UNPKG

@kvaser/canking-api

Version:

CanKing API to communicate with the CanKing service using Node.js.

1 lines 86.4 kB
"use strict";const t=require("./measurement_settings.js"),f=require("long");function I(){return{}}const _e={encode(e,n=new t.BinaryWriter){return n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=I();for(;r.pos<s;){const i=r.uint32();if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return _e.fromPartial(e??{})},fromPartial(e){return I()}};var Le=(e=>(e[e.PROJECT_FILE=0]="PROJECT_FILE",e[e.LOG_FILE=1]="LOG_FILE",e[e.CAN_DATABASES=2]="CAN_DATABASES",e[e.LIN_DATABASES=3]="LIN_DATABASES",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Le||{});function xn(e){switch(e){case 0:case"PROJECT_FILE":return 0;case 1:case"LOG_FILE":return 1;case 2:case"CAN_DATABASES":return 2;case 3:case"LIN_DATABASES":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function Mn(e){switch(e){case 0:return"PROJECT_FILE";case 1:return"LOG_FILE";case 2:return"CAN_DATABASES";case 3:return"LIN_DATABASES";case-1:default:return"UNRECOGNIZED"}}var Je=(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))(Je||{});function h(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;case-1:case"UNRECOGNIZED":default:return-1}}function k(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";case-1:default:return"UNRECOGNIZED"}}var Be=(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.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Be||{});function Ce(e){switch(e){case 0:case"APP_EVENT_UNSPECIFIED":return 0;case 1:case"APP_EVENT_LICENSE_INFO_CHANGED":return 1;case-1:case"UNRECOGNIZED":default:return-1}}function ve(e){switch(e){case 0:return"APP_EVENT_UNSPECIFIED";case 1:return"APP_EVENT_LICENSE_INFO_CHANGED";case-1:default:return"UNRECOGNIZED"}}function y(){return{preferences:void 0,logLevel:0}}const Ge={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.logLevel!==0&&n.uint32(16).int32(e.logLevel),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=y();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==16)break;a.logLevel=r.int32();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:u(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,logLevel:u(e.logLevel)?h(e.logLevel):0}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.logLevel!==0&&(n.logLevel=k(e.logLevel)),n},create(e){return Ge.fromPartial(e??{})},fromPartial(e){const n=y();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.logLevel=e.logLevel??0,n}};function _(){return{logLevel:0}}const Ve={encode(e,n=new t.BinaryWriter){return e.logLevel!==0&&n.uint32(8).int32(e.logLevel),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=_();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==8)break;a.logLevel=r.int32();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{logLevel:u(e.logLevel)?h(e.logLevel):0}},toJSON(e){const n={};return e.logLevel!==0&&(n.logLevel=k(e.logLevel)),n},create(e){return Ve.fromPartial(e??{})},fromPartial(e){const n=_();return n.logLevel=e.logLevel??0,n}};function L(){return{time:f.ZERO,logLevel:0,eventId:0,categoryName:"",message:""}}const p={encode(e,n=new t.BinaryWriter){return e.time.equals(f.ZERO)||n.uint32(8).int64(e.time.toString()),e.logLevel!==0&&n.uint32(16).int32(e.logLevel),e.eventId!==0&&n.uint32(24).int32(e.eventId),e.categoryName!==""&&n.uint32(34).string(e.categoryName),e.message!==""&&n.uint32(42).string(e.message),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=L();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==8)break;a.time=f.fromString(r.int64().toString());continue}case 2:{if(i!==16)break;a.logLevel=r.int32();continue}case 3:{if(i!==24)break;a.eventId=r.int32();continue}case 4:{if(i!==34)break;a.categoryName=r.string();continue}case 5:{if(i!==42)break;a.message=r.string();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{time:u(e.time)?f.fromValue(e.time):f.ZERO,logLevel:u(e.logLevel)?h(e.logLevel):0,eventId:u(e.eventId)?globalThis.Number(e.eventId):0,categoryName:u(e.categoryName)?globalThis.String(e.categoryName):"",message:u(e.message)?globalThis.String(e.message):""}},toJSON(e){const n={};return e.time.equals(f.ZERO)||(n.time=(e.time||f.ZERO).toString()),e.logLevel!==0&&(n.logLevel=k(e.logLevel)),e.eventId!==0&&(n.eventId=Math.round(e.eventId)),e.categoryName!==""&&(n.categoryName=e.categoryName),e.message!==""&&(n.message=e.message),n},create(e){return p.fromPartial(e??{})},fromPartial(e){const n=L();return n.time=e.time!==void 0&&e.time!==null?f.fromValue(e.time):f.ZERO,n.logLevel=e.logLevel??0,n.eventId=e.eventId??0,n.categoryName=e.categoryName??"",n.message=e.message??"",n}};function J(){return{items:[]}}const xe={encode(e,n=new t.BinaryWriter){for(const r of e.items)p.encode(r,n.uint32(10).fork()).join();return n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=J();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.items.push(p.decode(r,r.uint32()));continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{items:globalThis.Array.isArray(e==null?void 0:e.items)?e.items.map(n=>p.fromJSON(n)):[]}},toJSON(e){var r;const n={};return(r=e.items)!=null&&r.length&&(n.items=e.items.map(s=>p.toJSON(s))),n},create(e){return xe.fromPartial(e??{})},fromPartial(e){var r;const n=J();return n.items=((r=e.items)==null?void 0:r.map(s=>p.fromPartial(s)))||[],n}};function B(){return{licenseKey:"",productId:"",productName:"",productVersion:"",instanceId:"",instanceName:"",expirationDate:f.ZERO,isValid:!1}}const l={encode(e,n=new t.BinaryWriter){return e.licenseKey!==""&&n.uint32(10).string(e.licenseKey),e.productId!==""&&n.uint32(18).string(e.productId),e.productName!==""&&n.uint32(26).string(e.productName),e.productVersion!==""&&n.uint32(34).string(e.productVersion),e.instanceId!==""&&n.uint32(42).string(e.instanceId),e.instanceName!==""&&n.uint32(50).string(e.instanceName),e.expirationDate.equals(f.ZERO)||n.uint32(56).int64(e.expirationDate.toString()),e.isValid!==!1&&n.uint32(64).bool(e.isValid),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=B();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.licenseKey=r.string();continue}case 2:{if(i!==18)break;a.productId=r.string();continue}case 3:{if(i!==26)break;a.productName=r.string();continue}case 4:{if(i!==34)break;a.productVersion=r.string();continue}case 5:{if(i!==42)break;a.instanceId=r.string();continue}case 6:{if(i!==50)break;a.instanceName=r.string();continue}case 7:{if(i!==56)break;a.expirationDate=f.fromString(r.int64().toString());continue}case 8:{if(i!==64)break;a.isValid=r.bool();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{licenseKey:u(e.licenseKey)?globalThis.String(e.licenseKey):"",productId:u(e.productId)?globalThis.String(e.productId):"",productName:u(e.productName)?globalThis.String(e.productName):"",productVersion:u(e.productVersion)?globalThis.String(e.productVersion):"",instanceId:u(e.instanceId)?globalThis.String(e.instanceId):"",instanceName:u(e.instanceName)?globalThis.String(e.instanceName):"",expirationDate:u(e.expirationDate)?f.fromValue(e.expirationDate):f.ZERO,isValid:u(e.isValid)?globalThis.Boolean(e.isValid):!1}},toJSON(e){const n={};return e.licenseKey!==""&&(n.licenseKey=e.licenseKey),e.productId!==""&&(n.productId=e.productId),e.productName!==""&&(n.productName=e.productName),e.productVersion!==""&&(n.productVersion=e.productVersion),e.instanceId!==""&&(n.instanceId=e.instanceId),e.instanceName!==""&&(n.instanceName=e.instanceName),e.expirationDate.equals(f.ZERO)||(n.expirationDate=(e.expirationDate||f.ZERO).toString()),e.isValid!==!1&&(n.isValid=e.isValid),n},create(e){return l.fromPartial(e??{})},fromPartial(e){const n=B();return n.licenseKey=e.licenseKey??"",n.productId=e.productId??"",n.productName=e.productName??"",n.productVersion=e.productVersion??"",n.instanceId=e.instanceId??"",n.instanceName=e.instanceName??"",n.expirationDate=e.expirationDate!==void 0&&e.expirationDate!==null?f.fromValue(e.expirationDate):f.ZERO,n.isValid=e.isValid??!1,n}};function C(){return{items:[]}}const S={encode(e,n=new t.BinaryWriter){for(const r of e.items)l.encode(r,n.uint32(10).fork()).join();return n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=C();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.items.push(l.decode(r,r.uint32()));continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{items:globalThis.Array.isArray(e==null?void 0:e.items)?e.items.map(n=>l.fromJSON(n)):[]}},toJSON(e){var r;const n={};return(r=e.items)!=null&&r.length&&(n.items=e.items.map(s=>l.toJSON(s))),n},create(e){return S.fromPartial(e??{})},fromPartial(e){var r;const n=C();return n.items=((r=e.items)==null?void 0:r.map(s=>l.fromPartial(s)))||[],n}};function v(){return{eventType:0,licenses:void 0}}const Me={encode(e,n=new t.BinaryWriter){return e.eventType!==0&&n.uint32(8).int32(e.eventType),e.licenses!==void 0&&S.encode(e.licenses,n.uint32(18).fork()).join(),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=v();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==8)break;a.eventType=r.int32();continue}case 2:{if(i!==18)break;a.licenses=S.decode(r,r.uint32());continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{eventType:u(e.eventType)?Ce(e.eventType):0,licenses:u(e.licenses)?S.fromJSON(e.licenses):void 0}},toJSON(e){const n={};return e.eventType!==0&&(n.eventType=ve(e.eventType)),e.licenses!==void 0&&(n.licenses=S.toJSON(e.licenses)),n},create(e){return Me.fromPartial(e??{})},fromPartial(e){const n=v();return n.eventType=e.eventType??0,n.licenses=e.licenses!==void 0&&e.licenses!==null?S.fromPartial(e.licenses):void 0,n}};function G(){return{preferences:void 0,filePath:"",replaceExisting:void 0}}const De={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.filePath!==""&&n.uint32(18).string(e.filePath),e.replaceExisting!==void 0&&n.uint32(24).bool(e.replaceExisting),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=G();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.filePath=r.string();continue}case 3:{if(i!==24)break;a.replaceExisting=r.bool();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:u(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,filePath:u(e.filePath)?globalThis.String(e.filePath):"",replaceExisting:u(e.replaceExisting)?globalThis.Boolean(e.replaceExisting):void 0}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.filePath!==""&&(n.filePath=e.filePath),e.replaceExisting!==void 0&&(n.replaceExisting=e.replaceExisting),n},create(e){return De.fromPartial(e??{})},fromPartial(e){const n=G();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.filePath=e.filePath??"",n.replaceExisting=e.replaceExisting??void 0,n}};function V(){return{preferences:void 0,name:""}}const Fe={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.name!==""&&n.uint32(18).string(e.name),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=V();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.name=r.string();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:u(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,name:u(e.name)?globalThis.String(e.name):""}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.name!==""&&(n.name=e.name),n},create(e){return Fe.fromPartial(e??{})},fromPartial(e){const n=V();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.name=e.name??"",n}};function x(){return{preferences:void 0,filePathOrName:""}}const Ue={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.filePathOrName!==""&&n.uint32(18).string(e.filePathOrName),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=x();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.filePathOrName=r.string();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:u(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,filePathOrName:u(e.filePathOrName)?globalThis.String(e.filePathOrName):""}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.filePathOrName!==""&&(n.filePathOrName=e.filePathOrName),n},create(e){return Ue.fromPartial(e??{})},fromPartial(e){const n=x();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.filePathOrName=e.filePathOrName??"",n}};function M(){return{name:"",displayName:"",description:"",version:"",author:"",defaultConfig:""}}const qe={encode(e,n=new t.BinaryWriter){return e.name!==""&&n.uint32(10).string(e.name),e.displayName!==""&&n.uint32(18).string(e.displayName),e.description!==""&&n.uint32(26).string(e.description),e.version!==""&&n.uint32(34).string(e.version),e.author!==""&&n.uint32(42).string(e.author),e.defaultConfig!==""&&n.uint32(50).string(e.defaultConfig),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=M();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.name=r.string();continue}case 2:{if(i!==18)break;a.displayName=r.string();continue}case 3:{if(i!==26)break;a.description=r.string();continue}case 4:{if(i!==34)break;a.version=r.string();continue}case 5:{if(i!==42)break;a.author=r.string();continue}case 6:{if(i!==50)break;a.defaultConfig=r.string();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{name:u(e.name)?globalThis.String(e.name):"",displayName:u(e.displayName)?globalThis.String(e.displayName):"",description:u(e.description)?globalThis.String(e.description):"",version:u(e.version)?globalThis.String(e.version):"",author:u(e.author)?globalThis.String(e.author):"",defaultConfig:u(e.defaultConfig)?globalThis.String(e.defaultConfig):""}},toJSON(e){const n={};return e.name!==""&&(n.name=e.name),e.displayName!==""&&(n.displayName=e.displayName),e.description!==""&&(n.description=e.description),e.version!==""&&(n.version=e.version),e.author!==""&&(n.author=e.author),e.defaultConfig!==""&&(n.defaultConfig=e.defaultConfig),n},create(e){return qe.fromPartial(e??{})},fromPartial(e){const n=M();return n.name=e.name??"",n.displayName=e.displayName??"",n.description=e.description??"",n.version=e.version??"",n.author=e.author??"",n.defaultConfig=e.defaultConfig??"",n}};function D(){return{licenses:[]}}const we={encode(e,n=new t.BinaryWriter){for(const r of e.licenses)l.encode(r,n.uint32(10).fork()).join();return n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=D();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.licenses.push(l.decode(r,r.uint32()));continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{licenses:globalThis.Array.isArray(e==null?void 0:e.licenses)?e.licenses.map(n=>l.fromJSON(n)):[]}},toJSON(e){var r;const n={};return(r=e.licenses)!=null&&r.length&&(n.licenses=e.licenses.map(s=>l.toJSON(s))),n},create(e){return we.fromPartial(e??{})},fromPartial(e){var r;const n=D();return n.licenses=((r=e.licenses)==null?void 0:r.map(s=>l.fromPartial(s)))||[],n}};function F(){return{preferences:void 0,licenseKey:"",productId:""}}const We={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.licenseKey!==""&&n.uint32(18).string(e.licenseKey),e.productId!==""&&n.uint32(26).string(e.productId),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=F();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.licenseKey=r.string();continue}case 3:{if(i!==26)break;a.productId=r.string();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:u(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,licenseKey:u(e.licenseKey)?globalThis.String(e.licenseKey):"",productId:u(e.productId)?globalThis.String(e.productId):""}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.licenseKey!==""&&(n.licenseKey=e.licenseKey),e.productId!==""&&(n.productId=e.productId),n},create(e){return We.fromPartial(e??{})},fromPartial(e){const n=F();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.licenseKey=e.licenseKey??"",n.productId=e.productId??"",n}};function U(){return{apiVersion:"",serviceVersion:"",canlibVersion:""}}const Ze={encode(e,n=new t.BinaryWriter){return e.apiVersion!==""&&n.uint32(10).string(e.apiVersion),e.serviceVersion!==""&&n.uint32(18).string(e.serviceVersion),e.canlibVersion!==""&&n.uint32(26).string(e.canlibVersion),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=U();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.apiVersion=r.string();continue}case 2:{if(i!==18)break;a.serviceVersion=r.string();continue}case 3:{if(i!==26)break;a.canlibVersion=r.string();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{apiVersion:u(e.apiVersion)?globalThis.String(e.apiVersion):"",serviceVersion:u(e.serviceVersion)?globalThis.String(e.serviceVersion):"",canlibVersion:u(e.canlibVersion)?globalThis.String(e.canlibVersion):""}},toJSON(e){const n={};return e.apiVersion!==""&&(n.apiVersion=e.apiVersion),e.serviceVersion!==""&&(n.serviceVersion=e.serviceVersion),e.canlibVersion!==""&&(n.canlibVersion=e.canlibVersion),n},create(e){return Ze.fromPartial(e??{})},fromPartial(e){const n=U();return n.apiVersion=e.apiVersion??"",n.serviceVersion=e.serviceVersion??"",n.canlibVersion=e.canlibVersion??"",n}};function u(e){return e!=null}var Ke=(e=>(e[e.MEASUREMENT_EVENT_UNSPECIFIED=0]="MEASUREMENT_EVENT_UNSPECIFIED",e[e.MEASUREMENT_EVENT_MEASUREMENT_SETUP_CHANGED=1]="MEASUREMENT_EVENT_MEASUREMENT_SETUP_CHANGED",e[e.MEASUREMENT_EVENT_ONLINE_STATUS_CHANGED=2]="MEASUREMENT_EVENT_ONLINE_STATUS_CHANGED",e[e.MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STARTED=3]="MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STARTED",e[e.MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STOPPED=4]="MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STOPPED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Ke||{});function Qe(e){switch(e){case 0:case"MEASUREMENT_EVENT_UNSPECIFIED":return 0;case 1:case"MEASUREMENT_EVENT_MEASUREMENT_SETUP_CHANGED":return 1;case 2:case"MEASUREMENT_EVENT_ONLINE_STATUS_CHANGED":return 2;case 3:case"MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STARTED":return 3;case 4:case"MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STOPPED":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function He(e){switch(e){case 0:return"MEASUREMENT_EVENT_UNSPECIFIED";case 1:return"MEASUREMENT_EVENT_MEASUREMENT_SETUP_CHANGED";case 2:return"MEASUREMENT_EVENT_ONLINE_STATUS_CHANGED";case 3:return"MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STARTED";case 4:return"MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STOPPED";case-1:default:return"UNRECOGNIZED"}}function q(){return{preferences:void 0,setup:void 0}}const Ye={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.setup!==void 0&&t.MeasurementSetup.encode(e.setup,n.uint32(18).fork()).join(),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=q();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.setup=t.MeasurementSetup.decode(r,r.uint32());continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,setup:o(e.setup)?t.MeasurementSetup.fromJSON(e.setup):void 0}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.setup!==void 0&&(n.setup=t.MeasurementSetup.toJSON(e.setup)),n},create(e){return Ye.fromPartial(e??{})},fromPartial(e){const n=q();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.setup=e.setup!==void 0&&e.setup!==null?t.MeasurementSetup.fromPartial(e.setup):void 0,n}};function w(){return{preferences:void 0,configuration:void 0}}const $e={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.configuration!==void 0&&t.CanChannelConfiguration.encode(e.configuration,n.uint32(18).fork()).join(),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=w();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.configuration=t.CanChannelConfiguration.decode(r,r.uint32());continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,configuration:o(e.configuration)?t.CanChannelConfiguration.fromJSON(e.configuration):void 0}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.configuration!==void 0&&(n.configuration=t.CanChannelConfiguration.toJSON(e.configuration)),n},create(e){return $e.fromPartial(e??{})},fromPartial(e){const n=w();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.configuration=e.configuration!==void 0&&e.configuration!==null?t.CanChannelConfiguration.fromPartial(e.configuration):void 0,n}};function W(){return{preferences:void 0,configuration:void 0}}const ze={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.configuration!==void 0&&t.LinChannelConfiguration.encode(e.configuration,n.uint32(18).fork()).join(),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=W();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.configuration=t.LinChannelConfiguration.decode(r,r.uint32());continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,configuration:o(e.configuration)?t.LinChannelConfiguration.fromJSON(e.configuration):void 0}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.configuration!==void 0&&(n.configuration=t.LinChannelConfiguration.toJSON(e.configuration)),n},create(e){return ze.fromPartial(e??{})},fromPartial(e){const n=W();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.configuration=e.configuration!==void 0&&e.configuration!==null?t.LinChannelConfiguration.fromPartial(e.configuration):void 0,n}};function Z(){return{preferences:void 0,source:void 0,replaceAllProperties:!1}}const Xe={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.source!==void 0&&t.SourceNodeProperties.encode(e.source,n.uint32(18).fork()).join(),e.replaceAllProperties!==!1&&n.uint32(24).bool(e.replaceAllProperties),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=Z();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.source=t.SourceNodeProperties.decode(r,r.uint32());continue}case 3:{if(i!==24)break;a.replaceAllProperties=r.bool();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,source:o(e.source)?t.SourceNodeProperties.fromJSON(e.source):void 0,replaceAllProperties:o(e.replaceAllProperties)?globalThis.Boolean(e.replaceAllProperties):!1}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.source!==void 0&&(n.source=t.SourceNodeProperties.toJSON(e.source)),e.replaceAllProperties!==!1&&(n.replaceAllProperties=e.replaceAllProperties),n},create(e){return Xe.fromPartial(e??{})},fromPartial(e){const n=Z();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.source=e.source!==void 0&&e.source!==null?t.SourceNodeProperties.fromPartial(e.source):void 0,n.replaceAllProperties=e.replaceAllProperties??!1,n}};function K(){return{source:void 0}}const be={encode(e,n=new t.BinaryWriter){return e.source!==void 0&&t.SourceNodeProperties.encode(e.source,n.uint32(10).fork()).join(),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=K();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.source=t.SourceNodeProperties.decode(r,r.uint32());continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{source:o(e.source)?t.SourceNodeProperties.fromJSON(e.source):void 0}},toJSON(e){const n={};return e.source!==void 0&&(n.source=t.SourceNodeProperties.toJSON(e.source)),n},create(e){return be.fromPartial(e??{})},fromPartial(e){const n=K();return n.source=e.source!==void 0&&e.source!==null?t.SourceNodeProperties.fromPartial(e.source):void 0,n}};function Q(){return{preferences:void 0,dataProcessor:void 0,previousNode:"",nextNode:"",replaceAllProperties:!1}}const je={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.dataProcessor!==void 0&&t.DataProcessorNodeProperties.encode(e.dataProcessor,n.uint32(18).fork()).join(),e.previousNode!==""&&n.uint32(26).string(e.previousNode),e.nextNode!==""&&n.uint32(34).string(e.nextNode),e.replaceAllProperties!==!1&&n.uint32(40).bool(e.replaceAllProperties),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=Q();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.dataProcessor=t.DataProcessorNodeProperties.decode(r,r.uint32());continue}case 3:{if(i!==26)break;a.previousNode=r.string();continue}case 4:{if(i!==34)break;a.nextNode=r.string();continue}case 5:{if(i!==40)break;a.replaceAllProperties=r.bool();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,dataProcessor:o(e.dataProcessor)?t.DataProcessorNodeProperties.fromJSON(e.dataProcessor):void 0,previousNode:o(e.previousNode)?globalThis.String(e.previousNode):"",nextNode:o(e.nextNode)?globalThis.String(e.nextNode):"",replaceAllProperties:o(e.replaceAllProperties)?globalThis.Boolean(e.replaceAllProperties):!1}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.dataProcessor!==void 0&&(n.dataProcessor=t.DataProcessorNodeProperties.toJSON(e.dataProcessor)),e.previousNode!==""&&(n.previousNode=e.previousNode),e.nextNode!==""&&(n.nextNode=e.nextNode),e.replaceAllProperties!==!1&&(n.replaceAllProperties=e.replaceAllProperties),n},create(e){return je.fromPartial(e??{})},fromPartial(e){const n=Q();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.dataProcessor=e.dataProcessor!==void 0&&e.dataProcessor!==null?t.DataProcessorNodeProperties.fromPartial(e.dataProcessor):void 0,n.previousNode=e.previousNode??"",n.nextNode=e.nextNode??"",n.replaceAllProperties=e.replaceAllProperties??!1,n}};function H(){return{dataProcessor:void 0}}const en={encode(e,n=new t.BinaryWriter){return e.dataProcessor!==void 0&&t.DataProcessorNodeProperties.encode(e.dataProcessor,n.uint32(10).fork()).join(),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=H();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.dataProcessor=t.DataProcessorNodeProperties.decode(r,r.uint32());continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{dataProcessor:o(e.dataProcessor)?t.DataProcessorNodeProperties.fromJSON(e.dataProcessor):void 0}},toJSON(e){const n={};return e.dataProcessor!==void 0&&(n.dataProcessor=t.DataProcessorNodeProperties.toJSON(e.dataProcessor)),n},create(e){return en.fromPartial(e??{})},fromPartial(e){const n=H();return n.dataProcessor=e.dataProcessor!==void 0&&e.dataProcessor!==null?t.DataProcessorNodeProperties.fromPartial(e.dataProcessor):void 0,n}};function Y(){return{preferences:void 0,target:void 0,replaceAllProperties:!1}}const nn={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.target!==void 0&&t.TargetNodeProperties.encode(e.target,n.uint32(18).fork()).join(),e.replaceAllProperties!==!1&&n.uint32(24).bool(e.replaceAllProperties),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=Y();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.target=t.TargetNodeProperties.decode(r,r.uint32());continue}case 3:{if(i!==24)break;a.replaceAllProperties=r.bool();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,target:o(e.target)?t.TargetNodeProperties.fromJSON(e.target):void 0,replaceAllProperties:o(e.replaceAllProperties)?globalThis.Boolean(e.replaceAllProperties):!1}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.target!==void 0&&(n.target=t.TargetNodeProperties.toJSON(e.target)),e.replaceAllProperties!==!1&&(n.replaceAllProperties=e.replaceAllProperties),n},create(e){return nn.fromPartial(e??{})},fromPartial(e){const n=Y();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.target=e.target!==void 0&&e.target!==null?t.TargetNodeProperties.fromPartial(e.target):void 0,n.replaceAllProperties=e.replaceAllProperties??!1,n}};function $(){return{target:void 0}}const rn={encode(e,n=new t.BinaryWriter){return e.target!==void 0&&t.TargetNodeProperties.encode(e.target,n.uint32(10).fork()).join(),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=$();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.target=t.TargetNodeProperties.decode(r,r.uint32());continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{target:o(e.target)?t.TargetNodeProperties.fromJSON(e.target):void 0}},toJSON(e){const n={};return e.target!==void 0&&(n.target=t.TargetNodeProperties.toJSON(e.target)),n},create(e){return rn.fromPartial(e??{})},fromPartial(e){const n=$();return n.target=e.target!==void 0&&e.target!==null?t.TargetNodeProperties.fromPartial(e.target):void 0,n}};function z(){return{preferences:void 0,startNode:"",endNode:""}}const tn={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.startNode!==""&&n.uint32(18).string(e.startNode),e.endNode!==""&&n.uint32(26).string(e.endNode),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=z();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.startNode=r.string();continue}case 3:{if(i!==26)break;a.endNode=r.string();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,startNode:o(e.startNode)?globalThis.String(e.startNode):"",endNode:o(e.endNode)?globalThis.String(e.endNode):""}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.startNode!==""&&(n.startNode=e.startNode),e.endNode!==""&&(n.endNode=e.endNode),n},create(e){return tn.fromPartial(e??{})},fromPartial(e){const n=z();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.startNode=e.startNode??"",n.endNode=e.endNode??"",n}};function X(){return{preferences:void 0,startNode:"",endNode:""}}const an={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.startNode!==""&&n.uint32(18).string(e.startNode),e.endNode!==""&&n.uint32(26).string(e.endNode),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=X();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.startNode=r.string();continue}case 3:{if(i!==26)break;a.endNode=r.string();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,startNode:o(e.startNode)?globalThis.String(e.startNode):"",endNode:o(e.endNode)?globalThis.String(e.endNode):""}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.startNode!==""&&(n.startNode=e.startNode),e.endNode!==""&&(n.endNode=e.endNode),n},create(e){return an.fromPartial(e??{})},fromPartial(e){const n=X();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.startNode=e.startNode??"",n.endNode=e.endNode??"",n}};function b(){return{preferences:void 0,identifier:""}}const sn={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.identifier!==""&&n.uint32(18).string(e.identifier),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=b();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.identifier=r.string();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,identifier:o(e.identifier)?globalThis.String(e.identifier):""}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.identifier!==""&&(n.identifier=e.identifier),n},create(e){return sn.fromPartial(e??{})},fromPartial(e){const n=b();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.identifier=e.identifier??"",n}};function j(){return{preferences:void 0,identifiers:[]}}const on={encode(e,n=new t.BinaryWriter){e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join();for(const r of e.identifiers)n.uint32(18).string(r);return n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=j();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.identifiers.push(r.string());continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,identifiers:globalThis.Array.isArray(e==null?void 0:e.identifiers)?e.identifiers.map(n=>globalThis.String(n)):[]}},toJSON(e){var r;const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),(r=e.identifiers)!=null&&r.length&&(n.identifiers=e.identifiers),n},create(e){return on.fromPartial(e??{})},fromPartial(e){var r;const n=j();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.identifiers=((r=e.identifiers)==null?void 0:r.map(s=>s))||[],n}};function ee(){return{preferences:void 0,channelIdentifier:"",frame:void 0}}const fn={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.channelIdentifier!==""&&n.uint32(18).string(e.channelIdentifier),e.frame!==void 0&&t.WriteFrame.encode(e.frame,n.uint32(26).fork()).join(),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=ee();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.channelIdentifier=r.string();continue}case 3:{if(i!==26)break;a.frame=t.WriteFrame.decode(r,r.uint32());continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,channelIdentifier:o(e.channelIdentifier)?globalThis.String(e.channelIdentifier):"",frame:o(e.frame)?t.WriteFrame.fromJSON(e.frame):void 0}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.channelIdentifier!==""&&(n.channelIdentifier=e.channelIdentifier),e.frame!==void 0&&(n.frame=t.WriteFrame.toJSON(e.frame)),n},create(e){return fn.fromPartial(e??{})},fromPartial(e){const n=ee();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.channelIdentifier=e.channelIdentifier??"",n.frame=e.frame!==void 0&&e.frame!==null?t.WriteFrame.fromPartial(e.frame):void 0,n}};function ne(){return{preferences:void 0,channelIdentifier:"",count:0,interval:0}}const un={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.channelIdentifier!==""&&n.uint32(18).string(e.channelIdentifier),e.count!==0&&n.uint32(24).int32(e.count),e.interval!==0&&n.uint32(32).int32(e.interval),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=ne();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.channelIdentifier=r.string();continue}case 3:{if(i!==24)break;a.count=r.int32();continue}case 4:{if(i!==32)break;a.interval=r.int32();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,channelIdentifier:o(e.channelIdentifier)?globalThis.String(e.channelIdentifier):"",count:o(e.count)?globalThis.Number(e.count):0,interval:o(e.interval)?globalThis.Number(e.interval):0}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.channelIdentifier!==""&&(n.channelIdentifier=e.channelIdentifier),e.count!==0&&(n.count=Math.round(e.count)),e.interval!==0&&(n.interval=Math.round(e.interval)),n},create(e){return un.fromPartial(e??{})},fromPartial(e){const n=ne();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.channelIdentifier=e.channelIdentifier??"",n.count=e.count??0,n.interval=e.interval??0,n}};function re(){return{preferences:void 0,channelIdentifier:"",frameId:0}}const dn={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.channelIdentifier!==""&&n.uint32(18).string(e.channelIdentifier),e.frameId!==0&&n.uint32(24).int32(e.frameId),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=re();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.channelIdentifier=r.string();continue}case 3:{if(i!==24)break;a.frameId=r.int32();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,channelIdentifier:o(e.channelIdentifier)?globalThis.String(e.channelIdentifier):"",frameId:o(e.frameId)?globalThis.Number(e.frameId):0}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.channelIdentifier!==""&&(n.channelIdentifier=e.channelIdentifier),e.frameId!==0&&(n.frameId=Math.round(e.frameId)),n},create(e){return dn.fromPartial(e??{})},fromPartial(e){const n=re();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.channelIdentifier=e.channelIdentifier??"",n.frameId=e.frameId??0,n}};function ie(){return{preferences:void 0,channelIdentifier:"",frame:void 0}}const cn={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.channelIdentifier!==""&&n.uint32(18).string(e.channelIdentifier),e.frame!==void 0&&t.WriteFrame.encode(e.frame,n.uint32(26).fork()).join(),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=ie();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.channelIdentifier=r.string();continue}case 3:{if(i!==26)break;a.frame=t.WriteFrame.decode(r,r.uint32());continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,channelIdentifier:o(e.channelIdentifier)?globalThis.String(e.channelIdentifier):"",frame:o(e.frame)?t.WriteFrame.fromJSON(e.frame):void 0}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.channelIdentifier!==""&&(n.channelIdentifier=e.channelIdentifier),e.frame!==void 0&&(n.frame=t.WriteFrame.toJSON(e.frame)),n},create(e){return cn.fromPartial(e??{})},fromPartial(e){const n=ie();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.channelIdentifier=e.channelIdentifier??"",n.frame=e.frame!==void 0&&e.frame!==null?t.WriteFrame.fromPartial(e.frame):void 0,n}};function te(){return{preferences:void 0,channelIdentifier:"",frameId:0}}const ln={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.channelIdentifier!==""&&n.uint32(18).string(e.channelIdentifier),e.frameId!==0&&n.uint32(24).int32(e.frameId),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=te();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.channelIdentifier=r.string();continue}case 3:{if(i!==24)break;a.frameId=r.int32();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,channelIdentifier:o(e.channelIdentifier)?globalThis.String(e.channelIdentifier):"",frameId:o(e.frameId)?globalThis.Number(e.frameId):0}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.channelIdentifier!==""&&(n.channelIdentifier=e.channelIdentifier),e.frameId!==0&&(n.frameId=Math.round(e.frameId)),n},create(e){return ln.fromPartial(e??{})},fromPartial(e){const n=te();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.channelIdentifier=e.channelIdentifier??"",n.frameId=e.frameId??0,n}};function ae(){return{preferences:void 0,settings:void 0}}const pn={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.settings!==void 0&&t.PeriodicTransmissionSettings.encode(e.settings,n.uint32(18).fork()).join(),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=ae();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.settings=t.PeriodicTransmissionSettings.decode(r,r.uint32());continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,settings:o(e.settings)?t.PeriodicTransmissionSettings.fromJSON(e.settings):void 0}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.settings!==void 0&&(n.settings=t.PeriodicTransmissionSettings.toJSON(e.settings)),n},create(e){return pn.fromPartial(e??{})},fromPartial(e){const n=ae();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.settings=e.settings!==void 0&&e.settings!==null?t.PeriodicTransmissionSettings.fromPartial(e.settings):void 0,n}};function se(){return{preferences:void 0,settings:void 0,identifier:""}}const Sn={encode(e,n=new t.BinaryWriter){return e.preferences!==void 0&&t.ApiPreferences.encode(e.preferences,n.uint32(10).fork()).join(),e.settings!==void 0&&t.PeriodicTransmissionSettings.encode(e.settings,n.uint32(18).fork()).join(),e.identifier!==""&&n.uint32(26).string(e.identifier),n},decode(e,n){const r=e instanceof t.BinaryReader?e:new t.BinaryReader(e);let s=n===void 0?r.len:r.pos+n;const a=se();for(;r.pos<s;){const i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;a.preferences=t.ApiPreferences.decode(r,r.uint32());continue}case 2:{if(i!==18)break;a.settings=t.PeriodicTransmissionSettings.decode(r,r.uint32());continue}case 3:{if(i!==26)break;a.identifier=r.string();continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return a},fromJSON(e){return{preferences:o(e.preferences)?t.ApiPreferences.fromJSON(e.preferences):void 0,settings:o(e.settings)?t.PeriodicTransmissionSettings.fromJSON(e.settings):void 0,identifier:o(e.identifier)?globalThis.String(e.identifier):""}},toJSON(e){const n={};return e.preferences!==void 0&&(n.preferences=t.ApiPreferences.toJSON(e.preferences)),e.settings!==void 0&&(n.settings=t.PeriodicTransmissionSettings.toJSON(e.settings)),e.identifier!==""&&(n.identifier=e.identifier),n},create(e){return Sn.fromPartial(e??{})},fromPartial(e){const n=se();return n.preferences=e.preferences!==void 0&&e.preferences!==null?t.ApiPreferences.fromPartial(e.preferences):void 0,n.settings=e.settings!==void 0&&e.settings!==null?t.PeriodicTransmissionSettings.fromPartial(e.settings):void 0,n.identifier=e.identifier??"",n}};function oe(){return{periodicTransmissionIdentifier:""}}const Nn={encode(e,n=new t.BinaryWriter){return e.periodicTransmissionIdentifier!==""&&n.u