@hzhangxyz/ddss 0.0.1-alpha1 → 0.0.1-alpha2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +1 -0
- package/package.json +8 -4
- package/ddss.proto +0 -85
- package/hzhangxyz-ddss-v0.0.1-alpha1.tgz +0 -0
- package/main.ts +0 -472
- package/rollup.config.js +0 -20
- package/tsconfig.json +0 -12
package/dist/main.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import require$$1$5,{promisify}from"util";import{randomUUID}from"crypto";import{createInterface}from"readline";import require$$1$1 from"process";import require$$0$1 from"tls";import require$$0 from"fs";import require$$0$2 from"os";import require$$0$3 from"net";import require$$0$4 from"events";import require$$1$2 from"stream";import require$$1$3 from"path";import require$$0$5 from"zlib";import require$$0$6 from"http2";import require$$3$1 from"http";import require$$6$1 from"url";import require$$1$4 from"dns";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getAugmentedNamespace(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){var r=!1;try{r=this instanceof e}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var src$2={},callCredentials={},metadata={},logging={},constants={},hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,Object.defineProperty(constants,"__esModule",{value:!0}),constants.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=constants.DEFAULT_MAX_SEND_MESSAGE_LENGTH=constants.Propagate=constants.LogVerbosity=constants.Status=void 0,function(e){e[e.OK=0]="OK",e[e.CANCELLED=1]="CANCELLED",e[e.UNKNOWN=2]="UNKNOWN",e[e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",e[e.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",e[e.NOT_FOUND=5]="NOT_FOUND",e[e.ALREADY_EXISTS=6]="ALREADY_EXISTS",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",e[e.ABORTED=10]="ABORTED",e[e.OUT_OF_RANGE=11]="OUT_OF_RANGE",e[e.UNIMPLEMENTED=12]="UNIMPLEMENTED",e[e.INTERNAL=13]="INTERNAL",e[e.UNAVAILABLE=14]="UNAVAILABLE",e[e.DATA_LOSS=15]="DATA_LOSS",e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED"}(e||(constants.Status=e={})),function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.ERROR=2]="ERROR",e[e.NONE=3]="NONE"}(t||(constants.LogVerbosity=t={})),function(e){e[e.DEADLINE=1]="DEADLINE",e[e.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",e[e.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",e[e.CANCELLATION=8]="CANCELLATION",e[e.DEFAULTS=65535]="DEFAULTS"}(r||(constants.Propagate=r={})),constants.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1,constants.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4194304),constants;var e,t,r}var version="1.14.3",require$$12={version:version},hasRequiredLogging;function requireLogging(){return hasRequiredLogging||(hasRequiredLogging=1,function(e){var t,r,n,i;Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.setLoggerVerbosity=e.setLogger=e.getLogger=void 0,e.trace=function(t,r,n){g(r)&&(0,e.log)(t,(new Date).toISOString()+" | v"+o+" "+a.pid+" | "+r+" | "+n)},e.isTracerEnabled=g;const s=requireConstants(),a=require$$1$1,o=require$$12.version,l={error:(e,...t)=>{console.error("E "+e,...t)},info:(e,...t)=>{console.error("I "+e,...t)},debug:(e,...t)=>{console.error("D "+e,...t)}};let c=l,u=s.LogVerbosity.ERROR;switch((null!==(r=null!==(t=process.env.GRPC_NODE_VERBOSITY)&&void 0!==t?t:process.env.GRPC_VERBOSITY)&&void 0!==r?r:"").toUpperCase()){case"DEBUG":u=s.LogVerbosity.DEBUG;break;case"INFO":u=s.LogVerbosity.INFO;break;case"ERROR":u=s.LogVerbosity.ERROR;break;case"NONE":u=s.LogVerbosity.NONE}e.getLogger=()=>c;e.setLogger=e=>{c=e};e.setLoggerVerbosity=e=>{u=e};e.log=(e,...t)=>{let r;if(e>=u){switch(e){case s.LogVerbosity.DEBUG:r=c.debug;break;case s.LogVerbosity.INFO:r=c.info;break;case s.LogVerbosity.ERROR:r=c.error}r||(r=c.error),r&&r.bind(c)(...t)}};const h=null!==(i=null!==(n=process.env.GRPC_NODE_TRACE)&&void 0!==n?n:process.env.GRPC_TRACE)&&void 0!==i?i:"",d=new Set,p=new Set;for(const e of h.split(","))e.startsWith("-")?p.add(e.substring(1)):d.add(e);const f=d.has("all");function g(e){return!p.has(e)&&(f||d.has(e))}}(logging)),logging}var error={},hasRequiredError,hasRequiredMetadata,hasRequiredCallCredentials;function requireError(){if(hasRequiredError)return error;return hasRequiredError=1,Object.defineProperty(error,"__esModule",{value:!0}),error.getErrorMessage=function(e){return e instanceof Error?e.message:String(e)},error.getErrorCode=function(e){return"object"==typeof e&&null!==e&&"code"in e&&"number"==typeof e.code?e.code:null},error}function requireMetadata(){if(hasRequiredMetadata)return metadata;hasRequiredMetadata=1,Object.defineProperty(metadata,"__esModule",{value:!0}),metadata.Metadata=void 0;const e=requireLogging(),t=requireConstants(),r=requireError(),n=/^[:0-9a-z_.-]+$/,i=/^[ -~]*$/;function s(e){return e.endsWith("-bin")}function a(e){return!e.startsWith("grpc-")}function o(e){return e.toLowerCase()}function l(e,t){if(!function(e){return n.test(e)}(e))throw new Error('Metadata key "'+e+'" contains illegal characters');if(null!=t)if(s(e)){if(!Buffer.isBuffer(t))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(t))throw new Error("keys that don't end with '-bin' must have String values");if(!function(e){return i.test(e)}(t))throw new Error('Metadata string value "'+t+'" contains illegal characters')}}class c{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,t){l(e=o(e),t),this.internalRepr.set(e,[t])}add(e,t){l(e=o(e),t);const r=this.internalRepr.get(e);void 0===r?this.internalRepr.set(e,[t]):r.push(t)}remove(e){e=o(e),this.internalRepr.delete(e)}get(e){return e=o(e),this.internalRepr.get(e)||[]}getMap(){const e={};for(const[t,r]of this.internalRepr)if(r.length>0){const n=r[0];e[t]=Buffer.isBuffer(n)?Buffer.from(n):n}return e}clone(){const e=new c(this.options),t=e.internalRepr;for(const[e,r]of this.internalRepr){const n=r.map(e=>Buffer.isBuffer(e)?Buffer.from(e):e);t.set(e,n)}return e}merge(e){for(const[t,r]of e.internalRepr){const e=(this.internalRepr.get(t)||[]).concat(r);this.internalRepr.set(t,e)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){const e={};for(const[t,r]of this.internalRepr)t.startsWith(":")||(e[t]=r.map(u));return e}toJSON(){const e={};for(const[t,r]of this.internalRepr)e[t]=r;return e}setOpaque(e,t){this.opaqueData.set(e,t)}getOpaque(e){return this.opaqueData.get(e)}static fromHttp2Headers(n){const i=new c;for(const o of Object.keys(n)){if(":"===o.charAt(0))continue;const l=n[o];try{s(o)?Array.isArray(l)?l.forEach(e=>{i.add(o,Buffer.from(e,"base64"))}):void 0!==l&&(a(o)?l.split(",").forEach(e=>{i.add(o,Buffer.from(e.trim(),"base64"))}):i.add(o,Buffer.from(l,"base64"))):Array.isArray(l)?l.forEach(e=>{i.add(o,e)}):void 0!==l&&i.add(o,l)}catch(n){const i=`Failed to add metadata entry ${o}: ${l}. ${(0,r.getErrorMessage)(n)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,e.log)(t.LogVerbosity.ERROR,i)}}return i}}metadata.Metadata=c;const u=e=>Buffer.isBuffer(e)?e.toString("base64"):e;return metadata}function requireCallCredentials(){if(hasRequiredCallCredentials)return callCredentials;hasRequiredCallCredentials=1,Object.defineProperty(callCredentials,"__esModule",{value:!0}),callCredentials.CallCredentials=void 0;const e=requireMetadata();class t{static createFromMetadataGenerator(e){return new n(e)}static createFromGoogleCredential(r){return t.createFromMetadataGenerator((t,n)=>{let i;i=function(e){return"getRequestHeaders"in e&&"function"==typeof e.getRequestHeaders}(r)?r.getRequestHeaders(t.service_url):new Promise((e,n)=>{r.getRequestMetadata(t.service_url,(t,r)=>{t?n(t):r?e(r):n(new Error("Headers not set by metadata plugin"))})}),i.then(t=>{const r=new e.Metadata;for(const e of Object.keys(t))r.add(e,t[e]);n(null,r)},e=>{n(e)})})}static createEmpty(){return new i}}callCredentials.CallCredentials=t;class r extends t{constructor(e){super(),this.creds=e}async generateMetadata(t){const r=new e.Metadata,n=await Promise.all(this.creds.map(e=>e.generateMetadata(t)));for(const e of n)r.merge(e);return r}compose(e){return new r(this.creds.concat([e]))}_equals(e){return this===e||e instanceof r&&this.creds.every((t,r)=>t._equals(e.creds[r]))}}class n extends t{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,r)=>{this.metadataGenerator(e,(e,n)=>{void 0!==n?t(n):r(e)})})}compose(e){return new r([this,e])}_equals(e){return this===e||e instanceof n&&this.metadataGenerator===e.metadataGenerator}}class i extends t{generateMetadata(t){return Promise.resolve(new e.Metadata)}compose(e){return e}_equals(e){return e instanceof i}}return callCredentials}var channel={},channelCredentials={},tlsHelpers={},hasRequiredTlsHelpers;function requireTlsHelpers(){if(hasRequiredTlsHelpers)return tlsHelpers;hasRequiredTlsHelpers=1,Object.defineProperty(tlsHelpers,"__esModule",{value:!0}),tlsHelpers.CIPHER_SUITES=void 0,tlsHelpers.getDefaultRootsData=function(){if(t)return null===r&&(r=e.readFileSync(t)),r;return null};const e=require$$0;tlsHelpers.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;const t=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH;let r=null;return tlsHelpers}var uriParser={},hasRequiredUriParser;function requireUriParser(){if(hasRequiredUriParser)return uriParser;hasRequiredUriParser=1,Object.defineProperty(uriParser,"__esModule",{value:!0}),uriParser.parseUri=function(t){const r=e.exec(t);if(null===r)return null;return{scheme:r[1],authority:r[2],path:r[3]}},uriParser.splitHostPort=function(e){if(e.startsWith("[")){const r=e.indexOf("]");if(-1===r)return null;const n=e.substring(1,r);if(-1===n.indexOf(":"))return null;if(e.length>r+1){if(":"===e[r+1]){const i=e.substring(r+2);return t.test(i)?{host:n,port:+i}:null}return null}return{host:n}}{const r=e.split(":");return 2===r.length?t.test(r[1])?{host:r[0],port:+r[1]}:null:{host:e}}},uriParser.combineHostPort=function(e){return void 0===e.port?e.host:e.host.includes(":")?`[${e.host}]:${e.port}`:`${e.host}:${e.port}`},uriParser.uriToString=function(e){let t="";void 0!==e.scheme&&(t+=e.scheme+":");void 0!==e.authority&&(t+="//"+e.authority+"/");return t+=e.path,t};const e=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;const t=/^\d+$/;return uriParser}var resolver={},hasRequiredResolver,hasRequiredChannelCredentials;function requireResolver(){if(hasRequiredResolver)return resolver;hasRequiredResolver=1,Object.defineProperty(resolver,"__esModule",{value:!0}),resolver.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0,resolver.registerResolver=function(e,r){t[e]=r},resolver.registerDefaultScheme=function(e){r=e},resolver.createResolver=function(r,n,i){if(void 0!==r.scheme&&r.scheme in t)return new t[r.scheme](r,n,i);throw new Error(`No resolver could be created for target ${(0,e.uriToString)(r)}`)},resolver.getDefaultAuthority=function(r){if(void 0!==r.scheme&&r.scheme in t)return t[r.scheme].getDefaultAuthority(r);throw new Error(`Invalid target ${(0,e.uriToString)(r)}`)},resolver.mapUriDefaultScheme=function(n){if(void 0===n.scheme||!(n.scheme in t))return null!==r?{scheme:r,authority:void 0,path:(0,e.uriToString)(n)}:null;return n};const e=requireUriParser();resolver.CHANNEL_ARGS_CONFIG_SELECTOR_KEY="grpc.internal.config_selector";const t={};let r=null;return resolver}function requireChannelCredentials(){if(hasRequiredChannelCredentials)return channelCredentials;hasRequiredChannelCredentials=1,Object.defineProperty(channelCredentials,"__esModule",{value:!0}),channelCredentials.ChannelCredentials=void 0,channelCredentials.createCertificateProviderChannelCredentials=function(e,t,r){return new p(e,t,null!=r?r:{})};const e=require$$0$1,t=requireCallCredentials(),r=requireTlsHelpers(),n=requireUriParser(),i=requireResolver(),s=requireLogging(),a=requireConstants();function o(e,t){if(e&&!(e instanceof Buffer))throw new TypeError(`${t}, if provided, must be a Buffer.`)}class l{compose(e){return new f(this,e)}static createSsl(t,n,i,s){var a;if(o(t,"Root certificate"),o(n,"Private key"),o(i,"Certificate chain"),n&&!i)throw new Error("Private key must be given with accompanying certificate chain");if(!n&&i)throw new Error("Certificate chain must be given with accompanying private key");const l=(0,e.createSecureContext)({ca:null!==(a=null!=t?t:(0,r.getDefaultRootsData)())&&void 0!==a?a:void 0,key:null!=n?n:void 0,cert:null!=i?i:void 0,ciphers:r.CIPHER_SUITES});return new d(l,null!=s?s:{})}static createFromSecureContext(e,t){return new d(e,null!=t?t:{})}static createInsecure(){return new c}}channelCredentials.ChannelCredentials=l;class c extends l{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof c}_createSecureConnector(e,r,n){return{connect:e=>Promise.resolve({socket:e,secure:!1}),waitForReady:()=>Promise.resolve(),getCallCredentials:()=>null!=n?n:t.CallCredentials.createEmpty(),destroy(){}}}}function u(t,r,s,a){var o,l;const c={secureContext:t};let u=s;if("grpc.http_connect_target"in a){const e=(0,n.parseUri)(a["grpc.http_connect_target"]);e&&(u=e)}const h=(0,i.getDefaultAuthority)(u),d=(0,n.splitHostPort)(h),p=null!==(o=null==d?void 0:d.host)&&void 0!==o?o:h;if(c.host=p,r.checkServerIdentity&&(c.checkServerIdentity=r.checkServerIdentity),void 0!==r.rejectUnauthorized&&(c.rejectUnauthorized=r.rejectUnauthorized),c.ALPNProtocols=["h2"],a["grpc.ssl_target_name_override"]){const t=a["grpc.ssl_target_name_override"],r=null!==(l=c.checkServerIdentity)&&void 0!==l?l:e.checkServerIdentity;c.checkServerIdentity=(e,n)=>r(t,n),c.servername=t}else c.servername=p;return a["grpc-node.tls_enable_trace"]&&(c.enableTrace=!0),c}class h{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(t){const r=Object.assign({socket:t},this.connectionOptions);return new Promise((t,n)=>{const i=(0,e.connect)(r,()=>{var e;null!==(e=this.connectionOptions.rejectUnauthorized)&&void 0!==e&&!e||i.authorized?t({socket:i,secure:!0}):n(i.authorizationError)});i.on("error",e=>{n(e)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}}class d extends l{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e||e instanceof d&&(this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity)}_createSecureConnector(e,r,n){const i=u(this.secureContext,this.verifyOptions,e,r);return new h(i,null!=n?n:t.CallCredentials.createEmpty())}}class p extends l{constructor(e,t,r){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=r,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var t,r;return this===e||e instanceof p&&(this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&(null===(t=this.verifyOptions)||void 0===t?void 0:t.checkServerIdentity)===(null===(r=e.verifyOptions)||void 0===r?void 0:r.checkServerIdentity))}ref(){var e;0===this.refcount&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),null===(e=this.identityCertificateProvider)||void 0===e||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,0===this.refcount&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),null===(e=this.identityCertificateProvider)||void 0===e||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,r,n){return this.ref(),new p.SecureConnectorImpl(this,e,r,null!=n?n:t.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(const e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return void 0!==this.latestCaUpdate&&(!this.identityCertificateProvider||void 0!==this.latestIdentityUpdate)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var t,n;if(!this.latestCaUpdate)return null;if(null!==this.identityCertificateProvider&&!this.latestIdentityUpdate)return null;try{return(0,e.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:null===(t=this.latestIdentityUpdate)||void 0===t?void 0:t.privateKey,cert:null===(n=this.latestIdentityUpdate)||void 0===n?void 0:n.certificate,ciphers:r.CIPHER_SUITES})}catch(e){return(0,s.log)(a.LogVerbosity.ERROR,"Failed to createSecureContext with error "+e.message),null}}}p.SecureConnectorImpl=class{constructor(e,t,r,n){this.parent=e,this.channelTarget=t,this.options=r,this.callCredentials=n}connect(t){return new Promise((r,n)=>{const i=this.parent.getLatestSecureContext();if(!i)return void n(new Error("Failed to load credentials"));t.closed&&n(new Error("Socket closed while loading credentials"));const s=u(i,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:t},s),o=()=>{n(new Error("Socket closed"))},l=e=>{n(e)},c=(0,e.connect)(a,()=>{var e;c.removeListener("close",o),c.removeListener("error",l),null!==(e=this.parent.verifyOptions.rejectUnauthorized)&&void 0!==e&&!e||c.authorized?r({socket:c,secure:!0}):n(c.authorizationError)});c.once("close",o),c.once("error",l)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};class f extends l{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){const t=this.callCredentials.compose(e);return new f(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e||e instanceof f&&(this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials))}_createSecureConnector(e,r,n){const i=this.callCredentials.compose(null!=n?n:t.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,r,i)}}return channelCredentials}var internalChannel={},resolvingLoadBalancer={},loadBalancer={},hasRequiredLoadBalancer;function requireLoadBalancer(){if(hasRequiredLoadBalancer)return loadBalancer;hasRequiredLoadBalancer=1,Object.defineProperty(loadBalancer,"__esModule",{value:!0}),loadBalancer.createChildChannelControlHelper=function(e,t){var r,n,i,s,a,o,l,c,u,h;return{createSubchannel:null!==(n=null===(r=t.createSubchannel)||void 0===r?void 0:r.bind(t))&&void 0!==n?n:e.createSubchannel.bind(e),updateState:null!==(s=null===(i=t.updateState)||void 0===i?void 0:i.bind(t))&&void 0!==s?s:e.updateState.bind(e),requestReresolution:null!==(o=null===(a=t.requestReresolution)||void 0===a?void 0:a.bind(t))&&void 0!==o?o:e.requestReresolution.bind(e),addChannelzChild:null!==(c=null===(l=t.addChannelzChild)||void 0===l?void 0:l.bind(t))&&void 0!==c?c:e.addChannelzChild.bind(e),removeChannelzChild:null!==(h=null===(u=t.removeChannelzChild)||void 0===u?void 0:u.bind(t))&&void 0!==h?h:e.removeChannelzChild.bind(e)}},loadBalancer.registerLoadBalancerType=function(e,t,n){r[e]={LoadBalancer:t,LoadBalancingConfig:n}},loadBalancer.registerDefaultLoadBalancerType=function(e){n=e},loadBalancer.createLoadBalancer=function(e,t){const n=e.getLoadBalancerName();return n in r?new r[n].LoadBalancer(t):null},loadBalancer.isLoadBalancerNameRegistered=function(e){return e in r},loadBalancer.parseLoadBalancingConfig=i,loadBalancer.getDefaultConfig=function(){if(!n)throw new Error("No default load balancer type registered");return new r[n].LoadBalancingConfig},loadBalancer.selectLbConfigFromList=function(s,a=!1){for(const r of s)try{return i(r)}catch(r){(0,e.log)(t.LogVerbosity.DEBUG,"Config parsing failed with error",r.message);continue}return a&&n?new r[n].LoadBalancingConfig:null};const e=requireLogging(),t=requireConstants();const r={};let n=null;function i(e){const t=Object.keys(e);if(1!==t.length)throw new Error("Provided load balancing config has multiple conflicting entries");const n=t[0];if(!(n in r))throw new Error(`Unrecognized load balancing config name ${n}`);try{return r[n].LoadBalancingConfig.createFromJson(e[n])}catch(e){throw new Error(`${n}: ${e.message}`)}}return loadBalancer}var serviceConfig={},hasRequiredServiceConfig;function requireServiceConfig(){if(hasRequiredServiceConfig)return serviceConfig;hasRequiredServiceConfig=1,Object.defineProperty(serviceConfig,"__esModule",{value:!0}),serviceConfig.validateRetryThrottling=a,serviceConfig.validateServiceConfig=l,serviceConfig.extractAndSelectServiceConfig=function(e,t){for(const r of e)if(r.length>0&&r[0].startsWith("grpc_config=")){const e=r.join("").substring(12);return u(JSON.parse(e),t)}return null};const e=require$$0$2,t=requireConstants(),r=/^\d+(\.\d{1,9})?s$/,n="node";function i(e){if("service"in e&&""!==e.service){if("string"!=typeof e.service)throw new Error("Invalid method config name: invalid service: expected type string, got "+typeof e.service);if("method"in e&&""!==e.method){if("string"!=typeof e.method)throw new Error("Invalid method config name: invalid method: expected type string, got "+typeof e.service);return{service:e.service,method:e.method}}return{service:e.service}}if("method"in e&&void 0!==e.method)throw new Error("Invalid method config name: method set with empty or unset service");return{}}function s(e){var n;const s={name:[]};if(!("name"in e)||!Array.isArray(e.name))throw new Error("Invalid method config: invalid name array");for(const t of e.name)s.name.push(i(t));if("waitForReady"in e){if("boolean"!=typeof e.waitForReady)throw new Error("Invalid method config: invalid waitForReady");s.waitForReady=e.waitForReady}if("timeout"in e)if("object"==typeof e.timeout){if(!("seconds"in e.timeout)||"number"!=typeof e.timeout.seconds)throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in e.timeout)||"number"!=typeof e.timeout.nanos)throw new Error("Invalid method config: invalid timeout.nanos");s.timeout=e.timeout}else{if("string"!=typeof e.timeout||!r.test(e.timeout))throw new Error("Invalid method config: invalid timeout");{const t=e.timeout.substring(0,e.timeout.length-1).split(".");s.timeout={seconds:0|t[0],nanos:0|(null!==(n=t[1])&&void 0!==n?n:0)}}}if("maxRequestBytes"in e){if("number"!=typeof e.maxRequestBytes)throw new Error("Invalid method config: invalid maxRequestBytes");s.maxRequestBytes=e.maxRequestBytes}if("maxResponseBytes"in e){if("number"!=typeof e.maxResponseBytes)throw new Error("Invalid method config: invalid maxRequestBytes");s.maxResponseBytes=e.maxResponseBytes}if("retryPolicy"in e){if("hedgingPolicy"in e)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");s.retryPolicy=function(e){if(!("maxAttempts"in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in e)||"string"!=typeof e.initialBackoff||!r.test(e.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in e)||"string"!=typeof e.maxBackoff||!r.test(e.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in e)||"number"!=typeof e.backoffMultiplier||e.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in e)||!Array.isArray(e.retryableStatusCodes))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(0===e.retryableStatusCodes.length)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(const r of e.retryableStatusCodes)if("number"==typeof r){if(!Object.values(t.Status).includes(r))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else{if("string"!=typeof r)throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");if(!Object.values(t.Status).includes(r.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}return{maxAttempts:e.maxAttempts,initialBackoff:e.initialBackoff,maxBackoff:e.maxBackoff,backoffMultiplier:e.backoffMultiplier,retryableStatusCodes:e.retryableStatusCodes}}(e.retryPolicy)}else"hedgingPolicy"in e&&(s.hedgingPolicy=function(e){if(!("maxAttempts"in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in e&&("string"!=typeof e.hedgingDelay||!r.test(e.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in e&&Array.isArray(e.nonFatalStatusCodes))for(const r of e.nonFatalStatusCodes)if("number"==typeof r){if(!Object.values(t.Status).includes(r))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else{if("string"!=typeof r)throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");if(!Object.values(t.Status).includes(r.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}const n={maxAttempts:e.maxAttempts};return e.hedgingDelay&&(n.hedgingDelay=e.hedgingDelay),e.nonFatalStatusCodes&&(n.nonFatalStatusCodes=e.nonFatalStatusCodes),n}(e.hedgingPolicy));return s}function a(e){if(!("maxTokens"in e)||"number"!=typeof e.maxTokens||e.maxTokens<=0||e.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in e)||"number"!=typeof e.tokenRatio||e.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+e.maxTokens.toFixed(3),tokenRatio:+e.tokenRatio.toFixed(3)}}function o(e){if("object"!=typeof e||null===e)throw new Error("Invalid loadBalancingConfig: unexpected type "+typeof e);const t=Object.keys(e);if(t.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${t}`);if(0===t.length)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[t[0]]:e[t[0]]}}function l(e){const t={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in e){if("string"!=typeof e.loadBalancingPolicy)throw new Error("Invalid service config: invalid loadBalancingPolicy");t.loadBalancingPolicy=e.loadBalancingPolicy}if("loadBalancingConfig"in e){if(!Array.isArray(e.loadBalancingConfig))throw new Error("Invalid service config: invalid loadBalancingConfig");for(const r of e.loadBalancingConfig)t.loadBalancingConfig.push(o(r))}if("methodConfig"in e&&Array.isArray(e.methodConfig))for(const r of e.methodConfig)t.methodConfig.push(s(r));"retryThrottling"in e&&(t.retryThrottling=a(e.retryThrottling));const r=[];for(const e of t.methodConfig)for(const t of e.name){for(const e of r)if(t.service===e.service&&t.method===e.method)throw new Error(`Invalid service config: duplicate name ${t.service}/${t.method}`);r.push(t)}return t}function c(e){if(!("serviceConfig"in e))throw new Error("Invalid service config choice: missing service config");const t={serviceConfig:l(e.serviceConfig)};if("clientLanguage"in e){if(!Array.isArray(e.clientLanguage))throw new Error("Invalid service config choice: invalid clientLanguage");t.clientLanguage=[];for(const r of e.clientLanguage){if("string"!=typeof r)throw new Error("Invalid service config choice: invalid clientLanguage");t.clientLanguage.push(r)}}if("clientHostname"in e){if(!Array.isArray(e.clientHostname))throw new Error("Invalid service config choice: invalid clientHostname");t.clientHostname=[];for(const r of e.clientHostname){if("string"!=typeof r)throw new Error("Invalid service config choice: invalid clientHostname");t.clientHostname.push(r)}}if("percentage"in e){if(!("number"==typeof e.percentage&&0<=e.percentage&&e.percentage<=100))throw new Error("Invalid service config choice: invalid percentage");t.percentage=e.percentage}const r=["clientLanguage","percentage","clientHostname","serviceConfig"];for(const t in e)if(!r.includes(t))throw new Error(`Invalid service config choice: unexpected field ${t}`);return t}function u(t,r){if(!Array.isArray(t))throw new Error("Invalid service config list");for(const i of t){const t=c(i);if(!("number"==typeof t.percentage&&r>t.percentage)){if(Array.isArray(t.clientHostname)){let r=!1;for(const n of t.clientHostname)n===e.hostname()&&(r=!0);if(!r)continue}if(Array.isArray(t.clientLanguage)){let e=!1;for(const r of t.clientLanguage)r===n&&(e=!0);if(!e)continue}return t.serviceConfig}}throw new Error("No matching service config found")}return serviceConfig}var connectivityState={},hasRequiredConnectivityState;function requireConnectivityState(){return hasRequiredConnectivityState||(hasRequiredConnectivityState=1,Object.defineProperty(connectivityState,"__esModule",{value:!0}),connectivityState.ConnectivityState=void 0,function(e){e[e.IDLE=0]="IDLE",e[e.CONNECTING=1]="CONNECTING",e[e.READY=2]="READY",e[e.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",e[e.SHUTDOWN=4]="SHUTDOWN"}(e||(connectivityState.ConnectivityState=e={}))),connectivityState;var e}var picker={},hasRequiredPicker;function requirePicker(){if(hasRequiredPicker)return picker;hasRequiredPicker=1,Object.defineProperty(picker,"__esModule",{value:!0}),picker.QueuePicker=picker.UnavailablePicker=picker.PickResultType=void 0;const e=requireMetadata(),t=requireConstants();var r;!function(e){e[e.COMPLETE=0]="COMPLETE",e[e.QUEUE=1]="QUEUE",e[e.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",e[e.DROP=3]="DROP"}(r||(picker.PickResultType=r={}));picker.UnavailablePicker=class{constructor(r){this.status=Object.assign({code:t.Status.UNAVAILABLE,details:"No connection established",metadata:new e.Metadata},r)}pick(e){return{pickResultType:r.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};return picker.QueuePicker=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:r.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}},picker}var backoffTimeout={},hasRequiredBackoffTimeout;function requireBackoffTimeout(){if(hasRequiredBackoffTimeout)return backoffTimeout;hasRequiredBackoffTimeout=1,Object.defineProperty(backoffTimeout,"__esModule",{value:!0}),backoffTimeout.BackoffTimeout=void 0;const e=requireConstants(),t=requireLogging();class r{constructor(e,t){this.callback=e,this.initialDelay=1e3,this.multiplier=1.6,this.maxDelay=12e4,this.jitter=.2,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=r.getNextId(),t&&(t.initialDelay&&(this.initialDelay=t.initialDelay),t.multiplier&&(this.multiplier=t.multiplier),t.jitter&&(this.jitter=t.jitter),t.maxDelay&&(this.maxDelay=t.maxDelay)),this.trace("constructed initialDelay="+this.initialDelay+" multiplier="+this.multiplier+" jitter="+this.jitter+" maxDelay="+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(r){t.trace(e.LogVerbosity.DEBUG,"backoff","{"+this.id+"} "+r)}runTimer(e){var t,r;this.trace("runTimer(delay="+e+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},e),this.hasRef||null===(r=(t=this.timerId).unref)||void 0===r||r.call(t)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);const e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;var r,n;this.nextDelay=e+(r=-t,n=t,Math.random()*(n-r)+r)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){const e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,null===(t=(e=this.timerId).ref)||void 0===t||t.call(e)}unref(){var e,t;this.hasRef=!1,null===(t=(e=this.timerId).unref)||void 0===t||t.call(e)}getEndTime(){return this.endTime}}return backoffTimeout.BackoffTimeout=r,r.nextId=0,backoffTimeout}var loadBalancerChildHandler={},hasRequiredLoadBalancerChildHandler,hasRequiredResolvingLoadBalancer;function requireLoadBalancerChildHandler(){if(hasRequiredLoadBalancerChildHandler)return loadBalancerChildHandler;hasRequiredLoadBalancerChildHandler=1,Object.defineProperty(loadBalancerChildHandler,"__esModule",{value:!0}),loadBalancerChildHandler.ChildLoadBalancerHandler=void 0;const e=requireLoadBalancer(),t=requireConnectivityState();return loadBalancerChildHandler.ChildLoadBalancerHandler=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(e){this.parent=e,this.child=null}createSubchannel(e,t){return this.parent.channelControlHelper.createSubchannel(e,t)}updateState(e,r,n){var i;if(this.calledByPendingChild()){if(e===t.ConnectivityState.CONNECTING)return;null===(i=this.parent.currentChild)||void 0===i||i.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(e,r,n)}requestReresolution(){var e;const t=null!==(e=this.parent.pendingChild)&&void 0!==e?e:this.parent.currentChild;this.child===t&&this.parent.channelControlHelper.requestReresolution()}setChild(e){this.child=e}addChannelzChild(e){this.parent.channelControlHelper.addChannelzChild(e)}removeChannelzChild(e){this.parent.channelControlHelper.removeChannelzChild(e)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(t,r,n,i){let s;if(null===this.currentChild||null===this.latestConfig||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,r)){const t=new this.ChildPolicyHelper(this),n=(0,e.createLoadBalancer)(r,t);t.setChild(n),null===this.currentChild?(this.currentChild=n,s=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=n,s=this.pendingChild)}else s=null===this.pendingChild?this.currentChild:this.pendingChild;return this.latestConfig=r,s.updateAddressList(t,r,n,i)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return"child_load_balancer_helper"}},loadBalancerChildHandler}function requireResolvingLoadBalancer(){if(hasRequiredResolvingLoadBalancer)return resolvingLoadBalancer;hasRequiredResolvingLoadBalancer=1,Object.defineProperty(resolvingLoadBalancer,"__esModule",{value:!0}),resolvingLoadBalancer.ResolvingLoadBalancer=void 0;const e=requireLoadBalancer(),t=requireServiceConfig(),r=requireConnectivityState(),n=requireResolver(),i=requirePicker(),s=requireBackoffTimeout(),a=requireConstants(),o=requireMetadata(),l=requireLogging(),c=requireConstants(),u=requireUriParser(),h=requireLoadBalancerChildHandler();function d(e){l.trace(c.LogVerbosity.DEBUG,"resolving_load_balancer",e)}const p=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function f(e,t,r,n){for(const i of r.name)switch(n){case"EMPTY":if(!i.service&&!i.method)return!0;break;case"SERVICE":if(i.service===e&&!i.method)return!0;break;case"SERVICE_AND_METHOD":if(i.service===e&&i.method===t)return!0}return!1}function g(e,t,r,n){for(const i of r)if(f(e,t,i,n))return i;return null}return resolvingLoadBalancer.ResolvingLoadBalancer=class{constructor(e,a,o,l,c){this.target=e,this.channelControlHelper=a,this.channelOptions=o,this.onSuccessfulResolution=l,this.onFailedResolution=c,this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new i.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,o["grpc.service_config"]?this.defaultServiceConfig=(0,t.validateServiceConfig)(JSON.parse(o["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(r.ConnectivityState.IDLE,new i.QueuePicker(this),null),this.childLoadBalancer=new h.ChildLoadBalancerHandler({createSubchannel:a.createSubchannel.bind(a),requestReresolution:()=>{this.backoffTimeout.isRunning()?(d("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(e,t,r)=>{this.latestChildState=e,this.latestChildPicker=t,this.latestChildErrorMessage=r,this.updateState(e,t,r)},addChannelzChild:a.addChannelzChild.bind(a),removeChannelzChild:a.removeChannelzChild.bind(a)}),this.innerResolver=(0,n.createResolver)(e,this.handleResolverResult.bind(this),o);const u={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new s.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},u),this.backoffTimeout.unref()}handleResolverResult(t,r,i,s){var l,c;this.backoffTimeout.stop(),this.backoffTimeout.reset();let u=!0,h=null;if(null===i?h=this.defaultServiceConfig:i.ok?h=i.value:null!==this.previousServiceConfig?h=this.previousServiceConfig:(u=!1,this.handleResolutionFailure(i.error)),null!==h){const n=null!==(l=null==h?void 0:h.loadBalancingConfig)&&void 0!==l?l:[],i=(0,e.selectLbConfigFromList)(n,!0);null===i?(u=!1,this.handleResolutionFailure({code:a.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new o.Metadata})):u=this.childLoadBalancer.updateAddressList(t,i,Object.assign(Object.assign({},this.channelOptions),r),s)}return u&&this.onSuccessfulResolution(h,null!==(c=r[n.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])&&void 0!==c?c:function(e){return{invoke(t,r){var n,i;const s=t.split("/").filter(e=>e.length>0),o=null!==(n=s[0])&&void 0!==n?n:"",l=null!==(i=s[1])&&void 0!==i?i:"";if(e&&e.methodConfig)for(const t of p){const r=g(o,l,e.methodConfig,t);if(r)return{methodConfig:r,pickInformation:{},status:a.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:a.Status.OK,dynamicFilterFactories:[]}},unref(){}}}(h)),u}updateResolution(){this.innerResolver.updateResolution(),this.currentState===r.ConnectivityState.IDLE&&this.updateState(r.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,n){d((0,u.uriToString)(this.target)+" "+r.ConnectivityState[this.currentState]+" -> "+r.ConnectivityState[e]),e===r.ConnectivityState.IDLE&&(t=new i.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,n)}handleResolutionFailure(e){this.latestChildState===r.ConnectivityState.IDLE&&(this.updateState(r.ConnectivityState.TRANSIENT_FAILURE,new i.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){this.currentState!==r.ConnectivityState.IDLE&&this.currentState!==r.ConnectivityState.TRANSIENT_FAILURE||(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new i.QueuePicker(this),this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}},resolvingLoadBalancer}var subchannelPool={},channelOptions={},hasRequiredChannelOptions;function requireChannelOptions(){if(hasRequiredChannelOptions)return channelOptions;return hasRequiredChannelOptions=1,Object.defineProperty(channelOptions,"__esModule",{value:!0}),channelOptions.recognizedOptions=void 0,channelOptions.channelOptionsEqual=function(e,t){const r=Object.keys(e).sort(),n=Object.keys(t).sort();if(r.length!==n.length)return!1;for(let i=0;i<r.length;i+=1){if(r[i]!==n[i])return!1;if(e[r[i]]!==t[n[i]])return!1}return!0},channelOptions.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0,"grpc.server_call_metric_recording":!0},channelOptions}var subchannel={},subchannelAddress={},hasRequiredSubchannelAddress;function requireSubchannelAddress(){if(hasRequiredSubchannelAddress)return subchannelAddress;hasRequiredSubchannelAddress=1,Object.defineProperty(subchannelAddress,"__esModule",{value:!0}),subchannelAddress.EndpointMap=void 0,subchannelAddress.isTcpSubchannelAddress=t,subchannelAddress.subchannelAddressEqual=r,subchannelAddress.subchannelAddressToString=n,subchannelAddress.stringToSubchannelAddress=function(t,r){return(0,e.isIP)(t)?{host:t,port:null!=r?r:i}:{path:t}},subchannelAddress.endpointEqual=function(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(let n=0;n<e.addresses.length;n++)if(!r(e.addresses[n],t.addresses[n]))return!1;return!0},subchannelAddress.endpointToString=function(e){return"["+e.addresses.map(n).join(", ")+"]"},subchannelAddress.endpointHasAddress=s;const e=require$$0$3;function t(e){return"port"in e}function r(e,r){return!e&&!r||!(!e||!r)&&(t(e)?t(r)&&e.host===r.host&&e.port===r.port:!t(r)&&e.path===r.path)}function n(r){return t(r)?(0,e.isIPv6)(r.host)?"["+r.host+"]:"+r.port:r.host+":"+r.port:r.path}const i=443;function s(e,t){for(const n of e.addresses)if(r(n,t))return!0;return!1}function a(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(const n of e.addresses){let e=!1;for(const i of t.addresses)if(r(n,i)){e=!0;break}if(!e)return!1}return!0}return subchannelAddress.EndpointMap=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(const t of this.map)if(s(t.key,e))return t.value}deleteMissing(e){const t=[];for(const r of this.map){let n=!1;for(const t of e)a(t,r.key)&&(n=!0);n||(t.push(r.value),this.map.delete(r))}return t}get(e){for(const t of this.map)if(a(e,t.key))return t.value}set(e,t){for(const r of this.map)if(a(e,r.key))return void(r.value=t);this.map.add({key:e,value:t})}delete(e){for(const t of this.map)if(a(e,t.key))return void this.map.delete(t)}has(e){for(const t of this.map)if(a(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(const e of this.map)yield e.key}*values(){for(const e of this.map)yield e.value}*entries(){for(const e of this.map)yield[e.key,e.value]}},subchannelAddress}var channelz={},extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},extendStatics(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function __generator(e,t){var r,n,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return l([e,t])}}function l(o){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}"function"==typeof SuppressedError&&SuppressedError;var TreeNode=function(){function e(e,t,r){void 0===r&&(r=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=r}return e.prototype.v=function(){var e=this,t=e.h.h===e;if(t&&1===e.l)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var r=e.h;r.t===e;)r=(e=r).h;e=r}return e},e.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}for(var t=e.h;t.i===e;)t=(e=t).h;return e.i!==t?t:e},e.prototype.T=function(){var e=this.h,t=this.i,r=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=r,r&&(r.h=this),t},e.prototype.I=function(){var e=this.h,t=this.t,r=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=r,r&&(r.h=this),t},e}(),TreeNodeEnableIndex=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.O=1,t}return __extends(t,e),t.prototype.T=function(){var t=e.prototype.T.call(this);return this.M(),t.M(),t},t.prototype.I=function(){var t=e.prototype.I.call(this);return this.M(),t.M(),t},t.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},t}(TreeNode),ContainerIterator=function(){function e(e){void 0===e&&(e=0),this.iteratorType=e}return e.prototype.equals=function(e){return this.C===e.C},e}(),Base=function(){function e(){this._=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),e.prototype.size=function(){return this._},e.prototype.empty=function(){return 0===this._},e}(),Container=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(Base);function throwIteratorAccessError(){throw new RangeError("Iterator access denied!")}var TreeContainer=function(e){function t(t,r){void 0===t&&(t=function(e,t){return e<t?-1:e>t?1:0}),void 0===r&&(r=!1);var n=e.call(this)||this;return n.N=void 0,n.g=t,n.enableIndex=r,n.S=r?TreeNodeEnableIndex:TreeNode,n.A=new n.S,n}return __extends(t,e),t.prototype.m=function(e,t){for(var r=this.A;e;){var n=this.g(e.u,t);if(n<0)e=e.i;else{if(!(n>0))return e;r=e,e=e.t}}return r},t.prototype.B=function(e,t){for(var r=this.A;e;){this.g(e.u,t)<=0?e=e.i:(r=e,e=e.t)}return r},t.prototype.j=function(e,t){for(var r=this.A;e;){var n=this.g(e.u,t);if(n<0)r=e,e=e.i;else{if(!(n>0))return e;e=e.t}}return r},t.prototype.k=function(e,t){for(var r=this.A;e;){this.g(e.u,t)<0?(r=e,e=e.i):e=e.t}return r},t.prototype.R=function(e){for(;;){var t,r=e.h;if(r===this.A)return;if(1===e.l)return void(e.l=0);if(e===r.t)if(1===(t=r.i).l)t.l=0,r.l=1,r===this.N?this.N=r.T():r.T();else{if(t.i&&1===t.i.l)return t.l=r.l,r.l=0,t.i.l=0,void(r===this.N?this.N=r.T():r.T());t.t&&1===t.t.l?(t.l=1,t.t.l=0,t.I()):(t.l=1,e=r)}else if(1===(t=r.t).l)t.l=0,r.l=1,r===this.N?this.N=r.I():r.I();else{if(t.t&&1===t.t.l)return t.l=r.l,r.l=0,t.t.l=0,void(r===this.N?this.N=r.I():r.I());t.i&&1===t.i.l?(t.l=1,t.i.l=0,t.T()):(t.l=1,e=r)}}},t.prototype.G=function(e){if(1!==this._){for(var t=e;t.t||t.i;){if(t.i)for(t=t.i;t.t;)t=t.t;else t=t.t;var r=e.u;e.u=t.u,t.u=r;var n=e.o;e.o=t.o,t.o=n,e=t}this.A.t===t?this.A.t=t.h:this.A.i===t&&(this.A.i=t.h),this.R(t);var i=t.h;if(t===i.t?i.t=void 0:i.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;i!==this.A;)i.O-=1,i=i.h}else this.clear()},t.prototype.P=function(e){for(var t="number"==typeof e?e:void 0,r="function"==typeof e?e:void 0,n=void 0===e?[]:void 0,i=0,s=this.N,a=[];a.length||s;)if(s)a.push(s),s=s.t;else{if(s=a.pop(),i===t)return s;n&&n.push(s),r&&r(s,i,this),i+=1,s=s.i}return n},t.prototype.q=function(e){for(;;){var t=e.h;if(0===t.l)return;var r=t.h;if(t===r.t){if((n=r.i)&&1===n.l){if(n.l=t.l=0,r===this.N)return;r.l=1,e=r;continue}if(e!==t.i)return t.l=0,r===this.N?this.N=r.I():r.I(),void(r.l=1);e.l=0,e.t&&(e.t.h=t),e.i&&(e.i.h=r),t.i=e.t,r.t=e.i,e.t=t,e.i=r,r===this.N?(this.N=e,this.A.h=e):(i=r.h).t===r?i.t=e:i.i=e,e.h=r.h,t.h=e,r.h=e,r.l=1}else{var n,i;if((n=r.t)&&1===n.l){if(n.l=t.l=0,r===this.N)return;r.l=1,e=r;continue}if(e!==t.t)return t.l=0,r===this.N?this.N=r.T():r.T(),void(r.l=1);e.l=0,e.t&&(e.t.h=r),e.i&&(e.i.h=t),r.i=e.t,t.t=e.i,e.t=r,e.i=t,r===this.N?(this.N=e,this.A.h=e):(i=r.h).t===r?i.t=e:i.i=e,e.h=r.h,t.h=e,r.h=e,r.l=1}return void(this.enableIndex&&(t.M(),r.M(),e.M()))}},t.prototype.D=function(e,t,r){if(void 0===this.N)return this._+=1,this.N=new this.S(e,t,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var n,i=this.A.t,s=this.g(i.u,e);if(0===s)return i.o=t,this._;if(s>0)i.t=new this.S(e,t),i.t.h=i,n=i.t,this.A.t=n;else{var a=this.A.i,o=this.g(a.u,e);if(0===o)return a.o=t,this._;if(o<0)a.i=new this.S(e,t),a.i.h=a,n=a.i,this.A.i=n;else{if(void 0!==r){var l=r.C;if(l!==this.A){var c=this.g(l.u,e);if(0===c)return l.o=t,this._;if(c>0){var u=l.v(),h=this.g(u.u,e);if(0===h)return u.o=t,this._;h<0&&(n=new this.S(e,t),void 0===u.i?(u.i=n,n.h=u):(l.t=n,n.h=l))}}}if(void 0===n)for(n=this.N;;){var d=this.g(n.u,e);if(d>0){if(void 0===n.t){n.t=new this.S(e,t),n.t.h=n,n=n.t;break}n=n.t}else{if(!(d<0))return n.o=t,this._;if(void 0===n.i){n.i=new this.S(e,t),n.i.h=n,n=n.i;break}n=n.i}}}}if(this.enableIndex)for(var p=n.h;p!==this.A;)p.O+=1,p=p.h;return this.q(n),this._+=1,this._},t.prototype.F=function(e,t){for(;e;){var r=this.g(e.u,t);if(r<0)e=e.i;else{if(!(r>0))return e;e=e.t}}return e||this.A},t.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},t.prototype.updateKeyByIterator=function(e,t){var r=e.C;if(r===this.A&&throwIteratorAccessError(),1===this._)return r.u=t,!0;var n=r.p().u;if(r===this.A.t)return this.g(n,t)>0&&(r.u=t,!0);var i=r.v().u;return r===this.A.i?this.g(i,t)<0&&(r.u=t,!0):!(this.g(i,t)>=0||this.g(n,t)<=0)&&(r.u=t,!0)},t.prototype.eraseElementByPos=function(e){if(e<0||e>this._-1)throw new RangeError;var t=this.P(e);return this.G(t),this._},t.prototype.eraseElementByKey=function(e){if(0===this._)return!1;var t=this.F(this.N,e);return t!==this.A&&(this.G(t),!0)},t.prototype.eraseElementByIterator=function(e){var t=e.C;t===this.A&&throwIteratorAccessError();var r=void 0===t.i;return 0===e.iteratorType?r&&e.next():r&&void 0!==t.t||e.next(),this.G(t),e},t.prototype.getHeight=function(){if(0===this._)return 0;return function e(t){return t?Math.max(e(t.t),e(t.i))+1:0}(this.N)},t}(Container),TreeIterator=function(e){function t(t,r,n){var i=e.call(this,n)||this;return i.C=t,i.A=r,0===i.iteratorType?(i.pre=function(){return this.C===this.A.t&&throwIteratorAccessError(),this.C=this.C.v(),this},i.next=function(){return this.C===this.A&&throwIteratorAccessError(),this.C=this.C.p(),this}):(i.pre=function(){return this.C===this.A.i&&throwIteratorAccessError(),this.C=this.C.p(),this},i.next=function(){return this.C===this.A&&throwIteratorAccessError(),this.C=this.C.v(),this}),i}return __extends(t,e),Object.defineProperty(t.prototype,"index",{get:function(){var e=this.C,t=this.A.h;if(e===this.A)return t?t.O-1:0;var r=0;for(e.t&&(r+=e.t.O);e!==t;){var n=e.h;e===n.i&&(r+=1,n.t&&(r+=n.t.O)),e=n}return r},enumerable:!1,configurable:!0}),t.prototype.isAccessible=function(){return this.C!==this.A},t}(ContainerIterator),OrderedMapIterator=function(e){function t(t,r,n,i){var s=e.call(this,t,r,i)||this;return s.container=n,s}return __extends(t,e),Object.defineProperty(t.prototype,"pointer",{get:function(){this.C===this.A&&throwIteratorAccessError();var e=this;return new Proxy([],{get:function(t,r){return"0"===r?e.C.u:"1"===r?e.C.o:(t[0]=e.C.u,t[1]=e.C.o,t[r])},set:function(t,r,n){if("1"!==r)throw new TypeError("prop must be 1");return e.C.o=n,!0}})},enumerable:!1,configurable:!0}),t.prototype.copy=function(){return new t(this.C,this.A,this.container,this.iteratorType)},t}(TreeIterator),OrderedMap=function(e){function t(t,r,n){void 0===t&&(t=[]);var i=e.call(this,r,n)||this,s=i;return t.forEach(function(e){s.setElement(e[0],e[1])}),i}return __extends(t,e),t.prototype.begin=function(){return new OrderedMapIterator(this.A.t||this.A,this.A,this)},t.prototype.end=function(){return new OrderedMapIterator(this.A,this.A,this)},t.prototype.rBegin=function(){return new OrderedMapIterator(this.A.i||this.A,this.A,this,1)},t.prototype.rEnd=function(){return new OrderedMapIterator(this.A,this.A,this,1)},t.prototype.front=function(){if(0!==this._){var e=this.A.t;return[e.u,e.o]}},t.prototype.back=function(){if(0!==this._){var e=this.A.i;return[e.u,e.o]}},t.prototype.lowerBound=function(e){var t=this.m(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.upperBound=function(e){var t=this.B(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.reverseLowerBound=function(e){var t=this.j(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.reverseUpperBound=function(e){var t=this.k(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.forEach=function(e){this.P(function(t,r,n){e([t.u,t.o],r,n)})},t.prototype.setElement=function(e,t,r){return this.D(e,t,r)},t.prototype.getElementByPos=function(e){if(e<0||e>this._-1)throw new RangeError;var t=this.P(e);return[t.u,t.o]},t.prototype.find=function(e){var t=this.F(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.getElementByKey=function(e){return this.F(this.N,e).o},t.prototype.union=function(e){var t=this;return e.forEach(function(e){t.setElement(e[0],e[1])}),this._},t.prototype[Symbol.iterator]=function(){var e,t,r,n;return __generator(this,function(i){switch(i.label){case 0:e=this._,t=this.P(),r=0,i.label=1;case 1:return r<e?[4,[(n=t[r]).u,n.o]]:[3,4];case 2:i.sent(),i.label=3;case 3:return++r,[3,1];case 4:return[2]}})},t}(TreeContainer),esm=Object.freeze({__proto__:null,OrderedMap:OrderedMap}),require$$1=getAugmentedNamespace(esm),admin={},hasRequiredAdmin;function requireAdmin(){if(hasRequiredAdmin)return admin;hasRequiredAdmin=1,Object.defineProperty(admin,"__esModule",{value:!0}),admin.registerAdminService=function(t,r){e.push({getServiceDefinition:t,getHandlers:r})},admin.addAdminServicesToServer=function(t){for(const{getServiceDefinition:r,getHandlers:n}of e)t.addService(r(),n())};const e=[];return admin}var makeClient={},client={},call={},hasRequiredCall;function requireCall(){if(hasRequiredCall)return call;hasRequiredCall=1,Object.defineProperty(call,"__esModule",{value:!0}),call.ClientDuplexStreamImpl=call.ClientWritableStreamImpl=call.ClientReadableStreamImpl=call.ClientUnaryCallImpl=void 0,call.callErrorFromStatus=function(e,t){const n=`${e.code} ${r.Status[e.code]}: ${e.details}`,i=new Error(n),s=`${i.stack}\nfor call at\n${t}`;return Object.assign(new Error(n),e,{stack:s})};const e=require$$0$4,t=require$$1$2,r=requireConstants();class n extends e.EventEmitter{constructor(){super()}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}}call.ClientUnaryCallImpl=n;class i extends t.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}_read(e){var t;null===(t=this.call)||void 0===t||t.startRead()}}call.ClientReadableStreamImpl=i;class s extends t.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}_write(e,t,r){var n;const i={callback:r},s=Number(t);Number.isNaN(s)||(i.flags=s),null===(n=this.call)||void 0===n||n.sendMessageWithContext(i,e)}_final(e){var t;null===(t=this.call)||void 0===t||t.halfClose(),e()}}call.ClientWritableStreamImpl=s;class a extends t.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}_read(e){var t;null===(t=this.call)||void 0===t||t.startRead()}_write(e,t,r){var n;const i={callback:r},s=Number(t);Number.isNaN(s)||(i.flags=s),null===(n=this.call)||void 0===n||n.sendMessageWithContext(i,e)}_final(e){var t;null===(t=this.call)||void 0===t||t.halfClose(),e()}}return call.ClientDuplexStreamImpl=a,call}var clientInterceptors={},callInterface={},hasRequiredCallInterface,hasRequiredClientInterceptors,hasRequiredClient,hasRequiredMakeClient;function requireCallInterface(){if(hasRequiredCallInterface)return callInterface;hasRequiredCallInterface=1,Object.defineProperty(callInterface,"__esModule",{value:!0}),callInterface.InterceptingListenerImpl=void 0,callInterface.statusOrFromValue=function(e){return{ok:!0,value:e}},callInterface.statusOrFromError=function(t){var r;return{ok:!1,error:Object.assign(Object.assign({},t),{metadata:null!==(r=t.metadata)&&void 0!==r?r:new e.Metadata})}},callInterface.isInterceptingListener=function(e){return void 0!==e.onReceiveMetadata&&1===e.onReceiveMetadata.length};const e=requireMetadata();return callInterface.InterceptingListenerImpl=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,e=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(e),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,e=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=e,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(e),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,e=>{this.processingMetadata||this.processingMessage?this.pendingStatus=e:this.nextListener.onReceiveStatus(e)})}},callInterface}function requireClientInterceptors(){if(hasRequiredClientInterceptors)return clientInterceptors;hasRequiredClientInterceptors=1,Object.defineProperty(clientInterceptors,"__esModule",{value:!0}),clientInterceptors.InterceptingCall=clientInterceptors.RequesterBuilder=clientInterceptors.ListenerBuilder=clientInterceptors.InterceptorConfigurationError=void 0,clientInterceptors.getInterceptingCall=function(e,t,r,n){if(e.clientInterceptors.length>0&&e.clientInterceptorProviders.length>0)throw new i("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(e.callInterceptors.length>0&&e.callInterceptorProviders.length>0)throw new i("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let s=[];s=e.callInterceptors.length>0||e.callInterceptorProviders.length>0?[].concat(e.callInterceptors,e.callInterceptorProviders.map(e=>e(t))).filter(e=>e):[].concat(e.clientInterceptors,e.clientInterceptorProviders.map(e=>e(t))).filter(e=>e);const a=Object.assign({},r,{method_definition:t}),o=s.reduceRight((e,t)=>r=>t(r,e),e=>u(n,e,t));return o(a)};const e=requireMetadata(),t=requireCallInterface(),r=requireConstants(),n=requireError();class i extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,i)}}clientInterceptors.InterceptorConfigurationError=i;clientInterceptors.ListenerBuilder=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};clientInterceptors.RequesterBuilder=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};const s={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveStatus:(e,t)=>{t(e)}},a={start:(e,t,r)=>{r(e,t)},sendMessage:(e,t)=>{t(e)},halfClose:e=>{e()},cancel:e=>{e()}};clientInterceptors.InterceptingCall=class{constructor(e,t){var r,n,i,s;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,this.requester=t?{start:null!==(r=t.start)&&void 0!==r?r:a.start,sendMessage:null!==(n=t.sendMessage)&&void 0!==n?n:a.sendMessage,halfClose:null!==(i=t.halfClose)&&void 0!==i?i:a.halfClose,cancel:null!==(s=t.cancel)&&void 0!==s?s:a.cancel}:a}cancelWithStatus(e,t){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,r){var n,i,a,o,l,c;const u={onReceiveMetadata:null!==(i=null===(n=null==r?void 0:r.onReceiveMetadata)||void 0===n?void 0:n.bind(r))&&void 0!==i?i:e=>{},onReceiveMessage:null!==(o=null===(a=null==r?void 0:r.onReceiveMessage)||void 0===a?void 0:a.bind(r))&&void 0!==o?o:e=>{},onReceiveStatus:null!==(c=null===(l=null==r?void 0:r.onReceiveStatus)||void 0===l?void 0:l.bind(r))&&void 0!==c?c:e=>{}};this.processingMetadata=!0,this.requester.start(e,u,(e,r)=>{var n,i,a;let o;if(this.processingMetadata=!1,(0,t.isInterceptingListener)(r))o=r;else{const e={onReceiveMetadata:null!==(n=r.onReceiveMetadata)&&void 0!==n?n:s.onReceiveMetadata,onReceiveMessage:null!==(i=r.onReceiveMessage)&&void 0!==i?i:s.onReceiveMessage,onReceiveStatus:null!==(a=r.onReceiveStatus)&&void 0!==a?a:s.onReceiveStatus};o=new t.InterceptingListenerImpl(e,u)}this.nextCall.start(e,o),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,r=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,r),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}getAuthContext(){return this.nextCall.getAuthContext()}};class o{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let i;try{i=this.methodDefinition.requestSerialize(t)}catch(e){return void this.call.cancelWithStatus(r.Status.INTERNAL,`Request message serialization failure: ${(0,n.getErrorMessage)(e)}`)}this.call.sendMessageWithContext(e,i)}sendMessage(e){this.sendMessageWithContext({},e)}start(t,i){let s=null;this.call.start(t,{onReceiveMetadata:e=>{var t;null===(t=null==i?void 0:i.onReceiveMetadata)||void 0===t||t.call(i,e)},onReceiveMessage:t=>{var a;let o;try{o=this.methodDefinition.responseDeserialize(t)}catch(t){return s={code:r.Status.INTERNAL,details:`Response message parsing error: ${(0,n.getErrorMessage)(t)}`,metadata:new e.Metadata},void this.call.cancelWithStatus(s.code,s.details)}null===(a=null==i?void 0:i.onReceiveMessage)||void 0===a||a.call(i,o)},onReceiveStatus:e=>{var t,r;s?null===(t=null==i?void 0:i.onReceiveStatus)||void 0===t||t.call(i,s):null===(r=null==i?void 0:i.onReceiveStatus)||void 0===r||r.call(i,e)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}}class l extends o{constructor(e,t){super(e,t)}start(e,t){var r,n;let i=!1;const s={onReceiveMetadata:null!==(n=null===(r=null==t?void 0:t.onReceiveMetadata)||void 0===r?void 0:r.bind(t))&&void 0!==n?n:e=>{},onReceiveMessage:e=>{var r;i=!0,null===(r=null==t?void 0:t.onReceiveMessage)||void 0===r||r.call(t,e)},onReceiveStatus:e=>{var r,n;i||null===(r=null==t?void 0:t.onReceiveMessage)||void 0===r||r.call(t,null),null===(n=null==t?void 0:t.onReceiveStatus)||void 0===n||n.call(t,e)}};super.start(e,s),this.call.startRead()}}class c extends o{}function u(e,t,r){const n=function(e,t,r){var n,i;const s=null!==(n=r.deadline)&&void 0!==n?n:1/0,a=r.host,o=null!==(i=r.parent)&&void 0!==i?i:null,l=r.propagate_flags,c=r.credentials,u=e.createCall(t,s,a,o,l);return c&&u.setCredentials(c),u}(e,r.path,t);return r.responseStream?new c(n,r):new l(n,r)}return clientInterceptors}function requireClient(){if(hasRequiredClient)return client;hasRequiredClient=1,Object.defineProperty(client,"__esModule",{value:!0}),client.Client=void 0;const e=requireCall(),t=requireChannel(),r=requireConnectivityState(),n=requireConstants(),i=requireMetadata(),s=requireClientInterceptors(),a=Symbol(),o=Symbol(),l=Symbol(),c=Symbol();function u(e){return"function"==typeof e}function h(e){var t;return(null===(t=e.stack)||void 0===t?void 0:t.split("\n").slice(1).join("\n"))||"no stack trace available"}return client.Client=class{constructor(e,r,n={}){var i,s;if(n=Object.assign({},n),this[o]=null!==(i=n.interceptors)&&void 0!==i?i:[],delete n.interceptors,this[l]=null!==(s=n.interceptor_providers)&&void 0!==s?s:[],delete n.interceptor_providers,this[o].length>0&&this[l].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[c]=n.callInvocationTransformer,delete n.callInvocationTransformer,n.channelOverride)this[a]=n.channelOverride;else if(n.channelFactoryOverride){const t=n.channelFactoryOverride;delete n.channelFactoryOverride,this[a]=t(e,r,n)}else this[a]=new t.ChannelImplementation(e,r,n)}close(){this[a].close()}getChannel(){return this[a]}waitForReady(e,t){const n=i=>{if(i)return void t(new Error("Failed to connect before the deadline"));let s;try{s=this[a].getConnectivityState(!0)}catch(e){return void t(new Error("The channel has been closed"))}if(s===r.ConnectivityState.READY)t();else try{this[a].watchConnectivityState(s,e,n)}catch(e){t(new Error("The channel has been closed"))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,t,r){if(u(e))return{metadata:new i.Metadata,options:{},callback:e};if(u(t))return e instanceof i.Metadata?{metadata:e,options:{},callback:t}:{metadata:new i.Metadata,options:e,callback:t};if(!(e instanceof i.Metadata&&t instanceof Object&&u(r)))throw new Error("Incorrect arguments passed");return{metadata:e,options:t,callback:r}}makeUnaryRequest(t,r,i,u,d,p,f){var g,v;const m=this.checkOptionalUnaryResponseArguments(d,p,f),A={path:t,requestStream:!1,responseStream:!1,requestSerialize:r,responseDeserialize:i};let y={argument:u,metadata:m.metadata,call:new e.ClientUnaryCallImpl,channel:this[a],methodDefinition:A,callOptions:m.options,callback:m.callback};this[c]&&(y=this[c](y));const C=y.call,S={clientInterceptors:this[o],clientInterceptorProviders:this[l],callInterceptors:null!==(g=y.callOptions.interceptors)&&void 0!==g?g:[],callInterceptorProviders:null!==(v=y.callOptions.interceptor_providers)&&void 0!==v?v:[]},E=(0,s.getInterceptingCall)(S,y.methodDefinition,y.callOptions,y.channel);C.call=E;let _=null,b=!1,T=new Error;return E.start(y.metadata,{onReceiveMetadata:e=>{C.emit("metadata",e)},onReceiveMessage(e){null!==_&&E.cancelWithStatus(n.Status.UNIMPLEMENTED,"Too many responses received"),_=e},onReceiveStatus(t){if(!b){if(b=!0,t.code===n.Status.OK)if(null===_){const r=h(T);y.callback((0,e.callErrorFromStatus)({code:n.Status.UNIMPLEMENTED,details:"No message received",metadata:t.metadata},r))}else y.callback(null,_);else{const r=h(T);y.callback((0,e.callErrorFromStatus)(t,r))}T=null,C.emit("status",t)}}}),E.sendMessage(u),E.halfClose(),C}makeClientStreamRequest(t,r,i,u,d,p){var f,g;const v=this.checkOptionalUnaryResponseArguments(u,d,p),m={path:t,requestStream:!0,responseStream:!1,requestSerialize:r,responseDeserialize:i};let A={metadata:v.metadata,call:new e.ClientWritableStreamImpl(r),channel:this[a],methodDefinition:m,callOptions:v.options,callback:v.callback};this[c]&&(A=this[c](A));const y=A.call,C={clientInterceptors:this[o],clientInterceptorProviders:this[l],callInterceptors:null!==(f=A.callOptions.interceptors)&&void 0!==f?f:[],callInterceptorProviders:null!==(g=A.callOptions.interceptor_providers)&&void 0!==g?g:[]},S=(0,s.getInterceptingCall)(C,A.methodDefinition,A.callOptions,A.channel);y.call=S;let E=null,_=!1,b=new Error;return S.start(A.metadata,{onReceiveMetadata:e=>{y.emit("metadata",e)},onReceiveMessage(e){null!==E&&S.cancelWithStatus(n.Status.UNIMPLEMENTED,"Too many responses received"),E=e,S.startRead()},onReceiveStatus(t){if(!_){if(_=!0,t.code===n.Status.OK)if(null===E){const r=h(b);A.callback((0,e.callErrorFromStatus)({code:n.Status.UNIMPLEMENTED,details:"No message received",metadata:t.metadata},r))}else A.callback(null,E);else{const r=h(b);A.callback((0,e.callErrorFromStatus)(t,r))}b=null,y.emit("status",t)}}}),y}checkMetadataAndOptions(e,t){let r,n;return e instanceof i.Metadata?(r=e,n=t||{}):(n=e||{},r=new i.Metadata),{metadata:r,options:n}}makeServerStreamRequest(t,r,i,u,d,p){var f,g;const v=this.checkMetadataAndOptions(d,p),m={path:t,requestStream:!1,responseStream:!0,requestSerialize:r,responseDeserialize:i};let A={argument:u,metadata:v.metadata,call:new e.ClientReadableStreamImpl(i),channel:this[a],methodDefinition:m,callOptions:v.options};this[c]&&(A=this[c](A));const y=A.call,C={clientInterceptors:this[o],clientInterceptorProviders:this[l],callInterceptors:null!==(f=A.callOptions.interceptors)&&void 0!==f?f:[],callInterceptorProviders:null!==(g=A.callOptions.interceptor_providers)&&void 0!==g?g:[]},S=(0,s.getInterceptingCall)(C,A.methodDefinition,A.callOptions,A.channel);y.call=S;let E=!1,_=new Error;return S.start(A.metadata,{onReceiveMetadata(e){y.emit("metadata",e)},onReceiveMessage(e){y.push(e)},onReceiveStatus(t){if(!E){if(E=!0,y.push(null),t.code!==n.Status.OK){const r=h(_);y.emit("error",(0,e.callErrorFromStatus)(t,r))}_=null,y.emit("status",t)}}}),S.sendMessage(u),S.halfClose(),y}makeBidiStreamRequest(t,r,i,u,d){var p,f;const g=this.checkMetadataAndOptions(u,d),v={path:t,requestStream:!0,responseStream:!0,requestSerialize:r,responseDeserialize:i};let m={metadata:g.metadata,call:new e.ClientDuplexStreamImpl(r,i),channel:this[a],methodDefinition:v,callOptions:g.options};this[c]&&(m=this[c](m));const A=m.call,y={clientInterceptors:this[o],clientInterceptorProviders:this[l],callInterceptors:null!==(p=m.callOptions.interceptors)&&void 0!==p?p:[],callInterceptorProviders:null!==(f=m.callOptions.interceptor_providers)&&void 0!==f?f:[]},C=(0,s.getInterceptingCall)(y,m.methodDefinition,m.callOptions,m.channel);A.call=C;let S=!1,E=new Error;return C.start(m.metadata,{onReceiveMetadata(e){A.emit("metadata",e)},onReceiveMessage(e){A.push(e)},onReceiveStatus(t){if(!S){if(S=!0,A.push(null),t.code!==n.Status.OK){const r=h(E);A.emit("error",(0,e.callErrorFromStatus)(t,r))}E=null,A.emit("status",t)}}}),A}},client}function requireMakeClient(){if(hasRequiredMakeClient)return makeClient;hasRequiredMakeClient=1,Object.defineProperty(makeClient,"__esModule",{value:!0}),makeClient.makeClientConstructor=n,makeClient.loadPackageDefinition=function(e){const t={};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const a=e[s],o=s.split(".");if(o.some(e=>r(e)))continue;const l=o[o.length-1];let c=t;for(const e of o.slice(0,-1))c[e]||(c[e]={}),c=c[e];i(a)?c[l]=a:c[l]=n(a,l)}return t};const e=requireClient(),t={unary:e.Client.prototype.makeUnaryRequest,server_stream:e.Client.prototype.makeServerStreamRequest,client_stream:e.Client.prototype.makeClientStreamRequest,bidi:e.Client.prototype.makeBidiStreamRequest};function r(e){return["__proto__","prototype","constructor"].includes(e)}function n(n,i,s){class a extends e.Client{}return Object.keys(n).forEach(e=>{if(r(e))return;const i=n[e];let s;if("string"==typeof e&&"$"===e.charAt(0))throw new Error("Method names cannot start with $");s=i.requestStream?i.responseStream?"bidi":"client_stream":i.responseStream?"server_stream":"unary";const o=i.requestSerialize,l=i.responseDeserialize,c=function(e,t,r,n){return function(...i){return e.call(this,t,r,n,...i)}}(t[s],i.path,o,l);a.prototype[e]=c,Object.assign(a.prototype[e],i),i.originalName&&!r(i.originalName)&&(a.prototype[i.originalName]=a.prototype[e])}),a.service=n,a.serviceName=i,a}function i(e){return"format"in e}return makeClient}var src$1={},lodash_camelcase,hasRequiredLodash_camelcase;function requireLodash_camelcase(){if(hasRequiredLodash_camelcase)return lodash_camelcase;hasRequiredLodash_camelcase=1;var e="[object Symbol]",t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",s="\\u20d0-\\u20f0",a="\\u2700-\\u27bf",o="a-z\\xdf-\\xf6\\xf8-\\xff",l="A-Z\\xc0-\\xd6\\xd8-\\xde",c="\\ufe0e\\ufe0f",u="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",h="['’]",d="["+n+"]",p="["+u+"]",f="["+i+s+"]",g="\\d+",v="["+a+"]",m="["+o+"]",A="[^"+n+u+g+a+o+l+"]",y="\\ud83c[\\udffb-\\udfff]",C="[^"+n+"]",S="(?:\\ud83c[\\udde6-\\uddff]){2}",E="[\\ud800-\\udbff][\\udc00-\\udfff]",_="["+l+"]",b="\\u200d",T="(?:"+m+"|"+A+")",R="(?:"+_+"|"+A+")",x="(?:['’](?:d|ll|m|re|s|t|ve))?",w="(?:['’](?:D|LL|M|RE|S|T|VE))?",k="(?:"+f+"|"+y+")"+"?",N="["+c+"]?",I=N+k+("(?:"+b+"(?:"+[C,S,E].join("|")+")"+N+k+")*"),O="(?:"+[v,S,E].join("|")+")"+I,P="(?:"+[C+f+"?",f,S,E,d].join("|")+")",j=RegExp(h,"g"),L=RegExp(f,"g"),q=RegExp(y+"(?="+y+")|"+P+I,"g"),M=RegExp([_+"?"+m+"+"+x+"(?="+[p,_,"$"].join("|")+")",R+"+"+w+"(?="+[p,_+T,"$"].join("|")+")",_+"?"+T+"+"+x,_+"+"+w,g,O].join("|"),"g"),D=RegExp("["+b+n+i+s+c+"]"),F=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,B="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,U="object"==typeof self&&self&&self.Object===Object&&self,$=B||U||Function("return this")();var z=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"});function H(e){return D.test(e)}function W(e){return H(e)?function(e){return e.match(q)||[]}(e):function(e){return e.split("")}(e)}var G=Object.prototype.toString,V=$.Symbol,Y=V?V.prototype:void 0,K=Y?Y.toString:void 0;function J(t){if("string"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(e){return!!e&&"object"==typeof e}(t)&&G.call(t)==e}(t))return K?K.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}function X(e,t,r){var n=e.length;return r=void 0===r?n:r,!t&&r>=n?e:function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(i);++n<i;)s[n]=e[n+t];return s}(e,t,r)}function Q(e){return null==e?"":J(e)}var Z,ee=(Z=function(e,t,r){return t=t.toLowerCase(),e+(r?re(Q(t).toLowerCase()):t)},function(e){return function(e,t,r){for(var n=-1,i=e?e.length:0;++n<i;)r=t(r,e[n],n,e);return r}(function(e,r){return e=Q(e),void 0===r?function(e){return F.test(e)}(e)?function(e){return e.match(M)||[]}(e):function(e){return e.match(t)||[]}(e):e.match(r)||[]}(function(e){return(e=Q(e))&&e.replace(r,z).replace(L,"")}(e).replace(j,"")),Z,"")});var te,re=(te="toUpperCase",function(e){var t=H(e=Q(e))?W(e):void 0,r=t?t[0]:e.charAt(0),n=t?X(t,1).join(""):e.slice(1);return r[te]()+n});return lodash_camelcase=ee}var src={exports:{}},indexLight={exports:{}},indexMinimal={},minimal={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){var r=new Array(arguments.length-1),n=0,i=2,s=!0;for(;i<arguments.length;)r[n++]=arguments[i++];return new Promise(function(i,a){r[n]=function(e){if(s)if(s=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(e){s&&(s=!1,a(e))}})},aspromise}var base64={},hasRequiredBase64,eventemitter,hasRequiredEventemitter,float,hasRequiredFloat,inquire_1,hasRequiredInquire;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(e){var t=e;t.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 r=new Array(64),n=new Array(123),i=0;i<64;)n[r[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;t.encode=function(e,t,n){for(var i,s=null,a=[],o=0,l=0;t<n;){var c=e[t++];switch(l){case 0:a[o++]=r[c>>2],i=(3&c)<<4,l=1;break;case 1:a[o++]=r[i|c>>4],i=(15&c)<<2,l=2;break;case 2:a[o++]=r[i|c>>6],a[o++]=r[63&c],l=0}o>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,a)),o=0)}return l&&(a[o++]=r[i],a[o++]=61,1===l&&(a[o++]=61)),s?(o&&s.push(String.fromCharCode.apply(String,a.slice(0,o))),s.join("")):String.fromCharCode.apply(String,a.slice(0,o))};var s="invalid encoding";t.decode=function(e,t,r){for(var i,a=r,o=0,l=0;l<e.length;){var c=e.charCodeAt(l++);if(61===c&&o>1)break;if(void 0===(c=n[c]))throw Error(s);switch(o){case 0:i=c,o=1;break;case 1:t[r++]=i<<2|(48&c)>>4,i=c,o=2;break;case 2:t[r++]=(15&i)<<4|(60&c)>>2,i=c,o=3;break;case 3:t[r++]=(3&i)<<6|c,o=0}}if(1===o)throw Error(s);return r-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(base64)),base64}function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;function e(){this._listeners={}}return hasRequiredEventemitter=1,eventemitter=e,e.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},e.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],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},e.prototype.emit=function(e){var t=this._listeners[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},eventemitter}function requireFloat(){if(hasRequiredFloat)return float;function e(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function s(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function o(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:s,e.writeFloatBE=n?s:i,e.readFloatLE=n?a:o,e.readFloatBE=n?o:a}():function(){function s(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var s=Math.floor(Math.log(t)/Math.LN2);e((i<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),i=2*(n>>31)+1,s=n>>>23&255,a=8388607&n;return 255===s?a?NaN:i*(1/0):0===s?1401298464324817e-60*i*a:i*Math.pow(2,s-150)*(a+8388608)}e.writeFloatLE=s.bind(null,t),e.writeFloatBE=s.bind(null,r),e.readFloatLE=a.bind(null,n),e.readFloatBE=a.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function s(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function o(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:s,e.writeDoubleBE=n?s:i,e.readDoubleLE=n?a:o,e.readDoubleBE=n?o:a}():function(){function s(e,t,r,n,i,s){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,i,s+t),e(1/n>0?0:2147483648,i,s+r);else if(isNaN(n))e(0,i,s+t),e(2146959360,i,s+r);else if(n>17976931348623157e292)e(0,i,s+t),e((a<<31|2146435072)>>>0,i,s+r);else{var o;if(n<22250738585072014e-324)e((o=n/5e-324)>>>0,i,s+t),e((a<<31|o/4294967296)>>>0,i,s+r);else{var l=Math.floor(Math.log(n)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(o=n*Math.pow(2,-l))>>>0,i,s+t),e((a<<31|l+1023<<20|1048576*o&1048575)>>>0,i,s+r)}}}function a(e,t,r,n,i){var s=e(n,i+t),a=e(n,i+r),o=2*(a>>31)+1,l=a>>>20&2047,c=4294967296*(1048575&a)+s;return 2047===l?c?NaN:o*(1/0):0===l?5e-324*o*c:o*Math.pow(2,l-1075)*(c+4503599627370496)}e.writeDoubleLE=s.bind(null,t,0,4),e.writeDoubleBE=s.bind(null,r,4,0),e.readDoubleLE=a.bind(null,n,0,4),e.readDoubleBE=a.bind(null,i,4,0)}(),e}function t(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 r(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 i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return hasRequiredFloat=1,float=e(e)}function requireInquire(){if(hasRequiredInquire)return inquire_1;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}return hasRequiredInquire=1,inquire_1=inquire,inquire_1}var utf8={},hasRequiredUtf8,pool_1,hasRequiredPool,longbits,hasRequiredLongbits,hasRequiredMinimal,writer,hasRequiredWriter,writer_buffer,hasRequiredWriter_buffer,reader,hasRequiredReader,reader_buffer,hasRequiredReader_buffer;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(e){var t=e;t.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},t.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,s=[],a=0;t<r;)(n=e[t++])<128?s[a++]=n:n>191&&n<224?s[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[a++]=55296+(n>>10),s[a++]=56320+(1023&n)):s[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))},t.write=function(e,t,r){for(var n,i,s=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&i),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-s}}(utf8)),utf8}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,r){var n=r||8192,i=n>>>1,s=null,a=n;return function(r){if(r<1||r>i)return e(r);a+r>n&&(s=e(n),a=0);var o=t.call(s,a,a+=r);return 7&a&&(a=1+(7|a)),o}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var r=t.zero=new t(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var n=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return r;var n=e<0;n&&(e=-e);var i=e>>>0,s=(e-i)/4294967296>>>0;return n&&(s=~s>>>0,i=~i>>>0,++i>4294967295&&(i=0,++s>4294967295&&(s=0))),new t(i,s)},t.from=function(n){if("number"==typeof n)return t.fromNumber(n);if(e.isString(n)){if(!e.Long)return t.fromNumber(parseInt(n,10));n=e.Long.fromString(n)}return n.low||n.high?new t(n.low>>>0,n.high>>>0):r},t.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},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var i=String.prototype.charCodeAt;return t.fromHash=function(e){return e===n?r:new t((i.call(e,0)|i.call(e,1)<<8|i.call(e,2)<<16|i.call(e,3)<<24)>>>0,(i.call(e,4)|i.call(e,5)<<8|i.call(e,6)<<16|i.call(e,7)<<24)>>>0)},t.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)},t.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},t.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},t.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},longbits}function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(){var e=minimal;function t(e,t,r){for(var n=Object.keys(t),i=0;i<n.length;++i)void 0!==e[n[i]]&&r||(e[n[i]]=t[n[i]]);return e}function r(e){function r(e,n){if(!(this instanceof r))return new r(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,r):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&t(this,n)}return r.prototype=Object.create(Error.prototype,{constructor:{value:r,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}}),r}e.asPromise=requireAspromise(),e.base64=requireBase64(),e.EventEmitter=requireEventemitter(),e.float=requireFloat(),e.inquire=requireInquire(),e.utf8=requireUtf8(),e.pool=requirePool(),e.LongBits=requireLongbits(),e.isNode=Boolean(void 0!==commonjsGlobal&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),e.global=e.isNode&&commonjsGlobal||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||minimal,e.emptyArray=Object.freeze?Object.freeze([]):[],e.emptyObject=Object.freeze?Object.freeze({}):{},e.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},e.isString=function(e){return"string"==typeof e||e instanceof String},e.isObject=function(e){return e&&"object"==typeof e},e.isset=e.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)},e.Buffer=function(){try{var t=e.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(e){return null}}(),e._Buffer_from=null,e._Buffer_allocUnsafe=null,e.newBuffer=function(t){return"number"==typeof t?e.Buffer?e._Buffer_allocUnsafe(t):new e.Array(t):e.Buffer?e._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},e.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,e.Long=e.global.dcodeIO&&e.global.dcodeIO.Long||e.global.Long||e.inquire("long"),e.key2Re=/^true|false|0|1$/,e.key32Re=/^-?(?:0|[1-9][0-9]*)$/,e.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,e.longToHash=function(t){return t?e.LongBits.from(t).toHash():e.LongBits.zeroHash},e.longFromHash=function(t,r){var n=e.LongBits.fromHash(t);return e.Long?e.Long.fromBits(n.lo,n.hi,r):n.toNumber(Boolean(r))},e.merge=t,e.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},e.newError=r,e.ProtocolError=r("ProtocolError"),e.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]}},e.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},e.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},e._configure=function(){var t=e.Buffer;t?(e._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,r){return new t(e,r)},e._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):e._Buffer_from=e._Buffer_allocUnsafe=null}}()),minimal}function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=l;var e,t=requireMinimal(),r=t.LongBits,n=t.base64,i=t.utf8;function s(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function a(){}function o(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new s(a,0,0),this.tail=this.head,this.states=null}var c=function(){return t.Buffer?function(){return(l.create=function(){return new e})()}:function(){return new l}};function u(e,t,r){t[r]=255&e}function h(e,t){this.len=e,this.next=void 0,this.val=t}function d(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 p(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=c(),l.alloc=function(e){return new t.Array(e)},t.Array!==Array&&(l.alloc=t.pool(l.alloc,t.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new s(e,t,r),this.len+=t,this},h.prototype=Object.create(s.prototype),h.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.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},l.prototype.int32=function(e){return e<0?this._push(d,10,r.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=r.from(e);return this._push(d,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=r.from(e).zzEncode();return this._push(d,t.length(),t)},l.prototype.bool=function(e){return this._push(u,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(p,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=r.from(e);return this._push(p,4,t.lo)._push(p,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(t.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(t.float.writeDoubleLE,8,e)};var f=t.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]};return l.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(u,1,0);if(t.isString(e)){var i=l.alloc(r=n.length(e));n.decode(e,i,0),e=i}return this.uint32(r)._push(f,r,e)},l.prototype.string=function(e){var t=i.length(e);return t?this.uint32(t)._push(i.write,t,e):this._push(u,1,0)},l.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new s(a,0,0),this.len=0,this},l.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 s(a,0,0),this.len=0),this},l.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},l.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},l._configure=function(t){e=t,l.create=c(),e._configure()},writer}function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=r;var e=requireWriter();(r.prototype=Object.create(e.prototype)).constructor=r;var t=requireMinimal();function r(){e.call(this)}function n(e,r,n){e.length<40?t.utf8.write(e,r,n):r.utf8Write?r.utf8Write(e,n):r.write(e,n)}return r._configure=function(){r.alloc=t._Buffer_allocUnsafe,r.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&"set"===t.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++]}},r.prototype.bytes=function(e){t.isString(e)&&(e=t._Buffer_from(e,"base64"));var n=e.length>>>0;return this.uint32(n),n&&this._push(r.writeBytesBuffer,n,e),this},r.prototype.string=function(e){var r=t.Buffer.byteLength(e);return this.uint32(r),r&&this._push(n,r,e),this},r._configure(),writer_buffer}function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=s;var e,t=requireMinimal(),r=t.LongBits,n=t.utf8;function i(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var a,o="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new s(e);throw Error("illegal buffer")},l=function(){return t.Buffer?function(r){return(s.create=function(r){return t.Buffer.isBuffer(r)?new e(r):o(r)})(r)}:o};function c(){var e=new r(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw i(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 i(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 u(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 i(this,8);return new r(u(this.buf,this.pos+=4),u(this.buf,this.pos+=4))}return s.create=l(),s.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,s.prototype.uint32=(a=4294967295,function(){if(a=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return a;if((this.pos+=5)>this.len)throw this.pos=this.len,i(this,10);return a}),s.prototype.int32=function(){return 0|this.uint32()},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},s.prototype.bool=function(){return 0!==this.uint32()},s.prototype.fixed32=function(){if(this.pos+4>this.len)throw i(this,4);return u(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw i(this,4);return 0|u(this.buf,this.pos+=4)},s.prototype.float=function(){if(this.pos+4>this.len)throw i(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw i(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw i(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,n);if(r===n){var s=t.Buffer;return s?s.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,n)},s.prototype.string=function(){var e=this.bytes();return n.read(e,0,e.length)},s.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw i(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw i(this)}while(128&this.buf[this.pos++]);return this},s.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},s._configure=function(r){e=r,s.create=l(),e._configure();var n=t.Long?"toLong":"toNumber";t.merge(s.prototype,{int64:function(){return c.call(this)[n](!1)},uint64:function(){return c.call(this)[n](!0)},sint64:function(){return c.call(this).zzDecode()[n](!1)},fixed64:function(){return h.call(this)[n](!0)},sfixed64:function(){return h.call(this)[n](!1)}})},reader}function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=r;var e=requireReader();(r.prototype=Object.create(e.prototype)).constructor=r;var t=requireMinimal();function r(t){e.call(this,t)}return r._configure=function(){t.Buffer&&(r.prototype._slice=t.Buffer.prototype.slice)},r.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))},r._configure(),reader_buffer}var rpc={},service$1,hasRequiredService$1,hasRequiredRpc,roots,hasRequiredRoots,hasRequiredIndexMinimal;function requireService$1(){if(hasRequiredService$1)return service$1;hasRequiredService$1=1,service$1=t;var e=requireMinimal();function t(t,r,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(r),this.responseDelimited=Boolean(n)}return(t.prototype=Object.create(e.EventEmitter.prototype)).constructor=t,t.prototype.rpcCall=function t(r,n,i,s,a){if(!s)throw TypeError("request must be specified");var o=this;if(!a)return e.asPromise(t,o,r,n,i,s);if(o.rpcImpl)try{return o.rpcImpl(r,n[o.requestDelimited?"encodeDelimited":"encode"](s).finish(),function(e,t){if(e)return o.emit("error",e,r),a(e);if(null!==t){if(!(t instanceof i))try{t=i[o.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return o.emit("error",e,r),a(e)}return o.emit("data",t,r),a(null,t)}o.end(!0)})}catch(e){return o.emit("error",e,r),void setTimeout(function(){a(e)},0)}else setTimeout(function(){a(Error("already ended"))},0)},t.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service$1}function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,rpc.Service=requireService$1()),rpc}function requireRoots(){return hasRequiredRoots?roots:(hasRequiredRoots=1,roots={})}function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(){var e=indexMinimal;function t(){e.util._configure(),e.Writer._configure(e.BufferWriter),e.Reader._configure(e.BufferReader)}e.build="minimal",e.Writer=requireWriter(),e.BufferWriter=requireWriter_buffer(),e.Reader=requireReader(),e.BufferReader=requireReader_buffer(),e.util=requireMinimal(),e.rpc=requireRpc(),e.roots=requireRoots(),e.configure=t,t()}()),indexMinimal}var types={},util$1={exports:{}},codegen_1,hasRequiredCodegen,fetch_1,hasRequiredFetch;function requireCodegen(){if(hasRequiredCodegen)return codegen_1;function e(t,r){"string"==typeof t&&(r=t,t=void 0);var n=[];function i(t){if("string"!=typeof t){var r=s();if(e.verbose&&console.log("codegen: "+r),r="return "+r,t){for(var a=Object.keys(t),o=new Array(a.length+1),l=new Array(a.length),c=0;c<a.length;)o[c]=a[c],l[c]=t[a[c++]];return o[c]=r,Function.apply(null,o).apply(null,l)}return Function(r)()}for(var u=new Array(arguments.length-1),h=0;h<u.length;)u[h]=arguments[++h];if(h=0,t=t.replace(/%([%dfijs])/g,function(e,t){var r=u[h++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"}),h!==u.length)throw Error("parameter count mismatch");return n.push(t),i}function s(e){return"function "+(e||r||"")+"("+(t&&t.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return i.toString=s,i}return hasRequiredCodegen=1,codegen_1=e,e.verbose=!1,codegen_1}function requireFetch(){if(hasRequiredFetch)return fetch_1;hasRequiredFetch=1,fetch_1=r;var e=requireAspromise(),t=requireInquire()("fs");function r(n,i,s){return"function"==typeof i?(s=i,i={}):i||(i={}),s?!i.xhr&&t&&t.readFile?t.readFile(n,function(e,t){return e&&"undefined"!=typeof XMLHttpRequest?r.xhr(n,i,s):e?s(e):s(null,i.binary?t:t.toString("utf8"))}):r.xhr(n,i,s):e(r,this,n,i)}return r.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var i=0;i<n.responseText.length;++i)e.push(255&n.responseText.charCodeAt(i))}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()},fetch_1}var path={},hasRequiredPath,namespace,hasRequiredNamespace,mapfield,hasRequiredMapfield,method,hasRequiredMethod,service,hasRequiredService,message,hasRequiredMessage,decoder_1,hasRequiredDecoder,verifier_1,hasRequiredVerifier;function requirePath(){return hasRequiredPath||(hasRequiredPath=1,function(e){var t=e,r=t.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},n=t.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=r(e),i="";n&&(i=t.shift()+"/");for(var s=0;s<t.length;)".."===t[s]?s>0&&".."!==t[s-1]?t.splice(--s,2):n?t.splice(s,1):++s:"."===t[s]?t.splice(s,1):++s;return i+t.join("/")};t.resolve=function(e,t,i){return i||(t=n(t)),r(t)?t:(i||(e=n(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?n(e+"/"+t):t)}}(path)),path}function requireNamespace(){if(hasRequiredNamespace)return namespace;hasRequiredNamespace=1,namespace=l;var e=requireObject();((l.prototype=Object.create(e.prototype)).constructor=l).className="Namespace";var t,r,n,i=requireField(),s=requireUtil$1(),a=requireOneof();function o(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function l(t,r){e.call(this,t,r),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function c(e){e._nestedArray=null,e._lookupCache={};for(var t=e;t=t.parent;)t._lookupCache={};return e}return l.fromJSON=function(e,t){return new l(e,t.options).addJSON(t.nested)},l.arrayToJSON=o,l.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},l.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(l.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=s.toArray(this.nested))}}),l.prototype.toJSON=function(e){return s.toObject(["options",this.options,"nested",o(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var s,a=Object.keys(e),o=0;o<a.length;++o)s=e[a[o]],this.add((void 0!==s.fields?t.fromJSON:void 0!==s.values?n.fromJSON:void 0!==s.methods?r.fromJSON:void 0!==s.id?i.fromJSON:l.fromJSON)(a[o],s));return this},l.prototype.get=function(e){return this.nested&&this.nested[e]||null},l.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof n)return this.nested[e].values;throw Error("no such enum: "+e)},l.prototype.add=function(e){if(!(e instanceof i&&void 0!==e.extend||e instanceof t||e instanceof a||e instanceof n||e instanceof r||e instanceof l))throw TypeError("object must be a valid nested object");if(this.nested){var s=this.get(e.name);if(s){if(!(s instanceof l&&e instanceof l)||s instanceof t||s instanceof r)throw Error("duplicate name '"+e.name+"' in "+this);for(var o=s.nestedArray,u=0;u<o.length;++u)e.add(o[u]);this.remove(s),this.nested||(this.nested={}),e.setOptions(s.options,!0)}}else this.nested={};this.nested[e.name]=e,this instanceof t||this instanceof r||this instanceof n||this instanceof i||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var h=this;h=h.parent;)h._needsRecursiveFeatureResolution=!0,h._needsRecursiveResolve=!0;return e.onAdd(this),c(this)},l.prototype.remove=function(t){if(!(t instanceof e))throw TypeError("object must be a ReflectionObject");if(t.parent!==this)throw Error(t+" is not a member of "+this);return delete this.nested[t.name],Object.keys(this.nested).length||(this.nested=void 0),t.onRemove(this),c(this)},l.prototype.define=function(e,t){if(s.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;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof l))throw Error("path conflicts with non-namespace objects")}else r.add(r=new l(n))}return t&&r.addJSON(t),r},l.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof l?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this},l.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.nestedArray.forEach(e=>{e._resolveFeaturesRecursive(t)}),this):this},l.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),s.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;var n=e.join(".");if(""===e[0])return this.root.lookup(e.slice(1),t);var i=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+n];if(i&&(!t||t.indexOf(i.constructor)>-1))return i;if((i=this._lookupImpl(e,n))&&(!t||t.indexOf(i.constructor)>-1))return i;if(r)return null;for(var a=this;a.parent;){if((i=a.parent._lookupImpl(e,n))&&(!t||t.indexOf(i.constructor)>-1))return i;a=a.parent}return null},l.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var r=this.get(e[0]),n=null;if(r)1===e.length?n=r:r instanceof l&&(e=e.slice(1),n=r._lookupImpl(e,e.join(".")));else for(var i=0;i<this.nestedArray.length;++i)this._nestedArray[i]instanceof l&&(r=this._nestedArray[i]._lookupImpl(e,t))&&(n=r);return this._lookupCache[t]=n,n},l.prototype.lookupType=function(e){var r=this.lookup(e,[t]);if(!r)throw Error("no such type: "+e);return r},l.prototype.lookupEnum=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},l.prototype.lookupTypeOrEnum=function(e){var r=this.lookup(e,[t,n]);if(!r)throw Error("no such Type or Enum '"+e+"' in "+this);return r},l.prototype.lookupService=function(e){var t=this.lookup(e,[r]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},l._configure=function(e,i,s){t=e,r=i,n=s},namespace}function requireMapfield(){if(hasRequiredMapfield)return mapfield;hasRequiredMapfield=1,mapfield=n;var e=requireField();((n.prototype=Object.create(e.prototype)).constructor=n).className="MapField";var t=requireTypes(),r=requireUtil$1();function n(t,n,i,s,a,o){if(e.call(this,t,n,s,void 0,void 0,a,o),!r.isString(i))throw TypeError("keyType must be a string");this.keyType=i,this.resolvedKeyType=null,this.map=!0}return n.fromJSON=function(e,t){return new n(e,t.id,t.keyType,t.type,t.options,t.comment)},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},n.prototype.resolve=function(){if(this.resolved)return this;if(void 0===t.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return e.prototype.resolve.call(this)},n.d=function(e,t,i){return"function"==typeof i?i=r.decorateType(i).name:i&&"object"==typeof i&&(i=r.decorateEnum(i).name),function(s,a){r.decorateType(s.constructor).add(new n(a,e,t,i))}},mapfield}function requireMethod(){if(hasRequiredMethod)return method;hasRequiredMethod=1,method=r;var e=requireObject();((r.prototype=Object.create(e.prototype)).constructor=r).className="Method";var t=requireUtil$1();function r(r,n,i,s,a,o,l,c,u){if(t.isObject(a)?(l=a,a=o=void 0):t.isObject(o)&&(l=o,o=void 0),void 0!==n&&!t.isString(n))throw TypeError("type must be a string");if(!t.isString(i))throw TypeError("requestType must be a string");if(!t.isString(s))throw TypeError("responseType must be a string");e.call(this,r,l),this.type=n||"rpc",this.requestType=i,this.requestStream=!!a||void 0,this.responseType=s,this.responseStream=!!o||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=c,this.parsedOptions=u}return r.fromJSON=function(e,t){return new r(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},r.prototype.toJSON=function(e){var r=!!e&&Boolean(e.keepComments);return t.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",r?this.comment:void 0,"parsedOptions",this.parsedOptions])},r.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),e.prototype.resolve.call(this))},method}function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=i;var e=requireNamespace();((i.prototype=Object.create(e.prototype)).constructor=i).className="Service";var t=requireMethod(),r=requireUtil$1(),n=requireRpc();function i(t,r){e.call(this,t,r),this.methods={},this._methodsArray=null}function s(e){return e._methodsArray=null,e}return i.fromJSON=function(e,r){var n=new i(e,r.options);if(r.methods)for(var s=Object.keys(r.methods),a=0;a<s.length;++a)n.add(t.fromJSON(s[a],r.methods[s[a]]));return r.nested&&n.addJSON(r.nested),r.edition&&(n._edition=r.edition),n.comment=r.comment,n._defaultEdition="proto3",n},i.prototype.toJSON=function(t){var n=e.prototype.toJSON.call(this,t),i=!!t&&Boolean(t.keepComments);return r.toObject(["edition",this._editionToJSON(),"options",n&&n.options||void 0,"methods",e.arrayToJSON(this.methodsArray,t)||{},"nested",n&&n.nested||void 0,"comment",i?this.comment:void 0])},Object.defineProperty(i.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=r.toArray(this.methods))}}),i.prototype.get=function(t){return this.methods[t]||e.prototype.get.call(this,t)},i.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;e.prototype.resolve.call(this);for(var t=this.methodsArray,r=0;r<t.length;++r)t[r].resolve();return this},i.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.methodsArray.forEach(e=>{e._resolveFeaturesRecursive(t)}),this):this},i.prototype.add=function(r){if(this.get(r.name))throw Error("duplicate name '"+r.name+"' in "+this);return r instanceof t?(this.methods[r.name]=r,r.parent=this,s(this)):e.prototype.add.call(this,r)},i.prototype.remove=function(r){if(r instanceof t){if(this.methods[r.name]!==r)throw Error(r+" is not a member of "+this);return delete this.methods[r.name],r.parent=null,s(this)}return e.prototype.remove.call(this,r)},i.prototype.create=function(e,t,i){for(var s,a=new n.Service(e,t,i),o=0;o<this.methodsArray.length;++o){var l=r.lcFirst((s=this._methodsArray[o]).resolve().name).replace(/[^$\w_]/g,"");a[l]=r.codegen(["r","c"],r.isReserved(l)?l+"_":l)("return this.rpcCall(m,q,s,r,c)")({m:s,q:s.resolvedRequestType.ctor,s:s.resolvedResponseType.ctor})}return a},service}function requireMessage(){if(hasRequiredMessage)return message;hasRequiredMessage=1,message=t;var e=requireMinimal();function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return t.create=function(e){return this.$type.create(e)},t.encode=function(e,t){return this.$type.encode(e,t)},t.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},t.decode=function(e){return this.$type.decode(e)},t.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},t.verify=function(e){return this.$type.verify(e)},t.fromObject=function(e){return this.$type.fromObject(e)},t.toObject=function(e,t){return this.$type.toObject(e,t)},t.prototype.toJSON=function(){return this.$type.toObject(this,e.toJSONOptions)},message}function requireDecoder(){if(hasRequiredDecoder)return decoder_1;hasRequiredDecoder=1,decoder_1=function(i){for(var s=r.codegen(["r","l","e"],i.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(i.fieldsArray.filter(function(e){return e.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),a=0;a<i.fieldsArray.length;++a){var o=i._fieldsArray[a].resolve(),l=o.resolvedType instanceof e?"int32":o.type,c="m"+r.safeProp(o.name);s("case %i: {",o.id),o.map?(s("if(%s===util.emptyObject)",c)("%s={}",c)("var c2 = r.uint32()+r.pos"),void 0!==t.defaults[o.keyType]?s("k=%j",t.defaults[o.keyType]):s("k=null"),void 0!==t.defaults[l]?s("value=%j",t.defaults[l]):s("value=null"),s("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",o.keyType)("case 2:"),void 0===t.basic[l]?s("value=types[%i].decode(r,r.uint32())",a):s("value=r.%s()",l),s("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==t.long[o.keyType]?s('%s[typeof k==="object"?util.longToHash(k):k]=value',c):s("%s[k]=value",c)):o.repeated?(s("if(!(%s&&%s.length))",c,c)("%s=[]",c),void 0!==t.packed[l]&&s("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",c,l)("}else"),void 0===t.basic[l]?s(o.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",c,a):s("%s.push(r.%s())",c,l)):void 0===t.basic[l]?s(o.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",c,a):s("%s=r.%s()",c,l),s("break")("}")}for(s("default:")("r.skipType(t&7)")("break")("}")("}"),a=0;a<i._fieldsArray.length;++a){var u=i._fieldsArray[a];u.required&&s("if(!m.hasOwnProperty(%j))",u.name)("throw util.ProtocolError(%j,{instance:m})",n(u))}return s("return m")};var e=require_enum(),t=requireTypes(),r=requireUtil$1();function n(e){return"missing required '"+e.name+"'"}return decoder_1}function requireVerifier(){if(hasRequiredVerifier)return verifier_1;hasRequiredVerifier=1,verifier_1=function(e){var s=t.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),a=e.oneofsArray,o={};a.length&&s("var p={}");for(var l=0;l<e.fieldsArray.length;++l){var c=e._fieldsArray[l].resolve(),u="m"+t.safeProp(c.name);if(c.optional&&s("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)s("if(!util.isObject(%s))",u)("return%j",r(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),i(s,c,"k[i]"),n(s,c,l,u+"[k[i]]")("}");else if(c.repeated)s("if(!Array.isArray(%s))",u)("return%j",r(c,"array"))("for(var i=0;i<%s.length;++i){",u),n(s,c,l,u+"[i]")("}");else{if(c.partOf){var h=t.safeProp(c.partOf.name);1===o[c.partOf.name]&&s("if(p%s===1)",h)("return%j",c.partOf.name+": multiple values"),o[c.partOf.name]=1,s("p%s=1",h)}n(s,c,l,u)}c.optional&&s("}")}return s("return null")};var e=require_enum(),t=requireUtil$1();function r(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function n(t,n,i,s){if(n.resolvedType)if(n.resolvedType instanceof e){t("switch(%s){",s)("default:")("return%j",r(n,"enum value"));for(var a=Object.keys(n.resolvedType.values),o=0;o<a.length;++o)t("case %i:",n.resolvedType.values[a[o]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s);",i,s)("if(e)")("return%j+e",n.name+".")("}");else switch(n.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",s)("return%j",r(n,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",s,s,s,s)("return%j",r(n,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',s)("return%j",r(n,"number"));break;case"bool":t('if(typeof %s!=="boolean")',s)("return%j",r(n,"boolean"));break;case"string":t("if(!util.isString(%s))",s)("return%j",r(n,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',s,s,s)("return%j",r(n,"buffer"))}return t}function i(e,t,n){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",n)("return%j",r(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",n)("return%j",r(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",n)("return%j",r(t,"boolean key"))}return e}return verifier_1}var converter={},hasRequiredConverter;function requireConverter(){return hasRequiredConverter||(hasRequiredConverter=1,function(e){var t=e,r=require_enum(),n=requireUtil$1();function i(e,t,n,i){var s=!1;if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(d%s){",i);for(var a=t.resolvedType.values,o=Object.keys(a),l=0;l<o.length;++l)a[o[l]]!==t.typeDefault||s||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',i,i,i),t.repeated||e("break"),s=!0),e("case%j:",o[l])("case %i:",a[o[l]])("m%s=%j",i,a[o[l]])("break");e("}")}else e('if(typeof d%s!=="object")',i)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",i,n,i);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",i,i);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",i,i);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",i,i);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,c)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length >= 0)",i)("m%s=d%s",i,i);break;case"string":e("m%s=String(d%s)",i,i);break;case"bool":e("m%s=Boolean(d%s)",i,i)}}return e}function s(e,t,n,i){if(t.resolvedType)t.resolvedType instanceof r?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",i,n,i,i,n,i,i):e("d%s=types[%i].toObject(m%s,o)",i,n,i);else{var s=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("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",i,i,i,i,s?"true":"",i);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",i,i,i,i,i);break;default:e("d%s=m%s",i,i)}}return e}t.fromObject=function(e){var t=e.fieldsArray,s=n.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return s("return new this.ctor");s("var m=new this.ctor");for(var a=0;a<t.length;++a){var o=t[a].resolve(),l=n.safeProp(o.name);o.map?(s("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",o.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),i(s,o,a,l+"[ks[i]]")("}")("}")):o.repeated?(s("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",o.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),i(s,o,a,l+"[i]")("}")("}")):(o.resolvedType instanceof r||s("if(d%s!=null){",l),i(s,o,a,l),o.resolvedType instanceof r||s("}"))}return s("return m")},t.toObject=function(e){var t=e.fieldsArray.slice().sort(n.compareFieldsById);if(!t.length)return n.codegen()("return {}");for(var i=n.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),a=[],o=[],l=[],c=0;c<t.length;++c)t[c].partOf||(t[c].resolve().repeated?a:t[c].map?o:l).push(t[c]);if(a.length){for(i("if(o.arrays||o.defaults){"),c=0;c<a.length;++c)i("d%s=[]",n.safeProp(a[c].name));i("}")}if(o.length){for(i("if(o.objects||o.defaults){"),c=0;c<o.length;++c)i("d%s={}",n.safeProp(o[c].name));i("}")}if(l.length){for(i("if(o.defaults){"),c=0;c<l.length;++c){var u=l[c],h=n.safeProp(u.name);if(u.resolvedType instanceof r)i("d%s=o.enums===String?%j:%j",h,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)i("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",h)("}else")("d%s=o.longs===String?%j:%i",h,u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var d="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]";i("if(o.bytes===String)d%s=%j",h,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",h,d)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",h,h)("}")}else i("d%s=%j",h,u.typeDefault)}i("}")}var p=!1;for(c=0;c<t.length;++c){u=t[c];var f=e._fieldsArray.indexOf(u);h=n.safeProp(u.name);u.map?(p||(p=!0,i("var ks2")),i("if(m%s&&(ks2=Object.keys(m%s)).length){",h,h)("d%s={}",h)("for(var j=0;j<ks2.length;++j){"),s(i,u,f,h+"[ks2[j]]")("}")):u.repeated?(i("if(m%s&&m%s.length){",h,h)("d%s=[]",h)("for(var j=0;j<m%s.length;++j){",h),s(i,u,f,h+"[j]")("}")):(i("if(m%s!=null&&m.hasOwnProperty(%j)){",h,u.name),s(i,u,f,h),u.partOf&&i("if(o.oneofs)")("d%s=%j",n.safeProp(u.partOf.name),u.name)),i("}")}return i("return d")}}(converter)),converter}var wrappers={},hasRequiredWrappers,type,hasRequiredType,root,hasRequiredRoot,hasRequiredUtil$1,hasRequiredTypes,field,hasRequiredField,oneof,hasRequiredOneof,object,hasRequiredObject,_enum,hasRequired_enum,encoder_1,hasRequiredEncoder,hasRequiredIndexLight,tokenize_1,hasRequiredTokenize,parse_1,hasRequiredParse,common_1,hasRequiredCommon,hasRequiredSrc$2,protobufjs,hasRequiredProtobufjs;function requireWrappers(){return hasRequiredWrappers||(hasRequiredWrappers=1,function(e){var t=e,r=requireMessage();t[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var n="",i="";if(t&&t.json&&e.type_url&&e.value){i=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var s=this.lookup(i);s&&(e=s.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof r){var a=e.$type.toObject(e,t);return""===n&&(n="type.googleapis.com/"),i=n+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),a["@type"]=i,a}return this.toObject(e,t)}}}(wrappers)),wrappers}function requireType(){if(hasRequiredType)return type;hasRequiredType=1,type=g;var e=requireNamespace();((g.prototype=Object.create(e.prototype)).constructor=g).className="Type";var t=require_enum(),r=requireOneof(),n=requireField(),i=requireMapfield(),s=requireService(),a=requireMessage(),o=requireReader(),l=requireWriter(),c=requireUtil$1(),u=requireEncoder(),h=requireDecoder(),d=requireVerifier(),p=requireConverter(),f=requireWrappers();function g(t,r){e.call(this,t,r),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function v(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}return Object.defineProperties(g.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=c.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=c.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=g.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof a||((e.prototype=new a).constructor=e,c.merge(e.prototype,t)),e.$type=e.prototype.$type=this,c.merge(e,a,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:c.oneOfGetter(this._oneofsArray[r].oneof),set:c.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),g.generateConstructor=function(e){for(var t,r=c.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",c.safeProp(t.name)):t.repeated&&r("this%s=[]",c.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]]")},g.fromJSON=function(a,o){var l=new g(a,o.options);l.extensions=o.extensions,l.reserved=o.reserved;for(var c=Object.keys(o.fields),u=0;u<c.length;++u)l.add((void 0!==o.fields[c[u]].keyType?i.fromJSON:n.fromJSON)(c[u],o.fields[c[u]]));if(o.oneofs)for(c=Object.keys(o.oneofs),u=0;u<c.length;++u)l.add(r.fromJSON(c[u],o.oneofs[c[u]]));if(o.nested)for(c=Object.keys(o.nested),u=0;u<c.length;++u){var h=o.nested[c[u]];l.add((void 0!==h.id?n.fromJSON:void 0!==h.fields?g.fromJSON:void 0!==h.values?t.fromJSON:void 0!==h.methods?s.fromJSON:e.fromJSON)(c[u],h))}return o.extensions&&o.extensions.length&&(l.extensions=o.extensions),o.reserved&&o.reserved.length&&(l.reserved=o.reserved),o.group&&(l.group=!0),o.comment&&(l.comment=o.comment),o.edition&&(l._edition=o.edition),l._defaultEdition="proto3",l},g.prototype.toJSON=function(t){var r=e.prototype.toJSON.call(this,t),n=!!t&&Boolean(t.keepComments);return c.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"oneofs",e.arrayToJSON(this.oneofsArray,t),"fields",e.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}),t)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",r&&r.nested||void 0,"comment",n?this.comment:void 0])},g.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;e.prototype.resolveAll.call(this);var t=this.oneofsArray;for(n=0;n<t.length;)t[n++].resolve();for(var r=this.fieldsArray,n=0;n<r.length;)r[n++].resolve();return this},g.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.oneofsArray.forEach(e=>{e._resolveFeatures(t)}),this.fieldsArray.forEach(e=>{e._resolveFeatures(t)}),this):this},g.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},g.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof n&&void 0===t.extend){if(this._fieldsById?this._fieldsById[t.id]:this.fieldsById[t.id])throw Error("duplicate id "+t.id+" in "+this);if(this.isReservedId(t.id))throw Error("id "+t.id+" is reserved in "+this);if(this.isReservedName(t.name))throw Error("name '"+t.name+"' is reserved in "+this);return t.parent&&t.parent.remove(t),this.fields[t.name]=t,t.message=this,t.onAdd(this),v(this)}return t instanceof r?(this.oneofs||(this.oneofs={}),this.oneofs[t.name]=t,t.onAdd(this),v(this)):e.prototype.add.call(this,t)},g.prototype.remove=function(t){if(t instanceof n&&void 0===t.extend){if(!this.fields||this.fields[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.fields[t.name],t.parent=null,t.onRemove(this),v(this)}if(t instanceof r){if(!this.oneofs||this.oneofs[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),v(this)}return e.prototype.remove.call(this,t)},g.prototype.isReservedId=function(t){return e.isReservedId(this.reserved,t)},g.prototype.isReservedName=function(t){return e.isReservedName(this.reserved,t)},g.prototype.create=function(e){return new this.ctor(e)},g.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=u(this)({Writer:l,types:t,util:c}),this.decode=h(this)({Reader:o,types:t,util:c}),this.verify=d(this)({types:t,util:c}),this.fromObject=p.fromObject(this)({types:t,util:c}),this.toObject=p.toObject(this)({types:t,util:c});var n=f[e];if(n){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(i),i.toObject=this.toObject,this.toObject=n.toObject.bind(i)}return this},g.prototype.encode=function(e,t){return this.setup().encode(e,t)},g.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},g.prototype.decode=function(e,t){return this.setup().decode(e,t)},g.prototype.decodeDelimited=function(e){return e instanceof o||(e=o.create(e)),this.decode(e,e.uint32())},g.prototype.verify=function(e){return this.setup().verify(e)},g.prototype.fromObject=function(e){return this.setup().fromObject(e)},g.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},g.d=function(e){return function(t){c.decorateType(t,e)}},type}function requireRoot(){if(hasRequiredRoot)return root;hasRequiredRoot=1,root=l;var e=requireNamespace();((l.prototype=Object.create(e.prototype)).constructor=l).className="Root";var t,r,n,i=requireField(),s=require_enum(),a=requireOneof(),o=requireUtil$1();function l(t){e.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}function c(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()},l.prototype.resolvePath=o.path.resolve,l.prototype.fetch=o.fetch,l.prototype.load=function e(t,i,s){"function"==typeof i&&(s=i,i=void 0);var a=this;if(!s)return o.asPromise(e,a,t,i);var l=s===c;function u(e,t){if(s){if(l)throw e;t&&t.resolveAll();var r=s;s=null,r(e,t)}}function h(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in n)return r}return null}function d(e,t){try{if(o.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),o.isString(t)){r.filename=e;var n,s=r(t,a,i),c=0;if(s.imports)for(;c<s.imports.length;++c)(n=h(s.imports[c])||a.resolvePath(e,s.imports[c]))&&p(n);if(s.weakImports)for(c=0;c<s.weakImports.length;++c)(n=h(s.weakImports[c])||a.resolvePath(e,s.weakImports[c]))&&p(n,!0)}else a.setOptions(t.options).addJSON(t.nested)}catch(e){u(e)}l||f||u(null,a)}function p(e,t){if(e=h(e)||e,!(a.files.indexOf(e)>-1))if(a.files.push(e),e in n)l?d(e,n[e]):(++f,setTimeout(function(){--f,d(e,n[e])}));else if(l){var r;try{r=o.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||u(e))}d(e,r)}else++f,a.fetch(e,function(r,n){--f,s&&(r?t?f||u(null,a):u(r):d(e,n))})}var f=0;o.isString(t)&&(t=[t]);for(var g,v=0;v<t.length;++v)(g=a.resolvePath("",t[v]))&&p(g);return l?(a.resolveAll(),a):(f||u(null,a),a)},l.prototype.loadSync=function(e,t){if(!o.isNode)throw Error("not supported");return this.load(e,t,c)},l.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return e.prototype.resolveAll.call(this)};var u=/^[A-Z]/;function h(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new i(t.fullName,t.id,t.type,t.rule,void 0,t.options);return r.get(n.name)||(n.declaringField=t,t.extensionField=n,r.add(n)),!0}return!1}return l.prototype._handleAdd=function(e){if(e instanceof i)void 0===e.extend||e.extensionField||h(0,e)||this.deferred.push(e);else if(e instanceof s)u.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof a)){if(e instanceof t)for(var r=0;r<this.deferred.length;)h(0,this.deferred[r])?this.deferred.splice(r,1):++r;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);u.test(e.name)&&(e.parent[e.name]=e)}(e instanceof t||e instanceof s||e instanceof i)&&(this._fullyQualifiedObjects[e.fullName]=e)},l.prototype._handleRemove=function(t){if(t instanceof i){if(void 0!==t.extend)if(t.extensionField)t.extensionField.parent.remove(t.extensionField),t.extensionField=null;else{var r=this.deferred.indexOf(t);r>-1&&this.deferred.splice(r,1)}}else if(t instanceof s)u.test(t.name)&&delete t.parent[t.name];else if(t instanceof e){for(var n=0;n<t.nestedArray.length;++n)this._handleRemove(t._nestedArray[n]);u.test(t.name)&&delete t.parent[t.name]}delete this._fullyQualifiedObjects[t.fullName]},l._configure=function(e,i,s){t=e,r=i,n=s},root}function requireUtil$1(){if(hasRequiredUtil$1)return util$1.exports;hasRequiredUtil$1=1;var e,t,r=util$1.exports=requireMinimal(),n=requireRoots();r.codegen=requireCodegen(),r.fetch=requireFetch(),r.path=requirePath(),r.fs=r.inquire("fs"),r.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},r.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],i=e[r++];void 0!==i&&(t[n]=i)}return t};var i=/\\/g,s=/"/g;r.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)},r.safeProp=function(e){return!/^[$\w_]+$/.test(e)||r.isReserved(e)?'["'+e.replace(i,"\\\\").replace(s,'\\"')+'"]':"."+e},r.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var a=/_([a-z])/g;r.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(a,function(e,t){return t.toUpperCase()})},r.compareFieldsById=function(e,t){return e.id-t.id},r.decorateType=function(t,n){if(t.$type)return n&&t.$type.name!==n&&(r.decorateRoot.remove(t.$type),t.$type.name=n,r.decorateRoot.add(t.$type)),t.$type;e||(e=requireType());var i=new e(n||t.name);return r.decorateRoot.add(i),i.ctor=t,Object.defineProperty(t,"$type",{value:i,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:i,enumerable:!1}),i};var o=0;return r.decorateEnum=function(e){if(e.$type)return e.$type;t||(t=require_enum());var n=new t("Enum"+o++,e);return r.decorateRoot.add(n),Object.defineProperty(e,"$type",{value:n,enumerable:!1}),n},r.setProperty=function(e,t,r,n){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,i){var s=r.shift();if("__proto__"===s||"prototype"===s)return t;if(r.length>0)t[s]=e(t[s]||{},r,i);else{var a=t[s];if(a&&n)return t;a&&(i=[].concat(a).concat(i)),t[s]=i}return t}(e,t=t.split("."),r)},Object.defineProperty(r,"decorateRoot",{get:function(){return n.decorated||(n.decorated=new(requireRoot()))}}),util$1.exports}function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(e){var t=e,r=requireUtil$1(),n=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function i(e,t){var r=0,i={};for(t|=0;r<e.length;)i[n[r+t]]=e[r++];return i}t.basic=i([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),t.defaults=i([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",r.emptyArray,null]),t.long=i([0,0,0,1,1],7),t.mapKey=i([0,0,0,5,5,0,0,0,1,1,0,2],2),t.packed=i([1,5,0,0,0,5,5,0,0,0,1,1,0])}(types)),types}function requireField(){if(hasRequiredField)return field;hasRequiredField=1,field=a;var e=requireObject();((a.prototype=Object.create(e.prototype)).constructor=a).className="Field";var t,r=require_enum(),n=requireTypes(),i=requireUtil$1(),s=/^required|optional|repeated$/;function a(t,r,a,o,l,c,u){if(i.isObject(o)?(u=l,c=o,o=l=void 0):i.isObject(l)&&(u=c,c=l,l=void 0),e.call(this,t,c),!i.isInteger(r)||r<0)throw TypeError("id must be a non-negative integer");if(!i.isString(a))throw TypeError("type must be a string");if(void 0!==o&&!s.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==l&&!i.isString(l))throw TypeError("extend must be a string");"proto3_optional"===o&&(o="optional"),this.rule=o&&"optional"!==o?o:void 0,this.type=a,this.id=r,this.extend=l||void 0,this.repeated="repeated"===o,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!i.Long&&void 0!==n.long[a],this.bytes="bytes"===a,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=u}return a.fromJSON=function(e,t){var r=new a(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(r._edition=t.edition),r._defaultEdition="proto3",r},Object.defineProperty(a.prototype,"required",{get:function(){return"LEGACY_REQUIRED"===this._features.field_presence}}),Object.defineProperty(a.prototype,"optional",{get:function(){return!this.required}}),Object.defineProperty(a.prototype,"delimited",{get:function(){return this.resolvedType instanceof t&&"DELIMITED"===this._features.message_encoding}}),Object.defineProperty(a.prototype,"packed",{get:function(){return"PACKED"===this._features.repeated_field_encoding}}),Object.defineProperty(a.prototype,"hasPresence",{get:function(){return!this.repeated&&!this.map&&(this.partOf||this.declaringField||this.extensionField||"IMPLICIT"!==this._features.field_presence)}}),a.prototype.setOption=function(t,r,n){return e.prototype.setOption.call(this,t,r,n)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["edition",this._editionToJSON(),"rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=n.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof t?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 r&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof r||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=i.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var s;i.base64.test(this.typeDefault)?i.base64.decode(this.typeDefault,s=i.newBuffer(i.base64.length(this.typeDefault)),0):i.utf8.write(this.typeDefault,s=i.newBuffer(i.utf8.length(this.typeDefault)),0),this.typeDefault=s}return this.map?this.defaultValue=i.emptyObject:this.repeated?this.defaultValue=i.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof t&&(this.parent.ctor.prototype[this.name]=this.defaultValue),e.prototype.resolve.call(this)},a.prototype._inferLegacyProtoFeatures=function(e){if("proto2"!==e&&"proto3"!==e)return{};var r={};if("required"===this.rule&&(r.field_presence="LEGACY_REQUIRED"),this.parent&&void 0===n.defaults[this.type]){var i=this.parent.get(this.type.split(".").pop());i&&i instanceof t&&i.group&&(r.message_encoding="DELIMITED")}return!0===this.getOption("packed")?r.repeated_field_encoding="PACKED":!1===this.getOption("packed")&&(r.repeated_field_encoding="EXPANDED"),r},a.prototype._resolveFeatures=function(t){return e.prototype._resolveFeatures.call(this,this._edition||t)},a.d=function(e,t,r,n){return"function"==typeof t?t=i.decorateType(t).name:t&&"object"==typeof t&&(t=i.decorateEnum(t).name),function(s,o){i.decorateType(s.constructor).add(new a(o,e,t,r,{default:n}))}},a._configure=function(e){t=e},field}function requireOneof(){if(hasRequiredOneof)return oneof;hasRequiredOneof=1,oneof=n;var e=requireObject();((n.prototype=Object.create(e.prototype)).constructor=n).className="OneOf";var t=requireField(),r=requireUtil$1();function n(t,r,n,i){if(Array.isArray(r)||(n=r,r=void 0),e.call(this,t,n),void 0!==r&&!Array.isArray(r))throw TypeError("fieldNames must be an Array");this.oneof=r||[],this.fieldsArray=[],this.comment=i}function i(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}return n.fromJSON=function(e,t){return new n(e,t.oneof,t.options,t.comment)},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},n.prototype.add=function(e){if(!(e instanceof t))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,i(this),this},n.prototype.remove=function(e){if(!(e instanceof t))throw TypeError("field must be a Field");var r=this.fieldsArray.indexOf(e);if(r<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(r,1),(r=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(r,1),e.partOf=null,this},n.prototype.onAdd=function(t){e.prototype.onAdd.call(this,t);for(var r=0;r<this.oneof.length;++r){var n=t.get(this.oneof[r]);n&&!n.partOf&&(n.partOf=this,this.fieldsArray.push(n))}i(this)},n.prototype.onRemove=function(t){for(var r,n=0;n<this.fieldsArray.length;++n)(r=this.fieldsArray[n]).parent&&r.parent.remove(r);e.prototype.onRemove.call(this,t)},Object.defineProperty(n.prototype,"isProto3Optional",{get:function(){if(null==this.fieldsArray||1!==this.fieldsArray.length)return!1;var e=this.fieldsArray[0];return null!=e.options&&!0===e.options.proto3_optional}}),n.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,i){r.decorateType(t.constructor).add(new n(i,e)),Object.defineProperty(t,i,{get:r.oneOfGetter(e),set:r.oneOfSetter(e)})}},oneof}function requireObject(){if(hasRequiredObject)return object;hasRequiredObject=1,object=a,a.className="ReflectionObject";const e=requireOneof();var t,r=requireUtil$1(),n={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},i={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},s={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function a(e,t){if(!r.isString(e))throw TypeError("name must be a string");if(t&&!r.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}return Object.defineProperties(a.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(".")}}}),a.prototype.toJSON=function(){throw Error()},a.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var r=e.root;r instanceof t&&r._handleAdd(this)},a.prototype.onRemove=function(e){var r=e.root;r instanceof t&&r._handleRemove(this),this.parent=null,this.resolved=!1},a.prototype.resolve=function(){return this.resolved||this.root instanceof t&&(this.resolved=!0),this},a.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)},a.prototype._resolveFeatures=function(t){if(!this._featuresResolved){var r={};if(!t)throw new Error("Unknown edition for "+this.fullName);var a=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(t));if(this._edition){if("proto2"===t)r=Object.assign({},i);else if("proto3"===t)r=Object.assign({},s);else{if("2023"!==t)throw new Error("Unknown edition: "+t);r=Object.assign({},n)}return this._features=Object.assign(r,a||{}),void(this._featuresResolved=!0)}if(this.partOf instanceof e){var o=Object.assign({},this.partOf._features);this._features=Object.assign(o,a||{})}else if(this.declaringField);else{if(!this.parent)throw new Error("Unable to find a parent for "+this.fullName);var l=Object.assign({},this.parent._features);this._features=Object.assign(l,a||{})}this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}},a.prototype._inferLegacyProtoFeatures=function(){return{}},a.prototype.getOption=function(e){if(this.options)return this.options[e]},a.prototype.setOption=function(e,t,n){return this.options||(this.options={}),/^features\./.test(e)?r.setProperty(this.options,e,t,n):n&&void 0!==this.options[e]||(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this},a.prototype.setParsedOption=function(e,t,n){this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(n){var s=i.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)});if(s){var a=s[e];r.setProperty(a,n,t)}else(s={})[e]=r.setProperty({},n,t),i.push(s)}else{var o={};o[e]=t,i.push(o)}return this},a.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},a.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},a.prototype._editionToJSON=function(){if(this._edition&&"proto3"!==this._edition)return this._edition},a._configure=function(e){t=e},object}function require_enum(){if(hasRequired_enum)return _enum;hasRequired_enum=1,_enum=n;var e=requireObject();((n.prototype=Object.create(e.prototype)).constructor=n).className="Enum";var t=requireNamespace(),r=requireUtil$1();function n(t,r,n,i,s,a){if(e.call(this,t,n),r&&"object"!=typeof r)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=s||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,r)for(var o=Object.keys(r),l=0;l<o.length;++l)"number"==typeof r[o[l]]&&(this.valuesById[this.values[o[l]]=r[o[l]]]=o[l])}return n.prototype._resolveFeatures=function(t){return t=this._edition||t,e.prototype._resolveFeatures.call(this,t),Object.keys(this.values).forEach(e=>{var t=Object.assign({},this._features);this._valuesFeatures[e]=Object.assign(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features)}),this},n.fromJSON=function(e,t){var r=new n(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,t.edition&&(r._edition=t.edition),r._defaultEdition="proto3",r},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},n.prototype.add=function(e,t,n,i){if(!r.isString(e))throw TypeError("name must be a string");if(!r.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])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(void 0!==this.valuesById[t]){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 i&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=i||null),this.comments[e]=n||null,this},n.prototype.remove=function(e){if(!r.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},n.prototype.isReservedId=function(e){return t.isReservedId(this.reserved,e)},n.prototype.isReservedName=function(e){return t.isReservedName(this.reserved,e)},_enum}function requireEncoder(){if(hasRequiredEncoder)return encoder_1;hasRequiredEncoder=1,encoder_1=function(i){for(var s,a=r.codegen(["m","w"],i.name+"$encode")("if(!w)")("w=Writer.create()"),o=i.fieldsArray.slice().sort(r.compareFieldsById),l=0;l<o.length;++l){var c=o[l].resolve(),u=i._fieldsArray.indexOf(c),h=c.resolvedType instanceof e?"int32":c.type,d=t.basic[h];s="m"+r.safeProp(c.name),c.map?(a("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",s,c.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",s)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(c.id<<3|2)>>>0,8|t.mapKey[c.keyType],c.keyType),void 0===d?a("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,s):a(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|d,h,s),a("}")("}")):c.repeated?(a("if(%s!=null&&%s.length){",s,s),c.packed&&void 0!==t.packed[h]?a("w.uint32(%i).fork()",(c.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",s)("w.%s(%s[i])",h,s)("w.ldelim()"):(a("for(var i=0;i<%s.length;++i)",s),void 0===d?n(a,c,u,s+"[i]"):a("w.uint32(%i).%s(%s[i])",(c.id<<3|d)>>>0,h,s)),a("}")):(c.optional&&a("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",s,c.name),void 0===d?n(a,c,u,s):a("w.uint32(%i).%s(%s)",(c.id<<3|d)>>>0,h,s))}return a("return w")};var e=require_enum(),t=requireTypes(),r=requireUtil$1();function n(e,t,r,n){return t.delimited?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)}return encoder_1}function requireIndexLight(){if(hasRequiredIndexLight)return indexLight.exports;hasRequiredIndexLight=1;var e=indexLight.exports=requireIndexMinimal();return e.build="light",e.load=function(t,r,n){return"function"==typeof r?(n=r,r=new e.Root):r||(r=new e.Root),r.load(t,n)},e.loadSync=function(t,r){return r||(r=new e.Root),r.loadSync(t)},e.encoder=requireEncoder(),e.decoder=requireDecoder(),e.verifier=requireVerifier(),e.converter=requireConverter(),e.ReflectionObject=requireObject(),e.Namespace=requireNamespace(),e.Root=requireRoot(),e.Enum=require_enum(),e.Type=requireType(),e.Field=requireField(),e.OneOf=requireOneof(),e.MapField=requireMapfield(),e.Service=requireService(),e.Method=requireMethod(),e.Message=requireMessage(),e.wrappers=requireWrappers(),e.types=requireTypes(),e.util=requireUtil$1(),e.ReflectionObject._configure(e.Root),e.Namespace._configure(e.Type,e.Service,e.Enum),e.Root._configure(e.Type),e.Field._configure(e.Type),indexLight.exports}function requireTokenize(){if(hasRequiredTokenize)return tokenize_1;hasRequiredTokenize=1,tokenize_1=u;var e=/[\s{}=;:[\],'"()<>]/g,t=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,r=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,n=/^ *[*/]+ */,i=/^\s*\*?\/*/,s=/\n/g,a=/\s/,o=/\\(.?)/g,l={0:"\0",r:"\r",n:"\n",t:"\t"};function c(e){return e.replace(o,function(e,t){switch(t){case"\\":case"":return t;default:return l[t]||""}})}function u(o,l){o=o.toString();var u=0,h=o.length,d=1,p=0,f={},g=[],v=null;function m(e){return Error("illegal "+e+" (line "+d+")")}function A(e){return o.charAt(e)}function y(e,t,r){var a,c={type:o.charAt(e++),lineEmpty:!1,leading:r},u=e-(l?2:3);do{if(--u<0||"\n"===(a=o.charAt(u))){c.lineEmpty=!0;break}}while(" "===a||"\t"===a);for(var h=o.substring(e,t).split(s),g=0;g<h.length;++g)h[g]=h[g].replace(l?i:n,"").trim();c.text=h.join("\n").trim(),f[d]=c,p=d}function C(e){var t=S(e),r=o.substring(e,t);return/^\s*\/\//.test(r)}function S(e){for(var t=e;t<h&&"\n"!==A(t);)t++;return t}function E(){if(g.length>0)return g.shift();if(v)return function(){var e="'"===v?r:t;e.lastIndex=u-1;var n=e.exec(o);if(!n)throw m("string");return u=e.lastIndex,_(v),v=null,c(n[1])}();var n,i,s,p,f,E=0===u;do{if(u===h)return null;for(n=!1;a.test(s=A(u));)if("\n"===s&&(E=!0,++d),++u===h)return null;if("/"===A(u)){if(++u===h)throw m("comment");if("/"===A(u))if(l){if(p=u,f=!1,C(u-1)){f=!0;do{if((u=S(u))===h)break;if(u++,!E)break}while(C(u))}else u=Math.min(h,S(u)+1);f&&(y(p,u,E),E=!0),d++,n=!0}else{for(f="/"===A(p=u+1);"\n"!==A(++u);)if(u===h)return null;++u,f&&(y(p,u-1,E),E=!0),++d,n=!0}else{if("*"!==(s=A(u)))return"/";p=u+1,f=l||"*"===A(p);do{if("\n"===s&&++d,++u===h)throw m("comment");i=s,s=A(u)}while("*"!==i||"/"!==s);++u,f&&(y(p,u-2,E),E=!0),n=!0}}}while(n);var b=u;if(e.lastIndex=0,!e.test(A(b++)))for(;b<h&&!e.test(A(b));)++b;var T=o.substring(u,u=b);return'"'!==T&&"'"!==T||(v=T),T}function _(e){g.push(e)}function b(){if(!g.length){var e=E();if(null===e)return null;_(e)}return g[0]}return Object.defineProperty({next:E,peek:b,push:_,skip:function(e,t){var r=b();if(r===e)return E(),!0;if(!t)throw m("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t,r=null;return void 0===e?(t=f[d-1],delete f[d-1],t&&(l||"*"===t.type||t.lineEmpty)&&(r=t.leading?t.text:null)):(p<e&&b(),t=f[e],delete f[e],!t||t.lineEmpty||!l&&"/"!==t.type||(r=t.leading?null:t.text)),r}},"line",{get:function(){return d}})}return u.unescape=c,tokenize_1}function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1,parse_1=S,S.filename=null,S.defaults={keepCase:!1};var e=requireTokenize(),t=requireRoot(),r=requireType(),n=requireField(),i=requireMapfield(),s=requireOneof(),a=require_enum(),o=requireService(),l=requireMethod(),c=requireObject(),u=requireTypes(),h=requireUtil$1(),d=/^[1-9][0-9]*$/,p=/^-?[1-9][0-9]*$/,f=/^0[x][0-9a-fA-F]+$/,g=/^-?0[x][0-9a-fA-F]+$/,v=/^0[0-7]+$/,m=/^-?0[0-7]+$/,A=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,y=/^[a-zA-Z_][a-zA-Z_0-9]*$/,C=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function S(E,_,b){_ instanceof t||(b=_,_=new t),b||(b=S.defaults);var T,R,x,w,k=b.preferTrailingComment||!1,N=e(E,b.alternateCommentMode||!1),I=N.next,O=N.push,P=N.peek,j=N.skip,L=N.cmnt,q=!0,M="proto2",D=_,F=[],B={},U=b.keepCase?function(e){return e}:h.camelCase;function $(e,t,r){var n=S.filename;return r||(S.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+N.line+")")}function z(){var e,t=[];do{if('"'!==(e=I())&&"'"!==e)throw $(e);t.push(I()),j(e),e=P()}while('"'===e||"'"===e);return t.join("")}function H(e){var t=I();switch(t){case"'":case'"':return O(t),z();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;"-"===e.charAt(0)&&(r=-1,e=e.substring(1));switch(e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(d.test(e))return r*parseInt(e,10);if(f.test(e))return r*parseInt(e,16);if(v.test(e))return r*parseInt(e,8);if(A.test(e))return r*parseFloat(e);throw $(e,"number",t)}(t,!0)}catch(e){if(C.test(t))return t;throw $(t,"value")}}function W(e,t){var r,n;do{if(!t||'"'!==(r=P())&&"'"!==r)try{e.push([n=G(I()),j("to",!0)?G(I()):n])}catch(n){if(!(t&&C.test(r)&&M>=2023))throw n;e.push(r)}else{var i=z();if(e.push(i),M>=2023)throw $(i,"id")}}while(j(",",!0));var s={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};Q(s,function(e){if("option"!==e)throw $(e);re(s,e),j(";")},function(){se(s)})}function G(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw $(e,"id");if(p.test(e))return parseInt(e,10);if(g.test(e))return parseInt(e,16);if(m.test(e))return parseInt(e,8);throw $(e,"id")}function V(){if(void 0!==T)throw $("package");if(T=I(),!C.test(T))throw $(T,"name");D=D.define(T),j(";")}function Y(){var e,t=P();switch(t){case"weak":e=x||(x=[]),I();break;case"public":I();default:e=R||(R=[])}t=z(),j(";"),e.push(t)}function K(){if(j("="),(M=z())<2023)throw $(M,"syntax");j(";")}function J(){j("="),M=z();if(!["2023"].includes(M))throw $(M,"edition");j(";")}function X(e,t){switch(t){case"option":return re(e,t),j(";"),!0;case"message":return Z(e,t),!0;case"enum":return te(e,t),!0;case"service":return function(e,t){if(!y.test(t=I()))throw $(t,"service name");var r=new o(t);Q(r,function(e){if(!X(r,e)){if("rpc"!==e)throw $(e);!function(e,t){var r=L(),n=t;if(!y.test(t=I()))throw $(t,"name");var i,s,a,o,c=t;j("("),j("stream",!0)&&(s=!0);if(!C.test(t=I()))throw $(t);i=t,j(")"),j("returns"),j("("),j("stream",!0)&&(o=!0);if(!C.test(t=I()))throw $(t);a=t,j(")");var u=new l(c,n,i,a,s,o);u.comment=r,Q(u,function(e){if("option"!==e)throw $(e);re(u,e),j(";")}),e.add(u)}(r,e)}}),e.add(r),e===D&&F.push(r)}(e,t),!0;case"extend":return function(e,t){if(!C.test(t=I()))throw $(t,"reference");var r=t;Q(null,function(t){switch(t){case"required":case"repeated":ee(e,t,r);break;case"optional":ee(e,"proto3"===M?"proto3_optional":"optional",r);break;default:if("proto2"===M||!C.test(t))throw $(t);O(t),ee(e,"optional",r)}})}(e,t),!0}return!1}function Q(e,t,r){var n=N.line;if(e&&("string"!=typeof e.comment&&(e.comment=L()),e.filename=S.filename),j("{",!0)){for(var i;"}"!==(i=I());)t(i);j(";",!0)}else r&&r(),j(";"),e&&("string"!=typeof e.comment||k)&&(e.comment=L(n)||e.comment)}function Z(e,t){if(!y.test(t=I()))throw $(t,"type name");var n=new r(t);Q(n,function(e){if(!X(n,e))switch(e){case"map":!function(e){j("<");var t=I();if(void 0===u.mapKey[t])throw $(t,"type");j(",");var r=I();if(!C.test(r))throw $(r,"type");j(">");var n=I();if(!y.test(n))throw $(n,"name");j("=");var s=new i(U(n),G(I()),t,r);Q(s,function(e){if("option"!==e)throw $(e);re(s,e),j(";")},function(){se(s)}),e.add(s)}(n);break;case"required":if("proto2"!==M)throw $(e);case"repeated":ee(n,e);break;case"optional":if("proto3"===M)ee(n,"proto3_optional");else{if("proto2"!==M)throw $(e);ee(n,"optional")}break;case"oneof":!function(e,t){if(!y.test(t=I()))throw $(t,"name");var r=new s(U(t));Q(r,function(e){"option"===e?(re(r,e),j(";")):(O(e),ee(r,"optional"))}),e.add(r)}(n,e);break;case"extensions":W(n.extensions||(n.extensions=[]));break;case"reserved":W(n.reserved||(n.reserved=[]),!0);break;default:if("proto2"===M||!C.test(e))throw $(e);O(e),ee(n,"optional")}}),e.add(n),e===D&&F.push(n)}function ee(e,t,i){var a=I();if("group"!==a){for(;a.endsWith(".")||P().startsWith(".");)a+=I();if(!C.test(a))throw $(a,"type");var o=I();if(!y.test(o))throw $(o,"name");o=U(o),j("=");var l=new n(o,G(I()),a,t,i);if(Q(l,function(e){if("option"!==e)throw $(e);re(l,e),j(";")},function(){se(l)}),"proto3_optional"===t){var c=new s("_"+o);l.setOption("proto3_optional",!0),c.add(l),e.add(c)}else e.add(l);e===D&&F.push(l)}else!function(e,t){if(M>=2023)throw $("group");var i=I();if(!y.test(i))throw $(i,"name");var s=h.lcFirst(i);i===s&&(i=h.ucFirst(i));j("=");var a=G(I()),o=new r(i);o.group=!0;var l=new n(s,a,i,t);l.filename=S.filename,Q(o,function(e){switch(e){case"option":re(o,e),j(";");break;case"required":case"repeated":ee(o,e);break;case"optional":ee(o,"proto3"===M?"proto3_optional":"optional");break;case"message":Z(o,e);break;case"enum":te(o,e);break;case"reserved":W(o.reserved||(o.reserved=[]),!0);break;default:throw $(e)}}),e.add(o).add(l)}(e,t)}function te(e,t){if(!y.test(t=I()))throw $(t,"name");var r=new a(t);Q(r,function(e){switch(e){case"option":re(r,e),j(";");break;case"reserved":W(r.reserved||(r.reserved=[]),!0),void 0===r.reserved&&(r.reserved=[]);break;default:!function(e,t){if(!y.test(t))throw $(t,"name");j("=");var r=G(I(),!0),n={options:void 0,getOption:function(e){return this.options[e]}};n.setOption=function(e,t){c.prototype.setOption.call(n,e,t)},n.setParsedOption=function(){},Q(n,function(e){if("option"!==e)throw $(e);re(n,e),j(";")},function(){se(n)}),e.add(t,r,n.comment,n.parsedOptions||n.options)}(r,e)}}),e.add(r),e===D&&F.push(r)}function re(e,t){var r,n,i=!0;for("option"===t&&(t=I());"="!==t;){if("("===t){var s=I();j(")"),t="("+s+")"}if(i){if(i=!1,t.includes(".")&&!t.includes("(")){var a=t.split(".");r=a[0]+".",t=a[1];continue}r=t}else n=n?n+=t:t;t=I()}var o=ne(e,n?r.concat(n):r);n=n&&"."===n[0]?n.slice(1):n,function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,r=r&&"."===r[r.length-1]?r.slice(0,-1):r,o,n)}function ne(e,t){if(j("{",!0)){for(var r={};!j("}",!0);){if(!y.test(w=I()))throw $(w,"name");if(null===w)throw $(w,"end of input");var n,i=w;if(j(":",!0),"{"===P())n=ne(e,t+"."+w);else if("["===P()){var s;if(n=[],j("[",!0)){do{s=H(),n.push(s)}while(j(",",!0));j("]"),void 0!==s&&ie(e,t+"."+w,s)}}else n=H(),ie(e,t+"."+w,n);var a=r[i];a&&(n=[].concat(a).concat(n)),r[i]=n,j(",",!0),j(";",!0)}return r}var o=H();return ie(e,t,o),o}function ie(e,t,r){D===e&&/^features\./.test(t)?B[t]=r:e.setOption&&e.setOption(t,r)}function se(e){if(j("[",!0)){do{re(e,"option")}while(j(",",!0));j("]")}return e}for(;null!==(w=I());)switch(w){case"package":if(!q)throw $(w);V();break;case"import":if(!q)throw $(w);Y();break;case"syntax":if(!q)throw $(w);K();break;case"edition":if(!q)throw $(w);J();break;case"option":re(D,w),j(";",!0);break;default:if(X(D,w)){q=!1;continue}throw $(w)}return F.forEach(e=>{e._edition=M,Object.keys(B).forEach(t=>{void 0===e.getOption(t)&&e.setOption(t,B[t],!0)})}),S.filename=null,{package:T,imports:R,weakImports:x,root:_}}return parse_1}function requireCommon(){if(hasRequiredCommon)return common_1;hasRequiredCommon=1,common_1=r;var e,t=/\/|\./;function r(e,n){t.test(e)||(e="google/protobuf/"+e+".proto",n={nested:{google:{nested:{protobuf:{nested:n}}}}}),r[e]=n}return r("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),r("duration",{Duration:e={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),r("timestamp",{Timestamp:e}),r("empty",{Empty:{fields:{}}}),r("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),r("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),r("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),r.get=function(e){return r[e]||null},common_1}function requireSrc$2(){if(hasRequiredSrc$2)return src.exports;hasRequiredSrc$2=1;var e=src.exports=requireIndexLight();return e.build="full",e.tokenize=requireTokenize(),e.parse=requireParse(),e.common=requireCommon(),e.Root._configure(e.Type,e.parse,e.common),src.exports}function requireProtobufjs(){return hasRequiredProtobufjs?protobufjs:(hasRequiredProtobufjs=1,protobufjs=requireSrc$2())}var descriptor={exports:{}},nested$3={google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536e6,536e6]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],[38,38],"php_generic_services"],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}},require$$4={nested:nested$3},hasRequiredDescriptor;function requireDescriptor(){return hasRequiredDescriptor||(hasRequiredDescriptor=1,function(e,t){var r=requireProtobufjs();e.exports=t=r.descriptor=r.Root.fromJSON(require$$4).lookup(".google.protobuf");var n=r.Namespace,i=r.Root,s=r.Enum,a=r.Type,o=r.Field,l=r.MapField,c=r.OneOf,u=r.Service,h=r.Method;function d(e,r,l){var c=t.FileDescriptorProto.create({name:e.filename||(e.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});!function(e,r){if(!e)return;if("proto2"===e||"proto3"===e)r.syntax=e;else{if(r.syntax="editions","2023"!==e)throw new Error("Unsupported edition "+e);r.edition=t.Edition.EDITION_2023}}(l,c),e instanceof i||(c.package=e.fullName.substring(1));for(var h,p=0;p<e.nestedArray.length;++p)(h=e._nestedArray[p])instanceof a?c.messageType.push(h.toDescriptor(l)):h instanceof s?c.enumType.push(h.toDescriptor()):h instanceof o?c.extension.push(h.toDescriptor(l)):h instanceof u?c.service.push(h.toDescriptor()):h instanceof n&&d(h,r,l);c.options=_(e.options,t.FileOptions),c.messageType.length+c.enumType.length+c.extension.length+c.service.length&&r.push(c)}i.fromDescriptor=function(e){"number"==typeof e.length&&(e=t.FileDescriptorSet.decode(e));var r=new i;if(e.file)for(var n,l,c,h=0;h<e.file.length;++h){l=r,(n=e.file[h]).package&&n.package.length&&(l=r.define(n.package));var d=R(n);if(n.name&&n.name.length&&r.files.push(l.filename=n.name),n.messageType)for(c=0;c<n.messageType.length;++c)l.add(a.fromDescriptor(n.messageType[c],d));if(n.enumType)for(c=0;c<n.enumType.length;++c)l.add(s.fromDescriptor(n.enumType[c],d));if(n.extension)for(c=0;c<n.extension.length;++c)l.add(o.fromDescriptor(n.extension[c],d));if(n.service)for(c=0;c<n.service.length;++c)l.add(u.fromDescriptor(n.service[c],d));var p=S(n.options,t.FileOptions);if(p){var f=Object.keys(p);for(c=0;c<f.length;++c)l.setOption(f[c],p[f[c]])}}return r.resolveAll()},i.prototype.toDescriptor=function(e){var r=t.FileDescriptorSet.create();return d(this,r.file,e),r};var p=0;a.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.DescriptorProto.decode(e));var i,l=new a(e.name.length?e.name:"Type"+p++,S(e.options,t.MessageOptions));if(n||(l._edition=r),e.oneofDecl)for(i=0;i<e.oneofDecl.length;++i)l.add(c.fromDescriptor(e.oneofDecl[i]));if(e.field)for(i=0;i<e.field.length;++i){var u=o.fromDescriptor(e.field[i],r,!0);l.add(u),e.field[i].hasOwnProperty("oneofIndex")&&l.oneofsArray[e.field[i].oneofIndex].add(u)}if(e.extension)for(i=0;i<e.extension.length;++i)l.add(o.fromDescriptor(e.extension[i],r,!0));if(e.nestedType)for(i=0;i<e.nestedType.length;++i)l.add(a.fromDescriptor(e.nestedType[i],r,!0)),e.nestedType[i].options&&e.nestedType[i].options.mapEntry&&l.setOption("map_entry",!0);if(e.enumType)for(i=0;i<e.enumType.length;++i)l.add(s.fromDescriptor(e.enumType[i],r,!0));if(e.extensionRange&&e.extensionRange.length)for(l.extensions=[],i=0;i<e.extensionRange.length;++i)l.extensions.push([e.extensionRange[i].start,e.extensionRange[i].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(l.reserved=[],e.reservedRange)for(i=0;i<e.reservedRange.length;++i)l.reserved.push([e.reservedRange[i].start,e.reservedRange[i].end]);if(e.reservedName)for(i=0;i<e.reservedName.length;++i)l.reserved.push(e.reservedName[i])}return l},a.prototype.toDescriptor=function(e){var r,n=t.DescriptorProto.create({name:this.name});for(r=0;r<this.fieldsArray.length;++r){var i;if(n.field.push(i=this._fieldsArray[r].toDescriptor(e)),this._fieldsArray[r]instanceof l){var c=y(this._fieldsArray[r].keyType,this._fieldsArray[r].resolvedKeyType,!1),u=y(this._fieldsArray[r].type,this._fieldsArray[r].resolvedType,!1),h=11===u||14===u?this._fieldsArray[r].resolvedType&&b(this.parent,this._fieldsArray[r].resolvedType)||this._fieldsArray[r].type:void 0;n.nestedType.push(t.DescriptorProto.create({name:i.typeName,field:[t.FieldDescriptorProto.create({name:"key",number:1,label:1,type:c}),t.FieldDescriptorProto.create({name:"value",number:2,label:1,type:u,typeName:h})],options:t.MessageOptions.create({mapEntry:!0})}))}}for(r=0;r<this.oneofsArray.length;++r)n.oneofDecl.push(this._oneofsArray[r].toDescriptor());for(r=0;r<this.nestedArray.length;++r)this._nestedArray[r]instanceof o?n.field.push(this._nestedArray[r].toDescriptor(e)):this._nestedArray[r]instanceof a?n.nestedType.push(this._nestedArray[r].toDescriptor(e)):this._nestedArray[r]instanceof s&&n.enumType.push(this._nestedArray[r].toDescriptor());if(this.extensions)for(r=0;r<this.extensions.length;++r)n.extensionRange.push(t.DescriptorProto.ExtensionRange.create({start:this.extensions[r][0],end:this.extensions[r][1]}));if(this.reserved)for(r=0;r<this.reserved.length;++r)"string"==typeof this.reserved[r]?n.reservedName.push(this.reserved[r]):n.reservedRange.push(t.DescriptorProto.ReservedRange.create({start:this.reserved[r][0],end:this.reserved[r][1]}));return n.options=_(this.options,t.MessageOptions),n};var f=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;o.fromDescriptor=function(e,r,n){if("number"==typeof e.length&&(e=t.DescriptorProto.decode(e)),"number"!=typeof e.number)throw Error("missing field id");var i,s;switch(i=e.typeName&&e.typeName.length?e.typeName:function(e){switch(e){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+e)}(e.type),e.label){case 1:s=void 0;break;case 2:s="required";break;case 3:s="repeated";break;default:throw Error("illegal label: "+e.label)}var a=e.extendee;void 0!==e.extendee&&(a=a.length?a:void 0);var l=new o(e.name.length?e.name:"field"+e.number,e.number,i,s,a);if(n||(l._edition=r),l.options=S(e.options,t.FieldOptions),e.proto3_optional&&(l.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var c=e.defaultValue;switch(c){case"true":case"TRUE":c=!0;break;case"false":case"FALSE":c=!1;break;default:f.exec(c)&&(c=parseInt(c))}l.setOption("default",c)}return function(e){switch(e){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}(e.type)&&("proto3"===r?e.options&&!e.options.packed&&l.setOption("packed",!1):r&&"proto2"!==r||!e.options||!e.options.packed||l.setOption("packed",!0)),l},o.prototype.toDescriptor=function(e){var n=t.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)n.type=11,n.typeName=r.util.ucFirst(this.name),n.label=3;else{switch(n.type=y(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:n.typeName=this.resolvedType?b(this.parent,this.resolvedType):this.type}"repeated"===this.rule?n.label=3:this.required&&"proto2"===e?n.label=2:n.label=1}if(n.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&(n.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(n.options=_(this.options,t.FieldOptions),null!=this.options.default&&(n.defaultValue=String(this.options.default)),this.options.proto3_optional&&(n.proto3_optional=!0)),"proto3"===e?this.packed||((n.options||(n.options=t.FieldOptions.create())).packed=!1):e&&"proto2"!==e||!this.packed||((n.options||(n.options=t.FieldOptions.create())).packed=!0),n};var g=0;s.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.EnumDescriptorProto.decode(e));var i={};if(e.value)for(var a=0;a<e.value.length;++a){var o=e.value[a].name,l=e.value[a].number||0;i[o&&o.length?o:"NAME"+l]=l}var c=new s(e.name&&e.name.length?e.name:"Enum"+g++,i,S(e.options,t.EnumOptions));return n||(c._edition=r),c},s.prototype.toDescriptor=function(){for(var e=[],r=0,n=Object.keys(this.values);r<n.length;++r)e.push(t.EnumValueDescriptorProto.create({name:n[r],number:this.values[n[r]]}));return t.EnumDescriptorProto.create({name:this.name,value:e,options:_(this.options,t.EnumOptions)})};var v=0;c.fromDescriptor=function(e){return"number"==typeof e.length&&(e=t.OneofDescriptorProto.decode(e)),new c(e.name&&e.name.length?e.name:"oneof"+v++)},c.prototype.toDescriptor=function(){return t.OneofDescriptorProto.create({name:this.name})};var m=0;u.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.ServiceDescriptorProto.decode(e));var i=new u(e.name&&e.name.length?e.name:"Service"+m++,S(e.options,t.ServiceOptions));if(n||(i._edition=r),e.method)for(var s=0;s<e.method.length;++s)i.add(h.fromDescriptor(e.method[s]));return i},u.prototype.toDescriptor=function(){for(var e=[],r=0;r<this.methodsArray.length;++r)e.push(this._methodsArray[r].toDescriptor());return t.ServiceDescriptorProto.create({name:this.name,method:e,options:_(this.options,t.ServiceOptions)})};var A=0;function y(e,t,r){switch(e){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(t instanceof s)return 14;if(t instanceof a)return r?10:11;throw Error("illegal type: "+e)}function C(e,t){for(var r,n,i={},o=0;o<t.fieldsArray.length;++o)if("uninterpretedOption"!==(n=(r=t._fieldsArray[o]).name)&&Object.prototype.hasOwnProperty.call(e,n)){var l=T(n);r.resolvedType instanceof a?i[l]=C(e[n],r.resolvedType):r.resolvedType instanceof s?i[l]=r.resolvedType.valuesById[e[n]]:i[l]=e[n]}return i}function S(e,t){if(e)return C(t.toObject(e),t)}function E(e,t){for(var n={},i=Object.keys(e),s=0;s<i.length;++s){var o=i[s],l=r.util.camelCase(o);if(Object.prototype.hasOwnProperty.call(t.fields,l)){var c=t.fields[l];c.resolvedType instanceof a?n[l]=E(e[o],c.resolvedType):n[l]=e[o],c.repeated&&!Array.isArray(n[l])&&(n[l]=[n[l]])}}return n}function _(e,t){if(e)return t.fromObject(E(e,t))}function b(e,t){var r=e.fullName.split("."),s=t.fullName.split("."),a=0,o=0,l=s.length-1;if(!(e instanceof i)&&t instanceof n)for(;a<r.length&&o<l&&r[a]===s[o];){var c=t.lookup(r[a++],!0);if(null!==c&&c!==t)break;++o}else for(;a<r.length&&o<l&&r[a]===s[o];++a,++o);return s.slice(o).join(".")}function T(e){return e.substring(0,1)+e.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return"_"+t.toLowerCase()})}function R(e){if("editions"===e.syntax){if(e.edition===t.Edition.EDITION_2023)return"2023";throw new Error("Unsupported edition "+e.edition)}return"proto3"===e.syntax?"proto3":"proto2"}h.fromDescriptor=function(e){return"number"==typeof e.length&&(e=t.MethodDescriptorProto.decode(e)),new h(e.name&&e.name.length?e.name:"Method"+A++,"rpc",e.inputType,e.outputType,Boolean(e.clientStreaming),Boolean(e.serverStreaming),S(e.options,t.MethodOptions))},h.prototype.toDescriptor=function(){return t.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:_(this.options,t.MethodOptions)})}}(descriptor,descriptor.exports)),descriptor.exports}var util={},nested$2={google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}},require$$3={nested:nested$2},nested$1={google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}},require$$5={nested:nested$1},nested={google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}},require$$6={nested:nested},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;hasRequiredUtil=1,
|
|
2
3
|
/**
|
|
3
4
|
* @license
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hzhangxyz/ddss",
|
|
3
|
-
"
|
|
3
|
+
"license": "AGPL-3.0-or-later",
|
|
4
|
+
"version": "v0.0.1-alpha2",
|
|
4
5
|
"type": "module",
|
|
5
|
-
"bin": "dist/main.
|
|
6
|
-
"main": "dist/main.
|
|
7
|
-
"module": "dist/main.
|
|
6
|
+
"bin": "dist/main.js",
|
|
7
|
+
"main": "dist/main.js",
|
|
8
|
+
"module": "dist/main.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/main.js"
|
|
11
|
+
],
|
|
8
12
|
"scripts": {
|
|
9
13
|
"proto": "protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=. --ts_proto_opt=outputServices=grpc-js,env=node ./ddss.proto",
|
|
10
14
|
"rollup": "rollup -c rollup.config.js",
|
package/ddss.proto
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package cn.edu.ustc.kclab.ddss;
|
|
4
|
-
|
|
5
|
-
// 节点信息
|
|
6
|
-
message Node {
|
|
7
|
-
string id = 1; // 节点唯一标识符
|
|
8
|
-
string addr = 2; // 节点地址(格式: IP:端口)
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// 加入集群请求
|
|
12
|
-
message JoinRequest {
|
|
13
|
-
Node node = 1; // 请求加入的节点信息
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// 加入集群响应
|
|
17
|
-
message JoinResponse {
|
|
18
|
-
repeated Node nodes = 1; // 当前集群中所有节点的列表
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// 离开集群请求
|
|
22
|
-
message LeaveRequest {
|
|
23
|
-
Node node = 1; // 请求离开的节点信息
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// 离开集群响应
|
|
27
|
-
message LeaveResponse {
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
service Cluster {
|
|
31
|
-
// 向对方节点发送加入请求, 对方负责将本节点信息加入其本地信息, 并返回当前集群中所有节点的信息, 由本节点负责向其他节点发送加入请求
|
|
32
|
-
rpc Join(JoinRequest) returns (JoinResponse);
|
|
33
|
-
// 向对方节点发送离开请求, 对方负责将本节点信息从其本地信息中删除, 由本节点负责向所有节点发送离开请求
|
|
34
|
-
rpc Leave(LeaveRequest) returns (LeaveResponse);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// 引擎类型
|
|
38
|
-
enum EngineKind {
|
|
39
|
-
EAGER = 0; // 积极模式:主动搜索数据
|
|
40
|
-
LAZY = 1; // 惰性模式:被动响应查询
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// 引擎元数据
|
|
44
|
-
message EngineMetaData {
|
|
45
|
-
string id = 1; // 引擎标识符
|
|
46
|
-
EngineKind kind = 2; // 引擎类型
|
|
47
|
-
repeated string input = 3; // 输入数据模式列表
|
|
48
|
-
repeated string output = 4; // 输出数据模式列表
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// 获取元数据请求
|
|
52
|
-
message MetaDataRequest {
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// 获取元数据响应
|
|
56
|
-
message MetaDataResponse {
|
|
57
|
-
EngineMetaData metadata = 1; // 引擎元数据信息
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// 推送数据请求
|
|
61
|
-
message PushDataRequest {
|
|
62
|
-
repeated string data = 1; // 要推送的数据列表
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// 推送数据响应
|
|
66
|
-
message PushDataResponse {
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// 拉取数据请求
|
|
70
|
-
message PullDataRequest {
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// 拉取数据响应
|
|
74
|
-
message PullDataResponse {
|
|
75
|
-
repeated string data = 1; // 返回的数据列表
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
service Engine {
|
|
79
|
-
// 获取引擎的元数据信息
|
|
80
|
-
rpc MetaData(MetaDataRequest) returns (MetaDataResponse);
|
|
81
|
-
// 推送数据到对方, 对方不负责转发到其他节点
|
|
82
|
-
rpc PushData(PushDataRequest) returns (PushDataResponse);
|
|
83
|
-
// 从对方拉取先前所有数据, 对方不负责收集其他节点数据
|
|
84
|
-
rpc PullData(PullDataRequest) returns (PullDataResponse);
|
|
85
|
-
}
|
|
Binary file
|
package/main.ts
DELETED
|
@@ -1,472 +0,0 @@
|
|
|
1
|
-
// 导入工具模块
|
|
2
|
-
import {
|
|
3
|
-
promisify, // 将回调函数转换为 Promise 的工具
|
|
4
|
-
} from "util";
|
|
5
|
-
import {
|
|
6
|
-
randomUUID, // 生成随机 UUID
|
|
7
|
-
} from "crypto";
|
|
8
|
-
import {
|
|
9
|
-
createInterface, // 创建readline接口用于读取stdin
|
|
10
|
-
} from "readline";
|
|
11
|
-
// 导入 gRPC 相关模块
|
|
12
|
-
import * as grpc from "@grpc/grpc-js"; // gRPC JavaScript 实现
|
|
13
|
-
// 导入 ATSDS(自适应树搜索数据结构)相关模块
|
|
14
|
-
import {
|
|
15
|
-
Search as Search_, // ATSDS 搜索引擎基类
|
|
16
|
-
Rule,
|
|
17
|
-
} from "atsds";
|
|
18
|
-
import {
|
|
19
|
-
parse, // 解析规则字符串为内部表示
|
|
20
|
-
unparse, // 将内部表示转换为规则字符串
|
|
21
|
-
} from "atsds-bnf";
|
|
22
|
-
// 导入生成的 Protocol Buffers 类型和服务
|
|
23
|
-
import {
|
|
24
|
-
Node,
|
|
25
|
-
JoinRequest,
|
|
26
|
-
JoinResponse,
|
|
27
|
-
LeaveRequest,
|
|
28
|
-
LeaveResponse,
|
|
29
|
-
MetaDataRequest,
|
|
30
|
-
MetaDataResponse,
|
|
31
|
-
PushDataRequest,
|
|
32
|
-
PushDataResponse,
|
|
33
|
-
PullDataRequest,
|
|
34
|
-
PullDataResponse,
|
|
35
|
-
EngineKind,
|
|
36
|
-
ClusterClient,
|
|
37
|
-
ClusterServer,
|
|
38
|
-
ClusterService,
|
|
39
|
-
EngineClient,
|
|
40
|
-
EngineServer,
|
|
41
|
-
EngineService,
|
|
42
|
-
} from "./ddss.js";
|
|
43
|
-
|
|
44
|
-
interface NodeClient {
|
|
45
|
-
cluster: ClusterClient;
|
|
46
|
-
engine: EngineClient;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
interface NodeInfoWithClient {
|
|
50
|
-
id: string;
|
|
51
|
-
addr: string;
|
|
52
|
-
client: NodeClient;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* 搜索引擎类
|
|
57
|
-
* 扩展 ATSDS 的 Search 类,提供字符串形式的规则处理和数据管理
|
|
58
|
-
*/
|
|
59
|
-
class Search extends Search_ {
|
|
60
|
-
private data: Set<string>;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* 构造函数
|
|
64
|
-
* @param {number} limit_size - Size of the buffer for storing the final objects (rules/facts) in the knowledge base (default: 1000)
|
|
65
|
-
* @param {number} buffer_size - Size of the buffer for internal operations like conversions and transformations (default: 10000)
|
|
66
|
-
*/
|
|
67
|
-
constructor(limit_size: number = 1000, buffer_size: number = 10000) {
|
|
68
|
-
super(limit_size, buffer_size);
|
|
69
|
-
this.data = new Set(); // 存储已添加的数据(使用 Set 避免重复)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* 输入规则到搜索引擎
|
|
74
|
-
* @param {string} rule - 规则字符串
|
|
75
|
-
*/
|
|
76
|
-
input(rule: string): string | null {
|
|
77
|
-
const parsedRule = parse(rule); // 解析规则字符串
|
|
78
|
-
if (super.add(parsedRule)) {
|
|
79
|
-
const unparsedRule = unparse(parsedRule);
|
|
80
|
-
this.data.add(unparsedRule); // 添加成功则保存到数据集合
|
|
81
|
-
return unparsedRule;
|
|
82
|
-
}
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* 执行搜索并输出结果
|
|
88
|
-
* @param {function} callback - 处理搜索结果的回调函数
|
|
89
|
-
* @returns {*} - 搜索执行结果
|
|
90
|
-
*/
|
|
91
|
-
output(callback: (result: string) => boolean): number {
|
|
92
|
-
return super.execute((candidate: Rule) => {
|
|
93
|
-
const result = unparse(candidate.toString());
|
|
94
|
-
this.data.add(result); // 保存搜索结果到数据集合
|
|
95
|
-
return callback(result);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* 获取所有已存储的数据
|
|
101
|
-
* @returns {Array<string>} - 数据数组
|
|
102
|
-
*/
|
|
103
|
-
getData(): string[] {
|
|
104
|
-
return [...this.data];
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* 集群节点类
|
|
110
|
-
* 管理分布式搜索引擎集群中的单个节点
|
|
111
|
-
*/
|
|
112
|
-
class ClusterNode {
|
|
113
|
-
id: string;
|
|
114
|
-
addr: string;
|
|
115
|
-
engine: Search;
|
|
116
|
-
server: grpc.Server;
|
|
117
|
-
nodes: Map<string, NodeInfoWithClient>;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* 构造函数
|
|
121
|
-
* @param {string} addr - 节点绑定地址
|
|
122
|
-
* @param {string} id - 节点唯一标识符,默认随机生成
|
|
123
|
-
* @param {number} limit_size - 搜索引擎的限制大小参数,默认 1000
|
|
124
|
-
* @param {number} buffer_size - 搜索引擎的缓冲区大小参数,默认 10000
|
|
125
|
-
*/
|
|
126
|
-
constructor(
|
|
127
|
-
addr: string,
|
|
128
|
-
id: string = randomUUID(),
|
|
129
|
-
limit_size: number = 1000,
|
|
130
|
-
buffer_size: number = 10000,
|
|
131
|
-
) {
|
|
132
|
-
this.id = id; // 节点 ID
|
|
133
|
-
this.addr = addr; // 节点地址
|
|
134
|
-
this.engine = new Search(limit_size, buffer_size); // 创建搜索引擎实例
|
|
135
|
-
this.server = new grpc.Server();
|
|
136
|
-
this.nodes = new Map(); // 存储集群中所有节点信息
|
|
137
|
-
// 将自己加入节点列表
|
|
138
|
-
this.nodes.set(id, {
|
|
139
|
-
id,
|
|
140
|
-
addr,
|
|
141
|
-
client: {
|
|
142
|
-
cluster: null as any,
|
|
143
|
-
engine: null as any,
|
|
144
|
-
},
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* 设置定时循环执行搜索任务
|
|
149
|
-
* 每秒执行一次搜索,并将新发现的数据推送到其他节点
|
|
150
|
-
*/
|
|
151
|
-
private setupSearchLoop(): void {
|
|
152
|
-
const loop = async (): Promise<void> => {
|
|
153
|
-
const begin = Date.now();
|
|
154
|
-
const data: string[] = []; // 存储本轮搜索发现的新数据
|
|
155
|
-
// 执行搜索引擎,处理搜索结果
|
|
156
|
-
this.engine.output((result: string) => {
|
|
157
|
-
data.push(result); // 添加到待推送列表(结果已由 engine.output 自动保存)
|
|
158
|
-
console.log(`Found data: ${result}`);
|
|
159
|
-
return false; // 继续搜索
|
|
160
|
-
});
|
|
161
|
-
// 如果发现新数据,推送到所有其他节点
|
|
162
|
-
if (data.length > 0) {
|
|
163
|
-
for (const id of this.nodes.keys()) {
|
|
164
|
-
if (id !== this.id) {
|
|
165
|
-
// 排除自己
|
|
166
|
-
const node = this.nodes.get(id)!;
|
|
167
|
-
const pushDataAsync = promisify<PushDataRequest, PushDataResponse>(
|
|
168
|
-
node.client.engine.pushData,
|
|
169
|
-
).bind(node.client.engine);
|
|
170
|
-
await pushDataAsync({
|
|
171
|
-
data,
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
const end = Date.now();
|
|
177
|
-
const cost = end - begin; // 计算本轮执行耗时
|
|
178
|
-
const waiting = Math.max(1000 - cost, 0); // 计算等待时间,确保每秒执行一次
|
|
179
|
-
setTimeout(loop, waiting); // 安排下次执行
|
|
180
|
-
};
|
|
181
|
-
setTimeout(loop, 0);
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* 设置stdin读取循环
|
|
185
|
-
* 持续读取标准输入,每收到一行时将其输入到搜索引擎并推送到所有其他节点
|
|
186
|
-
*/
|
|
187
|
-
private setupStdinLoop(): ReturnType<typeof createInterface> {
|
|
188
|
-
const rl = createInterface({
|
|
189
|
-
input: process.stdin,
|
|
190
|
-
output: process.stdout,
|
|
191
|
-
terminal: false,
|
|
192
|
-
});
|
|
193
|
-
rl.on("line", async (line: string) => {
|
|
194
|
-
// 去除空白字符
|
|
195
|
-
const trimmedLine = line.trim();
|
|
196
|
-
if (trimmedLine.length === 0) {
|
|
197
|
-
return; // 跳过空行
|
|
198
|
-
}
|
|
199
|
-
// 将输入喂给搜索引擎
|
|
200
|
-
const formattedLine = this.engine.input(trimmedLine);
|
|
201
|
-
if (formattedLine === null) {
|
|
202
|
-
return; // 已存在则跳过
|
|
203
|
-
}
|
|
204
|
-
console.log(`Received input from stdin: ${formattedLine}`);
|
|
205
|
-
// 推送到所有其他节点(排除自己)
|
|
206
|
-
for (const id of this.nodes.keys()) {
|
|
207
|
-
if (id !== this.id) {
|
|
208
|
-
// 排除自己
|
|
209
|
-
const node = this.nodes.get(id)!;
|
|
210
|
-
const pushDataAsync = promisify<PushDataRequest, PushDataResponse>(
|
|
211
|
-
node.client.engine.pushData,
|
|
212
|
-
).bind(node.client.engine);
|
|
213
|
-
await pushDataAsync({
|
|
214
|
-
data: [formattedLine],
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
return rl;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* 创建节点信息对象
|
|
223
|
-
* @param {string} id - 节点 ID
|
|
224
|
-
* @param {string} addr - 节点地址
|
|
225
|
-
* @returns {Object} 包含节点信息和 gRPC 客户端的对象
|
|
226
|
-
*/
|
|
227
|
-
private nodeInfo(id: string, addr: string): NodeInfoWithClient {
|
|
228
|
-
return {
|
|
229
|
-
id: id,
|
|
230
|
-
addr: addr,
|
|
231
|
-
client: {
|
|
232
|
-
// 创建集群管理服务客户端
|
|
233
|
-
cluster: new ClusterClient(addr, grpc.credentials.createInsecure()),
|
|
234
|
-
// 创建引擎服务客户端
|
|
235
|
-
engine: new EngineClient(addr, grpc.credentials.createInsecure()),
|
|
236
|
-
},
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* 启动节点监听服务
|
|
241
|
-
* 创建 gRPC 服务器并注册集群管理和引擎服务
|
|
242
|
-
* @returns {ClusterNode} 返回当前节点实例
|
|
243
|
-
*/
|
|
244
|
-
async listen(): Promise<ClusterNode> {
|
|
245
|
-
// 注册集群管理服务
|
|
246
|
-
this.server.addService(ClusterService, {
|
|
247
|
-
/**
|
|
248
|
-
* 处理节点加入请求
|
|
249
|
-
* 将请求节点加入本地节点列表,并返回当前所有节点信息
|
|
250
|
-
*/
|
|
251
|
-
join: async (
|
|
252
|
-
call: grpc.ServerUnaryCall<JoinRequest, JoinResponse>,
|
|
253
|
-
callback: grpc.sendUnaryData<JoinResponse>,
|
|
254
|
-
) => {
|
|
255
|
-
const node = call.request.node!;
|
|
256
|
-
const { id, addr } = node;
|
|
257
|
-
if (!this.nodes.has(id)) {
|
|
258
|
-
this.nodes.set(id, this.nodeInfo(id, addr));
|
|
259
|
-
console.log(`Joined with node ${id} at ${addr}`);
|
|
260
|
-
}
|
|
261
|
-
const nodes = [...this.nodes.values()].map((n) => ({
|
|
262
|
-
id: n.id,
|
|
263
|
-
addr: n.addr,
|
|
264
|
-
}));
|
|
265
|
-
callback(null, {
|
|
266
|
-
nodes,
|
|
267
|
-
});
|
|
268
|
-
},
|
|
269
|
-
/**
|
|
270
|
-
* 处理节点离开请求
|
|
271
|
-
* 将请求节点从本地节点列表中移除
|
|
272
|
-
*/
|
|
273
|
-
leave: async (
|
|
274
|
-
call: grpc.ServerUnaryCall<LeaveRequest, LeaveResponse>,
|
|
275
|
-
callback: grpc.sendUnaryData<LeaveResponse>,
|
|
276
|
-
) => {
|
|
277
|
-
const node = call.request.node!;
|
|
278
|
-
const { id, addr } = node;
|
|
279
|
-
if (this.nodes.has(id)) {
|
|
280
|
-
this.nodes.delete(id);
|
|
281
|
-
console.log(`Left node ${id} at ${addr}`);
|
|
282
|
-
}
|
|
283
|
-
callback(null, {});
|
|
284
|
-
},
|
|
285
|
-
});
|
|
286
|
-
// 注册引擎服务
|
|
287
|
-
this.server.addService(EngineService, {
|
|
288
|
-
/**
|
|
289
|
-
* 处理元数据查询请求
|
|
290
|
-
* 返回引擎的元数据信息
|
|
291
|
-
*/
|
|
292
|
-
metaData: async (
|
|
293
|
-
call: grpc.ServerUnaryCall<MetaDataRequest, MetaDataResponse>,
|
|
294
|
-
callback: grpc.sendUnaryData<MetaDataResponse>,
|
|
295
|
-
) => {
|
|
296
|
-
callback(null, {
|
|
297
|
-
metadata: {
|
|
298
|
-
id: this.id,
|
|
299
|
-
kind: EngineKind.EAGER, // 积极模式
|
|
300
|
-
input: ["`x"], // 输入模式
|
|
301
|
-
output: ["`x"], // 输出模式
|
|
302
|
-
},
|
|
303
|
-
});
|
|
304
|
-
},
|
|
305
|
-
/**
|
|
306
|
-
* 处理数据推送请求
|
|
307
|
-
* 接收其他节点推送的数据并添加到本地搜索引擎
|
|
308
|
-
*/
|
|
309
|
-
pushData: async (
|
|
310
|
-
call: grpc.ServerUnaryCall<PushDataRequest, PushDataResponse>,
|
|
311
|
-
callback: grpc.sendUnaryData<PushDataResponse>,
|
|
312
|
-
) => {
|
|
313
|
-
const data = call.request.data!;
|
|
314
|
-
for (const item of data) {
|
|
315
|
-
console.log(`Received data: ${item}`);
|
|
316
|
-
this.engine.input(item);
|
|
317
|
-
}
|
|
318
|
-
callback(null, {});
|
|
319
|
-
},
|
|
320
|
-
/**
|
|
321
|
-
* 处理数据拉取请求
|
|
322
|
-
* 返回本地存储的所有数据
|
|
323
|
-
*/
|
|
324
|
-
pullData: async (
|
|
325
|
-
call: grpc.ServerUnaryCall<PullDataRequest, PullDataResponse>,
|
|
326
|
-
callback: grpc.sendUnaryData<PullDataResponse>,
|
|
327
|
-
) => {
|
|
328
|
-
callback(null, {
|
|
329
|
-
data: this.engine.getData(),
|
|
330
|
-
});
|
|
331
|
-
},
|
|
332
|
-
});
|
|
333
|
-
// 绑定服务器到指定地址
|
|
334
|
-
const bindAsync = promisify<string, grpc.ServerCredentials, number>(
|
|
335
|
-
this.server.bindAsync,
|
|
336
|
-
).bind(this.server);
|
|
337
|
-
await bindAsync(this.addr, grpc.ServerCredentials.createInsecure());
|
|
338
|
-
this.setupSearchLoop();
|
|
339
|
-
const rl = this.setupStdinLoop();
|
|
340
|
-
// 注册进程终止信号处理器,确保优雅退出
|
|
341
|
-
process.on("SIGINT", async () => {
|
|
342
|
-
rl.close(); // 关闭 readline 接口
|
|
343
|
-
await this.leave(); // 通知其他节点本节点离开
|
|
344
|
-
process.exit(0);
|
|
345
|
-
});
|
|
346
|
-
// 注册 SIGUSR1 信号处理器,打印所有节点信息
|
|
347
|
-
process.on("SIGUSR1", () => {
|
|
348
|
-
console.log("=== All Nodes Information ===");
|
|
349
|
-
for (const [id, nodeInfo] of this.nodes.entries()) {
|
|
350
|
-
console.log(`Node ID: ${id}`);
|
|
351
|
-
console.log(` Address: ${nodeInfo.addr}`);
|
|
352
|
-
}
|
|
353
|
-
console.log(`Total nodes: ${this.nodes.size}`);
|
|
354
|
-
console.log("=============================");
|
|
355
|
-
});
|
|
356
|
-
// 注册 SIGUSR2 信号处理器,打印所有数据
|
|
357
|
-
process.on("SIGUSR2", () => {
|
|
358
|
-
console.log("=== All Data Managed by Search ===");
|
|
359
|
-
const data = this.engine.getData();
|
|
360
|
-
data.forEach((item, index) => {
|
|
361
|
-
console.log(`[${index + 1}] ${item}`);
|
|
362
|
-
});
|
|
363
|
-
console.log(`Total data items: ${data.length}`);
|
|
364
|
-
console.log("==================================");
|
|
365
|
-
});
|
|
366
|
-
console.log(`Node ${this.id} listening on ${this.addr}`);
|
|
367
|
-
return this;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* 加入现有集群
|
|
371
|
-
* @param {string} addr - 要加入的集群中某个节点的地址
|
|
372
|
-
*/
|
|
373
|
-
async join(addr: string): Promise<void> {
|
|
374
|
-
// 创建目标节点的集群服务客户端
|
|
375
|
-
const client = new ClusterClient(addr, grpc.credentials.createInsecure());
|
|
376
|
-
const joinAsync = promisify<JoinRequest, JoinResponse>(client.join).bind(
|
|
377
|
-
client,
|
|
378
|
-
);
|
|
379
|
-
// 向目标节点发送加入请求
|
|
380
|
-
const response = await joinAsync({
|
|
381
|
-
node: this,
|
|
382
|
-
});
|
|
383
|
-
// 遍历集群中的所有节点
|
|
384
|
-
const localData = this.engine.getData();
|
|
385
|
-
for (const node of response.nodes) {
|
|
386
|
-
if (!this.nodes.has(node.id)) {
|
|
387
|
-
// 创建节点信息并保存
|
|
388
|
-
const nodeInfo = this.nodeInfo(node.id, node.addr);
|
|
389
|
-
this.nodes.set(node.id, nodeInfo);
|
|
390
|
-
// 向该节点发送加入请求
|
|
391
|
-
const nodeJoinAsync = promisify<JoinRequest, JoinResponse>(
|
|
392
|
-
nodeInfo.client.cluster.join,
|
|
393
|
-
).bind(nodeInfo.client.cluster);
|
|
394
|
-
await nodeJoinAsync({
|
|
395
|
-
node: this,
|
|
396
|
-
});
|
|
397
|
-
// 如果本地有数据,推送给新节点
|
|
398
|
-
if (localData.length > 0) {
|
|
399
|
-
const nodePushAsync = promisify<PushDataRequest, PushDataResponse>(
|
|
400
|
-
nodeInfo.client.engine.pushData,
|
|
401
|
-
).bind(nodeInfo.client.engine);
|
|
402
|
-
await nodePushAsync({
|
|
403
|
-
data: localData,
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
// 从该节点拉取历史数据
|
|
407
|
-
const nodePullAsync = promisify<PullDataRequest, PullDataResponse>(
|
|
408
|
-
nodeInfo.client.engine.pullData,
|
|
409
|
-
).bind(nodeInfo.client.engine);
|
|
410
|
-
const dataResponse = await nodePullAsync({});
|
|
411
|
-
if (dataResponse.data) {
|
|
412
|
-
for (const item of dataResponse.data) {
|
|
413
|
-
console.log(`Receiving data: ${item}`);
|
|
414
|
-
this.engine.input(item); // 添加到搜索引擎(数据自动保存)
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
console.log(`Joining node ${node.id} at ${node.addr}`);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* 离开集群
|
|
423
|
-
* 向所有其他节点发送离开通知
|
|
424
|
-
*/
|
|
425
|
-
async leave(): Promise<void> {
|
|
426
|
-
for (const id of this.nodes.keys()) {
|
|
427
|
-
if (id !== this.id) {
|
|
428
|
-
// 排除自己
|
|
429
|
-
const node = this.nodes.get(id)!;
|
|
430
|
-
const leaveAsync = promisify<LeaveRequest, LeaveResponse>(
|
|
431
|
-
node.client.cluster.leave,
|
|
432
|
-
).bind(node.client.cluster);
|
|
433
|
-
await leaveAsync({
|
|
434
|
-
node: this,
|
|
435
|
-
});
|
|
436
|
-
console.log(`Leaving node ${node.id} at ${node.addr}`);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
// ============================================================
|
|
443
|
-
// 主程序入口
|
|
444
|
-
// ============================================================
|
|
445
|
-
|
|
446
|
-
// 命令行参数检查
|
|
447
|
-
// 用法: node dist/main.mjs <bind_addr> [<join_addr>]
|
|
448
|
-
// bind_addr: 本节点绑定的端口号
|
|
449
|
-
// join_addr: (可选) 要加入的集群中某个节点的端口号
|
|
450
|
-
if (process.argv.length < 3 || process.argv.length > 4) {
|
|
451
|
-
console.error("Usage: main <bind_addr> [<join_addr>]");
|
|
452
|
-
process.exit(1);
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
// 场景一: 加入现有集群
|
|
456
|
-
// 启动节点并加入指定地址的集群
|
|
457
|
-
if (process.argv.length === 4) {
|
|
458
|
-
console.log(
|
|
459
|
-
`Starting node at ${process.argv[2]} and joining ${process.argv[3]}`,
|
|
460
|
-
);
|
|
461
|
-
const node = new ClusterNode(`0.0.0.0:${process.argv[2]}`);
|
|
462
|
-
await node.listen(); // 启动服务监听
|
|
463
|
-
await node.join(`0.0.0.0:${process.argv[3]}`); // 加入集群
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
// 场景二: 创建新集群
|
|
467
|
-
// 启动第一个节点,作为集群的初始节点
|
|
468
|
-
if (process.argv.length === 3) {
|
|
469
|
-
console.log(`Starting node at ${process.argv[2]}`);
|
|
470
|
-
const node = new ClusterNode(`0.0.0.0:${process.argv[2]}`);
|
|
471
|
-
await node.listen(); // 启动服务监听
|
|
472
|
-
}
|
package/rollup.config.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import commonjs from "@rollup/plugin-commonjs";
|
|
2
|
-
import resolve from "@rollup/plugin-node-resolve";
|
|
3
|
-
import typescript from "@rollup/plugin-typescript";
|
|
4
|
-
import terser from "@rollup/plugin-terser";
|
|
5
|
-
import json from "@rollup/plugin-json";
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
input: "main.ts",
|
|
9
|
-
output: {
|
|
10
|
-
file: "dist/main.js",
|
|
11
|
-
format: "es",
|
|
12
|
-
},
|
|
13
|
-
plugins: [
|
|
14
|
-
resolve(),
|
|
15
|
-
commonjs(),
|
|
16
|
-
json(),
|
|
17
|
-
typescript(),
|
|
18
|
-
terser()
|
|
19
|
-
]
|
|
20
|
-
};
|
package/tsconfig.json
DELETED