varn=r(620),i=r(329),o=r(327);functions(){try{vare=newUint8Array(1);returne.__proto__={__proto__:Uint8Array.prototype,foo:function(){return42}},42===e.foo()&&"function"==typeofe.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}functiona(){returnc.TYPED_ARRAY_SUPPORT?2147483647:1073741823}functionu(e,t){if(a()<t)thrownewRangeError("Invalid typed array length");returnc.TYPED_ARRAY_SUPPORT?(e=newUint8Array(t),e.__proto__=c.prototype):(null===e&&(e=newc(t)),e.length=t),e}functionc(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||thisinstanceofc))returnnewc(e,t,r);if("number"==typeofe){if("string"==typeoft)thrownewError("If encoding is specified then the first argument must be a string");returnp(this,e)}returnf(this,e,t,r)}functionf(e,t,r,n){if("number"==typeoft)thrownewTypeError('"value" argument must not be a number');return"undefined"!=typeofArrayBuffer&&tinstanceofArrayBuffer?g(e,t,r,n):"string"==typeoft?d(e,t,r):m(e,t)}functionl(e){if("number"!=typeofe)thrownewTypeError('"size" argument must be a number');if(e<0)thrownewRangeError('"size" argument must not be negative')}functionh(e,t,r,n){returnl(t),t<=0?u(e,t):void0!==r?"string"==typeofn?u(e,t).fill(r,n):u(e,t).fill(r):u(e,t)}functionp(e,t){if(l(t),e=u(e,t<0?0:0|b(t)),!c.TYPED_ARRAY_SUPPORT)for(varr=0;r<t;++r)e[r]=0;returne}functiond(e,t,r){if("string"==typeofr&&""!==r||(r="utf8"),!c.isEncoding(r))thrownewTypeError('"encoding" must be a valid string encoding');varn=0|_(t,r);e=u(e,n);vari=e.write(t,r);returni!==n&&(e=e.slice(0,i)),e}functiony(e,t){varr=t.length<0?0:0|b(t.length);e=u(e,r);for(varn=0;n<r;n+=1)e[n]=255&t[n];returne}functiong(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)thrownewRangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))thrownewRangeError("'length' is out of bounds");returnt=void0===r&&void0===n?newUint8Array(t):void0===n?newUint8Array(t,r):newUint8Array(t,r,n),c.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=c.prototype):e=y(e,t),e}functionm(e,t){if(c.isBuffer(t)){varr=0|b(t.length);returne=u(e,r),0===e.length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeofArrayBuffer&&t.bufferinstanceofArrayBuffer||"length"int)return"number"!=typeoft.length||te(t.length)?u(e,0):y(e,t);if("Buffer"===t.type&&o(t.data))returny(e,t.data)}thrownewTypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}functionb(e){if(e>=a())thrownewRangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return0|e}functionv(e){return+e!=e&&(e=0),c.alloc(+e)}function_(e,t){if(c.isBuffer(e))returne.length;if("undefined"!=typeofArrayBuffer&&"function"==typeofArrayBuffer.isView&&(ArrayBuffer.isView(e)||einstanceofArrayBuffer))returne.byteLength;"string"!=typeofe&&(e=""+e);varr=e.length;if(0===r)return0;for(varn=!1;;)switch(t){case"ascii":case"latin1":case"binary":returnr;case"utf8":case"utf-8":casevoid0:returnJ(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return2*r;case"hex":returnr>>>1;case"base64":returnQ(e).length;default:if(n)returnJ(e).length;t=(""+t).toLowerCase(),n=!0}}functionw(e,t,r){varn=!1;if((void0===t||t<0)&&(t=0),t>this.length)return"";if((void0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":returnM(this,t,r);case"utf8":case"utf-8":returnO(this,t,r);case"ascii":returnL(this,t,r);case"latin1":case"binary":returnj(this,t,r);case"base64":returnP(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":returnK(this,t,r);default:if(n)thrownewTypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}functionS(e,t,r){varn=e[t];e[t]=e[r],e[r]=n}functionk(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeofr?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}elseif(r<0){if(!i)return-1;r=0}if("string"==typeoft&&(t=c.from(t,n)),c.isBuffer(t))return0===t.length?-1:E(e,t,r,n
e.exports=functione(t){"use strict";if("function"!=typeofPromise)throw"Promise support required";varr=t.crypto||t.msCrypto;if(r){varn=r.subtle||r.webkitSubtle;if(n){vari=t.Crypto||r.constructor||Object,o=t.SubtleCrypto||n.constructor||Object,s=t.CryptoKey||t.Key||Object,a=t.navigator.userAgent.indexOf("Edge/")>-1,u=!!t.msCrypto&&!a,c=!r.subtle&&!!r.webkitSubtle;if(u||c){varf={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},l={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};if(["generateKey","importKey","unwrapKey"].forEach(function(e){vart=n[e];n[e]=function(i,o,s){vara=[].slice.call(arguments),f,l,h,p;switch(e){case"generateKey":f=m(i),l=o,h=s;break;case"importKey":f=m(s),l=a[3],h=a[4],"jwk"===i&&(o=v(o),o.alg||(o.alg=b(f)),o.key_ops||(o.key_ops="oct"!==o.kty?"d"ino?h.filter(I):h.filter(x):h.slice()),a[1]=_(o));break;case"unwrapKey":f=a[4],l=a[5],h=a[6],a[2]=s._key}if("generateKey"===e&&"HMAC"===f.name&&f.hash)returnf.length=f.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[f.hash.name],n.importKey("raw",r.getRandomValues(newUint8Array(f.length+7>>3)),f,l,h);if(c&&"generateKey"===e&&"RSASSA-PKCS1-v1_5"===f.name&&(!f.modulusLength||f.modulusLength>=2048))returni=m(i),i.name="RSAES-PKCS1-v1_5",deletei.hash,n.generateKey(i,!0,["encrypt","decrypt"]).then(function(e){returnPromise.all([n.exportKey("jwk",e.publicKey),n.exportKey("jwk",e.privateKey)])}).then(function(e){returne[0].alg=e[1].alg=b(f),e[0].key_ops=h.filter(x),e[1].key_ops=h.filter(I),Promise.all([n.importKey("jwk",e[0],f,!0,e[0].key_ops),n.importKey("jwk",e[1],f,l,e[1].key_ops)])}).then(function(e){return{publicKey:e[0],privateKey:e[1]}});if((c||u&&"SHA-1"===(f.hash||{}).name)&&"importKey"===e&&"jwk"===i&&"HMAC"===f.name&&"oct"===o.kty)returnn.importKey("raw",y(d(o.k)),s,a[3],a[4]);if(c&&"importKey"===e&&("spki"===i||"pkcs8"===i))returnn.importKey("jwk",w(o),s,a[3],a[4]);if(u&&"unwrapKey"===e)returnn.decrypt(a[3],s,o).then(function(e){returnn.importKey(i,e,a[4],a[5],a[6])});try{p=t.apply(n,a)}catch(e){returnPromise.reject(e)}returnu&&(p=newPromise(function(e,t){p.onabort=p.onerror=function(e){t(e)},p.oncomplete=function(t){e(t.target.result)}})),p=p.then(function(e){return"HMAC"===f.name&&(f.length||(f.length=8*e.algorithm.length)),0==f.name.search("RSA")&&(f.modulusLength||(f.modulusLength=(e.publicKey||e).algorithm.modulusLength),f.publicExponent||(f.publicExponent=(e.publicKey||e).algorithm.publicExponent)),e=e.publicKey&&e.privateKey?{publicKey:newA(e.publicKey,f,l,h.filter(x)),privateKey:newA(e.privateKey,f,l,h.filter(I))}:newA(e,f,l,h),e}),p}}),["exportKey","wrapKey"].forEach(function(e){vart=n[e];n[e]=function(r,i,o){vars=[].slice.call(arguments),a;switch(e){case"exportKey":s[1]=i._key;break;case"wrapKey":s[1]=i._key,s[2]=o._key}if((c||u&&"SHA-1"===(i.algorithm.hash||{}).name)&&"exportKey"===e&&"jwk"===r&&"HMAC"===i.algorithm.name&&(s[0]="raw"),!c||"exportKey"!==e||"spki"!==r&&"pkcs8"!==r||(s[0]="jwk"),u&&"wrapKey"===e)returnn.exportKey(r,i).then(function(e){return"jwk"===r&&(e=y(unescape(encodeURIComponent(JSON.stringify(v(e)))))),n.encrypt(s[3],o,e)});try{a=t.apply(n,s)}catch(e){returnPromise.reject(e)}returnu&&(a=newPromise(function(e,t){a.onabort=a.onerror=function(e){t(e)},a.oncomplete=function(t){e(t.target.result)}})),"exportKey"===e&&"jwk"===r&&(a=a.then(function(e){return(c||u&&"SHA-1"===(i.algorithm.hash||{}).name)&&"HMAC"===i.algorithm.name?{kty:"oct",alg:b(i.algorithm),key_ops:i.usages.slice(),ext:!0,k:p(g(e))}:(e=v(e),e.alg||(e.alg=b(i.algorithm)),e.key_ops||(e.key_ops="public"===i.type?i.usages.filter(x):"private"===i.type?i.usages.filter(I):i.usages.slice()),e)})),!c||"exportKey"!==e||"spki"!==r&&"pkcs8"!==r||(a=a.then(function(e){returne=S(v(e)),e})),a}}),["encrypt","decrypt","sign","verify"].forEach(function(e){vart=n[e];n[e]=function(r,i,o,s){if(u&&(!o.byteLength||s&&!s.byteLength))thrownewError("Empy input is not allowed");vara=[].slice.call(arguments),c=m(r),f;if(u&&"decrypt"===e&&"AES-GCM"===c.name){varl=r.tagLength>>3;a[2]=(o.buffer||o).slice(0,o.byteLength-l),r.tag=(o.buffer||o).slice(o.byteLength-
varn=r(33),i=r(34),o=r(35);functions(){try{vare=newUint8Array(1);returne.__proto__={__proto__:Uint8Array.prototype,foo:function(){return42}},42===e.foo()&&"function"==typeofe.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}functiona(){returnc.TYPED_ARRAY_SUPPORT?2147483647:1073741823}functionu(e,t){if(a()<t)thrownewRangeError("Invalid typed array length");returnc.TYPED_ARRAY_SUPPORT?(e=newUint8Array(t),e.__proto__=c.prototype):(null===e&&(e=newc(t)),e.length=t),e}functionc(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||thisinstanceofc))returnnewc(e,t,r);if("number"==typeofe){if("string"==typeoft)thrownewError("If encoding is specified then the first argument must be a string");returnp(this,e)}returnf(this,e,t,r)}functionf(e,t,r,n){if("number"==typeoft)thrownewTypeError('"value" argument must not be a number');return"undefined"!=typeofArrayBuffer&&tinstanceofArrayBuffer?g(e,t,r,n):"string"==typeoft?d(e,t,r):m(e,t)}functionl(e){if("number"!=typeofe)thrownewTypeError('"size" argument must be a number');if(e<0)thrownewRangeError('"size" argument must not be negative')}functionh(e,t,r,n){returnl(t),t<=0?u(e,t):void0!==r?"string"==typeofn?u(e,t).fill(r,n):u(e,t).fill(r):u(e,t)}functionp(e,t){if(l(t),e=u(e,t<0?0:0|b(t)),!c.TYPED_ARRAY_SUPPORT)for(varr=0;r<t;++r)e[r]=0;returne}functiond(e,t,r){if("string"==typeofr&&""!==r||(r="utf8"),!c.isEncoding(r))thrownewTypeError('"encoding" must be a valid string encoding');varn=0|_(t,r);e=u(e,n);vari=e.write(t,r);returni!==n&&(e=e.slice(0,i)),e}functiony(e,t){varr=t.length<0?0:0|b(t.length);e=u(e,r);for(varn=0;n<r;n+=1)e[n]=255&t[n];returne}functiong(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)thrownewRangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))thrownewRangeError("'length' is out of bounds");returnt=void0===r&&void0===n?newUint8Array(t):void0===n?newUint8Array(t,r):newUint8Array(t,r,n),c.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=c.prototype):e=y(e,t),e}functionm(e,t){if(c.isBuffer(t)){varr=0|b(t.length);returne=u(e,r),0===e.length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeofArrayBuffer&&t.bufferinstanceofArrayBuffer||"length"int)return"number"!=typeoft.length||te(t.length)?u(e,0):y(e,t);if("Buffer"===t.type&&o(t.data))returny(e,t.data)}thrownewTypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}functionb(e){if(e>=a())thrownewRangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return0|e}functionv(e){return+e!=e&&(e=0),c.alloc(+e)}function_(e,t){if(c.isBuffer(e))returne.length;if("undefined"!=typeofArrayBuffer&&"function"==typeofArrayBuffer.isView&&(ArrayBuffer.isView(e)||einstanceofArrayBuffer))returne.byteLength;"string"!=typeofe&&(e=""+e);varr=e.length;if(0===r)return0;for(varn=!1;;)switch(t){case"ascii":case"latin1":case"binary":returnr;case"utf8":case"utf-8":casevoid0:returnJ(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return2*r;case"hex":returnr>>>1;case"base64":returnQ(e).length;default:if(n)returnJ(e).length;t=(""+t).toLowerCase(),n=!0}}functionw(e,t,r){varn=!1;if((void0===t||t<0)&&(t=0),t>this.length)return"";if((void0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":returnM(this,t,r);case"utf8":case"utf-8":returnO(this,t,r);case"ascii":returnL(this,t,r);case"latin1":case"binary":returnj(this,t,r);case"base64":returnP(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":returnK(this,t,r);default:if(n)thrownewTypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}functionS(e,t,r){varn=e[t];e[t]=e[r],e[r]=n}functionk(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeofr?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}elseif(r<0){if(!i)return-1;r=0}if("string"==typeoft&&(t=c.from(t,n)),c.isBuffer(t))return0===t.length?-1:E(e,t,r,n,i)
varr,n,i;r="prr",n=this,i=function(){vare="function"==typeofObject.defineProperty?function(e,t,r){returnObject.defineProperty(e,t,r),e}:function(e,t,r){returne[t]=r.value,e},t=function(e,t){varr="object"==typeoft,n=!r&&"string"==typeoft,i=function(e){returnr?!!t[e]:!!n&&t.indexOf(e[0])>-1};return{enumerable:i("enumerable"),configurable:i("configurable"),writable:i("writable"),value:e}},r=function(r,n,i,o){vars;if(o=t(i,o),"object"==typeofn){for(sinn)Object.hasOwnProperty.call(n,s)&&(o.value=n[s],e(r,s,o));returnr}returne(r,n,o)};returnr},void0!==e&&e.exports?e.exports=i():n.prr=i()},function(e,t,r){"use strict";varn=r(223).AbstractLevelDOWN,i=r(223).AbstractChainedBatch,o=r(223).AbstractIterator,s=r(4),a=r(27),u=r(709),c=r(711).EncodingError;functionf(e,t){if(!(thisinstanceoff))returnnewf(e,t);n.call(this,""),t=t||{},void0===t.keyEncoding&&(t.keyEncoding="utf8"),void0===t.valueEncoding&&(t.valueEncoding="utf8"),this.db=e,this.codec=newu(t)}functionl(e,t){o.call(this,e),this.codec=e.codec,this.keys=t.keys,this.values=t.values,this.opts=this.codec.encodeLtgt(t),this.it=e.db.iterator(this.opts)}functionh(e,t){i.call(this,e),this.codec=e.codec,this.batch=e.db.batch()}e.exports=f.default=f,s(f,n),f.prototype._serializeKey=f.prototype._serializeValue=function(e){returne},f.prototype._open=function(e,t){this.db.open(e,t)},f.prototype._close=function(e){this.db.close(e)},f.prototype._put=function(e,t,r,n){e=this.codec.encodeKey(e,r),t=this.codec.encodeValue(t,r),this.db.put(e,t,r,n)},f.prototype._get=function(e,t,r){varn=this;e=this.codec.encodeKey(e,t),t.asBuffer=this.codec.valueAsBuffer(t),this.db.get(e,t,function(e,i){if(e)returnr(e);try{i=n.codec.decodeValue(i,t)}catch(e){returnr(newc(e))}r(null,i)})},f.prototype._del=function(e,t,r){e=this.codec.encodeKey(e,t),this.db.del(e,t,r)},f.prototype._chainedBatch=function(){returnnewh(this)},f.prototype._batch=function(e,t,r){e=this.codec.encodeBatch(e,t),this.db.batch(e,t,r)},f.prototype._iterator=function(e){returne.keyAsBuffer=this.codec.keyAsBuffer(e),e.valueAsBuffer=this.codec.valueAsBuffer(e),newl(this,e)},f.prototype._setupIteratorOptions=function(e){returne=a(e),e.reverse=!!e.reverse,e.keys=!1!==e.keys,e.values=!1!==e.values,e.limit="limit"ine?e.limit:-1,e.keyAsBuffer=!1!==e.keyAsBuffer,e.valueAsBuffer=!1!==e.valueAsBuffer,e},f.prototype.approximateSize=function(e,t,r,n){returnthis.db.approximateSize(e,t,r,n)},s(l,o),l.prototype._next=function(e){vart=this;this.it.next(function(r,n,i){if(r)returne(r);try{n=t.keys&&void0!==n?t.codec.decodeKey(n,t.opts):void0,i=t.values&&void0!==i?t.codec.decodeValue(i,t.opts):void0}catch(r){returne(newc(r))}e(null,n,i)})},l.prototype._end=function(e){this.it.end(e)},s(h,i),h.prototype._put=function(e,t){e=this.codec.encodeKey(e),t=this.codec.encodeValue(t),this.batch.put(e,t)},h.prototype._del=function(e){e=this.codec.encodeKey(e),this.batch.del(e)},h.prototype._clear=function(){this.batch.clear()},h.prototype._write=function(e,t){this.batch.write(e,t)}},function(e,t,r){(function(t,n){vari=r(27),o=r(369),s=r(370),a=Object.prototype.hasOwnProperty,u="start end gt gte lt lte".split(" ");functionc(e){if(!arguments.length||void0===e)thrownewError("constructor requires at least a location argument");if("string"!=typeofe)thrownewError("constructor requires a location string argument");this.location=e,this.status="new"}functionf(e){vart={};for(varrine)a.call(e,r)&&(l(r)&&h(e[r])||(t[r]=e[r]));returnt}functionl(e){return-1!==u.indexOf(e)}functionh(e){return""===e||null==e||p(e)}functionp(e){returnn.isBuffer(e)&&0===e.length}c.prototype.open=function(e,t){varr=this,n=this.status;if("function"==typeofe&&(t=e),"function"!=typeoft)thrownewError("open() requires a callback argument");"object"!=typeofe&&(e={}),e.createIfMissing=!1!==e.createIfMissing,e.errorIfExists=!!e.errorIfExists,this.status="opening",this._open(e,function(e){if(e)returnr.status=n,t(e);r.status="open",t()})},c.prototype._open=function(e,r){t.nextTick(r)},c.prototype.close=function(e){vart=this,r=this.status;if(
varn,i;n=this,i=function(){"use strict";vare=function(e,r){returnt(e.slice(),r)};functiont(e,t){"function"!=typeoft&&(t=function(e,t){returnString(e).localeCompare(t)});varn=e.length;if(n<=1)returne;for(vari=newArray(n),o=1;o<n;o*=2){r(e,t,o,i);vars=e;e=i,i=s}returne}e.inplace=function(e,n){vari=t(e,n);returni!==e&&r(i,null,e.length,e),e};varr=function(e,t,r,n){vari=e.length,o=0,s=2*r,a,u,c,f,l;for(a=0;a<i;a+=s)for(u=a+r,c=u+r,u>i&&(u=i),c>i&&(c=i),f=a,l=u;;)if(f<u&&l<c)t(e[f],e[l])<=0?n[o++]=e[f++]:n[o++]=e[l++];elseif(f<u)n[o++]=e[f++];else{if(!(l<c))break;n[o++]=e[l++]}};returne},e.exports=i()},function(e,t,r){varn=r(734),i=r(736);e.exports=n,e.exports.parse=n,e.exports.stringify=i},function(e,t,r){varn=r(735),i=536870911,o=["int32","int64","uint32","uint64","sint32","sint64","bool","fixed64","sfixed64","double","fixed32","sfixed32","float"],s=function(e){for(vart={};e.length;)switch(e[0]){case"[":case",":e.shift();varr=e.shift();if("("===r&&(r=e.shift(),e.shift()),"="!==e[0])thrownewError("Unexpected token in field options: "+e[0]);if(e.shift(),"]"===e[0])thrownewError("Unexpected ] in field option");t[r]=e.shift();break;case"]":returne.shift(),t;default:thrownewError("Unexpected token in field options: "+e[0])}thrownewError("No closing tag for field options")},a=function(e){for(vart={name:null,type:null,tag:-1,map:null,oneof:null,required:!1,repeated:!1,options:{}};e.length;)switch(e[0]){case"=":e.shift(),t.tag=Number(e.shift());break;case"map":if(t.type="map",t.map={from:null,to:null},e.shift(),"<"!==e[0])thrownewError("Unexpected token in map type: "+e[0]);if(e.shift(),t.map.from=e.shift(),","!==e[0])thrownewError("Unexpected token in map type: "+e[0]);if(e.shift(),t.map.to=e.shift(),">"!==e[0])thrownewError("Unexpected token in map type: "+e[0]);e.shift(),t.name=e.shift();break;case"repeated":case"required":case"optional":varr=e.shift();t.required="required"===r,t.repeated="repeated"===r,t.type=e.shift(),t.name=e.shift();break;case"[":t.options=s(e);break;case";":if(null===t.name)thrownewError("Missing field name");if(null===t.type)thrownewError("Missing type in message field: "+t.name);if(-1===t.tag)thrownewError("Missing tag number in message field: "+t.name);returne.shift(),t;default:thrownewError("Unexpected token in message field: "+e[0])}thrownewError("No ; found for message field")},u=function(e){for(vart={enums:[],messages:[],fields:[],extends:[],extensions:null};e.length;)switch(e[0]){case"map":case"repeated":case"optional":case"required":t.fields.push(a(e));break;case"enum":t.enums.push(y(e));break;case"message":t.messages.push(l(e));break;case"extensions":t.extensions=f(e);break;case"oneof":e.shift();varr=e.shift();if("{"!==e[0])thrownewError("Unexpected token in oneof: "+e[0]);for(e.shift();"}"!==e[0];){e.unshift("optional");varn=a(e);n.oneof=r,t.fields.push(n)}e.shift();break;case"extend":t.extends.push(c(e));break;case";":e.shift();break;case"reserved":case"option":for(e.shift();";"!==e[0];)e.shift();break;default:e.unshift("optional"),t.fields.push(a(e))}returnt},c=function(e){vart={name:e[1],message:l(e)};returnt},f=function(e){e.shift();vart=Number(e.shift());if(isNaN(t))thrownewError("Invalid from in extensions definition");if("to"!==e.shift())thrownewError("Expected keyword 'to' in extensions definition");varr=e.shift();if("max"===r&&(r=536870911),r=Number(r),isNaN(r))thrownewError("Invalid to in extensions definition");if(";"!==e.shift())thrownewError("Missing ; in extensions definition");return{from:t,to:r}},l=function(e){e.shift();vart=1,r=[],n={name:e.shift(),enums:[],extends:[],messages:[],fields:[]};if("{"!==e[0])thrownewError("Expected { but found "+e[0]);for(e.shift();e.length;){if("{"===e[0]?t++:"}"===e[0]&&t--,!t)returne.shift(),r=u(r),n.enums=r.enums,n.messages=r.messages,n.fields=r.fields,n.extends=r.extends,n.extensions=r.extensions,n;r.push(e.shift())}if(t)thrownewError("No closing tag for message")},h=function(e){e.shift();vart=e.shift();if(";"!==e[0])thrownewError("Expected ; but found "+e[0]);returne