"use strict";var util=exports;function merge(e,t,r){for(var i=Object.keys(t),u=0;u<i.length;++u)void 0!==e[i[u]]&&r||(e[i[u]]=t[i[u]]);return e}function newError(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:Error().stack||""}),r&&merge(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}util.asPromise=require("@protobufjs/aspromise"),util.base64=require("@protobufjs/base64"),util.EventEmitter=require("@protobufjs/eventemitter"),util.float=require("@protobufjs/float"),util.inquire=require("@protobufjs/inquire"),util.utf8=require("@protobufjs/utf8"),util.pool=require("@protobufjs/pool"),util.LongBits=require("./longbits"),util.isNode=!!("undefined"!=typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),util.global=util.isNode&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,util.emptyArray=Object.freeze?Object.freeze([]):[],util.emptyObject=Object.freeze?Object.freeze({}):{},util.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},util.isString=function(e){return"string"==typeof e||e instanceof String},util.isObject=function(e){return e&&"object"==typeof e},util.isset=util.isSet=function(e,t){var r=e[t];return!!(null!=r&&e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},util.Buffer=function(){try{var e=util.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),util._Buffer_from=null,util._Buffer_allocUnsafe=null,util.newBuffer=function(e){return"number"==typeof e?util.Buffer?util._Buffer_allocUnsafe(e):new util.Array(e):util.Buffer?util._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},util.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,util.Long=util.global.dcodeIO&&util.global.dcodeIO.Long||util.global.Long||util.inquire("long"),util.key2Re=/^true|false|0|1$/,util.key32Re=/^-?(?:0|[1-9][0-9]*)$/,util.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,util.longToHash=function(e){return e?util.LongBits.from(e).toHash():util.LongBits.zeroHash},util.longFromHash=function(e,t){var r=util.LongBits.fromHash(e);return util.Long?util.Long.fromBits(r.lo,r.hi,t):r.toNumber(!!t)},util.merge=merge,util.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},util.newError=newError,util.ProtocolError=newError("ProtocolError"),util.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},util.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},util.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},util._configure=function(){var e=util.Buffer;if(!e){util._Buffer_from=util._Buffer_allocUnsafe=null;return}util._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},util._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}};