You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

alks.js

Package Overview
Dependencies
Maintainers
7
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alks.js - npm Package Compare versions

Comparing version

to
2.14.0

2

dist/alks.min.js

@@ -1,1 +0,1 @@

((global,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((global="undefined"!=typeof globalThis?globalThis:global||self).alks={})})(this,function(t){var global=window||this;function e(r){var n;return r.__esModule?r:(n=Object.defineProperty({},"__esModule",{value:!0}),Object.keys(r).forEach(function(t){var e=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(n,t,e.get?e:{enumerable:!0,get:function(){return r[t]}})}),n)}var n=function(t,e){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}))(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o=function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function i(t,e){var r={};for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(r[o[n]]=t[o[n]]);return r}function M(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;0<=a;a--)(o=t[a])&&(s=(i<3?o(s):3<i?o(e,r,s):o(e,r))||s);return 3<i&&s&&Object.defineProperty(e,r,s),s}function L(r,n){return function(t,e){n(t,e,r)}}function C(t,e,r,n,o,i){function s(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,c=n.kind,u="getter"===c?"get":"setter"===c?"set":"value",t=!e&&t?n.static?t:t.prototype:null,l=e||(t?Object.getOwnPropertyDescriptor(t,n.name):{}),f=!1,h=r.length-1;0<=h;h--){var p,d={};for(p in n)d[p]="access"===p?{}:n[p];for(p in n.access)d.access[p]=n.access[p];d.addInitializer=function(t){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(t||null))};var y=(0,r[h])("accessor"===c?{get:l.get,set:l.set}:l[u],d);if("accessor"===c){if(void 0!==y){if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=s(y.get))&&(l.get=a),(a=s(y.set))&&(l.set=a),(a=s(y.init))&&o.unshift(a)}}else(a=s(y))&&("field"===c?o.unshift(a):l[u]=a)}t&&Object.defineProperty(t,n.name,l),f=!0}function D(t,e,r){for(var n=2<arguments.length,o=0;o<e.length;o++)r=n?e[o].call(t,r):e[o].call(t);return n?r:void 0}function F(t){return"symbol"==typeof t?t:"".concat(t)}function Y(t,e,r){return"symbol"==typeof e&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function N(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function K(t,s,a,c){return new(a=a||Promise)(function(r,e){function n(t){try{i(c.next(t))}catch(t){e(t)}}function o(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?r(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,o)}i((c=c.apply(t,s||[])).next())})}function G(n,o){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=t(0),u.throw=t(1),u.return=t(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function t(r){return function(t){var e=[r,t];if(i)throw new TypeError("Generator is already executing.");for(;c=u&&e[u=0]?0:c;)try{if(i=1,s&&(a=2&e[0]?s.return:e[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,e[1])).done)return a;switch(s=0,(e=a?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,s=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3]))c.label=e[1];else if(6===e[0]&&c.label<a[1])c.label=a[1],a=e;else{if(!(a&&c.label<a[2])){a[2]&&c.ops.pop(),c.trys.pop();continue}c.label=a[2],c.ops.push(e)}}e=o.call(n,c)}catch(t){e=[6,t],s=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}var s=Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&("get"in o?e.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){t[n=void 0===n?r:n]=e[r]};function z(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||s(e,t,r)}function a(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function W(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t}function J(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),o=0,e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n}function V(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||((n=n||Array.prototype.slice.call(e,0,o))[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}function f(t){return this instanceof f?(this.v=t,this):new f(t)}function q(t,e,r){var o,i,s;if(Symbol.asyncIterator)return o=r.apply(t,e||[]),i=[],s=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),n("next"),n("throw"),n("return",function(e){return function(t){return Promise.resolve(t).then(e,u)}}),s[Symbol.asyncIterator]=function(){return this},s;throw new TypeError("Symbol.asyncIterator is not defined.");function n(n,t){o[n]&&(s[n]=function(r){return new Promise(function(t,e){1<i.push([n,r,t,e])||a(n,r)})},t)&&(s[n]=t(s[n]))}function a(t,e){try{(r=o[t](e)).value instanceof f?Promise.resolve(r.value.v).then(c,u):l(i[0][2],r)}catch(t){l(i[0][3],t)}var r}function c(t){a("next",t)}function u(t){a("throw",t)}function l(t,e){t(e),i.shift(),i.length&&a(i[0][0],i[0][1])}}function H(n){var o,t={};return e("next"),e("throw",function(t){throw t}),e("return"),t[Symbol.iterator]=function(){return this},t;function e(e,r){t[e]=n[e]?function(t){return(o=!o)?{value:f(n[e](t)),done:!1}:r?r(t):t}:r}}function $(s){var t,e;if(Symbol.asyncIterator)return(t=s[Symbol.asyncIterator])?t.call(s):(s=a(s),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);throw new TypeError("Symbol.asyncIterator is not defined.");function r(i){e[i]=s[i]&&function(o){return new Promise(function(t,e){var r,n;o=s[i](o),r=t,t=e,n=o.done,e=o.value,Promise.resolve(e).then(function(t){r({value:t,done:n})},t)})}}}function Q(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var X=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},Z=function(t){return(Z=Object.getOwnPropertyNames||function(t){var e,r=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[r.length]=e);return r})(t)};function tt(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r=Z(t),n=0;n<r.length;n++)"default"!==r[n]&&s(e,t,r[n]);return X(e,t),e}function et(t){return t&&t.__esModule?t:{default:t}}function rt(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t===e&&n:e.has(t))return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t);throw new TypeError("Cannot read private member from an object whose class did not declare it")}function nt(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t===e&&o:e.has(t))return"a"===n?o.call(t,r):o?o.value=r:e.set(t,r),r;throw new TypeError("Cannot write private member to an object whose class did not declare it")}function ot(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}function it(t,e,r){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(o=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var st="function"==typeof SuppressedError?SuppressedError:function(t,e,r){r=new Error(r);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function at(r){function n(t){r.error=r.hasError?new st(t,r.error,"An error was suppressed during disposal."):t,r.hasError=!0}var o,i=0;return function e(){for(;o=r.stack.pop();)try{if(!o.async&&1===i)return i=0,r.stack.push(o),Promise.resolve().then(e);if(o.dispose){var t=o.dispose.call(o.value);if(o.async)return i|=2,Promise.resolve(t).then(e,function(t){return n(t),e()})}else i|=1}catch(t){n(t)}if(1===i)return r.hasError?Promise.reject(r.error):Promise.resolve();if(r.hasError)throw r.error}()}function ct(t,i){return"string"==typeof t&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,e,r,n,o){return e?i?".jsx":".js":!r||n&&o?r+n+"."+o.toLowerCase()+"js":t}):t}var u={__extends:r,__assign:o,__rest:i,__decorate:M,__param:L,__esDecorate:C,__runInitializers:D,__propKey:F,__setFunctionName:Y,__metadata:N,__awaiter:K,__generator:G,__createBinding:s,__exportStar:z,__values:a,__read:c,__spread:W,__spreadArrays:J,__spreadArray:V,__await:f,__asyncGenerator:q,__asyncDelegator:H,__asyncValues:$,__makeTemplateObject:Q,__importStar:tt,__importDefault:et,__classPrivateFieldGet:rt,__classPrivateFieldSet:nt,__classPrivateFieldIn:ot,__addDisposableResource:it,__disposeResources:at,__rewriteRelativeImportExtension:ct},u=e(Object.freeze({__proto__:null,__extends:r,get __assign(){return o},__rest:i,__decorate:M,__param:L,__esDecorate:C,__runInitializers:D,__propKey:F,__setFunctionName:Y,__metadata:N,__awaiter:K,__generator:G,__createBinding:s,__exportStar:z,__values:a,__read:c,__spread:W,__spreadArrays:J,__spreadArray:V,__await:f,__asyncGenerator:q,__asyncDelegator:H,__asyncValues:$,__makeTemplateObject:Q,__importStar:tt,__importDefault:et,__classPrivateFieldGet:rt,__classPrivateFieldSet:nt,__classPrivateFieldIn:ot,__addDisposableResource:it,__disposeResources:at,__rewriteRelativeImportExtension:ct,default:u})),l={name:"alks.js",version:"2.13.0",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",unpkg:"dist/alks.min.js",browser:"dist/alks.umd.js",module:"dist/alks.esm.js",scripts:{rmdirs:"rimraf dist lib",mkdirs:"mkdirp dist lib",clean:"npm run rmdirs && npm run mkdirs",rollup:"rollup -c rollup.config.js",minify:'uglifyjs -m reserved=["global"] -c < dist/alks.umd.js > dist/alks.min.js',build:"npm run clean && npm run compile && npm run rollup && npm run minify",lint:"prettier --write --no-error-on-unmatched-pattern {src,test}/**/*.{ts,js,json,md}",test:"npm run build && npm run lint && npm run mocha",mocha:"nyc mocha test/test.js",coverage:"nyc report --reporter=lcov --reporter=text",docs:"typedoc src/alks.ts",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:">=14.0.0"},dependencies:{encoding:"^0.1.13",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.14.9","@types/node-fetch":"^2.5.10",browserify:"^17.0.0",chai:"^4.3.4","chai-as-promised":"^7.1.1",eslint:"^7.25.0","eslint-plugin-jsdoc":"^4.1.1","fetch-mock":"^12.2.0",husky:"^6.0.0","lint-staged":"^11.0.0",mkdirp:"^1.0.4",mocha:"^10.0.0",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",typedoc:"^0.22.15",typescript:"^4.2.4","uglify-js":"^3.13.6"},prettier:{singleQuote:!0,semi:!0,arrowParens:"always",endOfLine:"lf",trailingComma:"es5"},"lint-staged":{"{src,test}/**/*.{js,ts,json,md}":["prettier --write"]}},global=void 0!==global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},h=[],p=[],ut="undefined"!=typeof Uint8Array?Uint8Array:Array,d=!1;function lt(){d=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)h[e]=t[e],p[t.charCodeAt(e)]=e;p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63}function ft(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(h[n>>18&63]+h[n>>12&63]+h[n>>6&63]+h[63&n]);return o.join("")}function ht(t){d||lt();for(var e,r=t.length,n=r%3,o="",i=[],s=0,a=r-n;s<a;s+=16383)i.push(ft(t,s,a<s+16383?a:s+16383));return 1==n?(e=t[r-1],o=(o+=h[e>>2])+h[e<<4&63]+"=="):2==n&&(e=(t[r-2]<<8)+t[r-1],o=(o=(o+=h[e>>10])+h[e>>4&63])+h[e<<2&63]+"="),i.push(o),i.join("")}function y(t,e,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,u=c>>1,l=-7,f=r?o-1:0,h=r?-1:1,o=t[e+f];for(f+=h,i=o&(1<<-l)-1,o>>=-l,l+=a;0<l;i=256*i+t[e+f],f+=h,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=n;0<l;s=256*s+t[e+f],f+=h,l-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(o?-1:1);s+=Math.pow(2,n),i-=u}return(o?-1:1)*s*Math.pow(2,i-n)}function pt(t,e,r,n,o,i){var s,a,c=8*i-o-1,u=(1<<c)-1,l=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,i=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(n=Math.pow(2,-s))<1&&(s--,n*=2),2<=(e+=1<=s+l?f/n:f*Math.pow(2,1-l))*n&&(s++,n/=2),u<=s+l?(a=0,s=u):1<=s+l?(a=(e*n-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));8<=o;t[r+h]=255&a,h+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;0<c;t[r+h]=255&s,h+=p,s/=256,c-=8);t[r+h-p]|=128*i}var dt={}.toString,yt=Array.isArray||function(t){return"[object Array]"==dt.call(t)},global=(w.TYPED_ARRAY_SUPPORT=void 0===global.TYPED_ARRAY_SUPPORT||global.TYPED_ARRAY_SUPPORT,g());function g(){return w.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function _(t,e){if(g()<e)throw new RangeError("Invalid typed array length");return w.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=w.prototype:(t=null===t?new w(e):t).length=e,t}function w(t,e,r){if(!(w.TYPED_ARRAY_SUPPORT||this instanceof w))return new w(t,e,r);if("number"!=typeof t)return gt(this,t,e,r);if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return v(this,t)}function gt(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var o=t,i=e,s=r;if(i.byteLength,s<0||i.byteLength<s)throw new RangeError("'offset' is out of bounds");if(i.byteLength<s+(n||0))throw new RangeError("'length' is out of bounds");return i=void 0===s&&void 0===n?new Uint8Array(i):void 0===n?new Uint8Array(i,s):new Uint8Array(i,s,n),w.TYPED_ARRAY_SUPPORT?(o=i).__proto__=w.prototype:o=b(o,i),o}if("string"!=typeof e){s=t,n=e;if(A(n))return i=0|m(n.length),0!==(s=_(s,i)).length&&n.copy(s,0,0,i),s;if(n){if("undefined"!=typeof ArrayBuffer&&n.buffer instanceof ArrayBuffer||"length"in n)return"number"!=typeof n.length||(t=>t!=t)(n.length)?_(s,0):b(s,n);if("Buffer"===n.type&&yt(n.data))return b(s,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}o=t,n=e,t=r;if(w.isEncoding(t="string"==typeof t&&""!==t?t:"utf8"))return e=0|wt(n,t),o=(n=(o=_(o,e)).write(n,t))!==e?o.slice(0,n):o;throw new TypeError('"encoding" must be a valid string encoding')}function _t(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function v(t,e){if(_t(e),t=_(t,e<0?0:0|m(e)),!w.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function b(t,e){var r=e.length<0?0:0|m(e.length);t=_(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function m(t){if(g()<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+g().toString(16)+" bytes");return 0|t}function A(t){return null!=t&&t._isBuffer}function wt(t,e){if(A(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;var r=(t="string"!=typeof t?""+t:t).length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return jt(t).length;default:if(n)return I(t).length;e=(""+e).toLowerCase(),n=!0}}function vt(t,e,r){var n,o=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":var i=this,s=e,a=r,c=i.length;(!a||a<0||c<a)&&(a=c);for(var u="",l=s=!s||s<0?0:s;l<a;++l)u+=(t=>t<16?"0"+t.toString(16):t.toString(16))(i[l]);return u;case"utf8":case"utf-8":return Tt(this,e,r);case"ascii":var f=this,c=e,h=r,p="";h=Math.min(f.length,h);for(var d=c;d<h;++d)p+=String.fromCharCode(127&f[d]);return p;case"latin1":case"binary":var y=this,s=e,g=r,_="";g=Math.min(y.length,g);for(var w=s;w<g;++w)_+=String.fromCharCode(y[w]);return _;case"base64":return v=this,n=r,0===(b=e)&&n===v.length?ht(v):ht(v.slice(b,n));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var v=e,b=r,m=this.slice(v,b),A="",R=0;R<m.length;R+=2)A+=String.fromCharCode(m[R]+256*m[R+1]);return A;default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function R(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function bt(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,(r=(r=isNaN(r)?o?0:t.length-1:r)<0?t.length+r:r)>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if(A(e="string"==typeof e?w.from(e,n):e))return 0===e.length?-1:mt(t,e,r,n,o);if("number"==typeof e)return e&=255,w.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,r):mt(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function mt(t,e,r,n,o){var i=1,s=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s/=i=2,a/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o)for(var u=-1,l=r;l<s;l++)if(c(t,l)===c(e,-1===u?0:l-u)){if(l-(u=-1===u?l:u)+1===a)return u*i}else-1!==u&&(l-=l-u),u=-1;else for(l=r=s<r+a?s-a:r;0<=l;l--){for(var f=!0,h=0;h<a;h++)if(c(t,l+h)!==c(e,h)){f=!1;break}if(f)return l}return-1}function At(t,e,r,n){return O((t=>{for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e})(e),t,r,n)}function Rt(t,e,r,n){return O(((t,e)=>{for(var r,n,o=[],i=0;i<t.length&&!((e-=2)<0);++i)r=t.charCodeAt(i),n=r>>8,o.push(r%256),o.push(n);return o})(e,t.length-r),t,r,n)}function Tt(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,c,u=t[o],l=null,f=239<u?4:223<u?3:191<u?2:1;if(o+f<=r)switch(f){case 1:u<128&&(l=u);break;case 2:128==(192&(i=t[o+1]))&&127<(c=(31&u)<<6|63&i)&&(l=c);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&2047<(c=(15&u)<<12|(63&i)<<6|63&s)&&(c<55296||57343<c)&&(l=c);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&65535<(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)&&c<1114112&&(l=c)}null===l?(l=65533,f=1):65535<l&&(n.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}var h=n,p=h.length;if(p<=Et)return String.fromCharCode.apply(String,h);for(var d="",y=0;y<p;)d+=String.fromCharCode.apply(String,h.slice(y,y+=Et));return d}w.poolSize=8192,w._augment=function(t){return t.__proto__=w.prototype,t},w.from=function(t,e,r){return gt(null,t,e,r)},w.TYPED_ARRAY_SUPPORT&&(w.prototype.__proto__=Uint8Array.prototype,w.__proto__=Uint8Array),w.alloc=function(t,e,r){return n=null,e=e,r=r,_t(t=t),!(t<=0)&&void 0!==e?"string"==typeof r?_(n,t).fill(e,r):_(n,t).fill(e):_(n,t);var n},w.allocUnsafe=function(t){return v(null,t)},w.allocUnsafeSlow=function(t){return v(null,t)},w.isBuffer=Ut,w.compare=function(t,e){if(!A(t)||!A(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},w.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},w.concat=function(t,e){if(!yt(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return w.alloc(0);if(void 0===e)for(o=e=0;o<t.length;++o)e+=t[o].length;for(var r=w.allocUnsafe(e),n=0,o=0;o<t.length;++o){var i=t[o];if(!A(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,n),n+=i.length}return r},w.byteLength=wt,w.prototype._isBuffer=!0,w.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)R(this,e,e+1);return this},w.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)R(this,e,e+3),R(this,e+1,e+2);return this},w.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)R(this,e,e+7),R(this,e+1,e+6),R(this,e+2,e+5),R(this,e+3,e+4);return this},w.prototype.toString=function(){var t=0|this.length;return 0==t?"":0===arguments.length?Tt(this,0,t):vt.apply(this,arguments)},w.prototype.equals=function(t){if(A(t))return this===t||0===w.compare(this,t);throw new TypeError("Argument must be a Buffer")},w.prototype.inspect=function(){var t="";return 0<this.length&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length)&&(t+=" ... "),"<Buffer "+t+">"},w.prototype.compare=function(t,e,r,n,o){if(!A(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),(e=void 0===e?0:e)<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&r<=e)return 0;if(o<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(i,s),c=this.slice(n,o),u=t.slice(e,r),l=0;l<a;++l)if(c[l]!==u[l]){i=c[l],s=u[l];break}return i<s?-1:s<i?1:0},w.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},w.prototype.indexOf=function(t,e,r){return bt(this,t,e,r,!0)},w.prototype.lastIndexOf=function(t,e,r){return bt(this,t,e,r,!1)},w.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||o<r)&&(r=o),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var i,s,a,c=!1;;)switch(n){case"hex":var u=this,l=t,f=e,h=r,p=(f=Number(f)||0,u.length-f);if((!h||p<(h=Number(h)))&&(h=p),(p=l.length)%2!=0)throw new TypeError("Invalid hex string");p/2<h&&(h=p/2);for(var d=0;d<h;++d){var y=parseInt(l.substr(2*d,2),16);if(isNaN(y))return d;u[f+d]=y}return d;case"utf8":case"utf-8":return p=e,a=r,O(I(t,(s=this).length-p),s,p,a);case"ascii":return At(this,t,e,r);case"latin1":case"binary":return At(this,t,e,r);case"base64":return s=this,a=e,i=r,O(jt(t),s,a,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rt(this,t,e,r);default:if(c)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),c=!0}},w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Et=4096;function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function E(t,e,r,n,o,i){if(!A(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<e||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function S(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function P(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function St(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Pt(t,e,r,n,o){return o||St(t,0,r,4),pt(t,e,r,n,23,4),r+4}function It(t,e,r,n,o){return o||St(t,0,r,8),pt(t,e,r,n,52,8),r+8}w.prototype.slice=function(t,e){var r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),e<t&&(e=t),w.TYPED_ARRAY_SUPPORT)(o=this.subarray(t,e)).__proto__=w.prototype;else for(var n=e-t,o=new w(n,void 0),i=0;i<n;++i)o[i]=this[i+t];return o},w.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},w.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;0<e&&(o*=256);)n+=this[t+--e]*o;return n},w.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},w.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},w.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},w.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},w.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},w.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return(o*=128)<=n&&(n-=Math.pow(2,8*e)),n},w.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,i=this[t+--n];0<n&&(o*=256);)i+=this[t+--n]*o;return(o*=128)<=i&&(i-=Math.pow(2,8*e)),i},w.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},w.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},w.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},w.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},w.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},w.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),y(this,t,!0,23,4)},w.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),y(this,t,!1,23,4)},w.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),y(this,t,!0,52,8)},w.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),y(this,t,!1,52,8)},w.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||E(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},w.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||E(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;0<=--o&&(i*=256);)this[e+o]=t/i&255;return e+r},w.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,1,255,0),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},w.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):S(this,t,e,!0),e+2},w.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):S(this,t,e,!1),e+2},w.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):P(this,t,e,!0),e+4},w.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},w.prototype.writeIntLE=function(t,e,r,n){t=+t,e|=0,n||E(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var o=0,i=1,s=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},w.prototype.writeIntBE=function(t,e,r,n){t=+t,e|=0,n||E(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var o=r-1,i=1,s=0;for(this[e+o]=255&t;0<=--o&&(i*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},w.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,1,127,-128),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&(t=t<0?255+t+1:t),e+1},w.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):S(this,t,e,!0),e+2},w.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):S(this,t,e,!1),e+2},w.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,4,2147483647,-2147483648),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):P(this,t,e,!0),e+4},w.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},w.prototype.writeFloatLE=function(t,e,r){return Pt(this,t,e,!0,r)},w.prototype.writeFloatBE=function(t,e,r){return Pt(this,t,e,!1,r)},w.prototype.writeDoubleLE=function(t,e,r){return It(this,t,e,!0,r)},w.prototype.writeDoubleBE=function(t,e,r){return It(this,t,e,!1,r)},w.prototype.copy=function(t,e,r,n){if(r=r||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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 o,i=(n=t.length-e<n-r?t.length-e+r:n)-r;if(this===t&&r<e&&e<n)for(o=i-1;0<=o;--o)t[o+e]=this[o+r];else if(i<1e3||!w.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},w.prototype.fill=function(t,e,r,n){if("string"==typeof t){var o;if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length&&(o=t.charCodeAt(0))<256&&(t=o),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!w.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(!(r<=e))if(e>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(a=e;a<r;++a)this[a]=t;else for(var i=A(t)?t:I(new w(t,n).toString()),s=i.length,a=0;a<r-e;++a)this[a+e]=i[a%s];return this};var Ot=/[^+\/0-9A-Za-z-_]/g;function I(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&r<57344){if(!o){if(56319<r){-1<(e-=3)&&i.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&i.push(239,191,189);continue}o=r;continue}if(r<56320){-1<(e-=3)&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&-1<(e-=3)&&i.push(239,191,189);if(o=null,r<128){if(--e<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function jt(t){var e=(t=>{var e;if((t=((e=t).trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(Ot,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t})(t);d||lt();var r,t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");for(var n="="===e[t-2]?2:"="===e[t-1]?1:0,o=new ut(3*t/4-n),i=0<n?t-4:t,s=0,a=0;a<i;a+=4)r=p[e.charCodeAt(a)]<<18|p[e.charCodeAt(a+1)]<<12|p[e.charCodeAt(a+2)]<<6|p[e.charCodeAt(a+3)],o[s++]=r>>16&255,o[s++]=r>>8&255,o[s++]=255&r;return 2==n?(r=p[e.charCodeAt(a)]<<2|p[e.charCodeAt(a+1)]>>4,o[s++]=255&r):1==n&&(r=p[e.charCodeAt(a)]<<10|p[e.charCodeAt(a+1)]<<4|p[e.charCodeAt(a+2)]>>2,o[s++]=r>>8&255,o[s++]=255&r),o}function O(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function Ut(t){return null!=t&&(!!t._isBuffer||kt(t)||"function"==typeof(t=t).readFloatLE&&"function"==typeof t.slice&&kt(t.slice(0,0)))}function kt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var j,global=e(Object.freeze({__proto__:null,Buffer:w,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return w.alloc(+(t=+t!=t?0:t))},isBuffer:Ut,kMaxLength:global})),U=u,xt=U.__importStar(l),Bt=global,u=window.fetch.bind(window),l=j=j||{},global=((global=l.TrustType||(l.TrustType={})).CrossAccount="Cross Account",global.InnerAccount="Inner Account",(global=l.PseudoBoolean||(l.PseudoBoolean={}))[global.True=1]="True",global[global.False=0]="False",k.prototype.create=function(t){return new k(U.__assign(U.__assign({},this.config),t))},k.prototype.getAccounts=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("getAccounts",r)];case 1:return e=t.sent(),[2,Object.keys(e.accountListRole).map(function(t){return{account:t,role:e.accountListRole[t][0].role,iamKeyActive:e.accountListRole[t][0].iamKeyActive,maxKeyDuration:e.accountListRole[t][0].maxKeyDuration,securityLevel:e.accountListRole[t][0].securityLevel,accountType:e.accountListRole[t][0].accountType,skypieaAccount:e.accountListRole[t][0].skypieaAccount}})]}})})},k.prototype.getKeys=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("getKeys",e)];case 1:return[2,B(t.sent(),["accessKey","secretKey","sessionToken","consoleURL","sessionTime","changeRequestNumber"])]}})})},k.prototype.getIAMKeys=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("getIAMKeys",e)];case 1:return[2,B(t.sent(),["accessKey","secretKey","sessionToken","consoleURL","sessionTime","changeRequestNumber"])]}})})},k.prototype.getAllAWSRoleTypes=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return e=r.getDynamicValues?"allAwsRoleTypes?getDynamicValues=true":"allAwsRoleTypes",[4,this.internalFetch(e,r,"GET")];case 1:return[2,t.sent().roleTypes]}})})},k.prototype.getAWSRoleTypes=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("getAWSRoleTypes",r)];case 1:return e=t.sent(),[2,JSON.parse(e.roleTypes)]}})})},k.prototype.getNonServiceAWSRoleTypes=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("getNonServiceAWSRoleTypes",r)];case 1:return e=t.sent(),[2,JSON.parse(e.roleTypes)]}})})},k.prototype.createRole=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return null!=r.roleType==(null!=r.trustPolicy)?[3,2]:[4,this.internalFetch("createRole",r)];case 1:return(e=t.sent()).denyArns=e.denyArns.split(","),[2,B(e,["roleArn","denyArns","instanceProfileArn","addedRoleToInstanceProfile","tags"])];case 2:throw new Error("Must include roleType or trustPolicy, but not both.")}})})},k.prototype.createNonServiceRole=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("createNonServiceRole",r)];case 1:return(e=t.sent()).denyArns=e.denyArns.split(","),[2,B(e,["roleArn","denyArns","instanceProfileArn","addedRoleToInstanceProfile","tags"])]}})})},k.prototype.awsAccountRoles=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("awsAccountRoles?account=".concat(e.account),e,"GET")];case 1:return[2,t.sent().awsRoleList]}})})},k.prototype.listAWSAccountRoles=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("listAWSAccountRoles",r)];case 1:return e=t.sent(),[2,JSON.parse(e.jsonAWSRoleList).map(function(t){return t.split("/").slice(-1)[0]})]}})})},k.prototype.getAccountRole=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("getAccountRole",r)];case 1:if((e=t.sent()).roleExists)return[2,U.__assign(U.__assign({},B(e,["roleArn","isMachineIdentity","tags","maxSessionDurationInSeconds"])),{instanceProfileArn:e.instanceProfileARN})];throw new Error("Role ".concat(r.roleName," does not exist in this account"))}})})},k.prototype.updateRole=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("role",r,"PATCH")];case 1:if((e=t.sent()).roleExists)return[2,U.__assign(U.__assign({},B(e,["roleArn","isMachineIdentity","tags"])),{instanceProfileArn:e.instanceProfileARN})];throw new Error("Role ".concat(r.roleName," does not exist in this account"))}})})},k.prototype.deleteRole=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("deleteRole",e)];case 1:return t.sent(),[2,!0]}})})},k.prototype.addRoleMachineIdentity=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("roleMachineIdentity",e)];case 1:return[2,B(t.sent(),["machineIdentityArn"])]}})})},k.prototype.deleteRoleMachineIdentity=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("roleMachineIdentity",e,"DELETE")];case 1:return[2,B(t.sent(),["machineIdentityArn"])]}})})},k.prototype.getUserAccess=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return e=r.accountId,[4,this.internalFetch("userAccess/".concat(e),r,"GET")];case 1:return[2,t.sent().users]}})})},k.prototype.getUserAccessByRole=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return e=r.accountId,[4,this.internalFetch("reports/users-by-role?accountId=".concat(e),r,"GET")];case 1:return[2,t.sent().users]}})})},k.prototype.getUserRoleAccess=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return e=r.accountId,[4,this.internalFetch("userAccess/roles/".concat(e),r)];case 1:return[2,t.sent().roles]}})})},k.prototype.getAccountOwners=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return e=r.accountId,[4,this.internalFetch("userAccess/owners/".concat(e),r,"GET")];case 1:return[2,t.sent().accountOwners]}})})},k.prototype.createAccessKeys=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("accessKeys",e)];case 1:return[2,B(t.sent(),["iamUserArn","accessKey","secretKey","addedIAMUserToGroup","tags"])]}})})},k.prototype.getIamUser=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("iam-users/id/".concat(e.account,"/").concat(e.iamUserName),e,"GET")];case 1:return[2,B(t.sent().item,["arn","accountId","userName","accessKey","tags"])]}})})},k.prototype.updateIamUser=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return delete(e=U.__assign(U.__assign({},r),{user:{tags:r.tags}})).tags,[4,this.internalFetch("iam-users/id/".concat(r.account,"/").concat(r.iamUserName),e,"PATCH")];case 1:return[2,B(t.sent().item,["arn","accountId","userName","accessKey","tags"])]}})})},k.prototype.deleteIAMUser=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("IAMUser",e,"DELETE")];case 1:return t.sent(),[2,!0]}})})},k.prototype.version=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("version",e,"GET")];case 1:return[2,B(t.sent(),["version"])]}})})},k.prototype.getLoginRole=function(n){return U.__awaiter(this,void 0,void 0,function(){var e,r;return U.__generator(this,function(t){switch(t.label){case 0:return e=n.accountId,r=n.role,[4,this.internalFetch("loginRoles/id/".concat(e,"/").concat(r),n,"GET")];case 1:return[2,B(t.sent().loginRole,["account","role","iamKeyActive","maxKeyDuration","securityLevel","accountType"])]}})})},k.prototype.getAccessToken=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("accessToken",e)];case 1:return[2,B(t.sent(),["accessToken","expiresIn"])]}})})},k.prototype.getRefreshTokens=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("refreshTokens",e,"GET")];case 1:return[2,t.sent().refreshTokens.map(function(t){return B(t,["clientId","id","userId","value"])})]}})})},k.prototype.revoke=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("revoke",e)];case 1:return[2,"Success"==t.sent().statusMessage]}})})},k.prototype.getCostTotals=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("costTotals/".concat(e.accountId),e,"GET")];case 1:return[2,B(t.sent().costTotals,["awsAccountId","yyyy","mm","dd","daily","weekly","monthly","yearly","dailyCostsByService","monthlyCostsByService"])]}})})},k.prototype.internalFetch=function(f,h,p){return void 0===h&&(h={}),void 0===p&&(p="POST"),U.__awaiter(this,void 0,void 0,function(){var e,r,n,o,i,s,a,c,u,l;return U.__generator(this,function(t){switch(t.label){case 0:if(e=U.__assign(U.__assign({},this.config),h),r=U.__assign({},e),n={"Content-Type":"application/json","User-Agent":"AlksJS/".concat(xt.version)},void 0!==e.accessToken?(n.Authorization="Bearer ".concat(e.accessToken),delete r.accessToken):void 0!==e.accessKey?(n["ALKS-STS-Access-Key"]=e.accessKey,n["ALKS-STS-Secret-Key"]=e.secretKey,n["ALKS-STS-Session-Token"]=e.sessionToken,delete r.accessKey,delete r.secretKey,delete r.sessionToken):void 0!==e.userid&&(console.error("The userid and password properties are deprecated and should be replaced with an access token"),l=(t=>(void 0===t&&(t=""),Bt.Buffer.from(t).toString("base64")))("".concat(e.userid,":").concat(e.password)),n.Authorization="Basic ".concat(l),delete r.userid,delete r.password),e.userAgent&&(n["User-Agent"]+=" ".concat(e.userAgent),delete r.userAgent),e.headers){for(o=0,i=Object.entries(e.headers);o<i.length;o++)s=i[o],a=s[0],n[a]=s[1];delete r.headers}return[4,e._fetch("".concat(e.baseUrl,"/").concat(f),{method:p,headers:n,credentials:"omit",body:"GET"==p?void 0:JSON.stringify(r)})];case 1:c=t.sent(),t.label=2;case 2:return t.trys.push([2,4,,5]),[4,c.json()];case 3:return u=t.sent(),[3,5];case 4:return l=t.sent(),u={errors:[l.message]},[3,5];case 5:if(c.ok)return[2,u];throw new Mt(c,u)}})})},k);function k(t){this.config=t}l.Alks=global,x=Error,U.__extends(Lt,x);var x,Mt=Lt;function Lt(t,e){var r=this,n=Array.isArray(null==e?void 0:e.errors)?e.errors:[],n=(t.statusText&&n.unshift(t.statusText),n.join("; "));return(r=x.call(this,n)||this).status=t.status,r.message=n,Object.assign(r,e),r}function B(r,t){return t.reduce(function(t,e){return t[e]=r[e],t},{})}l.AlksError=Mt;u=global.prototype.create.call({},{_fetch:u}),l.create=global.prototype.create.bind(u),l.getAccounts=global.prototype.getAccounts.bind(u),l.getKeys=global.prototype.getKeys.bind(u),l.getIAMKeys=global.prototype.getIAMKeys.bind(u),l.getAllAWSRoleTypes=global.prototype.getAllAWSRoleTypes.bind(u),l.getAWSRoleTypes=global.prototype.getAWSRoleTypes.bind(u),l.getNonServiceAWSRoleTypes=global.prototype.getNonServiceAWSRoleTypes.bind(u),l.createRole=global.prototype.createRole.bind(u),l.createNonServiceRole=global.prototype.createNonServiceRole.bind(u),l.awsAccountRoles=global.prototype.awsAccountRoles.bind(u),l.listAWSAccountRoles=global.prototype.listAWSAccountRoles.bind(u),l.getAccountRole=global.prototype.getAccountRole.bind(u),l.updateRole=global.prototype.updateRole.bind(u),l.deleteRole=global.prototype.deleteRole.bind(u),l.addRoleMachineIdentity=global.prototype.addRoleMachineIdentity.bind(u),l.deleteRoleMachineIdentity=global.prototype.deleteRoleMachineIdentity.bind(u),l.getUserAccess=global.prototype.getUserAccess.bind(u),l.getUserAccessByRole=global.prototype.getUserAccessByRole.bind(u),l.getUserRoleAccess=global.prototype.getUserRoleAccess.bind(u),l.getAccountOwners=global.prototype.getAccountOwners.bind(u),l.createAccessKeys=global.prototype.createAccessKeys.bind(u),l.getIamUser=global.prototype.getIamUser.bind(u),l.updateIamUser=global.prototype.updateIamUser.bind(u),l.deleteIAMUser=global.prototype.deleteIAMUser.bind(u),l.version=global.prototype.version.bind(u),l.getLoginRole=global.prototype.getLoginRole.bind(u),l.getAccessToken=global.prototype.getAccessToken.bind(u),l.getRefreshTokens=global.prototype.getRefreshTokens.bind(u),l.revoke=global.prototype.revoke.bind(u),l.getCostTotals=global.prototype.getCostTotals.bind(u),l=j;t.default=l,Object.defineProperty(t,"__esModule",{value:!0}),Object.assign(t,l)});
((global,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((global="undefined"!=typeof globalThis?globalThis:global||self).alks={})})(this,function(t){var global=window||this;function e(r){var n;return r.__esModule?r:(n=Object.defineProperty({},"__esModule",{value:!0}),Object.keys(r).forEach(function(t){var e=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(n,t,e.get?e:{enumerable:!0,get:function(){return r[t]}})}),n)}var n=function(t,e){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}))(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o=function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function i(t,e){var r={};for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(r[o[n]]=t[o[n]]);return r}function M(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;0<=a;a--)(o=t[a])&&(s=(i<3?o(s):3<i?o(e,r,s):o(e,r))||s);return 3<i&&s&&Object.defineProperty(e,r,s),s}function L(r,n){return function(t,e){n(t,e,r)}}function C(t,e,r,n,o,i){function s(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,c=n.kind,u="getter"===c?"get":"setter"===c?"set":"value",t=!e&&t?n.static?t:t.prototype:null,l=e||(t?Object.getOwnPropertyDescriptor(t,n.name):{}),f=!1,h=r.length-1;0<=h;h--){var p,d={};for(p in n)d[p]="access"===p?{}:n[p];for(p in n.access)d.access[p]=n.access[p];d.addInitializer=function(t){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(t||null))};var y=(0,r[h])("accessor"===c?{get:l.get,set:l.set}:l[u],d);if("accessor"===c){if(void 0!==y){if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=s(y.get))&&(l.get=a),(a=s(y.set))&&(l.set=a),(a=s(y.init))&&o.unshift(a)}}else(a=s(y))&&("field"===c?o.unshift(a):l[u]=a)}t&&Object.defineProperty(t,n.name,l),f=!0}function D(t,e,r){for(var n=2<arguments.length,o=0;o<e.length;o++)r=n?e[o].call(t,r):e[o].call(t);return n?r:void 0}function F(t){return"symbol"==typeof t?t:"".concat(t)}function Y(t,e,r){return"symbol"==typeof e&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function N(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function K(t,s,a,c){return new(a=a||Promise)(function(r,e){function n(t){try{i(c.next(t))}catch(t){e(t)}}function o(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?r(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,o)}i((c=c.apply(t,s||[])).next())})}function G(n,o){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=t(0),u.throw=t(1),u.return=t(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function t(r){return function(t){var e=[r,t];if(i)throw new TypeError("Generator is already executing.");for(;c=u&&e[u=0]?0:c;)try{if(i=1,s&&(a=2&e[0]?s.return:e[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,e[1])).done)return a;switch(s=0,(e=a?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,s=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3]))c.label=e[1];else if(6===e[0]&&c.label<a[1])c.label=a[1],a=e;else{if(!(a&&c.label<a[2])){a[2]&&c.ops.pop(),c.trys.pop();continue}c.label=a[2],c.ops.push(e)}}e=o.call(n,c)}catch(t){e=[6,t],s=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}var s=Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&("get"in o?e.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){t[n=void 0===n?r:n]=e[r]};function z(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||s(e,t,r)}function a(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function W(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t}function J(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),o=0,e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n}function V(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||((n=n||Array.prototype.slice.call(e,0,o))[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}function f(t){return this instanceof f?(this.v=t,this):new f(t)}function q(t,e,r){var o,i,s;if(Symbol.asyncIterator)return o=r.apply(t,e||[]),i=[],s=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),n("next"),n("throw"),n("return",function(e){return function(t){return Promise.resolve(t).then(e,u)}}),s[Symbol.asyncIterator]=function(){return this},s;throw new TypeError("Symbol.asyncIterator is not defined.");function n(n,t){o[n]&&(s[n]=function(r){return new Promise(function(t,e){1<i.push([n,r,t,e])||a(n,r)})},t)&&(s[n]=t(s[n]))}function a(t,e){try{(r=o[t](e)).value instanceof f?Promise.resolve(r.value.v).then(c,u):l(i[0][2],r)}catch(t){l(i[0][3],t)}var r}function c(t){a("next",t)}function u(t){a("throw",t)}function l(t,e){t(e),i.shift(),i.length&&a(i[0][0],i[0][1])}}function H(n){var o,t={};return e("next"),e("throw",function(t){throw t}),e("return"),t[Symbol.iterator]=function(){return this},t;function e(e,r){t[e]=n[e]?function(t){return(o=!o)?{value:f(n[e](t)),done:!1}:r?r(t):t}:r}}function $(s){var t,e;if(Symbol.asyncIterator)return(t=s[Symbol.asyncIterator])?t.call(s):(s=a(s),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);throw new TypeError("Symbol.asyncIterator is not defined.");function r(i){e[i]=s[i]&&function(o){return new Promise(function(t,e){var r,n;o=s[i](o),r=t,t=e,n=o.done,e=o.value,Promise.resolve(e).then(function(t){r({value:t,done:n})},t)})}}}function Q(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var X=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},Z=function(t){return(Z=Object.getOwnPropertyNames||function(t){var e,r=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[r.length]=e);return r})(t)};function tt(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r=Z(t),n=0;n<r.length;n++)"default"!==r[n]&&s(e,t,r[n]);return X(e,t),e}function et(t){return t&&t.__esModule?t:{default:t}}function rt(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t===e&&n:e.has(t))return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t);throw new TypeError("Cannot read private member from an object whose class did not declare it")}function nt(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t===e&&o:e.has(t))return"a"===n?o.call(t,r):o?o.value=r:e.set(t,r),r;throw new TypeError("Cannot write private member to an object whose class did not declare it")}function ot(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}function it(t,e,r){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(o=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var st="function"==typeof SuppressedError?SuppressedError:function(t,e,r){r=new Error(r);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function at(r){function n(t){r.error=r.hasError?new st(t,r.error,"An error was suppressed during disposal."):t,r.hasError=!0}var o,i=0;return function e(){for(;o=r.stack.pop();)try{if(!o.async&&1===i)return i=0,r.stack.push(o),Promise.resolve().then(e);if(o.dispose){var t=o.dispose.call(o.value);if(o.async)return i|=2,Promise.resolve(t).then(e,function(t){return n(t),e()})}else i|=1}catch(t){n(t)}if(1===i)return r.hasError?Promise.reject(r.error):Promise.resolve();if(r.hasError)throw r.error}()}function ct(t,i){return"string"==typeof t&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,e,r,n,o){return e?i?".jsx":".js":!r||n&&o?r+n+"."+o.toLowerCase()+"js":t}):t}var u={__extends:r,__assign:o,__rest:i,__decorate:M,__param:L,__esDecorate:C,__runInitializers:D,__propKey:F,__setFunctionName:Y,__metadata:N,__awaiter:K,__generator:G,__createBinding:s,__exportStar:z,__values:a,__read:c,__spread:W,__spreadArrays:J,__spreadArray:V,__await:f,__asyncGenerator:q,__asyncDelegator:H,__asyncValues:$,__makeTemplateObject:Q,__importStar:tt,__importDefault:et,__classPrivateFieldGet:rt,__classPrivateFieldSet:nt,__classPrivateFieldIn:ot,__addDisposableResource:it,__disposeResources:at,__rewriteRelativeImportExtension:ct},u=e(Object.freeze({__proto__:null,__extends:r,get __assign(){return o},__rest:i,__decorate:M,__param:L,__esDecorate:C,__runInitializers:D,__propKey:F,__setFunctionName:Y,__metadata:N,__awaiter:K,__generator:G,__createBinding:s,__exportStar:z,__values:a,__read:c,__spread:W,__spreadArrays:J,__spreadArray:V,__await:f,__asyncGenerator:q,__asyncDelegator:H,__asyncValues:$,__makeTemplateObject:Q,__importStar:tt,__importDefault:et,__classPrivateFieldGet:rt,__classPrivateFieldSet:nt,__classPrivateFieldIn:ot,__addDisposableResource:it,__disposeResources:at,__rewriteRelativeImportExtension:ct,default:u})),l={name:"alks.js",version:"2.14.0",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",unpkg:"dist/alks.min.js",browser:"dist/alks.umd.js",module:"dist/alks.esm.js",scripts:{rmdirs:"rimraf dist lib",mkdirs:"mkdirp dist lib",clean:"npm run rmdirs && npm run mkdirs",rollup:"rollup -c rollup.config.js",minify:'uglifyjs -m reserved=["global"] -c < dist/alks.umd.js > dist/alks.min.js',build:"npm run clean && npm run compile && npm run rollup && npm run minify",lint:"prettier --write --no-error-on-unmatched-pattern {src,test}/**/*.{ts,js,json,md}",test:"npm run build && npm run lint && npm run mocha",mocha:"nyc mocha test/test.js",coverage:"nyc report --reporter=lcov --reporter=text",docs:"typedoc src/alks.ts",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:">=14.0.0"},dependencies:{encoding:"^0.1.13",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.14.9","@types/node-fetch":"^2.5.10",browserify:"^17.0.0",chai:"^4.3.4","chai-as-promised":"^7.1.1",eslint:"^7.25.0","eslint-plugin-jsdoc":"^4.1.1","fetch-mock":"^12.2.0",husky:"^6.0.0","lint-staged":"^11.0.0",mkdirp:"^1.0.4",mocha:"^10.0.0",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",typedoc:"^0.22.15",typescript:"^4.2.4","uglify-js":"^3.13.6"},prettier:{singleQuote:!0,semi:!0,arrowParens:"always",endOfLine:"lf",trailingComma:"es5"},"lint-staged":{"{src,test}/**/*.{js,ts,json,md}":["prettier --write"]}},global=void 0!==global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},h=[],p=[],ut="undefined"!=typeof Uint8Array?Uint8Array:Array,d=!1;function lt(){d=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)h[e]=t[e],p[t.charCodeAt(e)]=e;p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63}function ft(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(h[n>>18&63]+h[n>>12&63]+h[n>>6&63]+h[63&n]);return o.join("")}function ht(t){d||lt();for(var e,r=t.length,n=r%3,o="",i=[],s=0,a=r-n;s<a;s+=16383)i.push(ft(t,s,a<s+16383?a:s+16383));return 1==n?(e=t[r-1],o=(o+=h[e>>2])+h[e<<4&63]+"=="):2==n&&(e=(t[r-2]<<8)+t[r-1],o=(o=(o+=h[e>>10])+h[e>>4&63])+h[e<<2&63]+"="),i.push(o),i.join("")}function y(t,e,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,u=c>>1,l=-7,f=r?o-1:0,h=r?-1:1,o=t[e+f];for(f+=h,i=o&(1<<-l)-1,o>>=-l,l+=a;0<l;i=256*i+t[e+f],f+=h,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=n;0<l;s=256*s+t[e+f],f+=h,l-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(o?-1:1);s+=Math.pow(2,n),i-=u}return(o?-1:1)*s*Math.pow(2,i-n)}function pt(t,e,r,n,o,i){var s,a,c=8*i-o-1,u=(1<<c)-1,l=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,i=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(n=Math.pow(2,-s))<1&&(s--,n*=2),2<=(e+=1<=s+l?f/n:f*Math.pow(2,1-l))*n&&(s++,n/=2),u<=s+l?(a=0,s=u):1<=s+l?(a=(e*n-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));8<=o;t[r+h]=255&a,h+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;0<c;t[r+h]=255&s,h+=p,s/=256,c-=8);t[r+h-p]|=128*i}var dt={}.toString,yt=Array.isArray||function(t){return"[object Array]"==dt.call(t)},global=(w.TYPED_ARRAY_SUPPORT=void 0===global.TYPED_ARRAY_SUPPORT||global.TYPED_ARRAY_SUPPORT,g());function g(){return w.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function _(t,e){if(g()<e)throw new RangeError("Invalid typed array length");return w.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=w.prototype:(t=null===t?new w(e):t).length=e,t}function w(t,e,r){if(!(w.TYPED_ARRAY_SUPPORT||this instanceof w))return new w(t,e,r);if("number"!=typeof t)return gt(this,t,e,r);if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return v(this,t)}function gt(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var o=t,i=e,s=r;if(i.byteLength,s<0||i.byteLength<s)throw new RangeError("'offset' is out of bounds");if(i.byteLength<s+(n||0))throw new RangeError("'length' is out of bounds");return i=void 0===s&&void 0===n?new Uint8Array(i):void 0===n?new Uint8Array(i,s):new Uint8Array(i,s,n),w.TYPED_ARRAY_SUPPORT?(o=i).__proto__=w.prototype:o=b(o,i),o}if("string"!=typeof e){s=t,n=e;if(A(n))return i=0|m(n.length),0!==(s=_(s,i)).length&&n.copy(s,0,0,i),s;if(n){if("undefined"!=typeof ArrayBuffer&&n.buffer instanceof ArrayBuffer||"length"in n)return"number"!=typeof n.length||(t=>t!=t)(n.length)?_(s,0):b(s,n);if("Buffer"===n.type&&yt(n.data))return b(s,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}o=t,n=e,t=r;if(w.isEncoding(t="string"==typeof t&&""!==t?t:"utf8"))return e=0|wt(n,t),o=(n=(o=_(o,e)).write(n,t))!==e?o.slice(0,n):o;throw new TypeError('"encoding" must be a valid string encoding')}function _t(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function v(t,e){if(_t(e),t=_(t,e<0?0:0|m(e)),!w.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function b(t,e){var r=e.length<0?0:0|m(e.length);t=_(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function m(t){if(g()<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+g().toString(16)+" bytes");return 0|t}function A(t){return null!=t&&t._isBuffer}function wt(t,e){if(A(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;var r=(t="string"!=typeof t?""+t:t).length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return jt(t).length;default:if(n)return I(t).length;e=(""+e).toLowerCase(),n=!0}}function vt(t,e,r){var n,o=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":var i=this,s=e,a=r,c=i.length;(!a||a<0||c<a)&&(a=c);for(var u="",l=s=!s||s<0?0:s;l<a;++l)u+=(t=>t<16?"0"+t.toString(16):t.toString(16))(i[l]);return u;case"utf8":case"utf-8":return Tt(this,e,r);case"ascii":var f=this,c=e,h=r,p="";h=Math.min(f.length,h);for(var d=c;d<h;++d)p+=String.fromCharCode(127&f[d]);return p;case"latin1":case"binary":var y=this,s=e,g=r,_="";g=Math.min(y.length,g);for(var w=s;w<g;++w)_+=String.fromCharCode(y[w]);return _;case"base64":return v=this,n=r,0===(b=e)&&n===v.length?ht(v):ht(v.slice(b,n));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var v=e,b=r,m=this.slice(v,b),A="",R=0;R<m.length;R+=2)A+=String.fromCharCode(m[R]+256*m[R+1]);return A;default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function R(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function bt(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,(r=(r=isNaN(r)?o?0:t.length-1:r)<0?t.length+r:r)>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if(A(e="string"==typeof e?w.from(e,n):e))return 0===e.length?-1:mt(t,e,r,n,o);if("number"==typeof e)return e&=255,w.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,r):mt(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function mt(t,e,r,n,o){var i=1,s=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s/=i=2,a/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o)for(var u=-1,l=r;l<s;l++)if(c(t,l)===c(e,-1===u?0:l-u)){if(l-(u=-1===u?l:u)+1===a)return u*i}else-1!==u&&(l-=l-u),u=-1;else for(l=r=s<r+a?s-a:r;0<=l;l--){for(var f=!0,h=0;h<a;h++)if(c(t,l+h)!==c(e,h)){f=!1;break}if(f)return l}return-1}function At(t,e,r,n){return O((t=>{for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e})(e),t,r,n)}function Rt(t,e,r,n){return O(((t,e)=>{for(var r,n,o=[],i=0;i<t.length&&!((e-=2)<0);++i)r=t.charCodeAt(i),n=r>>8,o.push(r%256),o.push(n);return o})(e,t.length-r),t,r,n)}function Tt(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,c,u=t[o],l=null,f=239<u?4:223<u?3:191<u?2:1;if(o+f<=r)switch(f){case 1:u<128&&(l=u);break;case 2:128==(192&(i=t[o+1]))&&127<(c=(31&u)<<6|63&i)&&(l=c);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&2047<(c=(15&u)<<12|(63&i)<<6|63&s)&&(c<55296||57343<c)&&(l=c);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&65535<(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)&&c<1114112&&(l=c)}null===l?(l=65533,f=1):65535<l&&(n.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}var h=n,p=h.length;if(p<=Et)return String.fromCharCode.apply(String,h);for(var d="",y=0;y<p;)d+=String.fromCharCode.apply(String,h.slice(y,y+=Et));return d}w.poolSize=8192,w._augment=function(t){return t.__proto__=w.prototype,t},w.from=function(t,e,r){return gt(null,t,e,r)},w.TYPED_ARRAY_SUPPORT&&(w.prototype.__proto__=Uint8Array.prototype,w.__proto__=Uint8Array),w.alloc=function(t,e,r){return n=null,e=e,r=r,_t(t=t),!(t<=0)&&void 0!==e?"string"==typeof r?_(n,t).fill(e,r):_(n,t).fill(e):_(n,t);var n},w.allocUnsafe=function(t){return v(null,t)},w.allocUnsafeSlow=function(t){return v(null,t)},w.isBuffer=Ut,w.compare=function(t,e){if(!A(t)||!A(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},w.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},w.concat=function(t,e){if(!yt(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return w.alloc(0);if(void 0===e)for(o=e=0;o<t.length;++o)e+=t[o].length;for(var r=w.allocUnsafe(e),n=0,o=0;o<t.length;++o){var i=t[o];if(!A(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,n),n+=i.length}return r},w.byteLength=wt,w.prototype._isBuffer=!0,w.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)R(this,e,e+1);return this},w.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)R(this,e,e+3),R(this,e+1,e+2);return this},w.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)R(this,e,e+7),R(this,e+1,e+6),R(this,e+2,e+5),R(this,e+3,e+4);return this},w.prototype.toString=function(){var t=0|this.length;return 0==t?"":0===arguments.length?Tt(this,0,t):vt.apply(this,arguments)},w.prototype.equals=function(t){if(A(t))return this===t||0===w.compare(this,t);throw new TypeError("Argument must be a Buffer")},w.prototype.inspect=function(){var t="";return 0<this.length&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length)&&(t+=" ... "),"<Buffer "+t+">"},w.prototype.compare=function(t,e,r,n,o){if(!A(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),(e=void 0===e?0:e)<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&r<=e)return 0;if(o<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(i,s),c=this.slice(n,o),u=t.slice(e,r),l=0;l<a;++l)if(c[l]!==u[l]){i=c[l],s=u[l];break}return i<s?-1:s<i?1:0},w.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},w.prototype.indexOf=function(t,e,r){return bt(this,t,e,r,!0)},w.prototype.lastIndexOf=function(t,e,r){return bt(this,t,e,r,!1)},w.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||o<r)&&(r=o),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var i,s,a,c=!1;;)switch(n){case"hex":var u=this,l=t,f=e,h=r,p=(f=Number(f)||0,u.length-f);if((!h||p<(h=Number(h)))&&(h=p),(p=l.length)%2!=0)throw new TypeError("Invalid hex string");p/2<h&&(h=p/2);for(var d=0;d<h;++d){var y=parseInt(l.substr(2*d,2),16);if(isNaN(y))return d;u[f+d]=y}return d;case"utf8":case"utf-8":return p=e,a=r,O(I(t,(s=this).length-p),s,p,a);case"ascii":return At(this,t,e,r);case"latin1":case"binary":return At(this,t,e,r);case"base64":return s=this,a=e,i=r,O(jt(t),s,a,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rt(this,t,e,r);default:if(c)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),c=!0}},w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Et=4096;function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function E(t,e,r,n,o,i){if(!A(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<e||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function S(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function P(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function St(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Pt(t,e,r,n,o){return o||St(t,0,r,4),pt(t,e,r,n,23,4),r+4}function It(t,e,r,n,o){return o||St(t,0,r,8),pt(t,e,r,n,52,8),r+8}w.prototype.slice=function(t,e){var r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),e<t&&(e=t),w.TYPED_ARRAY_SUPPORT)(o=this.subarray(t,e)).__proto__=w.prototype;else for(var n=e-t,o=new w(n,void 0),i=0;i<n;++i)o[i]=this[i+t];return o},w.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},w.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;0<e&&(o*=256);)n+=this[t+--e]*o;return n},w.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},w.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},w.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},w.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},w.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},w.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return(o*=128)<=n&&(n-=Math.pow(2,8*e)),n},w.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,i=this[t+--n];0<n&&(o*=256);)i+=this[t+--n]*o;return(o*=128)<=i&&(i-=Math.pow(2,8*e)),i},w.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},w.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},w.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},w.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},w.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},w.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),y(this,t,!0,23,4)},w.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),y(this,t,!1,23,4)},w.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),y(this,t,!0,52,8)},w.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),y(this,t,!1,52,8)},w.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||E(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},w.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||E(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;0<=--o&&(i*=256);)this[e+o]=t/i&255;return e+r},w.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,1,255,0),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},w.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):S(this,t,e,!0),e+2},w.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):S(this,t,e,!1),e+2},w.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):P(this,t,e,!0),e+4},w.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},w.prototype.writeIntLE=function(t,e,r,n){t=+t,e|=0,n||E(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var o=0,i=1,s=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},w.prototype.writeIntBE=function(t,e,r,n){t=+t,e|=0,n||E(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var o=r-1,i=1,s=0;for(this[e+o]=255&t;0<=--o&&(i*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},w.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,1,127,-128),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&(t=t<0?255+t+1:t),e+1},w.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):S(this,t,e,!0),e+2},w.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):S(this,t,e,!1),e+2},w.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,4,2147483647,-2147483648),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):P(this,t,e,!0),e+4},w.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||E(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},w.prototype.writeFloatLE=function(t,e,r){return Pt(this,t,e,!0,r)},w.prototype.writeFloatBE=function(t,e,r){return Pt(this,t,e,!1,r)},w.prototype.writeDoubleLE=function(t,e,r){return It(this,t,e,!0,r)},w.prototype.writeDoubleBE=function(t,e,r){return It(this,t,e,!1,r)},w.prototype.copy=function(t,e,r,n){if(r=r||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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 o,i=(n=t.length-e<n-r?t.length-e+r:n)-r;if(this===t&&r<e&&e<n)for(o=i-1;0<=o;--o)t[o+e]=this[o+r];else if(i<1e3||!w.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},w.prototype.fill=function(t,e,r,n){if("string"==typeof t){var o;if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length&&(o=t.charCodeAt(0))<256&&(t=o),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!w.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(!(r<=e))if(e>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(a=e;a<r;++a)this[a]=t;else for(var i=A(t)?t:I(new w(t,n).toString()),s=i.length,a=0;a<r-e;++a)this[a+e]=i[a%s];return this};var Ot=/[^+\/0-9A-Za-z-_]/g;function I(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&r<57344){if(!o){if(56319<r){-1<(e-=3)&&i.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&i.push(239,191,189);continue}o=r;continue}if(r<56320){-1<(e-=3)&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&-1<(e-=3)&&i.push(239,191,189);if(o=null,r<128){if(--e<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function jt(t){var e=(t=>{var e;if((t=((e=t).trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(Ot,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t})(t);d||lt();var r,t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");for(var n="="===e[t-2]?2:"="===e[t-1]?1:0,o=new ut(3*t/4-n),i=0<n?t-4:t,s=0,a=0;a<i;a+=4)r=p[e.charCodeAt(a)]<<18|p[e.charCodeAt(a+1)]<<12|p[e.charCodeAt(a+2)]<<6|p[e.charCodeAt(a+3)],o[s++]=r>>16&255,o[s++]=r>>8&255,o[s++]=255&r;return 2==n?(r=p[e.charCodeAt(a)]<<2|p[e.charCodeAt(a+1)]>>4,o[s++]=255&r):1==n&&(r=p[e.charCodeAt(a)]<<10|p[e.charCodeAt(a+1)]<<4|p[e.charCodeAt(a+2)]>>2,o[s++]=r>>8&255,o[s++]=255&r),o}function O(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function Ut(t){return null!=t&&(!!t._isBuffer||kt(t)||"function"==typeof(t=t).readFloatLE&&"function"==typeof t.slice&&kt(t.slice(0,0)))}function kt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var j,global=e(Object.freeze({__proto__:null,Buffer:w,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return w.alloc(+(t=+t!=t?0:t))},isBuffer:Ut,kMaxLength:global})),U=u,xt=U.__importStar(l),Bt=global,u=window.fetch.bind(window),l=j=j||{},global=((global=l.TrustType||(l.TrustType={})).CrossAccount="Cross Account",global.InnerAccount="Inner Account",(global=l.PseudoBoolean||(l.PseudoBoolean={}))[global.True=1]="True",global[global.False=0]="False",k.prototype.create=function(t){return new k(U.__assign(U.__assign({},this.config),t))},k.prototype.getAccounts=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("getAccounts",r)];case 1:return e=t.sent(),[2,Object.keys(e.accountListRole).map(function(t){return{account:t,role:e.accountListRole[t][0].role,iamKeyActive:e.accountListRole[t][0].iamKeyActive,maxKeyDuration:e.accountListRole[t][0].maxKeyDuration,securityLevel:e.accountListRole[t][0].securityLevel,accountType:e.accountListRole[t][0].accountType,skypieaAccount:e.accountListRole[t][0].skypieaAccount}})]}})})},k.prototype.getKeys=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("getKeys",e)];case 1:return[2,B(t.sent(),["accessKey","secretKey","sessionToken","consoleURL","sessionTime","changeRequestNumber"])]}})})},k.prototype.getIAMKeys=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("getIAMKeys",e)];case 1:return[2,B(t.sent(),["accessKey","secretKey","sessionToken","consoleURL","sessionTime","changeRequestNumber"])]}})})},k.prototype.getAllAWSRoleTypes=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return e=r.getDynamicValues?"allAwsRoleTypes?getDynamicValues=true":"allAwsRoleTypes",[4,this.internalFetch(e,r,"GET")];case 1:return[2,t.sent().roleTypes]}})})},k.prototype.getAWSRoleTypes=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("getAWSRoleTypes",r)];case 1:return e=t.sent(),[2,JSON.parse(e.roleTypes)]}})})},k.prototype.getNonServiceAWSRoleTypes=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("getNonServiceAWSRoleTypes",r)];case 1:return e=t.sent(),[2,JSON.parse(e.roleTypes)]}})})},k.prototype.createRole=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return null!=r.roleType==(null!=r.trustPolicy)?[3,2]:[4,this.internalFetch("createRole",r)];case 1:return(e=t.sent()).denyArns=e.denyArns.split(","),[2,B(e,["roleArn","denyArns","instanceProfileArn","addedRoleToInstanceProfile","tags"])];case 2:throw new Error("Must include roleType or trustPolicy, but not both.")}})})},k.prototype.createNonServiceRole=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("createNonServiceRole",r)];case 1:return(e=t.sent()).denyArns=e.denyArns.split(","),[2,B(e,["roleArn","denyArns","instanceProfileArn","addedRoleToInstanceProfile","tags"])]}})})},k.prototype.awsAccountRoles=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("awsAccountRoles?account=".concat(e.account),e,"GET")];case 1:return[2,t.sent().awsRoleList]}})})},k.prototype.listAWSAccountRoles=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("listAWSAccountRoles",r)];case 1:return e=t.sent(),[2,JSON.parse(e.jsonAWSRoleList).map(function(t){return t.split("/").slice(-1)[0]})]}})})},k.prototype.getAccountRole=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("getAccountRole",r)];case 1:if((e=t.sent()).roleExists)return[2,U.__assign(U.__assign({},B(e,["roleArn","isMachineIdentity","tags","maxSessionDurationInSeconds"])),{instanceProfileArn:e.instanceProfileARN})];throw new Error("Role ".concat(r.roleName," does not exist in this account"))}})})},k.prototype.updateRole=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("role",r,"PATCH")];case 1:if((e=t.sent()).roleExists)return[2,U.__assign(U.__assign({},B(e,["roleArn","isMachineIdentity","tags"])),{instanceProfileArn:e.instanceProfileARN})];throw new Error("Role ".concat(r.roleName," does not exist in this account"))}})})},k.prototype.deleteRole=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("deleteRole",e)];case 1:return t.sent(),[2,!0]}})})},k.prototype.addRoleMachineIdentity=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("roleMachineIdentity",e)];case 1:return[2,B(t.sent(),["machineIdentityArn"])]}})})},k.prototype.deleteRoleMachineIdentity=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("roleMachineIdentity",e,"DELETE")];case 1:return[2,B(t.sent(),["machineIdentityArn"])]}})})},k.prototype.getUserAccess=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return e=r.accountId,[4,this.internalFetch("userAccess/".concat(e),r,"GET")];case 1:return[2,t.sent().users]}})})},k.prototype.getUserAccessByRole=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return e=r.accountId,[4,this.internalFetch("reports/users-by-role?accountId=".concat(e),r,"GET")];case 1:return[2,t.sent().users]}})})},k.prototype.getUserRoleAccess=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return e=r.accountId,[4,this.internalFetch("userAccess/roles/".concat(e),r)];case 1:return[2,t.sent().roles]}})})},k.prototype.getAccountOwners=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return e=r.accountId,[4,this.internalFetch("userAccess/owners/".concat(e),r,"GET")];case 1:return[2,t.sent().accountOwners]}})})},k.prototype.createAccessKeys=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("accessKeys",e)];case 1:return[2,B(t.sent(),["iamUserArn","accessKey","secretKey","addedIAMUserToGroup","tags"])]}})})},k.prototype.getIamUser=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("iam-users/id/".concat(e.account,"/").concat(e.iamUserName),e,"GET")];case 1:return[2,B(t.sent().item,["arn","accountId","userName","accessKey","tags"])]}})})},k.prototype.updateIamUser=function(r){return U.__awaiter(this,void 0,void 0,function(){var e;return U.__generator(this,function(t){switch(t.label){case 0:return delete(e=U.__assign(U.__assign({},r),{user:{tags:r.tags}})).tags,[4,this.internalFetch("iam-users/id/".concat(r.account,"/").concat(r.iamUserName),e,"PATCH")];case 1:return[2,B(t.sent().item,["arn","accountId","userName","accessKey","tags"])]}})})},k.prototype.deleteIAMUser=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("IAMUser",e,"DELETE")];case 1:return t.sent(),[2,!0]}})})},k.prototype.version=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("version",e,"GET")];case 1:return[2,B(t.sent(),["version"])]}})})},k.prototype.getLoginRole=function(n){return U.__awaiter(this,void 0,void 0,function(){var e,r;return U.__generator(this,function(t){switch(t.label){case 0:return e=n.accountId,r=n.role,[4,this.internalFetch("loginRoles/id/".concat(e,"/").concat(r),n,"GET")];case 1:return[2,B(t.sent().loginRole,["account","role","iamKeyActive","maxKeyDuration","securityLevel","accountType"])]}})})},k.prototype.getAccessToken=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("accessToken",e)];case 1:return[2,B(t.sent(),["accessToken","expiresIn"])]}})})},k.prototype.getRefreshTokens=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("refreshTokens",e,"GET")];case 1:return[2,t.sent().refreshTokens.map(function(t){return B(t,["clientId","id","userId","value"])})]}})})},k.prototype.revoke=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("revoke",e)];case 1:return[2,"Success"==t.sent().statusMessage]}})})},k.prototype.getCostTotals=function(e){return U.__awaiter(this,void 0,void 0,function(){return U.__generator(this,function(t){switch(t.label){case 0:return[4,this.internalFetch("costTotals/".concat(e.accountId),e,"GET")];case 1:return[2,B(t.sent().costTotals,["awsAccountId","yyyy","mm","dd","daily","weekly","monthly","yearly","dailyCostsByService","monthlyCostsByService"])]}})})},k.prototype.internalFetch=function(f,h,p){return void 0===h&&(h={}),void 0===p&&(p="POST"),U.__awaiter(this,void 0,void 0,function(){var e,r,n,o,i,s,a,c,u,l;return U.__generator(this,function(t){switch(t.label){case 0:if(e=U.__assign(U.__assign({},this.config),h),r=U.__assign({},e),n={"Content-Type":"application/json","User-Agent":"AlksJS/".concat(xt.version)},void 0!==e.accessToken?(n.Authorization="Bearer ".concat(e.accessToken),delete r.accessToken):void 0!==e.accessKey?(n["ALKS-STS-Access-Key"]=e.accessKey,n["ALKS-STS-Secret-Key"]=e.secretKey,n["ALKS-STS-Session-Token"]=e.sessionToken,delete r.accessKey,delete r.secretKey,delete r.sessionToken):void 0!==e.userid&&(console.error("The userid and password properties are deprecated and should be replaced with an access token"),l=(t=>(void 0===t&&(t=""),Bt.Buffer.from(t).toString("base64")))("".concat(e.userid,":").concat(e.password)),n.Authorization="Basic ".concat(l),delete r.userid,delete r.password),e.userAgent&&(n["User-Agent"]+=" ".concat(e.userAgent),delete r.userAgent),e.headers){for(o=0,i=Object.entries(e.headers);o<i.length;o++)s=i[o],a=s[0],n[a]=s[1];delete r.headers}return[4,e._fetch("".concat(e.baseUrl,"/").concat(f),{method:p,headers:n,credentials:"omit",body:"GET"==p?void 0:JSON.stringify(r)})];case 1:c=t.sent(),t.label=2;case 2:return t.trys.push([2,4,,5]),[4,c.json()];case 3:return u=t.sent(),[3,5];case 4:return l=t.sent(),u={errors:[l.message]},[3,5];case 5:if(c.ok)return[2,u];throw new Mt(c,u)}})})},k);function k(t){this.config=t}l.Alks=global,x=Error,U.__extends(Lt,x);var x,Mt=Lt;function Lt(t,e){var r=this,n=Array.isArray(null==e?void 0:e.errors)?e.errors:[],n=(t.statusText&&n.unshift(t.statusText),n.join("; "));return(r=x.call(this,n)||this).status=t.status,r.message=n,Object.assign(r,e),r}function B(r,t){return t.reduce(function(t,e){return t[e]=r[e],t},{})}l.AlksError=Mt;u=global.prototype.create.call({},{_fetch:u}),l.create=global.prototype.create.bind(u),l.getAccounts=global.prototype.getAccounts.bind(u),l.getKeys=global.prototype.getKeys.bind(u),l.getIAMKeys=global.prototype.getIAMKeys.bind(u),l.getAllAWSRoleTypes=global.prototype.getAllAWSRoleTypes.bind(u),l.getAWSRoleTypes=global.prototype.getAWSRoleTypes.bind(u),l.getNonServiceAWSRoleTypes=global.prototype.getNonServiceAWSRoleTypes.bind(u),l.createRole=global.prototype.createRole.bind(u),l.createNonServiceRole=global.prototype.createNonServiceRole.bind(u),l.awsAccountRoles=global.prototype.awsAccountRoles.bind(u),l.listAWSAccountRoles=global.prototype.listAWSAccountRoles.bind(u),l.getAccountRole=global.prototype.getAccountRole.bind(u),l.updateRole=global.prototype.updateRole.bind(u),l.deleteRole=global.prototype.deleteRole.bind(u),l.addRoleMachineIdentity=global.prototype.addRoleMachineIdentity.bind(u),l.deleteRoleMachineIdentity=global.prototype.deleteRoleMachineIdentity.bind(u),l.getUserAccess=global.prototype.getUserAccess.bind(u),l.getUserAccessByRole=global.prototype.getUserAccessByRole.bind(u),l.getUserRoleAccess=global.prototype.getUserRoleAccess.bind(u),l.getAccountOwners=global.prototype.getAccountOwners.bind(u),l.createAccessKeys=global.prototype.createAccessKeys.bind(u),l.getIamUser=global.prototype.getIamUser.bind(u),l.updateIamUser=global.prototype.updateIamUser.bind(u),l.deleteIAMUser=global.prototype.deleteIAMUser.bind(u),l.version=global.prototype.version.bind(u),l.getLoginRole=global.prototype.getLoginRole.bind(u),l.getAccessToken=global.prototype.getAccessToken.bind(u),l.getRefreshTokens=global.prototype.getRefreshTokens.bind(u),l.revoke=global.prototype.revoke.bind(u),l.getCostTotals=global.prototype.getCostTotals.bind(u),l=j;t.default=l,Object.defineProperty(t,"__esModule",{value:!0}),Object.assign(t,l)});

@@ -245,2 +245,3 @@ declare type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>;

description?: string;
category?: string;
};

@@ -247,0 +248,0 @@ export type GetAWSRoleTypesProps = Partial<AlksProps> & {};

{
"name": "alks.js",
"version": "2.13.0",
"version": "2.14.0",
"description": "JavaScript client for the ALKS API, usable in both modern browsers and node.js",

@@ -5,0 +5,0 @@ "main": "dist/alks.cjs.js",

@@ -20,3 +20,3 @@ # alks.js

Install with [NPM](https://www.npmjs.com/package/alks.js) like this
Install with [NPM](https://www.npmjs.com/package/alks.js) like this,
```

@@ -23,0 +23,0 @@ npm install alks.js

Sorry, the diff of this file is too big to display