-
Notifications
You must be signed in to change notification settings - Fork 0
/
bundle.js
1 lines (1 loc) · 106 KB
/
bundle.js
1
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,(()=>(()=>{"use strict";var __webpack_modules__={45:e=>{e.exports=function(e,t){for(var r=new Array(arguments.length-1),i=0,n=2,a=!0;n<arguments.length;)r[i++]=arguments[n++];return new Promise((function(n,o){r[i]=function(e){if(a)if(a=!1,e)o(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];n.apply(null,t)}};try{e.apply(t||null,r)}catch(e){a&&(a=!1,o(e))}}))}},839:(e,t)=>{var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var i=new Array(64),n=new Array(123),a=0;a<64;)n[i[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;r.encode=function(e,t,r){for(var n,a=null,o=[],s=0,l=0;t<r;){var c=e[t++];switch(l){case 0:o[s++]=i[c>>2],n=(3&c)<<4,l=1;break;case 1:o[s++]=i[n|c>>4],n=(15&c)<<2,l=2;break;case 2:o[s++]=i[n|c>>6],o[s++]=i[63&c],l=0}s>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,o)),s=0)}return l&&(o[s++]=i[n],o[s++]=61,1===l&&(o[s++]=61)),a?(s&&a.push(String.fromCharCode.apply(String,o.slice(0,s))),a.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var o="invalid encoding";r.decode=function(e,t,r){for(var i,a=r,s=0,l=0;l<e.length;){var c=e.charCodeAt(l++);if(61===c&&s>1)break;if(void 0===(c=n[c]))throw Error(o);switch(s){case 0:i=c,s=1;break;case 1:t[r++]=i<<2|(48&c)>>4,i=c,s=2;break;case 2:t[r++]=(15&i)<<4|(60&c)>>2,i=c,s=3;break;case 3:t[r++]=(3&i)<<6|c,s=0}}if(1===s)throw Error(o);return r-a},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},358:e=>{function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],i=0;i<r.length;)r[i].fn===t?r.splice(i,1):++i;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,r)}return this}},410:e=>{function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),i=128===r[3];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3]}function a(e,i,n){t[0]=e,i[n]=r[3],i[n+1]=r[2],i[n+2]=r[1],i[n+3]=r[0]}function o(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],t[0]}function s(e,i){return r[3]=e[i],r[2]=e[i+1],r[1]=e[i+2],r[0]=e[i+3],t[0]}e.writeFloatLE=i?n:a,e.writeFloatBE=i?a:n,e.readFloatLE=i?o:s,e.readFloatBE=i?s:o}():function(){function t(e,t,r,i){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,r,i);else if(isNaN(t))e(2143289344,r,i);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,i);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,i);else{var a=Math.floor(Math.log(t)/Math.LN2);e((n<<31|a+127<<23|8388607&Math.round(t*Math.pow(2,-a)*8388608))>>>0,r,i)}}function o(e,t,r){var i=e(t,r),n=2*(i>>31)+1,a=i>>>23&255,o=8388607&i;return 255===a?o?NaN:n*(1/0):0===a?1401298464324817e-60*n*o:n*Math.pow(2,a-150)*(o+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i),e.readFloatLE=o.bind(null,n),e.readFloatBE=o.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),i=128===r[7];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3],i[n+4]=r[4],i[n+5]=r[5],i[n+6]=r[6],i[n+7]=r[7]}function a(e,i,n){t[0]=e,i[n]=r[7],i[n+1]=r[6],i[n+2]=r[5],i[n+3]=r[4],i[n+4]=r[3],i[n+5]=r[2],i[n+6]=r[1],i[n+7]=r[0]}function o(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],r[4]=e[i+4],r[5]=e[i+5],r[6]=e[i+6],r[7]=e[i+7],t[0]}function s(e,i){return r[7]=e[i],r[6]=e[i+1],r[5]=e[i+2],r[4]=e[i+3],r[3]=e[i+4],r[2]=e[i+5],r[1]=e[i+6],r[0]=e[i+7],t[0]}e.writeDoubleLE=i?n:a,e.writeDoubleBE=i?a:n,e.readDoubleLE=i?o:s,e.readDoubleBE=i?s:o}():function(){function t(e,t,r,i,n,a){var o=i<0?1:0;if(o&&(i=-i),0===i)e(0,n,a+t),e(1/i>0?0:2147483648,n,a+r);else if(isNaN(i))e(0,n,a+t),e(2146959360,n,a+r);else if(i>17976931348623157e292)e(0,n,a+t),e((o<<31|2146435072)>>>0,n,a+r);else{var s;if(i<22250738585072014e-324)e((s=i/5e-324)>>>0,n,a+t),e((o<<31|s/4294967296)>>>0,n,a+r);else{var l=Math.floor(Math.log(i)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=i*Math.pow(2,-l))>>>0,n,a+t),e((o<<31|l+1023<<20|1048576*s&1048575)>>>0,n,a+r)}}}function o(e,t,r,i,n){var a=e(i,n+t),o=e(i,n+r),s=2*(o>>31)+1,l=o>>>20&2047,c=4294967296*(1048575&o)+a;return 2047===l?c?NaN:s*(1/0):0===l?5e-324*s*c:s*Math.pow(2,l-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0),e.readDoubleLE=o.bind(null,n,0,4),e.readDoubleBE=o.bind(null,a,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function i(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},153:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},390:e=>{e.exports=function(e,t,r){var i=r||8192,n=i>>>1,a=null,o=i;return function(r){if(r<1||r>n)return e(r);o+r>i&&(a=e(i),o=0);var s=t.call(a,o,o+=r);return 7&o&&(o=1+(7|o)),s}}},447:(e,t)=>{var r=t;r.length=function(e){for(var t=0,r=0,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(i+1))?(++i,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var i,n=null,a=[],o=0;t<r;)(i=e[t++])<128?a[o++]=i:i>191&&i<224?a[o++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[o++]=55296+(i>>10),a[o++]=56320+(1023&i)):a[o++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,a)),o=0);return n?(o&&n.push(String.fromCharCode.apply(String,a.slice(0,o))),n.join("")):String.fromCharCode.apply(String,a.slice(0,o))},r.write=function(e,t,r){for(var i,n,a=r,o=0;o<e.length;++o)(i=e.charCodeAt(o))<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=e.charCodeAt(o+1)))?(i=65536+((1023&i)<<10)+(1023&n),++o,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128);return r-a}},252:(e,t,r)=>{var i,n=r(946),a=n.Reader,o=n.Writer,s=n.util,l=n.roots.default||(n.roots.default={});l.transit_realtime=((i={}).FeedMessage=function(){function e(e){if(this.entity=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.header=null,e.prototype.entity=s.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),l.transit_realtime.FeedHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.entity&&e.entity.length)for(var r=0;r<e.entity.length;++r)l.transit_realtime.FeedEntity.encode(e.entity[r],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.FeedMessage;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.header=l.transit_realtime.FeedHeader.decode(e,e.uint32());break;case 2:i.entity&&i.entity.length||(i.entity=[]),i.entity.push(l.transit_realtime.FeedEntity.decode(e,e.uint32()));break;default:e.skipType(7&n)}}if(!i.hasOwnProperty("header"))throw s.ProtocolError("missing required 'header'",{instance:i});return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(r=l.transit_realtime.FeedHeader.verify(e.header))return"header."+r;if(null!=e.entity&&e.hasOwnProperty("entity")){if(!Array.isArray(e.entity))return"entity: array expected";for(var t=0;t<e.entity.length;++t){var r;if(r=l.transit_realtime.FeedEntity.verify(e.entity[t]))return"entity."+r}}return null},e.fromObject=function(e){if(e instanceof l.transit_realtime.FeedMessage)return e;var t=new l.transit_realtime.FeedMessage;if(null!=e.header){if("object"!=typeof e.header)throw TypeError(".transit_realtime.FeedMessage.header: object expected");t.header=l.transit_realtime.FeedHeader.fromObject(e.header)}if(e.entity){if(!Array.isArray(e.entity))throw TypeError(".transit_realtime.FeedMessage.entity: array expected");t.entity=[];for(var r=0;r<e.entity.length;++r){if("object"!=typeof e.entity[r])throw TypeError(".transit_realtime.FeedMessage.entity: object expected");t.entity[r]=l.transit_realtime.FeedEntity.fromObject(e.entity[r])}}return t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.entity=[]),t.defaults&&(r.header=null),null!=e.header&&e.hasOwnProperty("header")&&(r.header=l.transit_realtime.FeedHeader.toObject(e.header,t)),e.entity&&e.entity.length){r.entity=[];for(var i=0;i<e.entity.length;++i)r.entity[i]=l.transit_realtime.FeedEntity.toObject(e.entity[i],t)}return r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.FeedMessage"},e}(),i.FeedHeader=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var t,r;return e.prototype.gtfsRealtimeVersion="",e.prototype.incrementality=0,e.prototype.timestamp=s.Long?s.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),t.uint32(10).string(e.gtfsRealtimeVersion),null!=e.incrementality&&Object.hasOwnProperty.call(e,"incrementality")&&t.uint32(16).int32(e.incrementality),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).uint64(e.timestamp),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.FeedHeader;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.gtfsRealtimeVersion=e.string();break;case 2:i.incrementality=e.int32();break;case 3:i.timestamp=e.uint64();break;default:e.skipType(7&n)}}if(!i.hasOwnProperty("gtfsRealtimeVersion"))throw s.ProtocolError("missing required 'gtfsRealtimeVersion'",{instance:i});return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!s.isString(e.gtfsRealtimeVersion))return"gtfsRealtimeVersion: string expected";if(null!=e.incrementality&&e.hasOwnProperty("incrementality"))switch(e.incrementality){default:return"incrementality: enum value expected";case 0:case 1:}return null!=e.timestamp&&e.hasOwnProperty("timestamp")&&!(s.isInteger(e.timestamp)||e.timestamp&&s.isInteger(e.timestamp.low)&&s.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":null},e.fromObject=function(e){if(e instanceof l.transit_realtime.FeedHeader)return e;var t=new l.transit_realtime.FeedHeader;switch(null!=e.gtfsRealtimeVersion&&(t.gtfsRealtimeVersion=String(e.gtfsRealtimeVersion)),e.incrementality){default:if("number"==typeof e.incrementality){t.incrementality=e.incrementality;break}break;case"FULL_DATASET":case 0:t.incrementality=0;break;case"DIFFERENTIAL":case 1:t.incrementality=1}return null!=e.timestamp&&(s.Long?(t.timestamp=s.Long.fromValue(e.timestamp)).unsigned=!0:"string"==typeof e.timestamp?t.timestamp=parseInt(e.timestamp,10):"number"==typeof e.timestamp?t.timestamp=e.timestamp:"object"==typeof e.timestamp&&(t.timestamp=new s.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults)if(r.gtfsRealtimeVersion="",r.incrementality=t.enums===String?"FULL_DATASET":0,s.Long){var i=new s.Long(0,0,!0);r.timestamp=t.longs===String?i.toString():t.longs===Number?i.toNumber():i}else r.timestamp=t.longs===String?"0":0;return null!=e.gtfsRealtimeVersion&&e.hasOwnProperty("gtfsRealtimeVersion")&&(r.gtfsRealtimeVersion=e.gtfsRealtimeVersion),null!=e.incrementality&&e.hasOwnProperty("incrementality")&&(r.incrementality=t.enums===String?void 0===l.transit_realtime.FeedHeader.Incrementality[e.incrementality]?e.incrementality:l.transit_realtime.FeedHeader.Incrementality[e.incrementality]:e.incrementality),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&("number"==typeof e.timestamp?r.timestamp=t.longs===String?String(e.timestamp):e.timestamp:r.timestamp=t.longs===String?s.Long.prototype.toString.call(e.timestamp):t.longs===Number?new s.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0):e.timestamp),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.FeedHeader"},e.Incrementality=(t={},(r=Object.create(t))[t[0]="FULL_DATASET"]=0,r[t[1]="DIFFERENTIAL"]=1,r),e}(),i.FeedEntity=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.id="",e.prototype.isDeleted=!1,e.prototype.tripUpdate=null,e.prototype.vehicle=null,e.prototype.alert=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),t.uint32(10).string(e.id),null!=e.isDeleted&&Object.hasOwnProperty.call(e,"isDeleted")&&t.uint32(16).bool(e.isDeleted),null!=e.tripUpdate&&Object.hasOwnProperty.call(e,"tripUpdate")&&l.transit_realtime.TripUpdate.encode(e.tripUpdate,t.uint32(26).fork()).ldelim(),null!=e.vehicle&&Object.hasOwnProperty.call(e,"vehicle")&&l.transit_realtime.VehiclePosition.encode(e.vehicle,t.uint32(34).fork()).ldelim(),null!=e.alert&&Object.hasOwnProperty.call(e,"alert")&&l.transit_realtime.Alert.encode(e.alert,t.uint32(42).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.FeedEntity;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.id=e.string();break;case 2:i.isDeleted=e.bool();break;case 3:i.tripUpdate=l.transit_realtime.TripUpdate.decode(e,e.uint32());break;case 4:i.vehicle=l.transit_realtime.VehiclePosition.decode(e,e.uint32());break;case 5:i.alert=l.transit_realtime.Alert.decode(e,e.uint32());break;default:e.skipType(7&n)}}if(!i.hasOwnProperty("id"))throw s.ProtocolError("missing required 'id'",{instance:i});return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":s.isString(e.id)?null!=e.isDeleted&&e.hasOwnProperty("isDeleted")&&"boolean"!=typeof e.isDeleted?"isDeleted: boolean expected":null!=e.tripUpdate&&e.hasOwnProperty("tripUpdate")&&(t=l.transit_realtime.TripUpdate.verify(e.tripUpdate))?"tripUpdate."+t:null!=e.vehicle&&e.hasOwnProperty("vehicle")&&(t=l.transit_realtime.VehiclePosition.verify(e.vehicle))?"vehicle."+t:null!=e.alert&&e.hasOwnProperty("alert")&&(t=l.transit_realtime.Alert.verify(e.alert))?"alert."+t:null:"id: string expected";var t},e.fromObject=function(e){if(e instanceof l.transit_realtime.FeedEntity)return e;var t=new l.transit_realtime.FeedEntity;if(null!=e.id&&(t.id=String(e.id)),null!=e.isDeleted&&(t.isDeleted=Boolean(e.isDeleted)),null!=e.tripUpdate){if("object"!=typeof e.tripUpdate)throw TypeError(".transit_realtime.FeedEntity.tripUpdate: object expected");t.tripUpdate=l.transit_realtime.TripUpdate.fromObject(e.tripUpdate)}if(null!=e.vehicle){if("object"!=typeof e.vehicle)throw TypeError(".transit_realtime.FeedEntity.vehicle: object expected");t.vehicle=l.transit_realtime.VehiclePosition.fromObject(e.vehicle)}if(null!=e.alert){if("object"!=typeof e.alert)throw TypeError(".transit_realtime.FeedEntity.alert: object expected");t.alert=l.transit_realtime.Alert.fromObject(e.alert)}return t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.id="",r.isDeleted=!1,r.tripUpdate=null,r.vehicle=null,r.alert=null),null!=e.id&&e.hasOwnProperty("id")&&(r.id=e.id),null!=e.isDeleted&&e.hasOwnProperty("isDeleted")&&(r.isDeleted=e.isDeleted),null!=e.tripUpdate&&e.hasOwnProperty("tripUpdate")&&(r.tripUpdate=l.transit_realtime.TripUpdate.toObject(e.tripUpdate,t)),null!=e.vehicle&&e.hasOwnProperty("vehicle")&&(r.vehicle=l.transit_realtime.VehiclePosition.toObject(e.vehicle,t)),null!=e.alert&&e.hasOwnProperty("alert")&&(r.alert=l.transit_realtime.Alert.toObject(e.alert,t)),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.FeedEntity"},e}(),i.TripUpdate=function(){function e(e){if(this.stopTimeUpdate=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.trip=null,e.prototype.vehicle=null,e.prototype.stopTimeUpdate=s.emptyArray,e.prototype.timestamp=s.Long?s.Long.fromBits(0,0,!0):0,e.prototype.delay=0,e.prototype.tripProperties=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),l.transit_realtime.TripDescriptor.encode(e.trip,t.uint32(10).fork()).ldelim(),null!=e.stopTimeUpdate&&e.stopTimeUpdate.length)for(var r=0;r<e.stopTimeUpdate.length;++r)l.transit_realtime.TripUpdate.StopTimeUpdate.encode(e.stopTimeUpdate[r],t.uint32(18).fork()).ldelim();return null!=e.vehicle&&Object.hasOwnProperty.call(e,"vehicle")&&l.transit_realtime.VehicleDescriptor.encode(e.vehicle,t.uint32(26).fork()).ldelim(),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(32).uint64(e.timestamp),null!=e.delay&&Object.hasOwnProperty.call(e,"delay")&&t.uint32(40).int32(e.delay),null!=e.tripProperties&&Object.hasOwnProperty.call(e,"tripProperties")&&l.transit_realtime.TripUpdate.TripProperties.encode(e.tripProperties,t.uint32(50).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.TripUpdate;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.trip=l.transit_realtime.TripDescriptor.decode(e,e.uint32());break;case 3:i.vehicle=l.transit_realtime.VehicleDescriptor.decode(e,e.uint32());break;case 2:i.stopTimeUpdate&&i.stopTimeUpdate.length||(i.stopTimeUpdate=[]),i.stopTimeUpdate.push(l.transit_realtime.TripUpdate.StopTimeUpdate.decode(e,e.uint32()));break;case 4:i.timestamp=e.uint64();break;case 5:i.delay=e.int32();break;case 6:i.tripProperties=l.transit_realtime.TripUpdate.TripProperties.decode(e,e.uint32());break;default:e.skipType(7&n)}}if(!i.hasOwnProperty("trip"))throw s.ProtocolError("missing required 'trip'",{instance:i});return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(r=l.transit_realtime.TripDescriptor.verify(e.trip))return"trip."+r;if(null!=e.vehicle&&e.hasOwnProperty("vehicle")&&(r=l.transit_realtime.VehicleDescriptor.verify(e.vehicle)))return"vehicle."+r;if(null!=e.stopTimeUpdate&&e.hasOwnProperty("stopTimeUpdate")){if(!Array.isArray(e.stopTimeUpdate))return"stopTimeUpdate: array expected";for(var t=0;t<e.stopTimeUpdate.length;++t){var r;if(r=l.transit_realtime.TripUpdate.StopTimeUpdate.verify(e.stopTimeUpdate[t]))return"stopTimeUpdate."+r}}return null!=e.timestamp&&e.hasOwnProperty("timestamp")&&!(s.isInteger(e.timestamp)||e.timestamp&&s.isInteger(e.timestamp.low)&&s.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":null!=e.delay&&e.hasOwnProperty("delay")&&!s.isInteger(e.delay)?"delay: integer expected":null!=e.tripProperties&&e.hasOwnProperty("tripProperties")&&(r=l.transit_realtime.TripUpdate.TripProperties.verify(e.tripProperties))?"tripProperties."+r:null},e.fromObject=function(e){if(e instanceof l.transit_realtime.TripUpdate)return e;var t=new l.transit_realtime.TripUpdate;if(null!=e.trip){if("object"!=typeof e.trip)throw TypeError(".transit_realtime.TripUpdate.trip: object expected");t.trip=l.transit_realtime.TripDescriptor.fromObject(e.trip)}if(null!=e.vehicle){if("object"!=typeof e.vehicle)throw TypeError(".transit_realtime.TripUpdate.vehicle: object expected");t.vehicle=l.transit_realtime.VehicleDescriptor.fromObject(e.vehicle)}if(e.stopTimeUpdate){if(!Array.isArray(e.stopTimeUpdate))throw TypeError(".transit_realtime.TripUpdate.stopTimeUpdate: array expected");t.stopTimeUpdate=[];for(var r=0;r<e.stopTimeUpdate.length;++r){if("object"!=typeof e.stopTimeUpdate[r])throw TypeError(".transit_realtime.TripUpdate.stopTimeUpdate: object expected");t.stopTimeUpdate[r]=l.transit_realtime.TripUpdate.StopTimeUpdate.fromObject(e.stopTimeUpdate[r])}}if(null!=e.timestamp&&(s.Long?(t.timestamp=s.Long.fromValue(e.timestamp)).unsigned=!0:"string"==typeof e.timestamp?t.timestamp=parseInt(e.timestamp,10):"number"==typeof e.timestamp?t.timestamp=e.timestamp:"object"==typeof e.timestamp&&(t.timestamp=new s.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),null!=e.delay&&(t.delay=0|e.delay),null!=e.tripProperties){if("object"!=typeof e.tripProperties)throw TypeError(".transit_realtime.TripUpdate.tripProperties: object expected");t.tripProperties=l.transit_realtime.TripUpdate.TripProperties.fromObject(e.tripProperties)}return t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.stopTimeUpdate=[]),t.defaults){if(r.trip=null,r.vehicle=null,s.Long){var i=new s.Long(0,0,!0);r.timestamp=t.longs===String?i.toString():t.longs===Number?i.toNumber():i}else r.timestamp=t.longs===String?"0":0;r.delay=0,r.tripProperties=null}if(null!=e.trip&&e.hasOwnProperty("trip")&&(r.trip=l.transit_realtime.TripDescriptor.toObject(e.trip,t)),e.stopTimeUpdate&&e.stopTimeUpdate.length){r.stopTimeUpdate=[];for(var n=0;n<e.stopTimeUpdate.length;++n)r.stopTimeUpdate[n]=l.transit_realtime.TripUpdate.StopTimeUpdate.toObject(e.stopTimeUpdate[n],t)}return null!=e.vehicle&&e.hasOwnProperty("vehicle")&&(r.vehicle=l.transit_realtime.VehicleDescriptor.toObject(e.vehicle,t)),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&("number"==typeof e.timestamp?r.timestamp=t.longs===String?String(e.timestamp):e.timestamp:r.timestamp=t.longs===String?s.Long.prototype.toString.call(e.timestamp):t.longs===Number?new s.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0):e.timestamp),null!=e.delay&&e.hasOwnProperty("delay")&&(r.delay=e.delay),null!=e.tripProperties&&e.hasOwnProperty("tripProperties")&&(r.tripProperties=l.transit_realtime.TripUpdate.TripProperties.toObject(e.tripProperties,t)),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.TripUpdate"},e.StopTimeEvent=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.delay=0,e.prototype.time=s.Long?s.Long.fromBits(0,0,!1):0,e.prototype.uncertainty=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.delay&&Object.hasOwnProperty.call(e,"delay")&&t.uint32(8).int32(e.delay),null!=e.time&&Object.hasOwnProperty.call(e,"time")&&t.uint32(16).int64(e.time),null!=e.uncertainty&&Object.hasOwnProperty.call(e,"uncertainty")&&t.uint32(24).int32(e.uncertainty),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.TripUpdate.StopTimeEvent;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.delay=e.int32();break;case 2:i.time=e.int64();break;case 3:i.uncertainty=e.int32();break;default:e.skipType(7&n)}}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.delay&&e.hasOwnProperty("delay")&&!s.isInteger(e.delay)?"delay: integer expected":null!=e.time&&e.hasOwnProperty("time")&&!(s.isInteger(e.time)||e.time&&s.isInteger(e.time.low)&&s.isInteger(e.time.high))?"time: integer|Long expected":null!=e.uncertainty&&e.hasOwnProperty("uncertainty")&&!s.isInteger(e.uncertainty)?"uncertainty: integer expected":null},e.fromObject=function(e){if(e instanceof l.transit_realtime.TripUpdate.StopTimeEvent)return e;var t=new l.transit_realtime.TripUpdate.StopTimeEvent;return null!=e.delay&&(t.delay=0|e.delay),null!=e.time&&(s.Long?(t.time=s.Long.fromValue(e.time)).unsigned=!1:"string"==typeof e.time?t.time=parseInt(e.time,10):"number"==typeof e.time?t.time=e.time:"object"==typeof e.time&&(t.time=new s.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),null!=e.uncertainty&&(t.uncertainty=0|e.uncertainty),t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults){if(r.delay=0,s.Long){var i=new s.Long(0,0,!1);r.time=t.longs===String?i.toString():t.longs===Number?i.toNumber():i}else r.time=t.longs===String?"0":0;r.uncertainty=0}return null!=e.delay&&e.hasOwnProperty("delay")&&(r.delay=e.delay),null!=e.time&&e.hasOwnProperty("time")&&("number"==typeof e.time?r.time=t.longs===String?String(e.time):e.time:r.time=t.longs===String?s.Long.prototype.toString.call(e.time):t.longs===Number?new s.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),null!=e.uncertainty&&e.hasOwnProperty("uncertainty")&&(r.uncertainty=e.uncertainty),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.TripUpdate.StopTimeEvent"},e}(),e.StopTimeUpdate=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var t,r;return e.prototype.stopSequence=0,e.prototype.stopId="",e.prototype.arrival=null,e.prototype.departure=null,e.prototype.scheduleRelationship=0,e.prototype.stopTimeProperties=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.stopSequence&&Object.hasOwnProperty.call(e,"stopSequence")&&t.uint32(8).uint32(e.stopSequence),null!=e.arrival&&Object.hasOwnProperty.call(e,"arrival")&&l.transit_realtime.TripUpdate.StopTimeEvent.encode(e.arrival,t.uint32(18).fork()).ldelim(),null!=e.departure&&Object.hasOwnProperty.call(e,"departure")&&l.transit_realtime.TripUpdate.StopTimeEvent.encode(e.departure,t.uint32(26).fork()).ldelim(),null!=e.stopId&&Object.hasOwnProperty.call(e,"stopId")&&t.uint32(34).string(e.stopId),null!=e.scheduleRelationship&&Object.hasOwnProperty.call(e,"scheduleRelationship")&&t.uint32(40).int32(e.scheduleRelationship),null!=e.stopTimeProperties&&Object.hasOwnProperty.call(e,"stopTimeProperties")&&l.transit_realtime.TripUpdate.StopTimeUpdate.StopTimeProperties.encode(e.stopTimeProperties,t.uint32(50).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.TripUpdate.StopTimeUpdate;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.stopSequence=e.uint32();break;case 4:i.stopId=e.string();break;case 2:i.arrival=l.transit_realtime.TripUpdate.StopTimeEvent.decode(e,e.uint32());break;case 3:i.departure=l.transit_realtime.TripUpdate.StopTimeEvent.decode(e,e.uint32());break;case 5:i.scheduleRelationship=e.int32();break;case 6:i.stopTimeProperties=l.transit_realtime.TripUpdate.StopTimeUpdate.StopTimeProperties.decode(e,e.uint32());break;default:e.skipType(7&n)}}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.stopSequence&&e.hasOwnProperty("stopSequence")&&!s.isInteger(e.stopSequence))return"stopSequence: integer expected";if(null!=e.stopId&&e.hasOwnProperty("stopId")&&!s.isString(e.stopId))return"stopId: string expected";var t;if(null!=e.arrival&&e.hasOwnProperty("arrival")&&(t=l.transit_realtime.TripUpdate.StopTimeEvent.verify(e.arrival)))return"arrival."+t;if(null!=e.departure&&e.hasOwnProperty("departure")&&(t=l.transit_realtime.TripUpdate.StopTimeEvent.verify(e.departure)))return"departure."+t;if(null!=e.scheduleRelationship&&e.hasOwnProperty("scheduleRelationship"))switch(e.scheduleRelationship){default:return"scheduleRelationship: enum value expected";case 0:case 1:case 2:case 3:}return null!=e.stopTimeProperties&&e.hasOwnProperty("stopTimeProperties")&&(t=l.transit_realtime.TripUpdate.StopTimeUpdate.StopTimeProperties.verify(e.stopTimeProperties))?"stopTimeProperties."+t:null},e.fromObject=function(e){if(e instanceof l.transit_realtime.TripUpdate.StopTimeUpdate)return e;var t=new l.transit_realtime.TripUpdate.StopTimeUpdate;if(null!=e.stopSequence&&(t.stopSequence=e.stopSequence>>>0),null!=e.stopId&&(t.stopId=String(e.stopId)),null!=e.arrival){if("object"!=typeof e.arrival)throw TypeError(".transit_realtime.TripUpdate.StopTimeUpdate.arrival: object expected");t.arrival=l.transit_realtime.TripUpdate.StopTimeEvent.fromObject(e.arrival)}if(null!=e.departure){if("object"!=typeof e.departure)throw TypeError(".transit_realtime.TripUpdate.StopTimeUpdate.departure: object expected");t.departure=l.transit_realtime.TripUpdate.StopTimeEvent.fromObject(e.departure)}switch(e.scheduleRelationship){default:if("number"==typeof e.scheduleRelationship){t.scheduleRelationship=e.scheduleRelationship;break}break;case"SCHEDULED":case 0:t.scheduleRelationship=0;break;case"SKIPPED":case 1:t.scheduleRelationship=1;break;case"NO_DATA":case 2:t.scheduleRelationship=2;break;case"UNSCHEDULED":case 3:t.scheduleRelationship=3}if(null!=e.stopTimeProperties){if("object"!=typeof e.stopTimeProperties)throw TypeError(".transit_realtime.TripUpdate.StopTimeUpdate.stopTimeProperties: object expected");t.stopTimeProperties=l.transit_realtime.TripUpdate.StopTimeUpdate.StopTimeProperties.fromObject(e.stopTimeProperties)}return t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.stopSequence=0,r.arrival=null,r.departure=null,r.stopId="",r.scheduleRelationship=t.enums===String?"SCHEDULED":0,r.stopTimeProperties=null),null!=e.stopSequence&&e.hasOwnProperty("stopSequence")&&(r.stopSequence=e.stopSequence),null!=e.arrival&&e.hasOwnProperty("arrival")&&(r.arrival=l.transit_realtime.TripUpdate.StopTimeEvent.toObject(e.arrival,t)),null!=e.departure&&e.hasOwnProperty("departure")&&(r.departure=l.transit_realtime.TripUpdate.StopTimeEvent.toObject(e.departure,t)),null!=e.stopId&&e.hasOwnProperty("stopId")&&(r.stopId=e.stopId),null!=e.scheduleRelationship&&e.hasOwnProperty("scheduleRelationship")&&(r.scheduleRelationship=t.enums===String?void 0===l.transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship[e.scheduleRelationship]?e.scheduleRelationship:l.transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship[e.scheduleRelationship]:e.scheduleRelationship),null!=e.stopTimeProperties&&e.hasOwnProperty("stopTimeProperties")&&(r.stopTimeProperties=l.transit_realtime.TripUpdate.StopTimeUpdate.StopTimeProperties.toObject(e.stopTimeProperties,t)),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.TripUpdate.StopTimeUpdate"},e.ScheduleRelationship=(t={},(r=Object.create(t))[t[0]="SCHEDULED"]=0,r[t[1]="SKIPPED"]=1,r[t[2]="NO_DATA"]=2,r[t[3]="UNSCHEDULED"]=3,r),e.StopTimeProperties=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.assignedStopId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.assignedStopId&&Object.hasOwnProperty.call(e,"assignedStopId")&&t.uint32(10).string(e.assignedStopId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.TripUpdate.StopTimeUpdate.StopTimeProperties;e.pos<r;){var n=e.uint32();n>>>3==1?i.assignedStopId=e.string():e.skipType(7&n)}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.assignedStopId&&e.hasOwnProperty("assignedStopId")&&!s.isString(e.assignedStopId)?"assignedStopId: string expected":null},e.fromObject=function(e){if(e instanceof l.transit_realtime.TripUpdate.StopTimeUpdate.StopTimeProperties)return e;var t=new l.transit_realtime.TripUpdate.StopTimeUpdate.StopTimeProperties;return null!=e.assignedStopId&&(t.assignedStopId=String(e.assignedStopId)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.assignedStopId=""),null!=e.assignedStopId&&e.hasOwnProperty("assignedStopId")&&(r.assignedStopId=e.assignedStopId),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.TripUpdate.StopTimeUpdate.StopTimeProperties"},e}(),e}(),e.TripProperties=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.tripId="",e.prototype.startDate="",e.prototype.startTime="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.tripId&&Object.hasOwnProperty.call(e,"tripId")&&t.uint32(10).string(e.tripId),null!=e.startDate&&Object.hasOwnProperty.call(e,"startDate")&&t.uint32(18).string(e.startDate),null!=e.startTime&&Object.hasOwnProperty.call(e,"startTime")&&t.uint32(26).string(e.startTime),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.TripUpdate.TripProperties;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.tripId=e.string();break;case 2:i.startDate=e.string();break;case 3:i.startTime=e.string();break;default:e.skipType(7&n)}}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.tripId&&e.hasOwnProperty("tripId")&&!s.isString(e.tripId)?"tripId: string expected":null!=e.startDate&&e.hasOwnProperty("startDate")&&!s.isString(e.startDate)?"startDate: string expected":null!=e.startTime&&e.hasOwnProperty("startTime")&&!s.isString(e.startTime)?"startTime: string expected":null},e.fromObject=function(e){if(e instanceof l.transit_realtime.TripUpdate.TripProperties)return e;var t=new l.transit_realtime.TripUpdate.TripProperties;return null!=e.tripId&&(t.tripId=String(e.tripId)),null!=e.startDate&&(t.startDate=String(e.startDate)),null!=e.startTime&&(t.startTime=String(e.startTime)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.tripId="",r.startDate="",r.startTime=""),null!=e.tripId&&e.hasOwnProperty("tripId")&&(r.tripId=e.tripId),null!=e.startDate&&e.hasOwnProperty("startDate")&&(r.startDate=e.startDate),null!=e.startTime&&e.hasOwnProperty("startTime")&&(r.startTime=e.startTime),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.TripUpdate.TripProperties"},e}(),e}(),i.VehiclePosition=function(){function e(e){if(this.multiCarriageDetails=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var t,r;return e.prototype.trip=null,e.prototype.vehicle=null,e.prototype.position=null,e.prototype.currentStopSequence=0,e.prototype.stopId="",e.prototype.currentStatus=2,e.prototype.timestamp=s.Long?s.Long.fromBits(0,0,!0):0,e.prototype.congestionLevel=0,e.prototype.occupancyStatus=0,e.prototype.occupancyPercentage=0,e.prototype.multiCarriageDetails=s.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.trip&&Object.hasOwnProperty.call(e,"trip")&&l.transit_realtime.TripDescriptor.encode(e.trip,t.uint32(10).fork()).ldelim(),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&l.transit_realtime.Position.encode(e.position,t.uint32(18).fork()).ldelim(),null!=e.currentStopSequence&&Object.hasOwnProperty.call(e,"currentStopSequence")&&t.uint32(24).uint32(e.currentStopSequence),null!=e.currentStatus&&Object.hasOwnProperty.call(e,"currentStatus")&&t.uint32(32).int32(e.currentStatus),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(40).uint64(e.timestamp),null!=e.congestionLevel&&Object.hasOwnProperty.call(e,"congestionLevel")&&t.uint32(48).int32(e.congestionLevel),null!=e.stopId&&Object.hasOwnProperty.call(e,"stopId")&&t.uint32(58).string(e.stopId),null!=e.vehicle&&Object.hasOwnProperty.call(e,"vehicle")&&l.transit_realtime.VehicleDescriptor.encode(e.vehicle,t.uint32(66).fork()).ldelim(),null!=e.occupancyStatus&&Object.hasOwnProperty.call(e,"occupancyStatus")&&t.uint32(72).int32(e.occupancyStatus),null!=e.occupancyPercentage&&Object.hasOwnProperty.call(e,"occupancyPercentage")&&t.uint32(80).uint32(e.occupancyPercentage),null!=e.multiCarriageDetails&&e.multiCarriageDetails.length)for(var r=0;r<e.multiCarriageDetails.length;++r)l.transit_realtime.VehiclePosition.CarriageDetails.encode(e.multiCarriageDetails[r],t.uint32(90).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.VehiclePosition;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.trip=l.transit_realtime.TripDescriptor.decode(e,e.uint32());break;case 8:i.vehicle=l.transit_realtime.VehicleDescriptor.decode(e,e.uint32());break;case 2:i.position=l.transit_realtime.Position.decode(e,e.uint32());break;case 3:i.currentStopSequence=e.uint32();break;case 7:i.stopId=e.string();break;case 4:i.currentStatus=e.int32();break;case 5:i.timestamp=e.uint64();break;case 6:i.congestionLevel=e.int32();break;case 9:i.occupancyStatus=e.int32();break;case 10:i.occupancyPercentage=e.uint32();break;case 11:i.multiCarriageDetails&&i.multiCarriageDetails.length||(i.multiCarriageDetails=[]),i.multiCarriageDetails.push(l.transit_realtime.VehiclePosition.CarriageDetails.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.trip&&e.hasOwnProperty("trip")&&(r=l.transit_realtime.TripDescriptor.verify(e.trip)))return"trip."+r;if(null!=e.vehicle&&e.hasOwnProperty("vehicle")&&(r=l.transit_realtime.VehicleDescriptor.verify(e.vehicle)))return"vehicle."+r;if(null!=e.position&&e.hasOwnProperty("position")&&(r=l.transit_realtime.Position.verify(e.position)))return"position."+r;if(null!=e.currentStopSequence&&e.hasOwnProperty("currentStopSequence")&&!s.isInteger(e.currentStopSequence))return"currentStopSequence: integer expected";if(null!=e.stopId&&e.hasOwnProperty("stopId")&&!s.isString(e.stopId))return"stopId: string expected";if(null!=e.currentStatus&&e.hasOwnProperty("currentStatus"))switch(e.currentStatus){default:return"currentStatus: enum value expected";case 0:case 1:case 2:}if(null!=e.timestamp&&e.hasOwnProperty("timestamp")&&!(s.isInteger(e.timestamp)||e.timestamp&&s.isInteger(e.timestamp.low)&&s.isInteger(e.timestamp.high)))return"timestamp: integer|Long expected";if(null!=e.congestionLevel&&e.hasOwnProperty("congestionLevel"))switch(e.congestionLevel){default:return"congestionLevel: enum value expected";case 0:case 1:case 2:case 3:case 4:}if(null!=e.occupancyStatus&&e.hasOwnProperty("occupancyStatus"))switch(e.occupancyStatus){default:return"occupancyStatus: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:}if(null!=e.occupancyPercentage&&e.hasOwnProperty("occupancyPercentage")&&!s.isInteger(e.occupancyPercentage))return"occupancyPercentage: integer expected";if(null!=e.multiCarriageDetails&&e.hasOwnProperty("multiCarriageDetails")){if(!Array.isArray(e.multiCarriageDetails))return"multiCarriageDetails: array expected";for(var t=0;t<e.multiCarriageDetails.length;++t){var r;if(r=l.transit_realtime.VehiclePosition.CarriageDetails.verify(e.multiCarriageDetails[t]))return"multiCarriageDetails."+r}}return null},e.fromObject=function(e){if(e instanceof l.transit_realtime.VehiclePosition)return e;var t=new l.transit_realtime.VehiclePosition;if(null!=e.trip){if("object"!=typeof e.trip)throw TypeError(".transit_realtime.VehiclePosition.trip: object expected");t.trip=l.transit_realtime.TripDescriptor.fromObject(e.trip)}if(null!=e.vehicle){if("object"!=typeof e.vehicle)throw TypeError(".transit_realtime.VehiclePosition.vehicle: object expected");t.vehicle=l.transit_realtime.VehicleDescriptor.fromObject(e.vehicle)}if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".transit_realtime.VehiclePosition.position: object expected");t.position=l.transit_realtime.Position.fromObject(e.position)}switch(null!=e.currentStopSequence&&(t.currentStopSequence=e.currentStopSequence>>>0),null!=e.stopId&&(t.stopId=String(e.stopId)),e.currentStatus){case"INCOMING_AT":case 0:t.currentStatus=0;break;case"STOPPED_AT":case 1:t.currentStatus=1;break;default:if("number"==typeof e.currentStatus){t.currentStatus=e.currentStatus;break}break;case"IN_TRANSIT_TO":case 2:t.currentStatus=2}switch(null!=e.timestamp&&(s.Long?(t.timestamp=s.Long.fromValue(e.timestamp)).unsigned=!0:"string"==typeof e.timestamp?t.timestamp=parseInt(e.timestamp,10):"number"==typeof e.timestamp?t.timestamp=e.timestamp:"object"==typeof e.timestamp&&(t.timestamp=new s.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.congestionLevel){default:if("number"==typeof e.congestionLevel){t.congestionLevel=e.congestionLevel;break}break;case"UNKNOWN_CONGESTION_LEVEL":case 0:t.congestionLevel=0;break;case"RUNNING_SMOOTHLY":case 1:t.congestionLevel=1;break;case"STOP_AND_GO":case 2:t.congestionLevel=2;break;case"CONGESTION":case 3:t.congestionLevel=3;break;case"SEVERE_CONGESTION":case 4:t.congestionLevel=4}switch(e.occupancyStatus){default:if("number"==typeof e.occupancyStatus){t.occupancyStatus=e.occupancyStatus;break}break;case"EMPTY":case 0:t.occupancyStatus=0;break;case"MANY_SEATS_AVAILABLE":case 1:t.occupancyStatus=1;break;case"FEW_SEATS_AVAILABLE":case 2:t.occupancyStatus=2;break;case"STANDING_ROOM_ONLY":case 3:t.occupancyStatus=3;break;case"CRUSHED_STANDING_ROOM_ONLY":case 4:t.occupancyStatus=4;break;case"FULL":case 5:t.occupancyStatus=5;break;case"NOT_ACCEPTING_PASSENGERS":case 6:t.occupancyStatus=6;break;case"NO_DATA_AVAILABLE":case 7:t.occupancyStatus=7;break;case"NOT_BOARDABLE":case 8:t.occupancyStatus=8}if(null!=e.occupancyPercentage&&(t.occupancyPercentage=e.occupancyPercentage>>>0),e.multiCarriageDetails){if(!Array.isArray(e.multiCarriageDetails))throw TypeError(".transit_realtime.VehiclePosition.multiCarriageDetails: array expected");t.multiCarriageDetails=[];for(var r=0;r<e.multiCarriageDetails.length;++r){if("object"!=typeof e.multiCarriageDetails[r])throw TypeError(".transit_realtime.VehiclePosition.multiCarriageDetails: object expected");t.multiCarriageDetails[r]=l.transit_realtime.VehiclePosition.CarriageDetails.fromObject(e.multiCarriageDetails[r])}}return t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.multiCarriageDetails=[]),t.defaults){if(r.trip=null,r.position=null,r.currentStopSequence=0,r.currentStatus=t.enums===String?"IN_TRANSIT_TO":2,s.Long){var i=new s.Long(0,0,!0);r.timestamp=t.longs===String?i.toString():t.longs===Number?i.toNumber():i}else r.timestamp=t.longs===String?"0":0;r.congestionLevel=t.enums===String?"UNKNOWN_CONGESTION_LEVEL":0,r.stopId="",r.vehicle=null,r.occupancyStatus=t.enums===String?"EMPTY":0,r.occupancyPercentage=0}if(null!=e.trip&&e.hasOwnProperty("trip")&&(r.trip=l.transit_realtime.TripDescriptor.toObject(e.trip,t)),null!=e.position&&e.hasOwnProperty("position")&&(r.position=l.transit_realtime.Position.toObject(e.position,t)),null!=e.currentStopSequence&&e.hasOwnProperty("currentStopSequence")&&(r.currentStopSequence=e.currentStopSequence),null!=e.currentStatus&&e.hasOwnProperty("currentStatus")&&(r.currentStatus=t.enums===String?void 0===l.transit_realtime.VehiclePosition.VehicleStopStatus[e.currentStatus]?e.currentStatus:l.transit_realtime.VehiclePosition.VehicleStopStatus[e.currentStatus]:e.currentStatus),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&("number"==typeof e.timestamp?r.timestamp=t.longs===String?String(e.timestamp):e.timestamp:r.timestamp=t.longs===String?s.Long.prototype.toString.call(e.timestamp):t.longs===Number?new s.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0):e.timestamp),null!=e.congestionLevel&&e.hasOwnProperty("congestionLevel")&&(r.congestionLevel=t.enums===String?void 0===l.transit_realtime.VehiclePosition.CongestionLevel[e.congestionLevel]?e.congestionLevel:l.transit_realtime.VehiclePosition.CongestionLevel[e.congestionLevel]:e.congestionLevel),null!=e.stopId&&e.hasOwnProperty("stopId")&&(r.stopId=e.stopId),null!=e.vehicle&&e.hasOwnProperty("vehicle")&&(r.vehicle=l.transit_realtime.VehicleDescriptor.toObject(e.vehicle,t)),null!=e.occupancyStatus&&e.hasOwnProperty("occupancyStatus")&&(r.occupancyStatus=t.enums===String?void 0===l.transit_realtime.VehiclePosition.OccupancyStatus[e.occupancyStatus]?e.occupancyStatus:l.transit_realtime.VehiclePosition.OccupancyStatus[e.occupancyStatus]:e.occupancyStatus),null!=e.occupancyPercentage&&e.hasOwnProperty("occupancyPercentage")&&(r.occupancyPercentage=e.occupancyPercentage),e.multiCarriageDetails&&e.multiCarriageDetails.length){r.multiCarriageDetails=[];for(var n=0;n<e.multiCarriageDetails.length;++n)r.multiCarriageDetails[n]=l.transit_realtime.VehiclePosition.CarriageDetails.toObject(e.multiCarriageDetails[n],t)}return r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.VehiclePosition"},e.VehicleStopStatus=(t={},(r=Object.create(t))[t[0]="INCOMING_AT"]=0,r[t[1]="STOPPED_AT"]=1,r[t[2]="IN_TRANSIT_TO"]=2,r),e.CongestionLevel=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_CONGESTION_LEVEL"]=0,t[e[1]="RUNNING_SMOOTHLY"]=1,t[e[2]="STOP_AND_GO"]=2,t[e[3]="CONGESTION"]=3,t[e[4]="SEVERE_CONGESTION"]=4,t}(),e.OccupancyStatus=function(){var e={},t=Object.create(e);return t[e[0]="EMPTY"]=0,t[e[1]="MANY_SEATS_AVAILABLE"]=1,t[e[2]="FEW_SEATS_AVAILABLE"]=2,t[e[3]="STANDING_ROOM_ONLY"]=3,t[e[4]="CRUSHED_STANDING_ROOM_ONLY"]=4,t[e[5]="FULL"]=5,t[e[6]="NOT_ACCEPTING_PASSENGERS"]=6,t[e[7]="NO_DATA_AVAILABLE"]=7,t[e[8]="NOT_BOARDABLE"]=8,t}(),e.CarriageDetails=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.id="",e.prototype.label="",e.prototype.occupancyStatus=7,e.prototype.occupancyPercentage=-1,e.prototype.carriageSequence=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.label&&Object.hasOwnProperty.call(e,"label")&&t.uint32(18).string(e.label),null!=e.occupancyStatus&&Object.hasOwnProperty.call(e,"occupancyStatus")&&t.uint32(24).int32(e.occupancyStatus),null!=e.occupancyPercentage&&Object.hasOwnProperty.call(e,"occupancyPercentage")&&t.uint32(32).int32(e.occupancyPercentage),null!=e.carriageSequence&&Object.hasOwnProperty.call(e,"carriageSequence")&&t.uint32(40).uint32(e.carriageSequence),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.VehiclePosition.CarriageDetails;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.id=e.string();break;case 2:i.label=e.string();break;case 3:i.occupancyStatus=e.int32();break;case 4:i.occupancyPercentage=e.int32();break;case 5:i.carriageSequence=e.uint32();break;default:e.skipType(7&n)}}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!s.isString(e.id))return"id: string expected";if(null!=e.label&&e.hasOwnProperty("label")&&!s.isString(e.label))return"label: string expected";if(null!=e.occupancyStatus&&e.hasOwnProperty("occupancyStatus"))switch(e.occupancyStatus){default:return"occupancyStatus: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:}return null!=e.occupancyPercentage&&e.hasOwnProperty("occupancyPercentage")&&!s.isInteger(e.occupancyPercentage)?"occupancyPercentage: integer expected":null!=e.carriageSequence&&e.hasOwnProperty("carriageSequence")&&!s.isInteger(e.carriageSequence)?"carriageSequence: integer expected":null},e.fromObject=function(e){if(e instanceof l.transit_realtime.VehiclePosition.CarriageDetails)return e;var t=new l.transit_realtime.VehiclePosition.CarriageDetails;switch(null!=e.id&&(t.id=String(e.id)),null!=e.label&&(t.label=String(e.label)),e.occupancyStatus){case"EMPTY":case 0:t.occupancyStatus=0;break;case"MANY_SEATS_AVAILABLE":case 1:t.occupancyStatus=1;break;case"FEW_SEATS_AVAILABLE":case 2:t.occupancyStatus=2;break;case"STANDING_ROOM_ONLY":case 3:t.occupancyStatus=3;break;case"CRUSHED_STANDING_ROOM_ONLY":case 4:t.occupancyStatus=4;break;case"FULL":case 5:t.occupancyStatus=5;break;case"NOT_ACCEPTING_PASSENGERS":case 6:t.occupancyStatus=6;break;default:if("number"==typeof e.occupancyStatus){t.occupancyStatus=e.occupancyStatus;break}break;case"NO_DATA_AVAILABLE":case 7:t.occupancyStatus=7;break;case"NOT_BOARDABLE":case 8:t.occupancyStatus=8}return null!=e.occupancyPercentage&&(t.occupancyPercentage=0|e.occupancyPercentage),null!=e.carriageSequence&&(t.carriageSequence=e.carriageSequence>>>0),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.id="",r.label="",r.occupancyStatus=t.enums===String?"NO_DATA_AVAILABLE":7,r.occupancyPercentage=-1,r.carriageSequence=0),null!=e.id&&e.hasOwnProperty("id")&&(r.id=e.id),null!=e.label&&e.hasOwnProperty("label")&&(r.label=e.label),null!=e.occupancyStatus&&e.hasOwnProperty("occupancyStatus")&&(r.occupancyStatus=t.enums===String?void 0===l.transit_realtime.VehiclePosition.OccupancyStatus[e.occupancyStatus]?e.occupancyStatus:l.transit_realtime.VehiclePosition.OccupancyStatus[e.occupancyStatus]:e.occupancyStatus),null!=e.occupancyPercentage&&e.hasOwnProperty("occupancyPercentage")&&(r.occupancyPercentage=e.occupancyPercentage),null!=e.carriageSequence&&e.hasOwnProperty("carriageSequence")&&(r.carriageSequence=e.carriageSequence),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.VehiclePosition.CarriageDetails"},e}(),e}(),i.Alert=function(){function e(e){if(this.activePeriod=[],this.informedEntity=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var t,r;return e.prototype.activePeriod=s.emptyArray,e.prototype.informedEntity=s.emptyArray,e.prototype.cause=1,e.prototype.effect=8,e.prototype.url=null,e.prototype.headerText=null,e.prototype.descriptionText=null,e.prototype.ttsHeaderText=null,e.prototype.ttsDescriptionText=null,e.prototype.severityLevel=1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.activePeriod&&e.activePeriod.length)for(var r=0;r<e.activePeriod.length;++r)l.transit_realtime.TimeRange.encode(e.activePeriod[r],t.uint32(10).fork()).ldelim();if(null!=e.informedEntity&&e.informedEntity.length)for(r=0;r<e.informedEntity.length;++r)l.transit_realtime.EntitySelector.encode(e.informedEntity[r],t.uint32(42).fork()).ldelim();return null!=e.cause&&Object.hasOwnProperty.call(e,"cause")&&t.uint32(48).int32(e.cause),null!=e.effect&&Object.hasOwnProperty.call(e,"effect")&&t.uint32(56).int32(e.effect),null!=e.url&&Object.hasOwnProperty.call(e,"url")&&l.transit_realtime.TranslatedString.encode(e.url,t.uint32(66).fork()).ldelim(),null!=e.headerText&&Object.hasOwnProperty.call(e,"headerText")&&l.transit_realtime.TranslatedString.encode(e.headerText,t.uint32(82).fork()).ldelim(),null!=e.descriptionText&&Object.hasOwnProperty.call(e,"descriptionText")&&l.transit_realtime.TranslatedString.encode(e.descriptionText,t.uint32(90).fork()).ldelim(),null!=e.ttsHeaderText&&Object.hasOwnProperty.call(e,"ttsHeaderText")&&l.transit_realtime.TranslatedString.encode(e.ttsHeaderText,t.uint32(98).fork()).ldelim(),null!=e.ttsDescriptionText&&Object.hasOwnProperty.call(e,"ttsDescriptionText")&&l.transit_realtime.TranslatedString.encode(e.ttsDescriptionText,t.uint32(106).fork()).ldelim(),null!=e.severityLevel&&Object.hasOwnProperty.call(e,"severityLevel")&&t.uint32(112).int32(e.severityLevel),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.Alert;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.activePeriod&&i.activePeriod.length||(i.activePeriod=[]),i.activePeriod.push(l.transit_realtime.TimeRange.decode(e,e.uint32()));break;case 5:i.informedEntity&&i.informedEntity.length||(i.informedEntity=[]),i.informedEntity.push(l.transit_realtime.EntitySelector.decode(e,e.uint32()));break;case 6:i.cause=e.int32();break;case 7:i.effect=e.int32();break;case 8:i.url=l.transit_realtime.TranslatedString.decode(e,e.uint32());break;case 10:i.headerText=l.transit_realtime.TranslatedString.decode(e,e.uint32());break;case 11:i.descriptionText=l.transit_realtime.TranslatedString.decode(e,e.uint32());break;case 12:i.ttsHeaderText=l.transit_realtime.TranslatedString.decode(e,e.uint32());break;case 13:i.ttsDescriptionText=l.transit_realtime.TranslatedString.decode(e,e.uint32());break;case 14:i.severityLevel=e.int32();break;default:e.skipType(7&n)}}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.activePeriod&&e.hasOwnProperty("activePeriod")){if(!Array.isArray(e.activePeriod))return"activePeriod: array expected";for(var t=0;t<e.activePeriod.length;++t)if(r=l.transit_realtime.TimeRange.verify(e.activePeriod[t]))return"activePeriod."+r}if(null!=e.informedEntity&&e.hasOwnProperty("informedEntity")){if(!Array.isArray(e.informedEntity))return"informedEntity: array expected";for(t=0;t<e.informedEntity.length;++t)if(r=l.transit_realtime.EntitySelector.verify(e.informedEntity[t]))return"informedEntity."+r}if(null!=e.cause&&e.hasOwnProperty("cause"))switch(e.cause){default:return"cause: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:}if(null!=e.effect&&e.hasOwnProperty("effect"))switch(e.effect){default:return"effect: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:}var r;if(null!=e.url&&e.hasOwnProperty("url")&&(r=l.transit_realtime.TranslatedString.verify(e.url)))return"url."+r;if(null!=e.headerText&&e.hasOwnProperty("headerText")&&(r=l.transit_realtime.TranslatedString.verify(e.headerText)))return"headerText."+r;if(null!=e.descriptionText&&e.hasOwnProperty("descriptionText")&&(r=l.transit_realtime.TranslatedString.verify(e.descriptionText)))return"descriptionText."+r;if(null!=e.ttsHeaderText&&e.hasOwnProperty("ttsHeaderText")&&(r=l.transit_realtime.TranslatedString.verify(e.ttsHeaderText)))return"ttsHeaderText."+r;if(null!=e.ttsDescriptionText&&e.hasOwnProperty("ttsDescriptionText")&&(r=l.transit_realtime.TranslatedString.verify(e.ttsDescriptionText)))return"ttsDescriptionText."+r;if(null!=e.severityLevel&&e.hasOwnProperty("severityLevel"))switch(e.severityLevel){default:return"severityLevel: enum value expected";case 1:case 2:case 3:case 4:}return null},e.fromObject=function(e){if(e instanceof l.transit_realtime.Alert)return e;var t=new l.transit_realtime.Alert;if(e.activePeriod){if(!Array.isArray(e.activePeriod))throw TypeError(".transit_realtime.Alert.activePeriod: array expected");t.activePeriod=[];for(var r=0;r<e.activePeriod.length;++r){if("object"!=typeof e.activePeriod[r])throw TypeError(".transit_realtime.Alert.activePeriod: object expected");t.activePeriod[r]=l.transit_realtime.TimeRange.fromObject(e.activePeriod[r])}}if(e.informedEntity){if(!Array.isArray(e.informedEntity))throw TypeError(".transit_realtime.Alert.informedEntity: array expected");for(t.informedEntity=[],r=0;r<e.informedEntity.length;++r){if("object"!=typeof e.informedEntity[r])throw TypeError(".transit_realtime.Alert.informedEntity: object expected");t.informedEntity[r]=l.transit_realtime.EntitySelector.fromObject(e.informedEntity[r])}}switch(e.cause){default:if("number"==typeof e.cause){t.cause=e.cause;break}break;case"UNKNOWN_CAUSE":case 1:t.cause=1;break;case"OTHER_CAUSE":case 2:t.cause=2;break;case"TECHNICAL_PROBLEM":case 3:t.cause=3;break;case"STRIKE":case 4:t.cause=4;break;case"DEMONSTRATION":case 5:t.cause=5;break;case"ACCIDENT":case 6:t.cause=6;break;case"HOLIDAY":case 7:t.cause=7;break;case"WEATHER":case 8:t.cause=8;break;case"MAINTENANCE":case 9:t.cause=9;break;case"CONSTRUCTION":case 10:t.cause=10;break;case"POLICE_ACTIVITY":case 11:t.cause=11;break;case"MEDICAL_EMERGENCY":case 12:t.cause=12}switch(e.effect){case"NO_SERVICE":case 1:t.effect=1;break;case"REDUCED_SERVICE":case 2:t.effect=2;break;case"SIGNIFICANT_DELAYS":case 3:t.effect=3;break;case"DETOUR":case 4:t.effect=4;break;case"ADDITIONAL_SERVICE":case 5:t.effect=5;break;case"MODIFIED_SERVICE":case 6:t.effect=6;break;case"OTHER_EFFECT":case 7:t.effect=7;break;default:if("number"==typeof e.effect){t.effect=e.effect;break}break;case"UNKNOWN_EFFECT":case 8:t.effect=8;break;case"STOP_MOVED":case 9:t.effect=9;break;case"NO_EFFECT":case 10:t.effect=10;break;case"ACCESSIBILITY_ISSUE":case 11:t.effect=11}if(null!=e.url){if("object"!=typeof e.url)throw TypeError(".transit_realtime.Alert.url: object expected");t.url=l.transit_realtime.TranslatedString.fromObject(e.url)}if(null!=e.headerText){if("object"!=typeof e.headerText)throw TypeError(".transit_realtime.Alert.headerText: object expected");t.headerText=l.transit_realtime.TranslatedString.fromObject(e.headerText)}if(null!=e.descriptionText){if("object"!=typeof e.descriptionText)throw TypeError(".transit_realtime.Alert.descriptionText: object expected");t.descriptionText=l.transit_realtime.TranslatedString.fromObject(e.descriptionText)}if(null!=e.ttsHeaderText){if("object"!=typeof e.ttsHeaderText)throw TypeError(".transit_realtime.Alert.ttsHeaderText: object expected");t.ttsHeaderText=l.transit_realtime.TranslatedString.fromObject(e.ttsHeaderText)}if(null!=e.ttsDescriptionText){if("object"!=typeof e.ttsDescriptionText)throw TypeError(".transit_realtime.Alert.ttsDescriptionText: object expected");t.ttsDescriptionText=l.transit_realtime.TranslatedString.fromObject(e.ttsDescriptionText)}switch(e.severityLevel){default:if("number"==typeof e.severityLevel){t.severityLevel=e.severityLevel;break}break;case"UNKNOWN_SEVERITY":case 1:t.severityLevel=1;break;case"INFO":case 2:t.severityLevel=2;break;case"WARNING":case 3:t.severityLevel=3;break;case"SEVERE":case 4:t.severityLevel=4}return t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.activePeriod=[],r.informedEntity=[]),t.defaults&&(r.cause=t.enums===String?"UNKNOWN_CAUSE":1,r.effect=t.enums===String?"UNKNOWN_EFFECT":8,r.url=null,r.headerText=null,r.descriptionText=null,r.ttsHeaderText=null,r.ttsDescriptionText=null,r.severityLevel=t.enums===String?"UNKNOWN_SEVERITY":1),e.activePeriod&&e.activePeriod.length){r.activePeriod=[];for(var i=0;i<e.activePeriod.length;++i)r.activePeriod[i]=l.transit_realtime.TimeRange.toObject(e.activePeriod[i],t)}if(e.informedEntity&&e.informedEntity.length)for(r.informedEntity=[],i=0;i<e.informedEntity.length;++i)r.informedEntity[i]=l.transit_realtime.EntitySelector.toObject(e.informedEntity[i],t);return null!=e.cause&&e.hasOwnProperty("cause")&&(r.cause=t.enums===String?void 0===l.transit_realtime.Alert.Cause[e.cause]?e.cause:l.transit_realtime.Alert.Cause[e.cause]:e.cause),null!=e.effect&&e.hasOwnProperty("effect")&&(r.effect=t.enums===String?void 0===l.transit_realtime.Alert.Effect[e.effect]?e.effect:l.transit_realtime.Alert.Effect[e.effect]:e.effect),null!=e.url&&e.hasOwnProperty("url")&&(r.url=l.transit_realtime.TranslatedString.toObject(e.url,t)),null!=e.headerText&&e.hasOwnProperty("headerText")&&(r.headerText=l.transit_realtime.TranslatedString.toObject(e.headerText,t)),null!=e.descriptionText&&e.hasOwnProperty("descriptionText")&&(r.descriptionText=l.transit_realtime.TranslatedString.toObject(e.descriptionText,t)),null!=e.ttsHeaderText&&e.hasOwnProperty("ttsHeaderText")&&(r.ttsHeaderText=l.transit_realtime.TranslatedString.toObject(e.ttsHeaderText,t)),null!=e.ttsDescriptionText&&e.hasOwnProperty("ttsDescriptionText")&&(r.ttsDescriptionText=l.transit_realtime.TranslatedString.toObject(e.ttsDescriptionText,t)),null!=e.severityLevel&&e.hasOwnProperty("severityLevel")&&(r.severityLevel=t.enums===String?void 0===l.transit_realtime.Alert.SeverityLevel[e.severityLevel]?e.severityLevel:l.transit_realtime.Alert.SeverityLevel[e.severityLevel]:e.severityLevel),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.Alert"},e.Cause=(t={},(r=Object.create(t))[t[1]="UNKNOWN_CAUSE"]=1,r[t[2]="OTHER_CAUSE"]=2,r[t[3]="TECHNICAL_PROBLEM"]=3,r[t[4]="STRIKE"]=4,r[t[5]="DEMONSTRATION"]=5,r[t[6]="ACCIDENT"]=6,r[t[7]="HOLIDAY"]=7,r[t[8]="WEATHER"]=8,r[t[9]="MAINTENANCE"]=9,r[t[10]="CONSTRUCTION"]=10,r[t[11]="POLICE_ACTIVITY"]=11,r[t[12]="MEDICAL_EMERGENCY"]=12,r),e.Effect=function(){var e={},t=Object.create(e);return t[e[1]="NO_SERVICE"]=1,t[e[2]="REDUCED_SERVICE"]=2,t[e[3]="SIGNIFICANT_DELAYS"]=3,t[e[4]="DETOUR"]=4,t[e[5]="ADDITIONAL_SERVICE"]=5,t[e[6]="MODIFIED_SERVICE"]=6,t[e[7]="OTHER_EFFECT"]=7,t[e[8]="UNKNOWN_EFFECT"]=8,t[e[9]="STOP_MOVED"]=9,t[e[10]="NO_EFFECT"]=10,t[e[11]="ACCESSIBILITY_ISSUE"]=11,t}(),e.SeverityLevel=function(){var e={},t=Object.create(e);return t[e[1]="UNKNOWN_SEVERITY"]=1,t[e[2]="INFO"]=2,t[e[3]="WARNING"]=3,t[e[4]="SEVERE"]=4,t}(),e}(),i.TimeRange=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.start=s.Long?s.Long.fromBits(0,0,!0):0,e.prototype.end=s.Long?s.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.start&&Object.hasOwnProperty.call(e,"start")&&t.uint32(8).uint64(e.start),null!=e.end&&Object.hasOwnProperty.call(e,"end")&&t.uint32(16).uint64(e.end),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.TimeRange;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.start=e.uint64();break;case 2:i.end=e.uint64();break;default:e.skipType(7&n)}}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.start&&e.hasOwnProperty("start")&&!(s.isInteger(e.start)||e.start&&s.isInteger(e.start.low)&&s.isInteger(e.start.high))?"start: integer|Long expected":null!=e.end&&e.hasOwnProperty("end")&&!(s.isInteger(e.end)||e.end&&s.isInteger(e.end.low)&&s.isInteger(e.end.high))?"end: integer|Long expected":null},e.fromObject=function(e){if(e instanceof l.transit_realtime.TimeRange)return e;var t=new l.transit_realtime.TimeRange;return null!=e.start&&(s.Long?(t.start=s.Long.fromValue(e.start)).unsigned=!0:"string"==typeof e.start?t.start=parseInt(e.start,10):"number"==typeof e.start?t.start=e.start:"object"==typeof e.start&&(t.start=new s.LongBits(e.start.low>>>0,e.start.high>>>0).toNumber(!0))),null!=e.end&&(s.Long?(t.end=s.Long.fromValue(e.end)).unsigned=!0:"string"==typeof e.end?t.end=parseInt(e.end,10):"number"==typeof e.end?t.end=e.end:"object"==typeof e.end&&(t.end=new s.LongBits(e.end.low>>>0,e.end.high>>>0).toNumber(!0))),t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults){if(s.Long){var i=new s.Long(0,0,!0);r.start=t.longs===String?i.toString():t.longs===Number?i.toNumber():i}else r.start=t.longs===String?"0":0;s.Long?(i=new s.Long(0,0,!0),r.end=t.longs===String?i.toString():t.longs===Number?i.toNumber():i):r.end=t.longs===String?"0":0}return null!=e.start&&e.hasOwnProperty("start")&&("number"==typeof e.start?r.start=t.longs===String?String(e.start):e.start:r.start=t.longs===String?s.Long.prototype.toString.call(e.start):t.longs===Number?new s.LongBits(e.start.low>>>0,e.start.high>>>0).toNumber(!0):e.start),null!=e.end&&e.hasOwnProperty("end")&&("number"==typeof e.end?r.end=t.longs===String?String(e.end):e.end:r.end=t.longs===String?s.Long.prototype.toString.call(e.end):t.longs===Number?new s.LongBits(e.end.low>>>0,e.end.high>>>0).toNumber(!0):e.end),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.TimeRange"},e}(),i.Position=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.latitude=0,e.prototype.longitude=0,e.prototype.bearing=0,e.prototype.odometer=0,e.prototype.speed=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),t.uint32(13).float(e.latitude),t.uint32(21).float(e.longitude),null!=e.bearing&&Object.hasOwnProperty.call(e,"bearing")&&t.uint32(29).float(e.bearing),null!=e.odometer&&Object.hasOwnProperty.call(e,"odometer")&&t.uint32(33).double(e.odometer),null!=e.speed&&Object.hasOwnProperty.call(e,"speed")&&t.uint32(45).float(e.speed),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.Position;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.latitude=e.float();break;case 2:i.longitude=e.float();break;case 3:i.bearing=e.float();break;case 4:i.odometer=e.double();break;case 5:i.speed=e.float();break;default:e.skipType(7&n)}}if(!i.hasOwnProperty("latitude"))throw s.ProtocolError("missing required 'latitude'",{instance:i});if(!i.hasOwnProperty("longitude"))throw s.ProtocolError("missing required 'longitude'",{instance:i});return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":"number"!=typeof e.latitude?"latitude: number expected":"number"!=typeof e.longitude?"longitude: number expected":null!=e.bearing&&e.hasOwnProperty("bearing")&&"number"!=typeof e.bearing?"bearing: number expected":null!=e.odometer&&e.hasOwnProperty("odometer")&&"number"!=typeof e.odometer?"odometer: number expected":null!=e.speed&&e.hasOwnProperty("speed")&&"number"!=typeof e.speed?"speed: number expected":null},e.fromObject=function(e){if(e instanceof l.transit_realtime.Position)return e;var t=new l.transit_realtime.Position;return null!=e.latitude&&(t.latitude=Number(e.latitude)),null!=e.longitude&&(t.longitude=Number(e.longitude)),null!=e.bearing&&(t.bearing=Number(e.bearing)),null!=e.odometer&&(t.odometer=Number(e.odometer)),null!=e.speed&&(t.speed=Number(e.speed)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.latitude=0,r.longitude=0,r.bearing=0,r.odometer=0,r.speed=0),null!=e.latitude&&e.hasOwnProperty("latitude")&&(r.latitude=t.json&&!isFinite(e.latitude)?String(e.latitude):e.latitude),null!=e.longitude&&e.hasOwnProperty("longitude")&&(r.longitude=t.json&&!isFinite(e.longitude)?String(e.longitude):e.longitude),null!=e.bearing&&e.hasOwnProperty("bearing")&&(r.bearing=t.json&&!isFinite(e.bearing)?String(e.bearing):e.bearing),null!=e.odometer&&e.hasOwnProperty("odometer")&&(r.odometer=t.json&&!isFinite(e.odometer)?String(e.odometer):e.odometer),null!=e.speed&&e.hasOwnProperty("speed")&&(r.speed=t.json&&!isFinite(e.speed)?String(e.speed):e.speed),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.Position"},e}(),i.TripDescriptor=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var t,r;return e.prototype.tripId="",e.prototype.routeId="",e.prototype.directionId=0,e.prototype.startTime="",e.prototype.startDate="",e.prototype.scheduleRelationship=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.tripId&&Object.hasOwnProperty.call(e,"tripId")&&t.uint32(10).string(e.tripId),null!=e.startTime&&Object.hasOwnProperty.call(e,"startTime")&&t.uint32(18).string(e.startTime),null!=e.startDate&&Object.hasOwnProperty.call(e,"startDate")&&t.uint32(26).string(e.startDate),null!=e.scheduleRelationship&&Object.hasOwnProperty.call(e,"scheduleRelationship")&&t.uint32(32).int32(e.scheduleRelationship),null!=e.routeId&&Object.hasOwnProperty.call(e,"routeId")&&t.uint32(42).string(e.routeId),null!=e.directionId&&Object.hasOwnProperty.call(e,"directionId")&&t.uint32(48).uint32(e.directionId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.TripDescriptor;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.tripId=e.string();break;case 5:i.routeId=e.string();break;case 6:i.directionId=e.uint32();break;case 2:i.startTime=e.string();break;case 3:i.startDate=e.string();break;case 4:i.scheduleRelationship=e.int32();break;default:e.skipType(7&n)}}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tripId&&e.hasOwnProperty("tripId")&&!s.isString(e.tripId))return"tripId: string expected";if(null!=e.routeId&&e.hasOwnProperty("routeId")&&!s.isString(e.routeId))return"routeId: string expected";if(null!=e.directionId&&e.hasOwnProperty("directionId")&&!s.isInteger(e.directionId))return"directionId: integer expected";if(null!=e.startTime&&e.hasOwnProperty("startTime")&&!s.isString(e.startTime))return"startTime: string expected";if(null!=e.startDate&&e.hasOwnProperty("startDate")&&!s.isString(e.startDate))return"startDate: string expected";if(null!=e.scheduleRelationship&&e.hasOwnProperty("scheduleRelationship"))switch(e.scheduleRelationship){default:return"scheduleRelationship: enum value expected";case 0:case 1:case 2:case 3:case 5:case 6:}return null},e.fromObject=function(e){if(e instanceof l.transit_realtime.TripDescriptor)return e;var t=new l.transit_realtime.TripDescriptor;switch(null!=e.tripId&&(t.tripId=String(e.tripId)),null!=e.routeId&&(t.routeId=String(e.routeId)),null!=e.directionId&&(t.directionId=e.directionId>>>0),null!=e.startTime&&(t.startTime=String(e.startTime)),null!=e.startDate&&(t.startDate=String(e.startDate)),e.scheduleRelationship){default:if("number"==typeof e.scheduleRelationship){t.scheduleRelationship=e.scheduleRelationship;break}break;case"SCHEDULED":case 0:t.scheduleRelationship=0;break;case"ADDED":case 1:t.scheduleRelationship=1;break;case"UNSCHEDULED":case 2:t.scheduleRelationship=2;break;case"CANCELED":case 3:t.scheduleRelationship=3;break;case"REPLACEMENT":case 5:t.scheduleRelationship=5;break;case"DUPLICATED":case 6:t.scheduleRelationship=6}return t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.tripId="",r.startTime="",r.startDate="",r.scheduleRelationship=t.enums===String?"SCHEDULED":0,r.routeId="",r.directionId=0),null!=e.tripId&&e.hasOwnProperty("tripId")&&(r.tripId=e.tripId),null!=e.startTime&&e.hasOwnProperty("startTime")&&(r.startTime=e.startTime),null!=e.startDate&&e.hasOwnProperty("startDate")&&(r.startDate=e.startDate),null!=e.scheduleRelationship&&e.hasOwnProperty("scheduleRelationship")&&(r.scheduleRelationship=t.enums===String?void 0===l.transit_realtime.TripDescriptor.ScheduleRelationship[e.scheduleRelationship]?e.scheduleRelationship:l.transit_realtime.TripDescriptor.ScheduleRelationship[e.scheduleRelationship]:e.scheduleRelationship),null!=e.routeId&&e.hasOwnProperty("routeId")&&(r.routeId=e.routeId),null!=e.directionId&&e.hasOwnProperty("directionId")&&(r.directionId=e.directionId),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.TripDescriptor"},e.ScheduleRelationship=(t={},(r=Object.create(t))[t[0]="SCHEDULED"]=0,r[t[1]="ADDED"]=1,r[t[2]="UNSCHEDULED"]=2,r[t[3]="CANCELED"]=3,r[t[5]="REPLACEMENT"]=5,r[t[6]="DUPLICATED"]=6,r),e}(),i.VehicleDescriptor=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.id="",e.prototype.label="",e.prototype.licensePlate="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.label&&Object.hasOwnProperty.call(e,"label")&&t.uint32(18).string(e.label),null!=e.licensePlate&&Object.hasOwnProperty.call(e,"licensePlate")&&t.uint32(26).string(e.licensePlate),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.VehicleDescriptor;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.id=e.string();break;case 2:i.label=e.string();break;case 3:i.licensePlate=e.string();break;default:e.skipType(7&n)}}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!s.isString(e.id)?"id: string expected":null!=e.label&&e.hasOwnProperty("label")&&!s.isString(e.label)?"label: string expected":null!=e.licensePlate&&e.hasOwnProperty("licensePlate")&&!s.isString(e.licensePlate)?"licensePlate: string expected":null},e.fromObject=function(e){if(e instanceof l.transit_realtime.VehicleDescriptor)return e;var t=new l.transit_realtime.VehicleDescriptor;return null!=e.id&&(t.id=String(e.id)),null!=e.label&&(t.label=String(e.label)),null!=e.licensePlate&&(t.licensePlate=String(e.licensePlate)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.id="",r.label="",r.licensePlate=""),null!=e.id&&e.hasOwnProperty("id")&&(r.id=e.id),null!=e.label&&e.hasOwnProperty("label")&&(r.label=e.label),null!=e.licensePlate&&e.hasOwnProperty("licensePlate")&&(r.licensePlate=e.licensePlate),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.VehicleDescriptor"},e}(),i.EntitySelector=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.agencyId="",e.prototype.routeId="",e.prototype.routeType=0,e.prototype.trip=null,e.prototype.stopId="",e.prototype.directionId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.agencyId&&Object.hasOwnProperty.call(e,"agencyId")&&t.uint32(10).string(e.agencyId),null!=e.routeId&&Object.hasOwnProperty.call(e,"routeId")&&t.uint32(18).string(e.routeId),null!=e.routeType&&Object.hasOwnProperty.call(e,"routeType")&&t.uint32(24).int32(e.routeType),null!=e.trip&&Object.hasOwnProperty.call(e,"trip")&&l.transit_realtime.TripDescriptor.encode(e.trip,t.uint32(34).fork()).ldelim(),null!=e.stopId&&Object.hasOwnProperty.call(e,"stopId")&&t.uint32(42).string(e.stopId),null!=e.directionId&&Object.hasOwnProperty.call(e,"directionId")&&t.uint32(48).uint32(e.directionId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.EntitySelector;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.agencyId=e.string();break;case 2:i.routeId=e.string();break;case 3:i.routeType=e.int32();break;case 4:i.trip=l.transit_realtime.TripDescriptor.decode(e,e.uint32());break;case 5:i.stopId=e.string();break;case 6:i.directionId=e.uint32();break;default:e.skipType(7&n)}}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.agencyId&&e.hasOwnProperty("agencyId")&&!s.isString(e.agencyId))return"agencyId: string expected";if(null!=e.routeId&&e.hasOwnProperty("routeId")&&!s.isString(e.routeId))return"routeId: string expected";if(null!=e.routeType&&e.hasOwnProperty("routeType")&&!s.isInteger(e.routeType))return"routeType: integer expected";if(null!=e.trip&&e.hasOwnProperty("trip")){var t=l.transit_realtime.TripDescriptor.verify(e.trip);if(t)return"trip."+t}return null!=e.stopId&&e.hasOwnProperty("stopId")&&!s.isString(e.stopId)?"stopId: string expected":null!=e.directionId&&e.hasOwnProperty("directionId")&&!s.isInteger(e.directionId)?"directionId: integer expected":null},e.fromObject=function(e){if(e instanceof l.transit_realtime.EntitySelector)return e;var t=new l.transit_realtime.EntitySelector;if(null!=e.agencyId&&(t.agencyId=String(e.agencyId)),null!=e.routeId&&(t.routeId=String(e.routeId)),null!=e.routeType&&(t.routeType=0|e.routeType),null!=e.trip){if("object"!=typeof e.trip)throw TypeError(".transit_realtime.EntitySelector.trip: object expected");t.trip=l.transit_realtime.TripDescriptor.fromObject(e.trip)}return null!=e.stopId&&(t.stopId=String(e.stopId)),null!=e.directionId&&(t.directionId=e.directionId>>>0),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.agencyId="",r.routeId="",r.routeType=0,r.trip=null,r.stopId="",r.directionId=0),null!=e.agencyId&&e.hasOwnProperty("agencyId")&&(r.agencyId=e.agencyId),null!=e.routeId&&e.hasOwnProperty("routeId")&&(r.routeId=e.routeId),null!=e.routeType&&e.hasOwnProperty("routeType")&&(r.routeType=e.routeType),null!=e.trip&&e.hasOwnProperty("trip")&&(r.trip=l.transit_realtime.TripDescriptor.toObject(e.trip,t)),null!=e.stopId&&e.hasOwnProperty("stopId")&&(r.stopId=e.stopId),null!=e.directionId&&e.hasOwnProperty("directionId")&&(r.directionId=e.directionId),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.EntitySelector"},e}(),i.TranslatedString=function(){function e(e){if(this.translation=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.translation=s.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.translation&&e.translation.length)for(var r=0;r<e.translation.length;++r)l.transit_realtime.TranslatedString.Translation.encode(e.translation[r],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.TranslatedString;e.pos<r;){var n=e.uint32();n>>>3==1?(i.translation&&i.translation.length||(i.translation=[]),i.translation.push(l.transit_realtime.TranslatedString.Translation.decode(e,e.uint32()))):e.skipType(7&n)}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.translation&&e.hasOwnProperty("translation")){if(!Array.isArray(e.translation))return"translation: array expected";for(var t=0;t<e.translation.length;++t){var r=l.transit_realtime.TranslatedString.Translation.verify(e.translation[t]);if(r)return"translation."+r}}return null},e.fromObject=function(e){if(e instanceof l.transit_realtime.TranslatedString)return e;var t=new l.transit_realtime.TranslatedString;if(e.translation){if(!Array.isArray(e.translation))throw TypeError(".transit_realtime.TranslatedString.translation: array expected");t.translation=[];for(var r=0;r<e.translation.length;++r){if("object"!=typeof e.translation[r])throw TypeError(".transit_realtime.TranslatedString.translation: object expected");t.translation[r]=l.transit_realtime.TranslatedString.Translation.fromObject(e.translation[r])}}return t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.translation=[]),e.translation&&e.translation.length){r.translation=[];for(var i=0;i<e.translation.length;++i)r.translation[i]=l.transit_realtime.TranslatedString.Translation.toObject(e.translation[i],t)}return r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.TranslatedString"},e.Translation=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.text="",e.prototype.language="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),t.uint32(10).string(e.text),null!=e.language&&Object.hasOwnProperty.call(e,"language")&&t.uint32(18).string(e.language),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new l.transit_realtime.TranslatedString.Translation;e.pos<r;){var n=e.uint32();switch(n>>>3){case 1:i.text=e.string();break;case 2:i.language=e.string();break;default:e.skipType(7&n)}}if(!i.hasOwnProperty("text"))throw s.ProtocolError("missing required 'text'",{instance:i});return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":s.isString(e.text)?null!=e.language&&e.hasOwnProperty("language")&&!s.isString(e.language)?"language: string expected":null:"text: string expected"},e.fromObject=function(e){if(e instanceof l.transit_realtime.TranslatedString.Translation)return e;var t=new l.transit_realtime.TranslatedString.Translation;return null!=e.text&&(t.text=String(e.text)),null!=e.language&&(t.language=String(e.language)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.text="",r.language=""),null!=e.text&&e.hasOwnProperty("text")&&(r.text=e.text),null!=e.language&&e.hasOwnProperty("language")&&(r.language=e.language),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/transit_realtime.TranslatedString.Translation"},e}(),e}(),i),e.exports=l},946:(e,t,r)=>{e.exports=r(394)},394:(e,t,r)=>{var i=t;function n(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}i.build="minimal",i.Writer=r(449),i.BufferWriter=r(818),i.Reader=r(237),i.BufferReader=r(158),i.util=r(610),i.rpc=r(47),i.roots=r(529),i.configure=n,n()},237:(e,t,r)=>{e.exports=l;var i,n=r(610),a=n.LongBits,o=n.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var c,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},p=function(){return n.Buffer?function(e){return(l.create=function(e){return n.Buffer.isBuffer(e)?new i(e):u(e)})(e)}:u};function d(){var e=new a(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new a(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}l.create=p(),l.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,l.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return f(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|f(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,r);if(t===r){var i=n.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,r)},l.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){i=e,l.create=p(),i._configure();var t=n.Long?"toLong":"toNumber";n.merge(l.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return h.call(this)[t](!0)},sfixed64:function(){return h.call(this)[t](!1)}})}},158:(e,t,r)=>{e.exports=a;var i=r(237);(a.prototype=Object.create(i.prototype)).constructor=a;var n=r(610);function a(e){i.call(this,e)}a._configure=function(){n.Buffer&&(a.prototype._slice=n.Buffer.prototype.slice)},a.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},a._configure()},529:e=>{e.exports={}},47:(e,t,r)=>{t.Service=r(595)},595:(e,t,r)=>{e.exports=n;var i=r(610);function n(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(n.prototype=Object.create(i.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,r,n,a,o){if(!a)throw TypeError("request must be specified");var s=this;if(!o)return i.asPromise(e,s,t,r,n,a);if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](a).finish(),(function(e,r){if(e)return s.emit("error",e,t),o(e);if(null!==r){if(!(r instanceof n))try{r=n[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),o(e)}return s.emit("data",r,t),o(null,r)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},239:(e,t,r)=>{e.exports=n;var i=r(610);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var a=n.zero=new n(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var o=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return a;var t=e<0;t&&(e=-e);var r=e>>>0,i=(e-r)/4294967296>>>0;return t&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new n(r,i)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(i.isString(e)){if(!i.Long)return n.fromNumber(parseInt(e,10));e=i.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):a},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;n.fromHash=function(e){return e===o?a:new n((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},610:function(e,t,r){var i=t;function n(e,t,r){for(var i=Object.keys(t),n=0;n<i.length;++n)void 0!==e[i[n]]&&r||(e[i[n]]=t[i[n]]);return e}function a(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&n(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}i.asPromise=r(45),i.base64=r(839),i.EventEmitter=r(358),i.float=r(410),i.inquire=r(153),i.utf8=r(447),i.pool=r(390),i.LongBits=r(239),i.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),i.global=i.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},i.isString=function(e){return"string"==typeof e||e instanceof String},i.isObject=function(e){return e&&"object"==typeof e},i.isset=i.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},i.Buffer=function(){try{var e=i.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(e){return"number"==typeof e?i.Buffer?i._Buffer_allocUnsafe(e):new i.Array(e):i.Buffer?i._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(e){return e?i.LongBits.from(e).toHash():i.LongBits.zeroHash},i.longFromHash=function(e,t){var r=i.LongBits.fromHash(e);return i.Long?i.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},i.merge=n,i.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},i.newError=a,i.ProtocolError=a("ProtocolError"),i.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},i.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var e=i.Buffer;e?(i._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},i._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):i._Buffer_from=i._Buffer_allocUnsafe=null}},449:(e,t,r)=>{e.exports=p;var i,n=r(610),a=n.LongBits,o=n.base64,s=n.utf8;function l(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function c(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){this.len=0,this.head=new l(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(p.create=function(){return new i})()}:function(){return new p}};function f(e,t,r){t[r]=255&e}function h(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function y(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}p.create=d(),p.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(p.alloc=n.pool(p.alloc,n.Array.prototype.subarray)),p.prototype._push=function(e,t,r){return this.tail=this.tail.next=new l(e,t,r),this.len+=t,this},h.prototype=Object.create(l.prototype),h.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},p.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},p.prototype.int32=function(e){return e<0?this._push(m,10,a.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=a.from(e);return this._push(m,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=a.from(e).zzEncode();return this._push(m,t.length(),t)},p.prototype.bool=function(e){return this._push(f,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=a.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},p.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var g=n.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var i=0;i<e.length;++i)t[r+i]=e[i]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=p.alloc(t=o.length(e));o.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},p.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(f,1,0)},p.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new l(c,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(c,0,0),this.len=0),this},p.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},p.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},p._configure=function(e){i=e,p.create=d(),i._configure()}},818:(e,t,r)=>{e.exports=a;var i=r(449);(a.prototype=Object.create(i.prototype)).constructor=a;var n=r(610);function a(){i.call(this)}function o(e,t,r){e.length<40?n.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}a._configure=function(){a.alloc=n._Buffer_allocUnsafe,a.writeBytesBuffer=n.Buffer&&n.Buffer.prototype instanceof Uint8Array&&"set"===n.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var i=0;i<e.length;)t[r++]=e[i++]}},a.prototype.bytes=function(e){n.isString(e)&&(e=n._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(a.writeBytesBuffer,t,e),this},a.prototype.string=function(e){var t=n.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},a._configure()}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{getAllBusStopCoordinates:()=>getAllBusStopCoordinates,getAllTrainStopCoordinates:()=>getAllTrainStopCoordinates,getBusArrivals:()=>getBusArrivals,getFeedData:()=>getFeedData,getIconToURL:()=>getIconToURL,getNearbyBusStops:()=>getNearbyBusStops,getNearbyStops:()=>getNearbyStops,getTrainArrivals:()=>getTrainArrivals,getTrainLineColor:()=>getTrainLineColor,getTrainLineShapes:()=>getTrainLineShapes,getTrainLinesWithIcons:()=>getTrainLinesWithIcons,getTrainServiceAlerts:()=>getTrainServiceAlerts,parseAndReturnFeed:()=>parseAndReturnFeed,unixTimestampToDateTime:()=>unixTimestampToDateTime});var gtfs_realtime_bindings__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(252),gtfs_realtime_bindings__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(gtfs_realtime_bindings__WEBPACK_IMPORTED_MODULE_0__),__awaiter=function(e,t,r,i){return new(r||(r=Promise))((function(n,a){function o(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((i=i.apply(e,t||[])).next())}))};function parseAndReturnFeed(e){return __awaiter(this,void 0,void 0,(function*(){const t=yield fetch(e,{method:"GET",headers:{}});if(!t.ok)throw new Error(`${t.url}: ${t.status} ${t.statusText}`);const r=yield t.arrayBuffer(),i=new Uint8Array(r);return gtfs_realtime_bindings__WEBPACK_IMPORTED_MODULE_0___default().transit_realtime.FeedMessage.decode(i)}))}function getTrainServiceAlerts(e,t){return __awaiter(this,void 0,void 0,(function*(){var t={};const r=(yield parseAndReturnFeed("https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/camsys%2Fsubway-alerts")).entity;for(var i=0;i<r.length&&r[i].id.includes("lmm:alert");i++){const o=r[i].alert;if(o){const r=o.informedEntity,i=o.headerText;if(i){const s=o.descriptionText,l=i.translation,c=null==s?null:s.translation;if(l){const i=l[Number(e)].text;if(r)for(var n=0;n<r.length;n++){const e=r[n].routeId;if(e){var a=null;null!=c&&(a=c[1].text),t[e]={headerText:i,descriptionText:a}}}}}}}return t}))}function unixTimestampToDateTime(e){return new Date(1e3*e)}function getFeedData(e){return __awaiter(this,void 0,void 0,(function*(){let t="";return["A","C","E"].includes(e)?t="https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-ace":["B","D","F","M"].includes(e)?t="https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-bdfm":["G"].includes(e)?t="https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-g":["J","Z"].includes(e)?t="https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-jz":["N","Q","R","W"].includes(e)?t="https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-nqrw":["L"].includes(e)?t="https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-l":["1","2","3","4","5","6","7"].includes(e)?t="https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs":["SIR"].includes(e)&&(t="https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-si"),yield parseAndReturnFeed(t)}))}function getTrainArrivals(e,t,r,i,n){return __awaiter(this,void 0,void 0,(function*(){var a=[];if(4===r.length){let e="Error: The length of the stop ID should be 4. It's possible that you provided the stopID with the S or N at the end. If you did that, just slice off the last character of the stop ID before running this function.";return console.error(e),e}const o=e.entity;var s=1;""===n&&(s=2);for(var l=0;l<o.length;l++){const e=o[l].tripUpdate;if(null==e||null==e)continue;const p=e.trip,d=(p.tripId,p.routeId);if(!d)continue;if("string"==typeof t){if(d!=t)continue}else if(!t.includes(d))continue;const f=e.stopTimeUpdate;if(f)for(let e=0;e<f.length;e++)if(f[e]){var c=f[e].stopId;if(c){let t=n;""==t&&(t="N");for(var u=0;u<s;u++)if(""==n&&1==u&&(t="N"==t?"S":"N"),c===r+t){const r=f[e].arrival;if(r){const e=Number(r.time);if(e){let r=unixTimestampToDateTime(e).valueOf()-i.valueOf();r=Math.round(r/6e4),a.push({arrivalTime:r,direction:t,line:d})}}}}}}return 0==a.length&&console.log("It's possible your stopID or trainline is incorrect. Check the if your stopID really is part of the trainline you put in. ALSO: MAKE SURE YOUR TRAIN IS ACTUALLY RUNNING - IT'S POSSIBLE THERE ARE NO ARRIVALS BECAUSE IT'S NOT RUNNING AT THIS TIME."),a}))}function getBusArrivals(e,t,r,i,n){return __awaiter(this,void 0,void 0,(function*(){const r=`https://bustime.mta.info/api/siri/stop-monitoring.json?key=${n}&OperatorRef=MTA&MonitoringRef=${t}&LineRef=${e}`;let i=yield fetch(r);return i=yield i.json(),i.Siri.ServiceDelivery.StopMonitoringDelivery[0].MonitoredStopVisit}))}function getTrainLineColor(e){let t="";return["A","C","E"].includes(e)?t="#0039A6":["B","D","F","M"].includes(e)?t="#FF6319":["G"].includes(e)?t="#6CBE45":["J","Z"].includes(e)?t="#996633":["N","Q","R","W"].includes(e)?t="#FCCC0A":["L"].includes(e)?t="#A7A9AC":["1","2","3"].includes(e)?t="#EE352E":["4","5","6"].includes(e)?t="#00933C":["7"].includes(e)?t="#B933AD":["SI"].includes(e)&&(t="#2A9FDD"),t}function getTrainLineShapes(e){return __awaiter(this,void 0,void 0,(function*(){for(var t={},r=-1,i=!1,n=1;n<e.length-1;n++){const a=e[n].split(","),o=a[0].slice(0,a[0].indexOf("."));if(t[o]){if(i)continue}else i&&(i=!1),r=-1,t[o]={color:"black",layers:[]},t[o].color=getTrainLineColor(o);if("0"==a[1]){if(0==r){i=!0;continue}r+=1}try{t[o].layers.push([parseFloat(a[2]),parseFloat(a[3])])}catch(e){}}return t}))}function getAllBusStopCoordinates(e){let t={};for(var r=1;r<e.length;r++){if(""==e[r])continue;let i=e[r].split(",");const[n,a,o,s,l,c,u,p,d]=i;t[n]={stopname:a,coordinates:[parseFloat(s),parseFloat(l)],type:"bus"}}return t}function getAllTrainStopCoordinates(e){let t={};for(var r=1;r<e.length;r++){if("N"!=e[r][3]||""==e[r])continue;let i=e[r].split(",");const[n,a,o,s,l]=i;t[n]={stopname:a,coordinates:[parseFloat(o),parseFloat(s)],type:"train",trainLine:l}}return t}function getNearbyStops(e,t,r){let i={},n=Object.keys(e),a=Object.values(e);for(var o=1;o<n.length;o++){let e=a[o].coordinates,s=r,l=e[0]-s,c=e[0]+s,u=e[1]-s,p=e[1]+s,d=l<=t[0]&&c>=t[0],f=u<=t[1]&&p>=t[1];d&&f&&(i[n[o]]=a[o])}return i}function getNearbyBusStops(e,t,r,i){return __awaiter(this,void 0,void 0,(function*(){const n=`https://bustime.mta.info/api/where/stops-for-location.json?lat=${e[0]}&lon=${e[1]}&latSpan=${t}&lonSpan=${r}&key=${i}`;let a=yield fetch(n);return a=yield a.json(),a.data.stops}))}const iconToURL={1:"https://github.com/louh/mta-subway-bullets/blob/main/svg/1.svg",2:"https://github.com/louh/mta-subway-bullets/blob/main/svg/2.svg",3:"https://github.com/louh/mta-subway-bullets/blob/main/svg/3.svg",4:"https://github.com/louh/mta-subway-bullets/blob/main/svg/4.svg",5:"https://github.com/louh/mta-subway-bullets/blob/main/svg/6.svg",6:"https://github.com/louh/mta-subway-bullets/blob/main/svg/6d.svg",7:"https://github.com/louh/mta-subway-bullets/blob/main/svg/7svg","7d":"https://github.com/louh/mta-subway-bullets/blob/main/svg/7d.svg",a:"https://github.com/louh/mta-subway-bullets/blob/main/svg/a.svg",b:"https://github.com/louh/mta-subway-bullets/blob/main/svg/b.svg",c:"https://github.com/louh/mta-subway-bullets/blob/main/svg/c.svg",d:"https://github.com/louh/mta-subway-bullets/blob/main/svg/d.svg",e:"https://github.com/louh/mta-subway-bullets/blob/main/svg/e.svg",f:"https://github.com/louh/mta-subway-bullets/blob/main/svg/f.svg",g:"https://github.com/louh/mta-subway-bullets/blob/main/svg/g.svg",h:"https://github.com/louh/mta-subway-bullets/blob/main/svg/h.svg",j:"https://github.com/louh/mta-subway-bullets/blob/main/svg/j.svg",l:"https://github.com/louh/mta-subway-bullets/blob/main/svg/l.svg",m:"https://github.com/louh/mta-subway-bullets/blob/main/svg/m.svg",n:"https://github.com/louh/mta-subway-bullets/blob/main/svg/n.svg",q:"https://github.com/louh/mta-subway-bullets/blob/main/svg/q.svg",r:"https://github.com/louh/mta-subway-bullets/blob/main/svg/r.svg",s:"https://github.com/louh/mta-subway-bullets/blob/main/svg/s.svg",sf:"https://github.com/louh/mta-subway-bullets/blob/main/svg/sf.svg",sir:"https://github.com/louh/mta-subway-bullets/blob/main/svg/sir.svg",sr:"https://github.com/louh/mta-subway-bullets/blob/main/svg/sr.svg",w:"https://github.com/louh/mta-subway-bullets/blob/main/svg/w.svg",z:"https://github.com/louh/mta-subway-bullets/blob/main/svg/z.svg"};function getIconToURL(){return iconToURL}const trainLinesWithIcons=["1","2","3","4","5","6","6x","7","7x","a","b","c","d","e","f","fx","g","h","j","l","m","n","q","r","s","sf","sir","sr","w","z"];function getTrainLinesWithIcons(){return trainLinesWithIcons}function getBorough(){}return __webpack_exports__})()));