mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-01 05:31:01 +01:00
2 lines
489 KiB
JavaScript
Executable File
2 lines
489 KiB
JavaScript
Executable File
/*! For license information please see Serialise.js.LICENSE.txt */
|
||
(()=>{var e={34529:(e,t,r)=>{"use strict";function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function i(e){return r.g.Buffer&&"function"==typeof r.g.Buffer.isBuffer?r.g.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var o=r(40537),s=Object.prototype.hasOwnProperty,a=Array.prototype.slice,u="foo"===function(){}.name;function c(e){return Object.prototype.toString.call(e)}function f(e){return!i(e)&&"function"==typeof r.g.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer)))}var l=e.exports=m,h=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(o.isFunction(e)){if(u)return e.name;var t=e.toString().match(h);return t&&t[1]}}function d(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function y(e){if(u||!o.isFunction(e))return o.inspect(e);var t=p(e);return"[Function"+(t?": "+t:"")+"]"}function g(e,t,r,n,i){throw new l.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function m(e,t){e||g(e,!0,t,"==",l.ok)}function v(e,t,r,s){if(e===t)return!0;if(i(e)&&i(t))return 0===n(e,t);if(o.isDate(e)&&o.isDate(t))return e.getTime()===t.getTime();if(o.isRegExp(e)&&o.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(f(e)&&f(t)&&c(e)===c(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;var u=(s=s||{actual:[],expected:[]}).actual.indexOf(e);return-1!==u&&u===s.expected.indexOf(t)||(s.actual.push(e),s.expected.push(t),function(e,t,r,n){if(null==e||null==t)return!1;if(o.isPrimitive(e)||o.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=b(e),s=b(t);if(i&&!s||!i&&s)return!1;if(i)return v(e=a.call(e),t=a.call(t),r);var u,c,f=E(e),l=E(t);if(f.length!==l.length)return!1;for(f.sort(),l.sort(),c=f.length-1;c>=0;c--)if(f[c]!==l[c])return!1;for(c=f.length-1;c>=0;c--)if(!v(e[u=f[c]],t[u],r,n))return!1;return!0}(e,t,r,s))}return r?e===t:e==t}function b(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function _(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function w(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&g(i,r,"Missing expected exception"+n);var s="string"==typeof n,a=!e&&i&&!r;if((!e&&o.isError(i)&&s&&_(i,r)||a)&&g(i,r,"Got unwanted exception"+n),e&&i&&r&&!_(i,r)||!e&&i)throw i}l.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return d(y(e.actual),128)+" "+e.operator+" "+d(y(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=p(t),o=n.indexOf("\n"+i);if(o>=0){var s=n.indexOf("\n",o+1);n=n.substring(s+1)}this.stack=n}}},o.inherits(l.AssertionError,Error),l.fail=g,l.ok=m,l.equal=function(e,t,r){e!=t&&g(e,t,r,"==",l.equal)},l.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",l.notEqual)},l.deepEqual=function(e,t,r){v(e,t,!1)||g(e,t,r,"deepEqual",l.deepEqual)},l.deepStrictEqual=function(e,t,r){v(e,t,!0)||g(e,t,r,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function(e,t,r){v(e,t,!1)&&g(e,t,r,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=function e(t,r,n){v(t,r,!0)&&g(t,r,n,"notDeepStrictEqual",e)},l.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",l.strictEqual)},l.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",l.notStrictEqual)},l.throws=function(e,t,r){w(!0,e,t,r)},l.doesNotThrow=function(e,t,r){w(!1,e,t,r)},l.ifError=function(e){if(e)throw e};var E=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}},34138:(e,t,r)=>{"use strict";var n=r(91185),i=r(75942),o=r(78412),s=r(22561);e.exports={Service:i.Service,assembleProtocol:o.assembleProtocol,discoverProtocol:i.discoverProtocol,parse:function(e,t){var r=o.read(e);return r.protocol?i.Service.forProtocol(r,t):n.Type.forSchema(r,t)},readProtocol:o.readProtocol,readSchema:o.readSchema},s.copyOwnProperties(n,e.exports)},91185:(e,t,r)=>{"use strict";var n=r(77725);e.exports={Type:n.Type,parse:function(e,t){var r;if("string"==typeof e)try{r=JSON.parse(e)}catch(t){r=e}else r=e;return n.Type.forSchema(r,t)},types:n.builtins,combine:n.Type.forTypes,infer:n.Type.forValue}},23809:(e,t,r)=>{"use strict";var n=r(34138),i=r(21946),o=r(22561),s=r(88310),a=r(40537);function u(e,t){s.Readable.call(this),t=t||{},this._batchSize=t.batchSize||65536,this._blob=e,this._pos=0}function c(){s.Transform.call(this,{readableObjectMode:!0}),this._bufs=[]}a.inherits(u,s.Readable),u.prototype._read=function(){var e=this._pos;if(e>=this._blob.size)this.push(null);else{this._pos+=this._batchSize;var t=this._blob.slice(e,this._pos,this._blob.type),r=new FileReader,n=this;r.addEventListener("loadend",(function e(t){r.removeEventListener("loadend",e,!1),t.error?n.emit("error",t.error):n.push(o.bufferFrom(r.result))}),!1),r.readAsArrayBuffer(t)}},a.inherits(c,s.Transform),c.prototype._transform=function(e,t,r){this._bufs.push(e),r()},c.prototype._flush=function(e){this.push(new Blob(this._bufs,{type:"application/octet-binary"})),e()},e.exports={createBlobDecoder:function(e,t){return new u(e).pipe(new i.streams.BlockDecoder(t))},createBlobEncoder:function(e,t){var r=new i.streams.BlockEncoder(e,t),n=new c;return r.pipe(n),new s.Duplex({objectMode:!0,read:function(){var e=n.read();e?r(e):n.once("readable",r);var t=this;function r(e){t.push(e||n.read()),t.push(null)}},write:function(e,t,n){return r.write(e,t,n)}}).on("finish",(function(){r.end()}))},streams:i.streams},o.copyOwnProperties(n,e.exports)},78505:(e,t,r)=>{"use strict";var n=r(48287).Buffer;function i(){this.data=void 0}function o(e,t){var r=e[0],n=e[1],i=e[2],o=e[3];r=a(r,n,i,o,t[0],7,-680876936),o=a(o,r,n,i,t[1],12,-389564586),i=a(i,o,r,n,t[2],17,606105819),n=a(n,i,o,r,t[3],22,-1044525330),r=a(r,n,i,o,t[4],7,-176418897),o=a(o,r,n,i,t[5],12,1200080426),i=a(i,o,r,n,t[6],17,-1473231341),n=a(n,i,o,r,t[7],22,-45705983),r=a(r,n,i,o,t[8],7,1770035416),o=a(o,r,n,i,t[9],12,-1958414417),i=a(i,o,r,n,t[10],17,-42063),n=a(n,i,o,r,t[11],22,-1990404162),r=a(r,n,i,o,t[12],7,1804603682),o=a(o,r,n,i,t[13],12,-40341101),i=a(i,o,r,n,t[14],17,-1502002290),r=u(r,n=a(n,i,o,r,t[15],22,1236535329),i,o,t[1],5,-165796510),o=u(o,r,n,i,t[6],9,-1069501632),i=u(i,o,r,n,t[11],14,643717713),n=u(n,i,o,r,t[0],20,-373897302),r=u(r,n,i,o,t[5],5,-701558691),o=u(o,r,n,i,t[10],9,38016083),i=u(i,o,r,n,t[15],14,-660478335),n=u(n,i,o,r,t[4],20,-405537848),r=u(r,n,i,o,t[9],5,568446438),o=u(o,r,n,i,t[14],9,-1019803690),i=u(i,o,r,n,t[3],14,-187363961),n=u(n,i,o,r,t[8],20,1163531501),r=u(r,n,i,o,t[13],5,-1444681467),o=u(o,r,n,i,t[2],9,-51403784),i=u(i,o,r,n,t[7],14,1735328473),r=c(r,n=u(n,i,o,r,t[12],20,-1926607734),i,o,t[5],4,-378558),o=c(o,r,n,i,t[8],11,-2022574463),i=c(i,o,r,n,t[11],16,1839030562),n=c(n,i,o,r,t[14],23,-35309556),r=c(r,n,i,o,t[1],4,-1530992060),o=c(o,r,n,i,t[4],11,1272893353),i=c(i,o,r,n,t[7],16,-155497632),n=c(n,i,o,r,t[10],23,-1094730640),r=c(r,n,i,o,t[13],4,681279174),o=c(o,r,n,i,t[0],11,-358537222),i=c(i,o,r,n,t[3],16,-722521979),n=c(n,i,o,r,t[6],23,76029189),r=c(r,n,i,o,t[9],4,-640364487),o=c(o,r,n,i,t[12],11,-421815835),i=c(i,o,r,n,t[15],16,530742520),r=f(r,n=c(n,i,o,r,t[2],23,-995338651),i,o,t[0],6,-198630844),o=f(o,r,n,i,t[7],10,1126891415),i=f(i,o,r,n,t[14],15,-1416354905),n=f(n,i,o,r,t[5],21,-57434055),r=f(r,n,i,o,t[12],6,1700485571),o=f(o,r,n,i,t[3],10,-1894986606),i=f(i,o,r,n,t[10],15,-1051523),n=f(n,i,o,r,t[1],21,-2054922799),r=f(r,n,i,o,t[8],6,1873313359),o=f(o,r,n,i,t[15],10,-30611744),i=f(i,o,r,n,t[6],15,-1560198380),n=f(n,i,o,r,t[13],21,1309151649),r=f(r,n,i,o,t[4],6,-145523070),o=f(o,r,n,i,t[11],10,-1120210379),i=f(i,o,r,n,t[2],15,718787259),n=f(n,i,o,r,t[9],21,-343485551),e[0]=h(r,e[0]),e[1]=h(n,e[1]),e[2]=h(i,e[2]),e[3]=h(o,e[3])}function s(e,t,r,n,i,o){return t=h(h(t,e),h(n,o)),h(t<<i|t>>>32-i,r)}function a(e,t,r,n,i,o,a){return s(t&r|~t&n,e,t,i,o,a)}function u(e,t,r,n,i,o,a){return s(t&n|r&~n,e,t,i,o,a)}function c(e,t,r,n,i,o,a){return s(t^r^n,e,t,i,o,a)}function f(e,t,r,n,i,o,a){return s(r^(t|~n),e,t,i,o,a)}function l(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function h(e,t){return e+t&4294967295}i.prototype.end=function(e){this.data=e},i.prototype.read=function(){return function(e){var t,r=function(e){var t,r=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)o(n,l(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)i[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(o(n,i),t=0;t<16;t++)i[t]=0;return i[14]=8*r,o(n,i),n}(e),i=n.alloc?n.alloc(16):new n(16);for(t=0;t<4;t++)i.writeIntLE(r[t],4*t,4);return i}(this.data)},e.exports={createHash:function(e){if("md5"!==e)throw new Error("only md5 is supported in the browser");return new i}}},36161:e=>{"use strict";function t(){return new Error("unsupported in the browser")}e.exports={createImportHook:function(){return function(e,r,n){n(t())}},createSyncImportHook:function(){return function(){throw t()}},existsSync:function(){return!1},readFileSync:function(){throw t()}}},21946:(e,t,r)=>{"use strict";var n=r(65606),i=r(77725),o=r(22561),s=r(48287),a=r(88310),u=r(40537),c=r(78559),f=s.Buffer,l={namespace:"org.apache.avro.file"},h=i.Type.forSchema("long",l),p=i.Type.forSchema({type:"map",values:"bytes"},l),d=i.Type.forSchema({name:"Header",type:"record",fields:[{name:"magic",type:{type:"fixed",name:"Magic",size:4}},{name:"meta",type:p},{name:"sync",type:{type:"fixed",name:"Sync",size:16}}]},l),y=i.Type.forSchema({name:"Block",type:"record",fields:[{name:"count",type:"long"},{name:"data",type:"bytes"},{name:"sync",type:"Sync"}]},l),g=o.bufferFrom("Obj"),m=u.format,v=o.Tap;function b(e,t){var r=!!(t=t||{}).noDecode;a.Duplex.call(this,{readableObjectMode:!r,allowHalfOpen:!1}),this._type=i.Type.forSchema(e),this._tap=new v(o.newBuffer(0)),this._writeCb=null,this._needPush=!1,this._readValue=S(r,this._type),this._finished=!1,this.on("finish",(function(){this._finished=!0,this._read()}))}function _(e){var t=!!(e=e||{}).noDecode;a.Duplex.call(this,{allowHalfOpen:!0,readableObjectMode:!t}),this._rType=void 0!==e.readerSchema?i.Type.forSchema(e.readerSchema):void 0,this._wType=null,this._codecs=e.codecs,this._codec=void 0,this._parseHook=e.parseHook,this._tap=new v(o.newBuffer(0)),this._blockTap=new v(o.newBuffer(0)),this._syncMarker=null,this._readValue=null,this._noDecode=t,this._queue=new o.OrderedQueue,this._decompress=null,this._index=0,this._remaining=void 0,this._needPush=!1,this._finished=!1,this.on("finish",(function(){this._finished=!0,this._needPush&&this._read()}))}function w(e,t){t=t||{},a.Transform.call(this,{writableObjectMode:!0,allowHalfOpen:!1}),this._type=i.Type.forSchema(e),this._writeValue=function(e,t){try{this._type._write(e,t)}catch(e){this.emit("typeError",e,t,this._type)}},this._tap=new v(o.newBuffer(t.batchSize||65536)),this.on("typeError",(function(e){this.emit("error",e)}))}function E(e,t){var r;if(t=t||{},a.Duplex.call(this,{allowHalfOpen:!0,writableObjectMode:!0}),i.Type.isType(e)?(r=e,e=void 0):r=i.Type.forSchema(e),this._schema=e,this._type=r,this._writeValue=function(e,t){try{this._type._write(e,t)}catch(e){return this.emit("typeError",e,t,this._type),!1}return!0},this._blockSize=t.blockSize||65536,this._tap=new v(o.newBuffer(this._blockSize)),this._codecs=t.codecs,this._codec=t.codec||"null",this._blockCount=0,this._syncMarker=t.syncMarker||(new o.Lcg).nextBuffer(16),this._queue=new o.OrderedQueue,this._pending=0,this._finished=!1,this._needHeader=!1,this._needPush=!1,this._metadata=t.metadata||{},!p.isValid(this._metadata))throw new Error("invalid metadata");var n=this._codec;if(this._compress=(this._codecs||E.getDefaultCodecs())[n],!this._compress)throw new Error(m("unsupported codec: %s",n));switch(void 0!==t.omitHeader&&(t.writeHeader=t.omitHeader?"never":"auto"),t.writeHeader){case!1:case"never":break;case void 0:case"auto":this._needHeader=!0;break;default:this._writeHeader()}this.on("finish",(function(){this._finished=!0,this._blockCount?this._flushChunk():this._finished&&this._needPush&&this.push(null)})),this.on("typeError",(function(e){this.emit("error",e)}))}function x(e,t,r){this.valueCount=e,this.rawDataLength=t,this.compressedDataLength=r}function B(e,t,r,n){this.index=e,this.buf=t,this.cb=r,this.count=0|n}function A(e){var t=e.pos,r=y._read(e);return e.isValid()?r:(e.pos=t,null)}function S(e,t,r){if(e)return i=t._skip,function(e){var t=e.pos;return i(e),e.buf.slice(t,e.pos)};if(r){var n=r.createResolver(t);return function(e){return n._read(e)}}return function(e){return t._read(e)};var i}u.inherits(b,a.Duplex),b.prototype._write=function(e,t,r){this._writeCb=r;var n=this._tap;n.buf=f.concat([n.buf.slice(n.pos),e]),n.pos=0,this._needPush&&(this._needPush=!1,this._read())},b.prototype._read=function(){this._needPush=!1;var e=this._tap,t=e.pos,r=this._readValue(e);e.isValid()?this.push(r):this._finished?this.push(null):(e.pos=t,this._needPush=!0,this._writeCb&&this._writeCb())},u.inherits(_,a.Duplex),_.defaultCodecs=function(){return{null:function(e,t){t(null,e)},deflate:c.inflateRaw}},_.getDefaultCodecs=_.defaultCodecs,_.prototype._decodeHeader=function(){var e=this._tap;if(e.buf.length<g.length)return!1;if(!g.equals(e.buf.slice(0,g.length)))return this.emit("error",new Error("invalid magic bytes")),!1;var t=d._read(e);if(!e.isValid())return!1;this._codec=(t.meta["avro.codec"]||"null").toString();var r=this._codecs||_.getDefaultCodecs();if(this._decompress=r[this._codec],this._decompress){try{var n=JSON.parse(t.meta["avro.schema"].toString());this._parseHook&&(n=this._parseHook(n)),this._wType=i.Type.forSchema(n)}catch(e){return void this.emit("error",e)}try{this._readValue=S(this._noDecode,this._wType,this._rType)}catch(e){return void this.emit("error",e)}return this._syncMarker=t.sync,this.emit("metadata",this._wType,this._codec,t),!0}this.emit("error",new Error(m("unknown codec: %s",this._codec)))},_.prototype._write=function(e,t,r){var i=this._tap;i.buf=f.concat([i.buf,e]),i.pos=0,this._decodeHeader()?(this._write=this._writeChunk,this._write(o.newBuffer(0),t,r)):n.nextTick(r)},_.prototype._writeChunk=function(e,t,r){var n=this._tap;n.buf=f.concat([n.buf.slice(n.pos),e]),n.pos=0;for(var i,o=1;i=A(n);){if(!this._syncMarker.equals(i.sync))return void this.emit("error",new Error("invalid sync marker"));o++,this._decompress(i.data,this._createBlockCallback(i.data.length,i.count,s))}function s(){--o||r()}s()},_.prototype._createBlockCallback=function(e,t,r){var n=this,i=this._index++;return function(o,s){if(o){var a=new Error(m("%s codec decompression error",n._codec));a.cause=o,n.emit("error",a),r()}else n.emit("block",new x(t,s.length,e)),n._queue.push(new B(i,s,r,t)),n._needPush&&n._read()}},_.prototype._read=function(){this._needPush=!1;var e,t=this._blockTap;if(!this._remaining){var r=this._queue.pop();if(!r||!r.count)return this._finished?this.push(null):this._needPush=!0,void(r&&r.cb());r.cb(),this._remaining=r.count,t.buf=r.buf,t.pos=0}this._remaining--;try{if(e=this._readValue(t),!t.isValid())throw new Error("truncated block")}catch(e){return this._remaining=0,void this.emit("error",e)}this.push(e)},u.inherits(w,a.Transform),w.prototype._transform=function(e,t,r){var n=this._tap,i=n.buf,s=n.pos;if(this._writeValue(n,e),!n.isValid()){s&&this.push(function(e,t,r){var n=o.newBuffer(r);return e.copy(n,0,0,0+r),n}(n.buf,0,s));var a=n.pos-s;a>i.length&&(n.buf=o.newBuffer(2*a)),n.pos=0,this._writeValue(n,e)}r()},w.prototype._flush=function(e){var t=this._tap,r=t.pos;r&&this.push(t.buf.slice(0,r)),e()},u.inherits(E,a.Duplex),E.defaultCodecs=function(){return{null:function(e,t){t(null,e)},deflate:c.deflateRaw}},E.getDefaultCodecs=E.defaultCodecs,E.prototype._writeHeader=function(){var e=JSON.stringify(this._schema?this._schema:this._type.getSchema({exportAttrs:!0})),t=o.copyOwnProperties(this._metadata,{"avro.schema":o.bufferFrom(e),"avro.codec":o.bufferFrom(this._codec)},!0),r=new(d.getRecordConstructor())(g,t,this._syncMarker);this.push(r.toBuffer())},E.prototype._write=function(e,t,r){this._needHeader&&(this._writeHeader(),this._needHeader=!1);var n=this._tap,i=n.pos,s=!1;if(this._writeValue(n,e)){if(!n.isValid()){i&&(this._flushChunk(i,r),s=!0);var a=n.pos-i;a>this._blockSize&&(this._blockSize=2*a),n.buf=o.newBuffer(this._blockSize),n.pos=0,this._writeValue(n,e)}this._blockCount++}else n.pos=i;s||r()},E.prototype._flushChunk=function(e,t){var r=this._tap;e=e||r.pos,this._compress(r.buf.slice(0,e),this._createBlockCallback(e,t)),this._blockCount=0},E.prototype._read=function(){var e=this,t=this._queue.pop();t?(this.push(h.toBuffer(t.count,!0)),this.push(h.toBuffer(t.buf.length,!0)),this.push(t.buf),this.push(this._syncMarker),this._finished||t.cb()):this._finished&&!this._pending?n.nextTick((function(){e.push(null)})):this._needPush=!0},E.prototype._createBlockCallback=function(e,t){var r=this,n=this._index++,i=this._blockCount;return this._pending++,function(o,s){if(o){var a=new Error(m("%s codec compression error",r._codec));return a.cause=o,void r.emit("error",a)}r._pending--,r.emit("block",new x(i,e,s.length)),r._queue.push(new B(n,s,t,i)),r._needPush&&(r._needPush=!1,r._read())}},e.exports={BLOCK_TYPE:y,HEADER_TYPE:d,MAGIC_BYTES:g,streams:{BlockDecoder:_,BlockEncoder:E,RawDecoder:b,RawEncoder:w}}},75942:(e,t,r)=>{"use strict";var n=r(65606),i=r(77725),o=r(22561),s=r(48287),a=r(37007),u=r(88310),c=r(40537),f=s.Buffer,l=o.Tap,h=i.Type,p=c.debuglog("avsc:services"),d=c.format,y={namespace:"org.apache.avro.ipc"},g=h.forSchema("boolean",y),m=h.forSchema({type:"map",values:"bytes"},y),v=h.forSchema("string",y),b=h.forSchema({name:"HandshakeRequest",type:"record",fields:[{name:"clientHash",type:{name:"MD5",type:"fixed",size:16}},{name:"clientProtocol",type:["null","string"],default:null},{name:"serverHash",type:"MD5"},{name:"meta",type:["null",m],default:null}]},y),_=h.forSchema({name:"HandshakeResponse",type:"record",fields:[{name:"match",type:{name:"HandshakeMatch",type:"enum",symbols:["BOTH","CLIENT","NONE"]}},{name:"serverProtocol",type:["null","string"],default:null},{name:"serverHash",type:["null","MD5"],default:null},{name:"meta",type:["null",m],default:null}]},y),w=16,E=new x("",h.forSchema({name:"PingRequest",type:"record",fields:[]},y),h.forSchema(["string"],y),h.forSchema("null",y));function x(e,t,r,n,i,o){if(this.name=e,!h.isType(t,"record"))throw new Error("invalid request type");if(this.requestType=t,!h.isType(r,"union")||!h.isType(r.getTypes()[0],"string"))throw new Error("invalid error type");if(this.errorType=r,i&&(!h.isType(n,"null")||r.getTypes().length>1))throw new Error("inapplicable one-way parameter");this.responseType=n,this.oneWay=!!i,this.doc=void 0!==o?""+o:void 0,Object.freeze(this)}function B(e,t,r,n,i){if("string"!=typeof e)return B.forProtocol(e,t);this.name=e,this._messagesByName=t||{},this.messages=Object.freeze(o.objectValues(this._messagesByName)),this._typesByName=r||{},this.types=Object.freeze(o.objectValues(this._typesByName)),this.protocol=n,this._hashStr=o.getHash(JSON.stringify(n)).toString("binary"),this.doc=n.doc?""+n.doc:void 0,this._server=i||this.createServer({silent:!0}),Object.freeze(this)}function A(e,t){t=t||{},a.EventEmitter.call(this),this._svc$=e,this._channels$=[],this._fns$=[],this._buffering$=!!t.buffering,this._cache$=t.cache||{},this._policy$=t.channelPolicy,this._strict$=!!t.strictTypes,this._timeout$=o.getOption(t,"timeout",1e4),t.remoteProtocols&&q(this._cache$,t.remoteProtocols,e,!0),this._svc$.messages.forEach((function(e){this[e.name]=this._createMessageHandler$(e)}),this)}function S(e,t){t=t||{},a.EventEmitter.call(this),this.service=e,this._handlers={},this._fns=[],this._channels={},this._nextChannelId=1,this._cache=t.cache||{},this._defaultHandler=t.defaultHandler,this._sysErrFormatter=t.systemErrorFormatter,this._silent=!!t.silent,this._strict=!!t.strictTypes,t.remoteProtocols&&q(this._cache,t.remoteProtocols,e,!1),e.messages.forEach((function(e){var r=e.name;t.noCapitalize||(r=o.capitalize(r)),this["on"+r]=this._createMessageHandler(e)}),this)}function k(e,t){t=t||{},a.EventEmitter.call(this),this.client=e,this.timeout=o.getOption(t,"timeout",e._timeout$),this._endWritable=!!o.getOption(t,"endWritable",!0),this._prefix=X(t.scope);var r=e._cache$,n=e._svc$,i=t.serverHash;i||(i=n.hash);var s=r[i];s||(s=r[i=n.hash]=new j(n,n,i)),this._adapter=s,this._registry=new C(this,w),this.pending=0,this.destroyed=!1,this.draining=!1,this.once("_eot",(function(e,t){p("client channel EOT"),this.destroyed=!0,this.emit("eot",e,t)}))}function T(e,t,r){k.call(this,e,r),this._writableFactory=t,r&&r.noPing||(p("emitting ping request"),this.ping())}function O(e,t,r,i){k.call(this,e,i),this._readable=t,this._writable=r,this._connected=!(!i||!i.noPing),this._readable.on("end",d),this._writable.on("finish",y);var s,a=this,u=null;function c(e){if(!a.destroyed){s=a._createHandshakeRequest(a._adapter,!e);var t=[b.toBuffer(s),o.bufferFrom([0,0])];a._writable.write({id:a._prefix,payload:t})}}function l(e){if(a._matchesPrefix(e.id)){var t=f.concat(e.payload);try{var r=H(_,t).head;r.serverHash&&(a._adapter=a._getAdapter(r))}catch(e){return void a.destroy(e)}var i=r.match;p("handshake match: %s",i),a.emit("handshake",s,r),"NONE"===i?n.nextTick((function(){c(!0)})):(p("successfully connected"),u&&(clearTimeout(u),u=null),a._readable.removeListener("data",l).on("data",h),a._connected=!0,a.emit("_ready"),s=null)}else p("discarding unscoped response %s (still connecting)",e.id)}function h(e){var t=e.id;if(a._matchesPrefix(t)){var r=a._registry.get(t);r&&n.nextTick((function(){p("received message %s",t),r(null,f.concat(e.payload),a._adapter)}))}else p("discarding unscoped message %s",t)}function d(){a.destroy(!0)}function y(){a.destroy()}this.once("eot",(function(){u&&(clearTimeout(u),u=null),a._connected||a.emit("_ready"),this._writable.removeListener("finish",y),this._endWritable&&(p("ending transport"),this._writable.end()),this._readable.removeListener("data",l).removeListener("data",h).removeListener("end",d)})),this._connected?this._readable.on("data",h):(this._readable.on("data",l),n.nextTick(c),a.timeout&&(u=setTimeout((function(){a.destroy(new Error("timeout"))}),a.timeout)))}function I(e,t){t=t||{},a.EventEmitter.call(this),this.server=e,this._endWritable=!!o.getOption(t,"endWritable",!0),this._prefix=X(t.scope);var r=e._cache,n=e.service,i=n.hash;r[i]||(r[i]=new j(n,n,i)),this._adapter=null,this.destroyed=!1,this.draining=!1,this.pending=0,this.once("_eot",(function(e,t){p("server channel EOT"),this.emit("eot",e,t)}))}function N(e,t,r){I.call(this,e,r),this._writable=void 0;var i,o=this;function s(e){var t,r=e.id,n=f.concat(e.payload);try{var i=H(b,n),s=i.head,a=o._getAdapter(s)}catch(e){t=Y("INVALID_HANDSHAKE_REQUEST",e)}var u=o._createHandshakeResponse(t,s);function c(e){if(!o.destroyed){if(!o._writable)return void o.once("_writable",(function(){c(e)}));o._writable.write({id:r,payload:[_.toBuffer(u),e]})}o._writable&&o._endWritable&&o._writable.end()}o.emit("handshake",s,u),t?c(o._encodeSystemError(t)):o._receive(i.tail,a,c)}function a(){o.destroy()}function u(e){i.removeListener("data",s).removeListener("end",a),o.destroy(e||!0)}n.nextTick((function(){i=t.call(o,(function(e,t){n.nextTick((function(){e?u(e):(o._writable=t.on("finish",u),o.emit("_writable"))}))})).on("data",s).on("end",a)}))}function F(e,t,r,n){I.call(this,e,n),this._adapter=void 0,this._writable=r.on("finish",u),this._readable=t.on("data",o).on("end",a),this.once("_drain",(function(){this._readable.removeListener("data",o).removeListener("data",s).removeListener("end",a)})).once("eot",(function(){this._writable.removeListener("finish",u),this._endWritable&&this._writable.end()}));var i=this;function o(e){var t=e.id;if(i._matchesPrefix(t)){var r,n=f.concat(e.payload);try{var a=H(b,n),u=a.head;i._adapter=i._getAdapter(u)}catch(e){r=Y("INVALID_HANDSHAKE_REQUEST",e)}var c=i._createHandshakeResponse(r,u);i.emit("handshake",u,c),r?l(i._encodeSystemError(r)):(i._readable.removeListener("data",o).on("data",s),i._receive(a.tail,i._adapter,l))}function l(e){i.destroyed||i._writable.write({id:t,payload:[_.toBuffer(c),e]})}}function s(e){var t=e.id;if(i._matchesPrefix(t)){var r=f.concat(e.payload);i._receive(r,i._adapter,(function(e,r){i.destroyed||r||i._writable.write({id:t,payload:[e]})}))}}function a(){i.destroy()}function u(){i.destroy(!0)}}function R(e,t,r){this._msg=e,this.headers=t||{},this.request=r||{}}function L(e,t,r,n){this._msg=e,this.headers=t,this.error=r,this.response=n}function U(e,t){this.channel=t,this.locals={},this.message=e,Object.freeze(this)}function C(e,t){this._ctx=e,this._mask=-1>>>(0|t),this._id=0,this._n=0,this._cbs={}}function j(e,t,r,n){this._clientSvc=e,this._serverSvc=t,this._hash=r,this._isRemote=!!n,this._readers=Z(e,t)}function D(){u.Transform.call(this,{readableObjectMode:!0}),this._id=void 0,this._buf=o.newBuffer(0),this._bufs=[],this.on("finish",(function(){this.push(null)}))}function M(){u.Transform.call(this,{writableObjectMode:!0}),this.on("finish",(function(){this.push(null)}))}function P(){u.Transform.call(this,{readableObjectMode:!0}),this._id=void 0,this._frameCount=0,this._buf=o.newBuffer(0),this._bufs=[],this.on("finish",(function(){this.push(null)}))}function z(){u.Transform.call(this,{writableObjectMode:!0}),this.on("finish",(function(){this.push(null)}))}function $(e){var t=o.newBuffer(4);return t.writeInt32BE(e),t}function H(e,t){var r=new l(t),n=e._read(r);if(!r.isValid())throw new Error(d("truncated %j",e.schema()));return{head:n,tail:r.buf.slice(r.pos)}}function V(e,t){return e.equals(t)?e:e.createResolver(t)}function Z(e,t){var r={};return e.messages.forEach((function(e){var n=e.name,i=t.message(n);try{if(!i)throw new Error(d("missing server message: %s",n));if(i.oneWay!==e.oneWay)throw new Error(d("inconsistent one-way message: %s",n));r[n+"?"]=V(i.requestType,e.requestType),r[n+"*"]=V(e.errorType,i.errorType),r[n+"!"]=V(e.responseType,i.responseType)}catch(e){throw Y("INCOMPATIBLE_PROTOCOL",e)}})),r}function q(e,t,r,n){Object.keys(t).forEach((function(i){var o,s,a=t[i];n?(o=r,s=B.forProtocol(a)):(o=B.forProtocol(a),s=r),e[i]=new j(o,s,i,!0)}))}function G(e,t){var r={};return Object.keys(e).forEach((function(n){var i=e[n];if(i._isRemote){var o=t?i._serverSvc:i._clientSvc;r[n]=o.protocol}})),r}function J(e){return!!e&&"[object Error]"===Object.prototype.toString.call(e)}function W(e,t){var r=new Error(e);return r.cause=t,r}function Y(e,t){var r=W(e.toLowerCase().replace(/_/g," "),t);return r.rpcCode=t&&t.rpcCode?t.rpcCode:e,r}function K(e,t,r){var n,i,o,s=[];for(n=0,i=r.length;n<i;n++)(o=r[n]).type.isValid(t[o.name],{errorHook:c});var a=s.map((function(e){return d("%s = %j but expected %s",e.path,e.value,e.type)})).join(", "),u=new Error(d("%s (%s)",e,a));return u.details=s,u;function c(e,t,r){var n,i,a,u=[];for(n=0,i=e.length;n<i;n++)a=e[n],isNaN(a)?u.push("."+a):u.push("["+a+"]");s.push({path:o.name+u.join(""),value:t,type:r})}}function X(e){return e?o.getHash(e).readInt16BE(0)<<32-w:0}function Q(e,t){return!((e^t)>>32-w)}function ee(e){return!(!e||!e.pipe)}function te(e,t){var r=e.message(t);if(!r)throw new Error(d("unknown message: %s",t));return r}function re(e){var t,r=[e.wreq,e.wres],i=[];function o(){var r=i.pop();if(r){var n=!1;r.call(e.ctx,t,(function(r){n?e.onError(W("duplicate backward middleware call",r)):(t=r,n=!0,o())}))}else e.onCompletion.call(e.ctx,t)}!function s(a){var u=!1;a<e.fns.length?e.fns[a].apply(e.ctx,r.concat((function(r,n){if(u)e.onError(W("duplicate forward middleware call",r));else{if(u=!0,r||e.wres&&(void 0!==e.wres.error||void 0!==e.wres.response))return t=r,void o();n&&i.push(n),s(++a)}}))):e.onTransition.apply(e.ctx,r.concat((function(r){u?e.onError(W("duplicate handler call",r)):(u=!0,t=r,n.nextTick(o))})))}(0)}x.forSchema=function(e,t,r){if(r=r||{},!o.isValidName(e))throw new Error(d("invalid message name: %s",e));if(!Array.isArray(t.request))throw new Error(d("invalid message request: %s",e));var n=d("%s.%sRequest",y.namespace,o.capitalize(e)),i=h.forSchema({name:n,type:"record",namespace:r.namespace||"",fields:t.request},r);if(delete r.registry[n],!t.response)throw new Error(d("invalid message response: %s",e));var s=h.forSchema(t.response,r);if(void 0!==t.errors&&!Array.isArray(t.errors))throw new Error(d("invalid message errors: %s",e));return new x(e,i,h.forSchema(["string"].concat(t.errors||[]),r),s,!!t["one-way"],t.doc)},x.prototype.schema=h.prototype.getSchema,x.prototype._attrs=function(e){var t={request:this.requestType._attrs(e).fields,response:this.responseType._attrs(e)},r=this.doc;void 0!==r&&(t.doc=r);var n=this.errorType._attrs(e);return n.length>1&&(t.errors=n.slice(1)),this.oneWay&&(t["one-way"]=!0),t},o.addDeprecatedGetters(x,["name","errorType","requestType","responseType"]),x.prototype.isOneWay=c.deprecate((function(){return this.oneWay}),"use `.oneWay` directly instead of `.isOneWay()`"),B.Client=A,B.Server=S,B.compatible=function(e,t){try{Z(e,t)}catch(e){return!1}return!0},B.forProtocol=function(e,t){t=t||{};var r,n=e.protocol;if(!n)throw new Error("missing protocol name");if(void 0!==e.namespace)t.namespace=e.namespace;else{var i=/^(.*)\.[^.]+$/.exec(n);i&&(t.namespace=i[1])}return n=o.qualify(n,t.namespace),e.types&&e.types.forEach((function(e){h.forSchema(e,t)})),e.messages&&(r={},Object.keys(e.messages).forEach((function(n){r[n]=x.forSchema(n,e.messages[n],t)}))),new B(n,r,t.registry,e)},B.isService=function(e){return!!e&&e.hasOwnProperty("_hashStr")},B.prototype.createClient=function(e){var t=new A(this,e);return n.nextTick((function(){if(e&&e.server){var r={objectMode:!0},n=[new u.PassThrough(r),new u.PassThrough(r)];e.server.createChannel({readable:n[0],writable:n[1]},r),t.createChannel({readable:n[1],writable:n[0]},r)}else e&&e.transport&&t.createChannel(e.transport)})),t},B.prototype.createServer=function(e){return new S(this,e)},Object.defineProperty(B.prototype,"hash",{enumerable:!0,get:function(){return o.bufferFrom(this._hashStr,"binary")}}),B.prototype.message=function(e){return this._messagesByName[e]},B.prototype.type=function(e){return this._typesByName[e]},B.prototype.inspect=function(){return d("<Service %j>",this.name)},o.addDeprecatedGetters(B,["message","messages","name","type","types"]),B.prototype.createEmitter=c.deprecate((function(e,t){t=t||{};var r,n,i=this.createClient({cache:t.cache,buffering:!1,strictTypes:t.strictErrors,timeout:t.timeout}),o=i.createChannel(e,t);return n=o,(r=i).on("error",(function(e){n.emit("error",e,r)})),o}),"use `.createClient()` instead of `.createEmitter()`"),B.prototype.createListener=c.deprecate((function(e,t){if(t&&t.strictErrors)throw new Error("use `.createServer()` to support strict errors");return this._server.createChannel(e,t)}),"use `.createServer().createChannel()` instead of `.createListener()`"),B.prototype.emit=c.deprecate((function(e,t,r,n){if(!r||!this.equals(r.client._svc$))throw new Error("invalid emitter");var i=r.client;return A.prototype.emitMessage.call(i,e,t,n&&n.bind(this)),r.getPending()}),"create a client via `.createClient()` to emit messages instead of `.emit()`"),B.prototype.equals=c.deprecate((function(e){return B.isService(e)&&this.getFingerprint().equals(e.getFingerprint())}),"equality testing is deprecated, compare the `.protocol`s instead"),B.prototype.getFingerprint=c.deprecate((function(e){return o.getHash(JSON.stringify(this.protocol),e)}),"use `.hash` instead of `.getFingerprint()`"),B.prototype.getSchema=c.deprecate(h.prototype.getSchema,"use `.protocol` instead of `.getSchema()`"),B.prototype.on=c.deprecate((function(e,t){var r=this;return this._server.onMessage(e,(function(e,n){return t.call(r,e,this.channel,n)})),this}),"use `.createServer().onMessage()` instead of `.on()`"),B.prototype.subprotocol=c.deprecate((function(){var e=this._server,t={strictTypes:e._strict,cache:e._cache},r=new S(e.service,t);return r._handlers=Object.create(e._handlers),new B(this.name,this._messagesByName,this._typesByName,this.protocol,r)}),"`.subprotocol()` will be removed in 5.1"),B.prototype._attrs=function(e){var t={protocol:this.name},r=[];this.types.forEach((function(t){if(void 0!==t.getName()){var n=t._attrs(e);"string"!=typeof n&&r.push(n)}})),r.length&&(t.types=r);var n=Object.keys(this._messagesByName);return n.length&&(t.messages={},n.forEach((function(r){t.messages[r]=this._messagesByName[r]._attrs(e)}),this)),e&&e.exportAttrs&&void 0!==this.doc&&(t.doc=this.doc),t},c.inherits(A,a.EventEmitter),A.prototype.activeChannels=function(){return this._channels$.slice()},A.prototype.createChannel=function(e,t){var r,n=t&&t.objectMode;if("function"==typeof e){var i;i=n?e:function(t){var n=new M,i=e((function(e,n){if(e)t(e);else{var i=(new D).once("error",(function(e){r.destroy(e)}));t(null,n.pipe(i))}}));if(i)return n.pipe(i),n},r=new T(this,i,t)}else{var o,s;if(ee(e)?o=s=e:(o=e.readable,s=e.writable),!n){var a=new P;o=o.pipe(a);var u=new z;u.pipe(s),s=u}r=new O(this,o,s,t),n||(r.once("eot",(function(){o.unpipe(a),u.unpipe(s)})),a.once("error",(function(e){r.destroy(e)})))}var c=this._channels$;return c.push(r),r.once("_drain",(function(){c.splice(c.indexOf(this),1)})),this._buffering$=!1,this.emit("channel",r),r},A.prototype.destroyChannels=function(e){this._channels$.forEach((function(t){t.destroy(e&&e.noWait)}))},A.prototype.emitMessage=function(e,t,r,n){var i=new R(te(this._svc$,e),{},t);this._emitMessage$(i,r,n)},A.prototype.remoteProtocols=function(){return G(this._cache$,!0)},Object.defineProperty(A.prototype,"service",{enumerable:!0,get:function(){return this._svc$}}),A.prototype.use=function(){var e,t,r;for(e=0,t=arguments.length;e<t;e++)r=arguments[e],this._fns$.push(r.length<3?r(this):r);return this},A.prototype._emitMessage$=function(e,t,r){r||"function"!=typeof t||(r=t,t=void 0);var i=this,o=this._channels$,s=o.length;if(s){var a;if(void 0===(t=t||{}).timeout&&(t.timeout=this._timeout$),1===s)a=o[0];else if(this._policy$){if(!(a=this._policy$(this._channels$.slice())))return void p("policy returned no channel, skipping call")}else a=o[Math.floor(Math.random()*s)];a._emit(e,t,(function(e,t){var n=this,o=n.message.errorType;if(e)return i._strict$&&(e=o.clone(e.message,{wrapUnions:!0})),void s(e);function s(e,t){r?r.call(n,e,t):e&&i.emit("error",e)}t?(e=t.error,i._strict$||(void 0===e?e=null:h.isType(o,"union:unwrapped")?"string"==typeof e&&(e=new Error(e)):e&&e.string&&"string"==typeof e.string&&(e=new Error(e.string))),s(e,t.response)):s()}))}else if(this._buffering$)p("no active client channels, buffering call"),this.once("channel",(function(){this._emitMessage$(e,t,r)}));else{var u=new Error("no active channels");n.nextTick((function(){r?r.call(new U(e._msg),u):i.emit("error",u)}))}},A.prototype._createMessageHandler$=function(e){var t=e.requestType.getFields().map((function(e){return e.getName()})),r="return function "+e.name+"(";return t.length&&(r+=t.join(", ")+", "),r+="opts, cb) {\n",r+=" var req = {",r+=t.map((function(e){return e+": "+e})).join(", "),r+="};\n",r+=" return this.emitMessage('"+e.name+"', req, opts, cb);\n",r+="};",new Function(r)()},c.inherits(S,a.EventEmitter),S.prototype.activeChannels=function(){return o.objectValues(this._channels)},S.prototype.createChannel=function(e,t){var r,n=t&&t.objectMode;if("function"==typeof e){var i;i=n?e:function(t){var n=(new D).once("error",(function(e){r.destroy(e)}));return e((function(e,r){if(e)t(e);else{var n=new M;n.pipe(r),t(null,n)}})).pipe(n)},r=new N(this,i,t)}else{var o,s;if(ee(e)?o=s=e:(o=e.readable,s=e.writable),!n){var a=new P;o=o.pipe(a);var u=new z;u.pipe(s),s=u}r=new F(this,o,s,t),n||(r.once("eot",(function(){o.unpipe(a),u.unpipe(s)})),a.once("error",(function(e){r.destroy(e)})))}this.listeners("error").length||this.on("error",this._onError);var c=this._nextChannelId++,f=this._channels;return f[c]=r.once("eot",(function(){delete f[c]})),this.emit("channel",r),r},S.prototype.onMessage=function(e,t){return te(this.service,e),this._handlers[e]=t,this},S.prototype.remoteProtocols=function(){return G(this._cache,!1)},S.prototype.use=function(){var e,t,r;for(e=0,t=arguments.length;e<t;e++)r=arguments[e],this._fns.push(r.length<3?r(this):r);return this},S.prototype._createMessageHandler=function(e){var t=e.name,r=e.requestType.fields,n=r.length,i=r.length?", "+r.map((function(e){return"req."+e.name})).join(", "):"",o="return function (handler) {\n";return o+=" if (handler.length > "+n+") {\n",o+=" return this.onMessage('"+t+"', function (req, cb) {\n",o+=" return handler.call(this"+i+", cb);\n",o+=" });\n",o+=" } else {\n",o+=" return this.onMessage('"+t+"', function (req) {\n",o+=" return handler.call(this"+i+");\n",o+=" });\n",o+=" }\n",o+="};\n",new Function(o)()},S.prototype._onError=function(e){this._silent||"UNKNOWN_PROTOCOL"===e.rpcCode||(console.error(),e.rpcCode?(console.error(e.rpcCode),console.error(e.cause)):(console.error("INTERNAL_SERVER_ERROR"),console.error(e)))},c.inherits(k,a.EventEmitter),k.prototype.destroy=function(e){p("destroying client channel"),this.draining||(this.draining=!0,this.emit("_drain"));var t=this._registry,r=this.pending;e&&t.clear(),e||!r?J(e)?(p("fatal client channel error: %s",e),this.emit("_eot",r,e)):this.emit("_eot",r):p("client channel entering drain mode (%s pending)",r)},k.prototype.ping=function(e,t){t||"function"!=typeof e||(t=e,e=void 0);var r=this,n=new R(E);this._emit(n,{timeout:e},(function(e){t?t.call(r,e):e&&r.destroy(e)}))},k.prototype._createHandshakeRequest=function(e,t){var r=this.client._svc$;return{clientHash:r.hash,clientProtocol:t?null:JSON.stringify(r.protocol),serverHash:e._hash}},k.prototype._emit=function(e,t,r){var i=e._msg,o=i.oneWay?void 0:new L(i,{}),s=new U(i,this),a=this;function u(e,r,n){var o,s;if(a.destroyed)o=new Error("channel destroyed");else try{s=e.toBuffer()}catch(t){o=K(d("invalid %j request",i.name),e,[{name:"headers",type:m},{name:"request",type:i.requestType}])}if(o)n(o);else{var u=t&&void 0!==t.timeout?t.timeout:a.timeout,c=a._registry.add(u,(function(e,t,o){if(!e&&!i.oneWay)try{o._decodeResponse(t,r,i)}catch(t){e=t}n(e)}));c|=a._prefix,p("sending message %s",c),a._send(c,s,!!i&&i.oneWay)}}function c(e){a.pending--,r.call(s,e,o),!a.draining||a.destroyed||a.pending||a.destroy()}function f(e){a.client.emit("error",e,a)}this.pending++,n.nextTick((function(){if(i.name){a.emit("outgoingCall",s,t);var r=a.client._fns$;p("starting client middleware chain (%s middleware)",r.length),re({fns:r,ctx:s,wreq:e,wres:o,onTransition:u,onCompletion:c,onError:f})}else u(e,o,c)}))},k.prototype._getAdapter=function(e){var t=e.serverHash,r=this.client._cache$,n=r[t];if(n)return n;var i=JSON.parse(e.serverProtocol),o=B.forProtocol(i);return n=new j(this.client._svc$,o,t,!0),r[t]=n},k.prototype._matchesPrefix=function(e){return Q(e,this._prefix)},k.prototype._send=o.abstractFunction,o.addDeprecatedGetters(k,["pending","timeout"]),k.prototype.getCache=c.deprecate((function(){return this.client._cache$}),"use `.remoteProtocols()` instead of `.getCache()`"),k.prototype.getProtocol=c.deprecate((function(){return this.client._svc$}),"use `.service` instead or `.getProtocol()`"),k.prototype.isDestroyed=c.deprecate((function(){return this.destroyed}),"use `.destroyed` instead of `.isDestroyed`"),c.inherits(T,k),T.prototype._send=function(e,t){var r=this._registry.get(e),i=this._adapter,o=this;return n.nextTick((function s(a){if(!o.destroyed){var u=o._createHandshakeRequest(i,!a),c=o._writableFactory.call(o,(function(e,t){e?r(e):t.on("data",(function(e){p("received response %s",e.id);var t=f.concat(e.payload);try{var a=H(_,t),c=a.head;c.serverHash&&(i=o._getAdapter(c))}catch(e){return void r(e)}var l=c.match;p("handshake match: %s",l),o.emit("handshake",u,c),"NONE"===l?n.nextTick((function(){s(!0)})):(o._adapter=i,r(null,a.tail,i))}))}));c?(c.write({id:e,payload:[b.toBuffer(u),t]}),o._endWritable&&c.end()):r(new Error("invalid writable stream"))}})),!0},c.inherits(O,k),O.prototype._emit=function(){if(this._connected||this.draining)k.prototype._emit.apply(this,arguments);else{p("queuing request");var e,t,r=[];for(e=0,t=arguments.length;e<t;e++)r.push(arguments[e]);this.once("_ready",(function(){this._emit.apply(this,r)}))}},O.prototype._send=function(e,t,r){if(r){var i=this;n.nextTick((function(){i._registry.get(e)(null,o.bufferFrom([0,0,0]),i._adapter)}))}return this._writable.write({id:e,payload:[t]})},c.inherits(I,a.EventEmitter),I.prototype.destroy=function(e){this.draining||(this.draining=!0,this.emit("_drain")),!e&&this.pending||(this.destroyed=!0,J(e)?(p("fatal server channel error: %s",e),this.emit("_eot",this.pending,e)):this.emit("_eot",this.pending))},I.prototype._createHandshakeResponse=function(e,t){var r=this.server.service,n=r.hash,i=t&&t.serverHash.equals(n);return{match:e?"NONE":i?"BOTH":"CLIENT",serverProtocol:i?null:JSON.stringify(r.protocol),serverHash:i?null:n}},I.prototype._getAdapter=function(e){var t=e.clientHash,r=this.server._cache[t];if(r)return r;if(!e.clientProtocol)throw Y("UNKNOWN_PROTOCOL");var n=JSON.parse(e.clientProtocol);return r=new j(B.forProtocol(n),this.server.service,t,!0),this.server._cache[t]=r},I.prototype._matchesPrefix=function(e){return Q(e,this._prefix)},I.prototype._receive=function(e,t,r){var n,i=this;try{n=t._decodeRequest(e)}catch(e){return void r(i._encodeSystemError(Y("INVALID_REQUEST",e)))}var o=n._msg,s=new L(o,{});if(!o.name)return s.response=null,void r(s.toBuffer(),!1);var a=new U(o,this);i.emit("incomingCall",a);var u=this.server._fns;function c(e){i.server.emit("error",e,i)}p("starting server middleware chain (%s middleware)",u.length),i.pending++,re({fns:u,ctx:a,wreq:n,wres:s,onTransition:function(e,t,r){var n=i.server._handlers[o.name];if(n){var s=!o.oneWay;try{s?n.call(a,e.request,(function(e,n){s=!1,t.error=e,t.response=n,r()})):(n.call(a,e.request),r())}catch(e){s?(s=!1,r(e)):c(e)}}else{var u=i.server._defaultHandler;if(u)u.call(a,e,t,r);else{var f=new Error(d("no handler for %s",o.name));r(Y("NOT_IMPLEMENTED",f))}}},onCompletion:function(e){i.pending--;var t,n=i.server;if(!e){var a=s.error;n._strict||(J(a)?s.error=o.errorType.clone(a.message,{wrapUnions:!0}):null===a&&(a=s.error=void 0),void 0===a&&void 0===s.response&&o.responseType.isValid(null)&&(s.response=null));try{t=s.toBuffer()}catch(t){e=void 0!==s.error?K(d("invalid %j error",o.name),s,[{name:"headers",type:m},{name:"error",type:o.errorType}]):K(d("invalid %j response",o.name),s,[{name:"headers",type:m},{name:"response",type:o.responseType}])}}t?void 0!==a&&n.emit("error",Y("APPLICATION_ERROR",a)):t=i._encodeSystemError(e,s.headers),r(t,o.oneWay),i.draining&&!i.pending&&i.destroy()},onError:c})},o.addDeprecatedGetters(I,["pending"]),I.prototype.getCache=c.deprecate((function(){return this.server._cache}),"use `.remoteProtocols()` instead of `.getCache()`"),I.prototype.getProtocol=c.deprecate((function(){return this.server.service}),"use `.service` instead of `.getProtocol()`"),I.prototype.isDestroyed=c.deprecate((function(){return this.destroyed}),"use `.destroyed` instead of `.isDestroyed`"),I.prototype._encodeSystemError=function(e,t){var r,n,i=this.server;if(i.emit("error",e,this),i._sysErrFormatter?r=i._sysErrFormatter.call(this,e):e.rpcCode&&(r=e.message),t)try{n=m.toBuffer(t)}catch(e){i.emit("error",e,this)}return f.concat([n||o.bufferFrom([0]),o.bufferFrom([1,0]),v.toBuffer(r||"internal server error")])},c.inherits(N,I),c.inherits(F,I),R.prototype.toBuffer=function(){var e=this._msg;return f.concat([m.toBuffer(this.headers),v.toBuffer(e.name),e.requestType.toBuffer(this.request)])},L.prototype.toBuffer=function(){var e=m.toBuffer(this.headers),t=void 0!==this.error;return f.concat([e,g.toBuffer(t),t?this._msg.errorType.toBuffer(this.error):this._msg.responseType.toBuffer(this.response)])},C.prototype.get=function(e){return this._cbs[e&this._mask]},C.prototype.add=function(e,t){this._id=this._id+1&this._mask;var r,n=this,i=this._id;return e>0&&(r=setTimeout((function(){o(new Error("timeout"))}),e)),this._cbs[i]=o,this._n++,i;function o(){n._cbs[i]&&(delete n._cbs[i],n._n--,r&&clearTimeout(r),t.apply(n._ctx,arguments))}},C.prototype.clear=function(){Object.keys(this._cbs).forEach((function(e){this._cbs[e](new Error("interrupted"))}),this)},j.prototype._decodeRequest=function(e){var t,r,n=new l(e),i=m._read(n),o=v._read(n);if(o?(t=this._serverSvc.message(o),r=this._readers[o+"?"]._read(n)):t=E,!n.isValid())throw new Error(d("truncated %s request",o||"ping$"));return new R(t,i,r)},j.prototype._decodeResponse=function(e,t,r){var n=new l(e);o.copyOwnProperties(m._read(n),t.headers,!0);var i=g._read(n),s=r.name;if(s){var a=this._readers[s+(i?"*":"!")];if(r=this._clientSvc.message(s),i?t.error=a._read(n):t.response=a._read(n),!n.isValid())throw new Error(d("truncated %s response",s))}else r=E},c.inherits(D,u.Transform),D.prototype._transform=function(e,t,r){var n;for(e=f.concat([this._buf,e]);e.length>=4&&e.length>=(n=e.readInt32BE(0))+4;){if(n)this._bufs.push(e.slice(4,n+4));else{var i=this._bufs;this._bufs=[],this.push({id:null,payload:i})}e=e.slice(n+4)}this._buf=e,r()},D.prototype._flush=function(e){if(this._buf.length||this._bufs.length){var t=this._bufs.slice();t.unshift(this._buf);var r=Y("TRAILING_DATA");r.trailingData=f.concat(t).toString(),this.emit("error",r)}e()},c.inherits(M,u.Transform),M.prototype._transform=function(e,t,r){var n,i,o,s=e.payload;for(n=0,i=s.length;n<i;n++)o=s[n],this.push($(o.length)),this.push(o);this.push($(0)),r()},c.inherits(P,u.Transform),P.prototype._transform=function(e,t,r){for(e=f.concat([this._buf,e]);;){if(void 0===this._id){if(e.length<8)return this._buf=e,void r();this._id=e.readInt32BE(0),this._frameCount=e.readInt32BE(4),e=e.slice(8)}for(var n;this._frameCount&&e.length>=4&&e.length>=(n=e.readInt32BE(0))+4;)this._frameCount--,this._bufs.push(e.slice(4,n+4)),e=e.slice(n+4);if(this._frameCount)return this._buf=e,void r();var i={id:this._id,payload:this._bufs};this._bufs=[],this._id=void 0,this.push(i)}},P.prototype._flush=D.prototype._flush,c.inherits(z,u.Transform),z.prototype._transform=function(e,t,r){var n,i,s=e.payload,a=s.length;for((n=o.newBuffer(8)).writeInt32BE(e.id,0),n.writeInt32BE(a,4),this.push(n),i=0;i<a;i++)n=s[i],this.push($(n.length)),this.push(n);r()},e.exports={Adapter:j,HANDSHAKE_REQUEST_TYPE:b,HANDSHAKE_RESPONSE_TYPE:_,Message:x,Registry:C,Service:B,discoverProtocol:function(e,t,r){var n;void 0===r&&"function"==typeof t&&(r=t,t=void 0),new B({protocol:"Empty"},y).createClient({timeout:t&&t.timeout}).createChannel(e,{scope:t&&t.scope,endWritable:"function"==typeof e}).once("handshake",(function(e,t){n=t.serverProtocol,this.destroy(!0)})).once("eot",(function(e,t){t&&!/interrupted/.test(t)?r(t):r(null,JSON.parse(n))}))},streams:{FrameDecoder:D,FrameEncoder:M,NettyDecoder:P,NettyEncoder:z}}},78412:(e,t,r)=>{"use strict";var n=r(36161),i=r(22561),o=r(43627),s=r(40537).format,a={date:{type:"int",logicalType:"date"},decimal:{type:"bytes",logicalType:"decimal"},time_ms:{type:"long",logicalType:"time-millis"},timestamp_ms:{type:"long",logicalType:"timestamp-millis"}};function u(e,t,r){r||"function"!=typeof t||(r=t,t=void 0),(t=t||{}).importHook||(t.importHook=n.createImportHook()),function e(r,n){t.importHook(r,"idl",(function(i,a){if(i)n(i);else if(void 0!==a){try{var u=new c(a,t)._readProtocol(a,t)}catch(i){return i.path=r,void n(i)}!function(r,n,i,a){var u=[];!function c(){var f=n.shift();if(f){var l=o.join(i,f.name);"idl"===f.kind?e(l,(function(e,t){e?a(e):(t&&u.push(t),c())})):t.importHook(l,f.kind,(function(e,t){if(e)a(e);else switch(f.kind){case"protocol":case"schema":if(void 0===t)return void c();try{var r=JSON.parse(t)}catch(e){return e.path=l,void a(e)}var n="schema"===f.kind?{types:[r]}:r;return u.push(n),void c();default:a(new Error(s("invalid import kind: %s",f.kind)))}}))}else{u.reverse();try{u.forEach((function(e){!function(e,t){var r=t.types||[];r.reverse(),r.forEach((function(r){e.types||(e.types=[]),void 0===r.namespace&&(r.namespace=h(t)||""),e.types.unshift(r)})),Object.keys(t.messages||{}).forEach((function(r){if(e.messages||(e.messages={}),e.messages[r])throw new Error(s("duplicate message: %s",r));e.messages[r]=t.messages[r]}))}(r,e)}))}catch(e){return void a(e)}a(null,r)}}()}(u.protocol,u.imports,o.dirname(r),n)}else n()}))}(e,(function(e,t){if(e)r(e);else if(t){var n=t.types;if(n){var i=h(t)||"";n.forEach((function(e){e.namespace===i&&delete e.namespace}))}r(null,t)}else r(new Error("empty root import"))}))}function c(e,t){t=t||{},this._tk=new f(e),this._ackVoidMessages=!!t.ackVoidMessages,this._implicitTags=!t.delimitedCollections,this._typeRefs=t.typeRefs||a}function f(e){this._str=e,this.pos=0}function l(e){for(var t=e.replace(/^[ \t]+|[ \t]+$/g,"").split("\n").map((function(e,t){return t?e.replace(/^\s*\*\s?/,""):e}));t.length&&!t[0];)t.shift();for(;t.length&&!t[t.length-1];)t.pop();return t.join("\n")}function h(e){if(e.namespace)return e.namespace;var t=/^(.*)\.[^.]+$/.exec(e.protocol);return t?t[1]:void 0}c.readProtocol=function(e,t){var r=new c(e,t)._readProtocol();if(r.imports.length)throw new Error("unresolvable import");return r.protocol},c.readSchema=function(e,t){var r=new c(e,t),n=r._readJavadoc(),i=r._readType(void 0===n?{}:{doc:n},!0);return r._tk.next({id:"(eof)"}),i},c.prototype._readProtocol=function(){var e,t=this._tk,r=[],n=[],i={};this._readImports(r);var o={},a=this._readJavadoc();for(void 0!==a&&(o.doc=a),this._readAnnotations(o),t.next({val:"protocol"}),t.next({val:"{",silent:!0})||(o.protocol=t.next({id:"name"}).val,t.next({val:"{"}));!t.next({val:"}",silent:!0});)if(!this._readImports(r)){var u=this._readJavadoc(),c=this._readType({},!0),f=this._readImports(r,!0),l=void 0;if(e=t.pos,!f&&(l=this._readMessage(c))){void 0!==u&&void 0===l.schema.doc&&(l.schema.doc=u);var h=!1;if("void"!==l.schema.response&&"void"!==l.schema.response.type||(h=!this._ackVoidMessages&&!l.schema.errors,"void"===l.schema.response?l.schema.response="null":l.schema.response.type="null"),h&&(l.schema["one-way"]=!0),i[l.name])throw new Error(s("duplicate message: %s",l.name));i[l.name]=l.schema}else u&&("string"==typeof c?c={doc:u,type:c}:void 0===c.doc&&(c.doc=u)),n.push(c),t.pos=e,t.next({val:";",silent:!0});u=void 0}return t.next({id:"(eof)"}),n.length&&(o.types=n),Object.keys(i).length&&(o.messages=i),{protocol:o,imports:r}},c.prototype._readAnnotations=function(e){for(var t=this._tk;t.next({val:"@",silent:!0});){for(var r=[];!t.next({val:"(",silent:!0});)r.push(t.next().val);e[r.join("")]=t.next({id:"json"}).val,t.next({val:")"})}},c.prototype._readMessage=function(e){var t=this._tk,r={request:[],response:e};this._readAnnotations(r);var n=t.next().val;if("("===t.next().val){if(!t.next({val:")",silent:!0}))do{r.request.push(this._readField())}while(!t.next({val:")",silent:!0})&&t.next({val:","}));var i=t.next();switch(i.val){case"throws":r.errors=[];do{r.errors.push(this._readType())}while(!t.next({val:";",silent:!0})&&t.next({val:","}));break;case"oneway":r["one-way"]=!0,t.next({val:";"});break;case";":break;default:throw t.error("invalid message suffix",i)}return{name:n,schema:r}}},c.prototype._readJavadoc=function(){var e=this._tk.next({id:"javadoc",emitJavadoc:!0,silent:!0});if(e)return e.val},c.prototype._readField=function(){var e=this._tk,t=this._readJavadoc(),r={type:this._readType()};return void 0!==t&&void 0===r.doc&&(r.doc=t),this._readAnnotations(r),r.name=e.next({id:"name"}).val,e.next({val:"=",silent:!0})&&(r.default=e.next({id:"json"}).val),r},c.prototype._readType=function(e,t){switch(e=e||{},this._readAnnotations(e),e.type=this._tk.next({id:"name"}).val,e.type){case"record":case"error":return this._readRecord(e);case"fixed":return this._readFixed(e);case"enum":return this._readEnum(e,t);case"map":return this._readMap(e);case"array":return this._readArray(e);case"union":if(Object.keys(e).length>1)throw new Error("union annotations are not supported");return this._readUnion();default:var r=this._typeRefs[e.type];return r&&(delete e.type,i.copyOwnProperties(r,e)),Object.keys(e).length>1?e:e.type}},c.prototype._readFixed=function(e){var t=this._tk;return t.next({val:"(",silent:!0})||(e.name=t.next({id:"name"}).val,t.next({val:"("})),e.size=parseInt(t.next({id:"number"}).val),t.next({val:")"}),e},c.prototype._readMap=function(e){var t=this._tk,r=this._implicitTags,n=void 0===t.next({val:"<",silent:r});return e.values=this._readType(),t.next({val:">",silent:n}),e},c.prototype._readArray=function(e){var t=this._tk,r=this._implicitTags,n=void 0===t.next({val:"<",silent:r});return e.items=this._readType(),t.next({val:">",silent:n}),e},c.prototype._readEnum=function(e,t){var r=this._tk;r.next({val:"{",silent:!0})||(e.name=r.next({id:"name"}).val,r.next({val:"{"})),e.symbols=[];do{e.symbols.push(r.next().val)}while(!r.next({val:"}",silent:!0})&&r.next({val:","}));return t&&r.next({val:"=",silent:!0})&&(e.default=r.next().val,r.next({val:";"})),e},c.prototype._readUnion=function(){var e=this._tk,t=[];e.next({val:"{"});do{t.push(this._readType())}while(!e.next({val:"}",silent:!0})&&e.next({val:","}));return t},c.prototype._readRecord=function(e){var t=this._tk;for(t.next({val:"{",silent:!0})||(e.name=t.next({id:"name"}).val,t.next({val:"{"})),e.fields=[];!t.next({val:"}",silent:!0});)e.fields.push(this._readField()),t.next({val:";"});return e},c.prototype._readImports=function(e,t){for(var r=this._tk,n=0,i=r.pos;r.next({val:"import",silent:!0});){if(!n&&t&&r.next({val:"(",silent:!0}))return void(r.pos=i);var o=r.next({id:"name"}).val,s=JSON.parse(r.next({id:"string"}).val);r.next({val:";"}),e.push({kind:o,name:s}),n++}return n},f.prototype.next=function(e){var t,r={pos:this.pos,id:void 0,val:void 0},n=this._skip(e&&e.emitJavadoc);if("string"==typeof n)r.id="javadoc",r.val=n;else{var i=this.pos,o=this._str,a=o.charAt(i);if(a)if(e&&"json"===e.id?(r.id="json",this.pos=this._endOfJson()):'"'===a?(r.id="string",this.pos=this._endOfString()):/[0-9]/.test(a)?(r.id="number",this.pos=this._endOf(/[0-9]/)):/[`A-Za-z_.]/.test(a)?(r.id="name",this.pos=this._endOf(/[`A-Za-z0-9_.]/)):(r.id="operator",this.pos=i+1),r.val=o.slice(i,this.pos),"json"===r.id)try{r.val=JSON.parse(r.val)}catch(t){throw this.error("invalid JSON",r)}else"name"===r.id&&(r.val=r.val.replace(/`/g,""));else r.id="(eof)"}if(e&&e.id&&e.id!==r.id?t=this.error(s("expected ID %s",e.id),r):e&&e.val&&e.val!==r.val&&(t=this.error(s("expected value %s",e.val),r)),t){if(e&&e.silent)return void(this.pos=r.pos);throw t}return r},f.prototype.error=function(e,t){var r,n="number"!=typeof t,i=n?t.pos:t,o=this._str,a=1,u=0;for(r=0;r<i;r++)"\n"===o.charAt(r)&&(a++,u=r);var c=n?s("invalid token %j: %s",t,e):e,f=new Error(c);return f.token=n?t:void 0,f.lineNum=a,f.colNum=i-u,f},f.prototype._skip=function(e){for(var t,r,n=this._str,i=!1;(r=n.charAt(this.pos))&&/\s/.test(r);)this.pos++;if(t=this.pos,"/"===r)switch(n.charAt(this.pos+1)){case"/":for(this.pos+=2;(r=n.charAt(this.pos))&&"\n"!==r;)this.pos++;return this._skip(e);case"*":for(this.pos+=2,"*"===n.charAt(this.pos)&&(i=!0);r=n.charAt(this.pos++);)if("*"===r&&"/"===n.charAt(this.pos))return this.pos++,i&&e?l(n.slice(t+3,this.pos-2)):this._skip(e);throw this.error("unterminated comment",t)}},f.prototype._endOf=function(e){for(var t=this.pos,r=this._str;e.test(r.charAt(t));)t++;return t},f.prototype._endOfString=function(){for(var e,t=this.pos+1,r=this._str;e=r.charAt(t);){if('"'===e)return t+1;"\\"===e?t+=2:t++}throw this.error("unterminated string",t-1)},f.prototype._endOfJson=function(){var e=i.jsonEnd(this._str,this.pos);if(e<0)throw this.error("invalid JSON",e);return e},e.exports={Tokenizer:f,assembleProtocol:u,read:function(e){var t;if("string"==typeof e&&~e.indexOf(o.sep)&&n.existsSync(e)){var r=n.readFileSync(e,{encoding:"utf8"});try{return JSON.parse(r)}catch(i){u(e,{importHook:n.createSyncImportHook()},(function(e,n){t=e?r:n}))}}else t=e;if("string"!=typeof t||"null"===t)return t;try{return JSON.parse(t)}catch(e){try{return c.readProtocol(t)}catch(e){try{return c.readSchema(t)}catch(e){return t}}}},readProtocol:c.readProtocol,readSchema:c.readSchema}},77725:(e,t,r)=>{"use strict";var n=r(22561),i=r(48287),o=r(40537),s=i.Buffer,a=i.SlowBuffer,u=n.Tap,c=o.debuglog("avsc:types"),f=o.format,l={array:F,boolean:b,bytes:A,double:x,enum:O,error:R,fixed:I,float:E,int:_,long:w,map:N,null:v,record:R,string:B},h=new n.Lcg,p=new u(new a(1024)),d=null,y=[];function g(e,t){var r;if(d?(r=d,y.push([d,this]),d=null):r=this,this._hash=new D,this.name=void 0,this.aliases=void 0,this.doc=e&&e.doc?""+e.doc:void 0,e){var n=e.name,i=void 0===e.namespace?t&&t.namespace:e.namespace;if(void 0!==n){if($(n=J(n,i)))throw new Error(f("cannot rename primitive type: %j",n));var o=t&&t.registry;if(o){if(void 0!==o[n])throw new Error(f("duplicate type name: %s",n));o[n]=r}}else if(t&&t.noAnonymousTypes)throw new Error(f("missing name property in schema: %j",e));this.name=n,this.aliases=e.aliases?e.aliases.map((function(e){return J(e,i)})):[]}}function m(e){g.call(this),this._branchConstructor=this._createBranchConstructor(),e||Object.freeze(this)}function v(){m.call(this)}function b(){m.call(this)}function _(){m.call(this)}function w(){m.call(this)}function E(){m.call(this)}function x(){m.call(this)}function B(){m.call(this)}function A(){m.call(this)}function S(e,t){if(g.call(this),!Array.isArray(e))throw new Error(f("non-array union schema: %j",e));if(!e.length)throw new Error("empty union");this.types=Object.freeze(e.map((function(e){return g.forSchema(e,t)}))),this._branchIndices={},this.types.forEach((function(e,t){if(g.isType(e,"union"))throw new Error("unions cannot be directly nested");var r=e.branchName;if(void 0!==this._branchIndices[r])throw new Error(f("duplicate union branch name: %j",r));this._branchIndices[r]=t}),this)}function k(e,t){S.call(this,e,t),this._dynamicBranches=null,this._bucketIndices={},this.types.forEach((function(e,t){if(g.isType(e,"abstract","logical"))this._dynamicBranches||(this._dynamicBranches=[]),this._dynamicBranches.push({index:t,type:e});else{var r=W(e);if(void 0!==this._bucketIndices[r])throw new Error(f("ambiguous unwrapped union: %j",this));this._bucketIndices[r]=t}}),this),Object.freeze(this)}function T(e,t){S.call(this,e,t),Object.freeze(this)}function O(e,t){if(g.call(this,e,t),!Array.isArray(e.symbols)||!e.symbols.length)throw new Error(f("invalid enum symbols: %j",e.symbols));if(this.symbols=Object.freeze(e.symbols.slice()),this._indices={},this.symbols.forEach((function(e,t){if(!n.isValidName(e))throw new Error(f("invalid %s symbol: %j",this,e));if(void 0!==this._indices[e])throw new Error(f("duplicate %s symbol: %j",this,e));this._indices[e]=t}),this),this.default=e.default,void 0!==this.default&&void 0===this._indices[this.default])throw new Error(f("invalid %s default: %j",this,this.default));this._branchConstructor=this._createBranchConstructor(),Object.freeze(this)}function I(e,t){if(g.call(this,e,t),e.size!==(0|e.size)||e.size<0)throw new Error(f("invalid %s size",this.branchName));this.size=0|e.size,this._branchConstructor=this._createBranchConstructor(),Object.freeze(this)}function N(e,t){if(g.call(this),!e.values)throw new Error(f("missing map values: %j",e));this.valuesType=g.forSchema(e.values,t),this._branchConstructor=this._createBranchConstructor(),Object.freeze(this)}function F(e,t){if(g.call(this),!e.items)throw new Error(f("missing array items: %j",e));this.itemsType=g.forSchema(e.items,t),this._branchConstructor=this._createBranchConstructor(),Object.freeze(this)}function R(e,t){var r=(t=t||{}).namespace;if(void 0!==e.namespace)t.namespace=e.namespace;else if(e.name){var i=n.impliedNamespace(e.name);void 0!==i&&(t.namespace=i)}if(g.call(this,e,t),!Array.isArray(e.fields))throw new Error(f("non-array record fields: %j",e.fields));if(n.hasDuplicates(e.fields,(function(e){return e.name})))throw new Error(f("duplicate field name: %j",e.fields));this._fieldsByName={},this.fields=Object.freeze(e.fields.map((function(e){var r=new C(e,t);return this._fieldsByName[r.name]=r,r}),this)),this._branchConstructor=this._createBranchConstructor(),this._isError="error"===e.type,this.recordConstructor=this._createConstructor(t.errorStackTraces,t.omitRecordMethods),this._read=this._createReader(),this._skip=this._createSkipper(),this._write=this._createWriter(),this._check=this._createChecker(),t.namespace=r,Object.freeze(this)}function L(e,t){this._logicalTypeName=e.logicalType,g.call(this),d=this;try{this._underlyingType=g.forSchema(e,t)}finally{d=null;var r=y.length;r&&y[r-1][0]===this&&y.pop()}g.isType(this.underlyingType,"union")?this._branchConstructor=this.underlyingType._branchConstructor:this._branchConstructor=this.underlyingType._createBranchConstructor()}function U(e){this._concreteTypeName="long",m.call(this,!0),this._noUnpack=!!e}function C(e,t){var r=e.name;if("string"!=typeof r||!n.isValidName(r))throw new Error(f("invalid field name: %s",r));this.name=r,this.type=g.forSchema(e.type,t),this.aliases=e.aliases||[],this.doc=void 0!==e.doc?""+e.doc:void 0,this._order=function(e){switch(e){case"ascending":return 1;case"descending":return-1;case"ignore":return 0;default:throw new Error(f("invalid order: %j",e))}}(void 0===e.order?"ascending":e.order);var i=e.default;if(void 0!==i){var o,s=this.type;try{o=s._copy(i,{coerce:2,wrap:2})}catch(e){var a=f("incompatible field default %j (%s)",i,e.message);throw g.isType(s,"union")&&(a+=f(", union defaults must match the first branch's type (%j)",s.types[0])),new Error(a)}$(s.typeName)&&"bytes"!==s.typeName?this.defaultValue=function(){return o}:this.defaultValue=function(){return s._copy(o)}}Object.freeze(this)}function j(e){this._readerType=e,this._read=null,this.itemsType=null,this.size=0,this.symbols=null,this.valuesType=null}function D(){this.str=void 0}function M(e,t,r,n){if(r){if(r._readerType!==e)throw new Error("invalid resolver");return r._read(t,n)}return e._read(t)}function P(e){var t={};e.name&&(t[e.name]=!0);var r,n,i=e.aliases;for(r=0,n=i.length;r<n;r++)t[i[r]]=!0;return Object.keys(t)}function z(e,t,r){if(!t.name)return!0;var i,o,s,a=r?t.name:n.unqualify(t.name),u=P(e);for(i=0,o=u.length;i<o;i++)if(s=u[i],r||(s=n.unqualify(s)),s===a)return!0;return!1}function $(e){var t=l[e];return t&&t.prototype instanceof m}function H(e){if("error"===e)e="record";else{var t=/^([^:]+):(.*)$/.exec(e);t&&(e="union"===t[1]?t[2]+"Union":t[1])}return n.capitalize(e)+"Type"}function V(e){var t=e.readLong();return t<0&&(t=-t,e.skipLong()),t}function Z(e){return e>=-9007199254740990&&e<=9007199254740990}function q(e){return e&&"Buffer"===e.type&&Array.isArray(e.data)}function G(e,t){throw new Error(f("invalid %j: %j",t.schema(),e))}function J(e,t){var r=n.unqualify(e);return $(r)?r:n.qualify(e,t)}function W(e){var t=e.typeName;switch(t){case"double":case"float":case"int":case"long":return"number";case"bytes":case"fixed":return"buffer";case"enum":return"string";case"map":case"error":case"record":return"object";default:return t}}function Y(e){if(null===e)return"null";var t=typeof e;if("object"===t){if(Array.isArray(e))return"array";if(s.isBuffer(e))return"buffer"}return t}g.forSchema=function(e,t){(t=t||{}).registry=t.registry||{};var r,n=function(e){switch(!0===e?e="always":!1===e?e="never":void 0===e?e="auto":"string"==typeof e&&(e=e.toLowerCase()),e){case"always":return T;case"never":return k;case"auto":return;default:throw new Error(f("invalid wrap unions option: %j",e))}}(t.wrapUnions);if(null===e)throw new Error('invalid type: null (did you mean "null"?)');if(g.isType(e))return e;if(t.typeHook&&(r=t.typeHook(e,t))){if(!g.isType(r))throw new Error(f("invalid typehook return value: %j",r));return r}if("string"==typeof e){if(e=J(e,t.namespace),r=t.registry[e])return r;if($(e))return t.registry[e]=g.forSchema({type:e},t);throw new Error(f("undefined type name: %s",e))}if(e.logicalType&&t.logicalTypes&&!d){var i=t.logicalTypes[e.logicalType];if(i){var o=t.namespace,s={};Object.keys(t.registry).forEach((function(e){s[e]=t.registry[e]}));try{return c("instantiating logical type for %s",e.logicalType),new i(e,t)}catch(r){if(c("failed to instantiate logical type for %s",e.logicalType),t.assertLogicalTypes)throw r;d=null,t.namespace=o,t.registry=s}}}if(Array.isArray(e)){var a=d;d=null;var u=e.map((function(e){return g.forSchema(e,t)}));n||(n=function(e){var t,r,n,i,o={};for(t=0,r=e.length;t<r;t++)if(i=e[t],!g.isType(i,"logical")){if(o[n=W(i)])return!0;o[n]=!0}return!1}(u)?T:k),d=a,r=new n(u,t)}else r=function(r){var n=l[r];if(void 0===n)throw new Error(f("unknown type: %j",r));return new n(e,t)}(e.type);return r},g.forValue=function(e,t){if((t=t||{}).emptyArrayType=t.emptyArrayType||g.forSchema({type:"array",items:"null"}),t.valueHook){var r=t.valueHook(e,t);if(void 0!==r){if(!g.isType(r))throw new Error(f("invalid value hook return value: %j",r));return r}}switch(typeof e){case"string":return g.forSchema("string",t);case"boolean":return g.forSchema("boolean",t);case"number":return(0|e)===e?g.forSchema("int",t):Math.abs(e)<9007199254740991?g.forSchema("float",t):g.forSchema("double",t);case"object":if(null===e)return g.forSchema("null",t);if(Array.isArray(e))return e.length?g.forSchema({type:"array",items:g.forTypes(e.map((function(e){return g.forValue(e,t)})),t)},t):t.emptyArrayType;if(s.isBuffer(e))return g.forSchema("bytes",t);var i=Object.keys(e);return i.some((function(e){return!n.isValidName(e)}))?g.forSchema({type:"map",values:g.forTypes(i.map((function(r){return g.forValue(e[r],t)})),t)},t):g.forSchema({type:"record",fields:i.map((function(r){return{name:r,type:g.forValue(e[r],t)}}))},t);default:throw new Error(f("cannot infer type from: %j",e))}},g.forTypes=function(e,t){if(!e.length)throw new Error("no types to combine");if(1===e.length)return e[0];t=t||{};var r=[],n=0,i=!0;if(e.forEach((function(e){switch(e.typeName){case"union:unwrapped":i=!1,r=r.concat(e.types);break;case"union:wrapped":n++,r=r.concat(e.types);break;case"null":r.push(e);break;default:i=!1,r.push(e)}})),n){if(!i)throw new Error("cannot combine wrapped union");var o={};r.forEach((function(e){var t=e.branchName,r=o[t];if(r){if(!e.equals(r))throw new Error("inconsistent branch type")}else o[t]=e}));var s,a=t.wrapUnions;t.wrapUnions=!0;try{s=g.forSchema(Object.keys(o).map((function(e){return o[e]})),t)}catch(e){throw t.wrapUnions=a,e}return t.wrapUnions=a,s}var u={};r.forEach((function(e){var t=W(e),r=u[t];r||(u[t]=r=[]),r.push(e)}));var c=Object.keys(u).map((function(e){var r=u[e];if(1===r.length)return r[0];switch(e){case"null":case"boolean":return r[0];case"number":return function(e){var t,r,n,i,o=["int","long","float","double"],s=-1,a=null;for(t=0,r=e.length;t<r;t++)n=e[t],(i=o.indexOf(n.typeName))>s&&(s=i,a=n);return a}(r);case"string":return function(e,t){var r,n,i,o,s={};for(r=0,n=e.length;r<n;r++){if("string"===(i=e[r]).typeName)return i;var a,u;for(a=0,u=(o=i.symbols).length;a<u;a++)s[o[a]]=!0}return g.forSchema({type:"enum",symbols:Object.keys(s)},t)}(r,t);case"buffer":return function(e,t){var r,n,i,o=-1;for(r=0,n=e.length;r<n;r++){if("bytes"===(i=e[r]).typeName)return i;-1===o?o=i.size:i.size!==o&&(o=-2)}return o<0?g.forSchema("bytes",t):e[0]}(r,t);case"array":return(r=r.filter((function(e){return e!==t.emptyArrayType}))).length?g.forSchema({type:"array",items:g.forTypes(r.map((function(e){return e.itemsType})),t)},t):t.emptyArrayType;default:return function(e,t){var r,n,i,o,s,a=[],u={},c={},f=!0;for(r=0,n=e.length;r<n;r++){var l,h,p,d,y,m;if("map"===(i=e[r]).typeName)f=!1,a.push(i.valuesType);else for(l=0,h=(o=i.fields).length;l<h;l++)y=(p=o[l]).name,m=p.type,a.push(m),f&&(u[y]||(u[y]=[]),u[y].push(m),void 0!==(d=p.defaultValue())&&(c[y]=d))}if(f){var v=Object.keys(u);for(r=0,n=v.length;r<n;r++)y=v[r],u[y].length<e.length&&void 0===c[y]&&(t&&t.strictDefaults?f=!1:(u[y].unshift(g.forSchema("null",t)),c[y]=null))}return s=f?{type:"record",fields:v.map((function(e){var r=g.forTypes(u[e],t),n=c[e];if(void 0!==n&&~r.typeName.indexOf("union")){var i,o,s=r.types.slice();for(i=0,o=s.length;i<o&&!s[i].isValid(n);i++);if(i>0){var a=s[0];s[0]=s[i],s[i]=a,r=g.forSchema(s,t)}}return{name:e,type:r,default:c[e]}}))}:{type:"map",values:g.forTypes(a,t)},g.forSchema(s,t)}(r,t)}}));return 1===c.length?c[0]:g.forSchema(c,t)},g.isType=function(){var e=arguments.length;if(!e)return!1;var t=arguments[0];if(!t||"function"!=typeof t._update||"function"!=typeof t.fingerprint)return!1;if(1===e)return!0;var r,n=t.typeName;for(r=1;r<e;r++)if(0===n.indexOf(arguments[r]))return!0;return!1},g.__reset=function(e){c("resetting type buffer to %d",e),p.buf=new a(e)},Object.defineProperty(g.prototype,"branchName",{enumerable:!0,get:function(){var e=g.isType(this,"logical")?this.underlyingType:this;return e.name?e.name:g.isType(e,"abstract")?e._concreteTypeName:g.isType(e,"union")?void 0:e.typeName}}),g.prototype.clone=function(e,t){return t?(t={coerce:0|!!t.coerceBuffers,fieldHook:t.fieldHook,qualifyNames:!!t.qualifyNames,skip:!!t.skipMissingFields,wrap:0|!!t.wrapUnions},this._copy(e,t)):this.fromBuffer(this.toBuffer(e))},g.prototype.compare=n.abstractFunction,g.prototype.compareBuffers=function(e,t){return this._match(new u(e),new u(t))},g.prototype.createResolver=function(e,t){if(!g.isType(e))throw new Error(f("not a type: %j",e));if(!g.isType(this,"union","logical")&&g.isType(e,"logical"))return this.createResolver(e.underlyingType,t);var r,n;if((t=t||{}).registry=t.registry||{},g.isType(this,"record","error")&&g.isType(e,"record","error")&&(n=this.name+":"+e.name,r=t.registry[n]))return r;if(r=new j(this),n&&(t.registry[n]=r),g.isType(e,"union")){var i=e.types.map((function(e){return this.createResolver(e,t)}),this);r._read=function(e){var t=e.readLong();if(void 0===i[t])throw new Error(f("invalid union index: %s",t));return i[t]._read(e)}}else this._update(r,e,t);if(!r._read)throw new Error(f("cannot read %s as %s",e,this));return Object.freeze(r)},g.prototype.decode=function(e,t,r){var n=new u(e,t),i=M(this,n,r);return n.isValid()?{value:i,offset:n.pos}:{value:void 0,offset:-1}},g.prototype.encode=function(e,t,r){var n=new u(t,r);return this._write(n,e),n.isValid()?n.pos:t.length-n.pos},g.prototype.equals=function(e,t){var r=g.isType(e)&&this.fingerprint().equals(e.fingerprint());return r&&t&&t.strict?JSON.stringify(this.schema({exportAttrs:!0}))===JSON.stringify(e.schema({exportAttrs:!0})):r},g.prototype.fingerprint=function(e){if(e)return n.getHash(JSON.stringify(this.schema()),e);if(!this._hash.str){var t=JSON.stringify(this.schema());this._hash.str=n.getHash(t).toString("binary")}return n.bufferFrom(this._hash.str,"binary")},g.prototype.fromBuffer=function(e,t,r){var n=new u(e),i=M(this,n,t,r);if(!n.isValid())throw new Error("truncated buffer");if(!r&&n.pos<e.length)throw new Error("trailing data");return i},g.prototype.fromString=function(e){return this._copy(JSON.parse(e),{coerce:2})},g.prototype.inspect=function(){var e=this.typeName,t=H(e);if($(e))return f("<%s>",t);var r=this.schema({exportAttrs:!0,noDeref:!0});return"object"!=typeof r||g.isType(this,"logical")||(r.type=void 0),f("<%s %j>",t,r)},g.prototype.isValid=function(e,t){var r,n,i=0|(t&&t.noUndeclaredFields),o=t&&t.errorHook;return o&&(n=[],r=function(t,r){o.call(this,n.slice(),t,r,e)}),this._check(e,i,r,n)},g.prototype.random=n.abstractFunction,g.prototype.schema=function(e){return this._attrs({exportAttrs:!(!e||!e.exportAttrs),noDeref:!(!e||!e.noDeref)})},g.prototype.toBuffer=function(e){p.pos=0,this._write(p,e);var t=n.newBuffer(p.pos);return p.isValid()?p.buf.copy(t,0,0,p.pos):this._write(new u(t),e),t},g.prototype.toJSON=function(){return this.schema({exportAttrs:!0})},g.prototype.toString=function(e){return void 0===e?JSON.stringify(this.schema({noDeref:!0})):JSON.stringify(this._copy(e,{coerce:3}))},g.prototype.wrap=function(e){var t=this._branchConstructor;return null===t?null:new t(e)},g.prototype._attrs=function(e){e.derefed=e.derefed||{};var t=this.name;if(void 0!==t){if(e.noDeref||e.derefed[t])return t;e.derefed[t]=!0}var r={};void 0!==this.name&&(r.name=t),r.type=this.typeName;var n=this._deref(r,e);return void 0!==n&&(r=n),e.exportAttrs&&(this.aliases&&this.aliases.length&&(r.aliases=this.aliases),void 0!==this.doc&&(r.doc=this.doc)),r},g.prototype._createBranchConstructor=function(){var e=this.branchName;if("null"===e)return null;var t=~e.indexOf(".")?"this['"+e+"']":"this."+e,r=new Function("return function Branch$(val) { "+t+" = val; };")();return r.type=this,r.prototype.unwrap=new Function("return "+t+";"),r.prototype.unwrapped=r.prototype.unwrap,r},g.prototype._peek=function(e){var t=e.pos,r=this._read(e);return e.pos=t,r},g.prototype._check=n.abstractFunction,g.prototype._copy=n.abstractFunction,g.prototype._deref=n.abstractFunction,g.prototype._match=n.abstractFunction,g.prototype._read=n.abstractFunction,g.prototype._skip=n.abstractFunction,g.prototype._update=n.abstractFunction,g.prototype._write=n.abstractFunction,g.prototype.getAliases=function(){return this.aliases},g.prototype.getFingerprint=g.prototype.fingerprint,g.prototype.getName=function(e){return this.name||!e?this.name:this.branchName},g.prototype.getSchema=g.prototype.schema,g.prototype.getTypeName=function(){return this.typeName},o.inherits(m,g),m.prototype._update=function(e,t){t.typeName===this.typeName&&(e._read=this._read)},m.prototype._copy=function(e){return this._check(e,void 0,G),e},m.prototype._deref=function(){return this.typeName},m.prototype.compare=n.compare,o.inherits(v,m),v.prototype._check=function(e,t,r){var n=null===e;return!n&&r&&r(e,this),n},v.prototype._read=function(){return null},v.prototype._skip=function(){},v.prototype._write=function(e,t){null!==t&&G(t,this)},v.prototype._match=function(){return 0},v.prototype.compare=v.prototype._match,v.prototype.typeName="null",v.prototype.random=v.prototype._read,o.inherits(b,m),b.prototype._check=function(e,t,r){var n="boolean"==typeof e;return!n&&r&&r(e,this),n},b.prototype._read=function(e){return e.readBoolean()},b.prototype._skip=function(e){e.skipBoolean()},b.prototype._write=function(e,t){"boolean"!=typeof t&&G(t,this),e.writeBoolean(t)},b.prototype._match=function(e,t){return e.matchBoolean(t)},b.prototype.typeName="boolean",b.prototype.random=function(){return h.nextBoolean()},o.inherits(_,m),_.prototype._check=function(e,t,r){var n=e===(0|e);return!n&&r&&r(e,this),n},_.prototype._read=function(e){return e.readInt()},_.prototype._skip=function(e){e.skipInt()},_.prototype._write=function(e,t){t!==(0|t)&&G(t,this),e.writeInt(t)},_.prototype._match=function(e,t){return e.matchInt(t)},_.prototype.typeName="int",_.prototype.random=function(){return 0|h.nextInt(1e3)},o.inherits(w,m),w.prototype._check=function(e,t,r){var n="number"==typeof e&&e%1==0&&Z(e);return!n&&r&&r(e,this),n},w.prototype._read=function(e){var t=e.readLong();if(!Z(t))throw new Error("potential precision loss");return t},w.prototype._skip=function(e){e.skipLong()},w.prototype._write=function(e,t){("number"!=typeof t||t%1||!Z(t))&&G(t,this),e.writeLong(t)},w.prototype._match=function(e,t){return e.matchLong(t)},w.prototype._update=function(e,t){switch(t.typeName){case"int":e._read=t._read;break;case"abstract:long":case"long":e._read=this._read}},w.prototype.typeName="long",w.prototype.random=function(){return h.nextInt()},w.__with=function(e,t){e=e||{};var r={toBuffer:"_toBuffer",fromBuffer:"_fromBuffer",fromJSON:"_fromJSON",toJSON:"_toJSON",isValid:"_isValid",compare:"compare"},n=new U(t);return Object.keys(r).forEach((function(t){if(void 0===e[t])throw new Error(f("missing method implementation: %s",t));n[r[t]]=e[t]})),Object.freeze(n)},o.inherits(E,m),E.prototype._check=function(e,t,r){var n="number"==typeof e;return!n&&r&&r(e,this),n},E.prototype._read=function(e){return e.readFloat()},E.prototype._skip=function(e){e.skipFloat()},E.prototype._write=function(e,t){"number"!=typeof t&&G(t,this),e.writeFloat(t)},E.prototype._match=function(e,t){return e.matchFloat(t)},E.prototype._update=function(e,t){switch(t.typeName){case"float":case"int":e._read=t._read;break;case"abstract:long":case"long":e._read=function(e){return e.readLong()}}},E.prototype.typeName="float",E.prototype.random=function(){return h.nextFloat(1e3)},o.inherits(x,m),x.prototype._check=function(e,t,r){var n="number"==typeof e;return!n&&r&&r(e,this),n},x.prototype._read=function(e){return e.readDouble()},x.prototype._skip=function(e){e.skipDouble()},x.prototype._write=function(e,t){"number"!=typeof t&&G(t,this),e.writeDouble(t)},x.prototype._match=function(e,t){return e.matchDouble(t)},x.prototype._update=function(e,t){switch(t.typeName){case"double":case"float":case"int":e._read=t._read;break;case"abstract:long":case"long":e._read=function(e){return e.readLong()}}},x.prototype.typeName="double",x.prototype.random=function(){return h.nextFloat()},o.inherits(B,m),B.prototype._check=function(e,t,r){var n="string"==typeof e;return!n&&r&&r(e,this),n},B.prototype._read=function(e){return e.readString()},B.prototype._skip=function(e){e.skipString()},B.prototype._write=function(e,t){"string"!=typeof t&&G(t,this),e.writeString(t)},B.prototype._match=function(e,t){return e.matchString(t)},B.prototype._update=function(e,t){switch(t.typeName){case"bytes":case"string":e._read=this._read}},B.prototype.typeName="string",B.prototype.random=function(){return h.nextString(h.nextInt(32))},o.inherits(A,m),A.prototype._check=function(e,t,r){var n=s.isBuffer(e);return!n&&r&&r(e,this),n},A.prototype._read=function(e){return e.readBytes()},A.prototype._skip=function(e){e.skipBytes()},A.prototype._write=function(e,t){s.isBuffer(t)||G(t,this),e.writeBytes(t)},A.prototype._match=function(e,t){return e.matchBytes(t)},A.prototype._update=B.prototype._update,A.prototype._copy=function(e,t){var r;switch(0|(t&&t.coerce)){case 3:return this._check(e,void 0,G),e.toString("binary");case 2:if("string"!=typeof e)throw new Error(f("cannot coerce to buffer: %j",e));return r=n.bufferFrom(e,"binary"),this._check(r,void 0,G),r;case 1:if(!q(e))throw new Error(f("cannot coerce to buffer: %j",e));return r=n.bufferFrom(e.data),this._check(r,void 0,G),r;default:return this._check(e,void 0,G),n.bufferFrom(e)}},A.prototype.compare=s.compare,A.prototype.typeName="bytes",A.prototype.random=function(){return h.nextBuffer(h.nextInt(32))},o.inherits(S,g),S.prototype._branchConstructor=function(){throw new Error("unions cannot be directly wrapped")},S.prototype._skip=function(e){this.types[e.readLong()]._skip(e)},S.prototype._match=function(e,t){var r=e.readLong(),n=t.readLong();return r===n?this.types[r]._match(e,t):r<n?-1:1},S.prototype._deref=function(e,t){return this.types.map((function(e){return e._attrs(t)}))},S.prototype.getTypes=function(){return this.types},o.inherits(k,S),k.prototype._getIndex=function(e){var t=this._bucketIndices[Y(e)];return this._dynamicBranches&&(t=this._getBranchIndex(e,t)),t},k.prototype._getBranchIndex=function(e,t){var r,n,i,o=this._dynamicBranches;for(r=0,n=o.length;r<n;r++)if((i=o[r]).type._check(e)){if(void 0!==t)throw new Error("ambiguous conversion");t=i.index}return t},k.prototype._check=function(e,t,r,n){var i=this._getIndex(e),o=void 0!==i;return o?this.types[i]._check(e,t,r,n):(r&&r(e,this),o)},k.prototype._read=function(e){var t=e.readLong(),r=this.types[t];if(r)return r._read(e);throw new Error(f("invalid union index: %s",t))},k.prototype._write=function(e,t){var r=this._getIndex(t);void 0===r&&G(t,this),e.writeLong(r),null!==t&&this.types[r]._write(e,t)},k.prototype._update=function(e,t,r){var n,i,o;for(n=0,i=this.types.length;n<i;n++){try{o=this.types[n].createResolver(t,r)}catch(e){continue}return void(e._read=function(e){return o._read(e)})}},k.prototype._copy=function(e,t){var r,n=t&&0|t.coerce,i=t&&0|t.wrap;if(2===i)r=0;else{switch(n){case 1:r=q(e)&&void 0!==this._bucketIndices.buffer?this._bucketIndices.buffer:this._getIndex(e);break;case 2:if(null===e)r=this._bucketIndices.null;else if("object"==typeof e){var o=Object.keys(e);1===o.length&&(r=this._branchIndices[o[0]],e=e[o[0]])}break;default:r=this._getIndex(e)}void 0===r&&G(e,this)}var s=this.types[r];if(null===e||3===i)return s._copy(e,t);if(3===n){var a={};return a[s.branchName]=s._copy(e,t),a}return s._copy(e,t)},k.prototype.compare=function(e,t){var r=this._getIndex(e),i=this._getIndex(t);if(void 0===r)G(e,this);else{if(void 0!==i)return r===i?this.types[r].compare(e,t):n.compare(r,i);G(t,this)}},k.prototype.typeName="union:unwrapped",k.prototype.random=function(){var e=h.nextInt(this.types.length);return this.types[e].random()},o.inherits(T,S),T.prototype._check=function(e,t,r,n){var i=!1;if(null===e)i=void 0!==this._branchIndices.null;else if("object"==typeof e){var o=Object.keys(e);if(1===o.length){var s=o[0],a=this._branchIndices[s];if(void 0!==a)return r?(n.push(s),i=this.types[a]._check(e[s],t,r,n),n.pop(),i):this.types[a]._check(e[s],t)}}return!i&&r&&r(e,this),i},T.prototype._read=function(e){var t=this.types[e.readLong()];if(!t)throw new Error(f("invalid union index"));var r=t._branchConstructor;return null===r?null:new r(t._read(e))},T.prototype._write=function(e,t){var r,n,i;null===t?(void 0===(r=this._branchIndices.null)&&G(t,this),e.writeLong(r)):(1===(n=Object.keys(t)).length&&(i=n[0],r=this._branchIndices[i]),void 0===r&&G(t,this),e.writeLong(r),this.types[r]._write(e,t[i]))},T.prototype._update=function(e,t,r){var n,i,o,s;for(n=0,i=this.types.length;n<i;n++){try{o=this.types[n].createResolver(t,r)}catch(e){continue}return s=this.types[n]._branchConstructor,void(e._read=s?function(e){return new s(o._read(e))}:function(){return null})}},T.prototype._copy=function(e,t){var r,i,o,s=t&&0|t.wrap;if(2===s){var a=this.types[0];return null===e&&"null"===a.typeName?null:new a._branchConstructor(a._copy(e,t))}if(null===e&&void 0!==this._branchIndices.null)return null;if("object"==typeof e){var u=Object.keys(e);if(1===u.length){var c,f,l=u[0];if(void 0===(r=this._branchIndices[l])&&t.qualifyNames)for(c=0,i=this.types.length;c<i;c++)if((f=this.types[c]).name&&l===n.unqualify(f.name)){r=c;break}void 0!==r&&(o=this.types[r]._copy(e[l],t))}}if(1===s&&void 0===o)for(r=0,i=this.types.length;r<i&&void 0===o;)try{o=this.types[r]._copy(e,t)}catch(e){r++}if(void 0!==o)return 3===s?o:new this.types[r]._branchConstructor(o);G(e,this)},T.prototype.compare=function(e,t){var r=null===e?"null":Object.keys(e)[0],i=null===t?"null":Object.keys(t)[0],o=this._branchIndices[r];return r===i?"null"===r?0:this.types[o].compare(e[r],t[r]):n.compare(o,this._branchIndices[i])},T.prototype.typeName="union:wrapped",T.prototype.random=function(){var e=h.nextInt(this.types.length),t=this.types[e],r=t._branchConstructor;return r?new r(t.random()):null},o.inherits(O,g),O.prototype._check=function(e,t,r){var n=void 0!==this._indices[e];return!n&&r&&r(e,this),n},O.prototype._read=function(e){var t=e.readLong(),r=this.symbols[t];if(void 0===r)throw new Error(f("invalid %s enum index: %s",this.name,t));return r},O.prototype._skip=function(e){e.skipLong()},O.prototype._write=function(e,t){var r=this._indices[t];void 0===r&&G(t,this),e.writeLong(r)},O.prototype._match=function(e,t){return e.matchLong(t)},O.prototype.compare=function(e,t){return n.compare(this._indices[e],this._indices[t])},O.prototype._update=function(e,t,r){var n=this.symbols;"enum"===t.typeName&&z(this,t,!r.ignoreNamespaces)&&(t.symbols.every((function(e){return~n.indexOf(e)}))||void 0!==this.default)&&(e.symbols=t.symbols.map((function(e){return void 0===this._indices[e]?this.default:e}),this),e._read=t._read)},O.prototype._copy=function(e){return this._check(e,void 0,G),e},O.prototype._deref=function(e){e.symbols=this.symbols},O.prototype.getSymbols=function(){return this.symbols},O.prototype.typeName="enum",O.prototype.random=function(){return h.choice(this.symbols)},o.inherits(I,g),I.prototype._check=function(e,t,r){var n=s.isBuffer(e)&&e.length===this.size;return!n&&r&&r(e,this),n},I.prototype._read=function(e){return e.readFixed(this.size)},I.prototype._skip=function(e){e.skipFixed(this.size)},I.prototype._write=function(e,t){s.isBuffer(t)&&t.length===this.size||G(t,this),e.writeFixed(t,this.size)},I.prototype._match=function(e,t){return e.matchFixed(t,this.size)},I.prototype.compare=s.compare,I.prototype._update=function(e,t,r){"fixed"===t.typeName&&this.size===t.size&&z(this,t,!r.ignoreNamespaces)&&(e.size=this.size,e._read=this._read)},I.prototype._copy=A.prototype._copy,I.prototype._deref=function(e){e.size=this.size},I.prototype.getSize=function(){return this.size},I.prototype.typeName="fixed",I.prototype.random=function(){return h.nextBuffer(this.size)},o.inherits(N,g),N.prototype._check=function(e,t,r,n){if(!e||"object"!=typeof e||Array.isArray(e))return r&&r(e,this),!1;var i,o,s,a,u=Object.keys(e),c=!0;if(r){for(s=n.length,n.push(""),i=0,o=u.length;i<o;i++)a=n[s]=u[i],this.valuesType._check(e[a],t,r,n)||(c=!1);n.pop()}else for(i=0,o=u.length;i<o;i++)if(!this.valuesType._check(e[u[i]],t))return!1;return c},N.prototype._read=function(e){for(var t,r=this.valuesType,n={};t=V(e);)for(;t--;)n[e.readString()]=r._read(e);return n},N.prototype._skip=function(e){for(var t,r,n=this.valuesType;r=e.readLong();)if(r<0)t=e.readLong(),e.pos+=t;else for(;r--;)e.skipString(),n._skip(e)},N.prototype._write=function(e,t){t&&"object"==typeof t&&!Array.isArray(t)||G(t,this);var r,n,i=this.valuesType,o=Object.keys(t),s=o.length;if(s)for(e.writeLong(s),r=0;r<s;r++)n=o[r],e.writeString(n),i._write(e,t[n]);e.writeLong(0)},N.prototype._match=function(){throw new Error("maps cannot be compared")},N.prototype._update=function(e,t,r){"map"===t.typeName&&(e.valuesType=this.valuesType.createResolver(t.valuesType,r),e._read=this._read)},N.prototype._copy=function(e,t){if(e&&"object"==typeof e&&!Array.isArray(e)){var r,n,i,o=this.valuesType,s=Object.keys(e),a={};for(r=0,n=s.length;r<n;r++)a[i=s[r]]=o._copy(e[i],t);return a}G(e,this)},N.prototype.compare=N.prototype._match,N.prototype.typeName="map",N.prototype.getValuesType=function(){return this.valuesType},N.prototype.random=function(){var e,t,r={};for(e=0,t=h.nextInt(10);e<t;e++)r[h.nextString(h.nextInt(20))]=this.valuesType.random();return r},N.prototype._deref=function(e,t){e.values=this.valuesType._attrs(t)},o.inherits(F,g),F.prototype._check=function(e,t,r,n){if(!Array.isArray(e))return r&&r(e,this),!1;var i,o,s,a=this.itemsType,u=!0;if(r){for(s=n.length,n.push(""),i=0,o=e.length;i<o;i++)n[s]=""+i,a._check(e[i],t,r,n)||(u=!1);n.pop()}else for(i=0,o=e.length;i<o;i++)if(!a._check(e[i],t))return!1;return u},F.prototype._read=function(e){for(var t,r,n=this.itemsType,i=0;r=e.readLong();)for(r<0&&(r=-r,e.skipLong()),t=t||new Array(r);r--;)t[i++]=n._read(e);return t||[]},F.prototype._skip=function(e){for(var t,r,n=this.itemsType;r=e.readLong();)if(r<0)t=e.readLong(),e.pos+=t;else for(;r--;)n._skip(e)},F.prototype._write=function(e,t){Array.isArray(t)||G(t,this);var r,n=this.itemsType,i=t.length;if(i)for(e.writeLong(i),r=0;r<i;r++)n._write(e,t[r]);e.writeLong(0)},F.prototype._match=function(e,t){for(var r,i=e.readLong(),o=t.readLong();i&&o;){if(r=this.itemsType._match(e,t))return r;--i||(i=V(e)),--o||(o=V(t))}return n.compare(i,o)},F.prototype._update=function(e,t,r){"array"===t.typeName&&(e.itemsType=this.itemsType.createResolver(t.itemsType,r),e._read=this._read)},F.prototype._copy=function(e,t){Array.isArray(e)||G(e,this);var r,n,i=new Array(e.length);for(r=0,n=e.length;r<n;r++)i[r]=this.itemsType._copy(e[r],t);return i},F.prototype._deref=function(e,t){e.items=this.itemsType._attrs(t)},F.prototype.compare=function(e,t){var r,i,o,s=e.length,a=t.length;for(r=0,i=Math.min(s,a);r<i;r++)if(o=this.itemsType.compare(e[r],t[r]))return o;return n.compare(s,a)},F.prototype.getItemsType=function(){return this.itemsType},F.prototype.typeName="array",F.prototype.random=function(){var e,t,r=[];for(e=0,t=h.nextInt(10);e<t;e++)r.push(this.itemsType.random());return r},o.inherits(R,g),R.prototype._getConstructorName=function(){return this.name?n.capitalize(n.unqualify(this.name)):this._isError?"Error$":"Record$"},R.prototype._createConstructor=function(e,t){var r,n,i,s,a,u,c,f=[],l=[],h=[],p="";for(r=0,n=this.fields.length;r<n;r++)u=void 0!==(a=(i=this.fields[r]).defaultValue)(),s=i.name,e&&this._isError&&"stack"===s&&g.isType(i.type,"string")&&!u&&(c=i),l.push("v"+r),p+=" ",u?(p+="if (v"+r+" === undefined) { ",p+="this."+s+" = d"+h.length+"(); ",p+="} else { this."+s+" = v"+r+"; }\n",f.push("d"+h.length),h.push(a)):p+="this."+s+" = v"+r+";\n";c&&(p+=" if (this.stack === undefined) { ","function"==typeof Error.captureStackTrace?p+="Error.captureStackTrace(this, this.constructor);":p+="this.stack = Error().stack;",p+=" }\n");var d="return function "+this._getConstructorName()+"(";d+=l.join()+") {\n"+p+"};";var y=new Function(f.join(),d).apply(void 0,h);if(t)return y;var m=this;return y.getType=function(){return m},y.type=m,this._isError&&(o.inherits(y,Error),y.prototype.name=this._getConstructorName()),y.prototype.clone=function(e){return m.clone(this,e)},y.prototype.compare=function(e){return m.compare(this,e)},y.prototype.isValid=function(e){return m.isValid(this,e)},y.prototype.toBuffer=function(){return m.toBuffer(this)},y.prototype.toString=function(){return m.toString(this)},y.prototype.wrap=function(){return m.wrap(this)},y.prototype.wrapped=y.prototype.wrap,y},R.prototype._createChecker=function(){var e=[],t=[],r="return function check"+this._getConstructorName()+"(v, f, h, p) {\n";if(r+=" if (\n",r+=" v === null ||\n",r+=" typeof v != 'object' ||\n",r+=" (f && !this._checkFields(v))\n",r+=" ) {\n",r+=" if (h) { h(v, this); }\n",r+=" return false;\n",r+=" }\n",this.fields.length){for(n=0,i=this.fields.length;n<i;n++)o=this.fields[n],e.push("t"+n),t.push(o.type),void 0!==o.defaultValue()&&(r+=" var v"+n+" = v."+o.name+";\n");var n,i,o;for(r+=" if (h) {\n",r+=" var b = 1;\n",r+=" var j = p.length;\n",r+=" p.push('');\n",n=0,i=this.fields.length;n<i;n++)r+=" p[j] = '"+(o=this.fields[n]).name+"';\n",r+=" b &= ",void 0===o.defaultValue()?r+="t"+n+"._check(v."+o.name+", f, h, p);\n":(r+="v"+n+" === undefined || ",r+="t"+n+"._check(v"+n+", f, h, p);\n");r+=" p.pop();\n",r+=" return !!b;\n",r+=" } else {\n return (\n ",r+=this.fields.map((function(e,t){return void 0===e.defaultValue()?"t"+t+"._check(v."+e.name+", f)":"(v"+t+" === undefined || t"+t+"._check(v"+t+", f))"})).join(" &&\n "),r+="\n );\n }\n"}else r+=" return true;\n";return r+="};",new Function(e.join(),r).apply(void 0,t)},R.prototype._createReader=function(){var e,t,r=[],n=[this.recordConstructor];for(e=0,t=this.fields.length;e<t;e++)r.push("t"+e),n.push(this.fields[e].type);var i=this._getConstructorName(),o="return function read"+i+"(t) {\n";return o+=" return new "+i+"(\n ",o+=r.map((function(e){return e+"._read(t)"})).join(",\n "),o+="\n );\n};",r.unshift(i),new Function(r.join(),o).apply(void 0,n)},R.prototype._createSkipper=function(){var e,t,r=[],n="return function skip"+this._getConstructorName()+"(t) {\n",i=[];for(e=0,t=this.fields.length;e<t;e++)r.push("t"+e),i.push(this.fields[e].type),n+=" t"+e+"._skip(t);\n";return n+="}",new Function(r.join(),n).apply(void 0,i)},R.prototype._createWriter=function(){var e,t,r,n,i=[],o="return function write"+this._getConstructorName()+"(t, v) {\n",s=[];for(e=0,t=this.fields.length;e<t;e++)r=this.fields[e],i.push("t"+e),s.push(r.type),o+=" ",void 0===r.defaultValue()?o+="t"+e+"._write(t, v."+r.name+");\n":(n=r.type.toBuffer(r.defaultValue()).toString("binary"),i.push("d"+e),s.push(n),o+="var v"+e+" = v."+r.name+";\n",o+="if (v"+e+" === undefined) {\n",o+=" t.writeBinary(d"+e+", "+n.length+");\n",o+=" } else {\n t"+e+"._write(t, v"+e+");\n }\n");return o+="}",new Function(i.join(),o).apply(void 0,s)},R.prototype._update=function(e,t,r){if(!z(this,t,!r.ignoreNamespaces))throw new Error(f("no alias found for %s",t.name));var i,o,s,a,u,c,l,h=this.fields,p=t.fields,d=n.toMap(p,(function(e){return e.name})),y=[],g={};for(i=0;i<h.length;i++){for(u=P(s=h[i]),c=[],o=0;o<u.length;o++)d[a=u[o]]&&c.push(a);if(c.length>1)throw new Error(f("ambiguous aliasing for %s.%s (%s)",t.name,s.name,c));if(c.length)a=c[0],l={resolver:s.type.createResolver(d[a].type,r),name:"_"+s.name},g[a]?g[a].push(l):g[a]=[l],y.push(l.name);else{if(void 0===s.defaultValue())throw new Error(f("no matching field for default-less %s.%s",t.name,s.name));y.push("undefined")}}var m=-1;for(i=p.length;i&&void 0===g[p[--i].name];)m=i;var v=this._getConstructorName(),b=[v],_=[this.recordConstructor],w=" return function read"+v+"(t, b) {\n";for(i=0;i<p.length;i++)if(i===m&&(w+=" if (!b) {\n"),void 0===g[a=(s=t.fields[i]).name])w+=~m&&i>=m?" ":" ",b.push("r"+i),_.push(s.type),w+="r"+i+"._skip(t);\n";else for(o=g[a].length;o--;)w+=~m&&i>=m?" ":" ",b.push("r"+i+"f"+o),l=g[a][o],_.push(l.resolver),w+="var "+l.name+" = ",w+="r"+i+"f"+o+"._"+(o?"peek":"read")+"(t);\n";~m&&(w+=" }\n"),w+=" return new "+v+"("+y.join()+");\n};",e._read=new Function(b.join(),w).apply(void 0,_)},R.prototype._match=function(e,t){var r,n,i,o,s,a=this.fields;for(r=0,n=a.length;r<n;r++)if(o=(i=a[r])._order,s=i.type,o){if(o*=s._match(e,t))return o}else s._skip(e),s._skip(t);return 0},R.prototype._checkFields=function(e){var t,r,n=Object.keys(e);for(t=0,r=n.length;t<r;t++)if(!this._fieldsByName[n[t]])return!1;return!0},R.prototype._copy=function(e,t){var r,n,i,o,s=t&&t.fieldHook,a=[void 0];for(r=0,n=this.fields.length;r<n;r++)void 0===(o=e[(i=this.fields[r]).name])&&i.hasOwnProperty("defaultValue")&&(o=i.defaultValue()),(t&&!t.skip||void 0!==o)&&(o=i.type._copy(o,t)),s&&(o=s(i,o,this)),a.push(o);var u=this.recordConstructor;return new(u.bind.apply(u,a))},R.prototype._deref=function(e,t){e.fields=this.fields.map((function(e){var r=e.type,n={name:e.name,type:r._attrs(t)};if(t.exportAttrs){var i=e.defaultValue();void 0!==i&&(n.default=r._copy(i,{coerce:3,wrap:3}));var o=e.order;"ascending"!==o&&(n.order=o);var s=e.aliases;s.length&&(n.aliases=s);var a=e.doc;void 0!==a&&(n.doc=a)}return n}))},R.prototype.compare=function(e,t){var r,n,i,o,s,a,u=this.fields;for(r=0,n=u.length;r<n;r++)if(o=(i=u[r]).name,s=i._order,a=i.type,s&&(s*=a.compare(e[o],t[o])))return s;return 0},R.prototype.random=function(){var e=this.fields.map((function(e){return e.type.random()}));e.unshift(void 0);var t=this.recordConstructor;return new(t.bind.apply(t,e))},R.prototype.field=function(e){return this._fieldsByName[e]},R.prototype.getField=R.prototype.field,R.prototype.getFields=function(){return this.fields},R.prototype.getRecordConstructor=function(){return this.recordConstructor},Object.defineProperty(R.prototype,"typeName",{enumerable:!0,get:function(){return this._isError?"error":"record"}}),o.inherits(L,g),Object.defineProperty(L.prototype,"typeName",{enumerable:!0,get:function(){return"logical:"+this._logicalTypeName}}),Object.defineProperty(L.prototype,"underlyingType",{enumerable:!0,get:function(){if(this._underlyingType)return this._underlyingType;var e,t,r;for(e=0,t=y.length;e<t;e++)if((r=y[e])[0]===this)return r[1]}}),L.prototype.getUnderlyingType=function(){return this.underlyingType},L.prototype._read=function(e){return this._fromValue(this.underlyingType._read(e))},L.prototype._write=function(e,t){this.underlyingType._write(e,this._toValue(t))},L.prototype._check=function(e,t,r,n){try{var i=this._toValue(e)}catch(e){}return void 0===i?(r&&r(e,this),!1):this.underlyingType._check(i,t,r,n)},L.prototype._copy=function(e,t){var r=this.underlyingType;switch(t&&t.coerce){case 3:return r._copy(this._toValue(e),t);case 2:return this._fromValue(r._copy(e,t));default:return this._fromValue(r._copy(this._toValue(e),t))}},L.prototype._update=function(e,t,r){var n=this._resolve(t,r);n&&(e._read=function(e){return n(t._read(e))})},L.prototype.compare=function(e,t){var r=this._toValue(e),n=this._toValue(t);return this.underlyingType.compare(r,n)},L.prototype.random=function(){return this._fromValue(this.underlyingType.random())},L.prototype._deref=function(e,t){var r=this.underlyingType,n=void 0!==r.name&&t.derefed[r.name];return e=r._attrs(t),!n&&t.exportAttrs&&("string"==typeof e&&(e={type:e}),e.logicalType=this._logicalTypeName,this._export(e)),e},L.prototype._skip=function(e){this.underlyingType._skip(e)},L.prototype._export=function(){},L.prototype._fromValue=n.abstractFunction,L.prototype._toValue=n.abstractFunction,L.prototype._resolve=n.abstractFunction,o.inherits(U,w),U.prototype.typeName="abstract:long",U.prototype._check=function(e,t,r){var n=this._isValid(e);return!n&&r&&r(e,this),n},U.prototype._read=function(e){var t,r;if(this._noUnpack?(r=e.pos,e.skipLong(),t=e.buf.slice(r,e.pos)):t=e.unpackLongBytes(e),e.isValid())return this._fromBuffer(t)},U.prototype._write=function(e,t){this._isValid(t)||G(t,this);var r=this._toBuffer(t);this._noUnpack?e.writeFixed(r):e.packLongBytes(r)},U.prototype._copy=function(e,t){switch(t&&t.coerce){case 3:return this._toJSON(e);case 2:return this._fromJSON(e);default:return this._fromJSON(this._toJSON(e))}},U.prototype._deref=function(){return"long"},U.prototype._update=function(e,t){var r=this;switch(t.typeName){case"int":e._read=function(e){return r._fromJSON(t._read(e))};break;case"abstract:long":case"long":e._read=function(e){return r._read(e)}}},U.prototype.random=function(){return this._fromJSON(w.prototype.random())},U.prototype._fromBuffer=n.abstractFunction,U.prototype._toBuffer=n.abstractFunction,U.prototype._fromJSON=n.abstractFunction,U.prototype._toJSON=n.abstractFunction,U.prototype._isValid=n.abstractFunction,U.prototype.compare=n.abstractFunction,C.prototype.defaultValue=function(){},Object.defineProperty(C.prototype,"order",{enumerable:!0,get:function(){return["descending","ignore","ascending"][this._order+1]}}),C.prototype.getAliases=function(){return this.aliases},C.prototype.getDefault=C.prototype.defaultValue,C.prototype.getName=function(){return this.name},C.prototype.getOrder=function(){return this.order},C.prototype.getType=function(){return this.type},j.prototype._peek=g.prototype._peek,j.prototype.inspect=function(){return"<Resolver>"},e.exports={Type:g,getTypeBucket:W,getValueBucket:Y,isPrimitive:$,builtins:function(){var e,t,r,n={LogicalType:L,UnwrappedUnionType:k,WrappedUnionType:T},i=Object.keys(l);for(e=0,t=i.length;e<t;e++)n[H(r=i[e])]=l[r];return n}()}},22561:(e,t,r)=>{"use strict";var n=r(48287),i=r(78505),o=r(40537),s=n.Buffer,a=new d(4096),u=/^[A-Za-z_][A-Za-z0-9_]*$/,c=o.format;function f(e){return"function"==typeof s.alloc?s.alloc(e):new s(e)}function l(e,t){return"function"==typeof s.from?s.from(e,t):new s(e,t)}function h(e){return e.charAt(0).toUpperCase()+e.slice(1)}function p(e){return u.test(e)}function d(e){this._len=0|e,this._pos=0,this._slab=f(this._len)}function y(e){var t=Math.pow(2,31),r=Math.floor(e||Math.random()*(t-1));this._max=t,this._nextInt=function(){return r=(1103515245*r+12345)%t}}function g(){this._index=0,this._items=[]}function m(e,t){if(this.buf=e,this.pos=0|t,this.pos<0)throw new Error("negative offset")}function v(e,t){for(;t--;)e[t]=~e[t]}d.prototype.alloc=function(e){if(e<0)throw new Error("negative length");var t=this._len;return e>t?f(e):(this._pos+e>t&&(this._slab=f(t),this._pos=0),this._slab.slice(this._pos,this._pos+=e))},y.prototype.nextBoolean=function(){return!!(this._nextInt()%2)},y.prototype.nextInt=function(e,t){return void 0===t&&(t=e,e=0),t=void 0===t?this._max:t,e+Math.floor(this.nextFloat()*(t-e))},y.prototype.nextFloat=function(e,t){return void 0===t&&(t=e,e=0),e+((t=void 0===t?1:t)-e)*this._nextInt()/this._max},y.prototype.nextString=function(e,t){e|=0;var r="";(t=t||"aA").indexOf("a")>-1&&(r+="abcdefghijklmnopqrstuvwxyz"),t.indexOf("A")>-1&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.indexOf("#")>-1&&(r+="0123456789"),t.indexOf("!")>-1&&(r+="~`!@#$%^&*()_+-={}[]:\";'<>?,./|\\");for(var n=[],i=0;i<e;i++)n.push(this.choice(r));return n.join("")},y.prototype.nextBuffer=function(e){var t,r=[];for(t=0;t<e;t++)r.push(this.nextInt(256));return l(r)},y.prototype.choice=function(e){var t=e.length;if(!t)throw new Error("choosing from empty array");return e[this.nextInt(t)]},g.prototype.push=function(e){var t,r=this._items,n=0|r.length;for(r.push(e);n>0&&r[n].index<r[t=n-1>>1].index;)e=r[n],r[n]=r[t],r[t]=e,n=t},g.prototype.pop=function(){var e=this._items,t=e.length-1|0,r=e[0];if(!r||r.index>this._index)return null;if(this._index++,!t)return e.pop(),r;e[0]=e.pop();for(var n,i,o,s,a,u,c,f=t>>1,l=0;l<f&&(s=e[l],i=l+1<<1,u=e[n=1+(l<<1)],!(c=e[i])||u.index<=c.index?(a=u,o=n):(a=c,o=i),!(a.index>=s.index));)e[o]=s,e[l]=a,l=o;return r},m.prototype.isValid=function(){return this.pos<=this.buf.length},m.prototype._invalidate=function(){this.pos=this.buf.length+1},m.prototype.readBoolean=function(){return!!this.buf[this.pos++]},m.prototype.skipBoolean=function(){this.pos++},m.prototype.writeBoolean=function(e){this.buf[this.pos++]=!!e},m.prototype.readInt=m.prototype.readLong=function(){var e,t,r,n,i=0,o=0,s=this.buf;do{t=128&(e=s[this.pos++]),i|=(127&e)<<o,o+=7}while(t&&o<28);if(t){r=i,n=268435456;do{r+=(127&(e=s[this.pos++]))*n,n*=128}while(128&e);return(r%2?-(r+1):r)/2}return i>>1^-(1&i)},m.prototype.skipInt=m.prototype.skipLong=function(){for(var e=this.buf;128&e[this.pos++];);},m.prototype.writeInt=m.prototype.writeLong=function(e){var t,r,n=this.buf;if(e>=-1073741824&&e<1073741824){r=e>=0?e<<1:~e<<1|1;do{n[this.pos]=127&r,r>>=7}while(r&&(n[this.pos++]|=128))}else{t=e>=0?2*e:2*-e-1;do{n[this.pos]=127&t,t/=128}while(t>=1&&(n[this.pos++]|=128))}this.pos++},m.prototype.readFloat=function(){var e=this.buf,t=this.pos;return this.pos+=4,this.pos>e.length?0:this.buf.readFloatLE(t)},m.prototype.skipFloat=function(){this.pos+=4},m.prototype.writeFloat=function(e){var t=this.buf,r=this.pos;if(this.pos+=4,!(this.pos>t.length))return this.buf.writeFloatLE(e,r)},m.prototype.readDouble=function(){var e=this.buf,t=this.pos;return this.pos+=8,this.pos>e.length?0:this.buf.readDoubleLE(t)},m.prototype.skipDouble=function(){this.pos+=8},m.prototype.writeDouble=function(e){var t=this.buf,r=this.pos;if(this.pos+=8,!(this.pos>t.length))return this.buf.writeDoubleLE(e,r)},m.prototype.readFixed=function(e){var t=this.pos;if(this.pos+=e,!(this.pos>this.buf.length)){var r=a.alloc(e);return this.buf.copy(r,0,t,t+e),r}},m.prototype.skipFixed=function(e){this.pos+=e},m.prototype.writeFixed=function(e,t){t=t||e.length;var r=this.pos;this.pos+=t,this.pos>this.buf.length||e.copy(this.buf,r,0,t)},m.prototype.readBytes=function(){var e=this.readLong();if(!(e<0))return this.readFixed(e);this._invalidate()},m.prototype.skipBytes=function(){var e=this.readLong();e<0?this._invalidate():this.pos+=e},m.prototype.writeBytes=function(e){var t=e.length;this.writeLong(t),this.writeFixed(e,t)},"function"==typeof s.prototype.utf8Slice?m.prototype.readString=function(){var e=this.readLong();if(e<0)return this._invalidate(),"";var t=this.pos,r=this.buf;return this.pos+=e,this.pos>r.length?void 0:this.buf.utf8Slice(t,t+e)}:m.prototype.readString=function(){var e=this.readLong();if(e<0)return this._invalidate(),"";var t=this.pos,r=this.buf;return this.pos+=e,this.pos>r.length?void 0:this.buf.slice(t,t+e).toString()},m.prototype.skipString=function(){var e=this.readLong();e<0?this._invalidate():this.pos+=e},m.prototype.writeString=function(e){var t=s.byteLength(e),r=this.buf;this.writeLong(t);var n,i,o,a,u=this.pos;if(this.pos+=t,!(this.pos>r.length))if(t>64&&"function"==typeof s.prototype.utf8Write)r.utf8Write(e,u,t);else for(n=0,i=t;n<i;n++)(o=e.charCodeAt(n))<128?r[u++]=o:o<2048?(r[u++]=o>>6|192,r[u++]=63&o|128):55296==(64512&o)&&56320==(64512&(a=e.charCodeAt(n+1)))?(o=65536+((1023&o)<<10)+(1023&a),n++,r[u++]=o>>18|240,r[u++]=o>>12&63|128,r[u++]=o>>6&63|128,r[u++]=63&o|128):(r[u++]=o>>12|224,r[u++]=o>>6&63|128,r[u++]=63&o|128)},"function"==typeof s.prototype.latin1Write?m.prototype.writeBinary=function(e,t){var r=this.pos;this.pos+=t,this.pos>this.buf.length||this.buf.latin1Write(e,r,t)}:"function"==typeof s.prototype.binaryWrite?m.prototype.writeBinary=function(e,t){var r=this.pos;this.pos+=t,this.pos>this.buf.length||this.buf.binaryWrite(e,r,t)}:m.prototype.writeBinary=function(e,t){var r=this.pos;this.pos+=t,this.pos>this.buf.length||this.buf.write(e,r,t,"binary")},m.prototype.matchBoolean=function(e){return this.buf[this.pos++]-e.buf[e.pos++]},m.prototype.matchInt=m.prototype.matchLong=function(e){var t=this.readLong(),r=e.readLong();return t===r?0:t<r?-1:1},m.prototype.matchFloat=function(e){var t=this.readFloat(),r=e.readFloat();return t===r?0:t<r?-1:1},m.prototype.matchDouble=function(e){var t=this.readDouble(),r=e.readDouble();return t===r?0:t<r?-1:1},m.prototype.matchFixed=function(e,t){return this.readFixed(t).compare(e.readFixed(t))},m.prototype.matchBytes=m.prototype.matchString=function(e){var t=this.readLong(),r=this.pos;this.pos+=t;var n=e.readLong(),i=e.pos;e.pos+=n;var o=this.buf.slice(r,this.pos),s=e.buf.slice(i,e.pos);return o.compare(s)},m.prototype.unpackLongBytes=function(){var e,t,r=f(8),n=0,i=0,o=6,s=this.buf;for(t=1&(e=s[this.pos++]),r.fill(0),n|=(127&e)>>1;128&e;)n|=(127&(e=s[this.pos++]))<<o,(o+=7)>=8&&(o-=8,r[i++]=n,n>>=8);return r[i]=n,t&&v(r,8),r},m.prototype.packLongBytes=function(e){var t,r=(128&e[7])>>7,n=this.buf,i=1,o=0,s=3;r?(v(e,8),t=1):t=0;for(var a=[e.readUIntLE(0,3),e.readUIntLE(3,3),e.readUIntLE(6,2)];s&&!a[--s];);for(;o<s;)for(t|=a[o++]<<i,i+=24;i>7;)n[this.pos++]=127&t|128,t>>=7,i-=7;t|=a[s]<<i;do{n[this.pos]=127&t,t>>=7}while(t&&(n[this.pos++]|=128));this.pos++,r&&v(e,8)},e.exports={abstractFunction:function(){throw new Error("abstract")},addDeprecatedGetters:function(e,t){var r,n,i,s,a=e.prototype;for(r=0,n=t.length;r<n;r++)a[s="get"+h(i=t[r])]=o.deprecate(u(i),"use `."+i+"` instead of `."+s+"()`");function u(e){return function(){var t=this[e];return"function"==typeof t?t.apply(this,arguments):t}}},bufferFrom:l,capitalize:h,copyOwnProperties:function(e,t,r){var n,i,o,s=Object.getOwnPropertyNames(e);for(n=0,i=s.length;n<i;n++)if(o=s[n],!t.hasOwnProperty(o)||r){var a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,a)}return t},getHash:function(e,t){t=t||"md5";var r=i.createHash(t);return r.end(e),r.read()},compare:function(e,t){return e===t?0:e<t?-1:1},getOption:function(e,t,r){var n=e[t];return void 0===n?r:n},impliedNamespace:function(e){var t=/^(.*)\.[^.]+$/.exec(e);return t?t[1]:void 0},isValidName:p,jsonEnd:function(e,t){t|=0;var r=e.charAt(t++);if(/[\d-]/.test(r)){for(;/[eE\d.+-]/.test(e.charAt(t));)t++;return t}if(/true|null/.test(e.slice(t-1,t+3)))return t+3;if(/false/.test(e.slice(t-1,t+4)))return t+4;var n=0,i=!1;do{switch(r){case"{":case"[":i||n++;break;case"}":case"]":if(!i&&! --n)return t;break;case'"':if(i=!i,!n&&!i)return t;break;case"\\":t++}}while(r=e.charAt(t++));return-1},newBuffer:f,objectValues:function(e){return Object.keys(e).map((function(t){return e[t]}))},qualify:function(e,t){return~e.indexOf(".")?e=e.replace(/^\./,""):t&&(e=t+"."+e),e.split(".").forEach((function(t){if(!p(t))throw new Error(c("invalid name: %j",e))})),e},toMap:function(e,t){var r,n,i={};for(r=0;r<e.length;r++)i[t(n=e[r])]=n;return i},singleIndexOf:function(e,t){var r,n,i=-1;if(!e)return-1;for(r=0,n=e.length;r<n;r++)if(e[r]===t){if(i>=0)return-2;i=r}return i},hasDuplicates:function(e,t){var r,n,i,o=Object.create(null);for(r=0,n=e.length;r<n;r++){if(i=e[r],t&&(i=t(i)),o[i])return!0;o[i]=!0}return!1},unqualify:function(e){var t=e.split(".");return t[t.length-1]},BufferPool:d,Lcg:y,OrderedQueue:g,Tap:m}},67526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),f=0,l=u>0?s-4:s;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[f++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(u(e,a,a+s>c?c:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},5974:(e,t,r)=>{"use strict";var n=r(48287).Buffer,i=r(65606),o=r(34529),s=r(44442),a=r(58411),u=r(71447),c=r(19681);for(var f in c)t[f]=c[f];function l(e){if("number"!=typeof e||e<t.DEFLATE||e>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7,l.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,o(this.init_done,"close before init"),o(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?a.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||u.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},l.prototype.write=function(e,t,r,n,i,o,s){return this._write(!0,e,t,r,n,i,o,s)},l.prototype.writeSync=function(e,t,r,n,i,o,s){return this._write(!1,e,t,r,n,i,o,s)},l.prototype._write=function(e,r,s,a,u,c,f,l){if(o.equal(arguments.length,8),o(this.init_done,"write before init"),o(this.mode!==t.NONE,"already finalized"),o.equal(!1,this.write_in_progress,"write already in progress"),o.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,o.equal(!1,void 0===r,"must provide flush value"),this.write_in_progress=!0,r!==t.Z_NO_FLUSH&&r!==t.Z_PARTIAL_FLUSH&&r!==t.Z_SYNC_FLUSH&&r!==t.Z_FULL_FLUSH&&r!==t.Z_FINISH&&r!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==s&&(s=n.alloc(0),u=0,a=0),this.strm.avail_in=u,this.strm.input=s,this.strm.next_in=a,this.strm.avail_out=l,this.strm.output=c,this.strm.next_out=f,this.flush=r,!e)return this._process(),this._checkError()?this._afterSync():void 0;var h=this;return i.nextTick((function(){h._process(),h._after()})),this},l.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},l.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=a.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=u.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=u.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=u.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=u.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},l.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},l.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},l.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},l.prototype.init=function(e,r,n,i,s){o(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),o(e>=8&&e<=15,"invalid windowBits"),o(r>=-1&&r<=9,"invalid compression level"),o(n>=1&&n<=9,"invalid memlevel"),o(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,n,i,s),this._setDictionary()},l.prototype.params=function(){throw new Error("deflateParams Not supported")},l.prototype.reset=function(){this._reset(),this._setDictionary()},l.prototype._init=function(e,r,n,i,o){switch(this.level=e,this.windowBits=r,this.memLevel=n,this.strategy=i,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new s,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=a.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=u.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=o,this.write_in_progress=!1,this.init_done=!0},l.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=a.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},l.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=a.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=u.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=l},78559:(e,t,r)=>{"use strict";var n=r(65606),i=r(48287).Buffer,o=r(88310).Transform,s=r(5974),a=r(40537),u=r(34529).ok,c=r(48287).kMaxLength,f="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";s.Z_MIN_WINDOWBITS=8,s.Z_MAX_WINDOWBITS=15,s.Z_DEFAULT_WINDOWBITS=15,s.Z_MIN_CHUNK=64,s.Z_MAX_CHUNK=1/0,s.Z_DEFAULT_CHUNK=16384,s.Z_MIN_MEMLEVEL=1,s.Z_MAX_MEMLEVEL=9,s.Z_DEFAULT_MEMLEVEL=8,s.Z_MIN_LEVEL=-1,s.Z_MAX_LEVEL=9,s.Z_DEFAULT_LEVEL=s.Z_DEFAULT_COMPRESSION;for(var l=Object.keys(s),h=0;h<l.length;h++){var p=l[h];p.match(/^Z/)&&Object.defineProperty(t,p,{enumerable:!0,value:s[p],writable:!1})}for(var d={Z_OK:s.Z_OK,Z_STREAM_END:s.Z_STREAM_END,Z_NEED_DICT:s.Z_NEED_DICT,Z_ERRNO:s.Z_ERRNO,Z_STREAM_ERROR:s.Z_STREAM_ERROR,Z_DATA_ERROR:s.Z_DATA_ERROR,Z_MEM_ERROR:s.Z_MEM_ERROR,Z_BUF_ERROR:s.Z_BUF_ERROR,Z_VERSION_ERROR:s.Z_VERSION_ERROR},y=Object.keys(d),g=0;g<y.length;g++){var m=y[g];d[d[m]]=m}function v(e,t,r){var n=[],o=0;function s(){for(var t;null!==(t=e.read());)n.push(t),o+=t.length;e.once("readable",s)}function a(){var t,s=null;o>=c?s=new RangeError(f):t=i.concat(n,o),n=[],e.close(),r(s,t)}e.on("error",(function(t){e.removeListener("end",a),e.removeListener("readable",s),r(t)})),e.on("end",a),e.end(t),s()}function b(e,t){if("string"==typeof t&&(t=i.from(t)),!i.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function _(e){if(!(this instanceof _))return new _(e);T.call(this,e,s.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);T.call(this,e,s.INFLATE)}function E(e){if(!(this instanceof E))return new E(e);T.call(this,e,s.GZIP)}function x(e){if(!(this instanceof x))return new x(e);T.call(this,e,s.GUNZIP)}function B(e){if(!(this instanceof B))return new B(e);T.call(this,e,s.DEFLATERAW)}function A(e){if(!(this instanceof A))return new A(e);T.call(this,e,s.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);T.call(this,e,s.UNZIP)}function k(e){return e===s.Z_NO_FLUSH||e===s.Z_PARTIAL_FLUSH||e===s.Z_SYNC_FLUSH||e===s.Z_FULL_FLUSH||e===s.Z_FINISH||e===s.Z_BLOCK}function T(e,r){var n=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,o.call(this,e),e.flush&&!k(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!k(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||s.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:s.Z_FINISH,e.chunkSize&&(e.chunkSize<t.Z_MIN_CHUNK||e.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<t.Z_MIN_WINDOWBITS||e.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<t.Z_MIN_LEVEL||e.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<t.Z_MIN_MEMLEVEL||e.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!i.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new s.Zlib(r);var a=this;this._hadError=!1,this._handle.onerror=function(e,r){O(a),a._hadError=!0;var n=new Error(e);n.errno=r,n.code=t.codes[r],a.emit("error",n)};var u=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(u=e.level);var c=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(c=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,u,e.memLevel||t.Z_DEFAULT_MEMLEVEL,c,e.dictionary),this._buffer=i.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=c,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!n._handle},configurable:!0,enumerable:!0})}function O(e,t){t&&n.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function I(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),t.Deflate=_,t.Inflate=w,t.Gzip=E,t.Gunzip=x,t.DeflateRaw=B,t.InflateRaw=A,t.Unzip=S,t.createDeflate=function(e){return new _(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new B(e)},t.createInflateRaw=function(e){return new A(e)},t.createGzip=function(e){return new E(e)},t.createGunzip=function(e){return new x(e)},t.createUnzip=function(e){return new S(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new _(t),e,r)},t.deflateSync=function(e,t){return b(new _(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new E(t),e,r)},t.gzipSync=function(e,t){return b(new E(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new B(t),e,r)},t.deflateRawSync=function(e,t){return b(new B(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new S(t),e,r)},t.unzipSync=function(e,t){return b(new S(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new w(t),e,r)},t.inflateSync=function(e,t){return b(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new x(t),e,r)},t.gunzipSync=function(e,t){return b(new x(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new A(t),e,r)},t.inflateRawSync=function(e,t){return b(new A(t),e)},a.inherits(T,o),T.prototype.params=function(e,r,i){if(e<t.Z_MIN_LEVEL||e>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(r!=t.Z_FILTERED&&r!=t.Z_HUFFMAN_ONLY&&r!=t.Z_RLE&&r!=t.Z_FIXED&&r!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==e||this._strategy!==r){var o=this;this.flush(s.Z_SYNC_FLUSH,(function(){u(o._handle,"zlib binding closed"),o._handle.params(e,r),o._hadError||(o._level=e,o._strategy=r,i&&i())}))}else n.nextTick(i)},T.prototype.reset=function(){return u(this._handle,"zlib binding closed"),this._handle.reset()},T.prototype._flush=function(e){this._transform(i.alloc(0),"",e)},T.prototype.flush=function(e,t){var r=this,o=this._writableState;("function"==typeof e||void 0===e&&!t)&&(t=e,e=s.Z_FULL_FLUSH),o.ended?t&&n.nextTick(t):o.ending?t&&this.once("end",t):o.needDrain?t&&this.once("drain",(function(){return r.flush(e,t)})):(this._flushFlag=e,this.write(i.alloc(0),"",t))},T.prototype.close=function(e){O(this,e),n.nextTick(I,this)},T.prototype._transform=function(e,t,r){var n,o=this._writableState,a=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||i.isBuffer(e)?this._handle?(a?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||s.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},T.prototype._processChunk=function(e,t,r){var n=e&&e.length,o=this._chunkSize-this._offset,s=0,a=this,l="function"==typeof r;if(!l){var h,p=[],d=0;this.on("error",(function(e){h=e})),u(this._handle,"zlib binding closed");do{var y=this._handle.writeSync(t,e,s,n,this._buffer,this._offset,o)}while(!this._hadError&&v(y[0],y[1]));if(this._hadError)throw h;if(d>=c)throw O(this),new RangeError(f);var g=i.concat(p,d);return O(this),g}u(this._handle,"zlib binding closed");var m=this._handle.write(t,e,s,n,this._buffer,this._offset,o);function v(c,f){if(this&&(this.buffer=null,this.callback=null),!a._hadError){var h=o-f;if(u(h>=0,"have should not go down"),h>0){var y=a._buffer.slice(a._offset,a._offset+h);a._offset+=h,l?a.push(y):(p.push(y),d+=y.length)}if((0===f||a._offset>=a._chunkSize)&&(o=a._chunkSize,a._offset=0,a._buffer=i.allocUnsafe(a._chunkSize)),0===f){if(s+=n-c,n=c,!l)return!0;var g=a._handle.write(t,e,s,n,a._buffer,a._offset,a._chunkSize);return g.callback=v,void(g.buffer=e)}if(!l)return!1;r()}}m.buffer=e,m.callback=v},a.inherits(_,T),a.inherits(w,T),a.inherits(E,T),a.inherits(x,T),a.inherits(B,T),a.inherits(A,T),a.inherits(S,T)},48287:(e,t,r)=>{"use strict";const n=r(67526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return f(e),a(e<0?0:0|d(e))}function h(e){const t=e.length<0?0:0|d(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function d(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:q(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function _(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Y(n))return s;e[r+s]=n}return s}function w(e,t,r,n){return J(q(t,e.length-r),e,r,n)}function E(e,t,r,n){return J(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function x(e,t,r,n){return J(G(t),e,r,n)}function B(e,t,r,n){return J(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return l(e)},u.allocUnsafeSlow=function(e){return l(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(W(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),W(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).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}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(W(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(W(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),f=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==f[e]){o=c[e],s=f[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function T(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function O(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function I(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=K[e[n]];return i}function N(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function F(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function U(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function C(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,o){return t=+t,r>>>=0,o||C(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,o){return t=+t,r>>>=0,o||C(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||F(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||F(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||F(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||F(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||F(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||F(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<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),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=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&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const M={};function P(e,t,r){M[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function z(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function $(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new M.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function H(e,t){if("number"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}P("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),P("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),P("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const Z=/[^+/0-9A-Za-z-_]/g;function q(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const K=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},49881:(e,t,r)=>{"use strict";const n=r(20893),i=r(79777),o=r(93737),s=r(72893),a=r(15059),u=r(53557),c=r(82903),f=r(207);e.exports={Commented:n,Diagnose:i,Decoder:o,Encoder:s,Simple:a,Tagged:u,Map:c,SharedValueEncoder:f,comment:n.comment,decodeAll:o.decodeAll,decodeFirst:o.decodeFirst,decodeAllSync:o.decodeAllSync,decodeFirstSync:o.decodeFirstSync,diagnose:i.diagnose,encode:s.encode,encodeCanonical:s.encodeCanonical,encodeOne:s.encodeOne,encodeAsync:s.encodeAsync,decode:o.decodeFirstSync,leveldb:{decode:o.decodeFirstSync,encode:s.encode,buffer:!0,name:"cbor"},reset(){s.reset(),u.reset()}}},20893:(e,t,r)=>{"use strict";const n=r(88310),i=r(27328),o=r(93737),s=r(5256),{MT:a,NUMBYTES:u,SYMS:c}=r(79452),{Buffer:f}=r(48287);function l(e){return e>1?"s":""}class h extends n.Transform{constructor(e={}){const{depth:t=1,max_depth:r=10,no_summary:n=!1,tags:i={},preferWeb:a,encoding:u,...c}=e;super({...c,readableObjectMode:!1,writableObjectMode:!1}),this.depth=t,this.max_depth=r,this.all=new s,i[24]||(i[24]=this._tag_24.bind(this)),this.parser=new o({tags:i,max_depth:r,preferWeb:a,encoding:u}),this.parser.on("value",this._on_value.bind(this)),this.parser.on("start",this._on_start.bind(this)),this.parser.on("start-string",this._on_start_string.bind(this)),this.parser.on("stop",this._on_stop.bind(this)),this.parser.on("more-bytes",this._on_more.bind(this)),this.parser.on("error",this._on_error.bind(this)),n||this.parser.on("data",this._on_data.bind(this)),this.parser.bs.on("read",this._on_read.bind(this))}_tag_24(e){const t=new h({depth:this.depth+1,no_summary:!0});t.on("data",(e=>this.push(e))),t.on("error",(e=>this.emit("error",e))),t.end(e)}_transform(e,t,r){this.parser.write(e,t,r)}_flush(e){return this.parser._flush(e)}static comment(e,t={},r=null){if(null==e)throw new Error("input required");({options:t,cb:r}=function(e,t){switch(typeof e){case"function":return{options:{},cb:e};case"string":return{options:{encoding:e},cb:t};case"number":return{options:{max_depth:e},cb:t};case"object":return{options:e||{},cb:t};default:throw new TypeError("Unknown option type")}}(t,r));const n=new s,{encoding:o="hex",...a}=t,u=new h(a);let c=null;return"function"==typeof r?(u.on("end",(()=>{r(null,n.toString("utf8"))})),u.on("error",r)):c=new Promise(((e,t)=>{u.on("end",(()=>{e(n.toString("utf8"))})),u.on("error",t)})),u.pipe(n),i.guessEncoding(e,o).pipe(u),c}_on_error(e){this.push("ERROR: "),this.push(e.toString()),this.push("\n")}_on_read(e){this.all.write(e);const t=e.toString("hex");this.push(new Array(this.depth+1).join(" ")),this.push(t);let r=2*(this.max_depth-this.depth)-t.length;r<1&&(r=1),this.push(new Array(r+1).join(" ")),this.push("-- ")}_on_more(e,t,r,n){let i="";switch(this.depth++,e){case a.POS_INT:i="Positive number,";break;case a.NEG_INT:i="Negative number,";break;case a.ARRAY:i="Array, length";break;case a.MAP:i="Map, count";break;case a.BYTE_STRING:i="Bytes, length";break;case a.UTF8_STRING:i="String, length";break;case a.SIMPLE_FLOAT:i=1===t?"Simple value,":"Float,"}this.push(`${i} next ${t} byte${l(t)}\n`)}_on_start_string(e,t,r,n){let i="";switch(this.depth++,e){case a.BYTE_STRING:i=`Bytes, length: ${t}`;break;case a.UTF8_STRING:i=`String, length: ${t.toString()}`}this.push(`${i}\n`)}_on_start(e,t,r,n){switch(this.depth++,r){case a.ARRAY:this.push(`[${n}], `);break;case a.MAP:n%2?this.push(`{Val:${Math.floor(n/2)}}, `):this.push(`{Key:${Math.floor(n/2)}}, `)}switch(e){case a.TAG:this.push(`Tag #${t}`),24===t&&this.push(" Encoded CBOR data item");break;case a.ARRAY:t===c.STREAM?this.push("Array (streaming)"):this.push(`Array, ${t} item${l(t)}`);break;case a.MAP:t===c.STREAM?this.push("Map (streaming)"):this.push(`Map, ${t} pair${l(t)}`);break;case a.BYTE_STRING:this.push("Bytes (streaming)");break;case a.UTF8_STRING:this.push("String (streaming)")}this.push("\n")}_on_stop(e){this.depth--}_on_value(e,t,r,n){if(e!==c.BREAK)switch(t){case a.ARRAY:this.push(`[${r}], `);break;case a.MAP:r%2?this.push(`{Val:${Math.floor(r/2)}}, `):this.push(`{Key:${Math.floor(r/2)}}, `)}const o=i.cborValueToString(e,-1/0);switch("string"==typeof e||f.isBuffer(e)?(e.length>0&&(this.push(o),this.push("\n")),this.depth--):(this.push(o),this.push("\n")),n){case u.ONE:case u.TWO:case u.FOUR:case u.EIGHT:this.depth--}}_on_data(){this.push("0x"),this.push(this.all.read().toString("hex")),this.push("\n")}}e.exports=h},79452:(e,t)=>{"use strict";t.MT={POS_INT:0,NEG_INT:1,BYTE_STRING:2,UTF8_STRING:3,ARRAY:4,MAP:5,TAG:6,SIMPLE_FLOAT:7},t.TAG={DATE_STRING:0,DATE_EPOCH:1,POS_BIGINT:2,NEG_BIGINT:3,DECIMAL_FRAC:4,BIGFLOAT:5,BASE64URL_EXPECTED:21,BASE64_EXPECTED:22,BASE16_EXPECTED:23,CBOR:24,URI:32,BASE64URL:33,BASE64:34,REGEXP:35,MIME:36,SET:258},t.NUMBYTES={ZERO:0,ONE:24,TWO:25,FOUR:26,EIGHT:27,INDEFINITE:31},t.SIMPLE={FALSE:20,TRUE:21,NULL:22,UNDEFINED:23},t.SYMS={NULL:Symbol.for("github.com/hildjj/node-cbor/null"),UNDEFINED:Symbol.for("github.com/hildjj/node-cbor/undef"),PARENT:Symbol.for("github.com/hildjj/node-cbor/parent"),BREAK:Symbol.for("github.com/hildjj/node-cbor/break"),STREAM:Symbol.for("github.com/hildjj/node-cbor/stream")},t.SHIFT32=4294967296,t.BI={MINUS_ONE:BigInt(-1),NEG_MAX:BigInt(-1)-BigInt(Number.MAX_SAFE_INTEGER),MAXINT32:BigInt("0xffffffff"),MAXINT64:BigInt("0xffffffffffffffff"),SHIFT32:BigInt(t.SHIFT32)}},93737:(e,t,r)=>{"use strict";const n=r(54957),i=r(53557),o=r(15059),s=r(27328),a=r(5256),u=(r(88310),r(79452)),{MT:c,NUMBYTES:f,SYMS:l,BI:h}=u,{Buffer:p}=r(48287),d=Symbol("count"),y=Symbol("major type"),g=Symbol("error"),m=Symbol("not found");function v(e,t,r){const n=[];return n[d]=r,n[l.PARENT]=e,n[y]=t,n}function b(e,t){const r=new a;return r[d]=-1,r[l.PARENT]=e,r[y]=t,r}class _ extends Error{constructor(e,t){super(`Unexpected data: 0x${e.toString(16)}`),this.name="UnexpectedDataError",this.byte=e,this.value=t}}function w(e,t){switch(typeof e){case"function":return{options:{},cb:e};case"string":return{options:{encoding:e},cb:t};case"object":return{options:e||{},cb:t};default:throw new TypeError("Unknown option type")}}class E extends n{constructor(e={}){const{tags:t={},max_depth:r=-1,preferMap:n=!1,preferWeb:i=!1,required:o=!1,encoding:s="hex",extendedResults:u=!1,preventDuplicateKeys:c=!1,...f}=e;super({defaultEncoding:s,...f}),this.running=!0,this.max_depth=r,this.tags=t,this.preferMap=n,this.preferWeb=i,this.extendedResults=u,this.required=o,this.preventDuplicateKeys=c,u&&(this.bs.on("read",this._onRead.bind(this)),this.valueBytes=new a)}static nullcheck(e){switch(e){case l.NULL:return null;case l.UNDEFINED:return;case m:throw new Error("Value not found");default:return e}}static decodeFirstSync(e,t={}){if(null==e)throw new TypeError("input required");({options:t}=w(t));const{encoding:r="hex",...n}=t,i=new E(n),o=s.guessEncoding(e,r),a=i._parse();let u=a.next();for(;!u.done;){const e=o.read(u.value);if(null==e||e.length!==u.value)throw new Error("Insufficient data");i.extendedResults&&i.valueBytes.write(e),u=a.next(e)}let c=null;if(i.extendedResults)c=u.value,c.unused=o.read();else if(c=E.nullcheck(u.value),o.length>0){const e=o.read(1);throw o.unshift(e),new _(e[0],c)}return c}static decodeAllSync(e,t={}){if(null==e)throw new TypeError("input required");({options:t}=w(t));const{encoding:r="hex",...n}=t,i=new E(n),o=s.guessEncoding(e,r),a=[];for(;o.length>0;){const e=i._parse();let t=e.next();for(;!t.done;){const r=o.read(t.value);if(null==r||r.length!==t.value)throw new Error("Insufficient data");i.extendedResults&&i.valueBytes.write(r),t=e.next(r)}a.push(E.nullcheck(t.value))}return a}static decodeFirst(e,t={},r=null){if(null==e)throw new TypeError("input required");({options:t,cb:r}=w(t,r));const{encoding:n="hex",required:i=!1,...o}=t,a=new E(o);let u=m;const c=s.guessEncoding(e,n),f=new Promise(((e,t)=>{a.on("data",(e=>{u=E.nullcheck(e),a.close()})),a.once("error",(r=>a.extendedResults&&r instanceof _?(u.unused=a.bs.slice(),e(u)):(u!==m&&(r.value=u),u=g,a.close(),t(r)))),a.once("end",(()=>{switch(u){case m:return i?t(new Error("No CBOR found")):e(u);case g:return;default:return e(u)}}))}));return"function"==typeof r&&f.then((e=>r(null,e)),r),c.pipe(a),f}static decodeAll(e,t={},r=null){if(null==e)throw new TypeError("input required");({options:t,cb:r}=w(t,r));const{encoding:n="hex",...i}=t,o=new E(i),a=[];o.on("data",(e=>a.push(E.nullcheck(e))));const u=new Promise(((e,t)=>{o.on("error",t),o.on("end",(()=>e(a)))}));return"function"==typeof r&&u.then((e=>r(void 0,e)),(e=>r(e,void 0))),s.guessEncoding(e,n).pipe(o),u}close(){this.running=!1,this.__fresh=!0}_onRead(e){this.valueBytes.write(e)}*_parse(){let e=null,t=0,r=null;for(;;){if(this.max_depth>=0&&t>this.max_depth)throw new Error(`Maximum depth ${this.max_depth} exceeded`);const[n]=yield 1;if(!this.running)throw this.bs.unshift(p.from([n])),new _(n);const u=n>>5,g=31&n,m=null==e?void 0:e[y],w=null==e?void 0:e.length;switch(g){case f.ONE:this.emit("more-bytes",u,1,m,w),[r]=yield 1;break;case f.TWO:case f.FOUR:case f.EIGHT:{const e=1<<g-24;this.emit("more-bytes",u,e,m,w);const t=yield e;r=u===c.SIMPLE_FLOAT?t:s.parseCBORint(g,t);break}case 28:case 29:case 30:throw this.running=!1,new Error(`Additional info not implemented: ${g}`);case f.INDEFINITE:switch(u){case c.POS_INT:case c.NEG_INT:case c.TAG:throw new Error(`Invalid indefinite encoding for MT ${u}`)}r=-1;break;default:r=g}switch(u){case c.POS_INT:break;case c.NEG_INT:r=r===Number.MAX_SAFE_INTEGER?h.NEG_MAX:"bigint"==typeof r?h.MINUS_ONE-r:-1-r;break;case c.BYTE_STRING:case c.UTF8_STRING:switch(r){case 0:this.emit("start-string",u,r,m,w),r=u===c.UTF8_STRING?"":this.preferWeb?new Uint8Array(0):p.allocUnsafe(0);break;case-1:this.emit("start",u,l.STREAM,m,w),e=b(e,u),t++;continue;default:this.emit("start-string",u,r,m,w),r=yield r,u===c.UTF8_STRING?r=s.utf8(r):this.preferWeb&&(r=new Uint8Array(r.buffer,r.byteOffset,r.length))}break;case c.ARRAY:case c.MAP:switch(r){case 0:r=u===c.MAP?this.preferMap?new Map:{}:[];break;case-1:this.emit("start",u,l.STREAM,m,w),e=v(e,u,-1),t++;continue;default:this.emit("start",u,r,m,w),e=v(e,u,r*(u-3)),t++;continue}break;case c.TAG:this.emit("start",u,r,m,w),e=v(e,u,1),e.push(r),t++;continue;case c.SIMPLE_FLOAT:if("number"==typeof r){if(g===f.ONE&&r<32)throw new Error(`Invalid two-byte encoding of simple value ${r}`);const t=null!=e;r=o.decode(r,t,t&&e[d]<0)}else r=s.parseCBORfloat(r)}this.emit("value",r,m,w,g);let x=!1;for(;null!=e;){if(r===l.BREAK)e[d]=1;else if(Array.isArray(e))e.push(r);else{const t=e[y];if(null!=t&&t!==u)throw this.running=!1,new Error("Invalid major type in indefinite encoding");e.write(r)}if(0!=--e[d]){x=!0;break}if(--t,delete e[d],Array.isArray(e))switch(e[y]){case c.ARRAY:r=e;break;case c.MAP:{let t=!this.preferMap;if(e.length%2!=0)throw new Error(`Invalid map length: ${e.length}`);for(let r=0,n=e.length;t&&r<n;r+=2)if("string"!=typeof e[r]||"__proto__"===e[r]){t=!1;break}if(t){r={};for(let t=0,n=e.length;t<n;t+=2){if(this.preventDuplicateKeys&&Object.prototype.hasOwnProperty.call(r,e[t]))throw new Error("Duplicate keys in a map");r[e[t]]=e[t+1]}}else{r=new Map;for(let t=0,n=e.length;t<n;t+=2){if(this.preventDuplicateKeys&&r.has(e[t]))throw new Error("Duplicate keys in a map");r.set(e[t],e[t+1])}}break}case c.TAG:r=new i(e[0],e[1]).convert(this.tags)}else if(e instanceof a)switch(e[y]){case c.BYTE_STRING:r=e.slice(),this.preferWeb&&(r=new Uint8Array(r.buffer,r.byteOffset,r.length));break;case c.UTF8_STRING:r=e.toString("utf-8")}this.emit("stop",e[y]);const n=e;e=e[l.PARENT],delete n[l.PARENT],delete n[y]}if(!x){if(this.extendedResults){const e=this.valueBytes.slice(),t={value:E.nullcheck(r),bytes:e,length:e.length};return this.valueBytes=new a,t}return r}}}}E.NOT_FOUND=m,e.exports=E},79777:(e,t,r)=>{"use strict";const n=r(88310),i=r(93737),o=r(27328),s=r(5256),{MT:a,SYMS:u}=r(79452);class c extends n.Transform{constructor(e={}){const{separator:t="\n",stream_errors:r=!1,tags:n,max_depth:o,preferWeb:s,encoding:a,...u}=e;super({...u,readableObjectMode:!1,writableObjectMode:!1}),this.float_bytes=-1,this.separator=t,this.stream_errors=r,this.parser=new i({tags:n,max_depth:o,preferWeb:s,encoding:a}),this.parser.on("more-bytes",this._on_more.bind(this)),this.parser.on("value",this._on_value.bind(this)),this.parser.on("start",this._on_start.bind(this)),this.parser.on("stop",this._on_stop.bind(this)),this.parser.on("data",this._on_data.bind(this)),this.parser.on("error",this._on_error.bind(this))}_transform(e,t,r){this.parser.write(e,t,r)}_flush(e){this.parser._flush((t=>this.stream_errors?(t&&this._on_error(t),e()):e(t)))}static diagnose(e,t={},r=null){if(null==e)throw new TypeError("input required");({options:t,cb:r}=function(e,t){switch(typeof e){case"function":return{options:{},cb:e};case"string":return{options:{encoding:e},cb:t};case"object":return{options:e||{},cb:t};default:throw new TypeError("Unknown option type")}}(t,r));const{encoding:n="hex",...i}=t,a=new s,u=new c(i);let f=null;return"function"==typeof r?(u.on("end",(()=>r(null,a.toString("utf8")))),u.on("error",r)):f=new Promise(((e,t)=>{u.on("end",(()=>e(a.toString("utf8")))),u.on("error",t)})),u.pipe(a),o.guessEncoding(e,n).pipe(u),f}_on_error(e){this.stream_errors?this.push(e.toString()):this.emit("error",e)}_on_more(e,t,r,n){e===a.SIMPLE_FLOAT&&(this.float_bytes={2:1,4:2,8:3}[t])}_fore(e,t){switch(e){case a.BYTE_STRING:case a.UTF8_STRING:case a.ARRAY:t>0&&this.push(", ");break;case a.MAP:t>0&&(t%2?this.push(": "):this.push(", "))}}_on_value(e,t,r){if(e===u.BREAK)return;this._fore(t,r);const n=this.float_bytes;this.float_bytes=-1,this.push(o.cborValueToString(e,n))}_on_start(e,t,r,n){switch(this._fore(r,n),e){case a.TAG:this.push(`${t}(`);break;case a.ARRAY:this.push("[");break;case a.MAP:this.push("{");break;case a.BYTE_STRING:case a.UTF8_STRING:this.push("(")}t===u.STREAM&&this.push("_ ")}_on_stop(e){switch(e){case a.TAG:this.push(")");break;case a.ARRAY:this.push("]");break;case a.MAP:this.push("}");break;case a.BYTE_STRING:case a.UTF8_STRING:this.push(")")}}_on_data(){this.push(this.separator)}}e.exports=c},72893:(e,t,r)=>{"use strict";const n=r(88310),i=r(5256),o=r(27328),s=r(79452),{MT:a,NUMBYTES:u,SHIFT32:c,SIMPLE:f,SYMS:l,TAG:h,BI:p}=s,{Buffer:d}=r(48287),y=a.SIMPLE_FLOAT<<5|u.TWO,g=a.SIMPLE_FLOAT<<5|u.FOUR,m=a.SIMPLE_FLOAT<<5|u.EIGHT,v=a.SIMPLE_FLOAT<<5|f.TRUE,b=a.SIMPLE_FLOAT<<5|f.FALSE,_=a.SIMPLE_FLOAT<<5|f.UNDEFINED,w=a.SIMPLE_FLOAT<<5|f.NULL,E=d.from([255]),x=d.from("f97e00","hex"),B=d.from("f9fc00","hex"),A=d.from("f97c00","hex"),S=d.from("f98000","hex"),k={};let T={};class O extends n.Transform{constructor(e={}){const{canonical:t=!1,encodeUndefined:r,disallowUndefinedKeys:n=!1,dateType:i="number",collapseBigIntegers:o=!1,detectLoops:s=!1,omitUndefinedProperties:a=!1,genTypes:u=[],...c}=e;if(super({...c,readableObjectMode:!1,writableObjectMode:!0}),this.canonical=t,this.encodeUndefined=r,this.disallowUndefinedKeys=n,this.dateType=function(e){if(!e)return"number";switch(e.toLowerCase()){case"number":return"number";case"float":return"float";case"int":case"integer":return"int";case"string":return"string"}throw new TypeError(`dateType invalid, got "${e}"`)}(i),this.collapseBigIntegers=!!this.canonical||o,this.detectLoops=void 0,"boolean"==typeof s)s&&(this.detectLoops=new WeakSet);else{if(!(s instanceof WeakSet))throw new TypeError("detectLoops must be boolean or WeakSet");this.detectLoops=s}if(this.omitUndefinedProperties=a,this.semanticTypes={...O.SEMANTIC_TYPES},Array.isArray(u))for(let e=0,t=u.length;e<t;e+=2)this.addSemanticType(u[e],u[e+1]);else for(const[e,t]of Object.entries(u))this.addSemanticType(e,t)}_transform(e,t,r){r(!1===this.pushAny(e)?new Error("Push Error"):void 0)}_flush(e){e()}_pushUInt8(e){const t=d.allocUnsafe(1);return t.writeUInt8(e,0),this.push(t)}_pushUInt16BE(e){const t=d.allocUnsafe(2);return t.writeUInt16BE(e,0),this.push(t)}_pushUInt32BE(e){const t=d.allocUnsafe(4);return t.writeUInt32BE(e,0),this.push(t)}_pushFloatBE(e){const t=d.allocUnsafe(4);return t.writeFloatBE(e,0),this.push(t)}_pushDoubleBE(e){const t=d.allocUnsafe(8);return t.writeDoubleBE(e,0),this.push(t)}_pushNaN(){return this.push(x)}_pushInfinity(e){const t=e<0?B:A;return this.push(t)}_pushFloat(e){if(this.canonical){const t=d.allocUnsafe(2);if(o.writeHalf(t,e))return this._pushUInt8(y)&&this.push(t)}return Math.fround(e)===e?this._pushUInt8(g)&&this._pushFloatBE(e):this._pushUInt8(m)&&this._pushDoubleBE(e)}_pushInt(e,t,r){const n=t<<5;if(e<24)return this._pushUInt8(n|e);if(e<=255)return this._pushUInt8(n|u.ONE)&&this._pushUInt8(e);if(e<=65535)return this._pushUInt8(n|u.TWO)&&this._pushUInt16BE(e);if(e<=4294967295)return this._pushUInt8(n|u.FOUR)&&this._pushUInt32BE(e);let i=Number.MAX_SAFE_INTEGER;return t===a.NEG_INT&&i--,e<=i?this._pushUInt8(n|u.EIGHT)&&this._pushUInt32BE(Math.floor(e/c))&&this._pushUInt32BE(e%c):t===a.NEG_INT?this._pushFloat(r):this._pushFloat(e)}_pushIntNum(e){return Object.is(e,-0)?this.push(S):e<0?this._pushInt(-e-1,a.NEG_INT,e):this._pushInt(e,a.POS_INT)}_pushNumber(e){return isNaN(e)?this._pushNaN():isFinite(e)?Math.round(e)===e?this._pushIntNum(e):this._pushFloat(e):this._pushInfinity(e)}_pushString(e){const t=d.byteLength(e,"utf8");return this._pushInt(t,a.UTF8_STRING)&&this.push(e,"utf8")}_pushBoolean(e){return this._pushUInt8(e?v:b)}_pushUndefined(e){switch(typeof this.encodeUndefined){case"undefined":return this._pushUInt8(_);case"function":return this.pushAny(this.encodeUndefined(e));case"object":{const e=o.bufferishToBuffer(this.encodeUndefined);if(e)return this.push(e)}}return this.pushAny(this.encodeUndefined)}_pushNull(e){return this._pushUInt8(w)}_pushTag(e){return this._pushInt(e,a.TAG)}_pushJSBigint(e){let t=a.POS_INT,r=h.POS_BIGINT;if(e<0&&(e=-e+p.MINUS_ONE,t=a.NEG_INT,r=h.NEG_BIGINT),this.collapseBigIntegers&&e<=p.MAXINT64)return e<=4294967295?this._pushInt(Number(e),t):this._pushUInt8(t<<5|u.EIGHT)&&this._pushUInt32BE(Number(e/p.SHIFT32))&&this._pushUInt32BE(Number(e%p.SHIFT32));let n=e.toString(16);n.length%2&&(n=`0${n}`);const i=d.from(n,"hex");return this._pushTag(r)&&O._pushBuffer(this,i)}_pushObject(e,t){if(!e)return this._pushNull(e);if(!(t={indefinite:!1,skipTypes:!1,...t}).indefinite&&this.detectLoops){if(this.detectLoops.has(e))throw new Error("Loop detected while CBOR encoding.\nCall removeLoopDetectors before resuming.");this.detectLoops.add(e)}if(!t.skipTypes){const t=e.encodeCBOR;if("function"==typeof t)return t.call(e,this);const r=this.semanticTypes[e.constructor.name];if(r)return r.call(e,this,e)}const r=Object.keys(e).filter((t=>{const r=typeof e[t];return"function"!==r&&(!this.omitUndefinedProperties||"undefined"!==r)})),n={};if(this.canonical&&r.sort(((e,t)=>{const r=n[e]||(n[e]=O.encode(e)),i=n[t]||(n[t]=O.encode(t));return r.compare(i)})),t.indefinite){if(!this._pushUInt8(a.MAP<<5|u.INDEFINITE))return!1}else if(!this._pushInt(r.length,a.MAP))return!1;let i=null;for(let t=0,o=r.length;t<o;t++){const o=r[t];if(this.canonical&&(i=n[o])){if(!this.push(i))return!1}else if(!this._pushString(o))return!1;if(!this.pushAny(e[o]))return!1}if(t.indefinite){if(!this.push(E))return!1}else this.detectLoops&&this.detectLoops.delete(e);return!0}_encodeAll(e){const t=new i({highWaterMark:this.readableHighWaterMark});this.pipe(t);for(const t of e)this.pushAny(t);return this.end(),t.read()}addSemanticType(e,t){const r="string"==typeof e?e:e.name,n=this.semanticTypes[r];if(t){if("function"!=typeof t)throw new TypeError("fun must be of type function");this.semanticTypes[r]=t}else n&&delete this.semanticTypes[r];return n}pushAny(e){switch(typeof e){case"number":return this._pushNumber(e);case"bigint":return this._pushJSBigint(e);case"string":return this._pushString(e);case"boolean":return this._pushBoolean(e);case"undefined":return this._pushUndefined(e);case"object":return this._pushObject(e);case"symbol":switch(e){case l.NULL:return this._pushNull(null);case l.UNDEFINED:return this._pushUndefined(void 0);default:throw new TypeError(`Unknown symbol: ${e.toString()}`)}default:throw new TypeError(`Unknown type: ${typeof e}, ${"function"==typeof e.toString?e.toString():""}`)}}static pushArray(e,t,r){r={indefinite:!1,...r};const n=t.length;if(r.indefinite){if(!e._pushUInt8(a.ARRAY<<5|u.INDEFINITE))return!1}else if(!e._pushInt(n,a.ARRAY))return!1;for(let r=0;r<n;r++)if(!e.pushAny(t[r]))return!1;return!(r.indefinite&&!e.push(E))}removeLoopDetectors(){return!!this.detectLoops&&(this.detectLoops=new WeakSet,!0)}static _pushDate(e,t){switch(e.dateType){case"string":return e._pushTag(h.DATE_STRING)&&e._pushString(t.toISOString());case"int":return e._pushTag(h.DATE_EPOCH)&&e._pushIntNum(Math.round(t.getTime()/1e3));case"float":return e._pushTag(h.DATE_EPOCH)&&e._pushFloat(t.getTime()/1e3);default:return e._pushTag(h.DATE_EPOCH)&&e.pushAny(t.getTime()/1e3)}}static _pushBuffer(e,t){return e._pushInt(t.length,a.BYTE_STRING)&&e.push(t)}static _pushNoFilter(e,t){return O._pushBuffer(e,t.slice())}static _pushRegexp(e,t){return e._pushTag(h.REGEXP)&&e.pushAny(t.source)}static _pushSet(e,t){if(!e._pushTag(h.SET))return!1;if(!e._pushInt(t.size,a.ARRAY))return!1;for(const r of t)if(!e.pushAny(r))return!1;return!0}static _pushURL(e,t){return e._pushTag(h.URI)&&e.pushAny(t.toString())}static _pushBoxed(e,t){return e.pushAny(t.valueOf())}static _pushMap(e,t,r){r={indefinite:!1,...r};let n=[...t.entries()];if(e.omitUndefinedProperties&&(n=n.filter((([e,t])=>void 0!==t))),r.indefinite){if(!e._pushUInt8(a.MAP<<5|u.INDEFINITE))return!1}else if(!e._pushInt(n.length,a.MAP))return!1;if(e.canonical){const t=new O({genTypes:e.semanticTypes,canonical:e.canonical,detectLoops:Boolean(e.detectLoops),dateType:e.dateType,disallowUndefinedKeys:e.disallowUndefinedKeys,collapseBigIntegers:e.collapseBigIntegers}),r=new i({highWaterMark:e.readableHighWaterMark});t.pipe(r),n.sort((([e],[n])=>{t.pushAny(e);const i=r.read();t.pushAny(n);const o=r.read();return i.compare(o)}));for(const[t,r]of n){if(e.disallowUndefinedKeys&&void 0===t)throw new Error("Invalid Map key: undefined");if(!e.pushAny(t)||!e.pushAny(r))return!1}}else for(const[t,r]of n){if(e.disallowUndefinedKeys&&void 0===t)throw new Error("Invalid Map key: undefined");if(!e.pushAny(t)||!e.pushAny(r))return!1}return!(r.indefinite&&!e.push(E))}static _pushTypedArray(e,t){let r=64,n=t.BYTES_PER_ELEMENT;const{name:i}=t.constructor;return i.startsWith("Float")?(r|=16,n/=2):i.includes("U")||(r|=8),(i.includes("Clamped")||1!==n&&!o.isBigEndian())&&(r|=4),r|={1:0,2:1,4:2,8:3}[n],!!e._pushTag(r)&&O._pushBuffer(e,d.from(t.buffer,t.byteOffset,t.byteLength))}static _pushArrayBuffer(e,t){return O._pushBuffer(e,d.from(t))}static encodeIndefinite(e,t,r={}){if(null==t){if(null==this)throw new Error("No object to encode");t=this}const{chunkSize:n=4096}=r;let i=!0;const s=typeof t;let c=null;if("string"===s){i=i&&e._pushUInt8(a.UTF8_STRING<<5|u.INDEFINITE);let r=0;for(;r<t.length;){const o=r+n;i=i&&e._pushString(t.slice(r,o)),r=o}i=i&&e.push(E)}else if(c=o.bufferishToBuffer(t)){i=i&&e._pushUInt8(a.BYTE_STRING<<5|u.INDEFINITE);let t=0;for(;t<c.length;){const r=t+n;i=i&&O._pushBuffer(e,c.slice(t,r)),t=r}i=i&&e.push(E)}else if(Array.isArray(t))i=i&&O.pushArray(e,t,{indefinite:!0});else if(t instanceof Map)i=i&&O._pushMap(e,t,{indefinite:!0});else{if("object"!==s)throw new Error("Invalid indefinite encoding");i=i&&e._pushObject(t,{indefinite:!0,skipTypes:!0})}return i}static encode(...e){return(new O)._encodeAll(e)}static encodeCanonical(...e){return new O({canonical:!0})._encodeAll(e)}static encodeOne(e,t){return new O(t)._encodeAll([e])}static encodeAsync(e,t){return new Promise(((r,n)=>{const i=[],o=new O(t);o.on("data",(e=>i.push(e))),o.on("error",n),o.on("finish",(()=>r(d.concat(i)))),o.pushAny(e),o.end()}))}static get SEMANTIC_TYPES(){return T}static set SEMANTIC_TYPES(e){T=e}static reset(){O.SEMANTIC_TYPES={...k}}}Object.assign(k,{Array:O.pushArray,Date:O._pushDate,Buffer:O._pushBuffer,[d.name]:O._pushBuffer,Map:O._pushMap,NoFilter:O._pushNoFilter,[i.name]:O._pushNoFilter,RegExp:O._pushRegexp,Set:O._pushSet,ArrayBuffer:O._pushArrayBuffer,Uint8ClampedArray:O._pushTypedArray,Uint8Array:O._pushTypedArray,Uint16Array:O._pushTypedArray,Uint32Array:O._pushTypedArray,Int8Array:O._pushTypedArray,Int16Array:O._pushTypedArray,Int32Array:O._pushTypedArray,Float32Array:O._pushTypedArray,Float64Array:O._pushTypedArray,URL:O._pushURL,Boolean:O._pushBoxed,Number:O._pushBoxed,String:O._pushBoxed}),"undefined"!=typeof BigUint64Array&&(k[BigUint64Array.name]=O._pushTypedArray),"undefined"!=typeof BigInt64Array&&(k[BigInt64Array.name]=O._pushTypedArray),O.reset(),e.exports=O},82903:(e,t,r)=>{"use strict";const{Buffer:n}=r(48287),i=r(72893),o=r(93737),{MT:s}=r(79452);class a extends Map{constructor(e){super(e)}static _encode(e){return i.encodeCanonical(e).toString("base64")}static _decode(e){return o.decodeFirstSync(e,"base64")}get(e){return super.get(a._encode(e))}set(e,t){return super.set(a._encode(e),t)}delete(e){return super.delete(a._encode(e))}has(e){return super.has(a._encode(e))}*keys(){for(const e of super.keys())yield a._decode(e)}*entries(){for(const e of super.entries())yield[a._decode(e[0]),e[1]]}[Symbol.iterator](){return this.entries()}forEach(e,t){if("function"!=typeof e)throw new TypeError("Must be function");for(const t of super.entries())e.call(this,t[1],a._decode(t[0]),this)}encodeCBOR(e){if(!e._pushInt(this.size,s.MAP))return!1;if(e.canonical){const t=Array.from(super.entries()).map((e=>[n.from(e[0],"base64"),e[1]]));t.sort(((e,t)=>e[0].compare(t[0])));for(const r of t)if(!e.push(r[0])||!e.pushAny(r[1]))return!1}else for(const t of super.entries())if(!e.push(n.from(t[0],"base64"))||!e.pushAny(t[1]))return!1;return!0}}e.exports=a},69744:e=>{"use strict";class t{constructor(){this.clear()}clear(){this.map=new WeakMap,this.count=0,this.recording=!0}stop(){this.recording=!1}check(e){const r=this.map.get(e);if(r)return r.length>1?r[0]||this.recording?r[1]:(r[0]=!0,t.FIRST):this.recording?(r.push(this.count++),r[1]):t.NEVER;if(!this.recording)throw new Error("New object detected when not recording");return this.map.set(e,[!1]),t.NEVER}}t.NEVER=-1,t.FIRST=-2,e.exports=t},207:(e,t,r)=>{"use strict";const n=r(72893),i=r(69744),{Buffer:o}=r(48287);class s extends n{constructor(e){super(e),this.valueSharing=new i}_pushObject(e,t){if(null!==e){const t=this.valueSharing.check(e);switch(t){case i.FIRST:this._pushTag(28);break;case i.NEVER:break;default:return this._pushTag(29)&&this._pushIntNum(t)}}return super._pushObject(e,t)}stopRecording(){this.valueSharing.stop()}clearRecording(){this.valueSharing.clear()}static encode(...e){const t=new s;t.on("data",(()=>{}));for(const r of e)t.pushAny(r);return t.stopRecording(),t.removeAllListeners("data"),t._encodeAll(e)}static encodeCanonical(...e){throw new Error("Cannot encode canonically in a SharedValueEncoder, which serializes objects multiple times.")}static encodeOne(e,t){const r=new s(t);return r.on("data",(()=>{})),r.pushAny(e),r.stopRecording(),r.removeAllListeners("data"),r._encodeAll([e])}static encodeAsync(e,t){return new Promise(((r,n)=>{const i=[],a=new s(t);a.on("data",(()=>{})),a.on("error",n),a.on("finish",(()=>r(o.concat(i)))),a.pushAny(e),a.stopRecording(),a.removeAllListeners("data"),a.on("data",(e=>i.push(e))),a.pushAny(e),a.end()}))}}e.exports=s},15059:(e,t,r)=>{"use strict";const{MT:n,SIMPLE:i,SYMS:o}=r(79452);class s{constructor(e){if("number"!=typeof e)throw new Error("Invalid Simple type: "+typeof e);if(e<0||e>255||(0|e)!==e)throw new Error(`value must be a small positive integer: ${e}`);this.value=e}toString(){return`simple(${this.value})`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return`simple(${this.value})`}encodeCBOR(e){return e._pushInt(this.value,n.SIMPLE_FLOAT)}static isSimple(e){return e instanceof s}static decode(e,t=!0,r=!1){switch(e){case i.FALSE:return!1;case i.TRUE:return!0;case i.NULL:return t?null:o.NULL;case i.UNDEFINED:if(t)return;return o.UNDEFINED;case-1:if(!t||!r)throw new Error("Invalid BREAK");return o.BREAK;default:return new s(e)}}}e.exports=s},53557:(e,t,r)=>{"use strict";const n=r(79452),i=r(27328),o=Symbol("INTERNAL_JSON");function s(e,t){if(i.isBufferish(e))e.toJSON=t;else if(Array.isArray(e))for(const r of e)s(r,t);else if(e&&"object"==typeof e&&(!(e instanceof d)||e.tag<21||e.tag>23))for(const r of Object.values(e))s(r,t)}function a(){return i.base64(this)}function u(){return i.base64url(this)}function c(){return this.toString("hex")}const f={0:e=>new Date(e),1:e=>new Date(1e3*e),2:e=>i.bufferToBigInt(e),3:e=>n.BI.MINUS_ONE-i.bufferToBigInt(e),21:(e,t)=>(i.isBufferish(e)?t[o]=u:s(e,u),t),22:(e,t)=>(i.isBufferish(e)?t[o]=a:s(e,a),t),23:(e,t)=>(i.isBufferish(e)?t[o]=c:s(e,c),t),32:e=>new URL(e),33:(e,t)=>{if(!e.match(/^[a-zA-Z0-9_-]+$/))throw new Error("Invalid base64url characters");const r=e.length%4;if(1===r)throw new Error("Invalid base64url length");if(2===r){if(-1==="AQgw".indexOf(e[e.length-1]))throw new Error("Invalid base64 padding")}else if(3===r&&-1==="AEIMQUYcgkosw048".indexOf(e[e.length-1]))throw new Error("Invalid base64 padding");return t},34:(e,t)=>{const r=e.match(/^[a-zA-Z0-9+/]+(?<padding>={0,2})$/);if(!r)throw new Error("Invalid base64 characters");if(e.length%4!=0)throw new Error("Invalid base64 length");if("="===r.groups.padding){if(-1==="AQgw".indexOf(e[e.length-2]))throw new Error("Invalid base64 padding")}else if("=="===r.groups.padding&&-1==="AEIMQUYcgkosw048".indexOf(e[e.length-3]))throw new Error("Invalid base64 padding");return t},35:e=>new RegExp(e),258:e=>new Set(e)},l={64:Uint8Array,65:Uint16Array,66:Uint32Array,68:Uint8ClampedArray,69:Uint16Array,70:Uint32Array,72:Int8Array,73:Int16Array,74:Int32Array,77:Int16Array,78:Int32Array,81:Float32Array,82:Float64Array,85:Float32Array,86:Float64Array};function h(e,t){if(!i.isBufferish(e))throw new TypeError("val not a buffer");const{tag:r}=t,n=l[r];if(!n)throw new Error(`Invalid typed array tag: ${r}`);const o=2**(((16&r)>>4)+(3&r));return!(4&r)!==i.isBigEndian()&&o>1&&function(e,t,r,n){const i=new DataView(e),[o,s]={2:[i.getUint16,i.setUint16],4:[i.getUint32,i.setUint32],8:[i.getBigUint64,i.setBigUint64]}[t],a=r+n;for(let e=r;e<a;e+=t)s.call(i,e,o.call(i,e,!0))}(e.buffer,o,e.byteOffset,e.byteLength),new n(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}"undefined"!=typeof BigUint64Array&&(l[67]=BigUint64Array,l[71]=BigUint64Array),"undefined"!=typeof BigInt64Array&&(l[75]=BigInt64Array,l[79]=BigInt64Array);for(const e of Object.keys(l))f[e]=h;let p={};class d{constructor(e,t,r){if(this.tag=e,this.value=t,this.err=r,"number"!=typeof this.tag)throw new Error(`Invalid tag type (${typeof this.tag})`);if(this.tag<0||(0|this.tag)!==this.tag)throw new Error(`Tag must be a positive integer: ${this.tag}`)}toJSON(){if(this[o])return this[o].call(this.value);const e={tag:this.tag,value:this.value};return this.err&&(e.err=this.err),e}toString(){return`${this.tag}(${JSON.stringify(this.value)})`}encodeCBOR(e){return e._pushTag(this.tag),e.pushAny(this.value)}convert(e){let t=null==e?void 0:e[this.tag];if(null===t)return this;if("function"!=typeof t&&(t=d.TAGS[this.tag],"function"!=typeof t))return this;try{return t.call(this,this.value,this)}catch(e){return e&&e.message&&e.message.length>0?this.err=e.message:this.err=e,this}}static get TAGS(){return p}static set TAGS(e){p=e}static reset(){d.TAGS={...f}}}d.INTERNAL_JSON=o,d.reset(),e.exports=d},27328:(e,t,r)=>{"use strict";const{Buffer:n}=r(48287),i=r(5256),o=r(88310),s=r(79452),{NUMBYTES:a,SHIFT32:u,BI:c,SYMS:f}=s,l=new TextDecoder("utf8",{fatal:!0,ignoreBOM:!0});t.utf8=e=>l.decode(e),t.utf8.checksUTF8=!0,t.isBufferish=function(e){return e&&"object"==typeof e&&(n.isBuffer(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof ArrayBuffer||e instanceof DataView)},t.bufferishToBuffer=function(e){return n.isBuffer(e)?e:ArrayBuffer.isView(e)?n.from(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?n.from(e):null},t.parseCBORint=function(e,t){switch(e){case a.ONE:return t.readUInt8(0);case a.TWO:return t.readUInt16BE(0);case a.FOUR:return t.readUInt32BE(0);case a.EIGHT:{const e=t.readUInt32BE(0),r=t.readUInt32BE(4);return e>2097151?BigInt(e)*c.SHIFT32+BigInt(r):e*u+r}default:throw new Error(`Invalid additional info for int: ${e}`)}},t.writeHalf=function(e,t){const r=n.allocUnsafe(4);r.writeFloatBE(t,0);const i=r.readUInt32BE(0);if(8191&i)return!1;let o=i>>16&32768;const s=i>>23&255,a=8388607&i;if(s>=113&&s<=142)o+=(s-112<<10)+(a>>13);else{if(!(s>=103&&s<113))return!1;if(a&(1<<126-s)-1)return!1;o+=a+8388608>>126-s}return e.writeUInt16BE(o),!0},t.parseHalf=function(e){const t=128&e[0]?-1:1,r=(124&e[0])>>2,n=(3&e[0])<<8|e[1];return r?31===r?t*(n?NaN:1/0):t*2**(r-25)*(1024+n):5.960464477539063e-8*t*n},t.parseCBORfloat=function(e){switch(e.length){case 2:return t.parseHalf(e);case 4:return e.readFloatBE(0);case 8:return e.readDoubleBE(0);default:throw new Error(`Invalid float size: ${e.length}`)}},t.hex=function(e){return n.from(e.replace(/^0x/,""),"hex")},t.bin=function(e){let t=0,r=(e=e.replace(/\s/g,"")).length%8||8;const i=[];for(;r<=e.length;)i.push(parseInt(e.slice(t,r),2)),t=r,r+=8;return n.from(i)},t.arrayEqual=function(e,t){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every(((e,r)=>e===t[r]))},t.bufferToBigInt=function(e){return BigInt(`0x${e.toString("hex")}`)},t.cborValueToString=function(e,r=-1){switch(typeof e){case"symbol":{switch(e){case f.NULL:return"null";case f.UNDEFINED:return"undefined";case f.BREAK:return"BREAK"}if(e.description)return e.description;const t=e.toString().match(/^Symbol\((?<name>.*)\)/);return t&&t.groups.name?t.groups.name:"Symbol"}case"string":return JSON.stringify(e);case"bigint":return e.toString();case"number":{const t=Object.is(e,-0)?"-0":String(e);return r>0?`${t}_${r}`:t}case"object":{if(!e)return"null";const n=t.bufferishToBuffer(e);if(n){const e=n.toString("hex");return r===-1/0?e:`h'${e}'`}return e&&"function"==typeof e[Symbol.for("nodejs.util.inspect.custom")]?e[Symbol.for("nodejs.util.inspect.custom")]():Array.isArray(e)?"[]":"{}"}}return String(e)},t.guessEncoding=function(e,r){if("string"==typeof e)return new i(e,null==r?"hex":r);const n=t.bufferishToBuffer(e);if(n)return new i(n);if((s=e)instanceof o.Readable||["read","on","pipe"].every((e=>"function"==typeof s[e])))return e;var s;throw new Error("Unknown input type")};const h={"=":"","+":"-","/":"_"};t.base64url=function(e){return t.bufferishToBuffer(e).toString("base64").replace(/[=+/]/g,(e=>h[e]))},t.base64=function(e){return t.bufferishToBuffer(e).toString("base64")},t.isBigEndian=function(){const e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])}},54957:(e,t,r)=>{"use strict";const n=r(88310),i=r(5256);class o extends n.Transform{constructor(e){super(e),this._writableState.objectMode=!1,this._readableState.objectMode=!0,this.bs=new i,this.__restart()}_transform(e,t,r){for(this.bs.write(e);this.bs.length>=this.__needed;){let e=null;const t=null===this.__needed?void 0:this.bs.read(this.__needed);try{e=this.__parser.next(t)}catch(e){return r(e)}this.__needed&&(this.__fresh=!1),e.done?(this.push(e.value),this.__restart()):this.__needed=e.value||1/0}return r()}*_parse(){throw new Error("Must be implemented in subclass")}__restart(){this.__needed=null,this.__parser=this._parse(),this.__fresh=!0}_flush(e){e(this.__fresh?null:new Error("unexpected end of input"))}}e.exports=o},37007:e=>{function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function n(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}e.exports=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t.prototype.emit=function(e){var t,o,s,a,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var f=new Error('Uncaught, unspecified "error" event. ('+t+")");throw f.context=t,f}if(i(o=this._events[e]))return!1;if(r(o))switch(arguments.length){case 1:o.call(this);break;case 2:o.call(this,arguments[1]);break;case 3:o.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),o.apply(this,a)}else if(n(o))for(a=Array.prototype.slice.call(arguments,1),s=(c=o.slice()).length,u=0;u<s;u++)c[u].apply(this,a);return!0},t.prototype.addListener=function(e,o){var s;if(!r(o))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(o.listener)?o.listener:o),this._events[e]?n(this._events[e])?this._events[e].push(o):this._events[e]=[this._events[e],o]:this._events[e]=o,n(this._events[e])&&!this._events[e].warned&&(s=i(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&s>0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},t.prototype.removeListener=function(e,t){var i,o,s,a;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(s=(i=this._events[e]).length,o=-1,i===t||r(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(n(i)){for(a=s;a-- >0;)if(i[a]===t||i[a].listener&&i[a].listener===t){o=a;break}if(o<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},t.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},t.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},t.listenerCount=function(e,t){return e.listenerCount(t)}},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+p]=255&s,p+=d,s/=256,c-=8);e[r+p-d]|=128*y}},56698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},73065:function(e,t,r){var n,i;!function(o,s){"use strict";n=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],i={},o=null;function s(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var r=this.getLevel(),i=0;i<n.length;i++){var o=n[i];this[o]=i<r?e:this.methodFactory(o,r,this.name)}if(this.log=this.debug,typeof console===t&&r<this.levels.SILENT)return"No console available for logging"}function c(e){return function(){typeof console!==t&&(u.call(this),this[e].apply(this,arguments))}}function f(n,i,o){return function(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&r?a:void 0!==console[n]?s(console,n):void 0!==console.log?s(console,"log"):e)}(n)||c.apply(this,arguments)}function l(e,r){var s,a,c,l=this,h="loglevel";function p(){var e;if(typeof window!==t&&h){try{e=window.localStorage[h]}catch(e){}if(typeof e===t)try{var r=window.document.cookie,n=encodeURIComponent(h),i=r.indexOf(n+"=");-1!==i&&(e=/^([^;]+)/.exec(r.slice(i+n.length+1))[1])}catch(e){}return void 0===l.levels[e]&&(e=void 0),e}}function d(e){var t=e;if("string"==typeof t&&void 0!==l.levels[t.toUpperCase()]&&(t=l.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=l.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?h+=":"+e:"symbol"==typeof e&&(h=void 0),l.name=e,l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=r||f,l.getLevel=function(){return null!=c?c:null!=a?a:s},l.setLevel=function(e,r){return c=d(e),!1!==r&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&h){try{return void(window.localStorage[h]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"="+r+";"}catch(e){}}}(c),u.call(l)},l.setDefaultLevel=function(e){a=d(e),p()||l.setLevel(e,!1)},l.resetLevel=function(){c=null,function(){if(typeof window!==t&&h){try{window.localStorage.removeItem(h)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),u.call(l)},l.enableAll=function(e){l.setLevel(l.levels.TRACE,e)},l.disableAll=function(e){l.setLevel(l.levels.SILENT,e)},l.rebuild=function(){if(o!==l&&(s=d(o.getLevel())),u.call(l),o===l)for(var e in i)i[e].rebuild()},s=d(o?o.getLevel():"WARN");var y=p();null!=y&&(c=d(y)),u.call(l)}(o=new l).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=i[e];return t||(t=i[e]=new l(e,o.methodFactory)),t};var h=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=h),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=n.call(t,r,t,e))||(e.exports=i)}()},5256:(e,t,r)=>{"use strict";const n=r(88310),{Buffer:i}=r(48287),o=new TextDecoder("utf8",{fatal:!0,ignoreBOM:!0});class s extends n.Transform{constructor(e,t,r={}){let n=null,o=null;switch(typeof e){case"object":i.isBuffer(e)?n=e:e&&(r=e);break;case"string":n=e;break;case"undefined":break;default:throw new TypeError("Invalid input")}switch(typeof t){case"object":t&&(r=t);break;case"string":o=t;break;case"undefined":break;default:throw new TypeError("Invalid inputEncoding")}if(!r||"object"!=typeof r)throw new TypeError("Invalid options");null==n&&(n=r.input),null==o&&(o=r.inputEncoding),delete r.input,delete r.inputEncoding;const s=null==r.watchPipe||r.watchPipe;delete r.watchPipe;const a=Boolean(r.readError);delete r.readError,super(r),this.readError=a,s&&this.on("pipe",(e=>{const t=e._readableState.objectMode;if(this.length>0&&t!==this._readableState.objectMode)throw new Error("Do not switch objectMode in the middle of the stream");this._readableState.objectMode=t,this._writableState.objectMode=t})),null!=n&&this.end(n,o)}static isNoFilter(e){return e instanceof this}static compare(e,t){if(!(e instanceof this))throw new TypeError("Arguments must be NoFilters");return e===t?0:e.compare(t)}static concat(e,t){if(!Array.isArray(e))throw new TypeError("list argument must be an Array of NoFilters");if(0===e.length||0===t)return i.alloc(0);null==t&&(t=e.reduce(((e,t)=>{if(!(t instanceof s))throw new TypeError("list argument must be an Array of NoFilters");return e+t.length}),0));let r=!0,n=!0;const o=e.map((e=>{if(!(e instanceof s))throw new TypeError("list argument must be an Array of NoFilters");const t=e.slice();return i.isBuffer(t)?n=!1:r=!1,t}));if(r)return i.concat(o,t);if(n)return[].concat(...o).slice(0,t);throw new Error("Concatenating mixed object and byte streams not supported")}_transform(e,t,r){this._readableState.objectMode||i.isBuffer(e)||(e=i.from(e,t)),this.push(e),r()}_bufArray(){let e=this._readableState.buffer;if(!Array.isArray(e)){let t=e.head;for(e=[];null!=t;)e.push(t.data),t=t.next}return e}read(e){const t=super.read(e);if(null!=t){if(this.emit("read",t),this.readError&&t.length<e)throw new Error(`Read ${t.length}, wanted ${e}`)}else if(this.readError)throw new Error(`No data available, wanted ${e}`);return t}readFull(e){let t=null,r=null,n=null;return new Promise(((i,o)=>{this.length>=e?i(this.read(e)):this.writableFinished?o(new Error(`Stream finished before ${e} bytes were available`)):(t=t=>{this.length>=e&&i(this.read(e))},r=()=>{o(new Error(`Stream finished before ${e} bytes were available`))},n=o,this.on("readable",t),this.on("error",n),this.on("finish",r))})).finally((()=>{t&&(this.removeListener("readable",t),this.removeListener("error",n),this.removeListener("finish",r))}))}promise(e){let t=!1;return new Promise(((r,n)=>{this.on("finish",(()=>{const n=this.read();null==e||t||(t=!0,e(null,n)),r(n)})),this.on("error",(r=>{null==e||t||(t=!0,e(r)),n(r)}))}))}compare(e){if(!(e instanceof s))throw new TypeError("Arguments must be NoFilters");if(this===e)return 0;const t=this.slice(),r=e.slice();if(i.isBuffer(t)&&i.isBuffer(r))return t.compare(r);throw new Error("Cannot compare streams in object mode")}equals(e){return 0===this.compare(e)}slice(e,t){if(this._readableState.objectMode)return this._bufArray().slice(e,t);const r=this._bufArray();switch(r.length){case 0:return i.alloc(0);case 1:return r[0].slice(e,t);default:return i.concat(r).slice(e,t)}}get(e){return this.slice()[e]}toJSON(){const e=this.slice();return i.isBuffer(e)?e.toJSON():e}toString(e,t,r){const n=this.slice(t,r);return i.isBuffer(n)?e&&"utf8"!==e?n.toString(e):o.decode(n):JSON.stringify(n)}[Symbol.for("nodejs.util.inspect.custom")](e,t){const r=this._bufArray().map((e=>i.isBuffer(e)?t.stylize(e.toString("hex"),"string"):JSON.stringify(e))).join(", ");return`${this.constructor.name} [${r}]`}get length(){return this._readableState.length}writeBigInt(e){let t=e.toString(16);if(e<0){const r=BigInt(Math.floor(t.length/2));t=(e=(BigInt(1)<<r*BigInt(8))+e).toString(16)}return t.length%2&&(t=`0${t}`),this.push(i.from(t,"hex"))}readUBigInt(e){const t=this.read(e);return i.isBuffer(t)?BigInt(`0x${t.toString("hex")}`):null}readBigInt(e){const t=this.read(e);if(!i.isBuffer(t))return null;let r=BigInt(`0x${t.toString("hex")}`);return 128&t[0]&&(r-=BigInt(1)<<BigInt(t.length)*BigInt(8)),r}writeUInt8(e){const t=i.from([e]);return this.push(t)}writeUInt16LE(e){const t=i.alloc(2);return t.writeUInt16LE(e),this.push(t)}writeUInt16BE(e){const t=i.alloc(2);return t.writeUInt16BE(e),this.push(t)}writeUInt32LE(e){const t=i.alloc(4);return t.writeUInt32LE(e),this.push(t)}writeUInt32BE(e){const t=i.alloc(4);return t.writeUInt32BE(e),this.push(t)}writeInt8(e){const t=i.from([e]);return this.push(t)}writeInt16LE(e){const t=i.alloc(2);return t.writeUInt16LE(e),this.push(t)}writeInt16BE(e){const t=i.alloc(2);return t.writeUInt16BE(e),this.push(t)}writeInt32LE(e){const t=i.alloc(4);return t.writeUInt32LE(e),this.push(t)}writeInt32BE(e){const t=i.alloc(4);return t.writeUInt32BE(e),this.push(t)}writeFloatLE(e){const t=i.alloc(4);return t.writeFloatLE(e),this.push(t)}writeFloatBE(e){const t=i.alloc(4);return t.writeFloatBE(e),this.push(t)}writeDoubleLE(e){const t=i.alloc(8);return t.writeDoubleLE(e),this.push(t)}writeDoubleBE(e){const t=i.alloc(8);return t.writeDoubleBE(e),this.push(t)}writeBigInt64LE(e){const t=i.alloc(8);return t.writeBigInt64LE(e),this.push(t)}writeBigInt64BE(e){const t=i.alloc(8);return t.writeBigInt64BE(e),this.push(t)}writeBigUInt64LE(e){const t=i.alloc(8);return t.writeBigUInt64LE(e),this.push(t)}writeBigUInt64BE(e){const t=i.alloc(8);return t.writeBigUInt64BE(e),this.push(t)}readUInt8(){const e=this.read(1);return i.isBuffer(e)?e.readUInt8():null}readUInt16LE(){const e=this.read(2);return i.isBuffer(e)?e.readUInt16LE():null}readUInt16BE(){const e=this.read(2);return i.isBuffer(e)?e.readUInt16BE():null}readUInt32LE(){const e=this.read(4);return i.isBuffer(e)?e.readUInt32LE():null}readUInt32BE(){const e=this.read(4);return i.isBuffer(e)?e.readUInt32BE():null}readInt8(){const e=this.read(1);return i.isBuffer(e)?e.readInt8():null}readInt16LE(){const e=this.read(2);return i.isBuffer(e)?e.readInt16LE():null}readInt16BE(){const e=this.read(2);return i.isBuffer(e)?e.readInt16BE():null}readInt32LE(){const e=this.read(4);return i.isBuffer(e)?e.readInt32LE():null}readInt32BE(){const e=this.read(4);return i.isBuffer(e)?e.readInt32BE():null}readFloatLE(){const e=this.read(4);return i.isBuffer(e)?e.readFloatLE():null}readFloatBE(){const e=this.read(4);return i.isBuffer(e)?e.readFloatBE():null}readDoubleLE(){const e=this.read(8);return i.isBuffer(e)?e.readDoubleLE():null}readDoubleBE(){const e=this.read(8);return i.isBuffer(e)?e.readDoubleBE():null}readBigInt64LE(){const e=this.read(8);return i.isBuffer(e)?e.readBigInt64LE():null}readBigInt64BE(){const e=this.read(8);return i.isBuffer(e)?e.readBigInt64BE():null}readBigUInt64LE(){const e=this.read(8);return i.isBuffer(e)?e.readBigUInt64LE():null}readBigUInt64BE(){const e=this.read(8);return i.isBuffer(e)?e.readBigUInt64BE():null}}e.exports=s},9805:(e,t)=>{"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,s;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(s=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],s.set(o,i),i+=o.length;return s}},o={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,o))},t.setTyped(r)},53269:e=>{"use strict";e.exports=function(e,t,r,n){for(var i=65535&e,o=e>>>16&65535,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16}},19681:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},14823:e=>{"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var o=t,s=i+n;e^=-1;for(var a=i;a<s;a++)e=e>>>8^o[255&(e^r[a])];return~e}},58411:(e,t,r)=>{"use strict";var n,i=r(9805),o=r(23665),s=r(53269),a=r(14823),u=r(54674),c=0,f=0,l=-2,h=2,p=8,d=286,y=30,g=19,m=2*d+1,v=15,b=3,_=258,w=_+b+1,E=42,x=103,B=113,A=666;function S(e,t){return e.msg=u[t],t}function k(e){return(e<<1)-(e>4?9:0)}function T(e){for(var t=e.length;--t>=0;)e[t]=0}function O(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function I(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,O(e.strm)}function N(e,t){e.pending_buf[e.pending++]=t}function F(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function R(e,t){var r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,u=e.strstart>e.w_size-w?e.strstart-(e.w_size-w):0,c=e.window,f=e.w_mask,l=e.prev,h=e.strstart+_,p=c[o+s-1],d=c[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(r=t)+s]===d&&c[r+s-1]===p&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<h);if(n=_-(h-o),o=h-_,n>s){if(e.match_start=t,s=n,n>=a)break;p=c[o+s-1],d=c[o+s]}}}while((t=l[t&f])>u&&0!=--i);return s<=e.lookahead?s:e.lookahead}function L(e){var t,r,n,o,u,c,f,l,h,p,d=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-w)){i.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=d?n-d:0}while(--r);t=r=d;do{n=e.prev[--t],e.prev[t]=n>=d?n-d:0}while(--r);o+=d}if(0===e.strm.avail_in)break;if(c=e.strm,f=e.window,l=e.strstart+e.lookahead,h=o,p=void 0,(p=c.avail_in)>h&&(p=h),r=0===p?0:(c.avail_in-=p,i.arraySet(f,c.input,c.next_in,p,l),1===c.state.wrap?c.adler=s(c.adler,f,p,l):2===c.state.wrap&&(c.adler=a(c.adler,f,p,l)),c.next_in+=p,c.total_in+=p,p),e.lookahead+=r,e.lookahead+e.insert>=b)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+b-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<b)););}while(e.lookahead<w&&0!==e.strm.avail_in)}function U(e,t){for(var r,n;;){if(e.lookahead<w){if(L(e),e.lookahead<w&&t===c)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=b&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+b-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-w&&(e.match_length=R(e,r)),e.match_length>=b)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-b),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=b){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+b-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(I(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<b-1?e.strstart:b-1,4===t?(I(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?1:2}function C(e,t){for(var r,n,i;;){if(e.lookahead<w){if(L(e),e.lookahead<w&&t===c)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=b&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+b-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=b-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-w&&(e.match_length=R(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===b&&e.strstart-e.match_start>4096)&&(e.match_length=b-1)),e.prev_length>=b&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-b,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-b),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+b-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=b-1,e.strstart++,n&&(I(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&I(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<b-1?e.strstart:b-1,4===t?(I(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?1:2}function j(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function D(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=p,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*m),this.dyn_dtree=new i.Buf16(2*(2*y+1)),this.bl_tree=new i.Buf16(2*(2*g+1)),T(this.dyn_ltree),T(this.dyn_dtree),T(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(v+1),this.heap=new i.Buf16(2*d+1),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*d+1),T(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function M(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=h,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?E:B,e.adler=2===t.wrap?0:1,t.last_flush=c,o._tr_init(t),f):S(e,l)}function P(e){var t,r=M(e);return r===f&&((t=e.state).window_size=2*t.w_size,T(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=b-1,t.match_available=0,t.ins_h=0),r}function z(e,t,r,n,o,s){if(!e)return l;var a=1;if(-1===t&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),o<1||o>9||r!==p||n<8||n>15||t<0||t>9||s<0||s>4)return S(e,l);8===n&&(n=9);var u=new D;return e.state=u,u.strm=e,u.wrap=a,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+b-1)/b),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=s,u.method=r,P(e)}n=[new j(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(L(e),0===e.lookahead&&t===c)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,I(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-w&&(I(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(I(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),1)})),new j(4,4,8,4,U),new j(4,5,16,8,U),new j(4,6,32,32,U),new j(4,4,16,16,C),new j(8,16,32,32,C),new j(8,16,128,128,C),new j(8,32,128,256,C),new j(32,128,258,1024,C),new j(32,258,258,4096,C)],t.deflateInit=function(e,t){return z(e,t,p,15,8,0)},t.deflateInit2=z,t.deflateReset=P,t.deflateResetKeep=M,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?l:(e.state.gzhead=t,f):l},t.deflate=function(e,t){var r,i,s,u;if(!e||!e.state||t>5||t<0)return e?S(e,l):l;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===A&&4!==t)return S(e,0===e.avail_out?-5:l);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===E)if(2===i.wrap)e.adler=0,N(i,31),N(i,139),N(i,8),i.gzhead?(N(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),N(i,255&i.gzhead.time),N(i,i.gzhead.time>>8&255),N(i,i.gzhead.time>>16&255),N(i,i.gzhead.time>>24&255),N(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),N(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(N(i,255&i.gzhead.extra.length),N(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=a(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(N(i,0),N(i,0),N(i,0),N(i,0),N(i,0),N(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),N(i,3),i.status=B);else{var h=p+(i.w_bits-8<<4)<<8;h|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=B,F(i,h),0!==i.strstart&&(F(i,e.adler>>>16),F(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),O(e),s=i.pending,i.pending!==i.pending_buf_size));)N(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),O(e),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,N(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),O(e),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,N(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.status=x)}else i.status=x;if(i.status===x&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&O(e),i.pending+2<=i.pending_buf_size&&(N(i,255&e.adler),N(i,e.adler>>8&255),e.adler=0,i.status=B)):i.status=B),0!==i.pending){if(O(e),0===e.avail_out)return i.last_flush=-1,f}else if(0===e.avail_in&&k(t)<=k(r)&&4!==t)return S(e,-5);if(i.status===A&&0!==e.avail_in)return S(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==c&&i.status!==A){var d=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(L(e),0===e.lookahead)){if(t===c)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(I(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(I(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=_){if(L(e),e.lookahead<=_&&t===c)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=b&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){s=e.strstart+_;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<s);e.match_length=_-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=b?(r=o._tr_tally(e,1,e.match_length-b),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(I(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(I(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==d&&4!==d||(i.status=A),1===d||3===d)return 0===e.avail_out&&(i.last_flush=-1),f;if(2===d&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(T(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),O(e),0===e.avail_out))return i.last_flush=-1,f}return 4!==t?f:i.wrap<=0?1:(2===i.wrap?(N(i,255&e.adler),N(i,e.adler>>8&255),N(i,e.adler>>16&255),N(i,e.adler>>24&255),N(i,255&e.total_in),N(i,e.total_in>>8&255),N(i,e.total_in>>16&255),N(i,e.total_in>>24&255)):(F(i,e.adler>>>16),F(i,65535&e.adler)),O(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?f:1)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==E&&69!==t&&73!==t&&91!==t&&t!==x&&t!==B&&t!==A?S(e,l):(e.state=null,t===B?S(e,-3):f):l},t.deflateSetDictionary=function(e,t){var r,n,o,a,u,c,h,p,d=t.length;if(!e||!e.state)return l;if(2===(a=(r=e.state).wrap)||1===a&&r.status!==E||r.lookahead)return l;for(1===a&&(e.adler=s(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===a&&(T(r.head),r.strstart=0,r.block_start=0,r.insert=0),p=new i.Buf8(r.w_size),i.arraySet(p,t,d-r.w_size,r.w_size,0),t=p,d=r.w_size),u=e.avail_in,c=e.next_in,h=e.input,e.avail_in=d,e.next_in=0,e.input=t,L(r);r.lookahead>=b;){n=r.strstart,o=r.lookahead-(b-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+b-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--o);r.strstart=n,r.lookahead=b-1,L(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=b-1,r.match_available=0,e.next_in=c,e.input=h,e.avail_in=u,r.wrap=a,f},t.deflateInfo="pako deflate (from Nodeca project)"},47293:e=>{"use strict";e.exports=function(e,t){var r,n,i,o,s,a,u,c,f,l,h,p,d,y,g,m,v,b,_,w,E,x,B,A,S;r=e.state,n=e.next_in,A=e.input,i=n+(e.avail_in-5),o=e.next_out,S=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),u=r.dmax,c=r.wsize,f=r.whave,l=r.wnext,h=r.window,p=r.hold,d=r.bits,y=r.lencode,g=r.distcode,m=(1<<r.lenbits)-1,v=(1<<r.distbits)-1;e:do{d<15&&(p+=A[n++]<<d,d+=8,p+=A[n++]<<d,d+=8),b=y[p&m];t:for(;;){if(p>>>=_=b>>>24,d-=_,0==(_=b>>>16&255))S[o++]=65535&b;else{if(!(16&_)){if(64&_){if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}b=y[(65535&b)+(p&(1<<_)-1)];continue t}for(w=65535&b,(_&=15)&&(d<_&&(p+=A[n++]<<d,d+=8),w+=p&(1<<_)-1,p>>>=_,d-=_),d<15&&(p+=A[n++]<<d,d+=8,p+=A[n++]<<d,d+=8),b=g[p&v];;){if(p>>>=_=b>>>24,d-=_,16&(_=b>>>16&255)){if(E=65535&b,d<(_&=15)&&(p+=A[n++]<<d,(d+=8)<_&&(p+=A[n++]<<d,d+=8)),(E+=p&(1<<_)-1)>u){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=_,d-=_,E>(_=o-s)){if((_=E-_)>f&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=0,B=h,0===l){if(x+=c-_,_<w){w-=_;do{S[o++]=h[x++]}while(--_);x=o-E,B=S}}else if(l<_){if(x+=c+l-_,(_-=l)<w){w-=_;do{S[o++]=h[x++]}while(--_);if(x=0,l<w){w-=_=l;do{S[o++]=h[x++]}while(--_);x=o-E,B=S}}}else if(x+=l-_,_<w){w-=_;do{S[o++]=h[x++]}while(--_);x=o-E,B=S}for(;w>2;)S[o++]=B[x++],S[o++]=B[x++],S[o++]=B[x++],w-=3;w&&(S[o++]=B[x++],w>1&&(S[o++]=B[x++]))}else{x=o-E;do{S[o++]=S[x++],S[o++]=S[x++],S[o++]=S[x++],w-=3}while(w>2);w&&(S[o++]=S[x++],w>1&&(S[o++]=S[x++]))}break}if(64&_){e.msg="invalid distance code",r.mode=30;break e}b=g[(65535&b)+(p&(1<<_)-1)]}}break}}while(n<i&&o<a);n-=w=d>>3,p&=(1<<(d-=w<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<a?a-o+257:257-(o-a),r.hold=p,r.bits=d}},71447:(e,t,r)=>{"use strict";var n=r(9805),i=r(53269),o=r(14823),s=r(47293),a=r(21998),u=0,c=-2,f=1,l=12,h=30,p=852,d=592;function y(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(p),t.distcode=t.distdyn=new n.Buf32(d),t.sane=1,t.back=-1,u):c}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,m(e)):c}function b(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?c:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,v(e))):c}function _(e,t){var r,n;return e?(n=new g,e.state=n,n.window=null,(r=b(e,t))!==u&&(e.state=null),r):c}var w,E,x=!0;function B(e){if(x){var t;for(w=new n.Buf32(512),E=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,w,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,E,0,e.work,{bits:5}),x=!1}e.lencode=w,e.lenbits=9,e.distcode=E,e.distbits=5}function A(e,t,r,i){var o,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),i>=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),n.arraySet(s.window,t,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}t.inflateReset=v,t.inflateReset2=b,t.inflateResetKeep=m,t.inflateInit=function(e){return _(e,15)},t.inflateInit2=_,t.inflate=function(e,t){var r,p,d,g,m,v,b,_,w,E,x,S,k,T,O,I,N,F,R,L,U,C,j,D,M=0,P=new n.Buf8(4),z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return c;(r=e.state).mode===l&&(r.mode=13),m=e.next_out,d=e.output,b=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,_=r.hold,w=r.bits,E=v,x=b,C=u;e:for(;;)switch(r.mode){case f:if(0===r.wrap){r.mode=13;break}for(;w<16;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}if(2&r.wrap&&35615===_){r.check=0,P[0]=255&_,P[1]=_>>>8&255,r.check=o(r.check,P,2,0),_=0,w=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&_)<<8)+(_>>8))%31){e.msg="incorrect header check",r.mode=h;break}if(8!=(15&_)){e.msg="unknown compression method",r.mode=h;break}if(w-=4,U=8+(15&(_>>>=4)),0===r.wbits)r.wbits=U;else if(U>r.wbits){e.msg="invalid window size",r.mode=h;break}r.dmax=1<<U,e.adler=r.check=1,r.mode=512&_?10:l,_=0,w=0;break;case 2:for(;w<16;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}if(r.flags=_,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=h;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=h;break}r.head&&(r.head.text=_>>8&1),512&r.flags&&(P[0]=255&_,P[1]=_>>>8&255,r.check=o(r.check,P,2,0)),_=0,w=0,r.mode=3;case 3:for(;w<32;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}r.head&&(r.head.time=_),512&r.flags&&(P[0]=255&_,P[1]=_>>>8&255,P[2]=_>>>16&255,P[3]=_>>>24&255,r.check=o(r.check,P,4,0)),_=0,w=0,r.mode=4;case 4:for(;w<16;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}r.head&&(r.head.xflags=255&_,r.head.os=_>>8),512&r.flags&&(P[0]=255&_,P[1]=_>>>8&255,r.check=o(r.check,P,2,0)),_=0,w=0,r.mode=5;case 5:if(1024&r.flags){for(;w<16;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}r.length=_,r.head&&(r.head.extra_len=_),512&r.flags&&(P[0]=255&_,P[1]=_>>>8&255,r.check=o(r.check,P,2,0)),_=0,w=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((S=r.length)>v&&(S=v),S&&(r.head&&(U=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,p,g,S,U)),512&r.flags&&(r.check=o(r.check,p,S,g)),v-=S,g+=S,r.length-=S),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===v)break e;S=0;do{U=p[g+S++],r.head&&U&&r.length<65536&&(r.head.name+=String.fromCharCode(U))}while(U&&S<v);if(512&r.flags&&(r.check=o(r.check,p,S,g)),v-=S,g+=S,U)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===v)break e;S=0;do{U=p[g+S++],r.head&&U&&r.length<65536&&(r.head.comment+=String.fromCharCode(U))}while(U&&S<v);if(512&r.flags&&(r.check=o(r.check,p,S,g)),v-=S,g+=S,U)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;w<16;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}if(_!==(65535&r.check)){e.msg="header crc mismatch",r.mode=h;break}_=0,w=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=l;break;case 10:for(;w<32;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}e.adler=r.check=y(_),_=0,w=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=m,e.avail_out=b,e.next_in=g,e.avail_in=v,r.hold=_,r.bits=w,2;e.adler=r.check=1,r.mode=l;case l:if(5===t||6===t)break e;case 13:if(r.last){_>>>=7&w,w-=7&w,r.mode=27;break}for(;w<3;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}switch(r.last=1&_,w-=1,3&(_>>>=1)){case 0:r.mode=14;break;case 1:if(B(r),r.mode=20,6===t){_>>>=2,w-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=h}_>>>=2,w-=2;break;case 14:for(_>>>=7&w,w-=7&w;w<32;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}if((65535&_)!=(_>>>16^65535)){e.msg="invalid stored block lengths",r.mode=h;break}if(r.length=65535&_,_=0,w=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(S=r.length){if(S>v&&(S=v),S>b&&(S=b),0===S)break e;n.arraySet(d,p,g,S,m),v-=S,g+=S,b-=S,m+=S,r.length-=S;break}r.mode=l;break;case 17:for(;w<14;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}if(r.nlen=257+(31&_),_>>>=5,w-=5,r.ndist=1+(31&_),_>>>=5,w-=5,r.ncode=4+(15&_),_>>>=4,w-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=h;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;w<3;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}r.lens[z[r.have++]]=7&_,_>>>=3,w-=3}for(;r.have<19;)r.lens[z[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,j={bits:r.lenbits},C=a(0,r.lens,0,19,r.lencode,0,r.work,j),r.lenbits=j.bits,C){e.msg="invalid code lengths set",r.mode=h;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;I=(M=r.lencode[_&(1<<r.lenbits)-1])>>>16&255,N=65535&M,!((O=M>>>24)<=w);){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}if(N<16)_>>>=O,w-=O,r.lens[r.have++]=N;else{if(16===N){for(D=O+2;w<D;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}if(_>>>=O,w-=O,0===r.have){e.msg="invalid bit length repeat",r.mode=h;break}U=r.lens[r.have-1],S=3+(3&_),_>>>=2,w-=2}else if(17===N){for(D=O+3;w<D;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}w-=O,U=0,S=3+(7&(_>>>=O)),_>>>=3,w-=3}else{for(D=O+7;w<D;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}w-=O,U=0,S=11+(127&(_>>>=O)),_>>>=7,w-=7}if(r.have+S>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=h;break}for(;S--;)r.lens[r.have++]=U}}if(r.mode===h)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=h;break}if(r.lenbits=9,j={bits:r.lenbits},C=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,C){e.msg="invalid literal/lengths set",r.mode=h;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},C=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,C){e.msg="invalid distances set",r.mode=h;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(v>=6&&b>=258){e.next_out=m,e.avail_out=b,e.next_in=g,e.avail_in=v,r.hold=_,r.bits=w,s(e,x),m=e.next_out,d=e.output,b=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,_=r.hold,w=r.bits,r.mode===l&&(r.back=-1);break}for(r.back=0;I=(M=r.lencode[_&(1<<r.lenbits)-1])>>>16&255,N=65535&M,!((O=M>>>24)<=w);){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}if(I&&!(240&I)){for(F=O,R=I,L=N;I=(M=r.lencode[L+((_&(1<<F+R)-1)>>F)])>>>16&255,N=65535&M,!(F+(O=M>>>24)<=w);){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}_>>>=F,w-=F,r.back+=F}if(_>>>=O,w-=O,r.back+=O,r.length=N,0===I){r.mode=26;break}if(32&I){r.back=-1,r.mode=l;break}if(64&I){e.msg="invalid literal/length code",r.mode=h;break}r.extra=15&I,r.mode=22;case 22:if(r.extra){for(D=r.extra;w<D;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}r.length+=_&(1<<r.extra)-1,_>>>=r.extra,w-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;I=(M=r.distcode[_&(1<<r.distbits)-1])>>>16&255,N=65535&M,!((O=M>>>24)<=w);){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}if(!(240&I)){for(F=O,R=I,L=N;I=(M=r.distcode[L+((_&(1<<F+R)-1)>>F)])>>>16&255,N=65535&M,!(F+(O=M>>>24)<=w);){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}_>>>=F,w-=F,r.back+=F}if(_>>>=O,w-=O,r.back+=O,64&I){e.msg="invalid distance code",r.mode=h;break}r.offset=N,r.extra=15&I,r.mode=24;case 24:if(r.extra){for(D=r.extra;w<D;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}r.offset+=_&(1<<r.extra)-1,_>>>=r.extra,w-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=h;break}r.mode=25;case 25:if(0===b)break e;if(S=x-b,r.offset>S){if((S=r.offset-S)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=h;break}S>r.wnext?(S-=r.wnext,k=r.wsize-S):k=r.wnext-S,S>r.length&&(S=r.length),T=r.window}else T=d,k=m-r.offset,S=r.length;S>b&&(S=b),b-=S,r.length-=S;do{d[m++]=T[k++]}while(--S);0===r.length&&(r.mode=21);break;case 26:if(0===b)break e;d[m++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;w<32;){if(0===v)break e;v--,_|=p[g++]<<w,w+=8}if(x-=b,e.total_out+=x,r.total+=x,x&&(e.adler=r.check=r.flags?o(r.check,d,x,m-x):i(r.check,d,x,m-x)),x=b,(r.flags?_:y(_))!==r.check){e.msg="incorrect data check",r.mode=h;break}_=0,w=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;w<32;){if(0===v)break e;v--,_+=p[g++]<<w,w+=8}if(_!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=h;break}_=0,w=0}r.mode=29;case 29:C=1;break e;case h:C=-3;break e;case 31:return-4;default:return c}return e.next_out=m,e.avail_out=b,e.next_in=g,e.avail_in=v,r.hold=_,r.bits=w,(r.wsize||x!==e.avail_out&&r.mode<h&&(r.mode<27||4!==t))&&A(e,e.output,e.next_out,x-e.avail_out)?(r.mode=31,-4):(E-=e.avail_in,x-=e.avail_out,e.total_in+=E,e.total_out+=x,r.total+=x,r.wrap&&x&&(e.adler=r.check=r.flags?o(r.check,d,x,e.next_out-x):i(r.check,d,x,e.next_out-x)),e.data_type=r.bits+(r.last?64:0)+(r.mode===l?128:0)+(20===r.mode||15===r.mode?256:0),(0===E&&0===x||4===t)&&C===u&&(C=-5),C)},t.inflateEnd=function(e){if(!e||!e.state)return c;var t=e.state;return t.window&&(t.window=null),e.state=null,u},t.inflateGetHeader=function(e,t){var r;return e&&e.state&&2&(r=e.state).wrap?(r.head=t,t.done=!1,u):c},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?c:11===r.mode&&i(1,t,n,0)!==r.check?-3:A(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,u):c},t.inflateInfo="pako inflate (from Nodeca project)"},21998:(e,t,r)=>{"use strict";var n=r(9805),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,u,c,f,l,h){var p,d,y,g,m,v,b,_,w,E=h.bits,x=0,B=0,A=0,S=0,k=0,T=0,O=0,I=0,N=0,F=0,R=null,L=0,U=new n.Buf16(16),C=new n.Buf16(16),j=null,D=0;for(x=0;x<=15;x++)U[x]=0;for(B=0;B<u;B++)U[t[r+B]]++;for(k=E,S=15;S>=1&&0===U[S];S--);if(k>S&&(k=S),0===S)return c[f++]=20971520,c[f++]=20971520,h.bits=1,0;for(A=1;A<S&&0===U[A];A++);for(k<A&&(k=A),I=1,x=1;x<=15;x++)if(I<<=1,(I-=U[x])<0)return-1;if(I>0&&(0===e||1!==S))return-1;for(C[1]=0,x=1;x<15;x++)C[x+1]=C[x]+U[x];for(B=0;B<u;B++)0!==t[r+B]&&(l[C[t[r+B]]++]=B);if(0===e?(R=j=l,v=19):1===e?(R=i,L-=257,j=o,D-=257,v=256):(R=s,j=a,v=-1),F=0,B=0,x=A,m=f,T=k,O=0,y=-1,g=(N=1<<k)-1,1===e&&N>852||2===e&&N>592)return 1;for(;;){b=x-O,l[B]<v?(_=0,w=l[B]):l[B]>v?(_=j[D+l[B]],w=R[L+l[B]]):(_=96,w=0),p=1<<x-O,A=d=1<<T;do{c[m+(F>>O)+(d-=p)]=b<<24|_<<16|w}while(0!==d);for(p=1<<x-1;F&p;)p>>=1;if(0!==p?(F&=p-1,F+=p):F=0,B++,0==--U[x]){if(x===S)break;x=t[r+l[B]]}if(x>k&&(F&g)!==y){for(0===O&&(O=k),m+=A,I=1<<(T=x-O);T+O<S&&!((I-=U[T+O])<=0);)T++,I<<=1;if(N+=1<<T,1===e&&N>852||2===e&&N>592)return 1;c[y=F&g]=k<<24|T<<16|m-f}}return 0!==F&&(c[m+F]=x-O<<24|64<<16),h.bits=k,0}},54674:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},23665:(e,t,r)=>{"use strict";var n=r(9805);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var o=256,s=286,a=30,u=15,c=16,f=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],p=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=new Array(576);i(d);var y=new Array(60);i(y);var g=new Array(512);i(g);var m=new Array(256);i(m);var v=new Array(29);i(v);var b,_,w,E=new Array(a);function x(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function B(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function A(e){return e<256?g[e]:g[256+(e>>>7)]}function S(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function k(e,t,r){e.bi_valid>c-r?(e.bi_buf|=t<<e.bi_valid&65535,S(e,e.bi_buf),e.bi_buf=t>>c-e.bi_valid,e.bi_valid+=r-c):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function T(e,t,r){k(e,r[2*t],r[2*t+1])}function O(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function I(e,t,r){var n,i,o=new Array(u+1),s=0;for(n=1;n<=u;n++)o[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=O(o[a]++,a))}}function N(e){var t;for(t=0;t<s;t++)e.dyn_ltree[2*t]=0;for(t=0;t<a;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function F(e){e.bi_valid>8?S(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function R(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function L(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&R(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!R(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function U(e,t,r){var n,i,s,a,u=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*u]<<8|e.pending_buf[e.d_buf+2*u+1],i=e.pending_buf[e.l_buf+u],u++,0===n?T(e,i,t):(T(e,(s=m[i])+o+1,t),0!==(a=f[s])&&k(e,i-=v[s],a),T(e,s=A(--n),r),0!==(a=l[s])&&k(e,n-=E[s],a))}while(u<e.last_lit);T(e,256,t)}function C(e,t){var r,n,i,o=t.dyn_tree,s=t.stat_desc.static_tree,a=t.stat_desc.has_stree,c=t.stat_desc.elems,f=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<c;r++)0!==o[2*r]?(e.heap[++e.heap_len]=f=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=f<2?++f:0)]=1,e.depth[i]=0,e.opt_len--,a&&(e.static_len-=s[2*i+1]);for(t.max_code=f,r=e.heap_len>>1;r>=1;r--)L(e,o,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],L(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,L(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,s,a,c=t.dyn_tree,f=t.max_code,l=t.stat_desc.static_tree,h=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,y=t.stat_desc.max_length,g=0;for(o=0;o<=u;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=c[2*c[2*(n=e.heap[r])+1]+1]+1)>y&&(o=y,g++),c[2*n+1]=o,n>f||(e.bl_count[o]++,s=0,n>=d&&(s=p[n-d]),a=c[2*n],e.opt_len+=a*(o+s),h&&(e.static_len+=a*(l[2*n+1]+s)));if(0!==g){do{for(o=y-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[y]--,g-=2}while(g>0);for(o=y;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>f||(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),n--)}}(e,t),I(o,f,e.bl_count)}function j(e,t,r){var n,i,o=-1,s=t[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a<u&&i===s||(a<c?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=i,0===s?(u=138,c=3):i===s?(u=6,c=3):(u=7,c=4))}function D(e,t,r){var n,i,o=-1,s=t[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++a<u&&i===s)){if(a<c)do{T(e,i,e.bl_tree)}while(0!=--a);else 0!==i?(i!==o&&(T(e,i,e.bl_tree),a--),T(e,16,e.bl_tree),k(e,a-3,2)):a<=10?(T(e,17,e.bl_tree),k(e,a-3,3)):(T(e,18,e.bl_tree),k(e,a-11,7));a=0,o=i,0===s?(u=138,c=3):i===s?(u=6,c=3):(u=7,c=4)}}i(E);var M=!1;function P(e,t,r,i){k(e,0+(i?1:0),3),function(e,t,r,i){F(e),S(e,r),S(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r)}t._tr_init=function(e){M||(function(){var e,t,r,n,i,o=new Array(u+1);for(r=0,n=0;n<28;n++)for(v[n]=r,e=0;e<1<<f[n];e++)m[r++]=n;for(m[r-1]=n,i=0,n=0;n<16;n++)for(E[n]=i,e=0;e<1<<l[n];e++)g[i++]=n;for(i>>=7;n<a;n++)for(E[n]=i<<7,e=0;e<1<<l[n]-7;e++)g[256+i++]=n;for(t=0;t<=u;t++)o[t]=0;for(e=0;e<=143;)d[2*e+1]=8,e++,o[8]++;for(;e<=255;)d[2*e+1]=9,e++,o[9]++;for(;e<=279;)d[2*e+1]=7,e++,o[7]++;for(;e<=287;)d[2*e+1]=8,e++,o[8]++;for(I(d,287,o),e=0;e<a;e++)y[2*e+1]=5,y[2*e]=O(e,5);b=new x(d,f,257,s,u),_=new x(y,l,0,a,u),w=new x(new Array(0),h,0,19,7)}(),M=!0),e.l_desc=new B(e.dyn_ltree,b),e.d_desc=new B(e.dyn_dtree,_),e.bl_desc=new B(e.bl_tree,w),e.bi_buf=0,e.bi_valid=0,N(e)},t._tr_stored_block=P,t._tr_flush_block=function(e,t,r,n){var i,s,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<o;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),C(e,e.l_desc),C(e,e.d_desc),a=function(e){var t;for(j(e,e.dyn_ltree,e.l_desc.max_code),j(e,e.dyn_dtree,e.d_desc.max_code),C(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*p[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?P(e,t,r,n):4===e.strategy||s===i?(k(e,2+(n?1:0),3),U(e,d,y)):(k(e,4+(n?1:0),3),function(e,t,r,n){var i;for(k(e,t-257,5),k(e,r-1,5),k(e,n-4,4),i=0;i<n;i++)k(e,e.bl_tree[2*p[i]+1],3);D(e,e.dyn_ltree,t-1),D(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),U(e,e.dyn_ltree,e.dyn_dtree)),N(e),n&&F(e)},t._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(m[r]+o+1)]++,e.dyn_dtree[2*A(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){k(e,2,3),T(e,256,d),function(e){16===e.bi_valid?(S(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},44442:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},43627:(e,t,r)=>{"use strict";var n=r(65606),i="win32"===n.platform,o=r(40537);function s(e,t){for(var r=[],n=0;n<e.length;n++){var i=e[n];i&&"."!==i&&(".."===i?r.length&&".."!==r[r.length-1]?r.pop():t&&r.push(".."):r.push(i))}return r}function a(e){for(var t=e.length-1,r=0;r<=t&&!e[r];r++);for(var n=t;n>=0&&!e[n];n--);return 0===r&&n===t?e:r>n?[]:e.slice(r,n+1)}var u=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,c=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,f={};function l(e){var t=u.exec(e),r=(t[1]||"")+(t[2]||""),n=t[3]||"",i=c.exec(n);return[r,i[1],i[2],i[3]]}function h(e){var t=u.exec(e),r=t[1]||"",n=!!r&&":"!==r[1];return{device:r,isUnc:n,isAbsolute:n||!!t[2],tail:t[3]}}function p(e){return"\\\\"+e.replace(/^[\\\/]+/,"").replace(/[\\\/]+/g,"\\")}f.resolve=function(){for(var e="",t="",r=!1,i=arguments.length-1;i>=-1;i--){var a;if(i>=0?a=arguments[i]:e?(a=n.env["="+e])&&a.substr(0,3).toLowerCase()===e.toLowerCase()+"\\"||(a=e+"\\"):a=n.cwd(),!o.isString(a))throw new TypeError("Arguments to path.resolve must be strings");if(a){var u=h(a),c=u.device,f=u.isUnc,l=u.isAbsolute,d=u.tail;if((!c||!e||c.toLowerCase()===e.toLowerCase())&&(e||(e=c),r||(t=d+"\\"+t,r=l),e&&r))break}}return f&&(e=p(e)),e+(r?"\\":"")+(t=s(t.split(/[\\\/]+/),!r).join("\\"))||"."},f.normalize=function(e){var t=h(e),r=t.device,n=t.isUnc,i=t.isAbsolute,o=t.tail,a=/[\\\/]$/.test(o);return(o=s(o.split(/[\\\/]+/),!i).join("\\"))||i||(o="."),o&&a&&(o+="\\"),n&&(r=p(r)),r+(i?"\\":"")+o},f.isAbsolute=function(e){return h(e).isAbsolute},f.join=function(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(!o.isString(r))throw new TypeError("Arguments to path.join must be strings");r&&e.push(r)}var n=e.join("\\");return/^[\\\/]{2}[^\\\/]/.test(e[0])||(n=n.replace(/^[\\\/]{2,}/,"\\")),f.normalize(n)},f.relative=function(e,t){e=f.resolve(e),t=f.resolve(t);for(var r=e.toLowerCase(),n=t.toLowerCase(),i=a(t.split("\\")),o=a(r.split("\\")),s=a(n.split("\\")),u=Math.min(o.length,s.length),c=u,l=0;l<u;l++)if(o[l]!==s[l]){c=l;break}if(0==c)return t;var h=[];for(l=c;l<o.length;l++)h.push("..");return(h=h.concat(i.slice(c))).join("\\")},f._makeLong=function(e){if(!o.isString(e))return e;if(!e)return"";var t=f.resolve(e);return/^[a-zA-Z]\:\\/.test(t)?"\\\\?\\"+t:/^\\\\[^?.]/.test(t)?"\\\\?\\UNC\\"+t.substring(2):e},f.dirname=function(e){var t=l(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},f.basename=function(e,t){var r=l(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},f.extname=function(e){return l(e)[3]},f.format=function(e){if(!o.isObject(e))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof e);var t=e.root||"";if(!o.isString(t))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof e.root);var r=e.dir,n=e.base||"";return r?r[r.length-1]===f.sep?r+n:r+f.sep+n:n},f.parse=function(e){if(!o.isString(e))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t=l(e);if(!t||4!==t.length)throw new TypeError("Invalid path '"+e+"'");return{root:t[0],dir:t[0]+t[1].slice(0,-1),base:t[2],ext:t[3],name:t[2].slice(0,t[2].length-t[3].length)}},f.sep="\\",f.delimiter=";";var d=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,y={};function g(e){return d.exec(e).slice(1)}y.resolve=function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var i=r>=0?arguments[r]:n.cwd();if(!o.isString(i))throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,t="/"===i[0])}return(t?"/":"")+(e=s(e.split("/"),!t).join("/"))||"."},y.normalize=function(e){var t=y.isAbsolute(e),r=e&&"/"===e[e.length-1];return(e=s(e.split("/"),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},y.isAbsolute=function(e){return"/"===e.charAt(0)},y.join=function(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];if(!o.isString(r))throw new TypeError("Arguments to path.join must be strings");r&&(e+=e?"/"+r:r)}return y.normalize(e)},y.relative=function(e,t){e=y.resolve(e).substr(1),t=y.resolve(t).substr(1);for(var r=a(e.split("/")),n=a(t.split("/")),i=Math.min(r.length,n.length),o=i,s=0;s<i;s++)if(r[s]!==n[s]){o=s;break}var u=[];for(s=o;s<r.length;s++)u.push("..");return(u=u.concat(n.slice(o))).join("/")},y._makeLong=function(e){return e},y.dirname=function(e){var t=g(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},y.basename=function(e,t){var r=g(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},y.extname=function(e){return g(e)[3]},y.format=function(e){if(!o.isObject(e))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof e);var t=e.root||"";if(!o.isString(t))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof e.root);return(e.dir?e.dir+y.sep:"")+(e.base||"")},y.parse=function(e){if(!o.isString(e))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t=g(e);if(!t||4!==t.length)throw new TypeError("Invalid path '"+e+"'");return t[1]=t[1]||"",t[2]=t[2]||"",t[3]=t[3]||"",{root:t[0],dir:t[0]+t[1].slice(0,-1),base:t[2],ext:t[3],name:t[2].slice(0,t[2].length-t[3].length)}},y.sep="/",y.delimiter=":",e.exports=i?f:y,e.exports.posix=y,e.exports.win32=f},65606:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&h())}function h(){if(!c){var e=s(l);c=!0;for(var t=u.length;t;){for(a=u,u=[];++f<t;)a&&a[f].run();f=-1,t=u.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function d(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},86048:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,s,a,u;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=("number"!=typeof u&&(u=0),u+1>(a=e).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},25382:(e,t,r)=>{"use strict";var n=r(65606),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var o=r(45412),s=r(16708);r(56698)(f,o);for(var a=i(s.prototype),u=0;u<a.length;u++){var c=a[u];f.prototype[c]||(f.prototype[c]=s.prototype[c])}function f(e){if(!(this instanceof f))return new f(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},63600:(e,t,r)=>{"use strict";e.exports=i;var n=r(74610);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(56698)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},45412:(e,t,r)=>{"use strict";var n,i=r(65606);e.exports=A,A.ReadableState=B,r(37007).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=r(40345),u=r(48287).Buffer,c=r.g.Uint8Array||function(){},f=r(79838);o=f&&f.debuglog?f.debuglog("stream"):function(){};var l,h,p,d=r(80345),y=r(75896),g=r(65291).getHighWaterMark,m=r(86048).F,v=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,_=m.ERR_METHOD_NOT_IMPLEMENTED,w=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(56698)(A,a);var E=y.errorOrDestroy,x=["error","close","destroy","pause","resume"];function B(e,t,i){n=n||r(25382),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(83141).I),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function A(e){if(n=n||r(25382),!(this instanceof A))return new A(e);var t=this instanceof n;this._readableState=new B(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function S(e,t,r,n,i){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?I(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,N(e)))}}(e,a);else if(i||(s=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)E(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)a.endEmitted?E(e,new w):k(e,a,t,!0);else if(a.ended)E(e,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?k(e,a,t,!1):F(e,a)):k(e,a,t,!1)}else n||(a.reading=!1,F(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function k(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&I(e)),F(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=y.destroy,A.prototype._undestroy=y.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),S(this,e,t,!1,r)},A.prototype.unshift=function(e){return S(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(e){l||(l=r(83141).I);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var T=1073741824;function O(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function I(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(N,e))}function N(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,j(e)}function F(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function L(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function U(e){o("readable nexttick read 0"),e.read(0)}function C(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function M(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(P,t,e))}function P(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function z(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}A.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):I(this),null;if(0===(e=O(e,t))&&t.ended)return 0===t.length&&M(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=O(r,t))),null===(n=e>0?D(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&M(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){E(this,new _("_read()"))},A.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?y:u;function u(){o("onend"),e.end()}n.endEmitted?i.nextTick(a):r.once("end",a),e.on("unpipe",(function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",l),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}));var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,j(e))}}(r);e.on("drain",c);var f=!1;function l(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==z(n.pipes,e))&&!f&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){o("onerror",t),y(),e.removeListener("error",h),0===s(e,"error")&&E(e,t)}function p(){e.removeListener("finish",d),y()}function d(){o("onfinish"),e.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(e)}return r.on("data",l),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",d),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=z(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},A.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?I(this):n.reading||i.nextTick(U,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(L,this),r},A.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(L,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(C,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<x.length;s++)e.on(x[s],this.emit.bind(this,x[s]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(2955)),h(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=D,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(e,t){return void 0===p&&(p=r(55157)),p(A,e,t)})},74610:(e,t,r)=>{"use strict";e.exports=f;var n=r(86048).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(25382);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(e){if(!(this instanceof f))return new f(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(56698)(f,u),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,r){r(new i("_transform()"))},f.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},16708:(e,t,r)=>{"use strict";var n,i=r(65606);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=A,A.WritableState=B;var s,a={deprecate:r(94643)},u=r(40345),c=r(48287).Buffer,f=r.g.Uint8Array||function(){},l=r(75896),h=r(65291).getHighWaterMark,p=r(86048).F,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,m=p.ERR_STREAM_CANNOT_PIPE,v=p.ERR_STREAM_DESTROYED,b=p.ERR_STREAM_NULL_VALUES,_=p.ERR_STREAM_WRITE_AFTER_END,w=p.ERR_UNKNOWN_ENCODING,E=l.errorOrDestroy;function x(){}function B(e,t,s){n=n||r(25382),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(N,e,t),e._writableState.errorEmitted=!0,E(e,n)):(o(n),e._writableState.errorEmitted=!0,E(e,n),N(e,t))}(e,r,n,t,o);else{var s=O(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?i.nextTick(k,e,r,s,o):k(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(e){var t=this instanceof(n=n||r(25382));if(!t&&!s.call(A,this))return new A(e);this._writableState=new B(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function S(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function k(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),N(e,t)}function T(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,S(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(S(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function O(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function I(e,t){e._final((function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),N(e,t)}))}function N(e,t){var r=O(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(I,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(56698)(A,u),B.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(B.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===A&&e&&e._writableState instanceof B}})):s=function(e){return e instanceof this},A.prototype.pipe=function(){E(this,new m)},A.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,c.isBuffer(n)||n instanceof f);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=x),o.ending?function(e,t){var r=new _;E(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new b:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(E(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else S(e,t,!1,a,n,i,o);return u}(this,o,a,e,t,r)),s},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,N(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(e,t){t(e)}},2955:(e,t,r)=>{"use strict";var n,i=r(65606);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(86238),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function y(e){var t=e[a];if(null!==t){var r=e[p].read();null!==r&&(e[l]=null,e[a]=null,e[u]=null,t(d(r,!1)))}}function g(e){i.nextTick(y,e)}var m=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[f])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[c]?r(e[c]):t(d(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[f]?r(d(void 0,!0)):t[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(d(void 0,!0))}))}))})),n),m);e.exports=function(e){var t,r=Object.create(v,(o(t={},p,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,f,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var n=r[p].read();n?(r[l]=null,r[a]=null,r[u]=null,e(d(n,!1))):(r[a]=e,r[u]=t)},writable:!0}),t));return r[l]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[l]=null,r[a]=null,r[u]=null,t(e)),void(r[c]=e)}var n=r[a];null!==n&&(r[l]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[f]=!0})),e.on("readable",g.bind(null,r)),r}},80345:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=r(48287).Buffer,a=r(15340).inspect,u=a&&a.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,s.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&o(t.prototype,r),e}()},75896:(e,t,r)=>{"use strict";var n=r(65606);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},86238:(e,t,r)=>{"use strict";var n=r(86048).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||f()},c=t._writableState&&t._writableState.finished,f=function(){a=!1,c=!0,s||o.call(t)},l=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,l=!0,a||o.call(t)},p=function(e){o.call(t,e)},d=function(){var e;return s&&!l?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},y=function(){t.req.on("finish",f)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",f),t.on("abort",d),t.req?y():t.on("request",y)):a&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",h),t.on("finish",f),!1!==r.error&&t.on("error",p),t.on("close",d),function(){t.removeListener("complete",f),t.removeListener("abort",d),t.removeListener("request",y),t.req&&t.req.removeListener("finish",f),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",f),t.removeListener("end",h),t.removeListener("error",p),t.removeListener("close",d)}}},55157:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},57758:(e,t,r)=>{"use strict";var n,i=r(86048).F,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var f,l=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var h=t.map((function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(86238)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var u=!1;return function(t){if(!a&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,(function(e){f||(f=e),e&&h.forEach(u),o||(h.forEach(u),l(f))}))}));return t.reduce(c)}},65291:(e,t,r)=>{"use strict";var n=r(86048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},40345:(e,t,r)=>{e.exports=r(37007).EventEmitter},88310:(e,t,r)=>{e.exports=i;var n=r(37007).EventEmitter;function i(){n.call(this)}r(56698)(i,n),i.Readable=r(45412),i.Writable=r(16708),i.Duplex=r(25382),i.Transform=r(74610),i.PassThrough=r(63600),i.finished=r(86238),i.pipeline=r(57758),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,e.end())}function u(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",c),e.on("error",c),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},83141:(e,t,r)=>{"use strict";var n=r(15003).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=f,this.end=l,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"<22>";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"<22>";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"<22>"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"<22>":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},15003:(e,t,r)=>{var n=r(48287),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},90031:(e,t)=>{!function(e){var t,r,n,i=String.fromCharCode;function o(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function s(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function a(e,t){return i(e>>t&63|128)}function u(e){if(!(4294967168&e))return i(e);var t="";return 4294965248&e?4294901760&e?4292870144&e||(t=i(e>>18&7|240),t+=a(e,12),t+=a(e,6)):(s(e),t=i(e>>12&15|224),t+=a(e,6)):t=i(e>>6&31|192),t+i(63&e|128)}function c(){if(n>=r)throw Error("Invalid byte index");var e=255&t[n];if(n++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function f(){var e,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(e=255&t[n],n++,!(128&e))return e;if(192==(224&e)){if((i=(31&e)<<6|c())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if((i=(15&e)<<12|c()<<6|c())>=2048)return s(i),i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(i=(7&e)<<18|c()<<12|c()<<6|c())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=o(e),r=t.length,n=-1,i="";++n<r;)i+=u(t[n]);return i},e.decode=function(e){t=o(e),r=t.length,n=0;for(var s,a=[];!1!==(s=f());)a.push(s);return function(e){for(var t,r=e.length,n=-1,o="";++n<r;)(t=e[n])>65535&&(o+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=i(t);return o}(a)}}(t)},94643:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},36622:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},81135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},40537:(e,t,r)=>{var n=r(65606),i=/%[sdj%]/g;t.format=function(e){if(!m(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(a(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),u=n[r];r<o;u=n[++r])y(u)||!_(u)?s+=" "+u:s+=" "+a(u);return s},t.deprecate=function(e,i){if(v(r.g.process))return function(){return t.deprecate(e,i).apply(this,arguments)};if(!0===n.noDeprecation)return e;var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),o=!0}return e.apply(this,arguments)}};var o,s={};function a(e,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,e,n.depth)}function u(e,t){var r=a.styles[t];return r?"["+a.colors[r][0]+"m"+e+"["+a.colors[r][1]+"m":e}function c(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&x(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return m(i)||(i=f(e,i,n)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),E(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(x(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return l(r)}var c,_="",B=!1,A=["{","}"];return p(r)&&(B=!0,A=["[","]"]),x(r)&&(_=" [Function"+(r.name?": "+r.name:"")+"]"),b(r)&&(_=" "+RegExp.prototype.toString.call(r)),w(r)&&(_=" "+Date.prototype.toUTCString.call(r)),E(r)&&(_=" "+l(r)),0!==s.length||B&&0!=r.length?n<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=B?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)k(t,String(s))?o.push(h(e,t,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(h(e,t,r,n,i,!0))})),o}(e,r,n,a,s):s.map((function(t){return h(e,r,n,a,t,B)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,_,A)):A[0]+_+A[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),k(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=y(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),v(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function y(e){return null===e}function g(e){return"number"==typeof e}function m(e){return"string"==typeof e}function v(e){return void 0===e}function b(e){return _(e)&&"[object RegExp]"===B(e)}function _(e){return"object"==typeof e&&null!==e}function w(e){return _(e)&&"[object Date]"===B(e)}function E(e){return _(e)&&("[object Error]"===B(e)||e instanceof Error)}function x(e){return"function"==typeof e}function B(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(v(o)&&(o=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!s[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=d,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=m,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=b,t.isObject=_,t.isDate=w,t.isError=E,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(81135);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[A((e=new Date).getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":"),[e.getDate(),S[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(36622),t._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}},15340:()=>{},79838:()=>{},4633:(e,t,r)=>{var n=r(73738).default;function i(){"use strict";e.exports=i=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},o=Object.prototype,s=o.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",f=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(t){h=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var i=t&&t.prototype instanceof _?t:_,o=Object.create(i.prototype),s=new R(n||[]);return a(o,"_invoke",{value:O(e,r,s)}),o}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var y="suspendedStart",g="suspendedYield",m="executing",v="completed",b={};function _(){}function w(){}function E(){}var x={};h(x,c,(function(){return this}));var B=Object.getPrototypeOf,A=B&&B(B(L([])));A&&A!==o&&s.call(A,c)&&(x=A);var S=E.prototype=_.prototype=Object.create(x);function k(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(i,o,a,u){var c=d(e[i],e,o);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==n(l)&&s.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(l).then((function(e){f.value=e,a(f)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var i=y;return function(o,s){if(i===m)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=I(a,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===y)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:g,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function I(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,b;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function F(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(s.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=E,a(S,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:w,configurable:!0}),w.displayName=h(E,l,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,h(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},r.awrap=function(e){return{__await:e}},k(T.prototype),h(T.prototype,f,(function(){return this})),r.AsyncIterator=T,r.async=function(e,t,n,i,o){void 0===o&&(o=Promise);var s=new T(p(e,t,n,i),o);return r.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},k(S),h(S,l,"Generator"),h(S,c,(function(){return this})),h(S,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=L,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(F),!e)for(var r in this)"t"===r.charAt(0)&&s.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),F(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;F(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},r}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},73738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},54756:(e,t,r)=>{var n=r(4633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,r){if(r&&("object"==t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function f(e,t,r,n,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,i)}function l(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){f(o,n,i,s,a,"next",e)}function a(e){f(o,n,i,s,a,"throw",e)}s(void 0)}))}}var h=r(54756),p=r.n(h);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t){if(e){if("string"==typeof e)return d(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function g(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||y(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var m=r(73065),v=r.n(m),b=r(90031),_=r.n(b);function w(e,t,r){return t=a(t),s(e,E()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(E=function(){return!!e})()}const x=function(t){function r(){var t;e(this,r);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return(t=w(this,r,[].concat(i))).type="OperationError",Error.captureStackTrace&&Error.captureStackTrace(t,r),t}return c(r,t),o(r)}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error));function B(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!e)return"";if("string"==typeof e&&(e=U.strToArrayBuffer(e)),e instanceof ArrayBuffer&&(e=new Uint8Array(e)),64!==(t=U.expandAlphRange(t).join("")).length&&65!==t.length)throw new x(`Invalid Base64 alphabet length (${t.length}): ${t}`);for(var r,n,i,o,s,a,u,c="",f=0;f<e.length;)o=(r=e[f++])>>2,s=(3&r)<<4|(n=e[f++])>>4,a=(15&n)<<2|(i=e[f++])>>6,u=63&i,isNaN(n)?a=u=64:isNaN(i)&&(u=64),c+=t.charAt(o)+t.charAt(s)+t.charAt(a)+t.charAt(u);return c}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!e)return"string"===r?"":[];if(t=t||"A-Za-z0-9+/=",64!==(t=U.expandAlphRange(t).join("")).length&&65!==t.length)throw new x(`Error: Base64 alphabet should be 64 characters long, or 65 with a padding character. Found ${t.length}: ${t}`);if(n){var o=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(o,"")}if(i){if(e.length%4==1)throw new x(`Error: Invalid Base64 input length (${e.length}). Cannot be 4n+1, even without padding chars.`);if(65===t.length){var s=t.charAt(64),a=e.indexOf(s);if(a>=0){if(a<e.length-2||e.charAt(e.length-1)!==s)throw new x(`Error: Base64 padding character (${s}) not used in the correct place.`);if(e.length%4!=0)throw new x("Error: Base64 not padded to a multiple of 4.")}}}for(var u,c,f,l,h,p,d,y=[],g=0;g<e.length;){if(l=t.indexOf(e.charAt(g++)||null),h=t.indexOf(e.charAt(g++)||null),p=t.indexOf(e.charAt(g++)||null),d=t.indexOf(e.charAt(g++)||null),i&&(l<0||h<0||p<0||d<0))throw new x("Error: Base64 input contains non-alphabet char(s)");c=(15&h)<<4|p>>2,f=(3&p)<<6|d,(u=l<<2|h>>4)>=0&&u<256&&y.push(u),c>=0&&c<256&&64!==p&&y.push(c),f>=0&&f<256&&64!==d&&y.push(f)}return"string"===r?U.byteArrayToUtf8(y):y}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(r<1||Math.round(r)!==r)throw new x("Byte length must be a positive integer");if("None"!==t){var n="Auto"===t?/[^a-f\d]|0x/gi:U.regexRep(t);e=e.split(n)}else e=[e];for(var i=[],o=0;o<e.length;o++)for(var s=0;s<e[o].length;s+=r)i.push(parseInt(e[o].substr(s,r),16));return i}function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto";t=U.charRep(t);var r=[],n=e.split(t);""===n[n.length-1]&&(n=n.slice(0,n.length-1));for(var i=0;i<n.length;i++)r[i]=parseInt(n[i],10);return r}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(r<1||Math.round(r)!==r)throw new x("Byte length must be a positive integer");var n=U.regexRep(t);e=e.replace(n,"");for(var i=[],o=0;o<e.length;o+=r)i.push(parseInt(e.substr(o,r),2));return i}["Auto"].concat(["Space","Percent","Comma","Semi-colon","Colon","Line feed","CRLF","0x","0x with comma","\\x","None"]);var O=r(48287).Buffer,I=r(65606),N=function(){function t(){e(this,t)}return o(t,null,[{key:"chr",value:function(e){if(e>65535){e-=65536;var t=String.fromCharCode(e>>>10&1023|55296);return e=56320|1023&e,t+String.fromCharCode(e)}return String.fromCharCode(e)}},{key:"ord",value:function(e){if(2===e.length){var t=e.charCodeAt(0),r=e.charCodeAt(1);if(t>=55296&&t<56320&&r>=56320&&r<57344)return 1024*(t-55296)+r-56320+65536}return e.charCodeAt(0)}},{key:"padBytesRight",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new Array(t);return n.fill(r),g(e).forEach((function(e,t){n[t]=e})),n}},{key:"truncate",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length>t&&(e=e.slice(0,t-r.length)+r),e}},{key:"hex",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e="string"==typeof e?t.ord(e):e).toString(16).padStart(r,"0")}},{key:"bin",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(e="string"==typeof e?t.ord(e):e).toString(2).padStart(r,"0")}},{key:"printable",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?e.replace(/[^\x20-\x7f]/g,"."):(e=e.replace(/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,"."),t||(e=e.replace(/[\x09-\x10\u2028\u2029]/g,".")),e)}},{key:"escapeWhitespace",value:function(e){return e.replace(/[\x09-\x10]/g,(function(e){return String.fromCharCode(57344+e.charCodeAt(0))}))}},{key:"parseEscapedChars",value:function(e){return e.replace(/\\([abfnrtv'"]|[0-3][0-7]{2}|[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\}|\\)/g,(function(e,t){switch(t[0]){case"\\":return"\\";case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":return String.fromCharCode(parseInt(t,8));case"a":return String.fromCharCode(7);case"b":return"\b";case"t":return"\t";case"n":return"\n";case"v":return"\v";case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"x":return String.fromCharCode(parseInt(t.substr(1),16));case"u":return"{"===t[1]?String.fromCodePoint(parseInt(t.slice(2,-1),16)):String.fromCharCode(parseInt(t.substr(1),16))}}))}},{key:"escapeRegex",value:function(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}},{key:"expandAlphRange",value:function(e){for(var r=[],n=0;n<e.length;n++)if(n<e.length-2&&"-"===e[n+1]&&"\\"!==e[n]){for(var i=t.ord(e[n]),o=t.ord(e[n+2]),s=i;s<=o;s++)r.push(t.chr(s));n+=2}else n<e.length-2&&"\\"===e[n]&&"-"===e[n+1]?(r.push("-"),n++):r.push(e[n]);return r}},{key:"convertToByteArray",value:function(e,r){switch(r.toLowerCase()){case"binary":return T(e);case"hex":return S(e);case"decimal":return k(e);case"base64":return A(e,null,"byteArray");case"utf8":return t.strToUtf8ByteArray(e);default:return t.strToByteArray(e)}}},{key:"convertToByteString",value:function(e,r){switch(r.toLowerCase()){case"binary":return t.byteArrayToChars(T(e));case"hex":return t.byteArrayToChars(S(e));case"decimal":return t.byteArrayToChars(k(e));case"base64":return t.byteArrayToChars(A(e,null,"byteArray"));case"utf8":return _().encode(e);default:return e}}},{key:"byteArrayToInt",value:function(e,t){var r=0;if("big"===t)for(var n=0;n<e.length;n++)r=256*r+e[n];else for(var i=e.length-1;i>=0;i--)r=256*r+e[i];return r}},{key:"intToByteArray",value:function(e,t,r){var n=new Array(t);if("little"===r)for(var i=0;i<t;i++)n[i]=255&e,e>>>=8;else for(var o=t-1;o>=0;o--)n[o]=255&e,e>>>=8;return n}},{key:"strToArrayBuffer",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to array buffer`),!e)return new ArrayBuffer;for(var r,n=new Uint8Array(e.length),i=e.length;i--;)if(r=e.charCodeAt(i),n[i]=r,r>255)return t.strToUtf8ArrayBuffer(e);return n.buffer}},{key:"strToUtf8ArrayBuffer",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to UTF8 array buffer`),!e)return new ArrayBuffer;var t=new TextEncoder("utf-8").encode(e);return e.length!==t.length&&(L()&&self&&"function"==typeof self.setOption?self.setOption("attemptHighlight",!1):R()&&(window.app.options.attemptHighlight=!1)),t.buffer}},{key:"strToByteArray",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to byte array`),!e)return[];for(var r,n=new Array(e.length),i=e.length;i--;)if(r=e.charCodeAt(i),n[i]=r,r>255)return t.strToUtf8ByteArray(e);return n}},{key:"strToUtf8ByteArray",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to UTF8 byte array`),!e)return[];var r=_().encode(e);return e.length!==r.length&&(L()?self.setOption("attemptHighlight",!1):R()&&(window.app.options.attemptHighlight=!1)),t.strToByteArray(r)}},{key:"strToCharcode",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to charcode`),!e)return[];for(var r=[],n=0;n<e.length;n++){var i=e.charCodeAt(n);if(n<e.length-1&&i>=55296&&i<56320){var o=e[n+1].charCodeAt(0);o>=56320&&o<57344&&(i=t.ord(e[n]+e[++n]))}r.push(i)}return r}},{key:"byteArrayToUtf8",value:function(e){var r;if(v().debug(`Converting byte array[${null===(r=e)||void 0===r?void 0:r.length}] to UTF8`),!e||!e.length)return"";e instanceof Uint8Array||(e=new Uint8Array(e));try{var n=new TextDecoder("utf-8",{fatal:!0}).decode(e);return n.length!==e.length&&(L()?self.setOption("attemptHighlight",!1):R()&&(window.app.options.attemptHighlight=!1)),n}catch(r){return t.byteArrayToChars(e)}}},{key:"byteArrayToChars",value:function(e){if(v().debug(`Converting byte array[${null==e?void 0:e.length}] to chars`),!e||!e.length)return"";for(var t="",r=0;r<e.length;r+=2e4)t+=String.fromCharCode.apply(String,g(e.slice(r,r+2e4)));return t}},{key:"arrayBufferToStr",value:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(v().debug(`Converting array buffer[${null==e?void 0:e.byteLength}] to str`),!e||!e.byteLength)return"";var n=new Uint8Array(e);return r?t.byteArrayToUtf8(n):t.byteArrayToChars(n)}},{key:"calculateShannonEntropy",value:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var t,r=[],n=new Array(256).fill(0);for(t=0;t<e.length;t++)n[e[t]]++;for(t=0;t<n.length;t++)n[t]>0&&r.push(n[t]/e.length);var i,o=0;for(t=0;t<r.length;t++)o+=(i=r[t])*Math.log(i)/Math.log(2);return-o}},{key:"parseCSV",value:function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[","],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["\n","\r"],o=!1,s=!1,a="",u=[],c=[];e.length&&"\ufeff"===e[0]&&(e=e.substr(1));for(var f=0;f<e.length;f++)t=e[f],r=e[f+1]||"",o?(a+=t,o=!1):'"'!==t||s?'"'===t&&s?'"'===r?o=!0:s=!1:!s&&n.indexOf(t)>=0?(u.push(a),a=""):!s&&i.indexOf(t)>=0?(u.push(a),a="",c.push(u),u=[],i.indexOf(r)>=0&&r!==t&&f++):a+=t:s=!0;return u.length&&(u.push(a),c.push(u)),c}},{key:"stripHtmlTags",value:function(e){function t(e,r){var n=r.replace(e,"");return n.length===r.length?n:t(e,n)}return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(e=t(/<script[^>]*>(\s|\S)*?<\/script[^>]*>/gi,e),e=t(/<style[^>]*>(\s|\S)*?<\/style[^>]*>/gi,e)),t(/<[^>]+>/g,e)}},{key:"escapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","\0":""};return e?e.replace(/[&<>"'`\u0000]/g,(function(e){return t[e]})):e}},{key:"unescapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/","`":"`","":"\0"};return e.replace(/(&#?x?[a-z0-9]{2,4};|\ue000)/gi,(function(e){return t[e]||e}))}},{key:"toTitleCase",value:function(e){return e.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))}},{key:"encodeURIFragment",value:function(e){var t={"%2D":"-","%2E":".","%5F":"_","%7E":"~","%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2C":",","%3B":";","%3A":":","%40":"@","%2F":"/","%3F":"?"};return(e=encodeURIComponent(e)).replace(/%[0-9A-F]{2}/g,(function(e){return t[e]||e}))}},{key:"generatePrettyRecipe",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n="",i="",o="",s="";return e.forEach((function(e){n=e.op.replace(/ /g,"_"),i=JSON.stringify(e.args).slice(1,-1).replace(/'/g,"\\'").replace(/"((?:[^"\\]|\\.)*)"/g,"'$1'").replace(/\\"/g,'"'),o=e.disabled?"/disabled":"",s=e.breakpoint?"/breakpoint":"",r+=`${n}(${i}${o}${s})`,t&&(r+="\n")})),r}},{key:"parseRecipeConfig",value:function(e){if(0===(e=e.trim()).length)return[];if("["===e[0])return JSON.parse(e);var t,r;e=e.replace(/\n/g,"");for(var n=/([^(]+)\(((?:'[^'\\]*(?:\\.[^'\\]*)*'|[^)/'])*)(\/[^)]+)?\)/g,i=[];t=n.exec(e);){r="["+(r=t[2].replace(/"/g,'\\"').replace(/(^|,|{|:)'/g,'$1"').replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g,'$1"$2').replace(/\\'/g,"'"))+"]";var o={op:t[1].replace(/_/g," "),args:JSON.parse(r)};t[3]&&t[3].indexOf("disabled")>0&&(o.disabled=!0),t[3]&&t[3].indexOf("breakpoint")>0&&(o.breakpoint=!0),i.push(o)}return i}},{key:"displayFilesAsHTML",value:(r=l(p().mark((function e(r){var n,i,o,s,a;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=function(e){return`<div class='card' style='white-space: normal;'>\n <div class='card-header'>\n <h6 class="mb-0">\n ${t.escapeHtml(e.name)}\n </h6>\n </div>\n </div>`},i=function(e,r){if(r.startsWith("image")){var n="data:";return n+=r+";","<img style='max-width: 100%;' src='"+(n+="base64,"+B(e))+"'>"}return`<pre>${t.escapeHtml(t.arrayBufferToStr(e.buffer))}</pre>`},o=function(){var e=l(p().mark((function e(r,n){var o,s,a,u;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.readFile(r);case 2:return o=e.sent,s=new Blob([o],{type:r.type||"octet/stream"}),a=URL.createObjectURL(s),u=`<div class='card' style='white-space: normal;'>\n <div class='card-header' id='heading${n}'>\n <h6 class='mb-0'>\n <a class='collapsed'\n data-toggle='collapse'\n href='#collapse${n}'\n aria-expanded='false'\n aria-controls='collapse${n}'\n title="Show/hide contents of '${t.escapeHtml(r.name)}'">\n ${t.escapeHtml(r.name)}</a>\n <span class='float-right' style="margin-top: -3px">\n ${r.size.toLocaleString()} bytes\n <a title="Download ${t.escapeHtml(r.name)}"\n href="${a}"\n download="${t.escapeHtml(r.name)}"\n data-toggle="tooltip">\n <i class="material-icons" style="vertical-align: bottom">save</i>\n </a>\n <a title="Move to input"\n href="#"\n blob-url="${a}"\n file-name="${t.escapeHtml(r.name)}"\n class="extract-file"\n data-toggle="tooltip">\n <i class="material-icons" style="vertical-align: bottom">open_in_browser</i>\n </a>\n </span>\n </h6>\n </div>\n <div id='collapse${n}' class='collapse' aria-labelledby='heading${n}' data-parent="#files">\n <div class='card-body'>\n ${i(o,r.type)}\n </div>\n </div>\n </div>`,e.abrupt("return",u);case 7:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),s=`<div style='padding: 5px; white-space: normal;'>\n ${r.length} file(s) found\n </div><div id="files" style="padding: 20px">`,a=0;case 5:if(!(a<r.length)){e.next=17;break}if(!r[a].name.endsWith("/")){e.next=10;break}s+=n(r[a]),e.next=14;break;case 10:return e.t0=s,e.next=13,o(r[a],a);case 13:s=e.t0+=e.sent;case 14:a++,e.next=5;break;case 17:return e.abrupt("return",s+="</div>");case 18:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"parseURIParams",value:function(e){if(""===e)return{};"?"!==e[0]&&"#"!==e[0]||(e=e.substr(1));for(var t=e.split("&"),r={},n=0;n<t.length;n++){var i=t[n].split("=");2!==i.length?r[t[n]]=!0:r[i[0]]=decodeURIComponent(i[1].replace(/\+/g," "))}return r}},{key:"readFile",value:function(e){return F()?O.from(e).buffer:new Promise((function(t,r){var n=new FileReader,i=new Uint8Array(e.size),o=0,s=10485760,a=function(){if(o>=e.size)t(i);else{var r=e.slice(o,o+s);n.readAsArrayBuffer(r)}};n.onload=function(e){i.set(new Uint8Array(n.result),o),o+=s,a()},n.onerror=function(e){r(n.error.message)},a()}))}},{key:"readFileSync",value:function(e){if(!F())throw new TypeError("Browser environment cannot support readFileSync");return Uint8Array.from(e.data).buffer}},{key:"mod",value:function(e,t){return(e%t+t)%t}},{key:"gcd",value:function(e,r){return r?t.gcd(r,e%r):e}},{key:"modInv",value:function(e,t){e%=t;for(var r=1;r<t;r++)if(e*r%26==1)return r}},{key:"charRep",value:function(e){return{Space:" ",Percent:"%",Comma:",","Semi-colon":";",Colon:":",Tab:"\t","Line feed":"\n",CRLF:"\r\n","Forward slash":"/",Backslash:"\\","0x":"0x","\\x":"\\x","Nothing (separate chars)":"",None:""}[e]}},{key:"regexRep",value:function(e){return{Space:/\s+/g,Percent:/%/g,Comma:/,/g,"Semi-colon":/;/g,Colon:/:/g,"Line feed":/\n/g,CRLF:/\r\n/g,"Forward slash":/\//g,Backslash:/\\/g,"0x with comma":/,?0x/g,"0x":/0x/g,"\\x":/\\x/g,None:/\s+/g}[e]}},{key:"chunked",value:p().mark((function e(t,r){var n,i,o,s;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t[Symbol.iterator]();case 1:i=[],o=0;case 4:if(!(o<r)){e.next=12;break}if(!(s=n.next()).done){e.next=8;break}return e.abrupt("break",12);case 8:i.push(s.value);case 9:o++,e.next=4;break;case 12:if(!i.length){e.next=17;break}return e.next=15,i;case 15:e.next=18;break;case 17:return e.abrupt("return");case 18:e.next=1;break;case 20:case"end":return e.stop()}}),e)}))}]);var r}();function F(){return void 0!==I&&null!=I.versions&&null!=I.versions.node}function R(){return"object"==typeof window}function L(){return"function"==typeof importScripts}const U=N;function C(e,t,r){return t=a(t),s(e,j()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(j=function(){return!!e})()}Array.prototype.unique=function(){for(var e={},t=[],r=0,n=this.length;r<n;r++)Object.prototype.hasOwnProperty.call(e,this[r])||(t.push(this[r]),e[this[r]]=1);return t},Array.prototype.max=function(){return Math.max.apply(null,this)},Array.prototype.min=function(){return Math.min.apply(null,this)},Array.prototype.sum=function(){return this.reduce((function(e,t){return e+t}),0)},Array.prototype.equals=function(e){if(!e)return!1;var t=this.length;if(t!==e.length)return!1;for(;t--;)if(this[t]!==e[t])return!1;return!0},String.prototype.count=function(e){return this.split(e).length-1},String.prototype.padStart||(String.prototype.padStart=function(e,t){return e|=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return e|=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),String(this)+t.slice(0,e))});const D=function(t){function r(){var t;e(this,r);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return(t=C(this,r,[].concat(i))).type="DishError",Error.captureStackTrace&&Error.captureStackTrace(t,r),t}return c(r,t),o(r)}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error));var M=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,P=Math.ceil,z=Math.floor,$="[BigNumber Error] ",H=$+"Number primitive has more than 15 significant digits: ",V=1e14,Z=14,q=9007199254740991,G=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],J=1e7,W=1e9;function Y(e){var t=0|e;return e>0||e===t?t:t-1}function K(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=Z-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function X(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,u=e.e,c=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=u==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(a=(u=i.length)<(c=o.length)?u:c,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return u==c?0:u>c^r?1:-1}function Q(e,t,r,n){if(e<t||e>r||e!==z(e))throw Error($+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function ee(e){var t=e.c.length-1;return Y(e.e/Z)==t&&e.c[t]%2!=0}function te(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function re(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var ne=function e(t){var r,n,i,o,s,a,u,c,f,l,h=S.prototype={constructor:S,toString:null,valueOf:null},p=new S(1),d=20,y=4,g=-7,m=21,v=-1e7,b=1e7,_=!1,w=1,E=0,x={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},B="0123456789abcdefghijklmnopqrstuvwxyz",A=!0;function S(e,t){var r,o,s,a,u,c,f,l,h=this;if(!(h instanceof S))return new S(e,t);if(null==t){if(e&&!0===e._isBigNumber)return h.s=e.s,void(!e.c||e.e>b?h.c=h.e=null:e.e<v?h.c=[h.e=0]:(h.e=e.e,h.c=e.c.slice()));if((c="number"==typeof e)&&0*e==0){if(h.s=1/e<0?(e=-e,-1):1,e===~~e){for(a=0,u=e;u>=10;u/=10,a++);return void(a>b?h.c=h.e=null:(h.e=a,h.c=[e]))}l=String(e)}else{if(!M.test(l=String(e)))return i(h,l,c);h.s=45==l.charCodeAt(0)?(l=l.slice(1),-1):1}(a=l.indexOf("."))>-1&&(l=l.replace(".","")),(u=l.search(/e/i))>0?(a<0&&(a=u),a+=+l.slice(u+1),l=l.substring(0,u)):a<0&&(a=l.length)}else{if(Q(t,2,B.length,"Base"),10==t&&A)return I(h=new S(e),d+h.e+1,y);if(l=String(e),c="number"==typeof e){if(0*e!=0)return i(h,l,c,t);if(h.s=1/e<0?(l=l.slice(1),-1):1,S.DEBUG&&l.replace(/^0\.0*|\./,"").length>15)throw Error(H+e)}else h.s=45===l.charCodeAt(0)?(l=l.slice(1),-1):1;for(r=B.slice(0,t),a=u=0,f=l.length;u<f;u++)if(r.indexOf(o=l.charAt(u))<0){if("."==o){if(u>a){a=f;continue}}else if(!s&&(l==l.toUpperCase()&&(l=l.toLowerCase())||l==l.toLowerCase()&&(l=l.toUpperCase()))){s=!0,u=-1,a=0;continue}return i(h,String(e),c,t)}c=!1,(a=(l=n(l,t,10,h.s)).indexOf("."))>-1?l=l.replace(".",""):a=l.length}for(u=0;48===l.charCodeAt(u);u++);for(f=l.length;48===l.charCodeAt(--f););if(l=l.slice(u,++f)){if(f-=u,c&&S.DEBUG&&f>15&&(e>q||e!==z(e)))throw Error(H+h.s*e);if((a=a-u-1)>b)h.c=h.e=null;else if(a<v)h.c=[h.e=0];else{if(h.e=a,h.c=[],u=(a+1)%Z,a<0&&(u+=Z),u<f){for(u&&h.c.push(+l.slice(0,u)),f-=Z;u<f;)h.c.push(+l.slice(u,u+=Z));u=Z-(l=l.slice(u)).length}else u-=f;for(;u--;l+="0");h.c.push(+l)}}else h.c=[h.e=0]}function k(e,t,r,n){var i,o,s,a,u;if(null==r?r=y:Q(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)u=K(e.c),u=1==n||2==n&&(s<=g||s>=m)?te(u,s):re(u,s,"0");else if(o=(e=I(new S(e),t,r)).e,a=(u=K(e.c)).length,1==n||2==n&&(t<=o||o<=g)){for(;a<t;u+="0",a++);u=te(u,o)}else if(t-=s,u=re(u,o,"0"),o+1>a){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-a)>0)for(o+1==a&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function T(e,t){for(var r,n,i=1,o=new S(e[0]);i<e.length;i++)(!(n=new S(e[i])).s||(r=X(o,n))===t||0===r&&o.s===t)&&(o=n);return o}function O(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*Z-1)>b?e.c=e.e=null:r<v?e.c=[e.e=0]:(e.e=r,e.c=t),e}function I(e,t,r,n){var i,o,s,a,u,c,f,l=e.c,h=G;if(l){e:{for(i=1,a=l[0];a>=10;a/=10,i++);if((o=t-i)<0)o+=Z,s=t,u=l[c=0],f=z(u/h[i-s-1]%10);else if((c=P((o+1)/Z))>=l.length){if(!n)break e;for(;l.length<=c;l.push(0));u=f=0,i=1,s=(o%=Z)-Z+1}else{for(u=a=l[c],i=1;a>=10;a/=10,i++);f=(s=(o%=Z)-Z+i)<0?0:z(u/h[i-s-1]%10)}if(n=n||t<0||null!=l[c+1]||(s<0?u:u%h[i-s-1]),n=r<4?(f||n)&&(0==r||r==(e.s<0?3:2)):f>5||5==f&&(4==r||n||6==r&&(o>0?s>0?u/h[i-s]:0:l[c-1])%10&1||r==(e.s<0?8:7)),t<1||!l[0])return l.length=0,n?(t-=e.e+1,l[0]=h[(Z-t%Z)%Z],e.e=-t||0):l[0]=e.e=0,e;if(0==o?(l.length=c,a=1,c--):(l.length=c+1,a=h[Z-o],l[c]=s>0?z(u/h[i-s]%h[s])*a:0),n)for(;;){if(0==c){for(o=1,s=l[0];s>=10;s/=10,o++);for(s=l[0]+=a,a=1;s>=10;s/=10,a++);o!=a&&(e.e++,l[0]==V&&(l[0]=1));break}if(l[c]+=a,l[c]!=V)break;l[c--]=0,a=1}for(o=l.length;0===l[--o];l.pop());}e.e>b?e.c=e.e=null:e.e<v&&(e.c=[e.e=0])}return e}function N(e){var t,r=e.e;return null===r?e.toString():(t=K(e.c),t=r<=g||r>=m?te(t,r):re(t,r,"0"),e.s<0?"-"+t:t)}return S.clone=e,S.ROUND_UP=0,S.ROUND_DOWN=1,S.ROUND_CEIL=2,S.ROUND_FLOOR=3,S.ROUND_HALF_UP=4,S.ROUND_HALF_DOWN=5,S.ROUND_HALF_EVEN=6,S.ROUND_HALF_CEIL=7,S.ROUND_HALF_FLOOR=8,S.EUCLID=9,S.config=S.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error($+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(Q(r=e[t],0,W,t),d=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(Q(r=e[t],0,8,t),y=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(Q(r[0],-W,0,t),Q(r[1],0,W,t),g=r[0],m=r[1]):(Q(r,-W,W,t),g=-(m=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)Q(r[0],-W,-1,t),Q(r[1],1,W,t),v=r[0],b=r[1];else{if(Q(r,-W,W,t),!r)throw Error($+t+" cannot be zero: "+r);v=-(b=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error($+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw _=!r,Error($+"crypto unavailable");_=r}else _=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(Q(r=e[t],0,9,t),w=r),e.hasOwnProperty(t="POW_PRECISION")&&(Q(r=e[t],0,W,t),E=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error($+t+" not an object: "+r);x=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error($+t+" invalid: "+r);A="0123456789"==r.slice(0,10),B=r}}return{DECIMAL_PLACES:d,ROUNDING_MODE:y,EXPONENTIAL_AT:[g,m],RANGE:[v,b],CRYPTO:_,MODULO_MODE:w,POW_PRECISION:E,FORMAT:x,ALPHABET:B}},S.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!S.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-W&&i<=W&&i===z(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%Z)<1&&(t+=Z),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=V||r!==z(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error($+"Invalid BigNumber: "+e)},S.maximum=S.max=function(){return T(arguments,-1)},S.minimum=S.min=function(){return T(arguments,1)},S.random=(o=9007199254740992,s=Math.random()*o&2097151?function(){return z(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,a=0,u=[],c=new S(p);if(null==e?e=d:Q(e,0,W),i=P(e/Z),_)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));a<i;)(o=131072*t[a]+(t[a+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[a]=r[0],t[a+1]=r[1]):(u.push(o%1e14),a+=2);a=i/2}else{if(!crypto.randomBytes)throw _=!1,Error($+"crypto unavailable");for(t=crypto.randomBytes(i*=7);a<i;)(o=281474976710656*(31&t[a])+1099511627776*t[a+1]+4294967296*t[a+2]+16777216*t[a+3]+(t[a+4]<<16)+(t[a+5]<<8)+t[a+6])>=9e15?crypto.randomBytes(7).copy(t,a):(u.push(o%1e14),a+=7);a=i/7}if(!_)for(;a<i;)(o=s())<9e15&&(u[a++]=o%1e14);for(i=u[--a],e%=Z,i&&e&&(o=G[Z-e],u[a]=z(i/o)*o);0===u[a];u.pop(),a--);if(a<0)u=[n=0];else{for(n=-1;0===u[0];u.splice(0,1),n-=Z);for(a=1,o=u[0];o>=10;o/=10,a++);a<Z&&(n-=Z-a)}return c.e=n,c.c=u,c}),S.sum=function(){for(var e=1,t=arguments,r=new S(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,u=e.length;a<u;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var u,c,f,l,h,p,g,m,v=n.indexOf("."),b=d,_=y;for(v>=0&&(l=E,E=0,n=n.replace(".",""),p=(m=new S(i)).pow(n.length-v),E=l,m.c=t(re(K(p.c),p.e,"0"),10,o,e),m.e=m.c.length),f=l=(g=t(n,i,o,a?(u=B,e):(u=e,B))).length;0==g[--l];g.pop());if(!g[0])return u.charAt(0);if(v<0?--f:(p.c=g,p.e=f,p.s=s,g=(p=r(p,m,b,_,o)).c,h=p.r,f=p.e),v=g[c=f+b+1],l=o/2,h=h||c<0||null!=g[c+1],h=_<4?(null!=v||h)&&(0==_||_==(p.s<0?3:2)):v>l||v==l&&(4==_||h||6==_&&1&g[c-1]||_==(p.s<0?8:7)),c<1||!g[0])n=h?re(u.charAt(1),-b,u.charAt(0)):u.charAt(0);else{if(g.length=c,h)for(--o;++g[--c]>o;)g[c]=0,c||(++f,g=[1].concat(g));for(l=g.length;!g[--l];);for(v=0,n="";v<=l;n+=u.charAt(g[v++]));n=re(n,f,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,u=e.length,c=t%J,f=t/J|0;for(e=e.slice();u--;)a=((i=c*(o=e[u]%J)+(n=f*o+(s=e[u]/J|0)*c)%J*J+a)/r|0)+(n/J|0)+f*s,e[u]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,s,a){var u,c,f,l,h,p,d,y,g,m,v,b,_,w,E,x,B,A=n.s==i.s?1:-1,k=n.c,T=i.c;if(!(k&&k[0]&&T&&T[0]))return new S(n.s&&i.s&&(k?!T||k[0]!=T[0]:T)?k&&0==k[0]||!T?0*A:A/0:NaN);for(g=(y=new S(A)).c=[],A=o+(c=n.e-i.e)+1,a||(a=V,c=Y(n.e/Z)-Y(i.e/Z),A=A/Z|0),f=0;T[f]==(k[f]||0);f++);if(T[f]>(k[f]||0)&&c--,A<0)g.push(1),l=!0;else{for(w=k.length,x=T.length,f=0,A+=2,(h=z(a/(T[0]+1)))>1&&(T=e(T,h,a),k=e(k,h,a),x=T.length,w=k.length),_=x,v=(m=k.slice(0,x)).length;v<x;m[v++]=0);B=T.slice(),B=[0].concat(B),E=T[0],T[1]>=a/2&&E++;do{if(h=0,(u=t(T,m,x,v))<0){if(b=m[0],x!=v&&(b=b*a+(m[1]||0)),(h=z(b/E))>1)for(h>=a&&(h=a-1),d=(p=e(T,h,a)).length,v=m.length;1==t(p,m,d,v);)h--,r(p,x<d?B:T,d,a),d=p.length,u=1;else 0==h&&(u=h=1),d=(p=T.slice()).length;if(d<v&&(p=[0].concat(p)),r(m,p,v,a),v=m.length,-1==u)for(;t(T,m,x,v)<1;)h++,r(m,x<v?B:T,v,a),v=m.length}else 0===u&&(h++,m=[0]);g[f++]=h,m[0]?m[v++]=k[_]||0:(m=[k[_]],v=1)}while((_++<w||null!=m[0])&&A--);l=null!=m[0],g[0]||g.splice(0,1)}if(a==V){for(f=1,A=g[0];A>=10;A/=10,f++);I(y,o+(y.e=f+c*Z-1)+1,s,l)}else y.e=c,y.r=+l;return y}}(),a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,c=/^\.([^.]+)$/,f=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(l,"");if(f.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(a,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(u,"$1").replace(c,"0.$1")),t!=o))return new S(o,i);if(S.DEBUG)throw Error($+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},h.absoluteValue=h.abs=function(){var e=new S(this);return e.s<0&&(e.s=1),e},h.comparedTo=function(e,t){return X(this,new S(e,t))},h.decimalPlaces=h.dp=function(e,t){var r,n,i,o=this;if(null!=e)return Q(e,0,W),null==t?t=y:Q(t,0,8),I(new S(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-Y(this.e/Z))*Z,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},h.dividedBy=h.div=function(e,t){return r(this,new S(e,t),d,y)},h.dividedToIntegerBy=h.idiv=function(e,t){return r(this,new S(e,t),0,1)},h.exponentiatedBy=h.pow=function(e,t){var r,n,i,o,s,a,u,c,f=this;if((e=new S(e)).c&&!e.isInteger())throw Error($+"Exponent not an integer: "+N(e));if(null!=t&&(t=new S(t)),s=e.e>14,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!e.c||!e.c[0])return c=new S(Math.pow(+N(f),s?e.s*(2-ee(e)):+N(e))),t?c.mod(t):c;if(a=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new S(NaN);(n=!a&&f.isInteger()&&t.isInteger())&&(f=f.mod(t))}else{if(e.e>9&&(f.e>0||f.e<-1||(0==f.e?f.c[0]>1||s&&f.c[1]>=24e7:f.c[0]<8e13||s&&f.c[0]<=9999975e7)))return o=f.s<0&&ee(e)?-0:0,f.e>-1&&(o=1/o),new S(a?1/o:o);E&&(o=P(E/Z+2))}for(s?(r=new S(.5),a&&(e.s=1),u=ee(e)):u=(i=Math.abs(+N(e)))%2,c=new S(p);;){if(u){if(!(c=c.times(f)).c)break;o?c.c.length>o&&(c.c.length=o):n&&(c=c.mod(t))}if(i){if(0===(i=z(i/2)))break;u=i%2}else if(I(e=e.times(r),e.e+1,1),e.e>14)u=ee(e);else{if(0==(i=+N(e)))break;u=i%2}f=f.times(f),o?f.c&&f.c.length>o&&(f.c.length=o):n&&(f=f.mod(t))}return n?c:(a&&(c=p.div(c)),t?c.mod(t):o?I(c,E,y,void 0):c)},h.integerValue=function(e){var t=new S(this);return null==e?e=y:Q(e,0,8),I(t,t.e+1,e)},h.isEqualTo=h.eq=function(e,t){return 0===X(this,new S(e,t))},h.isFinite=function(){return!!this.c},h.isGreaterThan=h.gt=function(e,t){return X(this,new S(e,t))>0},h.isGreaterThanOrEqualTo=h.gte=function(e,t){return 1===(t=X(this,new S(e,t)))||0===t},h.isInteger=function(){return!!this.c&&Y(this.e/Z)>this.c.length-2},h.isLessThan=h.lt=function(e,t){return X(this,new S(e,t))<0},h.isLessThanOrEqualTo=h.lte=function(e,t){return-1===(t=X(this,new S(e,t)))||0===t},h.isNaN=function(){return!this.s},h.isNegative=function(){return this.s<0},h.isPositive=function(){return this.s>0},h.isZero=function(){return!!this.c&&0==this.c[0]},h.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new S(e,t)).s,!a||!t)return new S(NaN);if(a!=t)return e.s=-t,s.plus(e);var u=s.e/Z,c=e.e/Z,f=s.c,l=e.c;if(!u||!c){if(!f||!l)return f?(e.s=-t,e):new S(l?s:NaN);if(!f[0]||!l[0])return l[0]?(e.s=-t,e):new S(f[0]?s:3==y?-0:0)}if(u=Y(u),c=Y(c),f=f.slice(),a=u-c){for((o=a<0)?(a=-a,i=f):(c=u,i=l),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=f.length)<(t=l.length))?a:t,a=t=0;t<n;t++)if(f[t]!=l[t]){o=f[t]<l[t];break}if(o&&(i=f,f=l,l=i,e.s=-e.s),(t=(n=l.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=V-1;n>a;){if(f[--n]<l[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=V}f[n]-=l[n]}for(;0==f[0];f.splice(0,1),--c);return f[0]?O(e,f,c):(e.s=3==y?-1:1,e.c=[e.e=0],e)},h.modulo=h.mod=function(e,t){var n,i,o=this;return e=new S(e,t),!o.c||!e.s||e.c&&!e.c[0]?new S(NaN):!e.c||o.c&&!o.c[0]?new S(o):(9==w?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,w),(e=o.minus(n.times(e))).c[0]||1!=w||(e.s=o.s),e)},h.multipliedBy=h.times=function(e,t){var r,n,i,o,s,a,u,c,f,l,h,p,d,y,g,m=this,v=m.c,b=(e=new S(e,t)).c;if(!(v&&b&&v[0]&&b[0]))return!m.s||!e.s||v&&!v[0]&&!b||b&&!b[0]&&!v?e.c=e.e=e.s=null:(e.s*=m.s,v&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=Y(m.e/Z)+Y(e.e/Z),e.s*=m.s,(u=v.length)<(l=b.length)&&(d=v,v=b,b=d,i=u,u=l,l=i),i=u+l,d=[];i--;d.push(0));for(y=V,g=J,i=l;--i>=0;){for(r=0,h=b[i]%g,p=b[i]/g|0,o=i+(s=u);o>i;)r=((c=h*(c=v[--s]%g)+(a=p*c+(f=v[s]/g|0)*h)%g*g+d[o]+r)/y|0)+(a/g|0)+p*f,d[o--]=c%y;d[o]=r}return r?++n:d.splice(0,1),O(e,d,n)},h.negated=function(){var e=new S(this);return e.s=-e.s||null,e},h.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new S(e,t)).s,!i||!t)return new S(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/Z,s=e.e/Z,a=n.c,u=e.c;if(!o||!s){if(!a||!u)return new S(i/0);if(!a[0]||!u[0])return u[0]?e:new S(a[0]?n:0*i)}if(o=Y(o),s=Y(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=u):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+u[t]+i)/V|0,a[t]=V===a[t]?0:a[t]%V;return i&&(a=[i].concat(a),++s),O(e,a,s)},h.precision=h.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return Q(e,1,W),null==t?t=y:Q(t,0,8),I(new S(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*Z+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},h.shiftedBy=function(e){return Q(e,-9007199254740991,q),this.times("1e"+e)},h.squareRoot=h.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,u=s.s,c=s.e,f=d+4,l=new S("0.5");if(1!==u||!a||!a[0])return new S(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+N(s)))||u==1/0?(((t=K(a)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=Y((c+1)/2)-(c<0||c%2),n=new S(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new S(u+""),n.c[0])for((u=(c=n.e)+f)<3&&(u=0);;)if(o=n,n=l.times(o.plus(r(s,o,f,1))),K(o.c).slice(0,u)===(t=K(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(I(n,n.e+d+2,1),e=!n.times(n).eq(s));break}if(!i&&(I(o,o.e+d+2,0),o.times(o).eq(s))){n=o;break}f+=4,u+=4,i=1}return I(n,n.e+d+1,y,e)},h.toExponential=function(e,t){return null!=e&&(Q(e,0,W),e++),k(this,e,t,1)},h.toFixed=function(e,t){return null!=e&&(Q(e,0,W),e=e+this.e+1),k(this,e,t)},h.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=x;else if("object"!=typeof r)throw Error($+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,s=n.split("."),a=+r.groupSize,u=+r.secondaryGroupSize,c=r.groupSeparator||"",f=s[0],l=s[1],h=i.s<0,p=h?f.slice(1):f,d=p.length;if(u&&(o=a,a=u,u=o,d-=o),a>0&&d>0){for(o=d%a||a,f=p.substr(0,o);o<d;o+=a)f+=c+p.substr(o,a);u>0&&(f+=c+p.slice(o)),h&&(f="-"+f)}n=l?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):f}return(r.prefix||"")+n+(r.suffix||"")},h.toFraction=function(e){var t,n,i,o,s,a,u,c,f,l,h,d,g=this,m=g.c;if(null!=e&&(!(u=new S(e)).isInteger()&&(u.c||1!==u.s)||u.lt(p)))throw Error($+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+N(u));if(!m)return new S(g);for(t=new S(p),f=n=new S(p),i=c=new S(p),d=K(m),s=t.e=d.length-g.e-1,t.c[0]=G[(a=s%Z)<0?Z+a:a],e=!e||u.comparedTo(t)>0?s>0?t:f:u,a=b,b=1/0,u=new S(d),c.c[0]=0;l=r(u,t,0,1),1!=(o=n.plus(l.times(i))).comparedTo(e);)n=i,i=o,f=c.plus(l.times(o=f)),c=o,t=u.minus(l.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),c=c.plus(o.times(f)),n=n.plus(o.times(i)),c.s=f.s=g.s,h=r(f,i,s*=2,y).minus(g).abs().comparedTo(r(c,n,s,y).minus(g).abs())<1?[f,i]:[c,n],b=a,h},h.toNumber=function(){return+N(this)},h.toPrecision=function(e,t){return null!=e&&Q(e,1,W),k(this,e,t,2)},h.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=g||o>=m?te(K(r.c),o):re(K(r.c),o,"0"):10===e&&A?t=re(K((r=I(new S(r),d+o+1,y)).c),r.e,"0"):(Q(e,2,B.length,"Base"),t=n(re(K(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},h.valueOf=h.toJSON=function(){return N(this)},h._isBigNumber=!0,h[Symbol.toStringTag]="BigNumber",h[Symbol.for("nodejs.util.inspect.custom")]=h.valueOf,null!=t&&S.set(t),S}();const ie=ne;var oe=function(){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e(this,t),this.bytes=r,this.length=this.bytes.length,this.position=n,this.bitPos=i}return o(t,[{key:"clone",value:function(){return new t(this.bytes,this.position,this.bitPos)}},{key:"getBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!(this.position>this.length)){var t=null!==e?this.position+e:this.length,r=this.bytes.slice(this.position,t);return this.position=t,this.bitPos=0,r}}},{key:"readString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(this.position>this.length)){-1===e&&(e=this.length-this.position);for(var t="",r=this.position;r<this.position+e;r++){var n=this.bytes[r];if(0===n)break;t+=String.fromCharCode(n)}return this.position+=e,this.bitPos=0,t}}},{key:"readInt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r=0;if("be"===t)for(var n=this.position;n<this.position+e;n++)r<<=8,r|=this.bytes[n];else for(var i=this.position+e-1;i>=this.position;i--)r<<=8,r|=this.bytes[i];return this.position+=e,this.bitPos=0,r}}},{key:"readBits",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r,n=0,i=0;for(n=this.bytes[this.position++]&(r=this.bitPos,"be"===t?(1<<8-r)-1:256-(1<<r)),"be"!==t&&(n>>>=this.bitPos),i=8-this.bitPos,this.bitPos=0;i<e;)"be"===t?n=n<<i|this.bytes[this.position++]:n|=this.bytes[this.position++]<<i,i+=8;if(i>e){var o=i-e;"be"===t?n>>>=o:n&=(1<<e)-1,i-=o,this.position--,this.bitPos=8-o}return n}}},{key:"continueUntil",value:function(e){if(!(this.position>this.length))if(this.bitPos=0,"number"!=typeof e){var t=e.length,r=e[t-1];this.position=t;for(var n,i=function(e,t){var r=new Array;return e.forEach((function(e,n){r[e]=t-n})),r}(e,t);this.position<this.length;){for(;this.position<this.length&&this.bytes[this.position++]!==r;);n=!0;for(var o=t-1;o>=0;o--)if(this.bytes[this.position-t+o]!==e[o]){n=!1,this.position+=i[e[o]];break}if(n){this.position-=t;break}}}else for(;++this.position<this.length&&this.bytes[this.position]!==e;);}},{key:"consumeWhile",value:function(e){for(;this.position<this.length&&this.bytes[this.position]===e;)this.position++;this.bitPos=0}},{key:"consumeIf",value:function(e){this.bytes[this.position]===e&&(this.position++,this.bitPos=0)}},{key:"moveForwardsBy",value:function(e){var t=this.position+e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsBy",value:function(e){var t=this.position-e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsByBits",value:function(e){if(e<=this.bitPos)this.bitPos-=e;else for(this.bitPos>0&&(e-=this.bitPos,this.bitPos=0);e>0;)this.moveBackwardsBy(1),this.bitPos=8,this.moveBackwardsByBits(e),e-=8}},{key:"moveTo",value:function(e){if(e<0||e>this.length)throw new Error("Cannot move to position "+e+" in stream. Out of bounds.");this.position=e,this.bitPos=0}},{key:"hasMore",value:function(){return this.position<this.length}},{key:"carve",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position;return this.bitPos>0&&t++,this.bytes.slice(e,t)}}])}();function se(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ae(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ae(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ue={Images:[{name:"Joint Photographic Experts Group image",extension:"jpg,jpeg,jpe,thm,mpo",mime:"image/jpeg",description:"",signature:{0:255,1:216,2:255,3:[192,196,219,221,224,225,226,227,228,229,231,232,234,235,236,237,238,254]},extractor:function(e,t){for(var r=new oe(e.slice(t));r.hasMore();){var n=r.getBytes(2);if(255!==n[0])throw new Error(`Invalid marker while parsing JPEG at pos ${r.position}: ${n}`);var i=0;switch(n[1]){case 216:case 1:break;case 217:return r.carve();case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:case 219:case 222:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:i=r.readInt(2,"be"),r.position+=i-2;break;case 223:r.position++;break;case 220:case 221:r.position+=2;break;case 218:i=r.readInt(2,"be"),r.position+=i-2,r.continueUntil(255);break;default:r.continueUntil(255)}}throw new Error("Unable to parse JPEG successfully")}},{name:"Graphics Interchange Format image",extension:"gif",mime:"image/gif",description:"",signature:{0:71,1:73,2:70,3:56,4:[55,57],5:97},extractor:function(e,t){var r=new oe(e.slice(t));for(r.continueUntil([33,255]),r.continueUntil([33,249]),r.moveForwardsBy(2);r.hasMore();){for(r.moveForwardsBy(r.readInt(1)+1),r.moveForwardsBy(11);!Array.from(r.getBytes(2)).equals([33,249])&&(r.moveBackwardsBy(2),r.moveForwardsBy(r.readInt(1)),r.readInt(1));)r.moveBackwardsBy(1);if(59===r.readInt(1))break;r.moveForwardsBy(1)}return r.carve()}},{name:"Portable Network Graphics image",extension:"png",mime:"image/png",description:"",signature:{0:137,1:80,2:78,3:71,4:13,5:10,6:26,7:10},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(8);for(var n=0,i="";"IEND"!==i;)n=r.readInt(4,"be"),i=r.readString(4),r.moveForwardsBy(n+4);return r.carve()}},{name:"WEBP Image",extension:"webp",mime:"image/webp",description:"",signature:{8:87,9:69,10:66,11:80},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(4);var n=r.readInt(4,"le");return r.moveForwardsBy(n),r.carve()}},{name:"High Efficiency Image File Format",extension:"heic,heif",mime:"image/heif",description:"",signature:{0:0,1:0,2:0,3:[36,24],4:102,5:116,6:121,7:112,8:104,9:101,10:105,11:99},extractor:null},{name:"Camera Image File Format",extension:"crw",mime:"image/x-canon-crw",description:"",signature:{6:72,7:69,8:65,9:80,10:67,11:67,12:68,13:82},extractor:null},{name:"Canon CR2 raw image",extension:"cr2",mime:"image/x-canon-cr2",description:"",signature:[{0:73,1:73,2:42,3:0,8:67,9:82},{0:77,1:77,2:0,3:42,8:67,9:82}],extractor:null},{name:"Tagged Image File Format image",extension:"tif",mime:"image/tiff",description:"",signature:[{0:73,1:73,2:42,3:0},{0:77,1:77,2:0,3:42}],extractor:null},{name:"Bitmap image",extension:"bmp",mime:"image/bmp",description:"",signature:{0:66,1:77,7:0,9:0,14:[12,40,56,64,108,124],15:0,16:0,17:0},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(2);var n=r.readInt(4,"le");return r.moveForwardsBy(n-6),r.carve()}},{name:"JPEG Extended Range image",extension:"jxr",mime:"image/vnd.ms-photo",description:"",signature:{0:73,1:73,2:188},extractor:null},{name:"Photoshop image",extension:"psd",mime:"image/vnd.adobe.photoshop",description:"",signature:{0:56,1:66,2:80,3:83,4:0,5:1,6:0,7:0,8:0,9:0,10:0,11:0},extractor:null},{name:"Photoshop Large Document",extension:"psb",mime:"application/x-photoshop",description:"",signature:{0:56,1:66,2:80,3:83,4:0,5:2,6:0,7:0,8:0,9:0,10:0,11:0,12:0},extractor:null},{name:"Paint Shop Pro image",extension:"psp",mime:"image/psp",description:"",signature:[{0:80,1:97,2:105,3:110,4:116,5:32,6:83,7:104,8:111,9:112,10:32,11:80,12:114,13:111,14:32,15:73,16:109},{0:126,1:66,2:75,3:0}],extractor:null},{name:"The GIMP image",extension:"xcf",mime:"image/x-xcf",description:"",signature:{0:103,1:105,2:109,3:112,4:32,5:120,6:99,7:102,8:32,9:[102,118],10:[105,48],11:[108,48],12:[101,49,50,51]},extractor:null},{name:"Icon image",extension:"ico",mime:"image/x-icon",description:"",signature:{0:0,1:0,2:1,3:0,4:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21],5:0,6:[16,32,48,64,128],7:[16,32,48,64,128],9:0,10:[0,1]},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(4);var n=r.readInt(2,"le");r.moveForwardsBy(8+16*(n-1));var i=r.readInt(4,"le"),o=r.readInt(4,"le");return r.moveTo(o+i),r.carve()}},{name:"Radiance High Dynamic Range image",extension:"hdr",mime:"image/vnd.radiance",description:"",signature:{0:35,1:63,2:82,3:65,4:68,5:73,6:65,7:78,8:67,9:69,10:10},extractor:null},{name:"Sony ARW image",extension:"arw",mime:"image/x-raw",description:"",signature:{0:5,1:0,2:0,3:0,4:65,5:87,6:49,7:46},extractor:null},{name:"Fujifilm Raw Image",extension:"raf",mime:"image/x-raw",description:"",signature:{0:70,1:85,2:74,3:73,4:70,5:73,6:76,7:77,8:67,9:67,10:68,11:45,12:82,13:65,14:87},extractor:null},{name:"Minolta RAW image",extension:"mrw",mime:"image/x-raw",description:"",signature:{0:0,1:77,2:82,3:77},extractor:null},{name:"Adobe Bridge Thumbnail Cache",extension:"bct",mime:"application/octet-stream",description:"",signature:{0:108,1:110,2:98,3:116,4:2,5:0,6:0,7:0},extractor:null},{name:"Microsoft Document Imaging",extension:"mdi",mime:"image/vnd.ms-modi",description:"",signature:{0:69,1:80,2:42,3:0},extractor:null},{name:"Joint Photographic Experts Group image (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:47,1:57,2:106,3:47,4:52},extractor:null},{name:"Portable Network Graphics image (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:105,1:86,2:66,3:79,4:82,5:119,6:48},extractor:null},{name:"AutoCAD Drawing",extension:"dwg,123d",mime:"application/acad",description:"",signature:{0:65,1:67,2:49,3:48,4:[48,49],5:[48,49,50,51,52,53],6:0},extractor:null},{name:"AutoCAD Drawing",extension:"dwg,dwt",mime:"application/acad",description:"",signature:[{0:65,1:67,2:49,3:48,4:49,5:56,6:0},{0:65,1:67,2:49,3:48,4:50,5:52,6:0},{0:65,1:67,2:49,3:48,4:50,5:55,6:0}],extractor:null},{name:"Targa Image",extension:"tga",mime:"image/x-targa",description:"",signature:[{0:84,1:82,2:85,3:69,4:86,5:73,6:83,7:73,8:79,9:78,10:45,11:88,12:70,13:73,14:76,15:69,16:46}],extractor:function(e,t){var r=new oe(e);r.moveTo(t-8);var n=r.readInt(4,"le"),i=r.readInt(4,"le");function o(e,t){for(var n=0;n<e;n++){r.moveBackwardsBy(1);var i=r.readInt(t,"le")-1;if(r.moveBackwardsBy(t),i===n)break}}return r.moveBackwardsBy(8),n||i?n?(o(65535,2),r.moveBackwardsBy(n)):i&&(o(4294967295,4),r.moveBackwardsBy(6),r.moveBackwardsBy(i)):(function(){r.moveBackwardsBy(5);for(var e=0;e<1048576&&r.readInt(2,"le")*r.readInt(2,"le")*r.readInt(1)/8!=e-1;e++)r.moveBackwardsBy(6)}(),r.moveBackwardsBy(17)),r.carve(r.position,t+18)}}],Video:[{name:"Matroska Multimedia Container",extension:"mkv",mime:"video/x-matroska",description:"",signature:{31:109,32:97,33:116,34:114,35:111,36:115,37:107,38:97},extractor:null},{name:"WEBM video",extension:"webm",mime:"video/webm",description:"",signature:{0:26,1:69,2:223,3:163},extractor:null},{name:"Flash MP4 video",extension:"f4v",mime:"video/mp4",description:"",signature:{4:102,5:116,6:121,7:112,8:[102,70],9:52,10:[118,86],11:32},extractor:null},{name:"MPEG-4 video",extension:"mp4",mime:"video/mp4",description:"",signature:[{0:0,1:0,2:0,3:[24,32],4:102,5:116,6:121,7:112},{0:51,1:103,2:112,3:53},{0:0,1:0,2:0,3:28,4:102,5:116,6:121,7:112,8:109,9:112,10:52,11:50,16:109,17:112,18:52,19:49,20:109,21:112,22:52,23:50,24:105,25:115,26:111,27:109}],extractor:null},{name:"M4V video",extension:"m4v",mime:"video/x-m4v",description:"",signature:{0:0,1:0,2:0,3:28,4:102,5:116,6:121,7:112,8:77,9:52,10:86},extractor:null},{name:"Quicktime video",extension:"mov",mime:"video/quicktime",description:"",signature:{0:0,1:0,2:0,3:20,4:102,5:116,6:121,7:112},extractor:null},{name:"Audio Video Interleave",extension:"avi",mime:"video/x-msvideo",description:"",signature:{0:82,1:73,2:70,3:70,8:65,9:86,10:73},extractor:null},{name:"Windows Media Video",extension:"wmv",mime:"video/x-ms-wmv",description:"",signature:{0:48,1:38,2:178,3:117,4:142,5:102,6:207,7:17,8:166,9:217},extractor:null},{name:"MPEG video",extension:"mpg",mime:"video/mpeg",description:"",signature:{0:0,1:0,2:1,3:186},extractor:null},{name:"Flash Video",extension:"flv",mime:"video/x-flv",description:"",signature:{0:70,1:76,2:86,3:1},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(5);var n=r.readInt(4,"be");r.moveForwardsBy(n-9);for(var i=-11;r.hasMore();){var o=r.readInt(4,"be"),s=r.readInt(1);if([8,9,18].indexOf(s)<0){r.moveBackwardsBy(1);break}if(o!==i+11){r.moveBackwardsBy(i+11+5);break}i=r.readInt(3,"be"),r.moveForwardsBy(7+i)}return r.carve()}},{name:"OGG Video",extension:"ogv,ogm,opus,ogx",mime:"video/ogg",description:"",signature:[{0:79,1:103,2:103,3:83,4:0,5:2,28:1,29:118,30:105,31:100,32:101,33:111},{0:79,1:103,2:103,3:83,4:0,5:2,28:128,29:116,30:104,31:101,32:111,33:114,34:97},{0:79,1:103,2:103,3:83,4:0,5:2,28:102,29:105,30:115,31:104,32:101,33:97,34:100}],extractor:null}],Audio:[{name:"Waveform Audio",extension:"wav",mime:"audio/x-wav",description:"",signature:{0:82,1:73,2:70,3:70,8:87,9:65,10:86,11:69},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(4),r.moveTo(r.readInt(4,"le")+8),r.carve()}},{name:"OGG audio",extension:"ogg",mime:"audio/ogg",description:"",signature:{0:79,1:103,2:103,3:83},extractor:null},{name:"Musical Instrument Digital Interface audio",extension:"midi",mime:"audio/midi",description:"",signature:{0:77,1:84,2:104,3:100},extractor:null},{name:"MPEG-3 audio",extension:"mp3",mime:"audio/mpeg",description:"",signature:[{0:73,1:68,2:51},{0:255,1:251}],extractor:function(e,t){var r=new oe(e.slice(t)),n=["free",32e3,4e4,48e3,56e3,64e3,8e4,96e3,112e3,128e3,16e4,192e3,224e3,256e3,32e4,"bad"],i=[44100,48e3,32e3,"reserved"];if(r.getBytes(3).toString()===[73,68,51].toString()){r.moveTo(6);var o=r.readInt(1)<<21|r.readInt(1)<<14|r.readInt(1)<<7|r.readInt(1);r.moveForwardsBy(o)}else r.moveTo(0);for(;r.hasMore();){if(r.getBytes(3)===[84,65,71].toString()){r.moveForwardsBy(125);break}if(r.getBytes(2).toString()!==[255,251].toString()){r.moveBackwardsBy(2);break}var s=r.readInt(1),a=n[s>>4],u=i[(15&s)>>2],c=(2&s)>>1;if("free"===a||"bad"===a||"reserved"===u){r.moveBackwardsBy(1);break}var f=Math.floor(144*a/u+c);if(r.position+f>r.length){r.moveTo(r.length);break}r.moveForwardsBy(f-3)}return r.carve()}},{name:"MPEG-4 Part 14 audio",extension:"m4a",mime:"audio/m4a",description:"",signature:[{4:102,5:116,6:121,7:112,8:77,9:52,10:65},{0:77,1:52,2:65,3:32}],extractor:null},{name:"Free Lossless Audio Codec",extension:"flac",mime:"audio/x-flac",description:"",signature:{0:102,1:76,2:97,3:67},extractor:null},{name:"Adaptive Multi-Rate audio codec",extension:"amr",mime:"audio/amr",description:"",signature:{0:35,1:33,2:65,3:77,4:82,5:10},extractor:null},{name:"Audacity",extension:"au",mime:"audio/x-au",description:"",signature:{0:100,1:110,2:115,3:46,24:65,25:117,26:100,27:97,28:99,29:105,30:116,31:121,32:66,33:108,34:111,35:99,36:107,37:70,38:105,39:108,40:101},extractor:null},{name:"Audacity Block",extension:"auf",mime:"application/octet-stream",description:"",signature:{0:65,1:117,2:100,3:97,4:99,5:105,6:116,7:121,8:66,9:108,10:111,11:99,12:107,13:70,14:105,15:108,16:101},extractor:null},{name:"Audio Interchange File",extension:"aif",mime:"audio/x-aiff",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:70},extractor:null},{name:"Audio Interchange File (compressed)",extension:"aifc",mime:"audio/x-aifc",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:67},extractor:null}],Documents:[{name:"Portable Document Format",extension:"pdf",mime:"application/pdf",description:"",signature:{0:37,1:80,2:68,3:70},extractor:function(e,t){var r=new oe(e.slice(t));return r.continueUntil([37,37,69,79,70]),r.moveForwardsBy(5),r.consumeIf(13),r.consumeIf(10),r.carve()}},{name:"Portable Document Format (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:65,1:74,2:86,3:66,4:69,5:82,6:105},extractor:null},{name:"Adobe PostScript",extension:"ps,eps,ai,pfa",mime:"application/postscript",description:"",signature:{0:37,1:33,2:80,3:83,4:45,5:65,6:100,7:111,8:98,9:101},extractor:null},{name:"PostScript",extension:"ps",mime:"application/postscript",description:"",signature:{0:37,1:33},extractor:null},{name:"Encapsulated PostScript",extension:"eps,ai",mime:"application/eps",description:"",signature:{0:197,1:208,2:211,3:198},extractor:null},{name:"Rich Text Format",extension:"rtf",mime:"application/rtf",description:"",signature:{0:123,1:92,2:114,3:116},extractor:function(e,t){var r=new oe(e.slice(t)),n=0;if(123!==r.readInt(1))throw new Error("Not a valid RTF file");for(n++;n>0&&r.hasMore();)switch(r.readInt(1)){case 123:n++;break;case 125:n--;break;case 92:r.consumeIf(92),r.position++}return r.carve()}},{name:"Microsoft Office document/OLE2",extension:"ole2,doc,xls,dot,ppt,xla,ppa,pps,pot,msi,sdw,db,vsd,msg",mime:"application/msword,application/vnd.ms-excel,application/vnd.ms-powerpoint",description:"Microsoft Office documents",signature:{0:208,1:207,2:17,3:224,4:161,5:177,6:26,7:225},extractor:null},{name:"Microsoft Office document/OLE2 (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:48,1:77,2:56,3:82,4:52,5:75,6:71,7:120},extractor:null},{name:"Microsoft Office 2007+ document",extension:"docx,xlsx,pptx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation",description:"",signature:{38:95,39:84,40:121,41:112,42:101,43:115,44:93,45:46,46:120,47:109,48:108},extractor:ce},{name:"Microsoft Access database",extension:"mdb,mda,mde,mdt,fdb,psa",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:74,14:101,15:116},extractor:null},{name:"Microsoft Access 2007+ database",extension:"accdb,accde,accda,accdu",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:65,14:67,15:69,16:32},extractor:null},{name:"Microsoft OneNote document",extension:"one",mime:"application/onenote",description:"",signature:{0:228,1:82,2:92,3:123,4:140,5:216,6:167,7:77,8:174,9:177,10:83,11:120,12:208,13:41,14:150,15:211},extractor:null},{name:"Outlook Express database",extension:"dbx",mime:"application/octet-stream",description:"",signature:{0:207,1:173,2:18,3:254,4:[48,197,198,199],11:17},extractor:null},{name:"Personal Storage Table (Outlook)",extension:"pst,ost,fdb,pab",mime:"application/octet-stream",description:"",signature:{0:33,1:66,2:68,3:78},extractor:null},{name:"Microsoft Exchange Database",extension:"edb",mime:"application/octet-stream",description:"",signature:{4:239,5:205,6:171,7:137,8:[32,35],9:6,10:0,11:0,12:[0,1],13:0,14:0,15:0},extractor:null},{name:"WordPerfect document",extension:"wpd,wp,wp5,wp6,wpp,bk!,wcm",mime:"application/wordperfect",description:"",signature:{0:255,1:87,2:80,3:67,7:[0,1,2],8:1,9:10},extractor:null},{name:"EPUB e-book",extension:"epub",mime:"application/epub+zip",description:"",signature:{0:80,1:75,2:3,3:4,30:109,31:105,32:109,33:101,34:116,35:121,36:112,37:101,38:97,39:112,40:112,41:108,42:105,43:99,44:97,45:116,46:105,47:111,48:110,49:47,50:101,51:112,52:117,53:98,54:43,55:122,56:105,57:112},extractor:ce}],Applications:[{name:"Windows Portable Executable",extension:"exe,dll,drv,vxd,sys,ocx,vbx,com,fon,scr",mime:"application/vnd.microsoft.portable-executable",description:"",signature:{0:77,1:90,3:[0,1,2],5:[0,1,2]},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(60);var n=r.readInt(4,"le");r.moveTo(n),r.moveForwardsBy(6);var i=r.readInt(2,"le");r.moveForwardsBy(16);var o=523===r.readInt(2,"le")?112:96;r.moveForwardsBy(o-2),r.moveForwardsBy(32);var s=r.readInt(4,"le"),a=r.readInt(4,"le");if(s>0)return r.moveTo(s+a),r.carve();r.moveForwardsBy(88),r.moveForwardsBy(40*(i-1)),r.moveForwardsBy(16);var u=r.readInt(4,"le"),c=r.readInt(4,"le");return r.moveTo(c+u),r.carve()}},{name:"Executable and Linkable Format",extension:"elf,bin,axf,o,prx,so",mime:"application/x-executable",description:"Executable and Linkable Format file. No standard file extension.",signature:{0:127,1:69,2:76,3:70},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(4);var n=1===r.readInt(1),i=1===r.readInt(1)?"le":"be";r.moveForwardsBy(n?26:34);var o=n?r.readInt(4,i):r.readInt(8,i);r.moveForwardsBy(10);var s=r.readInt(2,i),a=r.readInt(2,i);return r.moveTo(o),r.moveForwardsBy(s*a),r.carve()}},{name:"MacOS Mach-O object",extension:"dylib",mime:"application/octet-stream",description:"",signature:[{0:202,1:254,2:186,3:190,4:0,5:0,6:0,7:[1,2,3]},{0:206,1:250,2:237,3:254,4:7,5:0,6:0,7:0,8:[1,2,3]}],extractor:fe},{name:"MacOS Mach-O 64-bit object",extension:"dylib",mime:"application/octet-stream",description:"",signature:{0:207,1:250,2:237,3:254},extractor:fe},{name:"Adobe Flash",extension:"swf",mime:"application/x-shockwave-flash",description:"",signature:{0:[67,70],1:87,2:83},extractor:null},{name:"Java Class",extension:"class",mime:"application/java-vm",description:"",signature:{0:202,1:254,2:186,3:190},extractor:null},{name:"Dalvik Executable",extension:"dex",mime:"application/octet-stream",description:"Dalvik Executable as used by Android",signature:{0:100,1:101,2:120,3:10,4:48,5:51,6:53,7:0},extractor:null},{name:"Google Chrome Extension",extension:"crx",mime:"application/crx",description:"Google Chrome extension or packaged app",signature:{0:67,1:114,2:50,3:52},extractor:null}],Archives:[{name:"PKZIP archive",extension:"zip",mime:"application/zip",description:"",signature:{0:80,1:75,2:[3,5,7],3:[4,6,8]},extractor:ce},{name:"PKZIP archive (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:85,1:69,2:115,3:68,4:66,5:66},extractor:null},{name:"TAR archive",extension:"tar",mime:"application/x-tar",description:"",signature:{257:117,258:115,259:116,260:97,261:114},extractor:function(e,t){for(var r=new oe(e.slice(t)),n=function(){if(r.moveForwardsBy(257),r.getBytes(5).join("")!==[117,115,116,97,114].join(""))return r.moveBackwardsBy(262),1;r.moveBackwardsBy(138);var e=0;r.getBytes(11).forEach((function(t,r){e+=(t-48).toString()})),e=512*Math.ceil(parseInt(e,8)/512),r.moveForwardsBy(e+377)};r.hasMore()&&!n(););return r.consumeWhile(0),r.carve()}},{name:"Roshal Archive",extension:"rar",mime:"application/x-rar-compressed",description:"",signature:{0:82,1:97,2:114,3:33,4:26,5:7,6:[0,1]},extractor:null},{name:"Gzip",extension:"gz",mime:"application/gzip",description:"",signature:{0:31,1:139,2:8},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(3);var n=r.readInt(1);if(r.moveForwardsBy(4),r.readInt(1),r.moveForwardsBy(1),4&n){var i=r.readInt(2,"le");r.moveForwardsby(i)}return 8&n&&(r.continueUntil(0),r.moveForwardsBy(1)),16&n&&(r.continueUntil(0),r.moveForwardsBy(1)),2&n&&r.moveForwardsBy(2),ge(r),r.moveForwardsBy(8),r.carve()}},{name:"Bzip2",extension:"bz2",mime:"application/x-bzip2",description:"",signature:{0:66,1:90,2:104},extractor:function(e,t){for(var r=new oe(e.slice(t)),n=[[119,36,83,133,9],[238,72,167,10,18],[220,145,78,20,36],[185,34,156,40,72],[114,69,56,80,144],[187,146,41,194,132],[93,201,20,225,66],[46,228,138,112,161],[23,114,69,56,80]],i=0;i<n.length&&(r.continueUntil(n[i]),r.getBytes(5).join("")!==n[i].join(""));i++)r.moveTo(0);return r.moveForwardsBy(4),r.carve()}},{name:"7zip",extension:"7z",mime:"application/x-7z-compressed",description:"",signature:{0:55,1:122,2:188,3:175,4:39,5:28},extractor:null},{name:"Zlib Deflate",extension:"zlib",mime:"application/x-deflate",description:"",signature:{0:120,1:[1,156,218,94]},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveForwardsBy(1),32&r.readInt(1)&&r.moveForwardsBy(4),ge(r),r.moveForwardsBy(4),r.carve()}},{name:"xz compression",extension:"xz",mime:"application/x-xz",description:"",signature:{0:253,1:55,2:122,3:88,4:90,5:0},extractor:function(e,t){var r=new oe(e.slice(t));return r.continueUntil([0,0,0,0,4,89,90]),r.moveForwardsBy(7),r.carve()}},{name:"Tarball",extension:"tar.z",mime:"application/x-gtar",description:"",signature:{0:31,1:[157,160]},extractor:null},{name:"ISO disk image",extension:"iso",mime:"application/octet-stream",description:"ISO 9660 CD/DVD image file",signature:[{32769:67,32770:68,32771:48,32772:48,32773:49},{34817:67,34818:68,34819:48,34820:48,34821:49},{36865:67,36866:68,36867:48,36868:48,36869:49}],extractor:null},{name:"Virtual Machine Disk",extension:"vmdk",mime:"application/vmdk,application/x-virtualbox-vmdk",description:"",signature:{0:75,1:68,2:77,3:86,5:0,6:0,7:0},extractor:null},{name:"Virtual Hard Drive",extension:"vhd",mime:"application/x-vhd",description:"",signature:{0:99,1:111,2:110,3:101,4:99,5:116,6:105,7:120},extractor:null},{name:"Macintosh disk image",extension:"dmf,dmg",mime:"application/octet-stream",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96,7:96},extractor:null},{name:"ARJ Archive",extension:"arj",mime:"application/x-arj-compressed",description:"",signature:{0:96,1:234,8:[0,16,20],9:0,10:2},extractor:null},{name:"WinAce Archive",extension:"ace",mime:"application/x-ace-compressed",description:"",signature:{7:42,8:42,9:65,10:67,11:69,12:42,13:42},extractor:null},{name:"Macintosh BinHex Encoded File",extension:"hqx",mime:"application/mac-binhex",description:"",signature:{11:109,12:117,13:115,14:116,15:32,16:98,17:101,18:32,19:99,20:111,21:110,22:118,23:101,24:114,25:116,26:101,27:100,28:32,29:119,30:105,31:116,32:104,33:32,34:66,35:105,36:110,37:72,38:101,39:120},extractor:null},{name:"ALZip Archive",extension:"alz",mime:"application/octet-stream",description:"",signature:{0:65,1:76,2:90,3:1,4:10,5:0,6:0,7:0},extractor:null},{name:"KGB Compressed Archive",extension:"kgb",mime:"application/x-kgb-compressed",description:"",signature:{0:75,1:71,2:66,3:95,4:97,5:114,6:99,7:104,8:32,9:45},extractor:null},{name:"Microsoft Cabinet",extension:"cab",mime:"vnd.ms-cab-compressed",description:"",signature:{0:77,1:83,2:67,3:70,4:0,5:0,6:0,7:0},extractor:null},{name:"Jar Archive",extension:"jar",mime:"application/java-archive",description:"",signature:{0:95,1:39,2:168,3:137},extractor:null},{name:"Jar Archive",extension:"jar",mime:"application/java-archive",description:"",signature:{0:80,1:75,2:3,3:4,4:20,5:0,6:8,7:0,8:8,9:0},extractor:ce},{name:"lzop compressed",extension:"lzop,lzo",mime:"application/x-lzop",description:"",signature:{0:137,1:76,2:90,3:79,4:0,5:13,6:10,7:26},extractor:function(e,t){var r=new oe(e.slice(t)),n=0,i=0;r.moveForwardsBy(9);var o=r.readInt(2,"be");r.moveForwardsBy(6);var s=r.readInt(4,"be");2048&o&&r.moveForwardsBy(4),2&s&&n++,512&s&&n++,1&s&&i++,256&s&&i++,r.moveForwardsBy(8),o>=2368&&r.moveForwardsBy(4);var a=r.readInt(1,"be");if(r.moveForwardsBy(a),64&s){var u=r.readInt(4,"be");r.moveForwardsBy(u)}for(r.moveForwardsBy(4);r.hasMore();){var c=r.readInt(4,"be");if(0===c)break;var f=r.readInt(4,"be"),l=c===f?i:i+n;r.moveForwardsBy(f+4*l)}return r.carve()}},{name:"Linux deb package",extension:"deb",mime:"application/vnd.debian.binary-package",description:"",signature:{0:33,1:60,2:97,3:114,4:99,5:104,6:62},extractor:function(e,t){var r=new oe(e.slice(t));for(r.moveForwardsBy(8);r.hasMore();){r.moveForwardsBy(48);var n,i="",o=se(r.getBytes(10));try{for(o.s();!(n=o.n()).done;){var s=n.value;i+=String.fromCharCode(s)}}catch(e){o.e(e)}finally{o.f()}i=parseInt(i.trim(),10),r.moveForwardsBy(2),r.moveForwardsBy(i)}return r.carve()}},{name:"Apple Disk Image",extension:"dmg",mime:"application/x-apple-diskimage",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96},extractor:null}],Miscellaneous:[{name:"UTF-8 text",extension:"txt",mime:"text/plain",description:"UTF-8 encoded Unicode byte order mark, commonly but not exclusively seen in text files.",signature:{0:239,1:187,2:191},extractor:null},{name:"UTF-32 LE text",extension:"utf32le",mime:"charset/utf32le",description:"Little-endian UTF-32 encoded Unicode byte order mark.",signature:{0:255,1:254,2:0,3:0},extractor:null},{name:"UTF-16 LE text",extension:"utf16le",mime:"charset/utf16le",description:"Little-endian UTF-16 encoded Unicode byte order mark.",signature:{0:255,1:254},extractor:null},{name:"Web Open Font Format",extension:"woff",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:70,4:0,5:1,6:0,7:0},extractor:null},{name:"Web Open Font Format 2",extension:"woff2",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:50,4:0,5:1,6:0,7:0},extractor:null},{name:"Embedded OpenType font",extension:"eot",mime:"application/octet-stream",description:"",signature:[{8:2,9:0,10:1,34:76,35:80},{8:1,9:0,10:0,34:76,35:80},{8:2,9:0,10:2,34:76,35:80}],extractor:null},{name:"TrueType Font",extension:"ttf",mime:"application/font-sfnt",description:"",signature:{0:0,1:1,2:0,3:0,4:0},extractor:null},{name:"OpenType Font",extension:"otf",mime:"application/font-sfnt",description:"",signature:{0:79,1:84,2:84,3:79,4:0},extractor:null},{name:"SQLite",extension:"sqlite",mime:"application/x-sqlite3",description:"",signature:{0:83,1:81,2:76,3:105},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(16);var n=r.readInt(2);r.moveTo(28);var i=r.readInt(4);return r.moveTo(n*i),r.carve()}},{name:"BitTorrent link",extension:"torrent",mime:"application/x-bittorrent",description:"",signature:[{0:100,1:56,2:58,3:97,4:110,5:110,6:111,7:117,8:110,9:99,10:101,11:35,12:35,13:58},{0:100,1:52,2:58,3:105,4:110,5:102,6:111,7:100,8:[52,53,54],9:58}],extractor:null},{name:"Cryptocurrency wallet",extension:"wallet",mime:"application/octet-stream",description:"",signature:{0:0,1:0,2:0,3:0,4:1,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:98,13:49,14:5,15:0},extractor:null},{name:"Registry fragment",extension:"hbin",mime:"application/octet-stream",description:"",signature:{0:104,1:98,2:105,3:110,4:0},extractor:null},{name:"Registry script",extension:"rgs",mime:"application/octet-stream",description:"",signature:{0:72,1:75,2:67,3:82,4:13,5:10,6:92,7:123},extractor:null},{name:"WinNT Registry Hive",extension:"registry",mime:"application/octet-stream",description:"",signature:{0:114,1:101,2:103,3:102},extractor:null},{name:"Windows Event Log",extension:"evt",mime:"application/octet-stream",description:"",signature:{0:48,1:0,2:0,3:0,4:76,5:102,6:76,7:101},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(20);var n=r.readInt(4,"le");r.moveTo(n);var i=r.readInt(4,"le");return r.moveForwardsBy(i-4),r.carve()}},{name:"Windows Event Log",extension:"evtx",mime:"application/octet-stream",description:"",signature:{0:69,1:108,2:102,3:70,4:105,5:108,6:101},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(40);var n=r.readInt(4,"le")-44;for(r.moveForwardsBy(n);r.hasMore()&&r.getBytes(7).join("")===[69,108,102,67,104,110,107].join("");)r.moveForwardsBy(65529);return r.consumeWhile(0),r.carve()}},{name:"Windows Pagedump",extension:"dmp",mime:"application/octet-stream",description:"",signature:{0:80,1:65,2:71,3:69,4:68,5:85,6:[77,54],7:[80,52]},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(112),r.moveTo(4096*(r.readInt(4,"le")+1)),r.carve()}},{name:"Windows Prefetch",extension:"pf",mime:"application/x-pf",description:"",signature:{0:[17,23,26],1:0,2:0,3:0,4:83,5:67,6:67,7:65},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(12),r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"Windows Prefetch (Win 10)",extension:"pf",mime:"application/x-pf",description:"",signature:{0:77,1:65,2:77,3:4,7:0},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"PList (XML)",extension:"plist",mime:"application/xml",description:"",signature:{39:60,40:33,41:68,42:79,43:67,44:84,45:89,46:80,47:69,48:32,49:112,50:108,51:105,52:115,53:116},extractor:function(e,t){var r=new oe(e.slice(t)),n=0;for(r.continueUntil([60,112,108,105,115,116]),r.moveForwardsBy(6),n++;n>0&&r.hasMore();)60===r.readInt(1)&&(r.getBytes(5).join("")===[112,108,105,115,116].join("")?n++:r.moveBackwardsBy(5),r.getBytes(7).join("")===[47,112,108,105,115,116,62].join("")?n--:r.moveBackwardsBy(7));return r.consumeIf(10),r.carve()}},{name:"PList (binary)",extension:"bplist,plist,ipmeta,abcdp,mdbackup,mdinfo,strings,nib,ichat,qtz,webbookmark,webhistory",mime:"application/x-plist",description:"",signature:{0:98,1:112,2:108,3:105,4:115,5:116,6:48,7:48},extractor:null},{name:"MacOS X Keychain",extension:"keychain",mime:"application/octet-stream",description:"",signature:{0:107,1:121,2:99,3:104,4:0,5:1},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(20),r.moveForwardsBy(r.readInt(4)),r.carve()}},{name:"TCP Packet",extension:"tcp",mime:"application/tcp",description:"",signature:{12:8,13:0,14:69,15:0,21:0,22:function(e){return e>=1&&e<=128},23:6},extractor:null},{name:"UDP Packet",extension:"udp",mime:"application/udp",description:"",signature:{12:8,13:0,14:69,15:0,16:[0,1,2,3,4,5],22:function(e){return e>=1&&e<=128},23:17},extractor:null},{name:"Compiled HTML",extension:"chm,chw,chi",mime:"application/vnd.ms-htmlhelp",description:"",signature:{0:73,1:84,2:83,3:70,4:3,5:0,6:0,7:0},extractor:null},{name:"Windows Password",extension:"pwl",mime:"application/octet-stream",description:"",signature:{0:227,1:130,2:133,3:150},extractor:null},{name:"Bitlocker recovery key",extension:"bitlocker",mime:"application/octet-stream",description:"",signature:{0:255,1:254,2:66,3:0,4:105,5:0,6:116,7:0,8:76,9:0,10:111,11:0,12:99,13:0,14:107,15:0,16:101,17:0,18:114,19:0,20:32,21:0},extractor:null},{name:"Certificate",extension:"cer,cat,p7b,p7c,p7m,p7s,swz,rsa,crl,crt,der",mime:"application/pkix-cert",description:"",signature:{0:48,1:130,4:[6,10,48]},extractor:null},{name:"Certificate",extension:"cat,swz,p7m",mime:"application/vnd.ms-pki.seccat",description:"",signature:{0:48,1:131,2:function(e){return 0!==e},5:6,6:9},extractor:null},{name:"PGP pubring",extension:"pkr,gpg",mime:"application/pgp-keys",description:"",signature:{0:153,1:1,2:[13,162],3:4},extractor:null},{name:"PGP secring",extension:"skr",mime:"application/pgp-keys",description:"",signature:[{0:149,1:1,2:207,3:4},{0:149,1:3,2:198,3:4},{0:149,1:5,2:134,3:4}],extractor:null},{name:"PGP Safe",extension:"pgd",mime:"application/pgp-keys",description:"",signature:{0:80,1:71,2:80,3:100,4:77,5:65,6:73,7:78,8:96,9:1,10:0},extractor:null},{name:"Task Scheduler",extension:"job",mime:"application/octet-stream",description:"",signature:{0:[0,1,2,3],1:[5,6],2:1,3:0,20:70,21:0},extractor:null},{name:"Windows Shortcut",extension:"lnk",mime:"application/x-ms-shortcut",description:"",signature:{0:76,1:0,2:0,3:0,4:1,5:20,6:2,7:0,8:0,9:0,10:0,11:0,12:192,13:0,14:0,15:0,16:0,17:0,18:0,19:70},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(52),r.moveTo(r.readInt(4,"le")),r.carve()}},{name:"Bash",extension:"bash",mime:"application/bash",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:98,8:97,9:115,10:104},extractor:null},{name:"Shell",extension:"sh",mime:"application/sh",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:115,8:104},extractor:null},{name:"Python",extension:"py,pyc,pyd,pyo,pyw,pyz",mime:"application/python",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:121,13:116,14:104,15:111,16:110,17:[50,51,10,13]},extractor:null},{name:"Ruby",extension:"rb",mime:"application/ruby",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:114,12:117,13:98,14:121},extractor:null},{name:"perl",extension:"pl,pm,t,pod",mime:"application/perl",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:101,13:114,14:108},extractor:null},{name:"php",extension:"php,phtml,php3,php4,php5,php7,phps,php-s,pht,phar",mime:"application/php",description:"",signature:{0:60,1:63,2:112,3:104,4:112},extractor:null},{name:"Smile",extension:"sml",mime:"\tapplication/x-jackson-smile",description:"",signature:{0:58,1:41,2:10},extractor:null},{name:"Lua Bytecode",extension:"luac",mime:"application/x-lua",description:"",signature:{0:27,1:76,2:117,3:97},extractor:null},{name:"WebAssembly binary",extension:"wasm",mime:"application/octet-stream",description:"",signature:{0:0,1:97,2:115,3:109},extractor:null}]};function ce(e,t){var r=new oe(e.slice(t));r.continueUntil([80,75,5,6]),r.moveForwardsBy(20);var n=r.readInt(2,"le");return r.moveForwardsBy(n),r.carve()}function fe(e,t){var r="207250237254",n=new oe(e.slice(t)),i=n.getBytes(4).join("");return n.moveTo(function(e,t,r){var n=28;t&&(n+=4),e.moveTo(16);var i=e.readInt(4,r);return function(e,t,r,n){for(var i=0,o=0;o<n;o++){e.moveTo(t);var s=e.readInt(4,r);25===s?(e.moveTo(t+48),i+=e.readInt(8,r),e.moveTo(t+4),t+=e.readInt(4,r)):1===s&&(e.moveTo(t+36),i+=e.readInt(4,r),e.moveTo(t+4),t+=e.readInt(4,r))}return i}(e,n,r,i)}(n,function(e){return e===r||"254237250207"===e}(i),function(e){return"206250237254"===e||e===r}(i)?"le":"be")),n.carve()}for(var le=new Array(288),he=0;he<le.length;he++)le[he]=he<=143?8:he<=255?9:he<=279?7:8;var pe=_e(le),de=_e(new Array(30).fill(5)),ye=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function ge(e){for(var t=0;!t;){t=e.readBits(1,"le");var r=e.readBits(2,"le");if(0===r){e.moveForwardsBy(1);var n=e.readInt(2,"le");e.moveForwardsBy(2+n)}else if(1===r)be(e,pe,de);else{if(2!==r)throw new Error(`Invalid block type while parsing DEFLATE stream at pos ${e.position}`);for(var i=e.readBits(5,"le")+257,o=e.readBits(5,"le")+1,s=e.readBits(4,"le")+4,a=new Uint8Array(ye.length),u=0;u<s;u++)a[ye[u]]=e.readBits(3,"le");for(var c=_e(a),f=new Uint8Array(i+o),l=void 0,h=void 0,p=void 0,d=0;d<i+o;)switch(l=we(e,c)){case 16:for(h=3+e.readBits(2,"le");h--;)f[d++]=p;break;case 17:for(h=3+e.readBits(3,"le");h--;)f[d++]=0;p=0;break;case 18:for(h=11+e.readBits(7,"le");h--;)f[d++]=0;p=0;break;default:f[d++]=l,p=l}be(e,_e(f.subarray(0,i)),_e(f.subarray(i)))}}e.bitPos>0&&e.moveForwardsBy(1)}var me=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],ve=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function be(e,t,r){for(var n,i=0;(n=we(e,t))&&256!==n;){if(++i>1e4)throw new Error("Caught in probable infinite loop while parsing Huffman Block");n<256||(e.readBits(me[n-257],"le"),n=we(e,r),e.readBits(ve[n],"le"))}}function _e(e){for(var t=Math.max.apply(Math,e),r=Math.min.apply(Math,e),n=1<<t,i=new Uint32Array(n),o=1,s=0,a=2;o<=t;){for(var u=0;u<e.length;u++)if(e[u]===o){var c=void 0,f=void 0,l=void 0;for(c=0,f=s,l=0;l<o;l++)c=c<<1|1&f,f>>=1;for(var h=o<<16|u,p=c;p<n;p+=a)i[p]=h;s++}o++,s<<=1,a<<=1}return[i,t,r]}function we(e,t){var r,n,i=(n=2,function(e){if(Array.isArray(e))return e}(r=t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(r,n)||y(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[0],s=i[1],a=o[e.readBits(s,"le")&(1<<s)-1],u=a>>>16;if(u>s)throw new Error(`Invalid Huffman Code length while parsing DEFLATE block at pos ${e.position}: ${u}`);return e.moveBackwardsByBits(s-u),65535&a}function Ee(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.length){for(var n=0;n<e.length;n++)if(xe(e[n],t,r))return!0;return!1}return xe(e,t,r)}function xe(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;for(var n in e){var i=parseInt(n,10)+r;switch(typeof e[n]){case"number":if(t[i]!==e[n])return!1;break;case"object":if(e[n].indexOf(t[i])<0)return!1;break;case"function":if(!e[n](t[i]))return!1;break;default:throw new Error(`Unrecognised signature type at offset ${n}`)}}return!0}const Be=function(){return o((function t(){e(this,t)}),null,[{key:"checkForValue",value:function(e){if(void 0===e)throw new Error("only use translation methods with .bind")}},{key:"toArrayBuffer",value:function(){throw new Error("toArrayBuffer has not been implemented")}},{key:"fromArrayBuffer",value:function(){throw new Error("fromArrayBuffer has not been implemented")}}])}();function Ae(e,t,r){return t=a(t),s(e,Se()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function Se(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Se=function(){return!!e})()}const ke=function(t){function r(){return e(this,r),Ae(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=new Uint8Array(this.value).buffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=Array.prototype.slice.call(new Uint8Array(this.value))}}])}(Be);function Te(e,t,r){return t=a(t),s(e,Oe()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function Oe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Oe=function(){return!!e})()}const Ie=function(t){function r(){return e(this,r),Te(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=ie.isBigNumber(this.value)?U.strToArrayBuffer(this.value.toFixed()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value);try{this.value=new ie(U.arrayBufferToStr(this.value))}catch(e){this.value=new ie(NaN)}}}])}(Be);function Ne(e,t,r){return t=a(t),s(e,Fe()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function Fe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fe=function(){return!!e})()}const Re=function(t){function r(){return e(this,r),Ne(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){var e=this;if(r.checkForValue(this.value),!F())return new Promise((function(t,r){U.readFile(e.value).then((function(t){return e.value=t.buffer})).then(t).catch(r)}));this.value=U.readFileSync(this.value)}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=new File(this.value,"unknown")}}])}(Be);function Le(e,t,r){return t=a(t),s(e,Ue()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function Ue(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ue=function(){return!!e})()}const Ce=function(t){function r(){return e(this,r),Le(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?U.strToArrayBuffer(this.value):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?U.arrayBufferToStr(this.value):""}}])}(Be);function je(e,t,r){return t=a(t),s(e,De()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function De(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(De=function(){return!!e})()}const Me=function(t){function r(){return e(this,r),je(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?U.strToArrayBuffer(U.unescapeHtml(U.stripHtmlTags(this.value,!0))):new ArrayBuffer}}])}(Ce);function Pe(e,t,r){return t=a(t),s(e,ze()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function ze(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ze=function(){return!!e})()}const $e=function(t){function r(){return e(this,r),Pe(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=void 0!==this.value?U.strToArrayBuffer(JSON.stringify(this.value,null,4)):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=JSON.parse(U.arrayBufferToStr(this.value))}}])}(Be);function He(e,t,r){return t=a(t),s(e,Ve()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function Ve(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ve=function(){return!!e})()}const Ze=function(t){function r(){return e(this,r),He(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:(i=l(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.checkForValue(this.value),!F()){e.next=5;break}this.value=this.value.map((function(e){return Uint8Array.from(e.data)})),e.next=8;break;case 5:return e.next=7,r.concatenateTypedArraysWithTypedElements.apply(r,g(this.value));case 7:this.value=e.sent;case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=[new File(this.value,"unknown")]}},{key:"concatenateTypedArraysWithTypedElements",value:(n=l(p().mark((function e(){var t,r,n,i,o,s,a,u,c,f,l,h,d,y=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=0,r=y.length,n=new Array(r),i=0;i<r;i++)n[i]=y[i];for(o=0,s=n;o<s.length;o++)a=s[o],t+=a.size;u=new Uint8Array(t),c=0,f=0,l=n;case 6:if(!(f<l.length)){e.next=16;break}return h=l[f],e.next=10,U.readFile(h);case 10:d=e.sent,u.set(d,c),c+=d.length;case 13:f++,e.next=6;break;case 16:return e.abrupt("return",u);case 17:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"concatenateTypedArrays",value:function(){for(var e=0,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0,o=r;i<o.length;i++)e+=o[i].length;for(var s=new Uint8Array(e),a=0,u=0,c=r;u<c.length;u++){var f=c[u];s.set(f,a),a+=f.length}return s}}]);var n,i}(Be);function qe(e,t,r){return t=a(t),s(e,Ge()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function Ge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ge=function(){return!!e})()}const Je=function(t){function r(){return e(this,r),qe(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value="number"==typeof this.value?U.strToArrayBuffer(this.value.toString()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?parseFloat(U.arrayBufferToStr(this.value)):0}}])}(Be);var We=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e(this,t),this.value=new ArrayBuffer(0),this.type=t.ARRAY_BUFFER,r&&Object.prototype.hasOwnProperty.call(r,"value")&&Object.prototype.hasOwnProperty.call(r,"type"))this.set(r.value,r.type);else if(r&&null!==n)this.set(r,n);else if(r){var i=t.typeEnum(r.constructor.name);this.set(r,i)}}return o(t,[{key:"get",value:function(e){var r=this;return"string"==typeof e&&(e=t.typeEnum(e)),this.type!==e?F()?(this._translate(e),this.value):new Promise((function(t,n){r._translate(e).then((function(){t(r.value)})).catch(n)})):this.value}},{key:"set",value:function(e,r){if("string"==typeof r&&(r=t.typeEnum(r)),v().debug("Dish type: "+t.enumLookup(r)),this.value=e,this.type=r,!this.valid()){var n=U.truncate(JSON.stringify(this.value),25);throw new D(`Data is not a valid ${t.enumLookup(r)}: ${n}`)}}},{key:"presentAs",value:function(e){return this.clone().get(e)}},{key:"detectDishType",value:function(){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.keys(ue);if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e&&e.length>1))return[];var r=[],n={};for(var i in ue)t.includes(i)&&(n[i]=ue[i]);for(var o in n)n[o].forEach((function(t){Ee(t.signature,e)&&r.push(t)}));return r}(new Uint8Array(this.value.slice(0,2048)));return e.length&&e[0].mime&&"text/plain"===e[0].mime?e[0].mime:null}},{key:"getTitle",value:(r=l(p().mark((function e(r){var n,i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n="",e.t0=this.type,e.next=e.t0===t.FILE?4:e.t0===t.LIST_FILE?6:e.t0===t.JSON?8:e.t0===t.NUMBER||e.t0===t.BIG_NUMBER?10:e.t0===t.ARRAY_BUFFER||e.t0===t.BYTE_ARRAY?12:15;break;case 4:return n=this.value.name,e.abrupt("break",26);case 6:return n=`${this.value.length} file(s)`,e.abrupt("break",26);case 8:return n="application/json",e.abrupt("break",26);case 10:return n=this.value.toString(),e.abrupt("break",26);case 12:if(null===(n=this.detectDishType())){e.next=15;break}return e.abrupt("break",26);case 15:return e.prev=15,(i=this.clone()).value=i.value.slice(0,256),e.next=20,i.get(t.STRING);case 20:n=e.sent,e.next=26;break;case 23:e.prev=23,e.t1=e.catch(15),v().error(`${t.enumLookup(this.type)} cannot be sliced. ${e.t1}`);case 26:return e.abrupt("return",n.slice(0,r));case 27:case"end":return e.stop()}}),e,this,[[15,23]])}))),function(e){return r.apply(this,arguments)})},{key:"valid",value:function(){switch(this.type){case t.BYTE_ARRAY:if(!(this.value instanceof Uint8Array||this.value instanceof Array))return!1;for(var e=0;e<this.value.length;e++)if("number"!=typeof this.value[e]||this.value[e]<0||this.value[e]>255)return!1;return!0;case t.STRING:case t.HTML:return"string"==typeof this.value;case t.NUMBER:return"number"==typeof this.value;case t.ARRAY_BUFFER:return this.value instanceof ArrayBuffer;case t.BIG_NUMBER:if(ie.isBigNumber(this.value))return!0;if(Object.keys(this.value).sort().equals(["c","e","s"])){var r=new ie;return r.c=this.value.c,r.e=this.value.e,r.s=this.value.s,this.value=r,!0}return!1;case t.JSON:return!0;case t.FILE:return this.value instanceof File;case t.LIST_FILE:return this.value instanceof Array&&this.value.reduce((function(e,t){return e&&t instanceof File}),!0);default:return!1}}},{key:"size",get:function(){switch(this.type){case t.BYTE_ARRAY:case t.STRING:case t.HTML:return this.value.length;case t.NUMBER:case t.BIG_NUMBER:return this.value.toString().length;case t.ARRAY_BUFFER:return this.value.byteLength;case t.JSON:return JSON.stringify(this.value).length;case t.FILE:return this.value.size;case t.LIST_FILE:return this.value.reduce((function(e,t){return e+t.size}),0);default:return-1}}},{key:"clone",value:function(){var e=new t;switch(this.type){case t.STRING:case t.HTML:case t.NUMBER:case t.BIG_NUMBER:e.set(this.value,this.type);break;case t.BYTE_ARRAY:case t.JSON:e.set(JSON.parse(JSON.stringify(this.value)),this.type);break;case t.ARRAY_BUFFER:e.set(this.value.slice(0),this.type);break;case t.FILE:e.set(new File([this.value],this.value.name,{type:this.value.type,lastModified:this.value.lastModified}),this.type);break;case t.LIST_FILE:e.set(this.value.map((function(e){return new File([e],e.name,{type:e.type,lastModified:e.lastModified})})),this.type);break;default:throw new D("Cannot clone Dish, unknown type")}return e}},{key:"_translate",value:function(e){var r=this;if(v().debug(`Translating Dish from ${t.enumLookup(this.type)} to ${t.enumLookup(e)}`),!F())return new Promise((function(n,i){r._toArrayBuffer().then((function(){return r.type=t.ARRAY_BUFFER})).then((function(){r._fromArrayBuffer(e),n()})).catch(i)}));this._toArrayBuffer(),this.type=t.ARRAY_BUFFER,this._fromArrayBuffer(e)}},{key:"_toArrayBuffer",value:function(){var e=this,r={browser:{[t.STRING]:function(){return Promise.resolve(Ce.toArrayBuffer.bind(e)())},[t.NUMBER]:function(){return Promise.resolve(Je.toArrayBuffer.bind(e)())},[t.HTML]:function(){return Promise.resolve(Me.toArrayBuffer.bind(e)())},[t.ARRAY_BUFFER]:function(){return Promise.resolve()},[t.BIG_NUMBER]:function(){return Promise.resolve(Ie.toArrayBuffer.bind(e)())},[t.JSON]:function(){return Promise.resolve($e.toArrayBuffer.bind(e)())},[t.FILE]:function(){return Re.toArrayBuffer.bind(e)()},[t.LIST_FILE]:function(){return Promise.resolve(Ze.toArrayBuffer.bind(e)())},[t.BYTE_ARRAY]:function(){return Promise.resolve(ke.toArrayBuffer.bind(e)())}},node:{[t.STRING]:function(){return Ce.toArrayBuffer.bind(e)()},[t.NUMBER]:function(){return Je.toArrayBuffer.bind(e)()},[t.HTML]:function(){return Me.toArrayBuffer.bind(e)()},[t.ARRAY_BUFFER]:function(){},[t.BIG_NUMBER]:function(){return Ie.toArrayBuffer.bind(e)()},[t.JSON]:function(){return $e.toArrayBuffer.bind(e)()},[t.FILE]:function(){return Re.toArrayBuffer.bind(e)()},[t.LIST_FILE]:function(){return Ze.toArrayBuffer.bind(e)()},[t.BYTE_ARRAY]:function(){return ke.toArrayBuffer.bind(e)()}}};try{return r[F()?"node":"browser"][this.type]()}catch(e){throw new D(`Error translating from ${t.enumLookup(this.type)} to ArrayBuffer: ${e}`)}}},{key:"_fromArrayBuffer",value:function(e){var r=this,n={[t.STRING]:function(){return Ce.fromArrayBuffer.bind(r)()},[t.NUMBER]:function(){return Je.fromArrayBuffer.bind(r)()},[t.HTML]:function(){return Me.fromArrayBuffer.bind(r)()},[t.ARRAY_BUFFER]:function(){},[t.BIG_NUMBER]:function(){return Ie.fromArrayBuffer.bind(r)()},[t.JSON]:function(){return $e.fromArrayBuffer.bind(r)()},[t.FILE]:function(){return Re.fromArrayBuffer.bind(r)()},[t.LIST_FILE]:function(){return Ze.fromArrayBuffer.bind(r)()},[t.BYTE_ARRAY]:function(){return ke.fromArrayBuffer.bind(r)()}};try{n[e](),this.type=e}catch(r){throw new D(`Error translating from ArrayBuffer to ${t.enumLookup(e)}: ${r}`)}}}],[{key:"typeEnum",value:function(e){switch(e.toLowerCase()){case"bytearray":case"byte array":return t.BYTE_ARRAY;case"string":return t.STRING;case"number":return t.NUMBER;case"html":return t.HTML;case"arraybuffer":case"array buffer":return t.ARRAY_BUFFER;case"bignumber":case"big number":return t.BIG_NUMBER;case"json":case"object":return t.JSON;case"file":return t.FILE;case"list<file>":return t.LIST_FILE;default:throw new D("Invalid data type string. No matching enum.")}}},{key:"enumLookup",value:function(e){switch(e){case t.BYTE_ARRAY:return"byteArray";case t.STRING:return"string";case t.NUMBER:return"number";case t.HTML:return"html";case t.ARRAY_BUFFER:return"ArrayBuffer";case t.BIG_NUMBER:return"BigNumber";case t.JSON:return"JSON";case t.FILE:return"File";case t.LIST_FILE:return"List<File>";default:throw new D("Invalid data type enum. No matching type.")}}}]);var r}();We.BYTE_ARRAY=0,We.STRING=1,We.NUMBER=2,We.HTML=3,We.ARRAY_BUFFER=4,We.BIG_NUMBER=5,We.JSON=6,We.FILE=7,We.LIST_FILE=8;const Ye=We,Ke=function(){function t(r){e(this,t),this.name="",this.type="",this._value=null,this.disabled=!1,this.hint="",this.rows=0,this.toggleValues=[],this.target=null,this.defaultIndex=0,this.maxLength=null,this.min=null,this.max=null,this.step=1,r&&this._parseConfig(r)}return o(t,[{key:"_parseConfig",value:function(e){this.name=e.name,this.type=e.type,this.defaultValue=e.value,this.disabled=!!e.disabled,this.hint=e.hint||!1,this.rows=e.rows||!1,this.toggleValues=e.toggleValues,this.target=void 0!==e.target?e.target:null,this.defaultIndex=void 0!==e.defaultIndex?e.defaultIndex:0,this.maxLength=e.maxLength||null,this.min=e.min,this.max=e.max,this.step=e.step}},{key:"config",get:function(){return this._value}},{key:"value",get:function(){return this._value},set:function(e){this._value=t.prepare(e,this.type)}}],[{key:"prepare",value:function(e,t){var r;switch(t){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return U.parseEscapedChars(e);case"byteArray":return"string"==typeof e?S(e=e.replace(/\s+/g,"")):e;case"number":if(null===e)return e;if(r=parseFloat(e),isNaN(r))throw"Invalid ingredient value. Not a number: "+U.truncate(e.toString(),10);return r;default:return e}}}])}();var Xe=function(){return o((function t(){e(this,t),this._inputType=-1,this._outputType=-1,this._presentType=-1,this._breakpoint=!1,this._disabled=!1,this._flowControl=!1,this._manualBake=!1,this._ingList=[],this.name="",this.module="",this.description="",this.infoURL=null}),[{key:"run",value:function(e,t){return e}},{key:"highlight",value:function(e,t){return!1}},{key:"highlightReverse",value:function(e,t){return!1}},{key:"present",value:function(e,t){return e}},{key:"inputType",get:function(){return Ye.enumLookup(this._inputType)},set:function(e){this._inputType=Ye.typeEnum(e)}},{key:"outputType",get:function(){return Ye.enumLookup(this._outputType)},set:function(e){this._outputType=Ye.typeEnum(e),this._presentType<0&&(this._presentType=this._outputType)}},{key:"presentType",get:function(){return Ye.enumLookup(this._presentType)},set:function(e){this._presentType=Ye.typeEnum(e)}},{key:"args",get:function(){return this._ingList.map((function(e){var t={name:e.name,type:e.type,value:e.defaultValue};return e.toggleValues&&(t.toggleValues=e.toggleValues),e.hint&&(t.hint=e.hint),e.rows&&(t.rows=e.rows),e.disabled&&(t.disabled=e.disabled),e.target&&(t.target=e.target),e.defaultIndex&&(t.defaultIndex=e.defaultIndex),e.maxLength&&(t.maxLength=e.maxLength),"number"==typeof e.min&&(t.min=e.min),"number"==typeof e.max&&(t.max=e.max),e.step&&(t.step=e.step),t}))},set:function(e){var t=this;e.forEach((function(e){var r=new Ke(e);t.addIngredient(r)}))}},{key:"config",get:function(){return{op:this.name,args:this._ingList.map((function(e){return e.config}))}}},{key:"addIngredient",value:function(e){this._ingList.push(e)}},{key:"ingValues",get:function(){return this._ingList.map((function(e){return e.value}))},set:function(e){var t=this;e.forEach((function(e,r){t._ingList[r].value=e}))}},{key:"breakpoint",get:function(){return this._breakpoint},set:function(e){this._breakpoint=!!e}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=!!e}},{key:"flowControl",get:function(){return this._flowControl},set:function(e){this._flowControl=!!e}},{key:"manualBake",get:function(){return this._manualBake},set:function(e){this._manualBake=!!e}}])}();const Qe=Xe;var et=r(23809),tt=r.n(et);function rt(e,t,r){return t=a(t),s(e,nt()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function nt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nt=function(){return!!e})()}const it=function(t){function r(){var t;return e(this,r),(t=rt(this,r)).name="Avro to JSON",t.module="Serialise",t.description="Converts Avro encoded data into JSON.",t.infoURL="https://wikipedia.org/wiki/Apache_Avro",t.inputType="ArrayBuffer",t.outputType="string",t.args=[{name:"Force Valid JSON",type:"boolean",value:!0}],t}return c(r,t),o(r,[{key:"run",value:function(e,t){if(e.byteLength<=0)throw new x("Please provide an input.");var r=t[0];return new Promise((function(t,n){var i=[],o=new Uint8Array(e),s=new(tt().streams.BlockDecoder);s.on("data",(function(e){i.push(e)})).on("error",(function(){n(new x("Error parsing Avro file."))})).on("end",(function(){if(r)t(1===i.length?JSON.stringify(i[0],null,4):JSON.stringify(i,null,4));else{var e=i.reduce((function(e,t){return e+JSON.stringify(t)+"\n"}),"");t(e)}})),s.write(o),s.end()}))}}])}(Qe);for(var ot=[],st=[],at="undefined"!=typeof Uint8Array?Uint8Array:Array,ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ct=0;ct<64;++ct)ot[ct]=ut[ct],st[ut.charCodeAt(ct)]=ct;function ft(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function lt(e,t,r){for(var n,i,o=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(ot[(i=n)>>18&63]+ot[i>>12&63]+ot[i>>6&63]+ot[63&i]);return o.join("")}st["-".charCodeAt(0)]=62,st["_".charCodeAt(0)]=63;var ht,pt,dt=function(e){var t,r,n=ft(e),i=n[0],o=n[1],s=new at(function(e,t,r){return 3*(t+r)/4-r}(0,i,o)),a=0,u=o>0?i-4:i;for(r=0;r<u;r+=4)t=st[e.charCodeAt(r)]<<18|st[e.charCodeAt(r+1)]<<12|st[e.charCodeAt(r+2)]<<6|st[e.charCodeAt(r+3)],s[a++]=t>>16&255,s[a++]=t>>8&255,s[a++]=255&t;return 2===o&&(t=st[e.charCodeAt(r)]<<2|st[e.charCodeAt(r+1)]>>4,s[a++]=255&t),1===o&&(t=st[e.charCodeAt(r)]<<10|st[e.charCodeAt(r+1)]<<4|st[e.charCodeAt(r+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t),s},yt=function(e){for(var t,r=e.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push(lt(e,s,s+o>a?a:s+o));return 1===n?(t=e[r-1],i.push(ot[t>>2]+ot[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(ot[t>>10]+ot[t>>4&63]+ot[t<<2&63]+"=")),i.join("")},gt=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},mt=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+p]=255&s,p+=d,s/=256,c-=8);e[r+p-d]|=128*y},vt=(ht=function(e,t){var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50;var n=2147483647;function i(e){if(e>n)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|h(e,t),n=i(r),s=n.write(e,t);return s!==r&&(n=n.slice(0,s)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(D(e,Uint8Array)){var t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(e));if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return f(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(D(e,SharedArrayBuffer)||e&&D(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);var s=function(e){if(o.isBuffer(e)){var t=0|l(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||M(e.length)?i(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(e))}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return a(e),i(e<0?0:0|l(e))}function c(e){for(var t=e.length<0?0:0|l(e.length),r=i(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function f(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,o.prototype),n}function l(e){if(e>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return C(e).length;default:if(i)return n?-1:U(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function d(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),M(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var f=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var l=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){l=!1;break}if(l)return o}return-1}function m(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(M(a))return s;e[r+s]=a}return s}function v(e,t,r,n){return j(U(t,e.length-r),e,r,n)}function b(e,t,r,n){return j(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return j(C(t),e,r,n)}function w(e,t,r,n){return j(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?yt(e):yt(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,c=e[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(e){var t=e.length;if(t<=B)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=B));return r}(n)}t.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),o.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(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return function(e,t,r){return a(e),e<=0?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)}(e,t,r)},o.allocUnsafe=function(e){return u(e)},o.allocUnsafeSlow=function(e){return u(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(D(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),D(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).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}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(D(s,Uint8Array))i+s.length>n.length?o.from(s).copy(n,i):Uint8Array.prototype.set.call(n,s,i);else{if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i)}i+=s.length}return n},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)d(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)d(this,t,t+3),d(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)d(this,t,t+7),d(this,t+1,t+6),d(this,t+2,t+5),d(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):p.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(D(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),u=Math.min(s,a),c=this.slice(n,i),f=e.slice(t,r),l=0;l<u;++l)if(c[l]!==f[l]){s=c[l],a=f[l];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return b(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var B=4096;function A(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function S(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function k(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=P[e[o]];return i}function T(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function O(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,i){return t=+t,r>>>=0,i||N(e,0,r,4),mt(e,t,r,n,23,4),r+4}function R(e,t,r,n,i){return t=+t,r>>>=0,i||N(e,0,r,8),mt(e,t,r,n,52,8),r+8}o.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),gt(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),gt(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),gt(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),gt(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||I(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||I(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return R(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<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),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=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&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var s;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var a=o.isBuffer(e)?e:o.from(e,n),u=a.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=a[s%u]}return this};var L=/[^+/0-9A-Za-z-_]/g;function U(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function C(e){return dt(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function M(e){return e!=e}var P=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},ht(pt={exports:{}},pt.exports),pt.exports),bt=vt.Buffer;vt.SlowBuffer,vt.INSPECT_MAX_BYTES,vt.kMaxLength;var _t=function(e,t){return _t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},_t(e,t)};function wt(e,t){function r(){this.constructor=e}_t(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var Et=function(){return Et=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Et.apply(this,arguments)},xt=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return wt(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),t}(Error),Bt=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return wt(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),t}(TypeError);function At(e){return e&&e.Math==Math&&e}function St(){return At("object"==typeof globalThis&&globalThis)||At("object"==typeof window&&window)||At("object"==typeof self&&self)||At("object"==typeof r.g&&r.g)||Function("return this")()}function kt(e){return e.toString().replace("function(","function (")}var Tt=function(e){var t,r="object"==typeof(t=St()).navigator&&"ReactNative"===t.navigator.product?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var n=bt.alloc(e),i=0;i<e;++i)n[i]=Math.floor(256*Math.random());return n},Ot=function(){if("undefined"!=typeof window){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return function(t){return e.getRandomValues(bt.alloc(t))}}return void 0!==r.g&&r.g.crypto&&r.g.crypto.getRandomValues?function(e){return r.g.crypto.getRandomValues(bt.alloc(e))}:Tt}();function It(e){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e))}function Nt(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}function Ft(e){return"[object BigInt64Array]"===Object.prototype.toString.call(e)}function Rt(e){return"[object BigUint64Array]"===Object.prototype.toString.call(e)}function Lt(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function Ut(e){return Ct(e)&&"[object Date]"===Object.prototype.toString.call(e)}function Ct(e){return"object"==typeof e&&null!==e}function jt(e,t){var r=!1;return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return r||(console.warn(t),r=!0),e.apply(this,n)}}function Dt(e){if(ArrayBuffer.isView(e))return bt.from(e.buffer,e.byteOffset,e.byteLength);if(It(e))return bt.from(e);throw new Bt("Must use either Buffer or TypedArray")}var Mt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,Pt=function(e){return"string"==typeof e&&Mt.test(e)},zt=function(e){if(!Pt(e))throw new Bt('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var t=e.replace(/-/g,"");return bt.from(t,"hex")},$t=function(e,t){return void 0===t&&(t=!0),t?e.toString("hex",0,4)+"-"+e.toString("hex",4,6)+"-"+e.toString("hex",6,8)+"-"+e.toString("hex",8,10)+"-"+e.toString("hex",10,16):e.toString("hex")},Ht=2147483647,Vt=-2147483648,Zt=(Math.pow(2,63),Math.pow(2,63),Math.pow(2,53)),qt=-Math.pow(2,53),Gt=1,Jt=2,Wt=3,Yt=4,Kt=5,Xt=6,Qt=7,er=8,tr=9,rr=10,nr=11,ir=12,or=13,sr=14,ar=15,ur=16,cr=17,fr=18,lr=19,hr=255,pr=127,dr=0,yr=4,gr=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(!(null==t||"string"==typeof t||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||Array.isArray(t)))throw new Bt("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=null!=r?r:e.BSON_BINARY_SUBTYPE_DEFAULT,null==t?(this.buffer=bt.alloc(e.BUFFER_SIZE),this.position=0):("string"==typeof t?this.buffer=bt.from(t,"binary"):Array.isArray(t)?this.buffer=bt.from(t):this.buffer=Dt(t),this.position=this.buffer.byteLength)}return e.prototype.put=function(t){if("string"==typeof t&&1!==t.length)throw new Bt("only accepts single character String");if("number"!=typeof t&&1!==t.length)throw new Bt("only accepts single character Uint8Array or Array");var r;if((r="string"==typeof t?t.charCodeAt(0):"number"==typeof t?t:t[0])<0||r>255)throw new Bt("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var n=bt.alloc(e.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}},e.prototype.write=function(e,t){if(t="number"==typeof t?t:this.position,this.buffer.length<t+e.length){var r=bt.alloc(this.buffer.length+e.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r}ArrayBuffer.isView(e)?(this.buffer.set(Dt(e),t),this.position=t+e.byteLength>this.position?t+e.length:this.position):"string"==typeof e&&(this.buffer.write(e,t,e.length,"binary"),this.position=t+e.length>this.position?t+e.length:this.position)},e.prototype.read=function(e,t){return t=t&&t>0?t:this.position,this.buffer.slice(e,e+t)},e.prototype.value=function(e){return(e=!!e)&&this.buffer.length===this.position?this.buffer:e?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},e.prototype.length=function(){return this.position},e.prototype.toJSON=function(){return this.buffer.toString("base64")},e.prototype.toString=function(e){return this.buffer.toString(e)},e.prototype.toExtendedJSON=function(e){e=e||{};var t=this.buffer.toString("base64"),r=Number(this.sub_type).toString(16);return e.legacy?{$binary:t,$type:1===r.length?"0"+r:r}:{$binary:{base64:t,subType:1===r.length?"0"+r:r}}},e.prototype.toUUID=function(){if(this.sub_type===e.SUBTYPE_UUID)return new mr(this.buffer.slice(0,this.position));throw new xt('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(e.SUBTYPE_UUID,'" is currently supported.'))},e.fromExtendedJSON=function(t,r){var n,i;if(r=r||{},"$binary"in t?r.legacy&&"string"==typeof t.$binary&&"$type"in t?(i=t.$type?parseInt(t.$type,16):0,n=bt.from(t.$binary,"base64")):"string"!=typeof t.$binary&&(i=t.$binary.subType?parseInt(t.$binary.subType,16):0,n=bt.from(t.$binary.base64,"base64")):"$uuid"in t&&(i=4,n=zt(t.$uuid)),!n)throw new Bt("Unexpected Binary Extended JSON format ".concat(JSON.stringify(t)));return i===yr?new mr(n):new e(n,i)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=this.value(!0);return'new Binary(Buffer.from("'.concat(e.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},e.BSON_BINARY_SUBTYPE_DEFAULT=0,e.BUFFER_SIZE=256,e.SUBTYPE_DEFAULT=0,e.SUBTYPE_FUNCTION=1,e.SUBTYPE_BYTE_ARRAY=2,e.SUBTYPE_UUID_OLD=3,e.SUBTYPE_UUID=4,e.SUBTYPE_MD5=5,e.SUBTYPE_ENCRYPTED=6,e.SUBTYPE_COLUMN=7,e.SUBTYPE_USER_DEFINED=128,e}();Object.defineProperty(gr.prototype,"_bsontype",{value:"Binary"});var mr=function(e){function t(r){var n,i,o=this;if(null==r)n=t.generate();else if(r instanceof t)n=bt.from(r.buffer),i=r.__id;else if(ArrayBuffer.isView(r)&&16===r.byteLength)n=Dt(r);else{if("string"!=typeof r)throw new Bt("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");n=zt(r)}return(o=e.call(this,n,yr)||this).__id=i,o}return wt(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this.buffer},set:function(e){this.buffer=e,t.cacheHexString&&(this.__id=$t(e))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(e){if(void 0===e&&(e=!0),t.cacheHexString&&this.__id)return this.__id;var r=$t(this.id,e);return t.cacheHexString&&(this.__id=r),r},t.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(!e)return!1;if(e instanceof t)return e.id.equals(this.id);try{return new t(e).id.equals(this.id)}catch(e){return!1}},t.prototype.toBinary=function(){return new gr(this.id,gr.SUBTYPE_UUID)},t.generate=function(){var e=Ot(16);return e[6]=15&e[6]|64,e[8]=63&e[8]|128,bt.from(e)},t.isValid=function(e){return!!e&&(e instanceof t||("string"==typeof e?Pt(e):!(!Nt(e)||16!==e.length||64!=(240&e[6])||128&~e[8])))},t.createFromHexString=function(e){return new t(zt(e))},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},t}(gr),vr=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);this.code=t,this.scope=r}return e.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},e.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},e.fromExtendedJSON=function(t){return new e(t.$code,t.$scope)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=this.toJSON();return'new Code("'.concat(String(e.code),'"').concat(e.scope?", ".concat(JSON.stringify(e.scope)):"",")")},e}();function br(e){return Ct(e)&&null!=e.$id&&"string"==typeof e.$ref&&(null==e.$db||"string"==typeof e.$db)}Object.defineProperty(vr.prototype,"_bsontype",{value:"Code"});var _r=function(){function e(t,r,n,i){if(!(this instanceof e))return new e(t,r,n,i);var o=t.split(".");2===o.length&&(n=o.shift(),t=o.shift()),this.collection=t,this.oid=r,this.db=n,this.fields=i||{}}return Object.defineProperty(e.prototype,"namespace",{get:function(){return this.collection},set:function(e){this.collection=e},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(e.$db=this.db),e},e.prototype.toExtendedJSON=function(e){e=e||{};var t={$ref:this.collection,$id:this.oid};return e.legacy?t:(this.db&&(t.$db=this.db),t=Object.assign(t,this.fields))},e.fromExtendedJSON=function(t){var r=Object.assign({},t);return delete r.$ref,delete r.$id,delete r.$db,new e(t.$ref,t.$id,t.$db,r)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=void 0===this.oid||void 0===this.oid.toString?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(e),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},e}();Object.defineProperty(_r.prototype,"_bsontype",{value:"DBRef"});var wr=void 0;try{wr=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(e){}var Er=4294967296,xr=0x10000000000000000,Br=xr/2,Ar={},Sr={},kr=function(){function e(t,r,n){if(void 0===t&&(t=0),!(this instanceof e))return new e(t,r,n);"bigint"==typeof t?Object.assign(this,e.fromBigInt(t,!!r)):"string"==typeof t?Object.assign(this,e.fromString(t,!!r)):(this.low=0|t,this.high=0|r,this.unsigned=!!n),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return e.fromBits=function(t,r,n){return new e(t,r,n)},e.fromInt=function(t,r){var n,i,o;return r?(o=0<=(t>>>=0)&&t<256)&&(i=Sr[t])?i:(n=e.fromBits(t,(0|t)<0?-1:0,!0),o&&(Sr[t]=n),n):(o=-128<=(t|=0)&&t<128)&&(i=Ar[t])?i:(n=e.fromBits(t,t<0?-1:0,!1),o&&(Ar[t]=n),n)},e.fromNumber=function(t,r){if(isNaN(t))return r?e.UZERO:e.ZERO;if(r){if(t<0)return e.UZERO;if(t>=xr)return e.MAX_UNSIGNED_VALUE}else{if(t<=-Br)return e.MIN_VALUE;if(t+1>=Br)return e.MAX_VALUE}return t<0?e.fromNumber(-t,r).neg():e.fromBits(t%Er|0,t/Er|0,r)},e.fromBigInt=function(t,r){return e.fromString(t.toString(),r)},e.fromString=function(t,r,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e.ZERO;if("number"==typeof r?(n=r,r=!1):r=!!r,(n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return e.fromString(t.substring(1),r,n).neg();for(var o=e.fromNumber(Math.pow(n,8)),s=e.ZERO,a=0;a<t.length;a+=8){var u=Math.min(8,t.length-a),c=parseInt(t.substring(a,a+u),n);if(u<8){var f=e.fromNumber(Math.pow(n,u));s=s.mul(f).add(e.fromNumber(c))}else s=(s=s.mul(o)).add(e.fromNumber(c))}return s.unsigned=r,s},e.fromBytes=function(t,r,n){return n?e.fromBytesLE(t,r):e.fromBytesBE(t,r)},e.fromBytesLE=function(t,r){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)},e.fromBytesBE=function(t,r){return new e(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)},e.isLong=function(e){return Ct(e)&&!0===e.__isLong__},e.fromValue=function(t,r){return"number"==typeof t?e.fromNumber(t,r):"string"==typeof t?e.fromString(t,r):e.fromBits(t.low,t.high,"boolean"==typeof r?r:t.unsigned)},e.prototype.add=function(t){e.isLong(t)||(t=e.fromValue(t));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=t.high>>>16,a=65535&t.high,u=t.low>>>16,c=0,f=0,l=0,h=0;return l+=(h+=o+(65535&t.low))>>>16,h&=65535,f+=(l+=i+u)>>>16,l&=65535,c+=(f+=n+a)>>>16,f&=65535,c+=r+s,c&=65535,e.fromBits(l<<16|h,c<<16|f,this.unsigned)},e.prototype.and=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low&t.low,this.high&t.high,this.unsigned)},e.prototype.compare=function(t){if(e.isLong(t)||(t=e.fromValue(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?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},e.prototype.comp=function(e){return this.compare(e)},e.prototype.divide=function(t){if(e.isLong(t)||(t=e.fromValue(t)),t.isZero())throw Error("division by zero");if(wr){if(!this.unsigned&&-2147483648===this.high&&-1===t.low&&-1===t.high)return this;var r=(this.unsigned?wr.div_u:wr.div_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,wr.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var n,i,o;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return e.UZERO;if(t.gt(this.shru(1)))return e.UONE;o=e.UZERO}else{if(this.eq(e.MIN_VALUE))return t.eq(e.ONE)||t.eq(e.NEG_ONE)?e.MIN_VALUE:t.eq(e.MIN_VALUE)?e.ONE:(n=this.shr(1).div(t).shl(1)).eq(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(i=this.sub(t.mul(n)),o=n.add(i.div(t)));if(t.eq(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;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=e.ZERO}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),a=s<=48?1:Math.pow(2,s-48),u=e.fromNumber(n),c=u.mul(t);c.isNegative()||c.gt(i);)n-=a,c=(u=e.fromNumber(n,this.unsigned)).mul(t);u.isZero()&&(u=e.ONE),o=o.add(u),i=i.sub(c)}return o},e.prototype.div=function(e){return this.divide(e)},e.prototype.equals=function(t){return e.isLong(t)||(t=e.fromValue(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},e.prototype.eq=function(e){return this.equals(e)},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(e.MIN_VALUE)?64:this.neg().getNumBitsAbs();var t,r=0!==this.high?this.high:this.low;for(t=31;t>0&&!(r&1<<t);t--);return 0!==this.high?t+33:t+1},e.prototype.greaterThan=function(e){return this.comp(e)>0},e.prototype.gt=function(e){return this.greaterThan(e)},e.prototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},e.prototype.gte=function(e){return this.greaterThanOrEqual(e)},e.prototype.ge=function(e){return this.greaterThanOrEqual(e)},e.prototype.isEven=function(){return!(1&this.low)},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isOdd=function(){return!(1&~this.low)},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isZero=function(){return 0===this.high&&0===this.low},e.prototype.lessThan=function(e){return this.comp(e)<0},e.prototype.lt=function(e){return this.lessThan(e)},e.prototype.lessThanOrEqual=function(e){return this.comp(e)<=0},e.prototype.lte=function(e){return this.lessThanOrEqual(e)},e.prototype.modulo=function(t){if(e.isLong(t)||(t=e.fromValue(t)),wr){var r=(this.unsigned?wr.rem_u:wr.rem_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,wr.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},e.prototype.mod=function(e){return this.modulo(e)},e.prototype.rem=function(e){return this.modulo(e)},e.prototype.multiply=function(t){if(this.isZero())return e.ZERO;if(e.isLong(t)||(t=e.fromValue(t)),wr){var r=wr.mul(this.low,this.high,t.low,t.high);return e.fromBits(r,wr.get_high(),this.unsigned)}if(t.isZero())return e.ZERO;if(this.eq(e.MIN_VALUE))return t.isOdd()?e.MIN_VALUE:e.ZERO;if(t.eq(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;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(e.TWO_PWR_24)&&t.lt(e.TWO_PWR_24))return e.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,o=this.low>>>16,s=65535&this.low,a=t.high>>>16,u=65535&t.high,c=t.low>>>16,f=65535&t.low,l=0,h=0,p=0,d=0;return p+=(d+=s*f)>>>16,d&=65535,h+=(p+=o*f)>>>16,p&=65535,h+=(p+=s*c)>>>16,p&=65535,l+=(h+=i*f)>>>16,h&=65535,l+=(h+=o*c)>>>16,h&=65535,l+=(h+=s*u)>>>16,h&=65535,l+=n*f+i*c+o*u+s*a,l&=65535,e.fromBits(p<<16|d,l<<16|h,this.unsigned)},e.prototype.mul=function(e){return this.multiply(e)},e.prototype.negate=function(){return!this.unsigned&&this.eq(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=function(){return this.negate()},e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.notEquals=function(e){return!this.equals(e)},e.prototype.neq=function(e){return this.notEquals(e)},e.prototype.ne=function(e){return this.notEquals(e)},e.prototype.or=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low|t.low,this.high|t.high,this.unsigned)},e.prototype.shiftLeft=function(t){return e.isLong(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?e.fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):e.fromBits(0,this.low<<t-32,this.unsigned)},e.prototype.shl=function(e){return this.shiftLeft(e)},e.prototype.shiftRight=function(t){return e.isLong(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?e.fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):e.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=function(e){return this.shiftRight(e)},e.prototype.shiftRightUnsigned=function(t){if(e.isLong(t)&&(t=t.toInt()),0==(t&=63))return this;var r=this.high;if(t<32){var n=this.low;return e.fromBits(n>>>t|r<<32-t,r>>>t,this.unsigned)}return 32===t?e.fromBits(r,0,this.unsigned):e.fromBits(r>>>t-32,0,this.unsigned)},e.prototype.shr_u=function(e){return this.shiftRightUnsigned(e)},e.prototype.shru=function(e){return this.shiftRightUnsigned(e)},e.prototype.subtract=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.add(t.neg())},e.prototype.sub=function(e){return this.subtract(e)},e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*Er+(this.low>>>0):this.high*Er+(this.low>>>0)},e.prototype.toBigInt=function(){return BigInt(this.toString())},e.prototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},e.prototype.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},e.prototype.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},e.prototype.toSigned=function(){return this.unsigned?e.fromBits(this.low,this.high,!1):this},e.prototype.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(e.MIN_VALUE)){var r=e.fromNumber(t),n=this.div(r),i=n.mul(r).sub(this);return n.toString(t)+i.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var o=e.fromNumber(Math.pow(t,6),this.unsigned),s=this,a="";;){var u=s.div(o),c=(s.sub(u.mul(o)).toInt()>>>0).toString(t);if((s=u).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},e.prototype.toUnsigned=function(){return this.unsigned?this:e.fromBits(this.low,this.high,!0)},e.prototype.xor=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low^t.low,this.high^t.high,this.unsigned)},e.prototype.eqz=function(){return this.isZero()},e.prototype.le=function(e){return this.lessThanOrEqual(e)},e.prototype.toExtendedJSON=function(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}},e.fromExtendedJSON=function(t,r){var n=e.fromString(t.$numberLong);return r&&r.relaxed?n.toNumber():n},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},e.TWO_PWR_24=e.fromInt(16777216),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e}();Object.defineProperty(kr.prototype,"__isLong__",{value:!0}),Object.defineProperty(kr.prototype,"_bsontype",{value:"Long"});var Tr=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,Or=/^(\+|-)?(Infinity|inf)$/i,Ir=/^(\+|-)?NaN$/i,Nr=6111,Fr=-6176,Rr=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Lr=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Ur=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Cr=/^([-+])?(\d+)?$/;function jr(e){return!isNaN(parseInt(e,10))}function Dr(e){var t=kr.fromNumber(1e9),r=kr.fromNumber(0);if(!(e.parts[0]||e.parts[1]||e.parts[2]||e.parts[3]))return{quotient:e,rem:r};for(var n=0;n<=3;n++)r=(r=r.shiftLeft(32)).add(new kr(e.parts[n],0)),e.parts[n]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function Mr(e,t){throw new Bt('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var Pr=function(){function e(t){if(!(this instanceof e))return new e(t);if("string"==typeof t)this.bytes=e.fromString(t).bytes;else{if(!Nt(t))throw new Bt("Decimal128 must take a Buffer or string");if(16!==t.byteLength)throw new Bt("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}}return e.fromString=function(t){var r,n=!1,i=!1,o=!1,s=0,a=0,u=0,c=0,f=0,l=[0],h=0,p=0,d=0,y=0,g=0,m=0,v=new kr(0,0),b=new kr(0,0),_=0;if(t.length>=7e3)throw new Bt(t+" not a valid Decimal128 string");var w=t.match(Tr),E=t.match(Or),x=t.match(Ir);if(!w&&!E&&!x||0===t.length)throw new Bt(t+" not a valid Decimal128 string");if(w){var B=w[2],A=w[4],S=w[5],k=w[6];A&&void 0===k&&Mr(t,"missing exponent power"),A&&void 0===B&&Mr(t,"missing exponent base"),void 0===A&&(S||k)&&Mr(t,"missing e before exponent")}if("+"!==t[_]&&"-"!==t[_]||(n="-"===t[_++]),!jr(t[_])&&"."!==t[_]){if("i"===t[_]||"I"===t[_])return new e(bt.from(n?Lr:Ur));if("N"===t[_])return new e(bt.from(Rr))}for(;jr(t[_])||"."===t[_];)"."!==t[_]?(h<34&&("0"!==t[_]||o)&&(o||(f=a),o=!0,l[p++]=parseInt(t[_],10),h+=1),o&&(u+=1),i&&(c+=1),a+=1,_+=1):(i&&Mr(t,"contains multiple periods"),i=!0,_+=1);if(i&&!a)throw new Bt(t+" not a valid Decimal128 string");if("e"===t[_]||"E"===t[_]){var T=t.substr(++_).match(Cr);if(!T||!T[2])return new e(bt.from(Rr));g=parseInt(T[0],10),_+=T[0].length}if(t[_])return new e(bt.from(Rr));if(d=0,h){if(y=h-1,1!==(s=u))for(;0===l[f+s-1];)s-=1}else d=0,y=0,l[0]=0,u=1,h=1,s=0;for(g<=c&&c-g>16384?g=Fr:g-=c;g>Nr;){if((y+=1)-d>34){if(l.join("").match(/^0+$/)){g=Nr;break}Mr(t,"overflow")}g-=1}for(;g<Fr||h<u;){if(0===y&&s<h){g=Fr,s=0;break}if(h<u?u-=1:y-=1,g<Nr)g+=1;else{if(l.join("").match(/^0+$/)){g=Nr;break}Mr(t,"overflow")}}if(y-d+1<s){var O=a;i&&(f+=1,O+=1),n&&(f+=1,O+=1);var I=parseInt(t[f+y+1],10),N=0;if(I>=5&&(N=1,5===I))for(N=l[y]%2==1?1:0,m=f+y+2;m<O;m++)if(parseInt(t[m],10)){N=1;break}if(N)for(var F=y;F>=0;F--)if(++l[F]>9&&(l[F]=0,0===F)){if(!(g<Nr))return new e(bt.from(n?Lr:Ur));g+=1,l[F]=1}}if(v=kr.fromNumber(0),b=kr.fromNumber(0),0===s)v=kr.fromNumber(0),b=kr.fromNumber(0);else if(y-d<17)for(F=d,b=kr.fromNumber(l[F++]),v=new kr(0,0);F<=y;F++)b=(b=b.multiply(kr.fromNumber(10))).add(kr.fromNumber(l[F]));else{for(F=d,v=kr.fromNumber(l[F++]);F<=y-17;F++)v=(v=v.multiply(kr.fromNumber(10))).add(kr.fromNumber(l[F]));for(b=kr.fromNumber(l[F++]);F<=y;F++)b=(b=b.multiply(kr.fromNumber(10))).add(kr.fromNumber(l[F]))}var R,L,U,C,j=function(e,t){if(!e&&!t)return{high:kr.fromNumber(0),low:kr.fromNumber(0)};var r=e.shiftRightUnsigned(32),n=new kr(e.getLowBits(),0),i=t.shiftRightUnsigned(32),o=new kr(t.getLowBits(),0),s=r.multiply(i),a=r.multiply(o),u=n.multiply(i),c=n.multiply(o);return s=s.add(a.shiftRightUnsigned(32)),a=new kr(a.getLowBits(),0).add(u).add(c.shiftRightUnsigned(32)),{high:s=s.add(a.shiftRightUnsigned(32)),low:c=a.shiftLeft(32).add(new kr(c.getLowBits(),0))}}(v,kr.fromString("100000000000000000"));j.low=j.low.add(b),L=b,((U=(R=j.low).high>>>0)<(C=L.high>>>0)||U===C&&R.low>>>0<L.low>>>0)&&(j.high=j.high.add(kr.fromNumber(1))),r=g+6176;var D={low:kr.fromNumber(0),high:kr.fromNumber(0)};j.high.shiftRightUnsigned(49).and(kr.fromNumber(1)).equals(kr.fromNumber(1))?(D.high=D.high.or(kr.fromNumber(3).shiftLeft(61)),D.high=D.high.or(kr.fromNumber(r).and(kr.fromNumber(16383).shiftLeft(47))),D.high=D.high.or(j.high.and(kr.fromNumber(0x7fffffffffff)))):(D.high=D.high.or(kr.fromNumber(16383&r).shiftLeft(49)),D.high=D.high.or(j.high.and(kr.fromNumber(562949953421311)))),D.low=j.low,n&&(D.high=D.high.or(kr.fromString("9223372036854775808")));var M=bt.alloc(16);return _=0,M[_++]=255&D.low.low,M[_++]=D.low.low>>8&255,M[_++]=D.low.low>>16&255,M[_++]=D.low.low>>24&255,M[_++]=255&D.low.high,M[_++]=D.low.high>>8&255,M[_++]=D.low.high>>16&255,M[_++]=D.low.high>>24&255,M[_++]=255&D.high.low,M[_++]=D.high.low>>8&255,M[_++]=D.high.low>>16&255,M[_++]=D.high.low>>24&255,M[_++]=255&D.high.high,M[_++]=D.high.high>>8&255,M[_++]=D.high.high>>16&255,M[_++]=D.high.high>>24&255,new e(M)},e.prototype.toString=function(){for(var e,t=0,r=new Array(36),n=0;n<r.length;n++)r[n]=0;var i,o,s,a=0,u=!1,c={parts:[0,0,0,0]},f=[];a=0;var l=this.bytes,h=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24,p=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24,d=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24,y=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24;a=0,(new kr(h,p),new kr(d,y)).lessThan(kr.ZERO)&&f.push("-");var g=y>>26&31;if(g>>3==3){if(30===g)return f.join("")+"Infinity";if(31===g)return"NaN";e=y>>15&16383,i=8+(y>>14&1)}else i=y>>14&7,e=y>>17&16383;var m=e-6176;if(c.parts[0]=(16383&y)+((15&i)<<14),c.parts[1]=d,c.parts[2]=p,c.parts[3]=h,0===c.parts[0]&&0===c.parts[1]&&0===c.parts[2]&&0===c.parts[3])u=!0;else for(s=3;s>=0;s--){var v=0,b=Dr(c);if(c=b.quotient,v=b.rem.low)for(o=8;o>=0;o--)r[9*s+o]=v%10,v=Math.floor(v/10)}if(u)t=1,r[a]=0;else for(t=36;!r[a];)t-=1,a+=1;var _=t-1+m;if(_>=34||_<=-7||m>0){if(t>34)return f.push("".concat(0)),m>0?f.push("E+".concat(m)):m<0&&f.push("E".concat(m)),f.join("");for(f.push("".concat(r[a++])),(t-=1)&&f.push("."),n=0;n<t;n++)f.push("".concat(r[a++]));f.push("E"),_>0?f.push("+".concat(_)):f.push("".concat(_))}else if(m>=0)for(n=0;n<t;n++)f.push("".concat(r[a++]));else{var w=t+m;if(w>0)for(n=0;n<w;n++)f.push("".concat(r[a++]));else f.push("0");for(f.push(".");w++<0;)f.push("0");for(n=0;n<t-Math.max(w-1,0);n++)f.push("".concat(r[a++]))}return f.join("")},e.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},e.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},e.fromExtendedJSON=function(t){return e.fromString(t.$numberDecimal)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},e}();Object.defineProperty(Pr.prototype,"_bsontype",{value:"Decimal128"});var zr=function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t}return e.prototype.valueOf=function(){return this.value},e.prototype.toJSON=function(){return this.value},e.prototype.toString=function(e){return this.value.toString(e)},e.prototype.toExtendedJSON=function(e){return e&&(e.legacy||e.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},e.fromExtendedJSON=function(t,r){var n=parseFloat(t.$numberDouble);return r&&r.relaxed?n:new e(n)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=this.toExtendedJSON();return"new Double(".concat(e.$numberDouble,")")},e}();Object.defineProperty(zr.prototype,"_bsontype",{value:"Double"});var $r=function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=0|+t}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(e){return this.value.toString(e)},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}},e.fromExtendedJSON=function(t,r){return r&&r.relaxed?parseInt(t.$numberInt,10):new e(t.$numberInt)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},e}();Object.defineProperty($r.prototype,"_bsontype",{value:"Int32"});var Hr=function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$maxKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MaxKey()"},e}();Object.defineProperty(Hr.prototype,"_bsontype",{value:"MaxKey"});var Vr=function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$minKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MinKey()"},e}();Object.defineProperty(Vr.prototype,"_bsontype",{value:"MinKey"});var Zr=new RegExp("^[0-9a-fA-F]{24}$"),qr=null,Gr=Symbol("id"),Jr=function(){function e(t){if(!(this instanceof e))return new e(t);var r;if("object"==typeof t&&t&&"id"in t){if("string"!=typeof t.id&&!ArrayBuffer.isView(t.id))throw new Bt("Argument passed in must have an id that is of type string or Buffer");r="toHexString"in t&&"function"==typeof t.toHexString?bt.from(t.toHexString(),"hex"):t.id}else r=t;if(null==r||"number"==typeof r)this[Gr]=e.generate("number"==typeof r?r:void 0);else if(ArrayBuffer.isView(r)&&12===r.byteLength)this[Gr]=r instanceof bt?r:Dt(r);else{if("string"!=typeof r)throw new Bt("Argument passed in does not match the accepted types");if(12===r.length){var n=bt.from(r);if(12!==n.byteLength)throw new Bt("Argument passed in must be a string of 12 bytes");this[Gr]=n}else{if(24!==r.length||!Zr.test(r))throw new Bt("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");this[Gr]=bt.from(r,"hex")}}e.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(e.prototype,"id",{get:function(){return this[Gr]},set:function(t){this[Gr]=t,e.cacheHexString&&(this.__id=t.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(e){this.id.writeUInt32BE(e,0)},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(){if(e.cacheHexString&&this.__id)return this.__id;var t=this.id.toString("hex");return e.cacheHexString&&!this.__id&&(this.__id=t),t},e.getInc=function(){return e.index=(e.index+1)%16777215},e.generate=function(t){"number"!=typeof t&&(t=Math.floor(Date.now()/1e3));var r=e.getInc(),n=bt.alloc(12);return n.writeUInt32BE(t,0),null===qr&&(qr=Ot(5)),n[4]=qr[0],n[5]=qr[1],n[6]=qr[2],n[7]=qr[3],n[8]=qr[4],n[11]=255&r,n[10]=r>>8&255,n[9]=r>>16&255,n},e.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(t){if(null==t)return!1;if(t instanceof e)return this[Gr][11]===t[Gr][11]&&this[Gr].equals(t[Gr]);if("string"==typeof t&&e.isValid(t)&&12===t.length&&Nt(this.id))return t===bt.prototype.toString.call(this.id,"latin1");if("string"==typeof t&&e.isValid(t)&&24===t.length)return t.toLowerCase()===this.toHexString();if("string"==typeof t&&e.isValid(t)&&12===t.length)return bt.from(t).equals(this.id);if("object"==typeof t&&"toHexString"in t&&"function"==typeof t.toHexString){var r=t.toHexString(),n=this.toHexString().toLowerCase();return"string"==typeof r&&r.toLowerCase()===n}return!1},e.prototype.getTimestamp=function(){var e=new Date,t=this.id.readUInt32BE(0);return e.setTime(1e3*Math.floor(t)),e},e.createPk=function(){return new e},e.createFromTime=function(t){var r=bt.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(t,0),new e(r)},e.createFromHexString=function(t){if(void 0===t||null!=t&&24!==t.length)throw new Bt("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new e(bt.from(t,"hex"))},e.isValid=function(t){if(null==t)return!1;try{return new e(t),!0}catch(e){return!1}},e.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},e.fromExtendedJSON=function(t){return new e(t.$oid)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},e.index=Math.floor(16777215*Math.random()),e}();Object.defineProperty(Jr.prototype,"generate",{value:jt((function(e){return Jr.generate(e)}),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(Jr.prototype,"getInc",{value:jt((function(){return Jr.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(Jr.prototype,"get_inc",{value:jt((function(){return Jr.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(Jr,"get_inc",{value:jt((function(){return Jr.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(Jr.prototype,"_bsontype",{value:"ObjectID"});var Wr=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.pattern=t,this.options=(null!=r?r:"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new xt("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(-1!==this.options.indexOf("\0"))throw new xt("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var n=0;n<this.options.length;n++)if("i"!==this.options[n]&&"m"!==this.options[n]&&"x"!==this.options[n]&&"l"!==this.options[n]&&"s"!==this.options[n]&&"u"!==this.options[n])throw new xt("The regular expression option [".concat(this.options[n],"] is not supported"))}return e.parseOptions=function(e){return e?e.split("").sort().join(""):""},e.prototype.toExtendedJSON=function(e){return(e=e||{}).legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},e.fromExtendedJSON=function(t){if("$regex"in t){if("string"==typeof t.$regex)return new e(t.$regex,e.parseOptions(t.$options));if("BSONRegExp"===t.$regex._bsontype)return t}if("$regularExpression"in t)return new e(t.$regularExpression.pattern,e.parseOptions(t.$regularExpression.options));throw new Bt("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e}();Object.defineProperty(Wr.prototype,"_bsontype",{value:"BSONRegExp"});var Yr=function(){function e(t){if(!(this instanceof e))return new e(t);this.value=t}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(){return this.value},e.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(){return{$symbol:this.value}},e.fromExtendedJSON=function(t){return new e(t.$symbol)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e}();Object.defineProperty(Yr.prototype,"_bsontype",{value:"Symbol"});var Kr=function(e){function t(r,n){var i=this;return i instanceof t?(i=kr.isLong(r)?e.call(this,r.low,r.high,!0)||this:Ct(r)&&void 0!==r.t&&void 0!==r.i?e.call(this,r.i,r.t,!0)||this:e.call(this,r,n,!0)||this,Object.defineProperty(i,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),i):new t(r,n)}return wt(t,e),t.prototype.toJSON=function(){return{$timestamp:this.toString()}},t.fromInt=function(e){return new t(kr.fromInt(e,!0))},t.fromNumber=function(e){return new t(kr.fromNumber(e,!0))},t.fromBits=function(e,r){return new t(e,r)},t.fromString=function(e,r){return new t(kr.fromString(e,!0,r))},t.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},t.fromExtendedJSON=function(e){return new t(e.$timestamp)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},t.MAX_VALUE=kr.MAX_UNSIGNED_VALUE,t}(kr);function Xr(e){return Ct(e)&&Reflect.has(e,"_bsontype")&&"string"==typeof e._bsontype}var Qr=2147483647,en=-2147483648,tn=0x8000000000000000,rn=-0x8000000000000000,nn={$oid:Jr,$binary:gr,$uuid:gr,$symbol:Yr,$numberInt:$r,$numberDecimal:Pr,$numberDouble:zr,$numberLong:kr,$minKey:Vr,$maxKey:Hr,$regex:Wr,$regularExpression:Wr,$timestamp:Kr};function on(e,t){if(void 0===t&&(t={}),"number"==typeof e){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=en&&e<=Qr)return new $r(e);if(e>=rn&&e<=tn)return kr.fromNumber(e)}return new zr(e)}if(null==e||"object"!=typeof e)return e;if(e.$undefined)return null;for(var r=Object.keys(e).filter((function(t){return t.startsWith("$")&&null!=e[t]})),n=0;n<r.length;n++){var i=nn[r[n]];if(i)return i.fromExtendedJSON(e,t)}if(null!=e.$date){var o=e.$date,s=new Date;return t.legacy?"number"==typeof o?s.setTime(o):"string"==typeof o&&s.setTime(Date.parse(o)):"string"==typeof o?s.setTime(Date.parse(o)):kr.isLong(o)?s.setTime(o.toNumber()):"number"==typeof o&&t.relaxed&&s.setTime(o),s}if(null!=e.$code){var a=Object.assign({},e);return e.$scope&&(a.$scope=on(e.$scope)),vr.fromExtendedJSON(e)}if(br(e)||e.$dbPointer){var u=e.$ref?e:e.$dbPointer;if(u instanceof _r)return u;var c=Object.keys(u).filter((function(e){return e.startsWith("$")})),f=!0;if(c.forEach((function(e){-1===["$ref","$id","$db"].indexOf(e)&&(f=!1)})),f)return _r.fromExtendedJSON(u)}return e}function sn(e){var t=e.toISOString();return 0!==e.getUTCMilliseconds()?t:t.slice(0,-5)+"Z"}function an(e,t){if(("object"==typeof e||"function"==typeof e)&&null!==e){var r=t.seenObjects.findIndex((function(t){return t.obj===e}));if(-1!==r){var n=t.seenObjects.map((function(e){return e.propertyName})),i=n.slice(0,r).map((function(e){return"".concat(e," -> ")})).join(""),o=n[r],s=" -> "+n.slice(r+1,n.length-1).map((function(e){return"".concat(e," -> ")})).join(""),a=n[n.length-1],u=" ".repeat(i.length+o.length/2),c="-".repeat(s.length+(o.length+a.length)/2-1);throw new Bt("Converting circular structure to EJSON:\n"+" ".concat(i).concat(o).concat(s).concat(a,"\n")+" ".concat(u,"\\").concat(c,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return function(e,t){return e.map((function(e,r){t.seenObjects.push({propertyName:"index ".concat(r),obj:null});try{return an(e,t)}finally{t.seenObjects.pop()}}))}(e,t);if(void 0===e)return null;if(e instanceof Date||Ut(e)){var f=e.getTime(),l=f>-1&&f<2534023188e5;return t.legacy?t.relaxed&&l?{$date:e.getTime()}:{$date:sn(e)}:t.relaxed&&l?{$date:sn(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(!("number"!=typeof e||t.relaxed&&isFinite(e))){if(Math.floor(e)===e){var h=e>=rn&&e<=tn;if(e>=en&&e<=Qr)return{$numberInt:e.toString()};if(h)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||Lt(e)){var p=e.flags;if(void 0===p){var d=e.toString().match(/[gimuy]*$/);d&&(p=d[0])}return new Wr(e.source,p).toExtendedJSON(t)}return null!=e&&"object"==typeof e?function(e,t){if(null==e||"object"!=typeof e)throw new xt("not an object instance");var r=e._bsontype;if(void 0===r){var n={};for(var i in e){t.seenObjects.push({propertyName:i,obj:null});try{var o=an(e[i],t);"__proto__"===i?Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):n[i]=o}finally{t.seenObjects.pop()}}return n}if(Xr(e)){var s=e;if("function"!=typeof s.toExtendedJSON){var a=fn[e._bsontype];if(!a)throw new Bt("Unrecognized or invalid _bsontype: "+e._bsontype);s=a(s)}return"Code"===r&&s.scope?s=new vr(s.code,an(s.scope,t)):"DBRef"===r&&s.oid&&(s=new _r(an(s.collection,t),an(s.oid,t),an(s.db,t),an(s.fields,t))),s.toExtendedJSON(t)}throw new xt("_bsontype must be a string, but was: "+typeof r)}(e,t):e}var un,cn,fn={Binary:function(e){return new gr(e.value(),e.sub_type)},Code:function(e){return new vr(e.code,e.scope)},DBRef:function(e){return new _r(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new Pr(e.bytes)},Double:function(e){return new zr(e.value)},Int32:function(e){return new $r(e.value)},Long:function(e){return kr.fromBits(null!=e.low?e.low:e.low_,null!=e.low?e.high:e.high_,null!=e.low?e.unsigned:e.unsigned_)},MaxKey:function(){return new Hr},MinKey:function(){return new Vr},ObjectID:function(e){return new Jr(e)},ObjectId:function(e){return new Jr(e)},BSONRegExp:function(e){return new Wr(e.pattern,e.options)},Symbol:function(e){return new Yr(e.value)},Timestamp:function(e){return Kr.fromBits(e.low,e.high)}};!function(e){function t(e,t){var r=Object.assign({},{relaxed:!0,legacy:!1},t);return"boolean"==typeof r.relaxed&&(r.strict=!r.relaxed),"boolean"==typeof r.strict&&(r.relaxed=!r.strict),JSON.parse(e,(function(e,t){if(-1!==e.indexOf("\0"))throw new xt("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(e)));return on(t,r)}))}function r(e,t,r,n){null!=r&&"object"==typeof r&&(n=r,r=0),null==t||"object"!=typeof t||Array.isArray(t)||(n=t,t=void 0,r=0);var i=an(e,Object.assign({relaxed:!0,legacy:!1},n,{seenObjects:[{propertyName:"(root)",obj:null}]}));return JSON.stringify(i,t,r)}e.parse=t,e.stringify=r,e.serialize=function(e,t){return t=t||{},JSON.parse(r(e,t))},e.deserialize=function(e,r){return r=r||{},t(JSON.stringify(e),r)}}(un||(un={}));var ln=St();function hn(e,t,r){var n=5;if(Array.isArray(e))for(var i=0;i<e.length;i++)n+=pn(i.toString(),e[i],t,!0,r);else for(var o in"function"==typeof(null==e?void 0:e.toBSON)&&(e=e.toBSON()),e)n+=pn(o,e[o],t,!1,r);return n}function pn(e,t,r,n,i){switch(void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===i&&(i=!1),"function"==typeof(null==t?void 0:t.toBSON)&&(t=t.toBSON()),typeof t){case"string":return 1+bt.byteLength(e,"utf8")+1+4+bt.byteLength(t,"utf8")+1;case"number":return Math.floor(t)===t&&t>=qt&&t<=Zt&&t>=Vt&&t<=Ht?(null!=e?bt.byteLength(e,"utf8")+1:0)+5:(null!=e?bt.byteLength(e,"utf8")+1:0)+9;case"undefined":return n||!i?(null!=e?bt.byteLength(e,"utf8")+1:0)+1:0;case"boolean":return(null!=e?bt.byteLength(e,"utf8")+1:0)+2;case"object":if(null==t||"MinKey"===t._bsontype||"MaxKey"===t._bsontype)return(null!=e?bt.byteLength(e,"utf8")+1:0)+1;if("ObjectId"===t._bsontype||"ObjectID"===t._bsontype)return(null!=e?bt.byteLength(e,"utf8")+1:0)+13;if(t instanceof Date||Ut(t))return(null!=e?bt.byteLength(e,"utf8")+1:0)+9;if(ArrayBuffer.isView(t)||t instanceof ArrayBuffer||It(t))return(null!=e?bt.byteLength(e,"utf8")+1:0)+6+t.byteLength;if("Long"===t._bsontype||"Double"===t._bsontype||"Timestamp"===t._bsontype)return(null!=e?bt.byteLength(e,"utf8")+1:0)+9;if("Decimal128"===t._bsontype)return(null!=e?bt.byteLength(e,"utf8")+1:0)+17;if("Code"===t._bsontype)return null!=t.scope&&Object.keys(t.scope).length>0?(null!=e?bt.byteLength(e,"utf8")+1:0)+1+4+4+bt.byteLength(t.code.toString(),"utf8")+1+hn(t.scope,r,i):(null!=e?bt.byteLength(e,"utf8")+1:0)+1+4+bt.byteLength(t.code.toString(),"utf8")+1;if("Binary"===t._bsontype){var o=t;return o.sub_type===gr.SUBTYPE_BYTE_ARRAY?(null!=e?bt.byteLength(e,"utf8")+1:0)+(o.position+1+4+1+4):(null!=e?bt.byteLength(e,"utf8")+1:0)+(o.position+1+4+1)}if("Symbol"===t._bsontype)return(null!=e?bt.byteLength(e,"utf8")+1:0)+bt.byteLength(t.value,"utf8")+4+1+1;if("DBRef"===t._bsontype){var s=Object.assign({$ref:t.collection,$id:t.oid},t.fields);return null!=t.db&&(s.$db=t.db),(null!=e?bt.byteLength(e,"utf8")+1:0)+1+hn(s,r,i)}return t instanceof RegExp||Lt(t)?(null!=e?bt.byteLength(e,"utf8")+1:0)+1+bt.byteLength(t.source,"utf8")+1+(t.global?1:0)+(t.ignoreCase?1:0)+(t.multiline?1:0)+1:"BSONRegExp"===t._bsontype?(null!=e?bt.byteLength(e,"utf8")+1:0)+1+bt.byteLength(t.pattern,"utf8")+1+bt.byteLength(t.options,"utf8")+1:(null!=e?bt.byteLength(e,"utf8")+1:0)+hn(t,r,i)+1;case"function":if(t instanceof RegExp||Lt(t)||"[object RegExp]"===String.call(t))return(null!=e?bt.byteLength(e,"utf8")+1:0)+1+bt.byteLength(t.source,"utf8")+1+(t.global?1:0)+(t.ignoreCase?1:0)+(t.multiline?1:0)+1;if(r&&null!=t.scope&&Object.keys(t.scope).length>0)return(null!=e?bt.byteLength(e,"utf8")+1:0)+1+4+4+bt.byteLength(kt(t),"utf8")+1+hn(t.scope,r,i);if(r)return(null!=e?bt.byteLength(e,"utf8")+1:0)+1+4+bt.byteLength(kt(t),"utf8")+1}return 0}cn=ln.Map?ln.Map:function(){function e(e){void 0===e&&(e=[]),this._keys=[],this._values={};for(var t=0;t<e.length;t++)if(null!=e[t]){var r=e[t],n=r[0],i=r[1];this._keys.push(n),this._values[n]={v:i,i:this._keys.length-1}}}return e.prototype.clear=function(){this._keys=[],this._values={}},e.prototype.delete=function(e){var t=this._values[e];return null!=t&&(delete this._values[e],this._keys.splice(t.i,1),!0)},e.prototype.entries=function(){var e=this,t=0;return{next:function(){var r=e._keys[t++];return{value:void 0!==r?[r,e._values[r].v]:void 0,done:void 0===r}}}},e.prototype.forEach=function(e,t){t=t||this;for(var r=0;r<this._keys.length;r++){var n=this._keys[r];e.call(t,this._values[n].v,n,t)}},e.prototype.get=function(e){return this._values[e]?this._values[e].v:void 0},e.prototype.has=function(e){return null!=this._values[e]},e.prototype.keys=function(){var e=this,t=0;return{next:function(){var r=e._keys[t++];return{value:void 0!==r?r:void 0,done:void 0===r}}}},e.prototype.set=function(e,t){return this._values[e]?(this._values[e].v=t,this):(this._keys.push(e),this._values[e]={v:t,i:this._keys.length-1},this)},e.prototype.values=function(){var e=this,t=0;return{next:function(){var r=e._keys[t++];return{value:void 0!==r?e._values[r].v:void 0,done:void 0===r}}}},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),e}();var dn=128,yn=192,gn=224,mn=240,vn=248,bn=192,_n=224,wn=240,En=128;function xn(e,t,r){for(var n=0,i=t;i<r;i+=1){var o=e[i];if(n){if((o&yn)!==En)return!1;n-=1}else if(o&dn)if((o&gn)===bn)n=1;else if((o&mn)===_n)n=2;else{if((o&vn)!==wn)return!1;n=3}}return!n}var Bn=kr.fromNumber(Zt),An=kr.fromNumber(qt),Sn={};function kn(e,t,r){var n=(t=null==t?{}:t)&&t.index?t.index:0,i=e[n]|e[n+1]<<8|e[n+2]<<16|e[n+3]<<24;if(i<5)throw new xt("bson size must be >= 5, is ".concat(i));if(t.allowObjectSmallerThanBufferSize&&e.length<i)throw new xt("buffer length ".concat(e.length," must be >= bson size ").concat(i));if(!t.allowObjectSmallerThanBufferSize&&e.length!==i)throw new xt("buffer length ".concat(e.length," must === bson size ").concat(i));if(i+n>e.byteLength)throw new xt("(bson size ".concat(i," + options.index ").concat(n," must be <= buffer length ").concat(e.byteLength,")"));if(0!==e[n+i-1])throw new xt("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return On(e,n,t,r)}var Tn=/^\$ref$|^\$id$|^\$db$/;function On(e,t,r,n){void 0===n&&(n=!1);var i,o=null!=r.evalFunctions&&r.evalFunctions,s=null!=r.cacheFunctions&&r.cacheFunctions,a=null==r.fieldsAsRaw?null:r.fieldsAsRaw,u=null!=r.raw&&r.raw,c="boolean"==typeof r.bsonRegExp&&r.bsonRegExp,f=null!=r.promoteBuffers&&r.promoteBuffers,l=null==r.promoteLongs||r.promoteLongs,h=null==r.promoteValues||r.promoteValues,p=null==r.validation?{utf8:!0}:r.validation,d=!0,y=new Set,g=p.utf8;if("boolean"==typeof g)i=g;else{d=!1;var m=Object.keys(g).map((function(e){return g[e]}));if(0===m.length)throw new xt("UTF-8 validation setting cannot be empty");if("boolean"!=typeof m[0])throw new xt("Invalid UTF-8 validation option, must specify boolean values");if(i=m[0],!m.every((function(e){return e===i})))throw new xt("Invalid UTF-8 validation option - keys must be all true or all false")}if(!d)for(var v=0,b=Object.keys(g);v<b.length;v++){var _=b[v];y.add(_)}var w=t;if(e.length<5)throw new xt("corrupt bson message < 5 bytes long");var E=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(E<5||E>e.length)throw new xt("corrupt bson message");for(var x=n?[]:{},B=0,A=!n&&null,S=new DataView(e.buffer,e.byteOffset,e.byteLength);;){var k=e[t++];if(0===k)break;for(var T=t;0!==e[T]&&T<e.length;)T++;if(T>=e.byteLength)throw new xt("Bad BSON Document: illegal CString");var O,I=n?B++:e.toString("utf8",t,T);O=d||y.has(I)?i:!i,!1!==A&&"$"===I[0]&&(A=Tn.test(I));var N=void 0;if(t=T+1,k===Jt){if((te=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<=0||te>e.length-t||0!==e[t+te-1])throw new xt("bad string length in bson");N=Nn(e,t,t+te-1,O),t+=te}else if(k===Qt){var F=bt.alloc(12);e.copy(F,0,t,t+12),N=new Jr(F),t+=12}else if(k===ur&&!1===h)N=new $r(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24);else if(k===ur)N=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;else if(k===Gt&&!1===h)N=new zr(S.getFloat64(t,!0)),t+=8;else if(k===Gt)N=S.getFloat64(t,!0),t+=8;else if(k===tr){var R=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,L=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;N=new Date(new kr(R,L).toNumber())}else if(k===er){if(0!==e[t]&&1!==e[t])throw new xt("illegal boolean type value");N=1===e[t++]}else if(k===Wt){var U=t;if((Q=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)<=0||Q>e.length-t)throw new xt("bad embedded document length in bson");if(u)N=e.slice(t,t+Q);else{var C=r;d||(C=Et(Et({},r),{validation:{utf8:O}})),N=On(e,U,C,!1)}t+=Q}else if(k===Yt){U=t;var j=r,D=t+(Q=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24);if(a&&a[I]){for(var M in j={},r)j[M]=r[M];j.raw=!0}if(d||(j=Et(Et({},j),{validation:{utf8:O}})),N=On(e,U,j,!0),0!==e[(t+=Q)-1])throw new xt("invalid array terminator byte");if(t!==D)throw new xt("corrupted array bson")}else if(k===Xt)N=void 0;else if(k===rr)N=null;else if(k===fr){R=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,L=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;var P=new kr(R,L);N=l&&!0===h&&P.lessThanOrEqual(Bn)&&P.greaterThanOrEqual(An)?P.toNumber():P}else if(k===lr){var z=bt.alloc(16);e.copy(z,0,t,t+16),t+=16;var $=new Pr(z);N="toObject"in $&&"function"==typeof $.toObject?$.toObject():$}else if(k===Kt){var H=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,V=H,Z=e[t++];if(H<0)throw new xt("Negative binary type element size found");if(H>e.byteLength)throw new xt("Binary type size larger than document size");if(null!=e.slice){if(Z===gr.SUBTYPE_BYTE_ARRAY){if((H=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<0)throw new xt("Negative binary type element size found for subtype 0x02");if(H>V-4)throw new xt("Binary type with subtype 0x02 contains too long binary size");if(H<V-4)throw new xt("Binary type with subtype 0x02 contains too short binary size")}f&&h?N=e.slice(t,t+H):(N=new gr(e.slice(t,t+H),Z),Z===yr&&(N=N.toUUID()))}else{var q=bt.alloc(H);if(Z===gr.SUBTYPE_BYTE_ARRAY){if((H=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<0)throw new xt("Negative binary type element size found for subtype 0x02");if(H>V-4)throw new xt("Binary type with subtype 0x02 contains too long binary size");if(H<V-4)throw new xt("Binary type with subtype 0x02 contains too short binary size")}for(T=0;T<H;T++)q[T]=e[t+T];N=f&&h?q:Z===yr?new gr(e.slice(t,t+H),Z).toUUID():new gr(e.slice(t,t+H),Z)}t+=H}else if(k===nr&&!1===c){for(T=t;0!==e[T]&&T<e.length;)T++;if(T>=e.length)throw new xt("Bad BSON Document: illegal CString");var G=e.toString("utf8",t,T);for(T=t=T+1;0!==e[T]&&T<e.length;)T++;if(T>=e.length)throw new xt("Bad BSON Document: illegal CString");var J=e.toString("utf8",t,T);t=T+1;var W=new Array(J.length);for(T=0;T<J.length;T++)switch(J[T]){case"m":W[T]="m";break;case"s":W[T]="g";break;case"i":W[T]="i"}N=new RegExp(G,W.join(""))}else if(k===nr&&!0===c){for(T=t;0!==e[T]&&T<e.length;)T++;if(T>=e.length)throw new xt("Bad BSON Document: illegal CString");for(G=e.toString("utf8",t,T),T=t=T+1;0!==e[T]&&T<e.length;)T++;if(T>=e.length)throw new xt("Bad BSON Document: illegal CString");J=e.toString("utf8",t,T),t=T+1,N=new Wr(G,J)}else if(k===sr){if((te=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<=0||te>e.length-t||0!==e[t+te-1])throw new xt("bad string length in bson");var Y=Nn(e,t,t+te-1,O);N=h?Y:new Yr(Y),t+=te}else if(k===cr)R=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,L=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,N=new Kr(R,L);else if(k===hr)N=new Vr;else if(k===pr)N=new Hr;else if(k===or){if((te=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<=0||te>e.length-t||0!==e[t+te-1])throw new xt("bad string length in bson");var K=Nn(e,t,t+te-1,O);N=o?s?In(K,Sn,x):In(K):new vr(K),t+=te}else if(k===ar){var X=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(X<13)throw new xt("code_w_scope total size shorter minimum expected length");if((te=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<=0||te>e.length-t||0!==e[t+te-1])throw new xt("bad string length in bson");K=Nn(e,t,t+te-1,O),U=t+=te;var Q=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24,ee=On(e,U,r,!1);if(t+=Q,X<8+Q+te)throw new xt("code_w_scope total size is too short, truncating scope");if(X>8+Q+te)throw new xt("code_w_scope total size is too long, clips outer document");o?(N=s?In(K,Sn,x):In(K)).scope=ee:N=new vr(K,ee)}else{if(k!==ir)throw new xt("Detected unknown BSON type ".concat(k.toString(16),' for fieldname "').concat(I,'"'));var te;if((te=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<=0||te>e.length-t||0!==e[t+te-1])throw new xt("bad string length in bson");if(null!=p&&p.utf8&&!xn(e,t,t+te-1))throw new xt("Invalid UTF-8 string in BSON document");var re=e.toString("utf8",t,t+te-1);t+=te;var ne=bt.alloc(12);e.copy(ne,0,t,t+12),F=new Jr(ne),t+=12,N=new _r(re,F)}"__proto__"===I?Object.defineProperty(x,I,{value:N,writable:!0,enumerable:!0,configurable:!0}):x[I]=N}if(E!==t-w){if(n)throw new xt("corrupt array bson");throw new xt("corrupt object bson")}if(!A)return x;if(br(x)){var ie=Object.assign({},x);return delete ie.$ref,delete ie.$id,delete ie.$db,new _r(x.$ref,x.$id,x.$db,ie)}return x}function In(e,t,r){return t?(null==t[e]&&(t[e]=new Function(e)),t[e].bind(r)):new Function(e)}function Nn(e,t,r,n){var i=e.toString("utf8",t,r);if(n)for(var o=0;o<i.length;o++)if(65533===i.charCodeAt(o)){if(!xn(e,t,r))throw new xt("Invalid UTF-8 string in BSON document");break}return i}var Fn=/\x00/,Rn=new Set(["$db","$ref","$id","$clusterTime"]);function Ln(e,t,r,n,i){e[n++]=Jt;var o=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8");e[(n=n+o+1)-1]=0;var s=e.write(r,n+4,void 0,"utf8");return e[n+3]=s+1>>24&255,e[n+2]=s+1>>16&255,e[n+1]=s+1>>8&255,e[n]=s+1&255,n=n+4+s,e[n++]=0,n}var Un=new Uint8Array(8),Cn=new DataView(Un.buffer,Un.byteOffset,Un.byteLength);function jn(e,t,r,n,i){return Number.isInteger(r)&&r>=Vt&&r<=Ht?(e[n++]=ur,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,e[n++]=255&r,e[n++]=r>>8&255,e[n++]=r>>16&255,e[n++]=r>>24&255):(e[n++]=Gt,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,Cn.setFloat64(0,r,!0),e.set(Un,n),n+=8),n}function Dn(e,t,r,n,i){return e[n++]=rr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,n}function Mn(e,t,r,n,i){return e[n++]=er,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,e[n++]=r?1:0,n}function Pn(e,t,r,n,i){e[n++]=tr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var o=kr.fromNumber(r.getTime()),s=o.getLowBits(),a=o.getHighBits();return e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255,e[n++]=255&a,e[n++]=a>>8&255,e[n++]=a>>16&255,e[n++]=a>>24&255,n}function zn(e,t,r,n,i){if(e[n++]=nr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,r.source&&null!=r.source.match(Fn))throw Error("value "+r.source+" must not contain null bytes");return n+=e.write(r.source,n,void 0,"utf8"),e[n++]=0,r.ignoreCase&&(e[n++]=105),r.global&&(e[n++]=115),r.multiline&&(e[n++]=109),e[n++]=0,n}function $n(e,t,r,n,i){if(e[n++]=nr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,null!=r.pattern.match(Fn))throw Error("pattern "+r.pattern+" must not contain null bytes");return n+=e.write(r.pattern,n,void 0,"utf8"),e[n++]=0,n+=e.write(r.options.split("").sort().join(""),n,void 0,"utf8"),e[n++]=0,n}function Hn(e,t,r,n,i){return null===r?e[n++]=rr:"MinKey"===r._bsontype?e[n++]=hr:e[n++]=pr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,n}function Vn(e,t,r,n,i){if(e[n++]=Qt,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,"string"==typeof r.id)e.write(r.id,n,void 0,"binary");else{if(!Nt(r.id))throw new Bt("object ["+JSON.stringify(r)+"] is not a valid ObjectId");e.set(r.id.subarray(0,12),n)}return n+12}function Zn(e,t,r,n,i){e[n++]=Kt,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var o=r.length;return e[n++]=255&o,e[n++]=o>>8&255,e[n++]=o>>16&255,e[n++]=o>>24&255,e[n++]=dr,e.set(Dt(r),n),n+o}function qn(e,t,r,n,i,o,s,a,u,c){void 0===i&&(i=!1),void 0===o&&(o=0),void 0===s&&(s=!1),void 0===a&&(a=!0),void 0===u&&(u=!1),void 0===c&&(c=[]);for(var f=0;f<c.length;f++)if(c[f]===r)throw new xt("cyclic dependency detected");c.push(r),e[n++]=Array.isArray(r)?Yt:Wt,n+=u?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var l=ri(e,r,i,n,o+1,s,a,c);return c.pop(),l}function Gn(e,t,r,n,i){return e[n++]=lr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,e.set(r.bytes.subarray(0,16),n),n+16}function Jn(e,t,r,n,i){e[n++]="Long"===r._bsontype?fr:cr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var o=r.getLowBits(),s=r.getHighBits();return e[n++]=255&o,e[n++]=o>>8&255,e[n++]=o>>16&255,e[n++]=o>>24&255,e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255,n}function Wn(e,t,r,n,i){return r=r.valueOf(),e[n++]=ur,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,e[n++]=255&r,e[n++]=r>>8&255,e[n++]=r>>16&255,e[n++]=r>>24&255,n}function Yn(e,t,r,n,i){return e[n++]=Gt,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,Cn.setFloat64(0,r.value,!0),e.set(Un,n),n+8}function Kn(e,t,r,n,i,o,s){e[n++]=or,n+=s?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var a=kt(r),u=e.write(a,n+4,void 0,"utf8")+1;return e[n]=255&u,e[n+1]=u>>8&255,e[n+2]=u>>16&255,e[n+3]=u>>24&255,n=n+4+u-1,e[n++]=0,n}function Xn(e,t,r,n,i,o,s,a,u){if(void 0===i&&(i=!1),void 0===o&&(o=0),void 0===s&&(s=!1),void 0===a&&(a=!0),void 0===u&&(u=!1),r.scope&&"object"==typeof r.scope){e[n++]=ar,n+=u?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var c=n,f="string"==typeof r.code?r.code:r.code.toString();n+=4;var l=e.write(f,n+4,void 0,"utf8")+1;e[n]=255&l,e[n+1]=l>>8&255,e[n+2]=l>>16&255,e[n+3]=l>>24&255,e[n+4+l-1]=0,n=n+l+4;var h=ri(e,r.scope,i,n,o+1,s,a);n=h-1;var p=h-c;e[c++]=255&p,e[c++]=p>>8&255,e[c++]=p>>16&255,e[c++]=p>>24&255,e[n++]=0}else{e[n++]=or,n+=u?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,f=r.code.toString();var d=e.write(f,n+4,void 0,"utf8")+1;e[n]=255&d,e[n+1]=d>>8&255,e[n+2]=d>>16&255,e[n+3]=d>>24&255,n=n+4+d-1,e[n++]=0}return n}function Qn(e,t,r,n,i){e[n++]=Kt,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var o=r.value(!0),s=r.position;return r.sub_type===gr.SUBTYPE_BYTE_ARRAY&&(s+=4),e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255,e[n++]=r.sub_type,r.sub_type===gr.SUBTYPE_BYTE_ARRAY&&(s-=4,e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255),e.set(o,n),n+r.position}function ei(e,t,r,n,i){e[n++]=sr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var o=e.write(r.value,n+4,void 0,"utf8")+1;return e[n]=255&o,e[n+1]=o>>8&255,e[n+2]=o>>16&255,e[n+3]=o>>24&255,n=n+4+o-1,e[n++]=0,n}function ti(e,t,r,n,i,o,s){e[n++]=Wt,n+=s?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var a=n,u={$ref:r.collection||r.namespace,$id:r.oid};null!=r.db&&(u.$db=r.db);var c=ri(e,u=Object.assign(u,r.fields),!1,n,i+1,o),f=c-a;return e[a++]=255&f,e[a++]=f>>8&255,e[a++]=f>>16&255,e[a++]=f>>24&255,c}function ri(e,t,r,n,i,o,s,a){void 0===r&&(r=!1),void 0===n&&(n=0),void 0===i&&(i=0),void 0===o&&(o=!1),void 0===s&&(s=!0),void 0===a&&(a=[]),n=n||0,(a=a||[]).push(t);var u,c=n+4;if(Array.isArray(t))for(var f=0;f<t.length;f++){var l="".concat(f);if("function"==typeof(null==(g=t[f])?void 0:g.toBSON)&&(g=g.toBSON()),"string"==typeof g)c=Ln(e,l,g,c,!0);else if("number"==typeof g)c=jn(e,l,g,c,!0);else{if("bigint"==typeof g)throw new Bt("Unsupported type BigInt, please use Decimal128");if("boolean"==typeof g)c=Mn(e,l,g,c,!0);else if(g instanceof Date||Ut(g))c=Pn(e,l,g,c,!0);else if(void 0===g)c=Dn(e,l,0,c,!0);else if(null===g)c=Dn(e,l,0,c,!0);else if("ObjectId"===g._bsontype||"ObjectID"===g._bsontype)c=Vn(e,l,g,c,!0);else if(Nt(g))c=Zn(e,l,g,c,!0);else if(g instanceof RegExp||Lt(g))c=zn(e,l,g,c,!0);else if("object"==typeof g&&null==g._bsontype)c=qn(e,l,g,c,r,i,o,s,!0,a);else if("object"==typeof g&&Xr(g)&&"Decimal128"===g._bsontype)c=Gn(e,l,g,c,!0);else if("Long"===g._bsontype||"Timestamp"===g._bsontype)c=Jn(e,l,g,c,!0);else if("Double"===g._bsontype)c=Yn(e,l,g,c,!0);else if("function"==typeof g&&o)c=Kn(e,l,g,c,0,0,!0);else if("Code"===g._bsontype)c=Xn(e,l,g,c,r,i,o,s,!0);else if("Binary"===g._bsontype)c=Qn(e,l,g,c,!0);else if("Symbol"===g._bsontype)c=ei(e,l,g,c,!0);else if("DBRef"===g._bsontype)c=ti(e,l,g,c,i,o,!0);else if("BSONRegExp"===g._bsontype)c=$n(e,l,g,c,!0);else if("Int32"===g._bsontype)c=Wn(e,l,g,c,!0);else if("MinKey"===g._bsontype||"MaxKey"===g._bsontype)c=Hn(e,l,g,c,!0);else if(void 0!==g._bsontype)throw new Bt("Unrecognized or invalid _bsontype: ".concat(String(g._bsontype)))}}else if(t instanceof cn||(u=t,"[object Map]"===Object.prototype.toString.call(u)))for(var h=t.entries(),p=!1;!p;){var d=h.next();if(!(p=!!d.done)){l=d.value[0];var y=typeof(g=d.value[1]);if("string"==typeof l&&!Rn.has(l)){if(null!=l.match(Fn))throw Error("key "+l+" must not contain null bytes");if(r){if("$"===l[0])throw Error("key "+l+" must not start with '$'");if(~l.indexOf("."))throw Error("key "+l+" must not contain '.'")}}if("string"===y)c=Ln(e,l,g,c);else if("number"===y)c=jn(e,l,g,c);else{if("bigint"===y||Ft(g)||Rt(g))throw new Bt("Unsupported type BigInt, please use Decimal128");if("boolean"===y)c=Mn(e,l,g,c);else if(g instanceof Date||Ut(g))c=Pn(e,l,g,c);else if(null===g||void 0===g&&!1===s)c=Dn(e,l,0,c);else if("ObjectId"===g._bsontype||"ObjectID"===g._bsontype)c=Vn(e,l,g,c);else if(Nt(g))c=Zn(e,l,g,c);else if(g instanceof RegExp||Lt(g))c=zn(e,l,g,c);else if("object"===y&&null==g._bsontype)c=qn(e,l,g,c,r,i,o,s,!1,a);else if("object"===y&&"Decimal128"===g._bsontype)c=Gn(e,l,g,c);else if("Long"===g._bsontype||"Timestamp"===g._bsontype)c=Jn(e,l,g,c);else if("Double"===g._bsontype)c=Yn(e,l,g,c);else if("Code"===g._bsontype)c=Xn(e,l,g,c,r,i,o,s);else if("function"==typeof g&&o)c=Kn(e,l,g,c,0,0,o);else if("Binary"===g._bsontype)c=Qn(e,l,g,c);else if("Symbol"===g._bsontype)c=ei(e,l,g,c);else if("DBRef"===g._bsontype)c=ti(e,l,g,c,i,o);else if("BSONRegExp"===g._bsontype)c=$n(e,l,g,c);else if("Int32"===g._bsontype)c=Wn(e,l,g,c);else if("MinKey"===g._bsontype||"MaxKey"===g._bsontype)c=Hn(e,l,g,c);else if(void 0!==g._bsontype)throw new Bt("Unrecognized or invalid _bsontype: ".concat(String(g._bsontype)))}}}else{if("function"==typeof(null==t?void 0:t.toBSON)&&null!=(t=t.toBSON())&&"object"!=typeof t)throw new Bt("toBSON function did not return an object");for(var l in t){var g;if("function"==typeof(null==(g=t[l])?void 0:g.toBSON)&&(g=g.toBSON()),y=typeof g,"string"==typeof l&&!Rn.has(l)){if(null!=l.match(Fn))throw Error("key "+l+" must not contain null bytes");if(r){if("$"===l[0])throw Error("key "+l+" must not start with '$'");if(~l.indexOf("."))throw Error("key "+l+" must not contain '.'")}}if("string"===y)c=Ln(e,l,g,c);else if("number"===y)c=jn(e,l,g,c);else{if("bigint"===y)throw new Bt("Unsupported type BigInt, please use Decimal128");if("boolean"===y)c=Mn(e,l,g,c);else if(g instanceof Date||Ut(g))c=Pn(e,l,g,c);else if(void 0===g)!1===s&&(c=Dn(e,l,0,c));else if(null===g)c=Dn(e,l,0,c);else if("ObjectId"===g._bsontype||"ObjectID"===g._bsontype)c=Vn(e,l,g,c);else if(Nt(g))c=Zn(e,l,g,c);else if(g instanceof RegExp||Lt(g))c=zn(e,l,g,c);else if("object"===y&&null==g._bsontype)c=qn(e,l,g,c,r,i,o,s,!1,a);else if("object"===y&&"Decimal128"===g._bsontype)c=Gn(e,l,g,c);else if("Long"===g._bsontype||"Timestamp"===g._bsontype)c=Jn(e,l,g,c);else if("Double"===g._bsontype)c=Yn(e,l,g,c);else if("Code"===g._bsontype)c=Xn(e,l,g,c,r,i,o,s);else if("function"==typeof g&&o)c=Kn(e,l,g,c,0,0,o);else if("Binary"===g._bsontype)c=Qn(e,l,g,c);else if("Symbol"===g._bsontype)c=ei(e,l,g,c);else if("DBRef"===g._bsontype)c=ti(e,l,g,c,i,o);else if("BSONRegExp"===g._bsontype)c=$n(e,l,g,c);else if("Int32"===g._bsontype)c=Wn(e,l,g,c);else if("MinKey"===g._bsontype||"MaxKey"===g._bsontype)c=Hn(e,l,g,c);else if(void 0!==g._bsontype)throw new Bt("Unrecognized or invalid _bsontype: ".concat(String(g._bsontype)))}}}a.pop(),e[c++]=0;var m=c-n;return e[n++]=255&m,e[n++]=m>>8&255,e[n++]=m>>16&255,e[n++]=m>>24&255,c}var ni=17825792,ii=bt.alloc(ni),oi={Binary:gr,Code:vr,DBRef:_r,Decimal128:Pr,Double:zr,Int32:$r,Long:kr,UUID:mr,Map:cn,MaxKey:Hr,MinKey:Vr,ObjectId:Jr,ObjectID:Jr,BSONRegExp:Wr,BSONSymbol:Yr,Timestamp:Kr,EJSON:un,setInternalBufferSize:function(e){ii.length<e&&(ii=bt.alloc(e))},serialize:function(e,t){void 0===t&&(t={});var r="boolean"==typeof t.checkKeys&&t.checkKeys,n="boolean"==typeof t.serializeFunctions&&t.serializeFunctions,i="boolean"!=typeof t.ignoreUndefined||t.ignoreUndefined,o="number"==typeof t.minInternalBufferSize?t.minInternalBufferSize:ni;ii.length<o&&(ii=bt.alloc(o));var s=ri(ii,e,r,0,0,n,i,[]),a=bt.alloc(s);return ii.copy(a,0,0,a.length),a},serializeWithBufferAndIndex:function(e,t,r){void 0===r&&(r={});var n="boolean"==typeof r.checkKeys&&r.checkKeys,i="boolean"==typeof r.serializeFunctions&&r.serializeFunctions,o="boolean"!=typeof r.ignoreUndefined||r.ignoreUndefined,s="number"==typeof r.index?r.index:0,a=ri(ii,e,n,0,0,i,o);return ii.copy(t,s,0,a),s+a-1},deserialize:function(e,t){return void 0===t&&(t={}),kn(e instanceof bt?e:Dt(e),t)},calculateObjectSize:function(e,t){return void 0===t&&(t={}),hn(e,"boolean"==typeof(t=t||{}).serializeFunctions&&t.serializeFunctions,"boolean"!=typeof t.ignoreUndefined||t.ignoreUndefined)},deserializeStream:function(e,t,r,n,i,o){for(var s=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},o),a=Dt(e),u=t,c=0;c<r;c++){var f=a[u]|a[u+1]<<8|a[u+2]<<16|a[u+3]<<24;s.index=u,n[i+c]=kn(a,s),u+=f}return u},BSONError:xt,BSONTypeError:Bt};const si=oi;var ai=r(48287).Buffer;function ui(e,t,r){return t=a(t),s(e,ci()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function ci(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ci=function(){return!!e})()}const fi=function(t){function r(){var t;return e(this,r),(t=ui(this,r)).name="BSON deserialise",t.module="Serialise",t.description="BSON is a computer data interchange format used mainly as a data storage and network transfer format in the MongoDB database. It is a binary form for representing simple data structures, associative arrays (called objects or documents in MongoDB), and various data types of specific interest to MongoDB. The name 'BSON' is based on the term JSON and stands for 'Binary JSON'.<br><br>Input data should be in a raw bytes format.",t.infoURL="https://wikipedia.org/wiki/BSON",t.inputType="ArrayBuffer",t.outputType="string",t.args=[],t}return c(r,t),o(r,[{key:"run",value:function(e,t){if(!e.byteLength)return"";try{var r=si.deserialize(new ai(e));return JSON.stringify(r,null,2)}catch(e){throw new x(e.toString())}}}])}(Qe);function li(e,t,r){return t=a(t),s(e,hi()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function hi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hi=function(){return!!e})()}const pi=function(t){function r(){var t;return e(this,r),(t=li(this,r)).name="BSON serialise",t.module="Serialise",t.description="BSON is a computer data interchange format used mainly as a data storage and network transfer format in the MongoDB database. It is a binary form for representing simple data structures, associative arrays (called objects or documents in MongoDB), and various data types of specific interest to MongoDB. The name 'BSON' is based on the term JSON and stands for 'Binary JSON'.<br><br>Input data should be valid JSON.",t.infoURL="https://wikipedia.org/wiki/BSON",t.inputType="string",t.outputType="ArrayBuffer",t.args=[],t}return c(r,t),o(r,[{key:"run",value:function(e,t){if(!e)return new ArrayBuffer;try{var r=JSON.parse(e);return si.serialize(r).buffer}catch(e){throw new x(e.toString())}}}])}(Qe);var di=r(49881),yi=r.n(di),gi=r(48287).Buffer;function mi(e,t,r){return t=a(t),s(e,vi()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function vi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vi=function(){return!!e})()}const bi=function(t){function r(){var t;return e(this,r),(t=mi(this,r)).name="CBOR Decode",t.module="Serialise",t.description="Concise Binary Object Representation (CBOR) is a binary data serialization format loosely based on JSON. Like JSON it allows the transmission of data objects that contain name–value pairs, but in a more concise manner. This increases processing and transfer speeds at the cost of human readability. It is defined in IETF RFC 8949.",t.infoURL="https://wikipedia.org/wiki/CBOR",t.inputType="ArrayBuffer",t.outputType="JSON",t.args=[],t}return c(r,t),o(r,[{key:"run",value:function(e,t){return yi().decodeFirstSync(gi.from(e).toString("hex"))}}])}(Qe);function _i(e,t,r){return t=a(t),s(e,wi()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function wi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wi=function(){return!!e})()}const Ei=function(t){function r(){var t;return e(this,r),(t=_i(this,r)).name="CBOR Encode",t.module="Serialise",t.description="Concise Binary Object Representation (CBOR) is a binary data serialization format loosely based on JSON. Like JSON it allows the transmission of data objects that contain name–value pairs, but in a more concise manner. This increases processing and transfer speeds at the cost of human readability. It is defined in IETF RFC 8949.",t.infoURL="https://wikipedia.org/wiki/CBOR",t.inputType="JSON",t.outputType="ArrayBuffer",t.args=[],t}return c(r,t),o(r,[{key:"run",value:function(e,t){return new Uint8Array(yi().encodeCanonical(e)).buffer}}])}(Qe);function xi(e,t,r){return t=a(t),s(e,Bi()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function Bi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bi=function(){return!!e})()}const Ai=function(t){function r(){var t;return e(this,r),(t=xi(this,r)).name="Parse ObjectID timestamp",t.module="Serialise",t.description="Parse timestamp from MongoDB/BSON ObjectID hex string.",t.infoURL="https://docs.mongodb.com/manual/reference/method/ObjectId.getTimestamp/",t.inputType="string",t.outputType="string",t.args=[],t}return c(r,t),o(r,[{key:"run",value:function(e,t){try{return new si.ObjectID(e).getTimestamp().toISOString()}catch(e){throw new x(e)}}}])}(Qe);("undefined"==typeof self?{}:self.OpModules||{}).Serialise={"Avro to JSON":it,"BSON deserialise":fi,"BSON serialise":pi,"CBOR Decode":bi,"CBOR Encode":Ei,"Parse ObjectID timestamp":Ai}})()})(); |