@kvaser/canking-api
Version:
CanKing API to communicate with the CanKing service using Node.js.
1 lines • 260 kB
JavaScript
"use strict";const l=require("long");function yt(){let e=0,i=0;for(let t=0;t<28;t+=7){let a=this.buf[this.pos++];if(e|=(a&127)<<t,(a&128)==0)return this.assertBounds(),[e,i]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,i=(n&112)>>4,(n&128)==0)return this.assertBounds(),[e,i];for(let t=3;t<=31;t+=7){let a=this.buf[this.pos++];if(i|=(a&127)<<t,(a&128)==0)return this.assertBounds(),[e,i]}throw new Error("invalid varint")}function we(e,i,n){for(let r=0;r<28;r=r+7){const f=e>>>r,g=!(!(f>>>7)&&i==0),B=(g?f|128:f)&255;if(n.push(B),!g)return}const t=e>>>28&15|(i&7)<<4,a=i>>3!=0;if(n.push((a?t|128:t)&255),!!a){for(let r=3;r<31;r=r+7){const f=i>>>r,g=!!(f>>>7),B=(g?f|128:f)&255;if(n.push(B),!g)return}n.push(i>>>31&1)}}const Ge=4294967296;function ti(e){const i=e[0]==="-";i&&(e=e.slice(1));const n=1e6;let t=0,a=0;function r(f,g){const B=Number(e.slice(f,g));a*=n,t=t*n+B,t>=Ge&&(a=a+(t/Ge|0),t=t%Ge)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),i?Gr(t,a):ei(t,a)}function xt(e,i){let n=ei(e,i);const t=n.hi&2147483648;t&&(n=Gr(n.lo,n.hi));const a=br(n.lo,n.hi);return t?"-"+a:a}function br(e,i){if({lo:e,hi:i}=Jt(e,i),i<=2097151)return String(Ge*i+e);const n=e&16777215,t=(e>>>24|i<<8)&16777215,a=i>>16&65535;let r=n+t*6777216+a*6710656,f=t+a*8147497,g=a*2;const B=1e7;return r>=B&&(f+=Math.floor(r/B),r%=B),f>=B&&(g+=Math.floor(f/B),f%=B),g.toString()+oi(f)+oi(r)}function Jt(e,i){return{lo:e>>>0,hi:i>>>0}}function ei(e,i){return{lo:e|0,hi:i|0}}function Gr(e,i){return i=~i,e?e=~e+1:i+=1,ei(e,i)}const oi=e=>{const i=String(e);return"0000000".slice(i.length)+i};function si(e,i){if(e>=0){for(;e>127;)i.push(e&127|128),e=e>>>7;i.push(e)}else{for(let n=0;n<9;n++)i.push(e&127|128),e=e>>7;i.push(1)}}function Bt(){let e=this.buf[this.pos++],i=e&127;if((e&128)==0)return this.assertBounds(),i;if(e=this.buf[this.pos++],i|=(e&127)<<7,(e&128)==0)return this.assertBounds(),i;if(e=this.buf[this.pos++],i|=(e&127)<<14,(e&128)==0)return this.assertBounds(),i;if(e=this.buf[this.pos++],i|=(e&127)<<21,(e&128)==0)return this.assertBounds(),i;e=this.buf[this.pos++],i|=(e&15)<<28;for(let n=5;(e&128)!==0&&n<10;n++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),i>>>0}const q=Vt();function Vt(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const n=BigInt("-9223372036854775808"),t=BigInt("9223372036854775807"),a=BigInt("0"),r=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(f){const g=typeof f=="bigint"?f:BigInt(f);if(g>t||g<n)throw new Error(`invalid int64: ${f}`);return g},uParse(f){const g=typeof f=="bigint"?f:BigInt(f);if(g>r||g<a)throw new Error(`invalid uint64: ${f}`);return g},enc(f){return e.setBigInt64(0,this.parse(f),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(f){return e.setBigInt64(0,this.uParse(f),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(f,g){return e.setInt32(0,f,!0),e.setInt32(4,g,!0),e.getBigInt64(0,!0)},uDec(f,g){return e.setInt32(0,f,!0),e.setInt32(4,g,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(n){return typeof n!="string"&&(n=n.toString()),ui(n),n},uParse(n){return typeof n!="string"&&(n=n.toString()),li(n),n},enc(n){return typeof n!="string"&&(n=n.toString()),ui(n),ti(n)},uEnc(n){return typeof n!="string"&&(n=n.toString()),li(n),ti(n)},dec(n,t){return xt(n,t)},uDec(n,t){return br(n,t)}}}function ui(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function li(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}const He=Symbol.for("@bufbuild/protobuf/text-encoding");function Dr(){if(globalThis[He]==null){const e=new globalThis.TextEncoder,i=new globalThis.TextDecoder;globalThis[He]={encodeUtf8(n){return e.encode(n)},decodeUtf8(n){return i.decode(n)},checkUtf8(n){try{return encodeURIComponent(n),!0}catch{return!1}}}}return globalThis[He]}var Q;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Q||(Q={}));const Ut=34028234663852886e22,wt=-34028234663852886e22,Ht=4294967295,qt=2147483647,Zt=-2147483648;class u{constructor(i=Dr().encodeUtf8){this.encodeUtf8=i,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let i=0;for(let a=0;a<this.chunks.length;a++)i+=this.chunks[a].length;let n=new Uint8Array(i),t=0;for(let a=0;a<this.chunks.length;a++)n.set(this.chunks[a],t),t+=this.chunks[a].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let i=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(i.byteLength),this.raw(i)}tag(i,n){return this.uint32((i<<3|n)>>>0)}raw(i){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(i),this}uint32(i){for(di(i);i>127;)this.buf.push(i&127|128),i=i>>>7;return this.buf.push(i),this}int32(i){return qe(i),si(i,this.buf),this}bool(i){return this.buf.push(i?1:0),this}bytes(i){return this.uint32(i.byteLength),this.raw(i)}string(i){let n=this.encodeUtf8(i);return this.uint32(n.byteLength),this.raw(n)}float(i){Xt(i);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,i,!0),this.raw(n)}double(i){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,i,!0),this.raw(n)}fixed32(i){di(i);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,i,!0),this.raw(n)}sfixed32(i){qe(i);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,i,!0),this.raw(n)}sint32(i){return qe(i),i=(i<<1^i>>31)>>>0,si(i,this.buf),this}sfixed64(i){let n=new Uint8Array(8),t=new DataView(n.buffer),a=q.enc(i);return t.setInt32(0,a.lo,!0),t.setInt32(4,a.hi,!0),this.raw(n)}fixed64(i){let n=new Uint8Array(8),t=new DataView(n.buffer),a=q.uEnc(i);return t.setInt32(0,a.lo,!0),t.setInt32(4,a.hi,!0),this.raw(n)}int64(i){let n=q.enc(i);return we(n.lo,n.hi,this.buf),this}sint64(i){const n=q.enc(i),t=n.hi>>31,a=n.lo<<1^t,r=(n.hi<<1|n.lo>>>31)^t;return we(a,r,this.buf),this}uint64(i){const n=q.uEnc(i);return we(n.lo,n.hi,this.buf),this}}class s{constructor(i,n=Dr().decodeUtf8){this.decodeUtf8=n,this.varint64=yt,this.uint32=Bt,this.buf=i,this.len=i.length,this.pos=0,this.view=new DataView(i.buffer,i.byteOffset,i.byteLength)}tag(){let i=this.uint32(),n=i>>>3,t=i&7;if(n<=0||t<0||t>5)throw new Error("illegal tag: field no "+n+" wire type "+t);return[n,t]}skip(i,n){let t=this.pos;switch(i){case Q.Varint:for(;this.buf[this.pos++]&128;);break;case Q.Bit64:this.pos+=4;case Q.Bit32:this.pos+=4;break;case Q.LengthDelimited:let a=this.uint32();this.pos+=a;break;case Q.StartGroup:for(;;){const[r,f]=this.tag();if(f===Q.EndGroup){if(n!==void 0&&r!==n)throw new Error("invalid end group tag");break}this.skip(f,r)}break;default:throw new Error("cant skip wire type "+i)}return this.assertBounds(),this.buf.subarray(t,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let i=this.uint32();return i>>>1^-(i&1)}int64(){return q.dec(...this.varint64())}uint64(){return q.uDec(...this.varint64())}sint64(){let[i,n]=this.varint64(),t=-(i&1);return i=(i>>>1|(n&1)<<31)^t,n=n>>>1^t,q.dec(i,n)}bool(){let[i,n]=this.varint64();return i!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return q.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return q.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let i=this.uint32(),n=this.pos;return this.pos+=i,this.assertBounds(),this.buf.subarray(n,n+i)}string(){return this.decodeUtf8(this.bytes())}}function qe(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>qt||e<Zt)throw new Error("invalid int32: "+e)}function di(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>Ht||e<0)throw new Error("invalid uint32: "+e)}function Xt(e){if(typeof e=="string"){const i=e;if(e=Number(e),Number.isNaN(e)&&i!=="NaN")throw new Error("invalid float32: "+i)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>Ut||e<wt))throw new Error("invalid float32: "+e)}var yr=(e=>(e[e.SIGNAL_ENCODING_INTEL=0]="SIGNAL_ENCODING_INTEL",e[e.SIGNAL_ENCODING_MOTOROLA=1]="SIGNAL_ENCODING_MOTOROLA",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(yr||{});function xr(e){switch(e){case 0:case"SIGNAL_ENCODING_INTEL":return 0;case 1:case"SIGNAL_ENCODING_MOTOROLA":return 1;default:return-1}}function Jr(e){switch(e){case 0:return"SIGNAL_ENCODING_INTEL";case 1:return"SIGNAL_ENCODING_MOTOROLA";default:return"UNRECOGNIZED"}}var Br=(e=>(e[e.SIGNAL_TYPE_INVALID=0]="SIGNAL_TYPE_INVALID",e[e.SIGNAL_TYPE_SIGNED=1]="SIGNAL_TYPE_SIGNED",e[e.SIGNAL_TYPE_UNSIGNED=2]="SIGNAL_TYPE_UNSIGNED",e[e.SIGNAL_TYPE_FLOAT=3]="SIGNAL_TYPE_FLOAT",e[e.SIGNAL_TYPE_DOUBLE=4]="SIGNAL_TYPE_DOUBLE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Br||{});function Ze(e){switch(e){case 0:case"SIGNAL_TYPE_INVALID":return 0;case 1:case"SIGNAL_TYPE_SIGNED":return 1;case 2:case"SIGNAL_TYPE_UNSIGNED":return 2;case 3:case"SIGNAL_TYPE_FLOAT":return 3;case 4:case"SIGNAL_TYPE_DOUBLE":return 4;default:return-1}}function Vr(e){switch(e){case 0:return"SIGNAL_TYPE_INVALID";case 1:return"SIGNAL_TYPE_SIGNED";case 2:return"SIGNAL_TYPE_UNSIGNED";case 3:return"SIGNAL_TYPE_FLOAT";case 4:return"SIGNAL_TYPE_DOUBLE";default:return"UNRECOGNIZED"}}function fi(){return{name:"",qualifiedName:"",comment:"",encoding:0,dataType:0,startbit:0,length:0,unit:"",factor:0,offset:0,minValue:0,maxValue:0,enumValues:{},isMultiplexer:!1,isMultiplexed:!1,multiplexValue:void 0}}const V={encode(e,i=new u){return e.name!==""&&i.uint32(10).string(e.name),e.qualifiedName!==""&&i.uint32(18).string(e.qualifiedName),e.comment!==""&&i.uint32(26).string(e.comment),e.encoding!==0&&i.uint32(32).int32(e.encoding),e.dataType!==0&&i.uint32(40).int32(e.dataType),e.startbit!==0&&i.uint32(48).int32(e.startbit),e.length!==0&&i.uint32(56).int32(e.length),e.unit!==""&&i.uint32(66).string(e.unit),e.factor!==0&&i.uint32(73).double(e.factor),e.offset!==0&&i.uint32(81).double(e.offset),e.minValue!==0&&i.uint32(89).double(e.minValue),e.maxValue!==0&&i.uint32(97).double(e.maxValue),globalThis.Object.entries(e.enumValues).forEach(([n,t])=>{ye.encode({key:n,value:t},i.uint32(106).fork()).join()}),e.isMultiplexer!==!1&&i.uint32(112).bool(e.isMultiplexer),e.isMultiplexed!==!1&&i.uint32(120).bool(e.isMultiplexed),e.multiplexValue!==void 0&&i.uint32(128).int32(e.multiplexValue),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=fi();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==10)break;a.name=n.string();continue}case 2:{if(r!==18)break;a.qualifiedName=n.string();continue}case 3:{if(r!==26)break;a.comment=n.string();continue}case 4:{if(r!==32)break;a.encoding=n.int32();continue}case 5:{if(r!==40)break;a.dataType=n.int32();continue}case 6:{if(r!==48)break;a.startbit=n.int32();continue}case 7:{if(r!==56)break;a.length=n.int32();continue}case 8:{if(r!==66)break;a.unit=n.string();continue}case 9:{if(r!==73)break;a.factor=n.double();continue}case 10:{if(r!==81)break;a.offset=n.double();continue}case 11:{if(r!==89)break;a.minValue=n.double();continue}case 12:{if(r!==97)break;a.maxValue=n.double();continue}case 13:{if(r!==106)break;const f=ye.decode(n,n.uint32());f.value!==void 0&&(a.enumValues[f.key]=f.value);continue}case 14:{if(r!==112)break;a.isMultiplexer=n.bool();continue}case 15:{if(r!==120)break;a.isMultiplexed=n.bool();continue}case 16:{if(r!==128)break;a.multiplexValue=n.int32();continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{name:A(e.name)?globalThis.String(e.name):"",qualifiedName:A(e.qualifiedName)?globalThis.String(e.qualifiedName):A(e.qualified_name)?globalThis.String(e.qualified_name):"",comment:A(e.comment)?globalThis.String(e.comment):"",encoding:A(e.encoding)?xr(e.encoding):0,dataType:A(e.dataType)?Ze(e.dataType):A(e.data_type)?Ze(e.data_type):0,startbit:A(e.startbit)?globalThis.Number(e.startbit):0,length:A(e.length)?globalThis.Number(e.length):0,unit:A(e.unit)?globalThis.String(e.unit):"",factor:A(e.factor)?globalThis.Number(e.factor):0,offset:A(e.offset)?globalThis.Number(e.offset):0,minValue:A(e.minValue)?globalThis.Number(e.minValue):A(e.min_value)?globalThis.Number(e.min_value):0,maxValue:A(e.maxValue)?globalThis.Number(e.maxValue):A(e.max_value)?globalThis.Number(e.max_value):0,enumValues:mi(e.enumValues)?globalThis.Object.entries(e.enumValues).reduce((i,[n,t])=>(i[globalThis.Number(n)]=globalThis.String(t),i),{}):mi(e.enum_values)?globalThis.Object.entries(e.enum_values).reduce((i,[n,t])=>(i[globalThis.Number(n)]=globalThis.String(t),i),{}):{},isMultiplexer:A(e.isMultiplexer)?globalThis.Boolean(e.isMultiplexer):A(e.is_multiplexer)?globalThis.Boolean(e.is_multiplexer):!1,isMultiplexed:A(e.isMultiplexed)?globalThis.Boolean(e.isMultiplexed):A(e.is_multiplexed)?globalThis.Boolean(e.is_multiplexed):!1,multiplexValue:A(e.multiplexValue)?globalThis.Number(e.multiplexValue):A(e.multiplex_value)?globalThis.Number(e.multiplex_value):void 0}},toJSON(e){const i={};if(e.name!==""&&(i.name=e.name),e.qualifiedName!==""&&(i.qualifiedName=e.qualifiedName),e.comment!==""&&(i.comment=e.comment),e.encoding!==0&&(i.encoding=Jr(e.encoding)),e.dataType!==0&&(i.dataType=Vr(e.dataType)),e.startbit!==0&&(i.startbit=Math.round(e.startbit)),e.length!==0&&(i.length=Math.round(e.length)),e.unit!==""&&(i.unit=e.unit),e.factor!==0&&(i.factor=e.factor),e.offset!==0&&(i.offset=e.offset),e.minValue!==0&&(i.minValue=e.minValue),e.maxValue!==0&&(i.maxValue=e.maxValue),e.enumValues){const n=globalThis.Object.entries(e.enumValues);n.length>0&&(i.enumValues={},n.forEach(([t,a])=>{i.enumValues[t]=a}))}return e.isMultiplexer!==!1&&(i.isMultiplexer=e.isMultiplexer),e.isMultiplexed!==!1&&(i.isMultiplexed=e.isMultiplexed),e.multiplexValue!==void 0&&(i.multiplexValue=Math.round(e.multiplexValue)),i},create(e){return V.fromPartial(e??{})},fromPartial(e){const i=fi();return i.name=e.name??"",i.qualifiedName=e.qualifiedName??"",i.comment=e.comment??"",i.encoding=e.encoding??0,i.dataType=e.dataType??0,i.startbit=e.startbit??0,i.length=e.length??0,i.unit=e.unit??"",i.factor=e.factor??0,i.offset=e.offset??0,i.minValue=e.minValue??0,i.maxValue=e.maxValue??0,i.enumValues=globalThis.Object.entries(e.enumValues??{}).reduce((n,[t,a])=>(a!==void 0&&(n[globalThis.Number(t)]=globalThis.String(a)),n),{}),i.isMultiplexer=e.isMultiplexer??!1,i.isMultiplexed=e.isMultiplexed??!1,i.multiplexValue=e.multiplexValue??void 0,i}};function ci(){return{key:0,value:""}}const ye={encode(e,i=new u){return e.key!==0&&i.uint32(8).int32(e.key),e.value!==""&&i.uint32(18).string(e.value),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=ci();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==8)break;a.key=n.int32();continue}case 2:{if(r!==18)break;a.value=n.string();continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{key:A(e.key)?globalThis.Number(e.key):0,value:A(e.value)?globalThis.String(e.value):""}},toJSON(e){const i={};return e.key!==0&&(i.key=Math.round(e.key)),e.value!==""&&(i.value=e.value),i},create(e){return ye.fromPartial(e??{})},fromPartial(e){const i=ci();return i.key=e.key??0,i.value=e.value??"",i}};function _i(){return{items:[]}}const Ur={encode(e,i=new u){for(const n of e.items)V.encode(n,i.uint32(10).fork()).join();return i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=_i();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==10)break;a.items.push(V.decode(n,n.uint32()));continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{items:globalThis.Array.isArray(e?.items)?e.items.map(i=>V.fromJSON(i)):[]}},toJSON(e){const i={};return e.items?.length&&(i.items=e.items.map(n=>V.toJSON(n))),i},create(e){return Ur.fromPartial(e??{})},fromPartial(e){const i=_i();return i.items=e.items?.map(n=>V.fromPartial(n))||[],i}};function mi(e){return typeof e=="object"&&e!==null}function A(e){return e!=null}var wr=(e=>(e[e.CAN_FRAME_FLAG_UNSPECIFIED=0]="CAN_FRAME_FLAG_UNSPECIFIED",e[e.CAN_FRAME_FLAG_RTR=1]="CAN_FRAME_FLAG_RTR",e[e.CAN_FRAME_FLAG_STD=2]="CAN_FRAME_FLAG_STD",e[e.CAN_FRAME_FLAG_EXT=4]="CAN_FRAME_FLAG_EXT",e[e.CAN_FRAME_FLAG_WAKEUP=8]="CAN_FRAME_FLAG_WAKEUP",e[e.CAN_FRAME_FLAG_NERR=16]="CAN_FRAME_FLAG_NERR",e[e.CAN_FRAME_FLAG_ERROR_FRAME=32]="CAN_FRAME_FLAG_ERROR_FRAME",e[e.CAN_FRAME_FLAG_TXACK=64]="CAN_FRAME_FLAG_TXACK",e[e.CAN_FRAME_FLAG_TXRQ=128]="CAN_FRAME_FLAG_TXRQ",e[e.CAN_FRAME_FLAG_DELAY_MSG=256]="CAN_FRAME_FLAG_DELAY_MSG",e[e.CAN_FRAME_FLAG_LOCAL_TXACK=268435456]="CAN_FRAME_FLAG_LOCAL_TXACK",e[e.CAN_FRAME_FLAG_SINGLE_SHOT=16777216]="CAN_FRAME_FLAG_SINGLE_SHOT",e[e.CAN_FRAME_FLAG_TXNACK=33554432]="CAN_FRAME_FLAG_TXNACK",e[e.CAN_FRAME_FLAG_ABL=67108864]="CAN_FRAME_FLAG_ABL",e[e.CAN_FRAME_FLAG_FD_FDF=65536]="CAN_FRAME_FLAG_FD_FDF",e[e.CAN_FRAME_FLAG_FD_BRS=131072]="CAN_FRAME_FLAG_FD_BRS",e[e.CAN_FRAME_FLAG_FD_ESI=262144]="CAN_FRAME_FLAG_FD_ESI",e[e.CAN_FRAME_FLAG_ERR_HW_OVERRUN=512]="CAN_FRAME_FLAG_ERR_HW_OVERRUN",e[e.CAN_FRAME_FLAG_ERR_SW_OVERRUN=1024]="CAN_FRAME_FLAG_ERR_SW_OVERRUN",e[e.CAN_FRAME_FLAG_ERR_STUFF=2048]="CAN_FRAME_FLAG_ERR_STUFF",e[e.CAN_FRAME_FLAG_ERR_FORM=4096]="CAN_FRAME_FLAG_ERR_FORM",e[e.CAN_FRAME_FLAG_ERR_CRC=8192]="CAN_FRAME_FLAG_ERR_CRC",e[e.CAN_FRAME_FLAG_ERR_BIT0=16384]="CAN_FRAME_FLAG_ERR_BIT0",e[e.CAN_FRAME_FLAG_ERR_BIT1=32768]="CAN_FRAME_FLAG_ERR_BIT1",e[e.CAN_FRAME_FLAG_XL_XLF=1048576]="CAN_FRAME_FLAG_XL_XLF",e[e.CAN_FRAME_FLAG_XL_VCID=2097152]="CAN_FRAME_FLAG_XL_VCID",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(wr||{});function Hr(e){switch(e){case 0:case"CAN_FRAME_FLAG_UNSPECIFIED":return 0;case 1:case"CAN_FRAME_FLAG_RTR":return 1;case 2:case"CAN_FRAME_FLAG_STD":return 2;case 4:case"CAN_FRAME_FLAG_EXT":return 4;case 8:case"CAN_FRAME_FLAG_WAKEUP":return 8;case 16:case"CAN_FRAME_FLAG_NERR":return 16;case 32:case"CAN_FRAME_FLAG_ERROR_FRAME":return 32;case 64:case"CAN_FRAME_FLAG_TXACK":return 64;case 128:case"CAN_FRAME_FLAG_TXRQ":return 128;case 256:case"CAN_FRAME_FLAG_DELAY_MSG":return 256;case 268435456:case"CAN_FRAME_FLAG_LOCAL_TXACK":return 268435456;case 16777216:case"CAN_FRAME_FLAG_SINGLE_SHOT":return 16777216;case 33554432:case"CAN_FRAME_FLAG_TXNACK":return 33554432;case 67108864:case"CAN_FRAME_FLAG_ABL":return 67108864;case 65536:case"CAN_FRAME_FLAG_FD_FDF":return 65536;case 131072:case"CAN_FRAME_FLAG_FD_BRS":return 131072;case 262144:case"CAN_FRAME_FLAG_FD_ESI":return 262144;case 512:case"CAN_FRAME_FLAG_ERR_HW_OVERRUN":return 512;case 1024:case"CAN_FRAME_FLAG_ERR_SW_OVERRUN":return 1024;case 2048:case"CAN_FRAME_FLAG_ERR_STUFF":return 2048;case 4096:case"CAN_FRAME_FLAG_ERR_FORM":return 4096;case 8192:case"CAN_FRAME_FLAG_ERR_CRC":return 8192;case 16384:case"CAN_FRAME_FLAG_ERR_BIT0":return 16384;case 32768:case"CAN_FRAME_FLAG_ERR_BIT1":return 32768;case 1048576:case"CAN_FRAME_FLAG_XL_XLF":return 1048576;case 2097152:case"CAN_FRAME_FLAG_XL_VCID":return 2097152;default:return-1}}function qr(e){switch(e){case 0:return"CAN_FRAME_FLAG_UNSPECIFIED";case 1:return"CAN_FRAME_FLAG_RTR";case 2:return"CAN_FRAME_FLAG_STD";case 4:return"CAN_FRAME_FLAG_EXT";case 8:return"CAN_FRAME_FLAG_WAKEUP";case 16:return"CAN_FRAME_FLAG_NERR";case 32:return"CAN_FRAME_FLAG_ERROR_FRAME";case 64:return"CAN_FRAME_FLAG_TXACK";case 128:return"CAN_FRAME_FLAG_TXRQ";case 256:return"CAN_FRAME_FLAG_DELAY_MSG";case 268435456:return"CAN_FRAME_FLAG_LOCAL_TXACK";case 16777216:return"CAN_FRAME_FLAG_SINGLE_SHOT";case 33554432:return"CAN_FRAME_FLAG_TXNACK";case 67108864:return"CAN_FRAME_FLAG_ABL";case 65536:return"CAN_FRAME_FLAG_FD_FDF";case 131072:return"CAN_FRAME_FLAG_FD_BRS";case 262144:return"CAN_FRAME_FLAG_FD_ESI";case 512:return"CAN_FRAME_FLAG_ERR_HW_OVERRUN";case 1024:return"CAN_FRAME_FLAG_ERR_SW_OVERRUN";case 2048:return"CAN_FRAME_FLAG_ERR_STUFF";case 4096:return"CAN_FRAME_FLAG_ERR_FORM";case 8192:return"CAN_FRAME_FLAG_ERR_CRC";case 16384:return"CAN_FRAME_FLAG_ERR_BIT0";case 32768:return"CAN_FRAME_FLAG_ERR_BIT1";case 1048576:return"CAN_FRAME_FLAG_XL_XLF";case 2097152:return"CAN_FRAME_FLAG_XL_VCID";default:return"UNRECOGNIZED"}}var Zr=(e=>(e[e.LIN_FRAME_FLAG_UNSPECIFIED=0]="LIN_FRAME_FLAG_UNSPECIFIED",e[e.LIN_FRAME_FLAG_TX=1]="LIN_FRAME_FLAG_TX",e[e.LIN_FRAME_FLAG_RX=2]="LIN_FRAME_FLAG_RX",e[e.LIN_FRAME_FLAG_WAKEUP_FRAME=4]="LIN_FRAME_FLAG_WAKEUP_FRAME",e[e.LIN_FRAME_FLAG_NODATA=8]="LIN_FRAME_FLAG_NODATA",e[e.LIN_FRAME_FLAG_CSUM_ERROR=16]="LIN_FRAME_FLAG_CSUM_ERROR",e[e.LIN_FRAME_FLAG_PARITY_ERROR=32]="LIN_FRAME_FLAG_PARITY_ERROR",e[e.LIN_FRAME_FLAG_SYNCH_ERROR=64]="LIN_FRAME_FLAG_SYNCH_ERROR",e[e.LIN_FRAME_FLAG_BIT_ERROR=128]="LIN_FRAME_FLAG_BIT_ERROR",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Zr||{});function Xr(e){switch(e){case 0:case"LIN_FRAME_FLAG_UNSPECIFIED":return 0;case 1:case"LIN_FRAME_FLAG_TX":return 1;case 2:case"LIN_FRAME_FLAG_RX":return 2;case 4:case"LIN_FRAME_FLAG_WAKEUP_FRAME":return 4;case 8:case"LIN_FRAME_FLAG_NODATA":return 8;case 16:case"LIN_FRAME_FLAG_CSUM_ERROR":return 16;case 32:case"LIN_FRAME_FLAG_PARITY_ERROR":return 32;case 64:case"LIN_FRAME_FLAG_SYNCH_ERROR":return 64;case 128:case"LIN_FRAME_FLAG_BIT_ERROR":return 128;default:return-1}}function Qr(e){switch(e){case 0:return"LIN_FRAME_FLAG_UNSPECIFIED";case 1:return"LIN_FRAME_FLAG_TX";case 2:return"LIN_FRAME_FLAG_RX";case 4:return"LIN_FRAME_FLAG_WAKEUP_FRAME";case 8:return"LIN_FRAME_FLAG_NODATA";case 16:return"LIN_FRAME_FLAG_CSUM_ERROR";case 32:return"LIN_FRAME_FLAG_PARITY_ERROR";case 64:return"LIN_FRAME_FLAG_SYNCH_ERROR";case 128:return"LIN_FRAME_FLAG_BIT_ERROR";default:return"UNRECOGNIZED"}}function Ni(){return{flags:[]}}const T={encode(e,i=new u){i.uint32(10).fork();for(const n of e.flags)i.int32(n);return i.join(),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Ni();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r===8){a.flags.push(n.int32());continue}if(r===10){const f=n.uint32()+n.pos;for(;n.pos<f;)a.flags.push(n.int32());continue}break}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{flags:globalThis.Array.isArray(e?.flags)?e.flags.map(i=>Hr(i)):[]}},toJSON(e){const i={};return e.flags?.length&&(i.flags=e.flags.map(n=>qr(n))),i},create(e){return T.fromPartial(e??{})},fromPartial(e){const i=Ni();return i.flags=e.flags?.map(n=>n)||[],i}};function Si(){return{flags:[]}}const v={encode(e,i=new u){i.uint32(10).fork();for(const n of e.flags)i.int32(n);return i.join(),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Si();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r===8){a.flags.push(n.int32());continue}if(r===10){const f=n.uint32()+n.pos;for(;n.pos<f;)a.flags.push(n.int32());continue}break}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{flags:globalThis.Array.isArray(e?.flags)?e.flags.map(i=>Xr(i)):[]}},toJSON(e){const i={};return e.flags?.length&&(i.flags=e.flags.map(n=>Qr(n))),i},create(e){return v.fromPartial(e??{})},fromPartial(e){const i=Si();return i.flags=e.flags?.map(n=>n)||[],i}};function pi(){return{stringValue:void 0,doubleValue:void 0}}const Z={encode(e,i=new u){return e.stringValue!==void 0&&i.uint32(10).string(e.stringValue),e.doubleValue!==void 0&&i.uint32(17).double(e.doubleValue),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=pi();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==10)break;a.stringValue=n.string();continue}case 2:{if(r!==17)break;a.doubleValue=n.double();continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{stringValue:m(e.stringValue)?globalThis.String(e.stringValue):m(e.string_value)?globalThis.String(e.string_value):void 0,doubleValue:m(e.doubleValue)?globalThis.Number(e.doubleValue):m(e.double_value)?globalThis.Number(e.double_value):void 0}},toJSON(e){const i={};return e.stringValue!==void 0&&(i.stringValue=e.stringValue),e.doubleValue!==void 0&&(i.doubleValue=e.doubleValue),i},create(e){return Z.fromPartial(e??{})},fromPartial(e){const i=pi();return i.stringValue=e.stringValue??void 0,i.doubleValue=e.doubleValue??void 0,i}};function Ei(){return{name:"",qualifiedName:"",unit:"",stringValue:void 0,doubleValue:0}}const h={encode(e,i=new u){return e.name!==""&&i.uint32(10).string(e.name),e.qualifiedName!==""&&i.uint32(18).string(e.qualifiedName),e.unit!==""&&i.uint32(26).string(e.unit),e.stringValue!==void 0&&i.uint32(34).string(e.stringValue),e.doubleValue!==0&&i.uint32(41).double(e.doubleValue),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Ei();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==10)break;a.name=n.string();continue}case 2:{if(r!==18)break;a.qualifiedName=n.string();continue}case 3:{if(r!==26)break;a.unit=n.string();continue}case 4:{if(r!==34)break;a.stringValue=n.string();continue}case 5:{if(r!==41)break;a.doubleValue=n.double();continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{name:m(e.name)?globalThis.String(e.name):"",qualifiedName:m(e.qualifiedName)?globalThis.String(e.qualifiedName):m(e.qualified_name)?globalThis.String(e.qualified_name):"",unit:m(e.unit)?globalThis.String(e.unit):"",stringValue:m(e.stringValue)?globalThis.String(e.stringValue):m(e.string_value)?globalThis.String(e.string_value):void 0,doubleValue:m(e.doubleValue)?globalThis.Number(e.doubleValue):m(e.double_value)?globalThis.Number(e.double_value):0}},toJSON(e){const i={};return e.name!==""&&(i.name=e.name),e.qualifiedName!==""&&(i.qualifiedName=e.qualifiedName),e.unit!==""&&(i.unit=e.unit),e.stringValue!==void 0&&(i.stringValue=e.stringValue),e.doubleValue!==0&&(i.doubleValue=e.doubleValue),i},create(e){return h.fromPartial(e??{})},fromPartial(e){const i=Ei();return i.name=e.name??"",i.qualifiedName=e.qualifiedName??"",i.unit=e.unit??"",i.stringValue=e.stringValue??void 0,i.doubleValue=e.doubleValue??0,i}};function Ti(){return{sourceId:"",sourceName:"",streamId:"",id:0,messageName:"",data:[],tx:!1,dlc:0,hashCode:0,properties:{},signalValues:[],canFrameFlags:void 0,linFrameFlags:void 0,timeUs:l.UZERO,deltaTimeUs:void 0,fixedPosIdentifier:void 0,protocol:void 0,muxValue:void 0}}const me={encode(e,i=new u){e.sourceId!==""&&i.uint32(10).string(e.sourceId),e.sourceName!==""&&i.uint32(18).string(e.sourceName),e.streamId!==""&&i.uint32(26).string(e.streamId),e.id!==0&&i.uint32(32).int32(e.id),e.messageName!==""&&i.uint32(42).string(e.messageName),i.uint32(50).fork();for(const n of e.data)i.uint32(n);i.join(),e.tx!==!1&&i.uint32(64).bool(e.tx),e.dlc!==0&&i.uint32(72).int32(e.dlc),e.hashCode!==0&&i.uint32(80).int32(e.hashCode),globalThis.Object.entries(e.properties).forEach(([n,t])=>{xe.encode({key:n,value:t},i.uint32(90).fork()).join()});for(const n of e.signalValues)h.encode(n,i.uint32(98).fork()).join();return e.canFrameFlags!==void 0&&T.encode(e.canFrameFlags,i.uint32(106).fork()).join(),e.linFrameFlags!==void 0&&v.encode(e.linFrameFlags,i.uint32(114).fork()).join(),e.timeUs.equals(l.UZERO)||i.uint32(152).uint64(e.timeUs.toString()),e.deltaTimeUs!==void 0&&i.uint32(120).uint64(e.deltaTimeUs.toString()),e.fixedPosIdentifier!==void 0&&i.uint32(130).string(e.fixedPosIdentifier),e.protocol!==void 0&&i.uint32(138).string(e.protocol),e.muxValue!==void 0&&i.uint32(144).int32(e.muxValue),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Ti();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==10)break;a.sourceId=n.string();continue}case 2:{if(r!==18)break;a.sourceName=n.string();continue}case 3:{if(r!==26)break;a.streamId=n.string();continue}case 4:{if(r!==32)break;a.id=n.int32();continue}case 5:{if(r!==42)break;a.messageName=n.string();continue}case 6:{if(r===48){a.data.push(n.uint32());continue}if(r===50){const f=n.uint32()+n.pos;for(;n.pos<f;)a.data.push(n.uint32());continue}break}case 8:{if(r!==64)break;a.tx=n.bool();continue}case 9:{if(r!==72)break;a.dlc=n.int32();continue}case 10:{if(r!==80)break;a.hashCode=n.int32();continue}case 11:{if(r!==90)break;const f=xe.decode(n,n.uint32());f.value!==void 0&&(a.properties[f.key]=f.value);continue}case 12:{if(r!==98)break;a.signalValues.push(h.decode(n,n.uint32()));continue}case 13:{if(r!==106)break;a.canFrameFlags=T.decode(n,n.uint32());continue}case 14:{if(r!==114)break;a.linFrameFlags=v.decode(n,n.uint32());continue}case 19:{if(r!==152)break;a.timeUs=l.fromString(n.uint64().toString(),!0);continue}case 15:{if(r!==120)break;a.deltaTimeUs=l.fromString(n.uint64().toString(),!0);continue}case 16:{if(r!==130)break;a.fixedPosIdentifier=n.string();continue}case 17:{if(r!==138)break;a.protocol=n.string();continue}case 18:{if(r!==144)break;a.muxValue=n.int32();continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{sourceId:m(e.sourceId)?globalThis.String(e.sourceId):m(e.source_id)?globalThis.String(e.source_id):"",sourceName:m(e.sourceName)?globalThis.String(e.sourceName):m(e.source_name)?globalThis.String(e.source_name):"",streamId:m(e.streamId)?globalThis.String(e.streamId):m(e.stream_id)?globalThis.String(e.stream_id):"",id:m(e.id)?globalThis.Number(e.id):0,messageName:m(e.messageName)?globalThis.String(e.messageName):m(e.message_name)?globalThis.String(e.message_name):"",data:globalThis.Array.isArray(e?.data)?e.data.map(i=>globalThis.Number(i)):[],tx:m(e.tx)?globalThis.Boolean(e.tx):!1,dlc:m(e.dlc)?globalThis.Number(e.dlc):0,hashCode:m(e.hashCode)?globalThis.Number(e.hashCode):m(e.hash_code)?globalThis.Number(e.hash_code):0,properties:Qt(e.properties)?globalThis.Object.entries(e.properties).reduce((i,[n,t])=>(i[n]=Z.fromJSON(t),i),{}):{},signalValues:globalThis.Array.isArray(e?.signalValues)?e.signalValues.map(i=>h.fromJSON(i)):globalThis.Array.isArray(e?.signal_values)?e.signal_values.map(i=>h.fromJSON(i)):[],canFrameFlags:m(e.canFrameFlags)?T.fromJSON(e.canFrameFlags):m(e.can_frame_flags)?T.fromJSON(e.can_frame_flags):void 0,linFrameFlags:m(e.linFrameFlags)?v.fromJSON(e.linFrameFlags):m(e.lin_frame_flags)?v.fromJSON(e.lin_frame_flags):void 0,timeUs:m(e.timeUs)?l.fromValue(e.timeUs):m(e.time_us)?l.fromValue(e.time_us):l.UZERO,deltaTimeUs:m(e.deltaTimeUs)?l.fromValue(e.deltaTimeUs):m(e.delta_time_us)?l.fromValue(e.delta_time_us):void 0,fixedPosIdentifier:m(e.fixedPosIdentifier)?globalThis.String(e.fixedPosIdentifier):m(e.fixed_pos_identifier)?globalThis.String(e.fixed_pos_identifier):void 0,protocol:m(e.protocol)?globalThis.String(e.protocol):void 0,muxValue:m(e.muxValue)?globalThis.Number(e.muxValue):m(e.mux_value)?globalThis.Number(e.mux_value):void 0}},toJSON(e){const i={};if(e.sourceId!==""&&(i.sourceId=e.sourceId),e.sourceName!==""&&(i.sourceName=e.sourceName),e.streamId!==""&&(i.streamId=e.streamId),e.id!==0&&(i.id=Math.round(e.id)),e.messageName!==""&&(i.messageName=e.messageName),e.data?.length&&(i.data=e.data.map(n=>Math.round(n))),e.tx!==!1&&(i.tx=e.tx),e.dlc!==0&&(i.dlc=Math.round(e.dlc)),e.hashCode!==0&&(i.hashCode=Math.round(e.hashCode)),e.properties){const n=globalThis.Object.entries(e.properties);n.length>0&&(i.properties={},n.forEach(([t,a])=>{i.properties[t]=Z.toJSON(a)}))}return e.signalValues?.length&&(i.signalValues=e.signalValues.map(n=>h.toJSON(n))),e.canFrameFlags!==void 0&&(i.canFrameFlags=T.toJSON(e.canFrameFlags)),e.linFrameFlags!==void 0&&(i.linFrameFlags=v.toJSON(e.linFrameFlags)),e.timeUs.equals(l.UZERO)||(i.timeUs=(e.timeUs||l.UZERO).toString()),e.deltaTimeUs!==void 0&&(i.deltaTimeUs=(e.deltaTimeUs||l.UZERO).toString()),e.fixedPosIdentifier!==void 0&&(i.fixedPosIdentifier=e.fixedPosIdentifier),e.protocol!==void 0&&(i.protocol=e.protocol),e.muxValue!==void 0&&(i.muxValue=Math.round(e.muxValue)),i},create(e){return me.fromPartial(e??{})},fromPartial(e){const i=Ti();return i.sourceId=e.sourceId??"",i.sourceName=e.sourceName??"",i.streamId=e.streamId??"",i.id=e.id??0,i.messageName=e.messageName??"",i.data=e.data?.map(n=>n)||[],i.tx=e.tx??!1,i.dlc=e.dlc??0,i.hashCode=e.hashCode??0,i.properties=globalThis.Object.entries(e.properties??{}).reduce((n,[t,a])=>(a!==void 0&&(n[t]=Z.fromPartial(a)),n),{}),i.signalValues=e.signalValues?.map(n=>h.fromPartial(n))||[],i.canFrameFlags=e.canFrameFlags!==void 0&&e.canFrameFlags!==null?T.fromPartial(e.canFrameFlags):void 0,i.linFrameFlags=e.linFrameFlags!==void 0&&e.linFrameFlags!==null?v.fromPartial(e.linFrameFlags):void 0,i.timeUs=e.timeUs!==void 0&&e.timeUs!==null?l.fromValue(e.timeUs):l.UZERO,i.deltaTimeUs=e.deltaTimeUs!==void 0&&e.deltaTimeUs!==null?l.fromValue(e.deltaTimeUs):void 0,i.fixedPosIdentifier=e.fixedPosIdentifier??void 0,i.protocol=e.protocol??void 0,i.muxValue=e.muxValue??void 0,i}};function hi(){return{key:"",value:void 0}}const xe={encode(e,i=new u){return e.key!==""&&i.uint32(10).string(e.key),e.value!==void 0&&Z.encode(e.value,i.uint32(18).fork()).join(),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=hi();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==10)break;a.key=n.string();continue}case 2:{if(r!==18)break;a.value=Z.decode(n,n.uint32());continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{key:m(e.key)?globalThis.String(e.key):"",value:m(e.value)?Z.fromJSON(e.value):void 0}},toJSON(e){const i={};return e.key!==""&&(i.key=e.key),e.value!==void 0&&(i.value=Z.toJSON(e.value)),i},create(e){return xe.fromPartial(e??{})},fromPartial(e){const i=hi();return i.key=e.key??"",i.value=e.value!==void 0&&e.value!==null?Z.fromPartial(e.value):void 0,i}};function Ai(){return{items:[]}}const zr={encode(e,i=new u){for(const n of e.items)me.encode(n,i.uint32(10).fork()).join();return i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Ai();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==10)break;a.items.push(me.decode(n,n.uint32()));continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{items:globalThis.Array.isArray(e?.items)?e.items.map(i=>me.fromJSON(i)):[]}},toJSON(e){const i={};return e.items?.length&&(i.items=e.items.map(n=>me.toJSON(n))),i},create(e){return zr.fromPartial(e??{})},fromPartial(e){const i=Ai();return i.items=e.items?.map(n=>me.fromPartial(n))||[],i}};function gi(){return{id:0,data:[],canFrameFlags:void 0,linFrameFlags:void 0}}const O={encode(e,i=new u){e.id!==0&&i.uint32(8).int32(e.id),i.uint32(18).fork();for(const n of e.data)i.uint32(n);return i.join(),e.canFrameFlags!==void 0&&T.encode(e.canFrameFlags,i.uint32(26).fork()).join(),e.linFrameFlags!==void 0&&v.encode(e.linFrameFlags,i.uint32(34).fork()).join(),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=gi();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==8)break;a.id=n.int32();continue}case 2:{if(r===16){a.data.push(n.uint32());continue}if(r===18){const f=n.uint32()+n.pos;for(;n.pos<f;)a.data.push(n.uint32());continue}break}case 3:{if(r!==26)break;a.canFrameFlags=T.decode(n,n.uint32());continue}case 4:{if(r!==34)break;a.linFrameFlags=v.decode(n,n.uint32());continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{id:m(e.id)?globalThis.Number(e.id):0,data:globalThis.Array.isArray(e?.data)?e.data.map(i=>globalThis.Number(i)):[],canFrameFlags:m(e.canFrameFlags)?T.fromJSON(e.canFrameFlags):m(e.can_frame_flags)?T.fromJSON(e.can_frame_flags):void 0,linFrameFlags:m(e.linFrameFlags)?v.fromJSON(e.linFrameFlags):m(e.lin_frame_flags)?v.fromJSON(e.lin_frame_flags):void 0}},toJSON(e){const i={};return e.id!==0&&(i.id=Math.round(e.id)),e.data?.length&&(i.data=e.data.map(n=>Math.round(n))),e.canFrameFlags!==void 0&&(i.canFrameFlags=T.toJSON(e.canFrameFlags)),e.linFrameFlags!==void 0&&(i.linFrameFlags=v.toJSON(e.linFrameFlags)),i},create(e){return O.fromPartial(e??{})},fromPartial(e){const i=gi();return i.id=e.id??0,i.data=e.data?.map(n=>n)||[],i.canFrameFlags=e.canFrameFlags!==void 0&&e.canFrameFlags!==null?T.fromPartial(e.canFrameFlags):void 0,i.linFrameFlags=e.linFrameFlags!==void 0&&e.linFrameFlags!==null?v.fromPartial(e.linFrameFlags):void 0,i}};function Oi(){return{id:0,messageName:"",messageQualifiedName:"",dataLength:0,signals:[],canFrameFlags:void 0,sourceIdentifiers:[]}}const Ne={encode(e,i=new u){e.id!==0&&i.uint32(8).int32(e.id),e.messageName!==""&&i.uint32(18).string(e.messageName),e.messageQualifiedName!==""&&i.uint32(26).string(e.messageQualifiedName),e.dataLength!==0&&i.uint32(32).int32(e.dataLength);for(const n of e.signals)V.encode(n,i.uint32(42).fork()).join();e.canFrameFlags!==void 0&&T.encode(e.canFrameFlags,i.uint32(50).fork()).join();for(const n of e.sourceIdentifiers)i.uint32(58).string(n);return i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Oi();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==8)break;a.id=n.int32();continue}case 2:{if(r!==18)break;a.messageName=n.string();continue}case 3:{if(r!==26)break;a.messageQualifiedName=n.string();continue}case 4:{if(r!==32)break;a.dataLength=n.int32();continue}case 5:{if(r!==42)break;a.signals.push(V.decode(n,n.uint32()));continue}case 6:{if(r!==50)break;a.canFrameFlags=T.decode(n,n.uint32());continue}case 7:{if(r!==58)break;a.sourceIdentifiers.push(n.string());continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{id:m(e.id)?globalThis.Number(e.id):0,messageName:m(e.messageName)?globalThis.String(e.messageName):m(e.message_name)?globalThis.String(e.message_name):"",messageQualifiedName:m(e.messageQualifiedName)?globalThis.String(e.messageQualifiedName):m(e.message_qualified_name)?globalThis.String(e.message_qualified_name):"",dataLength:m(e.dataLength)?globalThis.Number(e.dataLength):m(e.data_length)?globalThis.Number(e.data_length):0,signals:globalThis.Array.isArray(e?.signals)?e.signals.map(i=>V.fromJSON(i)):[],canFrameFlags:m(e.canFrameFlags)?T.fromJSON(e.canFrameFlags):m(e.can_frame_flags)?T.fromJSON(e.can_frame_flags):void 0,sourceIdentifiers:globalThis.Array.isArray(e?.sourceIdentifiers)?e.sourceIdentifiers.map(i=>globalThis.String(i)):globalThis.Array.isArray(e?.source_identifiers)?e.source_identifiers.map(i=>globalThis.String(i)):[]}},toJSON(e){const i={};return e.id!==0&&(i.id=Math.round(e.id)),e.messageName!==""&&(i.messageName=e.messageName),e.messageQualifiedName!==""&&(i.messageQualifiedName=e.messageQualifiedName),e.dataLength!==0&&(i.dataLength=Math.round(e.dataLength)),e.signals?.length&&(i.signals=e.signals.map(n=>V.toJSON(n))),e.canFrameFlags!==void 0&&(i.canFrameFlags=T.toJSON(e.canFrameFlags)),e.sourceIdentifiers?.length&&(i.sourceIdentifiers=e.sourceIdentifiers),i},create(e){return Ne.fromPartial(e??{})},fromPartial(e){const i=Oi();return i.id=e.id??0,i.messageName=e.messageName??"",i.messageQualifiedName=e.messageQualifiedName??"",i.dataLength=e.dataLength??0,i.signals=e.signals?.map(n=>V.fromPartial(n))||[],i.canFrameFlags=e.canFrameFlags!==void 0&&e.canFrameFlags!==null?T.fromPartial(e.canFrameFlags):void 0,i.sourceIdentifiers=e.sourceIdentifiers?.map(n=>n)||[],i}};function vi(){return{items:[]}}const Kr={encode(e,i=new u){for(const n of e.items)Ne.encode(n,i.uint32(10).fork()).join();return i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=vi();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==10)break;a.items.push(Ne.decode(n,n.uint32()));continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{items:globalThis.Array.isArray(e?.items)?e.items.map(i=>Ne.fromJSON(i)):[]}},toJSON(e){const i={};return e.items?.length&&(i.items=e.items.map(n=>Ne.toJSON(n))),i},create(e){return Kr.fromPartial(e??{})},fromPartial(e){const i=vi();return i.items=e.items?.map(n=>Ne.fromPartial(n))||[],i}};function Ri(){return{dbcFiles:[],ldfFiles:[]}}const Yr={encode(e,i=new u){for(const n of e.dbcFiles)i.uint32(10).string(n);for(const n of e.ldfFiles)i.uint32(18).string(n);return i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Ri();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==10)break;a.dbcFiles.push(n.string());continue}case 2:{if(r!==18)break;a.ldfFiles.push(n.string());continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{dbcFiles:globalThis.Array.isArray(e?.dbcFiles)?e.dbcFiles.map(i=>globalThis.String(i)):globalThis.Array.isArray(e?.dbc_files)?e.dbc_files.map(i=>globalThis.String(i)):[],ldfFiles:globalThis.Array.isArray(e?.ldfFiles)?e.ldfFiles.map(i=>globalThis.String(i)):globalThis.Array.isArray(e?.ldf_files)?e.ldf_files.map(i=>globalThis.String(i)):[]}},toJSON(e){const i={};return e.dbcFiles?.length&&(i.dbcFiles=e.dbcFiles),e.ldfFiles?.length&&(i.ldfFiles=e.ldfFiles),i},create(e){return Yr.fromPartial(e??{})},fromPartial(e){const i=Ri();return i.dbcFiles=e.dbcFiles?.map(n=>n)||[],i.ldfFiles=e.ldfFiles?.map(n=>n)||[],i}};function Ii(){return{messageQualifiedName:"",delay:0}}const Se={encode(e,i=new u){return e.messageQualifiedName!==""&&i.uint32(10).string(e.messageQualifiedName),e.delay!==0&&i.uint32(17).double(e.delay),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Ii();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==10)break;a.messageQualifiedName=n.string();continue}case 2:{if(r!==17)break;a.delay=n.double();continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{messageQualifiedName:m(e.messageQualifiedName)?globalThis.String(e.messageQualifiedName):m(e.message_qualified_name)?globalThis.String(e.message_qualified_name):"",delay:m(e.delay)?globalThis.Number(e.delay):0}},toJSON(e){const i={};return e.messageQualifiedName!==""&&(i.messageQualifiedName=e.messageQualifiedName),e.delay!==0&&(i.delay=e.delay),i},create(e){return Se.fromPartial(e??{})},fromPartial(e){const i=Ii();return i.messageQualifiedName=e.messageQualifiedName??"",i.delay=e.delay??0,i}};function Pi(){return{name:"",qualifiedName:"",entries:[]}}const pe={encode(e,i=new u){e.name!==""&&i.uint32(10).string(e.name),e.qualifiedName!==""&&i.uint32(18).string(e.qualifiedName);for(const n of e.entries)Se.encode(n,i.uint32(26).fork()).join();return i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Pi();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==10)break;a.name=n.string();continue}case 2:{if(r!==18)break;a.qualifiedName=n.string();continue}case 3:{if(r!==26)break;a.entries.push(Se.decode(n,n.uint32()));continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{name:m(e.name)?globalThis.String(e.name):"",qualifiedName:m(e.qualifiedName)?globalThis.String(e.qualifiedName):m(e.qualified_name)?globalThis.String(e.qualified_name):"",entries:globalThis.Array.isArray(e?.entries)?e.entries.map(i=>Se.fromJSON(i)):[]}},toJSON(e){const i={};return e.name!==""&&(i.name=e.name),e.qualifiedName!==""&&(i.qualifiedName=e.qualifiedName),e.entries?.length&&(i.entries=e.entries.map(n=>Se.toJSON(n))),i},create(e){return pe.fromPartial(e??{})},fromPartial(e){const i=Pi();return i.name=e.name??"",i.qualifiedName=e.qualifiedName??"",i.entries=e.entries?.map(n=>Se.fromPartial(n))||[],i}};function Ci(){return{id:0,tx:void 0,mux:void 0,sourceId:void 0,canFrameFlags:void 0,linFrameFlags:void 0}}const p={encode(e,i=new u){return e.id!==0&&i.uint32(8).int32(e.id),e.tx!==void 0&&i.uint32(16).bool(e.tx),e.mux!==void 0&&i.uint32(24).int32(e.mux),e.sourceId!==void 0&&i.uint32(34).string(e.sourceId),e.canFrameFlags!==void 0&&T.encode(e.canFrameFlags,i.uint32(42).fork()).join(),e.linFrameFlags!==void 0&&v.encode(e.linFrameFlags,i.uint32(50).fork()).join(),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Ci();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==8)break;a.id=n.int32();continue}case 2:{if(r!==16)break;a.tx=n.bool();continue}case 3:{if(r!==24)break;a.mux=n.int32();continue}case 4:{if(r!==34)break;a.sourceId=n.string();continue}case 5:{if(r!==42)break;a.canFrameFlags=T.decode(n,n.uint32());continue}case 6:{if(r!==50)break;a.linFrameFlags=v.decode(n,n.uint32());continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{id:m(e.id)?globalThis.Number(e.id):0,tx:m(e.tx)?globalThis.Boolean(e.tx):void 0,mux:m(e.mux)?globalThis.Number(e.mux):void 0,sourceId:m(e.sourceId)?globalThis.String(e.sourceId):m(e.source_id)?globalThis.String(e.source_id):void 0,canFrameFlags:m(e.canFrameFlags)?T.fromJSON(e.canFrameFlags):m(e.can_frame_flags)?T.fromJSON(e.can_frame_flags):void 0,linFrameFlags:m(e.linFrameFlags)?v.fromJSON(e.linFrameFlags):m(e.lin_frame_flags)?v.fromJSON(e.lin_frame_flags):void 0}},toJSON(e){const i={};return e.id!==0&&(i.id=Math.round(e.id)),e.tx!==void 0&&(i.tx=e.tx),e.mux!==void 0&&(i.mux=Math.round(e.mux)),e.sourceId!==void 0&&(i.sourceId=e.sourceId),e.canFrameFlags!==void 0&&(i.canFrameFlags=T.toJSON(e.canFrameFlags)),e.linFrameFlags!==void 0&&(i.linFrameFlags=v.toJSON(e.linFrameFlags)),i},create(e){return p.fromPartial(e??{})},fromPartial(e){const i=Ci();return i.id=e.id??0,i.tx=e.tx??void 0,i.mux=e.mux??void 0,i.sourceId=e.sourceId??void 0,i.canFrameFlags=e.canFrameFlags!==void 0&&e.canFrameFlags!==null?T.fromPartial(e.canFrameFlags):void 0,i.linFrameFlags=e.linFrameFlags!==void 0&&e.linFrameFlags!==null?v.fromPartial(e.linFrameFlags):void 0,i}};function Qt(e){return typeof e=="object"&&e!==null}function m(e){return e!=null}function Fi(){return{}}const Wr={encode(e,i=new u){return i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Fi();for(;n.pos<t;){const r=n.uint32();if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return Wr.fromPartial(e??{})},fromPartial(e){return Fi()}};var $r=(e=>(e[e.LOG_LEVEL_TRACE=0]="LOG_LEVEL_TRACE",e[e.LOG_LEVEL_DEBUG=1]="LOG_LEVEL_DEBUG",e[e.LOG_LEVEL_INFORMATION=2]="LOG_LEVEL_INFORMATION",e[e.LOG_LEVEL_WARNING=3]="LOG_LEVEL_WARNING",e[e.LOG_LEVEL_ERROR=4]="LOG_LEVEL_ERROR",e[e.LOG_LEVEL_CRITICAL=5]="LOG_LEVEL_CRITICAL",e[e.LOG_LEVEL_NONE=6]="LOG_LEVEL_NONE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))($r||{});function Pe(e){switch(e){case 0:case"LOG_LEVEL_TRACE":return 0;case 1:case"LOG_LEVEL_DEBUG":return 1;case 2:case"LOG_LEVEL_INFORMATION":return 2;case 3:case"LOG_LEVEL_WARNING":return 3;case 4:case"LOG_LEVEL_ERROR":return 4;case 5:case"LOG_LEVEL_CRITICAL":return 5;case 6:case"LOG_LEVEL_NONE":return 6;default:return-1}}function Ve(e){switch(e){case 0:return"LOG_LEVEL_TRACE";case 1:return"LOG_LEVEL_DEBUG";case 2:return"LOG_LEVEL_INFORMATION";case 3:return"LOG_LEVEL_WARNING";case 4:return"LOG_LEVEL_ERROR";case 5:return"LOG_LEVEL_CRITICAL";case 6:return"LOG_LEVEL_NONE";default:return"UNRECOGNIZED"}}var jr=(e=>(e[e.APP_EVENT_UNSPECIFIED=0]="APP_EVENT_UNSPECIFIED",e[e.APP_EVENT_LICENSE_INFO_CHANGED=1]="APP_EVENT_LICENSE_INFO_CHANGED",e[e.APP_EVENT_EXTENSION_CHANGED=2]="APP_EVENT_EXTENSION_CHANGED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(jr||{});function Xe(e){switch(e){case 0:case"APP_EVENT_UNSPECIFIED":return 0;case 1:case"APP_EVENT_LICENSE_INFO_CHANGED":return 1;case 2:case"APP_EVENT_EXTENSION_CHANGED":return 2;default:return-1}}function ea(e){switch(e){case 0:return"APP_EVENT_UNSPECIFIED";case 1:return"APP_EVENT_LICENSE_INFO_CHANGED";case 2:return"APP_EVENT_EXTENSION_CHANGED";default:return"UNRECOGNIZED"}}function Li(){return{logLevel:0}}const ia={encode(e,i=new u){return e.logLevel!==0&&i.uint32(16).int32(e.logLevel),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Li();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 2:{if(r!==16)break;a.logLevel=n.int32();continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{logLevel:_(e.logLevel)?Pe(e.logLevel):_(e.log_level)?Pe(e.log_level):0}},toJSON(e){const i={};return e.logLevel!==0&&(i.logLevel=Ve(e.logLevel)),i},create(e){return ia.fromPartial(e??{})},fromPartial(e){const i=Li();return i.logLevel=e.logLevel??0,i}};function Mi(){return{logLevel:0}}const na={encode(e,i=new u){return e.logLevel!==0&&i.uint32(8).int32(e.logLevel),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=Mi();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==8)break;a.logLevel=n.int32();continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{logLevel:_(e.logLevel)?Pe(e.logLevel):_(e.log_level)?Pe(e.log_level):0}},toJSON(e){const i={};return e.logLevel!==0&&(i.logLevel=Ve(e.logLevel)),i},create(e){return na.fromPartial(e??{})},fromPartial(e){const i=Mi();return i.logLevel=e.logLevel??0,i}};function ki(){return{time:l.ZERO,logLevel:0,eventId:0,categoryName:"",message:""}}const Ee={encode(e,i=new u){return e.time.equals(l.ZERO)||i.uint32(8).int64(e.time.toString()),e.logLevel!==0&&i.uint32(16).int32(e.logLevel),e.eventId!==0&&i.uint32(24).int32(e.eventId),e.categoryName!==""&&i.uint32(34).string(e.categoryName),e.message!==""&&i.uint32(42).string(e.message),i},decode(e,i){const n=e instanceof s?e:new s(e),t=i===void 0?n.len:n.pos+i,a=ki();for(;n.pos<t;){const r=n.uint32();switch(r>>>3){case 1:{if(r!==8)break;a.time=l.fromString(n.int64().toString());continue}case 2:{if(r!==16)break;a.logLevel=n.int32();continue}case 3:{if(r!==24)break;a.eventId=n.int32();continue}case 4:{if(r!==34)break;a.categoryName=n.string();continue}case 5:{if(r!==42)break;a.message=n.string();continue}}if((r&7)===4||r===0)break;n.skip(r&7)}return a},fromJSON(e){return{time:_(e.time)?l.fromValue(e.time):l.ZERO,logLevel:_(e.logLevel)?Pe(e.logLevel):_(e.log_level)?Pe(e.log_level):0,eventId:_(e.eventId)