diff --git a/dist/alks.min.js b/dist/alks.min.js index 51d89e23..e4282f3a 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:{encoding:"^0.1.13","node-fetch":"^2.6.1",tslib:"^2.3.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",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-polyfills":"^0.2.1","rollup-plugin-replace":"^2.2.0",sinon:"^10.0.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 y(){_=!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;_||y();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;_||y();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,Buffer:T,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return T.alloc(+(e=+e!=e?0:e))},isBuffer:ee,kMaxLength:R}));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 tt=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 rt(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!tt(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=it;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=ot;break;default:return void(this.write=nt)}this.charBuffer=new T(6),this.charReceived=0,this.charLength=0}function nt(e){return e.toString(this.encoding)}function it(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function ot(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}rt.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},rt.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},ht.ReadableState=ut;var st,at=(Ke(Ie)&&(Ie=""),st=(st="stream").toUpperCase(),Me[st]||(new RegExp("\\b"+st+"\\b","i").test(Ie)?Me[st]=function(){var e=function(e){if(!Ye(e)){for(var t=[],r=0;rt.highWaterMark&&(t.highWaterMark=(ct<=(r=e)?r=ct:(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 dt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(at("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?ve(pt,e):pt(e))}function pt(e){at("emit readable"),e.emit("readable"),mt(e)}function gt(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 wt(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return at("read: emitReadable",t.length,t.ended),(0===t.length&&t.ended?wt:dt)(this),null;if(0===(e=ft(e,t))&&t.ended)return 0===t.length&&wt(this),null;var n=t.needReadable;return at("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===rr&&"ms-stream"!==t._mode&&t.push(null)},Te(ir,St);var or=["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"];ir.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===or.indexOf(r)&&(this._headers[r]={name:e,value:t})},ir.prototype.getHeader=function(e){return this._headers[e.toLowerCase()].value},ir.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},ir.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!==Yt)return Yt;try{new f.Blob([new ArrayBuffer(1)]),Yt=!0}catch(e){Yt=!1}return Yt}()?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"},mr=ar-ur,br=Math.floor,wr=String.fromCharCode;function vr(e){throw new RangeError(yr[e])}function kr(e,t){var r=e.split("@"),n="";return 1br((sr-t)/(u=r+1))&&vr("overflow"),t+=(i-d)*u,d=i,g=0;gsr&&vr("overflow"),a==d){for(o=t,s=ar;!(o<(h=s<=p?ur:p+hr<=s?hr:s-p));s+=ar)c.push(wr(Er(h+(l=o-h)%(h=ar-h),0))),o=br(l/h);c.push(wr(Er(o,0))),p=function(e,t,r){var n=0;for(e=r?br(e/cr):e>>1,e+=br(e/t);mr*hr>>1",'"',"`"," ","\r","\n","\t"]),zr=["'"].concat(xe),Ir=["%","/","?",";","#"].concat(zr),Mr=["/","?","#"],Ur=255,Br=/^[+a-z0-9A-Z_-]{0,63}$/,Nr=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Fr={javascript:!0,"javascript:":!0},Dr={javascript:!0,"javascript:":!0},Zr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function qr(e,t,r){if(e&&$e(e)&&e instanceof Lr)return e;var n=new Lr;return n.parse(e,t,r),n}function Hr(e,t,r,n){if(!Ye(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),o=-1!==i&&iUr?e.hostname="":e.hostname=e.hostname.toLowerCase(),c||(e.hostname=kr(e.hostname,function(e){return gr.test(e)?"xn--"+Rr(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(!Fr[S])for(d=0,p=zr.length;d>>7)]}function Fn(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Dn(e,t,r){e.bi_valid>mn-r?(e.bi_buf|=t<>mn-e.bi_valid,e.bi_valid+=r-mn):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function Hn(e,t,r){for(var n,i=new Array(yn+1),o=0,s=1;s<=yn;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]=qn(i[a]++,a))}}function Yn(e){for(var t=0;t>1;1<=r;r--)$n(e,o,r);for(i=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],$n(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++,$n(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<=yn;g++)e.bl_count[g]=0;for(a[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<_n;r++)d<(g=a[2*a[2*(n=e.heap[r])+1]+1]+1)&&(g=d,p++),a[2*n+1]=g,u>=7;o>=8,e.bi_valid-=8)}function ni(e,t,r,n){var i,o,s=0;0>>=1)if(1&t&&0!==e.dyn_ltree[2*r])return nn;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return on;for(r=32;r>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?ti(e,t,r,n):e.strategy===rn||o===i?(Dn(e,(hn<<1)+(n?1:0),3),Gn(e,xn,On)):(Dn(e,(ln<<1)+(n?1:0),3),function(e,t,r,n){var i;for(Dn(e,t-257,5),Dn(e,r-1,5),Dn(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*(Cn[r]+fn+1)]++,e.dyn_dtree[2*Nn(t)]++),e.last_lit===e.lit_bufsize-1}function oi(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 ai(e,t,r,n){var i=si,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}var ui=0,hi=1,li=3,ci=4,fi=5,di=0,pi=1,gi=-2,_i=-3,yi=-5,mi=-1,bi=1,wi=2,vi=3,ki=4,Ei=2,Ri=8,Ai=9,Si=286,Ti=30,xi=19,Oi=2*Si+1,Li=15,Ci=3,Pi=258,ji=Pi+Ci+1,zi=32,Ii=42,Mi=69,Ui=73,Bi=91,Ni=103,Fi=113,Di=666,Zi=1,qi=2,Hi=3,Yi=4,Ki=3;function Wi(e,t){return e.msg=Vr[t],t}function $i(e){return(e<<1)-(4e.avail_out?e.avail_out:r)&&(Jr(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 Xi(e,t){ni(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Vi(e.strm)}function Ji(e,t){e.pending_buf[e.pending++]=t}function Qi(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function eo(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-ji?e.strstart-(e.w_size-ji):0,h=e.window,l=e.w_mask,c=e.prev,f=e.strstart+Pi,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 to(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-ji)){for(Jr(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=Ci)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<=Ci&&(e.ins_h=(e.ins_h<=Ci)if(n=ii(e,e.strstart-e.match_start,e.match_length-Ci),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Ci){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=Ci&&(e.ins_h=(e.ins_h<=Ci&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-Ci,n=ii(e,e.strstart-1-e.prev_match,e.prev_length-Ci),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<>8&255),Ji(r,r.gzhead.time>>16&255),Ji(r,r.gzhead.time>>24&255),Ji(r,9===r.level?2:r.strategy>=wi||r.level<2?4:0),Ji(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Ji(r,255&r.gzhead.extra.length),Ji(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=ai(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Mi):(Ji(r,0),Ji(r,0),Ji(r,0),Ji(r,0),Ji(r,0),Ji(r,9===r.level?2:r.strategy>=wi||r.level<2?4:0),Ji(r,Ki),r.status=Fi)):(o=Ri+(r.w_bits-8<<4)<<8,o|=(r.strategy>=wi||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(o|=zi),o+=31-o%31,r.status=Fi,Qi(r,o),0!==r.strstart&&(Qi(r,e.adler>>>16),Qi(r,65535&e.adler)),e.adler=1)),r.status===Mi)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=ai(e.adler,r.pending_buf,r.pending-n,n)),Vi(e),n=r.pending,r.pending!==r.pending_buf_size));)Ji(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>n&&(e.adler=ai(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Ui)}else r.status=Ui;if(r.status===Ui)if(r.gzhead.name){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=ai(e.adler,r.pending_buf,r.pending-n,n)),Vi(e),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}}while(i=r.gzindexn&&(e.adler=ai(e.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.gzindex=0,r.status=Bi)}else r.status=Bi;if(r.status===Bi)if(r.gzhead.comment){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=ai(e.adler,r.pending_buf,r.pending-n,n)),Vi(e),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}}while(i=r.gzindexn&&(e.adler=ai(e.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.status=Ni)}else r.status=Ni;if(r.status===Ni&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Vi(e),r.pending+2<=r.pending_buf_size&&(Ji(r,255&e.adler),Ji(r,e.adler>>8&255),e.adler=0,r.status=Fi)):r.status=Fi),0!==r.pending){if(Vi(e),0===e.avail_out)return r.last_flush=-1,di}else if(0===e.avail_in&&$i(t)<=$i(s)&&t!==ci)return Wi(e,yi);if(r.status===Di&&0!==e.avail_in)return Wi(e,yi);if(0!==e.avail_in||0!==r.lookahead||t!==ui&&r.status!==Di){var s=r.strategy===wi?function(e,t){for(var r;;){if(0===e.lookahead&&(to(e),0===e.lookahead)){if(t===ui)return Zi;break}if(e.match_length=0,r=ii(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Xi(e,!1),0===e.strm.avail_out))return Zi}return e.insert=0,t===ci?(Xi(e,!0),0===e.strm.avail_out?Hi:Yi):e.last_lit&&(Xi(e,!1),0===e.strm.avail_out)?Zi:qi}(r,t):r.strategy===vi?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=Pi){if(to(e),e.lookahead<=Pi&&t===ui)return Zi;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=Ci&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Ci?(r=ii(e,1,e.match_length-Ci),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=ii(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Xi(e,!1),0===e.strm.avail_out))return Zi}return e.insert=0,t===ci?(Xi(e,!0),0===e.strm.avail_out?Hi:Yi):e.last_lit&&(Xi(e,!1),0===e.strm.avail_out)?Zi:qi}(r,t):uo[r.level].func(r,t);if(s!==Hi&&s!==Yi||(r.status=Di),s===Zi||s===Hi)return 0===e.avail_out&&(r.last_flush=-1),di;if(s===qi&&(t===hi?ri(r):t!==fi&&(ti(r,0,0,!1),t===li&&(Gi(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Vi(e),0===e.avail_out))return r.last_flush=-1,di}return t!==ci?di:r.wrap<=0?pi:(2===r.wrap?(Ji(r,255&e.adler),Ji(r,e.adler>>8&255),Ji(r,e.adler>>16&255),Ji(r,e.adler>>24&255),Ji(r,255&e.total_in),Ji(r,e.total_in>>8&255),Ji(r,e.total_in>>16&255),Ji(r,e.total_in>>24&255)):(Qi(r,e.adler>>>16),Qi(r,65535&e.adler)),Vi(e),0e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(to(e),0===e.lookahead&&t===ui)return Zi;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,Xi(e,!1),0===e.strm.avail_out))return Zi;if(e.strstart-e.block_start>=e.w_size-ji&&(Xi(e,!1),0===e.strm.avail_out))return Zi}return e.insert=0,t===ci?(Xi(e,!0),0===e.strm.avail_out?Hi:Yi):(e.strstart>e.block_start&&(Xi(e,!1),e.strm.avail_out),Zi)}),new io(4,4,8,4,ro),new io(4,5,16,8,ro),new io(4,6,32,32,ro),new io(4,4,16,16,no),new io(8,16,32,32,no),new io(8,16,128,128,no),new io(8,32,128,256,no),new io(32,128,258,1024,no),new io(32,258,258,4096,no)],ho=30,lo=12;var co=15,fo=852,po=592,go=0,_o=1,yo=2,mo=[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],bo=[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],wo=[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],vo=[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 ko(e,t,r,n,i,o,s,a){for(var u,h,l,c,f,d,p,g,_,y=a.bits,m=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 en(co+1),C=new en(co+1),P=null,j=0,m=0;m<=co;m++)L[m]=0;for(b=0;bd?(g=P[j+s[b]],x[O+s[b]]):(g=96,0),u=1<<(p=m-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[m]){if(m===v)break;m=t[r+s[b]]}if(k>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ms(){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 en(320),this.work=new en(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function bs(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=Uo,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new tn(gs),e.distcode=e.distdyn=new tn(_s),e.sane=1,e.back=-1,Oo):Po):Po}function ws(e,t){var r,n,i;return e?(r=new ms,(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=ai(r.check,P,2,0),l=h=0,r.mode=Bo;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=fs;break}if((15&h)!==Mo){e.msg="unknown compression method",r.mode=fs;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=fs;break}r.dmax=1<>8&1),512&r.flags&&(P[0]=255&h,P[1]=h>>>8&255,r.check=ai(r.check,P,2,0)),l=h=0,r.mode=No;case No:for(;l<32;){if(0===a)break e;a--,h+=n[o++]<>>8&255,P[2]=h>>>16&255,P[3]=h>>>24&255,r.check=ai(r.check,P,4,0)),l=h=0,r.mode=Fo;case Fo:for(;l<16;){if(0===a)break e;a--,h+=n[o++]<>8),512&r.flags&&(P[0]=255&h,P[1]=h>>>8&255,r.check=ai(r.check,P,2,0)),l=h=0,r.mode=Do;case Do:if(1024&r.flags){for(;l<16;){if(0===a)break e;a--,h+=n[o++]<>>8&255,r.check=ai(r.check,P,2,0)),l=h=0}else r.head&&(r.head.extra=null);r.mode=Zo;case Zo: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)),Jr(r.head.extra,n,o,d,k)),512&r.flags&&(r.check=ai(r.check,n,d,o)),a-=d,o+=d,r.length-=d),r.length))break e;r.length=0,r.mode=qo;case qo: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=$o;break;case Ko:for(;l<32;){if(0===a)break e;a--,h+=n[o++]<>>=7&l,l-=7&l,r.mode=hs;break}for(;l<3;){if(0===a)break e;a--,h+=n[o++]<>>=1)){case 0:r.mode=Vo;break;case 1:if(!function(e){if(Es){var t;for(vs=new tn(512),ks=new tn(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(ko(Ro,e.lens,0,288,vs,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ko(Ao,e.lens,0,32,ks,0,e.work,{bits:5}),Es=!1}e.lencode=vs,e.lenbits=9,e.distcode=ks,e.distbits=5}(r),r.mode=rs,t!==xo)break;h>>>=2,l-=2;break e;case 2:r.mode=Qo;break;case 3:e.msg="invalid block type",r.mode=fs}h>>>=2,l-=2;break;case Vo: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=fs;break}if(r.length=65535&h,l=h=0,r.mode=Xo,t===xo)break e;case Xo:r.mode=Jo;case Jo: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=ko(Eo,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,E){e.msg="invalid code lengths set",r.mode=fs;break}r.have=0,r.mode=ts;case ts:for(;r.have>>16&255,m=65535&C,!((_=C>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>>=_,l-=_,r.lens[r.have++]=m;else{if(16===m){for(A=_+2;l>>=_,l-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=fs;break}k=r.lens[r.have-1],d=3+(3&h),h>>>=2,l-=2}else if(17===m){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=fs;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===fs)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=fs;break}if(r.lenbits=9,R={bits:r.lenbits},E=ko(Ro,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,E){e.msg="invalid literal/lengths set",r.mode=fs;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},E=ko(Ao,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,E){e.msg="invalid distances set",r.mode=fs;break}if(r.mode=rs,t===xo)break e;case rs:r.mode=ns;case ns: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,y=u.wsize,m=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,m=65535&C,!((_=C>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>b)])>>>16&255,m=65535&C,!(b+(_=C>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>>=b,l-=b,r.back+=b}if(h>>>=_,l-=_,r.back+=_,r.length=m,0===y){r.mode=us;break}if(32&y){r.back=-1,r.mode=$o;break}if(64&y){e.msg="invalid literal/length code",r.mode=fs;break}r.extra=15&y,r.mode=is;case is:if(r.extra){for(A=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=os;case os:for(;y=(C=r.distcode[h&(1<>>16&255,m=65535&C,!((_=C>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>b)])>>>16&255,m=65535&C,!(b+(_=C>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>>=b,l-=b,r.back+=b}if(h>>>=_,l-=_,r.back+=_,64&y){e.msg="invalid distance code",r.mode=fs;break}r.offset=m,r.extra=15&y,r.mode=ss;case ss: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=fs;break}r.mode=as;case as: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=fs;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?(Jr(L.window,T,x-L.wsize,L.wsize,0),L.wnext=0,L.whave=L.wsize):(S=L.wsize-L.wnext,Jr(L.window,T,x-O,S=OCs.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsCs.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelCs.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelCs.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=Cs.Z_FILTERED&&e.strategy!=Cs.Z_HUFFMAN_ONLY&&e.strategy!=Cs.Z_RLE&&e.strategy!=Cs.Z_FIXED&&e.strategy!=Cs.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!T.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new Cs.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=Cs.codes[t],r.emit("error",e)};var n=Cs.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(n=e.level);t=Cs.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(t=e.strategy),this._binding.init(e.windowBits||Cs.Z_DEFAULT_WINDOWBITS,n,e.memLevel||Cs.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(Ps).forEach(function(e){Ps[Ps[e]]=e}),Te(Zs,Dt),Zs.prototype.params=function(e,t,r){if(eCs.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=Cs.Z_FILTERED&&t!=Cs.Z_HUFFMAN_ONLY&&t!=Cs.Z_RLE&&t!=Cs.Z_FIXED&&t!=Cs.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);var n;this._level!==e||this._strategy!==t?(n=this).flush(Cs.Z_SYNC_FLUSH,function(){n._binding.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())}):je.nextTick(r)},Zs.prototype.reset=function(){return this._binding.reset()},Zs.prototype._flush=function(e){this._transform(new T(0),"",e)},Zs.prototype.flush=function(e,t){var r,n=this._writableState;"function"!=typeof e&&(void 0!==e||t)||(t=e,e=Cs.Z_FULL_FLUSH),n.ended?t&&je.nextTick(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))},Zs.prototype.close=function(e){var t;e&&je.nextTick(e),this._closed||(this._closed=!0,this._binding.close(),t=this,je.nextTick(function(){t.emit("close")}))},Zs.prototype._transform=function(e,t,r){var n,i=this._writableState,o=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!T.isBuffer(e))return r(new Error("invalid input"));o?n=Cs.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||Cs.Z_NO_FLUSH)),this._processChunk(e,n,r)},Zs.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},Te(Is,Zs),Te(Ms,Zs),Te(Us,Zs),Te(Bs,Zs),Te(Ns,Zs),Te(Fs,Zs),Te(Ds,Zs);var qs={codes:Ps,createDeflate:function(e){return new Is(e)},createInflate:function(e){return new Ms(e)},createDeflateRaw:function(e){return new Ns(e)},createInflateRaw:function(e){return new Fs(e)},createGzip:function(e){return new Us(e)},createGunzip:function(e){return new Bs(e)},createUnzip:function(e){return new Ds(e)},deflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Is(t),e,r)},deflateSync:function(e,t){return zs(new Is(t),e)},gzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Us(t),e,r)},gzipSync:function(e,t){return zs(new Us(t),e)},deflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Ns(t),e,r)},deflateRawSync:function(e,t){return zs(new Ns(t),e)},unzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Ds(t),e,r)},unzipSync:function(e,t){return zs(new Ds(t),e)},inflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Ms(t),e,r)},inflateSync:function(e,t){return zs(new Ms(t),e)},gunzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Bs(t),e,r)},gunzipSync:function(e,t){return zs(new Bs(t),e)},inflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Fs(t),e,r)},inflateRawSync:function(e,t){return zs(new Fs(t),e)},Deflate:Is,Inflate:Ms,Gzip:Us,Gunzip:Bs,DeflateRaw:Ns,InflateRaw:Fs,Unzip:Ds,Zlib:Zs};const Hs=Ht.Readable,Ys=Symbol("buffer"),Ks=Symbol("type");class Ws{constructor(){this[Ks]="";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 $s(`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 $s(`Could not create Buffer from response body for ${n.url}: ${e.message}`,"system",e))}}})})}function ea(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 ta(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 ra(e){var t,r;let n=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof Ht&&"function"!=typeof n.getBoundary&&(t=new Xs,r=new Xs,n.pipe(t),n.pipe(r),e[Vs].body=t,n=r),n}function na(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":ea(e)?"application/x-www-form-urlencoded;charset=UTF-8":ta(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 Ht?null:"text/plain;charset=UTF-8"}function ia(e){const t=e.body;return null===t?0:ta(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}Js.prototype={get body(){return this[Vs].body},get bodyUsed(){return this[Vs].disturbed},arrayBuffer(){return Qs.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 Qs.call(this).then(function(e){return Object.assign(new Ws([],{type:t.toLowerCase()}),{[Ys]:e})})},json(){var t=this;return Qs.call(this).then(function(e){try{return JSON.parse(e.toString())}catch(e){return Js.Promise.reject(new $s(`invalid json response body at ${t.url} reason: ${e.message}`,"invalid-json"))}})},text(){return Qs.call(this).then(function(e){return e.toString()})},buffer(){return Qs.call(this)},textConverted(){var t=this;return Qs.call(this).then(function(e){return function(e,t){if("function"!=typeof Gs)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 $s(`maximum redirect reached at: ${f.url}`,"max-redirect")),void g();const a={headers:new ca(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===ia(f)?(c(new $s("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(Oa(new Ra(n,a))),void g())}}e.once("end",function(){d&&d.removeEventListener("abort",_)});let i=e.pipe(new Ta);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 ma(i,o),void l(p);r={flush:qs.Z_SYNC_FLUSH,finishFlush:qs.Z_SYNC_FLUSH};if("gzip"==s||"x-gzip"==s)return i=i.pipe(qs.createGunzip(r)),p=new ma(i,o),void l(p);if("deflate"!=s&&"x-deflate"!=s){if("br"==s&&"function"==typeof qs.createBrotliDecompress)return i=i.pipe(qs.createBrotliDecompress()),p=new ma(i,o),void l(p);p=new ma(i,o),l(p)}else{const u=e.pipe(new Ta);u.once("data",function(e){i=8==(15&e[0])?i.pipe(qs.createInflate()):i.pipe(qs.createInflateRaw()),p=new ma(i,o),l(p)})}}),function(e,t){const r=t.body;null===r?e.end():ta(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(n,f)}})}Oa.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},Oa.Promise=t.Promise;var t=r(Object.freeze({__proto__:null,default:Oa,Headers:ca,Request:Ra,Response:ma,FetchError:$s})),La=h,Ca=La.__importStar(l),Pa=re;La.__importDefault(t);var ja=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(La.__assign(La.__assign({},this.config),e))},r.prototype.getAccounts=function(r){return La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){var t,r;return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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.getCostTotals=function(t){return La.__awaiter(this,void 0,void 0,function(){return La.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("costTotals/"+t.accountId,t,"GET")];case 1:return[2,o(e.sent().costTotals,["awsAccountId","yyyy","mm","dd","daily","weekly","monthly","yearly","dailyCostsByService","monthlyCostsByService"])]}})})},r.prototype.internalFetch=function(a,u,h){return void 0===u&&(u={}),void 0===h&&(h="POST"),La.__awaiter(this,void 0,void 0,function(){var t,r,n,i,o,s;return La.__generator(this,function(e){switch(e.label){case 0:return t=La.__assign(La.__assign({},this.config),u),s=La.__assign({},t),r={"Content-Type":"application/json","User-Agent":"AlksJS/"+Ca.version},void 0!==t.accessToken?(r.Authorization="Bearer "+t.accessToken,delete s.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 s.accessKey,delete s.secretKey,delete s.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 Pa.Buffer.from(e).toString("base64")}(t.userid+":"+t.password),r.Authorization="Basic "+n,delete s.userid,delete s.password),t.userAgent&&(r["User-Agent"]+=" "+t.userAgent,delete s.userAgent),[4,t._fetch(t.baseUrl+"/"+a,{method:h,headers:r,body:"GET"==h?void 0:JSON.stringify(s)})];case 1:i=e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,i.json()];case 3:return o=e.sent(),[3,5];case 4:return s=e.sent(),o={errors:[s.message]},[3,5];case 5:if(!i.ok)throw new l(i,o);return[2,o]}})})},r);function r(e){this.config=e}e.Alks=t;var i,l=(i=Error,La.__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=l;var s=t.prototype.create.call({},{_fetch:ja});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),e.getCostTotals=t.prototype.getCostTotals.bind(s)}(za=za||{});var za=za;e.default=za,Object.defineProperty(e,"__esModule",{value:!0}),Object.assign(e,za)}); +!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:{encoding:"^0.1.13","node-fetch":"^2.6.1",tslib:"^2.3.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",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-polyfills":"^0.2.1","rollup-plugin-replace":"^2.2.0",sinon:"^10.0.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 y(){_=!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;_||y();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;_||y();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,Buffer:T,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return T.alloc(+(e=+e!=e?0:e))},isBuffer:ee,kMaxLength:R}));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 tt=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 rt(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!tt(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=it;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=ot;break;default:return void(this.write=nt)}this.charBuffer=new T(6),this.charReceived=0,this.charLength=0}function nt(e){return e.toString(this.encoding)}function it(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function ot(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}rt.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},rt.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},ht.ReadableState=ut;var st,at=(Ke(Ie)&&(Ie=""),st=(st="stream").toUpperCase(),Me[st]||(new RegExp("\\b"+st+"\\b","i").test(Ie)?Me[st]=function(){var e=function(e){if(!Ye(e)){for(var t=[],r=0;rt.highWaterMark&&(t.highWaterMark=(ct<=(r=e)?r=ct:(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 dt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(at("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?ve(pt,e):pt(e))}function pt(e){at("emit readable"),e.emit("readable"),mt(e)}function gt(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 wt(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return at("read: emitReadable",t.length,t.ended),(0===t.length&&t.ended?wt:dt)(this),null;if(0===(e=ft(e,t))&&t.ended)return 0===t.length&&wt(this),null;var n=t.needReadable;return at("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===rr&&"ms-stream"!==t._mode&&t.push(null)},Te(ir,St);var or=["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"];ir.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===or.indexOf(r)&&(this._headers[r]={name:e,value:t})},ir.prototype.getHeader=function(e){return this._headers[e.toLowerCase()].value},ir.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},ir.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!==Yt)return Yt;try{new f.Blob([new ArrayBuffer(1)]),Yt=!0}catch(e){Yt=!1}return Yt}()?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"},mr=ar-ur,br=Math.floor,wr=String.fromCharCode;function vr(e){throw new RangeError(yr[e])}function kr(e,t){var r=e.split("@"),n="";return 1br((sr-t)/(u=r+1))&&vr("overflow"),t+=(i-d)*u,d=i,g=0;gsr&&vr("overflow"),a==d){for(o=t,s=ar;!(o<(h=s<=p?ur:p+hr<=s?hr:s-p));s+=ar)c.push(wr(Er(h+(l=o-h)%(h=ar-h),0))),o=br(l/h);c.push(wr(Er(o,0))),p=function(e,t,r){var n=0;for(e=r?br(e/cr):e>>1,e+=br(e/t);mr*hr>>1",'"',"`"," ","\r","\n","\t"]),zr=["'"].concat(xe),Ir=["%","/","?",";","#"].concat(zr),Mr=["/","?","#"],Ur=255,Br=/^[+a-z0-9A-Z_-]{0,63}$/,Nr=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Fr={javascript:!0,"javascript:":!0},Dr={javascript:!0,"javascript:":!0},Zr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function qr(e,t,r){if(e&&$e(e)&&e instanceof Lr)return e;var n=new Lr;return n.parse(e,t,r),n}function Hr(e,t,r,n){if(!Ye(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),o=-1!==i&&iUr?e.hostname="":e.hostname=e.hostname.toLowerCase(),c||(e.hostname=kr(e.hostname,function(e){return gr.test(e)?"xn--"+Rr(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(!Fr[S])for(d=0,p=zr.length;d>>7)]}function Fn(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Dn(e,t,r){e.bi_valid>mn-r?(e.bi_buf|=t<>mn-e.bi_valid,e.bi_valid+=r-mn):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function Hn(e,t,r){for(var n,i=new Array(yn+1),o=0,s=1;s<=yn;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]=qn(i[a]++,a))}}function Yn(e){for(var t=0;t>1;1<=r;r--)$n(e,o,r);for(i=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],$n(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++,$n(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<=yn;g++)e.bl_count[g]=0;for(a[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<_n;r++)d<(g=a[2*a[2*(n=e.heap[r])+1]+1]+1)&&(g=d,p++),a[2*n+1]=g,u>=7;o>=8,e.bi_valid-=8)}function ni(e,t,r,n){var i,o,s=0;0>>=1)if(1&t&&0!==e.dyn_ltree[2*r])return nn;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return on;for(r=32;r>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?ti(e,t,r,n):e.strategy===rn||o===i?(Dn(e,(hn<<1)+(n?1:0),3),Gn(e,xn,On)):(Dn(e,(ln<<1)+(n?1:0),3),function(e,t,r,n){var i;for(Dn(e,t-257,5),Dn(e,r-1,5),Dn(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*(Cn[r]+fn+1)]++,e.dyn_dtree[2*Nn(t)]++),e.last_lit===e.lit_bufsize-1}function oi(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 ai(e,t,r,n){var i=si,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}var ui=0,hi=1,li=3,ci=4,fi=5,di=0,pi=1,gi=-2,_i=-3,yi=-5,mi=-1,bi=1,wi=2,vi=3,ki=4,Ei=2,Ri=8,Ai=9,Si=286,Ti=30,xi=19,Oi=2*Si+1,Li=15,Ci=3,Pi=258,ji=Pi+Ci+1,zi=32,Ii=42,Mi=69,Ui=73,Bi=91,Ni=103,Fi=113,Di=666,Zi=1,qi=2,Hi=3,Yi=4,Ki=3;function Wi(e,t){return e.msg=Vr[t],t}function $i(e){return(e<<1)-(4e.avail_out?e.avail_out:r)&&(Jr(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 Xi(e,t){ni(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Vi(e.strm)}function Ji(e,t){e.pending_buf[e.pending++]=t}function Qi(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function eo(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-ji?e.strstart-(e.w_size-ji):0,h=e.window,l=e.w_mask,c=e.prev,f=e.strstart+Pi,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 to(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-ji)){for(Jr(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=Ci)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<=Ci&&(e.ins_h=(e.ins_h<=Ci)if(n=ii(e,e.strstart-e.match_start,e.match_length-Ci),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Ci){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=Ci&&(e.ins_h=(e.ins_h<=Ci&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-Ci,n=ii(e,e.strstart-1-e.prev_match,e.prev_length-Ci),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<>8&255),Ji(r,r.gzhead.time>>16&255),Ji(r,r.gzhead.time>>24&255),Ji(r,9===r.level?2:r.strategy>=wi||r.level<2?4:0),Ji(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Ji(r,255&r.gzhead.extra.length),Ji(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=ai(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Mi):(Ji(r,0),Ji(r,0),Ji(r,0),Ji(r,0),Ji(r,0),Ji(r,9===r.level?2:r.strategy>=wi||r.level<2?4:0),Ji(r,Ki),r.status=Fi)):(o=Ri+(r.w_bits-8<<4)<<8,o|=(r.strategy>=wi||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(o|=zi),o+=31-o%31,r.status=Fi,Qi(r,o),0!==r.strstart&&(Qi(r,e.adler>>>16),Qi(r,65535&e.adler)),e.adler=1)),r.status===Mi)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=ai(e.adler,r.pending_buf,r.pending-n,n)),Vi(e),n=r.pending,r.pending!==r.pending_buf_size));)Ji(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>n&&(e.adler=ai(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Ui)}else r.status=Ui;if(r.status===Ui)if(r.gzhead.name){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=ai(e.adler,r.pending_buf,r.pending-n,n)),Vi(e),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}}while(i=r.gzindexn&&(e.adler=ai(e.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.gzindex=0,r.status=Bi)}else r.status=Bi;if(r.status===Bi)if(r.gzhead.comment){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=ai(e.adler,r.pending_buf,r.pending-n,n)),Vi(e),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}}while(i=r.gzindexn&&(e.adler=ai(e.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.status=Ni)}else r.status=Ni;if(r.status===Ni&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Vi(e),r.pending+2<=r.pending_buf_size&&(Ji(r,255&e.adler),Ji(r,e.adler>>8&255),e.adler=0,r.status=Fi)):r.status=Fi),0!==r.pending){if(Vi(e),0===e.avail_out)return r.last_flush=-1,di}else if(0===e.avail_in&&$i(t)<=$i(s)&&t!==ci)return Wi(e,yi);if(r.status===Di&&0!==e.avail_in)return Wi(e,yi);if(0!==e.avail_in||0!==r.lookahead||t!==ui&&r.status!==Di){var s=r.strategy===wi?function(e,t){for(var r;;){if(0===e.lookahead&&(to(e),0===e.lookahead)){if(t===ui)return Zi;break}if(e.match_length=0,r=ii(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Xi(e,!1),0===e.strm.avail_out))return Zi}return e.insert=0,t===ci?(Xi(e,!0),0===e.strm.avail_out?Hi:Yi):e.last_lit&&(Xi(e,!1),0===e.strm.avail_out)?Zi:qi}(r,t):r.strategy===vi?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=Pi){if(to(e),e.lookahead<=Pi&&t===ui)return Zi;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=Ci&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Ci?(r=ii(e,1,e.match_length-Ci),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=ii(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Xi(e,!1),0===e.strm.avail_out))return Zi}return e.insert=0,t===ci?(Xi(e,!0),0===e.strm.avail_out?Hi:Yi):e.last_lit&&(Xi(e,!1),0===e.strm.avail_out)?Zi:qi}(r,t):uo[r.level].func(r,t);if(s!==Hi&&s!==Yi||(r.status=Di),s===Zi||s===Hi)return 0===e.avail_out&&(r.last_flush=-1),di;if(s===qi&&(t===hi?ri(r):t!==fi&&(ti(r,0,0,!1),t===li&&(Gi(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Vi(e),0===e.avail_out))return r.last_flush=-1,di}return t!==ci?di:r.wrap<=0?pi:(2===r.wrap?(Ji(r,255&e.adler),Ji(r,e.adler>>8&255),Ji(r,e.adler>>16&255),Ji(r,e.adler>>24&255),Ji(r,255&e.total_in),Ji(r,e.total_in>>8&255),Ji(r,e.total_in>>16&255),Ji(r,e.total_in>>24&255)):(Qi(r,e.adler>>>16),Qi(r,65535&e.adler)),Vi(e),0e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(to(e),0===e.lookahead&&t===ui)return Zi;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,Xi(e,!1),0===e.strm.avail_out))return Zi;if(e.strstart-e.block_start>=e.w_size-ji&&(Xi(e,!1),0===e.strm.avail_out))return Zi}return e.insert=0,t===ci?(Xi(e,!0),0===e.strm.avail_out?Hi:Yi):(e.strstart>e.block_start&&(Xi(e,!1),e.strm.avail_out),Zi)}),new io(4,4,8,4,ro),new io(4,5,16,8,ro),new io(4,6,32,32,ro),new io(4,4,16,16,no),new io(8,16,32,32,no),new io(8,16,128,128,no),new io(8,32,128,256,no),new io(32,128,258,1024,no),new io(32,258,258,4096,no)],ho=30,lo=12;var co=15,fo=852,po=592,go=0,_o=1,yo=2,mo=[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],bo=[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],wo=[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],vo=[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 ko(e,t,r,n,i,o,s,a){for(var u,h,l,c,f,d,p,g,_,y=a.bits,m=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 en(co+1),C=new en(co+1),P=null,j=0,m=0;m<=co;m++)L[m]=0;for(b=0;bd?(g=P[j+s[b]],x[O+s[b]]):(g=96,0),u=1<<(p=m-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[m]){if(m===v)break;m=t[r+s[b]]}if(k>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ms(){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 en(320),this.work=new en(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function bs(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=Uo,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new tn(gs),e.distcode=e.distdyn=new tn(_s),e.sane=1,e.back=-1,Oo):Po):Po}function ws(e,t){var r,n,i;return e?(r=new ms,(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=ai(r.check,P,2,0),l=h=0,r.mode=Bo;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=fs;break}if((15&h)!==Mo){e.msg="unknown compression method",r.mode=fs;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=fs;break}r.dmax=1<>8&1),512&r.flags&&(P[0]=255&h,P[1]=h>>>8&255,r.check=ai(r.check,P,2,0)),l=h=0,r.mode=No;case No:for(;l<32;){if(0===a)break e;a--,h+=n[o++]<>>8&255,P[2]=h>>>16&255,P[3]=h>>>24&255,r.check=ai(r.check,P,4,0)),l=h=0,r.mode=Fo;case Fo:for(;l<16;){if(0===a)break e;a--,h+=n[o++]<>8),512&r.flags&&(P[0]=255&h,P[1]=h>>>8&255,r.check=ai(r.check,P,2,0)),l=h=0,r.mode=Do;case Do:if(1024&r.flags){for(;l<16;){if(0===a)break e;a--,h+=n[o++]<>>8&255,r.check=ai(r.check,P,2,0)),l=h=0}else r.head&&(r.head.extra=null);r.mode=Zo;case Zo: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)),Jr(r.head.extra,n,o,d,k)),512&r.flags&&(r.check=ai(r.check,n,d,o)),a-=d,o+=d,r.length-=d),r.length))break e;r.length=0,r.mode=qo;case qo: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=$o;break;case Ko:for(;l<32;){if(0===a)break e;a--,h+=n[o++]<>>=7&l,l-=7&l,r.mode=hs;break}for(;l<3;){if(0===a)break e;a--,h+=n[o++]<>>=1)){case 0:r.mode=Vo;break;case 1:if(!function(e){if(Es){var t;for(vs=new tn(512),ks=new tn(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(ko(Ro,e.lens,0,288,vs,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ko(Ao,e.lens,0,32,ks,0,e.work,{bits:5}),Es=!1}e.lencode=vs,e.lenbits=9,e.distcode=ks,e.distbits=5}(r),r.mode=rs,t!==xo)break;h>>>=2,l-=2;break e;case 2:r.mode=Qo;break;case 3:e.msg="invalid block type",r.mode=fs}h>>>=2,l-=2;break;case Vo: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=fs;break}if(r.length=65535&h,l=h=0,r.mode=Xo,t===xo)break e;case Xo:r.mode=Jo;case Jo: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=ko(Eo,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,E){e.msg="invalid code lengths set",r.mode=fs;break}r.have=0,r.mode=ts;case ts:for(;r.have>>16&255,m=65535&C,!((_=C>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>>=_,l-=_,r.lens[r.have++]=m;else{if(16===m){for(A=_+2;l>>=_,l-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=fs;break}k=r.lens[r.have-1],d=3+(3&h),h>>>=2,l-=2}else if(17===m){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=fs;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===fs)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=fs;break}if(r.lenbits=9,R={bits:r.lenbits},E=ko(Ro,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,E){e.msg="invalid literal/lengths set",r.mode=fs;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},E=ko(Ao,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,E){e.msg="invalid distances set",r.mode=fs;break}if(r.mode=rs,t===xo)break e;case rs:r.mode=ns;case ns: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,y=u.wsize,m=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,m=65535&C,!((_=C>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>b)])>>>16&255,m=65535&C,!(b+(_=C>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>>=b,l-=b,r.back+=b}if(h>>>=_,l-=_,r.back+=_,r.length=m,0===y){r.mode=us;break}if(32&y){r.back=-1,r.mode=$o;break}if(64&y){e.msg="invalid literal/length code",r.mode=fs;break}r.extra=15&y,r.mode=is;case is:if(r.extra){for(A=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=os;case os:for(;y=(C=r.distcode[h&(1<>>16&255,m=65535&C,!((_=C>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>b)])>>>16&255,m=65535&C,!(b+(_=C>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>>=b,l-=b,r.back+=b}if(h>>>=_,l-=_,r.back+=_,64&y){e.msg="invalid distance code",r.mode=fs;break}r.offset=m,r.extra=15&y,r.mode=ss;case ss: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=fs;break}r.mode=as;case as: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=fs;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?(Jr(L.window,T,x-L.wsize,L.wsize,0),L.wnext=0,L.whave=L.wsize):(S=L.wsize-L.wnext,Jr(L.window,T,x-O,S=OCs.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsCs.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelCs.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelCs.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=Cs.Z_FILTERED&&e.strategy!=Cs.Z_HUFFMAN_ONLY&&e.strategy!=Cs.Z_RLE&&e.strategy!=Cs.Z_FIXED&&e.strategy!=Cs.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!T.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new Cs.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=Cs.codes[t],r.emit("error",e)};var n=Cs.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(n=e.level);t=Cs.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(t=e.strategy),this._binding.init(e.windowBits||Cs.Z_DEFAULT_WINDOWBITS,n,e.memLevel||Cs.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(Ps).forEach(function(e){Ps[Ps[e]]=e}),Te(Zs,Dt),Zs.prototype.params=function(e,t,r){if(eCs.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=Cs.Z_FILTERED&&t!=Cs.Z_HUFFMAN_ONLY&&t!=Cs.Z_RLE&&t!=Cs.Z_FIXED&&t!=Cs.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);var n;this._level!==e||this._strategy!==t?(n=this).flush(Cs.Z_SYNC_FLUSH,function(){n._binding.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())}):je.nextTick(r)},Zs.prototype.reset=function(){return this._binding.reset()},Zs.prototype._flush=function(e){this._transform(new T(0),"",e)},Zs.prototype.flush=function(e,t){var r,n=this._writableState;"function"!=typeof e&&(void 0!==e||t)||(t=e,e=Cs.Z_FULL_FLUSH),n.ended?t&&je.nextTick(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))},Zs.prototype.close=function(e){var t;e&&je.nextTick(e),this._closed||(this._closed=!0,this._binding.close(),t=this,je.nextTick(function(){t.emit("close")}))},Zs.prototype._transform=function(e,t,r){var n,i=this._writableState,o=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!T.isBuffer(e))return r(new Error("invalid input"));o?n=Cs.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||Cs.Z_NO_FLUSH)),this._processChunk(e,n,r)},Zs.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},Te(Is,Zs),Te(Ms,Zs),Te(Us,Zs),Te(Bs,Zs),Te(Ns,Zs),Te(Fs,Zs),Te(Ds,Zs);var qs={codes:Ps,createDeflate:function(e){return new Is(e)},createInflate:function(e){return new Ms(e)},createDeflateRaw:function(e){return new Ns(e)},createInflateRaw:function(e){return new Fs(e)},createGzip:function(e){return new Us(e)},createGunzip:function(e){return new Bs(e)},createUnzip:function(e){return new Ds(e)},deflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Is(t),e,r)},deflateSync:function(e,t){return zs(new Is(t),e)},gzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Us(t),e,r)},gzipSync:function(e,t){return zs(new Us(t),e)},deflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Ns(t),e,r)},deflateRawSync:function(e,t){return zs(new Ns(t),e)},unzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Ds(t),e,r)},unzipSync:function(e,t){return zs(new Ds(t),e)},inflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Ms(t),e,r)},inflateSync:function(e,t){return zs(new Ms(t),e)},gunzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Bs(t),e,r)},gunzipSync:function(e,t){return zs(new Bs(t),e)},inflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),js(new Fs(t),e,r)},inflateRawSync:function(e,t){return zs(new Fs(t),e)},Deflate:Is,Inflate:Ms,Gzip:Us,Gunzip:Bs,DeflateRaw:Ns,InflateRaw:Fs,Unzip:Ds,Zlib:Zs};const Hs=Ht.Readable,Ys=Symbol("buffer"),Ks=Symbol("type");class Ws{constructor(){this[Ks]="";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 $s(`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 $s(`Could not create Buffer from response body for ${n.url}: ${e.message}`,"system",e))}}})})}function ea(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 ta(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 ra(e){var t,r;let n=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof Ht&&"function"!=typeof n.getBoundary&&(t=new Xs,r=new Xs,n.pipe(t),n.pipe(r),e[Vs].body=t,n=r),n}function na(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":ea(e)?"application/x-www-form-urlencoded;charset=UTF-8":ta(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 Ht?null:"text/plain;charset=UTF-8"}function ia(e){const t=e.body;return null===t?0:ta(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}Js.prototype={get body(){return this[Vs].body},get bodyUsed(){return this[Vs].disturbed},arrayBuffer(){return Qs.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 Qs.call(this).then(function(e){return Object.assign(new Ws([],{type:t.toLowerCase()}),{[Ys]:e})})},json(){var t=this;return Qs.call(this).then(function(e){try{return JSON.parse(e.toString())}catch(e){return Js.Promise.reject(new $s(`invalid json response body at ${t.url} reason: ${e.message}`,"invalid-json"))}})},text(){return Qs.call(this).then(function(e){return e.toString()})},buffer(){return Qs.call(this)},textConverted(){var t=this;return Qs.call(this).then(function(e){return function(e,t){if("function"!=typeof Gs)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 $s(`maximum redirect reached at: ${f.url}`,"max-redirect")),void g();const a={headers:new ca(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===ia(f)?(c(new $s("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(Oa(new Ra(n,a))),void g())}}e.once("end",function(){d&&d.removeEventListener("abort",_)});let i=e.pipe(new Ta);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 ma(i,o),void l(p);r={flush:qs.Z_SYNC_FLUSH,finishFlush:qs.Z_SYNC_FLUSH};if("gzip"==s||"x-gzip"==s)return i=i.pipe(qs.createGunzip(r)),p=new ma(i,o),void l(p);if("deflate"!=s&&"x-deflate"!=s){if("br"==s&&"function"==typeof qs.createBrotliDecompress)return i=i.pipe(qs.createBrotliDecompress()),p=new ma(i,o),void l(p);p=new ma(i,o),l(p)}else{const u=e.pipe(new Ta);u.once("data",function(e){i=8==(15&e[0])?i.pipe(qs.createInflate()):i.pipe(qs.createInflateRaw()),p=new ma(i,o),l(p)})}}),function(e,t){const r=t.body;null===r?e.end():ta(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(n,f)}})}Oa.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},Oa.Promise=t.Promise;var t=r(Object.freeze({__proto__:null,default:Oa,Headers:ca,Request:Ra,Response:ma,FetchError:$s})),La=h,Ca=La.__importStar(l),Pa=re;La.__importDefault(t);var ja=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(La.__assign(La.__assign({},this.config),e))},r.prototype.getAccounts=function(r){return La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){var t;return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){var t,r;return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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 La.__awaiter(this,void 0,void 0,function(){return La.__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.getCostTotals=function(t){return La.__awaiter(this,void 0,void 0,function(){return La.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("costTotals/"+t.accountId,t,"GET")];case 1:return[2,o(e.sent().costTotals,["awsAccountId","yyyy","mm","dd","daily","weekly","monthly","yearly","dailyCostsByService","monthlyCostsByService"])]}})})},r.prototype.internalFetch=function(a,u,h){return void 0===u&&(u={}),void 0===h&&(h="POST"),La.__awaiter(this,void 0,void 0,function(){var t,r,n,i,o,s;return La.__generator(this,function(e){switch(e.label){case 0:return t=La.__assign(La.__assign({},this.config),u),s=La.__assign({},t),r={"Content-Type":"application/json","User-Agent":"AlksJS/"+Ca.version},void 0!==t.accessToken?(r.Authorization="Bearer "+t.accessToken,delete s.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 s.accessKey,delete s.secretKey,delete s.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 Pa.Buffer.from(e).toString("base64")}(t.userid+":"+t.password),r.Authorization="Basic "+n,delete s.userid,delete s.password),t.userAgent&&(r["User-Agent"]+=" "+t.userAgent,delete s.userAgent),[4,t._fetch(t.baseUrl+"/"+a,{method:h,headers:r,body:"GET"==h?void 0:JSON.stringify(s)})];case 1:i=e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,i.json()];case 3:return o=e.sent(),[3,5];case 4:return s=e.sent(),o={errors:[s.message]},[3,5];case 5:if(!i.ok)throw new l(i,o);return[2,o]}})})},r);function r(e){this.config=e}e.Alks=t;var i,l=(i=Error,La.__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=l;var s=t.prototype.create.call({},{_fetch:ja});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),e.getCostTotals=t.prototype.getCostTotals.bind(s)}(za=za||{});var za=za;e.default=za,Object.defineProperty(e,"__esModule",{value:!0}),Object.assign(e,za)}); diff --git a/dist/alks.umd.js b/dist/alks.umd.js index 80dc7f29..cb0feaa0 100644 --- a/dist/alks.umd.js +++ b/dist/alks.umd.js @@ -291,7 +291,7 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(tslib_es6); var name = "alks.js"; - var version$1 = "1.13.1"; + var version$1 = "1.13.2"; 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 0a66407c..03759c3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "alks.js", - "version": "1.13.1", + "version": "1.13.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "alks.js", - "version": "1.13.1", + "version": "1.13.2", "license": "MIT", "dependencies": { "encoding": "^0.1.13", diff --git a/package.json b/package.json index 8f0de12c..fc50a345 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "alks.js", - "version": "1.13.1", + "version": "1.13.2", "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",