@oaknational/google-classroom-addon 1.11.1 → 1.13.0

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.
@@ -4,7 +4,7 @@
4
4
  * Copyright(c) 2012-2014 Roman Shtylman
5
5
  * Copyright(c) 2015 Douglas Christopher Wilson
6
6
  * MIT Licensed
7
- */function requireCookie(){if(hasRequiredCookie)return cookie;hasRequiredCookie=1,cookie.parse=function(e,r){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},o=e.length;if(o<2)return n;var i=r&&r.decode||l,d=0,u=0,c=0;do{if(-1===(u=e.indexOf("=",d)))break;if(-1===(c=e.indexOf(";",d)))c=o;else if(u>c){d=e.lastIndexOf(";",u-1)+1;continue}var f=a(e,d,u),h=s(e,u,f),m=e.slice(f,h);if(!t.call(n,m)){var g=a(e,u+1,c),y=s(e,c,g);34===e.charCodeAt(g)&&34===e.charCodeAt(y-1)&&(g++,y--);var v=e.slice(g,y);n[m]=p(v,i)}d=c+1}while(d<o);return n},cookie.serialize=function(t,a,s){var l=s&&s.encode||encodeURIComponent;if("function"!=typeof l)throw new TypeError("option encode is invalid");if(!r.test(t))throw new TypeError("argument name is invalid");var p=l(a);if(!n.test(p))throw new TypeError("argument val is invalid");var d=t+"="+p;if(!s)return d;if(null!=s.maxAge){var u=Math.floor(s.maxAge);if(!isFinite(u))throw new TypeError("option maxAge is invalid");d+="; Max-Age="+u}if(s.domain){if(!o.test(s.domain))throw new TypeError("option domain is invalid");d+="; Domain="+s.domain}if(s.path){if(!i.test(s.path))throw new TypeError("option path is invalid");d+="; Path="+s.path}if(s.expires){var c=s.expires;if(!function(t){return"[object Date]"===e.call(t)}(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");d+="; Expires="+c.toUTCString()}s.httpOnly&&(d+="; HttpOnly");s.secure&&(d+="; Secure");s.partitioned&&(d+="; Partitioned");if(s.priority){switch("string"==typeof s.priority?s.priority.toLowerCase():s.priority){case"low":d+="; Priority=Low";break;case"medium":d+="; Priority=Medium";break;case"high":d+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(s.sameSite){switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return d};var e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,r=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,n=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,o=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,i=/^[\u0020-\u003A\u003D-\u007E]*$/;function a(e,t,r){do{var n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<r);return r}function s(e,t,r){for(;t>r;){var n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return r}function l(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function p(e,t){try{return t(e)}catch(t){return e}}return cookie}requireCookie();var alphabetByEncoding={},alphabetByValue=Array.from({length:64});for(let e=0,t="A".charCodeAt(0),r="Z".charCodeAt(0);e+t<=r;e++){const r=String.fromCharCode(e+t);alphabetByEncoding[r]=e,alphabetByValue[e]=r}for(let e=0,t="a".charCodeAt(0),r="z".charCodeAt(0);e+t<=r;e++){const r=String.fromCharCode(e+t),n=e+26;alphabetByEncoding[r]=n,alphabetByValue[n]=r}for(let e=0;e<10;e++){alphabetByEncoding[e.toString(10)]=e+52;const t=e.toString(10),r=e+52;alphabetByEncoding[t]=r,alphabetByValue[r]=t}alphabetByEncoding["-"]=62,alphabetByValue[62]="-",alphabetByEncoding._=63,alphabetByValue[63]="_";var bitsPerLetter=6,bitsPerByte=8,maxLetterValue=63,stringToBuffer=e=>(new TextEncoder).encode(e),bufferToString=e=>(new TextDecoder).decode(e),base64urlDecode=e=>{const t=e+"=".repeat((4-e.length%4)%4);let r=t.length/4*3;t.endsWith("==")?r-=2:t.endsWith("=")&&r--;const n=new ArrayBuffer(r),o=new DataView(n);for(let e=0;e<t.length;e+=4){let r=0,n=0;for(let o=e,i=e+3;o<=i;o++)if("="===t[o])r>>=bitsPerLetter;else{if(!(t[o]in alphabetByEncoding))throw new TypeError(`Invalid character ${t[o]} in base64 string.`);r|=alphabetByEncoding[t[o]]<<(i-o)*bitsPerLetter,n+=bitsPerLetter}const i=e/4*3;r>>=n%bitsPerByte;const a=Math.floor(n/bitsPerByte);for(let e=0;e<a;e++){const t=(a-e-1)*bitsPerByte;o.setUint8(i+e,(r&255<<t)>>t)}}return new Uint8Array(n)},base64urlEncode=e=>{const t="string"==typeof e?stringToBuffer(e):e;let r="";for(let e=0;e<t.length;e+=3){let n=0,o=0;for(let r=e,i=Math.min(e+3,t.length);r<i;r++)n|=t[r]<<(i-r-1)*bitsPerByte,o+=bitsPerByte;const i=Math.ceil(o/bitsPerLetter);n<<=i*bitsPerLetter-o;for(let e=1;e<=i;e++){const t=(i-e)*bitsPerLetter;r+=alphabetByValue[(n&maxLetterValue<<t)>>t]}}return r},defaults={encryption:{saltBits:256,algorithm:"aes-256-cbc",iterations:1,minPasswordlength:32},integrity:{saltBits:256,algorithm:"sha256",iterations:1,minPasswordlength:32},ttl:0,timestampSkewSec:60,localtimeOffsetMsec:0},clone$1=e=>({...e,encryption:{...e.encryption},integrity:{...e.integrity}}),algorithms={"aes-128-ctr":{keyBits:128,ivBits:128,name:"AES-CTR"},"aes-256-cbc":{keyBits:256,ivBits:128,name:"AES-CBC"},sha256:{keyBits:256,name:"SHA-256"}},macPrefix="Fe26.2",randomBytes=(e,t)=>{const r=new Uint8Array(t);return e.getRandomValues(r),r},randomBits=(e,t)=>{if(t<1)throw new Error("Invalid random bits count");const r=Math.ceil(t/8);return randomBytes(e,r)},pbkdf2=async(e,t,r,n,o,i)=>{const a=stringToBuffer(t),s=await e.subtle.importKey("raw",a,{name:"PBKDF2"},!1,["deriveBits"]),l={name:"PBKDF2",hash:i,salt:stringToBuffer(r),iterations:n};return await e.subtle.deriveBits(l,s,8*o)},generateKey=async(e,t,r)=>{var n;if(!(null==t?void 0:t.length))throw new Error("Empty password");if(null==r||"object"!=typeof r)throw new Error("Bad options");if(!(r.algorithm in algorithms))throw new Error(`Unknown algorithm: ${r.algorithm}`);const o=algorithms[r.algorithm],i={},a=null!=(n=r.hmac)&&n,s=a?{name:"HMAC",hash:o.name}:{name:o.name},l=a?["sign","verify"]:["encrypt","decrypt"];if("string"==typeof t){if(t.length<r.minPasswordlength)throw new Error(`Password string too short (min ${r.minPasswordlength} characters required)`);let{salt:n=""}=r;if(!n){const{saltBits:t=0}=r;if(!t)throw new Error("Missing salt and saltBits options");const o=randomBits(e,t);n=[...new Uint8Array(o)].map(e=>e.toString(16).padStart(2,"0")).join("")}const a=await pbkdf2(e,t,n,r.iterations,o.keyBits/8,"SHA-1"),p=await e.subtle.importKey("raw",a,s,!1,l);i.key=p,i.salt=n}else{if(t.length<o.keyBits/8)throw new Error("Key buffer (password) too small");i.key=await e.subtle.importKey("raw",t,s,!1,l),i.salt=""}return r.iv?i.iv=r.iv:"ivBits"in o&&(i.iv=randomBits(e,o.ivBits)),i},getEncryptParams=(e,t,r)=>["aes-128-ctr"===e?{name:"AES-CTR",counter:t.iv,length:128}:{name:"AES-CBC",iv:t.iv},t.key,"string"==typeof r?stringToBuffer(r):r],encrypt=async(e,t,r,n)=>{const o=await generateKey(e,t,r),i=await e.subtle.encrypt(...getEncryptParams(r.algorithm,o,n));return{encrypted:new Uint8Array(i),key:o}},decrypt=async(e,t,r,n)=>{const o=await generateKey(e,t,r),i=await e.subtle.decrypt(...getEncryptParams(r.algorithm,o,n));return bufferToString(new Uint8Array(i))},hmacWithPassword=async(e,t,r,n)=>{const o=await generateKey(e,t,{...r,hmac:!0}),i=stringToBuffer(n),a=await e.subtle.sign({name:"HMAC"},o.key,i);return{digest:base64urlEncode(new Uint8Array(a)),salt:o.salt}},normalizePassword=e=>"string"==typeof e||e instanceof Uint8Array?{encryption:e,integrity:e}:"secret"in e?{id:e.id,encryption:e.secret,integrity:e.secret}:{id:e.id,encryption:e.encryption,integrity:e.integrity},seal=async(e,t,r,n)=>{if(!r)throw new Error("Empty password");const o=clone$1(n),i=Date.now()+(o.localtimeOffsetMsec||0),a=JSON.stringify(t),s=normalizePassword(r),{id:l="",encryption:p,integrity:d}=s;if(l&&!/^\w+$/.test(l))throw new Error("Invalid password id");const{encrypted:u,key:c}=await encrypt(e,p,o.encryption,a),f=base64urlEncode(new Uint8Array(u)),h=base64urlEncode(c.iv),m=o.ttl?i+o.ttl:"",g=`${macPrefix}*${l}*${c.salt}*${h}*${f}*${m}`,y=await hmacWithPassword(e,d,o.integrity,g);return`${g}*${y.salt}*${y.digest}`},fixedTimeComparison=(e,t)=>{let r=e.length===t.length?0:1;r&&(t=e);for(let n=0;n<e.length;n+=1)r|=e.charCodeAt(n)^t.charCodeAt(n);return 0===r},unseal=async(e,t,r,n)=>{if(!r)throw new Error("Empty password");const o=clone$1(n),i=Date.now()+(o.localtimeOffsetMsec||0),a=t.split("*");if(8!==a.length)throw new Error("Incorrect number of sealed components");const s=a[0];let l=a[1];const p=a[2],d=a[3],u=a[4],c=a[5],f=a[6],h=a[7],m=`${s}*${l}*${p}*${d}*${u}*${c}`;if(macPrefix!==s)throw new Error("Wrong mac prefix");if(c){if(!/^\d+$/.test(c))throw new Error("Invalid expiration");if(Number.parseInt(c,10)<=i-1e3*o.timestampSkewSec)throw new Error("Expired seal")}let g="";if(l=l||"default","string"==typeof r||r instanceof Uint8Array)g=r;else{if(!(l in r))throw new Error(`Cannot find password: ${l}`);g=r[l]}g=normalizePassword(g);const y=o.integrity;y.salt=f;const v=await hmacWithPassword(e,g.integrity,y,m);if(!fixedTimeComparison(v.digest,h))throw new Error("Bad hmac value");const b=base64urlDecode(u),O=o.encryption;O.salt=p,O.iv=base64urlDecode(d);const w=await decrypt(e,g.encryption,O,b);return w?JSON.parse(w):null};const webCrypto=globalThis.crypto,subtle=webCrypto.subtle,randomUUID$1=()=>webCrypto.randomUUID(),getRandomValues$1=e=>webCrypto.getRandomValues(e),_crypto={randomUUID:randomUUID$1,getRandomValues:getRandomValues$1,subtle:subtle};var crypto$1=Object.freeze({__proto__:null,default:_crypto,getRandomValues:getRandomValues$1,randomUUID:randomUUID$1,subtle:subtle}),fourteenDaysInSeconds=1209600,currentMajorVersion=2,versionDelimiter="~";function normalizeStringPasswordToMap(e){return"string"==typeof e?{1:e}:e}function parseSeal(e){const[t,r]=e.split(versionDelimiter);return{sealWithoutVersion:t,tokenVersion:null==r?null:parseInt(r,10)}}function createSealData(e){return async function(t,{password:r,ttl:n=fourteenDaysInSeconds}){const o=normalizeStringPasswordToMap(r),i=Math.max(...Object.keys(o).map(Number)),a={id:i.toString(),secret:o[i]};return`${await seal(e,t,a,{...defaults,ttl:1e3*n})}${versionDelimiter}${currentMajorVersion}`}}function createUnsealData(e){return async function(t,{password:r,ttl:n=fourteenDaysInSeconds}){const o=normalizeStringPasswordToMap(r),{sealWithoutVersion:i,tokenVersion:a}=parseSeal(t);try{const t=await unseal(e,i,o,{...defaults,ttl:1e3*n})??{};return 2===a?t:{...t.persistent}}catch(e){if(e instanceof Error&&/^(Expired seal|Bad hmac value|Cannot find password|Incorrect number of sealed components)/.test(e.message))return{};throw e}}}var sealData=createSealData(crypto$1),unsealData=createUnsealData(crypto$1),createAnnouncementAttachmentArgsSchema=z__default.default.object({courseId:z__default.default.string(),itemId:z__default.default.string(),addOnToken:z__default.default.string(),title:z__default.default.string(),lessonSlug:z__default.default.string(),programmeSlug:z__default.default.string(),unitSlug:z__default.default.string(),maxPoints:z__default.default.number().optional()}),classroomAttachmentSchema=z__default.default.object({courseId:z__default.default.string(),postId:z__default.default.string(),id:z__default.default.string(),title:z__default.default.string(),teacherViewUri:z__default.default.object({uri:z__default.default.string()}),studentViewUri:z__default.default.object({uri:z__default.default.string()}),studentWorkReviewUri:z__default.default.object({uri:z__default.default.string()}).optional(),itemId:z__default.default.string(),maxPoints:z__default.default.number().optional()});z__default.default.string();var googleOAuthUserSchema=z__default.default.object({accessToken:z__default.default.string(),loginHint:z__default.default.string(),refreshToken:z__default.default.string().optional(),profilePictureUrl:z__default.default.string().optional(),email:z__default.default.string().optional()}),tokenPayloadSchema=z__default.default.object({token:z__default.default.string()});z__default.default.tuple([createAnnouncementAttachmentArgsSchema,z__default.default.string().min(1),z__default.default.string().min(1)]);var classroomAttachmentEntitySchema=classroomAttachmentSchema.extend({attachmentId:z__default.default.string(),createdAt:z__default.default.string()}),userCredentialsEntitySchema=z__default.default.object({loginHint:z__default.default.string(),refreshToken:z__default.default.string().optional(),profilePictureUrl:z__default.default.string().optional()}),GoogleClassroomClient=function(){function e(e,t){this.baseUrl=e,this.oAuthClient=t,this.baseUrl=e,this.oAuthClient=t}return e.prototype.getClassroomClient=function(){return __awaiter(this,void 0,void 0,function(){var e;return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.oAuthClient.getOAuth2Client()];case 1:return e=t.sent(),[2,new classroom.classroom_v1.Classroom({auth:e})]}})})},e.prototype.createAnnouncementAttachment=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o,i,a,s,l,p,d,u,c,f;return __generator$1(this,function(h){switch(h.label){case 0:return t=e.courseId,r=e.itemId,n=e.addOnToken,o=e.title,i=e.lessonSlug,a=e.programmeSlug,s=e.unitSlug,l=e.maxPoints,[4,this.getClassroomClient()];case 1:return p=h.sent(),d=l?{maxPoints:l,studentWorkReviewUri:{uri:"".concat(this.baseUrl,"/pupils/programmes/").concat(a,"/units/").concat(s,"/lessons/").concat(i)}}:{},[4,p.courses.courseWork.addOnAttachments.create({courseId:t,itemId:r,addOnToken:n,requestBody:__assign({title:o,teacherViewUri:{uri:"".concat(this.baseUrl,"/pupils/programmes/").concat(a,"/units/").concat(s,"/lessons/").concat(i)},studentViewUri:{uri:"".concat(this.baseUrl,"/pupils/programmes/").concat(a,"/units/").concat(s,"/lessons/").concat(i)}},d)})];case 2:return u=h.sent(),c=classroomAttachmentSchema.parse(u.data),f=c.maxPoints?{maxPoints:c.maxPoints,studentWorkReviewUri:c.studentWorkReviewUri}:{},[2,__assign({courseId:c.courseId,postId:c.postId,id:c.id,title:c.title,teacherViewUri:c.teacherViewUri,studentViewUri:c.studentViewUri,itemId:c.itemId},f)]}})})},e.prototype.submitPupilResponse=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.getClassroomClient()];case 1:return[4,t.sent().courses.courseWork.addOnAttachments.studentSubmissions.patch({courseId:e.courseId,itemId:e.itemId,attachmentId:e.attachmentId,submissionId:e.submissionId,updateMask:"pointsEarned",requestBody:{pointsEarned:e.pointsEarned}})];case 2:return[2,t.sent().data]}})})},e.prototype.fetchPupilResponse=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.getClassroomClient()];case 1:return[4,t.sent().courses.courseWork.addOnAttachments.studentSubmissions.get({courseId:e.courseId,itemId:e.itemId,attachmentId:e.attachmentId,submissionId:e.submissionId})];case 2:return[2,t.sent().data]}})})},e}(),ExceptionType,ErrorSeverity;exports.ExceptionType=void 0,ExceptionType=exports.ExceptionType||(exports.ExceptionType={}),ExceptionType.GoogleOAuth="google-oauth",ExceptionType.Firestore="firestore",ExceptionType.Encryption="encryption",exports.ErrorSeverity=void 0,ErrorSeverity=exports.ErrorSeverity||(exports.ErrorSeverity={}),ErrorSeverity.Error="error",ErrorSeverity.Warning="warning",ErrorSeverity.Info="info";var OakGoogleClassroomException=function(e){function t(t,r,n){var o,i,a,s=e.call(this,t)||this;return s.name="OakGoogleClassroomException",s.type=r,s.code=null==n?void 0:n.code,s.shouldRetry=null!==(o=null==n?void 0:n.shouldRetry)&&void 0!==o&&o,s.severity=null!==(i=null==n?void 0:n.severity)&&void 0!==i?i:exports.ErrorSeverity.Error,s.context=null==n?void 0:n.context,s.originalError=null==n?void 0:n.originalError,(null===(a=null==n?void 0:n.originalError)||void 0===a?void 0:a.stack)&&(s.stack=n.originalError.stack),s}return __extends$1(t,e),t}(Error),src$7={},src$6={},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$3="1.14.0",require$$11={version:version$3},hasRequiredLogging;function requireLogging(){return hasRequiredLogging||(hasRequiredLogging=1,function(e){var t,r,n,o;Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.setLoggerVerbosity=e.setLogger=e.getLogger=void 0,e.trace=function(t,r,n){m(r)&&(0,e.log)(t,(new Date).toISOString()+" | v"+s+" "+a.pid+" | "+r+" | "+n)},e.isTracerEnabled=m;const i=requireConstants(),a=require$$1__default.default,s=require$$11.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 p=l,d=i.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":d=i.LogVerbosity.DEBUG;break;case"INFO":d=i.LogVerbosity.INFO;break;case"ERROR":d=i.LogVerbosity.ERROR;break;case"NONE":d=i.LogVerbosity.NONE}e.getLogger=()=>p;e.setLogger=e=>{p=e};e.setLoggerVerbosity=e=>{d=e};e.log=(e,...t)=>{let r;if(e>=d){switch(e){case i.LogVerbosity.DEBUG:r=p.debug;break;case i.LogVerbosity.INFO:r=p.info;break;case i.LogVerbosity.ERROR:r=p.error}r||(r=p.error),r&&r.bind(p)(...t)}};const u=null!==(o=null!==(n=process.env.GRPC_NODE_TRACE)&&void 0!==n?n:process.env.GRPC_TRACE)&&void 0!==o?o:"",c=new Set,f=new Set;for(const e of u.split(","))e.startsWith("-")?f.add(e.substring(1)):c.add(e);const h=c.has("all");function m(e){return!f.has(e)&&(h||c.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_.-]+$/,o=/^[ -~]*$/;function i(e){return e.endsWith("-bin")}function a(e){return!e.startsWith("grpc-")}function s(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(i(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 o.test(e)}(t))throw new Error('Metadata string value "'+t+'" contains illegal characters')}}class p{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,t){l(e=s(e),t),this.internalRepr.set(e,[t])}add(e,t){l(e=s(e),t);const r=this.internalRepr.get(e);void 0===r?this.internalRepr.set(e,[t]):r.push(t)}remove(e){e=s(e),this.internalRepr.delete(e)}get(e){return e=s(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 p(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(d));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 o=new p;for(const s of Object.keys(n)){if(":"===s.charAt(0))continue;const l=n[s];try{i(s)?Array.isArray(l)?l.forEach(e=>{o.add(s,Buffer.from(e,"base64"))}):void 0!==l&&(a(s)?l.split(",").forEach(e=>{o.add(s,Buffer.from(e.trim(),"base64"))}):o.add(s,Buffer.from(l,"base64"))):Array.isArray(l)?l.forEach(e=>{o.add(s,e)}):void 0!==l&&o.add(s,l)}catch(n){const o=`Failed to add metadata entry ${s}: ${l}. ${(0,r.getErrorMessage)(n)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,e.log)(t.LogVerbosity.ERROR,o)}}return o}}metadata.Metadata=p;const d=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 o;o=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"))})}),o.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 o}}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 o extends t{generateMetadata(t){return Promise.resolve(new e.Metadata)}compose(e){return e}_equals(e){return e instanceof o}}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__default.default;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 o=e.substring(r+2);return t.test(o)?{host:n,port:+o}: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,o){if(void 0!==r.scheme&&r.scheme in t)return new t[r.scheme](r,n,o);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 f(e,t,null!=r?r:{})};const e=require$$1__default$1.default,t=requireCallCredentials(),r=requireTlsHelpers(),n=requireUriParser(),o=requireResolver(),i=requireLogging(),a=requireConstants();function s(e,t){if(e&&!(e instanceof Buffer))throw new TypeError(`${t}, if provided, must be a Buffer.`)}class l{compose(e){return new h(this,e)}static createSsl(t,n,o,i){var a;if(s(t,"Root certificate"),s(n,"Private key"),s(o,"Certificate chain"),n&&!o)throw new Error("Private key must be given with accompanying certificate chain");if(!n&&o)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!=o?o:void 0,ciphers:r.CIPHER_SUITES});return new c(l,null!=i?i:{})}static createFromSecureContext(e,t){return new c(e,null!=t?t:{})}static createInsecure(){return new p}}channelCredentials.ChannelCredentials=l;class p extends l{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof p}_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 d(t,r,i,a){var s,l;const p={secureContext:t};let d=i;if("grpc.http_connect_target"in a){const e=(0,n.parseUri)(a["grpc.http_connect_target"]);e&&(d=e)}const u=(0,o.getDefaultAuthority)(d),c=(0,n.splitHostPort)(u),f=null!==(s=null==c?void 0:c.host)&&void 0!==s?s:u;if(p.host=f,r.checkServerIdentity&&(p.checkServerIdentity=r.checkServerIdentity),void 0!==r.rejectUnauthorized&&(p.rejectUnauthorized=r.rejectUnauthorized),p.ALPNProtocols=["h2"],a["grpc.ssl_target_name_override"]){const t=a["grpc.ssl_target_name_override"],r=null!==(l=p.checkServerIdentity)&&void 0!==l?l:e.checkServerIdentity;p.checkServerIdentity=(e,n)=>r(t,n),p.servername=t}else p.servername=f;return a["grpc-node.tls_enable_trace"]&&(p.enableTrace=!0),p}class u{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 o=(0,e.connect)(r,()=>{var e;null!==(e=this.connectionOptions.rejectUnauthorized)&&void 0!==e&&!e||o.authorized?t({socket:o,secure:!0}):n(o.authorizationError)});o.on("error",e=>{n(e)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}}class c extends l{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e||e instanceof c&&(this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity)}_createSecureConnector(e,r,n){const o=d(this.secureContext,this.verifyOptions,e,r);return new u(o,null!=n?n:t.CallCredentials.createEmpty())}}class f 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 f&&(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 f.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,i.log)(a.LogVerbosity.ERROR,"Failed to createSecureContext with error "+e.message),null}}}f.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 o=this.parent.getLatestSecureContext();if(!o)return void n(new Error("Failed to load credentials"));t.closed&&n(new Error("Socket closed while loading credentials"));const i=d(o,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:t},i),s=()=>{n(new Error("Socket closed"))},l=e=>{n(e)},p=(0,e.connect)(a,()=>{var e;p.removeListener("close",s),p.removeListener("error",l),null!==(e=this.parent.verifyOptions.rejectUnauthorized)&&void 0!==e&&!e||p.authorized?r({socket:p,secure:!0}):n(p.authorizationError)});p.once("close",s),p.once("error",l)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};class h 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 h(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e||e instanceof h&&(this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials))}_createSecureConnector(e,r,n){const o=this.callCredentials.compose(null!=n?n:t.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,r,o)}}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,o,i,a,s,l,p,d,u;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!==(i=null===(o=t.updateState)||void 0===o?void 0:o.bind(t))&&void 0!==i?i:e.updateState.bind(e),requestReresolution:null!==(s=null===(a=t.requestReresolution)||void 0===a?void 0:a.bind(t))&&void 0!==s?s:e.requestReresolution.bind(e),addChannelzChild:null!==(p=null===(l=t.addChannelzChild)||void 0===l?void 0:l.bind(t))&&void 0!==p?p:e.addChannelzChild.bind(e),removeChannelzChild:null!==(u=null===(d=t.removeChannelzChild)||void 0===d?void 0:d.bind(t))&&void 0!==u?u: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=o,loadBalancer.getDefaultConfig=function(){if(!n)throw new Error("No default load balancer type registered");return new r[n].LoadBalancingConfig},loadBalancer.selectLbConfigFromList=function(i,a=!1){for(const r of i)try{return o(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 o(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 d(JSON.parse(e),t)}return null};const e=require$$0__default$1.default,t=requireConstants(),r=/^\d+(\.\d{1,9})?s$/,n="node";function o(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 i(e){var n;const i={name:[]};if(!("name"in e)||!Array.isArray(e.name))throw new Error("Invalid method config: invalid name array");for(const t of e.name)i.name.push(o(t));if("waitForReady"in e){if("boolean"!=typeof e.waitForReady)throw new Error("Invalid method config: invalid waitForReady");i.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");i.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(".");i.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");i.maxRequestBytes=e.maxRequestBytes}if("maxResponseBytes"in e){if("number"!=typeof e.maxResponseBytes)throw new Error("Invalid method config: invalid maxRequestBytes");i.maxResponseBytes=e.maxResponseBytes}if("retryPolicy"in e){if("hedgingPolicy"in e)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");i.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&&(i.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 i}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 s(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(s(r))}if("methodConfig"in e&&Array.isArray(e.methodConfig))for(const r of e.methodConfig)t.methodConfig.push(i(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 p(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 d(t,r){if(!Array.isArray(t))throw new Error("Invalid service config list");for(const o of t){const t=p(o);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 o;if(this.calledByPendingChild()){if(e===t.ConnectivityState.CONNECTING)return;null===(o=this.parent.currentChild)||void 0===o||o.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,o){let i;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,i=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=n,i=this.pendingChild)}else i=null===this.pendingChild?this.currentChild:this.pendingChild;return this.latestConfig=r,i.updateAddressList(t,r,n,o)}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(),o=requirePicker(),i=requireBackoffTimeout(),a=requireConstants(),s=requireMetadata(),l=requireLogging(),p=requireConstants(),d=requireUriParser(),u=requireLoadBalancerChildHandler();function c(e){l.trace(p.LogVerbosity.DEBUG,"resolving_load_balancer",e)}const f=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function h(e,t,r,n){for(const o of r.name)switch(n){case"EMPTY":if(!o.service&&!o.method)return!0;break;case"SERVICE":if(o.service===e&&!o.method)return!0;break;case"SERVICE_AND_METHOD":if(o.service===e&&o.method===t)return!0}return!1}function m(e,t,r,n){for(const o of r)if(h(e,t,o,n))return o;return null}return resolvingLoadBalancer.ResolvingLoadBalancer=class{constructor(e,a,s,l,p){this.target=e,this.channelControlHelper=a,this.channelOptions=s,this.onSuccessfulResolution=l,this.onFailedResolution=p,this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new o.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,s["grpc.service_config"]?this.defaultServiceConfig=(0,t.validateServiceConfig)(JSON.parse(s["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(r.ConnectivityState.IDLE,new o.QueuePicker(this),null),this.childLoadBalancer=new u.ChildLoadBalancerHandler({createSubchannel:a.createSubchannel.bind(a),requestReresolution:()=>{this.backoffTimeout.isRunning()?(c("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),s);const d={initialDelay:s["grpc.initial_reconnect_backoff_ms"],maxDelay:s["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new i.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},d),this.backoffTimeout.unref()}handleResolverResult(t,r,o,i){var l,p;this.backoffTimeout.stop(),this.backoffTimeout.reset();let d=!0,u=null;if(null===o?u=this.defaultServiceConfig:o.ok?u=o.value:null!==this.previousServiceConfig?u=this.previousServiceConfig:(d=!1,this.handleResolutionFailure(o.error)),null!==u){const n=null!==(l=null==u?void 0:u.loadBalancingConfig)&&void 0!==l?l:[],o=(0,e.selectLbConfigFromList)(n,!0);null===o?(d=!1,this.handleResolutionFailure({code:a.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new s.Metadata})):d=this.childLoadBalancer.updateAddressList(t,o,Object.assign(Object.assign({},this.channelOptions),r),i)}return d&&this.onSuccessfulResolution(u,null!==(p=r[n.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])&&void 0!==p?p:function(e){return{invoke(t,r){var n,o;const i=t.split("/").filter(e=>e.length>0),s=null!==(n=i[0])&&void 0!==n?n:"",l=null!==(o=i[1])&&void 0!==o?o:"";if(e&&e.methodConfig)for(const t of f){const r=m(s,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(){}}}(u)),d}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){c((0,d.uriToString)(this.target)+" "+r.ConnectivityState[this.currentState]+" -> "+r.ConnectivityState[e]),e===r.ConnectivityState.IDLE&&(t=new o.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 o.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 o.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 o=0;o<r.length;o+=1){if(r[o]!==n[o])return!1;if(e[r[o]]!==t[n[o]])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:o}:{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=i;const e=require$$0__default$2.default;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 o=443;function i(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 o of t.addresses)if(r(n,o)){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(i(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,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return l([e,t])}}function l(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[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 o=t.h;if(t===o.t?o.t=void 0:o.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;o!==this.A;)o.O-=1,o=o.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,o=0,i=this.N,a=[];a.length||i;)if(i)a.push(i),i=i.t;else{if(i=a.pop(),o===t)return i;n&&n.push(i),r&&r(i,o,this),o+=1,i=i.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):(o=r.h).t===r?o.t=e:o.i=e,e.h=r.h,t.h=e,r.h=e,r.l=1}else{var n,o;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):(o=r.h).t===r?o.t=e:o.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,o=this.A.t,i=this.g(o.u,e);if(0===i)return o.o=t,this._;if(i>0)o.t=new this.S(e,t),o.t.h=o,n=o.t,this.A.t=n;else{var a=this.A.i,s=this.g(a.u,e);if(0===s)return a.o=t,this._;if(s<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 p=this.g(l.u,e);if(0===p)return l.o=t,this._;if(p>0){var d=l.v(),u=this.g(d.u,e);if(0===u)return d.o=t,this._;u<0&&(n=new this.S(e,t),void 0===d.i?(d.i=n,n.h=d):(l.t=n,n.h=l))}}}if(void 0===n)for(n=this.N;;){var c=this.g(n.u,e);if(c>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(!(c<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 f=n.h;f!==this.A;)f.O+=1,f=f.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 o=r.v().u;return r===this.A.i?this.g(o,t)<0&&(r.u=t,!0):!(this.g(o,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 o=e.call(this,n)||this;return o.C=t,o.A=r,0===o.iteratorType?(o.pre=function(){return this.C===this.A.t&&throwIteratorAccessError(),this.C=this.C.v(),this},o.next=function(){return this.C===this.A&&throwIteratorAccessError(),this.C=this.C.p(),this}):(o.pre=function(){return this.C===this.A.i&&throwIteratorAccessError(),this.C=this.C.p(),this},o.next=function(){return this.C===this.A&&throwIteratorAccessError(),this.C=this.C.v(),this}),o}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,o){var i=e.call(this,t,r,o)||this;return i.container=n,i}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 o=e.call(this,r,n)||this,i=o;return t.forEach(function(e){i.setElement(e[0],e[1])}),o}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(o){switch(o.label){case 0:e=this._,t=this.P(),r=0,o.label=1;case 1:return r<e?[4,[(n=t[r]).u,n.o]]:[3,4];case 2:o.sent(),o.label=3;case 3:return++r,[3,1];case 4:return[2]}})},t}(TreeContainer),esm=Object.freeze({__proto__:null,OrderedMap:OrderedMap}),require$$1$2=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$1={},hasRequiredCall$1;function requireCall$1(){if(hasRequiredCall$1)return call$1;hasRequiredCall$1=1,Object.defineProperty(call$1,"__esModule",{value:!0}),call$1.ClientDuplexStreamImpl=call$1.ClientWritableStreamImpl=call$1.ClientReadableStreamImpl=call$1.ClientUnaryCallImpl=void 0,call$1.callErrorFromStatus=function(e,t){const n=`${e.code} ${r.Status[e.code]}: ${e.details}`,o=new Error(n),i=`${o.stack}\nfor call at\n${t}`;return Object.assign(new Error(n),e,{stack:i})};const e=require$$0__default$3.default,t=Stream__default.default,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$1.ClientUnaryCallImpl=n;class o 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$1.ClientReadableStreamImpl=o;class i 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 o={callback:r},i=Number(t);Number.isNaN(i)||(o.flags=i),null===(n=this.call)||void 0===n||n.sendMessageWithContext(o,e)}_final(e){var t;null===(t=this.call)||void 0===t||t.halfClose(),e()}}call$1.ClientWritableStreamImpl=i;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 o={callback:r},i=Number(t);Number.isNaN(i)||(o.flags=i),null===(n=this.call)||void 0===n||n.sendMessageWithContext(o,e)}_final(e){var t;null===(t=this.call)||void 0===t||t.halfClose(),e()}}return call$1.ClientDuplexStreamImpl=a,call$1}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 o("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 o("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let i=[];i=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}),s=i.reduceRight((e,t)=>r=>t(r,e),e=>d(n,e,t));return s(a)};const e=requireMetadata(),t=requireCallInterface(),r=requireConstants(),n=requireError();class o extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,o)}}clientInterceptors.InterceptorConfigurationError=o;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 i={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,o,i;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!==(o=t.halfClose)&&void 0!==o?o:a.halfClose,cancel:null!==(i=t.cancel)&&void 0!==i?i: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,o,a,s,l,p;const d={onReceiveMetadata:null!==(o=null===(n=null==r?void 0:r.onReceiveMetadata)||void 0===n?void 0:n.bind(r))&&void 0!==o?o:e=>{},onReceiveMessage:null!==(s=null===(a=null==r?void 0:r.onReceiveMessage)||void 0===a?void 0:a.bind(r))&&void 0!==s?s:e=>{},onReceiveStatus:null!==(p=null===(l=null==r?void 0:r.onReceiveStatus)||void 0===l?void 0:l.bind(r))&&void 0!==p?p:e=>{}};this.processingMetadata=!0,this.requester.start(e,d,(e,r)=>{var n,o,a;let s;if(this.processingMetadata=!1,(0,t.isInterceptingListener)(r))s=r;else{const e={onReceiveMetadata:null!==(n=r.onReceiveMetadata)&&void 0!==n?n:i.onReceiveMetadata,onReceiveMessage:null!==(o=r.onReceiveMessage)&&void 0!==o?o:i.onReceiveMessage,onReceiveStatus:null!==(a=r.onReceiveStatus)&&void 0!==a?a:i.onReceiveStatus};s=new t.InterceptingListenerImpl(e,d)}this.nextCall.start(e,s),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 s{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 o;try{o=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,o)}sendMessage(e){this.sendMessageWithContext({},e)}start(t,o){let i=null;this.call.start(t,{onReceiveMetadata:e=>{var t;null===(t=null==o?void 0:o.onReceiveMetadata)||void 0===t||t.call(o,e)},onReceiveMessage:t=>{var a;let s;try{s=this.methodDefinition.responseDeserialize(t)}catch(t){return i={code:r.Status.INTERNAL,details:`Response message parsing error: ${(0,n.getErrorMessage)(t)}`,metadata:new e.Metadata},void this.call.cancelWithStatus(i.code,i.details)}null===(a=null==o?void 0:o.onReceiveMessage)||void 0===a||a.call(o,s)},onReceiveStatus:e=>{var t,r;i?null===(t=null==o?void 0:o.onReceiveStatus)||void 0===t||t.call(o,i):null===(r=null==o?void 0:o.onReceiveStatus)||void 0===r||r.call(o,e)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}}class l extends s{constructor(e,t){super(e,t)}start(e,t){var r,n;let o=!1;const i={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;o=!0,null===(r=null==t?void 0:t.onReceiveMessage)||void 0===r||r.call(t,e)},onReceiveStatus:e=>{var r,n;o||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,i),this.call.startRead()}}class p extends s{}function d(e,t,r){const n=function(e,t,r){var n,o;const i=null!==(n=r.deadline)&&void 0!==n?n:1/0,a=r.host,s=null!==(o=r.parent)&&void 0!==o?o:null,l=r.propagate_flags,p=r.credentials,d=e.createCall(t,i,a,s,l);return p&&d.setCredentials(p),d}(e,r.path,t);return r.responseStream?new p(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$1(),t=requireChannel(),r=requireConnectivityState(),n=requireConstants(),o=requireMetadata(),i=requireClientInterceptors(),a=Symbol(),s=Symbol(),l=Symbol(),p=Symbol();function d(e){return"function"==typeof e}function u(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 o,i;if(n=Object.assign({},n),this[s]=null!==(o=n.interceptors)&&void 0!==o?o:[],delete n.interceptors,this[l]=null!==(i=n.interceptor_providers)&&void 0!==i?i:[],delete n.interceptor_providers,this[s].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[p]=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=o=>{if(o)return void t(new Error("Failed to connect before the deadline"));let i;try{i=this[a].getConnectivityState(!0)}catch(e){return void t(new Error("The channel has been closed"))}if(i===r.ConnectivityState.READY)t();else try{this[a].watchConnectivityState(i,e,n)}catch(e){t(new Error("The channel has been closed"))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,t,r){if(d(e))return{metadata:new o.Metadata,options:{},callback:e};if(d(t))return e instanceof o.Metadata?{metadata:e,options:{},callback:t}:{metadata:new o.Metadata,options:e,callback:t};if(!(e instanceof o.Metadata&&t instanceof Object&&d(r)))throw new Error("Incorrect arguments passed");return{metadata:e,options:t,callback:r}}makeUnaryRequest(t,r,o,d,c,f,h){var m,g;const y=this.checkOptionalUnaryResponseArguments(c,f,h),v={path:t,requestStream:!1,responseStream:!1,requestSerialize:r,responseDeserialize:o};let b={argument:d,metadata:y.metadata,call:new e.ClientUnaryCallImpl,channel:this[a],methodDefinition:v,callOptions:y.options,callback:y.callback};this[p]&&(b=this[p](b));const O=b.call,w={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(m=b.callOptions.interceptors)&&void 0!==m?m:[],callInterceptorProviders:null!==(g=b.callOptions.interceptor_providers)&&void 0!==g?g:[]},S=(0,i.getInterceptingCall)(w,b.methodDefinition,b.callOptions,b.channel);O.call=S;let _=null,P=!1,E=new Error;return S.start(b.metadata,{onReceiveMetadata:e=>{O.emit("metadata",e)},onReceiveMessage(e){null!==_&&S.cancelWithStatus(n.Status.UNIMPLEMENTED,"Too many responses received"),_=e},onReceiveStatus(t){if(!P){if(P=!0,t.code===n.Status.OK)if(null===_){const r=u(E);b.callback((0,e.callErrorFromStatus)({code:n.Status.UNIMPLEMENTED,details:"No message received",metadata:t.metadata},r))}else b.callback(null,_);else{const r=u(E);b.callback((0,e.callErrorFromStatus)(t,r))}E=null,O.emit("status",t)}}}),S.sendMessage(d),S.halfClose(),O}makeClientStreamRequest(t,r,o,d,c,f){var h,m;const g=this.checkOptionalUnaryResponseArguments(d,c,f),y={path:t,requestStream:!0,responseStream:!1,requestSerialize:r,responseDeserialize:o};let v={metadata:g.metadata,call:new e.ClientWritableStreamImpl(r),channel:this[a],methodDefinition:y,callOptions:g.options,callback:g.callback};this[p]&&(v=this[p](v));const b=v.call,O={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(h=v.callOptions.interceptors)&&void 0!==h?h:[],callInterceptorProviders:null!==(m=v.callOptions.interceptor_providers)&&void 0!==m?m:[]},w=(0,i.getInterceptingCall)(O,v.methodDefinition,v.callOptions,v.channel);b.call=w;let S=null,_=!1,P=new Error;return w.start(v.metadata,{onReceiveMetadata:e=>{b.emit("metadata",e)},onReceiveMessage(e){null!==S&&w.cancelWithStatus(n.Status.UNIMPLEMENTED,"Too many responses received"),S=e,w.startRead()},onReceiveStatus(t){if(!_){if(_=!0,t.code===n.Status.OK)if(null===S){const r=u(P);v.callback((0,e.callErrorFromStatus)({code:n.Status.UNIMPLEMENTED,details:"No message received",metadata:t.metadata},r))}else v.callback(null,S);else{const r=u(P);v.callback((0,e.callErrorFromStatus)(t,r))}P=null,b.emit("status",t)}}}),b}checkMetadataAndOptions(e,t){let r,n;return e instanceof o.Metadata?(r=e,n=t||{}):(n=e||{},r=new o.Metadata),{metadata:r,options:n}}makeServerStreamRequest(t,r,o,d,c,f){var h,m;const g=this.checkMetadataAndOptions(c,f),y={path:t,requestStream:!1,responseStream:!0,requestSerialize:r,responseDeserialize:o};let v={argument:d,metadata:g.metadata,call:new e.ClientReadableStreamImpl(o),channel:this[a],methodDefinition:y,callOptions:g.options};this[p]&&(v=this[p](v));const b=v.call,O={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(h=v.callOptions.interceptors)&&void 0!==h?h:[],callInterceptorProviders:null!==(m=v.callOptions.interceptor_providers)&&void 0!==m?m:[]},w=(0,i.getInterceptingCall)(O,v.methodDefinition,v.callOptions,v.channel);b.call=w;let S=!1,_=new Error;return w.start(v.metadata,{onReceiveMetadata(e){b.emit("metadata",e)},onReceiveMessage(e){b.push(e)},onReceiveStatus(t){if(!S){if(S=!0,b.push(null),t.code!==n.Status.OK){const r=u(_);b.emit("error",(0,e.callErrorFromStatus)(t,r))}_=null,b.emit("status",t)}}}),w.sendMessage(d),w.halfClose(),b}makeBidiStreamRequest(t,r,o,d,c){var f,h;const m=this.checkMetadataAndOptions(d,c),g={path:t,requestStream:!0,responseStream:!0,requestSerialize:r,responseDeserialize:o};let y={metadata:m.metadata,call:new e.ClientDuplexStreamImpl(r,o),channel:this[a],methodDefinition:g,callOptions:m.options};this[p]&&(y=this[p](y));const v=y.call,b={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(f=y.callOptions.interceptors)&&void 0!==f?f:[],callInterceptorProviders:null!==(h=y.callOptions.interceptor_providers)&&void 0!==h?h:[]},O=(0,i.getInterceptingCall)(b,y.methodDefinition,y.callOptions,y.channel);v.call=O;let w=!1,S=new Error;return O.start(y.metadata,{onReceiveMetadata(e){v.emit("metadata",e)},onReceiveMessage(e){v.push(e)},onReceiveStatus(t){if(!w){if(w=!0,v.push(null),t.code!==n.Status.OK){const r=u(S);v.emit("error",(0,e.callErrorFromStatus)(t,r))}S=null,v.emit("status",t)}}}),v}},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 i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const a=e[i],s=i.split(".");if(s.some(e=>r(e)))continue;const l=s[s.length-1];let p=t;for(const e of s.slice(0,-1))p[e]||(p[e]={}),p=p[e];o(a)?p[l]=a:p[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,o,i){class a extends e.Client{}return Object.keys(n).forEach(e=>{if(r(e))return;const o=n[e];let i;if("string"==typeof e&&"$"===e.charAt(0))throw new Error("Method names cannot start with $");i=o.requestStream?o.responseStream?"bidi":"client_stream":o.responseStream?"server_stream":"unary";const s=o.requestSerialize,l=o.responseDeserialize,p=function(e,t,r,n){return function(...o){return e.call(this,t,r,n,...o)}}(t[i],o.path,s,l);a.prototype[e]=p,Object.assign(a.prototype[e],o),o.originalName&&!r(o.originalName)&&(a.prototype[o.originalName]=a.prototype[e])}),a.service=n,a.serviceName=o,a}function o(e){return"format"in e}return makeClient}var src$5={},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",o="\\u0300-\\u036f\\ufe20-\\ufe23",i="\\u20d0-\\u20f0",a="\\u2700-\\u27bf",s="a-z\\xdf-\\xf6\\xf8-\\xff",l="A-Z\\xc0-\\xd6\\xd8-\\xde",p="\\ufe0e\\ufe0f",d="\\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",u="['’]",c="["+n+"]",f="["+d+"]",h="["+o+i+"]",m="\\d+",g="["+a+"]",y="["+s+"]",v="[^"+n+d+m+a+s+l+"]",b="\\ud83c[\\udffb-\\udfff]",O="[^"+n+"]",w="(?:\\ud83c[\\udde6-\\uddff]){2}",S="[\\ud800-\\udbff][\\udc00-\\udfff]",_="["+l+"]",P="\\u200d",E="(?:"+y+"|"+v+")",T="(?:"+_+"|"+v+")",C="(?:['’](?:d|ll|m|re|s|t|ve))?",R="(?:['’](?:D|LL|M|RE|S|T|VE))?",D="(?:"+h+"|"+b+")"+"?",x="["+p+"]?",k=x+D+("(?:"+P+"(?:"+[O,w,S].join("|")+")"+x+D+")*"),j="(?:"+[g,w,S].join("|")+")"+k,A="(?:"+[O+h+"?",h,w,S,c].join("|")+")",N=RegExp(u,"g"),I=RegExp(h,"g"),q=RegExp(b+"(?="+b+")|"+A+k,"g"),M=RegExp([_+"?"+y+"+"+C+"(?="+[f,_,"$"].join("|")+")",T+"+"+R+"(?="+[f,_+E,"$"].join("|")+")",_+"?"+E+"+"+C,_+"+"+R,m,j].join("|"),"g"),L=RegExp("["+P+n+o+i+p+"]"),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,V="object"==typeof self&&self&&self.Object===Object&&self,U=B||V||Function("return this")();var $=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 G(e){return L.test(e)}function H(e){return G(e)?function(e){return e.match(q)||[]}(e):function(e){return e.split("")}(e)}var z=Object.prototype.toString,W=U.Symbol,J=W?W.prototype:void 0,Y=J?J.toString:void 0;function K(t){if("string"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(e){return!!e&&"object"==typeof e}(t)&&z.call(t)==e}(t))return Y?Y.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,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}(e,t,r)}function Q(e){return null==e?"":K(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,o=e?e.length:0;++n<o;)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,$).replace(I,"")}(e).replace(N,"")),Z,"")});var te,re=(te="toUpperCase",function(e){var t=G(e=Q(e))?H(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$4={exports:{}},indexLight={exports:{}},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){var r=new Array(arguments.length-1),n=0,o=2,i=!0;for(;o<arguments.length;)r[n++]=arguments[o++];return new Promise(function(o,a){r[n]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];o.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,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),o=0;o<64;)n[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(e,t,n){for(var o,i=null,a=[],s=0,l=0;t<n;){var p=e[t++];switch(l){case 0:a[s++]=r[p>>2],o=(3&p)<<4,l=1;break;case 1:a[s++]=r[o|p>>4],o=(15&p)<<2,l=2;break;case 2:a[s++]=r[o|p>>6],a[s++]=r[63&p],l=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return l&&(a[s++]=r[o],a[s++]=61,1===l&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var i="invalid encoding";t.decode=function(e,t,r){for(var o,a=r,s=0,l=0;l<e.length;){var p=e.charCodeAt(l++);if(61===p&&s>1)break;if(void 0===(p=n[p]))throw Error(i);switch(s){case 0:o=p,s=1;break;case 1:t[r++]=o<<2|(48&p)>>4,o=p,s=2;break;case 2:t[r++]=(15&o)<<4|(60&p)>>2,o=p,s=3;break;case 3:t[r++]=(3&o)<<6|p,s=0}}if(1===s)throw Error(i);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 o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3]}function i(e,n,o){t[0]=e,n[o]=r[3],n[o+1]=r[2],n[o+2]=r[1],n[o+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 s(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?o:i,e.writeFloatBE=n?i:o,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function i(e,t,r,n){var o=t<0?1:0;if(o&&(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((o<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),o=2*(n>>31)+1,i=n>>>23&255,a=8388607&n;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=i.bind(null,t),e.writeFloatBE=i.bind(null,r),e.readFloatLE=a.bind(null,n),e.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3],n[o+4]=r[4],n[o+5]=r[5],n[o+6]=r[6],n[o+7]=r[7]}function i(e,n,o){t[0]=e,n[o]=r[7],n[o+1]=r[6],n[o+2]=r[5],n[o+3]=r[4],n[o+4]=r[3],n[o+5]=r[2],n[o+6]=r[1],n[o+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 s(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?o:i,e.writeDoubleBE=n?i:o,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function i(e,t,r,n,o,i){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,o,i+t),e(1/n>0?0:2147483648,o,i+r);else if(isNaN(n))e(0,o,i+t),e(2146959360,o,i+r);else if(n>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+r);else{var l=Math.floor(Math.log(n)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=n*Math.pow(2,-l))>>>0,o,i+t),e((a<<31|l+1023<<20|1048576*s&1048575)>>>0,o,i+r)}}}function a(e,t,r,n,o){var i=e(n,o+t),a=e(n,o+r),s=2*(a>>31)+1,l=a>>>20&2047,p=4294967296*(1048575&a)+i;return 2047===l?p?NaN:s*(1/0):0===l?5e-324*s*p:s*Math.pow(2,l-1075)*(p+4503599627370496)}e.writeDoubleLE=i.bind(null,t,0,4),e.writeDoubleBE=i.bind(null,r,4,0),e.readDoubleLE=a.bind(null,n,0,4),e.readDoubleBE=a.bind(null,o,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 o(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$1,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,o=null,i=[],a=0;t<r;)(n=e[t++])<128?i[a++]=n:n>191&&n<224?i[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,i[a++]=55296+(n>>10),i[a++]=56320+(1023&n)):i[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},t.write=function(e,t,r){for(var n,o,i=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&(o=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&o),++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-i}}(utf8)),utf8}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,r){var n=r||8192,o=n>>>1,i=null,a=n;return function(r){if(r<1||r>o)return e(r);a+r>n&&(i=e(n),a=0);var s=t.call(i,a,a+=r);return 7&a&&(a=1+(7|a)),s}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal$1();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 o=e>>>0,i=(e-o)/4294967296>>>0;return n&&(i=~i>>>0,o=~o>>>0,++o>4294967295&&(o=0,++i>4294967295&&(i=0))),new t(o,i)},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 o=String.prototype.charCodeAt;return t.fromHash=function(e){return e===n?r:new t((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.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$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(){var e=minimal$1;function t(e,t,r){for(var n=Object.keys(t),o=0;o<n.length;++o)void 0!==e[n[o]]&&r||(e[n[o]]=t[n[o]]);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$1,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$1}function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=l;var e,t=requireMinimal$1(),r=t.LongBits,n=t.base64,o=t.utf8;function i(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function a(){}function s(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 i(a,0,0),this.tail=this.head,this.states=null}var p=function(){return t.Buffer?function(){return(l.create=function(){return new e})()}:function(){return new l}};function d(e,t,r){t[r]=255&e}function u(e,t){this.len=e,this.next=void 0,this.val=t}function c(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 f(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=p(),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 i(e,t,r),this.len+=t,this},u.prototype=Object.create(i.prototype),u.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 u((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(c,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(c,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=r.from(e).zzEncode();return this._push(c,t.length(),t)},l.prototype.bool=function(e){return this._push(d,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(f,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=r.from(e);return this._push(f,4,t.lo)._push(f,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 h=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(d,1,0);if(t.isString(e)){var o=l.alloc(r=n.length(e));n.decode(e,o,0),e=o}return this.uint32(r)._push(h,r,e)},l.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(d,1,0)},l.prototype.fork=function(){return this.states=new s(this),this.head=this.tail=new i(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 i(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=p(),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$1();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=i;var e,t=requireMinimal$1(),r=t.LongBits,n=t.utf8;function o(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function i(e){this.buf=e,this.pos=0,this.len=e.length}var a="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new i(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new i(e);throw Error("illegal buffer")},s=function(){return t.Buffer?function(r){return(i.create=function(r){return t.Buffer.isBuffer(r)?new e(r):a(r)})(r)}:a};function l(){var e=new r(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw o(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 o(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 p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw o(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}return i.create=s(),i.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,i.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return e}}(),i.prototype.int32=function(){return 0|this.uint32()},i.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},i.prototype.bool=function(){return 0!==this.uint32()},i.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return p(this.buf,this.pos+=4)},i.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return 0|p(this.buf,this.pos+=4)},i.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},i.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},i.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,n);if(r===n){var i=t.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,n)},i.prototype.string=function(){var e=this.bytes();return n.read(e,0,e.length)},i.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw o(this)}while(128&this.buf[this.pos++]);return this},i.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},i._configure=function(r){e=r,i.create=s(),e._configure();var n=t.Long?"toLong":"toNumber";t.merge(i.prototype,{int64:function(){return l.call(this)[n](!1)},uint64:function(){return l.call(this)[n](!0)},sint64:function(){return l.call(this).zzDecode()[n](!1)},fixed64:function(){return d.call(this)[n](!0)},sfixed64:function(){return d.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$1();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$1();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,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return e.asPromise(t,s,r,n,o,i);if(s.rpcImpl)try{return s.rpcImpl(r,n[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(e,t){if(e)return s.emit("error",e,r),a(e);if(null!==t){if(!(t instanceof o))try{t=o[s.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return s.emit("error",e,r),a(e)}return s.emit("data",t,r),a(null,t)}s.end(!0)})}catch(e){return s.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,function(e){e.Service=requireService$1()}(rpc)),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$1(),e.rpc=requireRpc(),e.roots=requireRoots(),e.configure=t,t()}()),indexMinimal}var types$1={},util$5={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 o(t){if("string"!=typeof t){var r=i();if(e.verbose&&console.log("codegen: "+r),r="return "+r,t){for(var a=Object.keys(t),s=new Array(a.length+1),l=new Array(a.length),p=0;p<a.length;)s[p]=a[p],l[p]=t[a[p++]];return s[p]=r,Function.apply(null,s).apply(null,l)}return Function(r)()}for(var d=new Array(arguments.length-1),u=0;u<d.length;)d[u]=arguments[++u];if(u=0,t=t.replace(/%([%dfijs])/g,function(e,t){var r=d[u++];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"%"}),u!==d.length)throw Error("parameter count mismatch");return n.push(t),o}function i(e){return"function "+(e||r||"")+"("+(t&&t.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return o.toString=i,o}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,o,i){return"function"==typeof o?(i=o,o={}):o||(o={}),i?!o.xhr&&t&&t.readFile?t.readFile(n,function(e,t){return e&&"undefined"!=typeof XMLHttpRequest?r.xhr(n,o,i):e?i(e):i(null,o.binary?t:t.toString("utf8"))}):r.xhr(n,o,i):e(r,this,n,o)}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 o=0;o<n.responseText.length;++o)e.push(255&n.responseText.charCodeAt(o))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()},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),o="";n&&(o=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):n?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return o+t.join("/")};t.resolve=function(e,t,o){return o||(t=n(t)),r(t)?t:(o||(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,o=requireField(),i=requireUtil$5(),a=requireOneof();function s(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 p(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=s,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=i.toArray(this.nested))}}),l.prototype.toJSON=function(e){return i.toObject(["options",this.options,"nested",s(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var i,a=Object.keys(e),s=0;s<a.length;++s)i=e[a[s]],this.add((void 0!==i.fields?t.fromJSON:void 0!==i.values?n.fromJSON:void 0!==i.methods?r.fromJSON:void 0!==i.id?o.fromJSON:l.fromJSON)(a[s],i));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 o&&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 i=this.get(e.name);if(i){if(!(i instanceof l&&e instanceof l)||i instanceof t||i instanceof r)throw Error("duplicate name '"+e.name+"' in "+this);for(var s=i.nestedArray,d=0;d<s.length;++d)e.add(s[d]);this.remove(i),this.nested||(this.nested={}),e.setOptions(i.options,!0)}}else this.nested={};this.nested[e.name]=e,this instanceof t||this instanceof r||this instanceof n||this instanceof o||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var u=this;u=u.parent;)u._needsRecursiveFeatureResolution=!0,u._needsRecursiveResolve=!0;return e.onAdd(this),p(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),p(this)},l.prototype.define=function(e,t){if(i.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]),i.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 o=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+n];if(o&&(!t||t.indexOf(o.constructor)>-1))return o;if((o=this._lookupImpl(e,n))&&(!t||t.indexOf(o.constructor)>-1))return o;if(r)return null;for(var a=this;a.parent;){if((o=a.parent._lookupImpl(e,n))&&(!t||t.indexOf(o.constructor)>-1))return o;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 o=0;o<this.nestedArray.length;++o)this._nestedArray[o]instanceof l&&(r=this._nestedArray[o]._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,o,i){t=e,r=o,n=i},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$5();function n(t,n,o,i,a,s){if(e.call(this,t,n,i,void 0,void 0,a,s),!r.isString(o))throw TypeError("keyType must be a string");this.keyType=o,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,o){return"function"==typeof o?o=r.decorateType(o).name:o&&"object"==typeof o&&(o=r.decorateEnum(o).name),function(i,a){r.decorateType(i.constructor).add(new n(a,e,t,o))}},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$5();function r(r,n,o,i,a,s,l,p,d){if(t.isObject(a)?(l=a,a=s=void 0):t.isObject(s)&&(l=s,s=void 0),void 0!==n&&!t.isString(n))throw TypeError("type must be a string");if(!t.isString(o))throw TypeError("requestType must be a string");if(!t.isString(i))throw TypeError("responseType must be a string");e.call(this,r,l),this.type=n||"rpc",this.requestType=o,this.requestStream=!!a||void 0,this.responseType=i,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=p,this.parsedOptions=d}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=o;var e=requireNamespace();((o.prototype=Object.create(e.prototype)).constructor=o).className="Service";var t=requireMethod(),r=requireUtil$5(),n=requireRpc();function o(t,r){e.call(this,t,r),this.methods={},this._methodsArray=null}function i(e){return e._methodsArray=null,e}return o.fromJSON=function(e,r){var n=new o(e,r.options);if(r.methods)for(var i=Object.keys(r.methods),a=0;a<i.length;++a)n.add(t.fromJSON(i[a],r.methods[i[a]]));return r.nested&&n.addJSON(r.nested),r.edition&&(n._edition=r.edition),n.comment=r.comment,n._defaultEdition="proto3",n},o.prototype.toJSON=function(t){var n=e.prototype.toJSON.call(this,t),o=!!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",o?this.comment:void 0])},Object.defineProperty(o.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=r.toArray(this.methods))}}),o.prototype.get=function(t){return this.methods[t]||e.prototype.get.call(this,t)},o.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},o.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},o.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,i(this)):e.prototype.add.call(this,r)},o.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,i(this)}return e.prototype.remove.call(this,r)},o.prototype.create=function(e,t,o){for(var i,a=new n.Service(e,t,o),s=0;s<this.methodsArray.length;++s){var l=r.lcFirst((i=this._methodsArray[s]).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:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return a},service}function requireMessage(){if(hasRequiredMessage)return message;hasRequiredMessage=1,message=t;var e=requireMinimal$1();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(o){for(var i=r.codegen(["r","l","e"],o.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(o.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<o.fieldsArray.length;++a){var s=o._fieldsArray[a].resolve(),l=s.resolvedType instanceof e?"int32":s.type,p="m"+r.safeProp(s.name);i("case %i: {",s.id),s.map?(i("if(%s===util.emptyObject)",p)("%s={}",p)("var c2 = r.uint32()+r.pos"),void 0!==t.defaults[s.keyType]?i("k=%j",t.defaults[s.keyType]):i("k=null"),void 0!==t.defaults[l]?i("value=%j",t.defaults[l]):i("value=null"),i("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===t.basic[l]?i("value=types[%i].decode(r,r.uint32())",a):i("value=r.%s()",l),i("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==t.long[s.keyType]?i('%s[typeof k==="object"?util.longToHash(k):k]=value',p):i("%s[k]=value",p)):s.repeated?(i("if(!(%s&&%s.length))",p,p)("%s=[]",p),void 0!==t.packed[l]&&i("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",p,l)("}else"),void 0===t.basic[l]?i(s.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",p,a):i("%s.push(r.%s())",p,l)):void 0===t.basic[l]?i(s.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",p,a):i("%s=r.%s()",p,l),i("break")("}")}for(i("default:")("r.skipType(t&7)")("break")("}")("}"),a=0;a<o._fieldsArray.length;++a){var d=o._fieldsArray[a];d.required&&i("if(!m.hasOwnProperty(%j))",d.name)("throw util.ProtocolError(%j,{instance:m})",n(d))}return i("return m")};var e=require_enum$1(),t=requireTypes(),r=requireUtil$5();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 i=t.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),a=e.oneofsArray,s={};a.length&&i("var p={}");for(var l=0;l<e.fieldsArray.length;++l){var p=e._fieldsArray[l].resolve(),d="m"+t.safeProp(p.name);if(p.optional&&i("if(%s!=null&&m.hasOwnProperty(%j)){",d,p.name),p.map)i("if(!util.isObject(%s))",d)("return%j",r(p,"object"))("var k=Object.keys(%s)",d)("for(var i=0;i<k.length;++i){"),o(i,p,"k[i]"),n(i,p,l,d+"[k[i]]")("}");else if(p.repeated)i("if(!Array.isArray(%s))",d)("return%j",r(p,"array"))("for(var i=0;i<%s.length;++i){",d),n(i,p,l,d+"[i]")("}");else{if(p.partOf){var u=t.safeProp(p.partOf.name);1===s[p.partOf.name]&&i("if(p%s===1)",u)("return%j",p.partOf.name+": multiple values"),s[p.partOf.name]=1,i("p%s=1",u)}n(i,p,l,d)}p.optional&&i("}")}return i("return null")};var e=require_enum$1(),t=requireUtil$5();function r(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function n(t,n,o,i){if(n.resolvedType)if(n.resolvedType instanceof e){t("switch(%s){",i)("default:")("return%j",r(n,"enum value"));for(var a=Object.keys(n.resolvedType.values),s=0;s<a.length;++s)t("case %i:",n.resolvedType.values[a[s]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s);",o,i)("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))",i)("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)))",i,i,i,i)("return%j",r(n,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',i)("return%j",r(n,"number"));break;case"bool":t('if(typeof %s!=="boolean")',i)("return%j",r(n,"boolean"));break;case"string":t("if(!util.isString(%s))",i)("return%j",r(n,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",r(n,"buffer"))}return t}function o(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$1(),n=requireUtil$5();function o(e,t,n,o){var i=!1;if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(d%s){",o);for(var a=t.resolvedType.values,s=Object.keys(a),l=0;l<s.length;++l)a[s[l]]!==t.typeDefault||i||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',o,o,o),t.repeated||e("break"),i=!0),e("case%j:",s[l])("case %i:",a[s[l]])("m%s=%j",o,a[s[l]])("break");e("}")}else e('if(typeof d%s!=="object")',o)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,n,o);else{var p=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",o,o);break;case"uint64":p=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,p)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,p?"true":"");break;case"bytes":e('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length >= 0)",o)("m%s=d%s",o,o);break;case"string":e("m%s=String(d%s)",o,o);break;case"bool":e("m%s=Boolean(d%s)",o,o)}}return e}function i(e,t,n,o){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",o,n,o,o,n,o,o):e("d%s=types[%i].toObject(m%s,o)",o,n,o);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,i?"true":"",o);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:e("d%s=m%s",o,o)}}return e}t.fromObject=function(e){var t=e.fieldsArray,i=n.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return i("return new this.ctor");i("var m=new this.ctor");for(var a=0;a<t.length;++a){var s=t[a].resolve(),l=n.safeProp(s.name);s.map?(i("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),o(i,s,a,l+"[ks[i]]")("}")("}")):s.repeated?(i("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),o(i,s,a,l+"[i]")("}")("}")):(s.resolvedType instanceof r||i("if(d%s!=null){",l),o(i,s,a,l),s.resolvedType instanceof r||i("}"))}return i("return m")},t.toObject=function(e){var t=e.fieldsArray.slice().sort(n.compareFieldsById);if(!t.length)return n.codegen()("return {}");for(var o=n.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),a=[],s=[],l=[],p=0;p<t.length;++p)t[p].partOf||(t[p].resolve().repeated?a:t[p].map?s:l).push(t[p]);if(a.length){for(o("if(o.arrays||o.defaults){"),p=0;p<a.length;++p)o("d%s=[]",n.safeProp(a[p].name));o("}")}if(s.length){for(o("if(o.objects||o.defaults){"),p=0;p<s.length;++p)o("d%s={}",n.safeProp(s[p].name));o("}")}if(l.length){for(o("if(o.defaults){"),p=0;p<l.length;++p){var d=l[p],u=n.safeProp(d.name);if(d.resolvedType instanceof r)o("d%s=o.enums===String?%j:%j",u,d.resolvedType.valuesById[d.typeDefault],d.typeDefault);else if(d.long)o("if(util.Long){")("var n=new util.Long(%i,%i,%j)",d.typeDefault.low,d.typeDefault.high,d.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",u)("}else")("d%s=o.longs===String?%j:%i",u,d.typeDefault.toString(),d.typeDefault.toNumber());else if(d.bytes){var c="["+Array.prototype.slice.call(d.typeDefault).join(",")+"]";o("if(o.bytes===String)d%s=%j",u,String.fromCharCode.apply(String,d.typeDefault))("else{")("d%s=%s",u,c)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",u,u)("}")}else o("d%s=%j",u,d.typeDefault)}o("}")}var f=!1;for(p=0;p<t.length;++p){d=t[p];var h=e._fieldsArray.indexOf(d);u=n.safeProp(d.name);d.map?(f||(f=!0,o("var ks2")),o("if(m%s&&(ks2=Object.keys(m%s)).length){",u,u)("d%s={}",u)("for(var j=0;j<ks2.length;++j){"),i(o,d,h,u+"[ks2[j]]")("}")):d.repeated?(o("if(m%s&&m%s.length){",u,u)("d%s=[]",u)("for(var j=0;j<m%s.length;++j){",u),i(o,d,h,u+"[j]")("}")):(o("if(m%s!=null&&m.hasOwnProperty(%j)){",u,d.name),i(o,d,h,u),d.partOf&&o("if(o.oneofs)")("d%s=%j",n.safeProp(d.partOf.name),d.name)),o("}")}return o("return d")}}(converter)),converter}var wrappers$2={},hasRequiredWrappers$1,type,hasRequiredType,root,hasRequiredRoot,hasRequiredUtil$5,hasRequiredTypes,field,hasRequiredField,oneof,hasRequiredOneof,object,hasRequiredObject,_enum$1,hasRequired_enum$1,encoder_1,hasRequiredEncoder,hasRequiredIndexLight,tokenize_1,hasRequiredTokenize,parse_1,hasRequiredParse,common_1,hasRequiredCommon$2,hasRequiredSrc$7,protobufjs,hasRequiredProtobufjs;function requireWrappers$1(){return hasRequiredWrappers$1||(hasRequiredWrappers$1=1,function(){var e=wrappers$2,t=requireMessage();e[".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,r){var n="",o="";if(r&&r.json&&e.type_url&&e.value){o=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(o);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof t){var a=e.$type.toObject(e,r);return""===n&&(n="type.googleapis.com/"),o=n+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),a["@type"]=o,a}return this.toObject(e,r)}}}()),wrappers$2}function requireType(){if(hasRequiredType)return type;hasRequiredType=1,type=m;var e=requireNamespace();((m.prototype=Object.create(e.prototype)).constructor=m).className="Type";var t=require_enum$1(),r=requireOneof(),n=requireField(),o=requireMapfield(),i=requireService(),a=requireMessage(),s=requireReader(),l=requireWriter(),p=requireUtil$5(),d=requireEncoder(),u=requireDecoder(),c=requireVerifier(),f=requireConverter(),h=requireWrappers$1();function m(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 g(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}return Object.defineProperties(m.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=p.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=p.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=m.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof a||((e.prototype=new a).constructor=e,p.merge(e.prototype,t)),e.$type=e.prototype.$type=this,p.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:p.oneOfGetter(this._oneofsArray[r].oneof),set:p.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),m.generateConstructor=function(e){for(var t,r=p.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",p.safeProp(t.name)):t.repeated&&r("this%s=[]",p.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]]")},m.fromJSON=function(a,s){var l=new m(a,s.options);l.extensions=s.extensions,l.reserved=s.reserved;for(var p=Object.keys(s.fields),d=0;d<p.length;++d)l.add((void 0!==s.fields[p[d]].keyType?o.fromJSON:n.fromJSON)(p[d],s.fields[p[d]]));if(s.oneofs)for(p=Object.keys(s.oneofs),d=0;d<p.length;++d)l.add(r.fromJSON(p[d],s.oneofs[p[d]]));if(s.nested)for(p=Object.keys(s.nested),d=0;d<p.length;++d){var u=s.nested[p[d]];l.add((void 0!==u.id?n.fromJSON:void 0!==u.fields?m.fromJSON:void 0!==u.values?t.fromJSON:void 0!==u.methods?i.fromJSON:e.fromJSON)(p[d],u))}return s.extensions&&s.extensions.length&&(l.extensions=s.extensions),s.reserved&&s.reserved.length&&(l.reserved=s.reserved),s.group&&(l.group=!0),s.comment&&(l.comment=s.comment),s.edition&&(l._edition=s.edition),l._defaultEdition="proto3",l},m.prototype.toJSON=function(t){var r=e.prototype.toJSON.call(this,t),n=!!t&&Boolean(t.keepComments);return p.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])},m.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},m.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},m.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},m.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),g(this)}return t instanceof r?(this.oneofs||(this.oneofs={}),this.oneofs[t.name]=t,t.onAdd(this),g(this)):e.prototype.add.call(this,t)},m.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),g(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),g(this)}return e.prototype.remove.call(this,t)},m.prototype.isReservedId=function(t){return e.isReservedId(this.reserved,t)},m.prototype.isReservedName=function(t){return e.isReservedName(this.reserved,t)},m.prototype.create=function(e){return new this.ctor(e)},m.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=d(this)({Writer:l,types:t,util:p}),this.decode=u(this)({Reader:s,types:t,util:p}),this.verify=c(this)({types:t,util:p}),this.fromObject=f.fromObject(this)({types:t,util:p}),this.toObject=f.toObject(this)({types:t,util:p});var n=h[e];if(n){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(o),o.toObject=this.toObject,this.toObject=n.toObject.bind(o)}return this},m.prototype.encode=function(e,t){return this.setup().encode(e,t)},m.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},m.prototype.decode=function(e,t){return this.setup().decode(e,t)},m.prototype.decodeDelimited=function(e){return e instanceof s||(e=s.create(e)),this.decode(e,e.uint32())},m.prototype.verify=function(e){return this.setup().verify(e)},m.prototype.fromObject=function(e){return this.setup().fromObject(e)},m.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},m.d=function(e){return function(t){p.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,o=requireField(),i=require_enum$1(),a=requireOneof(),s=requireUtil$5();function l(t){e.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}function p(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()},l.prototype.resolvePath=s.path.resolve,l.prototype.fetch=s.fetch,l.prototype.load=function e(t,o,i){"function"==typeof o&&(i=o,o=void 0);var a=this;if(!i)return s.asPromise(e,a,t,o);var l=i===p;function d(e,t){if(i){if(l)throw e;t&&t.resolveAll();var r=i;i=null,r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in n)return r}return null}function c(e,t){try{if(s.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),s.isString(t)){r.filename=e;var n,i=r(t,a,o),p=0;if(i.imports)for(;p<i.imports.length;++p)(n=u(i.imports[p])||a.resolvePath(e,i.imports[p]))&&f(n);if(i.weakImports)for(p=0;p<i.weakImports.length;++p)(n=u(i.weakImports[p])||a.resolvePath(e,i.weakImports[p]))&&f(n,!0)}else a.setOptions(t.options).addJSON(t.nested)}catch(e){d(e)}l||h||d(null,a)}function f(e,t){if(e=u(e)||e,!(a.files.indexOf(e)>-1))if(a.files.push(e),e in n)l?c(e,n[e]):(++h,setTimeout(function(){--h,c(e,n[e])}));else if(l){var r;try{r=s.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||d(e))}c(e,r)}else++h,a.fetch(e,function(r,n){--h,i&&(r?t?h||d(null,a):d(r):c(e,n))})}var h=0;s.isString(t)&&(t=[t]);for(var m,g=0;g<t.length;++g)(m=a.resolvePath("",t[g]))&&f(m);return l?(a.resolveAll(),a):(h||d(null,a),a)},l.prototype.loadSync=function(e,t){if(!s.isNode)throw Error("not supported");return this.load(e,t,p)},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 d=/^[A-Z]/;function u(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new o(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 o)void 0===e.extend||e.extensionField||u(0,e)||this.deferred.push(e);else if(e instanceof i)d.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;)u(0,this.deferred[r])?this.deferred.splice(r,1):++r;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);d.test(e.name)&&(e.parent[e.name]=e)}(e instanceof t||e instanceof i||e instanceof o)&&(this._fullyQualifiedObjects[e.fullName]=e)},l.prototype._handleRemove=function(t){if(t instanceof o){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 i)d.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]);d.test(t.name)&&delete t.parent[t.name]}delete this._fullyQualifiedObjects[t.fullName]},l._configure=function(e,o,i){t=e,r=o,n=i},root}function requireUtil$5(){if(hasRequiredUtil$5)return util$5.exports;hasRequiredUtil$5=1;var e,t,r=util$5.exports=requireMinimal$1(),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++],o=e[r++];void 0!==o&&(t[n]=o)}return t};var o=/\\/g,i=/"/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(o,"\\\\").replace(i,'\\"')+'"]':"."+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 o=new e(n||t.name);return r.decorateRoot.add(o),o.ctor=t,Object.defineProperty(t,"$type",{value:o,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:o,enumerable:!1}),o};var s=0;return r.decorateEnum=function(e){if(e.$type)return e.$type;t||(t=require_enum$1());var n=new t("Enum"+s++,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,o){var i=r.shift();if("__proto__"===i||"prototype"===i)return t;if(r.length>0)t[i]=e(t[i]||{},r,o);else{var a=t[i];if(a&&n)return t;a&&(o=[].concat(a).concat(o)),t[i]=o}return t}(e,t=t.split("."),r)},Object.defineProperty(r,"decorateRoot",{get:function(){return n.decorated||(n.decorated=new(requireRoot()))}}),util$5.exports}function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(){var e=types$1,t=requireUtil$5(),r=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function n(e,t){var n=0,o={};for(t|=0;n<e.length;)o[r[n+t]]=e[n++];return o}e.basic=n([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),e.defaults=n([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",t.emptyArray,null]),e.long=n([0,0,0,1,1],7),e.mapKey=n([0,0,0,5,5,0,0,0,1,1,0,2],2),e.packed=n([1,5,0,0,0,5,5,0,0,0,1,1,0])}()),types$1}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$1(),n=requireTypes(),o=requireUtil$5(),i=/^required|optional|repeated$/;function a(t,r,a,s,l,p,d){if(o.isObject(s)?(d=l,p=s,s=l=void 0):o.isObject(l)&&(d=p,p=l,l=void 0),e.call(this,t,p),!o.isInteger(r)||r<0)throw TypeError("id must be a non-negative integer");if(!o.isString(a))throw TypeError("type must be a string");if(void 0!==s&&!i.test(s=s.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==l&&!o.isString(l))throw TypeError("extend must be a string");"proto3_optional"===s&&(s="optional"),this.rule=s&&"optional"!==s?s:void 0,this.type=a,this.id=r,this.extend=l||void 0,this.repeated="repeated"===s,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!o.Long&&void 0!==n.long[a],this.bytes="bytes"===a,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=d}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 o.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=o.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var i;o.base64.test(this.typeDefault)?o.base64.decode(this.typeDefault,i=o.newBuffer(o.base64.length(this.typeDefault)),0):o.utf8.write(this.typeDefault,i=o.newBuffer(o.utf8.length(this.typeDefault)),0),this.typeDefault=i}return this.map?this.defaultValue=o.emptyObject:this.repeated?this.defaultValue=o.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 o=this.parent.get(this.type.split(".").pop());o&&o instanceof t&&o.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=o.decorateType(t).name:t&&"object"==typeof t&&(t=o.decorateEnum(t).name),function(i,s){o.decorateType(i.constructor).add(new a(s,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$5();function n(t,r,n,o){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=o}function o(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,o(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))}o(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,o){r.decorateType(t.constructor).add(new n(o,e)),Object.defineProperty(t,o,{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$5(),n={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},o={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},i={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({},o);else if("proto3"===t)r=Object.assign({},i);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 s=Object.assign({},this.partOf._features);this._features=Object.assign(s,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 o=this.parsedOptions;if(n){var i=o.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)});if(i){var a=i[e];r.setProperty(a,n,t)}else(i={})[e]=r.setProperty({},n,t),o.push(i)}else{var s={};s[e]=t,o.push(s)}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$1(){if(hasRequired_enum$1)return _enum$1;hasRequired_enum$1=1,_enum$1=n;var e=requireObject();((n.prototype=Object.create(e.prototype)).constructor=n).className="Enum";var t=requireNamespace(),r=requireUtil$5();function n(t,r,n,o,i,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=o,this.comments=i||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,r)for(var s=Object.keys(r),l=0;l<s.length;++l)"number"==typeof r[s[l]]&&(this.valuesById[this.values[s[l]]=r[s[l]]]=s[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,o){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 o&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=o||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$1}function requireEncoder(){if(hasRequiredEncoder)return encoder_1;hasRequiredEncoder=1,encoder_1=function(o){for(var i,a=r.codegen(["m","w"],o.name+"$encode")("if(!w)")("w=Writer.create()"),s=o.fieldsArray.slice().sort(r.compareFieldsById),l=0;l<s.length;++l){var p=s[l].resolve(),d=o._fieldsArray.indexOf(p),u=p.resolvedType instanceof e?"int32":p.type,c=t.basic[u];i="m"+r.safeProp(p.name),p.map?(a("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",i,p.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",i)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(p.id<<3|2)>>>0,8|t.mapKey[p.keyType],p.keyType),void 0===c?a("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",d,i):a(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,u,i),a("}")("}")):p.repeated?(a("if(%s!=null&&%s.length){",i,i),p.packed&&void 0!==t.packed[u]?a("w.uint32(%i).fork()",(p.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",u,i)("w.ldelim()"):(a("for(var i=0;i<%s.length;++i)",i),void 0===c?n(a,p,d,i+"[i]"):a("w.uint32(%i).%s(%s[i])",(p.id<<3|c)>>>0,u,i)),a("}")):(p.optional&&a("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",i,p.name),void 0===c?n(a,p,d,i):a("w.uint32(%i).%s(%s)",(p.id<<3|c)>>>0,u,i))}return a("return w")};var e=require_enum$1(),t=requireTypes(),r=requireUtil$5();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$1(),e.Type=requireType(),e.Field=requireField(),e.OneOf=requireOneof(),e.MapField=requireMapfield(),e.Service=requireService(),e.Method=requireMethod(),e.Message=requireMessage(),e.wrappers=requireWrappers$1(),e.types=requireTypes(),e.util=requireUtil$5(),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=d;var e=/[\s{}=;:[\],'"()<>]/g,t=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,r=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,n=/^ *[*/]+ */,o=/^\s*\*?\/*/,i=/\n/g,a=/\s/,s=/\\(.?)/g,l={0:"\0",r:"\r",n:"\n",t:"\t"};function p(e){return e.replace(s,function(e,t){switch(t){case"\\":case"":return t;default:return l[t]||""}})}function d(s,l){s=s.toString();var d=0,u=s.length,c=1,f=0,h={},m=[],g=null;function y(e){return Error("illegal "+e+" (line "+c+")")}function v(e){return s.charAt(e)}function b(e,t,r){var a,p={type:s.charAt(e++),lineEmpty:!1,leading:r},d=e-(l?2:3);do{if(--d<0||"\n"===(a=s.charAt(d))){p.lineEmpty=!0;break}}while(" "===a||"\t"===a);for(var u=s.substring(e,t).split(i),m=0;m<u.length;++m)u[m]=u[m].replace(l?o:n,"").trim();p.text=u.join("\n").trim(),h[c]=p,f=c}function O(e){var t=w(e),r=s.substring(e,t);return/^\s*\/\//.test(r)}function w(e){for(var t=e;t<u&&"\n"!==v(t);)t++;return t}function S(){if(m.length>0)return m.shift();if(g)return function(){var e="'"===g?r:t;e.lastIndex=d-1;var n=e.exec(s);if(!n)throw y("string");return d=e.lastIndex,_(g),g=null,p(n[1])}();var n,o,i,f,h,S=0===d;do{if(d===u)return null;for(n=!1;a.test(i=v(d));)if("\n"===i&&(S=!0,++c),++d===u)return null;if("/"===v(d)){if(++d===u)throw y("comment");if("/"===v(d))if(l){if(f=d,h=!1,O(d-1)){h=!0;do{if((d=w(d))===u)break;if(d++,!S)break}while(O(d))}else d=Math.min(u,w(d)+1);h&&(b(f,d,S),S=!0),c++,n=!0}else{for(h="/"===v(f=d+1);"\n"!==v(++d);)if(d===u)return null;++d,h&&(b(f,d-1,S),S=!0),++c,n=!0}else{if("*"!==(i=v(d)))return"/";f=d+1,h=l||"*"===v(f);do{if("\n"===i&&++c,++d===u)throw y("comment");o=i,i=v(d)}while("*"!==o||"/"!==i);++d,h&&(b(f,d-2,S),S=!0),n=!0}}}while(n);var P=d;if(e.lastIndex=0,!e.test(v(P++)))for(;P<u&&!e.test(v(P));)++P;var E=s.substring(d,d=P);return'"'!==E&&"'"!==E||(g=E),E}function _(e){m.push(e)}function P(){if(!m.length){var e=S();if(null===e)return null;_(e)}return m[0]}return Object.defineProperty({next:S,peek:P,push:_,skip:function(e,t){var r=P();if(r===e)return S(),!0;if(!t)throw y("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t,r=null;return void 0===e?(t=h[c-1],delete h[c-1],t&&(l||"*"===t.type||t.lineEmpty)&&(r=t.leading?t.text:null)):(f<e&&P(),t=h[e],delete h[e],!t||t.lineEmpty||!l&&"/"!==t.type||(r=t.leading?null:t.text)),r}},"line",{get:function(){return c}})}return d.unescape=p,tokenize_1}function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1,parse_1=w,w.filename=null,w.defaults={keepCase:!1};var e=requireTokenize(),t=requireRoot(),r=requireType(),n=requireField(),o=requireMapfield(),i=requireOneof(),a=require_enum$1(),s=requireService(),l=requireMethod(),p=requireObject(),d=requireTypes(),u=requireUtil$5(),c=/^[1-9][0-9]*$/,f=/^-?[1-9][0-9]*$/,h=/^0[x][0-9a-fA-F]+$/,m=/^-?0[x][0-9a-fA-F]+$/,g=/^0[0-7]+$/,y=/^-?0[0-7]+$/,v=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,b=/^[a-zA-Z_][a-zA-Z_0-9]*$/,O=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function w(S,_,P){_ instanceof t||(P=_,_=new t),P||(P=w.defaults);var E,T,C,R,D=P.preferTrailingComment||!1,x=e(S,P.alternateCommentMode||!1),k=x.next,j=x.push,A=x.peek,N=x.skip,I=x.cmnt,q=!0,M="proto2",L=_,F=[],B={},V=P.keepCase?function(e){return e}:u.camelCase;function U(e,t,r){var n=w.filename;return r||(w.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+x.line+")")}function $(){var e,t=[];do{if('"'!==(e=k())&&"'"!==e)throw U(e);t.push(k()),N(e),e=A()}while('"'===e||"'"===e);return t.join("")}function G(e){var t=k();switch(t){case"'":case'"':return j(t),$();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(c.test(e))return r*parseInt(e,10);if(h.test(e))return r*parseInt(e,16);if(g.test(e))return r*parseInt(e,8);if(v.test(e))return r*parseFloat(e);throw U(e,"number",t)}(t,!0)}catch(e){if(O.test(t))return t;throw U(t,"value")}}function H(e,t){var r,n;do{if(!t||'"'!==(r=A())&&"'"!==r)try{e.push([n=z(k()),N("to",!0)?z(k()):n])}catch(n){if(!(t&&O.test(r)&&M>=2023))throw n;e.push(r)}else{var o=$();if(e.push(o),M>=2023)throw U(o,"id")}}while(N(",",!0));var i={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};Q(i,function(e){if("option"!==e)throw U(e);re(i,e),N(";")},function(){ie(i)})}function z(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw U(e,"id");if(f.test(e))return parseInt(e,10);if(m.test(e))return parseInt(e,16);if(y.test(e))return parseInt(e,8);throw U(e,"id")}function W(){if(void 0!==E)throw U("package");if(E=k(),!O.test(E))throw U(E,"name");L=L.define(E),N(";")}function J(){var e,t=A();switch(t){case"weak":e=C||(C=[]),k();break;case"public":k();default:e=T||(T=[])}t=$(),N(";"),e.push(t)}function Y(){if(N("="),(M=$())<2023)throw U(M,"syntax");N(";")}function K(){N("="),M=$();if(!["2023"].includes(M))throw U(M,"edition");N(";")}function X(e,t){switch(t){case"option":return re(e,t),N(";"),!0;case"message":return Z(e,t),!0;case"enum":return te(e,t),!0;case"service":return function(e,t){if(!b.test(t=k()))throw U(t,"service name");var r=new s(t);Q(r,function(e){if(!X(r,e)){if("rpc"!==e)throw U(e);!function(e,t){var r=I(),n=t;if(!b.test(t=k()))throw U(t,"name");var o,i,a,s,p=t;N("("),N("stream",!0)&&(i=!0);if(!O.test(t=k()))throw U(t);o=t,N(")"),N("returns"),N("("),N("stream",!0)&&(s=!0);if(!O.test(t=k()))throw U(t);a=t,N(")");var d=new l(p,n,o,a,i,s);d.comment=r,Q(d,function(e){if("option"!==e)throw U(e);re(d,e),N(";")}),e.add(d)}(r,e)}}),e.add(r),e===L&&F.push(r)}(e,t),!0;case"extend":return function(e,t){if(!O.test(t=k()))throw U(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||!O.test(t))throw U(t);j(t),ee(e,"optional",r)}})}(e,t),!0}return!1}function Q(e,t,r){var n=x.line;if(e&&("string"!=typeof e.comment&&(e.comment=I()),e.filename=w.filename),N("{",!0)){for(var o;"}"!==(o=k());)t(o);N(";",!0)}else r&&r(),N(";"),e&&("string"!=typeof e.comment||D)&&(e.comment=I(n)||e.comment)}function Z(e,t){if(!b.test(t=k()))throw U(t,"type name");var n=new r(t);Q(n,function(e){if(!X(n,e))switch(e){case"map":!function(e){N("<");var t=k();if(void 0===d.mapKey[t])throw U(t,"type");N(",");var r=k();if(!O.test(r))throw U(r,"type");N(">");var n=k();if(!b.test(n))throw U(n,"name");N("=");var i=new o(V(n),z(k()),t,r);Q(i,function(e){if("option"!==e)throw U(e);re(i,e),N(";")},function(){ie(i)}),e.add(i)}(n);break;case"required":if("proto2"!==M)throw U(e);case"repeated":ee(n,e);break;case"optional":if("proto3"===M)ee(n,"proto3_optional");else{if("proto2"!==M)throw U(e);ee(n,"optional")}break;case"oneof":!function(e,t){if(!b.test(t=k()))throw U(t,"name");var r=new i(V(t));Q(r,function(e){"option"===e?(re(r,e),N(";")):(j(e),ee(r,"optional"))}),e.add(r)}(n,e);break;case"extensions":H(n.extensions||(n.extensions=[]));break;case"reserved":H(n.reserved||(n.reserved=[]),!0);break;default:if("proto2"===M||!O.test(e))throw U(e);j(e),ee(n,"optional")}}),e.add(n),e===L&&F.push(n)}function ee(e,t,o){var a=k();if("group"!==a){for(;a.endsWith(".")||A().startsWith(".");)a+=k();if(!O.test(a))throw U(a,"type");var s=k();if(!b.test(s))throw U(s,"name");s=V(s),N("=");var l=new n(s,z(k()),a,t,o);if(Q(l,function(e){if("option"!==e)throw U(e);re(l,e),N(";")},function(){ie(l)}),"proto3_optional"===t){var p=new i("_"+s);l.setOption("proto3_optional",!0),p.add(l),e.add(p)}else e.add(l);e===L&&F.push(l)}else!function(e,t){if(M>=2023)throw U("group");var o=k();if(!b.test(o))throw U(o,"name");var i=u.lcFirst(o);o===i&&(o=u.ucFirst(o));N("=");var a=z(k()),s=new r(o);s.group=!0;var l=new n(i,a,o,t);l.filename=w.filename,Q(s,function(e){switch(e){case"option":re(s,e),N(";");break;case"required":case"repeated":ee(s,e);break;case"optional":ee(s,"proto3"===M?"proto3_optional":"optional");break;case"message":Z(s,e);break;case"enum":te(s,e);break;case"reserved":H(s.reserved||(s.reserved=[]),!0);break;default:throw U(e)}}),e.add(s).add(l)}(e,t)}function te(e,t){if(!b.test(t=k()))throw U(t,"name");var r=new a(t);Q(r,function(e){switch(e){case"option":re(r,e),N(";");break;case"reserved":H(r.reserved||(r.reserved=[]),!0),void 0===r.reserved&&(r.reserved=[]);break;default:!function(e,t){if(!b.test(t))throw U(t,"name");N("=");var r=z(k(),!0),n={options:void 0,getOption:function(e){return this.options[e]}};n.setOption=function(e,t){p.prototype.setOption.call(n,e,t)},n.setParsedOption=function(){},Q(n,function(e){if("option"!==e)throw U(e);re(n,e),N(";")},function(){ie(n)}),e.add(t,r,n.comment,n.parsedOptions||n.options)}(r,e)}}),e.add(r),e===L&&F.push(r)}function re(e,t){var r,n,o=!0;for("option"===t&&(t=k());"="!==t;){if("("===t){var i=k();N(")"),t="("+i+")"}if(o){if(o=!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=k()}var s=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,s,n)}function ne(e,t){if(N("{",!0)){for(var r={};!N("}",!0);){if(!b.test(R=k()))throw U(R,"name");if(null===R)throw U(R,"end of input");var n,o=R;if(N(":",!0),"{"===A())n=ne(e,t+"."+R);else if("["===A()){var i;if(n=[],N("[",!0)){do{i=G(),n.push(i)}while(N(",",!0));N("]"),void 0!==i&&oe(e,t+"."+R,i)}}else n=G(),oe(e,t+"."+R,n);var a=r[o];a&&(n=[].concat(a).concat(n)),r[o]=n,N(",",!0),N(";",!0)}return r}var s=G();return oe(e,t,s),s}function oe(e,t,r){L===e&&/^features\./.test(t)?B[t]=r:e.setOption&&e.setOption(t,r)}function ie(e){if(N("[",!0)){do{re(e,"option")}while(N(",",!0));N("]")}return e}for(;null!==(R=k());)switch(R){case"package":if(!q)throw U(R);W();break;case"import":if(!q)throw U(R);J();break;case"syntax":if(!q)throw U(R);Y();break;case"edition":if(!q)throw U(R);K();break;case"option":re(L,R),N(";",!0);break;default:if(X(L,R)){q=!1;continue}throw U(R)}return F.forEach(e=>{e._edition=M,Object.keys(B).forEach(t=>{void 0===e.getOption(t)&&e.setOption(t,B[t],!0)})}),w.filename=null,{package:E,imports:T,weakImports:C,root:_}}return parse_1}function requireCommon$2(){if(hasRequiredCommon$2)return common_1;hasRequiredCommon$2=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$7(){if(hasRequiredSrc$7)return src$4.exports;hasRequiredSrc$7=1;var e=src$4.exports=requireIndexLight();return e.build="full",e.tokenize=requireTokenize(),e.parse=requireParse(),e.common=requireCommon$2(),e.Root._configure(e.Type,e.parse,e.common),src$4.exports}function requireProtobufjs(){return hasRequiredProtobufjs?protobufjs:(hasRequiredProtobufjs=1,protobufjs=requireSrc$7())}var descriptor$1={exports:{}},nested$7={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$2={nested:nested$7},hasRequiredDescriptor$1;function requireDescriptor$1(){return hasRequiredDescriptor$1||(hasRequiredDescriptor$1=1,function(e,t){var r=requireProtobufjs();e.exports=t=r.descriptor=r.Root.fromJSON(require$$4$2).lookup(".google.protobuf");var n=r.Namespace,o=r.Root,i=r.Enum,a=r.Type,s=r.Field,l=r.MapField,p=r.OneOf,d=r.Service,u=r.Method;function c(e,r,l){var p=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,p),e instanceof o||(p.package=e.fullName.substring(1));for(var u,f=0;f<e.nestedArray.length;++f)(u=e._nestedArray[f])instanceof a?p.messageType.push(u.toDescriptor(l)):u instanceof i?p.enumType.push(u.toDescriptor()):u instanceof s?p.extension.push(u.toDescriptor(l)):u instanceof d?p.service.push(u.toDescriptor()):u instanceof n&&c(u,r,l);p.options=_(e.options,t.FileOptions),p.messageType.length+p.enumType.length+p.extension.length+p.service.length&&r.push(p)}o.fromDescriptor=function(e){"number"==typeof e.length&&(e=t.FileDescriptorSet.decode(e));var r=new o;if(e.file)for(var n,l,p,u=0;u<e.file.length;++u){l=r,(n=e.file[u]).package&&n.package.length&&(l=r.define(n.package));var c=T(n);if(n.name&&n.name.length&&r.files.push(l.filename=n.name),n.messageType)for(p=0;p<n.messageType.length;++p)l.add(a.fromDescriptor(n.messageType[p],c));if(n.enumType)for(p=0;p<n.enumType.length;++p)l.add(i.fromDescriptor(n.enumType[p],c));if(n.extension)for(p=0;p<n.extension.length;++p)l.add(s.fromDescriptor(n.extension[p],c));if(n.service)for(p=0;p<n.service.length;++p)l.add(d.fromDescriptor(n.service[p],c));var f=w(n.options,t.FileOptions);if(f){var h=Object.keys(f);for(p=0;p<h.length;++p)l.setOption(h[p],f[h[p]])}}return r.resolveAll()},o.prototype.toDescriptor=function(e){var r=t.FileDescriptorSet.create();return c(this,r.file,e),r};var f=0;a.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.DescriptorProto.decode(e));var o,l=new a(e.name.length?e.name:"Type"+f++,w(e.options,t.MessageOptions));if(n||(l._edition=r),e.oneofDecl)for(o=0;o<e.oneofDecl.length;++o)l.add(p.fromDescriptor(e.oneofDecl[o]));if(e.field)for(o=0;o<e.field.length;++o){var d=s.fromDescriptor(e.field[o],r,!0);l.add(d),e.field[o].hasOwnProperty("oneofIndex")&&l.oneofsArray[e.field[o].oneofIndex].add(d)}if(e.extension)for(o=0;o<e.extension.length;++o)l.add(s.fromDescriptor(e.extension[o],r,!0));if(e.nestedType)for(o=0;o<e.nestedType.length;++o)l.add(a.fromDescriptor(e.nestedType[o],r,!0)),e.nestedType[o].options&&e.nestedType[o].options.mapEntry&&l.setOption("map_entry",!0);if(e.enumType)for(o=0;o<e.enumType.length;++o)l.add(i.fromDescriptor(e.enumType[o],r,!0));if(e.extensionRange&&e.extensionRange.length)for(l.extensions=[],o=0;o<e.extensionRange.length;++o)l.extensions.push([e.extensionRange[o].start,e.extensionRange[o].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(l.reserved=[],e.reservedRange)for(o=0;o<e.reservedRange.length;++o)l.reserved.push([e.reservedRange[o].start,e.reservedRange[o].end]);if(e.reservedName)for(o=0;o<e.reservedName.length;++o)l.reserved.push(e.reservedName[o])}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 o;if(n.field.push(o=this._fieldsArray[r].toDescriptor(e)),this._fieldsArray[r]instanceof l){var p=b(this._fieldsArray[r].keyType,this._fieldsArray[r].resolvedKeyType,!1),d=b(this._fieldsArray[r].type,this._fieldsArray[r].resolvedType,!1),u=11===d||14===d?this._fieldsArray[r].resolvedType&&P(this.parent,this._fieldsArray[r].resolvedType)||this._fieldsArray[r].type:void 0;n.nestedType.push(t.DescriptorProto.create({name:o.typeName,field:[t.FieldDescriptorProto.create({name:"key",number:1,label:1,type:p}),t.FieldDescriptorProto.create({name:"value",number:2,label:1,type:d,typeName:u})],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 s?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 i&&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 h=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;s.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 o,i;switch(o=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:i=void 0;break;case 2:i="required";break;case 3:i="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 s(e.name.length?e.name:"field"+e.number,e.number,o,i,a);if(n||(l._edition=r),l.options=w(e.options,t.FieldOptions),e.proto3_optional&&(l.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var p=e.defaultValue;switch(p){case"true":case"TRUE":p=!0;break;case"false":case"FALSE":p=!1;break;default:h.exec(p)&&(p=parseInt(p))}l.setOption("default",p)}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},s.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=b(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:n.typeName=this.resolvedType?P(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 m=0;i.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.EnumDescriptorProto.decode(e));var o={};if(e.value)for(var a=0;a<e.value.length;++a){var s=e.value[a].name,l=e.value[a].number||0;o[s&&s.length?s:"NAME"+l]=l}var p=new i(e.name&&e.name.length?e.name:"Enum"+m++,o,w(e.options,t.EnumOptions));return n||(p._edition=r),p},i.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 g=0;p.fromDescriptor=function(e){return"number"==typeof e.length&&(e=t.OneofDescriptorProto.decode(e)),new p(e.name&&e.name.length?e.name:"oneof"+g++)},p.prototype.toDescriptor=function(){return t.OneofDescriptorProto.create({name:this.name})};var y=0;d.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.ServiceDescriptorProto.decode(e));var o=new d(e.name&&e.name.length?e.name:"Service"+y++,w(e.options,t.ServiceOptions));if(n||(o._edition=r),e.method)for(var i=0;i<e.method.length;++i)o.add(u.fromDescriptor(e.method[i]));return o},d.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 v=0;function b(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 i)return 14;if(t instanceof a)return r?10:11;throw Error("illegal type: "+e)}function O(e,t){for(var r,n,o={},s=0;s<t.fieldsArray.length;++s)if("uninterpretedOption"!==(n=(r=t._fieldsArray[s]).name)&&Object.prototype.hasOwnProperty.call(e,n)){var l=E(n);r.resolvedType instanceof a?o[l]=O(e[n],r.resolvedType):r.resolvedType instanceof i?o[l]=r.resolvedType.valuesById[e[n]]:o[l]=e[n]}return o}function w(e,t){if(e)return O(t.toObject(e),t)}function S(e,t){for(var n={},o=Object.keys(e),i=0;i<o.length;++i){var s=o[i],l=r.util.camelCase(s);if(Object.prototype.hasOwnProperty.call(t.fields,l)){var p=t.fields[l];p.resolvedType instanceof a?n[l]=S(e[s],p.resolvedType):n[l]=e[s],p.repeated&&!Array.isArray(n[l])&&(n[l]=[n[l]])}}return n}function _(e,t){if(e)return t.fromObject(S(e,t))}function P(e,t){var r=e.fullName.split("."),i=t.fullName.split("."),a=0,s=0,l=i.length-1;if(!(e instanceof o)&&t instanceof n)for(;a<r.length&&s<l&&r[a]===i[s];){var p=t.lookup(r[a++],!0);if(null!==p&&p!==t)break;++s}else for(;a<r.length&&s<l&&r[a]===i[s];++a,++s);return i.slice(s).join(".")}function E(e){return e.substring(0,1)+e.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return"_"+t.toLowerCase()})}function T(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"}u.fromDescriptor=function(e){return"number"==typeof e.length&&(e=t.MethodDescriptorProto.decode(e)),new u(e.name&&e.name.length?e.name:"Method"+v++,"rpc",e.inputType,e.outputType,Boolean(e.clientStreaming),Boolean(e.serverStreaming),w(e.options,t.MethodOptions))},u.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$1,descriptor$1.exports)),descriptor$1.exports}var util$4={},nested$6={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$1={nested:nested$6},nested$5={google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}},require$$5$2={nested:nested$5},nested$4={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$1={nested:nested$4},hasRequiredUtil$4;function requireUtil$4(){if(hasRequiredUtil$4)return util$4;hasRequiredUtil$4=1,
7
+ */function requireCookie(){if(hasRequiredCookie)return cookie;hasRequiredCookie=1,cookie.parse=function(e,r){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},o=e.length;if(o<2)return n;var i=r&&r.decode||l,d=0,u=0,c=0;do{if(-1===(u=e.indexOf("=",d)))break;if(-1===(c=e.indexOf(";",d)))c=o;else if(u>c){d=e.lastIndexOf(";",u-1)+1;continue}var f=a(e,d,u),h=s(e,u,f),m=e.slice(f,h);if(!t.call(n,m)){var g=a(e,u+1,c),y=s(e,c,g);34===e.charCodeAt(g)&&34===e.charCodeAt(y-1)&&(g++,y--);var v=e.slice(g,y);n[m]=p(v,i)}d=c+1}while(d<o);return n},cookie.serialize=function(t,a,s){var l=s&&s.encode||encodeURIComponent;if("function"!=typeof l)throw new TypeError("option encode is invalid");if(!r.test(t))throw new TypeError("argument name is invalid");var p=l(a);if(!n.test(p))throw new TypeError("argument val is invalid");var d=t+"="+p;if(!s)return d;if(null!=s.maxAge){var u=Math.floor(s.maxAge);if(!isFinite(u))throw new TypeError("option maxAge is invalid");d+="; Max-Age="+u}if(s.domain){if(!o.test(s.domain))throw new TypeError("option domain is invalid");d+="; Domain="+s.domain}if(s.path){if(!i.test(s.path))throw new TypeError("option path is invalid");d+="; Path="+s.path}if(s.expires){var c=s.expires;if(!function(t){return"[object Date]"===e.call(t)}(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");d+="; Expires="+c.toUTCString()}s.httpOnly&&(d+="; HttpOnly");s.secure&&(d+="; Secure");s.partitioned&&(d+="; Partitioned");if(s.priority){switch("string"==typeof s.priority?s.priority.toLowerCase():s.priority){case"low":d+="; Priority=Low";break;case"medium":d+="; Priority=Medium";break;case"high":d+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(s.sameSite){switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return d};var e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,r=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,n=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,o=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,i=/^[\u0020-\u003A\u003D-\u007E]*$/;function a(e,t,r){do{var n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<r);return r}function s(e,t,r){for(;t>r;){var n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return r}function l(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function p(e,t){try{return t(e)}catch(t){return e}}return cookie}requireCookie();var alphabetByEncoding={},alphabetByValue=Array.from({length:64});for(let e=0,t="A".charCodeAt(0),r="Z".charCodeAt(0);e+t<=r;e++){const r=String.fromCharCode(e+t);alphabetByEncoding[r]=e,alphabetByValue[e]=r}for(let e=0,t="a".charCodeAt(0),r="z".charCodeAt(0);e+t<=r;e++){const r=String.fromCharCode(e+t),n=e+26;alphabetByEncoding[r]=n,alphabetByValue[n]=r}for(let e=0;e<10;e++){alphabetByEncoding[e.toString(10)]=e+52;const t=e.toString(10),r=e+52;alphabetByEncoding[t]=r,alphabetByValue[r]=t}alphabetByEncoding["-"]=62,alphabetByValue[62]="-",alphabetByEncoding._=63,alphabetByValue[63]="_";var bitsPerLetter=6,bitsPerByte=8,maxLetterValue=63,stringToBuffer=e=>(new TextEncoder).encode(e),bufferToString=e=>(new TextDecoder).decode(e),base64urlDecode=e=>{const t=e+"=".repeat((4-e.length%4)%4);let r=t.length/4*3;t.endsWith("==")?r-=2:t.endsWith("=")&&r--;const n=new ArrayBuffer(r),o=new DataView(n);for(let e=0;e<t.length;e+=4){let r=0,n=0;for(let o=e,i=e+3;o<=i;o++)if("="===t[o])r>>=bitsPerLetter;else{if(!(t[o]in alphabetByEncoding))throw new TypeError(`Invalid character ${t[o]} in base64 string.`);r|=alphabetByEncoding[t[o]]<<(i-o)*bitsPerLetter,n+=bitsPerLetter}const i=e/4*3;r>>=n%bitsPerByte;const a=Math.floor(n/bitsPerByte);for(let e=0;e<a;e++){const t=(a-e-1)*bitsPerByte;o.setUint8(i+e,(r&255<<t)>>t)}}return new Uint8Array(n)},base64urlEncode=e=>{const t="string"==typeof e?stringToBuffer(e):e;let r="";for(let e=0;e<t.length;e+=3){let n=0,o=0;for(let r=e,i=Math.min(e+3,t.length);r<i;r++)n|=t[r]<<(i-r-1)*bitsPerByte,o+=bitsPerByte;const i=Math.ceil(o/bitsPerLetter);n<<=i*bitsPerLetter-o;for(let e=1;e<=i;e++){const t=(i-e)*bitsPerLetter;r+=alphabetByValue[(n&maxLetterValue<<t)>>t]}}return r},defaults={encryption:{saltBits:256,algorithm:"aes-256-cbc",iterations:1,minPasswordlength:32},integrity:{saltBits:256,algorithm:"sha256",iterations:1,minPasswordlength:32},ttl:0,timestampSkewSec:60,localtimeOffsetMsec:0},clone$1=e=>({...e,encryption:{...e.encryption},integrity:{...e.integrity}}),algorithms={"aes-128-ctr":{keyBits:128,ivBits:128,name:"AES-CTR"},"aes-256-cbc":{keyBits:256,ivBits:128,name:"AES-CBC"},sha256:{keyBits:256,name:"SHA-256"}},macPrefix="Fe26.2",randomBytes=(e,t)=>{const r=new Uint8Array(t);return e.getRandomValues(r),r},randomBits=(e,t)=>{if(t<1)throw new Error("Invalid random bits count");const r=Math.ceil(t/8);return randomBytes(e,r)},pbkdf2=async(e,t,r,n,o,i)=>{const a=stringToBuffer(t),s=await e.subtle.importKey("raw",a,{name:"PBKDF2"},!1,["deriveBits"]),l={name:"PBKDF2",hash:i,salt:stringToBuffer(r),iterations:n};return await e.subtle.deriveBits(l,s,8*o)},generateKey=async(e,t,r)=>{var n;if(!(null==t?void 0:t.length))throw new Error("Empty password");if(null==r||"object"!=typeof r)throw new Error("Bad options");if(!(r.algorithm in algorithms))throw new Error(`Unknown algorithm: ${r.algorithm}`);const o=algorithms[r.algorithm],i={},a=null!=(n=r.hmac)&&n,s=a?{name:"HMAC",hash:o.name}:{name:o.name},l=a?["sign","verify"]:["encrypt","decrypt"];if("string"==typeof t){if(t.length<r.minPasswordlength)throw new Error(`Password string too short (min ${r.minPasswordlength} characters required)`);let{salt:n=""}=r;if(!n){const{saltBits:t=0}=r;if(!t)throw new Error("Missing salt and saltBits options");const o=randomBits(e,t);n=[...new Uint8Array(o)].map(e=>e.toString(16).padStart(2,"0")).join("")}const a=await pbkdf2(e,t,n,r.iterations,o.keyBits/8,"SHA-1"),p=await e.subtle.importKey("raw",a,s,!1,l);i.key=p,i.salt=n}else{if(t.length<o.keyBits/8)throw new Error("Key buffer (password) too small");i.key=await e.subtle.importKey("raw",t,s,!1,l),i.salt=""}return r.iv?i.iv=r.iv:"ivBits"in o&&(i.iv=randomBits(e,o.ivBits)),i},getEncryptParams=(e,t,r)=>["aes-128-ctr"===e?{name:"AES-CTR",counter:t.iv,length:128}:{name:"AES-CBC",iv:t.iv},t.key,"string"==typeof r?stringToBuffer(r):r],encrypt=async(e,t,r,n)=>{const o=await generateKey(e,t,r),i=await e.subtle.encrypt(...getEncryptParams(r.algorithm,o,n));return{encrypted:new Uint8Array(i),key:o}},decrypt=async(e,t,r,n)=>{const o=await generateKey(e,t,r),i=await e.subtle.decrypt(...getEncryptParams(r.algorithm,o,n));return bufferToString(new Uint8Array(i))},hmacWithPassword=async(e,t,r,n)=>{const o=await generateKey(e,t,{...r,hmac:!0}),i=stringToBuffer(n),a=await e.subtle.sign({name:"HMAC"},o.key,i);return{digest:base64urlEncode(new Uint8Array(a)),salt:o.salt}},normalizePassword=e=>"string"==typeof e||e instanceof Uint8Array?{encryption:e,integrity:e}:"secret"in e?{id:e.id,encryption:e.secret,integrity:e.secret}:{id:e.id,encryption:e.encryption,integrity:e.integrity},seal=async(e,t,r,n)=>{if(!r)throw new Error("Empty password");const o=clone$1(n),i=Date.now()+(o.localtimeOffsetMsec||0),a=JSON.stringify(t),s=normalizePassword(r),{id:l="",encryption:p,integrity:d}=s;if(l&&!/^\w+$/.test(l))throw new Error("Invalid password id");const{encrypted:u,key:c}=await encrypt(e,p,o.encryption,a),f=base64urlEncode(new Uint8Array(u)),h=base64urlEncode(c.iv),m=o.ttl?i+o.ttl:"",g=`${macPrefix}*${l}*${c.salt}*${h}*${f}*${m}`,y=await hmacWithPassword(e,d,o.integrity,g);return`${g}*${y.salt}*${y.digest}`},fixedTimeComparison=(e,t)=>{let r=e.length===t.length?0:1;r&&(t=e);for(let n=0;n<e.length;n+=1)r|=e.charCodeAt(n)^t.charCodeAt(n);return 0===r},unseal=async(e,t,r,n)=>{if(!r)throw new Error("Empty password");const o=clone$1(n),i=Date.now()+(o.localtimeOffsetMsec||0),a=t.split("*");if(8!==a.length)throw new Error("Incorrect number of sealed components");const s=a[0];let l=a[1];const p=a[2],d=a[3],u=a[4],c=a[5],f=a[6],h=a[7],m=`${s}*${l}*${p}*${d}*${u}*${c}`;if(macPrefix!==s)throw new Error("Wrong mac prefix");if(c){if(!/^\d+$/.test(c))throw new Error("Invalid expiration");if(Number.parseInt(c,10)<=i-1e3*o.timestampSkewSec)throw new Error("Expired seal")}let g="";if(l=l||"default","string"==typeof r||r instanceof Uint8Array)g=r;else{if(!(l in r))throw new Error(`Cannot find password: ${l}`);g=r[l]}g=normalizePassword(g);const y=o.integrity;y.salt=f;const v=await hmacWithPassword(e,g.integrity,y,m);if(!fixedTimeComparison(v.digest,h))throw new Error("Bad hmac value");const b=base64urlDecode(u),O=o.encryption;O.salt=p,O.iv=base64urlDecode(d);const w=await decrypt(e,g.encryption,O,b);return w?JSON.parse(w):null};const webCrypto=globalThis.crypto,subtle=webCrypto.subtle,randomUUID$1=()=>webCrypto.randomUUID(),getRandomValues$1=e=>webCrypto.getRandomValues(e),_crypto={randomUUID:randomUUID$1,getRandomValues:getRandomValues$1,subtle:subtle};var crypto$1=Object.freeze({__proto__:null,default:_crypto,getRandomValues:getRandomValues$1,randomUUID:randomUUID$1,subtle:subtle}),fourteenDaysInSeconds=1209600,currentMajorVersion=2,versionDelimiter="~";function normalizeStringPasswordToMap(e){return"string"==typeof e?{1:e}:e}function parseSeal(e){const[t,r]=e.split(versionDelimiter);return{sealWithoutVersion:t,tokenVersion:null==r?null:parseInt(r,10)}}function createSealData(e){return async function(t,{password:r,ttl:n=fourteenDaysInSeconds}){const o=normalizeStringPasswordToMap(r),i=Math.max(...Object.keys(o).map(Number)),a={id:i.toString(),secret:o[i]};return`${await seal(e,t,a,{...defaults,ttl:1e3*n})}${versionDelimiter}${currentMajorVersion}`}}function createUnsealData(e){return async function(t,{password:r,ttl:n=fourteenDaysInSeconds}){const o=normalizeStringPasswordToMap(r),{sealWithoutVersion:i,tokenVersion:a}=parseSeal(t);try{const t=await unseal(e,i,o,{...defaults,ttl:1e3*n})??{};return 2===a?t:{...t.persistent}}catch(e){if(e instanceof Error&&/^(Expired seal|Bad hmac value|Cannot find password|Incorrect number of sealed components)/.test(e.message))return{};throw e}}}var sealData=createSealData(crypto$1),unsealData=createUnsealData(crypto$1),createAnnouncementAttachmentArgsSchema=z__default.default.object({courseId:z__default.default.string(),itemId:z__default.default.string(),addOnToken:z__default.default.string(),title:z__default.default.string(),lessonSlug:z__default.default.string(),programmeSlug:z__default.default.string(),unitSlug:z__default.default.string(),maxPoints:z__default.default.number().optional()}),classroomAttachmentSchema=z__default.default.object({courseId:z__default.default.string(),postId:z__default.default.string(),id:z__default.default.string(),title:z__default.default.string(),teacherViewUri:z__default.default.object({uri:z__default.default.string()}),studentViewUri:z__default.default.object({uri:z__default.default.string()}),studentWorkReviewUri:z__default.default.object({uri:z__default.default.string()}).optional(),itemId:z__default.default.string(),maxPoints:z__default.default.number().optional()});z__default.default.string();var googleOAuthUserSchema=z__default.default.object({accessToken:z__default.default.string(),loginHint:z__default.default.string(),refreshToken:z__default.default.string().optional(),profilePictureUrl:z__default.default.string().optional(),email:z__default.default.string().optional()}),tokenPayloadSchema=z__default.default.object({token:z__default.default.string()});z__default.default.tuple([createAnnouncementAttachmentArgsSchema,z__default.default.string().min(1),z__default.default.string().min(1)]);var classroomAttachmentEntitySchema=classroomAttachmentSchema.extend({attachmentId:z__default.default.string(),createdAt:z__default.default.string()}),userCredentialsEntitySchema=z__default.default.object({loginHint:z__default.default.string(),refreshToken:z__default.default.string().optional(),profilePictureUrl:z__default.default.string().optional()}),GoogleClassroomClient=function(){function e(e,t){this.baseUrl=e,this.oAuthClient=t,this.baseUrl=e,this.oAuthClient=t}return e.prototype.getClassroomClient=function(){return __awaiter(this,void 0,void 0,function(){var e;return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.oAuthClient.getOAuth2Client()];case 1:return e=t.sent(),[2,new classroom.classroom_v1.Classroom({auth:e})]}})})},e.prototype.createAnnouncementAttachment=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o,i,a,s,l,p,d,u,c,f;return __generator$1(this,function(h){switch(h.label){case 0:return t=e.courseId,r=e.itemId,n=e.addOnToken,o=e.title,i=e.lessonSlug,a=e.programmeSlug,s=e.unitSlug,l=e.maxPoints,[4,this.getClassroomClient()];case 1:return p=h.sent(),d=l?{maxPoints:l,studentWorkReviewUri:{uri:"".concat(this.baseUrl,"/pupils/programmes/").concat(a,"/units/").concat(s,"/lessons/").concat(i)}}:{},[4,p.courses.courseWork.addOnAttachments.create({courseId:t,itemId:r,addOnToken:n,requestBody:__assign({title:o,teacherViewUri:{uri:"".concat(this.baseUrl,"/pupils/programmes/").concat(a,"/units/").concat(s,"/lessons/").concat(i)},studentViewUri:{uri:"".concat(this.baseUrl,"/pupils/programmes/").concat(a,"/units/").concat(s,"/lessons/").concat(i)}},d)})];case 2:return u=h.sent(),c=classroomAttachmentSchema.parse(u.data),f=c.maxPoints?{maxPoints:c.maxPoints,studentWorkReviewUri:c.studentWorkReviewUri}:{},[2,__assign({courseId:c.courseId,postId:c.postId,id:c.id,title:c.title,teacherViewUri:c.teacherViewUri,studentViewUri:c.studentViewUri,itemId:c.itemId},f)]}})})},e.prototype.submitPupilResponse=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.getClassroomClient()];case 1:return[4,t.sent().courses.courseWork.addOnAttachments.studentSubmissions.patch({courseId:e.courseId,itemId:e.itemId,attachmentId:e.attachmentId,submissionId:e.submissionId,updateMask:"pointsEarned",requestBody:{pointsEarned:e.pointsEarned}})];case 2:return[2,t.sent().data]}})})},e.prototype.fetchPupilResponse=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.getClassroomClient()];case 1:return[4,t.sent().courses.courseWork.addOnAttachments.studentSubmissions.get({courseId:e.courseId,itemId:e.itemId,attachmentId:e.attachmentId,submissionId:e.submissionId})];case 2:return[2,t.sent().data]}})})},e}(),ExceptionType,ErrorSeverity;exports.ExceptionType=void 0,ExceptionType=exports.ExceptionType||(exports.ExceptionType={}),ExceptionType.GoogleOAuth="google-oauth",ExceptionType.Firestore="firestore",ExceptionType.Encryption="encryption",exports.ErrorSeverity=void 0,ErrorSeverity=exports.ErrorSeverity||(exports.ErrorSeverity={}),ErrorSeverity.Error="error",ErrorSeverity.Warning="warning",ErrorSeverity.Info="info";var OakGoogleClassroomException=function(e){function t(r,n,o){var i,a,s,l=e.call(this,r)||this;return Object.setPrototypeOf(l,t.prototype),l.name="OakGoogleClassroomException",l.type=n,l.code=null==o?void 0:o.code,l.shouldRetry=null!==(i=null==o?void 0:o.shouldRetry)&&void 0!==i&&i,l.severity=null!==(a=null==o?void 0:o.severity)&&void 0!==a?a:exports.ErrorSeverity.Error,l.context=null==o?void 0:o.context,l.originalError=null==o?void 0:o.originalError,(null===(s=null==o?void 0:o.originalError)||void 0===s?void 0:s.stack)&&(l.stack=o.originalError.stack),l}return __extends$1(t,e),t.prototype.toObject=function(){return{name:this.name,message:this.message,type:this.type,code:this.code,shouldRetry:this.shouldRetry,severity:this.severity,context:this.context,originalError:this.originalError}},t}(Error),src$7={},src$6={},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$3="1.14.0",require$$11={version:version$3},hasRequiredLogging;function requireLogging(){return hasRequiredLogging||(hasRequiredLogging=1,function(e){var t,r,n,o;Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.setLoggerVerbosity=e.setLogger=e.getLogger=void 0,e.trace=function(t,r,n){m(r)&&(0,e.log)(t,(new Date).toISOString()+" | v"+s+" "+a.pid+" | "+r+" | "+n)},e.isTracerEnabled=m;const i=requireConstants(),a=require$$1__default.default,s=require$$11.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 p=l,d=i.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":d=i.LogVerbosity.DEBUG;break;case"INFO":d=i.LogVerbosity.INFO;break;case"ERROR":d=i.LogVerbosity.ERROR;break;case"NONE":d=i.LogVerbosity.NONE}e.getLogger=()=>p;e.setLogger=e=>{p=e};e.setLoggerVerbosity=e=>{d=e};e.log=(e,...t)=>{let r;if(e>=d){switch(e){case i.LogVerbosity.DEBUG:r=p.debug;break;case i.LogVerbosity.INFO:r=p.info;break;case i.LogVerbosity.ERROR:r=p.error}r||(r=p.error),r&&r.bind(p)(...t)}};const u=null!==(o=null!==(n=process.env.GRPC_NODE_TRACE)&&void 0!==n?n:process.env.GRPC_TRACE)&&void 0!==o?o:"",c=new Set,f=new Set;for(const e of u.split(","))e.startsWith("-")?f.add(e.substring(1)):c.add(e);const h=c.has("all");function m(e){return!f.has(e)&&(h||c.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_.-]+$/,o=/^[ -~]*$/;function i(e){return e.endsWith("-bin")}function a(e){return!e.startsWith("grpc-")}function s(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(i(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 o.test(e)}(t))throw new Error('Metadata string value "'+t+'" contains illegal characters')}}class p{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,t){l(e=s(e),t),this.internalRepr.set(e,[t])}add(e,t){l(e=s(e),t);const r=this.internalRepr.get(e);void 0===r?this.internalRepr.set(e,[t]):r.push(t)}remove(e){e=s(e),this.internalRepr.delete(e)}get(e){return e=s(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 p(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(d));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 o=new p;for(const s of Object.keys(n)){if(":"===s.charAt(0))continue;const l=n[s];try{i(s)?Array.isArray(l)?l.forEach(e=>{o.add(s,Buffer.from(e,"base64"))}):void 0!==l&&(a(s)?l.split(",").forEach(e=>{o.add(s,Buffer.from(e.trim(),"base64"))}):o.add(s,Buffer.from(l,"base64"))):Array.isArray(l)?l.forEach(e=>{o.add(s,e)}):void 0!==l&&o.add(s,l)}catch(n){const o=`Failed to add metadata entry ${s}: ${l}. ${(0,r.getErrorMessage)(n)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,e.log)(t.LogVerbosity.ERROR,o)}}return o}}metadata.Metadata=p;const d=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 o;o=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"))})}),o.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 o}}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 o extends t{generateMetadata(t){return Promise.resolve(new e.Metadata)}compose(e){return e}_equals(e){return e instanceof o}}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__default.default;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 o=e.substring(r+2);return t.test(o)?{host:n,port:+o}: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,o){if(void 0!==r.scheme&&r.scheme in t)return new t[r.scheme](r,n,o);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 f(e,t,null!=r?r:{})};const e=require$$1__default$1.default,t=requireCallCredentials(),r=requireTlsHelpers(),n=requireUriParser(),o=requireResolver(),i=requireLogging(),a=requireConstants();function s(e,t){if(e&&!(e instanceof Buffer))throw new TypeError(`${t}, if provided, must be a Buffer.`)}class l{compose(e){return new h(this,e)}static createSsl(t,n,o,i){var a;if(s(t,"Root certificate"),s(n,"Private key"),s(o,"Certificate chain"),n&&!o)throw new Error("Private key must be given with accompanying certificate chain");if(!n&&o)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!=o?o:void 0,ciphers:r.CIPHER_SUITES});return new c(l,null!=i?i:{})}static createFromSecureContext(e,t){return new c(e,null!=t?t:{})}static createInsecure(){return new p}}channelCredentials.ChannelCredentials=l;class p extends l{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof p}_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 d(t,r,i,a){var s,l;const p={secureContext:t};let d=i;if("grpc.http_connect_target"in a){const e=(0,n.parseUri)(a["grpc.http_connect_target"]);e&&(d=e)}const u=(0,o.getDefaultAuthority)(d),c=(0,n.splitHostPort)(u),f=null!==(s=null==c?void 0:c.host)&&void 0!==s?s:u;if(p.host=f,r.checkServerIdentity&&(p.checkServerIdentity=r.checkServerIdentity),void 0!==r.rejectUnauthorized&&(p.rejectUnauthorized=r.rejectUnauthorized),p.ALPNProtocols=["h2"],a["grpc.ssl_target_name_override"]){const t=a["grpc.ssl_target_name_override"],r=null!==(l=p.checkServerIdentity)&&void 0!==l?l:e.checkServerIdentity;p.checkServerIdentity=(e,n)=>r(t,n),p.servername=t}else p.servername=f;return a["grpc-node.tls_enable_trace"]&&(p.enableTrace=!0),p}class u{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 o=(0,e.connect)(r,()=>{var e;null!==(e=this.connectionOptions.rejectUnauthorized)&&void 0!==e&&!e||o.authorized?t({socket:o,secure:!0}):n(o.authorizationError)});o.on("error",e=>{n(e)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}}class c extends l{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e||e instanceof c&&(this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity)}_createSecureConnector(e,r,n){const o=d(this.secureContext,this.verifyOptions,e,r);return new u(o,null!=n?n:t.CallCredentials.createEmpty())}}class f 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 f&&(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 f.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,i.log)(a.LogVerbosity.ERROR,"Failed to createSecureContext with error "+e.message),null}}}f.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 o=this.parent.getLatestSecureContext();if(!o)return void n(new Error("Failed to load credentials"));t.closed&&n(new Error("Socket closed while loading credentials"));const i=d(o,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:t},i),s=()=>{n(new Error("Socket closed"))},l=e=>{n(e)},p=(0,e.connect)(a,()=>{var e;p.removeListener("close",s),p.removeListener("error",l),null!==(e=this.parent.verifyOptions.rejectUnauthorized)&&void 0!==e&&!e||p.authorized?r({socket:p,secure:!0}):n(p.authorizationError)});p.once("close",s),p.once("error",l)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};class h 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 h(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e||e instanceof h&&(this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials))}_createSecureConnector(e,r,n){const o=this.callCredentials.compose(null!=n?n:t.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,r,o)}}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,o,i,a,s,l,p,d,u;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!==(i=null===(o=t.updateState)||void 0===o?void 0:o.bind(t))&&void 0!==i?i:e.updateState.bind(e),requestReresolution:null!==(s=null===(a=t.requestReresolution)||void 0===a?void 0:a.bind(t))&&void 0!==s?s:e.requestReresolution.bind(e),addChannelzChild:null!==(p=null===(l=t.addChannelzChild)||void 0===l?void 0:l.bind(t))&&void 0!==p?p:e.addChannelzChild.bind(e),removeChannelzChild:null!==(u=null===(d=t.removeChannelzChild)||void 0===d?void 0:d.bind(t))&&void 0!==u?u: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=o,loadBalancer.getDefaultConfig=function(){if(!n)throw new Error("No default load balancer type registered");return new r[n].LoadBalancingConfig},loadBalancer.selectLbConfigFromList=function(i,a=!1){for(const r of i)try{return o(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 o(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 d(JSON.parse(e),t)}return null};const e=require$$0__default$1.default,t=requireConstants(),r=/^\d+(\.\d{1,9})?s$/,n="node";function o(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 i(e){var n;const i={name:[]};if(!("name"in e)||!Array.isArray(e.name))throw new Error("Invalid method config: invalid name array");for(const t of e.name)i.name.push(o(t));if("waitForReady"in e){if("boolean"!=typeof e.waitForReady)throw new Error("Invalid method config: invalid waitForReady");i.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");i.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(".");i.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");i.maxRequestBytes=e.maxRequestBytes}if("maxResponseBytes"in e){if("number"!=typeof e.maxResponseBytes)throw new Error("Invalid method config: invalid maxRequestBytes");i.maxResponseBytes=e.maxResponseBytes}if("retryPolicy"in e){if("hedgingPolicy"in e)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");i.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&&(i.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 i}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 s(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(s(r))}if("methodConfig"in e&&Array.isArray(e.methodConfig))for(const r of e.methodConfig)t.methodConfig.push(i(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 p(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 d(t,r){if(!Array.isArray(t))throw new Error("Invalid service config list");for(const o of t){const t=p(o);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 o;if(this.calledByPendingChild()){if(e===t.ConnectivityState.CONNECTING)return;null===(o=this.parent.currentChild)||void 0===o||o.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,o){let i;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,i=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=n,i=this.pendingChild)}else i=null===this.pendingChild?this.currentChild:this.pendingChild;return this.latestConfig=r,i.updateAddressList(t,r,n,o)}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(),o=requirePicker(),i=requireBackoffTimeout(),a=requireConstants(),s=requireMetadata(),l=requireLogging(),p=requireConstants(),d=requireUriParser(),u=requireLoadBalancerChildHandler();function c(e){l.trace(p.LogVerbosity.DEBUG,"resolving_load_balancer",e)}const f=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function h(e,t,r,n){for(const o of r.name)switch(n){case"EMPTY":if(!o.service&&!o.method)return!0;break;case"SERVICE":if(o.service===e&&!o.method)return!0;break;case"SERVICE_AND_METHOD":if(o.service===e&&o.method===t)return!0}return!1}function m(e,t,r,n){for(const o of r)if(h(e,t,o,n))return o;return null}return resolvingLoadBalancer.ResolvingLoadBalancer=class{constructor(e,a,s,l,p){this.target=e,this.channelControlHelper=a,this.channelOptions=s,this.onSuccessfulResolution=l,this.onFailedResolution=p,this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new o.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,s["grpc.service_config"]?this.defaultServiceConfig=(0,t.validateServiceConfig)(JSON.parse(s["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(r.ConnectivityState.IDLE,new o.QueuePicker(this),null),this.childLoadBalancer=new u.ChildLoadBalancerHandler({createSubchannel:a.createSubchannel.bind(a),requestReresolution:()=>{this.backoffTimeout.isRunning()?(c("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),s);const d={initialDelay:s["grpc.initial_reconnect_backoff_ms"],maxDelay:s["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new i.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},d),this.backoffTimeout.unref()}handleResolverResult(t,r,o,i){var l,p;this.backoffTimeout.stop(),this.backoffTimeout.reset();let d=!0,u=null;if(null===o?u=this.defaultServiceConfig:o.ok?u=o.value:null!==this.previousServiceConfig?u=this.previousServiceConfig:(d=!1,this.handleResolutionFailure(o.error)),null!==u){const n=null!==(l=null==u?void 0:u.loadBalancingConfig)&&void 0!==l?l:[],o=(0,e.selectLbConfigFromList)(n,!0);null===o?(d=!1,this.handleResolutionFailure({code:a.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new s.Metadata})):d=this.childLoadBalancer.updateAddressList(t,o,Object.assign(Object.assign({},this.channelOptions),r),i)}return d&&this.onSuccessfulResolution(u,null!==(p=r[n.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])&&void 0!==p?p:function(e){return{invoke(t,r){var n,o;const i=t.split("/").filter(e=>e.length>0),s=null!==(n=i[0])&&void 0!==n?n:"",l=null!==(o=i[1])&&void 0!==o?o:"";if(e&&e.methodConfig)for(const t of f){const r=m(s,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(){}}}(u)),d}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){c((0,d.uriToString)(this.target)+" "+r.ConnectivityState[this.currentState]+" -> "+r.ConnectivityState[e]),e===r.ConnectivityState.IDLE&&(t=new o.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 o.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 o.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 o=0;o<r.length;o+=1){if(r[o]!==n[o])return!1;if(e[r[o]]!==t[n[o]])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:o}:{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=i;const e=require$$0__default$2.default;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 o=443;function i(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 o of t.addresses)if(r(n,o)){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(i(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,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return l([e,t])}}function l(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[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 o=t.h;if(t===o.t?o.t=void 0:o.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;o!==this.A;)o.O-=1,o=o.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,o=0,i=this.N,a=[];a.length||i;)if(i)a.push(i),i=i.t;else{if(i=a.pop(),o===t)return i;n&&n.push(i),r&&r(i,o,this),o+=1,i=i.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):(o=r.h).t===r?o.t=e:o.i=e,e.h=r.h,t.h=e,r.h=e,r.l=1}else{var n,o;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):(o=r.h).t===r?o.t=e:o.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,o=this.A.t,i=this.g(o.u,e);if(0===i)return o.o=t,this._;if(i>0)o.t=new this.S(e,t),o.t.h=o,n=o.t,this.A.t=n;else{var a=this.A.i,s=this.g(a.u,e);if(0===s)return a.o=t,this._;if(s<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 p=this.g(l.u,e);if(0===p)return l.o=t,this._;if(p>0){var d=l.v(),u=this.g(d.u,e);if(0===u)return d.o=t,this._;u<0&&(n=new this.S(e,t),void 0===d.i?(d.i=n,n.h=d):(l.t=n,n.h=l))}}}if(void 0===n)for(n=this.N;;){var c=this.g(n.u,e);if(c>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(!(c<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 f=n.h;f!==this.A;)f.O+=1,f=f.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 o=r.v().u;return r===this.A.i?this.g(o,t)<0&&(r.u=t,!0):!(this.g(o,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 o=e.call(this,n)||this;return o.C=t,o.A=r,0===o.iteratorType?(o.pre=function(){return this.C===this.A.t&&throwIteratorAccessError(),this.C=this.C.v(),this},o.next=function(){return this.C===this.A&&throwIteratorAccessError(),this.C=this.C.p(),this}):(o.pre=function(){return this.C===this.A.i&&throwIteratorAccessError(),this.C=this.C.p(),this},o.next=function(){return this.C===this.A&&throwIteratorAccessError(),this.C=this.C.v(),this}),o}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,o){var i=e.call(this,t,r,o)||this;return i.container=n,i}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 o=e.call(this,r,n)||this,i=o;return t.forEach(function(e){i.setElement(e[0],e[1])}),o}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(o){switch(o.label){case 0:e=this._,t=this.P(),r=0,o.label=1;case 1:return r<e?[4,[(n=t[r]).u,n.o]]:[3,4];case 2:o.sent(),o.label=3;case 3:return++r,[3,1];case 4:return[2]}})},t}(TreeContainer),esm=Object.freeze({__proto__:null,OrderedMap:OrderedMap}),require$$1$2=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$1={},hasRequiredCall$1;function requireCall$1(){if(hasRequiredCall$1)return call$1;hasRequiredCall$1=1,Object.defineProperty(call$1,"__esModule",{value:!0}),call$1.ClientDuplexStreamImpl=call$1.ClientWritableStreamImpl=call$1.ClientReadableStreamImpl=call$1.ClientUnaryCallImpl=void 0,call$1.callErrorFromStatus=function(e,t){const n=`${e.code} ${r.Status[e.code]}: ${e.details}`,o=new Error(n),i=`${o.stack}\nfor call at\n${t}`;return Object.assign(new Error(n),e,{stack:i})};const e=require$$0__default$3.default,t=Stream__default.default,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$1.ClientUnaryCallImpl=n;class o 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$1.ClientReadableStreamImpl=o;class i 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 o={callback:r},i=Number(t);Number.isNaN(i)||(o.flags=i),null===(n=this.call)||void 0===n||n.sendMessageWithContext(o,e)}_final(e){var t;null===(t=this.call)||void 0===t||t.halfClose(),e()}}call$1.ClientWritableStreamImpl=i;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 o={callback:r},i=Number(t);Number.isNaN(i)||(o.flags=i),null===(n=this.call)||void 0===n||n.sendMessageWithContext(o,e)}_final(e){var t;null===(t=this.call)||void 0===t||t.halfClose(),e()}}return call$1.ClientDuplexStreamImpl=a,call$1}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 o("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 o("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let i=[];i=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}),s=i.reduceRight((e,t)=>r=>t(r,e),e=>d(n,e,t));return s(a)};const e=requireMetadata(),t=requireCallInterface(),r=requireConstants(),n=requireError();class o extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,o)}}clientInterceptors.InterceptorConfigurationError=o;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 i={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,o,i;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!==(o=t.halfClose)&&void 0!==o?o:a.halfClose,cancel:null!==(i=t.cancel)&&void 0!==i?i: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,o,a,s,l,p;const d={onReceiveMetadata:null!==(o=null===(n=null==r?void 0:r.onReceiveMetadata)||void 0===n?void 0:n.bind(r))&&void 0!==o?o:e=>{},onReceiveMessage:null!==(s=null===(a=null==r?void 0:r.onReceiveMessage)||void 0===a?void 0:a.bind(r))&&void 0!==s?s:e=>{},onReceiveStatus:null!==(p=null===(l=null==r?void 0:r.onReceiveStatus)||void 0===l?void 0:l.bind(r))&&void 0!==p?p:e=>{}};this.processingMetadata=!0,this.requester.start(e,d,(e,r)=>{var n,o,a;let s;if(this.processingMetadata=!1,(0,t.isInterceptingListener)(r))s=r;else{const e={onReceiveMetadata:null!==(n=r.onReceiveMetadata)&&void 0!==n?n:i.onReceiveMetadata,onReceiveMessage:null!==(o=r.onReceiveMessage)&&void 0!==o?o:i.onReceiveMessage,onReceiveStatus:null!==(a=r.onReceiveStatus)&&void 0!==a?a:i.onReceiveStatus};s=new t.InterceptingListenerImpl(e,d)}this.nextCall.start(e,s),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 s{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 o;try{o=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,o)}sendMessage(e){this.sendMessageWithContext({},e)}start(t,o){let i=null;this.call.start(t,{onReceiveMetadata:e=>{var t;null===(t=null==o?void 0:o.onReceiveMetadata)||void 0===t||t.call(o,e)},onReceiveMessage:t=>{var a;let s;try{s=this.methodDefinition.responseDeserialize(t)}catch(t){return i={code:r.Status.INTERNAL,details:`Response message parsing error: ${(0,n.getErrorMessage)(t)}`,metadata:new e.Metadata},void this.call.cancelWithStatus(i.code,i.details)}null===(a=null==o?void 0:o.onReceiveMessage)||void 0===a||a.call(o,s)},onReceiveStatus:e=>{var t,r;i?null===(t=null==o?void 0:o.onReceiveStatus)||void 0===t||t.call(o,i):null===(r=null==o?void 0:o.onReceiveStatus)||void 0===r||r.call(o,e)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}}class l extends s{constructor(e,t){super(e,t)}start(e,t){var r,n;let o=!1;const i={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;o=!0,null===(r=null==t?void 0:t.onReceiveMessage)||void 0===r||r.call(t,e)},onReceiveStatus:e=>{var r,n;o||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,i),this.call.startRead()}}class p extends s{}function d(e,t,r){const n=function(e,t,r){var n,o;const i=null!==(n=r.deadline)&&void 0!==n?n:1/0,a=r.host,s=null!==(o=r.parent)&&void 0!==o?o:null,l=r.propagate_flags,p=r.credentials,d=e.createCall(t,i,a,s,l);return p&&d.setCredentials(p),d}(e,r.path,t);return r.responseStream?new p(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$1(),t=requireChannel(),r=requireConnectivityState(),n=requireConstants(),o=requireMetadata(),i=requireClientInterceptors(),a=Symbol(),s=Symbol(),l=Symbol(),p=Symbol();function d(e){return"function"==typeof e}function u(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 o,i;if(n=Object.assign({},n),this[s]=null!==(o=n.interceptors)&&void 0!==o?o:[],delete n.interceptors,this[l]=null!==(i=n.interceptor_providers)&&void 0!==i?i:[],delete n.interceptor_providers,this[s].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[p]=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=o=>{if(o)return void t(new Error("Failed to connect before the deadline"));let i;try{i=this[a].getConnectivityState(!0)}catch(e){return void t(new Error("The channel has been closed"))}if(i===r.ConnectivityState.READY)t();else try{this[a].watchConnectivityState(i,e,n)}catch(e){t(new Error("The channel has been closed"))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,t,r){if(d(e))return{metadata:new o.Metadata,options:{},callback:e};if(d(t))return e instanceof o.Metadata?{metadata:e,options:{},callback:t}:{metadata:new o.Metadata,options:e,callback:t};if(!(e instanceof o.Metadata&&t instanceof Object&&d(r)))throw new Error("Incorrect arguments passed");return{metadata:e,options:t,callback:r}}makeUnaryRequest(t,r,o,d,c,f,h){var m,g;const y=this.checkOptionalUnaryResponseArguments(c,f,h),v={path:t,requestStream:!1,responseStream:!1,requestSerialize:r,responseDeserialize:o};let b={argument:d,metadata:y.metadata,call:new e.ClientUnaryCallImpl,channel:this[a],methodDefinition:v,callOptions:y.options,callback:y.callback};this[p]&&(b=this[p](b));const O=b.call,w={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(m=b.callOptions.interceptors)&&void 0!==m?m:[],callInterceptorProviders:null!==(g=b.callOptions.interceptor_providers)&&void 0!==g?g:[]},S=(0,i.getInterceptingCall)(w,b.methodDefinition,b.callOptions,b.channel);O.call=S;let _=null,P=!1,E=new Error;return S.start(b.metadata,{onReceiveMetadata:e=>{O.emit("metadata",e)},onReceiveMessage(e){null!==_&&S.cancelWithStatus(n.Status.UNIMPLEMENTED,"Too many responses received"),_=e},onReceiveStatus(t){if(!P){if(P=!0,t.code===n.Status.OK)if(null===_){const r=u(E);b.callback((0,e.callErrorFromStatus)({code:n.Status.UNIMPLEMENTED,details:"No message received",metadata:t.metadata},r))}else b.callback(null,_);else{const r=u(E);b.callback((0,e.callErrorFromStatus)(t,r))}E=null,O.emit("status",t)}}}),S.sendMessage(d),S.halfClose(),O}makeClientStreamRequest(t,r,o,d,c,f){var h,m;const g=this.checkOptionalUnaryResponseArguments(d,c,f),y={path:t,requestStream:!0,responseStream:!1,requestSerialize:r,responseDeserialize:o};let v={metadata:g.metadata,call:new e.ClientWritableStreamImpl(r),channel:this[a],methodDefinition:y,callOptions:g.options,callback:g.callback};this[p]&&(v=this[p](v));const b=v.call,O={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(h=v.callOptions.interceptors)&&void 0!==h?h:[],callInterceptorProviders:null!==(m=v.callOptions.interceptor_providers)&&void 0!==m?m:[]},w=(0,i.getInterceptingCall)(O,v.methodDefinition,v.callOptions,v.channel);b.call=w;let S=null,_=!1,P=new Error;return w.start(v.metadata,{onReceiveMetadata:e=>{b.emit("metadata",e)},onReceiveMessage(e){null!==S&&w.cancelWithStatus(n.Status.UNIMPLEMENTED,"Too many responses received"),S=e,w.startRead()},onReceiveStatus(t){if(!_){if(_=!0,t.code===n.Status.OK)if(null===S){const r=u(P);v.callback((0,e.callErrorFromStatus)({code:n.Status.UNIMPLEMENTED,details:"No message received",metadata:t.metadata},r))}else v.callback(null,S);else{const r=u(P);v.callback((0,e.callErrorFromStatus)(t,r))}P=null,b.emit("status",t)}}}),b}checkMetadataAndOptions(e,t){let r,n;return e instanceof o.Metadata?(r=e,n=t||{}):(n=e||{},r=new o.Metadata),{metadata:r,options:n}}makeServerStreamRequest(t,r,o,d,c,f){var h,m;const g=this.checkMetadataAndOptions(c,f),y={path:t,requestStream:!1,responseStream:!0,requestSerialize:r,responseDeserialize:o};let v={argument:d,metadata:g.metadata,call:new e.ClientReadableStreamImpl(o),channel:this[a],methodDefinition:y,callOptions:g.options};this[p]&&(v=this[p](v));const b=v.call,O={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(h=v.callOptions.interceptors)&&void 0!==h?h:[],callInterceptorProviders:null!==(m=v.callOptions.interceptor_providers)&&void 0!==m?m:[]},w=(0,i.getInterceptingCall)(O,v.methodDefinition,v.callOptions,v.channel);b.call=w;let S=!1,_=new Error;return w.start(v.metadata,{onReceiveMetadata(e){b.emit("metadata",e)},onReceiveMessage(e){b.push(e)},onReceiveStatus(t){if(!S){if(S=!0,b.push(null),t.code!==n.Status.OK){const r=u(_);b.emit("error",(0,e.callErrorFromStatus)(t,r))}_=null,b.emit("status",t)}}}),w.sendMessage(d),w.halfClose(),b}makeBidiStreamRequest(t,r,o,d,c){var f,h;const m=this.checkMetadataAndOptions(d,c),g={path:t,requestStream:!0,responseStream:!0,requestSerialize:r,responseDeserialize:o};let y={metadata:m.metadata,call:new e.ClientDuplexStreamImpl(r,o),channel:this[a],methodDefinition:g,callOptions:m.options};this[p]&&(y=this[p](y));const v=y.call,b={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(f=y.callOptions.interceptors)&&void 0!==f?f:[],callInterceptorProviders:null!==(h=y.callOptions.interceptor_providers)&&void 0!==h?h:[]},O=(0,i.getInterceptingCall)(b,y.methodDefinition,y.callOptions,y.channel);v.call=O;let w=!1,S=new Error;return O.start(y.metadata,{onReceiveMetadata(e){v.emit("metadata",e)},onReceiveMessage(e){v.push(e)},onReceiveStatus(t){if(!w){if(w=!0,v.push(null),t.code!==n.Status.OK){const r=u(S);v.emit("error",(0,e.callErrorFromStatus)(t,r))}S=null,v.emit("status",t)}}}),v}},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 i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const a=e[i],s=i.split(".");if(s.some(e=>r(e)))continue;const l=s[s.length-1];let p=t;for(const e of s.slice(0,-1))p[e]||(p[e]={}),p=p[e];o(a)?p[l]=a:p[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,o,i){class a extends e.Client{}return Object.keys(n).forEach(e=>{if(r(e))return;const o=n[e];let i;if("string"==typeof e&&"$"===e.charAt(0))throw new Error("Method names cannot start with $");i=o.requestStream?o.responseStream?"bidi":"client_stream":o.responseStream?"server_stream":"unary";const s=o.requestSerialize,l=o.responseDeserialize,p=function(e,t,r,n){return function(...o){return e.call(this,t,r,n,...o)}}(t[i],o.path,s,l);a.prototype[e]=p,Object.assign(a.prototype[e],o),o.originalName&&!r(o.originalName)&&(a.prototype[o.originalName]=a.prototype[e])}),a.service=n,a.serviceName=o,a}function o(e){return"format"in e}return makeClient}var src$5={},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",o="\\u0300-\\u036f\\ufe20-\\ufe23",i="\\u20d0-\\u20f0",a="\\u2700-\\u27bf",s="a-z\\xdf-\\xf6\\xf8-\\xff",l="A-Z\\xc0-\\xd6\\xd8-\\xde",p="\\ufe0e\\ufe0f",d="\\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",u="['’]",c="["+n+"]",f="["+d+"]",h="["+o+i+"]",m="\\d+",g="["+a+"]",y="["+s+"]",v="[^"+n+d+m+a+s+l+"]",b="\\ud83c[\\udffb-\\udfff]",O="[^"+n+"]",w="(?:\\ud83c[\\udde6-\\uddff]){2}",S="[\\ud800-\\udbff][\\udc00-\\udfff]",_="["+l+"]",P="\\u200d",E="(?:"+y+"|"+v+")",T="(?:"+_+"|"+v+")",C="(?:['’](?:d|ll|m|re|s|t|ve))?",R="(?:['’](?:D|LL|M|RE|S|T|VE))?",D="(?:"+h+"|"+b+")"+"?",x="["+p+"]?",k=x+D+("(?:"+P+"(?:"+[O,w,S].join("|")+")"+x+D+")*"),j="(?:"+[g,w,S].join("|")+")"+k,A="(?:"+[O+h+"?",h,w,S,c].join("|")+")",N=RegExp(u,"g"),I=RegExp(h,"g"),q=RegExp(b+"(?="+b+")|"+A+k,"g"),M=RegExp([_+"?"+y+"+"+C+"(?="+[f,_,"$"].join("|")+")",T+"+"+R+"(?="+[f,_+E,"$"].join("|")+")",_+"?"+E+"+"+C,_+"+"+R,m,j].join("|"),"g"),L=RegExp("["+P+n+o+i+p+"]"),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,V="object"==typeof self&&self&&self.Object===Object&&self,U=B||V||Function("return this")();var $=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 G(e){return L.test(e)}function H(e){return G(e)?function(e){return e.match(q)||[]}(e):function(e){return e.split("")}(e)}var z=Object.prototype.toString,W=U.Symbol,J=W?W.prototype:void 0,Y=J?J.toString:void 0;function K(t){if("string"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(e){return!!e&&"object"==typeof e}(t)&&z.call(t)==e}(t))return Y?Y.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,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}(e,t,r)}function Q(e){return null==e?"":K(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,o=e?e.length:0;++n<o;)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,$).replace(I,"")}(e).replace(N,"")),Z,"")});var te,re=(te="toUpperCase",function(e){var t=G(e=Q(e))?H(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$4={exports:{}},indexLight={exports:{}},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){var r=new Array(arguments.length-1),n=0,o=2,i=!0;for(;o<arguments.length;)r[n++]=arguments[o++];return new Promise(function(o,a){r[n]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];o.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,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),o=0;o<64;)n[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(e,t,n){for(var o,i=null,a=[],s=0,l=0;t<n;){var p=e[t++];switch(l){case 0:a[s++]=r[p>>2],o=(3&p)<<4,l=1;break;case 1:a[s++]=r[o|p>>4],o=(15&p)<<2,l=2;break;case 2:a[s++]=r[o|p>>6],a[s++]=r[63&p],l=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return l&&(a[s++]=r[o],a[s++]=61,1===l&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var i="invalid encoding";t.decode=function(e,t,r){for(var o,a=r,s=0,l=0;l<e.length;){var p=e.charCodeAt(l++);if(61===p&&s>1)break;if(void 0===(p=n[p]))throw Error(i);switch(s){case 0:o=p,s=1;break;case 1:t[r++]=o<<2|(48&p)>>4,o=p,s=2;break;case 2:t[r++]=(15&o)<<4|(60&p)>>2,o=p,s=3;break;case 3:t[r++]=(3&o)<<6|p,s=0}}if(1===s)throw Error(i);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 o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3]}function i(e,n,o){t[0]=e,n[o]=r[3],n[o+1]=r[2],n[o+2]=r[1],n[o+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 s(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?o:i,e.writeFloatBE=n?i:o,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function i(e,t,r,n){var o=t<0?1:0;if(o&&(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((o<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),o=2*(n>>31)+1,i=n>>>23&255,a=8388607&n;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=i.bind(null,t),e.writeFloatBE=i.bind(null,r),e.readFloatLE=a.bind(null,n),e.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3],n[o+4]=r[4],n[o+5]=r[5],n[o+6]=r[6],n[o+7]=r[7]}function i(e,n,o){t[0]=e,n[o]=r[7],n[o+1]=r[6],n[o+2]=r[5],n[o+3]=r[4],n[o+4]=r[3],n[o+5]=r[2],n[o+6]=r[1],n[o+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 s(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?o:i,e.writeDoubleBE=n?i:o,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function i(e,t,r,n,o,i){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,o,i+t),e(1/n>0?0:2147483648,o,i+r);else if(isNaN(n))e(0,o,i+t),e(2146959360,o,i+r);else if(n>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+r);else{var l=Math.floor(Math.log(n)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=n*Math.pow(2,-l))>>>0,o,i+t),e((a<<31|l+1023<<20|1048576*s&1048575)>>>0,o,i+r)}}}function a(e,t,r,n,o){var i=e(n,o+t),a=e(n,o+r),s=2*(a>>31)+1,l=a>>>20&2047,p=4294967296*(1048575&a)+i;return 2047===l?p?NaN:s*(1/0):0===l?5e-324*s*p:s*Math.pow(2,l-1075)*(p+4503599627370496)}e.writeDoubleLE=i.bind(null,t,0,4),e.writeDoubleBE=i.bind(null,r,4,0),e.readDoubleLE=a.bind(null,n,0,4),e.readDoubleBE=a.bind(null,o,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 o(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$1,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,o=null,i=[],a=0;t<r;)(n=e[t++])<128?i[a++]=n:n>191&&n<224?i[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,i[a++]=55296+(n>>10),i[a++]=56320+(1023&n)):i[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},t.write=function(e,t,r){for(var n,o,i=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&(o=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&o),++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-i}}(utf8)),utf8}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,r){var n=r||8192,o=n>>>1,i=null,a=n;return function(r){if(r<1||r>o)return e(r);a+r>n&&(i=e(n),a=0);var s=t.call(i,a,a+=r);return 7&a&&(a=1+(7|a)),s}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal$1();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 o=e>>>0,i=(e-o)/4294967296>>>0;return n&&(i=~i>>>0,o=~o>>>0,++o>4294967295&&(o=0,++i>4294967295&&(i=0))),new t(o,i)},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 o=String.prototype.charCodeAt;return t.fromHash=function(e){return e===n?r:new t((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.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$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(){var e=minimal$1;function t(e,t,r){for(var n=Object.keys(t),o=0;o<n.length;++o)void 0!==e[n[o]]&&r||(e[n[o]]=t[n[o]]);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$1,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$1}function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=l;var e,t=requireMinimal$1(),r=t.LongBits,n=t.base64,o=t.utf8;function i(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function a(){}function s(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 i(a,0,0),this.tail=this.head,this.states=null}var p=function(){return t.Buffer?function(){return(l.create=function(){return new e})()}:function(){return new l}};function d(e,t,r){t[r]=255&e}function u(e,t){this.len=e,this.next=void 0,this.val=t}function c(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 f(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=p(),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 i(e,t,r),this.len+=t,this},u.prototype=Object.create(i.prototype),u.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 u((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(c,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(c,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=r.from(e).zzEncode();return this._push(c,t.length(),t)},l.prototype.bool=function(e){return this._push(d,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(f,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=r.from(e);return this._push(f,4,t.lo)._push(f,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 h=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(d,1,0);if(t.isString(e)){var o=l.alloc(r=n.length(e));n.decode(e,o,0),e=o}return this.uint32(r)._push(h,r,e)},l.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(d,1,0)},l.prototype.fork=function(){return this.states=new s(this),this.head=this.tail=new i(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 i(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=p(),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$1();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=i;var e,t=requireMinimal$1(),r=t.LongBits,n=t.utf8;function o(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function i(e){this.buf=e,this.pos=0,this.len=e.length}var a="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new i(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new i(e);throw Error("illegal buffer")},s=function(){return t.Buffer?function(r){return(i.create=function(r){return t.Buffer.isBuffer(r)?new e(r):a(r)})(r)}:a};function l(){var e=new r(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw o(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 o(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 p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw o(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}return i.create=s(),i.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,i.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return e}}(),i.prototype.int32=function(){return 0|this.uint32()},i.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},i.prototype.bool=function(){return 0!==this.uint32()},i.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return p(this.buf,this.pos+=4)},i.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return 0|p(this.buf,this.pos+=4)},i.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},i.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},i.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,n);if(r===n){var i=t.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,n)},i.prototype.string=function(){var e=this.bytes();return n.read(e,0,e.length)},i.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw o(this)}while(128&this.buf[this.pos++]);return this},i.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},i._configure=function(r){e=r,i.create=s(),e._configure();var n=t.Long?"toLong":"toNumber";t.merge(i.prototype,{int64:function(){return l.call(this)[n](!1)},uint64:function(){return l.call(this)[n](!0)},sint64:function(){return l.call(this).zzDecode()[n](!1)},fixed64:function(){return d.call(this)[n](!0)},sfixed64:function(){return d.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$1();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$1();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,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return e.asPromise(t,s,r,n,o,i);if(s.rpcImpl)try{return s.rpcImpl(r,n[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(e,t){if(e)return s.emit("error",e,r),a(e);if(null!==t){if(!(t instanceof o))try{t=o[s.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return s.emit("error",e,r),a(e)}return s.emit("data",t,r),a(null,t)}s.end(!0)})}catch(e){return s.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,function(e){e.Service=requireService$1()}(rpc)),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$1(),e.rpc=requireRpc(),e.roots=requireRoots(),e.configure=t,t()}()),indexMinimal}var types$1={},util$5={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 o(t){if("string"!=typeof t){var r=i();if(e.verbose&&console.log("codegen: "+r),r="return "+r,t){for(var a=Object.keys(t),s=new Array(a.length+1),l=new Array(a.length),p=0;p<a.length;)s[p]=a[p],l[p]=t[a[p++]];return s[p]=r,Function.apply(null,s).apply(null,l)}return Function(r)()}for(var d=new Array(arguments.length-1),u=0;u<d.length;)d[u]=arguments[++u];if(u=0,t=t.replace(/%([%dfijs])/g,function(e,t){var r=d[u++];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"%"}),u!==d.length)throw Error("parameter count mismatch");return n.push(t),o}function i(e){return"function "+(e||r||"")+"("+(t&&t.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return o.toString=i,o}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,o,i){return"function"==typeof o?(i=o,o={}):o||(o={}),i?!o.xhr&&t&&t.readFile?t.readFile(n,function(e,t){return e&&"undefined"!=typeof XMLHttpRequest?r.xhr(n,o,i):e?i(e):i(null,o.binary?t:t.toString("utf8"))}):r.xhr(n,o,i):e(r,this,n,o)}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 o=0;o<n.responseText.length;++o)e.push(255&n.responseText.charCodeAt(o))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()},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),o="";n&&(o=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):n?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return o+t.join("/")};t.resolve=function(e,t,o){return o||(t=n(t)),r(t)?t:(o||(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,o=requireField(),i=requireUtil$5(),a=requireOneof();function s(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 p(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=s,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=i.toArray(this.nested))}}),l.prototype.toJSON=function(e){return i.toObject(["options",this.options,"nested",s(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var i,a=Object.keys(e),s=0;s<a.length;++s)i=e[a[s]],this.add((void 0!==i.fields?t.fromJSON:void 0!==i.values?n.fromJSON:void 0!==i.methods?r.fromJSON:void 0!==i.id?o.fromJSON:l.fromJSON)(a[s],i));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 o&&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 i=this.get(e.name);if(i){if(!(i instanceof l&&e instanceof l)||i instanceof t||i instanceof r)throw Error("duplicate name '"+e.name+"' in "+this);for(var s=i.nestedArray,d=0;d<s.length;++d)e.add(s[d]);this.remove(i),this.nested||(this.nested={}),e.setOptions(i.options,!0)}}else this.nested={};this.nested[e.name]=e,this instanceof t||this instanceof r||this instanceof n||this instanceof o||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var u=this;u=u.parent;)u._needsRecursiveFeatureResolution=!0,u._needsRecursiveResolve=!0;return e.onAdd(this),p(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),p(this)},l.prototype.define=function(e,t){if(i.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]),i.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 o=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+n];if(o&&(!t||t.indexOf(o.constructor)>-1))return o;if((o=this._lookupImpl(e,n))&&(!t||t.indexOf(o.constructor)>-1))return o;if(r)return null;for(var a=this;a.parent;){if((o=a.parent._lookupImpl(e,n))&&(!t||t.indexOf(o.constructor)>-1))return o;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 o=0;o<this.nestedArray.length;++o)this._nestedArray[o]instanceof l&&(r=this._nestedArray[o]._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,o,i){t=e,r=o,n=i},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$5();function n(t,n,o,i,a,s){if(e.call(this,t,n,i,void 0,void 0,a,s),!r.isString(o))throw TypeError("keyType must be a string");this.keyType=o,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,o){return"function"==typeof o?o=r.decorateType(o).name:o&&"object"==typeof o&&(o=r.decorateEnum(o).name),function(i,a){r.decorateType(i.constructor).add(new n(a,e,t,o))}},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$5();function r(r,n,o,i,a,s,l,p,d){if(t.isObject(a)?(l=a,a=s=void 0):t.isObject(s)&&(l=s,s=void 0),void 0!==n&&!t.isString(n))throw TypeError("type must be a string");if(!t.isString(o))throw TypeError("requestType must be a string");if(!t.isString(i))throw TypeError("responseType must be a string");e.call(this,r,l),this.type=n||"rpc",this.requestType=o,this.requestStream=!!a||void 0,this.responseType=i,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=p,this.parsedOptions=d}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=o;var e=requireNamespace();((o.prototype=Object.create(e.prototype)).constructor=o).className="Service";var t=requireMethod(),r=requireUtil$5(),n=requireRpc();function o(t,r){e.call(this,t,r),this.methods={},this._methodsArray=null}function i(e){return e._methodsArray=null,e}return o.fromJSON=function(e,r){var n=new o(e,r.options);if(r.methods)for(var i=Object.keys(r.methods),a=0;a<i.length;++a)n.add(t.fromJSON(i[a],r.methods[i[a]]));return r.nested&&n.addJSON(r.nested),r.edition&&(n._edition=r.edition),n.comment=r.comment,n._defaultEdition="proto3",n},o.prototype.toJSON=function(t){var n=e.prototype.toJSON.call(this,t),o=!!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",o?this.comment:void 0])},Object.defineProperty(o.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=r.toArray(this.methods))}}),o.prototype.get=function(t){return this.methods[t]||e.prototype.get.call(this,t)},o.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},o.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},o.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,i(this)):e.prototype.add.call(this,r)},o.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,i(this)}return e.prototype.remove.call(this,r)},o.prototype.create=function(e,t,o){for(var i,a=new n.Service(e,t,o),s=0;s<this.methodsArray.length;++s){var l=r.lcFirst((i=this._methodsArray[s]).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:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return a},service}function requireMessage(){if(hasRequiredMessage)return message;hasRequiredMessage=1,message=t;var e=requireMinimal$1();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(o){for(var i=r.codegen(["r","l","e"],o.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(o.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<o.fieldsArray.length;++a){var s=o._fieldsArray[a].resolve(),l=s.resolvedType instanceof e?"int32":s.type,p="m"+r.safeProp(s.name);i("case %i: {",s.id),s.map?(i("if(%s===util.emptyObject)",p)("%s={}",p)("var c2 = r.uint32()+r.pos"),void 0!==t.defaults[s.keyType]?i("k=%j",t.defaults[s.keyType]):i("k=null"),void 0!==t.defaults[l]?i("value=%j",t.defaults[l]):i("value=null"),i("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===t.basic[l]?i("value=types[%i].decode(r,r.uint32())",a):i("value=r.%s()",l),i("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==t.long[s.keyType]?i('%s[typeof k==="object"?util.longToHash(k):k]=value',p):i("%s[k]=value",p)):s.repeated?(i("if(!(%s&&%s.length))",p,p)("%s=[]",p),void 0!==t.packed[l]&&i("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",p,l)("}else"),void 0===t.basic[l]?i(s.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",p,a):i("%s.push(r.%s())",p,l)):void 0===t.basic[l]?i(s.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",p,a):i("%s=r.%s()",p,l),i("break")("}")}for(i("default:")("r.skipType(t&7)")("break")("}")("}"),a=0;a<o._fieldsArray.length;++a){var d=o._fieldsArray[a];d.required&&i("if(!m.hasOwnProperty(%j))",d.name)("throw util.ProtocolError(%j,{instance:m})",n(d))}return i("return m")};var e=require_enum$1(),t=requireTypes(),r=requireUtil$5();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 i=t.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),a=e.oneofsArray,s={};a.length&&i("var p={}");for(var l=0;l<e.fieldsArray.length;++l){var p=e._fieldsArray[l].resolve(),d="m"+t.safeProp(p.name);if(p.optional&&i("if(%s!=null&&m.hasOwnProperty(%j)){",d,p.name),p.map)i("if(!util.isObject(%s))",d)("return%j",r(p,"object"))("var k=Object.keys(%s)",d)("for(var i=0;i<k.length;++i){"),o(i,p,"k[i]"),n(i,p,l,d+"[k[i]]")("}");else if(p.repeated)i("if(!Array.isArray(%s))",d)("return%j",r(p,"array"))("for(var i=0;i<%s.length;++i){",d),n(i,p,l,d+"[i]")("}");else{if(p.partOf){var u=t.safeProp(p.partOf.name);1===s[p.partOf.name]&&i("if(p%s===1)",u)("return%j",p.partOf.name+": multiple values"),s[p.partOf.name]=1,i("p%s=1",u)}n(i,p,l,d)}p.optional&&i("}")}return i("return null")};var e=require_enum$1(),t=requireUtil$5();function r(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function n(t,n,o,i){if(n.resolvedType)if(n.resolvedType instanceof e){t("switch(%s){",i)("default:")("return%j",r(n,"enum value"));for(var a=Object.keys(n.resolvedType.values),s=0;s<a.length;++s)t("case %i:",n.resolvedType.values[a[s]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s);",o,i)("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))",i)("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)))",i,i,i,i)("return%j",r(n,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',i)("return%j",r(n,"number"));break;case"bool":t('if(typeof %s!=="boolean")',i)("return%j",r(n,"boolean"));break;case"string":t("if(!util.isString(%s))",i)("return%j",r(n,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",r(n,"buffer"))}return t}function o(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$1(),n=requireUtil$5();function o(e,t,n,o){var i=!1;if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(d%s){",o);for(var a=t.resolvedType.values,s=Object.keys(a),l=0;l<s.length;++l)a[s[l]]!==t.typeDefault||i||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',o,o,o),t.repeated||e("break"),i=!0),e("case%j:",s[l])("case %i:",a[s[l]])("m%s=%j",o,a[s[l]])("break");e("}")}else e('if(typeof d%s!=="object")',o)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,n,o);else{var p=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",o,o);break;case"uint64":p=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,p)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,p?"true":"");break;case"bytes":e('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length >= 0)",o)("m%s=d%s",o,o);break;case"string":e("m%s=String(d%s)",o,o);break;case"bool":e("m%s=Boolean(d%s)",o,o)}}return e}function i(e,t,n,o){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",o,n,o,o,n,o,o):e("d%s=types[%i].toObject(m%s,o)",o,n,o);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,i?"true":"",o);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:e("d%s=m%s",o,o)}}return e}t.fromObject=function(e){var t=e.fieldsArray,i=n.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return i("return new this.ctor");i("var m=new this.ctor");for(var a=0;a<t.length;++a){var s=t[a].resolve(),l=n.safeProp(s.name);s.map?(i("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),o(i,s,a,l+"[ks[i]]")("}")("}")):s.repeated?(i("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),o(i,s,a,l+"[i]")("}")("}")):(s.resolvedType instanceof r||i("if(d%s!=null){",l),o(i,s,a,l),s.resolvedType instanceof r||i("}"))}return i("return m")},t.toObject=function(e){var t=e.fieldsArray.slice().sort(n.compareFieldsById);if(!t.length)return n.codegen()("return {}");for(var o=n.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),a=[],s=[],l=[],p=0;p<t.length;++p)t[p].partOf||(t[p].resolve().repeated?a:t[p].map?s:l).push(t[p]);if(a.length){for(o("if(o.arrays||o.defaults){"),p=0;p<a.length;++p)o("d%s=[]",n.safeProp(a[p].name));o("}")}if(s.length){for(o("if(o.objects||o.defaults){"),p=0;p<s.length;++p)o("d%s={}",n.safeProp(s[p].name));o("}")}if(l.length){for(o("if(o.defaults){"),p=0;p<l.length;++p){var d=l[p],u=n.safeProp(d.name);if(d.resolvedType instanceof r)o("d%s=o.enums===String?%j:%j",u,d.resolvedType.valuesById[d.typeDefault],d.typeDefault);else if(d.long)o("if(util.Long){")("var n=new util.Long(%i,%i,%j)",d.typeDefault.low,d.typeDefault.high,d.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",u)("}else")("d%s=o.longs===String?%j:%i",u,d.typeDefault.toString(),d.typeDefault.toNumber());else if(d.bytes){var c="["+Array.prototype.slice.call(d.typeDefault).join(",")+"]";o("if(o.bytes===String)d%s=%j",u,String.fromCharCode.apply(String,d.typeDefault))("else{")("d%s=%s",u,c)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",u,u)("}")}else o("d%s=%j",u,d.typeDefault)}o("}")}var f=!1;for(p=0;p<t.length;++p){d=t[p];var h=e._fieldsArray.indexOf(d);u=n.safeProp(d.name);d.map?(f||(f=!0,o("var ks2")),o("if(m%s&&(ks2=Object.keys(m%s)).length){",u,u)("d%s={}",u)("for(var j=0;j<ks2.length;++j){"),i(o,d,h,u+"[ks2[j]]")("}")):d.repeated?(o("if(m%s&&m%s.length){",u,u)("d%s=[]",u)("for(var j=0;j<m%s.length;++j){",u),i(o,d,h,u+"[j]")("}")):(o("if(m%s!=null&&m.hasOwnProperty(%j)){",u,d.name),i(o,d,h,u),d.partOf&&o("if(o.oneofs)")("d%s=%j",n.safeProp(d.partOf.name),d.name)),o("}")}return o("return d")}}(converter)),converter}var wrappers$2={},hasRequiredWrappers$1,type,hasRequiredType,root,hasRequiredRoot,hasRequiredUtil$5,hasRequiredTypes,field,hasRequiredField,oneof,hasRequiredOneof,object,hasRequiredObject,_enum$1,hasRequired_enum$1,encoder_1,hasRequiredEncoder,hasRequiredIndexLight,tokenize_1,hasRequiredTokenize,parse_1,hasRequiredParse,common_1,hasRequiredCommon$2,hasRequiredSrc$7,protobufjs,hasRequiredProtobufjs;function requireWrappers$1(){return hasRequiredWrappers$1||(hasRequiredWrappers$1=1,function(){var e=wrappers$2,t=requireMessage();e[".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,r){var n="",o="";if(r&&r.json&&e.type_url&&e.value){o=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(o);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof t){var a=e.$type.toObject(e,r);return""===n&&(n="type.googleapis.com/"),o=n+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),a["@type"]=o,a}return this.toObject(e,r)}}}()),wrappers$2}function requireType(){if(hasRequiredType)return type;hasRequiredType=1,type=m;var e=requireNamespace();((m.prototype=Object.create(e.prototype)).constructor=m).className="Type";var t=require_enum$1(),r=requireOneof(),n=requireField(),o=requireMapfield(),i=requireService(),a=requireMessage(),s=requireReader(),l=requireWriter(),p=requireUtil$5(),d=requireEncoder(),u=requireDecoder(),c=requireVerifier(),f=requireConverter(),h=requireWrappers$1();function m(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 g(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}return Object.defineProperties(m.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=p.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=p.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=m.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof a||((e.prototype=new a).constructor=e,p.merge(e.prototype,t)),e.$type=e.prototype.$type=this,p.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:p.oneOfGetter(this._oneofsArray[r].oneof),set:p.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),m.generateConstructor=function(e){for(var t,r=p.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",p.safeProp(t.name)):t.repeated&&r("this%s=[]",p.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]]")},m.fromJSON=function(a,s){var l=new m(a,s.options);l.extensions=s.extensions,l.reserved=s.reserved;for(var p=Object.keys(s.fields),d=0;d<p.length;++d)l.add((void 0!==s.fields[p[d]].keyType?o.fromJSON:n.fromJSON)(p[d],s.fields[p[d]]));if(s.oneofs)for(p=Object.keys(s.oneofs),d=0;d<p.length;++d)l.add(r.fromJSON(p[d],s.oneofs[p[d]]));if(s.nested)for(p=Object.keys(s.nested),d=0;d<p.length;++d){var u=s.nested[p[d]];l.add((void 0!==u.id?n.fromJSON:void 0!==u.fields?m.fromJSON:void 0!==u.values?t.fromJSON:void 0!==u.methods?i.fromJSON:e.fromJSON)(p[d],u))}return s.extensions&&s.extensions.length&&(l.extensions=s.extensions),s.reserved&&s.reserved.length&&(l.reserved=s.reserved),s.group&&(l.group=!0),s.comment&&(l.comment=s.comment),s.edition&&(l._edition=s.edition),l._defaultEdition="proto3",l},m.prototype.toJSON=function(t){var r=e.prototype.toJSON.call(this,t),n=!!t&&Boolean(t.keepComments);return p.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])},m.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},m.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},m.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},m.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),g(this)}return t instanceof r?(this.oneofs||(this.oneofs={}),this.oneofs[t.name]=t,t.onAdd(this),g(this)):e.prototype.add.call(this,t)},m.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),g(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),g(this)}return e.prototype.remove.call(this,t)},m.prototype.isReservedId=function(t){return e.isReservedId(this.reserved,t)},m.prototype.isReservedName=function(t){return e.isReservedName(this.reserved,t)},m.prototype.create=function(e){return new this.ctor(e)},m.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=d(this)({Writer:l,types:t,util:p}),this.decode=u(this)({Reader:s,types:t,util:p}),this.verify=c(this)({types:t,util:p}),this.fromObject=f.fromObject(this)({types:t,util:p}),this.toObject=f.toObject(this)({types:t,util:p});var n=h[e];if(n){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(o),o.toObject=this.toObject,this.toObject=n.toObject.bind(o)}return this},m.prototype.encode=function(e,t){return this.setup().encode(e,t)},m.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},m.prototype.decode=function(e,t){return this.setup().decode(e,t)},m.prototype.decodeDelimited=function(e){return e instanceof s||(e=s.create(e)),this.decode(e,e.uint32())},m.prototype.verify=function(e){return this.setup().verify(e)},m.prototype.fromObject=function(e){return this.setup().fromObject(e)},m.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},m.d=function(e){return function(t){p.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,o=requireField(),i=require_enum$1(),a=requireOneof(),s=requireUtil$5();function l(t){e.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}function p(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()},l.prototype.resolvePath=s.path.resolve,l.prototype.fetch=s.fetch,l.prototype.load=function e(t,o,i){"function"==typeof o&&(i=o,o=void 0);var a=this;if(!i)return s.asPromise(e,a,t,o);var l=i===p;function d(e,t){if(i){if(l)throw e;t&&t.resolveAll();var r=i;i=null,r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in n)return r}return null}function c(e,t){try{if(s.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),s.isString(t)){r.filename=e;var n,i=r(t,a,o),p=0;if(i.imports)for(;p<i.imports.length;++p)(n=u(i.imports[p])||a.resolvePath(e,i.imports[p]))&&f(n);if(i.weakImports)for(p=0;p<i.weakImports.length;++p)(n=u(i.weakImports[p])||a.resolvePath(e,i.weakImports[p]))&&f(n,!0)}else a.setOptions(t.options).addJSON(t.nested)}catch(e){d(e)}l||h||d(null,a)}function f(e,t){if(e=u(e)||e,!(a.files.indexOf(e)>-1))if(a.files.push(e),e in n)l?c(e,n[e]):(++h,setTimeout(function(){--h,c(e,n[e])}));else if(l){var r;try{r=s.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||d(e))}c(e,r)}else++h,a.fetch(e,function(r,n){--h,i&&(r?t?h||d(null,a):d(r):c(e,n))})}var h=0;s.isString(t)&&(t=[t]);for(var m,g=0;g<t.length;++g)(m=a.resolvePath("",t[g]))&&f(m);return l?(a.resolveAll(),a):(h||d(null,a),a)},l.prototype.loadSync=function(e,t){if(!s.isNode)throw Error("not supported");return this.load(e,t,p)},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 d=/^[A-Z]/;function u(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new o(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 o)void 0===e.extend||e.extensionField||u(0,e)||this.deferred.push(e);else if(e instanceof i)d.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;)u(0,this.deferred[r])?this.deferred.splice(r,1):++r;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);d.test(e.name)&&(e.parent[e.name]=e)}(e instanceof t||e instanceof i||e instanceof o)&&(this._fullyQualifiedObjects[e.fullName]=e)},l.prototype._handleRemove=function(t){if(t instanceof o){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 i)d.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]);d.test(t.name)&&delete t.parent[t.name]}delete this._fullyQualifiedObjects[t.fullName]},l._configure=function(e,o,i){t=e,r=o,n=i},root}function requireUtil$5(){if(hasRequiredUtil$5)return util$5.exports;hasRequiredUtil$5=1;var e,t,r=util$5.exports=requireMinimal$1(),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++],o=e[r++];void 0!==o&&(t[n]=o)}return t};var o=/\\/g,i=/"/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(o,"\\\\").replace(i,'\\"')+'"]':"."+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 o=new e(n||t.name);return r.decorateRoot.add(o),o.ctor=t,Object.defineProperty(t,"$type",{value:o,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:o,enumerable:!1}),o};var s=0;return r.decorateEnum=function(e){if(e.$type)return e.$type;t||(t=require_enum$1());var n=new t("Enum"+s++,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,o){var i=r.shift();if("__proto__"===i||"prototype"===i)return t;if(r.length>0)t[i]=e(t[i]||{},r,o);else{var a=t[i];if(a&&n)return t;a&&(o=[].concat(a).concat(o)),t[i]=o}return t}(e,t=t.split("."),r)},Object.defineProperty(r,"decorateRoot",{get:function(){return n.decorated||(n.decorated=new(requireRoot()))}}),util$5.exports}function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(){var e=types$1,t=requireUtil$5(),r=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function n(e,t){var n=0,o={};for(t|=0;n<e.length;)o[r[n+t]]=e[n++];return o}e.basic=n([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),e.defaults=n([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",t.emptyArray,null]),e.long=n([0,0,0,1,1],7),e.mapKey=n([0,0,0,5,5,0,0,0,1,1,0,2],2),e.packed=n([1,5,0,0,0,5,5,0,0,0,1,1,0])}()),types$1}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$1(),n=requireTypes(),o=requireUtil$5(),i=/^required|optional|repeated$/;function a(t,r,a,s,l,p,d){if(o.isObject(s)?(d=l,p=s,s=l=void 0):o.isObject(l)&&(d=p,p=l,l=void 0),e.call(this,t,p),!o.isInteger(r)||r<0)throw TypeError("id must be a non-negative integer");if(!o.isString(a))throw TypeError("type must be a string");if(void 0!==s&&!i.test(s=s.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==l&&!o.isString(l))throw TypeError("extend must be a string");"proto3_optional"===s&&(s="optional"),this.rule=s&&"optional"!==s?s:void 0,this.type=a,this.id=r,this.extend=l||void 0,this.repeated="repeated"===s,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!o.Long&&void 0!==n.long[a],this.bytes="bytes"===a,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=d}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 o.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=o.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var i;o.base64.test(this.typeDefault)?o.base64.decode(this.typeDefault,i=o.newBuffer(o.base64.length(this.typeDefault)),0):o.utf8.write(this.typeDefault,i=o.newBuffer(o.utf8.length(this.typeDefault)),0),this.typeDefault=i}return this.map?this.defaultValue=o.emptyObject:this.repeated?this.defaultValue=o.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 o=this.parent.get(this.type.split(".").pop());o&&o instanceof t&&o.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=o.decorateType(t).name:t&&"object"==typeof t&&(t=o.decorateEnum(t).name),function(i,s){o.decorateType(i.constructor).add(new a(s,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$5();function n(t,r,n,o){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=o}function o(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,o(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))}o(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,o){r.decorateType(t.constructor).add(new n(o,e)),Object.defineProperty(t,o,{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$5(),n={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},o={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},i={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({},o);else if("proto3"===t)r=Object.assign({},i);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 s=Object.assign({},this.partOf._features);this._features=Object.assign(s,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 o=this.parsedOptions;if(n){var i=o.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)});if(i){var a=i[e];r.setProperty(a,n,t)}else(i={})[e]=r.setProperty({},n,t),o.push(i)}else{var s={};s[e]=t,o.push(s)}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$1(){if(hasRequired_enum$1)return _enum$1;hasRequired_enum$1=1,_enum$1=n;var e=requireObject();((n.prototype=Object.create(e.prototype)).constructor=n).className="Enum";var t=requireNamespace(),r=requireUtil$5();function n(t,r,n,o,i,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=o,this.comments=i||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,r)for(var s=Object.keys(r),l=0;l<s.length;++l)"number"==typeof r[s[l]]&&(this.valuesById[this.values[s[l]]=r[s[l]]]=s[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,o){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 o&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=o||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$1}function requireEncoder(){if(hasRequiredEncoder)return encoder_1;hasRequiredEncoder=1,encoder_1=function(o){for(var i,a=r.codegen(["m","w"],o.name+"$encode")("if(!w)")("w=Writer.create()"),s=o.fieldsArray.slice().sort(r.compareFieldsById),l=0;l<s.length;++l){var p=s[l].resolve(),d=o._fieldsArray.indexOf(p),u=p.resolvedType instanceof e?"int32":p.type,c=t.basic[u];i="m"+r.safeProp(p.name),p.map?(a("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",i,p.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",i)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(p.id<<3|2)>>>0,8|t.mapKey[p.keyType],p.keyType),void 0===c?a("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",d,i):a(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,u,i),a("}")("}")):p.repeated?(a("if(%s!=null&&%s.length){",i,i),p.packed&&void 0!==t.packed[u]?a("w.uint32(%i).fork()",(p.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",u,i)("w.ldelim()"):(a("for(var i=0;i<%s.length;++i)",i),void 0===c?n(a,p,d,i+"[i]"):a("w.uint32(%i).%s(%s[i])",(p.id<<3|c)>>>0,u,i)),a("}")):(p.optional&&a("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",i,p.name),void 0===c?n(a,p,d,i):a("w.uint32(%i).%s(%s)",(p.id<<3|c)>>>0,u,i))}return a("return w")};var e=require_enum$1(),t=requireTypes(),r=requireUtil$5();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$1(),e.Type=requireType(),e.Field=requireField(),e.OneOf=requireOneof(),e.MapField=requireMapfield(),e.Service=requireService(),e.Method=requireMethod(),e.Message=requireMessage(),e.wrappers=requireWrappers$1(),e.types=requireTypes(),e.util=requireUtil$5(),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=d;var e=/[\s{}=;:[\],'"()<>]/g,t=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,r=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,n=/^ *[*/]+ */,o=/^\s*\*?\/*/,i=/\n/g,a=/\s/,s=/\\(.?)/g,l={0:"\0",r:"\r",n:"\n",t:"\t"};function p(e){return e.replace(s,function(e,t){switch(t){case"\\":case"":return t;default:return l[t]||""}})}function d(s,l){s=s.toString();var d=0,u=s.length,c=1,f=0,h={},m=[],g=null;function y(e){return Error("illegal "+e+" (line "+c+")")}function v(e){return s.charAt(e)}function b(e,t,r){var a,p={type:s.charAt(e++),lineEmpty:!1,leading:r},d=e-(l?2:3);do{if(--d<0||"\n"===(a=s.charAt(d))){p.lineEmpty=!0;break}}while(" "===a||"\t"===a);for(var u=s.substring(e,t).split(i),m=0;m<u.length;++m)u[m]=u[m].replace(l?o:n,"").trim();p.text=u.join("\n").trim(),h[c]=p,f=c}function O(e){var t=w(e),r=s.substring(e,t);return/^\s*\/\//.test(r)}function w(e){for(var t=e;t<u&&"\n"!==v(t);)t++;return t}function S(){if(m.length>0)return m.shift();if(g)return function(){var e="'"===g?r:t;e.lastIndex=d-1;var n=e.exec(s);if(!n)throw y("string");return d=e.lastIndex,_(g),g=null,p(n[1])}();var n,o,i,f,h,S=0===d;do{if(d===u)return null;for(n=!1;a.test(i=v(d));)if("\n"===i&&(S=!0,++c),++d===u)return null;if("/"===v(d)){if(++d===u)throw y("comment");if("/"===v(d))if(l){if(f=d,h=!1,O(d-1)){h=!0;do{if((d=w(d))===u)break;if(d++,!S)break}while(O(d))}else d=Math.min(u,w(d)+1);h&&(b(f,d,S),S=!0),c++,n=!0}else{for(h="/"===v(f=d+1);"\n"!==v(++d);)if(d===u)return null;++d,h&&(b(f,d-1,S),S=!0),++c,n=!0}else{if("*"!==(i=v(d)))return"/";f=d+1,h=l||"*"===v(f);do{if("\n"===i&&++c,++d===u)throw y("comment");o=i,i=v(d)}while("*"!==o||"/"!==i);++d,h&&(b(f,d-2,S),S=!0),n=!0}}}while(n);var P=d;if(e.lastIndex=0,!e.test(v(P++)))for(;P<u&&!e.test(v(P));)++P;var E=s.substring(d,d=P);return'"'!==E&&"'"!==E||(g=E),E}function _(e){m.push(e)}function P(){if(!m.length){var e=S();if(null===e)return null;_(e)}return m[0]}return Object.defineProperty({next:S,peek:P,push:_,skip:function(e,t){var r=P();if(r===e)return S(),!0;if(!t)throw y("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t,r=null;return void 0===e?(t=h[c-1],delete h[c-1],t&&(l||"*"===t.type||t.lineEmpty)&&(r=t.leading?t.text:null)):(f<e&&P(),t=h[e],delete h[e],!t||t.lineEmpty||!l&&"/"!==t.type||(r=t.leading?null:t.text)),r}},"line",{get:function(){return c}})}return d.unescape=p,tokenize_1}function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1,parse_1=w,w.filename=null,w.defaults={keepCase:!1};var e=requireTokenize(),t=requireRoot(),r=requireType(),n=requireField(),o=requireMapfield(),i=requireOneof(),a=require_enum$1(),s=requireService(),l=requireMethod(),p=requireObject(),d=requireTypes(),u=requireUtil$5(),c=/^[1-9][0-9]*$/,f=/^-?[1-9][0-9]*$/,h=/^0[x][0-9a-fA-F]+$/,m=/^-?0[x][0-9a-fA-F]+$/,g=/^0[0-7]+$/,y=/^-?0[0-7]+$/,v=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,b=/^[a-zA-Z_][a-zA-Z_0-9]*$/,O=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function w(S,_,P){_ instanceof t||(P=_,_=new t),P||(P=w.defaults);var E,T,C,R,D=P.preferTrailingComment||!1,x=e(S,P.alternateCommentMode||!1),k=x.next,j=x.push,A=x.peek,N=x.skip,I=x.cmnt,q=!0,M="proto2",L=_,F=[],B={},V=P.keepCase?function(e){return e}:u.camelCase;function U(e,t,r){var n=w.filename;return r||(w.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+x.line+")")}function $(){var e,t=[];do{if('"'!==(e=k())&&"'"!==e)throw U(e);t.push(k()),N(e),e=A()}while('"'===e||"'"===e);return t.join("")}function G(e){var t=k();switch(t){case"'":case'"':return j(t),$();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(c.test(e))return r*parseInt(e,10);if(h.test(e))return r*parseInt(e,16);if(g.test(e))return r*parseInt(e,8);if(v.test(e))return r*parseFloat(e);throw U(e,"number",t)}(t,!0)}catch(e){if(O.test(t))return t;throw U(t,"value")}}function H(e,t){var r,n;do{if(!t||'"'!==(r=A())&&"'"!==r)try{e.push([n=z(k()),N("to",!0)?z(k()):n])}catch(n){if(!(t&&O.test(r)&&M>=2023))throw n;e.push(r)}else{var o=$();if(e.push(o),M>=2023)throw U(o,"id")}}while(N(",",!0));var i={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};Q(i,function(e){if("option"!==e)throw U(e);re(i,e),N(";")},function(){ie(i)})}function z(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw U(e,"id");if(f.test(e))return parseInt(e,10);if(m.test(e))return parseInt(e,16);if(y.test(e))return parseInt(e,8);throw U(e,"id")}function W(){if(void 0!==E)throw U("package");if(E=k(),!O.test(E))throw U(E,"name");L=L.define(E),N(";")}function J(){var e,t=A();switch(t){case"weak":e=C||(C=[]),k();break;case"public":k();default:e=T||(T=[])}t=$(),N(";"),e.push(t)}function Y(){if(N("="),(M=$())<2023)throw U(M,"syntax");N(";")}function K(){N("="),M=$();if(!["2023"].includes(M))throw U(M,"edition");N(";")}function X(e,t){switch(t){case"option":return re(e,t),N(";"),!0;case"message":return Z(e,t),!0;case"enum":return te(e,t),!0;case"service":return function(e,t){if(!b.test(t=k()))throw U(t,"service name");var r=new s(t);Q(r,function(e){if(!X(r,e)){if("rpc"!==e)throw U(e);!function(e,t){var r=I(),n=t;if(!b.test(t=k()))throw U(t,"name");var o,i,a,s,p=t;N("("),N("stream",!0)&&(i=!0);if(!O.test(t=k()))throw U(t);o=t,N(")"),N("returns"),N("("),N("stream",!0)&&(s=!0);if(!O.test(t=k()))throw U(t);a=t,N(")");var d=new l(p,n,o,a,i,s);d.comment=r,Q(d,function(e){if("option"!==e)throw U(e);re(d,e),N(";")}),e.add(d)}(r,e)}}),e.add(r),e===L&&F.push(r)}(e,t),!0;case"extend":return function(e,t){if(!O.test(t=k()))throw U(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||!O.test(t))throw U(t);j(t),ee(e,"optional",r)}})}(e,t),!0}return!1}function Q(e,t,r){var n=x.line;if(e&&("string"!=typeof e.comment&&(e.comment=I()),e.filename=w.filename),N("{",!0)){for(var o;"}"!==(o=k());)t(o);N(";",!0)}else r&&r(),N(";"),e&&("string"!=typeof e.comment||D)&&(e.comment=I(n)||e.comment)}function Z(e,t){if(!b.test(t=k()))throw U(t,"type name");var n=new r(t);Q(n,function(e){if(!X(n,e))switch(e){case"map":!function(e){N("<");var t=k();if(void 0===d.mapKey[t])throw U(t,"type");N(",");var r=k();if(!O.test(r))throw U(r,"type");N(">");var n=k();if(!b.test(n))throw U(n,"name");N("=");var i=new o(V(n),z(k()),t,r);Q(i,function(e){if("option"!==e)throw U(e);re(i,e),N(";")},function(){ie(i)}),e.add(i)}(n);break;case"required":if("proto2"!==M)throw U(e);case"repeated":ee(n,e);break;case"optional":if("proto3"===M)ee(n,"proto3_optional");else{if("proto2"!==M)throw U(e);ee(n,"optional")}break;case"oneof":!function(e,t){if(!b.test(t=k()))throw U(t,"name");var r=new i(V(t));Q(r,function(e){"option"===e?(re(r,e),N(";")):(j(e),ee(r,"optional"))}),e.add(r)}(n,e);break;case"extensions":H(n.extensions||(n.extensions=[]));break;case"reserved":H(n.reserved||(n.reserved=[]),!0);break;default:if("proto2"===M||!O.test(e))throw U(e);j(e),ee(n,"optional")}}),e.add(n),e===L&&F.push(n)}function ee(e,t,o){var a=k();if("group"!==a){for(;a.endsWith(".")||A().startsWith(".");)a+=k();if(!O.test(a))throw U(a,"type");var s=k();if(!b.test(s))throw U(s,"name");s=V(s),N("=");var l=new n(s,z(k()),a,t,o);if(Q(l,function(e){if("option"!==e)throw U(e);re(l,e),N(";")},function(){ie(l)}),"proto3_optional"===t){var p=new i("_"+s);l.setOption("proto3_optional",!0),p.add(l),e.add(p)}else e.add(l);e===L&&F.push(l)}else!function(e,t){if(M>=2023)throw U("group");var o=k();if(!b.test(o))throw U(o,"name");var i=u.lcFirst(o);o===i&&(o=u.ucFirst(o));N("=");var a=z(k()),s=new r(o);s.group=!0;var l=new n(i,a,o,t);l.filename=w.filename,Q(s,function(e){switch(e){case"option":re(s,e),N(";");break;case"required":case"repeated":ee(s,e);break;case"optional":ee(s,"proto3"===M?"proto3_optional":"optional");break;case"message":Z(s,e);break;case"enum":te(s,e);break;case"reserved":H(s.reserved||(s.reserved=[]),!0);break;default:throw U(e)}}),e.add(s).add(l)}(e,t)}function te(e,t){if(!b.test(t=k()))throw U(t,"name");var r=new a(t);Q(r,function(e){switch(e){case"option":re(r,e),N(";");break;case"reserved":H(r.reserved||(r.reserved=[]),!0),void 0===r.reserved&&(r.reserved=[]);break;default:!function(e,t){if(!b.test(t))throw U(t,"name");N("=");var r=z(k(),!0),n={options:void 0,getOption:function(e){return this.options[e]}};n.setOption=function(e,t){p.prototype.setOption.call(n,e,t)},n.setParsedOption=function(){},Q(n,function(e){if("option"!==e)throw U(e);re(n,e),N(";")},function(){ie(n)}),e.add(t,r,n.comment,n.parsedOptions||n.options)}(r,e)}}),e.add(r),e===L&&F.push(r)}function re(e,t){var r,n,o=!0;for("option"===t&&(t=k());"="!==t;){if("("===t){var i=k();N(")"),t="("+i+")"}if(o){if(o=!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=k()}var s=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,s,n)}function ne(e,t){if(N("{",!0)){for(var r={};!N("}",!0);){if(!b.test(R=k()))throw U(R,"name");if(null===R)throw U(R,"end of input");var n,o=R;if(N(":",!0),"{"===A())n=ne(e,t+"."+R);else if("["===A()){var i;if(n=[],N("[",!0)){do{i=G(),n.push(i)}while(N(",",!0));N("]"),void 0!==i&&oe(e,t+"."+R,i)}}else n=G(),oe(e,t+"."+R,n);var a=r[o];a&&(n=[].concat(a).concat(n)),r[o]=n,N(",",!0),N(";",!0)}return r}var s=G();return oe(e,t,s),s}function oe(e,t,r){L===e&&/^features\./.test(t)?B[t]=r:e.setOption&&e.setOption(t,r)}function ie(e){if(N("[",!0)){do{re(e,"option")}while(N(",",!0));N("]")}return e}for(;null!==(R=k());)switch(R){case"package":if(!q)throw U(R);W();break;case"import":if(!q)throw U(R);J();break;case"syntax":if(!q)throw U(R);Y();break;case"edition":if(!q)throw U(R);K();break;case"option":re(L,R),N(";",!0);break;default:if(X(L,R)){q=!1;continue}throw U(R)}return F.forEach(e=>{e._edition=M,Object.keys(B).forEach(t=>{void 0===e.getOption(t)&&e.setOption(t,B[t],!0)})}),w.filename=null,{package:E,imports:T,weakImports:C,root:_}}return parse_1}function requireCommon$2(){if(hasRequiredCommon$2)return common_1;hasRequiredCommon$2=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$7(){if(hasRequiredSrc$7)return src$4.exports;hasRequiredSrc$7=1;var e=src$4.exports=requireIndexLight();return e.build="full",e.tokenize=requireTokenize(),e.parse=requireParse(),e.common=requireCommon$2(),e.Root._configure(e.Type,e.parse,e.common),src$4.exports}function requireProtobufjs(){return hasRequiredProtobufjs?protobufjs:(hasRequiredProtobufjs=1,protobufjs=requireSrc$7())}var descriptor$1={exports:{}},nested$7={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$2={nested:nested$7},hasRequiredDescriptor$1;function requireDescriptor$1(){return hasRequiredDescriptor$1||(hasRequiredDescriptor$1=1,function(e,t){var r=requireProtobufjs();e.exports=t=r.descriptor=r.Root.fromJSON(require$$4$2).lookup(".google.protobuf");var n=r.Namespace,o=r.Root,i=r.Enum,a=r.Type,s=r.Field,l=r.MapField,p=r.OneOf,d=r.Service,u=r.Method;function c(e,r,l){var p=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,p),e instanceof o||(p.package=e.fullName.substring(1));for(var u,f=0;f<e.nestedArray.length;++f)(u=e._nestedArray[f])instanceof a?p.messageType.push(u.toDescriptor(l)):u instanceof i?p.enumType.push(u.toDescriptor()):u instanceof s?p.extension.push(u.toDescriptor(l)):u instanceof d?p.service.push(u.toDescriptor()):u instanceof n&&c(u,r,l);p.options=_(e.options,t.FileOptions),p.messageType.length+p.enumType.length+p.extension.length+p.service.length&&r.push(p)}o.fromDescriptor=function(e){"number"==typeof e.length&&(e=t.FileDescriptorSet.decode(e));var r=new o;if(e.file)for(var n,l,p,u=0;u<e.file.length;++u){l=r,(n=e.file[u]).package&&n.package.length&&(l=r.define(n.package));var c=T(n);if(n.name&&n.name.length&&r.files.push(l.filename=n.name),n.messageType)for(p=0;p<n.messageType.length;++p)l.add(a.fromDescriptor(n.messageType[p],c));if(n.enumType)for(p=0;p<n.enumType.length;++p)l.add(i.fromDescriptor(n.enumType[p],c));if(n.extension)for(p=0;p<n.extension.length;++p)l.add(s.fromDescriptor(n.extension[p],c));if(n.service)for(p=0;p<n.service.length;++p)l.add(d.fromDescriptor(n.service[p],c));var f=w(n.options,t.FileOptions);if(f){var h=Object.keys(f);for(p=0;p<h.length;++p)l.setOption(h[p],f[h[p]])}}return r.resolveAll()},o.prototype.toDescriptor=function(e){var r=t.FileDescriptorSet.create();return c(this,r.file,e),r};var f=0;a.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.DescriptorProto.decode(e));var o,l=new a(e.name.length?e.name:"Type"+f++,w(e.options,t.MessageOptions));if(n||(l._edition=r),e.oneofDecl)for(o=0;o<e.oneofDecl.length;++o)l.add(p.fromDescriptor(e.oneofDecl[o]));if(e.field)for(o=0;o<e.field.length;++o){var d=s.fromDescriptor(e.field[o],r,!0);l.add(d),e.field[o].hasOwnProperty("oneofIndex")&&l.oneofsArray[e.field[o].oneofIndex].add(d)}if(e.extension)for(o=0;o<e.extension.length;++o)l.add(s.fromDescriptor(e.extension[o],r,!0));if(e.nestedType)for(o=0;o<e.nestedType.length;++o)l.add(a.fromDescriptor(e.nestedType[o],r,!0)),e.nestedType[o].options&&e.nestedType[o].options.mapEntry&&l.setOption("map_entry",!0);if(e.enumType)for(o=0;o<e.enumType.length;++o)l.add(i.fromDescriptor(e.enumType[o],r,!0));if(e.extensionRange&&e.extensionRange.length)for(l.extensions=[],o=0;o<e.extensionRange.length;++o)l.extensions.push([e.extensionRange[o].start,e.extensionRange[o].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(l.reserved=[],e.reservedRange)for(o=0;o<e.reservedRange.length;++o)l.reserved.push([e.reservedRange[o].start,e.reservedRange[o].end]);if(e.reservedName)for(o=0;o<e.reservedName.length;++o)l.reserved.push(e.reservedName[o])}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 o;if(n.field.push(o=this._fieldsArray[r].toDescriptor(e)),this._fieldsArray[r]instanceof l){var p=b(this._fieldsArray[r].keyType,this._fieldsArray[r].resolvedKeyType,!1),d=b(this._fieldsArray[r].type,this._fieldsArray[r].resolvedType,!1),u=11===d||14===d?this._fieldsArray[r].resolvedType&&P(this.parent,this._fieldsArray[r].resolvedType)||this._fieldsArray[r].type:void 0;n.nestedType.push(t.DescriptorProto.create({name:o.typeName,field:[t.FieldDescriptorProto.create({name:"key",number:1,label:1,type:p}),t.FieldDescriptorProto.create({name:"value",number:2,label:1,type:d,typeName:u})],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 s?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 i&&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 h=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;s.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 o,i;switch(o=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:i=void 0;break;case 2:i="required";break;case 3:i="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 s(e.name.length?e.name:"field"+e.number,e.number,o,i,a);if(n||(l._edition=r),l.options=w(e.options,t.FieldOptions),e.proto3_optional&&(l.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var p=e.defaultValue;switch(p){case"true":case"TRUE":p=!0;break;case"false":case"FALSE":p=!1;break;default:h.exec(p)&&(p=parseInt(p))}l.setOption("default",p)}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},s.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=b(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:n.typeName=this.resolvedType?P(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 m=0;i.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.EnumDescriptorProto.decode(e));var o={};if(e.value)for(var a=0;a<e.value.length;++a){var s=e.value[a].name,l=e.value[a].number||0;o[s&&s.length?s:"NAME"+l]=l}var p=new i(e.name&&e.name.length?e.name:"Enum"+m++,o,w(e.options,t.EnumOptions));return n||(p._edition=r),p},i.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 g=0;p.fromDescriptor=function(e){return"number"==typeof e.length&&(e=t.OneofDescriptorProto.decode(e)),new p(e.name&&e.name.length?e.name:"oneof"+g++)},p.prototype.toDescriptor=function(){return t.OneofDescriptorProto.create({name:this.name})};var y=0;d.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.ServiceDescriptorProto.decode(e));var o=new d(e.name&&e.name.length?e.name:"Service"+y++,w(e.options,t.ServiceOptions));if(n||(o._edition=r),e.method)for(var i=0;i<e.method.length;++i)o.add(u.fromDescriptor(e.method[i]));return o},d.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 v=0;function b(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 i)return 14;if(t instanceof a)return r?10:11;throw Error("illegal type: "+e)}function O(e,t){for(var r,n,o={},s=0;s<t.fieldsArray.length;++s)if("uninterpretedOption"!==(n=(r=t._fieldsArray[s]).name)&&Object.prototype.hasOwnProperty.call(e,n)){var l=E(n);r.resolvedType instanceof a?o[l]=O(e[n],r.resolvedType):r.resolvedType instanceof i?o[l]=r.resolvedType.valuesById[e[n]]:o[l]=e[n]}return o}function w(e,t){if(e)return O(t.toObject(e),t)}function S(e,t){for(var n={},o=Object.keys(e),i=0;i<o.length;++i){var s=o[i],l=r.util.camelCase(s);if(Object.prototype.hasOwnProperty.call(t.fields,l)){var p=t.fields[l];p.resolvedType instanceof a?n[l]=S(e[s],p.resolvedType):n[l]=e[s],p.repeated&&!Array.isArray(n[l])&&(n[l]=[n[l]])}}return n}function _(e,t){if(e)return t.fromObject(S(e,t))}function P(e,t){var r=e.fullName.split("."),i=t.fullName.split("."),a=0,s=0,l=i.length-1;if(!(e instanceof o)&&t instanceof n)for(;a<r.length&&s<l&&r[a]===i[s];){var p=t.lookup(r[a++],!0);if(null!==p&&p!==t)break;++s}else for(;a<r.length&&s<l&&r[a]===i[s];++a,++s);return i.slice(s).join(".")}function E(e){return e.substring(0,1)+e.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return"_"+t.toLowerCase()})}function T(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"}u.fromDescriptor=function(e){return"number"==typeof e.length&&(e=t.MethodDescriptorProto.decode(e)),new u(e.name&&e.name.length?e.name:"Method"+v++,"rpc",e.inputType,e.outputType,Boolean(e.clientStreaming),Boolean(e.serverStreaming),w(e.options,t.MethodOptions))},u.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$1,descriptor$1.exports)),descriptor$1.exports}var util$4={},nested$6={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$1={nested:nested$6},nested$5={google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}},require$$5$2={nested:nested$5},nested$4={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$1={nested:nested$4},hasRequiredUtil$4;function requireUtil$4(){if(hasRequiredUtil$4)return util$4;hasRequiredUtil$4=1,
8
8
  /**
9
9
  * @license
10
10
  * Copyright 2018 gRPC authors.