UNPKG

diffusion

Version:

Diffusion JavaScript client

2 lines 69.2 kB
/*! For license information please see diffusion-feature-time-series.js.LICENSE.txt */ (()=>{var t={526:(t,e)=>{"use strict";e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=s(t),u=o[0],a=o[1],f=new i(function(t,e,r){return 3*(e+r)/4-r}(0,u,a)),h=0,l=a>0?u-4:u;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],f[h++]=e>>16&255,f[h++]=e>>8&255,f[h++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,f[h++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,f[h++]=e>>8&255,f[h++]=255&e),f},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],u=16383,s=0,f=n-i;s<f;s+=u)o.push(a(t,s,s+u>f?f:s+u));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)r[u]=o[u],n[o.charCodeAt(u)]=u;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function a(t,e,n){for(var i,o,u=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),u.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return u.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},287:(t,e,r)=>{"use strict";var n=r(526),i=r(251);e.hp=s,e.IS=50;var o=2147483647;function u(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|p(t,e),n=u(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return l(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Q(t,ArrayBuffer)||t&&Q(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r)).__proto__=s.prototype,n}(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return s.from(n,e,r);var i=function(t){if(s.isBuffer(t)){var e=0|c(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||V(t.length)?u(0):l(t):"Buffer"===t.type&&Array.isArray(t.data)?l(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return f(t),u(t<0?0:0|c(t))}function l(t){for(var e=t.length<0?0:0|c(t.length),r=u(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function c(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Q(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return x(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(i)return n?-1:x(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,u=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;u=2,s/=2,a/=2,r/=2}function f(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(i){var h=-1;for(o=r;o<s;o++)if(f(t,o)===f(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===a)return h*u}else-1!==h&&(o-=o-h),h=-1}else for(r+a>s&&(r=s-a),o=r;o>=0;o--){for(var l=!0,c=0;c<a;c++)if(f(t,o+c)!==f(e,c)){l=!1;break}if(l)return o}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var u=0;u<n;++u){var s=parseInt(e.substr(2*u,2),16);if(V(s))return u;t[r+u]=s}return u}function E(t,e,r,n){return j(x(e,t.length-r),t,r,n)}function m(t,e,r,n){return j(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function _(t,e,r,n){return m(t,e,r,n)}function b(t,e,r,n){return j(D(e),t,r,n)}function T(t,e,r,n){return j(function(t,e){for(var r,n,i,o=[],u=0;u<t.length&&!((e-=2)<0);++u)n=(r=t.charCodeAt(u))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,u,s,a,f=t[i],h=null,l=f>239?4:f>223?3:f>191?2:1;if(i+l<=r)switch(l){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&(a=(31&f)<<6|63&o)>127&&(h=a);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(a=(15&f)<<12|(63&o)<<6|63&u)>2047&&(a<55296||a>57343)&&(h=a);break;case 4:o=t[i+1],u=t[i+2],s=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&s)&&(a=(15&f)<<18|(63&o)<<12|(63&u)<<6|63&s)>65535&&a<1114112&&(h=a)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return function(t){var e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=I));return r}(n)}s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(t,e,r){return a(t,e,r)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?u(t):void 0!==e?"string"==typeof r?u(t).fill(e,r):u(t).fill(e):u(t)}(t,e,r)},s.allocUnsafe=function(t){return h(t)},s.allocUnsafeSlow=function(t){return h(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(Q(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),Q(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},s.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}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(Q(o,Uint8Array)&&(o=s.from(o)),!s.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},s.byteLength=p,s.prototype._isBuffer=!0,s.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)d(this,e,e+1);return this},s.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)d(this,e,e+3),d(this,e+1,e+2);return this},s.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)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},s.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?A(this,0,t):y.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,i){if(Q(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(r>>>=0)-(e>>>=0),a=Math.min(o,u),f=this.slice(n,i),h=t.slice(e,r),l=0;l<a;++l)if(f[l]!==h[l]){o=f[l],u=h[l];break}return o<u?-1:u<o?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},s.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 i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return m(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function R(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function N(t,e,r){var n,i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var o="",u=e;u<r;++u)o+=(n=t[u])<16?"0"+n.toString(16):n.toString(16);return o}function B(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function q(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function U(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,n,o){return e=+e,r>>>=0,o||U(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||U(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=s.prototype,n},s.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},s.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||M(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||M(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||M(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||M(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||M(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||M(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||q(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||q(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);q(this,t,e,r,i-1,-i)}var o=0,u=1,s=0;for(this[e]=255&t;++o<r&&(u*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/u|0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);q(this,t,e,r,i-1,-i)}var o=r-1,u=1,s=0;for(this[e+o]=255&t;--o>=0&&(u*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/u|0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=i-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}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)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var u=s.isBuffer(t)?t:s.from(t,n),a=u.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=u[o%a]}return this};var C=/[^+/0-9A-Za-z-_]/g;function x(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function D(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(C,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Q(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,u,s=8*i-n-1,a=(1<<s)-1,f=a>>1,h=-7,l=r?i-1:0,c=r?-1:1,p=t[e+l];for(l+=c,o=p&(1<<-h)-1,p>>=-h,h+=s;h>0;o=256*o+t[e+l],l+=c,h-=8);for(u=o&(1<<-h)-1,o>>=-h,h+=n;h>0;u=256*u+t[e+l],l+=c,h-=8);if(0===o)o=1-f;else{if(o===a)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),o-=f}return(p?-1:1)*u*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var u,s,a,f=8*o-i-1,h=(1<<f)-1,l=h>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,u=h):(u=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-u))<1&&(u--,a*=2),(e+=u+l>=1?c/a:c*Math.pow(2,1-l))*a>=2&&(u++,a/=2),u+l>=h?(s=0,u=h):u+l>=1?(s=(e*a-1)*Math.pow(2,i),u+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),u=0));i>=8;t[r+p]=255&s,p+=y,s/=256,i-=8);for(u=u<<i|s,f+=i;f>0;t[r+p]=255&u,p+=y,u/=256,f-=8);t[r+p-y]|=128*d}},570:t=>{t.exports=r;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function r(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function n(t){return!0===(t&&t.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},o={};function u(t,e){var r,n,u;return e?(u=0<=(t>>>=0)&&t<256)&&(n=o[t])?n:(r=a(t,(0|t)<0?-1:0,!0),u&&(o[t]=r),r):(u=-128<=(t|=0)&&t<128)&&(n=i[t])?n:(r=a(t,t<0?-1:0,!1),u&&(i[t]=r),r)}function s(t,e){if(isNaN(t))return e?v:g;if(e){if(t<0)return v;if(t>=p)return b}else{if(t<=-y)return T;if(t+1>=y)return _}return t<0?s(-t,e).neg():a(t%c|0,t/c|0,e)}function a(t,e,n){return new r(t,e,n)}r.fromInt=u,r.fromNumber=s,r.fromBits=a;var f=Math.pow;function h(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return g;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return h(t.substring(1),e,r).neg();for(var i=s(f(r,8)),o=g,u=0;u<t.length;u+=8){var a=Math.min(8,t.length-u),l=parseInt(t.substring(u,u+a),r);if(a<8){var c=s(f(r,a));o=o.mul(c).add(s(l))}else o=(o=o.mul(i)).add(s(l))}return o.unsigned=e,o}function l(t,e){return"number"==typeof t?s(t,e):"string"==typeof t?h(t,e):a(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}r.fromString=h,r.fromValue=l;var c=4294967296,p=c*c,y=p/2,d=u(1<<24),g=u(0);r.ZERO=g;var v=u(0,!0);r.UZERO=v;var w=u(1);r.ONE=w;var E=u(1,!0);r.UONE=E;var m=u(-1);r.NEG_ONE=m;var _=a(-1,2147483647,!1);r.MAX_VALUE=_;var b=a(-1,-1,!0);r.MAX_UNSIGNED_VALUE=b;var T=a(0,-2147483648,!1);r.MIN_VALUE=T;var S=r.prototype;S.toInt=function(){return this.unsigned?this.low>>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},S.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(T)){var e=s(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=s(f(t,6),this.unsigned),o=this,u="";;){var a=o.div(i),h=(o.sub(a.mul(i)).toInt()>>>0).toString(t);if((o=a).isZero())return h+u;for(;h.length<6;)h="0"+h;u=""+h+u}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&!(t&1<<e);e--);return 0!=this.high?e+33:e+1},S.isZero=function(){return 0===this.high&&0===this.low},S.eqz=S.isZero,S.isNegative=function(){return!this.unsigned&&this.high<0},S.isPositive=function(){return this.unsigned||this.high>=0},S.isOdd=function(){return!(1&~this.low)},S.isEven=function(){return!(1&this.low)},S.equals=function(t){return n(t)||(t=l(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},S.eq=S.equals,S.notEquals=function(t){return!this.eq(t)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(t){return this.comp(t)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(t){return this.comp(t)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(t){return this.comp(t)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(t){return this.comp(t)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(t){if(n(t)||(t=l(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(w)},S.neg=S.negate,S.add=function(t){n(t)||(t=l(t));var e=this.high>>>16,r=65535&this.high,i=this.low>>>16,o=65535&this.low,u=t.high>>>16,s=65535&t.high,f=t.low>>>16,h=0,c=0,p=0,y=0;return p+=(y+=o+(65535&t.low))>>>16,c+=(p+=i+f)>>>16,h+=(c+=r+s)>>>16,h+=e+u,a((p&=65535)<<16|(y&=65535),(h&=65535)<<16|(c&=65535),this.unsigned)},S.subtract=function(t){return n(t)||(t=l(t)),this.add(t.neg())},S.sub=S.subtract,S.multiply=function(t){if(this.isZero())return g;if(n(t)||(t=l(t)),e)return a(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return g;if(this.eq(T))return t.isOdd()?T:g;if(t.eq(T))return this.isOdd()?T:g;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(d)&&t.lt(d))return s(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,o=this.low>>>16,u=65535&this.low,f=t.high>>>16,h=65535&t.high,c=t.low>>>16,p=65535&t.low,y=0,v=0,w=0,E=0;return w+=(E+=u*p)>>>16,v+=(w+=o*p)>>>16,w&=65535,v+=(w+=u*c)>>>16,y+=(v+=i*p)>>>16,v&=65535,y+=(v+=o*c)>>>16,v&=65535,y+=(v+=u*h)>>>16,y+=r*p+i*c+o*h+u*f,a((w&=65535)<<16|(E&=65535),(y&=65535)<<16|(v&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(t){if(n(t)||(t=l(t)),t.isZero())throw Error("division by zero");var r,i,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?a((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?v:g;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return v;if(t.gt(this.shru(1)))return E;o=v}else{if(this.eq(T))return t.eq(w)||t.eq(m)?T:t.eq(T)?w:(r=this.shr(1).div(t).shl(1)).eq(g)?t.isNegative()?w:m:(i=this.sub(t.mul(r)),o=r.add(i.div(t)));if(t.eq(T))return this.unsigned?v:g;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=g}for(i=this;i.gte(t);){r=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var u=Math.ceil(Math.log(r)/Math.LN2),h=u<=48?1:f(2,u-48),c=s(r),p=c.mul(t);p.isNegative()||p.gt(i);)p=(c=s(r-=h,this.unsigned)).mul(t);c.isZero()&&(c=w),o=o.add(c),i=i.sub(p)}return o},S.div=S.divide,S.modulo=function(t){return n(t)||(t=l(t)),e?a((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return a(~this.low,~this.high,this.unsigned)},S.and=function(t){return n(t)||(t=l(t)),a(this.low&t.low,this.high&t.high,this.unsigned)},S.or=function(t){return n(t)||(t=l(t)),a(this.low|t.low,this.high|t.high,this.unsigned)},S.xor=function(t){return n(t)||(t=l(t)),a(this.low^t.low,this.high^t.high,this.unsigned)},S.shiftLeft=function(t){return n(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?a(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):a(0,this.low<<t-32,this.unsigned)},S.shl=S.shiftLeft,S.shiftRight=function(t){return n(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?a(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):a(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(t){if(n(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return t<32?a(this.low>>>t|e<<32-t,e>>>t,this.unsigned):a(32===t?e:e>>>t-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},S.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},S.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},r.fromBytes=function(t,e,n){return n?r.fromBytesLE(t,e):r.fromBytesBE(t,e)},r.fromBytesLE=function(t,e){return new r(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},r.fromBytesBE=function(t,e){return new r(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},857:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorReason=void 0;var n=r(529),i=r(741);e.ErrorReason={COMMUNICATION_FAILURE:new n.ErrorReason(100,"Communication with server failed"),SESSION_CLOSED:new n.ErrorReason(101,"Session is closed"),REQUEST_TIME_OUT:new n.ErrorReason(102,"Request time out"),ACCESS_DENIED:new n.ErrorReason(103,"Access denied"),UNSUPPORTED:new n.ErrorReason(104,"Unsupported service"),CALLBACK_EXCEPTION:new n.ErrorReason(105,"An application callback threw an exception. Check logs for more information"),INVALID_DATA:new n.ErrorReason(106,"Invalid data"),NO_SUCH_SESSION:new n.ErrorReason(107,"A requested session could not be found"),INCOMPATIBLE_DATATYPE:new n.ErrorReason(108,"Data type is incompatible"),UNHANDLED_MESSAGE:new n.ErrorReason(109,"A message was not handled"),CLUSTER_REPARTITION:new n.ErrorReason(110,"The cluster was repartitioning and the request could not be routed."),INCOMPATIBLE_STATE:new n.ErrorReason(111,"Topic operation not performed because it is managed by a component that prohibits external updates"),CLUSTER_ROUTING:new n.ErrorReason(112,"The cluster operation could not be routed."),TOPIC_TREE_REGISTRATION_CONFLICT:new n.ErrorReason(200,"A conflicting registration exists on the same branch of the topic tree"),HANDLER_CONFLICT:new n.ErrorReason(201,"Conflict with an existing handler"),INVALID_PATH:new n.ErrorReason(202,"Invalid path"),REJECTED_REQUEST:new n.ErrorReason(9003,"A request has been rejected by the recipient session")},i.enumerize(e.ErrorReason)},191:function(t,e){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return r=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])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InternalError=e.IllegalStateError=e.RetryLimitError=e.SchemaParseError=e.SchemaViolationError=e.InvalidScriptError=e.InvalidFilterError=e.OutOfBoundsError=e.IllegalArgumentError=e.SessionError=e.IOError=e.InvalidDataError=e.AssertionError=e.RuntimeError=e.NullValueError=void 0;var i=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="null_value_error",e}(Error);e.NullValueError=i;var o=function(t){function e(e,r){var n=t.call(this,e)||this;return n.cause=r,n}return n(e,t),e.prototype.getType=function(){return e.type},e.type="runtime_error",e}(Error);e.RuntimeError=o;var u=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="assertion_error",e}(Error);e.AssertionError=u;var s=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="invalid_data_error",e}(Error);e.InvalidDataError=s;var a=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="io_error",e}(Error);e.IOError=a;var f=function(t){function e(e,r){var n=t.call(this,e)||this;return n.cause=r,n}return n(e,t),e.prototype.getType=function(){return e.type},e.type="session_error",e}(Error);e.SessionError=f;var h=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="illegal_argument_error",e}(Error);e.IllegalArgumentError=h;var l=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="out_of_bounds_error",e}(Error);e.OutOfBoundsError=l;var c=function(t){function e(e,r){var n=t.call(this,e)||this;return n.errors=r,n}return n(e,t),e.prototype.getType=function(){return e.type},e.type="invalid_filter_error",e}(Error);e.InvalidFilterError=c;var p=function(t){function e(e,r){var n=t.call(this,e)||this;return n.errors=r,n}return n(e,t),e.prototype.getType=function(){return e.type},e.type="invalid_script_error",e}(Error);e.InvalidScriptError=p;var y=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="schema_violation_error",e}(Error);e.SchemaViolationError=y;var d=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="schema_parse_error",e}(Error);e.SchemaParseError=d;var g=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="retry_limit_error",e}(Error);e.RetryLimitError=g;var v=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="illegal_state_error",e}(Error);e.IllegalStateError=v;var w=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="internal_error",e}(Error);e.InternalError=w},529:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorReason=void 0;var r=function(){function t(t,e){this.id=t,this.reason=e}return t.prototype.toString=function(){return this.id+": "+this.reason},t}();e.ErrorReason=r},548:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BufferSlice=void 0;e.BufferSlice=function(t,e,r){void 0===e&&(e=0),void 0===r&&(r=t.length),this.$buffer=t,this.$offset=e,this.$length=r}},665:function(t,e,r){"use strict";var n,i=r(287).hp,o=this&&this.__extends||(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])},n(t,e)},function(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.BytesImpl=void 0;var u=function(t){function e(e,r,n){return void 0===r&&(r=0),void 0===n&&(n=e.length),t.call(this,e,r,n)||this}return o(e,t),e.toString=function(){return"BytesImpl"},e.prototype.length=function(){return this.$length},e.prototype.asBuffer=function(){return i.from(this.asArray())},e.prototype.asArray=function(){return this.$buffer.subarray(this.$offset,this.$offset+this.$length)},e.prototype.copyTo=function(t,e){void 0===e&&(e=0),t.set(this.$buffer.subarray(this.$offset,this.$offset+this.$length),e)},e.prototype.equals=function(t){return this.equalBytes(t.$buffer,t.$offset,t.$length)},e.prototype.equalBytes=function(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=t.length),this.$length!==r)return!1;if(this.$buffer===t&&this.$offset===e)return!0;for(var n=0;n<r;++n)if(this.$buffer[this.$offset+n]!==t[e+n])return!1;return!0},e}(r(548).BufferSlice);e.BytesImpl=u},30:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Point=e.Types=e.Type=void 0;var n=r(741),i=r(536),o=function(t,e,r,n){this.id=t,this.anchorOperator=e,this.spanOperator=r,this.unitsSuffix=n};e.Type=o,e.Types={ABSOLUTE_START:new o(0,"fromStart","toStart",""),ABSOLUTE_SEQUENCE:new o(1,"from","to",""),ABSOLUTE_TIME:new o(2,"from","to"," ms"),OFFSET_SEQUENCE:new o(3,"fromLast","untilLast",""),OFFSET_TIME:new o(4,"fromLast","untilLast"," ms"),NEXT_COUNT:new o(5,null,"next",""),NEXT_TIME:new o(6,null,"next"," ms"),PREVIOUS_COUNT:new o(7,null,"previous",""),PREVIOUS_TIME:new o(8,null,"previous"," ms")},n.enumerize(e.Types);var u=function(){function t(t,e){this.value=t,this.type=e}return t.at=function(r){return r instanceof Date?new t(r.getTime(),e.Types.ABSOLUTE_TIME):new t(i.requireNonNegative(r,"Sequence"),e.Types.ABSOLUTE_SEQUENCE)},t.atStart=function(){return s},t.offset=function(r){return new t(i.requireNonNegative(r,"Count"),e.Types.OFFSET_SEQUENCE)},t.offsetMillis=function(r){return new t(i.requireNonNegative(r,"Timespan"),e.Types.OFFSET_TIME)},t.next=function(r){return new t(i.requireNonNegative(r,"Count"),e.Types.NEXT_COUNT)},t.nextMillis=function(r){return new t(i.requireNonNegative(r,"Timespan"),e.Types.NEXT_TIME)},t.previous=function(r){return new t(i.requireNonNegative(r,"Count"),e.Types.PREVIOUS_COUNT)},t.previousMillis=function(r){return new t(i.requireNonNegative(r,"Timespan"),e.Types.PREVIOUS_TIME)},t.prototype.equals=function(e){return!!(e&&e instanceof t)&&this.value===e.value&&this.type===e.type},t}();e.Point=u;var s=new u(0,e.Types.ABSOLUTE_START)},684:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryResultImpl=void 0;var n=r(257),i=r(570);function o(t){return!!t}function u(t,e){return t.originalEvent.sequence!==e.originalEvent.sequence?t.originalEvent.sequence-e.originalEvent.sequence:t.sequence-e.sequence}var s=function(){function t(t,e,r,n){this.events=n,this.selectedCount=t.toNumber(),this.isComplete=t.equals(e),this.streamStructure=r}return t.prototype.merge=function(e){var r,s,a=this.events.concat(e.events).sort(u).map((r=this.events.concat(e.events),s={},r.forEach((function(t){var e=t.originalEvent.sequence.toString(10);(!s[e]||s[e].sequence<t.sequence)&&(s[e]=t)})),function(t){var e=t.originalEvent.sequence.toString(10),r=s[e];return r?t.isEditEvent?t.sequence.equals(r.sequence)?(delete s[e],t):null:(delete s[e],r):null})).filter(o),f=i.fromNumber(a.length);return new t(f,f,n.StreamStructures.VALUE_EVENT_STREAM,a)},t}();e.QueryResultImpl=s},403:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RangeQueryImpl=void 0;var n=r(857),i=r(191),o=r(536),u=r(665),s=r(33),a=r(257),f=r(400);function h(t,e){return t.withViewRange(e(t.viewRange))}function l(t,e){return t.withEditRange(e(t.editRange))}var c=function(){function t(t,e,r,n){this.context=t,this.valueType=e,this.parameters=r,this.mode=n}return t.createDefault=function(e){return new t(e,u.BytesImpl,a.DEFAULT_RANGE_QUERY,h)},t.prototype.withCurrentRange=function(e){return new t(this.context,this.valueType,this.mode(this.parameters,e),this.mode)},t.prototype.selectFrom=function(t){var e=this;return new Promise((function(r,i){if(t){var o={topicPath:t,parameters:e.parameters};e.context.send(o,(function(t,o){if(f.responseSuccess(t,o))try{r(o.createQueryResult(e.valueType,e.parameters.queryType.streamStructure))}catch(t){i(n.ErrorReason.INVALID_DATA)}else i(t)}))}else i(new Error("Topic path is null"))}))},t.prototype.forValues=function(){return new t(this.context,this.valueType,this.parameters.withQueryType(a.QueryTypes.VALUES).withViewRange(s.DEFAULT_RANGE),h)},t.prototype.forEdits=function(){return new t(this.context,this.valueType,this.parameters.withQueryType(a.QueryTypes.ALL_EDITS).withViewRange(s.DEFAULT_RANGE),h)},t.prototype.editRange=function(){if(this.parameters.queryType!==a.QueryTypes.VALUES)throw new i.IllegalStateError(".editRange() cannot be applied to this edit range query");return new t(this.context,this.valueType,this.parameters,l)},t.prototype.allEdits=function(){if(this.parameters.queryType===a.QueryTypes.VALUES)throw new i.IllegalStateError(".allEdits() cannot be applied to this value range query");return new t(this.context,this.valueType,this.parameters.withQueryType(a.QueryTypes.ALL_EDITS),l)},t.prototype.latestEdits=function(){if(this.parameters.queryType===a.QueryTypes.VALUES)throw new i.IllegalStateError(".latestEdits() cannot be applied to this value range query");return new t(this.context,this.valueType,this.parameters.withQueryType(a.QueryTypes.LATEST_EDITS),l)},t.prototype.limit=function(e){return new t(this.context,this.valueType,this.parameters.withLimit(e),this.mode)},t.prototype.as=function(e){if(o.requireNonNull(e,"Value type"),e&&e.valueClass)return new t(this.context,e.valueClass,this.parameters,this.mode);if(e instanceof Function)return new t(this.context,e,this.parameters,this.mode);throw new i.IllegalArgumentError("Invalid value type: "+e)},t.prototype.from=function(t){return this.withCurrentRange((function(e){return e.from(t)}))},t.prototype.fromStart=function(){return this.withCurrentRange((function(t){return t.fromStart()}))},t.prototype.fromLast=function(t){return this.withCurrentRange((function(e){return e.fromLast(t)}))},t.prototype.fromLastMillis=function(t){return this.withCurrentRange((function(e){return e.fromLastMillis(t)}))},t.prototype.to=function(t){return this.withCurrentRange((function(e){return e.to(t)}))},t.prototype.toStart=function(){return this.withCurrentRange((function(t){return t.toStart()}))},t.prototype.untilLast=function(t){return this.withCurrentRange((function(e){return e.untilLast(t)}))},t.prototype.untilLastMillis=function(t){return this.withCurrentRange((function(e){return e.untilLastMillis(t)}))},t.prototype.next=function(t){return this.withCurrentRange((function(e){return e.next(t)}))},t.prototype.nextMillis=function(t){return this.withCurrentRange((function(e){return e.nextMillis(t)}))},t.prototype.previous=function(t){return this.withCurrentRange((function(e){return e.previous(t)}))},t.prototype.previousMillis=function(t){return this.withCurrentRange((function(e){return e.previousMillis(t)}))},t}();e.RangeQueryImpl=c},257:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_RANGE_QUERY=e.RangeQueryParameters=e.QueryTypes=e.QueryType=e.StreamStructures=e.StreamStructure=void 0;var n=r(33),i=r(741),o=r(775),u=r(536),s=function(){function t(t,e){this.id=t,this.name=e}return t.prototype.toString=function(){return this.name},t}();e.StreamStructure=s,e.StreamStructures={VALUE_EVENT_STREAM:new s(1,"VALUE_EVENT_STREAM"),EDIT_EVENT_STREAM:new s(2,"EDIT_EVENT_STREAM")},i.enumerize(e.StreamStructures),Object.freeze(e.StreamStructures);var a=function(t,e){this.id=t,this.streamStructure=e};e.QueryType=a,e.QueryTypes={VALUES:new a(0,e.StreamStructures.VALUE_EVENT_STREAM),ALL_EDITS:new a(1,e.StreamStructures.EDIT_EVENT_STREAM),LATEST_EDITS:new a(2,e.StreamStructures.EDIT_EVENT_STREAM)},i.enumerize(e.QueryTypes),Object.freeze(e.QueryTypes);var f=function(){function t(t,e,r,n){this.queryType=t,this.viewRange=e,this.editRange=r,this.limit=n}return t.prototype.withViewRange=function(e){return new t(this.queryType,e,this.editRange,this.limit)},t.prototype.withEditRange=function(e){return new t(this.queryType,this.viewRange,e,this.limit)},t.prototype.withLimit=function(e){return new t(this.queryType,this.viewRange,this.editRange,u.requireNonNegative(e,"limit"))},t.prototype.withQueryType=function(e){return new t(e,this.viewRange,this.editRange,this.limit)},t}();e.RangeQueryParameters=f,e.DEFAULT_RANGE_QUERY=Object.freeze(new f(e.QueryTypes.VALUES,n.DEFAULT_RANGE,n.DEFAULT_RANGE,o.MAX_SAFE_INTEGER))},33:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_RANGE=e.Range=void 0;var n=r(30),i=function(){function t(t,e){this.anchor=t,this.span=e}return t.prototype.equals=function(e){return!!(e&&e instanceof t)&&this.anchor.equals(e.anchor)&&this.span.equals(e.span)},t.prototype.from=function(e){return new t(n.Point.at(e),this.span)},t.prototype.fromStart=function(){return new t(n.Point.atStart(),this.span)},t.prototype.fromLast=function(e){return new t(n.Point.offset(e),this.span)},t.prototype.fromLastMillis=function(e){return new t(n.Point.offsetMillis(e),this.span)},t.prototype.to=function(e){return new t(this.anchor,n.Point.at(e))},t.prototype.toStart=function(){return new t(this.anchor,n.Point.atStart())},t.prototype.untilLast=function(e){return new t(this.anchor,n.Point.offset(e))},t.prototype.untilLastMillis=function(e){return new t(this.anchor,n.Point.offsetMillis(e))},t.prototype.next=function(e){return new t(this.anchor,n.Point.next(e))},t.prototype.nextMillis=function(e){return new t(this.anchor,n.Point.nextMillis(e))},t.prototype.previous=function(e){return new t(this.anchor,n.Point.previous(e))},t.prototype.previousMillis=function(e){return new t(this.anchor,n.Point.previousMillis(e))},t}();e.Range=i,e.DEFAULT_RANGE=new i(n.Point.atStart(),n.Point.offset(0))},873:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TimeSeriesImpl=void 0;var n=r(403),i=r(677),o=r(888),u=r(895),s=r(536),a=r(570),f=function(){function t(t){this.internal=t;var e=t.getServiceLocator();this.defaultRangeQuery=n.RangeQueryImpl.createDefault(e.obtain(i.rangeQueryFactory(t.getContext().DataTypes))),this.appendService=e.obtain(i.TIME_SERIES_APPEND),this.appendTimestampService=e.obtain(i.TIME_SERIES_TIMESTAMP_APPEND),this.editService=e.obtain(i.TIME_SERIES_EDIT)}return t.prototype.rangeQuery=function(){return this.defaultRangeQuery},t.prototype.edit=function(t,e,r,n){var i=this,o=this.internal.getContext().DataTypes;return new Promise((function(u,a){var f,h;try{f=n instanceof i.internal.getContext().AbstractDataType?n:n?o.getByClass(n):o.getByValue(r),s.requireNonNull(t,"Path"),s.requireNonNull(r,"Value"),s.requireNonNull(e,"Sequence"),h=(f=s.requireNonNull(f,"Data type")).writeValueToArray(r)}catch(t){return void a(t)}i.editService.send({path:t,sequence:e,dataType:f,value:h},(function(t,e){t?a(t):u(e)}))}))},t.prototype.append=function(t,e,r,n){var i=this,f=this.internal.getContext().DataTypes;return new Promise((function(h,l){var c,p;try{c=r instanceof i.internal.getContext().AbstractDataType?r:r?f.getByClass(r):f.getByValue(e),s.requireNonNull(t,"Path"),s.requireNonNull(e,"Value"),p=(c=s.requireNonNull(c,"Data type")).writeValueToArray(e)}catch(t){return void l(t)}var y=function(t,e){t?l(t):h(e)};void 0===n?i.appendService.send(new o.TimeSeriesAppendRequest(t,c,p),y):i.appendTimestampService.send(new u.TimeSeriesTimestampAppendRequest(t,c,p,"number"==typeof n?a.fromNumber(n):n),y)}))},t}();e.TimeSeriesImpl=f},771:function(t,e,r){"use strict";var n=this&&this.__values||function(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 t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.readOptional=e.writeOptional=e.writeBoolean=e.readBoolean=e.writeMap=e.readMap=e.readObject=e.writeObject=e.writeDictionary=e.readDictionary=e.readCollection=e.writeCollection=e.writeString=e.readString=e.writeBytes=e.readBytes=e.writeByte=e.writeInt32=e.readInt32=e.writeInt64=e.readInt64=e.readByte=void 0;var i=r(191),o=r(570),u=r(224),s=o.fromNumber(128),a=o.fromNumber(127),f=a.not();func