(function() { LWR.define("o11y/core_envelope",["exports","o11y/shared"],function(e,t){const s="o11y";class i{constructor(){this._envelope={diagnostics:{key:s,generatedTimestamp:void 0,bundleCount:0,bucketHistogramCount:0,upCounterCount:0,valueRecorderCount:0,schemaVersion:"254.44.0"},bundles:[],metrics:{bucketHistograms:[],upCounters:[],valueRecorders:[]},staticAttributes:{}}}withStaticAttributes(e){return this._envelope.staticAttributes=e,this}withLogs(e,t){let s=this._envelope.bundles.find(t=>t.schemaName===e);if(s)for(const e of t)s.messages.push(e);else s={schemaName:e,messages:t},this._envelope.bundles.push(s);return this._envelope.diagnostics.bundleCount=this._envelope.bundles.length,this}static getUpCounters(e,s=!0){return t.metricsUtility.getUpCounters(e,s)}static getValueRecorders(e,s=!0){return t.metricsUtility.getValueRecorders(e,s)}static getBucketHistograms(e,s=!0){return t.metricsUtility.getBucketHistograms(e,s)}withUpCounters(e){for(const t of e)this._envelope.metrics.upCounters.push(t);return this._envelope.diagnostics.upCounterCount=this._envelope.metrics.upCounters.length,this}withValueRecorders(e){for(const t of e)this._envelope.metrics.valueRecorders.push(t);return this._envelope.diagnostics.valueRecorderCount=this._envelope.metrics.valueRecorders.length,this}withBucketHistograms(e){for(const t of e)this._envelope.metrics.bucketHistograms.push(t);return this._envelope.diagnostics.bucketHistogramCount=this._envelope.metrics.bucketHistograms.length,this}build(){return this._envelope.diagnostics.generatedTimestamp=t.utility.time().tsNow,this._envelope}static buildFrom(e){const s=new i;return e.staticAttributes&&s.withStaticAttributes(e.staticAttributes),e.messages&&e.messages.forEach((e,i)=>{s.withLogs(t.schemaUtil.getSchemaId(i),e)}),e.upCounters&&s.withUpCounters(e.upCounters),e.valueRecorders&&s.withValueRecorders(e.valueRecorders),e.bucketHistograms&&s.withBucketHistograms(e.bucketHistograms),s.build()}}e.CoreEnvelopeBuilder=i,e.coreEnvelopeKey=s,Object.defineProperty(e,"__esModule",{value:!0})});
}
)();(function() { LWR.define("o11y/collectors",["exports","o11y/shared","o11y/core_envelope","o11y_schema/sf_instrumentation"],function(e,t,r,n){
/*!
     * protobuf.js v7.2.6 (c) 2016, daniel wirtz
     * compiled thu, 22 may 2025 20:40:14 utc
     * licensed under the bsd-3-clause license
     * see: https://github.com/dcodeio/protobuf.js for details
     */
var o,i,s,a;s={1:[function(e,t,r){t.exports=function(e,t){for(var r=Array(arguments.length-1),n=0,o=2,i=!0;o<arguments.length;)r[n++]=arguments[o++];return new Promise(function(o,s){r[n]=function(e){if(i)if(i=!1,e)s(e);else{for(var t=Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];o.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,s(e))}})}},{}],2:[function(e,t,r){r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;1<--t%4&&"="==(e[0|t]||"");)++r;return Math.ceil(3*e.length)/4-r};for(var n=Array(64),o=Array(123),s=0;s<64;)o[n[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;r.encode=function(e,t,r){for(var o,i=null,s=[],a=0,u=0;t<r;){var l=e[t++];switch(u){case 0:s[a++]=n[l>>2],o=(3&l)<<4,u=1;break;case 1:s[a++]=n[o|l>>4],o=(15&l)<<2,u=2;break;case 2:s[a++]=n[o|l>>6],s[a++]=n[63&l],u=0}8191<a&&((i=i||[]).push(String.fromCharCode.apply(String,s)),a=0)}return u&&(s[a++]=n[o],s[a++]=61,1===u&&(s[a++]=61)),i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var a="invalid encoding";r.decode=function(e,t,r){for(var n,s=r,u=0,l=0;l<e.length;){var p=e.charCodeAt(l++);if(61==p&&1<u)break;if((p=o[p])===i)throw Error(a);switch(u){case 0:n=p,u=1;break;case 1:t[r++]=n<<2|(48&p)>>4,n=p,u=2;break;case 2:t[r++]=(15&n)<<4|(60&p)>>2,n=p,u=3;break;case 3:t[r++]=(3&n)<<6|p,u=0}}if(1===u)throw Error(a);return r-s},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},{}],3:[function(e,t,r){(t.exports=function e(t,r){"string"==typeof t&&(r=t,t=i);var n=[];function o(t){if("string"!=typeof t){var r=s();if(e.verbose&&console.log("codegen: "+r),r="return "+r,t){for(var i=Object.keys(t),a=Array(i.length+1),u=Array(i.length),l=0;l<i.length;)a[l]=i[l],u[l]=t[i[l++]];return a[l]=r,Function.apply(null,a).apply(null,u)}return Function(r)()}for(var p=Array(arguments.length-1),f=0;f<p.length;)p[f]=arguments[++f];if(f=0,t=t.replace(/%([%dfijs])/g,function(e,t){var r=p[f++];switch(t){case"d":case"f":return""+ +(""+r);case"i":return""+Math.floor(r);case"j":return JSON.stringify(r);case"s":return""+r}return"%"}),f!==p.length)throw Error("parameter count mismatch");return n.push(t),o}function s(e){return"function "+(e||r||"")+"("+(t&&t.join(",")||"")+"){\n  "+n.join("\n  ")+"\n}"}return o.toString=s,o}).verbose=!1},{}],4:[function(e,t,r){function n(){this.t={}}(t.exports=n).prototype.on=function(e,t,r){return(this.t[e]||(this.t[e]=[])).push({fn:t,ctx:r||this}),this},n.prototype.off=function(e,t){if(e===i)this.t={};else if(t===i)this.t[e]=[];else for(var r=this.t[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},n.prototype.emit=function(e){var t=this.t[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},{}],5:[function(e,t,r){t.exports=s;var n=e(1),o=e(7)("fs");function s(e,t,r){return t="function"==typeof t?(r=t,{}):t||{},r?!t.xhr&&o&&o.readFile?o.readFile(e,function(n,o){return n&&"undefined"!=typeof XMLHttpRequest?s.xhr(e,t,r):n?r(n):r(null,t.binary?o:o.toString("utf8"))}):s.xhr(e,t,r):n(s,this,e,t)}s.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4!==n.readyState)return i;if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){if(!(e=n.response))for(var e=[],o=0;o<n.responseText.length;++o)e.push(255&n.responseText.charCodeAt(o));return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},{1:1,7:7}],6:[function(e,t,r){function n(e){function t(e,t,r,n){var o=t<0?1:0;e(0===(t=o?-t:t)?0<1/t?0:2147483648:isNaN(t)?2143289344:34028234663852886e22<t?(o<<31|2139095040)>>>0:t<11754943508222875e-54?(o<<31|Math.round(t/1401298464324817e-60))>>>0:(o<<31|127+(e=Math.floor(Math.log(t)/Math.LN2))<<23|8388607&Math.round(t*Math.pow(2,-e)*8388608))>>>0,r,n)}function r(e,t,r){return t=2*((e=e(t,r))>>31)+1,r=e>>>23&255,e&=8388607,255==r?e?NaN:1/0*t:0==r?1401298464324817e-60*t*e:t*Math.pow(2,r-150)*(8388608+e)}function n(e,t,r){f[0]=e,t[r]=c[0],t[r+1]=c[1],t[r+2]=c[2],t[r+3]=c[3]}function u(e,t,r){f[0]=e,t[r]=c[3],t[r+1]=c[2],t[r+2]=c[1],t[r+3]=c[0]}function l(e,t){return c[0]=e[t],c[1]=e[t+1],c[2]=e[t+2],c[3]=e[t+3],f[0]}function p(e,t){return c[3]=e[t],c[2]=e[t+1],c[1]=e[t+2],c[0]=e[t+3],f[0]}var f,c,h,d,y;function m(e,t,r,n,o,i){var s,a=n<0?1:0;0===(n=a?-n:n)?(e(0,o,i+t),e(0<1/n?0:2147483648,o,i+r)):isNaN(n)?(e(0,o,i+t),e(2146959360,o,i+r)):17976931348623157e292<n?(e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+r)):n<22250738585072014e-324?(e((s=n/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+r)):(e(4503599627370496*(s=n*Math.pow(2,-(n=1024===(n=Math.floor(Math.log(n)/Math.LN2))?1023:n)))>>>0,o,i+t),e((a<<31|n+1023<<20|1048576*s&1048575)>>>0,o,i+r))}function g(e,t,r,n,o){return t=e(n,o+t),n=2*((e=e(n,o+r))>>31)+1,r=4294967296*(1048575&e)+t,2047==(o=e>>>20&2047)?r?NaN:1/0*n:0==o?5e-324*n*r:n*Math.pow(2,o-1075)*(r+4503599627370496)}function v(e,t,r){h[0]=e,t[r]=d[0],t[r+1]=d[1],t[r+2]=d[2],t[r+3]=d[3],t[r+4]=d[4],t[r+5]=d[5],t[r+6]=d[6],t[r+7]=d[7]}function b(e,t,r){h[0]=e,t[r]=d[7],t[r+1]=d[6],t[r+2]=d[5],t[r+3]=d[4],t[r+4]=d[3],t[r+5]=d[2],t[r+6]=d[1],t[r+7]=d[0]}function w(e,t){return d[0]=e[t],d[1]=e[t+1],d[2]=e[t+2],d[3]=e[t+3],d[4]=e[t+4],d[5]=e[t+5],d[6]=e[t+6],d[7]=e[t+7],h[0]}function O(e,t){return d[7]=e[t],d[6]=e[t+1],d[5]=e[t+2],d[4]=e[t+3],d[3]=e[t+4],d[2]=e[t+5],d[1]=e[t+6],d[0]=e[t+7],h[0]}return"undefined"!=typeof Float32Array?(f=new Float32Array([-0]),y=128===(c=new Uint8Array(f.buffer))[3],e.writeFloatLE=y?n:u,e.writeFloatBE=y?u:n,e.readFloatLE=y?l:p,e.readFloatBE=y?p:l):(e.writeFloatLE=t.bind(null,o),e.writeFloatBE=t.bind(null,i),e.readFloatLE=r.bind(null,s),e.readFloatBE=r.bind(null,a)),"undefined"!=typeof Float64Array?(h=new Float64Array([-0]),y=128===(d=new Uint8Array(h.buffer))[7],e.writeDoubleLE=y?v:b,e.writeDoubleBE=y?b:v,e.readDoubleLE=y?w:O,e.readDoubleBE=y?O:w):(e.writeDoubleLE=m.bind(null,o,0,4),e.writeDoubleBE=m.bind(null,i,4,0),e.readDoubleLE=g.bind(null,s,0,4),e.readDoubleBE=g.bind(null,a,4,0)),e}function o(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 s(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}t.exports=n(n)},{}],7:[function(e,t,r){t.exports=function(e){return null}},{}],8:[function(e,t,r){var n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},o=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e);e="",r&&(e=t.shift()+"/");for(var o=0;o<t.length;)".."===t[o]?0<o&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return e+t.join("/")};r.resolve=function(e,t,r){return r||(t=o(t)),!n(t)&&(e=(e=r?e:o(e)).replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t}},{}],9:[function(e,t,r){t.exports=function(e,t,r){var n=r||8192,o=n>>>1,i=null,s=n;return function(r){return r<1||o<r?e(r):(n<s+r&&(i=e(n),s=0),r=t.call(i,s,s+=r),7&s&&(s=1+(7|s)),r)}}},{}],10:[function(e,t,r){r.length=function(e){for(var t,r=0,n=0;n<e.length;++n)(t=e.charCodeAt(n))<128?r+=1:t<2048?r+=2:55296==(64512&t)&&56320==(64512&e.charCodeAt(n+1))?(++n,r+=4):r+=3;return r},r.read=function(e,t,r){if(r-t<1)return"";for(var n,o=null,i=[],s=0;t<r;)(n=e[t++])<128?i[s++]=n:191<n&&n<224?i[s++]=(31&n)<<6|63&e[t++]:239<n&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[s++]=55296+(n>>10),i[s++]=56320+(1023&n)):i[s++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],8191<s&&((o=o||[]).push(String.fromCharCode.apply(String,i)),s=0);return o?(s&&o.push(String.fromCharCode.apply(String,i.slice(0,s))),o.join("")):String.fromCharCode.apply(String,i.slice(0,s))},r.write=function(e,t,r){for(var n,o,i=r,s=0;s<e.length;++s)(n=e.charCodeAt(s))<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(55296==(64512&n)&&56320==(64512&(o=e.charCodeAt(s+1)))?(++s,t[r++]=(n=65536+((1023&n)<<10)+(1023&o))>>18|240,t[r++]=n>>12&63|128):t[r++]=n>>12|224,t[r++]=n>>6&63|128),t[r++]=63&n|128);return r-i}},{}],11:[function(e,t,r){var n=e(14),o=e(33);function i(e,t,r,o){var i=!1;if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(d%s){",o);for(var s=t.resolvedType.values,a=Object.keys(s),u=0;u<a.length;++u)s[a[u]]!==t.typeDefault||i||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',o,o,o),t.repeated||e("break"),i=!0),e("case%j:",a[u])("case %i:",s[a[u]])("m%s=%j",o,s[a[u]])("break");e("}")}else e('if(typeof d%s!=="object")',o)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,r,o);else{var l=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",o,o);break;case"uint64":l=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,l)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,l?"true":"");break;case"bytes":e('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length >= 0)",o)("m%s=d%s",o,o);break;case"string":e("m%s=String(d%s)",o,o);break;case"bool":e("m%s=Boolean(d%s)",o,o)}}return e}function s(e,t,r,o){if(t.resolvedType)t.resolvedType instanceof n?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",o,r,o,o,r,o,o):e("d%s=types[%i].toObject(m%s,o)",o,r,o);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,i?"true":"",o);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:e("d%s=m%s",o,o)}}return e}r.fromObject=function(e){var t=e.fieldsArray,r=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var s=0;s<t.length;++s){var a=t[s].resolve(),u=o.safeProp(a.name);a.map?(r("if(d%s){",u)('if(typeof d%s!=="object")',u)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",u)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",u),i(r,a,s,u+"[ks[i]]")("}")("}")):a.repeated?(r("if(d%s){",u)("if(!Array.isArray(d%s))",u)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",u)("for(var i=0;i<d%s.length;++i){",u),i(r,a,s,u+"[i]")("}")("}")):(a.resolvedType instanceof n||r("if(d%s!=null){",u),i(r,a,s,u),a.resolvedType instanceof n||r("}"))}return r("return m")},r.toObject=function(e){var t=e.fieldsArray.slice().sort(o.compareFieldsById);if(!t.length)return o.codegen()("return {}");for(var r=o.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),i=[],a=[],u=[],l=0;l<t.length;++l)t[l].partOf||(t[l].resolve().repeated?i:t[l].map?a:u).push(t[l]);if(i.length){for(r("if(o.arrays||o.defaults){"),l=0;l<i.length;++l)r("d%s=[]",o.safeProp(i[l].name));r("}")}if(a.length){for(r("if(o.objects||o.defaults){"),l=0;l<a.length;++l)r("d%s={}",o.safeProp(a[l].name));r("}")}if(u.length){for(r("if(o.defaults){"),l=0;l<u.length;++l){var p,f=u[l],c=o.safeProp(f.name);f.resolvedType instanceof n?r("d%s=o.enums===String?%j:%j",c,f.resolvedType.valuesById[f.typeDefault],f.typeDefault):f.long?r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",f.typeDefault.low,f.typeDefault.high,f.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",c)("}else")("d%s=o.longs===String?%j:%i",c,f.typeDefault.toString(),f.typeDefault.toNumber()):f.bytes?(p="["+Array.prototype.slice.call(f.typeDefault).join(",")+"]",r("if(o.bytes===String)d%s=%j",c,String.fromCharCode.apply(String,f.typeDefault))("else{")("d%s=%s",c,p)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",c,c)("}")):r("d%s=%j",c,f.typeDefault)}r("}")}var h=!1;for(l=0;l<t.length;++l){f=t[l];var d=e.i.indexOf(f);c=o.safeProp(f.name),f.map?(h||(h=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",c,c)("d%s={}",c)("for(var j=0;j<ks2.length;++j){"),s(r,f,d,c+"[ks2[j]]")("}")):f.repeated?(r("if(m%s&&m%s.length){",c,c)("d%s=[]",c)("for(var j=0;j<m%s.length;++j){",c),s(r,f,d,c+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",c,f.name),s(r,f,d,c),f.partOf&&r("if(o.oneofs)")("d%s=%j",o.safeProp(f.partOf.name),f.name)),r("}")}return r("return d")}},{14:14,33:33}],12:[function(e,t,r){t.exports=function(e){var t=s.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter(function(e){return e.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var a=e.i[r].resolve(),u=a.resolvedType instanceof n?"int32":a.type,l="m"+s.safeProp(a.name);t("case %i: {",a.id),a.map?(t("if(%s===util.emptyObject)",l)("%s={}",l)("var c2 = r.uint32()+r.pos"),o.defaults[a.keyType]!==i?t("k=%j",o.defaults[a.keyType]):t("k=null"),o.defaults[u]!==i?t("value=%j",o.defaults[u]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),o.basic[u]===i?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",u),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),o.long[a.keyType]!==i?t('%s[typeof k==="object"?util.longToHash(k):k]=value',l):t("%s[k]=value",l)):a.repeated?(t("if(!(%s&&%s.length))",l,l)("%s=[]",l),o.packed[u]!==i&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",l,u)("}else"),o.basic[u]===i?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",l,r):t("%s.push(r.%s())",l,u)):o.basic[u]===i?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",l,r):t("%s=r.%s()",l,u),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e.i.length;++r){var p=e.i[r];p.required&&t("if(!m.hasOwnProperty(%j))",p.name)("throw util.ProtocolError(%j,{instance:m})","missing required '"+p.name+"'")}return t("return m")};var n=e(14),o=e(32),s=e(33)},{14:14,32:32,33:33}],13:[function(e,t,r){t.exports=function(e){for(var t,r=s.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),u=e.fieldsArray.slice().sort(s.compareFieldsById),l=0;l<u.length;++l){var p=u[l].resolve(),f=e.i.indexOf(p),c=p.resolvedType instanceof n?"int32":p.type,h=o.basic[c];t="m"+s.safeProp(p.name),p.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,p.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(p.id<<3|2)>>>0,8|o.mapKey[p.keyType],p.keyType),h===i?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",f,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,c,t),r("}")("}")):p.repeated?(r("if(%s!=null&&%s.length){",t,t),p.packed&&o.packed[c]!==i?r("w.uint32(%i).fork()",(p.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",c,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),h===i?a(r,p,f,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(p.id<<3|h)>>>0,c,t)),r("}")):(p.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,p.name),h===i?a(r,p,f,t):r("w.uint32(%i).%s(%s)",(p.id<<3|h)>>>0,c,t))}return r("return w")};var n=e(14),o=e(32),s=e(33);function a(e,t,r,n){t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},{14:14,32:32,33:33}],14:[function(e,t,r){t.exports=a;var n=e(22),o=(((a.prototype=Object.create(n.prototype)).constructor=a).className="Enum",e(21)),s=e(33);function a(e,t,r,o,s,a){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=s||{},this.valuesOptions=a,this.reserved=i,t)for(var u=Object.keys(t),l=0;l<u.length;++l)"number"==typeof t[u[l]]&&(this.valuesById[this.values[u[l]]=t[u[l]]]=u[l])}a.fromJSON=function(e,t){return(e=new a(e,t.values,t.options,t.comment,t.comments)).reserved=t.reserved,e},a.prototype.toJSON=function(e){return e=!!e&&!!e.keepComments,s.toObject(["options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:i,"comment",e?this.comment:i,"comments",e?this.comments:i])},a.prototype.add=function(e,t,r,n){if(!s.isString(e))throw TypeError("name must be a string");if(!s.isInteger(t))throw TypeError("id must be an integer");if(this.values[e]!==i)throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(this.valuesById[t]!==i){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return n&&(this.valuesOptions===i&&(this.valuesOptions={}),this.valuesOptions[e]=n||null),this.comments[e]=r||null,this},a.prototype.remove=function(e){if(!s.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},a.prototype.isReservedId=function(e){return o.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return o.isReservedName(this.reserved,e)}},{21:21,22:22,33:33}],15:[function(e,t,r){t.exports=p;var n,o=e(22),s=(((p.prototype=Object.create(o.prototype)).constructor=p).className="Field",e(14)),a=e(32),u=e(33),l=/^required|optional|repeated$/;function p(e,t,r,n,s,p,f){if(u.isObject(n)?(f=s,p=n,n=s=i):u.isObject(s)&&(f=p,p=s,s=i),o.call(this,e,p),!u.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!u.isString(r))throw TypeError("type must be a string");if(n!==i&&!l.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(s!==i&&!u.isString(s))throw TypeError("extend must be a string");this.rule=(n="proto3_optional"===n?"optional":n)&&"optional"!==n?n:i,this.type=r,this.id=t,this.extend=s||i,this.required="required"===n,this.optional=!this.required,this.repeated="repeated"===n,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!u.Long&&a.long[r]!==i,this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.n=null,this.comment=f}p.fromJSON=function(e,t){return new p(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(p.prototype,"packed",{get:function(){return null===this.n&&(this.n=!1!==this.getOption("packed")),this.n}}),p.prototype.setOption=function(e,t,r){return"packed"===e&&(this.n=null),o.prototype.setOption.call(this,e,t,r)},p.prototype.toJSON=function(e){return e=!!e&&!!e.keepComments,u.toObject(["rule","optional"!==this.rule&&this.rule||i,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",e?this.comment:i])},p.prototype.resolve=function(){var e;return this.resolved?this:((this.typeDefault=a.defaults[this.type])===i?(this.resolvedType=(this.declaringField||this).parent.lookupTypeOrEnum(this.type),this.resolvedType instanceof n?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof s&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(this.options.packed===i||!this.resolvedType||this.resolvedType instanceof s)||delete this.options.packed,Object.keys(this.options).length||(this.options=i)),this.long?(this.typeDefault=u.Long.fromNumber(this.typeDefault,"u"==(this.type[0]||"")),Object.freeze&&Object.freeze(this.typeDefault)):this.bytes&&"string"==typeof this.typeDefault&&(u.base64.test(this.typeDefault)?u.base64.decode(this.typeDefault,e=u.newBuffer(u.base64.length(this.typeDefault)),0):u.utf8.write(this.typeDefault,e=u.newBuffer(u.utf8.length(this.typeDefault)),0),this.typeDefault=e),this.map?this.defaultValue=u.emptyObject:this.repeated?this.defaultValue=u.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof n&&(this.parent.ctor.prototype[this.name]=this.defaultValue),o.prototype.resolve.call(this))},p.d=function(e,t,r,n){return"function"==typeof t?t=u.decorateType(t).name:t&&"object"==typeof t&&(t=u.decorateEnum(t).name),function(o,i){u.decorateType(o.constructor).add(new p(i,e,t,r,{default:n}))}},p.r=function(e){n=e}},{14:14,22:22,32:32,33:33}],16:[function(e,t,r){var n=t.exports=e(17);n.build="light",n.load=function(e,t,r){return(t="function"==typeof t?(r=t,new n.Root):t||new n.Root).load(e,r)},n.loadSync=function(e,t){return(t=t||new n.Root).loadSync(e)},n.encoder=e(13),n.decoder=e(12),n.verifier=e(36),n.converter=e(11),n.ReflectionObject=e(22),n.Namespace=e(21),n.Root=e(26),n.Enum=e(14),n.Type=e(31),n.Field=e(15),n.OneOf=e(23),n.MapField=e(18),n.Service=e(30),n.Method=e(20),n.Message=e(19),n.wrappers=e(37),n.types=e(32),n.util=e(33),n.ReflectionObject.r(n.Root),n.Namespace.r(n.Type,n.Service,n.Enum),n.Root.r(n.Type),n.Field.r(n.Type)},{11:11,12:12,13:13,14:14,15:15,17:17,18:18,19:19,20:20,21:21,22:22,23:23,26:26,30:30,31:31,32:32,33:33,36:36,37:37}],17:[function(e,t,r){var n=r;function o(){n.util.r(),n.Writer.r(n.BufferWriter),n.Reader.r(n.BufferReader)}n.build="minimal",n.Writer=e(38),n.BufferWriter=e(39),n.Reader=e(24),n.BufferReader=e(25),n.util=e(35),n.rpc=e(28),n.roots=e(27),n.configure=o,o()},{24:24,25:25,27:27,28:28,35:35,38:38,39:39}],18:[function(e,t,r){t.exports=a;var n=e(15),o=(((a.prototype=Object.create(n.prototype)).constructor=a).className="MapField",e(32)),s=e(33);function a(e,t,r,o,a,u){if(n.call(this,e,t,o,i,i,a,u),!s.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){return e=!!e&&!!e.keepComments,s.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",e?this.comment:i])},a.prototype.resolve=function(){if(this.resolved)return this;if(o.mapKey[this.keyType]===i)throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,r){return"function"==typeof r?r=s.decorateType(r).name:r&&"object"==typeof r&&(r=s.decorateEnum(r).name),function(n,o){s.decorateType(n.constructor).add(new a(o,e,t,r))}}},{15:15,32:32,33:33}],19:[function(e,t,r){t.exports=o;var n=e(35);function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.create=function(e){return this.$type.create(e)},o.encode=function(e,t){return this.$type.encode(e,t)},o.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},o.decode=function(e){return this.$type.decode(e)},o.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},o.verify=function(e){return this.$type.verify(e)},o.fromObject=function(e){return this.$type.fromObject(e)},o.toObject=function(e,t){return this.$type.toObject(e,t)},o.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},{35:35}],20:[function(e,t,r){t.exports=s;var n=e(22),o=(((s.prototype=Object.create(n.prototype)).constructor=s).className="Method",e(33));function s(e,t,r,s,a,u,l,p,f){if(o.isObject(a)?(l=a,a=u=i):o.isObject(u)&&(l=u,u=i),t!==i&&!o.isString(t))throw TypeError("type must be a string");if(!o.isString(r))throw TypeError("requestType must be a string");if(!o.isString(s))throw TypeError("responseType must be a string");n.call(this,e,l),this.type=t||"rpc",this.requestType=r,this.requestStream=!!a||i,this.responseType=s,this.responseStream=!!u||i,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=p,this.parsedOptions=f}s.fromJSON=function(e,t){return new s(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},s.prototype.toJSON=function(e){return e=!!e&&!!e.keepComments,o.toObject(["type","rpc"!==this.type&&this.type||i,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",e?this.comment:i,"parsedOptions",this.parsedOptions])},s.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},{22:22,33:33}],21:[function(e,t,r){t.exports=c;var n,o,s,a=e(22),u=(((c.prototype=Object.create(a.prototype)).constructor=c).className="Namespace",e(15)),l=e(33),p=e(23);function f(e,t){if(!e||!e.length)return i;for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}function c(e,t){a.call(this,e,t),this.nested=i,this.e=null}function h(e){return e.e=null,e}c.fromJSON=function(e,t){return new c(e,t.options).addJSON(t.nested)},c.arrayToJSON=f,c.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},c.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(c.prototype,"nestedArray",{get:function(){return this.e||(this.e=l.toArray(this.nested))}}),c.prototype.toJSON=function(e){return l.toObject(["options",this.options,"nested",f(this.nestedArray,e)])},c.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),a=0;a<r.length;++a)t=e[r[a]],this.add((t.fields!==i?n:t.values!==i?s:t.methods!==i?o:t.id!==i?u:c).fromJSON(r[a],t));return this},c.prototype.get=function(e){return this.nested&&this.nested[e]||null},c.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},c.prototype.add=function(e){if(!(e instanceof u&&e.extend!==i||e instanceof n||e instanceof p||e instanceof s||e instanceof o||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof c&&e instanceof c)||t instanceof n||t instanceof o)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,a=0;a<r.length;++a)e.add(r[a]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return(this.nested[e.name]=e).onAdd(this),h(this)},c.prototype.remove=function(e){if(!(e instanceof a))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=i),e.onRemove(this),h(this)},c.prototype.define=function(e,t){if(l.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;0<e.length;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof c))throw Error("path conflicts with non-namespace objects")}else r.add(r=new c(n))}return t&&r.addJSON(t),r},c.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof c?e[t++].resolveAll():e[t++].resolve();return this.resolve()},c.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=i):t&&!Array.isArray(t)&&(t=[t]),l.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(1===e.length){if(!t||~t.indexOf(n.constructor))return n}else if(n instanceof c&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var o=0;o<this.nestedArray.length;++o)if(this.e[o]instanceof c&&(n=this.e[o].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},c.prototype.lookupType=function(e){var t=this.lookup(e,[n]);if(t)return t;throw Error("no such type: "+e)},c.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(t)return t;throw Error("no such Enum '"+e+"' in "+this)},c.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[n,s]);if(t)return t;throw Error("no such Type or Enum '"+e+"' in "+this)},c.prototype.lookupService=function(e){var t=this.lookup(e,[o]);if(t)return t;throw Error("no such Service '"+e+"' in "+this)},c.r=function(e,t,r){n=e,o=t,s=r}},{15:15,22:22,23:23,33:33}],22:[function(e,t,r){(t.exports=s).className="ReflectionObject";var n,o=e(33);function s(e,t){if(!o.isString(e))throw TypeError("name must be a string");if(t&&!o.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(s.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),s.prototype.toJSON=function(){throw Error()},s.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1,(e=e.root)instanceof n&&e.o(this)},s.prototype.onRemove=function(e){(e=e.root)instanceof n&&e.u(this),this.parent=null,this.resolved=!1},s.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},s.prototype.getOption=function(e){return this.options?this.options[e]:i},s.prototype.setOption=function(e,t,r){return r&&this.options&&this.options[e]!==i||((this.options||(this.options={}))[e]=t),this},s.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n,i,s=this.parsedOptions;return r?(n=s.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)}))?(i=n[e],o.setProperty(i,r,t)):((n={})[e]=o.setProperty({},r,t),s.push(n)):((i={})[e]=t,s.push(i)),this},s.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},s.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},s.r=function(e){n=e}},{33:33}],23:[function(e,t,r){t.exports=a;var n=e(22),o=(((a.prototype=Object.create(n.prototype)).constructor=a).className="OneOf",e(15)),s=e(33);function a(e,t,r,o){if(Array.isArray(t)||(r=t,t=i),n.call(this,e,r),t!==i&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=o}function u(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){return e=!!e&&!!e.keepComments,s.toObject(["options",this.options,"oneof",this.oneof,"comment",e?this.comment:i])},a.prototype.add=function(e){if(e instanceof o)return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),u(e.partOf=this),this;throw TypeError("field must be a Field")},a.prototype.remove=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),-1<(t=this.oneof.indexOf(e.name))&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this).fieldsArray.push(r)}u(this)},a.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},a.d=function(){for(var e=Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){s.decorateType(t.constructor).add(new a(r,e)),Object.defineProperty(t,r,{get:s.oneOfGetter(e),set:s.oneOfSetter(e)})}}},{15:15,22:22,33:33}],24:[function(e,t,r){t.exports=u;var n,o=e(35),i=o.LongBits,s=o.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}function l(){return o.Buffer?function(e){return(u.create=function(e){return o.Buffer.isBuffer(e)?new n(e):f(e)})(e)}:f}var p,f="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")};function c(){var e=new i(0,0),t=0;if(!(4<this.len-this.pos)){for(;t<3;++t){if(this.pos>=this.len)throw a(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,4<this.len-this.pos){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 a(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 h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw a(this,8);return new i(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=l(),u.prototype.h=o.Array.prototype.subarray||o.Array.prototype.slice,u.prototype.uint32=(p=4294967295,function(){if(p=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(p=(p|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128||(p=(p|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128||(p=(p|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128||(p=(p|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128||!((this.pos+=5)>this.len))))))return p;throw this.pos=this.len,a(this,10)}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?(e=o.Buffer)?e.alloc(0):new this.buf.constructor(0):this.h.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.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},u.r=function(e){n=e,u.create=l(),n.r();var t=o.Long?"toLong":"toNumber";o.merge(u.prototype,{int64:function(){return c.call(this)[t](!1)},uint64:function(){return c.call(this)[t](!0)},sint64:function(){return c.call(this).zzDecode()[t](!1)},fixed64:function(){return d.call(this)[t](!0)},sfixed64:function(){return d.call(this)[t](!1)}})}},{35:35}],25:[function(e,t,r){t.exports=i;var n=e(24),o=((i.prototype=Object.create(n.prototype)).constructor=i,e(35));function i(e){n.call(this,e)}i.r=function(){o.Buffer&&(i.prototype.h=o.Buffer.prototype.slice)},i.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))},i.r()},{24:24,35:35}],26:[function(e,t,r){t.exports=c;var n,o,s,a=e(21),u=(((c.prototype=Object.create(a.prototype)).constructor=c).className="Root",e(15)),l=e(14),p=e(23),f=e(33);function c(e){a.call(this,"",e),this.deferred=[],this.files=[]}function h(){}c.fromJSON=function(e,t){return t=t||new c,e.options&&t.setOptions(e.options),t.addJSON(e.nested)},c.prototype.resolvePath=f.path.resolve,c.prototype.fetch=f.fetch,c.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=i);var a=this;if(!n)return f.asPromise(e,a,t,r);var u=n===h;function l(e,t){if(n){if(u)throw e;var r=n;n=null,r(e,t)}}function p(e){var t=e.lastIndexOf("google/protobuf/");return-1<t&&(e=e.substring(t))in s?e:null}function c(e,t){try{if(f.isString(t)&&"{"==(t[0]||"")&&(t=JSON.parse(t)),f.isString(t)){o.filename=e;var n,i=o(t,a,r),s=0;if(i.imports)for(;s<i.imports.length;++s)(n=p(i.imports[s])||a.resolvePath(e,i.imports[s]))&&d(n);if(i.weakImports)for(s=0;s<i.weakImports.length;++s)(n=p(i.weakImports[s])||a.resolvePath(e,i.weakImports[s]))&&d(n,!0)}else a.setOptions(t.options).addJSON(t.nested)}catch(e){l(e)}u||y||l(null,a)}function d(e,t){if(e=p(e)||e,!~a.files.indexOf(e))if(a.files.push(e),e in s)u?c(e,s[e]):(++y,setTimeout(function(){--y,c(e,s[e])}));else if(u){var r;try{r=f.fs.readFileSync(e).toString("utf8")}catch(r){return void(t||l(r))}c(e,r)}else++y,a.fetch(e,function(r,o){--y,n&&(r?t?y||l(null,a):l(r):c(e,o))})}var y=0;f.isString(t)&&(t=[t]);for(var m,g=0;g<t.length;++g)(m=a.resolvePath("",t[g]))&&d(m);return u?a:(y||l(null,a),i)},c.prototype.loadSync=function(e,t){if(f.isNode)return this.load(e,t,h);throw Error("not supported")},c.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return a.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function y(e,t){var r,n=t.parent.lookup(t.extend);if(n)return r=new u(t.fullName,t.id,t.type,t.rule,i,t.options),n.get(r.name)||((r.declaringField=t).extensionField=r,n.add(r)),1}c.prototype.o=function(e){if(e instanceof u)e.extend===i||e.extensionField||y(0,e)||this.deferred.push(e);else if(e instanceof l)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof p)){if(e instanceof n)for(var t=0;t<this.deferred.length;)y(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this.o(e.e[r]);d.test(e.name)&&(e.parent[e.name]=e)}},c.prototype.u=function(e){var t;if(e instanceof u)e.extend!==i&&(e.extensionField?(e.extensionField.parent.remove(e.extensionField),e.extensionField=null):-1<(t=this.deferred.indexOf(e))&&this.deferred.splice(t,1));else if(e instanceof l)d.test(e.name)&&delete e.parent[e.name];else if(e instanceof a){for(var r=0;r<e.nestedArray.length;++r)this.u(e.e[r]);d.test(e.name)&&delete e.parent[e.name]}},c.r=function(e,t,r){n=e,o=t,s=r}},{14:14,15:15,21:21,23:23,33:33}],27:[function(e,t,r){t.exports={}},{}],28:[function(e,t,r){r.Service=e(29)},{29:29}],29:[function(e,t,r){t.exports=o;var n=e(35);function o(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}((o.prototype=Object.create(n.EventEmitter.prototype)).constructor=o).prototype.rpcCall=function e(t,r,o,s,a){if(!s)throw TypeError("request must be specified");var u=this;if(!a)return n.asPromise(e,u,t,r,o,s);if(!u.rpcImpl)return setTimeout(function(){a(Error("already ended"))},0),i;try{return u.rpcImpl(t,r[u.requestDelimited?"encodeDelimited":"encode"](s).finish(),function(e,r){if(e)return u.emit("error",e,t),a(e);if(null===r)return u.end(!0),i;if(!(r instanceof o))try{r=o[u.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return u.emit("error",e,t),a(e)}return u.emit("data",r,t),a(null,r)})}catch(e){return u.emit("error",e,t),setTimeout(function(){a(e)},0),i}},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{35:35}],30:[function(e,t,r){t.exports=u;var n=e(21),o=(((u.prototype=Object.create(n.prototype)).constructor=u).className="Service",e(20)),s=e(33),a=e(28);function u(e,t){n.call(this,e,t),this.methods={},this.f=null}function l(e){return e.f=null,e}u.fromJSON=function(e,t){var r=new u(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),i=0;i<n.length;++i)r.add(o.fromJSON(n[i],t.methods[n[i]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},u.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&!!e.keepComments;return s.toObject(["options",t&&t.options||i,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||i,"comment",r?this.comment:i])},Object.defineProperty(u.prototype,"methodsArray",{get:function(){return this.f||(this.f=s.toArray(this.methods))}}),u.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},u.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},u.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof o?l((this.methods[e.name]=e).parent=this):n.prototype.add.call(this,e)},u.prototype.remove=function(e){if(e instanceof o){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,l(this)}return n.prototype.remove.call(this,e)},u.prototype.create=function(e,t,r){for(var n,o=new a.Service(e,t,r),i=0;i<this.methodsArray.length;++i){var u=s.lcFirst((n=this.f[i]).resolve().name).replace(/[^$\w_]/g,"");o[u]=s.codegen(["r","c"],s.isReserved(u)?u+"_":u)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return o}},{20:20,21:21,28:28,33:33}],31:[function(e,t,r){t.exports=b;var n=e(21),o=(((b.prototype=Object.create(n.prototype)).constructor=b).className="Type",e(14)),s=e(23),a=e(15),u=e(18),l=e(30),p=e(19),f=e(24),c=e(38),h=e(33),d=e(13),y=e(12),m=e(36),g=e(11),v=e(37);function b(e,t){n.call(this,e,t),this.fields={},this.oneofs=i,this.extensions=i,this.reserved=i,this.group=i,this.c=null,this.i=null,this.a=null,this.l=null}function w(e){return e.c=e.i=e.a=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(!this.c){this.c={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this.c[n])throw Error("duplicate id "+n+" in "+this);this.c[n]=r}}return this.c}},fieldsArray:{get:function(){return this.i||(this.i=h.toArray(this.fields))}},oneofsArray:{get:function(){return this.a||(this.a=h.toArray(this.oneofs))}},ctor:{get:function(){return this.l||(this.ctor=b.generateConstructor(this)())},set:function(e){for(var t=e.prototype,r=(t instanceof p||((e.prototype=new p).constructor=e,h.merge(e.prototype,t)),e.$type=e.prototype.$type=this,h.merge(e,p,!0),this.l=e,0);r<this.fieldsArray.length;++r)this.i[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this.a[r].resolve().name]={get:h.oneOfGetter(this.a[r].oneof),set:h.oneOfSetter(this.a[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),b.generateConstructor=function(e){for(var t,r=h.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e.i[n]).map?r("this%s={}",h.safeProp(t.name)):t.repeated&&r("this%s=[]",h.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(e,t){for(var r=new b(e,t.options),p=(r.extensions=t.extensions,r.reserved=t.reserved,Object.keys(t.fields)),f=0;f<p.length;++f)r.add((void 0!==t.fields[p[f]].keyType?u:a).fromJSON(p[f],t.fields[p[f]]));if(t.oneofs)for(p=Object.keys(t.oneofs),f=0;f<p.length;++f)r.add(s.fromJSON(p[f],t.oneofs[p[f]]));if(t.nested)for(p=Object.keys(t.nested),f=0;f<p.length;++f){var c=t.nested[p[f]];r.add((c.id!==i?a:c.fields!==i?b:c.values!==i?o:c.methods!==i?l:n).fromJSON(p[f],c))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},b.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&!!e.keepComments;return h.toObject(["options",t&&t.options||i,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:i,"reserved",this.reserved&&this.reserved.length?this.reserved:i,"group",this.group||i,"nested",t&&t.nested||i,"comment",r?this.comment:i])},b.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return n.prototype.resolveAll.call(this)},b.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},b.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof a&&e.extend===i){if((this.c||this.fieldsById)[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),(this.fields[e.name]=e).message=this,e.onAdd(this),w(this)}return e instanceof s?(this.oneofs||(this.oneofs={}),(this.oneofs[e.name]=e).onAdd(this),w(this)):n.prototype.add.call(this,e)},b.prototype.remove=function(e){if(e instanceof a&&e.extend===i){if(this.fields&&this.fields[e.name]===e)return delete this.fields[e.name],e.parent=null,e.onRemove(this),w(this);throw Error(e+" is not a member of "+this)}if(e instanceof s){if(this.oneofs&&this.oneofs[e.name]===e)return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),w(this);throw Error(e+" is not a member of "+this)}return n.prototype.remove.call(this,e)},b.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},b.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},b.prototype.create=function(e){return new this.ctor(e)},b.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this.i[r].resolve().resolvedType);var n;return this.encode=d(this)({Writer:c,types:t,util:h}),this.decode=y(this)({Reader:f,types:t,util:h}),this.verify=m(this)({types:t,util:h}),this.fromObject=g.fromObject(this)({types:t,util:h}),this.toObject=g.toObject(this)({types:t,util:h}),(e=v[e])&&((n=Object.create(this)).fromObject=this.fromObject,this.fromObject=e.fromObject.bind(n),n.toObject=this.toObject,this.toObject=e.toObject.bind(n)),this},b.prototype.encode=function(e,t){return this.setup().encode(e,t)},b.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},b.prototype.decode=function(e,t){return this.setup().decode(e,t)},b.prototype.decodeDelimited=function(e){return e instanceof f||(e=f.create(e)),this.decode(e,e.uint32())},b.prototype.verify=function(e){return this.setup().verify(e)},b.prototype.fromObject=function(e){return this.setup().fromObject(e)},b.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},b.d=function(e){return function(t){h.decorateType(t,e)}}},{11:11,12:12,13:13,14:14,15:15,18:18,19:19,21:21,23:23,24:24,30:30,33:33,36:36,37:37,38:38}],32:[function(e,t,r){e=e(33);var n=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function o(e,t){var r=0,o={};for(t|=0;r<e.length;)o[n[r+t]]=e[r++];return o}r.basic=o([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),r.defaults=o([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",e.emptyArray,null]),r.long=o([0,0,0,1,1],7),r.mapKey=o([0,0,0,5,5,0,0,0,1,1,0,2],2),r.packed=o([1,5,0,0,0,5,5,0,0,0,1,1,0])},{33:33}],33:[function(e,t,r){var n,o,s=t.exports=e(35),a=e(27),u=(s.codegen=e(3),s.fetch=e(5),s.path=e(8),s.fs=s.inquire("fs"),s.toArray=function(e){if(e){for(var t=Object.keys(e),r=Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},s.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],o=e[r++];o!==i&&(t[n]=o)}return t},/\\/g),l=/"/g,p=(s.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},s.safeProp=function(e){return!/^[$\w_]+$/.test(e)||s.isReserved(e)?'["'+e.replace(u,"\\\\").replace(l,'\\"')+'"]':"."+e},s.ucFirst=function(e){return(e[0]||"").toUpperCase()+e.substring(1)},/_([a-z])/g),f=(s.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(p,function(e,t){return t.toUpperCase()})},s.compareFieldsById=function(e,t){return e.id-t.id},s.decorateType=function(t,r){return t.$type?(r&&t.$type.name!==r&&(s.decorateRoot.remove(t.$type),t.$type.name=r,s.decorateRoot.add(t.$type)),t.$type):(r=new(n=n||e(31))(r||t.name),s.decorateRoot.add(r),r.ctor=t,Object.defineProperty(t,"$type",{value:r,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:r,enumerable:!1}),r)},0);s.decorateEnum=function(t){var r;return t.$type||(r=new(o=o||e(14))("Enum"+f++,t),s.decorateRoot.add(r),Object.defineProperty(t,"$type",{value:r,enumerable:!1}),r)},s.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(t)return function e(t,r,n){var o=r.shift();return"__proto__"!==o&&"prototype"!==o&&(0<r.length?t[o]=e(t[o]||{},r,n):((r=t[o])&&(n=[].concat(r).concat(n)),t[o]=n)),t}(e,t=t.split("."),r);throw TypeError("path must be specified")},Object.defineProperty(s,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(e(26)))}})},{14:14,26:26,27:27,3:3,31:31,35:35,5:5,8:8}],34:[function(e,t,r){t.exports=o;var n=e(35);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=o.zero=new o(0,0),s=(i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1},o.zeroHash="\0\0\0\0\0\0\0\0",o.fromNumber=function(e){var t,r;return 0===e?i:(r=(e=(t=e<0)?-e:e)>>>0,e=(e-r)/4294967296>>>0,t&&(e=~e>>>0,r=~r>>>0,4294967295<++r&&(r=0,4294967295<++e&&(e=0))),new o(r,e))},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(n.isString(e)){if(!n.Long)return o.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):i},o.prototype.toNumber=function(e){var t;return!e&&this.hi>>>31?(e=1+~this.lo>>>0,t=~this.hi>>>0,-(e+4294967296*(t=e?t:t+1>>>0))):this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,!!e):{low:0|this.lo,high:0|this.hi,unsigned:!!e}},String.prototype.charCodeAt);o.fromHash=function(e){return"\0\0\0\0\0\0\0\0"===e?i:new o((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)},o.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)},o.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},o.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},o.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}},{35:35}],35:[function(e,t,r){var n=r;function o(e,t,r){for(var n=Object.keys(t),o=0;o<n.length;++o)e[n[o]]!==i&&r||(e[n[o]]=t[n[o]]);return e}function s(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:Error().stack||""}),r&&o(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:i,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}n.asPromise=e(1),n.base64=e(2),n.EventEmitter=e(4),n.float=e(6),n.inquire=e(7),n.utf8=e(10),n.pool=e(9),n.LongBits=e(34),n.isNode=!!("undefined"!=typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),n.global=n.isNode&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return null!=r&&e.hasOwnProperty(t)&&("object"!=typeof r||0<(Array.isArray(r)?r:Object.keys(r)).length)},n.Buffer=null,n.v=null,n.b=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n.b(e):new n.Array(e):n.Buffer?n.v(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){return e=n.LongBits.fromHash(e),n.Long?n.Long.fromBits(e.lo,e.hi,t):e.toNumber(!!t)},n.merge=o,n.lcFirst=function(e){return(e[0]||"").toLowerCase()+e.substring(1)},n.newError=s,n.ProtocolError=s("ProtocolError"),n.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;-1<r;--r)if(1===t[e[r]]&&this[e[r]]!==i&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n.r=function(){var e=n.Buffer;e?(n.v=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n.b=e.allocUnsafe||function(t){return new e(t)}):n.v=n.b=null}},{1:1,10:10,2:2,34:34,4:4,6:6,7:7,9:9}],36:[function(e,t,r){t.exports=function(e){var t=o.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var n=0;n<e.fieldsArray.length;++n){var a,u=e.i[n].resolve(),l="m"+o.safeProp(u.name);u.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",l,u.name),u.map?(t("if(!util.isObject(%s))",l)("return%j",i(u,"object"))("var k=Object.keys(%s)",l)("for(var i=0;i<k.length;++i){"),function(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",i(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",i(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",i(t,"boolean key"))}}(t,u,"k[i]"),s(t,u,n,l+"[k[i]]")("}")):u.repeated?(t("if(!Array.isArray(%s))",l)("return%j",i(u,"array"))("for(var i=0;i<%s.length;++i){",l),s(t,u,n,l+"[i]")("}")):(u.partOf&&(a=o.safeProp(u.partOf.name),1===r[u.partOf.name]&&t("if(p%s===1)",a)("return%j",u.partOf.name+": multiple values"),r[u.partOf.name]=1,t("p%s=1",a)),s(t,u,n,l)),u.optional&&t("}")}return t("return null")};var n=e(14),o=e(33);function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function s(e,t,r,o){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",o)("default:")("return%j",i(t,"enum value"));for(var s=Object.keys(t.resolvedType.values),a=0;a<s.length;++a)e("case %i:",t.resolvedType.values[s[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,o)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",o)("return%j",i(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",o,o,o,o)("return%j",i(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',o)("return%j",i(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',o)("return%j",i(t,"boolean"));break;case"string":e("if(!util.isString(%s))",o)("return%j",i(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",i(t,"buffer"))}return e}},{14:14,33:33}],37:[function(e,t,r){var n=e(19);r[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t,r=e["@type"].substring(1+e["@type"].lastIndexOf("/"));if(r=this.lookup(r))return~(t="."==(e["@type"][0]||"")?e["@type"].slice(1):e["@type"]).indexOf("/")||(t="/"+t),this.create({type_url:t,value:r.encode(r.fromObject(e)).finish()})}return this.fromObject(e)},toObject:function(e,t){var r,o,i="",s="";return t&&t.json&&e.type_url&&e.value&&(s=e.type_url.substring(1+e.type_url.lastIndexOf("/")),i=e.type_url.substring(0,1+e.type_url.lastIndexOf("/")),(r=this.lookup(s))&&(e=r.decode(e.value))),!(e instanceof this.ctor)&&e instanceof n?(r=e.$type.toObject(e,t),o="."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName,r["@type"]=s=(i=""===i?"type.googleapis.com/":i)+o,r):this.toObject(e,t)}}},{19:19}],38:[function(e,t,r){t.exports=c;var n,o=e(35),s=o.LongBits,a=o.base64,u=o.utf8;function l(e,t,r){this.fn=e,this.len=t,this.next=i,this.val=r}function p(){}function f(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function c(){this.len=0,this.head=new l(p,0,0),this.tail=this.head,this.states=null}function h(){return o.Buffer?function(){return(c.create=function(){return new n})()}:function(){return new c}}function d(e,t,r){t[r]=255&e}function y(e,t){this.len=e,this.next=i,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(;127<e.lo;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function g(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}c.create=h(),c.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(c.alloc=o.pool(c.alloc,o.Array.prototype.subarray)),c.prototype.p=function(e,t,r){return this.tail=this.tail.next=new l(e,t,r),this.len+=t,this},(y.prototype=Object.create(l.prototype)).fn=function(e,t,r){for(;127<e;)t[r++]=127&e|128,e>>>=7;t[r]=e},c.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new y((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},c.prototype.int32=function(e){return e<0?this.p(m,10,s.fromNumber(e)):this.uint32(e)},c.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},c.prototype.int64=c.prototype.uint64=function(e){return e=s.from(e),this.p(m,e.length(),e)},c.prototype.sint64=function(e){return e=s.from(e).zzEncode(),this.p(m,e.length(),e)},c.prototype.bool=function(e){return this.p(d,1,e?1:0)},c.prototype.sfixed32=c.prototype.fixed32=function(e){return this.p(g,4,e>>>0)},c.prototype.sfixed64=c.prototype.fixed64=function(e){return e=s.from(e),this.p(g,4,e.lo).p(g,4,e.hi)},c.prototype.float=function(e){return this.p(o.float.writeFloatLE,4,e)},c.prototype.double=function(e){return this.p(o.float.writeDoubleLE,8,e)};var v=o.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};c.prototype.bytes=function(e){var t,r=e.length>>>0;return r?(o.isString(e)&&(t=c.alloc(r=a.length(e)),a.decode(e,t,0),e=t),this.uint32(r).p(v,r,e)):this.p(d,1,0)},c.prototype.string=function(e){var t=u.length(e);return t?this.uint32(t).p(u.write,t,e):this.p(d,1,0)},c.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new l(p,0,0),this.len=0,this},c.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(p,0,0),this.len=0),this},c.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},c.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},c.r=function(e){n=e,c.create=h(),n.r()}},{35:35}],39:[function(e,t,r){t.exports=i;var n=e(38),o=((i.prototype=Object.create(n.prototype)).constructor=i,e(35));function i(){n.call(this)}function s(e,t,r){e.length<40?o.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}i.r=function(){i.alloc=o.b,i.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.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 n=0;n<e.length;)t[r++]=e[n++]}},i.prototype.bytes=function(e){var t=(e=o.isString(e)?o.v(e,"base64"):e).length>>>0;return this.uint32(t),t&&this.p(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this.p(s,t,e),this},i.r()},{35:35,38:38}]},a={},o=function e(t){var r=a[t];return r||s[t][0].call(r=a[t]={exports:{}},e,r,r.exports),r.exports}(16);const u=new class{constructor(){this._typeStore=new Map}getSchemaType(e){t.utility.requireArgument(e,"schema");const r=t.schemaUtil.getSchemaId(e);let n=this._typeStore.get(r);if(!n){n=o.Root.fromJSON(e.pbjsSchema).lookupType(r),this._typeStore.set(r,n)}return n}validate(e,r){t.utility.requireArgument(e,"schema"),t.utility.requireArgument(r,"data");const n=this.getSchemaType(e),o=n.verify(r);if(o)throw new Error(`Data is invalid for ${n.fullName}: ${o}`);return n}encode(e,t){const r=this.validate(e,t),n=r.fromObject(t);return r.encode(n).finish()}encodePayload(e){if((null==e?void 0:e.schema)&&e.payload)return{schemaName:t.schemaUtil.getSchemaId(e.schema),payload:this.encode(e.schema,e.payload)}}getLogMessage(e,t,r){return{timestamp:r.timestamp,data:this.encode(e,t),age:r.age,rootId:r.rootId,seq:r.sequence,sseq:r.schemaSequence,loggerName:r.loggerName,pagePayload:this.encodePayload(r.pagePayload),loggerAppName:r.loggerAppName,connectionType:r.connectionType,appPayload:this.encodePayload(r.appPayload),csId:r.clientSessionId,recCsId:r.receiverClientSessionId,recRootId:r.receiverRootId}}processRawLogMessage(e,r){const n=r.data?Object.assign({},r.data):{};return t.schemaUtil.isInternal(e)&&n.userPayload&&(n.userPayload=this.encodePayload(n.userPayload)),Object.assign({},r,{data:this.encode(e,n),pagePayload:this.encodePayload(r.pagePayload),appPayload:this.encodePayload(r.appPayload)})}},l=o.Root.fromJSON(n.coreEnvelopeSchema.pbjsSchema).lookupType("CoreEnvelope");function p(e){const t=Object.assign({},e,{messages:new Map});return e.messages.forEach(function(e,r){t.messages.set(r,e.map(e=>u.processRawLogMessage(r,e)))}),t}function f(e){return r.CoreEnvelopeBuilder.buildFrom(e)}function c(e){const t=l.verify(e);if(t)throw new Error(`Invalid CoreEnvelope: ${t}`);return l.encode(e).finish()}var h;!function(e){e[e.fetchBinary=0]="fetchBinary",e[e.fetchFile=1]="fetchFile",e[e.noUpload=2]="noUpload"}(h||(h={}));const d="telemetry",y=h.fetchBinary;e.CoreCollector=class{constructor(e,r,n,o){this._messagesLimit=10,this._metricsLimit=10,this._formDataKey=d,this._uploadInterval=1e4,this._messageSize=0,this.uploadEndpoint=e,this.uploadMode=null==r?y:r,n&&(this._staticAttributes={appName:n.appName,appVersion:n.appVersion,appExperience:n.appExperience,deviceId:n.deviceId,deviceModel:n.deviceModel,sdkVersion:n.sdkVersion});let i=1e4;if(o){const e=o.maxUniqueSchemas;if(void 0!==e){if("number"!=typeof e||!(e>0))throw new Error("options.maxUniqueSchemas, if defined, must be > 0");i=e}const r=o.messagesLimit;if(void 0!==r){if("number"!=typeof r||!(r>0))throw new Error("options.messagesLimit, if defined, must be > 0");this._messagesLimit=r}const n=o.metricsLimit;if(void 0!==n){if("number"!=typeof n||!(n>0))throw new Error("options.metricsLimit, if defined, must be > 0");this._metricsLimit=n}t.utility.requireArgumentIfDefined(o.formDataKeyName,"options.formDataKeyName","string")&&(this._formDataKey=o.formDataKeyName),t.utility.requireArgumentIfDefined(o.uploadFailedListener,"options.uploadFailedListener","function")&&(this._uploadFailedListener=o.uploadFailedListener)}this._messageBuffers=new t.LazyMapToList(i),this._emptySize=this.getByteSize(1),this._restartTimer()}get uploadInterval(){return this._uploadInterval}set uploadInterval(e){if(void 0===e&&(e=1e4),"number"!=typeof e||!(e>0))throw new Error("uploadInterval, if defined, must be > 0");e!==this._uploadInterval&&(this._uploadInterval=e,this._restartTimer())}get uploadEndpoint(){return this._uploadEndpoint}set uploadEndpoint(e){t.utility.requireArgumentIfDefined(e,"uploadEndpoint","string"),this._uploadEndpoint=e}get uploadOptionsCallback(){return this._uploadOptionsCallback}set uploadOptionsCallback(e){t.utility.requireArgumentIfDefined(e,"uploadOptionsCallback","function"),this._uploadOptionsCallback=e}get uploadMode(){return this._uploadMode}set uploadMode(e){if(t.utility.requireArgumentIfDefined(e,"uploadMode","number"),void 0===e&&(e=y),!(e in h))throw new Error(`Unsupported upload mode: ${e}`);this._uploadMode=e}getByteSize(e){return e>=1?this._buildProtoEncodedCoreEnvelope(!1).byteLength:e>=.5?this._emptySize+this._messageSize+8*this.metricsCount:this._emptySize+this._messageSize}_stopTimer(){void 0!==this._intervalHandle&&(clearInterval(this._intervalHandle),this._intervalHandle=void 0)}_restartTimer(){this._stopTimer(),this._intervalHandle=setInterval(()=>{this.hasData&&this._upload()},this._uploadInterval)}async collect(e,r,n){t.schemaUtil.isInternal(e)&&r.userPayload&&(r.userPayload=u.encodePayload(r.userPayload));const o=u.getLogMessage(e,r,n);if(!this._messageBuffers.push(e,o))throw new Error(`Buffer is full. Refusing schemaId ${t.schemaUtil.getSchemaId(e)}`);if(this._messageSize+=t.utility.estimateObjectSize(o),this._shouldUpload())return this._upload()}_shouldUpload(){return this._immediateUpload&&this.hasData||this.messagesCount>=this._messagesLimit||this.metricsCount>=this._metricsLimit}async _upload(e){if(this._restartTimer(),!this._uploadEndpoint||this._uploadMode===h.noUpload)return;const t=this._getContentsOfCoreEnvelope(!0);return this._uploadContents(t,e)}async _uploadContents(e,t){let r=this._getRequestInit(e);const n={envelopeContents:e};try{if(this._uploadOptionsCallback){const e=this._uploadOptionsCallback()||{};if(e){if(e.headers&&r.headers)if(e.headers instanceof Headers)for(const t in r.headers)Object.prototype.hasOwnProperty.call(r.headers,t)&&e.headers.set(t,r.headers[t]);else{if(Array.isArray(e.headers))throw new Error("Headers as array is not supported.");Object.assign(e.headers,r.headers)}e.method=r.method,e.body=r.body,r=e}}if(n.response=await fetch(this._uploadEndpoint,r),!n.response.ok)throw new Error("HTTP Not OK");return n}catch(e){if(n.error=e,!t&&this._uploadFailedListener)try{this._uploadFailedListener(n)}catch(e){}throw n}}_getRequestInit(e){const t=c(f(e));let r;switch(this._uploadMode){case h.fetchBinary:r={method:"POST",headers:{"Content-Type":"application/octet-stream"},body:t};break;case void 0:case h.fetchFile:if("function"!=typeof FormData)throw new Error("FormData is not a function in the global namespace.");const e=new FormData;e.append(this._formDataKey||d,new Blob([t])),r={method:"POST",body:e};break;case h.noUpload:default:throw new Error("Invalid uploadMode")}return r}_checkUploadState(){if(void 0===this._uploadEndpoint)throw new Error("Upload endpoint is unset");if(this._uploadMode===h.noUpload)throw new Error("Upload mode is unset")}async upload(e){return this._checkUploadState(),t.utility.requireArgumentIfDefined(e,"contents","object")?this._uploadContents(e,!0):this.hasData?this._upload(!0):void 0}get hasData(){return this.messagesCount>0||this.metricsCount>0}get messagesCount(){return this._messageBuffers.totalItemCount}get metricsCount(){let e=0;return this._metricsExtractors&&(e+=this._metricsExtractors.getAllUpCounters().length||0,e+=this._metricsExtractors.getAllValueRecorders().length||0,e+=this._metricsExtractors.getAllBucketHistograms().length||0),e}getProtoEncodedCoreEnvelope(){return this._buildProtoEncodedCoreEnvelope(!0)}getContentsOfCoreEnvelope(){return this._getContentsOfCoreEnvelope(!0)}_getContentsOfCoreEnvelope(e){const t={staticAttributes:this._staticAttributes,messages:this._messageBuffers.getAllMessages(e)};return this._metricsExtractors&&(t.upCounters=r.CoreEnvelopeBuilder.getUpCounters(this._metricsExtractors.getAllUpCounters(),e),t.valueRecorders=r.CoreEnvelopeBuilder.getValueRecorders(this._metricsExtractors.getAllValueRecorders(),e),t.bucketHistograms=r.CoreEnvelopeBuilder.getBucketHistograms(this._metricsExtractors.getAllBucketHistograms(),e)),e&&(this._messageSize=0),t}_buildProtoEncodedCoreEnvelope(e){return c(f(this._getContentsOfCoreEnvelope(e)))}receiveMetricsExtractors(e){this._metricsExtractors=e}},e.HybridCollector=class{constructor(){if("undefined"==typeof __nimbus)throw new Error("Nimbus is unavailable");if(!__nimbus.plugins||!__nimbus.plugins.observability)throw new Error("Observability plugin not found in Nimbus plugins");this._observability=__nimbus.plugins.observability,setInterval(()=>{this._collectMetrics()},3e4)}collect(e,r,n){t.schemaUtil.isInternal(e)&&r.userPayload&&(r.userPayload=u.encodePayload(r.userPayload));const o=u.getLogMessage(e,r,n),i={timestamp:n.timestamp,rootId:n.rootId,sequence:n.sequence,schemaSequence:n.schemaSequence,loggerName:n.loggerName,pagePayload:o.pagePayload,loggerAppName:n.loggerAppName,connectionType:n.connectionType,appPayload:o.appPayload,clientSessionId:n.clientSessionId,age:n.age,receiverClientSessionId:n.receiverClientSessionId,receiverRootId:n.receiverRootId};this._observability.log(t.schemaUtil.getSchemaId(e),o.data,i)}receiveMetricsExtractors(e){this._metricsExtractors=e}notifyIdleDetected(e){this._observability.idleDetected(e)}_collectMetrics(){if(this._metricsExtractors){const e=this._metricsExtractors.getAllUpCounters(),t=this._metricsExtractors.getAllValueRecorders(),r=this._metricsExtractors.getAllBucketHistograms(),n=[],o=[],i=[];for(const e of t){const t={name:e.getName(),createdTimestamp:e.getCreatedOn(),lastUpdatedTimestamp:e.getLastUpdatedOn(),values:e.getData(),ownerName:e.getOwnerName(),ownerAppName:e.getOwnerAppName(),tags:this._getMetricTags(e)};n.push(t),e.reset()}for(const t of e){const e={name:t.getName(),createdTimestamp:t.getCreatedOn(),lastUpdatedTimestamp:t.getLastUpdatedOn(),value:t.getData(),ownerName:t.getOwnerName(),ownerAppName:t.getOwnerAppName(),tags:this._getMetricTags(t)};o.push(e),t.reset()}for(const e of r){const t={name:e.getName(),createdTimestamp:e.getCreatedOn(),lastUpdatedTimestamp:e.getLastUpdatedOn(),values:e.getData(),buckets:e.getBuckets(),ownerName:e.getOwnerName(),ownerAppName:e.getOwnerAppName(),tags:this._getMetricTags(e)};i.push(t),e.reset()}if(n.length>0||o.length>0){const e={upCounters:o,valueRecorders:n,bucketHistograms:i};this._observability.logMetrics(e)}}}_getMetricTags(e){const t=e.getTags();return t?Object.entries(t).map(e=>({name:e[0],value:e[1].toString()})):[]}},e.encodeCoreEnvelopeContentsRaw=function(e){return c(f(p(e)))},e.processRawContents=p,Object.defineProperty(e,"__esModule",{value:!0})});
}
)();