"use strict";var util=exports;function merge(t,r,e){for(var u=Object.keys(r),i=0;i<u.length;++i)void 0!==t[u[i]]&&e||(t[u[i]]=r[u[i]]);return t}function newError(t){function r(t,e){if(!(this instanceof r))return new r(t,e);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,r):Object.defineProperty(this,"stack",{value:Error().stack||""}),e&&merge(this,e)}return r.prototype=Object.create(Error.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),r}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=!!("u">typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),util.global=util.isNode&&global||"u">typeof window&&window||"u">typeof self&&self||this,util.emptyArray=Object.freeze?Object.freeze([]):[],util.emptyObject=Object.freeze?Object.freeze({}):{},util.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},util.isString=function(t){return"string"==typeof t||t instanceof String},util.isObject=function(t){return t&&"object"==typeof t},util.isset=util.isSet=function(t,r){var e=t[r];return!!(null!=e&&t.hasOwnProperty(r))&&("object"!=typeof e||(Array.isArray(e)?e.length:Object.keys(e).length)>0)},util.Buffer=function(){try{var t=util.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),util._Buffer_from=null,util._Buffer_allocUnsafe=null,util.newBuffer=function(t){return"number"==typeof t?util.Buffer?util._Buffer_allocUnsafe(t):new util.Array(t):util.Buffer?util._Buffer_from(t):"u"<typeof Uint8Array?t:new Uint8Array(t)},util.Array="u">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(t){return t?util.LongBits.from(t).toHash():util.LongBits.zeroHash},util.longFromHash=function(t,r){var e=util.LongBits.fromHash(t);return util.Long?util.Long.fromBits(e.lo,e.hi,r):e.toNumber(!!r)},util.merge=merge,util.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},util.newError=newError,util.ProtocolError=newError("ProtocolError"),util.oneOfGetter=function(t){for(var r={},e=0;e<t.length;++e)r[t[e]]=1;return function(){for(var t=Object.keys(this),e=t.length-1;e>-1;--e)if(1===r[t[e]]&&void 0!==this[t[e]]&&null!==this[t[e]])return t[e]}},util.oneOfSetter=function(t){return function(r){for(var e=0;e<t.length;++e)t[e]!==r&&delete this[t[e]]}},util.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},util._configure=function(){var t=util.Buffer;if(!t){util._Buffer_from=util._Buffer_allocUnsafe=null;return}util._Buffer_from=t.from!==Uint8Array.from&&t.from||function(r,e){return new t(r,e)},util._Buffer_allocUnsafe=t.allocUnsafe||function(r){return new t(r)}};