@sentio/runtime 2.57.12 → 2.57.13-rc.1

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.
@@ -1,131 +0,0 @@
1
- import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
2
- var xW=Object.create;var Cm=Object.defineProperty;var BW=Object.getOwnPropertyDescriptor;var DW=Object.getOwnPropertyNames;var MW=Object.getPrototypeOf,LW=Object.prototype.hasOwnProperty;var xe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var re=(e,t)=>()=>(e&&(t=e(e=0)),t);var m=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gh=(e,t)=>{for(var n in t)Cm(e,n,{get:t[n],enumerable:!0})},KI=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of DW(t))!LW.call(e,i)&&i!==n&&Cm(e,i,{get:()=>t[i],enumerable:!(r=BW(t,i))||r.enumerable});return e};var An=(e,t,n)=>(n=e!=null?xW(MW(e)):{},KI(t||!e||!e.__esModule?Cm(n,"default",{value:e,enumerable:!0}):n,e)),Bi=e=>KI(Cm({},"__esModule",{value:!0}),e);var FT=m((_be,a2)=>{"use strict";a2.exports=UW;function UW(e,t){for(var n=new Array(arguments.length-1),r=0,i=2,a=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise(function(s,u){n[r]=function(c){if(a)if(a=!1,c)u(c);else{for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f++]=arguments[f];s.apply(null,d)}};try{e.apply(t||null,n)}catch(l){a&&(a=!1,u(l))}})}});var l2=m(u2=>{"use strict";var _m=u2;_m.length=function(t){var n=t.length;if(!n)return 0;for(var r=0;--n%4>1&&t.charAt(n)==="=";)++r;return Math.ceil(t.length*3)/4-r};var Du=new Array(64),s2=new Array(123);for(Wr=0;Wr<64;)s2[Du[Wr]=Wr<26?Wr+65:Wr<52?Wr+71:Wr<62?Wr-4:Wr-59|43]=Wr++;var Wr;_m.encode=function(t,n,r){for(var i=null,a=[],o=0,s=0,u;n<r;){var l=t[n++];switch(s){case 0:a[o++]=Du[l>>2],u=(l&3)<<4,s=1;break;case 1:a[o++]=Du[u|l>>4],u=(l&15)<<2,s=2;break;case 2:a[o++]=Du[u|l>>6],a[o++]=Du[l&63],s=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),o=0)}return s&&(a[o++]=Du[u],a[o++]=61,s===1&&(a[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join("")):String.fromCharCode.apply(String,a.slice(0,o))};var o2="invalid encoding";_m.decode=function(t,n,r){for(var i=r,a=0,o,s=0;s<t.length;){var u=t.charCodeAt(s++);if(u===61&&a>1)break;if((u=s2[u])===void 0)throw Error(o2);switch(a){case 0:o=u,a=1;break;case 1:n[r++]=o<<2|(u&48)>>4,o=u,a=2;break;case 2:n[r++]=(o&15)<<4|(u&60)>>2,o=u,a=3;break;case 3:n[r++]=(o&3)<<6|u,a=0;break}}if(a===1)throw Error(o2);return r-i};_m.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}});var d2=m((Nbe,c2)=>{"use strict";c2.exports=Am;function Am(){this._listeners={}}Am.prototype.on=function(t,n,r){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:n,ctx:r||this}),this};Am.prototype.off=function(t,n){if(t===void 0)this._listeners={};else if(n===void 0)this._listeners[t]=[];else for(var r=this._listeners[t],i=0;i<r.length;)r[i].fn===n?r.splice(i,1):++i;return this};Am.prototype.emit=function(t){var n=this._listeners[t];if(n){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<n.length;)n[i].fn.apply(n[i++].ctx,r)}return this}});var v2=m((Ibe,y2)=>{"use strict";y2.exports=f2(f2);function f2(e){return typeof Float32Array<"u"?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=n[3]===128;function i(u,l,c){t[0]=u,l[c]=n[0],l[c+1]=n[1],l[c+2]=n[2],l[c+3]=n[3]}function a(u,l,c){t[0]=u,l[c]=n[3],l[c+1]=n[2],l[c+2]=n[1],l[c+3]=n[0]}e.writeFloatLE=r?i:a,e.writeFloatBE=r?a:i;function o(u,l){return n[0]=u[l],n[1]=u[l+1],n[2]=u[l+2],n[3]=u[l+3],t[0]}function s(u,l){return n[3]=u[l],n[2]=u[l+1],n[1]=u[l+2],n[0]=u[l+3],t[0]}e.readFloatLE=r?o:s,e.readFloatBE=r?s:o}():function(){function t(r,i,a,o){var s=i<0?1:0;if(s&&(i=-i),i===0)r(1/i>0?0:2147483648,a,o);else if(isNaN(i))r(2143289344,a,o);else if(i>34028234663852886e22)r((s<<31|2139095040)>>>0,a,o);else if(i<11754943508222875e-54)r((s<<31|Math.round(i/1401298464324817e-60))>>>0,a,o);else{var u=Math.floor(Math.log(i)/Math.LN2),l=Math.round(i*Math.pow(2,-u)*8388608)&8388607;r((s<<31|u+127<<23|l)>>>0,a,o)}}e.writeFloatLE=t.bind(null,h2),e.writeFloatBE=t.bind(null,p2);function n(r,i,a){var o=r(i,a),s=(o>>31)*2+1,u=o>>>23&255,l=o&8388607;return u===255?l?NaN:s*(1/0):u===0?s*1401298464324817e-60*l:s*Math.pow(2,u-150)*(l+8388608)}e.readFloatLE=n.bind(null,m2),e.readFloatBE=n.bind(null,g2)}(),typeof Float64Array<"u"?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=n[7]===128;function i(u,l,c){t[0]=u,l[c]=n[0],l[c+1]=n[1],l[c+2]=n[2],l[c+3]=n[3],l[c+4]=n[4],l[c+5]=n[5],l[c+6]=n[6],l[c+7]=n[7]}function a(u,l,c){t[0]=u,l[c]=n[7],l[c+1]=n[6],l[c+2]=n[5],l[c+3]=n[4],l[c+4]=n[3],l[c+5]=n[2],l[c+6]=n[1],l[c+7]=n[0]}e.writeDoubleLE=r?i:a,e.writeDoubleBE=r?a:i;function o(u,l){return n[0]=u[l],n[1]=u[l+1],n[2]=u[l+2],n[3]=u[l+3],n[4]=u[l+4],n[5]=u[l+5],n[6]=u[l+6],n[7]=u[l+7],t[0]}function s(u,l){return n[7]=u[l],n[6]=u[l+1],n[5]=u[l+2],n[4]=u[l+3],n[3]=u[l+4],n[2]=u[l+5],n[1]=u[l+6],n[0]=u[l+7],t[0]}e.readDoubleLE=r?o:s,e.readDoubleBE=r?s:o}():function(){function t(r,i,a,o,s,u){var l=o<0?1:0;if(l&&(o=-o),o===0)r(0,s,u+i),r(1/o>0?0:2147483648,s,u+a);else if(isNaN(o))r(0,s,u+i),r(2146959360,s,u+a);else if(o>17976931348623157e292)r(0,s,u+i),r((l<<31|2146435072)>>>0,s,u+a);else{var c;if(o<22250738585072014e-324)c=o/5e-324,r(c>>>0,s,u+i),r((l<<31|c/4294967296)>>>0,s,u+a);else{var d=Math.floor(Math.log(o)/Math.LN2);d===1024&&(d=1023),c=o*Math.pow(2,-d),r(c*4503599627370496>>>0,s,u+i),r((l<<31|d+1023<<20|c*1048576&1048575)>>>0,s,u+a)}}}e.writeDoubleLE=t.bind(null,h2,0,4),e.writeDoubleBE=t.bind(null,p2,4,0);function n(r,i,a,o,s){var u=r(o,s+i),l=r(o,s+a),c=(l>>31)*2+1,d=l>>>20&2047,f=4294967296*(l&1048575)+u;return d===2047?f?NaN:c*(1/0):d===0?c*5e-324*f:c*Math.pow(2,d-1075)*(f+4503599627370496)}e.readDoubleLE=n.bind(null,m2,0,4),e.readDoubleBE=n.bind(null,g2,4,0)}(),e}function h2(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function p2(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=e&255}function m2(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function g2(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}});var UT=m((exports,module)=>{"use strict";module.exports=inquire;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}});var b2=m(S2=>{"use strict";var qT=S2;qT.length=function(t){for(var n=0,r=0,i=0;i<t.length;++i)r=t.charCodeAt(i),r<128?n+=1:r<2048?n+=2:(r&64512)===55296&&(t.charCodeAt(i+1)&64512)===56320?(++i,n+=4):n+=3;return n};qT.read=function(t,n,r){var i=r-n;if(i<1)return"";for(var a=null,o=[],s=0,u;n<r;)u=t[n++],u<128?o[s++]=u:u>191&&u<224?o[s++]=(u&31)<<6|t[n++]&63:u>239&&u<365?(u=((u&7)<<18|(t[n++]&63)<<12|(t[n++]&63)<<6|t[n++]&63)-65536,o[s++]=55296+(u>>10),o[s++]=56320+(u&1023)):o[s++]=(u&15)<<12|(t[n++]&63)<<6|t[n++]&63,s>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,o)),s=0);return a?(s&&a.push(String.fromCharCode.apply(String,o.slice(0,s))),a.join("")):String.fromCharCode.apply(String,o.slice(0,s))};qT.write=function(t,n,r){for(var i=r,a,o,s=0;s<t.length;++s)a=t.charCodeAt(s),a<128?n[r++]=a:a<2048?(n[r++]=a>>6|192,n[r++]=a&63|128):(a&64512)===55296&&((o=t.charCodeAt(s+1))&64512)===56320?(a=65536+((a&1023)<<10)+(o&1023),++s,n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=a&63|128):(n[r++]=a>>12|224,n[r++]=a>>6&63|128,n[r++]=a&63|128);return r-i}});var E2=m((Rbe,T2)=>{"use strict";T2.exports=qW;function qW(e,t,n){var r=n||8192,i=r>>>1,a=null,o=r;return function(u){if(u<1||u>i)return e(u);o+u>r&&(a=e(r),o=0);var l=t.call(a,o,o+=u);return o&7&&(o=(o|7)+1),l}}});var k2=m((Pbe,C2)=>{"use strict";C2.exports=qt;var yh=Di();function qt(e,t){this.lo=e>>>0,this.hi=t>>>0}var ks=qt.zero=new qt(0,0);ks.toNumber=function(){return 0};ks.zzEncode=ks.zzDecode=function(){return this};ks.length=function(){return 1};var VW=qt.zeroHash="\0\0\0\0\0\0\0\0";qt.fromNumber=function(t){if(t===0)return ks;var n=t<0;n&&(t=-t);var r=t>>>0,i=(t-r)/4294967296>>>0;return n&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new qt(r,i)};qt.from=function(t){if(typeof t=="number")return qt.fromNumber(t);if(yh.isString(t))if(yh.Long)t=yh.Long.fromString(t);else return qt.fromNumber(parseInt(t,10));return t.low||t.high?new qt(t.low>>>0,t.high>>>0):ks};qt.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var n=~this.lo+1>>>0,r=~this.hi>>>0;return n||(r=r+1>>>0),-(n+r*4294967296)}return this.lo+this.hi*4294967296};qt.prototype.toLong=function(t){return yh.Long?new yh.Long(this.lo|0,this.hi|0,!!t):{low:this.lo|0,high:this.hi|0,unsigned:!!t}};var ja=String.prototype.charCodeAt;qt.fromHash=function(t){return t===VW?ks:new qt((ja.call(t,0)|ja.call(t,1)<<8|ja.call(t,2)<<16|ja.call(t,3)<<24)>>>0,(ja.call(t,4)|ja.call(t,5)<<8|ja.call(t,6)<<16|ja.call(t,7)<<24)>>>0)};qt.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};qt.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this};qt.prototype.zzDecode=function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this};qt.prototype.length=function(){var t=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return r===0?n===0?t<16384?t<128?1:2:t<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:r<128?9:10}});var Di=m(VT=>{"use strict";var oe=VT;oe.asPromise=FT();oe.base64=l2();oe.EventEmitter=d2();oe.float=v2();oe.inquire=UT();oe.utf8=b2();oe.pool=E2();oe.LongBits=k2();oe.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);oe.global=oe.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||VT;oe.emptyArray=Object.freeze?Object.freeze([]):[];oe.emptyObject=Object.freeze?Object.freeze({}):{};oe.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};oe.isString=function(t){return typeof t=="string"||t instanceof String};oe.isObject=function(t){return t&&typeof t=="object"};oe.isset=oe.isSet=function(t,n){var r=t[n];return r!=null&&t.hasOwnProperty(n)?typeof r!="object"||(Array.isArray(r)?r.length:Object.keys(r).length)>0:!1};oe.Buffer=function(){try{var e=oe.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch{return null}}();oe._Buffer_from=null;oe._Buffer_allocUnsafe=null;oe.newBuffer=function(t){return typeof t=="number"?oe.Buffer?oe._Buffer_allocUnsafe(t):new oe.Array(t):oe.Buffer?oe._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)};oe.Array=typeof Uint8Array<"u"?Uint8Array:Array;oe.Long=oe.global.dcodeIO&&oe.global.dcodeIO.Long||oe.global.Long||oe.inquire("long");oe.key2Re=/^true|false|0|1$/;oe.key32Re=/^-?(?:0|[1-9][0-9]*)$/;oe.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;oe.longToHash=function(t){return t?oe.LongBits.from(t).toHash():oe.LongBits.zeroHash};oe.longFromHash=function(t,n){var r=oe.LongBits.fromHash(t);return oe.Long?oe.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)};function _2(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)(e[r[i]]===void 0||!n)&&(e[r[i]]=t[r[i]]);return e}oe.merge=_2;oe.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)};function A2(e){function t(n,r){if(!(this instanceof t))return new t(n,r);Object.defineProperty(this,"message",{get:function(){return n}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:new Error().stack||""}),r&&_2(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}oe.newError=A2;oe.ProtocolError=A2("ProtocolError");oe.oneOfGetter=function(t){for(var n={},r=0;r<t.length;++r)n[t[r]]=1;return function(){for(var i=Object.keys(this),a=i.length-1;a>-1;--a)if(n[i[a]]===1&&this[i[a]]!==void 0&&this[i[a]]!==null)return i[a]}};oe.oneOfSetter=function(t){return function(n){for(var r=0;r<t.length;++r)t[r]!==n&&delete this[t[r]]}};oe.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};oe._configure=function(){var e=oe.Buffer;if(!e){oe._Buffer_from=oe._Buffer_allocUnsafe=null;return}oe._Buffer_from=e.from!==Uint8Array.from&&e.from||function(n,r){return new e(n,r)},oe._Buffer_allocUnsafe=e.allocUnsafe||function(n){return new e(n)}}});var Im=m((xbe,R2)=>{"use strict";R2.exports=Pe;var Sr=Di(),JT,Nm=Sr.LongBits,N2=Sr.base64,I2=Sr.utf8;function vh(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function HT(){}function JW(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function Pe(){this.len=0,this.head=new vh(HT,0,0),this.tail=this.head,this.states=null}var O2=function(){return Sr.Buffer?function(){return(Pe.create=function(){return new JT})()}:function(){return new Pe}};Pe.create=O2();Pe.alloc=function(t){return new Sr.Array(t)};Sr.Array!==Array&&(Pe.alloc=Sr.pool(Pe.alloc,Sr.Array.prototype.subarray));Pe.prototype._push=function(t,n,r){return this.tail=this.tail.next=new vh(t,n,r),this.len+=n,this};function GT(e,t,n){t[n]=e&255}function WW(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function zT(e,t){this.len=e,this.next=void 0,this.val=t}zT.prototype=Object.create(vh.prototype);zT.prototype.fn=WW;Pe.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new zT((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};Pe.prototype.int32=function(t){return t<0?this._push(QT,10,Nm.fromNumber(t)):this.uint32(t)};Pe.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)};function QT(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo=e.lo>>>7;t[n++]=e.lo}Pe.prototype.uint64=function(t){var n=Nm.from(t);return this._push(QT,n.length(),n)};Pe.prototype.int64=Pe.prototype.uint64;Pe.prototype.sint64=function(t){var n=Nm.from(t).zzEncode();return this._push(QT,n.length(),n)};Pe.prototype.bool=function(t){return this._push(GT,1,t?1:0)};function WT(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}Pe.prototype.fixed32=function(t){return this._push(WT,4,t>>>0)};Pe.prototype.sfixed32=Pe.prototype.fixed32;Pe.prototype.fixed64=function(t){var n=Nm.from(t);return this._push(WT,4,n.lo)._push(WT,4,n.hi)};Pe.prototype.sfixed64=Pe.prototype.fixed64;Pe.prototype.float=function(t){return this._push(Sr.float.writeFloatLE,4,t)};Pe.prototype.double=function(t){return this._push(Sr.float.writeDoubleLE,8,t)};var HW=Sr.Array.prototype.set?function(t,n,r){n.set(t,r)}:function(t,n,r){for(var i=0;i<t.length;++i)n[r+i]=t[i]};Pe.prototype.bytes=function(t){var n=t.length>>>0;if(!n)return this._push(GT,1,0);if(Sr.isString(t)){var r=Pe.alloc(n=N2.length(t));N2.decode(t,r,0),t=r}return this.uint32(n)._push(HW,n,t)};Pe.prototype.string=function(t){var n=I2.length(t);return n?this.uint32(n)._push(I2.write,n,t):this._push(GT,1,0)};Pe.prototype.fork=function(){return this.states=new JW(this),this.head=this.tail=new vh(HT,0,0),this.len=0,this};Pe.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 vh(HT,0,0),this.len=0),this};Pe.prototype.ldelim=function(){var t=this.head,n=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=t.next,this.tail=n,this.len+=r),this};Pe.prototype.finish=function(){for(var t=this.head.next,n=this.constructor.alloc(this.len),r=0;t;)t.fn(t.val,n,r),r+=t.len,t=t.next;return n};Pe._configure=function(e){JT=e,Pe.create=O2(),JT._configure()}});var x2=m((Bbe,w2)=>{"use strict";w2.exports=Mi;var P2=Im();(Mi.prototype=Object.create(P2.prototype)).constructor=Mi;var eo=Di();function Mi(){P2.call(this)}Mi._configure=function(){Mi.alloc=eo._Buffer_allocUnsafe,Mi.writeBytesBuffer=eo.Buffer&&eo.Buffer.prototype instanceof Uint8Array&&eo.Buffer.prototype.set.name==="set"?function(t,n,r){n.set(t,r)}:function(t,n,r){if(t.copy)t.copy(n,r,0,t.length);else for(var i=0;i<t.length;)n[r++]=t[i++]}};Mi.prototype.bytes=function(t){eo.isString(t)&&(t=eo._Buffer_from(t,"base64"));var n=t.length>>>0;return this.uint32(n),n&&this._push(Mi.writeBytesBuffer,n,t),this};function GW(e,t,n){e.length<40?eo.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}Mi.prototype.string=function(t){var n=eo.Buffer.byteLength(t);return this.uint32(n),n&&this._push(GW,n,t),this};Mi._configure()});var Rm=m((Dbe,F2)=>{"use strict";F2.exports=yt;var Hr=Di(),ZT,M2=Hr.LongBits,zW=Hr.utf8;function Gr(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function yt(e){this.buf=e,this.pos=0,this.len=e.length}var B2=typeof Uint8Array<"u"?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new yt(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new yt(t);throw Error("illegal buffer")},L2=function(){return Hr.Buffer?function(n){return(yt.create=function(i){return Hr.Buffer.isBuffer(i)?new ZT(i):B2(i)})(n)}:B2};yt.create=L2();yt.prototype._slice=Hr.Array.prototype.subarray||Hr.Array.prototype.slice;yt.prototype.uint32=function(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,Gr(this,10);return t}}();yt.prototype.int32=function(){return this.uint32()|0};yt.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(t&1)|0};function KT(){var e=new M2(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw Gr(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw Gr(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}yt.prototype.bool=function(){return this.uint32()!==0};function Om(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}yt.prototype.fixed32=function(){if(this.pos+4>this.len)throw Gr(this,4);return Om(this.buf,this.pos+=4)};yt.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Gr(this,4);return Om(this.buf,this.pos+=4)|0};function D2(){if(this.pos+8>this.len)throw Gr(this,8);return new M2(Om(this.buf,this.pos+=4),Om(this.buf,this.pos+=4))}yt.prototype.float=function(){if(this.pos+4>this.len)throw Gr(this,4);var t=Hr.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};yt.prototype.double=function(){if(this.pos+8>this.len)throw Gr(this,4);var t=Hr.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};yt.prototype.bytes=function(){var t=this.uint32(),n=this.pos,r=this.pos+t;if(r>this.len)throw Gr(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(n,r);if(n===r){var i=Hr.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,n,r)};yt.prototype.string=function(){var t=this.bytes();return zW.read(t,0,t.length)};yt.prototype.skip=function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw Gr(this,t);this.pos+=t}else do if(this.pos>=this.len)throw Gr(this);while(this.buf[this.pos++]&128);return this};yt.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(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this};yt._configure=function(e){ZT=e,yt.create=L2(),ZT._configure();var t=Hr.Long?"toLong":"toNumber";Hr.merge(yt.prototype,{int64:function(){return KT.call(this)[t](!1)},uint64:function(){return KT.call(this)[t](!0)},sint64:function(){return KT.call(this).zzDecode()[t](!1)},fixed64:function(){return D2.call(this)[t](!0)},sfixed64:function(){return D2.call(this)[t](!1)}})}});var J2=m((Mbe,V2)=>{"use strict";V2.exports=_s;var q2=Rm();(_s.prototype=Object.create(q2.prototype)).constructor=_s;var U2=Di();function _s(e){q2.call(this,e)}_s._configure=function(){U2.Buffer&&(_s.prototype._slice=U2.Buffer.prototype.slice)};_s.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};_s._configure()});var H2=m((Lbe,W2)=>{"use strict";W2.exports=Sh;var YT=Di();(Sh.prototype=Object.create(YT.EventEmitter.prototype)).constructor=Sh;function Sh(e,t,n){if(typeof e!="function")throw TypeError("rpcImpl must be a function");YT.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!n}Sh.prototype.rpcCall=function e(t,n,r,i,a){if(!i)throw TypeError("request must be specified");var o=this;if(!a)return YT.asPromise(e,o,t,n,r,i);if(!o.rpcImpl){setTimeout(function(){a(Error("already ended"))},0);return}try{return o.rpcImpl(t,n[o.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(u,l){if(u)return o.emit("error",u,t),a(u);if(l===null){o.end(!0);return}if(!(l instanceof r))try{l=r[o.responseDelimited?"decodeDelimited":"decode"](l)}catch(c){return o.emit("error",c,t),a(c)}return o.emit("data",l,t),a(null,l)})}catch(s){o.emit("error",s,t),setTimeout(function(){a(s)},0);return}};Sh.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var XT=m(G2=>{"use strict";var QW=G2;QW.Service=H2()});var $T=m((Ube,z2)=>{"use strict";z2.exports={}});var jT=m(K2=>{"use strict";var qn=K2;qn.build="minimal";qn.Writer=Im();qn.BufferWriter=x2();qn.Reader=Rm();qn.BufferReader=J2();qn.util=Di();qn.rpc=XT();qn.roots=$T();qn.configure=Q2;function Q2(){qn.util._configure(),qn.Writer._configure(qn.BufferWriter),qn.Reader._configure(qn.BufferReader)}Q2()});var Nn=m((Vbe,Z2)=>{"use strict";Z2.exports=jT()});var Ie=m(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=kr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=kr.Propagate=kr.LogVerbosity=kr.Status=void 0;var Pw;(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"})(Pw||(kr.Status=Pw={}));var ww;(function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.ERROR=2]="ERROR",e[e.NONE=3]="NONE"})(ww||(kr.LogVerbosity=ww={}));var xw;(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"})(xw||(kr.Propagate=xw={}));kr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;kr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var SE=m((qTe,L5)=>{L5.exports={name:"@grpc/grpc-js",version:"1.12.2",description:"gRPC Library for Node - pure JS implementation",homepage:"https://grpc.io/",repository:"https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",main:"build/src/index.js",engines:{node:">=12.10.0"},keywords:[],author:{name:"Google Inc."},types:"build/src/index.d.ts",license:"Apache-2.0",devDependencies:{"@grpc/proto-loader":"file:../proto-loader","@types/gulp":"^4.0.17","@types/gulp-mocha":"0.0.37","@types/lodash":"^4.14.202","@types/mocha":"^10.0.6","@types/ncp":"^2.0.8","@types/node":">=20.11.20","@types/pify":"^5.0.4","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0","@typescript-eslint/typescript-estree":"^7.1.0","clang-format":"^1.8.0",eslint:"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^4.2.1",execa:"^2.0.3",gulp:"^4.0.2","gulp-mocha":"^6.0.0",lodash:"^4.17.21",madge:"^5.0.1","mocha-jenkins-reporter":"^0.4.1",ncp:"^2.0.0",pify:"^4.0.1",prettier:"^2.8.8",rimraf:"^3.0.2",semver:"^7.6.0","ts-node":"^10.9.2",typescript:"^5.3.3"},contributors:[{name:"Google Inc."}],scripts:{build:"npm run compile",clean:"rimraf ./build",compile:"tsc -p .",format:'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',lint:"eslint src/*.ts test/*.ts",prepare:"npm run generate-types && npm run compile",test:"gulp test",check:"npm run lint",fix:"eslint --fix src/*.ts test/*.ts",pretest:"npm run generate-types && npm run generate-test-types && npm run compile",posttest:"npm run check && madge -c ./build/src","generate-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto","generate-test-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto"},dependencies:{"@grpc/proto-loader":"^0.7.13","@js-sdsl/ordered-map":"^4.4.2"},files:["src/**/*.ts","build/src/**/*.{js,d.ts,js.map}","proto/*.proto","LICENSE","deps/envoy-api/envoy/api/v2/**/*.proto","deps/envoy-api/envoy/config/**/*.proto","deps/envoy-api/envoy/service/**/*.proto","deps/envoy-api/envoy/type/**/*.proto","deps/udpa/udpa/**/*.proto","deps/googleapis/google/api/*.proto","deps/googleapis/google/rpc/*.proto","deps/protoc-gen-validate/validate/**/*.proto"]}});var ut=m(On=>{"use strict";var bE,TE,EE,CE;Object.defineProperty(On,"__esModule",{value:!0});On.isTracerEnabled=On.trace=On.log=On.setLoggerVerbosity=On.setLogger=On.getLogger=void 0;var ro=Ie(),F5=xe("process"),U5=SE().version,q5={error:(e,...t)=>{console.error("E "+e,...t)},info:(e,...t)=>{console.error("I "+e,...t)},debug:(e,...t)=>{console.error("D "+e,...t)}},Bs=q5,td=ro.LogVerbosity.ERROR,V5=(TE=(bE=process.env.GRPC_NODE_VERBOSITY)!==null&&bE!==void 0?bE:process.env.GRPC_VERBOSITY)!==null&&TE!==void 0?TE:"";switch(V5.toUpperCase()){case"DEBUG":td=ro.LogVerbosity.DEBUG;break;case"INFO":td=ro.LogVerbosity.INFO;break;case"ERROR":td=ro.LogVerbosity.ERROR;break;case"NONE":td=ro.LogVerbosity.NONE;break;default:}var J5=()=>Bs;On.getLogger=J5;var W5=e=>{Bs=e};On.setLogger=W5;var H5=e=>{td=e};On.setLoggerVerbosity=H5;var G5=(e,...t)=>{let n;if(e>=td){switch(e){case ro.LogVerbosity.DEBUG:n=Bs.debug;break;case ro.LogVerbosity.INFO:n=Bs.info;break;case ro.LogVerbosity.ERROR:n=Bs.error;break}n||(n=Bs.error),n&&n.bind(Bs)(...t)}};On.log=G5;var z5=(CE=(EE=process.env.GRPC_NODE_TRACE)!==null&&EE!==void 0?EE:process.env.GRPC_TRACE)!==null&&CE!==void 0?CE:"",kE=new Set,Bw=new Set;for(let e of z5.split(","))e.startsWith("-")?Bw.add(e.substring(1)):kE.add(e);var Q5=kE.has("all");function K5(e,t,n){Dw(t)&&(0,On.log)(e,new Date().toISOString()+" | v"+U5+" "+F5.pid+" | "+t+" | "+n)}On.trace=K5;function Dw(e){return!Bw.has(e)&&(Q5||kE.has(e))}On.isTracerEnabled=Dw});var Bm=m(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.getErrorCode=nd.getErrorMessage=void 0;function Z5(e){return e instanceof Error?e.message:String(e)}nd.getErrorMessage=Z5;function Y5(e){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="number"?e.code:null}nd.getErrorCode=Y5});var Sn=m(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});Mm.Metadata=void 0;var X5=ut(),$5=Ie(),j5=Bm(),eH=/^[0-9a-z_.-]+$/,tH=/^[ -~]*$/;function nH(e){return eH.test(e)}function rH(e){return tH.test(e)}function Lw(e){return e.endsWith("-bin")}function iH(e){return!e.startsWith("grpc-")}function Dm(e){return e.toLowerCase()}function Mw(e,t){if(!nH(e))throw new Error('Metadata key "'+e+'" contains illegal characters');if(t!=null)if(Lw(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(!rH(t))throw new Error('Metadata string value "'+t+'" contains illegal characters')}}var _E=class e{constructor(t={}){this.internalRepr=new Map,this.options=t}set(t,n){t=Dm(t),Mw(t,n),this.internalRepr.set(t,[n])}add(t,n){t=Dm(t),Mw(t,n);let r=this.internalRepr.get(t);r===void 0?this.internalRepr.set(t,[n]):r.push(n)}remove(t){t=Dm(t),this.internalRepr.delete(t)}get(t){return t=Dm(t),this.internalRepr.get(t)||[]}getMap(){let t={};for(let[n,r]of this.internalRepr)if(r.length>0){let i=r[0];t[n]=Buffer.isBuffer(i)?Buffer.from(i):i}return t}clone(){let t=new e(this.options),n=t.internalRepr;for(let[r,i]of this.internalRepr){let a=i.map(o=>Buffer.isBuffer(o)?Buffer.from(o):o);n.set(r,a)}return t}merge(t){for(let[n,r]of t.internalRepr){let i=(this.internalRepr.get(n)||[]).concat(r);this.internalRepr.set(n,i)}}setOptions(t){this.options=t}getOptions(){return this.options}toHttp2Headers(){let t={};for(let[n,r]of this.internalRepr)t[n]=r.map(aH);return t}toJSON(){let t={};for(let[n,r]of this.internalRepr)t[n]=r;return t}static fromHttp2Headers(t){let n=new e;for(let r of Object.keys(t)){if(r.charAt(0)===":")continue;let i=t[r];try{Lw(r)?Array.isArray(i)?i.forEach(a=>{n.add(r,Buffer.from(a,"base64"))}):i!==void 0&&(iH(r)?i.split(",").forEach(a=>{n.add(r,Buffer.from(a.trim(),"base64"))}):n.add(r,Buffer.from(i,"base64"))):Array.isArray(i)?i.forEach(a=>{n.add(r,a)}):i!==void 0&&n.add(r,i)}catch(a){let o=`Failed to add metadata entry ${r}: ${i}. ${(0,j5.getErrorMessage)(a)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,X5.log)($5.LogVerbosity.ERROR,o)}}return n}};Mm.Metadata=_E;var aH=e=>Buffer.isBuffer(e)?e.toString("base64"):e});var RE=m(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});Lm.CallCredentials=void 0;var OE=Sn();function oH(e){return"getRequestHeaders"in e&&typeof e.getRequestHeaders=="function"}var rd=class e{static createFromMetadataGenerator(t){return new NE(t)}static createFromGoogleCredential(t){return e.createFromMetadataGenerator((n,r)=>{let i;oH(t)?i=t.getRequestHeaders(n.service_url):i=new Promise((a,o)=>{t.getRequestMetadata(n.service_url,(s,u)=>{if(s){o(s);return}if(!u){o(new Error("Headers not set by metadata plugin"));return}a(u)})}),i.then(a=>{let o=new OE.Metadata;for(let s of Object.keys(a))o.add(s,a[s]);r(null,o)},a=>{r(a)})})}static createEmpty(){return new IE}};Lm.CallCredentials=rd;var AE=class e extends rd{constructor(t){super(),this.creds=t}async generateMetadata(t){let n=new OE.Metadata,r=await Promise.all(this.creds.map(i=>i.generateMetadata(t)));for(let i of r)n.merge(i);return n}compose(t){return new e(this.creds.concat([t]))}_equals(t){return this===t?!0:t instanceof e?this.creds.every((n,r)=>n._equals(t.creds[r])):!1}},NE=class e extends rd{constructor(t){super(),this.metadataGenerator=t}generateMetadata(t){return new Promise((n,r)=>{this.metadataGenerator(t,(i,a)=>{a!==void 0?n(a):r(i)})})}compose(t){return new AE([this,t])}_equals(t){return this===t?!0:t instanceof e?this.metadataGenerator===t.metadataGenerator:!1}},IE=class e extends rd{generateMetadata(t){return Promise.resolve(new OE.Metadata)}compose(t){return t}_equals(t){return t instanceof e}}});var wE=m(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.getDefaultRootsData=id.CIPHER_SUITES=void 0;var sH=xe("fs");id.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var Fw=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,PE=null;function uH(){return Fw?(PE===null&&(PE=sH.readFileSync(Fw)),PE):null}id.getDefaultRootsData=uH});var Th=m(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.createCertificateProviderChannelCredentials=ad.ChannelCredentials=void 0;var Uw=xe("tls"),lH=RE(),BE=wE();function xE(e,t){if(e&&!(e instanceof Buffer))throw new TypeError(`${t}, if provided, must be a Buffer.`)}var Ds=class{constructor(t){this.callCredentials=t||lH.CallCredentials.createEmpty()}_getCallCredentials(){return this.callCredentials}_ref(){}_unref(){}static createSsl(t,n,r,i){var a;if(xE(t,"Root certificate"),xE(n,"Private key"),xE(r,"Certificate chain"),n&&!r)throw new Error("Private key must be given with accompanying certificate chain");if(!n&&r)throw new Error("Certificate chain must be given with accompanying private key");let o=(0,Uw.createSecureContext)({ca:(a=t??(0,BE.getDefaultRootsData)())!==null&&a!==void 0?a:void 0,key:n??void 0,cert:r??void 0,ciphers:BE.CIPHER_SUITES});return new Fm(o,i??{})}static createFromSecureContext(t,n){return new Fm(t,n??{})}static createInsecure(){return new DE}};ad.ChannelCredentials=Ds;var DE=class e extends Ds{constructor(){super()}compose(t){throw new Error("Cannot compose insecure credentials")}_getConnectionOptions(){return{}}_isSecure(){return!1}_equals(t){return t instanceof e}},Fm=class e extends Ds{constructor(t,n){super(),this.secureContext=t,this.verifyOptions=n,this.connectionOptions={secureContext:t},n?.checkServerIdentity&&(this.connectionOptions.checkServerIdentity=n.checkServerIdentity),n?.rejectUnauthorized!==void 0&&(this.connectionOptions.rejectUnauthorized=n.rejectUnauthorized)}compose(t){let n=this.callCredentials.compose(t);return new Um(this,n)}_getConnectionOptions(){return Object.assign({},this.connectionOptions)}_isSecure(){return!0}_equals(t){return this===t?!0:t instanceof e?this.secureContext===t.secureContext&&this.verifyOptions.checkServerIdentity===t.verifyOptions.checkServerIdentity:!1}},ME=class e extends Ds{constructor(t,n,r){super(),this.caCertificateProvider=t,this.identityCertificateProvider=n,this.verifyOptions=r,this.refcount=0,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}compose(t){let n=this.callCredentials.compose(t);return new Um(this,n)}_getConnectionOptions(){var t,n,r;if(this.latestCaUpdate===null||this.identityCertificateProvider!==null&&this.latestIdentityUpdate===null)return null;let a={secureContext:(0,Uw.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(t=this.latestIdentityUpdate)===null||t===void 0?void 0:t.privateKey,cert:(n=this.latestIdentityUpdate)===null||n===void 0?void 0:n.certificate,ciphers:BE.CIPHER_SUITES})};return!((r=this.verifyOptions)===null||r===void 0)&&r.checkServerIdentity&&(a.checkServerIdentity=this.verifyOptions.checkServerIdentity),a}_isSecure(){return!0}_equals(t){var n,r;return this===t?!0:t instanceof e?this.caCertificateProvider===t.caCertificateProvider&&this.identityCertificateProvider===t.identityCertificateProvider&&((n=this.verifyOptions)===null||n===void 0?void 0:n.checkServerIdentity)===((r=t.verifyOptions)===null||r===void 0?void 0:r.checkServerIdentity):!1}_ref(){var t;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(t=this.identityCertificateProvider)===null||t===void 0||t.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}_unref(){var t;this.refcount-=1,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(t=this.identityCertificateProvider)===null||t===void 0||t.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}handleCaCertificateUpdate(t){this.latestCaUpdate=t}handleIdentityCertitificateUpdate(t){this.latestIdentityUpdate=t}};function cH(e,t,n){return new ME(e,t,n??null)}ad.createCertificateProviderChannelCredentials=cH;var Um=class e extends Ds{constructor(t,n){if(super(n),this.channelCredentials=t,!t._isSecure())throw new Error("Cannot compose insecure credentials")}compose(t){let n=this.callCredentials.compose(t);return new e(this.channelCredentials,n)}_getConnectionOptions(){return this.channelCredentials._getConnectionOptions()}_isSecure(){return!0}_equals(t){return this===t?!0:t instanceof e?this.channelCredentials._equals(t.channelCredentials)&&this.callCredentials._equals(t.callCredentials):!1}}});var Ms=m(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.selectLbConfigFromList=Wt.getDefaultConfig=Wt.parseLoadBalancingConfig=Wt.isLoadBalancerNameRegistered=Wt.createLoadBalancer=Wt.registerDefaultLoadBalancerType=Wt.registerLoadBalancerType=Wt.createChildChannelControlHelper=void 0;var dH=ut(),fH=Ie();function hH(e,t){var n,r,i,a,o,s,u,l,c,d;return{createSubchannel:(r=(n=t.createSubchannel)===null||n===void 0?void 0:n.bind(t))!==null&&r!==void 0?r:e.createSubchannel.bind(e),updateState:(a=(i=t.updateState)===null||i===void 0?void 0:i.bind(t))!==null&&a!==void 0?a:e.updateState.bind(e),requestReresolution:(s=(o=t.requestReresolution)===null||o===void 0?void 0:o.bind(t))!==null&&s!==void 0?s:e.requestReresolution.bind(e),addChannelzChild:(l=(u=t.addChannelzChild)===null||u===void 0?void 0:u.bind(t))!==null&&l!==void 0?l:e.addChannelzChild.bind(e),removeChannelzChild:(d=(c=t.removeChannelzChild)===null||c===void 0?void 0:c.bind(t))!==null&&d!==void 0?d:e.removeChannelzChild.bind(e)}}Wt.createChildChannelControlHelper=hH;var io={},Eh=null;function pH(e,t,n){io[e]={LoadBalancer:t,LoadBalancingConfig:n}}Wt.registerLoadBalancerType=pH;function mH(e){Eh=e}Wt.registerDefaultLoadBalancerType=mH;function gH(e,t,n,r){let i=e.getLoadBalancerName();return i in io?new io[i].LoadBalancer(t,n,r):null}Wt.createLoadBalancer=gH;function yH(e){return e in io}Wt.isLoadBalancerNameRegistered=yH;function qw(e){let t=Object.keys(e);if(t.length!==1)throw new Error("Provided load balancing config has multiple conflicting entries");let n=t[0];if(n in io)try{return io[n].LoadBalancingConfig.createFromJson(e[n])}catch(r){throw new Error(`${n}: ${r.message}`)}else throw new Error(`Unrecognized load balancing config name ${n}`)}Wt.parseLoadBalancingConfig=qw;function vH(){if(!Eh)throw new Error("No default load balancer type registered");return new io[Eh].LoadBalancingConfig}Wt.getDefaultConfig=vH;function SH(e,t=!1){for(let n of e)try{return qw(n)}catch(r){(0,dH.log)(fH.LogVerbosity.DEBUG,"Config parsing failed with error",r.message);continue}return t&&Eh?new io[Eh].LoadBalancingConfig:null}Wt.selectLbConfigFromList=SH});var LE=m(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.extractAndSelectServiceConfig=ao.validateServiceConfig=ao.validateRetryThrottling=void 0;var bH=xe("os"),qm=Ie(),Vm=/^\d+(\.\d{1,9})?s$/,TH="node";function EH(e){if("service"in e&&e.service!==""){if(typeof e.service!="string")throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof e.service}`);if("method"in e&&e.method!==""){if(typeof e.method!="string")throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof e.service}`);return{service:e.service,method:e.method}}else return{service:e.service}}else{if("method"in e&&e.method!==void 0)throw new Error("Invalid method config name: method set with empty or unset service");return{}}}function CH(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)||typeof e.initialBackoff!="string"||!Vm.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)||typeof e.maxBackoff!="string"||!Vm.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)||typeof e.backoffMultiplier!="number"||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(e.retryableStatusCodes.length===0)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let t of e.retryableStatusCodes)if(typeof t=="number"){if(!Object.values(qm.Status).includes(t))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof t=="string"){if(!Object.values(qm.Status).includes(t.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:e.maxAttempts,initialBackoff:e.initialBackoff,maxBackoff:e.maxBackoff,backoffMultiplier:e.backoffMultiplier,retryableStatusCodes:e.retryableStatusCodes}}function kH(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&&(typeof e.hedgingDelay!="string"||!Vm.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(let n of e.nonFatalStatusCodes)if(typeof n=="number"){if(!Object.values(qm.Status).includes(n))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof n=="string"){if(!Object.values(qm.Status).includes(n.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let t={maxAttempts:e.maxAttempts};return e.hedgingDelay&&(t.hedgingDelay=e.hedgingDelay),e.nonFatalStatusCodes&&(t.nonFatalStatusCodes=e.nonFatalStatusCodes),t}function _H(e){var t;let n={name:[]};if(!("name"in e)||!Array.isArray(e.name))throw new Error("Invalid method config: invalid name array");for(let r of e.name)n.name.push(EH(r));if("waitForReady"in e){if(typeof e.waitForReady!="boolean")throw new Error("Invalid method config: invalid waitForReady");n.waitForReady=e.waitForReady}if("timeout"in e)if(typeof e.timeout=="object"){if(!("seconds"in e.timeout)||typeof e.timeout.seconds!="number")throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in e.timeout)||typeof e.timeout.nanos!="number")throw new Error("Invalid method config: invalid timeout.nanos");n.timeout=e.timeout}else if(typeof e.timeout=="string"&&Vm.test(e.timeout)){let r=e.timeout.substring(0,e.timeout.length-1).split(".");n.timeout={seconds:r[0]|0,nanos:((t=r[1])!==null&&t!==void 0?t:0)|0}}else throw new Error("Invalid method config: invalid timeout");if("maxRequestBytes"in e){if(typeof e.maxRequestBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");n.maxRequestBytes=e.maxRequestBytes}if("maxResponseBytes"in e){if(typeof e.maxResponseBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");n.maxResponseBytes=e.maxResponseBytes}if("retryPolicy"in e){if("hedgingPolicy"in e)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");n.retryPolicy=CH(e.retryPolicy)}else"hedgingPolicy"in e&&(n.hedgingPolicy=kH(e.hedgingPolicy));return n}function Vw(e){if(!("maxTokens"in e)||typeof e.maxTokens!="number"||e.maxTokens<=0||e.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in e)||typeof e.tokenRatio!="number"||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)}}ao.validateRetryThrottling=Vw;function AH(e){if(!(typeof e=="object"&&e!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof e}`);let t=Object.keys(e);if(t.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${t}`);if(t.length===0)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[t[0]]:e[t[0]]}}function Jw(e){let t={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in e)if(typeof e.loadBalancingPolicy=="string")t.loadBalancingPolicy=e.loadBalancingPolicy;else throw new Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in e)if(Array.isArray(e.loadBalancingConfig))for(let r of e.loadBalancingConfig)t.loadBalancingConfig.push(AH(r));else throw new Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in e&&Array.isArray(e.methodConfig))for(let r of e.methodConfig)t.methodConfig.push(_H(r));"retryThrottling"in e&&(t.retryThrottling=Vw(e.retryThrottling));let n=[];for(let r of t.methodConfig)for(let i of r.name){for(let a of n)if(i.service===a.service&&i.method===a.method)throw new Error(`Invalid service config: duplicate name ${i.service}/${i.method}`);n.push(i)}return t}ao.validateServiceConfig=Jw;function NH(e){if(!("serviceConfig"in e))throw new Error("Invalid service config choice: missing service config");let t={serviceConfig:Jw(e.serviceConfig)};if("clientLanguage"in e)if(Array.isArray(e.clientLanguage)){t.clientLanguage=[];for(let r of e.clientLanguage)if(typeof r=="string")t.clientLanguage.push(r);else throw new Error("Invalid service config choice: invalid clientLanguage")}else throw new Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in e)if(Array.isArray(e.clientHostname)){t.clientHostname=[];for(let r of e.clientHostname)if(typeof r=="string")t.clientHostname.push(r);else throw new Error("Invalid service config choice: invalid clientHostname")}else throw new Error("Invalid service config choice: invalid clientHostname");if("percentage"in e)if(typeof e.percentage=="number"&&0<=e.percentage&&e.percentage<=100)t.percentage=e.percentage;else throw new Error("Invalid service config choice: invalid percentage");let n=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let r in e)if(!n.includes(r))throw new Error(`Invalid service config choice: unexpected field ${r}`);return t}function IH(e,t){if(!Array.isArray(e))throw new Error("Invalid service config list");for(let n of e){let r=NH(n);if(!(typeof r.percentage=="number"&&t>r.percentage)){if(Array.isArray(r.clientHostname)){let i=!1;for(let a of r.clientHostname)a===bH.hostname()&&(i=!0);if(!i)continue}if(Array.isArray(r.clientLanguage)){let i=!1;for(let a of r.clientLanguage)a===TH&&(i=!0);if(!i)continue}return r.serviceConfig}}throw new Error("No matching service config found")}function OH(e,t){for(let n of e)if(n.length>0&&n[0].startsWith("grpc_config=")){let r=n.join("").substring(12),i=JSON.parse(r);return IH(i,t)}return null}ao.extractAndSelectServiceConfig=OH});var _r=m(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.ConnectivityState=void 0;var Ww;(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"})(Ww||(Jm.ConnectivityState=Ww={}))});var rr=m(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.uriToString=Ui.combineHostPort=Ui.splitHostPort=Ui.parseUri=void 0;var RH=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function PH(e){let t=RH.exec(e);return t===null?null:{scheme:t[1],authority:t[2],path:t[3]}}Ui.parseUri=PH;var Hw=/^\d+$/;function wH(e){if(e.startsWith("[")){let t=e.indexOf("]");if(t===-1)return null;let n=e.substring(1,t);if(n.indexOf(":")===-1)return null;if(e.length>t+1)if(e[t+1]===":"){let r=e.substring(t+2);return Hw.test(r)?{host:n,port:+r}:null}else return null;else return{host:n}}else{let t=e.split(":");return t.length===2?Hw.test(t[1])?{host:t[0],port:+t[1]}:null:{host:e}}}Ui.splitHostPort=wH;function xH(e){return e.port===void 0?e.host:e.host.includes(":")?`[${e.host}]:${e.port}`:`${e.host}:${e.port}`}Ui.combineHostPort=xH;function BH(e){let t="";return e.scheme!==void 0&&(t+=e.scheme+":"),e.authority!==void 0&&(t+="//"+e.authority+"/"),t+=e.path,t}Ui.uriToString=BH});var qi=m(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.mapUriDefaultScheme=Ar.getDefaultAuthority=Ar.createResolver=Ar.registerDefaultScheme=Ar.registerResolver=void 0;var UE=rr(),od={},FE=null;function DH(e,t){od[e]=t}Ar.registerResolver=DH;function MH(e){FE=e}Ar.registerDefaultScheme=MH;function LH(e,t,n){if(e.scheme!==void 0&&e.scheme in od)return new od[e.scheme](e,t,n);throw new Error(`No resolver could be created for target ${(0,UE.uriToString)(e)}`)}Ar.createResolver=LH;function FH(e){if(e.scheme!==void 0&&e.scheme in od)return od[e.scheme].getDefaultAuthority(e);throw new Error(`Invalid target ${(0,UE.uriToString)(e)}`)}Ar.getDefaultAuthority=FH;function UH(e){return e.scheme===void 0||!(e.scheme in od)?FE!==null?{scheme:FE,authority:void 0,path:(0,UE.uriToString)(e)}:null:e}Ar.mapUriDefaultScheme=UH});var so=m(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.QueuePicker=oo.UnavailablePicker=oo.PickResultType=void 0;var qH=Sn(),VH=Ie(),Wm;(function(e){e[e.COMPLETE=0]="COMPLETE",e[e.QUEUE=1]="QUEUE",e[e.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",e[e.DROP=3]="DROP"})(Wm||(oo.PickResultType=Wm={}));var qE=class{constructor(t){this.status=Object.assign({code:VH.Status.UNAVAILABLE,details:"No connection established",metadata:new qH.Metadata},t)}pick(t){return{pickResultType:Wm.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};oo.UnavailablePicker=qE;var VE=class{constructor(t,n){this.loadBalancer=t,this.childPicker=n,this.calledExitIdle=!1}pick(t){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(t):{pickResultType:Wm.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};oo.QueuePicker=VE});var Ch=m(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.BackoffTimeout=void 0;var JH=1e3,WH=1.6,HH=12e4,GH=.2;function zH(e,t){return Math.random()*(t-e)+e}var JE=class{constructor(t,n){this.callback=t,this.initialDelay=JH,this.multiplier=WH,this.maxDelay=HH,this.jitter=GH,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,n&&(n.initialDelay&&(this.initialDelay=n.initialDelay),n.multiplier&&(this.multiplier=n.multiplier),n.jitter&&(this.jitter=n.jitter),n.maxDelay&&(this.maxDelay=n.maxDelay)),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}runTimer(t){var n,r;this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.callback(),this.running=!1},t),this.hasRef||(r=(n=this.timerId).unref)===null||r===void 0||r.call(n)}runOnce(){this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let t=Math.min(this.nextDelay*this.multiplier,this.maxDelay),n=t*this.jitter;this.nextDelay=t+zH(-n,n)}stop(){clearTimeout(this.timerId),this.running=!1}reset(){if(this.nextDelay=this.initialDelay,this.running){let t=new Date,n=this.startTime;n.setMilliseconds(n.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),t<n?this.runTimer(n.getTime()-t.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var t,n;this.hasRef=!0,(n=(t=this.timerId).ref)===null||n===void 0||n.call(t)}unref(){var t,n;this.hasRef=!1,(n=(t=this.timerId).unref)===null||n===void 0||n.call(t)}getEndTime(){return this.endTime}};Hm.BackoffTimeout=JE});var zm=m(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});Gm.ChildLoadBalancerHandler=void 0;var QH=Ms(),KH=_r(),ZH="child_load_balancer_helper",WE=class{constructor(t,n,r){this.channelControlHelper=t,this.credentials=n,this.options=r,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(i){this.parent=i,this.child=null}createSubchannel(i,a,o){return this.parent.channelControlHelper.createSubchannel(i,a,o)}updateState(i,a){var o;if(this.calledByPendingChild()){if(i===KH.ConnectivityState.CONNECTING)return;(o=this.parent.currentChild)===null||o===void 0||o.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(i,a)}requestReresolution(){var i;let a=(i=this.parent.pendingChild)!==null&&i!==void 0?i:this.parent.currentChild;this.child===a&&this.parent.channelControlHelper.requestReresolution()}setChild(i){this.child=i}addChannelzChild(i){this.parent.channelControlHelper.addChannelzChild(i)}removeChannelzChild(i){this.parent.channelControlHelper.removeChannelzChild(i)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(t,n){return t.getLoadBalancerName()!==n.getLoadBalancerName()}updateAddressList(t,n,r){let i;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,n)){let a=new this.ChildPolicyHelper(this),o=(0,QH.createLoadBalancer)(n,a,this.credentials,this.options);a.setChild(o),this.currentChild===null?(this.currentChild=o,i=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=o,i=this.pendingChild)}else this.pendingChild===null?i=this.currentChild:i=this.pendingChild;this.latestConfig=n,i.updateAddressList(t,n,r)}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 ZH}};Gm.ChildLoadBalancerHandler=WE});var zw=m(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});Qm.ResolvingLoadBalancer=void 0;var YH=Ms(),XH=LE(),Jn=_r(),$H=qi(),kh=so(),jH=Ch(),HE=Ie(),eG=Sn(),tG=ut(),nG=Ie(),rG=rr(),iG=zm(),aG="resolving_load_balancer";function Gw(e){tG.trace(nG.LogVerbosity.DEBUG,aG,e)}var oG=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function sG(e,t,n,r){for(let i of n.name)switch(r){case"EMPTY":if(!i.service&&!i.method)return!0;break;case"SERVICE":if(i.service===e&&!i.method)return!0;break;case"SERVICE_AND_METHOD":if(i.service===e&&i.method===t)return!0}return!1}function uG(e,t,n,r){for(let i of n)if(sG(e,t,i,r))return i;return null}function lG(e){return function(n,r){var i,a;let o=n.split("/").filter(l=>l.length>0),s=(i=o[0])!==null&&i!==void 0?i:"",u=(a=o[1])!==null&&a!==void 0?a:"";if(e&&e.methodConfig)for(let l of oG){let c=uG(s,u,e.methodConfig,l);if(c)return{methodConfig:c,pickInformation:{},status:HE.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:HE.Status.OK,dynamicFilterFactories:[]}}}var GE=class{constructor(t,n,r,i,a,o){this.target=t,this.channelControlHelper=n,this.onSuccessfulResolution=a,this.onFailedResolution=o,this.latestChildState=Jn.ConnectivityState.IDLE,this.latestChildPicker=new kh.QueuePicker(this),this.currentState=Jn.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,i["grpc.service_config"]?this.defaultServiceConfig=(0,XH.validateServiceConfig)(JSON.parse(i["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(Jn.ConnectivityState.IDLE,new kh.QueuePicker(this)),this.childLoadBalancer=new iG.ChildLoadBalancerHandler({createSubchannel:n.createSubchannel.bind(n),requestReresolution:()=>{this.backoffTimeout.isRunning()?(Gw("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(u,l)=>{this.latestChildState=u,this.latestChildPicker=l,this.updateState(u,l)},addChannelzChild:n.addChannelzChild.bind(n),removeChannelzChild:n.removeChannelzChild.bind(n)},r,i),this.innerResolver=(0,$H.createResolver)(t,{onSuccessfulResolution:(u,l,c,d,f)=>{var h;this.backoffTimeout.stop(),this.backoffTimeout.reset();let g=null;l===null?c===null?(this.previousServiceConfig=null,g=this.defaultServiceConfig):this.previousServiceConfig===null?this.handleResolutionFailure(c):g=this.previousServiceConfig:(g=l,this.previousServiceConfig=l);let p=(h=g?.loadBalancingConfig)!==null&&h!==void 0?h:[],b=(0,YH.selectLbConfigFromList)(p,!0);if(b===null){this.handleResolutionFailure({code:HE.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new eG.Metadata});return}this.childLoadBalancer.updateAddressList(u,b,f);let v=g??this.defaultServiceConfig;this.onSuccessfulResolution(v,d??lG(v))},onError:u=>{this.handleResolutionFailure(u)}},i);let s={initialDelay:i["grpc.initial_reconnect_backoff_ms"],maxDelay:i["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new jH.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker)},s),this.backoffTimeout.unref()}updateResolution(){this.innerResolver.updateResolution(),this.currentState===Jn.ConnectivityState.IDLE&&this.updateState(Jn.ConnectivityState.CONNECTING,this.latestChildPicker),this.backoffTimeout.runOnce()}updateState(t,n){Gw((0,rG.uriToString)(this.target)+" "+Jn.ConnectivityState[this.currentState]+" -> "+Jn.ConnectivityState[t]),t===Jn.ConnectivityState.IDLE&&(n=new kh.QueuePicker(this,n)),this.currentState=t,this.channelControlHelper.updateState(t,n)}handleResolutionFailure(t){this.latestChildState===Jn.ConnectivityState.IDLE&&(this.updateState(Jn.ConnectivityState.TRANSIENT_FAILURE,new kh.UnavailablePicker(t)),this.onFailedResolution(t))}exitIdle(){(this.currentState===Jn.ConnectivityState.IDLE||this.currentState===Jn.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(t,n){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=Jn.ConnectivityState.IDLE,this.latestChildPicker=new kh.QueuePicker(this),this.currentState=Jn.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}};Qm.ResolvingLoadBalancer=GE});var Qw=m(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.channelOptionsEqual=sd.recognizedOptions=void 0;sd.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};function cG(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1)if(n[i]!==r[i]||e[n[i]]!==t[r[i]])return!1;return!0}sd.channelOptionsEqual=cG});var Nr=m(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.EndpointMap=Ht.endpointHasAddress=Ht.endpointToString=Ht.endpointEqual=Ht.stringToSubchannelAddress=Ht.subchannelAddressToString=Ht.subchannelAddressEqual=Ht.isTcpSubchannelAddress=void 0;var Kw=xe("net");function Ah(e){return"port"in e}Ht.isTcpSubchannelAddress=Ah;function Km(e,t){return!e&&!t?!0:!e||!t?!1:Ah(e)?Ah(t)&&e.host===t.host&&e.port===t.port:!Ah(t)&&e.path===t.path}Ht.subchannelAddressEqual=Km;function Zw(e){return Ah(e)?(0,Kw.isIPv6)(e.host)?"["+e.host+"]:"+e.port:e.host+":"+e.port:e.path}Ht.subchannelAddressToString=Zw;var dG=443;function fG(e,t){return(0,Kw.isIP)(e)?{host:e,port:t??dG}:{path:e}}Ht.stringToSubchannelAddress=fG;function hG(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(let n=0;n<e.addresses.length;n++)if(!Km(e.addresses[n],t.addresses[n]))return!1;return!0}Ht.endpointEqual=hG;function pG(e){return"["+e.addresses.map(Zw).join(", ")+"]"}Ht.endpointToString=pG;function Yw(e,t){for(let n of e.addresses)if(Km(n,t))return!0;return!1}Ht.endpointHasAddress=Yw;function _h(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(let n of e.addresses){let r=!1;for(let i of t.addresses)if(Km(n,i)){r=!0;break}if(!r)return!1}return!0}var zE=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(t){for(let n of this.map)if(Yw(n.key,t))return n.value}deleteMissing(t){let n=[];for(let r of this.map){let i=!1;for(let a of t)_h(a,r.key)&&(i=!0);i||(n.push(r.value),this.map.delete(r))}return n}get(t){for(let n of this.map)if(_h(t,n.key))return n.value}set(t,n){for(let r of this.map)if(_h(t,r.key)){r.value=n;return}this.map.add({key:t,value:n})}delete(t){for(let n of this.map)if(_h(t,n.key)){this.map.delete(n);return}}has(t){for(let n of this.map)if(_h(t,n.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let t of this.map)yield t.key}*values(){for(let t of this.map)yield t.value}*entries(){for(let t of this.map)yield[t.key,t.value]}};Ht.EndpointMap=zE});var $w={};gh($w,{OrderedMap:()=>EG});function ud(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");QE(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function mG(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Ls(){throw new RangeError("Iterator access denied!")}var QE,Xw,gG,yG,vG,SG,bG,TG,Ea,EG,jw=re(()=>{"use strict";QE=function(e,t){return QE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},QE(e,t)};Xw=function(){function e(t,n,r){r===void 0&&(r=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=t,this.o=n,this.l=r}return e.prototype.v=function(){var t=this,n=t.h.h===t;if(n&&t.l===1)t=t.i;else if(t.t)for(t=t.t;t.i;)t=t.i;else{if(n)return t.h;for(var r=t.h;r.t===t;)t=r,r=t.h;t=r}return t},e.prototype.p=function(){var t=this;if(t.i){for(t=t.i;t.t;)t=t.t;return t}else{for(var n=t.h;n.i===t;)t=n,n=t.h;return t.i!==n?n:t}},e.prototype.T=function(){var t=this.h,n=this.i,r=n.t;return t.h===this?t.h=n:t.t===this?t.t=n:t.i=n,n.h=t,n.t=this,this.h=n,this.i=r,r&&(r.h=this),n},e.prototype.I=function(){var t=this.h,n=this.t,r=n.i;return t.h===this?t.h=n:t.t===this?t.t=n:t.i=n,n.h=t,n.i=this,this.h=n,this.t=r,r&&(r.h=this),n},e}(),gG=function(e){ud(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.O=1,n}return t.prototype.T=function(){var n=e.prototype.T.call(this);return this.M(),n.M(),n},t.prototype.I=function(){var n=e.prototype.I.call(this);return this.M(),n.M(),n},t.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},t}(Xw),yG=function(){function e(t){t===void 0&&(t=0),this.iteratorType=t}return e.prototype.equals=function(t){return this.C===t.C},e}(),vG=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 this._===0},e}(),SG=function(e){ud(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(vG);bG=function(e){ud(t,e);function t(n,r){n===void 0&&(n=function(a,o){return a<o?-1:a>o?1:0}),r===void 0&&(r=!1);var i=e.call(this)||this;return i.N=void 0,i.g=n,i.enableIndex=r,i.S=r?gG:Xw,i.A=new i.S,i}return t.prototype.m=function(n,r){for(var i=this.A;n;){var a=this.g(n.u,r);if(a<0)n=n.i;else if(a>0)i=n,n=n.t;else return n}return i},t.prototype.B=function(n,r){for(var i=this.A;n;){var a=this.g(n.u,r);a<=0?n=n.i:(i=n,n=n.t)}return i},t.prototype.j=function(n,r){for(var i=this.A;n;){var a=this.g(n.u,r);if(a<0)i=n,n=n.i;else if(a>0)n=n.t;else return n}return i},t.prototype.k=function(n,r){for(var i=this.A;n;){var a=this.g(n.u,r);a<0?(i=n,n=n.i):n=n.t}return i},t.prototype.R=function(n){for(;;){var r=n.h;if(r===this.A)return;if(n.l===1){n.l=0;return}if(n===r.t){var i=r.i;if(i.l===1)i.l=0,r.l=1,r===this.N?this.N=r.T():r.T();else if(i.i&&i.i.l===1){i.l=r.l,r.l=0,i.i.l=0,r===this.N?this.N=r.T():r.T();return}else i.t&&i.t.l===1?(i.l=1,i.t.l=0,i.I()):(i.l=1,n=r)}else{var i=r.t;if(i.l===1)i.l=0,r.l=1,r===this.N?this.N=r.I():r.I();else if(i.t&&i.t.l===1){i.l=r.l,r.l=0,i.t.l=0,r===this.N?this.N=r.I():r.I();return}else i.i&&i.i.l===1?(i.l=1,i.i.l=0,i.T()):(i.l=1,n=r)}}},t.prototype.G=function(n){if(this._===1){this.clear();return}for(var r=n;r.t||r.i;){if(r.i)for(r=r.i;r.t;)r=r.t;else r=r.t;var i=n.u;n.u=r.u,r.u=i;var a=n.o;n.o=r.o,r.o=a,n=r}this.A.t===r?this.A.t=r.h:this.A.i===r&&(this.A.i=r.h),this.R(r);var o=r.h;if(r===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},t.prototype.P=function(n){for(var r=typeof n=="number"?n:void 0,i=typeof n=="function"?n:void 0,a=typeof n>"u"?[]:void 0,o=0,s=this.N,u=[];u.length||s;)if(s)u.push(s),s=s.t;else{if(s=u.pop(),o===r)return s;a&&a.push(s),i&&i(s,o,this),o+=1,s=s.i}return a},t.prototype.q=function(n){for(;;){var r=n.h;if(r.l===0)return;var i=r.h;if(r===i.t){var a=i.i;if(a&&a.l===1){if(a.l=r.l=0,i===this.N)return;i.l=1,n=i;continue}else if(n===r.i){if(n.l=0,n.t&&(n.t.h=r),n.i&&(n.i.h=i),r.i=n.t,i.t=n.i,n.t=r,n.i=i,i===this.N)this.N=n,this.A.h=n;else{var o=i.h;o.t===i?o.t=n:o.i=n}n.h=i.h,r.h=n,i.h=n,i.l=1}else{r.l=0,i===this.N?this.N=i.I():i.I(),i.l=1;return}}else{var a=i.t;if(a&&a.l===1){if(a.l=r.l=0,i===this.N)return;i.l=1,n=i;continue}else if(n===r.t){if(n.l=0,n.t&&(n.t.h=i),n.i&&(n.i.h=r),i.i=n.t,r.t=n.i,n.t=i,n.i=r,i===this.N)this.N=n,this.A.h=n;else{var o=i.h;o.t===i?o.t=n:o.i=n}n.h=i.h,r.h=n,i.h=n,i.l=1}else{r.l=0,i===this.N?this.N=i.T():i.T(),i.l=1;return}}this.enableIndex&&(r.M(),i.M(),n.M());return}},t.prototype.D=function(n,r,i){if(this.N===void 0)return this._+=1,this.N=new this.S(n,r,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var a,o=this.A.t,s=this.g(o.u,n);if(s===0)return o.o=r,this._;if(s>0)o.t=new this.S(n,r),o.t.h=o,a=o.t,this.A.t=a;else{var u=this.A.i,l=this.g(u.u,n);if(l===0)return u.o=r,this._;if(l<0)u.i=new this.S(n,r),u.i.h=u,a=u.i,this.A.i=a;else{if(i!==void 0){var c=i.C;if(c!==this.A){var d=this.g(c.u,n);if(d===0)return c.o=r,this._;if(d>0){var f=c.v(),h=this.g(f.u,n);if(h===0)return f.o=r,this._;h<0&&(a=new this.S(n,r),f.i===void 0?(f.i=a,a.h=f):(c.t=a,a.h=c))}}}if(a===void 0)for(a=this.N;;){var g=this.g(a.u,n);if(g>0){if(a.t===void 0){a.t=new this.S(n,r),a.t.h=a,a=a.t;break}a=a.t}else if(g<0){if(a.i===void 0){a.i=new this.S(n,r),a.i.h=a,a=a.i;break}a=a.i}else return a.o=r,this._}}}if(this.enableIndex)for(var p=a.h;p!==this.A;)p.O+=1,p=p.h;return this.q(a),this._+=1,this._},t.prototype.F=function(n,r){for(;n;){var i=this.g(n.u,r);if(i<0)n=n.i;else if(i>0)n=n.t;else return n}return n||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(n,r){var i=n.C;if(i===this.A&&Ls(),this._===1)return i.u=r,!0;var a=i.p().u;if(i===this.A.t)return this.g(a,r)>0?(i.u=r,!0):!1;var o=i.v().u;return i===this.A.i?this.g(o,r)<0?(i.u=r,!0):!1:this.g(o,r)>=0||this.g(a,r)<=0?!1:(i.u=r,!0)},t.prototype.eraseElementByPos=function(n){if(n<0||n>this._-1)throw new RangeError;var r=this.P(n);return this.G(r),this._},t.prototype.eraseElementByKey=function(n){if(this._===0)return!1;var r=this.F(this.N,n);return r===this.A?!1:(this.G(r),!0)},t.prototype.eraseElementByIterator=function(n){var r=n.C;r===this.A&&Ls();var i=r.i===void 0,a=n.iteratorType===0;return a?i&&n.next():(!i||r.t===void 0)&&n.next(),this.G(r),n},t.prototype.getHeight=function(){if(this._===0)return 0;function n(r){return r?Math.max(n(r.t),n(r.i))+1:0}return n(this.N)},t}(SG),TG=function(e){ud(t,e);function t(n,r,i){var a=e.call(this,i)||this;return a.C=n,a.A=r,a.iteratorType===0?(a.pre=function(){return this.C===this.A.t&&Ls(),this.C=this.C.v(),this},a.next=function(){return this.C===this.A&&Ls(),this.C=this.C.p(),this}):(a.pre=function(){return this.C===this.A.i&&Ls(),this.C=this.C.p(),this},a.next=function(){return this.C===this.A&&Ls(),this.C=this.C.v(),this}),a}return Object.defineProperty(t.prototype,"index",{get:function(){var n=this.C,r=this.A.h;if(n===this.A)return r?r.O-1:0;var i=0;for(n.t&&(i+=n.t.O);n!==r;){var a=n.h;n===a.i&&(i+=1,a.t&&(i+=a.t.O)),n=a}return i},enumerable:!1,configurable:!0}),t.prototype.isAccessible=function(){return this.C!==this.A},t}(yG),Ea=function(e){ud(t,e);function t(n,r,i,a){var o=e.call(this,n,r,a)||this;return o.container=i,o}return Object.defineProperty(t.prototype,"pointer",{get:function(){this.C===this.A&&Ls();var n=this;return new Proxy([],{get:function(r,i){return i==="0"?n.C.u:i==="1"?n.C.o:(r[0]=n.C.u,r[1]=n.C.o,r[i])},set:function(r,i,a){if(i!=="1")throw new TypeError("prop must be 1");return n.C.o=a,!0}})},enumerable:!1,configurable:!0}),t.prototype.copy=function(){return new t(this.C,this.A,this.container,this.iteratorType)},t}(TG),EG=function(e){ud(t,e);function t(n,r,i){n===void 0&&(n=[]);var a=e.call(this,r,i)||this,o=a;return n.forEach(function(s){o.setElement(s[0],s[1])}),a}return t.prototype.begin=function(){return new Ea(this.A.t||this.A,this.A,this)},t.prototype.end=function(){return new Ea(this.A,this.A,this)},t.prototype.rBegin=function(){return new Ea(this.A.i||this.A,this.A,this,1)},t.prototype.rEnd=function(){return new Ea(this.A,this.A,this,1)},t.prototype.front=function(){if(this._!==0){var n=this.A.t;return[n.u,n.o]}},t.prototype.back=function(){if(this._!==0){var n=this.A.i;return[n.u,n.o]}},t.prototype.lowerBound=function(n){var r=this.m(this.N,n);return new Ea(r,this.A,this)},t.prototype.upperBound=function(n){var r=this.B(this.N,n);return new Ea(r,this.A,this)},t.prototype.reverseLowerBound=function(n){var r=this.j(this.N,n);return new Ea(r,this.A,this)},t.prototype.reverseUpperBound=function(n){var r=this.k(this.N,n);return new Ea(r,this.A,this)},t.prototype.forEach=function(n){this.P(function(r,i,a){n([r.u,r.o],i,a)})},t.prototype.setElement=function(n,r,i){return this.D(n,r,i)},t.prototype.getElementByPos=function(n){if(n<0||n>this._-1)throw new RangeError;var r=this.P(n);return[r.u,r.o]},t.prototype.find=function(n){var r=this.F(this.N,n);return new Ea(r,this.A,this)},t.prototype.getElementByKey=function(n){var r=this.F(this.N,n);return r.o},t.prototype.union=function(n){var r=this;return n.forEach(function(i){r.setElement(i[0],i[1])}),this._},t.prototype[Symbol.iterator]=function(){var n,r,i,a;return mG(this,function(o){switch(o.label){case 0:n=this._,r=this.P(),i=0,o.label=1;case 1:return i<n?(a=r[i],[4,[a.u,a.o]]):[3,4];case 2:o.sent(),o.label=3;case 3:return++i,[3,1];case 4:return[2]}})},t}(bG)});var Zm=m(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.addAdminServicesToServer=ld.registerAdminService=void 0;var ex=[];function CG(e,t){ex.push({getServiceDefinition:e,getHandlers:t})}ld.registerAdminService=CG;function kG(e){for(let{getServiceDefinition:t,getHandlers:n}of ex)e.addService(t(),n())}ld.addAdminServicesToServer=kG});var tx=m(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.ClientDuplexStreamImpl=Ir.ClientWritableStreamImpl=Ir.ClientReadableStreamImpl=Ir.ClientUnaryCallImpl=Ir.callErrorFromStatus=void 0;var _G=xe("events"),$E=xe("stream"),Nh=Ie();function AG(e,t){let n=`${e.code} ${Nh.Status[e.code]}: ${e.details}`,i=`${new Error(n).stack}
3
- for call at
4
- ${t}`;return Object.assign(new Error(n),e,{stack:i})}Ir.callErrorFromStatus=AG;var KE=class extends _G.EventEmitter{constructor(){super()}cancel(){var t;(t=this.call)===null||t===void 0||t.cancelWithStatus(Nh.Status.CANCELLED,"Cancelled on client")}getPeer(){var t,n;return(n=(t=this.call)===null||t===void 0?void 0:t.getPeer())!==null&&n!==void 0?n:"unknown"}};Ir.ClientUnaryCallImpl=KE;var ZE=class extends $E.Readable{constructor(t){super({objectMode:!0}),this.deserialize=t}cancel(){var t;(t=this.call)===null||t===void 0||t.cancelWithStatus(Nh.Status.CANCELLED,"Cancelled on client")}getPeer(){var t,n;return(n=(t=this.call)===null||t===void 0?void 0:t.getPeer())!==null&&n!==void 0?n:"unknown"}_read(t){var n;(n=this.call)===null||n===void 0||n.startRead()}};Ir.ClientReadableStreamImpl=ZE;var YE=class extends $E.Writable{constructor(t){super({objectMode:!0}),this.serialize=t}cancel(){var t;(t=this.call)===null||t===void 0||t.cancelWithStatus(Nh.Status.CANCELLED,"Cancelled on client")}getPeer(){var t,n;return(n=(t=this.call)===null||t===void 0?void 0:t.getPeer())!==null&&n!==void 0?n:"unknown"}_write(t,n,r){var i;let a={callback:r},o=Number(n);Number.isNaN(o)||(a.flags=o),(i=this.call)===null||i===void 0||i.sendMessageWithContext(a,t)}_final(t){var n;(n=this.call)===null||n===void 0||n.halfClose(),t()}};Ir.ClientWritableStreamImpl=YE;var XE=class extends $E.Duplex{constructor(t,n){super({objectMode:!0}),this.serialize=t,this.deserialize=n}cancel(){var t;(t=this.call)===null||t===void 0||t.cancelWithStatus(Nh.Status.CANCELLED,"Cancelled on client")}getPeer(){var t,n;return(n=(t=this.call)===null||t===void 0?void 0:t.getPeer())!==null&&n!==void 0?n:"unknown"}_read(t){var n;(n=this.call)===null||n===void 0||n.startRead()}_write(t,n,r){var i;let a={callback:r},o=Number(n);Number.isNaN(o)||(a.flags=o),(i=this.call)===null||i===void 0||i.sendMessageWithContext(a,t)}_final(t){var n;(n=this.call)===null||n===void 0||n.halfClose(),t()}};Ir.ClientDuplexStreamImpl=XE});var nx=m(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});cd.InterceptingListenerImpl=cd.isInterceptingListener=void 0;function NG(e){return e.onReceiveMetadata!==void 0&&e.onReceiveMetadata.length===1}cd.isInterceptingListener=NG;var jE=class{constructor(t,n){this.listener=t,this.nextListener=n,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(t){this.processingMetadata=!0,this.listener.onReceiveMetadata(t,n=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(n),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(t){this.processingMessage=!0,this.listener.onReceiveMessage(t,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=n,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(n),this.processPendingStatus())})}onReceiveStatus(t){this.listener.onReceiveStatus(t,n=>{this.processingMetadata||this.processingMessage?this.pendingStatus=n:this.nextListener.onReceiveStatus(n)})}};cd.InterceptingListenerImpl=jE});var oC=m(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.getInterceptingCall=Or.InterceptingCall=Or.RequesterBuilder=Or.ListenerBuilder=Or.InterceptorConfigurationError=void 0;var IG=Sn(),rx=nx(),ix=Ie(),ax=Bm(),Oh=class e extends Error{constructor(t){super(t),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,e)}};Or.InterceptorConfigurationError=Oh;var tC=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(t){return this.metadata=t,this}withOnReceiveMessage(t){return this.message=t,this}withOnReceiveStatus(t){return this.status=t,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};Or.ListenerBuilder=tC;var nC=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(t){return this.start=t,this}withSendMessage(t){return this.message=t,this}withHalfClose(t){return this.halfClose=t,this}withCancel(t){return this.cancel=t,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};Or.RequesterBuilder=nC;var eC={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveStatus:(e,t)=>{t(e)}},Ih={start:(e,t,n)=>{n(e,t)},sendMessage:(e,t)=>{t(e)},halfClose:e=>{e()},cancel:e=>{e()}},rC=class{constructor(t,n){var r,i,a,o;this.nextCall=t,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,n?this.requester={start:(r=n.start)!==null&&r!==void 0?r:Ih.start,sendMessage:(i=n.sendMessage)!==null&&i!==void 0?i:Ih.sendMessage,halfClose:(a=n.halfClose)!==null&&a!==void 0?a:Ih.halfClose,cancel:(o=n.cancel)!==null&&o!==void 0?o:Ih.cancel}:this.requester=Ih}cancelWithStatus(t,n){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(t,n)})}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(t,n){var r,i,a,o,s,u;let l={onReceiveMetadata:(i=(r=n?.onReceiveMetadata)===null||r===void 0?void 0:r.bind(n))!==null&&i!==void 0?i:c=>{},onReceiveMessage:(o=(a=n?.onReceiveMessage)===null||a===void 0?void 0:a.bind(n))!==null&&o!==void 0?o:c=>{},onReceiveStatus:(u=(s=n?.onReceiveStatus)===null||s===void 0?void 0:s.bind(n))!==null&&u!==void 0?u:c=>{}};this.processingMetadata=!0,this.requester.start(t,l,(c,d)=>{var f,h,g;this.processingMetadata=!1;let p;if((0,rx.isInterceptingListener)(d))p=d;else{let b={onReceiveMetadata:(f=d.onReceiveMetadata)!==null&&f!==void 0?f:eC.onReceiveMetadata,onReceiveMessage:(h=d.onReceiveMessage)!==null&&h!==void 0?h:eC.onReceiveMessage,onReceiveStatus:(g=d.onReceiveStatus)!==null&&g!==void 0?g:eC.onReceiveStatus};p=new rx.InterceptingListenerImpl(b,l)}this.nextCall.start(c,p),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(t,n){this.processingMessage=!0,this.requester.sendMessage(n,r=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=t,this.pendingMessage=n):(this.nextCall.sendMessageWithContext(t,r),this.processPendingHalfClose())})}sendMessage(t){this.sendMessageWithContext({},t)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}};Or.InterceptingCall=rC;function OG(e,t,n){var r,i;let a=(r=n.deadline)!==null&&r!==void 0?r:1/0,o=n.host,s=(i=n.parent)!==null&&i!==void 0?i:null,u=n.propagate_flags,l=n.credentials,c=e.createCall(t,a,o,s,u);return l&&c.setCredentials(l),c}var Ym=class{constructor(t,n){this.call=t,this.methodDefinition=n}cancelWithStatus(t,n){this.call.cancelWithStatus(t,n)}getPeer(){return this.call.getPeer()}sendMessageWithContext(t,n){let r;try{r=this.methodDefinition.requestSerialize(n)}catch(i){this.call.cancelWithStatus(ix.Status.INTERNAL,`Request message serialization failure: ${(0,ax.getErrorMessage)(i)}`);return}this.call.sendMessageWithContext(t,r)}sendMessage(t){this.sendMessageWithContext({},t)}start(t,n){let r=null;this.call.start(t,{onReceiveMetadata:i=>{var a;(a=n?.onReceiveMetadata)===null||a===void 0||a.call(n,i)},onReceiveMessage:i=>{var a;let o;try{o=this.methodDefinition.responseDeserialize(i)}catch(s){r={code:ix.Status.INTERNAL,details:`Response message parsing error: ${(0,ax.getErrorMessage)(s)}`,metadata:new IG.Metadata},this.call.cancelWithStatus(r.code,r.details);return}(a=n?.onReceiveMessage)===null||a===void 0||a.call(n,o)},onReceiveStatus:i=>{var a,o;r?(a=n?.onReceiveStatus)===null||a===void 0||a.call(n,r):(o=n?.onReceiveStatus)===null||o===void 0||o.call(n,i)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}},iC=class extends Ym{constructor(t,n){super(t,n)}start(t,n){var r,i;let a=!1,o={onReceiveMetadata:(i=(r=n?.onReceiveMetadata)===null||r===void 0?void 0:r.bind(n))!==null&&i!==void 0?i:s=>{},onReceiveMessage:s=>{var u;a=!0,(u=n?.onReceiveMessage)===null||u===void 0||u.call(n,s)},onReceiveStatus:s=>{var u,l;a||(u=n?.onReceiveMessage)===null||u===void 0||u.call(n,null),(l=n?.onReceiveStatus)===null||l===void 0||l.call(n,s)}};super.start(t,o),this.call.startRead()}},aC=class extends Ym{};function RG(e,t,n){let r=OG(e,n.path,t);return n.responseStream?new aC(r,n):new iC(r,n)}function PG(e,t,n,r){if(e.clientInterceptors.length>0&&e.clientInterceptorProviders.length>0)throw new Oh("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 Oh("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let i=[];e.callInterceptors.length>0||e.callInterceptorProviders.length>0?i=[].concat(e.callInterceptors,e.callInterceptorProviders.map(s=>s(t))).filter(s=>s):i=[].concat(e.clientInterceptors,e.clientInterceptorProviders.map(s=>s(t))).filter(s=>s);let a=Object.assign({},n,{method_definition:t});return i.reduceRight((s,u)=>l=>u(l,s),s=>RG(r,s,t))(a)}Or.getInterceptingCall=PG});var lC=m($m=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});$m.Client=void 0;var Vi=tx(),wG=cC(),xG=_r(),uo=Ie(),dd=Sn(),Xm=oC(),gi=Symbol(),fd=Symbol(),hd=Symbol(),Ca=Symbol();function sC(e){return typeof e=="function"}function pd(e){var t;return((t=e.stack)===null||t===void 0?void 0:t.split(`
5
- `).slice(1).join(`
6
- `))||"no stack trace available"}var uC=class{constructor(t,n,r={}){var i,a;if(r=Object.assign({},r),this[fd]=(i=r.interceptors)!==null&&i!==void 0?i:[],delete r.interceptors,this[hd]=(a=r.interceptor_providers)!==null&&a!==void 0?a:[],delete r.interceptor_providers,this[fd].length>0&&this[hd].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[Ca]=r.callInvocationTransformer,delete r.callInvocationTransformer,r.channelOverride)this[gi]=r.channelOverride;else if(r.channelFactoryOverride){let o=r.channelFactoryOverride;delete r.channelFactoryOverride,this[gi]=o(t,n,r)}else this[gi]=new wG.ChannelImplementation(t,n,r)}close(){this[gi].close()}getChannel(){return this[gi]}waitForReady(t,n){let r=i=>{if(i){n(new Error("Failed to connect before the deadline"));return}let a;try{a=this[gi].getConnectivityState(!0)}catch{n(new Error("The channel has been closed"));return}if(a===xG.ConnectivityState.READY)n();else try{this[gi].watchConnectivityState(a,t,r)}catch{n(new Error("The channel has been closed"))}};setImmediate(r)}checkOptionalUnaryResponseArguments(t,n,r){if(sC(t))return{metadata:new dd.Metadata,options:{},callback:t};if(sC(n))return t instanceof dd.Metadata?{metadata:t,options:{},callback:n}:{metadata:new dd.Metadata,options:t,callback:n};if(!(t instanceof dd.Metadata&&n instanceof Object&&sC(r)))throw new Error("Incorrect arguments passed");return{metadata:t,options:n,callback:r}}makeUnaryRequest(t,n,r,i,a,o,s){var u,l;let c=this.checkOptionalUnaryResponseArguments(a,o,s),d={path:t,requestStream:!1,responseStream:!1,requestSerialize:n,responseDeserialize:r},f={argument:i,metadata:c.metadata,call:new Vi.ClientUnaryCallImpl,channel:this[gi],methodDefinition:d,callOptions:c.options,callback:c.callback};this[Ca]&&(f=this[Ca](f));let h=f.call,g={clientInterceptors:this[fd],clientInterceptorProviders:this[hd],callInterceptors:(u=f.callOptions.interceptors)!==null&&u!==void 0?u:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},p=(0,Xm.getInterceptingCall)(g,f.methodDefinition,f.callOptions,f.channel);h.call=p;let b=null,v=!1,C=new Error;return p.start(f.metadata,{onReceiveMetadata:N=>{h.emit("metadata",N)},onReceiveMessage(N){b!==null&&p.cancelWithStatus(uo.Status.UNIMPLEMENTED,"Too many responses received"),b=N},onReceiveStatus(N){if(!v){if(v=!0,N.code===uo.Status.OK)if(b===null){let I=pd(C);f.callback((0,Vi.callErrorFromStatus)({code:uo.Status.UNIMPLEMENTED,details:"No message received",metadata:N.metadata},I))}else f.callback(null,b);else{let I=pd(C);f.callback((0,Vi.callErrorFromStatus)(N,I))}C=null,h.emit("status",N)}}}),p.sendMessage(i),p.halfClose(),h}makeClientStreamRequest(t,n,r,i,a,o){var s,u;let l=this.checkOptionalUnaryResponseArguments(i,a,o),c={path:t,requestStream:!0,responseStream:!1,requestSerialize:n,responseDeserialize:r},d={metadata:l.metadata,call:new Vi.ClientWritableStreamImpl(n),channel:this[gi],methodDefinition:c,callOptions:l.options,callback:l.callback};this[Ca]&&(d=this[Ca](d));let f=d.call,h={clientInterceptors:this[fd],clientInterceptorProviders:this[hd],callInterceptors:(s=d.callOptions.interceptors)!==null&&s!==void 0?s:[],callInterceptorProviders:(u=d.callOptions.interceptor_providers)!==null&&u!==void 0?u:[]},g=(0,Xm.getInterceptingCall)(h,d.methodDefinition,d.callOptions,d.channel);f.call=g;let p=null,b=!1,v=new Error;return g.start(d.metadata,{onReceiveMetadata:C=>{f.emit("metadata",C)},onReceiveMessage(C){p!==null&&g.cancelWithStatus(uo.Status.UNIMPLEMENTED,"Too many responses received"),p=C,g.startRead()},onReceiveStatus(C){if(!b){if(b=!0,C.code===uo.Status.OK)if(p===null){let N=pd(v);d.callback((0,Vi.callErrorFromStatus)({code:uo.Status.UNIMPLEMENTED,details:"No message received",metadata:C.metadata},N))}else d.callback(null,p);else{let N=pd(v);d.callback((0,Vi.callErrorFromStatus)(C,N))}v=null,f.emit("status",C)}}}),f}checkMetadataAndOptions(t,n){let r,i;return t instanceof dd.Metadata?(r=t,n?i=n:i={}):(t?i=t:i={},r=new dd.Metadata),{metadata:r,options:i}}makeServerStreamRequest(t,n,r,i,a,o){var s,u;let l=this.checkMetadataAndOptions(a,o),c={path:t,requestStream:!1,responseStream:!0,requestSerialize:n,responseDeserialize:r},d={argument:i,metadata:l.metadata,call:new Vi.ClientReadableStreamImpl(r),channel:this[gi],methodDefinition:c,callOptions:l.options};this[Ca]&&(d=this[Ca](d));let f=d.call,h={clientInterceptors:this[fd],clientInterceptorProviders:this[hd],callInterceptors:(s=d.callOptions.interceptors)!==null&&s!==void 0?s:[],callInterceptorProviders:(u=d.callOptions.interceptor_providers)!==null&&u!==void 0?u:[]},g=(0,Xm.getInterceptingCall)(h,d.methodDefinition,d.callOptions,d.channel);f.call=g;let p=!1,b=new Error;return g.start(d.metadata,{onReceiveMetadata(v){f.emit("metadata",v)},onReceiveMessage(v){f.push(v)},onReceiveStatus(v){if(!p){if(p=!0,f.push(null),v.code!==uo.Status.OK){let C=pd(b);f.emit("error",(0,Vi.callErrorFromStatus)(v,C))}b=null,f.emit("status",v)}}}),g.sendMessage(i),g.halfClose(),f}makeBidiStreamRequest(t,n,r,i,a){var o,s;let u=this.checkMetadataAndOptions(i,a),l={path:t,requestStream:!0,responseStream:!0,requestSerialize:n,responseDeserialize:r},c={metadata:u.metadata,call:new Vi.ClientDuplexStreamImpl(n,r),channel:this[gi],methodDefinition:l,callOptions:u.options};this[Ca]&&(c=this[Ca](c));let d=c.call,f={clientInterceptors:this[fd],clientInterceptorProviders:this[hd],callInterceptors:(o=c.callOptions.interceptors)!==null&&o!==void 0?o:[],callInterceptorProviders:(s=c.callOptions.interceptor_providers)!==null&&s!==void 0?s:[]},h=(0,Xm.getInterceptingCall)(f,c.methodDefinition,c.callOptions,c.channel);d.call=h;let g=!1,p=new Error;return h.start(c.metadata,{onReceiveMetadata(b){d.emit("metadata",b)},onReceiveMessage(b){d.push(b)},onReceiveStatus(b){if(!g){if(g=!0,d.push(null),b.code!==uo.Status.OK){let v=pd(p);d.emit("error",(0,Vi.callErrorFromStatus)(b,v))}p=null,d.emit("status",b)}}}),d}};$m.Client=uC});var fC=m(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.loadPackageDefinition=md.makeClientConstructor=void 0;var Rh=lC(),BG={unary:Rh.Client.prototype.makeUnaryRequest,server_stream:Rh.Client.prototype.makeServerStreamRequest,client_stream:Rh.Client.prototype.makeClientStreamRequest,bidi:Rh.Client.prototype.makeBidiStreamRequest};function dC(e){return["__proto__","prototype","constructor"].includes(e)}function ox(e,t,n){n||(n={});class r extends Rh.Client{}return Object.keys(e).forEach(i=>{if(dC(i))return;let a=e[i],o;if(typeof i=="string"&&i.charAt(0)==="$")throw new Error("Method names cannot start with $");a.requestStream?a.responseStream?o="bidi":o="client_stream":a.responseStream?o="server_stream":o="unary";let s=a.requestSerialize,u=a.responseDeserialize,l=DG(BG[o],a.path,s,u);r.prototype[i]=l,Object.assign(r.prototype[i],a),a.originalName&&!dC(a.originalName)&&(r.prototype[a.originalName]=r.prototype[i])}),r.service=e,r.serviceName=t,r}md.makeClientConstructor=ox;function DG(e,t,n,r){return function(...i){return e.call(this,t,n,r,...i)}}function MG(e){return"format"in e}function LG(e){let t={};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=e[n],i=n.split(".");if(i.some(s=>dC(s)))continue;let a=i[i.length-1],o=t;for(let s of i.slice(0,-1))o[s]||(o[s]={}),o=o[s];MG(r)?o[a]=r:o[a]=ox(r,a,{})}return t}md.loadPackageDefinition=LG});var Px=m((dEe,Rx)=>{"use strict";var FG=1/0,UG="[object Symbol]",qG=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,VG=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,eg="\\ud800-\\udfff",px="\\u0300-\\u036f\\ufe20-\\ufe23",mx="\\u20d0-\\u20f0",gx="\\u2700-\\u27bf",yx="a-z\\xdf-\\xf6\\xf8-\\xff",JG="\\xac\\xb1\\xd7\\xf7",WG="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",HG="\\u2000-\\u206f",GG=" \\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",vx="A-Z\\xc0-\\xd6\\xd8-\\xde",Sx="\\ufe0e\\ufe0f",bx=JG+WG+HG+GG,pC="['\u2019]",zG="["+eg+"]",sx="["+bx+"]",jm="["+px+mx+"]",Tx="\\d+",QG="["+gx+"]",Ex="["+yx+"]",Cx="[^"+eg+bx+Tx+gx+yx+vx+"]",hC="\\ud83c[\\udffb-\\udfff]",KG="(?:"+jm+"|"+hC+")",kx="[^"+eg+"]",mC="(?:\\ud83c[\\udde6-\\uddff]){2}",gC="[\\ud800-\\udbff][\\udc00-\\udfff]",gd="["+vx+"]",_x="\\u200d",ux="(?:"+Ex+"|"+Cx+")",ZG="(?:"+gd+"|"+Cx+")",lx="(?:"+pC+"(?:d|ll|m|re|s|t|ve))?",cx="(?:"+pC+"(?:D|LL|M|RE|S|T|VE))?",Ax=KG+"?",Nx="["+Sx+"]?",YG="(?:"+_x+"(?:"+[kx,mC,gC].join("|")+")"+Nx+Ax+")*",Ix=Nx+Ax+YG,XG="(?:"+[QG,mC,gC].join("|")+")"+Ix,$G="(?:"+[kx+jm+"?",jm,mC,gC,zG].join("|")+")",jG=RegExp(pC,"g"),e9=RegExp(jm,"g"),t9=RegExp(hC+"(?="+hC+")|"+$G+Ix,"g"),n9=RegExp([gd+"?"+Ex+"+"+lx+"(?="+[sx,gd,"$"].join("|")+")",ZG+"+"+cx+"(?="+[sx,gd+ux,"$"].join("|")+")",gd+"?"+ux+"+"+lx,gd+"+"+cx,Tx,XG].join("|"),"g"),r9=RegExp("["+_x+eg+px+mx+Sx+"]"),i9=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,a9={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},o9=typeof global=="object"&&global&&global.Object===Object&&global,s9=typeof self=="object"&&self&&self.Object===Object&&self,u9=o9||s9||Function("return this")();function l9(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function c9(e){return e.split("")}function d9(e){return e.match(qG)||[]}function f9(e){return function(t){return e?.[t]}}var h9=f9(a9);function Ox(e){return r9.test(e)}function p9(e){return i9.test(e)}function m9(e){return Ox(e)?g9(e):c9(e)}function g9(e){return e.match(t9)||[]}function y9(e){return e.match(n9)||[]}var v9=Object.prototype,S9=v9.toString,dx=u9.Symbol,fx=dx?dx.prototype:void 0,hx=fx?fx.toString:void 0;function b9(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function T9(e){if(typeof e=="string")return e;if(A9(e))return hx?hx.call(e):"";var t=e+"";return t=="0"&&1/e==-FG?"-0":t}function E9(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:b9(e,t,n)}function C9(e){return function(t){t=tg(t);var n=Ox(t)?m9(t):void 0,r=n?n[0]:t.charAt(0),i=n?E9(n,1).join(""):t.slice(1);return r[e]()+i}}function k9(e){return function(t){return l9(P9(O9(t).replace(jG,"")),e,"")}}function _9(e){return!!e&&typeof e=="object"}function A9(e){return typeof e=="symbol"||_9(e)&&S9.call(e)==UG}function tg(e){return e==null?"":T9(e)}var N9=k9(function(e,t,n){return t=t.toLowerCase(),e+(n?I9(t):t)});function I9(e){return R9(tg(e).toLowerCase())}function O9(e){return e=tg(e),e&&e.replace(VG,h9).replace(e9,"")}var R9=C9("toUpperCase");function P9(e,t,n){return e=tg(e),t=n?void 0:t,t===void 0?p9(e)?y9(e):d9(e):e.match(t)||[]}Rx.exports=N9});var xx=m((fEe,wx)=>{"use strict";wx.exports=yC;function yC(e,t){typeof e=="string"&&(t=e,e=void 0);var n=[];function r(a){if(typeof a!="string"){var o=i();if(yC.verbose&&console.log("codegen: "+o),o="return "+o,a){for(var s=Object.keys(a),u=new Array(s.length+1),l=new Array(s.length),c=0;c<s.length;)u[c]=s[c],l[c]=a[s[c++]];return u[c]=o,Function.apply(null,u).apply(null,l)}return Function(o)()}for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f]=arguments[++f];if(f=0,a=a.replace(/%([%dfijs])/g,function(g,p){var b=d[f++];switch(p){case"d":case"f":return String(Number(b));case"i":return String(Math.floor(b));case"j":return JSON.stringify(b);case"s":return String(b)}return"%"}),f!==d.length)throw Error("parameter count mismatch");return n.push(a),r}function i(a){return"function "+(a||t||"")+"("+(e&&e.join(",")||"")+`){
7
- `+n.join(`
8
- `)+`
9
- }`}return r.toString=i,r}yC.verbose=!1});var Dx=m((hEe,Bx)=>{"use strict";Bx.exports=Ph;var w9=FT(),x9=UT(),vC=x9("fs");function Ph(e,t,n){return typeof t=="function"?(n=t,t={}):t||(t={}),n?!t.xhr&&vC&&vC.readFile?vC.readFile(e,function(i,a){return i&&typeof XMLHttpRequest<"u"?Ph.xhr(e,t,n):i?n(i):n(null,t.binary?a:a.toString("utf8"))}):Ph.xhr(e,t,n):w9(Ph,this,e,t)}Ph.xhr=function(t,n,r){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(i.readyState===4){if(i.status!==0&&i.status!==200)return r(Error("status "+i.status));if(n.binary){var o=i.response;if(!o){o=[];for(var s=0;s<i.responseText.length;++s)o.push(i.responseText.charCodeAt(s)&255)}return r(null,typeof Uint8Array<"u"?new Uint8Array(o):o)}return r(null,i.responseText)}},n.binary&&("overrideMimeType"in i&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.responseType="arraybuffer"),i.open("GET",t),i.send()}});var Fx=m(Lx=>{"use strict";var bC=Lx,Mx=bC.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},SC=bC.normalize=function(t){t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var n=t.split("/"),r=Mx(t),i="";r&&(i=n.shift()+"/");for(var a=0;a<n.length;)n[a]===".."?a>0&&n[a-1]!==".."?n.splice(--a,2):r?n.splice(a,1):++a:n[a]==="."?n.splice(a,1):++a;return i+n.join("/")};bC.resolve=function(t,n,r){return r||(n=SC(n)),Mx(n)?n:(r||(t=SC(t)),(t=t.replace(/(?:\/|^)[^/]+$/,"")).length?SC(t+"/"+n):n)}});var Fs=m(Ux=>{"use strict";var wh=Ux,B9=Gt(),D9=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function xh(e,t){var n=0,r={};for(t|=0;n<e.length;)r[D9[n+t]]=e[n++];return r}wh.basic=xh([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);wh.defaults=xh([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",B9.emptyArray,null]);wh.long=xh([0,0,0,1,1],7);wh.mapKey=xh([0,0,0,5,5,0,0,0,1,1,0,2],2);wh.packed=xh([1,5,0,0,0,5,5,0,0,0,1,1,0])});var lo=m((gEe,Jx)=>{"use strict";Jx.exports=Rr;var ng=Us();((Rr.prototype=Object.create(ng.prototype)).constructor=Rr).className="Field";var qx=yi(),Vx=Fs(),It=Gt(),TC,M9=/^required|optional|repeated$/;Rr.fromJSON=function(t,n){return new Rr(t,n.id,n.type,n.rule,n.extend,n.options,n.comment)};function Rr(e,t,n,r,i,a,o){if(It.isObject(r)?(o=i,a=r,r=i=void 0):It.isObject(i)&&(o=a,a=i,i=void 0),ng.call(this,e,a),!It.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!It.isString(n))throw TypeError("type must be a string");if(r!==void 0&&!M9.test(r=r.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(i!==void 0&&!It.isString(i))throw TypeError("extend must be a string");r==="proto3_optional"&&(r="optional"),this.rule=r&&r!=="optional"?r:void 0,this.type=n,this.id=t,this.extend=i||void 0,this.required=r==="required",this.optional=!this.required,this.repeated=r==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=It.Long?Vx.long[n]!==void 0:!1,this.bytes=n==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=o}Object.defineProperty(Rr.prototype,"packed",{get:function(){return this._packed===null&&(this._packed=this.getOption("packed")!==!1),this._packed}});Rr.prototype.setOption=function(t,n,r){return t==="packed"&&(this._packed=null),ng.prototype.setOption.call(this,t,n,r)};Rr.prototype.toJSON=function(t){var n=t?!!t.keepComments:!1;return It.toObject(["rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",n?this.comment:void 0])};Rr.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=Vx.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof TC?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&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof qx&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&((this.options.packed===!0||this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof qx))&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=It.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var t;It.base64.test(this.typeDefault)?It.base64.decode(this.typeDefault,t=It.newBuffer(It.base64.length(this.typeDefault)),0):It.utf8.write(this.typeDefault,t=It.newBuffer(It.utf8.length(this.typeDefault)),0),this.typeDefault=t}return this.map?this.defaultValue=It.emptyObject:this.repeated?this.defaultValue=It.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof TC&&(this.parent.ctor.prototype[this.name]=this.defaultValue),ng.prototype.resolve.call(this)};Rr.d=function(t,n,r,i){return typeof n=="function"?n=It.decorateType(n).name:n&&typeof n=="object"&&(n=It.decorateEnum(n).name),function(o,s){It.decorateType(o.constructor).add(new Rr(s,t,n,r,{default:i}))}};Rr._configure=function(t){TC=t}});var yd=m((yEe,Gx)=>{"use strict";Gx.exports=Pr;var ig=Us();((Pr.prototype=Object.create(ig.prototype)).constructor=Pr).className="OneOf";var Wx=lo(),rg=Gt();function Pr(e,t,n,r){if(Array.isArray(t)||(n=t,t=void 0),ig.call(this,e,n),!(t===void 0||Array.isArray(t)))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=r}Pr.fromJSON=function(t,n){return new Pr(t,n.oneof,n.options,n.comment)};Pr.prototype.toJSON=function(t){var n=t?!!t.keepComments:!1;return rg.toObject(["options",this.options,"oneof",this.oneof,"comment",n?this.comment:void 0])};function Hx(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}Pr.prototype.add=function(t){if(!(t instanceof Wx))throw TypeError("field must be a Field");return t.parent&&t.parent!==this.parent&&t.parent.remove(t),this.oneof.push(t.name),this.fieldsArray.push(t),t.partOf=this,Hx(this),this};Pr.prototype.remove=function(t){if(!(t instanceof Wx))throw TypeError("field must be a Field");var n=this.fieldsArray.indexOf(t);if(n<0)throw Error(t+" is not a member of "+this);return this.fieldsArray.splice(n,1),n=this.oneof.indexOf(t.name),n>-1&&this.oneof.splice(n,1),t.partOf=null,this};Pr.prototype.onAdd=function(t){ig.prototype.onAdd.call(this,t);for(var n=this,r=0;r<this.oneof.length;++r){var i=t.get(this.oneof[r]);i&&!i.partOf&&(i.partOf=n,n.fieldsArray.push(i))}Hx(this)};Pr.prototype.onRemove=function(t){for(var n=0,r;n<this.fieldsArray.length;++n)(r=this.fieldsArray[n]).parent&&r.parent.remove(r);ig.prototype.onRemove.call(this,t)};Pr.d=function(){for(var t=new Array(arguments.length),n=0;n<arguments.length;)t[n]=arguments[n++];return function(i,a){rg.decorateType(i.constructor).add(new Pr(a,t)),Object.defineProperty(i,a,{get:rg.oneOfGetter(t),set:rg.oneOfSetter(t)})}}});var bd=m((vEe,Zx)=>{"use strict";Zx.exports=De;var EC=Us();((De.prototype=Object.create(EC.prototype)).constructor=De).className="Namespace";var zx=lo(),ag=Gt(),L9=yd(),vd,Bh,Sd;De.fromJSON=function(t,n){return new De(t,n.options).addJSON(n.nested)};function Qx(e,t){if(e&&e.length){for(var n={},r=0;r<e.length;++r)n[e[r].name]=e[r].toJSON(t);return n}}De.arrayToJSON=Qx;De.isReservedId=function(t,n){if(t){for(var r=0;r<t.length;++r)if(typeof t[r]!="string"&&t[r][0]<=n&&t[r][1]>n)return!0}return!1};De.isReservedName=function(t,n){if(t){for(var r=0;r<t.length;++r)if(t[r]===n)return!0}return!1};function De(e,t){EC.call(this,e,t),this.nested=void 0,this._nestedArray=null}function Kx(e){return e._nestedArray=null,e}Object.defineProperty(De.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=ag.toArray(this.nested))}});De.prototype.toJSON=function(t){return ag.toObject(["options",this.options,"nested",Qx(this.nestedArray,t)])};De.prototype.addJSON=function(t){var n=this;if(t)for(var r=Object.keys(t),i=0,a;i<r.length;++i)a=t[r[i]],n.add((a.fields!==void 0?vd.fromJSON:a.values!==void 0?Sd.fromJSON:a.methods!==void 0?Bh.fromJSON:a.id!==void 0?zx.fromJSON:De.fromJSON)(r[i],a));return this};De.prototype.get=function(t){return this.nested&&this.nested[t]||null};De.prototype.getEnum=function(t){if(this.nested&&this.nested[t]instanceof Sd)return this.nested[t].values;throw Error("no such enum: "+t)};De.prototype.add=function(t){if(!(t instanceof zx&&t.extend!==void 0||t instanceof vd||t instanceof L9||t instanceof Sd||t instanceof Bh||t instanceof De))throw TypeError("object must be a valid nested object");if(!this.nested)this.nested={};else{var n=this.get(t.name);if(n)if(n instanceof De&&t instanceof De&&!(n instanceof vd||n instanceof Bh)){for(var r=n.nestedArray,i=0;i<r.length;++i)t.add(r[i]);this.remove(n),this.nested||(this.nested={}),t.setOptions(n.options,!0)}else throw Error("duplicate name '"+t.name+"' in "+this)}return this.nested[t.name]=t,t.onAdd(this),Kx(this)};De.prototype.remove=function(t){if(!(t instanceof EC))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),Kx(this)};De.prototype.define=function(t,n){if(ag.isString(t))t=t.split(".");else if(!Array.isArray(t))throw TypeError("illegal path");if(t&&t.length&&t[0]==="")throw Error("path must be relative");for(var r=this;t.length>0;){var i=t.shift();if(r.nested&&r.nested[i]){if(r=r.nested[i],!(r instanceof De))throw Error("path conflicts with non-namespace objects")}else r.add(r=new De(i))}return n&&r.addJSON(n),r};De.prototype.resolveAll=function(){for(var t=this.nestedArray,n=0;n<t.length;)t[n]instanceof De?t[n++].resolveAll():t[n++].resolve();return this.resolve()};De.prototype.lookup=function(t,n,r){if(typeof n=="boolean"?(r=n,n=void 0):n&&!Array.isArray(n)&&(n=[n]),ag.isString(t)&&t.length){if(t===".")return this.root;t=t.split(".")}else if(!t.length)return this;if(t[0]==="")return this.root.lookup(t.slice(1),n);var i=this.get(t[0]);if(i){if(t.length===1){if(!n||n.indexOf(i.constructor)>-1)return i}else if(i instanceof De&&(i=i.lookup(t.slice(1),n,!0)))return i}else for(var a=0;a<this.nestedArray.length;++a)if(this._nestedArray[a]instanceof De&&(i=this._nestedArray[a].lookup(t,n,!0)))return i;return this.parent===null||r?null:this.parent.lookup(t,n)};De.prototype.lookupType=function(t){var n=this.lookup(t,[vd]);if(!n)throw Error("no such type: "+t);return n};De.prototype.lookupEnum=function(t){var n=this.lookup(t,[Sd]);if(!n)throw Error("no such Enum '"+t+"' in "+this);return n};De.prototype.lookupTypeOrEnum=function(t){var n=this.lookup(t,[vd,Sd]);if(!n)throw Error("no such Type or Enum '"+t+"' in "+this);return n};De.prototype.lookupService=function(t){var n=this.lookup(t,[Bh]);if(!n)throw Error("no such Service '"+t+"' in "+this);return n};De._configure=function(e,t,n){vd=e,Bh=t,Sd=n}});var og=m((SEe,Yx)=>{"use strict";Yx.exports=ka;var CC=lo();((ka.prototype=Object.create(CC.prototype)).constructor=ka).className="MapField";var F9=Fs(),Dh=Gt();function ka(e,t,n,r,i,a){if(CC.call(this,e,t,r,void 0,void 0,i,a),!Dh.isString(n))throw TypeError("keyType must be a string");this.keyType=n,this.resolvedKeyType=null,this.map=!0}ka.fromJSON=function(t,n){return new ka(t,n.id,n.keyType,n.type,n.options,n.comment)};ka.prototype.toJSON=function(t){var n=t?!!t.keepComments:!1;return Dh.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",n?this.comment:void 0])};ka.prototype.resolve=function(){if(this.resolved)return this;if(F9.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return CC.prototype.resolve.call(this)};ka.d=function(t,n,r){return typeof r=="function"?r=Dh.decorateType(r).name:r&&typeof r=="object"&&(r=Dh.decorateEnum(r).name),function(a,o){Dh.decorateType(a.constructor).add(new ka(o,t,n,r))}}});var sg=m((bEe,Xx)=>{"use strict";Xx.exports=qs;var kC=Us();((qs.prototype=Object.create(kC.prototype)).constructor=qs).className="Method";var Td=Gt();function qs(e,t,n,r,i,a,o,s,u){if(Td.isObject(i)?(o=i,i=a=void 0):Td.isObject(a)&&(o=a,a=void 0),!(t===void 0||Td.isString(t)))throw TypeError("type must be a string");if(!Td.isString(n))throw TypeError("requestType must be a string");if(!Td.isString(r))throw TypeError("responseType must be a string");kC.call(this,e,o),this.type=t||"rpc",this.requestType=n,this.requestStream=i?!0:void 0,this.responseType=r,this.responseStream=a?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=s,this.parsedOptions=u}qs.fromJSON=function(t,n){return new qs(t,n.type,n.requestType,n.responseType,n.requestStream,n.responseStream,n.options,n.comment,n.parsedOptions)};qs.prototype.toJSON=function(t){var n=t?!!t.keepComments:!1;return Td.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",n?this.comment:void 0,"parsedOptions",this.parsedOptions])};qs.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),kC.prototype.resolve.call(this))}});var ug=m((TEe,jx)=>{"use strict";jx.exports=wr;var co=bd();((wr.prototype=Object.create(co.prototype)).constructor=wr).className="Service";var _C=sg(),Mh=Gt(),U9=XT();function wr(e,t){co.call(this,e,t),this.methods={},this._methodsArray=null}wr.fromJSON=function(t,n){var r=new wr(t,n.options);if(n.methods)for(var i=Object.keys(n.methods),a=0;a<i.length;++a)r.add(_C.fromJSON(i[a],n.methods[i[a]]));return n.nested&&r.addJSON(n.nested),r.comment=n.comment,r};wr.prototype.toJSON=function(t){var n=co.prototype.toJSON.call(this,t),r=t?!!t.keepComments:!1;return Mh.toObject(["options",n&&n.options||void 0,"methods",co.arrayToJSON(this.methodsArray,t)||{},"nested",n&&n.nested||void 0,"comment",r?this.comment:void 0])};Object.defineProperty(wr.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=Mh.toArray(this.methods))}});function $x(e){return e._methodsArray=null,e}wr.prototype.get=function(t){return this.methods[t]||co.prototype.get.call(this,t)};wr.prototype.resolveAll=function(){for(var t=this.methodsArray,n=0;n<t.length;++n)t[n].resolve();return co.prototype.resolve.call(this)};wr.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);return t instanceof _C?(this.methods[t.name]=t,t.parent=this,$x(this)):co.prototype.add.call(this,t)};wr.prototype.remove=function(t){if(t instanceof _C){if(this.methods[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.methods[t.name],t.parent=null,$x(this)}return co.prototype.remove.call(this,t)};wr.prototype.create=function(t,n,r){for(var i=new U9.Service(t,n,r),a=0,o;a<this.methodsArray.length;++a){var s=Mh.lcFirst((o=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");i[s]=Mh.codegen(["r","c"],Mh.isReserved(s)?s+"_":s)("return this.rpcCall(m,q,s,r,c)")({m:o,q:o.resolvedRequestType.ctor,s:o.resolvedResponseType.ctor})}return i}});var lg=m((EEe,eB)=>{"use strict";eB.exports=Ji;var q9=Di();function Ji(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)this[t[n]]=e[t[n]]}Ji.create=function(t){return this.$type.create(t)};Ji.encode=function(t,n){return this.$type.encode(t,n)};Ji.encodeDelimited=function(t,n){return this.$type.encodeDelimited(t,n)};Ji.decode=function(t){return this.$type.decode(t)};Ji.decodeDelimited=function(t){return this.$type.decodeDelimited(t)};Ji.verify=function(t){return this.$type.verify(t)};Ji.fromObject=function(t){return this.$type.fromObject(t)};Ji.toObject=function(t,n){return this.$type.toObject(t,n)};Ji.prototype.toJSON=function(){return this.$type.toObject(this,q9.toJSONOptions)}});var AC=m((CEe,nB)=>{"use strict";nB.exports=W9;var V9=yi(),_a=Fs(),tB=Gt();function J9(e){return"missing required '"+e.name+"'"}function W9(e){var t=tB.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter(function(s){return s.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var n=0;n<e.fieldsArray.length;++n){var r=e._fieldsArray[n].resolve(),i=r.resolvedType instanceof V9?"int32":r.type,a="m"+tB.safeProp(r.name);t("case %i: {",r.id),r.map?(t("if(%s===util.emptyObject)",a)("%s={}",a)("var c2 = r.uint32()+r.pos"),_a.defaults[r.keyType]!==void 0?t("k=%j",_a.defaults[r.keyType]):t("k=null"),_a.defaults[i]!==void 0?t("value=%j",_a.defaults[i]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",r.keyType)("case 2:"),_a.basic[i]===void 0?t("value=types[%i].decode(r,r.uint32())",n):t("value=r.%s()",i),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),_a.long[r.keyType]!==void 0?t('%s[typeof k==="object"?util.longToHash(k):k]=value',a):t("%s[k]=value",a)):r.repeated?(t("if(!(%s&&%s.length))",a,a)("%s=[]",a),_a.packed[i]!==void 0&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",a,i)("}else"),_a.basic[i]===void 0?t(r.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",a,n):t("%s.push(r.%s())",a,i)):_a.basic[i]===void 0?t(r.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",a,n):t("%s=r.%s()",a,i),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),n=0;n<e._fieldsArray.length;++n){var o=e._fieldsArray[n];o.required&&t("if(!m.hasOwnProperty(%j))",o.name)("throw util.ProtocolError(%j,{instance:m})",J9(o))}return t("return m")}});var OC=m((kEe,rB)=>{"use strict";rB.exports=z9;var H9=yi(),NC=Gt();function xr(e,t){return e.name+": "+t+(e.repeated&&t!=="array"?"[]":e.map&&t!=="object"?"{k:"+e.keyType+"}":"")+" expected"}function IC(e,t,n,r){if(t.resolvedType)if(t.resolvedType instanceof H9){e("switch(%s){",r)("default:")("return%j",xr(t,"enum value"));for(var i=Object.keys(t.resolvedType.values),a=0;a<i.length;++a)e("case %i:",t.resolvedType.values[i[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",n,r)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",r)("return%j",xr(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",r,r,r,r)("return%j",xr(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',r)("return%j",xr(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',r)("return%j",xr(t,"boolean"));break;case"string":e("if(!util.isString(%s))",r)("return%j",xr(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',r,r,r)("return%j",xr(t,"buffer"));break}return e}function G9(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",xr(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",n)("return%j",xr(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",n)("return%j",xr(t,"boolean key"));break}return e}function z9(e){var t=NC.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),n=e.oneofsArray,r={};n.length&&t("var p={}");for(var i=0;i<e.fieldsArray.length;++i){var a=e._fieldsArray[i].resolve(),o="m"+NC.safeProp(a.name);if(a.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",o,a.name),a.map)t("if(!util.isObject(%s))",o)("return%j",xr(a,"object"))("var k=Object.keys(%s)",o)("for(var i=0;i<k.length;++i){"),G9(t,a,"k[i]"),IC(t,a,i,o+"[k[i]]")("}");else if(a.repeated)t("if(!Array.isArray(%s))",o)("return%j",xr(a,"array"))("for(var i=0;i<%s.length;++i){",o),IC(t,a,i,o+"[i]")("}");else{if(a.partOf){var s=NC.safeProp(a.partOf.name);r[a.partOf.name]===1&&t("if(p%s===1)",s)("return%j",a.partOf.name+": multiple values"),r[a.partOf.name]=1,t("p%s=1",s)}IC(t,a,i,o)}a.optional&&t("}")}return t("return null")}});var wC=m(aB=>{"use strict";var iB=aB,Lh=yi(),Wi=Gt();function RC(e,t,n,r){var i=!1;if(t.resolvedType)if(t.resolvedType instanceof Lh){e("switch(d%s){",r);for(var a=t.resolvedType.values,o=Object.keys(a),s=0;s<o.length;++s)a[o[s]]===t.typeDefault&&!i&&(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',r,r,r),t.repeated||e("break"),i=!0),e("case%j:",o[s])("case %i:",a[o[s]])("m%s=%j",r,a[o[s]])("break");e("}")}else e('if(typeof d%s!=="object")',r)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",r,n,r);else{var u=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",r,r);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",r,r);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",r,r);break;case"uint64":u=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,u)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,u?"true":"");break;case"bytes":e('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length >= 0)",r)("m%s=d%s",r,r);break;case"string":e("m%s=String(d%s)",r,r);break;case"bool":e("m%s=Boolean(d%s)",r,r);break}}return e}iB.fromObject=function(t){var n=t.fieldsArray,r=Wi.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!n.length)return r("return new this.ctor");r("var m=new this.ctor");for(var i=0;i<n.length;++i){var a=n[i].resolve(),o=Wi.safeProp(a.name);a.map?(r("if(d%s){",o)('if(typeof d%s!=="object")',o)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",o)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",o),RC(r,a,i,o+"[ks[i]]")("}")("}")):a.repeated?(r("if(d%s){",o)("if(!Array.isArray(d%s))",o)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",o)("for(var i=0;i<d%s.length;++i){",o),RC(r,a,i,o+"[i]")("}")("}")):(a.resolvedType instanceof Lh||r("if(d%s!=null){",o),RC(r,a,i,o),a.resolvedType instanceof Lh||r("}"))}return r("return m")};function PC(e,t,n,r){if(t.resolvedType)t.resolvedType instanceof Lh?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",r,n,r,r,n,r,r):e("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("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",r,r,r,r,i?"true":"",r);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",r,r,r,r,r);break;default:e("d%s=m%s",r,r);break}}return e}iB.toObject=function(t){var n=t.fieldsArray.slice().sort(Wi.compareFieldsById);if(!n.length)return Wi.codegen()("return {}");for(var r=Wi.codegen(["m","o"],t.name+"$toObject")("if(!o)")("o={}")("var d={}"),i=[],a=[],o=[],s=0;s<n.length;++s)n[s].partOf||(n[s].resolve().repeated?i:n[s].map?a:o).push(n[s]);if(i.length){for(r("if(o.arrays||o.defaults){"),s=0;s<i.length;++s)r("d%s=[]",Wi.safeProp(i[s].name));r("}")}if(a.length){for(r("if(o.objects||o.defaults){"),s=0;s<a.length;++s)r("d%s={}",Wi.safeProp(a[s].name));r("}")}if(o.length){for(r("if(o.defaults){"),s=0;s<o.length;++s){var u=o[s],l=Wi.safeProp(u.name);if(u.resolvedType instanceof Lh)r("d%s=o.enums===String?%j:%j",l,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",l)("}else")("d%s=o.longs===String?%j:%i",l,u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var c="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",l,c)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else r("d%s=%j",l,u.typeDefault)}r("}")}var d=!1;for(s=0;s<n.length;++s){var u=n[s],f=t._fieldsArray.indexOf(u),l=Wi.safeProp(u.name);u.map?(d||(d=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",l,l)("d%s={}",l)("for(var j=0;j<ks2.length;++j){"),PC(r,u,f,l+"[ks2[j]]")("}")):u.repeated?(r("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),PC(r,u,f,l+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",l,u.name),PC(r,u,f,l),u.partOf&&r("if(o.oneofs)")("d%s=%j",Wi.safeProp(u.partOf.name),u.name)),r("}")}return r("return d")}});var xC=m(oB=>{"use strict";var Q9=oB,K9=lg();Q9[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),n=this.lookup(t);if(n){var r=e["@type"].charAt(0)==="."?e["@type"].slice(1):e["@type"];return r.indexOf("/")===-1&&(r="/"+r),this.create({type_url:r,value:n.encode(n.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var n="type.googleapis.com/",r="",i="";if(t&&t.json&&e.type_url&&e.value){i=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var a=this.lookup(i);a&&(e=a.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof K9){var o=e.$type.toObject(e,t),s=e.$type.fullName[0]==="."?e.$type.fullName.slice(1):e.$type.fullName;return r===""&&(r=n),i=r+s,o["@type"]=i,o}return this.toObject(e,t)}}});var fg=m((NEe,uB)=>{"use strict";uB.exports=at;var vi=bd();((at.prototype=Object.create(vi.prototype)).constructor=at).className="Type";var Z9=yi(),MC=yd(),cg=lo(),Y9=og(),X9=ug(),BC=lg(),DC=Rm(),$9=Im(),bn=Gt(),j9=LC(),ez=AC(),tz=OC(),sB=wC(),nz=xC();function at(e,t){vi.call(this,e,t),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}Object.defineProperties(at.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 n=this.fields[e[t]],r=n.id;if(this._fieldsById[r])throw Error("duplicate id "+r+" in "+this);this._fieldsById[r]=n}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=bn.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=bn.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=at.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof BC||((e.prototype=new BC).constructor=e,bn.merge(e.prototype,t)),e.$type=e.prototype.$type=this,bn.merge(e,BC,!0),this._ctor=e;for(var n=0;n<this.fieldsArray.length;++n)this._fieldsArray[n].resolve();var r={};for(n=0;n<this.oneofsArray.length;++n)r[this._oneofsArray[n].resolve().name]={get:bn.oneOfGetter(this._oneofsArray[n].oneof),set:bn.oneOfSetter(this._oneofsArray[n].oneof)};n&&Object.defineProperties(e.prototype,r)}}});at.generateConstructor=function(t){for(var n=bn.codegen(["p"],t.name),r=0,i;r<t.fieldsArray.length;++r)(i=t._fieldsArray[r]).map?n("this%s={}",bn.safeProp(i.name)):i.repeated&&n("this%s=[]",bn.safeProp(i.name));return n("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]]")};function dg(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}at.fromJSON=function(t,n){var r=new at(t,n.options);r.extensions=n.extensions,r.reserved=n.reserved;for(var i=Object.keys(n.fields),a=0;a<i.length;++a)r.add((typeof n.fields[i[a]].keyType<"u"?Y9.fromJSON:cg.fromJSON)(i[a],n.fields[i[a]]));if(n.oneofs)for(i=Object.keys(n.oneofs),a=0;a<i.length;++a)r.add(MC.fromJSON(i[a],n.oneofs[i[a]]));if(n.nested)for(i=Object.keys(n.nested),a=0;a<i.length;++a){var o=n.nested[i[a]];r.add((o.id!==void 0?cg.fromJSON:o.fields!==void 0?at.fromJSON:o.values!==void 0?Z9.fromJSON:o.methods!==void 0?X9.fromJSON:vi.fromJSON)(i[a],o))}return n.extensions&&n.extensions.length&&(r.extensions=n.extensions),n.reserved&&n.reserved.length&&(r.reserved=n.reserved),n.group&&(r.group=!0),n.comment&&(r.comment=n.comment),r};at.prototype.toJSON=function(t){var n=vi.prototype.toJSON.call(this,t),r=t?!!t.keepComments:!1;return bn.toObject(["options",n&&n.options||void 0,"oneofs",vi.arrayToJSON(this.oneofsArray,t),"fields",vi.arrayToJSON(this.fieldsArray.filter(function(i){return!i.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",n&&n.nested||void 0,"comment",r?this.comment:void 0])};at.prototype.resolveAll=function(){for(var t=this.fieldsArray,n=0;n<t.length;)t[n++].resolve();var r=this.oneofsArray;for(n=0;n<r.length;)r[n++].resolve();return vi.prototype.resolveAll.call(this)};at.prototype.get=function(t){return this.fields[t]||this.oneofs&&this.oneofs[t]||this.nested&&this.nested[t]||null};at.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof cg&&t.extend===void 0){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),dg(this)}return t instanceof MC?(this.oneofs||(this.oneofs={}),this.oneofs[t.name]=t,t.onAdd(this),dg(this)):vi.prototype.add.call(this,t)};at.prototype.remove=function(t){if(t instanceof cg&&t.extend===void 0){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),dg(this)}if(t instanceof MC){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),dg(this)}return vi.prototype.remove.call(this,t)};at.prototype.isReservedId=function(t){return vi.isReservedId(this.reserved,t)};at.prototype.isReservedName=function(t){return vi.isReservedName(this.reserved,t)};at.prototype.create=function(t){return new this.ctor(t)};at.prototype.setup=function(){for(var t=this.fullName,n=[],r=0;r<this.fieldsArray.length;++r)n.push(this._fieldsArray[r].resolve().resolvedType);this.encode=j9(this)({Writer:$9,types:n,util:bn}),this.decode=ez(this)({Reader:DC,types:n,util:bn}),this.verify=tz(this)({types:n,util:bn}),this.fromObject=sB.fromObject(this)({types:n,util:bn}),this.toObject=sB.toObject(this)({types:n,util:bn});var i=nz[t];if(i){var a=Object.create(this);a.fromObject=this.fromObject,this.fromObject=i.fromObject.bind(a),a.toObject=this.toObject,this.toObject=i.toObject.bind(a)}return this};at.prototype.encode=function(t,n){return this.setup().encode(t,n)};at.prototype.encodeDelimited=function(t,n){return this.encode(t,n&&n.len?n.fork():n).ldelim()};at.prototype.decode=function(t,n){return this.setup().decode(t,n)};at.prototype.decodeDelimited=function(t){return t instanceof DC||(t=DC.create(t)),this.decode(t,t.uint32())};at.prototype.verify=function(t){return this.setup().verify(t)};at.prototype.fromObject=function(t){return this.setup().fromObject(t)};at.prototype.toObject=function(t,n){return this.setup().toObject(t,n)};at.d=function(t){return function(r){bn.decorateType(r,t)}}});var mg=m((IEe,hB)=>{"use strict";hB.exports=ir;var pg=bd();((ir.prototype=Object.create(pg.prototype)).constructor=ir).className="Root";var UC=lo(),cB=yi(),rz=yd(),fo=Gt(),dB,FC,Fh;function ir(e){pg.call(this,"",e),this.deferred=[],this.files=[]}ir.fromJSON=function(t,n){return n||(n=new ir),t.options&&n.setOptions(t.options),n.addJSON(t.nested)};ir.prototype.resolvePath=fo.path.resolve;ir.prototype.fetch=fo.fetch;function fB(){}ir.prototype.load=function e(t,n,r){typeof n=="function"&&(r=n,n=void 0);var i=this;if(!r)return fo.asPromise(e,i,t,n);var a=r===fB;function o(h,g){if(r){if(a)throw h;var p=r;r=null,p(h,g)}}function s(h){var g=h.lastIndexOf("google/protobuf/");if(g>-1){var p=h.substring(g);if(p in Fh)return p}return null}function u(h,g){try{if(fo.isString(g)&&g.charAt(0)==="{"&&(g=JSON.parse(g)),!fo.isString(g))i.setOptions(g.options).addJSON(g.nested);else{FC.filename=h;var p=FC(g,i,n),b,v=0;if(p.imports)for(;v<p.imports.length;++v)(b=s(p.imports[v])||i.resolvePath(h,p.imports[v]))&&l(b);if(p.weakImports)for(v=0;v<p.weakImports.length;++v)(b=s(p.weakImports[v])||i.resolvePath(h,p.weakImports[v]))&&l(b,!0)}}catch(C){o(C)}!a&&!c&&o(null,i)}function l(h,g){if(h=s(h)||h,!(i.files.indexOf(h)>-1)){if(i.files.push(h),h in Fh){a?u(h,Fh[h]):(++c,setTimeout(function(){--c,u(h,Fh[h])}));return}if(a){var p;try{p=fo.fs.readFileSync(h).toString("utf8")}catch(b){g||o(b);return}u(h,p)}else++c,i.fetch(h,function(b,v){if(--c,!!r){if(b){g?c||o(null,i):o(b);return}u(h,v)}})}}var c=0;fo.isString(t)&&(t=[t]);for(var d=0,f;d<t.length;++d)(f=i.resolvePath("",t[d]))&&l(f);if(a)return i;c||o(null,i)};ir.prototype.loadSync=function(t,n){if(!fo.isNode)throw Error("not supported");return this.load(t,n,fB)};ir.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(t){return"'extend "+t.extend+"' in "+t.parent.fullName}).join(", "));return pg.prototype.resolveAll.call(this)};var hg=/^[A-Z]/;function lB(e,t){var n=t.parent.lookup(t.extend);if(n){var r=new UC(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.get(r.name)||(r.declaringField=t,t.extensionField=r,n.add(r)),!0}return!1}ir.prototype._handleAdd=function(t){if(t instanceof UC)t.extend!==void 0&&!t.extensionField&&(lB(this,t)||this.deferred.push(t));else if(t instanceof cB)hg.test(t.name)&&(t.parent[t.name]=t.values);else if(!(t instanceof rz)){if(t instanceof dB)for(var n=0;n<this.deferred.length;)lB(this,this.deferred[n])?this.deferred.splice(n,1):++n;for(var r=0;r<t.nestedArray.length;++r)this._handleAdd(t._nestedArray[r]);hg.test(t.name)&&(t.parent[t.name]=t)}};ir.prototype._handleRemove=function(t){if(t instanceof UC){if(t.extend!==void 0)if(t.extensionField)t.extensionField.parent.remove(t.extensionField),t.extensionField=null;else{var n=this.deferred.indexOf(t);n>-1&&this.deferred.splice(n,1)}}else if(t instanceof cB)hg.test(t.name)&&delete t.parent[t.name];else if(t instanceof pg){for(var r=0;r<t.nestedArray.length;++r)this._handleRemove(t._nestedArray[r]);hg.test(t.name)&&delete t.parent[t.name]}};ir._configure=function(e,t,n){dB=e,FC=t,Fh=n}});var Gt=m((OEe,mB)=>{"use strict";var Ct=mB.exports=Di(),pB=$T(),qC,VC;Ct.codegen=xx();Ct.fetch=Dx();Ct.path=Fx();Ct.fs=Ct.inquire("fs");Ct.toArray=function(t){if(t){for(var n=Object.keys(t),r=new Array(n.length),i=0;i<n.length;)r[i]=t[n[i++]];return r}return[]};Ct.toObject=function(t){for(var n={},r=0;r<t.length;){var i=t[r++],a=t[r++];a!==void 0&&(n[i]=a)}return n};var iz=/\\/g,az=/"/g;Ct.isReserved=function(t){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(t)};Ct.safeProp=function(t){return!/^[$\w_]+$/.test(t)||Ct.isReserved(t)?'["'+t.replace(iz,"\\\\").replace(az,'\\"')+'"]':"."+t};Ct.ucFirst=function(t){return t.charAt(0).toUpperCase()+t.substring(1)};var oz=/_([a-z])/g;Ct.camelCase=function(t){return t.substring(0,1)+t.substring(1).replace(oz,function(n,r){return r.toUpperCase()})};Ct.compareFieldsById=function(t,n){return t.id-n.id};Ct.decorateType=function(t,n){if(t.$type)return n&&t.$type.name!==n&&(Ct.decorateRoot.remove(t.$type),t.$type.name=n,Ct.decorateRoot.add(t.$type)),t.$type;qC||(qC=fg());var r=new qC(n||t.name);return Ct.decorateRoot.add(r),r.ctor=t,Object.defineProperty(t,"$type",{value:r,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:r,enumerable:!1}),r};var sz=0;Ct.decorateEnum=function(t){if(t.$type)return t.$type;VC||(VC=yi());var n=new VC("Enum"+sz++,t);return Ct.decorateRoot.add(n),Object.defineProperty(t,"$type",{value:n,enumerable:!1}),n};Ct.setProperty=function(t,n,r){function i(a,o,s){var u=o.shift();if(u==="__proto__"||u==="prototype")return a;if(o.length>0)a[u]=i(a[u]||{},o,s);else{var l=a[u];l&&(s=[].concat(l).concat(s)),a[u]=s}return a}if(typeof t!="object")throw TypeError("dst must be an object");if(!n)throw TypeError("path must be specified");return n=n.split("."),i(t,n,r)};Object.defineProperty(Ct,"decorateRoot",{get:function(){return pB.decorated||(pB.decorated=new(mg()))}})});var Us=m((REe,gB)=>{"use strict";gB.exports=ar;ar.className="ReflectionObject";var gg=Gt(),yg;function ar(e,t){if(!gg.isString(e))throw TypeError("name must be a string");if(t&&!gg.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(ar.prototype,{root:{get:function(){for(var e=this;e.parent!==null;)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(".")}}});ar.prototype.toJSON=function(){throw Error()};ar.prototype.onAdd=function(t){this.parent&&this.parent!==t&&this.parent.remove(this),this.parent=t,this.resolved=!1;var n=t.root;n instanceof yg&&n._handleAdd(this)};ar.prototype.onRemove=function(t){var n=t.root;n instanceof yg&&n._handleRemove(this),this.parent=null,this.resolved=!1};ar.prototype.resolve=function(){return this.resolved?this:(this.root instanceof yg&&(this.resolved=!0),this)};ar.prototype.getOption=function(t){if(this.options)return this.options[t]};ar.prototype.setOption=function(t,n,r){return(!r||!this.options||this.options[t]===void 0)&&((this.options||(this.options={}))[t]=n),this};ar.prototype.setParsedOption=function(t,n,r){this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(r){var a=i.find(function(u){return Object.prototype.hasOwnProperty.call(u,t)});if(a){var o=a[t];gg.setProperty(o,r,n)}else a={},a[t]=gg.setProperty({},r,n),i.push(a)}else{var s={};s[t]=n,i.push(s)}return this};ar.prototype.setOptions=function(t,n){if(t)for(var r=Object.keys(t),i=0;i<r.length;++i)this.setOption(r[i],t[r[i]],n);return this};ar.prototype.toString=function(){var t=this.constructor.className,n=this.fullName;return n.length?t+" "+n:t};ar._configure=function(e){yg=e}});var yi=m((PEe,SB)=>{"use strict";SB.exports=Hi;var yB=Us();((Hi.prototype=Object.create(yB.prototype)).constructor=Hi).className="Enum";var vB=bd(),vg=Gt();function Hi(e,t,n,r,i,a){if(yB.call(this,e,n),t&&typeof t!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=r,this.comments=i||{},this.valuesOptions=a,this.reserved=void 0,t)for(var o=Object.keys(t),s=0;s<o.length;++s)typeof t[o[s]]=="number"&&(this.valuesById[this.values[o[s]]=t[o[s]]]=o[s])}Hi.fromJSON=function(t,n){var r=new Hi(t,n.values,n.options,n.comment,n.comments);return r.reserved=n.reserved,r};Hi.prototype.toJSON=function(t){var n=t?!!t.keepComments:!1;return vg.toObject(["options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",n?this.comment:void 0,"comments",n?this.comments:void 0])};Hi.prototype.add=function(t,n,r,i){if(!vg.isString(t))throw TypeError("name must be a string");if(!vg.isInteger(n))throw TypeError("id must be an integer");if(this.values[t]!==void 0)throw Error("duplicate name '"+t+"' in "+this);if(this.isReservedId(n))throw Error("id "+n+" is reserved in "+this);if(this.isReservedName(t))throw Error("name '"+t+"' is reserved in "+this);if(this.valuesById[n]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+n+" in "+this);this.values[t]=n}else this.valuesById[this.values[t]=n]=t;return i&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[t]=i||null),this.comments[t]=r||null,this};Hi.prototype.remove=function(t){if(!vg.isString(t))throw TypeError("name must be a string");var n=this.values[t];if(n==null)throw Error("name '"+t+"' does not exist in "+this);return delete this.valuesById[n],delete this.values[t],delete this.comments[t],this.valuesOptions&&delete this.valuesOptions[t],this};Hi.prototype.isReservedId=function(t){return vB.isReservedId(this.reserved,t)};Hi.prototype.isReservedName=function(t){return vB.isReservedName(this.reserved,t)}});var LC=m((wEe,TB)=>{"use strict";TB.exports=lz;var uz=yi(),JC=Fs(),WC=Gt();function bB(e,t,n,r){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,(t.id<<3|2)>>>0)}function lz(e){for(var t=WC.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),n,r,i=e.fieldsArray.slice().sort(WC.compareFieldsById),n=0;n<i.length;++n){var a=i[n].resolve(),o=e._fieldsArray.indexOf(a),s=a.resolvedType instanceof uz?"int32":a.type,u=JC.basic[s];r="m"+WC.safeProp(a.name),a.map?(t("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",r,a.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",r)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(a.id<<3|2)>>>0,8|JC.mapKey[a.keyType],a.keyType),u===void 0?t("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",o,r):t(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|u,s,r),t("}")("}")):a.repeated?(t("if(%s!=null&&%s.length){",r,r),a.packed&&JC.packed[s]!==void 0?t("w.uint32(%i).fork()",(a.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",r)("w.%s(%s[i])",s,r)("w.ldelim()"):(t("for(var i=0;i<%s.length;++i)",r),u===void 0?bB(t,a,o,r+"[i]"):t("w.uint32(%i).%s(%s[i])",(a.id<<3|u)>>>0,s,r)),t("}")):(a.optional&&t("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",r,a.name),u===void 0?bB(t,a,o,r):t("w.uint32(%i).%s(%s)",(a.id<<3|u)>>>0,s,r))}return t("return w")}});var CB=m((xEe,EB)=>{"use strict";var Oe=EB.exports=jT();Oe.build="light";function cz(e,t,n){return typeof t=="function"?(n=t,t=new Oe.Root):t||(t=new Oe.Root),t.load(e,n)}Oe.load=cz;function dz(e,t){return t||(t=new Oe.Root),t.loadSync(e)}Oe.loadSync=dz;Oe.encoder=LC();Oe.decoder=AC();Oe.verifier=OC();Oe.converter=wC();Oe.ReflectionObject=Us();Oe.Namespace=bd();Oe.Root=mg();Oe.Enum=yi();Oe.Type=fg();Oe.Field=lo();Oe.OneOf=yd();Oe.MapField=og();Oe.Service=ug();Oe.Method=sg();Oe.Message=lg();Oe.wrappers=xC();Oe.types=Fs();Oe.util=Gt();Oe.ReflectionObject._configure(Oe.Root);Oe.Namespace._configure(Oe.Type,Oe.Service,Oe.Enum);Oe.Root._configure(Oe.Type);Oe.Field._configure(Oe.Type)});var GC=m((BEe,AB)=>{"use strict";AB.exports=_B;var HC=/[\s{}=;:[\],'"()<>]/g,fz=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,hz=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,pz=/^ *[*/]+ */,mz=/^\s*\*?\/*/,gz=/\n/g,yz=/\s/,vz=/\\(.?)/g,Sz={0:"\0",r:"\r",n:`
10
- `,t:" "};function kB(e){return e.replace(vz,function(t,n){switch(n){case"\\":case"":return n;default:return Sz[n]||""}})}_B.unescape=kB;function _B(e,t){e=e.toString();var n=0,r=e.length,i=1,a=0,o={},s=[],u=null;function l(I){return Error("illegal "+I+" (line "+i+")")}function c(){var I=u==="'"?hz:fz;I.lastIndex=n-1;var M=I.exec(e);if(!M)throw l("string");return n=I.lastIndex,b(u),u=null,kB(M[1])}function d(I){return e.charAt(I)}function f(I,M,x){var U={type:e.charAt(I++),lineEmpty:!1,leading:x},G;t?G=2:G=3;var le=I-G,j;do if(--le<0||(j=e.charAt(le))===`
11
- `){U.lineEmpty=!0;break}while(j===" "||j===" ");for(var w=e.substring(I,M).split(gz),Ee=0;Ee<w.length;++Ee)w[Ee]=w[Ee].replace(t?mz:pz,"").trim();U.text=w.join(`
12
- `).trim(),o[i]=U,a=i}function h(I){var M=g(I),x=e.substring(I,M),U=/^\s*\/\//.test(x);return U}function g(I){for(var M=I;M<r&&d(M)!==`
13
- `;)M++;return M}function p(){if(s.length>0)return s.shift();if(u)return c();var I,M,x,U,G,le=n===0;do{if(n===r)return null;for(I=!1;yz.test(x=d(n));)if(x===`
14
- `&&(le=!0,++i),++n===r)return null;if(d(n)==="/"){if(++n===r)throw l("comment");if(d(n)==="/")if(t){if(U=n,G=!1,h(n-1)){G=!0;do if(n=g(n),n===r||(n++,!le))break;while(h(n))}else n=Math.min(r,g(n)+1);G&&(f(U,n,le),le=!0),i++,I=!0}else{for(G=d(U=n+1)==="/";d(++n)!==`
15
- `;)if(n===r)return null;++n,G&&(f(U,n-1,le),le=!0),++i,I=!0}else if((x=d(n))==="*"){U=n+1,G=t||d(U)==="*";do{if(x===`
16
- `&&++i,++n===r)throw l("comment");M=x,x=d(n)}while(M!=="*"||x!=="/");++n,G&&(f(U,n-2,le),le=!0),I=!0}else return"/"}}while(I);var j=n;HC.lastIndex=0;var w=HC.test(d(j++));if(!w)for(;j<r&&!HC.test(d(j));)++j;var Ee=e.substring(n,n=j);return(Ee==='"'||Ee==="'")&&(u=Ee),Ee}function b(I){s.push(I)}function v(){if(!s.length){var I=p();if(I===null)return null;b(I)}return s[0]}function C(I,M){var x=v(),U=x===I;if(U)return p(),!0;if(!M)throw l("token '"+x+"', '"+I+"' expected");return!1}function N(I){var M=null,x;return I===void 0?(x=o[i-1],delete o[i-1],x&&(t||x.type==="*"||x.lineEmpty)&&(M=x.leading?x.text:null)):(a<I&&v(),x=o[I],delete o[I],x&&!x.lineEmpty&&(t||x.type==="/")&&(M=x.leading?null:x.text)),M}return Object.defineProperty({next:p,peek:v,push:b,skip:C,cmnt:N},"line",{get:function(){return i}})}});var wB=m((DEe,PB)=>{"use strict";PB.exports=Aa;Aa.filename=null;Aa.defaults={keepCase:!1};var bz=GC(),NB=mg(),IB=fg(),OB=lo(),Tz=og(),RB=yd(),Ez=yi(),Cz=ug(),kz=sg(),zC=Fs(),QC=Gt(),_z=/^[1-9][0-9]*$/,Az=/^-?[1-9][0-9]*$/,Nz=/^0[x][0-9a-fA-F]+$/,Iz=/^-?0[x][0-9a-fA-F]+$/,Oz=/^0[0-7]+$/,Rz=/^-?0[0-7]+$/,Pz=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,Gi=/^[a-zA-Z_][a-zA-Z_0-9]*$/,zi=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,wz=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function Aa(e,t,n){t instanceof NB||(n=t,t=new NB),n||(n=Aa.defaults);var r=n.preferTrailingComment||!1,i=bz(e,n.alternateCommentMode||!1),a=i.next,o=i.push,s=i.peek,u=i.skip,l=i.cmnt,c=!0,d,f,h,g,p=!1,b=t,v=n.keepCase?function(L){return L}:QC.camelCase;function C(L,F,H){var X=Aa.filename;return H||(Aa.filename=null),Error("illegal "+(F||"token")+" '"+L+"' ("+(X?X+", ":"")+"line "+i.line+")")}function N(){var L=[],F;do{if((F=a())!=='"'&&F!=="'")throw C(F);L.push(a()),u(F),F=s()}while(F==='"'||F==="'");return L.join("")}function I(L){var F=a();switch(F){case"'":case'"':return o(F),N();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return x(F,!0)}catch{if(L&&zi.test(F))return F;throw C(F,"value")}}function M(L,F){var H,X;do F&&((H=s())==='"'||H==="'")?L.push(N()):L.push([X=U(a()),u("to",!0)?U(a()):X]);while(u(",",!0));var Y={options:void 0};Y.setOption=function(fe,je){this.options===void 0&&(this.options={}),this.options[fe]=je},Ee(Y,function(je){if(je==="option")me(Y,je),u(";");else throw C(je)},function(){$e(Y)})}function x(L,F){var H=1;switch(L.charAt(0)==="-"&&(H=-1,L=L.substring(1)),L){case"inf":case"INF":case"Inf":return H*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(_z.test(L))return H*parseInt(L,10);if(Nz.test(L))return H*parseInt(L,16);if(Oz.test(L))return H*parseInt(L,8);if(Pz.test(L))return H*parseFloat(L);throw C(L,"number",F)}function U(L,F){switch(L){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!F&&L.charAt(0)==="-")throw C(L,"id");if(Az.test(L))return parseInt(L,10);if(Iz.test(L))return parseInt(L,16);if(Rz.test(L))return parseInt(L,8);throw C(L,"id")}function G(){if(d!==void 0)throw C("package");if(d=a(),!zi.test(d))throw C(d,"name");b=b.define(d),u(";")}function le(){var L=s(),F;switch(L){case"weak":F=h||(h=[]),a();break;case"public":a();default:F=f||(f=[]);break}L=N(),u(";"),F.push(L)}function j(){if(u("="),g=N(),p=g==="proto3",!p&&g!=="proto2")throw C(g,"syntax");u(";")}function w(L,F){switch(F){case"option":return me(L,F),u(";"),!0;case"message":return D(L,F),!0;case"enum":return se(L,F),!0;case"service":return Qe(L,F),!0;case"extend":return _n(L,F),!0}return!1}function Ee(L,F,H){var X=i.line;if(L&&(typeof L.comment!="string"&&(L.comment=l()),L.filename=Aa.filename),u("{",!0)){for(var Y;(Y=a())!=="}";)F(Y);u(";",!0)}else H&&H(),u(";"),L&&(typeof L.comment!="string"||r)&&(L.comment=l(X)||L.comment)}function D(L,F){if(!Gi.test(F=a()))throw C(F,"type name");var H=new IB(F);Ee(H,function(Y){if(!w(H,Y))switch(Y){case"map":q(H,Y);break;case"required":case"repeated":E(H,Y);break;case"optional":p?E(H,"proto3_optional"):E(H,"optional");break;case"oneof":ne(H,Y);break;case"extensions":M(H.extensions||(H.extensions=[]));break;case"reserved":M(H.reserved||(H.reserved=[]),!0);break;default:if(!p||!zi.test(Y))throw C(Y);o(Y),E(H,"optional");break}}),L.add(H)}function E(L,F,H){var X=a();if(X==="group"){R(L,F);return}for(;X.endsWith(".")||s().startsWith(".");)X+=a();if(!zi.test(X))throw C(X,"type");var Y=a();if(!Gi.test(Y))throw C(Y,"name");Y=v(Y),u("=");var fe=new OB(Y,U(a()),X,F,H);if(Ee(fe,function(Xn){if(Xn==="option")me(fe,Xn),u(";");else throw C(Xn)},function(){$e(fe)}),F==="proto3_optional"){var je=new RB("_"+Y);fe.setOption("proto3_optional",!0),je.add(fe),L.add(je)}else L.add(fe);!p&&fe.repeated&&(zC.packed[X]!==void 0||zC.basic[X]===void 0)&&fe.setOption("packed",!1,!0)}function R(L,F){var H=a();if(!Gi.test(H))throw C(H,"name");var X=QC.lcFirst(H);H===X&&(H=QC.ucFirst(H)),u("=");var Y=U(a()),fe=new IB(H);fe.group=!0;var je=new OB(X,Y,H,F);je.filename=Aa.filename,Ee(fe,function(Xn){switch(Xn){case"option":me(fe,Xn),u(";");break;case"required":case"repeated":E(fe,Xn);break;case"optional":p?E(fe,"proto3_optional"):E(fe,"optional");break;case"message":D(fe,Xn);break;case"enum":se(fe,Xn);break;default:throw C(Xn)}}),L.add(fe).add(je)}function q(L){u("<");var F=a();if(zC.mapKey[F]===void 0)throw C(F,"type");u(",");var H=a();if(!zi.test(H))throw C(H,"type");u(">");var X=a();if(!Gi.test(X))throw C(X,"name");u("=");var Y=new Tz(v(X),U(a()),F,H);Ee(Y,function(je){if(je==="option")me(Y,je),u(";");else throw C(je)},function(){$e(Y)}),L.add(Y)}function ne(L,F){if(!Gi.test(F=a()))throw C(F,"name");var H=new RB(v(F));Ee(H,function(Y){Y==="option"?(me(H,Y),u(";")):(o(Y),E(H,"optional"))}),L.add(H)}function se(L,F){if(!Gi.test(F=a()))throw C(F,"name");var H=new Ez(F);Ee(H,function(Y){switch(Y){case"option":me(H,Y),u(";");break;case"reserved":M(H.reserved||(H.reserved=[]),!0);break;default:ce(H,Y)}}),L.add(H)}function ce(L,F){if(!Gi.test(F))throw C(F,"name");u("=");var H=U(a(),!0),X={options:void 0};X.setOption=function(Y,fe){this.options===void 0&&(this.options={}),this.options[Y]=fe},Ee(X,function(fe){if(fe==="option")me(X,fe),u(";");else throw C(fe)},function(){$e(X)}),L.add(F,H,X.comment,X.options)}function me(L,F){var H=u("(",!0);if(!zi.test(F=a()))throw C(F,"name");var X=F,Y=X,fe;H&&(u(")"),X="("+X+")",Y=X,F=s(),wz.test(F)&&(fe=F.slice(1),X+=F,a())),u("=");var je=Ve(L,X);Le(L,Y,je,fe)}function Ve(L,F){if(u("{",!0)){for(var H={};!u("}",!0);){if(!Gi.test(Nt=a()))throw C(Nt,"name");if(Nt===null)throw C(Nt,"end of input");var X,Y=Nt;if(u(":",!0),s()==="{")X=Ve(L,F+"."+Nt);else if(s()==="["){X=[];var fe;if(u("[",!0)){do fe=I(!0),X.push(fe);while(u(",",!0));u("]"),typeof fe<"u"&&Ae(L,F+"."+Nt,fe)}}else X=I(!0),Ae(L,F+"."+Nt,X);var je=H[Y];je&&(X=[].concat(je).concat(X)),H[Y]=X,u(",",!0),u(";",!0)}return H}var qr=I(!0);return Ae(L,F,qr),qr}function Ae(L,F,H){L.setOption&&L.setOption(F,H)}function Le(L,F,H,X){L.setParsedOption&&L.setParsedOption(F,H,X)}function $e(L){if(u("[",!0)){do me(L,"option");while(u(",",!0));u("]")}return L}function Qe(L,F){if(!Gi.test(F=a()))throw C(F,"service name");var H=new Cz(F);Ee(H,function(Y){if(!w(H,Y))if(Y==="rpc")gt(H,Y);else throw C(Y)}),L.add(H)}function gt(L,F){var H=l(),X=F;if(!Gi.test(F=a()))throw C(F,"name");var Y=F,fe,je,qr,Xn;if(u("("),u("stream",!0)&&(je=!0),!zi.test(F=a())||(fe=F,u(")"),u("returns"),u("("),u("stream",!0)&&(Xn=!0),!zi.test(F=a())))throw C(F);qr=F,u(")");var Em=new kz(Y,X,fe,qr,je,Xn);Em.comment=H,Ee(Em,function(DT){if(DT==="option")me(Em,DT),u(";");else throw C(DT)}),L.add(Em)}function _n(L,F){if(!zi.test(F=a()))throw C(F,"reference");var H=F;Ee(null,function(Y){switch(Y){case"required":case"repeated":E(L,Y,H);break;case"optional":p?E(L,"proto3_optional",H):E(L,"optional",H);break;default:if(!p||!zi.test(Y))throw C(Y);o(Y),E(L,"optional",H);break}})}for(var Nt;(Nt=a())!==null;)switch(Nt){case"package":if(!c)throw C(Nt);G();break;case"import":if(!c)throw C(Nt);le();break;case"syntax":if(!c)throw C(Nt);j();break;case"option":me(b,Nt),u(";");break;default:if(w(b,Nt)){c=!1;continue}throw C(Nt)}return Aa.filename=null,{package:d,imports:f,weakImports:h,syntax:g,root:t}}});var DB=m((MEe,BB)=>{"use strict";BB.exports=Si;var xz=/\/|\./;function Si(e,t){xz.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),Si[e]=t}Si("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var xB;Si("duration",{Duration:xB={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});Si("timestamp",{Timestamp:xB});Si("empty",{Empty:{fields:{}}});Si("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}}}});Si("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}}}});Si("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});Si.get=function(t){return Si[t]||null}});var LB=m((LEe,MB)=>{"use strict";var ho=MB.exports=CB();ho.build="full";ho.tokenize=GC();ho.parse=wB();ho.common=DB();ho.Root._configure(ho.Type,ho.parse,ho.common)});var Sg=m((FEe,FB)=>{"use strict";FB.exports=LB()});var KC=m((UEe,Bz)=>{Bz.exports={nested:{google:{nested:{protobuf:{nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{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,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},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}}},DescriptorProto:{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}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},FieldDescriptorProto:{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}},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_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{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:{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},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8]]},FieldOptions:{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},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},UninterpretedOption:{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}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}}}}}}}}});var WB=m((Te,JB)=>{"use strict";var Rn=Sg();JB.exports=Te=Rn.descriptor=Rn.Root.fromJSON(KC()).lookup(".google.protobuf");var UB=Rn.Namespace,Uh=Rn.Root,Na=Rn.Enum,po=Rn.Type,mo=Rn.Field,Dz=Rn.MapField,bg=Rn.OneOf,qh=Rn.Service,Tg=Rn.Method;Uh.fromDescriptor=function(t){typeof t.length=="number"&&(t=Te.FileDescriptorSet.decode(t));var n=new Uh;if(t.file)for(var r,i,a=0,o;a<t.file.length;++a){if(i=n,(r=t.file[a]).package&&r.package.length&&(i=n.define(r.package)),r.name&&r.name.length&&n.files.push(i.filename=r.name),r.messageType)for(o=0;o<r.messageType.length;++o)i.add(po.fromDescriptor(r.messageType[o],r.syntax));if(r.enumType)for(o=0;o<r.enumType.length;++o)i.add(Na.fromDescriptor(r.enumType[o]));if(r.extension)for(o=0;o<r.extension.length;++o)i.add(mo.fromDescriptor(r.extension[o]));if(r.service)for(o=0;o<r.service.length;++o)i.add(qh.fromDescriptor(r.service[o]));var s=Ed(r.options,Te.FileOptions);if(s){var u=Object.keys(s);for(o=0;o<u.length;++o)i.setOption(u[o],s[u[o]])}}return n};Uh.prototype.toDescriptor=function(t){var n=Te.FileDescriptorSet.create();return qB(this,n.file,t),n};function qB(e,t,n){var r=Te.FileDescriptorProto.create({name:e.filename||(e.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});n&&(r.syntax=n),e instanceof Uh||(r.package=e.fullName.substring(1));for(var i=0,a;i<e.nestedArray.length;++i)(a=e._nestedArray[i])instanceof po?r.messageType.push(a.toDescriptor(n)):a instanceof Na?r.enumType.push(a.toDescriptor()):a instanceof mo?r.extension.push(a.toDescriptor(n)):a instanceof qh?r.service.push(a.toDescriptor()):a instanceof UB&&qB(a,t,n);r.options=Cd(e.options,Te.FileOptions),r.messageType.length+r.enumType.length+r.extension.length+r.service.length&&t.push(r)}var Mz=0;po.fromDescriptor=function(t,n){typeof t.length=="number"&&(t=Te.DescriptorProto.decode(t));var r=new po(t.name.length?t.name:"Type"+Mz++,Ed(t.options,Te.MessageOptions)),i;if(t.oneofDecl)for(i=0;i<t.oneofDecl.length;++i)r.add(bg.fromDescriptor(t.oneofDecl[i]));if(t.field)for(i=0;i<t.field.length;++i){var a=mo.fromDescriptor(t.field[i],n);r.add(a),t.field[i].hasOwnProperty("oneofIndex")&&r.oneofsArray[t.field[i].oneofIndex].add(a)}if(t.extension)for(i=0;i<t.extension.length;++i)r.add(mo.fromDescriptor(t.extension[i],n));if(t.nestedType)for(i=0;i<t.nestedType.length;++i)r.add(po.fromDescriptor(t.nestedType[i],n)),t.nestedType[i].options&&t.nestedType[i].options.mapEntry&&r.setOption("map_entry",!0);if(t.enumType)for(i=0;i<t.enumType.length;++i)r.add(Na.fromDescriptor(t.enumType[i]));if(t.extensionRange&&t.extensionRange.length)for(r.extensions=[],i=0;i<t.extensionRange.length;++i)r.extensions.push([t.extensionRange[i].start,t.extensionRange[i].end]);if(t.reservedRange&&t.reservedRange.length||t.reservedName&&t.reservedName.length){if(r.reserved=[],t.reservedRange)for(i=0;i<t.reservedRange.length;++i)r.reserved.push([t.reservedRange[i].start,t.reservedRange[i].end]);if(t.reservedName)for(i=0;i<t.reservedName.length;++i)r.reserved.push(t.reservedName[i])}return r};po.prototype.toDescriptor=function(t){var n=Te.DescriptorProto.create({name:this.name}),r;for(r=0;r<this.fieldsArray.length;++r){var i;if(n.field.push(i=this._fieldsArray[r].toDescriptor(t)),this._fieldsArray[r]instanceof Dz){var a=ZC(this._fieldsArray[r].keyType,this._fieldsArray[r].resolvedKeyType),o=ZC(this._fieldsArray[r].type,this._fieldsArray[r].resolvedType),s=o===11||o===14?this._fieldsArray[r].resolvedType&&VB(this.parent,this._fieldsArray[r].resolvedType)||this._fieldsArray[r].type:void 0;n.nestedType.push(Te.DescriptorProto.create({name:i.typeName,field:[Te.FieldDescriptorProto.create({name:"key",number:1,label:1,type:a}),Te.FieldDescriptorProto.create({name:"value",number:2,label:1,type:o,typeName:s})],options:Te.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 mo?n.field.push(this._nestedArray[r].toDescriptor(t)):this._nestedArray[r]instanceof po?n.nestedType.push(this._nestedArray[r].toDescriptor(t)):this._nestedArray[r]instanceof Na&&n.enumType.push(this._nestedArray[r].toDescriptor());if(this.extensions)for(r=0;r<this.extensions.length;++r)n.extensionRange.push(Te.DescriptorProto.ExtensionRange.create({start:this.extensions[r][0],end:this.extensions[r][1]}));if(this.reserved)for(r=0;r<this.reserved.length;++r)typeof this.reserved[r]=="string"?n.reservedName.push(this.reserved[r]):n.reservedRange.push(Te.DescriptorProto.ReservedRange.create({start:this.reserved[r][0],end:this.reserved[r][1]}));return n.options=Cd(this.options,Te.MessageOptions),n};var Lz=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;mo.fromDescriptor=function(t,n){if(typeof t.length=="number"&&(t=Te.DescriptorProto.decode(t)),typeof t.number!="number")throw Error("missing field id");var r;t.typeName&&t.typeName.length?r=t.typeName:r=Jz(t.type);var i;switch(t.label){case 1:i=void 0;break;case 2:i="required";break;case 3:i="repeated";break;default:throw Error("illegal label: "+t.label)}var a=t.extendee;t.extendee!==void 0&&(a=a.length?a:void 0);var o=new mo(t.name.length?t.name:"field"+t.number,t.number,r,i,a);if(o.options=Ed(t.options,Te.FieldOptions),t.defaultValue&&t.defaultValue.length){var s=t.defaultValue;switch(s){case"true":case"TRUE":s=!0;break;case"false":case"FALSE":s=!1;break;default:var u=Lz.exec(s);u&&(s=parseInt(s));break}o.setOption("default",s)}return Wz(t.type)&&(n==="proto3"?t.options&&!t.options.packed&&o.setOption("packed",!1):t.options&&t.options.packed||o.setOption("packed",!1)),o};mo.prototype.toDescriptor=function(t){var n=Te.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)n.type=11,n.typeName=Rn.util.ucFirst(this.name),n.label=3;else{switch(n.type=ZC(this.type,this.resolve().resolvedType)){case 10:case 11:case 14:n.typeName=this.resolvedType?VB(this.parent,this.resolvedType):this.type;break}switch(this.rule){case"repeated":n.label=3;break;case"required":n.label=2;break;default:n.label=1;break}}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=Cd(this.options,Te.FieldOptions),this.options.default!=null&&(n.defaultValue=String(this.options.default))),t==="proto3"?this.packed||((n.options||(n.options=Te.FieldOptions.create())).packed=!1):this.packed&&((n.options||(n.options=Te.FieldOptions.create())).packed=!0),n};var Fz=0;Na.fromDescriptor=function(t){typeof t.length=="number"&&(t=Te.EnumDescriptorProto.decode(t));var n={};if(t.value)for(var r=0;r<t.value.length;++r){var i=t.value[r].name,a=t.value[r].number||0;n[i&&i.length?i:"NAME"+a]=a}return new Na(t.name&&t.name.length?t.name:"Enum"+Fz++,n,Ed(t.options,Te.EnumOptions))};Na.prototype.toDescriptor=function(){for(var t=[],n=0,r=Object.keys(this.values);n<r.length;++n)t.push(Te.EnumValueDescriptorProto.create({name:r[n],number:this.values[r[n]]}));return Te.EnumDescriptorProto.create({name:this.name,value:t,options:Cd(this.options,Te.EnumOptions)})};var Uz=0;bg.fromDescriptor=function(t){return typeof t.length=="number"&&(t=Te.OneofDescriptorProto.decode(t)),new bg(t.name&&t.name.length?t.name:"oneof"+Uz++)};bg.prototype.toDescriptor=function(){return Te.OneofDescriptorProto.create({name:this.name})};var qz=0;qh.fromDescriptor=function(t){typeof t.length=="number"&&(t=Te.ServiceDescriptorProto.decode(t));var n=new qh(t.name&&t.name.length?t.name:"Service"+qz++,Ed(t.options,Te.ServiceOptions));if(t.method)for(var r=0;r<t.method.length;++r)n.add(Tg.fromDescriptor(t.method[r]));return n};qh.prototype.toDescriptor=function(){for(var t=[],n=0;n<this.methodsArray.length;++n)t.push(this._methodsArray[n].toDescriptor());return Te.ServiceDescriptorProto.create({name:this.name,method:t,options:Cd(this.options,Te.ServiceOptions)})};var Vz=0;Tg.fromDescriptor=function(t){return typeof t.length=="number"&&(t=Te.MethodDescriptorProto.decode(t)),new Tg(t.name&&t.name.length?t.name:"Method"+Vz++,"rpc",t.inputType,t.outputType,!!t.clientStreaming,!!t.serverStreaming,Ed(t.options,Te.MethodOptions))};Tg.prototype.toDescriptor=function(){return Te.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:Cd(this.options,Te.MethodOptions)})};function Jz(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)}function Wz(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}function ZC(e,t){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 Na)return 14;if(t instanceof po)return t.group?10:11;throw Error("illegal type: "+e)}function Ed(e,t){if(e){for(var n=[],r=0,i,a,o;r<t.fieldsArray.length;++r)(a=(i=t._fieldsArray[r]).name)!=="uninterpretedOption"&&e.hasOwnProperty(a)&&(o=e[a],i.resolvedType instanceof Na&&typeof o=="number"&&i.resolvedType.valuesById[o]!==void 0&&(o=i.resolvedType.valuesById[o]),n.push(Hz(a),o));return n.length?Rn.util.toObject(n):void 0}}function Cd(e,t){if(e){for(var n=[],r=0,i=Object.keys(e),a,o;r<i.length;++r)if(o=e[a=i[r]],a!=="default"){var s=t.fields[a];!s&&!(s=t.fields[a=Rn.util.camelCase(a)])||n.push(a,o)}return n.length?t.fromObject(Rn.util.toObject(n)):void 0}}function VB(e,t){var n=e.fullName.split("."),r=t.fullName.split("."),i=0,a=0,o=r.length-1;if(!(e instanceof Uh)&&t instanceof UB)for(;i<n.length&&a<o&&n[i]===r[a];){var s=t.lookup(n[i++],!0);if(s!==null&&s!==t)break;++a}else for(;i<n.length&&a<o&&n[i]===r[a];++i,++a);return r.slice(a).join(".")}function Hz(e){return e.substring(0,1)+e.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(t,n){return"_"+n.toLowerCase()})}});var HB=m((qEe,Gz)=>{Gz.exports={nested:{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}}}}}}}}});var GB=m((VEe,zz)=>{zz.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var zB=m((JEe,Qz)=>{Qz.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var YB=m(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.addCommonProtos=go.loadProtosWithOptionsSync=go.loadProtosWithOptions=void 0;var QB=xe("fs"),KB=xe("path"),kd=Sg();function ZB(e,t){let n=e.resolvePath;e.resolvePath=(r,i)=>{if(KB.isAbsolute(i))return i;for(let a of t){let o=KB.join(a,i);try{return QB.accessSync(o,QB.constants.R_OK),o}catch{continue}}return process.emitWarning(`${i} not found in any of the include paths ${t}`),n(r,i)}}async function Kz(e,t){let n=new kd.Root;if(t=t||{},t.includeDirs){if(!Array.isArray(t.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));ZB(n,t.includeDirs)}let r=await n.load(e,t);return r.resolveAll(),r}go.loadProtosWithOptions=Kz;function Zz(e,t){let n=new kd.Root;if(t=t||{},t.includeDirs){if(!Array.isArray(t.includeDirs))throw new Error("The includeDirs option must be an array");ZB(n,t.includeDirs)}let r=n.loadSync(e,t);return r.resolveAll(),r}go.loadProtosWithOptionsSync=Zz;function Yz(){let e=HB(),t=KC(),n=GB(),r=zB();kd.common("api",e.nested.google.nested.protobuf.nested),kd.common("descriptor",t.nested.google.nested.protobuf.nested),kd.common("source_context",n.nested.google.nested.protobuf.nested),kd.common("type",r.nested.google.nested.protobuf.nested)}go.addCommonProtos=Yz});var XC=m(($B,YC)=>{"use strict";var XB=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function n(D,E,R){this.low=D|0,this.high=E|0,this.unsigned=!!R}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0});function r(D){return(D&&D.__isLong__)===!0}function i(D){var E=Math.clz32(D&-D);return D?31-E:E}n.isLong=r;var a={},o={};function s(D,E){var R,q,ne;return E?(D>>>=0,(ne=0<=D&&D<256)&&(q=o[D],q)?q:(R=l(D,0,!0),ne&&(o[D]=R),R)):(D|=0,(ne=-128<=D&&D<128)&&(q=a[D],q)?q:(R=l(D,D<0?-1:0,!1),ne&&(a[D]=R),R))}n.fromInt=s;function u(D,E){if(isNaN(D))return E?I:N;if(E){if(D<0)return I;if(D>=b)return le}else{if(D<=-v)return j;if(D+1>=v)return G}return D<0?u(-D,E).neg():l(D%p|0,D/p|0,E)}n.fromNumber=u;function l(D,E,R){return new n(D,E,R)}n.fromBits=l;var c=Math.pow;function d(D,E,R){if(D.length===0)throw Error("empty string");if(typeof E=="number"?(R=E,E=!1):E=!!E,D==="NaN"||D==="Infinity"||D==="+Infinity"||D==="-Infinity")return E?I:N;if(R=R||10,R<2||36<R)throw RangeError("radix");var q;if((q=D.indexOf("-"))>0)throw Error("interior hyphen");if(q===0)return d(D.substring(1),E,R).neg();for(var ne=u(c(R,8)),se=N,ce=0;ce<D.length;ce+=8){var me=Math.min(8,D.length-ce),Ve=parseInt(D.substring(ce,ce+me),R);if(me<8){var Ae=u(c(R,me));se=se.mul(Ae).add(u(Ve))}else se=se.mul(ne),se=se.add(u(Ve))}return se.unsigned=E,se}n.fromString=d;function f(D,E){return typeof D=="number"?u(D,E):typeof D=="string"?d(D,E):l(D.low,D.high,typeof E=="boolean"?E:D.unsigned)}n.fromValue=f;var h=65536,g=1<<24,p=h*h,b=p*p,v=b/2,C=s(g),N=s(0);n.ZERO=N;var I=s(0,!0);n.UZERO=I;var M=s(1);n.ONE=M;var x=s(1,!0);n.UONE=x;var U=s(-1);n.NEG_ONE=U;var G=l(-1,2147483647,!1);n.MAX_VALUE=G;var le=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=le;var j=l(0,-2147483648,!1);n.MIN_VALUE=j;var w=n.prototype;w.toInt=function(){return this.unsigned?this.low>>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},w.toString=function(E){if(E=E||10,E<2||36<E)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(j)){var R=u(E),q=this.div(R),ne=q.mul(R).sub(this);return q.toString(E)+ne.toInt().toString(E)}else return"-"+this.neg().toString(E);for(var se=u(c(E,6),this.unsigned),ce=this,me="";;){var Ve=ce.div(se),Ae=ce.sub(Ve.mul(se)).toInt()>>>0,Le=Ae.toString(E);if(ce=Ve,ce.isZero())return Le+me;for(;Le.length<6;)Le="0"+Le;me=""+Le+me}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(j)?64:this.neg().getNumBitsAbs();for(var E=this.high!=0?this.high:this.low,R=31;R>0&&!(E&1<<R);R--);return this.high!=0?R+33:R+1},w.isZero=function(){return this.high===0&&this.low===0},w.eqz=w.isZero,w.isNegative=function(){return!this.unsigned&&this.high<0},w.isPositive=function(){return this.unsigned||this.high>=0},w.isOdd=function(){return(this.low&1)===1},w.isEven=function(){return(this.low&1)===0},w.equals=function(E){return r(E)||(E=f(E)),this.unsigned!==E.unsigned&&this.high>>>31===1&&E.high>>>31===1?!1:this.high===E.high&&this.low===E.low},w.eq=w.equals,w.notEquals=function(E){return!this.eq(E)},w.neq=w.notEquals,w.ne=w.notEquals,w.lessThan=function(E){return this.comp(E)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(E){return this.comp(E)<=0},w.lte=w.lessThanOrEqual,w.le=w.lessThanOrEqual,w.greaterThan=function(E){return this.comp(E)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(E){return this.comp(E)>=0},w.gte=w.greaterThanOrEqual,w.ge=w.greaterThanOrEqual,w.compare=function(E){if(r(E)||(E=f(E)),this.eq(E))return 0;var R=this.isNegative(),q=E.isNegative();return R&&!q?-1:!R&&q?1:this.unsigned?E.high>>>0>this.high>>>0||E.high===this.high&&E.low>>>0>this.low>>>0?-1:1:this.sub(E).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(j)?j:this.not().add(M)},w.neg=w.negate,w.add=function(E){r(E)||(E=f(E));var R=this.high>>>16,q=this.high&65535,ne=this.low>>>16,se=this.low&65535,ce=E.high>>>16,me=E.high&65535,Ve=E.low>>>16,Ae=E.low&65535,Le=0,$e=0,Qe=0,gt=0;return gt+=se+Ae,Qe+=gt>>>16,gt&=65535,Qe+=ne+Ve,$e+=Qe>>>16,Qe&=65535,$e+=q+me,Le+=$e>>>16,$e&=65535,Le+=R+ce,Le&=65535,l(Qe<<16|gt,Le<<16|$e,this.unsigned)},w.subtract=function(E){return r(E)||(E=f(E)),this.add(E.neg())},w.sub=w.subtract,w.multiply=function(E){if(this.isZero())return this;if(r(E)||(E=f(E)),t){var R=t.mul(this.low,this.high,E.low,E.high);return l(R,t.get_high(),this.unsigned)}if(E.isZero())return this.unsigned?I:N;if(this.eq(j))return E.isOdd()?j:N;if(E.eq(j))return this.isOdd()?j:N;if(this.isNegative())return E.isNegative()?this.neg().mul(E.neg()):this.neg().mul(E).neg();if(E.isNegative())return this.mul(E.neg()).neg();if(this.lt(C)&&E.lt(C))return u(this.toNumber()*E.toNumber(),this.unsigned);var q=this.high>>>16,ne=this.high&65535,se=this.low>>>16,ce=this.low&65535,me=E.high>>>16,Ve=E.high&65535,Ae=E.low>>>16,Le=E.low&65535,$e=0,Qe=0,gt=0,_n=0;return _n+=ce*Le,gt+=_n>>>16,_n&=65535,gt+=se*Le,Qe+=gt>>>16,gt&=65535,gt+=ce*Ae,Qe+=gt>>>16,gt&=65535,Qe+=ne*Le,$e+=Qe>>>16,Qe&=65535,Qe+=se*Ae,$e+=Qe>>>16,Qe&=65535,Qe+=ce*Ve,$e+=Qe>>>16,Qe&=65535,$e+=q*Le+ne*Ae+se*Ve+ce*me,$e&=65535,l(gt<<16|_n,$e<<16|Qe,this.unsigned)},w.mul=w.multiply,w.divide=function(E){if(r(E)||(E=f(E)),E.isZero())throw Error("division by zero");if(t){if(!this.unsigned&&this.high===-2147483648&&E.low===-1&&E.high===-1)return this;var R=(this.unsigned?t.div_u:t.div_s)(this.low,this.high,E.low,E.high);return l(R,t.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?I:N;var q,ne,se;if(this.unsigned){if(E.unsigned||(E=E.toUnsigned()),E.gt(this))return I;if(E.gt(this.shru(1)))return x;se=I}else{if(this.eq(j)){if(E.eq(M)||E.eq(U))return j;if(E.eq(j))return M;var ce=this.shr(1);return q=ce.div(E).shl(1),q.eq(N)?E.isNegative()?M:U:(ne=this.sub(E.mul(q)),se=q.add(ne.div(E)),se)}else if(E.eq(j))return this.unsigned?I:N;if(this.isNegative())return E.isNegative()?this.neg().div(E.neg()):this.neg().div(E).neg();if(E.isNegative())return this.div(E.neg()).neg();se=N}for(ne=this;ne.gte(E);){q=Math.max(1,Math.floor(ne.toNumber()/E.toNumber()));for(var me=Math.ceil(Math.log(q)/Math.LN2),Ve=me<=48?1:c(2,me-48),Ae=u(q),Le=Ae.mul(E);Le.isNegative()||Le.gt(ne);)q-=Ve,Ae=u(q,this.unsigned),Le=Ae.mul(E);Ae.isZero()&&(Ae=M),se=se.add(Ae),ne=ne.sub(Le)}return se},w.div=w.divide,w.modulo=function(E){if(r(E)||(E=f(E)),t){var R=(this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,E.low,E.high);return l(R,t.get_high(),this.unsigned)}return this.sub(this.div(E).mul(E))},w.mod=w.modulo,w.rem=w.modulo,w.not=function(){return l(~this.low,~this.high,this.unsigned)},w.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},w.clz=w.countLeadingZeros,w.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},w.ctz=w.countTrailingZeros,w.and=function(E){return r(E)||(E=f(E)),l(this.low&E.low,this.high&E.high,this.unsigned)},w.or=function(E){return r(E)||(E=f(E)),l(this.low|E.low,this.high|E.high,this.unsigned)},w.xor=function(E){return r(E)||(E=f(E)),l(this.low^E.low,this.high^E.high,this.unsigned)},w.shiftLeft=function(E){return r(E)&&(E=E.toInt()),(E&=63)===0?this:E<32?l(this.low<<E,this.high<<E|this.low>>>32-E,this.unsigned):l(0,this.low<<E-32,this.unsigned)},w.shl=w.shiftLeft,w.shiftRight=function(E){return r(E)&&(E=E.toInt()),(E&=63)===0?this:E<32?l(this.low>>>E|this.high<<32-E,this.high>>E,this.unsigned):l(this.high>>E-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(E){return r(E)&&(E=E.toInt()),(E&=63)===0?this:E<32?l(this.low>>>E|this.high<<32-E,this.high>>>E,this.unsigned):E===32?l(this.high,0,this.unsigned):l(this.high>>>E-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.shr_u=w.shiftRightUnsigned,w.rotateLeft=function(E){var R;return r(E)&&(E=E.toInt()),(E&=63)===0?this:E===32?l(this.high,this.low,this.unsigned):E<32?(R=32-E,l(this.low<<E|this.high>>>R,this.high<<E|this.low>>>R,this.unsigned)):(E-=32,R=32-E,l(this.high<<E|this.low>>>R,this.low<<E|this.high>>>R,this.unsigned))},w.rotl=w.rotateLeft,w.rotateRight=function(E){var R;return r(E)&&(E=E.toInt()),(E&=63)===0?this:E===32?l(this.high,this.low,this.unsigned):E<32?(R=32-E,l(this.high<<R|this.low>>>E,this.low<<R|this.high>>>E,this.unsigned)):(E-=32,R=32-E,l(this.low<<R|this.high>>>E,this.high<<R|this.low>>>E,this.unsigned))},w.rotr=w.rotateRight,w.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},w.toBytes=function(E){return E?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var E=this.high,R=this.low;return[R&255,R>>>8&255,R>>>16&255,R>>>24,E&255,E>>>8&255,E>>>16&255,E>>>24]},w.toBytesBE=function(){var E=this.high,R=this.low;return[E>>>24,E>>>16&255,E>>>8&255,E&255,R>>>24,R>>>16&255,R>>>8&255,R&255]},n.fromBytes=function(E,R,q){return q?n.fromBytesLE(E,R):n.fromBytesBE(E,R)},n.fromBytesLE=function(E,R){return new n(E[0]|E[1]<<8|E[2]<<16|E[3]<<24,E[4]|E[5]<<8|E[6]<<16|E[7]<<24,R)},n.fromBytesBE=function(E,R){return new n(E[4]<<24|E[5]<<16|E[6]<<8|E[7],E[0]<<24|E[1]<<16|E[2]<<8|E[3],R)};var Ee=n;return e.default=Ee,"default"in e?e.default:e}({});typeof define=="function"&&define.amd?define([],function(){return XB}):typeof YC=="object"&&typeof $B=="object"&&(YC.exports=XB)});var aD=m(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.loadFileDescriptorSetFromObject=Bt.loadFileDescriptorSetFromBuffer=Bt.fromJSON=Bt.loadSync=Bt.load=Bt.IdempotencyLevel=Bt.isAnyExtension=Bt.Long=void 0;var Xz=Px(),Qi=Sg(),jC=WB(),ek=YB(),$z=XC();Bt.Long=$z;function jz(e){return"@type"in e&&typeof e["@type"]=="string"}Bt.isAnyExtension=jz;var tD;(function(e){e.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",e.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",e.IDEMPOTENT="IDEMPOTENT"})(tD=Bt.IdempotencyLevel||(Bt.IdempotencyLevel={}));var nD={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function eQ(e,t){return e===""?t:e+"."+t}function tQ(e){return e instanceof Qi.Service||e instanceof Qi.Type||e instanceof Qi.Enum}function nQ(e){return e instanceof Qi.Namespace||e instanceof Qi.Root}function rD(e,t){let n=eQ(t,e.name);return tQ(e)?[[n,e]]:nQ(e)&&typeof e.nested<"u"?Object.keys(e.nested).map(r=>rD(e.nested[r],n)).reduce((r,i)=>r.concat(i),[]):[]}function jB(e,t){return function(r){return e.toObject(e.decode(r),t)}}function eD(e){return function(n){if(Array.isArray(n))throw new Error(`Failed to serialize message: expected object with ${e.name} structure, got array instead`);let r=e.fromObject(n);return e.encode(r).finish()}}function rQ(e){return(e||[]).reduce((t,n)=>{for(let[r,i]of Object.entries(n))switch(r){case"uninterpreted_option":t.uninterpreted_option.push(n.uninterpreted_option);break;default:t[r]=i}return t},{deprecated:!1,idempotency_level:tD.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function iQ(e,t,n,r){let i=e.resolvedRequestType,a=e.resolvedResponseType;return{path:"/"+t+"/"+e.name,requestStream:!!e.requestStream,responseStream:!!e.responseStream,requestSerialize:eD(i),requestDeserialize:jB(i,n),responseSerialize:eD(a),responseDeserialize:jB(a,n),originalName:Xz(e.name),requestType:$C(i,r),responseType:$C(a,r),options:rQ(e.parsedOptions)}}function aQ(e,t,n,r){let i={};for(let a of e.methodsArray)i[a.name]=iQ(a,t,n,r);return i}function $C(e,t){let n=e.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:n.$type.toObject(n,nD),fileDescriptorProtos:t}}function oQ(e,t){let n=e.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:n.$type.toObject(n,nD),fileDescriptorProtos:t}}function sQ(e,t,n,r){if(e instanceof Qi.Service)return aQ(e,t,n,r);if(e instanceof Qi.Type)return $C(e,r);if(e instanceof Qi.Enum)return oQ(e,r);throw new Error("Type mismatch in reflection object handling")}function Eg(e,t){let n={};e.resolveAll();let i=e.toDescriptor("proto3").file.map(a=>Buffer.from(jC.FileDescriptorProto.encode(a).finish()));for(let[a,o]of rD(e,""))n[a]=sQ(o,a,t,i);return n}function iD(e,t){t=t||{};let n=Qi.Root.fromDescriptor(e);return n.resolveAll(),Eg(n,t)}function uQ(e,t){return(0,ek.loadProtosWithOptions)(e,t).then(n=>Eg(n,t))}Bt.load=uQ;function lQ(e,t){let n=(0,ek.loadProtosWithOptionsSync)(e,t);return Eg(n,t)}Bt.loadSync=lQ;function cQ(e,t){t=t||{};let n=Qi.Root.fromJSON(e);return n.resolveAll(),Eg(n,t)}Bt.fromJSON=cQ;function dQ(e,t){let n=jC.FileDescriptorSet.decode(e);return iD(n,t)}Bt.loadFileDescriptorSetFromBuffer=dQ;function fQ(e,t){let n=jC.FileDescriptorSet.fromObject(e);return iD(n,t)}Bt.loadFileDescriptorSetFromObject=fQ;(0,ek.addCommonProtos)()});var Js=m(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.setup=qe.getChannelzServiceDefinition=qe.getChannelzHandlers=qe.unregisterChannelzRef=qe.registerChannelzSocket=qe.registerChannelzServer=qe.registerChannelzSubchannel=qe.registerChannelzChannel=qe.ChannelzCallTrackerStub=qe.ChannelzCallTracker=qe.ChannelzChildrenTrackerStub=qe.ChannelzChildrenTracker=qe.ChannelzTrace=qe.ChannelzTraceStub=void 0;var oD=xe("net"),Vs=(jw(),Bi($w)),Vh=_r(),Jh=Ie(),hQ=Nr(),pQ=Zm(),mQ=fC();function tk(e){return{channel_id:e.id,name:e.name}}function ok(e){return{subchannel_id:e.id,name:e.name}}function gQ(e){return{server_id:e.id}}function Ag(e){return{socket_id:e.id,name:e.name}}var sD=32,sk=100,nk=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Ki(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};qe.ChannelzTraceStub=nk;var rk=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(t,n,r){let i=new Date;this.events.push({description:n,severity:t,timestamp:i,childChannel:r?.kind==="channel"?r:void 0,childSubchannel:r?.kind==="subchannel"?r:void 0}),this.events.length>=sD*2&&(this.events=this.events.slice(sD)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Ki(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(t=>({description:t.description,severity:t.severity,timestamp:Ki(t.timestamp),channel_ref:t.childChannel?tk(t.childChannel):null,subchannel_ref:t.childSubchannel?ok(t.childSubchannel):null}))}}};qe.ChannelzTrace=rk;var kg=class{constructor(){this.channelChildren=new Vs.OrderedMap,this.subchannelChildren=new Vs.OrderedMap,this.socketChildren=new Vs.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(t){let n=this.trackerMap[t.kind],r=n.find(t.id);r.equals(n.end())?n.setElement(t.id,{ref:t,count:1},r):r.pointer[1].count+=1}unrefChild(t){let n=this.trackerMap[t.kind],r=n.getElementByKey(t.id);r!==void 0&&(r.count-=1,r.count===0&&n.eraseElementByKey(t.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};qe.ChannelzChildrenTracker=kg;var ik=class extends kg{refChild(){}unrefChild(){}};qe.ChannelzChildrenTrackerStub=ik;var _g=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};qe.ChannelzCallTracker=_g;var ak=class extends _g{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};qe.ChannelzCallTrackerStub=ak;var Ia={channel:new Vs.OrderedMap,subchannel:new Vs.OrderedMap,server:new Vs.OrderedMap,socket:new Vs.OrderedMap},Ng=e=>{let t=1;function n(){return t++}let r=Ia[e];return(i,a,o)=>{let s=n(),u={id:s,name:i,kind:e};return o&&r.setElement(s,{ref:u,getInfo:a}),u}};qe.registerChannelzChannel=Ng("channel");qe.registerChannelzSubchannel=Ng("subchannel");qe.registerChannelzServer=Ng("server");qe.registerChannelzSocket=Ng("socket");function yQ(e){Ia[e.kind].eraseElementByKey(e.id)}qe.unregisterChannelzRef=yQ;function vQ(e){let t=Number.parseInt(e,16);return[t/256|0,t%256]}function uD(e){if(e==="")return[];let t=e.split(":").map(r=>vQ(r));return[].concat(...t)}function SQ(e){if((0,oD.isIPv4)(e))return Buffer.from(Uint8Array.from(e.split(".").map(t=>Number.parseInt(t))));if((0,oD.isIPv6)(e)){let t,n,r=e.indexOf("::");r===-1?(t=e,n=""):(t=e.substring(0,r),n=e.substring(r+2));let i=Buffer.from(uD(t)),a=Buffer.from(uD(n)),o=Buffer.alloc(16-i.length-a.length,0);return Buffer.concat([i,o,a])}else return null}function cD(e){switch(e){case Vh.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case Vh.ConnectivityState.IDLE:return{state:"IDLE"};case Vh.ConnectivityState.READY:return{state:"READY"};case Vh.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case Vh.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function Ki(e){if(!e)return null;let t=e.getTime();return{seconds:t/1e3|0,nanos:t%1e3*1e6}}function dD(e){let t=e.getInfo(),n=[],r=[];return t.children.channels.forEach(i=>{n.push(tk(i[1].ref))}),t.children.subchannels.forEach(i=>{r.push(ok(i[1].ref))}),{ref:tk(e.ref),data:{target:t.target,state:cD(t.state),calls_started:t.callTracker.callsStarted,calls_succeeded:t.callTracker.callsSucceeded,calls_failed:t.callTracker.callsFailed,last_call_started_timestamp:Ki(t.callTracker.lastCallStartedTimestamp),trace:t.trace.getTraceMessage()},channel_ref:n,subchannel_ref:r}}function bQ(e,t){let n=parseInt(e.request.channel_id,10),r=Ia.channel.getElementByKey(n);if(r===void 0){t({code:Jh.Status.NOT_FOUND,details:"No channel data found for id "+n});return}t(null,{channel:dD(r)})}function TQ(e,t){let n=parseInt(e.request.max_results,10)||sk,r=[],i=parseInt(e.request.start_channel_id,10),a=Ia.channel,o;for(o=a.lowerBound(i);!o.equals(a.end())&&r.length<n;o=o.next())r.push(dD(o.pointer[1]));t(null,{channel:r,end:o.equals(a.end())})}function fD(e){let t=e.getInfo(),n=[];return t.listenerChildren.sockets.forEach(r=>{n.push(Ag(r[1].ref))}),{ref:gQ(e.ref),data:{calls_started:t.callTracker.callsStarted,calls_succeeded:t.callTracker.callsSucceeded,calls_failed:t.callTracker.callsFailed,last_call_started_timestamp:Ki(t.callTracker.lastCallStartedTimestamp),trace:t.trace.getTraceMessage()},listen_socket:n}}function EQ(e,t){let n=parseInt(e.request.server_id,10),i=Ia.server.getElementByKey(n);if(i===void 0){t({code:Jh.Status.NOT_FOUND,details:"No server data found for id "+n});return}t(null,{server:fD(i)})}function CQ(e,t){let n=parseInt(e.request.max_results,10)||sk,r=parseInt(e.request.start_server_id,10),i=Ia.server,a=[],o;for(o=i.lowerBound(r);!o.equals(i.end())&&a.length<n;o=o.next())a.push(fD(o.pointer[1]));t(null,{server:a,end:o.equals(i.end())})}function kQ(e,t){let n=parseInt(e.request.subchannel_id,10),r=Ia.subchannel.getElementByKey(n);if(r===void 0){t({code:Jh.Status.NOT_FOUND,details:"No subchannel data found for id "+n});return}let i=r.getInfo(),a=[];i.children.sockets.forEach(s=>{a.push(Ag(s[1].ref))});let o={ref:ok(r.ref),data:{target:i.target,state:cD(i.state),calls_started:i.callTracker.callsStarted,calls_succeeded:i.callTracker.callsSucceeded,calls_failed:i.callTracker.callsFailed,last_call_started_timestamp:Ki(i.callTracker.lastCallStartedTimestamp),trace:i.trace.getTraceMessage()},socket_ref:a};t(null,{subchannel:o})}function lD(e){var t;return(0,hQ.isTcpSubchannelAddress)(e)?{address:"tcpip_address",tcpip_address:{ip_address:(t=SQ(e.host))!==null&&t!==void 0?t:void 0,port:e.port}}:{address:"uds_address",uds_address:{filename:e.path}}}function _Q(e,t){var n,r,i,a,o;let s=parseInt(e.request.socket_id,10),u=Ia.socket.getElementByKey(s);if(u===void 0){t({code:Jh.Status.NOT_FOUND,details:"No socket data found for id "+s});return}let l=u.getInfo(),c=l.security?{model:"tls",tls:{cipher_suite:l.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(n=l.security.cipherSuiteStandardName)!==null&&n!==void 0?n:void 0,other_name:(r=l.security.cipherSuiteOtherName)!==null&&r!==void 0?r:void 0,local_certificate:(i=l.security.localCertificate)!==null&&i!==void 0?i:void 0,remote_certificate:(a=l.security.remoteCertificate)!==null&&a!==void 0?a:void 0}}:null,d={ref:Ag(u.ref),local:l.localAddress?lD(l.localAddress):null,remote:l.remoteAddress?lD(l.remoteAddress):null,remote_name:(o=l.remoteName)!==null&&o!==void 0?o:void 0,security:c,data:{keep_alives_sent:l.keepAlivesSent,streams_started:l.streamsStarted,streams_succeeded:l.streamsSucceeded,streams_failed:l.streamsFailed,last_local_stream_created_timestamp:Ki(l.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Ki(l.lastRemoteStreamCreatedTimestamp),messages_received:l.messagesReceived,messages_sent:l.messagesSent,last_message_received_timestamp:Ki(l.lastMessageReceivedTimestamp),last_message_sent_timestamp:Ki(l.lastMessageSentTimestamp),local_flow_control_window:l.localFlowControlWindow?{value:l.localFlowControlWindow}:null,remote_flow_control_window:l.remoteFlowControlWindow?{value:l.remoteFlowControlWindow}:null}};t(null,{socket:d})}function AQ(e,t){let n=parseInt(e.request.server_id,10),r=Ia.server.getElementByKey(n);if(r===void 0){t({code:Jh.Status.NOT_FOUND,details:"No server data found for id "+n});return}let i=parseInt(e.request.start_socket_id,10),a=parseInt(e.request.max_results,10)||sk,s=r.getInfo().sessionChildren.sockets,u=[],l;for(l=s.lowerBound(i);!l.equals(s.end())&&u.length<a;l=l.next())u.push(Ag(l.pointer[1].ref));t(null,{socket_ref:u,end:l.equals(s.end())})}function hD(){return{GetChannel:bQ,GetTopChannels:TQ,GetServer:EQ,GetServers:CQ,GetSubchannel:kQ,GetSocket:_Q,GetServerSockets:AQ}}qe.getChannelzHandlers=hD;var Cg=null;function pD(){if(Cg)return Cg;let e=aD().loadSync,t=e("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return Cg=(0,mQ.loadPackageDefinition)(t).grpc.channelz.v1.Channelz.service,Cg}qe.getChannelzServiceDefinition=pD;function NQ(){(0,pQ.registerAdminService)(pD,hD)}qe.setup=NQ});var mD=m(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});Og.Subchannel=void 0;var Ge=_r(),IQ=Ch(),uk=ut(),Ig=Ie(),OQ=rr(),RQ=Nr(),Zi=Js(),PQ="subchannel",wQ=~(1<<31),lk=class{constructor(t,n,r,i,a){var o;this.channelTarget=t,this.subchannelAddress=n,this.options=r,this.credentials=i,this.connector=a,this.connectivityState=Ge.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0;let s={initialDelay:r["grpc.initial_reconnect_backoff_ms"],maxDelay:r["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new IQ.BackoffTimeout(()=>{this.handleBackoffTimer()},s),this.backoffTimeout.unref(),this.subchannelAddressString=(0,RQ.subchannelAddressToString)(n),this.keepaliveTime=(o=r["grpc.keepalive_time_ms"])!==null&&o!==void 0?o:-1,r["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new Zi.ChannelzTraceStub,this.callTracker=new Zi.ChannelzCallTrackerStub,this.childrenTracker=new Zi.ChannelzChildrenTrackerStub,this.streamTracker=new Zi.ChannelzCallTrackerStub):(this.channelzTrace=new Zi.ChannelzTrace,this.callTracker=new Zi.ChannelzCallTracker,this.childrenTracker=new Zi.ChannelzChildrenTracker,this.streamTracker=new Zi.ChannelzCallTracker),this.channelzRef=(0,Zi.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(r,void 0,2)),i._ref()}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(t){uk.trace(Ig.LogVerbosity.DEBUG,PQ,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+t)}refTrace(t){uk.trace(Ig.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+t)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([Ge.ConnectivityState.TRANSIENT_FAILURE],Ge.ConnectivityState.CONNECTING):this.transitionToState([Ge.ConnectivityState.TRANSIENT_FAILURE],Ge.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let t=this.options;if(t["grpc.keepalive_time_ms"]){let n=Math.min(this.keepaliveTime,wQ);t=Object.assign(Object.assign({},t),{"grpc.keepalive_time_ms":n})}this.connector.connect(this.subchannelAddress,this.credentials,t).then(n=>{this.transitionToState([Ge.ConnectivityState.CONNECTING],Ge.ConnectivityState.READY)?(this.transport=n,this.channelzEnabled&&this.childrenTracker.refChild(n.getChannelzRef()),n.addDisconnectListener(r=>{this.transitionToState([Ge.ConnectivityState.READY],Ge.ConnectivityState.IDLE),r&&this.keepaliveTime>0&&(this.keepaliveTime*=2,uk.log(Ig.LogVerbosity.ERROR,`Connection to ${(0,OQ.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):n.shutdown()},n=>{this.transitionToState([Ge.ConnectivityState.CONNECTING],Ge.ConnectivityState.TRANSIENT_FAILURE,`${n}`)})}transitionToState(t,n,r){var i,a;if(t.indexOf(this.connectivityState)===-1)return!1;r?this.trace(Ge.ConnectivityState[this.connectivityState]+" -> "+Ge.ConnectivityState[n]+' with error "'+r+'"'):this.trace(Ge.ConnectivityState[this.connectivityState]+" -> "+Ge.ConnectivityState[n]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+Ge.ConnectivityState[n]);let o=this.connectivityState;switch(this.connectivityState=n,n){case Ge.ConnectivityState.READY:this.stopBackoff();break;case Ge.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case Ge.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(i=this.transport)===null||i===void 0||i.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case Ge.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(a=this.transport)===null||a===void 0||a.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${n}`)}for(let s of this.stateListeners)s(this,o,n,this.keepaliveTime,r);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0&&(this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,Zi.unregisterChannelzRef)(this.channelzRef),this.credentials._unref(),process.nextTick(()=>{this.transitionToState([Ge.ConnectivityState.CONNECTING,Ge.ConnectivityState.READY],Ge.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(t,n,r,i){if(!this.transport)throw new Error("Cannot create call, subchannel not READY");let a;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),a={onCallEnd:o=>{o.code===Ig.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):a={},this.transport.createCall(t,n,r,i,a)}startConnecting(){process.nextTick(()=>{this.transitionToState([Ge.ConnectivityState.IDLE],Ge.ConnectivityState.CONNECTING)||this.connectivityState===Ge.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(t){this.stateListeners.add(t)}removeConnectivityStateListener(t){this.stateListeners.delete(t)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([Ge.ConnectivityState.TRANSIENT_FAILURE],Ge.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(t){}removeHealthStateWatcher(t){}getRealSubchannel(){return this}realSubchannelEquals(t){return t.getRealSubchannel()===this}throttleKeepalive(t){t>this.keepaliveTime&&(this.keepaliveTime=t)}};Og.Subchannel=lk});var gD=m(Rg=>{"use strict";var ck;Object.defineProperty(Rg,"__esModule",{value:!0});Rg.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;Rg.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((ck=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&ck!==void 0?ck:"false")==="true"});var mk=m(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.setup=vo.DEFAULT_PORT=void 0;var yD=qi(),dk=xe("dns"),xQ=LE(),fk=Ie(),hk=Sn(),BQ=ut(),DQ=Ie(),yo=rr(),vD=xe("net"),MQ=Ch(),SD=gD(),LQ="dns_resolver";function Yi(e){BQ.trace(DQ.LogVerbosity.DEBUG,LQ,e)}vo.DEFAULT_PORT=443;var FQ=3e4,pk=class{constructor(t,n,r){var i,a,o;this.target=t,this.listener=n,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new dk.promises.Resolver,Yi("Resolver constructed for target "+(0,yo.uriToString)(t)),t.authority&&this.alternativeResolver.setServers([t.authority]);let s=(0,yo.splitHostPort)(t.path);s===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,vD.isIPv4)(s.host)||(0,vD.isIPv6)(s.host)?(this.ipResult=[{addresses:[{host:s.host,port:(i=s.port)!==null&&i!==void 0?i:vo.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=s.host,this.port=(a=s.port)!==null&&a!==void 0?a:vo.DEFAULT_PORT),this.percentage=Math.random()*100,r["grpc.service_config_disable_resolution"]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:fk.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,yo.uriToString)(this.target)}`,metadata:new hk.Metadata};let u={initialDelay:r["grpc.initial_reconnect_backoff_ms"],maxDelay:r["grpc.max_reconnect_backoff_ms"]};this.backoff=new MQ.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},u),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(o=r["grpc.dns_min_time_between_resolutions_ms"])!==null&&o!==void 0?o:FQ,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(Yi("Returning IP address for target "+(0,yo.uriToString)(this.target)),setImmediate(()=>{this.listener.onSuccessfulResolution(this.ipResult,null,null,null,{})}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)Yi("Failed to parse DNS address "+(0,yo.uriToString)(this.target)),setImmediate(()=>{this.listener.onError({code:fk.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,yo.uriToString)(this.target)}`,metadata:new hk.Metadata})}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;Yi("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let t=this.dnsHostname;this.pendingLookupPromise=this.lookup(t),this.pendingLookupPromise.then(n=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.backoff.reset(),this.backoff.stop(),this.latestLookupResult=n.map(i=>({addresses:[i]}));let r="["+n.map(i=>i.host+":"+i.port).join(",")+"]";if(Yi("Resolved addresses for target "+(0,yo.uriToString)(this.target)+": "+r),this.latestLookupResult.length===0){this.listener.onError(this.defaultResolutionError);return}this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})},n=>{this.pendingLookupPromise!==null&&(Yi("Resolution error for target "+(0,yo.uriToString)(this.target)+": "+n.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener.onError(this.defaultResolutionError))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(t),this.pendingTxtPromise.then(n=>{if(this.pendingTxtPromise!==null){this.pendingTxtPromise=null;try{this.latestServiceConfig=(0,xQ.extractAndSelectServiceConfig)(n,this.percentage)}catch(r){this.latestServiceConfigError={code:fk.Status.UNAVAILABLE,details:`Parsing service config failed with error ${r.message}`,metadata:new hk.Metadata}}this.latestLookupResult!==null&&this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})}},n=>{}))}}async lookup(t){if(SD.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){Yi("Using alternative DNS resolver.");let r=await Promise.allSettled([this.alternativeResolver.resolve4(t),this.alternativeResolver.resolve6(t)]);if(r.every(i=>i.status==="rejected"))throw new Error(r[0].reason);return r.reduce((i,a)=>a.status==="fulfilled"?[...i,...a.value]:i,[]).map(i=>({host:i,port:+this.port}))}return(await dk.promises.lookup(t,{all:!0})).map(r=>({host:r.address,port:+this.port}))}async resolveTxt(t){return SD.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(Yi("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(t)):dk.promises.resolveTxt(t)}startNextResolutionTimer(){var t,n;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(n=(t=this.nextResolutionTimer).unref)===null||n===void 0||n.call(t),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?Yi('resolution update delayed by "min time between resolutions" rate limit'):Yi("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.returnedIpResult=!1}static getDefaultAuthority(t){return t.path}};function UQ(){(0,yD.registerResolver)("dns",pk),(0,yD.registerDefaultScheme)("dns")}vo.setup=UQ});var gk=m(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.getProxiedConnection=Nd.mapProxyName=void 0;var Wh=ut(),_d=Ie(),qQ=qi(),VQ=xe("http"),JQ=xe("tls"),WQ=ut(),bD=Nr(),Ad=rr(),HQ=xe("url"),GQ=mk(),zQ="proxy";function So(e){WQ.trace(_d.LogVerbosity.DEBUG,zQ,e)}function QQ(){let e="",t="";if(process.env.grpc_proxy)t="grpc_proxy",e=process.env.grpc_proxy;else if(process.env.https_proxy)t="https_proxy",e=process.env.https_proxy;else if(process.env.http_proxy)t="http_proxy",e=process.env.http_proxy;else return{};let n;try{n=new HQ.URL(e)}catch{return(0,Wh.log)(_d.LogVerbosity.ERROR,`cannot parse value of "${t}" env var`),{}}if(n.protocol!=="http:")return(0,Wh.log)(_d.LogVerbosity.ERROR,`"${n.protocol}" scheme not supported in proxy URI`),{};let r=null;n.username&&(n.password?((0,Wh.log)(_d.LogVerbosity.INFO,"userinfo found in proxy URI"),r=decodeURIComponent(`${n.username}:${n.password}`)):r=n.username);let i=n.hostname,a=n.port;a===""&&(a="80");let o={address:`${i}:${a}`};return r&&(o.creds=r),So("Proxy server "+o.address+" set by environment variable "+t),o}function KQ(){let e=process.env.no_grpc_proxy,t="no_grpc_proxy";return e||(e=process.env.no_proxy,t="no_proxy"),e?(So("No proxy server list set by environment variable "+t),e.split(",")):[]}function ZQ(e,t){var n;let r={target:e,extraOptions:{}};if(((n=t["grpc.enable_http_proxy"])!==null&&n!==void 0?n:1)===0||e.scheme==="unix")return r;let i=QQ();if(!i.address)return r;let a=(0,Ad.splitHostPort)(e.path);if(!a)return r;let o=a.host;for(let u of KQ())if(u===o)return So("Not using proxy for target in no_proxy list: "+(0,Ad.uriToString)(e)),r;let s={"grpc.http_connect_target":(0,Ad.uriToString)(e)};return i.creds&&(s["grpc.http_connect_creds"]=i.creds),{target:{scheme:"dns",path:i.address},extraOptions:s}}Nd.mapProxyName=ZQ;function YQ(e,t,n){var r;if(!("grpc.http_connect_target"in t))return Promise.resolve({});let i=t["grpc.http_connect_target"],a=(0,Ad.parseUri)(i);if(a===null)return Promise.resolve({});let o=(0,Ad.splitHostPort)(a.path);if(o===null)return Promise.resolve({});let s=`${o.host}:${(r=o.port)!==null&&r!==void 0?r:GQ.DEFAULT_PORT}`,u={method:"CONNECT",path:s},l={Host:s};(0,bD.isTcpSubchannelAddress)(e)?(u.host=e.host,u.port=e.port):u.socketPath=e.path,"grpc.http_connect_creds"in t&&(l["Proxy-Authorization"]="Basic "+Buffer.from(t["grpc.http_connect_creds"]).toString("base64")),u.headers=l;let c=(0,bD.subchannelAddressToString)(e);return So("Using proxy "+c+" to connect to "+u.path),new Promise((d,f)=>{let h=VQ.request(u);h.once("connect",(g,p,b)=>{var v;if(h.removeAllListeners(),p.removeAllListeners(),g.statusCode===200)if(So("Successfully connected to "+u.path+" through proxy "+c),b.length>0&&p.unshift(b),"secureContext"in n){let C=(0,qQ.getDefaultAuthority)(a),N=(0,Ad.splitHostPort)(C),I=(v=N?.host)!==null&&v!==void 0?v:C,M=JQ.connect(Object.assign({host:I,servername:I,socket:p},n),()=>{So("Successfully established a TLS connection to "+u.path+" through proxy "+c),d({socket:M,realTarget:a})});M.on("error",x=>{So("Failed to establish a TLS connection to "+u.path+" through proxy "+c+" with error "+x.message),f()})}else So("Successfully established a plaintext connection to "+u.path+" through proxy "+c),d({socket:p,realTarget:a});else(0,Wh.log)(_d.LogVerbosity.ERROR,"Failed to connect to "+u.path+" through proxy "+c+" with status "+g.statusCode),f()}),h.once("error",g=>{h.removeAllListeners(),(0,Wh.log)(_d.LogVerbosity.ERROR,"Failed to connect to proxy "+c+" with error "+g.message),f()}),h.end()})}Nd.getProxiedConnection=YQ});var vk=m(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.StreamDecoder=void 0;var Xi;(function(e){e[e.NO_DATA=0]="NO_DATA",e[e.READING_SIZE=1]="READING_SIZE",e[e.READING_MESSAGE=2]="READING_MESSAGE"})(Xi||(Xi={}));var yk=class{constructor(t){this.maxReadMessageLength=t,this.readState=Xi.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(t){let n=0,r,i=[];for(;n<t.length;)switch(this.readState){case Xi.NO_DATA:this.readCompressFlag=t.slice(n,n+1),n+=1,this.readState=Xi.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case Xi.READING_SIZE:if(r=Math.min(t.length-n,this.readSizeRemaining),t.copy(this.readPartialSize,4-this.readSizeRemaining,n,n+r),this.readSizeRemaining-=r,n+=r,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=Xi.READING_MESSAGE;else{let a=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=Xi.NO_DATA,i.push(a)}}break;case Xi.READING_MESSAGE:if(r=Math.min(t.length-n,this.readMessageRemaining),this.readPartialMessage.push(t.slice(n,n+r)),this.readMessageRemaining-=r,n+=r,this.readMessageRemaining===0){let a=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),o=Buffer.concat(a,this.readMessageSize+5);this.readState=Xi.NO_DATA,i.push(o)}break;default:throw new Error("Unexpected read state")}return i}};Pg.StreamDecoder=yk});var ED=m(wg=>{"use strict";Object.defineProperty(wg,"__esModule",{value:!0});wg.Http2SubchannelCall=void 0;var Oa=xe("http2"),XQ=xe("os"),Ye=Ie(),Ra=Sn(),$Q=vk(),jQ=ut(),eK=Ie(),tK="subchannel_call";function nK(e){for(let[t,n]of Object.entries(XQ.constants.errno))if(n===e)return t;return"Unknown system error "+e}function TD(e){let t=`Received HTTP status code ${e}`,n;switch(e){case 400:n=Ye.Status.INTERNAL;break;case 401:n=Ye.Status.UNAUTHENTICATED;break;case 403:n=Ye.Status.PERMISSION_DENIED;break;case 404:n=Ye.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:n=Ye.Status.UNAVAILABLE;break;default:n=Ye.Status.UNKNOWN}return{code:n,details:t,metadata:new Ra.Metadata}}var Sk=class{constructor(t,n,r,i,a){var o;this.http2Stream=t,this.callEventTracker=n,this.listener=r,this.transport=i,this.callId=a,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1;let s=(o=i.getOptions()["grpc.max_receive_message_length"])!==null&&o!==void 0?o:Ye.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new $Q.StreamDecoder(s),t.on("response",(u,l)=>{let c="";for(let d of Object.keys(u))c+=" "+d+": "+u[d]+`
17
- `;if(this.trace(`Received server headers:
18
- `+c),this.httpStatusCode=u[":status"],l&Oa.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(u);else{let d;try{d=Ra.Metadata.fromHttp2Headers(u)}catch(f){this.endCall({code:Ye.Status.UNKNOWN,details:f.message,metadata:new Ra.Metadata});return}this.listener.onReceiveMetadata(d)}}),t.on("trailers",u=>{this.handleTrailers(u)}),t.on("data",u=>{if(this.statusOutput)return;this.trace("receive HTTP/2 data frame of length "+u.length);let l;try{l=this.decoder.write(u)}catch(c){this.cancelWithStatus(Ye.Status.RESOURCE_EXHAUSTED,c.message);return}for(let c of l)this.trace("parsed message of length "+c.length),this.callEventTracker.addMessageReceived(),this.tryPush(c)}),t.on("end",()=>{this.readsClosed=!0,this.maybeOutputStatus()}),t.on("close",()=>{this.serverEndedCall=!0,process.nextTick(()=>{var u;if(this.trace("HTTP/2 stream closed with code "+t.rstCode),((u=this.finalStatus)===null||u===void 0?void 0:u.code)===Ye.Status.OK)return;let l,c="";switch(t.rstCode){case Oa.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let d=TD(this.httpStatusCode);l=d.code,c=d.details}else l=Ye.Status.INTERNAL,c=`Received RST_STREAM with code ${t.rstCode} (Call ended without gRPC status)`;break;case Oa.constants.NGHTTP2_REFUSED_STREAM:l=Ye.Status.UNAVAILABLE,c="Stream refused by server";break;case Oa.constants.NGHTTP2_CANCEL:l=Ye.Status.CANCELLED,c="Call cancelled";break;case Oa.constants.NGHTTP2_ENHANCE_YOUR_CALM:l=Ye.Status.RESOURCE_EXHAUSTED,c="Bandwidth exhausted or memory limit exceeded";break;case Oa.constants.NGHTTP2_INADEQUATE_SECURITY:l=Ye.Status.PERMISSION_DENIED,c="Protocol not secure enough";break;case Oa.constants.NGHTTP2_INTERNAL_ERROR:l=Ye.Status.INTERNAL,this.internalError===null?c=`Received RST_STREAM with code ${t.rstCode} (Internal server error)`:this.internalError.code==="ECONNRESET"||this.internalError.code==="ETIMEDOUT"?(l=Ye.Status.UNAVAILABLE,c=this.internalError.message):c=`Received RST_STREAM with code ${t.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:l=Ye.Status.INTERNAL,c=`Received RST_STREAM with code ${t.rstCode}`}this.endCall({code:l,details:c,metadata:new Ra.Metadata,rstCode:t.rstCode})})}),t.on("error",u=>{u.code!=="ERR_HTTP2_STREAM_ERROR"&&(this.trace("Node error event: message="+u.message+" code="+u.code+" errno="+nK(u.errno)+" syscall="+u.syscall),this.internalError=u),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.endCall({code:Ye.Status.UNAVAILABLE,details:"Connection dropped",metadata:new Ra.Metadata})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace("ended with status: code="+this.finalStatus.code+' details="'+this.finalStatus.details+'"'),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=>{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(t){jQ.trace(eK.LogVerbosity.DEBUG,tK,"["+this.callId+"] "+t)}endCall(t){(this.finalStatus===null||this.finalStatus.code===Ye.Status.OK)&&(this.finalStatus=t,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&&(this.finalStatus.code!==Ye.Status.OK||this.readsClosed&&this.unpushedReadMessages.length===0&&!this.isReadFilterPending&&!this.isPushPending)&&this.outputStatus()}push(t){this.trace("pushing to reader message of length "+(t instanceof Buffer?t.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=>{this.isPushPending=!1,!this.statusOutput&&(this.listener.onReceiveMessage(t),this.maybeOutputStatus())})}tryPush(t){this.canPush?(this.http2Stream.pause(),this.push(t)):(this.trace("unpushedReadMessages.push message of length "+t.length),this.unpushedReadMessages.push(t))}handleTrailers(t){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let n="";for(let o of Object.keys(t))n+=" "+o+": "+t[o]+`
19
- `;this.trace(`Received server trailers:
20
- `+n);let r;try{r=Ra.Metadata.fromHttp2Headers(t)}catch{r=new Ra.Metadata}let i=r.getMap(),a;if(typeof i["grpc-status"]=="string"){let o=Number(i["grpc-status"]);this.trace("received status code "+o+" from server"),r.remove("grpc-status");let s="";if(typeof i["grpc-message"]=="string"){try{s=decodeURI(i["grpc-message"])}catch{s=i["grpc-message"]}r.remove("grpc-message"),this.trace('received status details string "'+s+'" from server')}a={code:o,details:s,metadata:r}}else this.httpStatusCode?(a=TD(this.httpStatusCode),a.metadata=r):a={code:Ye.Status.UNKNOWN,details:"No status information received",metadata:r};this.endCall(a)}destroyHttp2Stream(){var t;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let n;((t=this.finalStatus)===null||t===void 0?void 0:t.code)===Ye.Status.OK?n=Oa.constants.NGHTTP2_NO_ERROR:n=Oa.constants.NGHTTP2_CANCEL,this.trace("close http2 stream with code "+n),this.http2Stream.close(n)}}cancelWithStatus(t,n){this.trace("cancelWithStatus code: "+t+' details: "'+n+'"'),this.endCall({code:t,details:n,metadata:new Ra.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}startRead(){if(this.finalStatus!==null&&this.finalStatus.code!==Ye.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let t=this.unpushedReadMessages.shift();this.push(t);return}this.http2Stream.resume()}sendMessageWithContext(t,n){this.trace("write() called with message of length "+n.length);let r=i=>{process.nextTick(()=>{var a;let o=Ye.Status.UNAVAILABLE;i?.code==="ERR_STREAM_WRITE_AFTER_END"&&(o=Ye.Status.INTERNAL),i&&this.cancelWithStatus(o,`Write error: ${i.message}`),(a=t.callback)===null||a===void 0||a.call(t)})};this.trace("sending data chunk of length "+n.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(n,r)}catch(i){this.endCall({code:Ye.Status.UNAVAILABLE,details:`Write failed with error ${i.message}`,metadata:new Ra.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}};wg.Http2SubchannelCall=Sk});var bk=m(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});xg.getNextCallNumber=void 0;var rK=0;function iK(){return rK++}xg.getNextCallNumber=iK});var _D=m(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.Http2SubchannelConnector=void 0;var kk=xe("http2"),CD=xe("tls"),Bg=Js(),Hh=Ie(),aK=gk(),Od=ut(),kD=qi(),Dg=Nr(),Id=rr(),oK=xe("net"),sK=ED(),uK=bk(),Tk="transport",lK="transport_flowctrl",cK=SE().version,{HTTP2_HEADER_AUTHORITY:dK,HTTP2_HEADER_CONTENT_TYPE:fK,HTTP2_HEADER_METHOD:hK,HTTP2_HEADER_PATH:pK,HTTP2_HEADER_TE:mK,HTTP2_HEADER_USER_AGENT:gK}=kk.constants,yK=2e4,vK=Buffer.from("too_many_pings","ascii"),Ek=class{constructor(t,n,r,i){this.session=t,this.options=r,this.remoteName=i,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,Dg.subchannelAddressToString)(n),r["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.streamTracker=new Bg.ChannelzCallTrackerStub):this.streamTracker=new Bg.ChannelzCallTracker,this.channelzRef=(0,Bg.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[r["grpc.primary_user_agent"],`grpc-node-js/${cK}`,r["grpc.secondary_user_agent"]].filter(a=>a).join(" "),"grpc.keepalive_time_ms"in r?this.keepaliveTimeMs=r["grpc.keepalive_time_ms"]:this.keepaliveTimeMs=-1,"grpc.keepalive_timeout_ms"in r?this.keepaliveTimeoutMs=r["grpc.keepalive_timeout_ms"]:this.keepaliveTimeoutMs=yK,"grpc.keepalive_permit_without_calls"in r?this.keepaliveWithoutCalls=r["grpc.keepalive_permit_without_calls"]===1:this.keepaliveWithoutCalls=!1,t.once("close",()=>{this.trace("session closed"),this.handleDisconnect()}),t.once("goaway",(a,o,s)=>{let u=!1;a===kk.constants.NGHTTP2_ENHANCE_YOUR_CALM&&s&&s.equals(vK)&&(u=!0),this.trace("connection closed by GOAWAY with code "+a+" and data "+s?.toString()),this.reportDisconnectToOwner(u)}),t.once("error",a=>{this.trace("connection closed with error "+a.message),this.handleDisconnect()}),Od.isTracerEnabled(Tk)&&(t.on("remoteSettings",a=>{this.trace("new settings received"+(this.session!==t?" on the old connection":"")+": "+JSON.stringify(a))}),t.on("localSettings",a=>{this.trace("local settings acknowledged by remote"+(this.session!==t?" on the old connection":"")+": "+JSON.stringify(a))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer()}getChannelzInfo(){var t,n,r;let i=this.session.socket,a=i.remoteAddress?(0,Dg.stringToSubchannelAddress)(i.remoteAddress,i.remotePort):null,o=i.localAddress?(0,Dg.stringToSubchannelAddress)(i.localAddress,i.localPort):null,s;if(this.session.encrypted){let l=i,c=l.getCipher(),d=l.getCertificate(),f=l.getPeerCertificate();s={cipherSuiteStandardName:(t=c.standardName)!==null&&t!==void 0?t:null,cipherSuiteOtherName:c.standardName?null:c.name,localCertificate:d&&"raw"in d?d.raw:null,remoteCertificate:f&&"raw"in f?f.raw:null}}else s=null;return{remoteAddress:a,localAddress:o,security:s,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:(n=this.session.state.localWindowSize)!==null&&n!==void 0?n:null,remoteFlowControlWindow:(r=this.session.state.remoteWindowSize)!==null&&r!==void 0?r:null}}trace(t){Od.trace(Hh.LogVerbosity.DEBUG,Tk,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+t)}keepaliveTrace(t){Od.trace(Hh.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+t)}flowControlTrace(t){Od.trace(Hh.LogVerbosity.DEBUG,lK,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+t)}internalsTrace(t){Od.trace(Hh.LogVerbosity.DEBUG,"transport_internals","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+t)}reportDisconnectToOwner(t){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(n=>n(t)))}handleDisconnect(){this.disconnectHandled||(this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1),setImmediate(()=>{for(let t of this.activeCalls)t.onDisconnect();this.session.destroy()}))}addDisconnectListener(t){this.disconnectListeners.push(t)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var t,n;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error("keepaliveTimeout is not null");return}this.channelzEnabled&&(this.keepalivesSent+=1),this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.keepaliveTrace("Ping timeout passed without response"),this.handleDisconnect()},this.keepaliveTimeoutMs),(n=(t=this.keepaliveTimer).unref)===null||n===void 0||n.call(t);let r="";try{this.session.ping((a,o,s)=>{this.clearKeepaliveTimeout(),a?(this.keepaliveTrace("Ping failed with error "+a.message),this.handleDisconnect()):(this.keepaliveTrace("Received ping response"),this.maybeStartKeepalivePingTimer())})||(r="Ping returned false")}catch(i){r=(i instanceof Error?i.message:"")||"Unknown error"}r&&(this.keepaliveTrace("Ping send failed: "+r),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var t,n;this.canSendPing()&&(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(n=(t=this.keepaliveTimer).unref)===null||n===void 0||n.call(t)))}clearKeepaliveTimeout(){this.keepaliveTimer&&(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(t){this.activeCalls.delete(t),this.activeCalls.size===0&&this.session.unref()}addActiveCall(t){this.activeCalls.add(t),this.activeCalls.size===1&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(t,n,r,i,a){let o=t.toHttp2Headers();o[dK]=n,o[gK]=this.userAgent,o[fK]="application/grpc",o[hK]="POST",o[pK]=r,o[mK]="trailers";let s;try{s=this.session.request(o)}catch(c){throw this.handleDisconnect(),c}this.flowControlTrace("local window size: "+this.session.state.localWindowSize+" remote window size: "+this.session.state.remoteWindowSize),this.internalsTrace("session.closed="+this.session.closed+" session.destroyed="+this.session.destroyed+" session.socket.destroyed="+this.session.socket.destroyed);let u,l;return this.channelzEnabled?(this.streamTracker.addCallStarted(),u={addMessageSent:()=>{var c;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(c=a.addMessageSent)===null||c===void 0||c.call(a)},addMessageReceived:()=>{var c;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(c=a.addMessageReceived)===null||c===void 0||c.call(a)},onCallEnd:c=>{var d;(d=a.onCallEnd)===null||d===void 0||d.call(a,c),this.removeActiveCall(l)},onStreamEnd:c=>{var d;c?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(d=a.onStreamEnd)===null||d===void 0||d.call(a,c)}}):u={addMessageSent:()=>{var c;(c=a.addMessageSent)===null||c===void 0||c.call(a)},addMessageReceived:()=>{var c;(c=a.addMessageReceived)===null||c===void 0||c.call(a)},onCallEnd:c=>{var d;(d=a.onCallEnd)===null||d===void 0||d.call(a,c),this.removeActiveCall(l)},onStreamEnd:c=>{var d;(d=a.onStreamEnd)===null||d===void 0||d.call(a,c)}},l=new sK.Http2SubchannelCall(s,u,i,this,(0,uK.getNextCallNumber)()),this.addActiveCall(l),l}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}shutdown(){this.session.close(),(0,Bg.unregisterChannelzRef)(this.channelzRef)}},Ck=class{constructor(t){this.channelTarget=t,this.session=null,this.isShutdown=!1}trace(t){Od.trace(Hh.LogVerbosity.DEBUG,Tk,(0,Id.uriToString)(this.channelTarget)+" "+t)}createSession(t,n,r,i){return this.isShutdown?Promise.reject():new Promise((a,o)=>{var s,u,l,c;let d;i.realTarget?(d=(0,Id.uriToString)(i.realTarget),this.trace("creating HTTP/2 session through proxy to "+(0,Id.uriToString)(i.realTarget))):(d=null,this.trace("creating HTTP/2 session to "+(0,Dg.subchannelAddressToString)(t)));let f=(0,kD.getDefaultAuthority)((s=i.realTarget)!==null&&s!==void 0?s:this.channelTarget),h=n._getConnectionOptions();if(!h){o("Credentials not loaded");return}h.maxSendHeaderBlockLength=Number.MAX_SAFE_INTEGER,"grpc-node.max_session_memory"in r?h.maxSessionMemory=r["grpc-node.max_session_memory"]:h.maxSessionMemory=Number.MAX_SAFE_INTEGER;let g="http://";if("secureContext"in h){if(g="https://",r["grpc.ssl_target_name_override"]){let C=r["grpc.ssl_target_name_override"],N=(u=h.checkServerIdentity)!==null&&u!==void 0?u:CD.checkServerIdentity;h.checkServerIdentity=(I,M)=>N(C,M),h.servername=C}else{let C=(c=(l=(0,Id.splitHostPort)(f))===null||l===void 0?void 0:l.host)!==null&&c!==void 0?c:"localhost";h.servername=C}i.socket&&(h.createConnection=(C,N)=>i.socket)}else h.createConnection=(C,N)=>i.socket?i.socket:oK.connect(t);h=Object.assign(Object.assign(Object.assign({},h),t),{enableTrace:r["grpc-node.tls_enable_trace"]===1});let p=kk.connect(g+f,h);this.session=p;let b="Failed to connect",v=!1;p.unref(),p.once("connect",()=>{p.removeAllListeners(),a(new Ek(p,t,r,d)),this.session=null}),p.once("close",()=>{this.session=null,setImmediate(()=>{v||(v=!0,o(`${b} (${new Date().toISOString()})`))})}),p.once("error",C=>{b=C.message,this.trace("connection failed with error "+b),v||(v=!0,o(`${b} (${new Date().toISOString()})`))})})}connect(t,n,r){var i,a,o;if(this.isShutdown)return Promise.reject();let s=n._getConnectionOptions();if(!s)return Promise.reject("Credentials not loaded");if("secureContext"in s){if(s.ALPNProtocols=["h2"],r["grpc.ssl_target_name_override"]){let u=r["grpc.ssl_target_name_override"],l=(i=s.checkServerIdentity)!==null&&i!==void 0?i:CD.checkServerIdentity;s.checkServerIdentity=(c,d)=>l(u,d),s.servername=u}else if("grpc.http_connect_target"in r){let u=(0,kD.getDefaultAuthority)((a=(0,Id.parseUri)(r["grpc.http_connect_target"]))!==null&&a!==void 0?a:{path:"localhost"}),l=(0,Id.splitHostPort)(u);s.servername=(o=l?.host)!==null&&o!==void 0?o:u}r["grpc-node.tls_enable_trace"]&&(s.enableTrace=!0)}return(0,aK.getProxiedConnection)(t,r,s).then(u=>this.createSession(t,n,r,u))}shutdown(){var t;this.isShutdown=!0,(t=this.session)===null||t===void 0||t.close(),this.session=null}};Mg.Http2SubchannelConnector=Ck});var AD=m(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.getSubchannelPool=Rd.SubchannelPool=void 0;var SK=Qw(),bK=mD(),TK=Nr(),EK=rr(),CK=_D(),kK=1e4,Gh=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let t=!0;for(let n in this.pool){let i=this.pool[n].filter(a=>!a.subchannel.unrefIfOneRef());i.length>0&&(t=!1),this.pool[n]=i}t&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var t,n;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},kK),(n=(t=this.cleanupTimer).unref)===null||n===void 0||n.call(t))}getOrCreateSubchannel(t,n,r,i){this.ensureCleanupTask();let a=(0,EK.uriToString)(t);if(a in this.pool){let s=this.pool[a];for(let u of s)if((0,TK.subchannelAddressEqual)(n,u.subchannelAddress)&&(0,SK.channelOptionsEqual)(r,u.channelArguments)&&i._equals(u.channelCredentials))return u.subchannel}let o=new bK.Subchannel(t,n,r,i,new CK.Http2SubchannelConnector(t));return a in this.pool||(this.pool[a]=[]),this.pool[a].push({subchannelAddress:n,channelArguments:r,channelCredentials:i,subchannel:o}),o.ref(),o}};Rd.SubchannelPool=Gh;var _K=new Gh;function AK(e){return e?_K:new Gh}Rd.getSubchannelPool=AK});var Ak=m(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.FilterStackFactory=Pd.FilterStack=void 0;var Lg=class{constructor(t){this.filters=t}sendMetadata(t){let n=t;for(let r=0;r<this.filters.length;r++)n=this.filters[r].sendMetadata(n);return n}receiveMetadata(t){let n=t;for(let r=this.filters.length-1;r>=0;r--)n=this.filters[r].receiveMetadata(n);return n}sendMessage(t){let n=t;for(let r=0;r<this.filters.length;r++)n=this.filters[r].sendMessage(n);return n}receiveMessage(t){let n=t;for(let r=this.filters.length-1;r>=0;r--)n=this.filters[r].receiveMessage(n);return n}receiveTrailers(t){let n=t;for(let r=this.filters.length-1;r>=0;r--)n=this.filters[r].receiveTrailers(n);return n}push(t){this.filters.unshift(...t)}getFilters(){return this.filters}};Pd.FilterStack=Lg;var _k=class e{constructor(t){this.factories=t}push(t){this.factories.unshift(...t)}clone(){return new e([...this.factories])}createFilter(){return new Lg(this.factories.map(t=>t.createFilter()))}};Pd.FilterStackFactory=_k});var Nk=m(Fg=>{"use strict";Object.defineProperty(Fg,"__esModule",{value:!0});Fg.CompressionAlgorithms=void 0;var ND;(function(e){e[e.identity=0]="identity",e[e.deflate=1]="deflate",e[e.gzip=2]="gzip"})(ND||(Fg.CompressionAlgorithms=ND={}))});var Ok=m(Ug=>{"use strict";Object.defineProperty(Ug,"__esModule",{value:!0});Ug.BaseFilter=void 0;var Ik=class{async sendMetadata(t){return t}receiveMetadata(t){return t}async sendMessage(t){return t}async receiveMessage(t){return t}receiveTrailers(t){return t}};Ug.BaseFilter=Ik});var RD=m(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.CompressionFilterFactory=Bd.CompressionFilter=void 0;var qg=xe("zlib"),OD=Nk(),wd=Ie(),NK=Ok(),IK=ut(),OK=e=>typeof e=="number"&&typeof OD.CompressionAlgorithms[e]=="string",xd=class{async writeMessage(t,n){let r=t;n&&(r=await this.compressMessage(r));let i=Buffer.allocUnsafe(r.length+5);return i.writeUInt8(n?1:0,0),i.writeUInt32BE(r.length,1),r.copy(i,5),i}async readMessage(t){let n=t.readUInt8(0)===1,r=t.slice(5);return n&&(r=await this.decompressMessage(r)),r}},Ws=class extends xd{async compressMessage(t){return t}async writeMessage(t,n){let r=Buffer.allocUnsafe(t.length+5);return r.writeUInt8(0,0),r.writeUInt32BE(t.length,1),t.copy(r,5),r}decompressMessage(t){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}},Rk=class extends xd{constructor(t){super(),this.maxRecvMessageLength=t}compressMessage(t){return new Promise((n,r)=>{qg.deflate(t,(i,a)=>{i?r(i):n(a)})})}decompressMessage(t){return new Promise((n,r)=>{let i=0,a=[],o=qg.createInflate();o.on("data",s=>{a.push(s),i+=s.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(o.destroy(),r({code:wd.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),o.on("end",()=>{n(Buffer.concat(a))}),o.write(t),o.end()})}},Pk=class extends xd{constructor(t){super(),this.maxRecvMessageLength=t}compressMessage(t){return new Promise((n,r)=>{qg.gzip(t,(i,a)=>{i?r(i):n(a)})})}decompressMessage(t){return new Promise((n,r)=>{let i=0,a=[],o=qg.createGunzip();o.on("data",s=>{a.push(s),i+=s.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(o.destroy(),r({code:wd.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),o.on("end",()=>{n(Buffer.concat(a))}),o.write(t),o.end()})}},wk=class extends xd{constructor(t){super(),this.compressionName=t}compressMessage(t){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(t){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function ID(e,t){switch(e){case"identity":return new Ws;case"deflate":return new Rk(t);case"gzip":return new Pk(t);default:return new wk(e)}}var Vg=class extends NK.BaseFilter{constructor(t,n){var r,i,a;super(),this.sharedFilterConfig=n,this.sendCompression=new Ws,this.receiveCompression=new Ws,this.currentCompressionAlgorithm="identity";let o=t["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(r=t["grpc.max_receive_message_length"])!==null&&r!==void 0?r:wd.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(i=t["grpc.max_send_message_length"])!==null&&i!==void 0?i:wd.DEFAULT_MAX_SEND_MESSAGE_LENGTH,o!==void 0)if(OK(o)){let s=OD.CompressionAlgorithms[o],u=(a=n.serverSupportedEncodingHeader)===null||a===void 0?void 0:a.split(",");(!u||u.includes(s))&&(this.currentCompressionAlgorithm=s,this.sendCompression=ID(this.currentCompressionAlgorithm,-1))}else IK.log(wd.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${o}`)}async sendMetadata(t){let n=await t;return n.set("grpc-accept-encoding","identity,deflate,gzip"),n.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity"?n.remove("grpc-encoding"):n.set("grpc-encoding",this.currentCompressionAlgorithm),n}receiveMetadata(t){let n=t.get("grpc-encoding");if(n.length>0){let i=n[0];typeof i=="string"&&(this.receiveCompression=ID(i,this.maxReceiveMessageLength))}t.remove("grpc-encoding");let r=t.get("grpc-accept-encoding")[0];return r&&(this.sharedFilterConfig.serverSupportedEncodingHeader=r,r.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new Ws,this.currentCompressionAlgorithm="identity")),t.remove("grpc-accept-encoding"),t}async sendMessage(t){var n;let r=await t;if(this.maxSendMessageLength!==-1&&r.message.length>this.maxSendMessageLength)throw{code:wd.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let i;return this.sendCompression instanceof Ws?i=!1:i=(((n=r.flags)!==null&&n!==void 0?n:0)&2)===0,{message:await this.sendCompression.writeMessage(r.message,i),flags:r.flags}}async receiveMessage(t){return this.receiveCompression.readMessage(await t)}};Bd.CompressionFilter=Vg;var xk=class{constructor(t,n){this.options=n,this.sharedFilterConfig={}}createFilter(){return new Vg(this.options,this.sharedFilterConfig)}};Bd.CompressionFilterFactory=xk});var zh=m(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.formatDateDifference=Br.deadlineToString=Br.getRelativeTimeout=Br.getDeadlineTimeoutString=Br.minDeadline=void 0;function RK(...e){let t=1/0;for(let n of e){let r=n instanceof Date?n.getTime():n;r<t&&(t=r)}return t}Br.minDeadline=RK;var PK=[["m",1],["S",1e3],["M",60*1e3],["H",60*60*1e3]];function wK(e){let t=new Date().getTime();e instanceof Date&&(e=e.getTime());let n=Math.max(e-t,0);for(let[r,i]of PK){let a=n/i;if(a<1e8)return String(Math.ceil(a))+r}throw new Error("Deadline is too far in the future")}Br.getDeadlineTimeoutString=wK;var xK=2147483647;function BK(e){let t=e instanceof Date?e.getTime():e,n=new Date().getTime(),r=t-n;return r<0?0:r>xK?1/0:r}Br.getRelativeTimeout=BK;function DK(e){if(e instanceof Date)return e.toISOString();{let t=new Date(e);return Number.isNaN(t.getTime())?""+e:t.toISOString()}}Br.deadlineToString=DK;function MK(e,t){return((t.getTime()-e.getTime())/1e3).toFixed(3)+"s"}Br.formatDateDifference=MK});var Wg=m(Jg=>{"use strict";Object.defineProperty(Jg,"__esModule",{value:!0});Jg.restrictControlPlaneStatusCode=void 0;var $i=Ie(),LK=[$i.Status.OK,$i.Status.INVALID_ARGUMENT,$i.Status.NOT_FOUND,$i.Status.ALREADY_EXISTS,$i.Status.FAILED_PRECONDITION,$i.Status.ABORTED,$i.Status.OUT_OF_RANGE,$i.Status.DATA_LOSS];function FK(e,t){return LK.includes(e)?{code:$i.Status.INTERNAL,details:`Invalid status from control plane: ${e} ${$i.Status[e]} ${t}`}:{code:e,details:t}}Jg.restrictControlPlaneStatusCode=FK});var xD=m(zg=>{"use strict";Object.defineProperty(zg,"__esModule",{value:!0});zg.LoadBalancingCall=void 0;var PD=_r(),Hg=Ie(),wD=zh(),Gg=Sn(),Qh=so(),UK=rr(),qK=ut(),Bk=Wg(),VK=xe("http2"),JK="load_balancing_call",Dk=class{constructor(t,n,r,i,a,o,s){var u,l;this.channel=t,this.callConfig=n,this.methodName=r,this.host=i,this.credentials=a,this.deadline=o,this.callNumber=s,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;let c=this.methodName.split("/"),d="";c.length>=2&&(d=c[1]);let f=(l=(u=(0,UK.splitHostPort)(this.host))===null||u===void 0?void 0:u.host)!==null&&l!==void 0?l:"localhost";this.serviceUrl=`https://${f}/${d}`,this.startTime=new Date}getDeadlineInfo(){var t,n;let r=[];return this.childStartTime?(this.childStartTime>this.startTime&&(!((t=this.metadata)===null||t===void 0)&&t.getOptions().waitForReady&&r.push("wait_for_ready"),r.push(`LB pick: ${(0,wD.formatDateDifference)(this.startTime,this.childStartTime)}`)),r.push(...this.child.getDeadlineInfo()),r):(!((n=this.metadata)===null||n===void 0)&&n.getOptions().waitForReady&&r.push("wait_for_ready"),r.push("Waiting for LB pick"),r)}trace(t){qK.trace(Hg.LogVerbosity.DEBUG,JK,"["+this.callNumber+"] "+t)}outputStatus(t,n){var r,i;if(!this.ended){this.ended=!0,this.trace("ended with status: code="+t.code+' details="'+t.details+'" start time='+this.startTime.toISOString());let a=Object.assign(Object.assign({},t),{progress:n});(r=this.listener)===null||r===void 0||r.onReceiveStatus(a),(i=this.onCallEnded)===null||i===void 0||i.call(this,a.code)}}doPick(){var t,n;if(this.ended)return;if(!this.metadata)throw new Error("doPick called before start");this.trace("Pick called");let r=this.metadata.clone(),i=this.channel.doPick(r,this.callConfig.pickInformation),a=i.subchannel?"("+i.subchannel.getChannelzRef().id+") "+i.subchannel.getAddress():""+i.subchannel;switch(this.trace("Pick result: "+Qh.PickResultType[i.pickResultType]+" subchannel: "+a+" status: "+((t=i.status)===null||t===void 0?void 0:t.code)+" "+((n=i.status)===null||n===void 0?void 0:n.details)),i.pickResultType){case Qh.PickResultType.COMPLETE:this.credentials.generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(u=>{var l,c,d;if(this.ended){this.trace("Credentials metadata generation finished after call ended");return}if(r.merge(u),r.get("authorization").length>1&&this.outputStatus({code:Hg.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new Gg.Metadata},"PROCESSED"),i.subchannel.getConnectivityState()!==PD.ConnectivityState.READY){this.trace("Picked subchannel "+a+" has state "+PD.ConnectivityState[i.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),this.doPick();return}this.deadline!==1/0&&r.set("grpc-timeout",(0,wD.getDeadlineTimeoutString)(this.deadline));try{this.child=i.subchannel.getRealSubchannel().createCall(r,this.host,this.methodName,{onReceiveMetadata:f=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(f)},onReceiveMessage:f=>{this.trace("Received message"),this.listener.onReceiveMessage(f)},onReceiveStatus:f=>{this.trace("Received status"),f.rstCode===VK.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(f,"REFUSED"):this.outputStatus(f,"PROCESSED")}}),this.childStartTime=new Date}catch(f){this.trace("Failed to start call on picked subchannel "+a+" with error "+f.message),this.outputStatus({code:Hg.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+f.message,metadata:new Gg.Metadata},"NOT_STARTED");return}(c=(l=this.callConfig).onCommitted)===null||c===void 0||c.call(l),(d=i.onCallStarted)===null||d===void 0||d.call(i),this.onCallEnded=i.onCallEnded,this.trace("Created child call ["+this.child.getCallNumber()+"]"),this.readPending&&this.child.startRead(),this.pendingMessage&&this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&&this.child.halfClose()},u=>{let{code:l,details:c}=(0,Bk.restrictControlPlaneStatusCode)(typeof u.code=="number"?u.code:Hg.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${u.message}`);this.outputStatus({code:l,details:c,metadata:new Gg.Metadata},"PROCESSED")});break;case Qh.PickResultType.DROP:let{code:o,details:s}=(0,Bk.restrictControlPlaneStatusCode)(i.status.code,i.status.details);setImmediate(()=>{this.outputStatus({code:o,details:s,metadata:i.status.metadata},"DROP")});break;case Qh.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:u,details:l}=(0,Bk.restrictControlPlaneStatusCode)(i.status.code,i.status.details);setImmediate(()=>{this.outputStatus({code:u,details:l,metadata:i.status.metadata},"PROCESSED")})}break;case Qh.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(t,n){var r;this.trace("cancelWithStatus code: "+t+' details: "'+n+'"'),(r=this.child)===null||r===void 0||r.cancelWithStatus(t,n),this.outputStatus({code:t,details:n,metadata:new Gg.Metadata},"PROCESSED")}getPeer(){var t,n;return(n=(t=this.child)===null||t===void 0?void 0:t.getPeer())!==null&&n!==void 0?n:this.channel.getTarget()}start(t,n){this.trace("start called"),this.listener=n,this.metadata=t,this.doPick()}sendMessageWithContext(t,n){this.trace("write() called with message of length "+n.length),this.child?this.child.sendMessageWithContext(t,n):this.pendingMessage={context:t,message:n}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(t){throw new Error("Method not implemented.")}getCallNumber(){return this.callNumber}};zg.LoadBalancingCall=Dk});var DD=m(Qg=>{"use strict";Object.defineProperty(Qg,"__esModule",{value:!0});Qg.ResolvingCall=void 0;var Hs=Ie(),Gs=zh(),BD=Sn(),WK=ut(),HK=Wg(),GK="resolving_call",Mk=class{constructor(t,n,r,i,a,o){this.channel=t,this.method=n,this.filterStackFactory=i,this.credentials=a,this.callNumber=o,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=>{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.deadline=r.deadline,this.host=r.host,r.parentCall&&(r.flags&Hs.Propagate.CANCELLATION&&r.parentCall.on("cancelled",()=>{this.cancelWithStatus(Hs.Status.CANCELLED,"Cancelled by parent call")}),r.flags&Hs.Propagate.DEADLINE&&(this.trace("Propagating deadline from parent: "+r.parentCall.getDeadline()),this.deadline=(0,Gs.minDeadline)(this.deadline,r.parentCall.getDeadline()))),this.trace("Created"),this.runDeadlineTimer()}trace(t){WK.trace(Hs.LogVerbosity.DEBUG,GK,"["+this.callNumber+"] "+t)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,Gs.deadlineToString)(this.deadline));let t=(0,Gs.getRelativeTimeout)(this.deadline);if(t!==1/0){this.trace("Deadline will be reached in "+t+"ms");let n=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(Hs.Status.DEADLINE_EXCEEDED,"Deadline exceeded");return}let r=[],i=new Date;r.push(`Deadline exceeded after ${(0,Gs.formatDateDifference)(this.deadlineStartTime,i)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&r.push(`name resolution: ${(0,Gs.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&r.push(`metadata filters: ${(0,Gs.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):r.push("waiting for metadata filters")):r.push("waiting for name resolution"),this.child&&r.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(Hs.Status.DEADLINE_EXCEEDED,r.join(","))};t<=0?process.nextTick(n):this.deadlineTimer=setTimeout(n,t)}}outputStatus(t){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let n=this.filterStack.receiveTrailers(t);this.trace("ended with status: code="+n.code+' details="'+n.details+'"'),this.statusWatchers.forEach(r=>r(n)),process.nextTick(()=>{var r;(r=this.listener)===null||r===void 0||r.onReceiveStatus(n)})}}sendMessageOnChild(t,n){if(!this.child)throw new Error("sendMessageonChild called with child not populated");let r=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:n,flags:t.flags})).then(i=>{this.writeFilterPending=!1,r.sendMessageWithContext(t,i.message),this.pendingHalfClose&&r.halfClose()},i=>{this.cancelWithStatus(i.code,i.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error("getConfig called before start");let t=this.channel.getConfig(this.method,this.metadata);if(t.type==="NONE"){this.channel.queueCallForConfig(this);return}else if(t.type==="ERROR"){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(t.error);return}this.configReceivedTime=new Date;let n=t.config;if(n.status!==Hs.Status.OK){let{code:r,details:i}=(0,HK.restrictControlPlaneStatusCode)(n.status,"Failed to route call to method "+this.method);this.outputStatus({code:r,details:i,metadata:new BD.Metadata});return}if(n.methodConfig.timeout){let r=new Date;r.setSeconds(r.getSeconds()+n.methodConfig.timeout.seconds),r.setMilliseconds(r.getMilliseconds()+n.methodConfig.timeout.nanos/1e6),this.deadline=(0,Gs.minDeadline)(this.deadline,r),this.runDeadlineTimer()}this.filterStackFactory.push(n.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(r=>{this.child=this.channel.createInnerCall(n,this.method,this.host,this.credentials,this.deadline),this.trace("Created child ["+this.child.getCallNumber()+"]"),this.childStartTime=new Date,this.child.start(r,{onReceiveMetadata:i=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(i))},onReceiveMessage:i=>{this.trace("Received message"),this.readFilterPending=!0,this.filterStack.receiveMessage(i).then(a=>{this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(a),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},a=>{this.cancelWithStatus(a.code,a.details)})},onReceiveStatus:i=>{this.trace("Received status"),this.readFilterPending?this.pendingChildStatus=i:this.outputStatus(i)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},r=>{this.outputStatus(r)})}reportResolverError(t){var n;!((n=this.metadata)===null||n===void 0)&&n.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(t)}cancelWithStatus(t,n){var r;this.trace("cancelWithStatus code: "+t+' details: "'+n+'"'),(r=this.child)===null||r===void 0||r.cancelWithStatus(t,n),this.outputStatus({code:t,details:n,metadata:new BD.Metadata})}getPeer(){var t,n;return(n=(t=this.child)===null||t===void 0?void 0:t.getPeer())!==null&&n!==void 0?n:this.channel.getTarget()}start(t,n){this.trace("start called"),this.metadata=t.clone(),this.listener=n,this.getConfig()}sendMessageWithContext(t,n){this.trace("write() called with message of length "+n.length),this.child?this.sendMessageOnChild(t,n):this.pendingMessage={context:t,message:n}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child&&!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(t){this.credentials=this.credentials.compose(t)}addStatusWatcher(t){this.statusWatchers.push(t)}getCallNumber(){return this.callNumber}};Qg.ResolvingCall=Mk});var MD=m(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.RetryingCall=bo.MessageBufferTracker=bo.RetryThrottler=void 0;var Kg=Ie(),zK=zh(),QK=Sn(),KK=ut(),ZK="retrying_call",Fk=class{constructor(t,n,r){this.maxTokens=t,this.tokenRatio=n,r?this.tokens=r.tokens*(t/r.maxTokens):this.tokens=t}addCallSucceeded(){this.tokens=Math.max(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.min(this.tokens-1,0)}canRetryCall(){return this.tokens>this.maxTokens/2}};bo.RetryThrottler=Fk;var Uk=class{constructor(t,n){this.totalLimit=t,this.limitPerCall=n,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(t,n){var r;let i=(r=this.allocatedPerCall.get(n))!==null&&r!==void 0?r:0;return this.limitPerCall-i<t||this.totalLimit-this.totalAllocated<t?!1:(this.allocatedPerCall.set(n,i+t),this.totalAllocated+=t,!0)}free(t,n){var r;if(this.totalAllocated<t)throw new Error(`Invalid buffer allocation state: call ${n} freed ${t} > total allocated ${this.totalAllocated}`);this.totalAllocated-=t;let i=(r=this.allocatedPerCall.get(n))!==null&&r!==void 0?r:0;if(i<t)throw new Error(`Invalid buffer allocation state: call ${n} freed ${t} > allocated for call ${i}`);this.allocatedPerCall.set(n,i-t)}freeAll(t){var n;let r=(n=this.allocatedPerCall.get(t))!==null&&n!==void 0?n:0;if(this.totalAllocated<r)throw new Error(`Invalid buffer allocation state: call ${t} allocated ${r} > total allocated ${this.totalAllocated}`);this.totalAllocated-=r,this.allocatedPerCall.delete(t)}};bo.MessageBufferTracker=Uk;var Lk="grpc-previous-rpc-attempts",YK=5,qk=class{constructor(t,n,r,i,a,o,s,u,l){var c;this.channel=t,this.callConfig=n,this.methodName=r,this.host=i,this.credentials=a,this.deadline=o,this.callNumber=s,this.bufferTracker=u,this.retryThrottler=l,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;let d=(c=t.getOptions()["grpc-node.retry_max_attempts_limit"])!==null&&c!==void 0?c:YK;if(n.methodConfig.retryPolicy){this.state="RETRY";let f=n.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(f.initialBackoff.substring(0,f.initialBackoff.length-1)),this.maxAttempts=Math.min(f.maxAttempts,d)}else n.methodConfig.hedgingPolicy?(this.state="HEDGING",this.maxAttempts=Math.min(n.methodConfig.hedgingPolicy.maxAttempts,d)):(this.state="TRANSPARENT_ONLY",this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let t=[],n=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&t.push(`previous attempts: ${this.underlyingCalls.length-1}`),n.startTime>this.startTime&&t.push(`time to current attempt start: ${(0,zK.formatDateDifference)(this.startTime,n.startTime)}`),t.push(...n.call.getDeadlineInfo()),t}getCallNumber(){return this.callNumber}trace(t){KK.trace(Kg.LogVerbosity.DEBUG,ZK,"["+this.callNumber+"] "+t)}reportStatus(t){this.trace("ended with status: code="+t.code+' details="'+t.details+'" start time='+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var n;(n=this.listener)===null||n===void 0||n.onReceiveStatus({code:t.code,details:t.details,metadata:t.metadata})})}cancelWithStatus(t,n){this.trace("cancelWithStatus code: "+t+' details: "'+n+'"'),this.reportStatus({code:t,details:n,metadata:new QK.Metadata});for(let{call:r}of this.underlyingCalls)r.cancelWithStatus(t,n)}getPeer(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getPeer():"unknown"}getBufferEntry(t){var n;return(n=this.writeBuffer[t-this.writeBufferOffset])!==null&&n!==void 0?n:{entryType:"FREED",allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!=="COMMITTED")return;let t=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let n=this.writeBufferOffset;n<t;n++){let r=this.getBufferEntry(n);r.allocated&&this.bufferTracker.free(r.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(t-this.writeBufferOffset),this.writeBufferOffset=t}commitCall(t){if(this.state!=="COMMITTED"&&this.underlyingCalls[t].state!=="COMPLETED"){this.trace("Committing call ["+this.underlyingCalls[t].call.getCallNumber()+"] at index "+t),this.state="COMMITTED",this.committedCallIndex=t;for(let n=0;n<this.underlyingCalls.length;n++)n!==t&&this.underlyingCalls[n].state!=="COMPLETED"&&(this.underlyingCalls[n].state="COMPLETED",this.underlyingCalls[n].call.cancelWithStatus(Kg.Status.CANCELLED,"Discarded in favor of other hedged attempt"));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state==="COMMITTED")return;let t=-1,n=-1;for(let[r,i]of this.underlyingCalls.entries())i.state==="ACTIVE"&&i.nextMessageToSend>t&&(t=i.nextMessageToSend,n=r);n===-1?this.state="TRANSPARENT_ONLY":this.commitCall(n)}isStatusCodeInList(t,n){return t.some(r=>{var i;return r===n||r.toString().toLowerCase()===((i=Kg.Status[n])===null||i===void 0?void 0:i.toLowerCase())})}getNextRetryBackoffMs(){var t;let n=(t=this.callConfig)===null||t===void 0?void 0:t.methodConfig.retryPolicy;if(!n)return 0;let r=Math.random()*this.nextRetryBackoffSec*1e3,i=Number(n.maxBackoff.substring(0,n.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*n.backoffMultiplier,i),r}maybeRetryCall(t,n){if(this.state!=="RETRY"){n(!1);return}if(this.attempts>=this.maxAttempts){n(!1);return}let r;if(t===null)r=this.getNextRetryBackoffMs();else if(t<0){this.state="TRANSPARENT_ONLY",n(!1);return}else r=t,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{var i,a;if(this.state!=="RETRY"){n(!1);return}(!((a=(i=this.retryThrottler)===null||i===void 0?void 0:i.canRetryCall())!==null&&a!==void 0)||a)&&(n(!0),this.attempts+=1,this.startNewAttempt())},r)}countActiveCalls(){let t=0;for(let n of this.underlyingCalls)n?.state==="ACTIVE"&&(t+=1);return t}handleProcessedStatus(t,n,r){var i,a,o;switch(this.state){case"COMMITTED":case"TRANSPARENT_ONLY":this.commitCall(n),this.reportStatus(t);break;case"HEDGING":if(this.isStatusCodeInList((i=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&&i!==void 0?i:[],t.code)){(a=this.retryThrottler)===null||a===void 0||a.addCallFailed();let s;if(r===null)s=0;else if(r<0){this.state="TRANSPARENT_ONLY",this.commitCall(n),this.reportStatus(t);return}else s=r;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(n),this.reportStatus(t))},s)}else this.commitCall(n),this.reportStatus(t);break;case"RETRY":this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,t.code)?((o=this.retryThrottler)===null||o===void 0||o.addCallFailed(),this.maybeRetryCall(r,s=>{s||(this.commitCall(n),this.reportStatus(t))})):(this.commitCall(n),this.reportStatus(t));break}}getPushback(t){let n=t.get("grpc-retry-pushback-ms");if(n.length===0)return null;try{return parseInt(n[0])}catch{return-1}}handleChildStatus(t,n){var r;if(this.underlyingCalls[n].state==="COMPLETED")return;if(this.trace("state="+this.state+" handling status with progress "+t.progress+" from child ["+this.underlyingCalls[n].call.getCallNumber()+"] in state "+this.underlyingCalls[n].state),this.underlyingCalls[n].state="COMPLETED",t.code===Kg.Status.OK){(r=this.retryThrottler)===null||r===void 0||r.addCallSucceeded(),this.commitCall(n),this.reportStatus(t);return}if(this.state==="COMMITTED"){this.reportStatus(t);return}let i=this.getPushback(t.metadata);switch(t.progress){case"NOT_STARTED":this.startNewAttempt();break;case"REFUSED":this.transparentRetryUsed?this.handleProcessedStatus(t,n,i):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case"DROP":this.commitCall(n),this.reportStatus(t);break;case"PROCESSED":this.handleProcessedStatus(t,n,i);break}}maybeStartHedgingAttempt(){this.state==="HEDGING"&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var t,n,r;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!=="HEDGING"||!this.callConfig.methodConfig.hedgingPolicy)return;let i=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let a=(t=i.hedgingDelay)!==null&&t!==void 0?t:"0s",o=Number(a.substring(0,a.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},o*1e3),(r=(n=this.hedgingTimer).unref)===null||r===void 0||r.call(n)}startNewAttempt(){let t=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace("Created child call ["+t.getCallNumber()+"] for attempt "+this.attempts);let n=this.underlyingCalls.length;this.underlyingCalls.push({state:"ACTIVE",call:t,nextMessageToSend:0,startTime:new Date});let r=this.attempts-1,i=this.initialMetadata.clone();r>0&&i.set(Lk,`${r}`);let a=!1;t.start(i,{onReceiveMetadata:o=>{this.trace("Received metadata from child ["+t.getCallNumber()+"]"),this.commitCall(n),a=!0,r>0&&o.set(Lk,`${r}`),this.underlyingCalls[n].state==="ACTIVE"&&this.listener.onReceiveMetadata(o)},onReceiveMessage:o=>{this.trace("Received message from child ["+t.getCallNumber()+"]"),this.commitCall(n),this.underlyingCalls[n].state==="ACTIVE"&&this.listener.onReceiveMessage(o)},onReceiveStatus:o=>{this.trace("Received status from child ["+t.getCallNumber()+"]"),!a&&r>0&&o.metadata.set(Lk,`${r}`),this.handleChildStatus(o,n)}}),this.sendNextChildMessage(n),this.readStarted&&t.startRead()}start(t,n){this.trace("start called"),this.listener=n,this.initialMetadata=t,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(t){var n,r;let i=this.underlyingCalls[t],a=i.nextMessageToSend;(r=(n=this.getBufferEntry(a)).callback)===null||r===void 0||r.call(n),this.clearSentMessages(),i.nextMessageToSend+=1,this.sendNextChildMessage(t)}sendNextChildMessage(t){let n=this.underlyingCalls[t];if(n.state!=="COMPLETED"&&this.getBufferEntry(n.nextMessageToSend)){let r=this.getBufferEntry(n.nextMessageToSend);switch(r.entryType){case"MESSAGE":n.call.sendMessageWithContext({callback:i=>{this.handleChildWriteCompleted(t)}},r.message.message);break;case"HALF_CLOSE":n.nextMessageToSend+=1,n.call.halfClose();break;case"FREED":break}}}sendMessageWithContext(t,n){var r;this.trace("write() called with message of length "+n.length);let i={message:n,flags:t.flags},a=this.getNextBufferIndex(),o={entryType:"MESSAGE",message:i,allocated:this.bufferTracker.allocate(n.length,this.callNumber)};if(this.writeBuffer.push(o),o.allocated){(r=t.callback)===null||r===void 0||r.call(t);for(let[s,u]of this.underlyingCalls.entries())u.state==="ACTIVE"&&u.nextMessageToSend===a&&u.call.sendMessageWithContext({callback:l=>{this.handleChildWriteCompleted(s)}},n)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let s=this.underlyingCalls[this.committedCallIndex];o.callback=t.callback,s.state==="ACTIVE"&&s.nextMessageToSend===a&&s.call.sendMessageWithContext({callback:u=>{this.handleChildWriteCompleted(this.committedCallIndex)}},n)}}startRead(){this.trace("startRead called"),this.readStarted=!0;for(let t of this.underlyingCalls)t?.state==="ACTIVE"&&t.call.startRead()}halfClose(){this.trace("halfClose called");let t=this.getNextBufferIndex();this.writeBuffer.push({entryType:"HALF_CLOSE",allocated:!1});for(let n of this.underlyingCalls)n?.state==="ACTIVE"&&n.nextMessageToSend===t&&(n.nextMessageToSend+=1,n.call.halfClose())}setCredentials(t){throw new Error("Method not implemented.")}getMethod(){return this.methodName}getHost(){return this.host}};bo.RetryingCall=qk});var Yg=m(Zg=>{"use strict";Object.defineProperty(Zg,"__esModule",{value:!0});Zg.BaseSubchannelWrapper=void 0;var Vk=class{constructor(t){this.child=t,this.healthy=!0,this.healthListeners=new Set,t.addHealthStateWatcher(n=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(let t of this.healthListeners)t(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(t){this.child.addConnectivityStateListener(t)}removeConnectivityStateListener(t){this.child.removeConnectivityStateListener(t)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(t){this.child.throttleKeepalive(t)}ref(){this.child.ref()}unref(){this.child.unref()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(t){this.healthListeners.add(t)}removeHealthStateWatcher(t){this.healthListeners.delete(t)}setHealthy(t){t!==this.healthy&&(this.healthy=t,this.child.isHealthy()&&this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(t){return this.getRealSubchannel()===t.getRealSubchannel()}};Zg.BaseSubchannelWrapper=Vk});var FD=m(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});e0.InternalChannel=void 0;var XK=Th(),$K=zw(),jK=AD(),Hk=so(),eZ=Sn(),To=Ie(),tZ=Ak(),nZ=RD(),LD=qi(),Xg=ut(),rZ=gk(),$g=rr(),bi=_r(),Kh=Js(),iZ=xD(),aZ=zh(),oZ=DD(),Jk=bk(),sZ=Wg(),Wk=MD(),uZ=Yg(),lZ=2147483647,cZ=1e3,dZ=30*60*1e3,jg=new Map,fZ=1<<24,hZ=1<<20,Gk=class extends uZ.BaseSubchannelWrapper{constructor(t,n){super(t),this.channel=n,this.refCount=0,this.subchannelStateListener=(r,i,a,o)=>{n.throttleKeepalive(o)},t.addConnectivityStateListener(this.subchannelStateListener)}ref(){this.child.ref(),this.refCount+=1}unref(){this.child.unref(),this.refCount-=1,this.refCount<=0&&(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},zk=class{pick(t){return{pickResultType:Hk.PickResultType.DROP,status:{code:To.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new eZ.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}},Qk=class{constructor(t,n,r){var i,a,o,s,u,l,c,d;if(this.credentials=n,this.options=r,this.connectivityState=bi.ConnectivityState.IDLE,this.currentPicker=new Hk.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.callTracker=new Kh.ChannelzCallTracker,this.childrenTracker=new Kh.ChannelzChildrenTracker,this.randomChannelId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),typeof t!="string")throw new TypeError("Channel target must be a string");if(!(n instanceof XK.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(r&&typeof r!="object")throw new TypeError("Channel options must be an object");this.originalTarget=t;let f=(0,$g.parseUri)(t);if(f===null)throw new Error(`Could not parse target name "${t}"`);let h=(0,LD.mapUriDefaultScheme)(f);if(h===null)throw new Error(`Could not find a default scheme for target name "${t}"`);this.callRefTimer=setInterval(()=>{},lZ),(a=(i=this.callRefTimer).unref)===null||a===void 0||a.call(i),this.options["grpc.enable_channelz"]===0&&(this.channelzEnabled=!1),this.channelzTrace=new Kh.ChannelzTrace,this.channelzRef=(0,Kh.registerChannelzChannel)(t,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Channel created"),this.options["grpc.default_authority"]?this.defaultAuthority=this.options["grpc.default_authority"]:this.defaultAuthority=(0,LD.getDefaultAuthority)(h);let g=(0,rZ.mapProxyName)(h,r);this.target=g.target,this.options=Object.assign({},this.options,g.extraOptions),this.subchannelPool=(0,jK.getSubchannelPool)(((o=r["grpc.use_local_subchannel_pool"])!==null&&o!==void 0?o:0)===0),this.retryBufferTracker=new Wk.MessageBufferTracker((s=r["grpc.retry_buffer_size"])!==null&&s!==void 0?s:fZ,(u=r["grpc.per_rpc_retry_buffer_size"])!==null&&u!==void 0?u:hZ),this.keepaliveTime=(l=r["grpc.keepalive_time_ms"])!==null&&l!==void 0?l:-1,this.idleTimeoutMs=Math.max((c=r["grpc.client_idle_timeout_ms"])!==null&&c!==void 0?c:dZ,cZ);let p={createSubchannel:(v,C,N)=>{let I=this.subchannelPool.getOrCreateSubchannel(this.target,v,Object.assign({},this.options,C),N??this.credentials);I.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Created subchannel or used existing subchannel",I.getChannelzRef());let M=new Gk(I,this);return this.wrappedSubchannels.add(M),M},updateState:(v,C)=>{this.currentPicker=C;let N=this.pickQueue.slice();this.pickQueue=[],N.length>0&&this.callRefTimerUnref();for(let I of N)I.doPick();this.updateState(v)},requestReresolution:()=>{throw new Error("Resolving load balancer should never call requestReresolution")},addChannelzChild:v=>{this.channelzEnabled&&this.childrenTracker.refChild(v)},removeChannelzChild:v=>{this.channelzEnabled&&this.childrenTracker.unrefChild(v)}};this.resolvingLoadBalancer=new $K.ResolvingLoadBalancer(this.target,p,n,r,(v,C)=>{v.retryThrottling?jg.set(this.getTarget(),new Wk.RetryThrottler(v.retryThrottling.maxTokens,v.retryThrottling.tokenRatio,jg.get(this.getTarget()))):jg.delete(this.getTarget()),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Address resolution succeeded"),this.configSelector=C,this.currentResolutionError=null,process.nextTick(()=>{let N=this.configSelectionQueue;this.configSelectionQueue=[],N.length>0&&this.callRefTimerUnref();for(let I of N)I.getConfig()})},v=>{this.channelzEnabled&&this.channelzTrace.addTrace("CT_WARNING","Address resolution failed with code "+v.code+' and details "'+v.details+'"'),this.configSelectionQueue.length>0&&this.trace("Name resolution failed with calls queued for config selection"),this.configSelector===null&&(this.currentResolutionError=Object.assign(Object.assign({},(0,sZ.restrictControlPlaneStatusCode)(v.code,v.details)),{metadata:v.metadata}));let C=this.configSelectionQueue;this.configSelectionQueue=[],C.length>0&&this.callRefTimerUnref();for(let N of C)N.reportResolverError(v)}),this.filterStackFactory=new tZ.FilterStackFactory([new nZ.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(r,void 0,2));let b=new Error;(0,Xg.isTracerEnabled)("channel_stacktrace")&&(0,Xg.trace)(To.LogVerbosity.DEBUG,"channel_stacktrace","("+this.channelzRef.id+`) Channel constructed
21
- `+((d=b.stack)===null||d===void 0?void 0:d.substring(b.stack.indexOf(`
22
- `)+1))),this.lastActivityTimestamp=new Date}getChannelzInfo(){return{target:this.originalTarget,state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}}trace(t,n){(0,Xg.trace)(n??To.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,$g.uriToString)(this.target)+" "+t)}callRefTimerRef(){var t,n,r,i;!((n=(t=this.callRefTimer).hasRef)===null||n===void 0)&&n.call(t)||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(i=(r=this.callRefTimer).ref)===null||i===void 0||i.call(r))}callRefTimerUnref(){var t,n;(!this.callRefTimer.hasRef||this.callRefTimer.hasRef())&&(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(n=(t=this.callRefTimer).unref)===null||n===void 0||n.call(t))}removeConnectivityStateWatcher(t){let n=this.connectivityStateWatchers.findIndex(r=>r===t);n>=0&&this.connectivityStateWatchers.splice(n,1)}updateState(t){(0,Xg.trace)(To.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,$g.uriToString)(this.target)+" "+bi.ConnectivityState[this.connectivityState]+" -> "+bi.ConnectivityState[t]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+bi.ConnectivityState[t]),this.connectivityState=t;let n=this.connectivityStateWatchers.slice();for(let r of n)t!==r.currentState&&(r.timer&&clearTimeout(r.timer),this.removeConnectivityStateWatcher(r),r.callback());t!==bi.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(t){if(t>this.keepaliveTime){this.keepaliveTime=t;for(let n of this.wrappedSubchannels)n.throttleKeepalive(t)}}removeWrappedSubchannel(t){this.wrappedSubchannels.delete(t)}doPick(t,n){return this.currentPicker.pick({metadata:t,extraPickInfo:n})}queueCallForPick(t){this.pickQueue.push(t),this.callRefTimerRef()}getConfig(t,n){return this.connectivityState!==bi.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:"SUCCESS",config:this.configSelector(t,n,this.randomChannelId)}:this.currentResolutionError?{type:"ERROR",error:this.currentResolutionError}:{type:"NONE"}}queueCallForConfig(t){this.configSelectionQueue.push(t),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(bi.ConnectivityState.IDLE),this.currentPicker=new Hk.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null)}startIdleTimeout(t){var n,r;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let a=new Date().valueOf()-this.lastActivityTimestamp.valueOf();a>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-a)},t),(r=(n=this.idleTimer).unref)===null||r===void 0||r.call(n)}maybeStartIdleTimer(){this.connectivityState!==bi.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(t){this.channelzEnabled&&(t.code===To.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(t,n,r,i,a){let o=(0,Jk.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+o+'] method="'+n+'"'),new iZ.LoadBalancingCall(this,t,n,r,i,a,o)}createRetryingCall(t,n,r,i,a){let o=(0,Jk.getNextCallNumber)();return this.trace("createRetryingCall ["+o+'] method="'+n+'"'),new Wk.RetryingCall(this,t,n,r,i,a,o,this.retryBufferTracker,jg.get(this.getTarget()))}createInnerCall(t,n,r,i,a){return this.options["grpc.enable_retries"]===0?this.createLoadBalancingCall(t,n,r,i,a):this.createRetryingCall(t,n,r,i,a)}createResolvingCall(t,n,r,i,a){let o=(0,Jk.getNextCallNumber)();this.trace("createResolvingCall ["+o+'] method="'+t+'", deadline='+(0,aZ.deadlineToString)(n));let s={deadline:n,flags:a??To.Propagate.DEFAULTS,host:r??this.defaultAuthority,parentCall:i},u=new oZ.ResolvingCall(this,t,s,this.filterStackFactory.clone(),this.credentials._getCallCredentials(),o);return this.onCallStart(),u.addStatusWatcher(l=>{this.onCallEnd(l)}),u}close(){this.resolvingLoadBalancer.destroy(),this.updateState(bi.ConnectivityState.SHUTDOWN),this.currentPicker=new zk;for(let t of this.configSelectionQueue)t.cancelWithStatus(To.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let t of this.pickQueue)t.cancelWithStatus(To.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,Kh.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels()}getTarget(){return(0,$g.uriToString)(this.target)}getConnectivityState(t){let n=this.connectivityState;return t&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),n}watchConnectivityState(t,n,r){if(this.connectivityState===bi.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let i=null;if(n!==1/0){let o=n instanceof Date?n:new Date(n),s=new Date;if(n===-1/0||o<=s){process.nextTick(r,new Error("Deadline passed without connectivity state change"));return}i=setTimeout(()=>{this.removeConnectivityStateWatcher(a),r(new Error("Deadline passed without connectivity state change"))},o.getTime()-s.getTime())}let a={currentState:t,callback:r,timer:i};this.connectivityStateWatchers.push(a)}getChannelzRef(){return this.channelzRef}createCall(t,n,r,i,a){if(typeof t!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof n=="number"||n instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===bi.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(t,n,r,i,a)}getOptions(){return this.options}};e0.InternalChannel=Qk});var cC=m(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});t0.ChannelImplementation=void 0;var pZ=Th(),mZ=FD(),Kk=class{constructor(t,n,r){if(typeof t!="string")throw new TypeError("Channel target must be a string");if(!(n instanceof pZ.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(r&&typeof r!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new mZ.InternalChannel(t,n,r)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(t){return this.internalChannel.getConnectivityState(t)}watchConnectivityState(t,n,r){this.internalChannel.watchConnectivityState(t,n,r)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(t,n,r,i,a){if(typeof t!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof n=="number"||n instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(t,n,r,i,a)}};t0.ChannelImplementation=Kk});var qD=m(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.ServerDuplexStreamImpl=Dr.ServerWritableStreamImpl=Dr.ServerReadableStreamImpl=Dr.ServerUnaryCallImpl=Dr.serverErrorToStatus=void 0;var gZ=xe("events"),jk=xe("stream"),e_=Ie(),UD=Sn();function t_(e,t){var n;let r={code:e_.Status.UNKNOWN,details:"message"in e?e.message:"Unknown Error",metadata:(n=t??e.metadata)!==null&&n!==void 0?n:null};return"code"in e&&typeof e.code=="number"&&Number.isInteger(e.code)&&(r.code=e.code,"details"in e&&typeof e.details=="string"&&(r.details=e.details)),r}Dr.serverErrorToStatus=t_;var Zk=class extends gZ.EventEmitter{constructor(t,n,r,i){super(),this.path=t,this.call=n,this.metadata=r,this.request=i,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(t){this.call.sendMetadata(t)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Dr.ServerUnaryCallImpl=Zk;var Yk=class extends jk.Readable{constructor(t,n,r){super({objectMode:!0}),this.path=t,this.call=n,this.metadata=r,this.cancelled=!1}_read(t){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(t){this.call.sendMetadata(t)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Dr.ServerReadableStreamImpl=Yk;var Xk=class extends jk.Writable{constructor(t,n,r,i){super({objectMode:!0}),this.path=t,this.call=n,this.metadata=r,this.request=i,this.pendingStatus={code:e_.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new UD.Metadata,this.on("error",a=>{this.pendingStatus=t_(a),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(t){this.call.sendMetadata(t)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_write(t,n,r){this.call.sendMessage(t,r)}_final(t){var n;t(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(n=this.pendingStatus.metadata)!==null&&n!==void 0?n:this.trailingMetadata}))}end(t){return t&&(this.trailingMetadata=t),super.end()}};Dr.ServerWritableStreamImpl=Xk;var $k=class extends jk.Duplex{constructor(t,n,r){super({objectMode:!0}),this.path=t,this.call=n,this.metadata=r,this.pendingStatus={code:e_.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new UD.Metadata,this.on("error",i=>{this.pendingStatus=t_(i),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(t){this.call.sendMetadata(t)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_read(t){this.call.startRead()}_write(t,n,r){this.call.sendMessage(t,r)}_final(t){var n;t(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(n=this.pendingStatus.metadata)!==null&&n!==void 0?n:this.trailingMetadata}))}end(t){return t&&(this.trailingMetadata=t),super.end()}};Dr.ServerDuplexStreamImpl=$k});var n0=m(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.createServerCredentialsWithInterceptors=Eo.createCertificateProviderServerCredentials=Eo.ServerCredentials=void 0;var VD=wE(),zs=class{constructor(){this.watchers=new Set,this.latestContextOptions=null}_addWatcher(t){this.watchers.add(t)}_removeWatcher(t){this.watchers.delete(t)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(t){this.latestContextOptions=t;for(let n of this.watchers)n(this.latestContextOptions)}_getSettings(){return this.latestContextOptions}_getInterceptors(){return[]}static createInsecure(){return new n_}static createSsl(t,n,r=!1){var i;if(t!==null&&!Buffer.isBuffer(t))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(n))throw new TypeError("keyCertPairs must be an array");if(typeof r!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let a=[],o=[];for(let s=0;s<n.length;s++){let u=n[s];if(u===null||typeof u!="object")throw new TypeError(`keyCertPair[${s}] must be an object`);if(!Buffer.isBuffer(u.private_key))throw new TypeError(`keyCertPair[${s}].private_key must be a Buffer`);if(!Buffer.isBuffer(u.cert_chain))throw new TypeError(`keyCertPair[${s}].cert_chain must be a Buffer`);a.push(u.cert_chain),o.push(u.private_key)}return new r_({ca:(i=t??(0,VD.getDefaultRootsData)())!==null&&i!==void 0?i:void 0,cert:a,key:o,requestCert:r,ciphers:VD.CIPHER_SUITES})}};Eo.ServerCredentials=zs;var n_=class e extends zs{_isSecure(){return!1}_getSettings(){return null}_equals(t){return t instanceof e}},r_=class e extends zs{constructor(t){super(),this.options=t}_isSecure(){return!0}_getSettings(){return this.options}_equals(t){if(this===t)return!0;if(!(t instanceof e))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(t.options.ca)){if(!this.options.ca.equals(t.options.ca))return!1}else if(this.options.ca!==t.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(t.options.cert)){if(this.options.cert.length!==t.options.cert.length)return!1;for(let n=0;n<this.options.cert.length;n++){let r=this.options.cert[n],i=t.options.cert[n];if(Buffer.isBuffer(r)&&Buffer.isBuffer(i)){if(!r.equals(i))return!1}else if(r!==i)return!1}}else if(this.options.cert!==t.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(t.options.key)){if(this.options.key.length!==t.options.key.length)return!1;for(let n=0;n<this.options.key.length;n++){let r=this.options.key[n],i=t.options.key[n];if(Buffer.isBuffer(r)&&Buffer.isBuffer(i)){if(!r.equals(i))return!1}else if(r!==i)return!1}}else if(this.options.key!==t.options.key)return!1;return this.options.requestCert===t.options.requestCert}},i_=class e extends zs{constructor(t,n,r){super(),this.identityCertificateProvider=t,this.caCertificateProvider=n,this.requireClientCertificate=r,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(t){var n;this.getWatcherCount()===0&&((n=this.caCertificateProvider)===null||n===void 0||n.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(t)}_removeWatcher(t){var n;super._removeWatcher(t),this.getWatcherCount()===0&&((n=this.caCertificateProvider)===null||n===void 0||n.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_isSecure(){return!0}_equals(t){return this===t?!0:t instanceof e?this.caCertificateProvider===t.caCertificateProvider&&this.identityCertificateProvider===t.identityCertificateProvider&&this.requireClientCertificate===t.requireClientCertificate:!1}calculateSecureContextOptions(){var t;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:(t=this.latestCaUpdate)===null||t===void 0?void 0:t.caCertificate,cert:this.latestIdentityUpdate.certificate,key:this.latestIdentityUpdate.privateKey,requestCert:this.latestIdentityUpdate!==null,rejectUnauthorized:this.requireClientCertificate}}finalizeUpdate(){this.updateSecureContextOptions(this.calculateSecureContextOptions())}handleCaCertificateUpdate(t){this.latestCaUpdate=t,this.finalizeUpdate()}handleIdentityCertitificateUpdate(t){this.latestIdentityUpdate=t,this.finalizeUpdate()}};function yZ(e,t,n){return new i_(e,t,n)}Eo.createCertificateProviderServerCredentials=yZ;var a_=class e extends zs{constructor(t,n){super(),this.childCredentials=t,this.interceptors=n}_isSecure(){return this.childCredentials._isSecure()}_equals(t){if(!(t instanceof e)||!this.childCredentials._equals(t.childCredentials)||this.interceptors.length!==t.interceptors.length)return!1;for(let n=0;n<this.interceptors.length;n++)if(this.interceptors[n]!==t.interceptors[n])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(t){this.childCredentials._addWatcher(t)}_removeWatcher(t){this.childCredentials._removeWatcher(t)}};function vZ(e,t){return new a_(e,t)}Eo.createServerCredentialsWithInterceptors=vZ});var f_=m(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.getServerInterceptingCall=Hn.BaseServerInterceptingCall=Hn.ServerInterceptingCall=Hn.ResponderBuilder=Hn.isInterceptingServerListener=Hn.ServerListenerBuilder=void 0;var JD=Sn(),Wn=Ie(),Dd=xe("http2"),WD=Bm(),HD=xe("zlib"),SZ=vk(),KD=ut(),ZD="server_call";function Qs(e){KD.trace(Wn.LogVerbosity.DEBUG,ZD,e)}var s_=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(t){return this.metadata=t,this}withOnReceiveMessage(t){return this.message=t,this}withOnReceiveHalfClose(t){return this.halfClose=t,this}withOnCancel(t){return this.cancel=t,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};Hn.ServerListenerBuilder=s_;function bZ(e){return e.onReceiveMetadata!==void 0&&e.onReceiveMetadata.length===1}Hn.isInterceptingServerListener=bZ;var u_=class{constructor(t,n){this.listener=t,this.nextListener=n,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&&(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(t){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(t,n=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(n),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(t){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(t,n=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=n,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(n),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},l_=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(t){return this.start=t,this}withSendMetadata(t){return this.metadata=t,this}withSendMessage(t){return this.message=t,this}withSendStatus(t){return this.status=t,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};Hn.ResponderBuilder=l_;var r0={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveHalfClose:e=>{e()},onCancel:()=>{}},i0={start:e=>{e()},sendMetadata:(e,t)=>{t(e)},sendMessage:(e,t)=>{t(e)},sendStatus:(e,t)=>{t(e)}},c_=class{constructor(t,n){var r,i,a,o;this.nextCall=t,this.processingMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(r=n?.start)!==null&&r!==void 0?r:i0.start,sendMetadata:(i=n?.sendMetadata)!==null&&i!==void 0?i:i0.sendMetadata,sendMessage:(a=n?.sendMessage)!==null&&a!==void 0?a:i0.sendMessage,sendStatus:(o=n?.sendStatus)!==null&&o!==void 0?o:i0.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&&(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(t){this.responder.start(n=>{var r,i,a,o;let s={onReceiveMetadata:(r=n?.onReceiveMetadata)!==null&&r!==void 0?r:r0.onReceiveMetadata,onReceiveMessage:(i=n?.onReceiveMessage)!==null&&i!==void 0?i:r0.onReceiveMessage,onReceiveHalfClose:(a=n?.onReceiveHalfClose)!==null&&a!==void 0?a:r0.onReceiveHalfClose,onCancel:(o=n?.onCancel)!==null&&o!==void 0?o:r0.onCancel},u=new u_(s,t);this.nextCall.start(u)})}sendMetadata(t){this.processingMetadata=!0,this.responder.sendMetadata(t,n=>{this.processingMetadata=!1,this.nextCall.sendMetadata(n),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(t,n){this.processingMessage=!0,this.responder.sendMessage(t,r=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=r,this.pendingMessageCallback=n):this.nextCall.sendMessage(r,n)})}sendStatus(t){this.responder.sendStatus(t,n=>{this.processingMetadata||this.processingMessage?this.pendingStatus=n:this.nextCall.sendStatus(n)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}};Hn.ServerInterceptingCall=c_;var YD="grpc-accept-encoding",d_="grpc-encoding",GD="grpc-message",zD="grpc-status",o_="grpc-timeout",TZ=/(\d{1,8})\s*([HMSmun])/,EZ={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},CZ={[YD]:"identity,deflate,gzip",[d_]:"identity"},QD={[Dd.constants.HTTP2_HEADER_STATUS]:Dd.constants.HTTP_STATUS_OK,[Dd.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},kZ={waitForTrailers:!0},a0=class{constructor(t,n,r,i,a){var o;this.stream=t,this.callEventTracker=r,this.handler=i,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=Wn.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=Wn.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.stream.once("error",c=>{}),this.stream.once("close",()=>{var c;Qs("Request to method "+((c=this.handler)===null||c===void 0?void 0:c.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:Wn.Status.CANCELLED,details:"Stream closed before sending status",metadata:null})),this.notifyOnCancel()}),this.stream.on("data",c=>{this.handleDataFrame(c)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in a&&(this.maxSendMessageSize=a["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in a&&(this.maxReceiveMessageSize=a["grpc.max_receive_message_length"]),this.host=(o=n[":authority"])!==null&&o!==void 0?o:n.host,this.decoder=new SZ.StreamDecoder(this.maxReceiveMessageSize);let s=JD.Metadata.fromHttp2Headers(n);KD.isTracerEnabled(ZD)&&Qs("Request to "+this.handler.path+" received headers "+JSON.stringify(s.toJSON()));let u=s.get(o_);u.length>0&&this.handleTimeoutHeader(u[0]);let l=s.get(d_);l.length>0&&(this.incomingEncoding=l[0]),s.remove(o_),s.remove(d_),s.remove(YD),s.remove(Dd.constants.HTTP2_HEADER_ACCEPT_ENCODING),s.remove(Dd.constants.HTTP2_HEADER_TE),s.remove(Dd.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=s}handleTimeoutHeader(t){let n=t.toString().match(TZ);if(n===null){let a={code:Wn.Status.INTERNAL,details:`Invalid ${o_} value "${t}"`,metadata:null};process.nextTick(()=>{this.sendStatus(a)});return}let r=+n[1]*EZ[n[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+r),this.deadlineTimer=setTimeout(()=>{let a={code:Wn.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(a)},r)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var t;(t=this.listener)===null||t===void 0||t.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new JD.Metadata)}serializeMessage(t){let n=this.handler.serialize(t),r=n.byteLength,i=Buffer.allocUnsafe(r+5);return i.writeUInt8(0,0),i.writeUInt32BE(r,1),n.copy(i,5),i}decompressMessage(t,n){let r=t.subarray(5);if(n==="identity")return r;if(n==="deflate"||n==="gzip"){let i;return n==="deflate"?i=HD.createInflate():i=HD.createGunzip(),new Promise((a,o)=>{let s=0,u=[];i.on("data",l=>{u.push(l),s+=l.byteLength,this.maxReceiveMessageSize!==-1&&s>this.maxReceiveMessageSize&&(i.destroy(),o({code:Wn.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),i.on("end",()=>{a(Buffer.concat(u))}),i.write(r),i.end()})}else return Promise.reject({code:Wn.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${n}"`})}async decompressAndMaybePush(t){if(t.type!=="COMPRESSED")throw new Error(`Invalid queue entry type: ${t.type}`);let r=t.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",i;try{i=await this.decompressMessage(t.compressedMessage,r)}catch(a){this.sendStatus(a);return}try{t.parsedMessage=this.handler.deserialize(i)}catch(a){this.sendStatus({code:Wn.Status.INTERNAL,details:`Error deserializing request: ${a.message}`});return}t.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let t=this.readQueue.shift();t.type==="READABLE"?this.listener.onReceiveMessage(t.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(t){var n;if(this.checkCancelled())return;Qs("Request to "+this.handler.path+" received data frame of size "+t.length);let r;try{r=this.decoder.write(t)}catch(i){this.sendStatus({code:Wn.Status.RESOURCE_EXHAUSTED,details:i.message});return}for(let i of r){this.stream.pause();let a={type:"COMPRESSED",compressedMessage:i,parsedMessage:null};this.readQueue.push(a),this.decompressAndMaybePush(a),(n=this.callEventTracker)===null||n===void 0||n.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(t){Qs("Request to "+this.handler.path+" start called"),!this.checkCancelled()&&(this.listener=t,t.onReceiveMetadata(this.metadata))}sendMetadata(t){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let n=t?t.toHttp2Headers():null,r=Object.assign(Object.assign(Object.assign({},QD),CZ),n);this.stream.respond(r,kZ)}sendMessage(t,n){if(this.checkCancelled())return;let r;try{r=this.serializeMessage(t)}catch(i){this.sendStatus({code:Wn.Status.INTERNAL,details:`Error serializing response: ${(0,WD.getErrorMessage)(i)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&r.length-5>this.maxSendMessageSize){this.sendStatus({code:Wn.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${r.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),Qs("Request to "+this.handler.path+" sent data frame of size "+r.length),this.stream.write(r,i=>{var a;if(i){this.sendStatus({code:Wn.Status.INTERNAL,details:`Error writing message: ${(0,WD.getErrorMessage)(i)}`,metadata:null});return}(a=this.callEventTracker)===null||a===void 0||a.addMessageSent(),n()})}sendStatus(t){var n,r;if(!this.checkCancelled())if(Qs("Request to method "+((n=this.handler)===null||n===void 0?void 0:n.path)+" ended with status code: "+Wn.Status[t.code]+" details: "+t.details),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{var i;this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(t));let a=Object.assign({[zD]:t.code,[GD]:encodeURI(t.details)},(i=t.metadata)===null||i===void 0?void 0:i.toHttp2Headers());this.stream.sendTrailers(a),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(t));let i=Object.assign(Object.assign({[zD]:t.code,[GD]:encodeURI(t.details)},QD),(r=t.metadata)===null||r===void 0?void 0:r.toHttp2Headers());this.stream.respond(i,{endStream:!0}),this.notifyOnCancel()}}startRead(){Qs("Request to "+this.handler.path+" startRead called"),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var t;let n=(t=this.stream.session)===null||t===void 0?void 0:t.socket;return n?.remoteAddress?n.remotePort?`${n.remoteAddress}:${n.remotePort}`:n.remoteAddress:"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}};Hn.BaseServerInterceptingCall=a0;function _Z(e,t,n,r,i,a){let o={path:i.path,requestStream:i.type==="clientStream"||i.type==="bidi",responseStream:i.type==="serverStream"||i.type==="bidi",requestDeserialize:i.deserialize,responseSerialize:i.serialize},s=new a0(t,n,r,i,a);return e.reduce((u,l)=>l(o,u),s)}Hn.getServerInterceptingCall=_Z});var rM=m(ko=>{"use strict";var AZ=ko&&ko.__runInitializers||function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},NZ=ko&&ko.__esDecorate||function(e,t,n,r,i,a){function o(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}for(var s=r.kind,u=s==="getter"?"get":s==="setter"?"set":"value",l=!t&&e?r.static?e:e.prototype:null,c=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d,f=!1,h=n.length-1;h>=0;h--){var g={};for(var p in r)g[p]=p==="access"?{}:r[p];for(var p in r.access)g.access[p]=r.access[p];g.addInitializer=function(v){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(v||null))};var b=(0,n[h])(s==="accessor"?{get:c.get,set:c.set}:c[u],g);if(s==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(d=o(b.get))&&(c.get=d),(d=o(b.set))&&(c.set=d),(d=o(b.init))&&i.unshift(d)}else(d=o(b))&&(s==="field"?i.unshift(d):c[u]=d)}l&&Object.defineProperty(l,r.name,c),f=!0};Object.defineProperty(ko,"__esModule",{value:!0});ko.Server=void 0;var Gn=xe("http2"),IZ=xe("util"),Dt=Ie(),Ld=qD(),XD=n0(),$D=qi(),o0=ut(),Co=Nr(),Ti=rr(),zt=Js(),jD=f_(),Md=~(1<<31),h_=~(1<<31),OZ=2e4,eM=~(1<<31),{HTTP2_HEADER_PATH:tM}=Gn.constants,RZ="server",nM=Buffer.from("max_age");function PZ(){}function wZ(e){return function(t,n){return IZ.deprecate(t,e)}}function p_(e){return{code:Dt.Status.UNIMPLEMENTED,details:`The server does not implement the method ${e}`}}function xZ(e,t){let n=p_(t);switch(e){case"unary":return(r,i)=>{i(n,null)};case"clientStream":return(r,i)=>{i(n,null)};case"serverStream":return r=>{r.emit("error",n)};case"bidi":return r=>{r.emit("error",n)};default:throw new Error(`Invalid handlerType ${e}`)}}var BZ=(()=>{var e;let t=[],n;return e=class{constructor(i){var a,o,s,u,l,c;this.boundPorts=(AZ(this,t),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=i??{},this.options["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new zt.ChannelzTraceStub,this.callTracker=new zt.ChannelzCallTrackerStub,this.listenerChildrenTracker=new zt.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new zt.ChannelzChildrenTrackerStub):(this.channelzTrace=new zt.ChannelzTrace,this.callTracker=new zt.ChannelzCallTracker,this.listenerChildrenTracker=new zt.ChannelzChildrenTracker,this.sessionChildrenTracker=new zt.ChannelzChildrenTracker),this.channelzRef=(0,zt.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(a=this.options["grpc.max_connection_age_ms"])!==null&&a!==void 0?a:Md,this.maxConnectionAgeGraceMs=(o=this.options["grpc.max_connection_age_grace_ms"])!==null&&o!==void 0?o:Md,this.keepaliveTimeMs=(s=this.options["grpc.keepalive_time_ms"])!==null&&s!==void 0?s:h_,this.keepaliveTimeoutMs=(u=this.options["grpc.keepalive_timeout_ms"])!==null&&u!==void 0?u:OZ,this.sessionIdleTimeout=(l=this.options["grpc.max_connection_idle_ms"])!==null&&l!==void 0?l:eM,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options?this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,"grpc.max_concurrent_streams"in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]}),this.interceptors=(c=this.options.interceptors)!==null&&c!==void 0?c:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(i){var a,o,s;let u=this.sessions.get(i),l=i.socket,c=l.remoteAddress?(0,Co.stringToSubchannelAddress)(l.remoteAddress,l.remotePort):null,d=l.localAddress?(0,Co.stringToSubchannelAddress)(l.localAddress,l.localPort):null,f;if(i.encrypted){let g=l,p=g.getCipher(),b=g.getCertificate(),v=g.getPeerCertificate();f={cipherSuiteStandardName:(a=p.standardName)!==null&&a!==void 0?a:null,cipherSuiteOtherName:p.standardName?null:p.name,localCertificate:b&&"raw"in b?b.raw:null,remoteCertificate:v&&"raw"in v?v.raw:null}}else f=null;return{remoteAddress:c,localAddress:d,security:f,remoteName:null,streamsStarted:u.streamTracker.callsStarted,streamsSucceeded:u.streamTracker.callsSucceeded,streamsFailed:u.streamTracker.callsFailed,messagesSent:u.messagesSent,messagesReceived:u.messagesReceived,keepAlivesSent:u.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:u.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:u.lastMessageSentTimestamp,lastMessageReceivedTimestamp:u.lastMessageReceivedTimestamp,localFlowControlWindow:(o=i.state.localWindowSize)!==null&&o!==void 0?o:null,remoteFlowControlWindow:(s=i.state.remoteWindowSize)!==null&&s!==void 0?s:null}}trace(i){o0.trace(Dt.LogVerbosity.DEBUG,RZ,"("+this.channelzRef.id+") "+i)}keepaliveTrace(i){o0.trace(Dt.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+i)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(i,a){if(i===null||typeof i!="object"||a===null||typeof a!="object")throw new Error("addService() requires two objects as arguments");let o=Object.keys(i);if(o.length===0)throw new Error("Cannot add an empty service to a server");o.forEach(s=>{let u=i[s],l;u.requestStream?u.responseStream?l="bidi":l="clientStream":u.responseStream?l="serverStream":l="unary";let c=a[s],d;if(c===void 0&&typeof u.originalName=="string"&&(c=a[u.originalName]),c!==void 0?d=c.bind(a):d=xZ(l,s),this.register(u.path,d,u.responseSerialize,u.requestDeserialize,l)===!1)throw new Error(`Method handler for ${u.path} already provided.`)})}removeService(i){if(i===null||typeof i!="object")throw new Error("removeService() requires object as argument");Object.keys(i).forEach(o=>{let s=i[o];this.unregister(s.path)})}bind(i,a){throw new Error("Not implemented. Use bindAsync() instead")}registerListenerToChannelz(i){return(0,zt.registerChannelzSocket)((0,Co.subchannelAddressToString)(i),()=>({localAddress:i,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}createHttp2Server(i){let a;if(i._isSecure()){let o=i._getSettings(),s=Object.assign(Object.assign(Object.assign({},this.commonServerOptions),o),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),u=o!==null;a=Gn.createSecureServer(s),a.on("connection",c=>{u||c.destroy()}),a.on("secureConnection",c=>{c.on("error",d=>{this.trace("An incoming TLS connection closed with error: "+d.message)})});let l=c=>{c&&a.setSecureContext(c),u=c!==null};i._addWatcher(l),a.on("close",()=>{i._removeWatcher(l)})}else a=Gn.createServer(this.commonServerOptions);return a.setTimeout(0,PZ),this._setupHandlers(a,i._getInterceptors()),a}bindOneAddress(i,a){this.trace("Attempting to bind "+(0,Co.subchannelAddressToString)(i));let o=this.createHttp2Server(a.credentials);return new Promise((s,u)=>{let l=c=>{this.trace("Failed to bind "+(0,Co.subchannelAddressToString)(i)+" with error "+c.message),s({port:"port"in i?i.port:1,error:c.message})};o.once("error",l),o.listen(i,()=>{let c=o.address(),d;typeof c=="string"?d={path:c}:d={host:c.address,port:c.port};let f=this.registerListenerToChannelz(d);this.listenerChildrenTracker.refChild(f),this.http2Servers.set(o,{channelzRef:f,sessions:new Set}),a.listeningServers.add(o),this.trace("Successfully bound "+(0,Co.subchannelAddressToString)(d)),s({port:"port"in d?d.port:1}),o.removeListener("error",l)})})}async bindManyPorts(i,a){if(i.length===0)return{count:0,port:0,errors:[]};if((0,Co.isTcpSubchannelAddress)(i[0])&&i[0].port===0){let o=await this.bindOneAddress(i[0],a);if(o.error){let s=await this.bindManyPorts(i.slice(1),a);return Object.assign(Object.assign({},s),{errors:[o.error,...s.errors]})}else{let s=i.slice(1).map(c=>(0,Co.isTcpSubchannelAddress)(c)?{host:c.host,port:o.port}:c),u=await Promise.all(s.map(c=>this.bindOneAddress(c,a))),l=[o,...u];return{count:l.filter(c=>c.error===void 0).length,port:o.port,errors:l.filter(c=>c.error).map(c=>c.error)}}}else{let o=await Promise.all(i.map(s=>this.bindOneAddress(s,a)));return{count:o.filter(s=>s.error===void 0).length,port:o[0].port,errors:o.filter(s=>s.error).map(s=>s.error)}}}async bindAddressList(i,a){let o=await this.bindManyPorts(i,a);if(o.count>0)return o.count<i.length&&o0.log(Dt.LogVerbosity.INFO,`WARNING Only ${o.count} addresses added out of total ${i.length} resolved`),o.port;{let s=`No address added out of total ${i.length} resolved`;throw o0.log(Dt.LogVerbosity.ERROR,s),new Error(`${s} errors: [${o.errors.join(",")}]`)}}resolvePort(i){return new Promise((a,o)=>{let s={onSuccessfulResolution:(l,c,d)=>{s.onSuccessfulResolution=()=>{};let f=[].concat(...l.map(h=>h.addresses));if(f.length===0){o(new Error(`No addresses resolved for port ${i}`));return}a(f)},onError:l=>{o(new Error(l.details))}};(0,$D.createResolver)(i,s,this.options).updateResolution()})}async bindPort(i,a){let o=await this.resolvePort(i);if(a.cancelled)throw this.completeUnbind(a),new Error("bindAsync operation cancelled by unbind call");let s=await this.bindAddressList(o,a);if(a.cancelled)throw this.completeUnbind(a),new Error("bindAsync operation cancelled by unbind call");return s}normalizePort(i){let a=(0,Ti.parseUri)(i);if(a===null)throw new Error(`Could not parse port "${i}"`);let o=(0,$D.mapUriDefaultScheme)(a);if(o===null)throw new Error(`Could not get a default scheme for port "${i}"`);return o}bindAsync(i,a,o){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof i!="string")throw new TypeError("port must be a string");if(a===null||!(a instanceof XD.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof o!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+i);let s=this.normalizePort(i),u=(f,h)=>{process.nextTick(()=>o(f,h))},l=this.boundPorts.get((0,Ti.uriToString)(s));if(l){if(!a._equals(l.credentials)){u(new Error(`${i} already bound with incompatible credentials`),0);return}l.cancelled=!1,l.completionPromise?l.completionPromise.then(f=>o(null,f),f=>o(f,0)):u(null,l.portNumber);return}l={mapKey:(0,Ti.uriToString)(s),originalUri:s,completionPromise:null,cancelled:!1,portNumber:0,credentials:a,listeningServers:new Set};let c=(0,Ti.splitHostPort)(s.path),d=this.bindPort(s,l);l.completionPromise=d,c?.port===0?d.then(f=>{let h={scheme:s.scheme,authority:s.authority,path:(0,Ti.combineHostPort)({host:c.host,port:f})};l.mapKey=(0,Ti.uriToString)(h),l.completionPromise=null,l.portNumber=f,this.boundPorts.set(l.mapKey,l),o(null,f)},f=>{o(f,0)}):(this.boundPorts.set(l.mapKey,l),d.then(f=>{l.completionPromise=null,l.portNumber=f,o(null,f)},f=>{o(f,0)}))}registerInjectorToChannelz(){return(0,zt.registerChannelzSocket)("injector",()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}createConnectionInjector(i){if(i===null||!(i instanceof XD.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let a=this.createHttp2Server(i),o=this.registerInjectorToChannelz();this.channelzEnabled&&this.listenerChildrenTracker.refChild(o);let s=new Set;return this.http2Servers.set(a,{channelzRef:o,sessions:s}),{injectConnection:u=>{a.emit("connection",u)},drain:u=>{var l,c;for(let d of s)this.closeSession(d);(c=(l=setTimeout(()=>{for(let d of s)d.destroy(Gn.constants.NGHTTP2_CANCEL)},u)).unref)===null||c===void 0||c.call(l)},destroy:()=>{this.closeServer(a);for(let u of s)this.closeSession(u)}}}closeServer(i,a){this.trace("Closing server with address "+JSON.stringify(i.address()));let o=this.http2Servers.get(i);i.close(()=>{o&&(this.listenerChildrenTracker.unrefChild(o.channelzRef),(0,zt.unregisterChannelzRef)(o.channelzRef)),this.http2Servers.delete(i),a?.()})}closeSession(i,a){var o;this.trace("Closing session initiated by "+((o=i.socket)===null||o===void 0?void 0:o.remoteAddress));let s=this.sessions.get(i),u=()=>{s&&(this.sessionChildrenTracker.unrefChild(s.ref),(0,zt.unregisterChannelzRef)(s.ref)),a?.()};i.closed?queueMicrotask(u):i.close(u)}completeUnbind(i){for(let a of i.listeningServers){let o=this.http2Servers.get(a);if(this.closeServer(a,()=>{i.listeningServers.delete(a)}),o)for(let s of o.sessions)this.closeSession(s)}this.boundPorts.delete(i.mapKey)}unbind(i){this.trace("unbind port="+i);let a=this.normalizePort(i),o=(0,Ti.splitHostPort)(a.path);if(o?.port===0)throw new Error("Cannot unbind port 0");let s=this.boundPorts.get((0,Ti.uriToString)(a));s&&(this.trace("unbinding "+s.mapKey+" originally bound as "+(0,Ti.uriToString)(s.originalUri)),s.completionPromise?s.cancelled=!0:this.completeUnbind(s))}drain(i,a){var o,s;this.trace("drain port="+i+" graceTimeMs="+a);let u=this.normalizePort(i),l=(0,Ti.splitHostPort)(u.path);if(l?.port===0)throw new Error("Cannot drain port 0");let c=this.boundPorts.get((0,Ti.uriToString)(u));if(!c)return;let d=new Set;for(let f of c.listeningServers){let h=this.http2Servers.get(f);if(h)for(let g of h.sessions)d.add(g),this.closeSession(g,()=>{d.delete(g)})}(s=(o=setTimeout(()=>{for(let f of d)f.destroy(Gn.constants.NGHTTP2_CANCEL)},a)).unref)===null||s===void 0||s.call(o)}forceShutdown(){for(let i of this.boundPorts.values())i.cancelled=!0;this.boundPorts.clear();for(let i of this.http2Servers.keys())this.closeServer(i);this.sessions.forEach((i,a)=>{this.closeSession(a),a.destroy(Gn.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,zt.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(i,a,o,s,u){return this.handlers.has(i)?!1:(this.handlers.set(i,{func:a,serialize:o,deserialize:s,type:u,path:i}),!0)}unregister(i){return this.handlers.delete(i)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(i=>!i.listening))throw new Error("server must be bound in order to start");if(this.started===!0)throw new Error("server is already started");this.started=!0}tryShutdown(i){var a;let o=l=>{(0,zt.unregisterChannelzRef)(this.channelzRef),i(l)},s=0;function u(){s--,s===0&&o()}this.shutdown=!0;for(let[l,c]of this.http2Servers.entries()){s++;let d=c.channelzRef.name;this.trace("Waiting for server "+d+" to close"),this.closeServer(l,()=>{this.trace("Server "+d+" finished closing"),u()});for(let f of c.sessions.keys()){s++;let h=(a=f.socket)===null||a===void 0?void 0:a.remoteAddress;this.trace("Waiting for session "+h+" to close"),this.closeSession(f,()=>{this.trace("Session "+h+" finished closing"),u()})}}s===0&&o()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(i,a){let o=a[Gn.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof o!="string"||!o.startsWith("application/grpc")?(i.respond({[Gn.constants.HTTP2_HEADER_STATUS]:Gn.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(i){this.trace("Received call to method "+i+" at address "+this.serverAddressString);let a=this.handlers.get(i);return a===void 0?(this.trace("No handler registered for method "+i+". Sending UNIMPLEMENTED status."),null):a}_respondWithError(i,a,o=null){var s,u;let l=Object.assign({"grpc-status":(s=i.code)!==null&&s!==void 0?s:Dt.Status.INTERNAL,"grpc-message":i.details,[Gn.constants.HTTP2_HEADER_STATUS]:Gn.constants.HTTP_STATUS_OK,[Gn.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(u=i.metadata)===null||u===void 0?void 0:u.toHttp2Headers());a.respond(l,{endStream:!0}),this.callTracker.addCallFailed(),o?.streamTracker.addCallFailed()}_channelzHandler(i,a,o){this.onStreamOpened(a);let s=this.sessions.get(a.session);if(this.callTracker.addCallStarted(),s?.streamTracker.addCallStarted(),!this._verifyContentType(a,o)){this.callTracker.addCallFailed(),s?.streamTracker.addCallFailed();return}let u=o[tM],l=this._retrieveHandler(u);if(!l){this._respondWithError(p_(u),a,s);return}let c={addMessageSent:()=>{s&&(s.messagesSent+=1,s.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{s&&(s.messagesReceived+=1,s.lastMessageReceivedTimestamp=new Date)},onCallEnd:f=>{f.code===Dt.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:f=>{s&&(f?s.streamTracker.addCallSucceeded():s.streamTracker.addCallFailed())}},d=(0,jD.getServerInterceptingCall)([...i,...this.interceptors],a,o,c,l,this.options);this._runHandlerForCall(d,l)||(this.callTracker.addCallFailed(),s?.streamTracker.addCallFailed(),d.sendStatus({code:Dt.Status.INTERNAL,details:`Unknown handler type: ${l.type}`}))}_streamHandler(i,a,o){if(this.onStreamOpened(a),this._verifyContentType(a,o)!==!0)return;let s=o[tM],u=this._retrieveHandler(s);if(!u){this._respondWithError(p_(s),a,null);return}let l=(0,jD.getServerInterceptingCall)([...i,...this.interceptors],a,o,null,u,this.options);this._runHandlerForCall(l,u)||l.sendStatus({code:Dt.Status.INTERNAL,details:`Unknown handler type: ${u.type}`})}_runHandlerForCall(i,a){let{type:o}=a;if(o==="unary")DZ(i,a);else if(o==="clientStream")MZ(i,a);else if(o==="serverStream")LZ(i,a);else if(o==="bidi")FZ(i,a);else return!1;return!0}_setupHandlers(i,a){if(i===null)return;let o=i.address(),s="null";o&&(typeof o=="string"?s=o:s=o.address+":"+o.port),this.serverAddressString=s;let u=this.channelzEnabled?this._channelzHandler:this._streamHandler,l=this.channelzEnabled?this._channelzSessionHandler(i):this._sessionHandler(i);i.on("stream",u.bind(this,a)),i.on("session",l)}_sessionHandler(i){return a=>{var o,s;(o=this.http2Servers.get(i))===null||o===void 0||o.sessions.add(a);let u=null,l=null,c=null,d=!1,f=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Md){let v=this.maxConnectionAgeMs/10,C=Math.random()*v*2-v;u=setTimeout(()=>{var N,I;d=!0,this.trace("Connection dropped by max connection age: "+((N=a.socket)===null||N===void 0?void 0:N.remoteAddress));try{a.goaway(Gn.constants.NGHTTP2_NO_ERROR,~(1<<31),nM)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Md&&(l=setTimeout(()=>{a.destroy()},this.maxConnectionAgeGraceMs),(I=l.unref)===null||I===void 0||I.call(l))},this.maxConnectionAgeMs+C),(s=u.unref)===null||s===void 0||s.call(u)}let h=()=>{c&&(clearTimeout(c),c=null)},g=()=>!a.destroyed&&this.keepaliveTimeMs<h_&&this.keepaliveTimeMs>0,p,b=()=>{var v;g()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),c=setTimeout(()=>{h(),p()},this.keepaliveTimeMs),(v=c.unref)===null||v===void 0||v.call(c))};p=()=>{var v;if(!g())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let C="";try{a.ping((I,M,x)=>{h(),I?(this.keepaliveTrace("Ping failed with error: "+I.message),d=!0,a.close()):(this.keepaliveTrace("Received ping response"),b())})||(C="Ping returned false")}catch(N){C=(N instanceof Error?N.message:"")||"Unknown error"}if(C){this.keepaliveTrace("Ping send failed: "+C),this.trace("Connection dropped due to ping send error: "+C),d=!0,a.close();return}c=setTimeout(()=>{h(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),d=!0,a.close()},this.keepaliveTimeoutMs),(v=c.unref)===null||v===void 0||v.call(c)},b(),a.on("close",()=>{var v,C;d||this.trace(`Connection dropped by client ${(v=a.socket)===null||v===void 0?void 0:v.remoteAddress}`),u&&clearTimeout(u),l&&clearTimeout(l),h(),f!==null&&(clearTimeout(f.timeout),this.sessionIdleTimeouts.delete(a)),(C=this.http2Servers.get(i))===null||C===void 0||C.sessions.delete(a)})}}_channelzSessionHandler(i){return a=>{var o,s,u,l;let c=(0,zt.registerChannelzSocket)((s=(o=a.socket)===null||o===void 0?void 0:o.remoteAddress)!==null&&s!==void 0?s:"unknown",this.getChannelzSessionInfo.bind(this,a),this.channelzEnabled),d={ref:c,streamTracker:new zt.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(u=this.http2Servers.get(i))===null||u===void 0||u.sessions.add(a),this.sessions.set(a,d);let f=`${a.socket.remoteAddress}:${a.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+f),this.trace("Connection established by client "+f),this.sessionChildrenTracker.refChild(c);let h=null,g=null,p=null,b=!1,v=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Md){let x=this.maxConnectionAgeMs/10,U=Math.random()*x*2-x;h=setTimeout(()=>{var G;b=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+f);try{a.goaway(Gn.constants.NGHTTP2_NO_ERROR,~(1<<31),nM)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Md&&(g=setTimeout(()=>{a.destroy()},this.maxConnectionAgeGraceMs),(G=g.unref)===null||G===void 0||G.call(g))},this.maxConnectionAgeMs+U),(l=h.unref)===null||l===void 0||l.call(h)}let C=()=>{p&&(clearTimeout(p),p=null)},N=()=>!a.destroyed&&this.keepaliveTimeMs<h_&&this.keepaliveTimeMs>0,I,M=()=>{var x;N()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),p=setTimeout(()=>{C(),I()},this.keepaliveTimeMs),(x=p.unref)===null||x===void 0||x.call(p))};I=()=>{var x;if(!N())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let U="";try{a.ping((le,j,w)=>{C(),le?(this.keepaliveTrace("Ping failed with error: "+le.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+le.message+" return in "+j),b=!0,a.close()):(this.keepaliveTrace("Received ping response"),M())})||(U="Ping returned false")}catch(G){U=(G instanceof Error?G.message:"")||"Unknown error"}if(U){this.keepaliveTrace("Ping send failed: "+U),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+U),b=!0,a.close();return}d.keepAlivesSent+=1,p=setTimeout(()=>{C(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+f),b=!0,a.close()},this.keepaliveTimeoutMs),(x=p.unref)===null||x===void 0||x.call(p)},M(),a.on("close",()=>{var x;b||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+f),this.sessionChildrenTracker.unrefChild(c),(0,zt.unregisterChannelzRef)(c),h&&clearTimeout(h),g&&clearTimeout(g),C(),v!==null&&(clearTimeout(v.timeout),this.sessionIdleTimeouts.delete(a)),(x=this.http2Servers.get(i))===null||x===void 0||x.sessions.delete(a),this.sessions.delete(a)})}}enableIdleTimeout(i){var a,o;if(this.sessionIdleTimeout>=eM)return null;let s={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,i),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,i)};(o=(a=s.timeout).unref)===null||o===void 0||o.call(a),this.sessionIdleTimeouts.set(i,s);let{socket:u}=i;return this.trace("Enable idle timeout for "+u.remoteAddress+":"+u.remotePort),s}onIdleTimeout(i,a){let{socket:o}=a,s=i.sessionIdleTimeouts.get(a);s!==void 0&&s.activeStreams===0&&(Date.now()-s.lastIdle>=i.sessionIdleTimeout?(i.trace("Session idle timeout triggered for "+o?.remoteAddress+":"+o?.remotePort+" last idle at "+s.lastIdle),i.closeSession(a)):s.timeout.refresh())}onStreamOpened(i){let a=i.session,o=this.sessionIdleTimeouts.get(a);o&&(o.activeStreams+=1,i.once("close",o.onClose))}onStreamClose(i){var a,o;let s=this.sessionIdleTimeouts.get(i);s&&(s.activeStreams-=1,s.activeStreams===0&&(s.lastIdle=Date.now(),s.timeout.refresh(),this.trace("Session onStreamClose"+((a=i.socket)===null||a===void 0?void 0:a.remoteAddress)+":"+((o=i.socket)===null||o===void 0?void 0:o.remotePort)+" at "+s.lastIdle)))}},(()=>{let r=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[wZ("Calling start() is no longer necessary. It can be safely omitted.")],NZ(e,null,n,{kind:"method",name:"start",static:!1,private:!1,access:{has:i=>"start"in i,get:i=>i.start},metadata:r},null,t),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();ko.Server=BZ;async function DZ(e,t){let n;function r(o,s,u,l){if(o){e.sendStatus((0,Ld.serverErrorToStatus)(o,u));return}e.sendMessage(s,()=>{e.sendStatus({code:Dt.Status.OK,details:"OK",metadata:u??null})})}let i,a=null;e.start({onReceiveMetadata(o){i=o,e.startRead()},onReceiveMessage(o){if(a){e.sendStatus({code:Dt.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${t.path}`,metadata:null});return}a=o,e.startRead()},onReceiveHalfClose(){if(!a){e.sendStatus({code:Dt.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${t.path}`,metadata:null});return}n=new Ld.ServerWritableStreamImpl(t.path,e,i,a);try{t.func(n,r)}catch(o){e.sendStatus({code:Dt.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onCancel(){n&&(n.cancelled=!0,n.emit("cancelled","cancelled"))}})}function MZ(e,t){let n;function r(i,a,o,s){if(i){e.sendStatus((0,Ld.serverErrorToStatus)(i,o));return}e.sendMessage(a,()=>{e.sendStatus({code:Dt.Status.OK,details:"OK",metadata:o??null})})}e.start({onReceiveMetadata(i){n=new Ld.ServerDuplexStreamImpl(t.path,e,i);try{t.func(n,r)}catch(a){e.sendStatus({code:Dt.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onReceiveMessage(i){n.push(i)},onReceiveHalfClose(){n.push(null)},onCancel(){n&&(n.cancelled=!0,n.emit("cancelled","cancelled"),n.destroy())}})}function LZ(e,t){let n,r,i=null;e.start({onReceiveMetadata(a){r=a,e.startRead()},onReceiveMessage(a){if(i){e.sendStatus({code:Dt.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${t.path}`,metadata:null});return}i=a,e.startRead()},onReceiveHalfClose(){if(!i){e.sendStatus({code:Dt.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${t.path}`,metadata:null});return}n=new Ld.ServerWritableStreamImpl(t.path,e,r,i);try{t.func(n)}catch(a){e.sendStatus({code:Dt.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onCancel(){n&&(n.cancelled=!0,n.emit("cancelled","cancelled"),n.destroy())}})}function FZ(e,t){let n;e.start({onReceiveMetadata(r){n=new Ld.ServerDuplexStreamImpl(t.path,e,r);try{t.func(n)}catch(i){e.sendStatus({code:Dt.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onReceiveMessage(r){n.push(r)},onReceiveHalfClose(){n.push(null)},onCancel(){n&&(n.cancelled=!0,n.emit("cancelled","cancelled"),n.destroy())}})}});var iM=m(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.StatusBuilder=void 0;var m_=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(t){return this.code=t,this}withDetails(t){return this.details=t,this}withMetadata(t){return this.metadata=t,this}build(){let t={};return this.code!==null&&(t.code=this.code),this.details!==null&&(t.details=this.details),this.metadata!==null&&(t.metadata=this.metadata),t}};s0.StatusBuilder=m_});var g_=m(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.parseDuration=ji.isDuration=ji.durationToMs=ji.msToDuration=void 0;function UZ(e){return{seconds:e/1e3|0,nanos:e%1e3*1e6|0}}ji.msToDuration=UZ;function qZ(e){return e.seconds*1e3+e.nanos/1e6|0}ji.durationToMs=qZ;function VZ(e){return typeof e.seconds=="number"&&typeof e.nanos=="number"}ji.isDuration=VZ;var JZ=/^(\d+)(?:\.(\d+))?s$/;function WZ(e){let t=e.match(JZ);return t?{seconds:Number.parseInt(t[1],10),nanos:t[2]?Number.parseInt(t[2].padEnd(9,"0"),10):0}:null}ji.parseDuration=WZ});var u0=m(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.setup=Mr.LeafLoadBalancer=Mr.PickFirstLoadBalancer=Mr.shuffled=Mr.PickFirstLoadBalancingConfig=void 0;var y_=Ms(),Mt=_r(),Fd=so(),aM=Nr(),HZ=ut(),GZ=Ie(),oM=Nr(),sM=xe("net"),zZ="pick_first";function Zh(e){HZ.trace(GZ.LogVerbosity.DEBUG,zZ,e)}var Yh="pick_first",QZ=250,Ud=class e{constructor(t){this.shuffleAddressList=t}getLoadBalancerName(){return Yh}toJsonObject(){return{[Yh]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(t){if("shuffleAddressList"in t&&typeof t.shuffleAddressList!="boolean")throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new e(t.shuffleAddressList===!0)}};Mr.PickFirstLoadBalancingConfig=Ud;var v_=class{constructor(t){this.subchannel=t}pick(t){return{pickResultType:Fd.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function uM(e){let t=e.slice();for(let n=t.length-1;n>1;n--){let r=Math.floor(Math.random()*(n+1)),i=t[n];t[n]=t[r],t[r]=i}return t}Mr.shuffled=uM;function KZ(e){let t=[],n=[],r=[],i=(0,oM.isTcpSubchannelAddress)(e[0])&&(0,sM.isIPv6)(e[0].host);for(let s of e)(0,oM.isTcpSubchannelAddress)(s)&&(0,sM.isIPv6)(s.host)?n.push(s):r.push(s);let a=i?n:r,o=i?r:n;for(let s=0;s<Math.max(a.length,o.length);s++)s<a.length&&t.push(a[s]),s<o.length&&t.push(o[s]);return t}var lM="grpc-node.internal.pick-first.report_health_status",Xh=class{constructor(t,n,r){this.channelControlHelper=t,this.children=[],this.currentState=Mt.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(i,a,o,s,u)=>{this.onSubchannelStateUpdate(i,a,o,u)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.lastError=null,this.latestAddressList=null,this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout),this.reportHealthStatus=r[lM]}allChildrenHaveReportedTF(){return this.children.every(t=>t.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(t=>t.hasReportedTransientFailure=!1)}calculateAndReportNewState(){this.currentPick?this.reportHealthStatus&&!this.currentPick.isHealthy()?this.updateState(Mt.ConnectivityState.TRANSIENT_FAILURE,new Fd.UnavailablePicker({details:`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`})):this.updateState(Mt.ConnectivityState.READY,new v_(this.currentPick)):this.children.length===0?this.updateState(Mt.ConnectivityState.IDLE,new Fd.QueuePicker(this)):this.stickyTransientFailureMode?this.updateState(Mt.ConnectivityState.TRANSIENT_FAILURE,new Fd.UnavailablePicker({details:`No connection established. Last error: ${this.lastError}`})):this.updateState(Mt.ConnectivityState.CONNECTING,new Fd.QueuePicker(this))}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:t}of this.children)t.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(t,n,r,i){var a;if(!((a=this.currentPick)===null||a===void 0)&&a.realSubchannelEquals(t)){r!==Mt.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[o,s]of this.children.entries())if(t.realSubchannelEquals(s.subchannel)){r===Mt.ConnectivityState.READY&&this.pickSubchannel(s.subchannel),r===Mt.ConnectivityState.TRANSIENT_FAILURE&&(s.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),o===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(o+1)),s.subchannel.startConnecting();return}}startNextSubchannelConnecting(t){clearTimeout(this.connectionDelayTimeout);for(let[n,r]of this.children.entries())if(n>=t){let i=r.subchannel.getConnectivityState();if(i===Mt.ConnectivityState.IDLE||i===Mt.ConnectivityState.CONNECTING){this.startConnecting(n);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(t){var n,r;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=t,this.children[t].subchannel.getConnectivityState()===Mt.ConnectivityState.IDLE&&(Zh("Start connecting to subchannel with address "+this.children[t].subchannel.getAddress()),process.nextTick(()=>{var i;(i=this.children[t])===null||i===void 0||i.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(t+1)},QZ),(r=(n=this.connectionDelayTimeout).unref)===null||r===void 0||r.call(n)}pickSubchannel(t){Zh("Pick subchannel with address "+t.getAddress()),this.stickyTransientFailureMode=!1,t.ref(),this.channelControlHelper.addChannelzChild(t.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),t.addConnectivityStateListener(this.subchannelStateListener),t.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=t,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(t,n){Zh(Mt.ConnectivityState[this.currentState]+" -> "+Mt.ConnectivityState[t]),this.currentState=t,this.channelControlHelper.updateState(t,n)}resetSubchannelList(){for(let t of this.children)t.subchannel.removeConnectivityStateListener(this.subchannelStateListener),t.subchannel.unref(),this.channelControlHelper.removeChannelzChild(t.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(t){Zh("connectToAddressList(["+t.map(r=>(0,aM.subchannelAddressToString)(r))+"])");let n=t.map(r=>({subchannel:this.channelControlHelper.createSubchannel(r,{},null),hasReportedTransientFailure:!1}));for(let{subchannel:r}of n)if(r.getConnectivityState()===Mt.ConnectivityState.READY){this.pickSubchannel(r);return}for(let{subchannel:r}of n)r.ref(),this.channelControlHelper.addChannelzChild(r.getChannelzRef());this.resetSubchannelList(),this.children=n;for(let{subchannel:r}of this.children)r.addConnectivityStateListener(this.subchannelStateListener);for(let r of this.children)r.subchannel.getConnectivityState()===Mt.ConnectivityState.TRANSIENT_FAILURE&&(r.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(t,n){if(!(n instanceof Ud))return;n.getShuffleAddressList()&&(t=uM(t));let r=[].concat(...t.map(a=>a.addresses));if(Zh("updateAddressList(["+r.map(a=>(0,aM.subchannelAddressToString)(a))+"])"),r.length===0)throw new Error("No addresses in endpoint list passed to pick_first");let i=KZ(r);this.latestAddressList=i,this.connectToAddressList(i)}exitIdle(){this.currentState===Mt.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return Yh}};Mr.PickFirstLoadBalancer=Xh;var ZZ=new Ud(!1),S_=class{constructor(t,n,r,i){this.endpoint=t,this.latestState=Mt.ConnectivityState.IDLE;let a=(0,y_.createChildChannelControlHelper)(n,{updateState:(o,s)=>{this.latestState=o,this.latestPicker=s,n.updateState(o,s)}});this.pickFirstBalancer=new Xh(a,r,Object.assign(Object.assign({},i),{[lM]:!0})),this.latestPicker=new Fd.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList([this.endpoint],ZZ)}updateEndpoint(t){this.endpoint=t,this.latestState!==Mt.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};Mr.LeafLoadBalancer=S_;function YZ(){(0,y_.registerLoadBalancerType)(Yh,Xh,Ud),(0,y_.registerDefaultLoadBalancerType)(Yh)}Mr.setup=YZ});var cM=m(c0=>{"use strict";Object.defineProperty(c0,"__esModule",{value:!0});c0.FileWatcherCertificateProvider=void 0;var XZ=xe("fs"),$Z=ut(),jZ=Ie(),eY=xe("util"),tY="certificate_provider";function l0(e){$Z.trace(jZ.LogVerbosity.DEBUG,tY,e)}var b_=(0,eY.promisify)(XZ.readFile),T_=class{constructor(t){if(this.config=t,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=null,this.caListeners=new Set,this.latestIdentityUpdate=null,this.identityListeners=new Set,this.lastUpdateTime=null,t.certificateFile===void 0!=(t.privateKeyFile===void 0))throw new Error("certificateFile and privateKeyFile must be set or unset together");if(t.certificateFile===void 0&&t.caCertificateFile===void 0)throw new Error("At least one of certificateFile and caCertificateFile must be set");l0("File watcher constructed with config "+JSON.stringify(t))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?b_(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?b_(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?b_(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([t,n,r])=>{if(this.refreshTimer){l0("File watcher read certificates certificate"+(t?"!=":"==")+"null, privateKey"+(n?"!=":"==")+"null, CA certificate"+(r?"!=":"==")+"null"),this.lastUpdateTime=new Date,this.fileResultPromise=null,t.status==="fulfilled"&&n.status==="fulfilled"?this.latestIdentityUpdate={certificate:t.value,privateKey:n.value}:this.latestIdentityUpdate=null,r.status==="fulfilled"&&(this.latestCaUpdate={caCertificate:r.value});for(let i of this.identityListeners)i(this.latestIdentityUpdate);for(let i of this.caListeners)i(this.latestCaUpdate)}}),l0("File watcher initiated certificate update"))}maybeStartWatchingFiles(){if(!this.refreshTimer){let t=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;t>this.config.refreshIntervalMs&&this.updateCertificates(),t>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=null,this.latestIdentityUpdate=null),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),l0("File watcher started watching")}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(t){this.caListeners.add(t),this.maybeStartWatchingFiles(),process.nextTick(t,this.latestCaUpdate)}removeCaCertificateListener(t){this.caListeners.delete(t),this.maybeStopWatchingFiles()}addIdentityCertificateListener(t){this.identityListeners.add(t),this.maybeStartWatchingFiles(),process.nextTick(t,this.latestIdentityUpdate)}removeIdentityCertificateListener(t){this.identityListeners.delete(t),this.maybeStopWatchingFiles()}};c0.FileWatcherCertificateProvider=T_});var C_=m(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.createCertificateProviderChannelCredentials=ee.FileWatcherCertificateProvider=ee.createCertificateProviderServerCredentials=ee.createServerCredentialsWithInterceptors=ee.BaseSubchannelWrapper=ee.registerAdminService=ee.FilterStackFactory=ee.BaseFilter=ee.PickResultType=ee.QueuePicker=ee.UnavailablePicker=ee.ChildLoadBalancerHandler=ee.EndpointMap=ee.endpointHasAddress=ee.endpointToString=ee.subchannelAddressToString=ee.LeafLoadBalancer=ee.isLoadBalancerNameRegistered=ee.parseLoadBalancingConfig=ee.selectLbConfigFromList=ee.registerLoadBalancerType=ee.createChildChannelControlHelper=ee.BackoffTimeout=ee.parseDuration=ee.durationToMs=ee.splitHostPort=ee.uriToString=ee.createResolver=ee.registerResolver=ee.log=ee.trace=void 0;var dM=ut();Object.defineProperty(ee,"trace",{enumerable:!0,get:function(){return dM.trace}});Object.defineProperty(ee,"log",{enumerable:!0,get:function(){return dM.log}});var fM=qi();Object.defineProperty(ee,"registerResolver",{enumerable:!0,get:function(){return fM.registerResolver}});Object.defineProperty(ee,"createResolver",{enumerable:!0,get:function(){return fM.createResolver}});var hM=rr();Object.defineProperty(ee,"uriToString",{enumerable:!0,get:function(){return hM.uriToString}});Object.defineProperty(ee,"splitHostPort",{enumerable:!0,get:function(){return hM.splitHostPort}});var pM=g_();Object.defineProperty(ee,"durationToMs",{enumerable:!0,get:function(){return pM.durationToMs}});Object.defineProperty(ee,"parseDuration",{enumerable:!0,get:function(){return pM.parseDuration}});var nY=Ch();Object.defineProperty(ee,"BackoffTimeout",{enumerable:!0,get:function(){return nY.BackoffTimeout}});var $h=Ms();Object.defineProperty(ee,"createChildChannelControlHelper",{enumerable:!0,get:function(){return $h.createChildChannelControlHelper}});Object.defineProperty(ee,"registerLoadBalancerType",{enumerable:!0,get:function(){return $h.registerLoadBalancerType}});Object.defineProperty(ee,"selectLbConfigFromList",{enumerable:!0,get:function(){return $h.selectLbConfigFromList}});Object.defineProperty(ee,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return $h.parseLoadBalancingConfig}});Object.defineProperty(ee,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return $h.isLoadBalancerNameRegistered}});var rY=u0();Object.defineProperty(ee,"LeafLoadBalancer",{enumerable:!0,get:function(){return rY.LeafLoadBalancer}});var d0=Nr();Object.defineProperty(ee,"subchannelAddressToString",{enumerable:!0,get:function(){return d0.subchannelAddressToString}});Object.defineProperty(ee,"endpointToString",{enumerable:!0,get:function(){return d0.endpointToString}});Object.defineProperty(ee,"endpointHasAddress",{enumerable:!0,get:function(){return d0.endpointHasAddress}});Object.defineProperty(ee,"EndpointMap",{enumerable:!0,get:function(){return d0.EndpointMap}});var iY=zm();Object.defineProperty(ee,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return iY.ChildLoadBalancerHandler}});var E_=so();Object.defineProperty(ee,"UnavailablePicker",{enumerable:!0,get:function(){return E_.UnavailablePicker}});Object.defineProperty(ee,"QueuePicker",{enumerable:!0,get:function(){return E_.QueuePicker}});Object.defineProperty(ee,"PickResultType",{enumerable:!0,get:function(){return E_.PickResultType}});var aY=Ok();Object.defineProperty(ee,"BaseFilter",{enumerable:!0,get:function(){return aY.BaseFilter}});var oY=Ak();Object.defineProperty(ee,"FilterStackFactory",{enumerable:!0,get:function(){return oY.FilterStackFactory}});var sY=Zm();Object.defineProperty(ee,"registerAdminService",{enumerable:!0,get:function(){return sY.registerAdminService}});var uY=Yg();Object.defineProperty(ee,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return uY.BaseSubchannelWrapper}});var mM=n0();Object.defineProperty(ee,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return mM.createServerCredentialsWithInterceptors}});Object.defineProperty(ee,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return mM.createCertificateProviderServerCredentials}});var lY=cM();Object.defineProperty(ee,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return lY.FileWatcherCertificateProvider}});var cY=Th();Object.defineProperty(ee,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return cY.createCertificateProviderChannelCredentials}})});var gM=m(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});f0.setup=void 0;var dY=qi(),k_=class{constructor(t,n,r){this.listener=n,this.hasReturnedResult=!1,this.endpoints=[];let i;t.authority===""?i="/"+t.path:i=t.path,this.endpoints=[{addresses:[{path:i}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener.onSuccessfulResolution,this.endpoints,null,null,null,{}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(t){return"localhost"}};function fY(){(0,dY.registerResolver)("unix",k_)}f0.setup=fY});var TM=m(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});m0.setup=void 0;var yM=xe("net"),h0=Ie(),__=Sn(),vM=qi(),SM=rr(),hY=ut(),pY="ip_resolver";function bM(e){hY.trace(h0.LogVerbosity.DEBUG,pY,e)}var A_="ipv4",N_="ipv6",mY=443,p0=class{constructor(t,n,r){var i;this.listener=n,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,bM("Resolver constructed for target "+(0,SM.uriToString)(t));let a=[];if(!(t.scheme===A_||t.scheme===N_)){this.error={code:h0.Status.UNAVAILABLE,details:`Unrecognized scheme ${t.scheme} in IP resolver`,metadata:new __.Metadata};return}let o=t.path.split(",");for(let s of o){let u=(0,SM.splitHostPort)(s);if(u===null){this.error={code:h0.Status.UNAVAILABLE,details:`Failed to parse ${t.scheme} address ${s}`,metadata:new __.Metadata};return}if(t.scheme===A_&&!(0,yM.isIPv4)(u.host)||t.scheme===N_&&!(0,yM.isIPv6)(u.host)){this.error={code:h0.Status.UNAVAILABLE,details:`Failed to parse ${t.scheme} address ${s}`,metadata:new __.Metadata};return}a.push({host:u.host,port:(i=u.port)!==null&&i!==void 0?i:mY})}this.endpoints=a.map(s=>({addresses:[s]})),bM("Parsed "+t.scheme+" address list "+a)}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener.onError(this.error):this.listener.onSuccessfulResolution(this.endpoints,null,null,null,{})}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(t){return t.path.split(",")[0]}};function gY(){(0,vM.registerResolver)(A_,p0),(0,vM.registerResolver)(N_,p0)}m0.setup=gY});var _M=m(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.setup=qd.RoundRobinLoadBalancer=void 0;var kM=Ms(),Pn=_r(),I_=so(),yY=ut(),vY=Ie(),EM=Nr(),SY=u0(),bY="round_robin";function CM(e){yY.trace(vY.LogVerbosity.DEBUG,bY,e)}var g0="round_robin",O_=class e{getLoadBalancerName(){return g0}constructor(){}toJsonObject(){return{[g0]:{}}}static createFromJson(t){return new e}},R_=class{constructor(t,n=0){this.children=t,this.nextIndex=n}pick(t){let n=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,n.pick(t)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}},y0=class{constructor(t,n,r){this.channelControlHelper=t,this.credentials=n,this.options=r,this.children=[],this.currentState=Pn.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,kM.createChildChannelControlHelper)(t,{updateState:(i,a)=>{this.currentState===Pn.ConnectivityState.READY&&i!==Pn.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),this.calculateAndUpdateState()}})}countChildrenWithState(t){return this.children.filter(n=>n.getConnectivityState()===t).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(Pn.ConnectivityState.READY)>0){let t=this.children.filter(r=>r.getConnectivityState()===Pn.ConnectivityState.READY),n=0;if(this.currentReadyPicker!==null){let r=this.currentReadyPicker.peekNextEndpoint();n=t.findIndex(i=>(0,EM.endpointEqual)(i.getEndpoint(),r)),n<0&&(n=0)}this.updateState(Pn.ConnectivityState.READY,new R_(t.map(r=>({endpoint:r.getEndpoint(),picker:r.getPicker()})),n))}else this.countChildrenWithState(Pn.ConnectivityState.CONNECTING)>0?this.updateState(Pn.ConnectivityState.CONNECTING,new I_.QueuePicker(this)):this.countChildrenWithState(Pn.ConnectivityState.TRANSIENT_FAILURE)>0?this.updateState(Pn.ConnectivityState.TRANSIENT_FAILURE,new I_.UnavailablePicker({details:`No connection established. Last error: ${this.lastError}`})):this.updateState(Pn.ConnectivityState.IDLE,new I_.QueuePicker(this));for(let t of this.children)t.getConnectivityState()===Pn.ConnectivityState.IDLE&&t.exitIdle()}}updateState(t,n){CM(Pn.ConnectivityState[this.currentState]+" -> "+Pn.ConnectivityState[t]),t===Pn.ConnectivityState.READY?this.currentReadyPicker=n:this.currentReadyPicker=null,this.currentState=t,this.channelControlHelper.updateState(t,n)}resetSubchannelList(){for(let t of this.children)t.destroy()}updateAddressList(t,n){this.resetSubchannelList(),CM("Connect to endpoint list "+t.map(EM.endpointToString)),this.updatesPaused=!0,this.children=t.map(r=>new SY.LeafLoadBalancer(r,this.childChannelControlHelper,this.credentials,this.options));for(let r of this.children)r.startConnecting();this.updatesPaused=!1,this.calculateAndUpdateState()}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return g0}};qd.RoundRobinLoadBalancer=y0;function TY(){(0,kM.registerLoadBalancerType)(g0,y0,O_)}qd.setup=TY});var IM=m(_o=>{"use strict";var P_;Object.defineProperty(_o,"__esModule",{value:!0});_o.setup=_o.OutlierDetectionLoadBalancer=_o.OutlierDetectionLoadBalancingConfig=void 0;var EY=_r(),AM=Ie(),Ks=g_(),NM=C_(),CY=Ms(),kY=zm(),_Y=so(),w_=Nr(),AY=Yg(),NY=ut(),IY="outlier_detection";function Yt(e){NY.trace(AM.LogVerbosity.DEBUG,IY,e)}var F_="outlier_detection",OY=((P_=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&P_!==void 0?P_:"true")==="true",RY={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},PY={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Vd(e,t,n,r){if(t in e&&e[t]!==void 0&&typeof e[t]!==n){let i=r?`${r}.${t}`:t;throw new Error(`outlier detection config ${i} parse error: expected ${n}, got ${typeof e[t]}`)}}function x_(e,t,n){let r=n?`${n}.${t}`:t;if(t in e&&e[t]!==void 0){if(!(0,Ks.isDuration)(e[t]))throw new Error(`outlier detection config ${r} parse error: expected Duration, got ${typeof e[t]}`);if(!(e[t].seconds>=0&&e[t].seconds<=315576e6&&e[t].nanos>=0&&e[t].nanos<=999999999))throw new Error(`outlier detection config ${r} parse error: values out of range for non-negative Duaration`)}}function v0(e,t,n){let r=n?`${n}.${t}`:t;if(Vd(e,t,"number",n),t in e&&e[t]!==void 0&&!(e[t]>=0&&e[t]<=100))throw new Error(`outlier detection config ${r} parse error: value out of range for percentage (0-100)`)}var jh=class e{constructor(t,n,r,i,a,o,s){if(this.childPolicy=s,s.getLoadBalancerName()==="pick_first")throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=t??1e4,this.baseEjectionTimeMs=n??3e4,this.maxEjectionTimeMs=r??3e5,this.maxEjectionPercent=i??10,this.successRateEjection=a?Object.assign(Object.assign({},RY),a):null,this.failurePercentageEjection=o?Object.assign(Object.assign({},PY),o):null}getLoadBalancerName(){return F_}toJsonObject(){var t,n;return{outlier_detection:{interval:(0,Ks.msToDuration)(this.intervalMs),base_ejection_time:(0,Ks.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,Ks.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(t=this.successRateEjection)!==null&&t!==void 0?t:void 0,failure_percentage_ejection:(n=this.failurePercentageEjection)!==null&&n!==void 0?n:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(t){var n;if(x_(t,"interval"),x_(t,"base_ejection_time"),x_(t,"max_ejection_time"),v0(t,"max_ejection_percent"),"success_rate_ejection"in t&&t.success_rate_ejection!==void 0){if(typeof t.success_rate_ejection!="object")throw new Error("outlier detection config success_rate_ejection must be an object");Vd(t.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),v0(t.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),Vd(t.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),Vd(t.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in t&&t.failure_percentage_ejection!==void 0){if(typeof t.failure_percentage_ejection!="object")throw new Error("outlier detection config failure_percentage_ejection must be an object");v0(t.failure_percentage_ejection,"threshold","failure_percentage_ejection"),v0(t.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),Vd(t.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),Vd(t.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in t)||!Array.isArray(t.child_policy))throw new Error("outlier detection config child_policy must be an array");let r=(0,CY.selectLbConfigFromList)(t.child_policy);if(!r)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new e(t.interval?(0,Ks.durationToMs)(t.interval):null,t.base_ejection_time?(0,Ks.durationToMs)(t.base_ejection_time):null,t.max_ejection_time?(0,Ks.durationToMs)(t.max_ejection_time):null,(n=t.max_ejection_percent)!==null&&n!==void 0?n:null,t.success_rate_ejection,t.failure_percentage_ejection,r)}};_o.OutlierDetectionLoadBalancingConfig=jh;var D_=class extends AY.BaseSubchannelWrapper{constructor(t,n){super(t),this.mapEntry=n,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0&&this.mapEntry){let t=this.mapEntry.subchannelWrappers.indexOf(this);t>=0&&this.mapEntry.subchannelWrappers.splice(t,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function B_(){return{success:0,failure:0}}var M_=class{constructor(){this.activeBucket=B_(),this.inactiveBucket=B_()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=B_()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},L_=class{constructor(t,n){this.wrappedPicker=t,this.countCalls=n}pick(t){let n=this.wrappedPicker.pick(t);if(n.pickResultType===_Y.PickResultType.COMPLETE){let r=n.subchannel,i=r.getMapEntry();if(i){let a=n.onCallEnded;return this.countCalls&&(a=o=>{var s;o===AM.Status.OK?i.counter.addSuccess():i.counter.addFailure(),(s=n.onCallEnded)===null||s===void 0||s.call(n,o)}),Object.assign(Object.assign({},n),{subchannel:r.getWrappedSubchannel(),onCallEnded:a})}else return Object.assign(Object.assign({},n),{subchannel:r.getWrappedSubchannel()})}else return n}},S0=class{constructor(t,n,r){this.entryMap=new w_.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new kY.ChildLoadBalancerHandler((0,NM.createChildChannelControlHelper)(t,{createSubchannel:(i,a,o)=>{let s=t.createSubchannel(i,a,o),u=this.entryMap.getForSubchannelAddress(i),l=new D_(s,u);return u?.currentEjectionTimestamp!==null&&l.eject(),u?.subchannelWrappers.push(l),l},updateState:(i,a)=>{i===EY.ConnectivityState.READY?t.updateState(i,new L_(a,this.isCountingEnabled())):t.updateState(i,a)}}),n,r),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let t=0;for(let n of this.entryMap.values())n.currentEjectionTimestamp!==null&&(t+=1);return t*100/this.entryMap.size}runSuccessRateCheck(t){if(!this.latestConfig)return;let n=this.latestConfig.getSuccessRateEjectionConfig();if(!n)return;Yt("Running success rate check");let r=n.request_volume,i=0,a=[];for(let[d,f]of this.entryMap.entries()){let h=f.counter.getLastSuccesses(),g=f.counter.getLastFailures();Yt("Stats for "+(0,w_.endpointToString)(d)+": successes="+h+" failures="+g+" targetRequestVolume="+r),h+g>=r&&(i+=1,a.push(h/(h+g)))}if(Yt("Found "+i+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+a+"]"),i<n.minimum_hosts)return;let o=a.reduce((d,f)=>d+f)/a.length,s=0;for(let d of a){let f=d-o;s+=f*f}let u=s/a.length,l=Math.sqrt(u),c=o-l*(n.stdev_factor/1e3);Yt("stdev="+l+" ejectionThreshold="+c);for(let[d,f]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let h=f.counter.getLastSuccesses(),g=f.counter.getLastFailures();if(h+g<r)continue;let p=h/(h+g);if(Yt("Checking candidate "+d+" successRate="+p),p<c){let b=Math.random()*100;Yt("Candidate "+d+" randomNumber="+b+" enforcement_percentage="+n.enforcement_percentage),b<n.enforcement_percentage&&(Yt("Ejecting candidate "+d),this.eject(f,t))}}}runFailurePercentageCheck(t){if(!this.latestConfig)return;let n=this.latestConfig.getFailurePercentageEjectionConfig();if(!n)return;Yt("Running failure percentage check. threshold="+n.threshold+" request volume threshold="+n.request_volume);let r=0;for(let i of this.entryMap.values()){let a=i.counter.getLastSuccesses(),o=i.counter.getLastFailures();a+o>=n.request_volume&&(r+=1)}if(!(r<n.minimum_hosts))for(let[i,a]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let o=a.counter.getLastSuccesses(),s=a.counter.getLastFailures();if(Yt("Candidate successes="+o+" failures="+s),o+s<n.request_volume)continue;if(s*100/(s+o)>n.threshold){let l=Math.random()*100;Yt("Candidate "+i+" randomNumber="+l+" enforcement_percentage="+n.enforcement_percentage),l<n.enforcement_percentage&&(Yt("Ejecting candidate "+i),this.eject(a,t))}}}eject(t,n){t.currentEjectionTimestamp=new Date,t.ejectionTimeMultiplier+=1;for(let r of t.subchannelWrappers)r.eject()}uneject(t){t.currentEjectionTimestamp=null;for(let n of t.subchannelWrappers)n.uneject()}switchAllBuckets(){for(let t of this.entryMap.values())t.counter.switchBuckets()}startTimer(t){var n,r;this.ejectionTimer=setTimeout(()=>this.runChecks(),t),(r=(n=this.ejectionTimer).unref)===null||r===void 0||r.call(n)}runChecks(){let t=new Date;if(Yt("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=t,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(t),this.runFailurePercentageCheck(t);for(let[n,r]of this.entryMap.entries())if(r.currentEjectionTimestamp===null)r.ejectionTimeMultiplier>0&&(r.ejectionTimeMultiplier-=1);else{let i=this.latestConfig.getBaseEjectionTimeMs(),a=this.latestConfig.getMaxEjectionTimeMs(),o=new Date(r.currentEjectionTimestamp.getTime());o.setMilliseconds(o.getMilliseconds()+Math.min(i*r.ejectionTimeMultiplier,Math.max(i,a))),o<new Date&&(Yt("Unejecting "+n),this.uneject(r))}}}updateAddressList(t,n,r){if(!(n instanceof jh))return;for(let a of t)this.entryMap.has(a)||(Yt("Adding map entry for "+(0,w_.endpointToString)(a)),this.entryMap.set(a,{counter:new M_,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(t);let i=n.getChildPolicy();if(this.childBalancer.updateAddressList(t,i,r),n.getSuccessRateEjectionConfig()||n.getFailurePercentageEjectionConfig())if(this.timerStartTime){Yt("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let a=n.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(a)}else Yt("Starting new timer"),this.timerStartTime=new Date,this.startTimer(n.getIntervalMs()),this.switchAllBuckets();else{Yt("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let a of this.entryMap.values())this.uneject(a),a.ejectionTimeMultiplier=0}this.latestConfig=n}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return F_}};_o.OutlierDetectionLoadBalancer=S0;function wY(){OY&&(0,NM.registerLoadBalancerType)(F_,S0,jh)}_o.setup=wY});var Ao=m(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.experimental=Q.ServerInterceptingCall=Q.ResponderBuilder=Q.ServerListenerBuilder=Q.addAdminServicesToServer=Q.getChannelzHandlers=Q.getChannelzServiceDefinition=Q.InterceptorConfigurationError=Q.InterceptingCall=Q.RequesterBuilder=Q.ListenerBuilder=Q.StatusBuilder=Q.getClientChannel=Q.ServerCredentials=Q.Server=Q.setLogVerbosity=Q.setLogger=Q.load=Q.loadObject=Q.CallCredentials=Q.ChannelCredentials=Q.waitForClientReady=Q.closeClient=Q.Channel=Q.makeGenericClientConstructor=Q.makeClientConstructor=Q.loadPackageDefinition=Q.Client=Q.compressionAlgorithms=Q.propagate=Q.connectivityState=Q.status=Q.logVerbosity=Q.Metadata=Q.credentials=void 0;var b0=RE();Object.defineProperty(Q,"CallCredentials",{enumerable:!0,get:function(){return b0.CallCredentials}});var xY=cC();Object.defineProperty(Q,"Channel",{enumerable:!0,get:function(){return xY.ChannelImplementation}});var BY=Nk();Object.defineProperty(Q,"compressionAlgorithms",{enumerable:!0,get:function(){return BY.CompressionAlgorithms}});var DY=_r();Object.defineProperty(Q,"connectivityState",{enumerable:!0,get:function(){return DY.ConnectivityState}});var T0=Th();Object.defineProperty(Q,"ChannelCredentials",{enumerable:!0,get:function(){return T0.ChannelCredentials}});var OM=lC();Object.defineProperty(Q,"Client",{enumerable:!0,get:function(){return OM.Client}});var U_=Ie();Object.defineProperty(Q,"logVerbosity",{enumerable:!0,get:function(){return U_.LogVerbosity}});Object.defineProperty(Q,"status",{enumerable:!0,get:function(){return U_.Status}});Object.defineProperty(Q,"propagate",{enumerable:!0,get:function(){return U_.Propagate}});var RM=ut(),q_=fC();Object.defineProperty(Q,"loadPackageDefinition",{enumerable:!0,get:function(){return q_.loadPackageDefinition}});Object.defineProperty(Q,"makeClientConstructor",{enumerable:!0,get:function(){return q_.makeClientConstructor}});Object.defineProperty(Q,"makeGenericClientConstructor",{enumerable:!0,get:function(){return q_.makeClientConstructor}});var MY=Sn();Object.defineProperty(Q,"Metadata",{enumerable:!0,get:function(){return MY.Metadata}});var LY=rM();Object.defineProperty(Q,"Server",{enumerable:!0,get:function(){return LY.Server}});var FY=n0();Object.defineProperty(Q,"ServerCredentials",{enumerable:!0,get:function(){return FY.ServerCredentials}});var UY=iM();Object.defineProperty(Q,"StatusBuilder",{enumerable:!0,get:function(){return UY.StatusBuilder}});Q.credentials={combineChannelCredentials:(e,...t)=>t.reduce((n,r)=>n.compose(r),e),combineCallCredentials:(e,...t)=>t.reduce((n,r)=>n.compose(r),e),createInsecure:T0.ChannelCredentials.createInsecure,createSsl:T0.ChannelCredentials.createSsl,createFromSecureContext:T0.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:b0.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:b0.CallCredentials.createFromGoogleCredential,createEmpty:b0.CallCredentials.createEmpty};var qY=e=>e.close();Q.closeClient=qY;var VY=(e,t,n)=>e.waitForReady(t,n);Q.waitForClientReady=VY;var JY=(e,t)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};Q.loadObject=JY;var WY=(e,t,n)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};Q.load=WY;var HY=e=>{RM.setLogger(e)};Q.setLogger=HY;var GY=e=>{RM.setLoggerVerbosity(e)};Q.setLogVerbosity=GY;var zY=e=>OM.Client.prototype.getChannel.call(e);Q.getClientChannel=zY;var E0=oC();Object.defineProperty(Q,"ListenerBuilder",{enumerable:!0,get:function(){return E0.ListenerBuilder}});Object.defineProperty(Q,"RequesterBuilder",{enumerable:!0,get:function(){return E0.RequesterBuilder}});Object.defineProperty(Q,"InterceptingCall",{enumerable:!0,get:function(){return E0.InterceptingCall}});Object.defineProperty(Q,"InterceptorConfigurationError",{enumerable:!0,get:function(){return E0.InterceptorConfigurationError}});var PM=Js();Object.defineProperty(Q,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return PM.getChannelzServiceDefinition}});Object.defineProperty(Q,"getChannelzHandlers",{enumerable:!0,get:function(){return PM.getChannelzHandlers}});var QY=Zm();Object.defineProperty(Q,"addAdminServicesToServer",{enumerable:!0,get:function(){return QY.addAdminServicesToServer}});var V_=f_();Object.defineProperty(Q,"ServerListenerBuilder",{enumerable:!0,get:function(){return V_.ServerListenerBuilder}});Object.defineProperty(Q,"ResponderBuilder",{enumerable:!0,get:function(){return V_.ResponderBuilder}});Object.defineProperty(Q,"ServerInterceptingCall",{enumerable:!0,get:function(){return V_.ServerInterceptingCall}});var KY=C_();Q.experimental=KY;var ZY=mk(),YY=gM(),XY=TM(),$Y=u0(),jY=_M(),eX=IM(),tX=Js();ZY.setup(),YY.setup(),XY.setup(),$Y.setup(),jY.setup(),eX.setup(),tX.setup()});var wM=m(C0=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});C0.Metadata=void 0;C0.Metadata=function(t){let n=new Map,r={set(i,a){if(i=Jd(i),Array.isArray(a))if(a.length===0)n.delete(i);else{for(let o of a)J_(i,o);n.set(i,i.endsWith("-bin")?a:[a.join(", ")])}else J_(i,a),n.set(i,[a]);return r},append(i,a){i=Jd(i),J_(i,a);let o=n.get(i);return o==null&&(o=[],n.set(i,o)),o.push(a),i.endsWith("-bin")||n.set(i,[o.join(", ")]),r},delete(i){i=Jd(i),n.delete(i)},get(i){var a;return i=Jd(i),(a=n.get(i))===null||a===void 0?void 0:a[0]},getAll(i){var a;return i=Jd(i),(a=n.get(i))!==null&&a!==void 0?a:[]},has(i){return i=Jd(i),n.has(i)},[Symbol.iterator](){return n[Symbol.iterator]()}};if(t!=null){let i=nX(t)?t:Object.entries(t);for(let[a,o]of i)r.set(a,o)}return r};function Jd(e){return e.toLowerCase()}function J_(e,t){if(!/^[0-9a-z_.-]+$/.test(e))throw new Error(`Metadata key '${e}' contains illegal characters`);if(e.endsWith("-bin")){if(!(t instanceof Uint8Array))throw new Error(`Metadata key '${e}' ends with '-bin', thus it must have binary value`)}else{if(typeof t!="string")throw new Error(`Metadata key '${e}' doesn't end with '-bin', thus it must have string value`);if(!/^[ -~]*$/.test(t))throw new Error(`Metadata value '${t}' of key '${e}' contains illegal characters`)}}function nX(e){return Symbol.iterator in e}});var k0=m(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.Status=void 0;var rX;(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"})(rX=ep.Status||(ep.Status={}))});var BM=m(xM=>{"use strict";Object.defineProperty(xM,"__esModule",{value:!0})});var MM=m(DM=>{"use strict";Object.defineProperty(DM,"__esModule",{value:!0})});var FM=m(LM=>{"use strict";Object.defineProperty(LM,"__esModule",{value:!0})});var UM=m(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});_0.composeClientMiddleware=void 0;function iX(e,t){return(n,r)=>t(Object.assign(Object.assign({},n),{next:(i,a)=>e(Object.assign(Object.assign({},n),{request:i}),a)}),r)}_0.composeClientMiddleware=iX});var W_={};gh(W_,{ExtendableError:()=>A0,default:()=>aX});var A0,aX,H_=re(()=>{"use strict";A0=class extends Error{constructor(...t){super(...t);var n=t.length>0&&typeof t[0]=="string"?t[0]:"";(this.name===void 0||this.name==="Error")&&Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:this.constructor.name,writable:!0}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,value:n,writable:!0}),Object.defineProperty(this,"stack",{configurable:!0,enumerable:!1,value:"",writable:!0}),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack===""&&(this.stack=new Error(n).stack)}},aX=A0});var qM=m(N0=>{"use strict";Object.defineProperty(N0,"__esModule",{value:!0});N0.ClientError=void 0;var oX=(H_(),Bi(W_)),sX=k0(),G_=class e extends oX.ExtendableError{constructor(t,n,r){super(`${t} ${sX.Status[n]}: ${r}`),this.path=t,this.code=n,this.details=r,this.name="ClientError",Object.defineProperty(this,"@@nice-grpc",{value:!0}),Object.defineProperty(this,"@@nice-grpc:ClientError",{value:!0})}static[Symbol.hasInstance](t){return this!==e?this.prototype.isPrototypeOf(t):typeof t=="object"&&t!==null&&(t.constructor===e||t["@@nice-grpc:ClientError"]===!0||t.name==="ClientError"&&t["@@nice-grpc"]===!0)}};N0.ClientError=G_});var JM=m(VM=>{"use strict";Object.defineProperty(VM,"__esModule",{value:!0})});var HM=m(WM=>{"use strict";Object.defineProperty(WM,"__esModule",{value:!0})});var GM=m(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});I0.composeServerMiddleware=void 0;function uX(e,t){return(n,r)=>e(Object.assign(Object.assign({},n),{next:(i,a)=>t(Object.assign(Object.assign({},n),{request:i}),a)}),r)}I0.composeServerMiddleware=uX});var zM=m(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});O0.ServerError=void 0;var lX=(H_(),Bi(W_)),cX=k0(),z_=class e extends lX.ExtendableError{constructor(t,n){super(`${cX.Status[t]}: ${n}`),this.code=t,this.details=n,this.name="ServerError",Object.defineProperty(this,"@@nice-grpc",{value:!0}),Object.defineProperty(this,"@@nice-grpc:ServerError",{value:!0})}static[Symbol.hasInstance](t){return this!==e?this.prototype.isPrototypeOf(t):typeof t=="object"&&t!==null&&(t.constructor===e||t["@@nice-grpc:ServerError"]===!0||t.name==="ServerError"&&t["@@nice-grpc"]===!0)}};O0.ServerError=z_});var wn=m(Xt=>{"use strict";var dX=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Ei=Xt&&Xt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&dX(t,e,n)};Object.defineProperty(Xt,"__esModule",{value:!0});Ei(wM(),Xt);Ei(k0(),Xt);Ei(BM(),Xt);Ei(MM(),Xt);Ei(FM(),Xt);Ei(UM(),Xt);Ei(qM(),Xt);Ei(JM(),Xt);Ei(HM(),Xt);Ei(GM(),Xt);Ei(zM(),Xt)});var QM=m(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});R0.fromGrpcJsServiceDefinition=fX;R0.isGrpcJsServiceDefinition=hX;function fX(e){let t={};for(let[n,r]of Object.entries(e))t[n]={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,requestDeserialize:i=>r.requestDeserialize(Buffer.from(i)),requestSerialize:r.requestSerialize,responseDeserialize:i=>r.responseDeserialize(Buffer.from(i)),responseSerialize:r.responseSerialize,options:{}};return t}function hX(e){return Object.values(e).every(t=>typeof t=="object"&&t!=null&&typeof t.path=="string")}});var KM=m(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});P0.fromTsProtoServiceDefinition=pX;P0.isTsProtoServiceDefinition=mX;function pX(e){let t={};for(let[n,r]of Object.entries(e.methods)){let i=r.requestType.encode,a=r.requestType.fromPartial,o=r.responseType.encode,s=r.responseType.fromPartial;t[n]={path:`/${e.fullName}/${r.name}`,requestStream:r.requestStream,responseStream:r.responseStream,requestDeserialize:r.requestType.decode,requestSerialize:a!=null?u=>i(a(u)).finish():u=>i(u).finish(),responseDeserialize:r.responseType.decode,responseSerialize:s!=null?u=>o(s(u)).finish():u=>o(u).finish(),options:r.options}}return t}function mX(e){return"name"in e&&"fullName"in e&&"methods"in e}});var Zs=m(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.normalizeServiceDefinition=gX;tp.toGrpcJsServiceDefinition=yX;tp.toGrpcJsMethodDefinition=XM;var ZM=QM(),YM=KM();function gX(e){return(0,ZM.isGrpcJsServiceDefinition)(e)?(0,ZM.fromGrpcJsServiceDefinition)(e):(0,YM.isTsProtoServiceDefinition)(e)?(0,YM.fromTsProtoServiceDefinition)(e):e}function yX(e){let t={};for(let[n,r]of Object.entries(e))t[n]=XM(r);return t}function XM(e){return{path:e.path,requestStream:e.requestStream,responseStream:e.responseStream,requestDeserialize:e.requestDeserialize,requestSerialize:t=>Buffer.from(e.requestSerialize(t)),responseDeserialize:e.responseDeserialize,responseSerialize:t=>Buffer.from(e.responseSerialize(t))}}});function or(e){return typeof e=="object"&&e!==null&&e.name==="AbortError"}function vX(e){if(e.aborted)throw new xn}function Q_(e){if(or(e))throw e}function Ys(e){if(!or(e))throw e}var xn,Pa=re(()=>{"use strict";xn=class extends Error{constructor(){super("The operation has been aborted"),this.message="The operation has been aborted",this.name="AbortError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,this.constructor)}}});function Ci(e,t){return new Promise((n,r)=>{if(e.aborted){r(new xn);return}let i,a=!1;function o(){a||(a=!0,i?.())}let s=t(u=>{n(u),o()},u=>{r(u),o()});if(!a){let u=()=>{let l=s();l==null?r(new xn):l.then(()=>{r(new xn)},c=>{r(c)}),o()};e.addEventListener("abort",u),i=()=>{e.removeEventListener("abort",u)}}})}var Xs=re(()=>{"use strict";Pa()});function SX(e,t){if(e.aborted){let n=()=>{};t.then(n,n)}return Ci(e,(n,r)=>(t.then(n,r),()=>{}))}var $M=re(()=>{"use strict";Xs()});function np(e,t){return Ci(e,n=>{let r=typeof t=="number"?t:t.getTime()-Date.now(),i=setTimeout(n,r);return()=>{clearTimeout(i)}})}var w0=re(()=>{"use strict";Xs()});function bX(e){return Ci(e,()=>()=>{})}var jM=re(()=>{"use strict";Xs()});function TX(e,t,n,r){return Ci(e,i=>{let a,o=!1;return a=EX(t,n,(...u)=>{i(u.length>1?u:u[0]),o=!0,a?.()},r),o&&a(),()=>{o=!0,a?.()}})}function EX(e,t,n,r){if(_X(e))return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r);if(kX(e))return e.on(t,n),()=>e.off(t,n);if(CX(e))return e.addListener(t,n),()=>e.removeListener(t,n);throw new Error("Invalid event target")}function CX(e){return Wd(e.addListener)&&Wd(e.removeListener)}function kX(e){return Wd(e.on)&&Wd(e.off)}function _X(e){return Wd(e.addEventListener)&&Wd(e.removeEventListener)}var Wd,eL=re(()=>{"use strict";Xs();Wd=e=>typeof e=="function"});function AX(e,t){return new Promise((n,r)=>{if(e.aborted){r(new xn);return}let i=new AbortController,a=t(i.signal);if(a.length===0){n([]);return}let o=()=>{i.abort()};e.addEventListener("abort",o);let s,u=new Array(a.length),l=0;function c(){l+=1,l===a.length&&(e.removeEventListener("abort",o),s!=null?r(s.reason):n(u))}for(let[d,f]of a.entries())f.then(h=>{u[d]=h,c()},h=>{i.abort(),(s==null||!or(h)&&or(s.reason))&&(s={reason:h}),c()})})}var tL=re(()=>{"use strict";Pa()});function NX(e,t){return new Promise((n,r)=>{if(e.aborted){r(new xn);return}let i=new AbortController,a=t(i.signal),o=()=>{i.abort()};e.addEventListener("abort",o);let s=0;function u(c){i.abort(),s+=1,s===a.length&&(e.removeEventListener("abort",o),c.status==="fulfilled"?n(c.value):r(c.reason))}let l;for(let c of a)c.then(d=>{l==null&&(l={status:"fulfilled",value:d}),u(l)},d=>{(l==null||!or(d)&&(l.status==="fulfilled"||or(l.reason)))&&(l={status:"rejected",reason:d}),u(l)})})}var nL=re(()=>{"use strict";Pa()});async function IX(e,t,n={}){let{baseMs:r=1e3,maxDelayMs:i=3e4,onError:a,maxAttempts:o=1/0}=n,s=0,u=()=>{s=-1};for(;;)try{return await t(e,s,u)}catch(l){if(Q_(l),s>=o)throw l;let c;if(s===-1)c=0;else{let d=Math.min(i,Math.pow(2,s)*r);c=Math.round(d*(1+Math.random())/2)}a&&a(l,s,c),c!==0&&await np(e,c),s+=1}}var rL=re(()=>{"use strict";w0();Pa()});function OX(e,t){if(e.aborted)return Promise.reject(new xn);let n=[],r=new AbortController,i=r.signal,a=()=>{r.abort()};e.addEventListener("abort",a);let o=()=>{e.removeEventListener("abort",a)},s=new Set,u=()=>{for(let d of s)d.abort()};i.addEventListener("abort",u);let l=()=>{i.removeEventListener("abort",u)},c=new Promise((d,f)=>{let h,g;p(b=>t(b,{defer(v){n.push(v)},fork:p})).join().then(b=>{r.abort(),h={value:b}},b=>{r.abort(),(!or(b)||g==null)&&(g={error:b})});function p(b){if(i.aborted)return{abort(){},async join(){throw new xn}};let v=new AbortController,C=v.signal,N=b(C),I={abort(){v.abort()},join:()=>N};return s.add(I),N.catch(Ys).catch(M=>{g={error:M},r.abort()}).finally(()=>{s.delete(I),s.size===0&&(g!=null?f(g.error):d(h.value))}),I}});return c=c.finally(()=>{o(),l();let d=Promise.resolve();for(let f=n.length-1;f>=0;f--)d=d.finally(n[f]);return d}),c}var iL=re(()=>{"use strict";Pa()});function RX(e){let t=new AbortController,n=e(t.signal).catch(Ys);return()=>(t.abort(),n)}var aL=re(()=>{"use strict";Pa()});function PX(e,t,n={}){let{baseMs:r=1e3,onError:i,maxAttempts:a=1/0}=n;return Ci(e,(o,s)=>{let u=new AbortController,l=!1,c=new Map;function d(g){u.abort(),c.clear(),o(g)}function f(g,p){if(c.delete(p),l&&c.size===0){s(g);return}if(!or(g)&&i)try{i(g,p)}catch(b){u.abort(),c.clear(),s(b)}}async function h(g){for(let p=0;;p++){let b=t(g,p);if(c.set(p,b),b.then(d,N=>f(N,p)),p+1>=a)break;let v=Math.pow(2,p)*r,C=Math.round(v*(1+Math.random())/2);await np(g,C)}l=!0}return h(u.signal).catch(Ys),()=>{u.abort()}})}var oL=re(()=>{"use strict";Pa();w0();Xs()});var No={};gh(No,{AbortError:()=>xn,abortable:()=>SX,all:()=>AX,catchAbortError:()=>Ys,delay:()=>np,execute:()=>Ci,forever:()=>bX,isAbortError:()=>or,proactiveRetry:()=>PX,race:()=>NX,rethrowAbortError:()=>Q_,retry:()=>IX,run:()=>RX,spawn:()=>OX,throwIfAborted:()=>vX,waitForEvent:()=>TX});var Io=re(()=>{"use strict";$M();Pa();w0();Xs();jM();eL();tL();nL();rL();iL();aL();oL()});var ta=m(ea=>{"use strict";var wX=ea&&ea.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),xX=ea&&ea.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),BX=ea&&ea.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&wX(t,e,n);return xX(t,e),t};Object.defineProperty(ea,"__esModule",{value:!0});ea.convertMetadataToGrpcJs=LX;ea.convertMetadataFromGrpcJs=FX;var DX=BX(Ao()),MX=wn();function LX(e){let t=new DX.Metadata;for(let[n,r]of e)for(let i of r)t.add(n,typeof i=="string"?i:Buffer.from(i));return t}function FX(e){let t=(0,MX.Metadata)();for(let n of Object.keys(e.getMap())){let r=e.get(n);t.set(n,r)}return t}});var wa=m(K_=>{"use strict";Object.defineProperty(K_,"__esModule",{value:!0});K_.isAsyncIterable=UX;function UX(e){return e!=null&&Symbol.asyncIterator in e}});var rp=m(Z_=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});Z_.readableToAsyncIterable=VX;var sL=!1;function qX(e){if(sL)return!0;let t=e&&typeof e=="object"&&"errored"in e&&"errorEmitted"in e&&"endEmitted"in e&&"closeEmitted"in e&&typeof e.errorEmitted=="boolean"&&typeof e.endEmitted=="boolean"&&typeof e.closeEmitted=="boolean";return sL=t,t}async function*VX(e){let t=uL;function n(u){this===e?(t(),t=uL):t=u}let r=e._readableState;if(!qX(r))throw new Error("nice-grpc: _readableState members incompatible");let i=r.errored,a=r.errorEmitted,o=r.endEmitted,s=r.closeEmitted;for(e.on("readable",n).on("error",function(u){i=u,a=!0,n.call(this)}).on("end",function(){o=!0,n.call(this)}).on("close",function(){s=!0,n.call(this)});;){let u=e.destroyed?null:e.read();if(u!==null)yield u;else{if(a)throw i;if(o)break;if(s)break;await new Promise(n)}}}var uL=()=>{}});var ip=m(Y_=>{"use strict";Object.defineProperty(Y_,"__esModule",{value:!0});Y_.createCallContext=JX;var lL=wn(),cL=ta();function JX(e){let t=new AbortController,n={signal:t.signal,cancel(){t.abort()}},r=(0,lL.Metadata)(),i=(0,lL.Metadata)();e.cancelled?(n.cancel?.(),n.cancel=void 0):(e.on("close",()=>{n.cancel=void 0}),e.on("finish",()=>{n.cancel=void 0}),e.on("cancelled",()=>{n.cancel?.(),n.cancel=void 0}));let a=!1;return{context:{metadata:(0,cL.convertMetadataFromGrpcJs)(e.metadata),peer:e.getPeer(),header:r,sendHeader(){a||(e.sendMetadata((0,cL.convertMetadataToGrpcJs)(r)),a=!0)},trailer:i,signal:n.signal},maybeCancel:n}}});var ap=m(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_.createErrorStatusObject=GX;var dL=Ao(),WX=(Io(),Bi(No)),HX=wn();function GX(e,t,n){return t instanceof HX.ServerError?{code:t.code,details:t.details,metadata:n}:(0,WX.isAbortError)(t)?{code:dL.status.CANCELLED,details:"The operation was cancelled",metadata:n}:(process.emitWarning(`${e}: Uncaught error in server implementation method. Server methods should only throw ServerError or AbortError. ${t instanceof Error?t.stack:t}`),{code:dL.status.UNKNOWN,details:"Unknown server error occurred",metadata:n})}});var pL=m($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});$_.createBidiStreamingMethodHandler=YX;var fL=(Io(),Bi(No)),hL=ta(),zX=wa(),QX=rp(),KX=ip(),ZX=ap();function YX(e,t,n){let r={path:e.path,requestStream:e.requestStream,responseStream:e.responseStream,options:e.options};async function*i(o,s){if(!(0,zX.isAsyncIterable)(o))throw new Error("A middleware passed invalid request to next(): expected a single message for bidirectional streaming method");yield*t(o,s)}let a=n==null?i:(o,s)=>n({method:r,requestStream:!0,request:o,responseStream:!0,next:i},s);return o=>{let{context:s,maybeCancel:u}=(0,KX.createCallContext)(o);Promise.resolve().then(async()=>{let c=a((0,QX.readableToAsyncIterable)(o),s)[Symbol.asyncIterator]();try{let d=await c.next();for(;;){if(!d.done){try{s.sendHeader(),o.write(d.value)||await(0,fL.waitForEvent)(s.signal,o,"drain")}catch(f){d=(0,fL.isAbortError)(f)?await c.return():await c.throw(f);continue}d=await c.next();continue}if(d.value!=null){d=await c.throw(new Error("A middleware returned a message, but expected to return void for bidirectional streaming method"));continue}break}}finally{u.cancel=void 0,s.sendHeader()}}).then(()=>{o.end((0,hL.convertMetadataToGrpcJs)(s.trailer))},l=>{o.emit("error",(0,ZX.createErrorStatusObject)(e.path,l,(0,hL.convertMetadataToGrpcJs)(s.trailer)))})}}});var gL=m(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});j_.createClientStreamingMethodHandler=t$;var mL=ta(),XX=wa(),$X=rp(),jX=ip(),e$=ap();function t$(e,t,n){let r={path:e.path,requestStream:e.requestStream,responseStream:e.responseStream,options:e.options};async function*i(o,s){if(!(0,XX.isAsyncIterable)(o))throw new Error("A middleware passed invalid request to next(): expected a single message for client streaming method");return await t(o,s)}let a=n==null?i:(o,s)=>n({method:r,requestStream:!0,request:o,responseStream:!1,next:i},s);return(o,s)=>{let{context:u,maybeCancel:l}=(0,jX.createCallContext)(o);Promise.resolve().then(async()=>{let d=a((0,$X.readableToAsyncIterable)(o),u)[Symbol.asyncIterator]();try{let f=await d.next();for(;;){if(!f.done){f=await d.throw(new Error("A middleware yielded a message, but expected to only return a message for client streaming method"));continue}if(f.value==null){f=await d.throw(new Error("A middleware returned void, but expected to return a message for client streaming method"));continue}return f.value}}finally{l.cancel=void 0,u.sendHeader()}}).then(c=>{s(null,c,(0,mL.convertMetadataToGrpcJs)(u.trailer))},c=>{s((0,e$.createErrorStatusObject)(e.path,c,(0,mL.convertMetadataToGrpcJs)(u.trailer)))})}}});var SL=m(e1=>{"use strict";Object.defineProperty(e1,"__esModule",{value:!0});e1.createServerStreamingMethodHandler=a$;var yL=(Io(),Bi(No)),vL=ta(),n$=wa(),r$=ip(),i$=ap();function a$(e,t,n){let r={path:e.path,requestStream:e.requestStream,responseStream:e.responseStream,options:e.options};async function*i(o,s){if((0,n$.isAsyncIterable)(o))throw new Error("A middleware passed invalid request to next(): expected a single message for server streaming method");yield*t(o,s)}let a=n==null?i:(o,s)=>n({method:r,requestStream:!1,request:o,responseStream:!0,next:i},s);return o=>{let{context:s,maybeCancel:u}=(0,r$.createCallContext)(o);Promise.resolve().then(async()=>{let c=a(o.request,s)[Symbol.asyncIterator]();try{let d=await c.next();for(;;){if(!d.done){try{s.sendHeader(),o.write(d.value)||await(0,yL.waitForEvent)(s.signal,o,"drain")}catch(f){d=(0,yL.isAbortError)(f)?await c.return():await c.throw(f);continue}d=await c.next();continue}if(d.value!=null){d=await c.throw(new Error("A middleware returned a message, but expected to return void for server streaming method"));continue}break}}finally{u.cancel=void 0,s.sendHeader()}}).then(()=>{o.end((0,vL.convertMetadataToGrpcJs)(s.trailer))},l=>{o.emit("error",(0,i$.createErrorStatusObject)(e.path,l,(0,vL.convertMetadataToGrpcJs)(s.trailer)))})}}});var TL=m(t1=>{"use strict";Object.defineProperty(t1,"__esModule",{value:!0});t1.createUnaryMethodHandler=l$;var bL=ta(),o$=wa(),s$=ip(),u$=ap();function l$(e,t,n){let r={path:e.path,requestStream:e.requestStream,responseStream:e.responseStream,options:e.options};async function*i(o,s){if((0,o$.isAsyncIterable)(o))throw new Error("A middleware passed invalid request to next(): expected a single message for unary method");return await t(o,s)}let a=n==null?i:(o,s)=>n({method:r,requestStream:!1,request:o,responseStream:!1,next:i},s);return(o,s)=>{let{context:u,maybeCancel:l}=(0,s$.createCallContext)(o);Promise.resolve().then(async()=>{let d=a(o.request,u)[Symbol.asyncIterator]();try{let f=await d.next();for(;;){if(!f.done){f=await d.throw(new Error("A middleware yielded a message, but expected to only return a message for unary method"));continue}if(f.value==null){f=await d.throw(new Error("A middleware returned void, but expected to return a message for unary method"));continue}return f.value}}finally{l.cancel=void 0,u.sendHeader()}}).then(c=>{s(null,c,(0,bL.convertMetadataToGrpcJs)(u.trailer))},c=>{s((0,u$.createErrorStatusObject)(e.path,c,(0,bL.convertMetadataToGrpcJs)(u.trailer)))})}}});var AL=m(n1=>{"use strict";Object.defineProperty(n1,"__esModule",{value:!0});n1.createServer=p$;var EL=Ao(),CL=wn(),kL=Zs(),c$=pL(),d$=gL(),f$=SL(),h$=TL();function p$(e={}){return _L(e)}function _L(e,t){let n=[],r;function i(a){return{with(o){return i(a==null?o:(0,CL.composeServerMiddleware)(a,o))},add(o,s){if(r!=null)throw new Error("server.add() must be used before listen()");n.push({definition:(0,kL.normalizeServiceDefinition)(o),middleware:a,implementation:s})}}}return{use(a){if(r!=null)throw new Error("server.use() must be used before listen()");if(n.length>0)throw new Error("server.use() must be used before adding any services");return _L(e,t==null?a:(0,CL.composeServerMiddleware)(t,a))},...i(t),async listen(a,o){if(r!=null)throw new Error("server.listen() has already been called");r=new EL.Server(e);for(let{definition:u,middleware:l,implementation:c}of n){let d={};for(let[f,h]of Object.entries(u)){let g=c[f].bind(c);h.requestStream?h.responseStream?d[f]=(0,c$.createBidiStreamingMethodHandler)(h,g,l):d[f]=(0,d$.createClientStreamingMethodHandler)(h,g,l):h.responseStream?d[f]=(0,f$.createServerStreamingMethodHandler)(h,g,l):d[f]=(0,h$.createUnaryMethodHandler)(h,g,l)}r.addService((0,kL.toGrpcJsServiceDefinition)(u),d)}return await new Promise((u,l)=>{r.bindAsync(a,o??EL.ServerCredentials.createInsecure(),(c,d)=>{c!=null?(r=void 0,l(c)):u(d)})})},async shutdown(){r!=null&&(await new Promise((a,o)=>{r.tryShutdown(s=>{s!=null?o(s):a()})}),r=void 0)},forceShutdown(){r!=null&&(r.forceShutdown(),r=void 0)}}}});var IL=m(NL=>{"use strict";Object.defineProperty(NL,"__esModule",{value:!0})});var OL=m(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});B0.createChannel=g$;B0.waitForChannelReady=y$;var x0=Ao(),m$=new Set(["http","https"]);function g$(e,t,n={}){let r=/^(?:([^:]+):\/\/)?(.*?)(?::(\d+))?$/.exec(e);if(r==null)throw new Error(`Invalid address: '${e}'`);let[,i,a,o]=r,s=!i||m$.has(i),u=t?._isSecure()||i?.includes("https");t??(t=u?x0.ChannelCredentials.createSsl():x0.ChannelCredentials.createInsecure()),o??(o=u?"443":"80");let l=s?`${a}:${o}`:e;return new x0.Channel(l,t,n)}async function y$(e,t){for(;;){let n=e.getConnectivityState(!0);if(n===x0.connectivityState.READY)return;await new Promise((r,i)=>{e.watchConnectivityState(n,t,a=>{a!=null?i(a):r()})})}}});var op=m(r1=>{"use strict";Object.defineProperty(r1,"__esModule",{value:!0});r1.wrapClientError=b$;var v$=wn(),S$=Ao();function b$(e,t){return T$(e)?new v$.ClientError(t,e.code,e.details):e}function T$(e){return typeof e=="object"&&e!==null&&typeof e.code=="number"&&typeof e.details=="string"&&e.metadata instanceof S$.Metadata}});var RL=m(a1=>{"use strict";Object.defineProperty(a1,"__esModule",{value:!0});a1.createBidiStreamingMethod=N$;var D0=(Io(),Bi(No)),E$=wn(),C$=Zs(),i1=ta(),k$=wa(),_$=rp(),A$=op();function N$(e,t,n,r){let i=(0,C$.toGrpcJsMethodDefinition)(e),a={path:e.path,requestStream:e.requestStream,responseStream:e.responseStream,options:e.options};async function*o(u,l){if(!(0,k$.isAsyncIterable)(u))throw new Error("A middleware passed invalid request to next(): expected a single message for bidirectional streaming method");let{metadata:c=(0,E$.Metadata)(),onHeader:d,onTrailer:f}=l,h=l.signal??new AbortController().signal,g=new AbortController,p=t.makeBidiStreamRequest(i.path,i.requestSerialize,i.responseDeserialize,(0,i1.convertMetadataToGrpcJs)(c));p.on("metadata",C=>{d?.((0,i1.convertMetadataFromGrpcJs)(C))}),p.on("status",C=>{f?.((0,i1.convertMetadataFromGrpcJs)(C.metadata))});let b;I$(g.signal,u,p).then(()=>{p.end()},C=>{(0,D0.isAbortError)(C)||(b=C,p.cancel())});let v=()=>{g.abort(),p.cancel()};h.addEventListener("abort",v);try{yield*(0,_$.readableToAsyncIterable)(p)}catch(C){throw(0,A$.wrapClientError)(C,e.path)}finally{if(g.abort(),h.removeEventListener("abort",v),(0,D0.throwIfAborted)(h),p.cancel(),b)throw b}}let s=n==null?o:(u,l)=>n({method:a,requestStream:!0,request:u,responseStream:!0,next:o},l);return(u,l)=>{let d=s(u,{...r,...l})[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{async next(){let f=await d.next();return f.done&&f.value!=null?await d.throw(new Error("A middleware returned a message, but expected to return void for bidirectional streaming method")):f},return(){return d.return()},throw(f){return d.throw(f)}}}}}}async function I$(e,t,n){for await(let r of t)(0,D0.throwIfAborted)(e),n.write(r)||await(0,D0.waitForEvent)(e,n,"drain")}});var PL=m(s1=>{"use strict";Object.defineProperty(s1,"__esModule",{value:!0});s1.createClientStreamingMethod=x$;var M0=(Io(),Bi(No)),O$=wn(),R$=Zs(),o1=ta(),P$=wa(),w$=op();function x$(e,t,n,r){let i=(0,R$.toGrpcJsMethodDefinition)(e),a={path:e.path,requestStream:e.requestStream,responseStream:e.responseStream,options:e.options};async function*o(u,l){if(!(0,P$.isAsyncIterable)(u))throw new Error("A middleware passed invalid request to next(): expected a single message for client streaming method");let{metadata:c=(0,O$.Metadata)(),signal:d=new AbortController().signal,onHeader:f,onTrailer:h}=l;return await(0,M0.execute)(d,(g,p)=>{let b=new AbortController,v=t.makeClientStreamRequest(i.path,i.requestSerialize,i.responseDeserialize,(0,o1.convertMetadataToGrpcJs)(c),(C,N)=>{b.abort(),C!=null?p((0,w$.wrapClientError)(C,e.path)):g(N)});return v.on("metadata",C=>{f?.((0,o1.convertMetadataFromGrpcJs)(C))}),v.on("status",C=>{h?.((0,o1.convertMetadataFromGrpcJs)(C.metadata))}),B$(b.signal,u,v).then(()=>{v.end()},C=>{(0,M0.isAbortError)(C)||(p(C),v.cancel())}),()=>{b.abort(),v.cancel()}})}let s=n==null?o:(u,l)=>n({method:a,requestStream:!0,request:u,responseStream:!1,next:o},l);return async(u,l)=>{let d=s(u,{...r,...l})[Symbol.asyncIterator](),f=await d.next();for(;;){if(!f.done){f=await d.throw(new Error("A middleware yielded a message, but expected to only return a message for client streaming method"));continue}if(f.value==null){f=await d.throw(new Error("A middleware returned void, but expected to return a message for client streaming method"));continue}return f.value}}}async function B$(e,t,n){for await(let r of t)(0,M0.throwIfAborted)(e),n.write(r)||await(0,M0.waitForEvent)(e,n,"drain")}});var wL=m(l1=>{"use strict";Object.defineProperty(l1,"__esModule",{value:!0});l1.createServerStreamingMethod=V$;var D$=(Io(),Bi(No)),M$=wn(),L$=Zs(),u1=ta(),F$=wa(),U$=rp(),q$=op();function V$(e,t,n,r){let i=(0,L$.toGrpcJsMethodDefinition)(e),a={path:e.path,requestStream:e.requestStream,responseStream:e.responseStream,options:e.options};async function*o(u,l){if((0,F$.isAsyncIterable)(u))throw new Error("A middleware passed invalid request to next(): expected a single message for server streaming method");let{metadata:c=(0,M$.Metadata)(),onHeader:d,onTrailer:f}=l,h=l.signal??new AbortController().signal,g=t.makeServerStreamRequest(i.path,i.requestSerialize,i.responseDeserialize,u,(0,u1.convertMetadataToGrpcJs)(c));g.on("metadata",b=>{d?.((0,u1.convertMetadataFromGrpcJs)(b))}),g.on("status",b=>{f?.((0,u1.convertMetadataFromGrpcJs)(b.metadata))});let p=()=>{g.cancel()};h.addEventListener("abort",p);try{yield*(0,U$.readableToAsyncIterable)(g)}catch(b){throw(0,q$.wrapClientError)(b,e.path)}finally{h.removeEventListener("abort",p),(0,D$.throwIfAborted)(h),g.cancel()}}let s=n==null?o:(u,l)=>n({method:a,requestStream:!1,request:u,responseStream:!0,next:o},l);return(u,l)=>{let d=s(u,{...r,...l})[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{async next(){let f=await d.next();return f.done&&f.value!=null?await d.throw(new Error("A middleware returned a message, but expected to return void for server streaming method")):f},return(){return d.return()},throw(f){return d.throw(f)}}}}}}});var xL=m(d1=>{"use strict";Object.defineProperty(d1,"__esModule",{value:!0});d1.createUnaryMethod=Q$;var J$=(Io(),Bi(No)),W$=wn(),H$=Zs(),c1=ta(),G$=wa(),z$=op();function Q$(e,t,n,r){let i=(0,H$.toGrpcJsMethodDefinition)(e),a={path:e.path,requestStream:e.requestStream,responseStream:e.responseStream,options:e.options};async function*o(u,l){if((0,G$.isAsyncIterable)(u))throw new Error("A middleware passed invalid request to next(): expected a single message for unary method");let{metadata:c=(0,W$.Metadata)(),signal:d=new AbortController().signal,onHeader:f,onTrailer:h}=l;return await(0,J$.execute)(d,(g,p)=>{let b=t.makeUnaryRequest(i.path,i.requestSerialize,i.responseDeserialize,u,(0,c1.convertMetadataToGrpcJs)(c),(v,C)=>{v!=null?p((0,z$.wrapClientError)(v,e.path)):g(C)});return b.on("metadata",v=>{f?.((0,c1.convertMetadataFromGrpcJs)(v))}),b.on("status",v=>{h?.((0,c1.convertMetadataFromGrpcJs)(v.metadata))}),()=>{b.cancel()}})}let s=n==null?o:(u,l)=>n({method:a,requestStream:!1,request:u,responseStream:!1,next:o},l);return async(u,l)=>{let d=s(u,{...r,...l})[Symbol.asyncIterator](),f=await d.next();for(;;){if(!f.done){f=await d.throw(new Error("A middleware yielded a message, but expected to only return a message for unary method"));continue}if(f.value==null){f=await d.throw(new Error("A middleware returned void, but expected to return a message for unary method"));continue}return f.value}}}});var ML=m(L0=>{"use strict";Object.defineProperty(L0,"__esModule",{value:!0});L0.createClientFactory=BL;L0.createClient=tj;var K$=Ao(),Z$=wn(),Y$=Zs(),X$=RL(),$$=PL(),j$=wL(),ej=xL();function BL(){return DL()}function tj(e,t,n){return BL().create(e,t,n)}function DL(e){return{use(t){return DL(e==null?t:(0,Z$.composeClientMiddleware)(e,t))},create(t,n,r={}){let i=(0,K$.makeClientConstructor)({},""),a=new i("",null,{channelOverride:n}),o={},s=Object.entries((0,Y$.normalizeServiceDefinition)(t));for(let[u,l]of s){let c={...r["*"],...r[u]};l.requestStream?l.responseStream?o[u]=(0,X$.createBidiStreamingMethod)(l,a,e,c):o[u]=(0,$$.createClientStreamingMethod)(l,a,e,c):l.responseStream?o[u]=(0,j$.createServerStreamingMethod)(l,a,e,c):o[u]=(0,ej.createUnaryMethod)(l,a,e,c)}return o}}}});var FL=m(LL=>{"use strict";Object.defineProperty(LL,"__esModule",{value:!0})});var VL=m(Lt=>{"use strict";var nj=Lt&&Lt.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),sp=Lt&&Lt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&nj(t,e,n)};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.ChannelCredentials=Lt.Channel=Lt.waitForChannelReady=Lt.createChannel=void 0;sp(wn(),Lt);sp(AL(),Lt);sp(IL(),Lt);var UL=OL();Object.defineProperty(Lt,"createChannel",{enumerable:!0,get:function(){return UL.createChannel}});Object.defineProperty(Lt,"waitForChannelReady",{enumerable:!0,get:function(){return UL.waitForChannelReady}});var qL=Ao();Object.defineProperty(Lt,"Channel",{enumerable:!0,get:function(){return qL.Channel}});Object.defineProperty(Lt,"ChannelCredentials",{enumerable:!0,get:function(){return qL.ChannelCredentials}});sp(ML(),Lt);sp(FL(),Lt)});var up=m(F0=>{"use strict";Object.defineProperty(F0,"__esModule",{value:!0});F0.messageTypeRegistry=void 0;F0.messageTypeRegistry=new Map});var HL=m(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.Duration=xa.protobufPackage=void 0;var Hd=Nn(),rj=up(),JL=XC();xa.protobufPackage="google.protobuf";function WL(){return{$type:"google.protobuf.Duration",seconds:0,nanos:0}}xa.Duration={$type:"google.protobuf.Duration",encode(e,t=Hd.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let n=e instanceof Hd.Reader?e:Hd.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=WL();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.seconds=ij(n.int64());continue;case 2:if(a!==16)break;i.nanos=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return xa.Duration.fromPartial(e??{})},fromPartial(e){var t,n;let r=WL();return r.seconds=(t=e.seconds)!==null&&t!==void 0?t:0,r.nanos=(n=e.nanos)!==null&&n!==void 0?n:0,r}};rj.messageTypeRegistry.set(xa.Duration.$type,xa.Duration);function ij(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}Hd.util.Long!==JL&&(Hd.util.Long=JL,Hd.configure())});var h1=m(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.LocalizedMessage=V.Help_Link=V.Help=V.ResourceInfo=V.RequestInfo=V.BadRequest_FieldViolation=V.BadRequest=V.PreconditionFailure_Violation=V.PreconditionFailure=V.ErrorInfo_MetadataEntry=V.ErrorInfo=V.QuotaFailure_Violation=V.QuotaFailure=V.DebugInfo=V.RetryInfo=V.protobufPackage=void 0;var ye=Nn(),Bn=up(),f1=HL();V.protobufPackage="google.rpc";function GL(){return{$type:"google.rpc.RetryInfo",retryDelay:void 0}}V.RetryInfo={$type:"google.rpc.RetryInfo",encode(e,t=ye.Writer.create()){return e.retryDelay!==void 0&&f1.Duration.encode(e.retryDelay,t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=GL();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.retryDelay=f1.Duration.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.RetryInfo.fromPartial(e??{})},fromPartial(e){let t=GL();return t.retryDelay=e.retryDelay!==void 0&&e.retryDelay!==null?f1.Duration.fromPartial(e.retryDelay):void 0,t}};Bn.messageTypeRegistry.set(V.RetryInfo.$type,V.RetryInfo);function zL(){return{$type:"google.rpc.DebugInfo",stackEntries:[],detail:""}}V.DebugInfo={$type:"google.rpc.DebugInfo",encode(e,t=ye.Writer.create()){for(let n of e.stackEntries)t.uint32(10).string(n);return e.detail!==""&&t.uint32(18).string(e.detail),t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=zL();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.stackEntries.push(n.string());continue;case 2:if(a!==18)break;i.detail=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.DebugInfo.fromPartial(e??{})},fromPartial(e){var t,n;let r=zL();return r.stackEntries=((t=e.stackEntries)===null||t===void 0?void 0:t.map(i=>i))||[],r.detail=(n=e.detail)!==null&&n!==void 0?n:"",r}};Bn.messageTypeRegistry.set(V.DebugInfo.$type,V.DebugInfo);function QL(){return{$type:"google.rpc.QuotaFailure",violations:[]}}V.QuotaFailure={$type:"google.rpc.QuotaFailure",encode(e,t=ye.Writer.create()){for(let n of e.violations)V.QuotaFailure_Violation.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=QL();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.violations.push(V.QuotaFailure_Violation.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.QuotaFailure.fromPartial(e??{})},fromPartial(e){var t;let n=QL();return n.violations=((t=e.violations)===null||t===void 0?void 0:t.map(r=>V.QuotaFailure_Violation.fromPartial(r)))||[],n}};Bn.messageTypeRegistry.set(V.QuotaFailure.$type,V.QuotaFailure);function KL(){return{$type:"google.rpc.QuotaFailure.Violation",subject:"",description:""}}V.QuotaFailure_Violation={$type:"google.rpc.QuotaFailure.Violation",encode(e,t=ye.Writer.create()){return e.subject!==""&&t.uint32(10).string(e.subject),e.description!==""&&t.uint32(18).string(e.description),t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=KL();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.subject=n.string();continue;case 2:if(a!==18)break;i.description=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.QuotaFailure_Violation.fromPartial(e??{})},fromPartial(e){var t,n;let r=KL();return r.subject=(t=e.subject)!==null&&t!==void 0?t:"",r.description=(n=e.description)!==null&&n!==void 0?n:"",r}};Bn.messageTypeRegistry.set(V.QuotaFailure_Violation.$type,V.QuotaFailure_Violation);function ZL(){return{$type:"google.rpc.ErrorInfo",reason:"",domain:"",metadata:{}}}V.ErrorInfo={$type:"google.rpc.ErrorInfo",encode(e,t=ye.Writer.create()){return e.reason!==""&&t.uint32(10).string(e.reason),e.domain!==""&&t.uint32(18).string(e.domain),Object.entries(e.metadata).forEach(([n,r])=>{V.ErrorInfo_MetadataEntry.encode({$type:"google.rpc.ErrorInfo.MetadataEntry",key:n,value:r},t.uint32(26).fork()).ldelim()}),t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ZL();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.reason=n.string();continue;case 2:if(a!==18)break;i.domain=n.string();continue;case 3:if(a!==26)break;let o=V.ErrorInfo_MetadataEntry.decode(n,n.uint32());o.value!==void 0&&(i.metadata[o.key]=o.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.ErrorInfo.fromPartial(e??{})},fromPartial(e){var t,n,r;let i=ZL();return i.reason=(t=e.reason)!==null&&t!==void 0?t:"",i.domain=(n=e.domain)!==null&&n!==void 0?n:"",i.metadata=Object.entries((r=e.metadata)!==null&&r!==void 0?r:{}).reduce((a,[o,s])=>(s!==void 0&&(a[o]=globalThis.String(s)),a),{}),i}};Bn.messageTypeRegistry.set(V.ErrorInfo.$type,V.ErrorInfo);function YL(){return{$type:"google.rpc.ErrorInfo.MetadataEntry",key:"",value:""}}V.ErrorInfo_MetadataEntry={$type:"google.rpc.ErrorInfo.MetadataEntry",encode(e,t=ye.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==""&&t.uint32(18).string(e.value),t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=YL();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.ErrorInfo_MetadataEntry.fromPartial(e??{})},fromPartial(e){var t,n;let r=YL();return r.key=(t=e.key)!==null&&t!==void 0?t:"",r.value=(n=e.value)!==null&&n!==void 0?n:"",r}};Bn.messageTypeRegistry.set(V.ErrorInfo_MetadataEntry.$type,V.ErrorInfo_MetadataEntry);function XL(){return{$type:"google.rpc.PreconditionFailure",violations:[]}}V.PreconditionFailure={$type:"google.rpc.PreconditionFailure",encode(e,t=ye.Writer.create()){for(let n of e.violations)V.PreconditionFailure_Violation.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=XL();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.violations.push(V.PreconditionFailure_Violation.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.PreconditionFailure.fromPartial(e??{})},fromPartial(e){var t;let n=XL();return n.violations=((t=e.violations)===null||t===void 0?void 0:t.map(r=>V.PreconditionFailure_Violation.fromPartial(r)))||[],n}};Bn.messageTypeRegistry.set(V.PreconditionFailure.$type,V.PreconditionFailure);function $L(){return{$type:"google.rpc.PreconditionFailure.Violation",type:"",subject:"",description:""}}V.PreconditionFailure_Violation={$type:"google.rpc.PreconditionFailure.Violation",encode(e,t=ye.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.subject!==""&&t.uint32(18).string(e.subject),e.description!==""&&t.uint32(26).string(e.description),t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=$L();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=n.string();continue;case 2:if(a!==18)break;i.subject=n.string();continue;case 3:if(a!==26)break;i.description=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.PreconditionFailure_Violation.fromPartial(e??{})},fromPartial(e){var t,n,r;let i=$L();return i.type=(t=e.type)!==null&&t!==void 0?t:"",i.subject=(n=e.subject)!==null&&n!==void 0?n:"",i.description=(r=e.description)!==null&&r!==void 0?r:"",i}};Bn.messageTypeRegistry.set(V.PreconditionFailure_Violation.$type,V.PreconditionFailure_Violation);function jL(){return{$type:"google.rpc.BadRequest",fieldViolations:[]}}V.BadRequest={$type:"google.rpc.BadRequest",encode(e,t=ye.Writer.create()){for(let n of e.fieldViolations)V.BadRequest_FieldViolation.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=jL();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.fieldViolations.push(V.BadRequest_FieldViolation.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.BadRequest.fromPartial(e??{})},fromPartial(e){var t;let n=jL();return n.fieldViolations=((t=e.fieldViolations)===null||t===void 0?void 0:t.map(r=>V.BadRequest_FieldViolation.fromPartial(r)))||[],n}};Bn.messageTypeRegistry.set(V.BadRequest.$type,V.BadRequest);function e6(){return{$type:"google.rpc.BadRequest.FieldViolation",field:"",description:""}}V.BadRequest_FieldViolation={$type:"google.rpc.BadRequest.FieldViolation",encode(e,t=ye.Writer.create()){return e.field!==""&&t.uint32(10).string(e.field),e.description!==""&&t.uint32(18).string(e.description),t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=e6();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.field=n.string();continue;case 2:if(a!==18)break;i.description=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.BadRequest_FieldViolation.fromPartial(e??{})},fromPartial(e){var t,n;let r=e6();return r.field=(t=e.field)!==null&&t!==void 0?t:"",r.description=(n=e.description)!==null&&n!==void 0?n:"",r}};Bn.messageTypeRegistry.set(V.BadRequest_FieldViolation.$type,V.BadRequest_FieldViolation);function t6(){return{$type:"google.rpc.RequestInfo",requestId:"",servingData:""}}V.RequestInfo={$type:"google.rpc.RequestInfo",encode(e,t=ye.Writer.create()){return e.requestId!==""&&t.uint32(10).string(e.requestId),e.servingData!==""&&t.uint32(18).string(e.servingData),t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=t6();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.requestId=n.string();continue;case 2:if(a!==18)break;i.servingData=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.RequestInfo.fromPartial(e??{})},fromPartial(e){var t,n;let r=t6();return r.requestId=(t=e.requestId)!==null&&t!==void 0?t:"",r.servingData=(n=e.servingData)!==null&&n!==void 0?n:"",r}};Bn.messageTypeRegistry.set(V.RequestInfo.$type,V.RequestInfo);function n6(){return{$type:"google.rpc.ResourceInfo",resourceType:"",resourceName:"",owner:"",description:""}}V.ResourceInfo={$type:"google.rpc.ResourceInfo",encode(e,t=ye.Writer.create()){return e.resourceType!==""&&t.uint32(10).string(e.resourceType),e.resourceName!==""&&t.uint32(18).string(e.resourceName),e.owner!==""&&t.uint32(26).string(e.owner),e.description!==""&&t.uint32(34).string(e.description),t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=n6();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.resourceType=n.string();continue;case 2:if(a!==18)break;i.resourceName=n.string();continue;case 3:if(a!==26)break;i.owner=n.string();continue;case 4:if(a!==34)break;i.description=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.ResourceInfo.fromPartial(e??{})},fromPartial(e){var t,n,r,i;let a=n6();return a.resourceType=(t=e.resourceType)!==null&&t!==void 0?t:"",a.resourceName=(n=e.resourceName)!==null&&n!==void 0?n:"",a.owner=(r=e.owner)!==null&&r!==void 0?r:"",a.description=(i=e.description)!==null&&i!==void 0?i:"",a}};Bn.messageTypeRegistry.set(V.ResourceInfo.$type,V.ResourceInfo);function r6(){return{$type:"google.rpc.Help",links:[]}}V.Help={$type:"google.rpc.Help",encode(e,t=ye.Writer.create()){for(let n of e.links)V.Help_Link.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=r6();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.links.push(V.Help_Link.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.Help.fromPartial(e??{})},fromPartial(e){var t;let n=r6();return n.links=((t=e.links)===null||t===void 0?void 0:t.map(r=>V.Help_Link.fromPartial(r)))||[],n}};Bn.messageTypeRegistry.set(V.Help.$type,V.Help);function i6(){return{$type:"google.rpc.Help.Link",description:"",url:""}}V.Help_Link={$type:"google.rpc.Help.Link",encode(e,t=ye.Writer.create()){return e.description!==""&&t.uint32(10).string(e.description),e.url!==""&&t.uint32(18).string(e.url),t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=i6();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.description=n.string();continue;case 2:if(a!==18)break;i.url=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.Help_Link.fromPartial(e??{})},fromPartial(e){var t,n;let r=i6();return r.description=(t=e.description)!==null&&t!==void 0?t:"",r.url=(n=e.url)!==null&&n!==void 0?n:"",r}};Bn.messageTypeRegistry.set(V.Help_Link.$type,V.Help_Link);function a6(){return{$type:"google.rpc.LocalizedMessage",locale:"",message:""}}V.LocalizedMessage={$type:"google.rpc.LocalizedMessage",encode(e,t=ye.Writer.create()){return e.locale!==""&&t.uint32(10).string(e.locale),e.message!==""&&t.uint32(18).string(e.message),t},decode(e,t){let n=e instanceof ye.Reader?e:ye.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=a6();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.locale=n.string();continue;case 2:if(a!==18)break;i.message=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return V.LocalizedMessage.fromPartial(e??{})},fromPartial(e){var t,n;let r=a6();return r.locale=(t=e.locale)!==null&&t!==void 0?t:"",r.message=(n=e.message)!==null&&n!==void 0?n:"",r}};Bn.messageTypeRegistry.set(V.LocalizedMessage.$type,V.LocalizedMessage)});var U0=m(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.Any=Ba.protobufPackage=void 0;var p1=Nn(),aj=up();Ba.protobufPackage="google.protobuf";function o6(){return{$type:"google.protobuf.Any",typeUrl:"",value:new Uint8Array(0)}}Ba.Any={$type:"google.protobuf.Any",encode(e,t=p1.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){let n=e instanceof p1.Reader?e:p1.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=o6();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.typeUrl=n.string();continue;case 2:if(a!==18)break;i.value=n.bytes();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return Ba.Any.fromPartial(e??{})},fromPartial(e){var t,n;let r=o6();return r.typeUrl=(t=e.typeUrl)!==null&&t!==void 0?t:"",r.value=(n=e.value)!==null&&n!==void 0?n:new Uint8Array(0),r}};aj.messageTypeRegistry.set(Ba.Any.$type,Ba.Any)});var g1=m(q0=>{"use strict";Object.defineProperty(q0,"__esModule",{value:!0});q0.RichServerError=void 0;var oj=wn(),m1=class extends oj.ServerError{constructor(t,n,r=[]){super(t,n),this.name="RichServerError",this.extra=r}};q0.RichServerError=m1});var y1=m(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.encodeErrorDetails=Gd.decodeErrorDetails=void 0;var sr=h1(),s6=U0(),u6=[sr.RetryInfo,sr.DebugInfo,sr.QuotaFailure,sr.QuotaFailure_Violation,sr.ErrorInfo,sr.PreconditionFailure,sr.PreconditionFailure_Violation,sr.BadRequest,sr.BadRequest_FieldViolation,sr.RequestInfo,sr.ResourceInfo,sr.Help,sr.LocalizedMessage];function sj(e){return e.map(t=>{let n=u6.find(r=>t.typeUrl.endsWith(`/${r.$type}`));return n==null?t:n.decode(t.value)})}Gd.decodeErrorDetails=sj;function uj(e){return e.map(t=>{if(t.$type===s6.Any.$type)return t;let n=u6.find(r=>r.$type===t.$type);if(n==null)throw new Error(`Unknown error details type: ${t.$type}`);return s6.Any.fromPartial({typeUrl:`type.googleapis.com/${t.$type}`,value:n.encode(t).finish()})})}Gd.encodeErrorDetails=uj});var b1=m(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.Status=Da.protobufPackage=void 0;var v1=Nn(),lj=up(),S1=U0();Da.protobufPackage="google.rpc";function l6(){return{$type:"google.rpc.Status",code:0,message:"",details:[]}}Da.Status={$type:"google.rpc.Status",encode(e,t=v1.Writer.create()){e.code!==0&&t.uint32(8).int32(e.code),e.message!==""&&t.uint32(18).string(e.message);for(let n of e.details)S1.Any.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof v1.Reader?e:v1.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=l6();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.code=n.int32();continue;case 2:if(a!==18)break;i.message=n.string();continue;case 3:if(a!==26)break;i.details.push(S1.Any.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},create(e){return Da.Status.fromPartial(e??{})},fromPartial(e){var t,n,r;let i=l6();return i.code=(t=e.code)!==null&&t!==void 0?t:0,i.message=(n=e.message)!==null&&n!==void 0?n:"",i.details=((r=e.details)===null||r===void 0?void 0:r.map(a=>S1.Any.fromPartial(a)))||[],i}};lj.messageTypeRegistry.set(Da.Status.$type,Da.Status)});var d6=m(V0=>{"use strict";Object.defineProperty(V0,"__esModule",{value:!0});V0.errorDetailsServerMiddleware=void 0;var cj=y1(),c6=b1(),dj=g1(),fj=async function*(t,n){try{return yield*t.next(t.request,n)}catch(r){if(r instanceof dj.RichServerError){let i=c6.Status.fromPartial({code:r.code,message:r.details,details:(0,cj.encodeErrorDetails)(r.extra)});n.trailer.set("grpc-status-details-bin",c6.Status.encode(i).finish())}throw r}};V0.errorDetailsServerMiddleware=fj});var E1=m(J0=>{"use strict";Object.defineProperty(J0,"__esModule",{value:!0});J0.RichClientError=void 0;var hj=wn(),T1=class extends hj.ClientError{constructor(t,n,r,i){super(t,n,r),this.name="RichClientError",this.extra=i}};J0.RichClientError=T1});var f6=m(W0=>{"use strict";Object.defineProperty(W0,"__esModule",{value:!0});W0.errorDetailsClientMiddleware=void 0;var pj=wn(),mj=y1(),gj=b1(),yj=E1(),vj=async function*(t,n){let r;try{return yield*t.next(t.request,{...n,onTrailer(i){var a;let o=i.get("grpc-status-details-bin");o!=null&&(r=gj.Status.decode(o)),(a=n.onTrailer)===null||a===void 0||a.call(n,i)}})}catch(i){throw r!=null&&i instanceof pj.ClientError?new yj.RichClientError(i.path,i.code,i.details,(0,mj.decodeErrorDetails)(r.details)):i}};W0.errorDetailsClientMiddleware=vj});var h6=m($t=>{"use strict";var Sj=$t&&$t.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),bj=$t&&$t.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Sj(t,e,n)};Object.defineProperty($t,"__esModule",{value:!0});$t.errorDetailsClientMiddleware=$t.RichClientError=$t.errorDetailsServerMiddleware=$t.RichServerError=$t.Any=void 0;bj(h1(),$t);var Tj=U0();Object.defineProperty($t,"Any",{enumerable:!0,get:function(){return Tj.Any}});var Ej=g1();Object.defineProperty($t,"RichServerError",{enumerable:!0,get:function(){return Ej.RichServerError}});var Cj=d6();Object.defineProperty($t,"errorDetailsServerMiddleware",{enumerable:!0,get:function(){return Cj.errorDetailsServerMiddleware}});var kj=E1();Object.defineProperty($t,"RichClientError",{enumerable:!0,get:function(){return kj.RichClientError}});var _j=f6();Object.defineProperty($t,"errorDetailsClientMiddleware",{enumerable:!0,get:function(){return _j.errorDetailsClientMiddleware}})});var g6,y6=re(()=>{"use strict";g6=typeof globalThis=="object"?globalThis:global});var v6=re(()=>{"use strict";y6()});var S6=re(()=>{"use strict";v6()});var Ma,C1=re(()=>{"use strict";Ma="1.9.0"});function Aj(e){var t=new Set([e]),n=new Set,r=e.match(b6);if(!r)return function(){return!1};var i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(u){return u===e};function a(s){return n.add(s),!1}function o(s){return t.add(s),!0}return function(u){if(t.has(u))return!0;if(n.has(u))return!1;var l=u.match(b6);if(!l)return a(u);var c={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return c.prerelease!=null||i.major!==c.major?a(u):i.major===0?i.minor===c.minor&&i.patch<=c.patch?o(u):a(u):i.minor<=c.minor?o(u):a(u)}}var b6,T6,E6=re(()=>{"use strict";C1();b6=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;T6=Aj(Ma)});function na(e,t,n,r){var i;r===void 0&&(r=!1);var a=cp[lp]=(i=cp[lp])!==null&&i!==void 0?i:{version:Ma};if(!r&&a[e]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(o.stack||o.message),!1}if(a.version!==Ma){var o=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+e+" does not match previously registered API v"+Ma);return n.error(o.stack||o.message),!1}return a[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+Ma+"."),!0}function ur(e){var t,n,r=(t=cp[lp])===null||t===void 0?void 0:t.version;if(!(!r||!T6(r)))return(n=cp[lp])===null||n===void 0?void 0:n[e]}function ra(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Ma+".");var n=cp[lp];n&&delete n[e]}var Nj,lp,cp,$s=re(()=>{"use strict";S6();C1();E6();Nj=Ma.split(".")[0],lp=Symbol.for("opentelemetry.js.api."+Nj),cp=g6});function dp(e,t,n){var r=ur("diag");if(r)return n.unshift(t),r[e].apply(r,Oj([],Ij(n),!1))}var Ij,Oj,C6,k6=re(()=>{"use strict";$s();Ij=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Oj=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},C6=function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return dp("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return dp("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return dp("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return dp("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return dp("verbose",this._namespace,t)},e}()});var jt,H0=re(()=>{"use strict";(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(jt||(jt={}))});function _6(e,t){e<jt.NONE?e=jt.NONE:e>jt.ALL&&(e=jt.ALL),t=t||{};function n(r,i){var a=t[r];return typeof a=="function"&&e>=i?a.bind(t):function(){}}return{error:n("error",jt.ERROR),warn:n("warn",jt.WARN),info:n("info",jt.INFO),debug:n("debug",jt.DEBUG),verbose:n("verbose",jt.VERBOSE)}}var A6=re(()=>{"use strict";H0()});var Rj,Pj,wj,Tn,js=re(()=>{"use strict";k6();A6();H0();$s();Rj=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Pj=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},wj="diag",Tn=function(){function e(){function t(i){return function(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var s=ur("diag");if(s)return s[i].apply(s,Pj([],Rj(a),!1))}}var n=this,r=function(i,a){var o,s,u;if(a===void 0&&(a={logLevel:jt.INFO}),i===n){var l=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((o=l.stack)!==null&&o!==void 0?o:l.message),!1}typeof a=="number"&&(a={logLevel:a});var c=ur("diag"),d=_6((s=a.logLevel)!==null&&s!==void 0?s:jt.INFO,i);if(c&&!a.suppressOverrideMessage){var f=(u=new Error().stack)!==null&&u!==void 0?u:"<failed to generate stacktrace>";c.warn("Current logger will be overwritten from "+f),d.warn("Current logger will overwrite one already registered from "+f)}return na("diag",d,n,!0)};n.setLogger=r,n.disable=function(){ra(wj,n)},n.createComponentLogger=function(i){return new C6(i)},n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}()});var xj,Bj,N6,I6=re(()=>{"use strict";xj=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Bj=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},N6=function(){function e(t){this._entries=t?new Map(t):new Map}return e.prototype.getEntry=function(t){var n=this._entries.get(t);if(n)return Object.assign({},n)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(t){var n=xj(t,2),r=n[0],i=n[1];return[r,i]})},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=new e(this._entries);try{for(var o=Bj(r),s=o.next();!s.done;s=o.next()){var u=s.value;a._entries.delete(u)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e.prototype.clear=function(){return new e},e}()});var O6,R6=re(()=>{"use strict";O6=Symbol("BaggageEntryMetadata")});function P6(e){return e===void 0&&(e={}),new N6(new Map(Object.entries(e)))}function w6(e){return typeof e!="string"&&(Dj.error("Cannot create baggage metadata from unknown type: "+typeof e),e=""),{__TYPE__:O6,toString:function(){return e}}}var Dj,k1=re(()=>{"use strict";js();I6();R6();Dj=Tn.instance()});function Qd(e){return Symbol.for(e)}var Mj,G0,fp=re(()=>{"use strict";Mj=function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(r){return n._currentContext.get(r)},n.setValue=function(r,i){var a=new e(n._currentContext);return a._currentContext.set(r,i),a},n.deleteValue=function(r){var i=new e(n._currentContext);return i._currentContext.delete(r),i}}return e}(),G0=new Mj});var _1,x6,B6=re(()=>{"use strict";_1=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],x6=function(){function e(){function t(r){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];if(console){var o=console[r];if(typeof o!="function"&&(o=console.log),typeof o=="function")return o.apply(console,i)}}}for(var n=0;n<_1.length;n++)this[_1[n].n]=t(_1[n].c)}return e}()});function D6(){return N1}var eu,Lj,z0,Fj,Uj,qj,Vj,A1,Jj,Wj,Hj,N1,Gj,zj,Qj,Kj,Zj,Yj,Xj,I1=re(()=>{"use strict";eu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lj=function(){function e(){}return e.prototype.createGauge=function(t,n){return zj},e.prototype.createHistogram=function(t,n){return Qj},e.prototype.createCounter=function(t,n){return Gj},e.prototype.createUpDownCounter=function(t,n){return Kj},e.prototype.createObservableGauge=function(t,n){return Yj},e.prototype.createObservableCounter=function(t,n){return Zj},e.prototype.createObservableUpDownCounter=function(t,n){return Xj},e.prototype.addBatchObservableCallback=function(t,n){},e.prototype.removeBatchObservableCallback=function(t){},e}(),z0=function(){function e(){}return e}(),Fj=function(e){eu(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(n,r){},t}(z0),Uj=function(e){eu(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(n,r){},t}(z0),qj=function(e){eu(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(n,r){},t}(z0),Vj=function(e){eu(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(n,r){},t}(z0),A1=function(){function e(){}return e.prototype.addCallback=function(t){},e.prototype.removeCallback=function(t){},e}(),Jj=function(e){eu(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(A1),Wj=function(e){eu(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(A1),Hj=function(e){eu(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(A1),N1=new Lj,Gj=new Fj,zj=new qj,Qj=new Vj,Kj=new Uj,Zj=new Jj,Yj=new Wj,Xj=new Hj});var Q0,M6=re(()=>{"use strict";(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(Q0||(Q0={}))});var K0,Z0,O1=re(()=>{"use strict";K0={get:function(e,t){if(e!=null)return e[t]},keys:function(e){return e==null?[]:Object.keys(e)}},Z0={set:function(e,t,n){e!=null&&(e[t]=n)}}});var $j,jj,L6,F6=re(()=>{"use strict";fp();$j=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},jj=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},L6=function(){function e(){}return e.prototype.active=function(){return G0},e.prototype.with=function(t,n,r){for(var i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];return n.call.apply(n,jj([r],$j(i),!1))},e.prototype.bind=function(t,n){return n},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}()});var eee,tee,R1,nee,Oo,hp=re(()=>{"use strict";F6();$s();js();eee=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},tee=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},R1="context",nee=new L6,Oo=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return na(R1,t,Tn.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,n,r){for(var i,a=[],o=3;o<arguments.length;o++)a[o-3]=arguments[o];return(i=this._getContextManager()).with.apply(i,tee([t,n,r],eee(a),!1))},e.prototype.bind=function(t,n){return this._getContextManager().bind(t,n)},e.prototype._getContextManager=function(){return ur(R1)||nee},e.prototype.disable=function(){this._getContextManager().disable(),ra(R1,Tn.instance())},e}()});var Kd,P1=re(()=>{"use strict";(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(Kd||(Kd={}))});var pp,mp,Y0,X0=re(()=>{"use strict";P1();pp="0000000000000000",mp="00000000000000000000000000000000",Y0={traceId:mp,spanId:pp,traceFlags:Kd.NONE}});var Ro,$0=re(()=>{"use strict";X0();Ro=function(){function e(t){t===void 0&&(t=Y0),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,n){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,n){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,n){},e}()});function j0(e){return e.getValue(w1)||void 0}function U6(){return j0(Oo.getInstance().active())}function gp(e,t){return e.setValue(w1,t)}function q6(e){return e.deleteValue(w1)}function V6(e,t){return gp(e,new Ro(t))}function ey(e){var t;return(t=j0(e))===null||t===void 0?void 0:t.spanContext()}var w1,x1=re(()=>{"use strict";fp();$0();hp();w1=Qd("OpenTelemetry Context Key SPAN")});function B1(e){return ree.test(e)&&e!==mp}function D1(e){return iee.test(e)&&e!==pp}function Zd(e){return B1(e.traceId)&&D1(e.spanId)}function J6(e){return new Ro(e)}var ree,iee,ty=re(()=>{"use strict";X0();$0();ree=/^([0-9a-f]{32})$/i,iee=/^[0-9a-f]{16}$/i});function aee(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var M1,ny,L1=re(()=>{"use strict";hp();x1();$0();ty();M1=Oo.getInstance(),ny=function(){function e(){}return e.prototype.startSpan=function(t,n,r){r===void 0&&(r=M1.active());var i=!!n?.root;if(i)return new Ro;var a=r&&ey(r);return aee(a)&&Zd(a)?new Ro(a):new Ro},e.prototype.startActiveSpan=function(t,n,r,i){var a,o,s;if(!(arguments.length<2)){arguments.length===2?s=n:arguments.length===3?(a=n,s=r):(a=n,o=r,s=i);var u=o??M1.active(),l=this.startSpan(t,a,u),c=gp(u,l);return M1.with(c,s,void 0,l)}},e}()});var oee,ry,F1=re(()=>{"use strict";L1();oee=new ny,ry=function(){function e(t,n,r,i){this._provider=t,this.name=n,this.version=r,this.options=i}return e.prototype.startSpan=function(t,n,r){return this._getTracer().startSpan(t,n,r)},e.prototype.startActiveSpan=function(t,n,r,i){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):oee},e}()});var W6,H6=re(()=>{"use strict";L1();W6=function(){function e(){}return e.prototype.getTracer=function(t,n,r){return new ny},e}()});var see,yp,U1=re(()=>{"use strict";F1();H6();see=new W6,yp=function(){function e(){}return e.prototype.getTracer=function(t,n,r){var i;return(i=this.getDelegateTracer(t,n,r))!==null&&i!==void 0?i:new ry(this,t,n,r)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:see},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,n,r){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(t,n,r)},e}()});var iy,G6=re(()=>{"use strict";(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(iy||(iy={}))});var ay,z6=re(()=>{"use strict";(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(ay||(ay={}))});var oy,Q6=re(()=>{"use strict";(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(oy||(oy={}))});function K6(e){return cee.test(e)}function Z6(e){return dee.test(e)&&!fee.test(e)}var q1,uee,lee,cee,dee,fee,Y6=re(()=>{"use strict";q1="[_0-9a-z-*/]",uee="[a-z]"+q1+"{0,255}",lee="[a-z0-9]"+q1+"{0,240}@[a-z]"+q1+"{0,13}",cee=new RegExp("^(?:"+uee+"|"+lee+")$"),dee=/^[ -~]{0,255}[!-~]$/,fee=/,|=/});var X6,hee,$6,j6,eF,tF=re(()=>{"use strict";Y6();X6=32,hee=512,$6=",",j6="=",eF=function(){function e(t){this._internalState=new Map,t&&this._parse(t)}return e.prototype.set=function(t,n){var r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,n),r},e.prototype.unset=function(t){var n=this._clone();return n._internalState.delete(t),n},e.prototype.get=function(t){return this._internalState.get(t)},e.prototype.serialize=function(){var t=this;return this._keys().reduce(function(n,r){return n.push(r+j6+t.get(r)),n},[]).join($6)},e.prototype._parse=function(t){t.length>hee||(this._internalState=t.split($6).reverse().reduce(function(n,r){var i=r.trim(),a=i.indexOf(j6);if(a!==-1){var o=i.slice(0,a),s=i.slice(a+1,r.length);K6(o)&&Z6(s)&&n.set(o,s)}return n},new Map),this._internalState.size>X6&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,X6))))},e.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},e.prototype._clone=function(){var t=new e;return t._internalState=new Map(this._internalState),t},e}()});function nF(e){return new eF(e)}var rF=re(()=>{"use strict";tF()});var V1,iF=re(()=>{"use strict";hp();V1=Oo.getInstance()});var J1,aF=re(()=>{"use strict";js();J1=Tn.instance()});var pee,oF,sF=re(()=>{"use strict";I1();pee=function(){function e(){}return e.prototype.getMeter=function(t,n,r){return N1},e}(),oF=new pee});var W1,uF,lF=re(()=>{"use strict";sF();$s();js();W1="metrics",uF=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(t){return na(W1,t,Tn.instance())},e.prototype.getMeterProvider=function(){return ur(W1)||oF},e.prototype.getMeter=function(t,n,r){return this.getMeterProvider().getMeter(t,n,r)},e.prototype.disable=function(){ra(W1,Tn.instance())},e}()});var vp,cF=re(()=>{"use strict";lF();vp=uF.getInstance()});var dF,fF=re(()=>{"use strict";dF=function(){function e(){}return e.prototype.inject=function(t,n){},e.prototype.extract=function(t,n){return t},e.prototype.fields=function(){return[]},e}()});function G1(e){return e.getValue(H1)||void 0}function hF(){return G1(Oo.getInstance().active())}function pF(e,t){return e.setValue(H1,t)}function mF(e){return e.deleteValue(H1)}var H1,gF=re(()=>{"use strict";hp();fp();H1=Qd("OpenTelemetry Baggage Key")});var z1,mee,yF,vF=re(()=>{"use strict";$s();fF();O1();gF();k1();js();z1="propagation",mee=new dF,yF=function(){function e(){this.createBaggage=P6,this.getBaggage=G1,this.getActiveBaggage=hF,this.setBaggage=pF,this.deleteBaggage=mF}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(t){return na(z1,t,Tn.instance())},e.prototype.inject=function(t,n,r){return r===void 0&&(r=Z0),this._getGlobalPropagator().inject(t,n,r)},e.prototype.extract=function(t,n,r){return r===void 0&&(r=K0),this._getGlobalPropagator().extract(t,n,r)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){ra(z1,Tn.instance())},e.prototype._getGlobalPropagator=function(){return ur(z1)||mee},e}()});var Q1,SF=re(()=>{"use strict";vF();Q1=yF.getInstance()});var K1,bF,TF=re(()=>{"use strict";$s();U1();ty();x1();js();K1="trace",bF=function(){function e(){this._proxyTracerProvider=new yp,this.wrapSpanContext=J6,this.isSpanContextValid=Zd,this.deleteSpan=q6,this.getSpan=j0,this.getActiveSpan=U6,this.getSpanContext=ey,this.setSpan=gp,this.setSpanContext=V6}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var n=na(K1,this._proxyTracerProvider,Tn.instance());return n&&this._proxyTracerProvider.setDelegate(t),n},e.prototype.getTracerProvider=function(){return ur(K1)||this._proxyTracerProvider},e.prototype.getTracer=function(t,n){return this.getTracerProvider().getTracer(t,n)},e.prototype.disable=function(){ra(K1,Tn.instance()),this._proxyTracerProvider=new yp},e}()});var Z1,EF=re(()=>{"use strict";TF();Z1=bF.getInstance()});var yee={};gh(yee,{DiagConsoleLogger:()=>x6,DiagLogLevel:()=>jt,INVALID_SPANID:()=>pp,INVALID_SPAN_CONTEXT:()=>Y0,INVALID_TRACEID:()=>mp,ProxyTracer:()=>ry,ProxyTracerProvider:()=>yp,ROOT_CONTEXT:()=>G0,SamplingDecision:()=>iy,SpanKind:()=>ay,SpanStatusCode:()=>oy,TraceFlags:()=>Kd,ValueType:()=>Q0,baggageEntryMetadataFromString:()=>w6,context:()=>V1,createContextKey:()=>Qd,createNoopMeter:()=>D6,createTraceState:()=>nF,default:()=>gee,defaultTextMapGetter:()=>K0,defaultTextMapSetter:()=>Z0,diag:()=>J1,isSpanContextValid:()=>Zd,isValidSpanId:()=>D1,isValidTraceId:()=>B1,metrics:()=>vp,propagation:()=>Q1,trace:()=>Z1});var gee,CF=re(()=>{"use strict";k1();fp();B6();H0();I1();M6();O1();F1();U1();G6();z6();Q6();P1();rF();ty();X0();iF();aF();cF();SF();EF();gee={context:V1,diag:J1,metrics:vp,propagation:Q1,trace:Z1}});var x7=m((cPe,sN)=>{"use strict";var wre=Object.prototype.hasOwnProperty,Fn="~";function $p(){}Object.create&&($p.prototype=Object.create(null),new $p().__proto__||(Fn=!1));function xre(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function w7(e,t,n,r,i){if(typeof n!="function")throw new TypeError("The listener must be a function");var a=new xre(n,r||e,i),o=Fn?Fn+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],a]:e._events[o].push(a):(e._events[o]=a,e._eventsCount++),e}function pv(e,t){--e._eventsCount===0?e._events=new $p:delete e._events[t]}function Cn(){this._events=new $p,this._eventsCount=0}Cn.prototype.eventNames=function(){var t=[],n,r;if(this._eventsCount===0)return t;for(r in n=this._events)wre.call(n,r)&&t.push(Fn?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(n)):t};Cn.prototype.listeners=function(t){var n=Fn?Fn+t:t,r=this._events[n];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=new Array(a);i<a;i++)o[i]=r[i].fn;return o};Cn.prototype.listenerCount=function(t){var n=Fn?Fn+t:t,r=this._events[n];return r?r.fn?1:r.length:0};Cn.prototype.emit=function(t,n,r,i,a,o){var s=Fn?Fn+t:t;if(!this._events[s])return!1;var u=this._events[s],l=arguments.length,c,d;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),l){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,n),!0;case 3:return u.fn.call(u.context,n,r),!0;case 4:return u.fn.call(u.context,n,r,i),!0;case 5:return u.fn.call(u.context,n,r,i,a),!0;case 6:return u.fn.call(u.context,n,r,i,a,o),!0}for(d=1,c=new Array(l-1);d<l;d++)c[d-1]=arguments[d];u.fn.apply(u.context,c)}else{var f=u.length,h;for(d=0;d<f;d++)switch(u[d].once&&this.removeListener(t,u[d].fn,void 0,!0),l){case 1:u[d].fn.call(u[d].context);break;case 2:u[d].fn.call(u[d].context,n);break;case 3:u[d].fn.call(u[d].context,n,r);break;case 4:u[d].fn.call(u[d].context,n,r,i);break;default:if(!c)for(h=1,c=new Array(l-1);h<l;h++)c[h-1]=arguments[h];u[d].fn.apply(u[d].context,c)}}return!0};Cn.prototype.on=function(t,n,r){return w7(this,t,n,r,!1)};Cn.prototype.once=function(t,n,r){return w7(this,t,n,r,!0)};Cn.prototype.removeListener=function(t,n,r,i){var a=Fn?Fn+t:t;if(!this._events[a])return this;if(!n)return pv(this,a),this;var o=this._events[a];if(o.fn)o.fn===n&&(!i||o.once)&&(!r||o.context===r)&&pv(this,a);else{for(var s=0,u=[],l=o.length;s<l;s++)(o[s].fn!==n||i&&!o[s].once||r&&o[s].context!==r)&&u.push(o[s]);u.length?this._events[a]=u.length===1?u[0]:u:pv(this,a)}return this};Cn.prototype.removeAllListeners=function(t){var n;return t?(n=Fn?Fn+t:t,this._events[n]&&pv(this,n)):(this._events=new $p,this._eventsCount=0),this};Cn.prototype.off=Cn.prototype.removeListener;Cn.prototype.addListener=Cn.prototype.on;Cn.prefixed=Fn;Cn.EventEmitter=Cn;typeof sN<"u"&&(sN.exports=Cn)});var mv=m(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.getChainType=ct.ChainId=ct.BTCChainId=ct.StarknetChainId=ct.CosmosChainId=ct.FuelChainId=ct.SolanaChainId=ct.SuiChainId=ct.AptosChainId=ct.EthChainId=ct.ChainType=void 0;var Tu;(function(e){e.SOLANA="solana",e.SUI="sui",e.APTOS="aptos",e.ETH="evm",e.BTC="btc"})(Tu||(ct.ChainType=Tu={}));var fN;(function(e){e.ETHEREUM="1",e.OPTIMISM="10",e.CRONOS="25",e.BSC="56",e.BSC_TESTNET="97",e.UNICHAIN="130",e.POLYGON="137",e.MANTA_PACIFIC="169",e.XLAYER_TESTNET="195",e.XLAYER_MAINNET="196",e.OP_BNB_MAINNET="204",e.SONIC_MAINNET="146",e.SONIC_TESTNET="57054",e.B2_MAINNET="223",e.FANTOM="250",e.FRAXTAL="252",e.KUCOIN="321",e.CRONOS_ZKEVM="388",e.ZKSYNC_ERA="324",e.CRONOS_TESTNET="338",e.ASTAR="592",e.DERIVE="957",e.HYPER_EVM="999",e.POLYGON_ZKEVM="1101",e.CONFLUX="1030",e.METIS="1088",e.MOONBEAM="1284",e.UNICHAIN_SEPOLIA="1301",e.SEI="1329",e.SONEIUM_TESTNET="1946",e.SONEIUM_MAINNET="1868",e.SWELL_TESTNET="1924",e.SWELL_MAINNET="1923",e.TAC_TESTNET="2390",e.KARAK="2410",e.BEVM="11501",e.MERLIN_MAINNET="4200",e.MANTLE="5000",e.BASE="8453",e.MONAD_TESTNET="10143",e.HOLESKY="17000",e.ASTAR_ZKEVM="3776",e.MODE="34443",e.ARBITRUM="42161",e.AVALANCHE="43114",e.ZIRCUIT_TESTNET="48899",e.ZIRCUIT_MAINNET="48900",e.BOB="60808",e.LINEA="59144",e.BERACHAIN="80094",e.BLAST="81457",e.CHILIZ="88888",e.TAIKO="167000",e.TAIKO_TESTNET="167008",e.BITLAYER="200901",e.SCROLL="534352",e.ZKLINK_NOVA="810180",e.SEPOLIA="11155111",e.CORN_MAIZENET="21000000",e.AURORA="1313161554",e.BLAST_SEPOLIA="168587773"})(fN||(ct.EthChainId=fN={}));var hN;(function(e){e.APTOS_MAINNET="aptos_mainnet",e.APTOS_TESTNET="aptos_testnet",e.APTOS_MOVEMENT_TESTNET="aptos_movement_testnet",e.APTOS_MOVEMENT_MAINNET="aptos_movement_mainnet"})(hN||(ct.AptosChainId=hN={}));var pN;(function(e){e.SUI_MAINNET="sui_mainnet",e.SUI_TESTNET="sui_testnet"})(pN||(ct.SuiChainId=pN={}));var mN;(function(e){e.SOLANA_MAINNET="sol_mainnet",e.SOLANA_DEVNET="sol_devnet",e.SOLANA_TESTNET="sol_testnet",e.SOLANA_PYTH="sol_pyth"})(mN||(ct.SolanaChainId=mN={}));var gN;(function(e){e.FUEL_MAINNET="fuel_mainnet",e.FUEL_TESTNET="fuel_testnet"})(gN||(ct.FuelChainId=gN={}));var yN;(function(e){e.INJECTIVE_MAINNET="injective_mainnet",e.INJECTIVE_TESTNET="injective_testnet"})(yN||(ct.CosmosChainId=yN={}));var vN;(function(e){e.STARKNET_MAINNET="starknet_mainnet",e.STARKNET_SEPOLIA="starknet_sepolia"})(vN||(ct.StarknetChainId=vN={}));var SN;(function(e){e.BTC_MAINNET="btc_mainnet",e.BTC_TESTNET="btc_testnet"})(SN||(ct.BTCChainId=SN={}));ct.ChainId={...fN,...hN,...pN,...mN,...gN,...yN,...vN,...SN};function Bre(e){let t=String(e).toLowerCase();return t.startsWith("sol")?Tu.SOLANA:t.startsWith("sui")?Tu.SUI:t.startsWith("apt")?Tu.APTOS:t.startsWith("btc")?Tu.BTC:Tu.ETH}ct.getChainType=Bre});var bN=m(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.getChainLogo=ke.getChainBlockscoutUrl=ke.getChainExternalUrl=ke.SolanaChainInfo=ke.AptosChainInfo=ke.BTCChainInfo=ke.EthChainInfo=ke.EthVariation=ke.ExplorerApiType=void 0;var O=mv(),ae;(function(e){e.ETHERSCAN="etherscan",e.BLOCKSCOUT="blockscout",e.L2_SCAN="l2scan",e.OK_LINK="oklink",e.UNKNOWN="unknown"})(ae||(ke.ExplorerApiType=ae={}));var te;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ARBITRUM=1]="ARBITRUM",e[e.OPTIMISM=2]="OPTIMISM",e[e.ZKSYNC=3]="ZKSYNC",e[e.POLYGON_ZKEVM=4]="POLYGON_ZKEVM",e[e.SUBSTRATE=5]="SUBSTRATE"})(te||(ke.EthVariation=te={}));ke.EthChainInfo={[O.EthChainId.ETHEREUM]:{name:"Ethereum",slug:"mainnet",chainId:O.EthChainId.ETHEREUM,variation:te.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ae.ETHERSCAN,explorerUrl:"https://etherscan.io",explorerApi:"https://api.etherscan.io",blockscoutUrl:"https://eth.blockscout.com",lightIcon:"https://sentio.xyz/chains/eth.svg",darkIcon:"https://sentio.xyz/chains/eth-dark.svg"},[O.EthChainId.SEPOLIA]:{name:"Sepolia",slug:"sepolia",chainId:O.EthChainId.SEPOLIA,mainnetChainId:O.EthChainId.ETHEREUM,variation:te.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x1ef5f52bdbe11af2377c58ecc914a8c72ea807cf",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ae.ETHERSCAN,explorerUrl:"https://sepolia.etherscan.io",explorerApi:"https://api-sepolia.etherscan.io",blockscoutUrl:"https://eth-sepolia.blockscout.com",lightIcon:"https://sentio.xyz/chains/eth.svg",darkIcon:"https://sentio.xyz/chains/eth-dark.svg"},[O.EthChainId.HOLESKY]:{name:"Holesky",slug:"holesky",chainId:O.EthChainId.HOLESKY,mainnetChainId:O.EthChainId.ETHEREUM,variation:te.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x94373a4919B3240D86eA41593D5eBa789FEF3848",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ae.ETHERSCAN,explorerUrl:"https://holesky.etherscan.io",explorerApi:"https://api-holesky.etherscan.io",blockscoutUrl:"https://eth-holesky.blockscout.com",lightIcon:"https://sentio.xyz/chains/eth.svg",darkIcon:"https://sentio.xyz/chains/eth-dark.svg"},[O.EthChainId.BSC]:{name:"Binance Smart Chain",slug:"bsc",chainId:O.EthChainId.BSC,variation:te.DEFAULT,priceTokenAddress:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",tokenSymbol:"BNB",tokenDecimals:18,explorerApiType:ae.ETHERSCAN,explorerUrl:"https://bscscan.com",explorerApi:"https://api.bscscan.com",lightIcon:"https://sentio.xyz/chains/bnb-chain.svg"},[O.EthChainId.BSC_TESTNET]:{name:"Binance Smart Chain Testnet",slug:"bsc-testnet",chainId:O.EthChainId.BSC_TESTNET,mainnetChainId:O.EthChainId.BSC,variation:te.DEFAULT,priceTokenAddress:"0xae13d989dac2f0debff460ac112a837c89baa7cd",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xae13d989dac2f0debff460ac112a837c89baa7cd",tokenSymbol:"tBNB",tokenDecimals:18,explorerApiType:ae.ETHERSCAN,explorerUrl:"https://testnet.bscscan.com",explorerApi:"https://api-testnet.bscscan.com",lightIcon:"https://sentio.xyz/chains/bnb-chain.svg"},[O.EthChainId.OP_BNB_MAINNET]:{name:"opBNB Mainnet",slug:"opbnb",chainId:O.EthChainId.OP_BNB_MAINNET,variation:te.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"BNB",tokenDecimals:18,explorerUrl:"https://opbnb.bscscan.com",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api-opbnb.bscscan.com",lightIcon:"https://sentio.xyz/chains/bnb-chain.svg"},[O.EthChainId.POLYGON]:{name:"Polygon",slug:"matic",chainId:O.EthChainId.POLYGON,variation:te.DEFAULT,priceTokenAddress:"0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",tokenSymbol:"MATIC",tokenDecimals:18,explorerApiType:ae.ETHERSCAN,explorerUrl:"https://polygonscan.com",explorerApi:"https://api.polygonscan.com",lightIcon:"https://sentio.xyz/chains/polygon.svg"},[O.EthChainId.ARBITRUM]:{name:"Arbitrum",slug:"arbitrum-one",chainId:O.EthChainId.ARBITRUM,variation:te.ARBITRUM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ae.ETHERSCAN,explorerUrl:"https://arbiscan.io",explorerApi:"https://api.arbiscan.io",lightIcon:"https://sentio.xyz/chains/arbitrum.svg"},[O.EthChainId.AVALANCHE]:{name:"Avalanche",slug:"avalanche",chainId:O.EthChainId.AVALANCHE,variation:te.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ae.ETHERSCAN,explorerUrl:"https://snowtrace.io",explorerApi:"https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan",lightIcon:"https://sentio.xyz/chains/avalanche.svg"},[O.EthChainId.POLYGON_ZKEVM]:{name:"Polygon zkEVM",chainId:O.EthChainId.POLYGON_ZKEVM,slug:"polygon-zkevm",variation:te.POLYGON_ZKEVM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ae.ETHERSCAN,explorerUrl:"https://zkevm.polygonscan.com",explorerApi:"https://api-zkevm.polygonscan.com",lightIcon:"https://sentio.xyz/chains/polygon.svg"},[O.EthChainId.MOONBEAM]:{name:"Moonbeam",slug:"moonbeam",chainId:O.EthChainId.MOONBEAM,variation:te.SUBSTRATE,priceTokenAddress:"0xacc15dc74880c9944775448304b263d191c6077f",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xacc15dc74880c9944775448304b263d191c6077f",tokenSymbol:"GLMR",tokenDecimals:18,explorerApiType:ae.ETHERSCAN,explorerUrl:"https://moonscan.io",explorerApi:"https://api-moonbeam.moonscan.io",lightIcon:"https://sentio.xyz/chains/moonbeam.svg"},[O.EthChainId.ASTAR]:{name:"Astar",slug:"astar",chainId:O.EthChainId.ASTAR,variation:te.SUBSTRATE,priceTokenAddress:"0xaeaaf0e2c81af264101b9129c00f4440ccf0f720",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xaeaaf0e2c81af264101b9129c00f4440ccf0f720",tokenSymbol:"ASTR",tokenDecimals:18,explorerApiType:ae.BLOCKSCOUT,explorerUrl:"https://astar.blockscout.com",explorerApi:"https://astar.blockscout.com",lightIcon:"https://sentio.xyz/chains/astar.svg"},[O.EthChainId.ASTAR_ZKEVM]:{name:"Astar zkEVM",slug:"astar-zkevm",chainId:O.EthChainId.ASTAR_ZKEVM,variation:te.POLYGON_ZKEVM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xE9CC37904875B459Fa5D0FE37680d36F1ED55e38",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://astar-zkevm.explorer.startale.com",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://astar-zkevm.explorer.startale.com",lightIcon:"https://sentio.xyz/chains/astar.svg"},[O.EthChainId.LINEA]:{name:"Linea",slug:"linea",chainId:O.EthChainId.LINEA,variation:te.DEFAULT,priceTokenAddress:"0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://lineascan.build",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.lineascan.build",lightIcon:"https://sentio.xyz/chains/linea.svg",darkIcon:"https://sentio.xyz/chains/linea-dark.svg"},[O.EthChainId.SCROLL]:{name:"Scroll",slug:"scroll",chainId:O.EthChainId.SCROLL,variation:te.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x5300000000000000000000000000000000000004",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://scrollscan.com",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.scrollscan.com",lightIcon:"https://sentio.xyz/chains/scroll.svg"},[O.EthChainId.TAIKO]:{name:"Taiko Mainnet",slug:"taiko",chainId:O.EthChainId.TAIKO,variation:te.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xA51894664A773981C6C112C43ce576f315d5b1B6",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://taikoscan.io",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.taikoscan.io",lightIcon:"https://sentio.xyz/chains/taiko.svg"},[O.EthChainId.TAIKO_TESTNET]:{name:"Taiko Testnet",slug:"taiko-hekla-testnet",chainId:O.EthChainId.TAIKO_TESTNET,mainnetChainId:O.EthChainId.TAIKO,variation:te.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xae2C46ddb314B9Ba743C6dEE4878F151881333D9",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://hekla.taikoscan.io",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api-hekla.taikoscan.io",lightIcon:"https://sentio.xyz/chains/taiko.svg"},[O.EthChainId.XLAYER_TESTNET]:{name:"X Layer Testnet",slug:"xlayer-sepolia",chainId:O.EthChainId.XLAYER_TESTNET,mainnetChainId:O.EthChainId.XLAYER_MAINNET,variation:te.POLYGON_ZKEVM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xa749ad81913cdc19881ebeb64631df72be708335",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://www.oklink.com/xlayer-test",explorerApiType:ae.OK_LINK,explorerApi:"https://www.oklink.com/api/v5/explorer",lightIcon:"https://sentio.xyz/chains/x1-logo.png"},[O.EthChainId.XLAYER_MAINNET]:{name:"X Layer Mainnet",slug:"xlayer-mainnet",chainId:O.EthChainId.XLAYER_MAINNET,variation:te.POLYGON_ZKEVM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x5a77f1443d16ee5761d310e38b62f77f726bc71c",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://www.oklink.com/xlayer",explorerApiType:ae.OK_LINK,explorerApi:"https://www.oklink.com/api/v5/explorer",lightIcon:"https://sentio.xyz/chains/x1-logo.png"},[O.EthChainId.BLAST]:{name:"Blast Mainnet",slug:"blast-mainnet",chainId:O.EthChainId.BLAST,variation:te.OPTIMISM,priceTokenAddress:"0x4300000000000000000000000000000000000004",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4300000000000000000000000000000000000004",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://blastscan.io",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.blastscan.io",lightIcon:"https://sentio.xyz/chains/blast-logo.png"},[O.EthChainId.BLAST_SEPOLIA]:{name:"Blast Testnet",slug:"blast-testnet",chainId:O.EthChainId.BLAST_SEPOLIA,mainnetChainId:O.EthChainId.BLAST,variation:te.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000023",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000023",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://sepolia.blastscan.io",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api-sepolia.blastscan.io",lightIcon:"https://sentio.xyz/chains/blast-logo.png"},[O.EthChainId.BASE]:{name:"Base",slug:"base",chainId:O.EthChainId.BASE,variation:te.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://basescan.org",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.basescan.org",lightIcon:"https://sentio.xyz/chains/base.svg",darkIcon:"https://sentio.xyz/chains/base_blue.svg"},[O.EthChainId.ZKSYNC_ERA]:{name:"zkSync Era",slug:"zksync-era",chainId:O.EthChainId.ZKSYNC_ERA,variation:te.ZKSYNC,priceTokenAddress:"0x000000000000000000000000000000000000800A",tokenAddress:"0x000000000000000000000000000000000000800A",wrappedTokenAddress:"0x000000000000000000000000000000000000800A",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.zksync.io",explorerApiType:ae.ETHERSCAN,explorerApi:"https://block-explorer-api.mainnet.zksync.io",lightIcon:"https://sentio.xyz/chains/zksync.svg"},[O.EthChainId.ZIRCUIT_TESTNET]:{name:"Zircuit Testnet",slug:"zircuit-testnet",chainId:O.EthChainId.ZIRCUIT_TESTNET,mainnetChainId:O.EthChainId.ZIRCUIT_MAINNET,variation:te.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.testnet.zircuit.com",lightIcon:"https://sentio.xyz/chains/zircuit-inverted-icon.svg",darkIcon:"https://sentio.xyz/chains/zircuit-green-icon.svg"},[O.EthChainId.ZIRCUIT_MAINNET]:{name:"Zircuit Mainnet",slug:"zircuit",chainId:O.EthChainId.ZIRCUIT_MAINNET,variation:te.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.zircuit.com",lightIcon:"https://sentio.xyz/chains/zircuit-inverted-icon.svg",darkIcon:"https://sentio.xyz/chains/zircuit-green-icon.svg"},[O.EthChainId.FANTOM]:{name:"Fantom Opera",slug:"fantom",chainId:O.EthChainId.FANTOM,variation:te.DEFAULT,priceTokenAddress:"0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83",tokenSymbol:"WFTM",tokenDecimals:18,explorerUrl:"https://ftmscan.com",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.ftmscan.com",lightIcon:"https://sentio.xyz/chains/fantom.svg"},[O.EthChainId.OPTIMISM]:{name:"Optimism Mainnet",slug:"optimism",chainId:O.EthChainId.OPTIMISM,variation:te.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://optimistic.etherscan.io",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api-optimistic.etherscan.io",lightIcon:"https://sentio.xyz/chains/optimism.svg"},[O.EthChainId.CRONOS]:{name:"Cronos Mainnet",slug:"cronos",chainId:O.EthChainId.CRONOS,variation:te.DEFAULT,priceTokenAddress:"0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23",tokenSymbol:"CRO",tokenDecimals:18,explorerUrl:"https://cronoscan.com",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.cronoscan.com",lightIcon:"https://sentio.xyz/chains/cronos.svg",darkIcon:"https://sentio.xyz/chains/cronos_light.svg"},[O.EthChainId.CRONOS_TESTNET]:{name:"Cronos Testnet",slug:"cronos-testnet",chainId:O.EthChainId.CRONOS_TESTNET,mainnetChainId:O.EthChainId.CRONOS,variation:te.DEFAULT,priceTokenAddress:"0x6a3173618859c7cd40faf6921b5e9eb6a76f1fd4",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x6a3173618859c7cd40faf6921b5e9eb6a76f1fd4",tokenSymbol:"CRO",tokenDecimals:18,explorerUrl:"https://explorer.cronos.org/testnet",lightIcon:"https://sentio.xyz/chains/cronos.svg",darkIcon:"https://sentio.xyz/chains/cronos_light.svg"},[O.EthChainId.BITLAYER]:{name:"Bitlayer Mainnet",slug:"bitlayer",chainId:O.EthChainId.BITLAYER,variation:te.DEFAULT,priceTokenAddress:"0xff204e2681a6fa0e2c3fade68a1b28fb90e4fc5f",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xff204e2681a6fa0e2c3fade68a1b28fb90e4fc5f",tokenSymbol:"BTC",tokenDecimals:18,explorerUrl:"https://www.btrscan.com",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.btrscan.com/scan",lightIcon:"https://sentio.xyz/chains/bitlayer.svg"},[O.EthChainId.MANTA_PACIFIC]:{name:"Manta Pacific",slug:"manta-pacific-mainnet",chainId:O.EthChainId.MANTA_PACIFIC,variation:te.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0Dc808adcE2099A9F62AA87D9670745AbA741746",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://pacific-explorer.manta.network",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://pacific-explorer.manta.network",lightIcon:"https://sentio.xyz/chains/manta.png"},[O.EthChainId.MANTLE]:{name:"Mantle",slug:"mantle",chainId:O.EthChainId.MANTLE,variation:te.OPTIMISM,priceTokenAddress:"0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8",tokenSymbol:"MNT",tokenDecimals:18,explorerUrl:"https://mantlescan.xyz",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.mantlescan.xyz",lightIcon:"https://sentio.xyz/chains/mantle.svg",darkIcon:"https://sentio.xyz/chains/mantle-white.svg"},[O.EthChainId.B2_MAINNET]:{name:"B2 Mainnet",slug:"b2-mainnet",chainId:O.EthChainId.B2_MAINNET,variation:te.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"BTC",tokenDecimals:18,explorerUrl:"https://explorer.bsquared.network",explorerApiType:ae.L2_SCAN,explorerApi:"https://explorer.bsquared.network/api",lightIcon:"https://sentio.xyz/chains/b2.svg"},[O.EthChainId.MODE]:{name:"Mode Mainnet",slug:"mode-mainnet",chainId:O.EthChainId.MODE,variation:te.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://modescan.io",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.routescan.io/v2/network/mainnet/evm/34443/etherscan"},[O.EthChainId.BOB]:{name:"Bob Mainnet",slug:"bob",chainId:O.EthChainId.BOB,variation:te.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.gobob.xyz",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://explorer.gobob.xyz",lightIcon:"https://sentio.xyz/chains/bob.svg"},[O.EthChainId.FRAXTAL]:{name:"Fraxtal Mainnet",slug:"frax-mainnet",chainId:O.EthChainId.FRAXTAL,variation:te.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xFC00000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://fraxscan.com",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.fraxscan.com",lightIcon:"https://sentio.xyz/chains/fraxtal.svg"},[O.EthChainId.KUCOIN]:{name:"KCC Mainnet",slug:"kucoin",chainId:O.EthChainId.KUCOIN,variation:te.DEFAULT,priceTokenAddress:"0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521",tokenSymbol:"KCS",tokenDecimals:18,explorerUrl:"https://scan.kcc.io",explorerApiType:ae.ETHERSCAN,explorerApi:"https://scan.kcc.io",lightIcon:"https://sentio.xyz/chains/kcc.svg"},[O.EthChainId.CONFLUX]:{name:"Conflux eSpace",slug:"conflux-espace",chainId:O.EthChainId.CONFLUX,variation:te.DEFAULT,priceTokenAddress:"0x14b2d3bc65e74dae1030eafd8ac30c533c976a9b",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x14b2d3bc65e74dae1030eafd8ac30c533c976a9b",tokenSymbol:"CFX",tokenDecimals:18,explorerUrl:"https://evm.confluxscan.io",explorerApiType:ae.ETHERSCAN,explorerApi:"https://evmapi.confluxscan.io",lightIcon:"https://sentio.xyz/chains/conflux.svg",darkIcon:"https://sentio.xyz/chains/conflux-white.svg"},[O.EthChainId.METIS]:{name:"Metis",slug:"metis",chainId:O.EthChainId.METIS,variation:te.DEFAULT,priceTokenAddress:"0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481",tokenSymbol:"METIS",tokenDecimals:18,explorerUrl:"https://explorer.metis.io",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan/",lightIcon:"https://sentio.xyz/chains/metis.svg"},[O.EthChainId.BEVM]:{name:"BEVM",slug:"bevm",chainId:O.EthChainId.BEVM,variation:te.SUBSTRATE,priceTokenAddress:"0xB5136FEba197f5fF4B765E5b50c74db717796dcD",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xB5136FEba197f5fF4B765E5b50c74db717796dcD",tokenSymbol:"BTC",tokenDecimals:18,explorerUrl:"https://scan.bevm.io",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://scan.bevm.io",lightIcon:"https://sentio.xyz/chains/bevm.svg"},[O.EthChainId.MERLIN_MAINNET]:{name:"Merlin Mainnet",slug:"merlin",chainId:O.EthChainId.MERLIN_MAINNET,variation:te.POLYGON_ZKEVM,priceTokenAddress:"0xF6D226f9Dc15d9bB51182815b320D3fBE324e1bA",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xF6D226f9Dc15d9bB51182815b320D3fBE324e1bA",tokenSymbol:"BTC",tokenDecimals:18,explorerUrl:"https://scan.merlinchain.io",explorerApiType:ae.L2_SCAN,explorerApi:"https://scan.merlinchain.io/api",lightIcon:"https://sentio.xyz/chains/merlin.png"},[O.EthChainId.CHILIZ]:{name:"Chiliz",slug:"chiliz",chainId:O.EthChainId.CHILIZ,variation:te.DEFAULT,priceTokenAddress:"0x721EF6871f1c4Efe730Dce047D40D1743B886946",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x721EF6871f1c4Efe730Dce047D40D1743B886946",tokenSymbol:"CHZ",tokenDecimals:18,explorerUrl:"https://chiliscan.com",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.routescan.io/v2/network/mainnet/evm/88888/etherscan",lightIcon:"https://sentio.xyz/chains/chiliz.svg"},[O.EthChainId.ZKLINK_NOVA]:{name:"zkLink Nova",slug:"zklink-nova",chainId:O.EthChainId.ZKLINK_NOVA,variation:te.ZKSYNC,priceTokenAddress:"0x000000000000000000000000000000000000800A",tokenAddress:"0x000000000000000000000000000000000000800A",wrappedTokenAddress:"0x000000000000000000000000000000000000800A",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.zklink.io",explorerApiType:ae.ETHERSCAN,explorerApi:"https://explorer-api.zklink.io",lightIcon:"https://sentio.xyz/chains/zklink.svg"},[O.EthChainId.AURORA]:{name:"Aurora",slug:"aurora",chainId:O.EthChainId.AURORA,variation:te.DEFAULT,priceTokenAddress:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",tokenAddress:"0x000000000000000000000000000000000000800A",wrappedTokenAddress:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.aurora.dev",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://explorer.aurora.dev",lightIcon:"https://sentio.xyz/chains/aurora.svg"},[O.EthChainId.SONIC_MAINNET]:{name:"Sonic Mainnet",slug:"sonic-mainnet",chainId:O.EthChainId.SONIC_MAINNET,variation:te.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x000000000000000000000000000000000000800A",tokenSymbol:"S",tokenDecimals:18,explorerUrl:"https://sonicscan.org",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api.sonicscan.org/api",lightIcon:"https://sentio.xyz/chains/sonic.svg",darkIcon:"https://sentio.xyz/chains/sonic-dark.svg"},[O.EthChainId.SONIC_TESTNET]:{name:"Sonic Testnet",slug:"sonic-testnet",chainId:O.EthChainId.SONIC_TESTNET,mainnetChainId:O.EthChainId.SONIC_MAINNET,variation:te.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x000000000000000000000000000000000000800A",tokenSymbol:"S",tokenDecimals:18,explorerUrl:"https://testnet.sonicscan.org",explorerApiType:ae.ETHERSCAN,explorerApi:"https://api-testnet.sonicscan.org",lightIcon:"https://sentio.xyz/chains/sonic.svg",darkIcon:"https://sentio.xyz/chains/sonic-dark.svg"},[O.EthChainId.SONEIUM_MAINNET]:{name:"Soneium Mainnet",slug:"soneium-mainnet",chainId:O.EthChainId.SONEIUM_MAINNET,variation:te.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://soneium.blockscout.com",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://soneium.blockscout.com",lightIcon:"https://sentio.xyz/chains/soneium.svg"},[O.EthChainId.SONEIUM_TESTNET]:{name:"Soneium Testnet",slug:"soneium-minato",chainId:O.EthChainId.SONEIUM_TESTNET,mainnetChainId:O.EthChainId.SONEIUM_MAINNET,variation:te.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x728F2745410A56620B50a6E0592743450e08Cac6",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://soneium-minato.blockscout.com",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://soneium-minato.blockscout.com",lightIcon:"https://sentio.xyz/chains/soneium.svg"},[O.EthChainId.CRONOS_ZKEVM]:{name:"Cronos zkEVM",slug:"cronos-zkevm",chainId:O.EthChainId.CRONOS_ZKEVM,variation:te.ZKSYNC,priceTokenAddress:"0x000000000000000000000000000000000000800a",tokenAddress:"0x000000000000000000000000000000000000800a",wrappedTokenAddress:"0xc1bf55ee54e16229d9b369a5502bfe5fc9f20b6d",tokenSymbol:"zkCRO",tokenDecimals:18,explorerUrl:"https://explorer.zkevm.cronos.org",explorerApiType:ae.ETHERSCAN,explorerApi:"https://explorer.zkevm.cronos.org",lightIcon:"https://sentio.xyz/chains/cronos.svg",darkIcon:"https://sentio.xyz/chains/cronos_light.svg"},[O.EthChainId.DERIVE]:{name:"Derive Mainnet",slug:"derive-mainnet",chainId:O.EthChainId.DERIVE,variation:te.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x15CEcd5190A43C7798dD2058308781D0662e678E",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.lyra.finance",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://explorer.lyra.finance",lightIcon:"https://sentio.xyz/chains/derive.svg"},[O.EthChainId.UNICHAIN_SEPOLIA]:{name:"Unichain Sepolia",slug:"unichain-sepolia",chainId:O.EthChainId.UNICHAIN_SEPOLIA,variation:te.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://unichain-sepolia.blockscout.com",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://unichain-sepolia.blockscout.com",lightIcon:"https://sentio.xyz/chains/unichain-testnet.svg"},[O.EthChainId.UNICHAIN]:{name:"Unichain",slug:"unichain-mainnet",chainId:O.EthChainId.UNICHAIN,variation:te.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://unichain.blockscout.com",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://unichain.blockscout.com",lightIcon:"https://sentio.xyz/chains/unichain-testnet.svg"},[O.EthChainId.CORN_MAIZENET]:{name:"Corn Maizenet",slug:"corn-maizenet",chainId:O.EthChainId.CORN_MAIZENET,variation:te.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"BTCN",tokenDecimals:18,explorerUrl:"https://maizenet-explorer.usecorn.com",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://maizenet-explorer.usecorn.com",lightIcon:"https://sentio.xyz/chains/corn.svg"},[O.EthChainId.KARAK]:{name:"Karak Mainnet",slug:"karak-mainnet",chainId:O.EthChainId.KARAK,variation:te.DEFAULT,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.karak.network",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://explorer.karak.network",lightIcon:"https://sentio.xyz/chains/karak.svg"},[O.EthChainId.SEI]:{name:"Sei Mainnet",slug:"sei",chainId:O.EthChainId.SEI,variation:te.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://seistream.app",lightIcon:"https://sentio.xyz/chains/sei.svg"},[O.EthChainId.SWELL_MAINNET]:{name:"Swell Mainnet",slug:"swell-mainnet",chainId:O.EthChainId.SWELL_MAINNET,variation:te.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.swellnetwork.io",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://explorer.swellnetwork.io",lightIcon:"https://sentio.xyz/chains/swell.svg"},[O.EthChainId.SWELL_TESTNET]:{name:"Swell Testnet",slug:"swell-testnet",chainId:O.EthChainId.SWELL_TESTNET,mainnetChainId:O.EthChainId.SWELL_MAINNET,variation:te.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://swell-testnet-explorer.alt.technology",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://swell-testnet-explorer.alt.technology",lightIcon:"https://sentio.xyz/chains/swell.svg"},[O.EthChainId.TAC_TESTNET]:{name:"TAC Testnet",slug:"tac-testnet",chainId:O.EthChainId.TAC_TESTNET,variation:te.DEFAULT,priceTokenAddress:"0x392D1cCB04d25fCBcA7D4fc0E429Dbc1F9fEe73F",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x392D1cCB04d25fCBcA7D4fc0E429Dbc1F9fEe73F",tokenSymbol:"TAC",tokenDecimals:18,explorerUrl:"https://turin.explorer.tac.build",explorerApiType:ae.BLOCKSCOUT,explorerApi:"https://turin.explorer.tac.build",lightIcon:"https://sentio.xyz/chains/tac.svg"},[O.EthChainId.MONAD_TESTNET]:{name:"Monad Testnet",slug:"monad-testnet",chainId:O.EthChainId.MONAD_TESTNET,variation:te.DEFAULT,priceTokenAddress:"0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701",tokenSymbol:"MON",tokenDecimals:18,explorerUrl:"https://testnet.monadexplorer.com",explorerApiType:ae.UNKNOWN},[O.EthChainId.BERACHAIN]:{name:"Berachain",slug:"berachain",chainId:O.EthChainId.BERACHAIN,variation:te.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"BERA",tokenDecimals:18,explorerUrl:"https://berascan.com",explorerApi:"https://api.berascan.com",explorerApiType:ae.ETHERSCAN,lightIcon:"https://sentio.xyz/chains/berachain.svg"},[O.EthChainId.HYPER_EVM]:{name:"HyperEVM",slug:"hyper-evm",chainId:O.EthChainId.HYPER_EVM,variation:te.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"HYPE",tokenDecimals:18,explorerUrl:"https://liquidscan.xyz/mainnet"}};function Dre(e,t,n){let r=n,i=ke.EthChainInfo[e];if(i)return i.explorerApiType===ae.L2_SCAN&&n==="block"&&(r="blocks"),`${i.explorerUrl}/${r}/${t}`}ke.BTCChainInfo={[O.BTCChainId.BTC_MAINNET]:{name:"Bitcoin Mainnet",chainId:O.BTCChainId.BTC_MAINNET,explorerUrl:"https://mempool.space",lightIcon:"https://sentio.xyz/chains/bitcoin.svg"},[O.BTCChainId.BTC_TESTNET]:{name:"Bitcoin Mainnet",chainId:O.BTCChainId.BTC_TESTNET,explorerUrl:"https://mempool.space/testnet4",lightIcon:"https://sentio.xyz/chains/bitcoin-testnet.svg"}};var Mre={block:"block",address:"address",tx:"tx",token:void 0};function Lre(e,t,n){let r=ke.BTCChainInfo[e]?.explorerUrl,i=Mre[n];if(!(!r||!i))return`${r}/${i}/${t}`}ke.AptosChainInfo={[O.AptosChainId.APTOS_MAINNET]:{name:"Aptos Mainnet",chainId:O.AptosChainId.APTOS_MAINNET,explorerUrl:"https://explorer.aptoslabs.com",suffix:"?network=mainnet",lightIcon:"https://sentio.xyz/chains/aptos.svg",darkIcon:"https://sentio.xyz/chains/aptos-dark.svg"},[O.AptosChainId.APTOS_TESTNET]:{name:"Aptos Testenet",chainId:O.AptosChainId.APTOS_TESTNET,explorerUrl:"https://explorer.aptoslabs.com",suffix:"?network=mainnet",lightIcon:"https://sentio.xyz/chains/aptos.svg",darkIcon:"https://sentio.xyz/chains/aptos-dark.svg"},[O.AptosChainId.APTOS_MOVEMENT_MAINNET]:{name:"Movement Mainnet Aptos",chainId:O.AptosChainId.APTOS_MOVEMENT_MAINNET,explorerUrl:"https://explorer.movementnetwork.xyz",suffix:"?network=mainnet",lightIcon:"https://sentio.xyz/chains/movement.svg",darkIcon:"https://sentio.xyz/chains/movement-dark.svg"},[O.AptosChainId.APTOS_MOVEMENT_TESTNET]:{name:"Movement Testnet Aptos",chainId:O.AptosChainId.APTOS_MOVEMENT_TESTNET,explorerUrl:"https://explorer.movementnetwork.xyz",suffix:"?network=testnet",lightIcon:"https://sentio.xyz/chains/movement.svg",darkIcon:"https://sentio.xyz/chains/movement-dark.svg"}};var Fre={block:"block",address:"account",tx:"txn",token:void 0};function Ure(e,t,n){let{explorerUrl:r,suffix:i}=ke.AptosChainInfo[e],a=Fre[n];if(a)return`${r}/${a}/${t}${i}`}ke.SolanaChainInfo={[O.SolanaChainId.SOLANA_MAINNET]:{name:"Solana Mainnet",chainId:O.SolanaChainId.SOLANA_MAINNET,explorerUrl:"https://solscan.io/",suffix:"",lightIcon:"https://sentio.xyz/solana.svg"},[O.SolanaChainId.SOLANA_TESTNET]:{name:"Solana Testnet",chainId:O.SolanaChainId.SOLANA_MAINNET,explorerUrl:"https://solscan.io/",suffix:"?cluster=testnet",lightIcon:"https://sentio.xyz/solana.svg"}};var qre={block:"block",address:"address",tx:"tx",token:"token"};function Vre(e,t,n){let{explorerUrl:r,suffix:i}=ke.SolanaChainInfo[e],a=qre[n];if(a)return`${r}${a}/${t}${i}`}var gv={[O.SuiChainId.SUI_MAINNET]:{name:"Sui Mainnet",chainId:O.SuiChainId.SUI_MAINNET,explorerUrl:"https://suivision.xyz",lightIcon:"https://sentio.xyz/chains/sui.svg",darkIcon:"https://sentio.xyz/chains/sui-dark.svg"},[O.SuiChainId.SUI_TESTNET]:{name:"Sui Testnet",chainId:O.SuiChainId.SUI_TESTNET,explorerUrl:"https://testnet.suivision.xyz",lightIcon:"https://sentio.xyz/chains/sui.svg",darkIcon:"https://sentio.xyz/chains/sui-dark.svg"}},Jre={block:"checkpoint",address:"account",tx:"txblock",token:void 0};function Wre(e,t,n){let{explorerUrl:r}=gv[e],i=Jre[n];if(i)return`${r}/${i}/${t}`}function Hre(e,t,n){if(!e||!t||!n)return;let r=e.toString();if(Object.keys(ke.EthChainInfo).includes(r))return Dre(r,t,n);if(Object.keys(ke.BTCChainInfo).includes(r))return Lre(r,t,n);if(Object.keys(ke.AptosChainInfo).includes(r))return Ure(r,t,n);if(Object.keys(ke.SolanaChainInfo).includes(r))return Vre(r,t,n);if(Object.keys(gv).includes(r))return Wre(r,t,n)}ke.getChainExternalUrl=Hre;function Gre(e,t,n){if(!e||!t||!n)return;let r=ke.EthChainInfo[e];if(r&&r.blockscoutUrl)return`${r.blockscoutUrl}/${n}/${t}`}ke.getChainBlockscoutUrl=Gre;function Af(e,t){let n="https://sentio.xyz/chains/chain-unknown.webp";return e?t&&e?.darkIcon?e.darkIcon:e?.lightIcon?e.lightIcon:n:n}function zre(e,t){if(!e)return;let n=e.toString();return Object.keys(ke.EthChainInfo).includes(n)?Af(ke.EthChainInfo[n],t):Object.keys(ke.BTCChainInfo).includes(n)?Af(ke.BTCChainInfo[n],t):Object.keys(ke.AptosChainInfo).includes(n)?Af(ke.AptosChainInfo[n],t):Object.keys(ke.SolanaChainInfo).includes(n)?Af(ke.SolanaChainInfo[n],t):Object.keys(gv).includes(n)?Af(gv[n],t):Af()}ke.getChainLogo=zre});var L7=m(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getChainScanUrl=Fr.getChainName=Fr.CHAIN_MAP=void 0;var nm=mv(),Qre=bN();Fr.CHAIN_MAP={[nm.ChainId.APTOS_MOVEMENT_MAINNET]:"Movement Mainnet",[nm.ChainId.APTOS_MOVEMENT_TESTNET]:"Movement Testnet",[nm.ChainId.BTC_MAINNET]:"Bitcoin Mainnet",[nm.ChainId.BTC_TESTNET]:"Bitcoin Testnet"};for(let[e,t]of Object.entries(nm.ChainId)){if(Fr.CHAIN_MAP[t])continue;let n=Qre.EthChainInfo[t];if(n){Fr.CHAIN_MAP[t]=n.name;continue}let r=e.split("_");Fr.CHAIN_MAP[t]=r.map((i,a)=>i[0]+i.slice(1).toLowerCase()).join(" ")}function M7(e){if(typeof e=="number"&&(e=e.toString()),e){let t=Fr.CHAIN_MAP[e];if(t)return t}return e||""}Fr.getChainName=M7;function Kre(e,t,n){let r=M7(e);if(r==="Ethereum")return n==="block"?`https://etherscan.io/block/${t}`:n==="address"?`https://etherscan.io/address/${t}`:`https://etherscan.io/tx/${t}`;if(r==="Polygon")return n==="block"?`https://polygonscan.com/block/${t}`:n==="address"?`https://polygonscan.com/address/${t}`:`https://polygonscan.com/tx/${t}`;if(r.startsWith("Aptos ")){let i="?network=mainnet";return r.includes("Testnet")?i="?network=testnet":r.includes("Devnet")&&(i="?network=devnet"),n==="block"?`https://explorer.aptoslabs.com/block/${t}/${i}`:n==="address"?`https://explorer.aptoslabs.com/account/${t}/${i}`:`https://explorer.aptoslabs.com/txn/${t}/${i}`}if(r.startsWith("Solana "))return n==="block"?`https://explorer.solana.com/block/${t}`:n==="address"?`https://explorer.solana.com/address/${t}`:`https://explorer.solana.io/tx/${t}`;if(r.startsWith("Sui "))return n==="block"?`https://suivision.xyz/checkpoint/${t}`:n==="address"?`https://suivision.xyz/account/${t}`:`https://suivision.xyz/txblock/${t}`}Fr.getChainScanUrl=Kre});var F7=m(za=>{"use strict";var Zre=za&&za.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),TN=za&&za.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Zre(t,e,n)};Object.defineProperty(za,"__esModule",{value:!0});TN(mv(),za);TN(bN(),za);TN(L7(),za)});var He=m(_v=>{"use strict";Object.defineProperty(_v,"__esModule",{value:!0});_v.isFunction=void 0;function aie(e){return typeof e=="function"}_v.isFunction=aie});var es=m(Av=>{"use strict";Object.defineProperty(Av,"__esModule",{value:!0});Av.createErrorClass=void 0;function oie(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}Av.createErrorClass=oie});var xN=m(Nv=>{"use strict";Object.defineProperty(Nv,"__esModule",{value:!0});Nv.UnsubscriptionError=void 0;var sie=es();Nv.UnsubscriptionError=sie.createErrorClass(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
23
- `+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
24
- `):"",this.name="UnsubscriptionError",this.errors=n}})});var Ka=m(Iv=>{"use strict";Object.defineProperty(Iv,"__esModule",{value:!0});Iv.arrRemove=void 0;function uie(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}Iv.arrRemove=uie});var gr=m(Kn=>{"use strict";var e8=Kn&&Kn.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},t8=Kn&&Kn.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n8=Kn&&Kn.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.isSubscription=Kn.EMPTY_SUBSCRIPTION=Kn.Subscription=void 0;var om=He(),BN=xN(),r8=Ka(),DN=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,i,a;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=e8(o),u=s.next();!u.done;u=s.next()){var l=u.value;l.remove(this)}}catch(p){t={error:p}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else o.remove(this);var c=this.initialTeardown;if(om.isFunction(c))try{c()}catch(p){a=p instanceof BN.UnsubscriptionError?p.errors:[p]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var f=e8(d),h=f.next();!h.done;h=f.next()){var g=h.value;try{i8(g)}catch(p){a=a??[],p instanceof BN.UnsubscriptionError?a=n8(n8([],t8(a)),t8(p.errors)):a.push(p)}}}catch(p){r={error:p}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}if(a)throw new BN.UnsubscriptionError(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)i8(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&r8.arrRemove(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&r8.arrRemove(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();Kn.Subscription=DN;Kn.EMPTY_SUBSCRIPTION=DN.EMPTY;function lie(e){return e instanceof DN||e&&"closed"in e&&om.isFunction(e.remove)&&om.isFunction(e.add)&&om.isFunction(e.unsubscribe)}Kn.isSubscription=lie;function i8(e){om.isFunction(e)?e():e.unsubscribe()}});var wf=m(Ov=>{"use strict";Object.defineProperty(Ov,"__esModule",{value:!0});Ov.config=void 0;Ov.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var MN=m(ca=>{"use strict";var a8=ca&&ca.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},o8=ca&&ca.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(ca,"__esModule",{value:!0});ca.timeoutProvider=void 0;ca.timeoutProvider={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=ca.timeoutProvider.delegate;return i?.setTimeout?i.setTimeout.apply(i,o8([e,t],a8(n))):setTimeout.apply(void 0,o8([e,t],a8(n)))},clearTimeout:function(e){var t=ca.timeoutProvider.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0}});var LN=m(Rv=>{"use strict";Object.defineProperty(Rv,"__esModule",{value:!0});Rv.reportUnhandledError=void 0;var cie=wf(),die=MN();function fie(e){die.timeoutProvider.setTimeout(function(){var t=cie.config.onUnhandledError;if(t)t(e);else throw e})}Rv.reportUnhandledError=fie});var an=m(Pv=>{"use strict";Object.defineProperty(Pv,"__esModule",{value:!0});Pv.noop=void 0;function hie(){}Pv.noop=hie});var s8=m(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.createNotification=da.nextNotification=da.errorNotification=da.COMPLETE_NOTIFICATION=void 0;da.COMPLETE_NOTIFICATION=function(){return wv("C",void 0,void 0)}();function pie(e){return wv("E",void 0,e)}da.errorNotification=pie;function mie(e){return wv("N",e,void 0)}da.nextNotification=mie;function wv(e,t,n){return{kind:e,value:t,error:n}}da.createNotification=wv});var xv=m(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.captureError=xf.errorContext=void 0;var u8=wf(),Eu=null;function gie(e){if(u8.config.useDeprecatedSynchronousErrorHandling){var t=!Eu;if(t&&(Eu={errorThrown:!1,error:null}),e(),t){var n=Eu,r=n.errorThrown,i=n.error;if(Eu=null,r)throw i}}else e()}xf.errorContext=gie;function yie(e){u8.config.useDeprecatedSynchronousErrorHandling&&Eu&&(Eu.errorThrown=!0,Eu.error=e)}xf.captureError=yie});var Bf=m(Pi=>{"use strict";var d8=Pi&&Pi.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Pi,"__esModule",{value:!0});Pi.EMPTY_OBSERVER=Pi.SafeSubscriber=Pi.Subscriber=void 0;var vie=He(),l8=gr(),VN=wf(),Sie=LN(),c8=an(),FN=s8(),bie=MN(),Tie=xv(),f8=function(e){d8(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,l8.isSubscription(n)&&n.add(r)):r.destination=Pi.EMPTY_OBSERVER,r}return t.create=function(n,r,i){return new h8(n,r,i)},t.prototype.next=function(n){this.isStopped?qN(FN.nextNotification(n),this):this._next(n)},t.prototype.error=function(n){this.isStopped?qN(FN.errorNotification(n),this):(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped?qN(FN.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(l8.Subscription);Pi.Subscriber=f8;var Eie=Function.prototype.bind;function UN(e,t){return Eie.call(e,t)}var Cie=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){Bv(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){Bv(r)}else Bv(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){Bv(n)}},e}(),h8=function(e){d8(t,e);function t(n,r,i){var a=e.call(this)||this,o;if(vie.isFunction(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;a&&VN.config.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&UN(n.next,s),error:n.error&&UN(n.error,s),complete:n.complete&&UN(n.complete,s)}):o=n}return a.destination=new Cie(o),a}return t}(f8);Pi.SafeSubscriber=h8;function Bv(e){VN.config.useDeprecatedSynchronousErrorHandling?Tie.captureError(e):Sie.reportUnhandledError(e)}function kie(e){throw e}function qN(e,t){var n=VN.config.onStoppedNotification;n&&bie.timeoutProvider.setTimeout(function(){return n(e,t)})}Pi.EMPTY_OBSERVER={closed:!0,next:c8.noop,error:kie,complete:c8.noop}});var sm=m(Dv=>{"use strict";Object.defineProperty(Dv,"__esModule",{value:!0});Dv.observable=void 0;Dv.observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}()});var on=m(Mv=>{"use strict";Object.defineProperty(Mv,"__esModule",{value:!0});Mv.identity=void 0;function _ie(e){return e}Mv.identity=_ie});var um=m(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.pipeFromArray=Df.pipe=void 0;var Aie=on();function Nie(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p8(e)}Df.pipe=Nie;function p8(e){return e.length===0?Aie.identity:e.length===1?e[0]:function(n){return e.reduce(function(r,i){return i(r)},n)}}Df.pipeFromArray=p8});var ze=m(Lv=>{"use strict";Object.defineProperty(Lv,"__esModule",{value:!0});Lv.Observable=void 0;var WN=Bf(),Iie=gr(),Oie=sm(),Rie=um(),Pie=wf(),JN=He(),wie=xv(),xie=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,a=Die(t)?t:new WN.SafeSubscriber(t,n,r);return wie.errorContext(function(){var o=i,s=o.operator,u=o.source;a.add(s?s.call(a,u):u?i._subscribe(a):i._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=m8(n),new n(function(i,a){var o=new WN.SafeSubscriber({next:function(s){try{t(s)}catch(u){a(u),o.unsubscribe()}},error:a,complete:i});r.subscribe(o)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[Oie.observable]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Rie.pipeFromArray(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=m8(t),new t(function(r,i){var a;n.subscribe(function(o){return a=o},function(o){return i(o)},function(){return r(a)})})},e.create=function(t){return new e(t)},e}();Lv.Observable=xie;function m8(e){var t;return(t=e??Pie.config.Promise)!==null&&t!==void 0?t:Promise}function Bie(e){return e&&JN.isFunction(e.next)&&JN.isFunction(e.error)&&JN.isFunction(e.complete)}function Die(e){return e&&e instanceof WN.Subscriber||Bie(e)&&Iie.isSubscription(e)}});var Z=m(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.operate=Mf.hasLift=void 0;var Mie=He();function g8(e){return Mie.isFunction(e?.lift)}Mf.hasLift=g8;function Lie(e){return function(t){if(g8(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}Mf.operate=Lie});var ie=m(ts=>{"use strict";var Fie=ts&&ts.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(ts,"__esModule",{value:!0});ts.OperatorSubscriber=ts.createOperatorSubscriber=void 0;var Uie=Bf();function qie(e,t,n,r,i){return new y8(e,t,n,r,i)}ts.createOperatorSubscriber=qie;var y8=function(e){Fie(t,e);function t(n,r,i,a,o,s){var u=e.call(this,n)||this;return u.onFinalize=o,u.shouldUnsubscribe=s,u._next=r?function(l){try{r(l)}catch(c){n.error(c)}}:e.prototype._next,u._error=a?function(l){try{a(l)}catch(c){n.error(c)}finally{this.unsubscribe()}}:e.prototype._error,u._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:e.prototype._complete,u}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t}(Uie.Subscriber);ts.OperatorSubscriber=y8});var HN=m(Fv=>{"use strict";Object.defineProperty(Fv,"__esModule",{value:!0});Fv.refCount=void 0;var Vie=Z(),Jie=ie();function Wie(){return Vie.operate(function(e,t){var n=null;e._refCount++;var r=Jie.createOperatorSubscriber(t,void 0,void 0,void 0,function(){if(!e||e._refCount<=0||0<--e._refCount){n=null;return}var i=e._connection,a=n;n=null,i&&(!a||i===a)&&i.unsubscribe(),t.unsubscribe()});e.subscribe(r),r.closed||(n=e.connect())})}Fv.refCount=Wie});var lm=m(Lf=>{"use strict";var Hie=Lf&&Lf.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Lf,"__esModule",{value:!0});Lf.ConnectableObservable=void 0;var Gie=ze(),v8=gr(),zie=HN(),Qie=ie(),Kie=Z(),Zie=function(e){Hie(t,e);function t(n,r){var i=e.call(this)||this;return i.source=n,i.subjectFactory=r,i._subject=null,i._refCount=0,i._connection=null,Kie.hasLift(n)&&(i.lift=n.lift),i}return t.prototype._subscribe=function(n){return this.getSubject().subscribe(n)},t.prototype.getSubject=function(){var n=this._subject;return(!n||n.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var n=this._connection;this._subject=this._connection=null,n?.unsubscribe()},t.prototype.connect=function(){var n=this,r=this._connection;if(!r){r=this._connection=new v8.Subscription;var i=this.getSubject();r.add(this.source.subscribe(Qie.createOperatorSubscriber(i,void 0,function(){n._teardown(),i.complete()},function(a){n._teardown(),i.error(a)},function(){return n._teardown()}))),r.closed&&(this._connection=null,r=v8.Subscription.EMPTY)}return r},t.prototype.refCount=function(){return zie.refCount()(this)},t}(Gie.Observable);Lf.ConnectableObservable=Zie});var S8=m(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.performanceTimestampProvider=void 0;cm.performanceTimestampProvider={now:function(){return(cm.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}});var GN=m(wi=>{"use strict";var b8=wi&&wi.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},T8=wi&&wi.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(wi,"__esModule",{value:!0});wi.animationFrameProvider=void 0;var Yie=gr();wi.animationFrameProvider={schedule:function(e){var t=requestAnimationFrame,n=cancelAnimationFrame,r=wi.animationFrameProvider.delegate;r&&(t=r.requestAnimationFrame,n=r.cancelAnimationFrame);var i=t(function(a){n=void 0,e(a)});return new Yie.Subscription(function(){return n?.(i)})},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=wi.animationFrameProvider.delegate;return(n?.requestAnimationFrame||requestAnimationFrame).apply(void 0,T8([],b8(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=wi.animationFrameProvider.delegate;return(n?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,T8([],b8(e)))},delegate:void 0}});var k8=m(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});Uv.animationFrames=void 0;var Xie=ze(),$ie=S8(),E8=GN();function jie(e){return e?C8(e):eae}Uv.animationFrames=jie;function C8(e){return new Xie.Observable(function(t){var n=e||$ie.performanceTimestampProvider,r=n.now(),i=0,a=function(){t.closed||(i=E8.animationFrameProvider.requestAnimationFrame(function(o){i=0;var s=n.now();t.next({timestamp:e?s:o,elapsed:s-r}),a()}))};return a(),function(){i&&E8.animationFrameProvider.cancelAnimationFrame(i)}})}var eae=C8()});var zN=m(qv=>{"use strict";Object.defineProperty(qv,"__esModule",{value:!0});qv.ObjectUnsubscribedError=void 0;var tae=es();qv.ObjectUnsubscribedError=tae.createErrorClass(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})});var sn=m(fa=>{"use strict";var A8=fa&&fa.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nae=fa&&fa.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(fa,"__esModule",{value:!0});fa.AnonymousSubject=fa.Subject=void 0;var _8=ze(),KN=gr(),rae=zN(),iae=Ka(),QN=xv(),N8=function(e){A8(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new ZN(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new rae.ObjectUnsubscribedError},t.prototype.next=function(n){var r=this;QN.errorContext(function(){var i,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=nae(r.currentObservers),s=o.next();!s.done;s=o.next()){var u=s.value;u.next(n)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}}})},t.prototype.error=function(n){var r=this;QN.errorContext(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},t.prototype.complete=function(){var n=this;QN.errorContext(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,i=this,a=i.hasError,o=i.isStopped,s=i.observers;return a||o?KN.EMPTY_SUBSCRIPTION:(this.currentObservers=null,s.push(n),new KN.Subscription(function(){r.currentObservers=null,iae.arrRemove(s,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,a=r.thrownError,o=r.isStopped;i?n.error(a):o&&n.complete()},t.prototype.asObservable=function(){var n=new _8.Observable;return n.source=this,n},t.create=function(n,r){return new ZN(n,r)},t}(_8.Observable);fa.Subject=N8;var ZN=function(e){A8(t,e);function t(n,r){var i=e.call(this)||this;return i.destination=n,i.source=r,i}return t.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},t.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},t.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},t.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:KN.EMPTY_SUBSCRIPTION},t}(N8);fa.AnonymousSubject=ZN});var YN=m(Ff=>{"use strict";var aae=Ff&&Ff.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Ff,"__esModule",{value:!0});Ff.BehaviorSubject=void 0;var oae=sn(),sae=function(e){aae(t,e);function t(n){var r=e.call(this)||this;return r._value=n,r}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(n){var r=e.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},t.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,a=n._value;if(r)throw i;return this._throwIfClosed(),a},t.prototype.next=function(n){e.prototype.next.call(this,this._value=n)},t}(oae.Subject);Ff.BehaviorSubject=sae});var Vv=m(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.dateTimestampProvider=void 0;dm.dateTimestampProvider={now:function(){return(dm.dateTimestampProvider.delegate||Date).now()},delegate:void 0}});var Jv=m(Uf=>{"use strict";var uae=Uf&&Uf.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Uf,"__esModule",{value:!0});Uf.ReplaySubject=void 0;var lae=sn(),cae=Vv(),dae=function(e){uae(t,e);function t(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=cae.dateTimestampProvider);var a=e.call(this)||this;return a._bufferSize=n,a._windowTime=r,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=r===1/0,a._bufferSize=Math.max(1,n),a._windowTime=Math.max(1,r),a}return t.prototype.next=function(n){var r=this,i=r.isStopped,a=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,u=r._windowTime;i||(a.push(n),!o&&a.push(s.now()+u)),this._trimBuffer(),e.prototype.next.call(this,n)},t.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,a=i._infiniteTimeWindow,o=i._buffer,s=o.slice(),u=0;u<s.length&&!n.closed;u+=a?1:2)n.next(s[u]);return this._checkFinalizedStatuses(n),r},t.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,a=n._buffer,o=n._infiniteTimeWindow,s=(o?1:2)*r;if(r<1/0&&s<a.length&&a.splice(0,a.length-s),!o){for(var u=i.now(),l=0,c=1;c<a.length&&a[c]<=u;c+=2)l=c;l&&a.splice(0,l+1)}},t}(lae.Subject);Uf.ReplaySubject=dae});var Wv=m(qf=>{"use strict";var fae=qf&&qf.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(qf,"__esModule",{value:!0});qf.AsyncSubject=void 0;var hae=sn(),pae=function(e){fae(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n._value=null,n._hasValue=!1,n._isComplete=!1,n}return t.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,a=r._hasValue,o=r._value,s=r.thrownError,u=r.isStopped,l=r._isComplete;i?n.error(s):(u||l)&&(a&&n.next(o),n.complete())},t.prototype.next=function(n){this.isStopped||(this._value=n,this._hasValue=!0)},t.prototype.complete=function(){var n=this,r=n._hasValue,i=n._value,a=n._isComplete;a||(this._isComplete=!0,r&&e.prototype.next.call(this,i),e.prototype.complete.call(this))},t}(hae.Subject);qf.AsyncSubject=pae});var I8=m(Vf=>{"use strict";var mae=Vf&&Vf.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Vf,"__esModule",{value:!0});Vf.Action=void 0;var gae=gr(),yae=function(e){mae(t,e);function t(n,r){return e.call(this)||this}return t.prototype.schedule=function(n,r){return r===void 0&&(r=0),this},t}(gae.Subscription);Vf.Action=yae});var P8=m(ha=>{"use strict";var O8=ha&&ha.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},R8=ha&&ha.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(ha,"__esModule",{value:!0});ha.intervalProvider=void 0;ha.intervalProvider={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=ha.intervalProvider.delegate;return i?.setInterval?i.setInterval.apply(i,R8([e,t],O8(n))):setInterval.apply(void 0,R8([e,t],O8(n)))},clearInterval:function(e){var t=ha.intervalProvider.delegate;return(t?.clearInterval||clearInterval)(e)},delegate:void 0}});var Wf=m(Jf=>{"use strict";var vae=Jf&&Jf.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Jf,"__esModule",{value:!0});Jf.AsyncAction=void 0;var Sae=I8(),w8=P8(),bae=Ka(),Tae=function(e){vae(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return t.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var a=this.id,o=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(o,a,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,r),this},t.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),w8.intervalProvider.setInterval(n.flush.bind(n,this),i)},t.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&w8.intervalProvider.clearInterval(r)},t.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(n,r){var i=!1,a;try{this.work(n)}catch(o){i=!0,a=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),a},t.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,a=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,bae.arrRemove(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Sae.Action);Jf.AsyncAction=Tae});var B8=m(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.TestTools=Hf.Immediate=void 0;var Eae=1,XN,Hv={};function x8(e){return e in Hv?(delete Hv[e],!0):!1}Hf.Immediate={setImmediate:function(e){var t=Eae++;return Hv[t]=!0,XN||(XN=Promise.resolve()),XN.then(function(){return x8(t)&&e()}),t},clearImmediate:function(e){x8(e)}};Hf.TestTools={pending:function(){return Object.keys(Hv).length}}});var M8=m(pa=>{"use strict";var Cae=pa&&pa.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},kae=pa&&pa.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(pa,"__esModule",{value:!0});pa.immediateProvider=void 0;var D8=B8(),_ae=D8.Immediate.setImmediate,Aae=D8.Immediate.clearImmediate;pa.immediateProvider={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=pa.immediateProvider.delegate;return(n?.setImmediate||_ae).apply(void 0,kae([],Cae(e)))},clearImmediate:function(e){var t=pa.immediateProvider.delegate;return(t?.clearImmediate||Aae)(e)},delegate:void 0}});var F8=m(Gf=>{"use strict";var Nae=Gf&&Gf.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Gf,"__esModule",{value:!0});Gf.AsapAction=void 0;var Iae=Wf(),L8=M8(),Oae=function(e){Nae(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return t.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!==null&&i>0?e.prototype.requestAsyncId.call(this,n,r,i):(n.actions.push(this),n._scheduled||(n._scheduled=L8.immediateProvider.setImmediate(n.flush.bind(n,void 0))))},t.prototype.recycleAsyncId=function(n,r,i){var a;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,n,r,i);var o=n.actions;r!=null&&((a=o[o.length-1])===null||a===void 0?void 0:a.id)!==r&&(L8.immediateProvider.clearImmediate(r),n._scheduled===r&&(n._scheduled=void 0))},t}(Iae.AsyncAction);Gf.AsapAction=Oae});var $N=m(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});Gv.Scheduler=void 0;var Rae=Vv(),Pae=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(t,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,t).schedule(r,n)},e.now=Rae.dateTimestampProvider.now,e}();Gv.Scheduler=Pae});var Qf=m(zf=>{"use strict";var wae=zf&&zf.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(zf,"__esModule",{value:!0});zf.AsyncScheduler=void 0;var U8=$N(),xae=function(e){wae(t,e);function t(n,r){r===void 0&&(r=U8.Scheduler.now);var i=e.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},t}(U8.Scheduler);zf.AsyncScheduler=xae});var q8=m(Kf=>{"use strict";var Bae=Kf&&Kf.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Kf,"__esModule",{value:!0});Kf.AsapScheduler=void 0;var Dae=Qf(),Mae=function(e){Bae(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(n){this._active=!0;var r=this._scheduled;this._scheduled=void 0;var i=this.actions,a;n=n||i.shift();do if(a=n.execute(n.state,n.delay))break;while((n=i[0])&&n.id===r&&i.shift());if(this._active=!1,a){for(;(n=i[0])&&n.id===r&&i.shift();)n.unsubscribe();throw a}},t}(Dae.AsyncScheduler);Kf.AsapScheduler=Mae});var V8=m(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.asap=Cu.asapScheduler=void 0;var Lae=F8(),Fae=q8();Cu.asapScheduler=new Fae.AsapScheduler(Lae.AsapAction);Cu.asap=Cu.asapScheduler});var Zn=m(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.async=ku.asyncScheduler=void 0;var Uae=Wf(),qae=Qf();ku.asyncScheduler=new qae.AsyncScheduler(Uae.AsyncAction);ku.async=ku.asyncScheduler});var J8=m(Zf=>{"use strict";var Vae=Zf&&Zf.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Zf,"__esModule",{value:!0});Zf.QueueAction=void 0;var Jae=Wf(),Wae=function(e){Vae(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return t.prototype.schedule=function(n,r){return r===void 0&&(r=0),r>0?e.prototype.schedule.call(this,n,r):(this.delay=r,this.state=n,this.scheduler.flush(this),this)},t.prototype.execute=function(n,r){return r>0||this.closed?e.prototype.execute.call(this,n,r):this._execute(n,r)},t.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0?e.prototype.requestAsyncId.call(this,n,r,i):(n.flush(this),0)},t}(Jae.AsyncAction);Zf.QueueAction=Wae});var W8=m(Yf=>{"use strict";var Hae=Yf&&Yf.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Yf,"__esModule",{value:!0});Yf.QueueScheduler=void 0;var Gae=Qf(),zae=function(e){Hae(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Gae.AsyncScheduler);Yf.QueueScheduler=zae});var H8=m(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.queue=_u.queueScheduler=void 0;var Qae=J8(),Kae=W8();_u.queueScheduler=new Kae.QueueScheduler(Qae.QueueAction);_u.queue=_u.queueScheduler});var z8=m(Xf=>{"use strict";var Zae=Xf&&Xf.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Xf,"__esModule",{value:!0});Xf.AnimationFrameAction=void 0;var Yae=Wf(),G8=GN(),Xae=function(e){Zae(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return t.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!==null&&i>0?e.prototype.requestAsyncId.call(this,n,r,i):(n.actions.push(this),n._scheduled||(n._scheduled=G8.animationFrameProvider.requestAnimationFrame(function(){return n.flush(void 0)})))},t.prototype.recycleAsyncId=function(n,r,i){var a;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,n,r,i);var o=n.actions;r!=null&&((a=o[o.length-1])===null||a===void 0?void 0:a.id)!==r&&(G8.animationFrameProvider.cancelAnimationFrame(r),n._scheduled=void 0)},t}(Yae.AsyncAction);Xf.AnimationFrameAction=Xae});var Q8=m($f=>{"use strict";var $ae=$f&&$f.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty($f,"__esModule",{value:!0});$f.AnimationFrameScheduler=void 0;var jae=Qf(),eoe=function(e){$ae(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(n){this._active=!0;var r=this._scheduled;this._scheduled=void 0;var i=this.actions,a;n=n||i.shift();do if(a=n.execute(n.state,n.delay))break;while((n=i[0])&&n.id===r&&i.shift());if(this._active=!1,a){for(;(n=i[0])&&n.id===r&&i.shift();)n.unsubscribe();throw a}},t}(jae.AsyncScheduler);$f.AnimationFrameScheduler=eoe});var K8=m(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.animationFrame=Au.animationFrameScheduler=void 0;var toe=z8(),noe=Q8();Au.animationFrameScheduler=new noe.AnimationFrameScheduler(toe.AnimationFrameAction);Au.animationFrame=Au.animationFrameScheduler});var X8=m(ns=>{"use strict";var Z8=ns&&ns.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(ns,"__esModule",{value:!0});ns.VirtualAction=ns.VirtualTimeScheduler=void 0;var roe=Wf(),ioe=gr(),aoe=Qf(),ooe=function(e){Z8(t,e);function t(n,r){n===void 0&&(n=Y8),r===void 0&&(r=1/0);var i=e.call(this,n,function(){return i.frame})||this;return i.maxFrames=r,i.frame=0,i.index=-1,i}return t.prototype.flush=function(){for(var n=this,r=n.actions,i=n.maxFrames,a,o;(o=r[0])&&o.delay<=i&&(r.shift(),this.frame=o.delay,!(a=o.execute(o.state,o.delay))););if(a){for(;o=r.shift();)o.unsubscribe();throw a}},t.frameTimeFactor=10,t}(aoe.AsyncScheduler);ns.VirtualTimeScheduler=ooe;var Y8=function(e){Z8(t,e);function t(n,r,i){i===void 0&&(i=n.index+=1);var a=e.call(this,n,r)||this;return a.scheduler=n,a.work=r,a.index=i,a.active=!0,a.index=n.index=i,a}return t.prototype.schedule=function(n,r){if(r===void 0&&(r=0),Number.isFinite(r)){if(!this.id)return e.prototype.schedule.call(this,n,r);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}else return ioe.Subscription.EMPTY},t.prototype.requestAsyncId=function(n,r,i){i===void 0&&(i=0),this.delay=n.frame+i;var a=n.actions;return a.push(this),a.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(n,r,i){i===void 0&&(i=0)},t.prototype._execute=function(n,r){if(this.active===!0)return e.prototype._execute.call(this,n,r)},t.sortActions=function(n,r){return n.delay===r.delay?n.index===r.index?0:n.index>r.index?1:-1:n.delay>r.delay?1:-1},t}(roe.AsyncAction);ns.VirtualAction=Y8});var xi=m(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.empty=Nu.EMPTY=void 0;var $8=ze();Nu.EMPTY=new $8.Observable(function(e){return e.complete()});function soe(e){return e?uoe(e):Nu.EMPTY}Nu.empty=soe;function uoe(e){return new $8.Observable(function(t){return e.schedule(function(){return t.complete()})})}});var fm=m(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0});zv.isScheduler=void 0;var loe=He();function coe(e){return e&&loe.isFunction(e.schedule)}zv.isScheduler=coe});var Yn=m(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.popNumber=rs.popScheduler=rs.popResultSelector=void 0;var doe=He(),foe=fm();function jN(e){return e[e.length-1]}function hoe(e){return doe.isFunction(jN(e))?e.pop():void 0}rs.popResultSelector=hoe;function poe(e){return foe.isScheduler(jN(e))?e.pop():void 0}rs.popScheduler=poe;function moe(e,t){return typeof jN(e)=="number"?e.pop():t}rs.popNumber=moe});var Kv=m(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0});Qv.isArrayLike=void 0;Qv.isArrayLike=function(e){return e&&typeof e.length=="number"&&typeof e!="function"}});var eI=m(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});Zv.isPromise=void 0;var goe=He();function yoe(e){return goe.isFunction(e?.then)}Zv.isPromise=yoe});var tI=m(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0});Yv.isInteropObservable=void 0;var voe=sm(),Soe=He();function boe(e){return Soe.isFunction(e[voe.observable])}Yv.isInteropObservable=boe});var nI=m(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});Xv.isAsyncIterable=void 0;var Toe=He();function Eoe(e){return Symbol.asyncIterator&&Toe.isFunction(e?.[Symbol.asyncIterator])}Xv.isAsyncIterable=Eoe});var rI=m($v=>{"use strict";Object.defineProperty($v,"__esModule",{value:!0});$v.createInvalidObservableTypeError=void 0;function Coe(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}$v.createInvalidObservableTypeError=Coe});var iI=m(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});jf.iterator=jf.getSymbolIterator=void 0;function j8(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}jf.getSymbolIterator=j8;jf.iterator=j8()});var aI=m(jv=>{"use strict";Object.defineProperty(jv,"__esModule",{value:!0});jv.isIterable=void 0;var koe=iI(),_oe=He();function Aoe(e){return _oe.isFunction(e?.[koe.iterator])}jv.isIterable=Aoe});var eS=m(Ur=>{"use strict";var Noe=Ur&&Ur.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},eh=Ur&&Ur.__await||function(e){return this instanceof eh?(this.v=e,this):new eh(e)},Ioe=Ur&&Ur.__asyncGenerator||function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(f){r[f]&&(i[f]=function(h){return new Promise(function(g,p){a.push([f,h,g,p])>1||s(f,h)})})}function s(f,h){try{u(r[f](h))}catch(g){d(a[0][3],g)}}function u(f){f.value instanceof eh?Promise.resolve(f.value.v).then(l,c):d(a[0][2],f)}function l(f){s("next",f)}function c(f){s("throw",f)}function d(f,h){f(h),a.shift(),a.length&&s(a[0][0],a[0][1])}};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.isReadableStreamLike=Ur.readableStreamLikeToAsyncGenerator=void 0;var Ooe=He();function Roe(e){return Ioe(this,arguments,function(){var n,r,i,a;return Noe(this,function(o){switch(o.label){case 0:n=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,eh(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,eh(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,eh(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}Ur.readableStreamLikeToAsyncGenerator=Roe;function Poe(e){return Ooe.isFunction(e?.getReader)}Ur.isReadableStreamLike=Poe});var ve=m(dt=>{"use strict";var woe=dt&&dt.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(c){try{l(r.next(c))}catch(d){o(d)}}function u(c){try{l(r.throw(c))}catch(d){o(d)}}function l(c){c.done?a(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},xoe=dt&&dt.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Boe=dt&&dt.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof oI=="function"?oI(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(o){return new Promise(function(s,u){o=e[a](o),i(s,u,o.done,o.value)})}}function i(a,o,s,u){Promise.resolve(u).then(function(l){a({value:l,done:s})},o)}},oI=dt&&dt.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(dt,"__esModule",{value:!0});dt.fromReadableStreamLike=dt.fromAsyncIterable=dt.fromIterable=dt.fromPromise=dt.fromArrayLike=dt.fromInteropObservable=dt.innerFrom=void 0;var Doe=Kv(),Moe=eI(),th=ze(),Loe=tI(),Foe=nI(),Uoe=rI(),qoe=aI(),eq=eS(),Voe=He(),Joe=LN(),Woe=sm();function Hoe(e){if(e instanceof th.Observable)return e;if(e!=null){if(Loe.isInteropObservable(e))return tq(e);if(Doe.isArrayLike(e))return nq(e);if(Moe.isPromise(e))return rq(e);if(Foe.isAsyncIterable(e))return sI(e);if(qoe.isIterable(e))return iq(e);if(eq.isReadableStreamLike(e))return aq(e)}throw Uoe.createInvalidObservableTypeError(e)}dt.innerFrom=Hoe;function tq(e){return new th.Observable(function(t){var n=e[Woe.observable]();if(Voe.isFunction(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}dt.fromInteropObservable=tq;function nq(e){return new th.Observable(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}dt.fromArrayLike=nq;function rq(e){return new th.Observable(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,Joe.reportUnhandledError)})}dt.fromPromise=rq;function iq(e){return new th.Observable(function(t){var n,r;try{for(var i=oI(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}dt.fromIterable=iq;function sI(e){return new th.Observable(function(t){Goe(e,t).catch(function(n){return t.error(n)})})}dt.fromAsyncIterable=sI;function aq(e){return sI(eq.readableStreamLikeToAsyncGenerator(e))}dt.fromReadableStreamLike=aq;function Goe(e,t){var n,r,i,a;return woe(this,void 0,void 0,function(){var o,s;return xoe(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=Boe(e),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}});var Za=m(tS=>{"use strict";Object.defineProperty(tS,"__esModule",{value:!0});tS.executeSchedule=void 0;function zoe(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}tS.executeSchedule=zoe});var hm=m(nS=>{"use strict";Object.defineProperty(nS,"__esModule",{value:!0});nS.observeOn=void 0;var uI=Za(),Qoe=Z(),Koe=ie();function Zoe(e,t){return t===void 0&&(t=0),Qoe.operate(function(n,r){n.subscribe(Koe.createOperatorSubscriber(r,function(i){return uI.executeSchedule(r,e,function(){return r.next(i)},t)},function(){return uI.executeSchedule(r,e,function(){return r.complete()},t)},function(i){return uI.executeSchedule(r,e,function(){return r.error(i)},t)}))})}nS.observeOn=Zoe});var pm=m(rS=>{"use strict";Object.defineProperty(rS,"__esModule",{value:!0});rS.subscribeOn=void 0;var Yoe=Z();function Xoe(e,t){return t===void 0&&(t=0),Yoe.operate(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}rS.subscribeOn=Xoe});var oq=m(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});iS.scheduleObservable=void 0;var $oe=ve(),joe=hm(),ese=pm();function tse(e,t){return $oe.innerFrom(e).pipe(ese.subscribeOn(t),joe.observeOn(t))}iS.scheduleObservable=tse});var sq=m(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});aS.schedulePromise=void 0;var nse=ve(),rse=hm(),ise=pm();function ase(e,t){return nse.innerFrom(e).pipe(ise.subscribeOn(t),rse.observeOn(t))}aS.schedulePromise=ase});var uq=m(oS=>{"use strict";Object.defineProperty(oS,"__esModule",{value:!0});oS.scheduleArray=void 0;var ose=ze();function sse(e,t){return new ose.Observable(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}oS.scheduleArray=sse});var lI=m(sS=>{"use strict";Object.defineProperty(sS,"__esModule",{value:!0});sS.scheduleIterable=void 0;var use=ze(),lse=iI(),cse=He(),lq=Za();function dse(e,t){return new use.Observable(function(n){var r;return lq.executeSchedule(n,t,function(){r=e[lse.iterator](),lq.executeSchedule(n,t,function(){var i,a,o;try{i=r.next(),a=i.value,o=i.done}catch(s){n.error(s);return}o?n.complete():n.next(a)},0,!0)}),function(){return cse.isFunction(r?.return)&&r.return()}})}sS.scheduleIterable=dse});var cI=m(uS=>{"use strict";Object.defineProperty(uS,"__esModule",{value:!0});uS.scheduleAsyncIterable=void 0;var fse=ze(),cq=Za();function hse(e,t){if(!e)throw new Error("Iterable cannot be null");return new fse.Observable(function(n){cq.executeSchedule(n,t,function(){var r=e[Symbol.asyncIterator]();cq.executeSchedule(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}uS.scheduleAsyncIterable=hse});var dq=m(lS=>{"use strict";Object.defineProperty(lS,"__esModule",{value:!0});lS.scheduleReadableStreamLike=void 0;var pse=cI(),mse=eS();function gse(e,t){return pse.scheduleAsyncIterable(mse.readableStreamLikeToAsyncGenerator(e),t)}lS.scheduleReadableStreamLike=gse});var dI=m(cS=>{"use strict";Object.defineProperty(cS,"__esModule",{value:!0});cS.scheduled=void 0;var yse=oq(),vse=sq(),Sse=uq(),bse=lI(),Tse=cI(),Ese=tI(),Cse=eI(),kse=Kv(),_se=aI(),Ase=nI(),Nse=rI(),Ise=eS(),Ose=dq();function Rse(e,t){if(e!=null){if(Ese.isInteropObservable(e))return yse.scheduleObservable(e,t);if(kse.isArrayLike(e))return Sse.scheduleArray(e,t);if(Cse.isPromise(e))return vse.schedulePromise(e,t);if(Ase.isAsyncIterable(e))return Tse.scheduleAsyncIterable(e,t);if(_se.isIterable(e))return bse.scheduleIterable(e,t);if(Ise.isReadableStreamLike(e))return Ose.scheduleReadableStreamLike(e,t)}throw Nse.createInvalidObservableTypeError(e)}cS.scheduled=Rse});var Ya=m(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});dS.from=void 0;var Pse=dI(),wse=ve();function xse(e,t){return t?Pse.scheduled(e,t):wse.innerFrom(e)}dS.from=xse});var hS=m(fS=>{"use strict";Object.defineProperty(fS,"__esModule",{value:!0});fS.of=void 0;var Bse=Yn(),Dse=Ya();function Mse(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Bse.popScheduler(e);return Dse.from(e,n)}fS.of=Mse});var fI=m(pS=>{"use strict";Object.defineProperty(pS,"__esModule",{value:!0});pS.throwError=void 0;var Lse=ze(),Fse=He();function Use(e,t){var n=Fse.isFunction(e)?e:function(){return e},r=function(i){return i.error(n())};return new Lse.Observable(t?function(i){return t.schedule(r,0,i)}:r)}pS.throwError=Use});var mS=m(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.observeNotification=Xa.Notification=Xa.NotificationKind=void 0;var qse=xi(),Vse=hS(),Jse=fI(),Wse=He(),Hse;(function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"})(Hse=Xa.NotificationKind||(Xa.NotificationKind={}));var Gse=function(){function e(t,n,r){this.kind=t,this.value=n,this.error=r,this.hasValue=t==="N"}return e.prototype.observe=function(t){return fq(this,t)},e.prototype.do=function(t,n,r){var i=this,a=i.kind,o=i.value,s=i.error;return a==="N"?t?.(o):a==="E"?n?.(s):r?.()},e.prototype.accept=function(t,n,r){var i;return Wse.isFunction((i=t)===null||i===void 0?void 0:i.next)?this.observe(t):this.do(t,n,r)},e.prototype.toObservable=function(){var t=this,n=t.kind,r=t.value,i=t.error,a=n==="N"?Vse.of(r):n==="E"?Jse.throwError(function(){return i}):n==="C"?qse.EMPTY:0;if(!a)throw new TypeError("Unexpected notification kind "+n);return a},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();Xa.Notification=Gse;function fq(e,t){var n,r,i,a=e,o=a.kind,s=a.value,u=a.error;if(typeof o!="string")throw new TypeError('Invalid notification, missing "kind"');o==="N"?(n=t.next)===null||n===void 0||n.call(t,s):o==="E"?(r=t.error)===null||r===void 0||r.call(t,u):(i=t.complete)===null||i===void 0||i.call(t)}Xa.observeNotification=fq});var pq=m(gS=>{"use strict";Object.defineProperty(gS,"__esModule",{value:!0});gS.isObservable=void 0;var zse=ze(),hq=He();function Qse(e){return!!e&&(e instanceof zse.Observable||hq.isFunction(e.lift)&&hq.isFunction(e.subscribe))}gS.isObservable=Qse});var is=m(yS=>{"use strict";Object.defineProperty(yS,"__esModule",{value:!0});yS.EmptyError=void 0;var Kse=es();yS.EmptyError=Kse.createErrorClass(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}})});var mq=m(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});vS.lastValueFrom=void 0;var Zse=is();function Yse(e,t){var n=typeof t=="object";return new Promise(function(r,i){var a=!1,o;e.subscribe({next:function(s){o=s,a=!0},error:i,complete:function(){a?r(o):n?r(t.defaultValue):i(new Zse.EmptyError)}})})}vS.lastValueFrom=Yse});var gq=m(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});SS.firstValueFrom=void 0;var Xse=is(),$se=Bf();function jse(e,t){var n=typeof t=="object";return new Promise(function(r,i){var a=new $se.SafeSubscriber({next:function(o){r(o),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new Xse.EmptyError)}});e.subscribe(a)})}SS.firstValueFrom=jse});var hI=m(bS=>{"use strict";Object.defineProperty(bS,"__esModule",{value:!0});bS.ArgumentOutOfRangeError=void 0;var eue=es();bS.ArgumentOutOfRangeError=eue.createErrorClass(function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})});var pI=m(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});TS.NotFoundError=void 0;var tue=es();TS.NotFoundError=tue.createErrorClass(function(e){return function(n){e(this),this.name="NotFoundError",this.message=n}})});var mI=m(ES=>{"use strict";Object.defineProperty(ES,"__esModule",{value:!0});ES.SequenceError=void 0;var nue=es();ES.SequenceError=nue.createErrorClass(function(e){return function(n){e(this),this.name="SequenceError",this.message=n}})});var kS=m(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});CS.isValidDate=void 0;function rue(e){return e instanceof Date&&!isNaN(e)}CS.isValidDate=rue});var _S=m(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.timeout=Iu.TimeoutError=void 0;var iue=Zn(),aue=kS(),oue=Z(),sue=ve(),uue=es(),lue=ie(),cue=Za();Iu.TimeoutError=uue.createErrorClass(function(e){return function(n){n===void 0&&(n=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=n}});function due(e,t){var n=aue.isValidDate(e)?{first:e}:typeof e=="number"?{each:e}:e,r=n.first,i=n.each,a=n.with,o=a===void 0?fue:a,s=n.scheduler,u=s===void 0?t??iue.asyncScheduler:s,l=n.meta,c=l===void 0?null:l;if(r==null&&i==null)throw new TypeError("No timeout provided.");return oue.operate(function(d,f){var h,g,p=null,b=0,v=function(C){g=cue.executeSchedule(f,u,function(){try{h.unsubscribe(),sue.innerFrom(o({meta:c,lastValue:p,seen:b})).subscribe(f)}catch(N){f.error(N)}},C)};h=d.subscribe(lue.createOperatorSubscriber(f,function(C){g?.unsubscribe(),b++,f.next(p=C),i>0&&v(i)},void 0,void 0,function(){g?.closed||g?.unsubscribe(),p=null})),!b&&v(r!=null?typeof r=="number"?r:+r-u.now():i)})}Iu.timeout=due;function fue(e){throw new Iu.TimeoutError(e)}});var as=m(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});AS.map=void 0;var hue=Z(),pue=ie();function mue(e,t){return hue.operate(function(n,r){var i=0;n.subscribe(pue.createOperatorSubscriber(r,function(a){r.next(e.call(t,a,i++))}))})}AS.map=mue});var ss=m(os=>{"use strict";var gue=os&&os.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},yue=os&&os.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(os,"__esModule",{value:!0});os.mapOneOrManyArgs=void 0;var vue=as(),Sue=Array.isArray;function bue(e,t){return Sue(t)?e.apply(void 0,yue([],gue(t))):e(t)}function Tue(e){return vue.map(function(t){return bue(e,t)})}os.mapOneOrManyArgs=Tue});var yI=m(us=>{"use strict";var Eue=us&&us.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},yq=us&&us.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(us,"__esModule",{value:!0});us.bindCallbackInternals=void 0;var Cue=fm(),kue=ze(),_ue=pm(),Aue=ss(),Nue=hm(),Iue=Wv();function gI(e,t,n,r){if(n)if(Cue.isScheduler(n))r=n;else return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return gI(e,t,r).apply(this,i).pipe(Aue.mapOneOrManyArgs(n))};return r?function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return gI(e,t).apply(this,i).pipe(_ue.subscribeOn(r),Nue.observeOn(r))}:function(){for(var i=this,a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var s=new Iue.AsyncSubject,u=!0;return new kue.Observable(function(l){var c=s.subscribe(l);if(u){u=!1;var d=!1,f=!1;t.apply(i,yq(yq([],Eue(a)),[function(){for(var h=[],g=0;g<arguments.length;g++)h[g]=arguments[g];if(e){var p=h.shift();if(p!=null){s.error(p);return}}s.next(1<h.length?h:h[0]),f=!0,d&&s.complete()}])),f&&s.complete(),d=!0}return c})}}us.bindCallbackInternals=gI});var vq=m(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});NS.bindCallback=void 0;var Oue=yI();function Rue(e,t,n){return Oue.bindCallbackInternals(!1,e,t,n)}NS.bindCallback=Rue});var Sq=m(IS=>{"use strict";Object.defineProperty(IS,"__esModule",{value:!0});IS.bindNodeCallback=void 0;var Pue=yI();function wue(e,t,n){return Pue.bindCallbackInternals(!0,e,t,n)}IS.bindNodeCallback=wue});var vI=m(OS=>{"use strict";Object.defineProperty(OS,"__esModule",{value:!0});OS.argsArgArrayOrObject=void 0;var xue=Array.isArray,Bue=Object.getPrototypeOf,Due=Object.prototype,Mue=Object.keys;function Lue(e){if(e.length===1){var t=e[0];if(xue(t))return{args:t,keys:null};if(Fue(t)){var n=Mue(t);return{args:n.map(function(r){return t[r]}),keys:n}}}return{args:e,keys:null}}OS.argsArgArrayOrObject=Lue;function Fue(e){return e&&typeof e=="object"&&Bue(e)===Due}});var SI=m(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});RS.createObject=void 0;function Uue(e,t){return e.reduce(function(n,r,i){return n[r]=t[i],n},{})}RS.createObject=Uue});var PS=m(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});nh.combineLatestInit=nh.combineLatest=void 0;var que=ze(),Vue=vI(),Eq=Ya(),Cq=on(),Jue=ss(),bq=Yn(),Wue=SI(),Hue=ie(),Gue=Za();function zue(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=bq.popScheduler(e),r=bq.popResultSelector(e),i=Vue.argsArgArrayOrObject(e),a=i.args,o=i.keys;if(a.length===0)return Eq.from([],n);var s=new que.Observable(kq(a,n,o?function(u){return Wue.createObject(o,u)}:Cq.identity));return r?s.pipe(Jue.mapOneOrManyArgs(r)):s}nh.combineLatest=zue;function kq(e,t,n){return n===void 0&&(n=Cq.identity),function(r){Tq(t,function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(c){Tq(t,function(){var d=Eq.from(e[c],t),f=!1;d.subscribe(Hue.createOperatorSubscriber(r,function(h){a[c]=h,f||(f=!0,s--),s||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)u(l)},r)}}nh.combineLatestInit=kq;function Tq(e,t,n){e?Gue.executeSchedule(n,e,t):t()}});var xS=m(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});wS.mergeInternals=void 0;var Que=ve(),Kue=Za(),_q=ie();function Zue(e,t,n,r,i,a,o,s){var u=[],l=0,c=0,d=!1,f=function(){d&&!u.length&&!l&&t.complete()},h=function(p){return l<r?g(p):u.push(p)},g=function(p){a&&t.next(p),l++;var b=!1;Que.innerFrom(n(p,c++)).subscribe(_q.createOperatorSubscriber(t,function(v){i?.(v),a?h(v):t.next(v)},function(){b=!0},void 0,function(){if(b)try{l--;for(var v=function(){var C=u.shift();o?Kue.executeSchedule(t,o,function(){return g(C)}):g(C)};u.length&&l<r;)v();f()}catch(C){t.error(C)}}))};return e.subscribe(_q.createOperatorSubscriber(t,h,function(){d=!0,f()})),function(){s?.()}}wS.mergeInternals=Zue});var $a=m(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});BS.mergeMap=void 0;var Yue=as(),Xue=ve(),$ue=Z(),jue=xS(),ele=He();function Aq(e,t,n){return n===void 0&&(n=1/0),ele.isFunction(t)?Aq(function(r,i){return Yue.map(function(a,o){return t(r,a,i,o)})(Xue.innerFrom(e(r,i)))},n):(typeof t=="number"&&(n=t),$ue.operate(function(r,i){return jue.mergeInternals(r,i,e,n)}))}BS.mergeMap=Aq});var mm=m(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});DS.mergeAll=void 0;var tle=$a(),nle=on();function rle(e){return e===void 0&&(e=1/0),tle.mergeMap(nle.identity,e)}DS.mergeAll=rle});var LS=m(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});MS.concatAll=void 0;var ile=mm();function ale(){return ile.mergeAll(1)}MS.concatAll=ale});var gm=m(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});FS.concat=void 0;var ole=LS(),sle=Yn(),ule=Ya();function lle(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ole.concatAll()(ule.from(e,sle.popScheduler(e)))}FS.concat=lle});var ym=m(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});US.defer=void 0;var cle=ze(),dle=ve();function fle(e){return new cle.Observable(function(t){dle.innerFrom(e()).subscribe(t)})}US.defer=fle});var Nq=m(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});qS.connectable=void 0;var hle=sn(),ple=ze(),mle=ym(),gle={connector:function(){return new hle.Subject},resetOnDisconnect:!0};function yle(e,t){t===void 0&&(t=gle);var n=null,r=t.connector,i=t.resetOnDisconnect,a=i===void 0?!0:i,o=r(),s=new ple.Observable(function(u){return o.subscribe(u)});return s.connect=function(){return(!n||n.closed)&&(n=mle.defer(function(){return e}).subscribe(o),a&&n.add(function(){return o=r()})),n},s}qS.connectable=yle});var Iq=m(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});VS.forkJoin=void 0;var vle=ze(),Sle=vI(),ble=ve(),Tle=Yn(),Ele=ie(),Cle=ss(),kle=SI();function _le(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Tle.popResultSelector(e),r=Sle.argsArgArrayOrObject(e),i=r.args,a=r.keys,o=new vle.Observable(function(s){var u=i.length;if(!u){s.complete();return}for(var l=new Array(u),c=u,d=u,f=function(g){var p=!1;ble.innerFrom(i[g]).subscribe(Ele.createOperatorSubscriber(s,function(b){p||(p=!0,d--),l[g]=b},function(){return c--},void 0,function(){(!c||!p)&&(d||s.next(a?kle.createObject(a,l):l),s.complete())}))},h=0;h<u;h++)f(h)});return n?o.pipe(Cle.mapOneOrManyArgs(n)):o}VS.forkJoin=_le});var Rq=m(rh=>{"use strict";var Ale=rh&&rh.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a};Object.defineProperty(rh,"__esModule",{value:!0});rh.fromEvent=void 0;var Nle=ve(),Ile=ze(),Ole=$a(),Rle=Kv(),Ou=He(),Ple=ss(),wle=["addListener","removeListener"],xle=["addEventListener","removeEventListener"],Ble=["on","off"];function bI(e,t,n,r){if(Ou.isFunction(n)&&(r=n,n=void 0),r)return bI(e,t,n).pipe(Ple.mapOneOrManyArgs(r));var i=Ale(Lle(e)?xle.map(function(s){return function(u){return e[s](t,u,n)}}):Dle(e)?wle.map(Oq(e,t)):Mle(e)?Ble.map(Oq(e,t)):[],2),a=i[0],o=i[1];if(!a&&Rle.isArrayLike(e))return Ole.mergeMap(function(s){return bI(s,t,n)})(Nle.innerFrom(e));if(!a)throw new TypeError("Invalid event target");return new Ile.Observable(function(s){var u=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return s.next(1<l.length?l:l[0])};return a(u),function(){return o(u)}})}rh.fromEvent=bI;function Oq(e,t){return function(n){return function(r){return e[n](t,r)}}}function Dle(e){return Ou.isFunction(e.addListener)&&Ou.isFunction(e.removeListener)}function Mle(e){return Ou.isFunction(e.on)&&Ou.isFunction(e.off)}function Lle(e){return Ou.isFunction(e.addEventListener)&&Ou.isFunction(e.removeEventListener)}});var wq=m(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});JS.fromEventPattern=void 0;var Fle=ze(),Ule=He(),qle=ss();function Pq(e,t,n){return n?Pq(e,t).pipe(qle.mapOneOrManyArgs(n)):new Fle.Observable(function(r){var i=function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return r.next(o.length===1?o[0]:o)},a=e(i);return Ule.isFunction(t)?function(){return t(i,a)}:void 0})}JS.fromEventPattern=Pq});var Bq=m(ih=>{"use strict";var Vle=ih&&ih.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(ih,"__esModule",{value:!0});ih.generate=void 0;var xq=on(),Jle=fm(),Wle=ym(),Hle=lI();function Gle(e,t,n,r,i){var a,o,s,u;arguments.length===1?(a=e,u=a.initialState,t=a.condition,n=a.iterate,o=a.resultSelector,s=o===void 0?xq.identity:o,i=a.scheduler):(u=e,!r||Jle.isScheduler(r)?(s=xq.identity,i=r):s=r);function l(){var c;return Vle(this,function(d){switch(d.label){case 0:c=u,d.label=1;case 1:return!t||t(c)?[4,s(c)]:[3,4];case 2:d.sent(),d.label=3;case 3:return c=n(c),[3,1];case 4:return[2]}})}return Wle.defer(i?function(){return Hle.scheduleIterable(l(),i)}:l)}ih.generate=Gle});var Dq=m(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});WS.iif=void 0;var zle=ym();function Qle(e,t,n){return zle.defer(function(){return e()?t:n})}WS.iif=Qle});var ls=m(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});HS.timer=void 0;var Kle=ze(),Zle=Zn(),Yle=fm(),Xle=kS();function $le(e,t,n){e===void 0&&(e=0),n===void 0&&(n=Zle.async);var r=-1;return t!=null&&(Yle.isScheduler(t)?n=t:r=t),new Kle.Observable(function(i){var a=Xle.isValidDate(e)?+e-n.now():e;a<0&&(a=0);var o=0;return n.schedule(function(){i.closed||(i.next(o++),0<=r?this.schedule(void 0,r):i.complete())},a)})}HS.timer=$le});var TI=m(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});GS.interval=void 0;var jle=Zn(),ece=ls();function tce(e,t){return e===void 0&&(e=0),t===void 0&&(t=jle.asyncScheduler),e<0&&(e=0),ece.timer(e,e,t)}GS.interval=tce});var Lq=m(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});zS.merge=void 0;var nce=mm(),rce=ve(),ice=xi(),Mq=Yn(),ace=Ya();function oce(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Mq.popScheduler(e),r=Mq.popNumber(e,1/0),i=e;return i.length?i.length===1?rce.innerFrom(i[0]):nce.mergeAll(r)(ace.from(i,n)):ice.EMPTY}zS.merge=oce});var EI=m(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.never=Ru.NEVER=void 0;var sce=ze(),uce=an();Ru.NEVER=new sce.Observable(uce.noop);function lce(){return Ru.NEVER}Ru.never=lce});var Pu=m(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});QS.argsOrArgArray=void 0;var cce=Array.isArray;function dce(e){return e.length===1&&cce(e[0])?e[0]:e}QS.argsOrArgArray=dce});var CI=m(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});KS.onErrorResumeNext=void 0;var fce=ze(),hce=Pu(),pce=ie(),Fq=an(),mce=ve();function gce(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=hce.argsOrArgArray(e);return new fce.Observable(function(r){var i=0,a=function(){if(i<n.length){var o=void 0;try{o=mce.innerFrom(n[i++])}catch{a();return}var s=new pce.OperatorSubscriber(r,void 0,Fq.noop,Fq.noop);o.subscribe(s),s.add(a)}else r.complete()};a()})}KS.onErrorResumeNext=gce});var Uq=m(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0});ZS.pairs=void 0;var yce=Ya();function vce(e,t){return yce.from(Object.entries(e),t)}ZS.pairs=vce});var qq=m(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});YS.not=void 0;function Sce(e,t){return function(n,r){return!e.call(t,n,r)}}YS.not=Sce});var wu=m(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});XS.filter=void 0;var bce=Z(),Tce=ie();function Ece(e,t){return bce.operate(function(n,r){var i=0;n.subscribe(Tce.createOperatorSubscriber(r,function(a){return e.call(t,a,i++)&&r.next(a)}))})}XS.filter=Ece});var Wq=m($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});$S.partition=void 0;var Cce=qq(),Vq=wu(),Jq=ve();function kce(e,t,n){return[Vq.filter(t,n)(Jq.innerFrom(e)),Vq.filter(Cce.not(t,n))(Jq.innerFrom(e))]}$S.partition=kce});var kI=m(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});ah.raceInit=ah.race=void 0;var _ce=ze(),Hq=ve(),Ace=Pu(),Nce=ie();function Ice(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=Ace.argsOrArgArray(e),e.length===1?Hq.innerFrom(e[0]):new _ce.Observable(Gq(e))}ah.race=Ice;function Gq(e){return function(t){for(var n=[],r=function(a){n.push(Hq.innerFrom(e[a]).subscribe(Nce.createOperatorSubscriber(t,function(o){if(n){for(var s=0;s<n.length;s++)s!==a&&n[s].unsubscribe();n=null}t.next(o)})))},i=0;n&&!t.closed&&i<e.length;i++)r(i)}}ah.raceInit=Gq});var zq=m(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});jS.range=void 0;var Oce=ze(),Rce=xi();function Pce(e,t,n){if(t==null&&(t=e,e=0),t<=0)return Rce.EMPTY;var r=t+e;return new Oce.Observable(n?function(i){var a=e;return n.schedule(function(){a<r?(i.next(a++),this.schedule()):i.complete()})}:function(i){for(var a=e;a<r&&!i.closed;)i.next(a++);i.complete()})}jS.range=Pce});var Qq=m(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});eb.using=void 0;var wce=ze(),xce=ve(),Bce=xi();function Dce(e,t){return new wce.Observable(function(n){var r=e(),i=t(r),a=i?xce.innerFrom(i):Bce.EMPTY;return a.subscribe(n),function(){r&&r.unsubscribe()}})}eb.using=Dce});var tb=m(cs=>{"use strict";var Mce=cs&&cs.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Lce=cs&&cs.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(cs,"__esModule",{value:!0});cs.zip=void 0;var Fce=ze(),Uce=ve(),qce=Pu(),Vce=xi(),Jce=ie(),Wce=Yn();function Hce(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Wce.popResultSelector(e),r=qce.argsOrArgArray(e);return r.length?new Fce.Observable(function(i){var a=r.map(function(){return[]}),o=r.map(function(){return!1});i.add(function(){a=o=null});for(var s=function(l){Uce.innerFrom(r[l]).subscribe(Jce.createOperatorSubscriber(i,function(c){if(a[l].push(c),a.every(function(f){return f.length})){var d=a.map(function(f){return f.shift()});i.next(n?n.apply(void 0,Lce([],Mce(d))):d),a.some(function(f,h){return!f.length&&o[h]})&&i.complete()}},function(){o[l]=!0,!a[l].length&&i.complete()}))},u=0;!i.closed&&u<r.length;u++)s(u);return function(){a=o=null}}):Vce.EMPTY}cs.zip=Hce});var Zq=m(Kq=>{"use strict";Object.defineProperty(Kq,"__esModule",{value:!0})});var _I=m(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});nb.audit=void 0;var Gce=Z(),zce=ve(),Yq=ie();function Qce(e){return Gce.operate(function(t,n){var r=!1,i=null,a=null,o=!1,s=function(){if(a?.unsubscribe(),a=null,r){r=!1;var l=i;i=null,n.next(l)}o&&n.complete()},u=function(){a=null,o&&n.complete()};t.subscribe(Yq.createOperatorSubscriber(n,function(l){r=!0,i=l,a||zce.innerFrom(e(l)).subscribe(a=Yq.createOperatorSubscriber(n,s,u))},function(){o=!0,(!r||!a||a.closed)&&n.complete()}))})}nb.audit=Qce});var Xq=m(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});rb.auditTime=void 0;var Kce=Zn(),Zce=_I(),Yce=ls();function Xce(e,t){return t===void 0&&(t=Kce.asyncScheduler),Zce.audit(function(){return Yce.timer(e,t)})}rb.auditTime=Xce});var jq=m(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});ib.buffer=void 0;var $ce=Z(),jce=an(),$q=ie(),ede=ve();function tde(e){return $ce.operate(function(t,n){var r=[];return t.subscribe($q.createOperatorSubscriber(n,function(i){return r.push(i)},function(){n.next(r),n.complete()})),ede.innerFrom(e).subscribe($q.createOperatorSubscriber(n,function(){var i=r;r=[],n.next(i)},jce.noop)),function(){r=null}})}ib.buffer=tde});var eV=m(oh=>{"use strict";var AI=oh&&oh.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(oh,"__esModule",{value:!0});oh.bufferCount=void 0;var nde=Z(),rde=ie(),ide=Ka();function ade(e,t){return t===void 0&&(t=null),t=t??e,nde.operate(function(n,r){var i=[],a=0;n.subscribe(rde.createOperatorSubscriber(r,function(o){var s,u,l,c,d=null;a++%t===0&&i.push([]);try{for(var f=AI(i),h=f.next();!h.done;h=f.next()){var g=h.value;g.push(o),e<=g.length&&(d=d??[],d.push(g))}}catch(v){s={error:v}}finally{try{h&&!h.done&&(u=f.return)&&u.call(f)}finally{if(s)throw s.error}}if(d)try{for(var p=AI(d),b=p.next();!b.done;b=p.next()){var g=b.value;ide.arrRemove(i,g),r.next(g)}}catch(v){l={error:v}}finally{try{b&&!b.done&&(c=p.return)&&c.call(p)}finally{if(l)throw l.error}}},function(){var o,s;try{for(var u=AI(i),l=u.next();!l.done;l=u.next()){var c=l.value;r.next(c)}}catch(d){o={error:d}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}r.complete()},void 0,function(){i=null}))})}oh.bufferCount=ade});var nV=m(sh=>{"use strict";var ode=sh&&sh.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(sh,"__esModule",{value:!0});sh.bufferTime=void 0;var sde=gr(),ude=Z(),lde=ie(),cde=Ka(),dde=Zn(),fde=Yn(),tV=Za();function hde(e){for(var t,n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var a=(t=fde.popScheduler(r))!==null&&t!==void 0?t:dde.asyncScheduler,o=(n=r[0])!==null&&n!==void 0?n:null,s=r[1]||1/0;return ude.operate(function(u,l){var c=[],d=!1,f=function(p){var b=p.buffer,v=p.subs;v.unsubscribe(),cde.arrRemove(c,p),l.next(b),d&&h()},h=function(){if(c){var p=new sde.Subscription;l.add(p);var b=[],v={buffer:b,subs:p};c.push(v),tV.executeSchedule(p,a,function(){return f(v)},e)}};o!==null&&o>=0?tV.executeSchedule(l,a,h,o,!0):d=!0,h();var g=lde.createOperatorSubscriber(l,function(p){var b,v,C=c.slice();try{for(var N=ode(C),I=N.next();!I.done;I=N.next()){var M=I.value,x=M.buffer;x.push(p),s<=x.length&&f(M)}}catch(U){b={error:U}}finally{try{I&&!I.done&&(v=N.return)&&v.call(N)}finally{if(b)throw b.error}}},function(){for(;c?.length;)l.next(c.shift().buffer);g?.unsubscribe(),l.complete(),l.unsubscribe()},void 0,function(){return c=null});u.subscribe(g)})}sh.bufferTime=hde});var aV=m(uh=>{"use strict";var pde=uh&&uh.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(uh,"__esModule",{value:!0});uh.bufferToggle=void 0;var mde=gr(),gde=Z(),rV=ve(),NI=ie(),iV=an(),yde=Ka();function vde(e,t){return gde.operate(function(n,r){var i=[];rV.innerFrom(e).subscribe(NI.createOperatorSubscriber(r,function(a){var o=[];i.push(o);var s=new mde.Subscription,u=function(){yde.arrRemove(i,o),r.next(o),s.unsubscribe()};s.add(rV.innerFrom(t(a)).subscribe(NI.createOperatorSubscriber(r,u,iV.noop)))},iV.noop)),n.subscribe(NI.createOperatorSubscriber(r,function(a){var o,s;try{for(var u=pde(i),l=u.next();!l.done;l=u.next()){var c=l.value;c.push(a)}}catch(d){o={error:d}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}},function(){for(;i.length>0;)r.next(i.shift());r.complete()}))})}uh.bufferToggle=vde});var sV=m(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});ab.bufferWhen=void 0;var Sde=Z(),bde=an(),oV=ie(),Tde=ve();function Ede(e){return Sde.operate(function(t,n){var r=null,i=null,a=function(){i?.unsubscribe();var o=r;r=[],o&&n.next(o),Tde.innerFrom(e()).subscribe(i=oV.createOperatorSubscriber(n,a,bde.noop))};a(),t.subscribe(oV.createOperatorSubscriber(n,function(o){return r?.push(o)},function(){r&&n.next(r),n.complete()},void 0,function(){return r=i=null}))})}ab.bufferWhen=Ede});var lV=m(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});ob.catchError=void 0;var Cde=ve(),kde=ie(),_de=Z();function uV(e){return _de.operate(function(t,n){var r=null,i=!1,a;r=t.subscribe(kde.createOperatorSubscriber(n,void 0,void 0,function(o){a=Cde.innerFrom(e(o,uV(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}ob.catchError=uV});var II=m(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});sb.scanInternals=void 0;var Ade=ie();function Nde(e,t,n,r,i){return function(a,o){var s=n,u=t,l=0;a.subscribe(Ade.createOperatorSubscriber(o,function(c){var d=l++;u=s?e(u,c,d):(s=!0,c),r&&o.next(u)},i&&function(){s&&o.next(u),o.complete()}))}}sb.scanInternals=Nde});var lh=m(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});ub.reduce=void 0;var Ide=II(),Ode=Z();function Rde(e,t){return Ode.operate(Ide.scanInternals(e,t,arguments.length>=2,!1,!0))}ub.reduce=Rde});var OI=m(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});lb.toArray=void 0;var Pde=lh(),wde=Z(),xde=function(e,t){return e.push(t),e};function Bde(){return wde.operate(function(e,t){Pde.reduce(xde,[])(e).subscribe(t)})}lb.toArray=Bde});var RI=m(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});cb.joinAllInternals=void 0;var Dde=on(),Mde=ss(),Lde=um(),Fde=$a(),Ude=OI();function qde(e,t){return Lde.pipe(Ude.toArray(),Fde.mergeMap(function(n){return e(n)}),t?Mde.mapOneOrManyArgs(t):Dde.identity)}cb.joinAllInternals=qde});var PI=m(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});db.combineLatestAll=void 0;var Vde=PS(),Jde=RI();function Wde(e){return Jde.joinAllInternals(Vde.combineLatest,e)}db.combineLatestAll=Wde});var cV=m(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});fb.combineAll=void 0;var Hde=PI();fb.combineAll=Hde.combineLatestAll});var pV=m(ds=>{"use strict";var dV=ds&&ds.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},fV=ds&&ds.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(ds,"__esModule",{value:!0});ds.combineLatest=void 0;var Gde=PS(),zde=Z(),Qde=Pu(),Kde=ss(),Zde=um(),Yde=Yn();function hV(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Yde.popResultSelector(e);return n?Zde.pipe(hV.apply(void 0,fV([],dV(e))),Kde.mapOneOrManyArgs(n)):zde.operate(function(r,i){Gde.combineLatestInit(fV([r],dV(Qde.argsOrArgArray(e))))(i)})}ds.combineLatest=hV});var mV=m(fs=>{"use strict";var Xde=fs&&fs.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},$de=fs&&fs.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(fs,"__esModule",{value:!0});fs.combineLatestWith=void 0;var jde=pV();function efe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return jde.combineLatest.apply(void 0,$de([],Xde(e)))}fs.combineLatestWith=efe});var wI=m(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});hb.concatMap=void 0;var gV=$a(),tfe=He();function nfe(e,t){return tfe.isFunction(t)?gV.mergeMap(e,t,1):gV.mergeMap(e,1)}hb.concatMap=nfe});var vV=m(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});pb.concatMapTo=void 0;var yV=wI(),rfe=He();function ife(e,t){return rfe.isFunction(t)?yV.concatMap(function(){return e},t):yV.concatMap(function(){return e})}pb.concatMapTo=ife});var SV=m(hs=>{"use strict";var afe=hs&&hs.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},ofe=hs&&hs.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(hs,"__esModule",{value:!0});hs.concat=void 0;var sfe=Z(),ufe=LS(),lfe=Yn(),cfe=Ya();function dfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=lfe.popScheduler(e);return sfe.operate(function(r,i){ufe.concatAll()(cfe.from(ofe([r],afe(e)),n)).subscribe(i)})}hs.concat=dfe});var bV=m(ps=>{"use strict";var ffe=ps&&ps.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},hfe=ps&&ps.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(ps,"__esModule",{value:!0});ps.concatWith=void 0;var pfe=SV();function mfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return pfe.concat.apply(void 0,hfe([],ffe(e)))}ps.concatWith=mfe});var TV=m(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});mb.fromSubscribable=void 0;var gfe=ze();function yfe(e){return new gfe.Observable(function(t){return e.subscribe(t)})}mb.fromSubscribable=yfe});var yb=m(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});gb.connect=void 0;var vfe=sn(),Sfe=ve(),bfe=Z(),Tfe=TV(),Efe={connector:function(){return new vfe.Subject}};function Cfe(e,t){t===void 0&&(t=Efe);var n=t.connector;return bfe.operate(function(r,i){var a=n();Sfe.innerFrom(e(Tfe.fromSubscribable(a))).subscribe(i),i.add(r.subscribe(a))})}gb.connect=Cfe});var EV=m(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});vb.count=void 0;var kfe=lh();function _fe(e){return kfe.reduce(function(t,n,r){return!e||e(n,r)?t+1:t},0)}vb.count=_fe});var kV=m(Sb=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});Sb.debounce=void 0;var Afe=Z(),Nfe=an(),CV=ie(),Ife=ve();function Ofe(e){return Afe.operate(function(t,n){var r=!1,i=null,a=null,o=function(){if(a?.unsubscribe(),a=null,r){r=!1;var s=i;i=null,n.next(s)}};t.subscribe(CV.createOperatorSubscriber(n,function(s){a?.unsubscribe(),r=!0,i=s,a=CV.createOperatorSubscriber(n,o,Nfe.noop),Ife.innerFrom(e(s)).subscribe(a)},function(){o(),n.complete()},void 0,function(){i=a=null}))})}Sb.debounce=Ofe});var _V=m(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});bb.debounceTime=void 0;var Rfe=Zn(),Pfe=Z(),wfe=ie();function xfe(e,t){return t===void 0&&(t=Rfe.asyncScheduler),Pfe.operate(function(n,r){var i=null,a=null,o=null,s=function(){if(i){i.unsubscribe(),i=null;var l=a;a=null,r.next(l)}};function u(){var l=o+e,c=t.now();if(c<l){i=this.schedule(void 0,l-c),r.add(i);return}s()}n.subscribe(wfe.createOperatorSubscriber(r,function(l){a=l,o=t.now(),i||(i=t.schedule(u,e),r.add(i))},function(){s(),r.complete()},void 0,function(){a=i=null}))})}bb.debounceTime=xfe});var vm=m(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});Tb.defaultIfEmpty=void 0;var Bfe=Z(),Dfe=ie();function Mfe(e){return Bfe.operate(function(t,n){var r=!1;t.subscribe(Dfe.createOperatorSubscriber(n,function(i){r=!0,n.next(i)},function(){r||n.next(e),n.complete()}))})}Tb.defaultIfEmpty=Mfe});var Sm=m(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});Eb.take=void 0;var Lfe=xi(),Ffe=Z(),Ufe=ie();function qfe(e){return e<=0?function(){return Lfe.EMPTY}:Ffe.operate(function(t,n){var r=0;t.subscribe(Ufe.createOperatorSubscriber(n,function(i){++r<=e&&(n.next(i),e<=r&&n.complete())}))})}Eb.take=qfe});var xI=m(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});Cb.ignoreElements=void 0;var Vfe=Z(),Jfe=ie(),Wfe=an();function Hfe(){return Vfe.operate(function(e,t){e.subscribe(Jfe.createOperatorSubscriber(t,Wfe.noop))})}Cb.ignoreElements=Hfe});var BI=m(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});kb.mapTo=void 0;var Gfe=as();function zfe(e){return Gfe.map(function(){return e})}kb.mapTo=zfe});var DI=m(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});_b.delayWhen=void 0;var Qfe=gm(),AV=Sm(),Kfe=xI(),Zfe=BI(),Yfe=$a(),Xfe=ve();function NV(e,t){return t?function(n){return Qfe.concat(t.pipe(AV.take(1),Kfe.ignoreElements()),n.pipe(NV(e)))}:Yfe.mergeMap(function(n,r){return Xfe.innerFrom(e(n,r)).pipe(AV.take(1),Zfe.mapTo(n))})}_b.delayWhen=NV});var IV=m(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});Ab.delay=void 0;var $fe=Zn(),jfe=DI(),ehe=ls();function the(e,t){t===void 0&&(t=$fe.asyncScheduler);var n=ehe.timer(e,t);return jfe.delayWhen(function(){return n})}Ab.delay=the});var OV=m(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});Nb.dematerialize=void 0;var nhe=mS(),rhe=Z(),ihe=ie();function ahe(){return rhe.operate(function(e,t){e.subscribe(ihe.createOperatorSubscriber(t,function(n){return nhe.observeNotification(n,t)}))})}Nb.dematerialize=ahe});var PV=m(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});Ib.distinct=void 0;var ohe=Z(),RV=ie(),she=an(),uhe=ve();function lhe(e,t){return ohe.operate(function(n,r){var i=new Set;n.subscribe(RV.createOperatorSubscriber(r,function(a){var o=e?e(a):a;i.has(o)||(i.add(o),r.next(a))})),t&&uhe.innerFrom(t).subscribe(RV.createOperatorSubscriber(r,function(){return i.clear()},she.noop))})}Ib.distinct=lhe});var MI=m(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});Ob.distinctUntilChanged=void 0;var che=on(),dhe=Z(),fhe=ie();function hhe(e,t){return t===void 0&&(t=che.identity),e=e??phe,dhe.operate(function(n,r){var i,a=!0;n.subscribe(fhe.createOperatorSubscriber(r,function(o){var s=t(o);(a||!e(i,s))&&(a=!1,i=s,r.next(o))}))})}Ob.distinctUntilChanged=hhe;function phe(e,t){return e===t}});var wV=m(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});Rb.distinctUntilKeyChanged=void 0;var mhe=MI();function ghe(e,t){return mhe.distinctUntilChanged(function(n,r){return t?t(n[e],r[e]):n[e]===r[e]})}Rb.distinctUntilKeyChanged=ghe});var bm=m(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});Pb.throwIfEmpty=void 0;var yhe=is(),vhe=Z(),She=ie();function bhe(e){return e===void 0&&(e=The),vhe.operate(function(t,n){var r=!1;t.subscribe(She.createOperatorSubscriber(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(e())}))})}Pb.throwIfEmpty=bhe;function The(){return new yhe.EmptyError}});var BV=m(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});wb.elementAt=void 0;var xV=hI(),Ehe=wu(),Che=bm(),khe=vm(),_he=Sm();function Ahe(e,t){if(e<0)throw new xV.ArgumentOutOfRangeError;var n=arguments.length>=2;return function(r){return r.pipe(Ehe.filter(function(i,a){return a===e}),_he.take(1),n?khe.defaultIfEmpty(t):Che.throwIfEmpty(function(){return new xV.ArgumentOutOfRangeError}))}}wb.elementAt=Ahe});var DV=m(ms=>{"use strict";var Nhe=ms&&ms.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Ihe=ms&&ms.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(ms,"__esModule",{value:!0});ms.endWith=void 0;var Ohe=gm(),Rhe=hS();function Phe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return Ohe.concat(n,Rhe.of.apply(void 0,Ihe([],Nhe(e))))}}ms.endWith=Phe});var MV=m(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});xb.every=void 0;var whe=Z(),xhe=ie();function Bhe(e,t){return whe.operate(function(n,r){var i=0;n.subscribe(xhe.createOperatorSubscriber(r,function(a){e.call(t,a,i++,n)||(r.next(!1),r.complete())},function(){r.next(!0),r.complete()}))})}xb.every=Bhe});var LI=m(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});Bb.exhaustMap=void 0;var Dhe=as(),LV=ve(),Mhe=Z(),FV=ie();function UV(e,t){return t?function(n){return n.pipe(UV(function(r,i){return LV.innerFrom(e(r,i)).pipe(Dhe.map(function(a,o){return t(r,a,i,o)}))}))}:Mhe.operate(function(n,r){var i=0,a=null,o=!1;n.subscribe(FV.createOperatorSubscriber(r,function(s){a||(a=FV.createOperatorSubscriber(r,void 0,function(){a=null,o&&r.complete()}),LV.innerFrom(e(s,i++)).subscribe(a))},function(){o=!0,!a&&r.complete()}))})}Bb.exhaustMap=UV});var FI=m(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});Db.exhaustAll=void 0;var Lhe=LI(),Fhe=on();function Uhe(){return Lhe.exhaustMap(Fhe.identity)}Db.exhaustAll=Uhe});var qV=m(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});Mb.exhaust=void 0;var qhe=FI();Mb.exhaust=qhe.exhaustAll});var VV=m(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});Lb.expand=void 0;var Vhe=Z(),Jhe=xS();function Whe(e,t,n){return t===void 0&&(t=1/0),t=(t||0)<1?1/0:t,Vhe.operate(function(r,i){return Jhe.mergeInternals(r,i,e,t,void 0,!0,n)})}Lb.expand=Whe});var JV=m(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});Fb.finalize=void 0;var Hhe=Z();function Ghe(e){return Hhe.operate(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}Fb.finalize=Ghe});var UI=m(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.createFind=ch.find=void 0;var zhe=Z(),Qhe=ie();function Khe(e,t){return zhe.operate(WV(e,t,"value"))}ch.find=Khe;function WV(e,t,n){var r=n==="index";return function(i,a){var o=0;i.subscribe(Qhe.createOperatorSubscriber(a,function(s){var u=o++;e.call(t,s,u,i)&&(a.next(r?u:s),a.complete())},function(){a.next(r?-1:void 0),a.complete()}))}}ch.createFind=WV});var HV=m(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});Ub.findIndex=void 0;var Zhe=Z(),Yhe=UI();function Xhe(e,t){return Zhe.operate(Yhe.createFind(e,t,"index"))}Ub.findIndex=Xhe});var GV=m(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});qb.first=void 0;var $he=is(),jhe=wu(),epe=Sm(),tpe=vm(),npe=bm(),rpe=on();function ipe(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?jhe.filter(function(i,a){return e(i,a,r)}):rpe.identity,epe.take(1),n?tpe.defaultIfEmpty(t):npe.throwIfEmpty(function(){return new $he.EmptyError}))}}qb.first=ipe});var QV=m(Vb=>{"use strict";Object.defineProperty(Vb,"__esModule",{value:!0});Vb.groupBy=void 0;var ape=ze(),ope=ve(),spe=sn(),upe=Z(),zV=ie();function lpe(e,t,n,r){return upe.operate(function(i,a){var o;!t||typeof t=="function"?o=t:(n=t.duration,o=t.element,r=t.connector);var s=new Map,u=function(g){s.forEach(g),g(a)},l=function(g){return u(function(p){return p.error(g)})},c=0,d=!1,f=new zV.OperatorSubscriber(a,function(g){try{var p=e(g),b=s.get(p);if(!b){s.set(p,b=r?r():new spe.Subject);var v=h(p,b);if(a.next(v),n){var C=zV.createOperatorSubscriber(b,function(){b.complete(),C?.unsubscribe()},void 0,void 0,function(){return s.delete(p)});f.add(ope.innerFrom(n(v)).subscribe(C))}}b.next(o?o(g):g)}catch(N){l(N)}},function(){return u(function(g){return g.complete()})},l,function(){return s.clear()},function(){return d=!0,c===0});i.subscribe(f);function h(g,p){var b=new ape.Observable(function(v){c++;var C=p.subscribe(v);return function(){C.unsubscribe(),--c===0&&d&&f.unsubscribe()}});return b.key=g,b}})}Vb.groupBy=lpe});var KV=m(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});Jb.isEmpty=void 0;var cpe=Z(),dpe=ie();function fpe(){return cpe.operate(function(e,t){e.subscribe(dpe.createOperatorSubscriber(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})}Jb.isEmpty=fpe});var qI=m(dh=>{"use strict";var hpe=dh&&dh.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(dh,"__esModule",{value:!0});dh.takeLast=void 0;var ppe=xi(),mpe=Z(),gpe=ie();function ype(e){return e<=0?function(){return ppe.EMPTY}:mpe.operate(function(t,n){var r=[];t.subscribe(gpe.createOperatorSubscriber(n,function(i){r.push(i),e<r.length&&r.shift()},function(){var i,a;try{for(var o=hpe(r),s=o.next();!s.done;s=o.next()){var u=s.value;n.next(u)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}n.complete()},void 0,function(){r=null}))})}dh.takeLast=ype});var ZV=m(Wb=>{"use strict";Object.defineProperty(Wb,"__esModule",{value:!0});Wb.last=void 0;var vpe=is(),Spe=wu(),bpe=qI(),Tpe=bm(),Epe=vm(),Cpe=on();function kpe(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?Spe.filter(function(i,a){return e(i,a,r)}):Cpe.identity,bpe.takeLast(1),n?Epe.defaultIfEmpty(t):Tpe.throwIfEmpty(function(){return new vpe.EmptyError}))}}Wb.last=kpe});var YV=m(Hb=>{"use strict";Object.defineProperty(Hb,"__esModule",{value:!0});Hb.materialize=void 0;var VI=mS(),_pe=Z(),Ape=ie();function Npe(){return _pe.operate(function(e,t){e.subscribe(Ape.createOperatorSubscriber(t,function(n){t.next(VI.Notification.createNext(n))},function(){t.next(VI.Notification.createComplete()),t.complete()},function(n){t.next(VI.Notification.createError(n)),t.complete()}))})}Hb.materialize=Npe});var XV=m(Gb=>{"use strict";Object.defineProperty(Gb,"__esModule",{value:!0});Gb.max=void 0;var Ipe=lh(),Ope=He();function Rpe(e){return Ipe.reduce(Ope.isFunction(e)?function(t,n){return e(t,n)>0?t:n}:function(t,n){return t>n?t:n})}Gb.max=Rpe});var $V=m(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});zb.flatMap=void 0;var Ppe=$a();zb.flatMap=Ppe.mergeMap});var eJ=m(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});Qb.mergeMapTo=void 0;var jV=$a(),wpe=He();function xpe(e,t,n){return n===void 0&&(n=1/0),wpe.isFunction(t)?jV.mergeMap(function(){return e},t,n):(typeof t=="number"&&(n=t),jV.mergeMap(function(){return e},n))}Qb.mergeMapTo=xpe});var tJ=m(Kb=>{"use strict";Object.defineProperty(Kb,"__esModule",{value:!0});Kb.mergeScan=void 0;var Bpe=Z(),Dpe=xS();function Mpe(e,t,n){return n===void 0&&(n=1/0),Bpe.operate(function(r,i){var a=t;return Dpe.mergeInternals(r,i,function(o,s){return e(a,o,s)},n,function(o){a=o},!1,void 0,function(){return a=null})})}Kb.mergeScan=Mpe});var rJ=m(gs=>{"use strict";var Lpe=gs&&gs.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Fpe=gs&&gs.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(gs,"__esModule",{value:!0});gs.merge=void 0;var Upe=Z(),qpe=Pu(),Vpe=mm(),nJ=Yn(),Jpe=Ya();function Wpe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=nJ.popScheduler(e),r=nJ.popNumber(e,1/0);return e=qpe.argsOrArgArray(e),Upe.operate(function(i,a){Vpe.mergeAll(r)(Jpe.from(Fpe([i],Lpe(e)),n)).subscribe(a)})}gs.merge=Wpe});var iJ=m(ys=>{"use strict";var Hpe=ys&&ys.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Gpe=ys&&ys.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(ys,"__esModule",{value:!0});ys.mergeWith=void 0;var zpe=rJ();function Qpe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zpe.merge.apply(void 0,Gpe([],Hpe(e)))}ys.mergeWith=Qpe});var aJ=m(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});Zb.min=void 0;var Kpe=lh(),Zpe=He();function Ype(e){return Kpe.reduce(Zpe.isFunction(e)?function(t,n){return e(t,n)<0?t:n}:function(t,n){return t<n?t:n})}Zb.min=Ype});var Xb=m(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});Yb.multicast=void 0;var Xpe=lm(),oJ=He(),$pe=yb();function jpe(e,t){var n=oJ.isFunction(e)?e:function(){return e};return oJ.isFunction(t)?$pe.connect(t,{connector:n}):function(r){return new Xpe.ConnectableObservable(r,n)}}Yb.multicast=jpe});var uJ=m(ma=>{"use strict";var eme=ma&&ma.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},tme=ma&&ma.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(ma,"__esModule",{value:!0});ma.onErrorResumeNext=ma.onErrorResumeNextWith=void 0;var nme=Pu(),rme=CI();function sJ(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=nme.argsOrArgArray(e);return function(r){return rme.onErrorResumeNext.apply(void 0,tme([r],eme(n)))}}ma.onErrorResumeNextWith=sJ;ma.onErrorResumeNext=sJ});var lJ=m($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});$b.pairwise=void 0;var ime=Z(),ame=ie();function ome(){return ime.operate(function(e,t){var n,r=!1;e.subscribe(ame.createOperatorSubscriber(t,function(i){var a=n;n=i,r&&t.next([a,i]),r=!0}))})}$b.pairwise=ome});var cJ=m(jb=>{"use strict";Object.defineProperty(jb,"__esModule",{value:!0});jb.pluck=void 0;var sme=as();function ume(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length;if(n===0)throw new Error("list of properties cannot be empty.");return sme.map(function(r){for(var i=r,a=0;a<n;a++){var o=i?.[e[a]];if(typeof o<"u")i=o;else return}return i})}jb.pluck=ume});var dJ=m(eT=>{"use strict";Object.defineProperty(eT,"__esModule",{value:!0});eT.publish=void 0;var lme=sn(),cme=Xb(),dme=yb();function fme(e){return e?function(t){return dme.connect(e)(t)}:function(t){return cme.multicast(new lme.Subject)(t)}}eT.publish=fme});var fJ=m(tT=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});tT.publishBehavior=void 0;var hme=YN(),pme=lm();function mme(e){return function(t){var n=new hme.BehaviorSubject(e);return new pme.ConnectableObservable(t,function(){return n})}}tT.publishBehavior=mme});var hJ=m(nT=>{"use strict";Object.defineProperty(nT,"__esModule",{value:!0});nT.publishLast=void 0;var gme=Wv(),yme=lm();function vme(){return function(e){var t=new gme.AsyncSubject;return new yme.ConnectableObservable(e,function(){return t})}}nT.publishLast=vme});var mJ=m(rT=>{"use strict";Object.defineProperty(rT,"__esModule",{value:!0});rT.publishReplay=void 0;var Sme=Jv(),bme=Xb(),pJ=He();function Tme(e,t,n,r){n&&!pJ.isFunction(n)&&(r=n);var i=pJ.isFunction(n)?n:void 0;return function(a){return bme.multicast(new Sme.ReplaySubject(e,t,r),i)(a)}}rT.publishReplay=Tme});var gJ=m(vs=>{"use strict";var Eme=vs&&vs.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Cme=vs&&vs.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(vs,"__esModule",{value:!0});vs.raceWith=void 0;var kme=kI(),_me=Z(),Ame=on();function Nme(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length?_me.operate(function(n,r){kme.raceInit(Cme([n],Eme(e)))(r)}):Ame.identity}vs.raceWith=Nme});var vJ=m(iT=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});iT.repeat=void 0;var Ime=xi(),Ome=Z(),yJ=ie(),Rme=ve(),Pme=ls();function wme(e){var t,n=1/0,r;return e!=null&&(typeof e=="object"?(t=e.count,n=t===void 0?1/0:t,r=e.delay):n=e),n<=0?function(){return Ime.EMPTY}:Ome.operate(function(i,a){var o=0,s,u=function(){if(s?.unsubscribe(),s=null,r!=null){var c=typeof r=="number"?Pme.timer(r):Rme.innerFrom(r(o)),d=yJ.createOperatorSubscriber(a,function(){d.unsubscribe(),l()});c.subscribe(d)}else l()},l=function(){var c=!1;s=i.subscribe(yJ.createOperatorSubscriber(a,void 0,function(){++o<n?s?u():c=!0:a.complete()})),c&&u()};l()})}iT.repeat=wme});var bJ=m(aT=>{"use strict";Object.defineProperty(aT,"__esModule",{value:!0});aT.repeatWhen=void 0;var xme=ve(),Bme=sn(),Dme=Z(),SJ=ie();function Mme(e){return Dme.operate(function(t,n){var r,i=!1,a,o=!1,s=!1,u=function(){return s&&o&&(n.complete(),!0)},l=function(){return a||(a=new Bme.Subject,xme.innerFrom(e(a)).subscribe(SJ.createOperatorSubscriber(n,function(){r?c():i=!0},function(){o=!0,u()}))),a},c=function(){s=!1,r=t.subscribe(SJ.createOperatorSubscriber(n,void 0,function(){s=!0,!u()&&l().next()})),i&&(r.unsubscribe(),r=null,i=!1,c())};c()})}aT.repeatWhen=Mme});var EJ=m(oT=>{"use strict";Object.defineProperty(oT,"__esModule",{value:!0});oT.retry=void 0;var Lme=Z(),TJ=ie(),Fme=on(),Ume=ls(),qme=ve();function Vme(e){e===void 0&&(e=1/0);var t;e&&typeof e=="object"?t=e:t={count:e};var n=t.count,r=n===void 0?1/0:n,i=t.delay,a=t.resetOnSuccess,o=a===void 0?!1:a;return r<=0?Fme.identity:Lme.operate(function(s,u){var l=0,c,d=function(){var f=!1;c=s.subscribe(TJ.createOperatorSubscriber(u,function(h){o&&(l=0),u.next(h)},void 0,function(h){if(l++<r){var g=function(){c?(c.unsubscribe(),c=null,d()):f=!0};if(i!=null){var p=typeof i=="number"?Ume.timer(i):qme.innerFrom(i(h,l)),b=TJ.createOperatorSubscriber(u,function(){b.unsubscribe(),g()},function(){u.complete()});p.subscribe(b)}else g()}else u.error(h)})),f&&(c.unsubscribe(),c=null,d())};d()})}oT.retry=Vme});var kJ=m(sT=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});sT.retryWhen=void 0;var Jme=ve(),Wme=sn(),Hme=Z(),CJ=ie();function Gme(e){return Hme.operate(function(t,n){var r,i=!1,a,o=function(){r=t.subscribe(CJ.createOperatorSubscriber(n,void 0,void 0,function(s){a||(a=new Wme.Subject,Jme.innerFrom(e(a)).subscribe(CJ.createOperatorSubscriber(n,function(){return r?o():i=!0}))),a&&a.next(s)})),i&&(r.unsubscribe(),r=null,i=!1,o())};o()})}sT.retryWhen=Gme});var JI=m(uT=>{"use strict";Object.defineProperty(uT,"__esModule",{value:!0});uT.sample=void 0;var zme=ve(),Qme=Z(),Kme=an(),_J=ie();function Zme(e){return Qme.operate(function(t,n){var r=!1,i=null;t.subscribe(_J.createOperatorSubscriber(n,function(a){r=!0,i=a})),zme.innerFrom(e).subscribe(_J.createOperatorSubscriber(n,function(){if(r){r=!1;var a=i;i=null,n.next(a)}},Kme.noop))})}uT.sample=Zme});var AJ=m(lT=>{"use strict";Object.defineProperty(lT,"__esModule",{value:!0});lT.sampleTime=void 0;var Yme=Zn(),Xme=JI(),$me=TI();function jme(e,t){return t===void 0&&(t=Yme.asyncScheduler),Xme.sample($me.interval(e,t))}lT.sampleTime=jme});var NJ=m(cT=>{"use strict";Object.defineProperty(cT,"__esModule",{value:!0});cT.scan=void 0;var ege=Z(),tge=II();function nge(e,t){return ege.operate(tge.scanInternals(e,t,arguments.length>=2,!0))}cT.scan=nge});var OJ=m(dT=>{"use strict";Object.defineProperty(dT,"__esModule",{value:!0});dT.sequenceEqual=void 0;var rge=Z(),ige=ie(),age=ve();function oge(e,t){return t===void 0&&(t=function(n,r){return n===r}),rge.operate(function(n,r){var i=IJ(),a=IJ(),o=function(u){r.next(u),r.complete()},s=function(u,l){var c=ige.createOperatorSubscriber(r,function(d){var f=l.buffer,h=l.complete;f.length===0?h?o(!1):u.buffer.push(d):!t(d,f.shift())&&o(!1)},function(){u.complete=!0;var d=l.complete,f=l.buffer;d&&o(f.length===0),c?.unsubscribe()});return c};n.subscribe(s(i,a)),age.innerFrom(e).subscribe(s(a,i))})}dT.sequenceEqual=oge;function IJ(){return{buffer:[],complete:!1}}});var HI=m(Ss=>{"use strict";var sge=Ss&&Ss.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},uge=Ss&&Ss.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(Ss,"__esModule",{value:!0});Ss.share=void 0;var RJ=ve(),lge=sn(),PJ=Bf(),cge=Z();function dge(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new lge.Subject}:t,r=e.resetOnError,i=r===void 0?!0:r,a=e.resetOnComplete,o=a===void 0?!0:a,s=e.resetOnRefCountZero,u=s===void 0?!0:s;return function(l){var c,d,f,h=0,g=!1,p=!1,b=function(){d?.unsubscribe(),d=void 0},v=function(){b(),c=f=void 0,g=p=!1},C=function(){var N=c;v(),N?.unsubscribe()};return cge.operate(function(N,I){h++,!p&&!g&&b();var M=f=f??n();I.add(function(){h--,h===0&&!p&&!g&&(d=WI(C,u))}),M.subscribe(I),!c&&h>0&&(c=new PJ.SafeSubscriber({next:function(x){return M.next(x)},error:function(x){p=!0,b(),d=WI(v,i,x),M.error(x)},complete:function(){g=!0,b(),d=WI(v,o),M.complete()}}),RJ.innerFrom(N).subscribe(c))})(l)}}Ss.share=dge;function WI(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(t===!0){e();return}if(t!==!1){var i=new PJ.SafeSubscriber({next:function(){i.unsubscribe(),e()}});return RJ.innerFrom(t.apply(void 0,uge([],sge(n)))).subscribe(i)}}});var wJ=m(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0});fT.shareReplay=void 0;var fge=Jv(),hge=HI();function pge(e,t,n){var r,i,a,o,s=!1;return e&&typeof e=="object"?(r=e.bufferSize,o=r===void 0?1/0:r,i=e.windowTime,t=i===void 0?1/0:i,a=e.refCount,s=a===void 0?!1:a,n=e.scheduler):o=e??1/0,hge.share({connector:function(){return new fge.ReplaySubject(o,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}fT.shareReplay=pge});var xJ=m(hT=>{"use strict";Object.defineProperty(hT,"__esModule",{value:!0});hT.single=void 0;var mge=is(),gge=mI(),yge=pI(),vge=Z(),Sge=ie();function bge(e){return vge.operate(function(t,n){var r=!1,i,a=!1,o=0;t.subscribe(Sge.createOperatorSubscriber(n,function(s){a=!0,(!e||e(s,o++,t))&&(r&&n.error(new gge.SequenceError("Too many matching values")),r=!0,i=s)},function(){r?(n.next(i),n.complete()):n.error(a?new yge.NotFoundError("No matching values"):new mge.EmptyError)}))})}hT.single=bge});var BJ=m(pT=>{"use strict";Object.defineProperty(pT,"__esModule",{value:!0});pT.skip=void 0;var Tge=wu();function Ege(e){return Tge.filter(function(t,n){return e<=n})}pT.skip=Ege});var DJ=m(mT=>{"use strict";Object.defineProperty(mT,"__esModule",{value:!0});mT.skipLast=void 0;var Cge=on(),kge=Z(),_ge=ie();function Age(e){return e<=0?Cge.identity:kge.operate(function(t,n){var r=new Array(e),i=0;return t.subscribe(_ge.createOperatorSubscriber(n,function(a){var o=i++;if(o<e)r[o]=a;else{var s=o%e,u=r[s];r[s]=a,n.next(u)}})),function(){r=null}})}mT.skipLast=Age});var LJ=m(gT=>{"use strict";Object.defineProperty(gT,"__esModule",{value:!0});gT.skipUntil=void 0;var Nge=Z(),MJ=ie(),Ige=ve(),Oge=an();function Rge(e){return Nge.operate(function(t,n){var r=!1,i=MJ.createOperatorSubscriber(n,function(){i?.unsubscribe(),r=!0},Oge.noop);Ige.innerFrom(e).subscribe(i),t.subscribe(MJ.createOperatorSubscriber(n,function(a){return r&&n.next(a)}))})}gT.skipUntil=Rge});var FJ=m(yT=>{"use strict";Object.defineProperty(yT,"__esModule",{value:!0});yT.skipWhile=void 0;var Pge=Z(),wge=ie();function xge(e){return Pge.operate(function(t,n){var r=!1,i=0;t.subscribe(wge.createOperatorSubscriber(n,function(a){return(r||(r=!e(a,i++)))&&n.next(a)}))})}yT.skipWhile=xge});var qJ=m(vT=>{"use strict";Object.defineProperty(vT,"__esModule",{value:!0});vT.startWith=void 0;var UJ=gm(),Bge=Yn(),Dge=Z();function Mge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Bge.popScheduler(e);return Dge.operate(function(r,i){(n?UJ.concat(e,r,n):UJ.concat(e,r)).subscribe(i)})}vT.startWith=Mge});var Tm=m(ST=>{"use strict";Object.defineProperty(ST,"__esModule",{value:!0});ST.switchMap=void 0;var Lge=ve(),Fge=Z(),VJ=ie();function Uge(e,t){return Fge.operate(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(VJ.createOperatorSubscriber(r,function(u){i?.unsubscribe();var l=0,c=a++;Lge.innerFrom(e(u,c)).subscribe(i=VJ.createOperatorSubscriber(r,function(d){return r.next(t?t(u,d,c,l++):d)},function(){i=null,s()}))},function(){o=!0,s()}))})}ST.switchMap=Uge});var JJ=m(bT=>{"use strict";Object.defineProperty(bT,"__esModule",{value:!0});bT.switchAll=void 0;var qge=Tm(),Vge=on();function Jge(){return qge.switchMap(Vge.identity)}bT.switchAll=Jge});var HJ=m(TT=>{"use strict";Object.defineProperty(TT,"__esModule",{value:!0});TT.switchMapTo=void 0;var WJ=Tm(),Wge=He();function Hge(e,t){return Wge.isFunction(t)?WJ.switchMap(function(){return e},t):WJ.switchMap(function(){return e})}TT.switchMapTo=Hge});var GJ=m(ET=>{"use strict";Object.defineProperty(ET,"__esModule",{value:!0});ET.switchScan=void 0;var Gge=Tm(),zge=Z();function Qge(e,t){return zge.operate(function(n,r){var i=t;return Gge.switchMap(function(a,o){return e(i,a,o)},function(a,o){return i=o,o})(n).subscribe(r),function(){i=null}})}ET.switchScan=Qge});var zJ=m(CT=>{"use strict";Object.defineProperty(CT,"__esModule",{value:!0});CT.takeUntil=void 0;var Kge=Z(),Zge=ie(),Yge=ve(),Xge=an();function $ge(e){return Kge.operate(function(t,n){Yge.innerFrom(e).subscribe(Zge.createOperatorSubscriber(n,function(){return n.complete()},Xge.noop)),!n.closed&&t.subscribe(n)})}CT.takeUntil=$ge});var QJ=m(kT=>{"use strict";Object.defineProperty(kT,"__esModule",{value:!0});kT.takeWhile=void 0;var jge=Z(),e0e=ie();function t0e(e,t){return t===void 0&&(t=!1),jge.operate(function(n,r){var i=0;n.subscribe(e0e.createOperatorSubscriber(r,function(a){var o=e(a,i++);(o||t)&&r.next(a),!o&&r.complete()}))})}kT.takeWhile=t0e});var KJ=m(_T=>{"use strict";Object.defineProperty(_T,"__esModule",{value:!0});_T.tap=void 0;var n0e=He(),r0e=Z(),i0e=ie(),a0e=on();function o0e(e,t,n){var r=n0e.isFunction(e)||t||n?{next:e,error:t,complete:n}:e;return r?r0e.operate(function(i,a){var o;(o=r.subscribe)===null||o===void 0||o.call(r);var s=!0;i.subscribe(i0e.createOperatorSubscriber(a,function(u){var l;(l=r.next)===null||l===void 0||l.call(r,u),a.next(u)},function(){var u;s=!1,(u=r.complete)===null||u===void 0||u.call(r),a.complete()},function(u){var l;s=!1,(l=r.error)===null||l===void 0||l.call(r,u),a.error(u)},function(){var u,l;s&&((u=r.unsubscribe)===null||u===void 0||u.call(r)),(l=r.finalize)===null||l===void 0||l.call(r)}))}):a0e.identity}_T.tap=o0e});var GI=m(AT=>{"use strict";Object.defineProperty(AT,"__esModule",{value:!0});AT.throttle=void 0;var s0e=Z(),ZJ=ie(),u0e=ve();function l0e(e,t){return s0e.operate(function(n,r){var i=t??{},a=i.leading,o=a===void 0?!0:a,s=i.trailing,u=s===void 0?!1:s,l=!1,c=null,d=null,f=!1,h=function(){d?.unsubscribe(),d=null,u&&(b(),f&&r.complete())},g=function(){d=null,f&&r.complete()},p=function(v){return d=u0e.innerFrom(e(v)).subscribe(ZJ.createOperatorSubscriber(r,h,g))},b=function(){if(l){l=!1;var v=c;c=null,r.next(v),!f&&p(v)}};n.subscribe(ZJ.createOperatorSubscriber(r,function(v){l=!0,c=v,!(d&&!d.closed)&&(o?b():p(v))},function(){f=!0,!(u&&l&&d&&!d.closed)&&r.complete()}))})}AT.throttle=l0e});var YJ=m(NT=>{"use strict";Object.defineProperty(NT,"__esModule",{value:!0});NT.throttleTime=void 0;var c0e=Zn(),d0e=GI(),f0e=ls();function h0e(e,t,n){t===void 0&&(t=c0e.asyncScheduler);var r=f0e.timer(e,t);return d0e.throttle(function(){return r},n)}NT.throttleTime=h0e});var $J=m(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.TimeInterval=fh.timeInterval=void 0;var p0e=Zn(),m0e=Z(),g0e=ie();function y0e(e){return e===void 0&&(e=p0e.asyncScheduler),m0e.operate(function(t,n){var r=e.now();t.subscribe(g0e.createOperatorSubscriber(n,function(i){var a=e.now(),o=a-r;r=a,n.next(new XJ(i,o))}))})}fh.timeInterval=y0e;var XJ=function(){function e(t,n){this.value=t,this.interval=n}return e}();fh.TimeInterval=XJ});var jJ=m(IT=>{"use strict";Object.defineProperty(IT,"__esModule",{value:!0});IT.timeoutWith=void 0;var v0e=Zn(),S0e=kS(),b0e=_S();function T0e(e,t,n){var r,i,a;if(n=n??v0e.async,S0e.isValidDate(e)?r=e:typeof e=="number"&&(i=e),t)a=function(){return t};else throw new TypeError("No observable provided to switch to");if(r==null&&i==null)throw new TypeError("No timeout provided.");return b0e.timeout({first:r,each:i,scheduler:n,with:a})}IT.timeoutWith=T0e});var eW=m(OT=>{"use strict";Object.defineProperty(OT,"__esModule",{value:!0});OT.timestamp=void 0;var E0e=Vv(),C0e=as();function k0e(e){return e===void 0&&(e=E0e.dateTimestampProvider),C0e.map(function(t){return{value:t,timestamp:e.now()}})}OT.timestamp=k0e});var rW=m(RT=>{"use strict";Object.defineProperty(RT,"__esModule",{value:!0});RT.window=void 0;var tW=sn(),_0e=Z(),nW=ie(),A0e=an(),N0e=ve();function I0e(e){return _0e.operate(function(t,n){var r=new tW.Subject;n.next(r.asObservable());var i=function(a){r.error(a),n.error(a)};return t.subscribe(nW.createOperatorSubscriber(n,function(a){return r?.next(a)},function(){r.complete(),n.complete()},i)),N0e.innerFrom(e).subscribe(nW.createOperatorSubscriber(n,function(){r.complete(),n.next(r=new tW.Subject)},A0e.noop,i)),function(){r?.unsubscribe(),r=null}})}RT.window=I0e});var aW=m(hh=>{"use strict";var O0e=hh&&hh.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(hh,"__esModule",{value:!0});hh.windowCount=void 0;var iW=sn(),R0e=Z(),P0e=ie();function w0e(e,t){t===void 0&&(t=0);var n=t>0?t:e;return R0e.operate(function(r,i){var a=[new iW.Subject],o=[],s=0;i.next(a[0].asObservable()),r.subscribe(P0e.createOperatorSubscriber(i,function(u){var l,c;try{for(var d=O0e(a),f=d.next();!f.done;f=d.next()){var h=f.value;h.next(u)}}catch(b){l={error:b}}finally{try{f&&!f.done&&(c=d.return)&&c.call(d)}finally{if(l)throw l.error}}var g=s-e+1;if(g>=0&&g%n===0&&a.shift().complete(),++s%n===0){var p=new iW.Subject;a.push(p),i.next(p.asObservable())}},function(){for(;a.length>0;)a.shift().complete();i.complete()},function(u){for(;a.length>0;)a.shift().error(u);i.error(u)},function(){o=null,a=null}))})}hh.windowCount=w0e});var sW=m(PT=>{"use strict";Object.defineProperty(PT,"__esModule",{value:!0});PT.windowTime=void 0;var x0e=sn(),B0e=Zn(),D0e=gr(),M0e=Z(),L0e=ie(),F0e=Ka(),U0e=Yn(),oW=Za();function q0e(e){for(var t,n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var a=(t=U0e.popScheduler(r))!==null&&t!==void 0?t:B0e.asyncScheduler,o=(n=r[0])!==null&&n!==void 0?n:null,s=r[1]||1/0;return M0e.operate(function(u,l){var c=[],d=!1,f=function(b){var v=b.window,C=b.subs;v.complete(),C.unsubscribe(),F0e.arrRemove(c,b),d&&h()},h=function(){if(c){var b=new D0e.Subscription;l.add(b);var v=new x0e.Subject,C={window:v,subs:b,seen:0};c.push(C),l.next(v.asObservable()),oW.executeSchedule(b,a,function(){return f(C)},e)}};o!==null&&o>=0?oW.executeSchedule(l,a,h,o,!0):d=!0,h();var g=function(b){return c.slice().forEach(b)},p=function(b){g(function(v){var C=v.window;return b(C)}),b(l),l.unsubscribe()};return u.subscribe(L0e.createOperatorSubscriber(l,function(b){g(function(v){v.window.next(b),s<=++v.seen&&f(v)})},function(){return p(function(b){return b.complete()})},function(b){return p(function(v){return v.error(b)})})),function(){c=null}})}PT.windowTime=q0e});var cW=m(ph=>{"use strict";var V0e=ph&&ph.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(ph,"__esModule",{value:!0});ph.windowToggle=void 0;var J0e=sn(),W0e=gr(),H0e=Z(),uW=ve(),zI=ie(),lW=an(),G0e=Ka();function z0e(e,t){return H0e.operate(function(n,r){var i=[],a=function(o){for(;0<i.length;)i.shift().error(o);r.error(o)};uW.innerFrom(e).subscribe(zI.createOperatorSubscriber(r,function(o){var s=new J0e.Subject;i.push(s);var u=new W0e.Subscription,l=function(){G0e.arrRemove(i,s),s.complete(),u.unsubscribe()},c;try{c=uW.innerFrom(t(o))}catch(d){a(d);return}r.next(s.asObservable()),u.add(c.subscribe(zI.createOperatorSubscriber(r,l,lW.noop,a)))},lW.noop)),n.subscribe(zI.createOperatorSubscriber(r,function(o){var s,u,l=i.slice();try{for(var c=V0e(l),d=c.next();!d.done;d=c.next()){var f=d.value;f.next(o)}}catch(h){s={error:h}}finally{try{d&&!d.done&&(u=c.return)&&u.call(c)}finally{if(s)throw s.error}}},function(){for(;0<i.length;)i.shift().complete();r.complete()},a,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}ph.windowToggle=z0e});var fW=m(wT=>{"use strict";Object.defineProperty(wT,"__esModule",{value:!0});wT.windowWhen=void 0;var Q0e=sn(),K0e=Z(),dW=ie(),Z0e=ve();function Y0e(e){return K0e.operate(function(t,n){var r,i,a=function(s){r.error(s),n.error(s)},o=function(){i?.unsubscribe(),r?.complete(),r=new Q0e.Subject,n.next(r.asObservable());var s;try{s=Z0e.innerFrom(e())}catch(u){a(u);return}s.subscribe(i=dW.createOperatorSubscriber(n,o,o,a))};o(),t.subscribe(dW.createOperatorSubscriber(n,function(s){return r.next(s)},function(){r.complete(),n.complete()},a,function(){i?.unsubscribe(),r=null}))})}wT.windowWhen=Y0e});var gW=m(bs=>{"use strict";var hW=bs&&bs.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},pW=bs&&bs.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(bs,"__esModule",{value:!0});bs.withLatestFrom=void 0;var X0e=Z(),mW=ie(),$0e=ve(),j0e=on(),eye=an(),tye=Yn();function nye(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=tye.popResultSelector(e);return X0e.operate(function(r,i){for(var a=e.length,o=new Array(a),s=e.map(function(){return!1}),u=!1,l=function(d){$0e.innerFrom(e[d]).subscribe(mW.createOperatorSubscriber(i,function(f){o[d]=f,!u&&!s[d]&&(s[d]=!0,(u=s.every(j0e.identity))&&(s=null))},eye.noop))},c=0;c<a;c++)l(c);r.subscribe(mW.createOperatorSubscriber(i,function(d){if(u){var f=pW([d],hW(o));i.next(n?n.apply(void 0,pW([],hW(f))):f)}}))})}bs.withLatestFrom=nye});var yW=m(xT=>{"use strict";Object.defineProperty(xT,"__esModule",{value:!0});xT.zipAll=void 0;var rye=tb(),iye=RI();function aye(e){return iye.joinAllInternals(rye.zip,e)}xT.zipAll=aye});var vW=m(Ts=>{"use strict";var oye=Ts&&Ts.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},sye=Ts&&Ts.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.zip=void 0;var uye=tb(),lye=Z();function cye(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return lye.operate(function(n,r){uye.zip.apply(void 0,sye([n],oye(e))).subscribe(r)})}Ts.zip=cye});var SW=m(Es=>{"use strict";var dye=Es&&Es.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},fye=Es&&Es.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(Es,"__esModule",{value:!0});Es.zipWith=void 0;var hye=vW();function pye(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return hye.zip.apply(void 0,fye([],dye(e)))}Es.zipWith=pye});var AW=m(y=>{"use strict";var mye=y&&y.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),gye=y&&y.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&mye(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.interval=y.iif=y.generate=y.fromEventPattern=y.fromEvent=y.from=y.forkJoin=y.empty=y.defer=y.connectable=y.concat=y.combineLatest=y.bindNodeCallback=y.bindCallback=y.UnsubscriptionError=y.TimeoutError=y.SequenceError=y.ObjectUnsubscribedError=y.NotFoundError=y.EmptyError=y.ArgumentOutOfRangeError=y.firstValueFrom=y.lastValueFrom=y.isObservable=y.identity=y.noop=y.pipe=y.NotificationKind=y.Notification=y.Subscriber=y.Subscription=y.Scheduler=y.VirtualAction=y.VirtualTimeScheduler=y.animationFrameScheduler=y.animationFrame=y.queueScheduler=y.queue=y.asyncScheduler=y.async=y.asapScheduler=y.asap=y.AsyncSubject=y.ReplaySubject=y.BehaviorSubject=y.Subject=y.animationFrames=y.observable=y.ConnectableObservable=y.Observable=void 0;y.filter=y.expand=y.exhaustMap=y.exhaustAll=y.exhaust=y.every=y.endWith=y.elementAt=y.distinctUntilKeyChanged=y.distinctUntilChanged=y.distinct=y.dematerialize=y.delayWhen=y.delay=y.defaultIfEmpty=y.debounceTime=y.debounce=y.count=y.connect=y.concatWith=y.concatMapTo=y.concatMap=y.concatAll=y.combineLatestWith=y.combineLatestAll=y.combineAll=y.catchError=y.bufferWhen=y.bufferToggle=y.bufferTime=y.bufferCount=y.buffer=y.auditTime=y.audit=y.config=y.NEVER=y.EMPTY=y.scheduled=y.zip=y.using=y.timer=y.throwError=y.range=y.race=y.partition=y.pairs=y.onErrorResumeNext=y.of=y.never=y.merge=void 0;y.switchMap=y.switchAll=y.subscribeOn=y.startWith=y.skipWhile=y.skipUntil=y.skipLast=y.skip=y.single=y.shareReplay=y.share=y.sequenceEqual=y.scan=y.sampleTime=y.sample=y.refCount=y.retryWhen=y.retry=y.repeatWhen=y.repeat=y.reduce=y.raceWith=y.publishReplay=y.publishLast=y.publishBehavior=y.publish=y.pluck=y.pairwise=y.onErrorResumeNextWith=y.observeOn=y.multicast=y.min=y.mergeWith=y.mergeScan=y.mergeMapTo=y.mergeMap=y.flatMap=y.mergeAll=y.max=y.materialize=y.mapTo=y.map=y.last=y.isEmpty=y.ignoreElements=y.groupBy=y.first=y.findIndex=y.find=y.finalize=void 0;y.zipWith=y.zipAll=y.withLatestFrom=y.windowWhen=y.windowToggle=y.windowTime=y.windowCount=y.window=y.toArray=y.timestamp=y.timeoutWith=y.timeout=y.timeInterval=y.throwIfEmpty=y.throttleTime=y.throttle=y.tap=y.takeWhile=y.takeUntil=y.takeLast=y.take=y.switchScan=y.switchMapTo=void 0;var yye=ze();Object.defineProperty(y,"Observable",{enumerable:!0,get:function(){return yye.Observable}});var vye=lm();Object.defineProperty(y,"ConnectableObservable",{enumerable:!0,get:function(){return vye.ConnectableObservable}});var Sye=sm();Object.defineProperty(y,"observable",{enumerable:!0,get:function(){return Sye.observable}});var bye=k8();Object.defineProperty(y,"animationFrames",{enumerable:!0,get:function(){return bye.animationFrames}});var Tye=sn();Object.defineProperty(y,"Subject",{enumerable:!0,get:function(){return Tye.Subject}});var Eye=YN();Object.defineProperty(y,"BehaviorSubject",{enumerable:!0,get:function(){return Eye.BehaviorSubject}});var Cye=Jv();Object.defineProperty(y,"ReplaySubject",{enumerable:!0,get:function(){return Cye.ReplaySubject}});var kye=Wv();Object.defineProperty(y,"AsyncSubject",{enumerable:!0,get:function(){return kye.AsyncSubject}});var bW=V8();Object.defineProperty(y,"asap",{enumerable:!0,get:function(){return bW.asap}});Object.defineProperty(y,"asapScheduler",{enumerable:!0,get:function(){return bW.asapScheduler}});var TW=Zn();Object.defineProperty(y,"async",{enumerable:!0,get:function(){return TW.async}});Object.defineProperty(y,"asyncScheduler",{enumerable:!0,get:function(){return TW.asyncScheduler}});var EW=H8();Object.defineProperty(y,"queue",{enumerable:!0,get:function(){return EW.queue}});Object.defineProperty(y,"queueScheduler",{enumerable:!0,get:function(){return EW.queueScheduler}});var CW=K8();Object.defineProperty(y,"animationFrame",{enumerable:!0,get:function(){return CW.animationFrame}});Object.defineProperty(y,"animationFrameScheduler",{enumerable:!0,get:function(){return CW.animationFrameScheduler}});var kW=X8();Object.defineProperty(y,"VirtualTimeScheduler",{enumerable:!0,get:function(){return kW.VirtualTimeScheduler}});Object.defineProperty(y,"VirtualAction",{enumerable:!0,get:function(){return kW.VirtualAction}});var _ye=$N();Object.defineProperty(y,"Scheduler",{enumerable:!0,get:function(){return _ye.Scheduler}});var Aye=gr();Object.defineProperty(y,"Subscription",{enumerable:!0,get:function(){return Aye.Subscription}});var Nye=Bf();Object.defineProperty(y,"Subscriber",{enumerable:!0,get:function(){return Nye.Subscriber}});var _W=mS();Object.defineProperty(y,"Notification",{enumerable:!0,get:function(){return _W.Notification}});Object.defineProperty(y,"NotificationKind",{enumerable:!0,get:function(){return _W.NotificationKind}});var Iye=um();Object.defineProperty(y,"pipe",{enumerable:!0,get:function(){return Iye.pipe}});var Oye=an();Object.defineProperty(y,"noop",{enumerable:!0,get:function(){return Oye.noop}});var Rye=on();Object.defineProperty(y,"identity",{enumerable:!0,get:function(){return Rye.identity}});var Pye=pq();Object.defineProperty(y,"isObservable",{enumerable:!0,get:function(){return Pye.isObservable}});var wye=mq();Object.defineProperty(y,"lastValueFrom",{enumerable:!0,get:function(){return wye.lastValueFrom}});var xye=gq();Object.defineProperty(y,"firstValueFrom",{enumerable:!0,get:function(){return xye.firstValueFrom}});var Bye=hI();Object.defineProperty(y,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return Bye.ArgumentOutOfRangeError}});var Dye=is();Object.defineProperty(y,"EmptyError",{enumerable:!0,get:function(){return Dye.EmptyError}});var Mye=pI();Object.defineProperty(y,"NotFoundError",{enumerable:!0,get:function(){return Mye.NotFoundError}});var Lye=zN();Object.defineProperty(y,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return Lye.ObjectUnsubscribedError}});var Fye=mI();Object.defineProperty(y,"SequenceError",{enumerable:!0,get:function(){return Fye.SequenceError}});var Uye=_S();Object.defineProperty(y,"TimeoutError",{enumerable:!0,get:function(){return Uye.TimeoutError}});var qye=xN();Object.defineProperty(y,"UnsubscriptionError",{enumerable:!0,get:function(){return qye.UnsubscriptionError}});var Vye=vq();Object.defineProperty(y,"bindCallback",{enumerable:!0,get:function(){return Vye.bindCallback}});var Jye=Sq();Object.defineProperty(y,"bindNodeCallback",{enumerable:!0,get:function(){return Jye.bindNodeCallback}});var Wye=PS();Object.defineProperty(y,"combineLatest",{enumerable:!0,get:function(){return Wye.combineLatest}});var Hye=gm();Object.defineProperty(y,"concat",{enumerable:!0,get:function(){return Hye.concat}});var Gye=Nq();Object.defineProperty(y,"connectable",{enumerable:!0,get:function(){return Gye.connectable}});var zye=ym();Object.defineProperty(y,"defer",{enumerable:!0,get:function(){return zye.defer}});var Qye=xi();Object.defineProperty(y,"empty",{enumerable:!0,get:function(){return Qye.empty}});var Kye=Iq();Object.defineProperty(y,"forkJoin",{enumerable:!0,get:function(){return Kye.forkJoin}});var Zye=Ya();Object.defineProperty(y,"from",{enumerable:!0,get:function(){return Zye.from}});var Yye=Rq();Object.defineProperty(y,"fromEvent",{enumerable:!0,get:function(){return Yye.fromEvent}});var Xye=wq();Object.defineProperty(y,"fromEventPattern",{enumerable:!0,get:function(){return Xye.fromEventPattern}});var $ye=Bq();Object.defineProperty(y,"generate",{enumerable:!0,get:function(){return $ye.generate}});var jye=Dq();Object.defineProperty(y,"iif",{enumerable:!0,get:function(){return jye.iif}});var eve=TI();Object.defineProperty(y,"interval",{enumerable:!0,get:function(){return eve.interval}});var tve=Lq();Object.defineProperty(y,"merge",{enumerable:!0,get:function(){return tve.merge}});var nve=EI();Object.defineProperty(y,"never",{enumerable:!0,get:function(){return nve.never}});var rve=hS();Object.defineProperty(y,"of",{enumerable:!0,get:function(){return rve.of}});var ive=CI();Object.defineProperty(y,"onErrorResumeNext",{enumerable:!0,get:function(){return ive.onErrorResumeNext}});var ave=Uq();Object.defineProperty(y,"pairs",{enumerable:!0,get:function(){return ave.pairs}});var ove=Wq();Object.defineProperty(y,"partition",{enumerable:!0,get:function(){return ove.partition}});var sve=kI();Object.defineProperty(y,"race",{enumerable:!0,get:function(){return sve.race}});var uve=zq();Object.defineProperty(y,"range",{enumerable:!0,get:function(){return uve.range}});var lve=fI();Object.defineProperty(y,"throwError",{enumerable:!0,get:function(){return lve.throwError}});var cve=ls();Object.defineProperty(y,"timer",{enumerable:!0,get:function(){return cve.timer}});var dve=Qq();Object.defineProperty(y,"using",{enumerable:!0,get:function(){return dve.using}});var fve=tb();Object.defineProperty(y,"zip",{enumerable:!0,get:function(){return fve.zip}});var hve=dI();Object.defineProperty(y,"scheduled",{enumerable:!0,get:function(){return hve.scheduled}});var pve=xi();Object.defineProperty(y,"EMPTY",{enumerable:!0,get:function(){return pve.EMPTY}});var mve=EI();Object.defineProperty(y,"NEVER",{enumerable:!0,get:function(){return mve.NEVER}});gye(Zq(),y);var gve=wf();Object.defineProperty(y,"config",{enumerable:!0,get:function(){return gve.config}});var yve=_I();Object.defineProperty(y,"audit",{enumerable:!0,get:function(){return yve.audit}});var vve=Xq();Object.defineProperty(y,"auditTime",{enumerable:!0,get:function(){return vve.auditTime}});var Sve=jq();Object.defineProperty(y,"buffer",{enumerable:!0,get:function(){return Sve.buffer}});var bve=eV();Object.defineProperty(y,"bufferCount",{enumerable:!0,get:function(){return bve.bufferCount}});var Tve=nV();Object.defineProperty(y,"bufferTime",{enumerable:!0,get:function(){return Tve.bufferTime}});var Eve=aV();Object.defineProperty(y,"bufferToggle",{enumerable:!0,get:function(){return Eve.bufferToggle}});var Cve=sV();Object.defineProperty(y,"bufferWhen",{enumerable:!0,get:function(){return Cve.bufferWhen}});var kve=lV();Object.defineProperty(y,"catchError",{enumerable:!0,get:function(){return kve.catchError}});var _ve=cV();Object.defineProperty(y,"combineAll",{enumerable:!0,get:function(){return _ve.combineAll}});var Ave=PI();Object.defineProperty(y,"combineLatestAll",{enumerable:!0,get:function(){return Ave.combineLatestAll}});var Nve=mV();Object.defineProperty(y,"combineLatestWith",{enumerable:!0,get:function(){return Nve.combineLatestWith}});var Ive=LS();Object.defineProperty(y,"concatAll",{enumerable:!0,get:function(){return Ive.concatAll}});var Ove=wI();Object.defineProperty(y,"concatMap",{enumerable:!0,get:function(){return Ove.concatMap}});var Rve=vV();Object.defineProperty(y,"concatMapTo",{enumerable:!0,get:function(){return Rve.concatMapTo}});var Pve=bV();Object.defineProperty(y,"concatWith",{enumerable:!0,get:function(){return Pve.concatWith}});var wve=yb();Object.defineProperty(y,"connect",{enumerable:!0,get:function(){return wve.connect}});var xve=EV();Object.defineProperty(y,"count",{enumerable:!0,get:function(){return xve.count}});var Bve=kV();Object.defineProperty(y,"debounce",{enumerable:!0,get:function(){return Bve.debounce}});var Dve=_V();Object.defineProperty(y,"debounceTime",{enumerable:!0,get:function(){return Dve.debounceTime}});var Mve=vm();Object.defineProperty(y,"defaultIfEmpty",{enumerable:!0,get:function(){return Mve.defaultIfEmpty}});var Lve=IV();Object.defineProperty(y,"delay",{enumerable:!0,get:function(){return Lve.delay}});var Fve=DI();Object.defineProperty(y,"delayWhen",{enumerable:!0,get:function(){return Fve.delayWhen}});var Uve=OV();Object.defineProperty(y,"dematerialize",{enumerable:!0,get:function(){return Uve.dematerialize}});var qve=PV();Object.defineProperty(y,"distinct",{enumerable:!0,get:function(){return qve.distinct}});var Vve=MI();Object.defineProperty(y,"distinctUntilChanged",{enumerable:!0,get:function(){return Vve.distinctUntilChanged}});var Jve=wV();Object.defineProperty(y,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Jve.distinctUntilKeyChanged}});var Wve=BV();Object.defineProperty(y,"elementAt",{enumerable:!0,get:function(){return Wve.elementAt}});var Hve=DV();Object.defineProperty(y,"endWith",{enumerable:!0,get:function(){return Hve.endWith}});var Gve=MV();Object.defineProperty(y,"every",{enumerable:!0,get:function(){return Gve.every}});var zve=qV();Object.defineProperty(y,"exhaust",{enumerable:!0,get:function(){return zve.exhaust}});var Qve=FI();Object.defineProperty(y,"exhaustAll",{enumerable:!0,get:function(){return Qve.exhaustAll}});var Kve=LI();Object.defineProperty(y,"exhaustMap",{enumerable:!0,get:function(){return Kve.exhaustMap}});var Zve=VV();Object.defineProperty(y,"expand",{enumerable:!0,get:function(){return Zve.expand}});var Yve=wu();Object.defineProperty(y,"filter",{enumerable:!0,get:function(){return Yve.filter}});var Xve=JV();Object.defineProperty(y,"finalize",{enumerable:!0,get:function(){return Xve.finalize}});var $ve=UI();Object.defineProperty(y,"find",{enumerable:!0,get:function(){return $ve.find}});var jve=HV();Object.defineProperty(y,"findIndex",{enumerable:!0,get:function(){return jve.findIndex}});var eSe=GV();Object.defineProperty(y,"first",{enumerable:!0,get:function(){return eSe.first}});var tSe=QV();Object.defineProperty(y,"groupBy",{enumerable:!0,get:function(){return tSe.groupBy}});var nSe=xI();Object.defineProperty(y,"ignoreElements",{enumerable:!0,get:function(){return nSe.ignoreElements}});var rSe=KV();Object.defineProperty(y,"isEmpty",{enumerable:!0,get:function(){return rSe.isEmpty}});var iSe=ZV();Object.defineProperty(y,"last",{enumerable:!0,get:function(){return iSe.last}});var aSe=as();Object.defineProperty(y,"map",{enumerable:!0,get:function(){return aSe.map}});var oSe=BI();Object.defineProperty(y,"mapTo",{enumerable:!0,get:function(){return oSe.mapTo}});var sSe=YV();Object.defineProperty(y,"materialize",{enumerable:!0,get:function(){return sSe.materialize}});var uSe=XV();Object.defineProperty(y,"max",{enumerable:!0,get:function(){return uSe.max}});var lSe=mm();Object.defineProperty(y,"mergeAll",{enumerable:!0,get:function(){return lSe.mergeAll}});var cSe=$V();Object.defineProperty(y,"flatMap",{enumerable:!0,get:function(){return cSe.flatMap}});var dSe=$a();Object.defineProperty(y,"mergeMap",{enumerable:!0,get:function(){return dSe.mergeMap}});var fSe=eJ();Object.defineProperty(y,"mergeMapTo",{enumerable:!0,get:function(){return fSe.mergeMapTo}});var hSe=tJ();Object.defineProperty(y,"mergeScan",{enumerable:!0,get:function(){return hSe.mergeScan}});var pSe=iJ();Object.defineProperty(y,"mergeWith",{enumerable:!0,get:function(){return pSe.mergeWith}});var mSe=aJ();Object.defineProperty(y,"min",{enumerable:!0,get:function(){return mSe.min}});var gSe=Xb();Object.defineProperty(y,"multicast",{enumerable:!0,get:function(){return gSe.multicast}});var ySe=hm();Object.defineProperty(y,"observeOn",{enumerable:!0,get:function(){return ySe.observeOn}});var vSe=uJ();Object.defineProperty(y,"onErrorResumeNextWith",{enumerable:!0,get:function(){return vSe.onErrorResumeNextWith}});var SSe=lJ();Object.defineProperty(y,"pairwise",{enumerable:!0,get:function(){return SSe.pairwise}});var bSe=cJ();Object.defineProperty(y,"pluck",{enumerable:!0,get:function(){return bSe.pluck}});var TSe=dJ();Object.defineProperty(y,"publish",{enumerable:!0,get:function(){return TSe.publish}});var ESe=fJ();Object.defineProperty(y,"publishBehavior",{enumerable:!0,get:function(){return ESe.publishBehavior}});var CSe=hJ();Object.defineProperty(y,"publishLast",{enumerable:!0,get:function(){return CSe.publishLast}});var kSe=mJ();Object.defineProperty(y,"publishReplay",{enumerable:!0,get:function(){return kSe.publishReplay}});var _Se=gJ();Object.defineProperty(y,"raceWith",{enumerable:!0,get:function(){return _Se.raceWith}});var ASe=lh();Object.defineProperty(y,"reduce",{enumerable:!0,get:function(){return ASe.reduce}});var NSe=vJ();Object.defineProperty(y,"repeat",{enumerable:!0,get:function(){return NSe.repeat}});var ISe=bJ();Object.defineProperty(y,"repeatWhen",{enumerable:!0,get:function(){return ISe.repeatWhen}});var OSe=EJ();Object.defineProperty(y,"retry",{enumerable:!0,get:function(){return OSe.retry}});var RSe=kJ();Object.defineProperty(y,"retryWhen",{enumerable:!0,get:function(){return RSe.retryWhen}});var PSe=HN();Object.defineProperty(y,"refCount",{enumerable:!0,get:function(){return PSe.refCount}});var wSe=JI();Object.defineProperty(y,"sample",{enumerable:!0,get:function(){return wSe.sample}});var xSe=AJ();Object.defineProperty(y,"sampleTime",{enumerable:!0,get:function(){return xSe.sampleTime}});var BSe=NJ();Object.defineProperty(y,"scan",{enumerable:!0,get:function(){return BSe.scan}});var DSe=OJ();Object.defineProperty(y,"sequenceEqual",{enumerable:!0,get:function(){return DSe.sequenceEqual}});var MSe=HI();Object.defineProperty(y,"share",{enumerable:!0,get:function(){return MSe.share}});var LSe=wJ();Object.defineProperty(y,"shareReplay",{enumerable:!0,get:function(){return LSe.shareReplay}});var FSe=xJ();Object.defineProperty(y,"single",{enumerable:!0,get:function(){return FSe.single}});var USe=BJ();Object.defineProperty(y,"skip",{enumerable:!0,get:function(){return USe.skip}});var qSe=DJ();Object.defineProperty(y,"skipLast",{enumerable:!0,get:function(){return qSe.skipLast}});var VSe=LJ();Object.defineProperty(y,"skipUntil",{enumerable:!0,get:function(){return VSe.skipUntil}});var JSe=FJ();Object.defineProperty(y,"skipWhile",{enumerable:!0,get:function(){return JSe.skipWhile}});var WSe=qJ();Object.defineProperty(y,"startWith",{enumerable:!0,get:function(){return WSe.startWith}});var HSe=pm();Object.defineProperty(y,"subscribeOn",{enumerable:!0,get:function(){return HSe.subscribeOn}});var GSe=JJ();Object.defineProperty(y,"switchAll",{enumerable:!0,get:function(){return GSe.switchAll}});var zSe=Tm();Object.defineProperty(y,"switchMap",{enumerable:!0,get:function(){return zSe.switchMap}});var QSe=HJ();Object.defineProperty(y,"switchMapTo",{enumerable:!0,get:function(){return QSe.switchMapTo}});var KSe=GJ();Object.defineProperty(y,"switchScan",{enumerable:!0,get:function(){return KSe.switchScan}});var ZSe=Sm();Object.defineProperty(y,"take",{enumerable:!0,get:function(){return ZSe.take}});var YSe=qI();Object.defineProperty(y,"takeLast",{enumerable:!0,get:function(){return YSe.takeLast}});var XSe=zJ();Object.defineProperty(y,"takeUntil",{enumerable:!0,get:function(){return XSe.takeUntil}});var $Se=QJ();Object.defineProperty(y,"takeWhile",{enumerable:!0,get:function(){return $Se.takeWhile}});var jSe=KJ();Object.defineProperty(y,"tap",{enumerable:!0,get:function(){return jSe.tap}});var ebe=GI();Object.defineProperty(y,"throttle",{enumerable:!0,get:function(){return ebe.throttle}});var tbe=YJ();Object.defineProperty(y,"throttleTime",{enumerable:!0,get:function(){return tbe.throttleTime}});var nbe=bm();Object.defineProperty(y,"throwIfEmpty",{enumerable:!0,get:function(){return nbe.throwIfEmpty}});var rbe=$J();Object.defineProperty(y,"timeInterval",{enumerable:!0,get:function(){return rbe.timeInterval}});var ibe=_S();Object.defineProperty(y,"timeout",{enumerable:!0,get:function(){return ibe.timeout}});var abe=jJ();Object.defineProperty(y,"timeoutWith",{enumerable:!0,get:function(){return abe.timeoutWith}});var obe=eW();Object.defineProperty(y,"timestamp",{enumerable:!0,get:function(){return obe.timestamp}});var sbe=OI();Object.defineProperty(y,"toArray",{enumerable:!0,get:function(){return sbe.toArray}});var ube=rW();Object.defineProperty(y,"window",{enumerable:!0,get:function(){return ube.window}});var lbe=aW();Object.defineProperty(y,"windowCount",{enumerable:!0,get:function(){return lbe.windowCount}});var cbe=sW();Object.defineProperty(y,"windowTime",{enumerable:!0,get:function(){return cbe.windowTime}});var dbe=cW();Object.defineProperty(y,"windowToggle",{enumerable:!0,get:function(){return dbe.windowToggle}});var fbe=fW();Object.defineProperty(y,"windowWhen",{enumerable:!0,get:function(){return fbe.windowWhen}});var hbe=gW();Object.defineProperty(y,"withLatestFrom",{enumerable:!0,get:function(){return hbe.withLatestFrom}});var pbe=yW();Object.defineProperty(y,"zipAll",{enumerable:!0,get:function(){return pbe.zipAll}});var mbe=SW();Object.defineProperty(y,"zipWith",{enumerable:!0,get:function(){return mbe.zipWith}})});var yr=null;try{yr=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function et(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}et.prototype.__isLong__;Object.defineProperty(et.prototype,"__isLong__",{value:!0});function un(e){return(e&&e.__isLong__)===!0}function ZI(e){var t=Math.clz32(e&-e);return e?31-t:t}et.isLong=un;var YI={},XI={};function Cs(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=XI[e],r)?r:(n=Be(e,0,!0),i&&(XI[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=YI[e],r)?r:(n=Be(e,e<0?-1:0,!1),i&&(YI[e]=n),n))}et.fromInt=Cs;function vr(e,t){if(isNaN(e))return t?ga:Vr;if(t){if(e<0)return ga;if(e>=t2)return i2}else{if(e<=-jI)return Un;if(e+1>=jI)return r2}return e<0?vr(-e,t).neg():Be(e%Bu|0,e/Bu|0,t)}et.fromNumber=vr;function Be(e,t,n){return new et(e,t,n)}et.fromBits=Be;var km=Math.pow;function LT(e,t,n){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(n=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?ga:Vr;if(n=n||10,n<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(r===0)return LT(e.substring(1),t,n).neg();for(var i=vr(km(n,8)),a=Vr,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+s),n);if(s<8){var l=vr(km(n,s));a=a.mul(l).add(vr(u))}else a=a.mul(i),a=a.add(vr(u))}return a.unsigned=t,a}et.fromString=LT;function Jr(e,t){return typeof e=="number"?vr(e,t):typeof e=="string"?LT(e,t):Be(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}et.fromValue=Jr;var $I=65536,FW=1<<24,Bu=$I*$I,t2=Bu*Bu,jI=t2/2,e2=Cs(FW),Vr=Cs(0);et.ZERO=Vr;var ga=Cs(0,!0);et.UZERO=ga;var xu=Cs(1);et.ONE=xu;var n2=Cs(1,!0);et.UONE=n2;var MT=Cs(-1);et.NEG_ONE=MT;var r2=Be(-1,2147483647,!1);et.MAX_VALUE=r2;var i2=Be(-1,-1,!0);et.MAX_UNSIGNED_VALUE=i2;var Un=Be(0,-2147483648,!1);et.MIN_VALUE=Un;var J=et.prototype;J.toInt=function(){return this.unsigned?this.low>>>0:this.low};J.toNumber=function(){return this.unsigned?(this.high>>>0)*Bu+(this.low>>>0):this.high*Bu+(this.low>>>0)};J.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Un)){var n=vr(t),r=this.div(n),i=r.mul(n).sub(this);return r.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=vr(km(t,6),this.unsigned),o=this,s="";;){var u=o.div(a),l=o.sub(u.mul(a)).toInt()>>>0,c=l.toString(t);if(o=u,o.isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}};J.getHighBits=function(){return this.high};J.getHighBitsUnsigned=function(){return this.high>>>0};J.getLowBits=function(){return this.low};J.getLowBitsUnsigned=function(){return this.low>>>0};J.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Un)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,n=31;n>0&&!(t&1<<n);n--);return this.high!=0?n+33:n+1};J.isZero=function(){return this.high===0&&this.low===0};J.eqz=J.isZero;J.isNegative=function(){return!this.unsigned&&this.high<0};J.isPositive=function(){return this.unsigned||this.high>=0};J.isOdd=function(){return(this.low&1)===1};J.isEven=function(){return(this.low&1)===0};J.equals=function(t){return un(t)||(t=Jr(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};J.eq=J.equals;J.notEquals=function(t){return!this.eq(t)};J.neq=J.notEquals;J.ne=J.notEquals;J.lessThan=function(t){return this.comp(t)<0};J.lt=J.lessThan;J.lessThanOrEqual=function(t){return this.comp(t)<=0};J.lte=J.lessThanOrEqual;J.le=J.lessThanOrEqual;J.greaterThan=function(t){return this.comp(t)>0};J.gt=J.greaterThan;J.greaterThanOrEqual=function(t){return this.comp(t)>=0};J.gte=J.greaterThanOrEqual;J.ge=J.greaterThanOrEqual;J.compare=function(t){if(un(t)||(t=Jr(t)),this.eq(t))return 0;var n=this.isNegative(),r=t.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};J.comp=J.compare;J.negate=function(){return!this.unsigned&&this.eq(Un)?Un:this.not().add(xu)};J.neg=J.negate;J.add=function(t){un(t)||(t=Jr(t));var n=this.high>>>16,r=this.high&65535,i=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,u=t.low>>>16,l=t.low&65535,c=0,d=0,f=0,h=0;return h+=a+l,f+=h>>>16,h&=65535,f+=i+u,d+=f>>>16,f&=65535,d+=r+s,c+=d>>>16,d&=65535,c+=n+o,c&=65535,Be(f<<16|h,c<<16|d,this.unsigned)};J.subtract=function(t){return un(t)||(t=Jr(t)),this.add(t.neg())};J.sub=J.subtract;J.multiply=function(t){if(this.isZero())return this;if(un(t)||(t=Jr(t)),yr){var n=yr.mul(this.low,this.high,t.low,t.high);return Be(n,yr.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?ga:Vr;if(this.eq(Un))return t.isOdd()?Un:Vr;if(t.eq(Un))return this.isOdd()?Un:Vr;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(e2)&&t.lt(e2))return vr(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,u=t.high&65535,l=t.low>>>16,c=t.low&65535,d=0,f=0,h=0,g=0;return g+=o*c,h+=g>>>16,g&=65535,h+=a*c,f+=h>>>16,h&=65535,h+=o*l,f+=h>>>16,h&=65535,f+=i*c,d+=f>>>16,f&=65535,f+=a*l,d+=f>>>16,f&=65535,f+=o*u,d+=f>>>16,f&=65535,d+=r*c+i*l+a*u+o*s,d&=65535,Be(h<<16|g,d<<16|f,this.unsigned)};J.mul=J.multiply;J.divide=function(t){if(un(t)||(t=Jr(t)),t.isZero())throw Error("division by zero");if(yr){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var n=(this.unsigned?yr.div_u:yr.div_s)(this.low,this.high,t.low,t.high);return Be(n,yr.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?ga:Vr;var r,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return ga;if(t.gt(this.shru(1)))return n2;a=ga}else{if(this.eq(Un)){if(t.eq(xu)||t.eq(MT))return Un;if(t.eq(Un))return xu;var o=this.shr(1);return r=o.div(t).shl(1),r.eq(Vr)?t.isNegative()?xu:MT:(i=this.sub(t.mul(r)),a=r.add(i.div(t)),a)}else if(t.eq(Un))return this.unsigned?ga:Vr;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=Vr}for(i=this;i.gte(t);){r=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),u=s<=48?1:km(2,s-48),l=vr(r),c=l.mul(t);c.isNegative()||c.gt(i);)r-=u,l=vr(r,this.unsigned),c=l.mul(t);l.isZero()&&(l=xu),a=a.add(l),i=i.sub(c)}return a};J.div=J.divide;J.modulo=function(t){if(un(t)||(t=Jr(t)),yr){var n=(this.unsigned?yr.rem_u:yr.rem_s)(this.low,this.high,t.low,t.high);return Be(n,yr.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};J.mod=J.modulo;J.rem=J.modulo;J.not=function(){return Be(~this.low,~this.high,this.unsigned)};J.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};J.clz=J.countLeadingZeros;J.countTrailingZeros=function(){return this.low?ZI(this.low):ZI(this.high)+32};J.ctz=J.countTrailingZeros;J.and=function(t){return un(t)||(t=Jr(t)),Be(this.low&t.low,this.high&t.high,this.unsigned)};J.or=function(t){return un(t)||(t=Jr(t)),Be(this.low|t.low,this.high|t.high,this.unsigned)};J.xor=function(t){return un(t)||(t=Jr(t)),Be(this.low^t.low,this.high^t.high,this.unsigned)};J.shiftLeft=function(t){return un(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Be(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Be(0,this.low<<t-32,this.unsigned)};J.shl=J.shiftLeft;J.shiftRight=function(t){return un(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Be(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Be(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};J.shr=J.shiftRight;J.shiftRightUnsigned=function(t){return un(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Be(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Be(this.high,0,this.unsigned):Be(this.high>>>t-32,0,this.unsigned)};J.shru=J.shiftRightUnsigned;J.shr_u=J.shiftRightUnsigned;J.rotateLeft=function(t){var n;return un(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Be(this.high,this.low,this.unsigned):t<32?(n=32-t,Be(this.low<<t|this.high>>>n,this.high<<t|this.low>>>n,this.unsigned)):(t-=32,n=32-t,Be(this.high<<t|this.low>>>n,this.low<<t|this.high>>>n,this.unsigned))};J.rotl=J.rotateLeft;J.rotateRight=function(t){var n;return un(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Be(this.high,this.low,this.unsigned):t<32?(n=32-t,Be(this.high<<n|this.low>>>t,this.low<<n|this.high>>>t,this.unsigned)):(t-=32,n=32-t,Be(this.low<<n|this.high>>>t,this.high<<n|this.low>>>t,this.unsigned))};J.rotr=J.rotateRight;J.toSigned=function(){return this.unsigned?Be(this.low,this.high,!1):this};J.toUnsigned=function(){return this.unsigned?this:Be(this.low,this.high,!0)};J.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};J.toBytesLE=function(){var t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};J.toBytesBE=function(){var t=this.high,n=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,n>>>24,n>>>16&255,n>>>8&255,n&255]};et.fromBytes=function(t,n,r){return r?et.fromBytesLE(t,n):et.fromBytesBE(t,n)};et.fromBytesLE=function(t,n){return new et(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,n)};et.fromBytesBE=function(t,n){return new et(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],n)};var Ut=et;var _=An(Nn(),1);var KW=An(Nn(),1);var $n=An(Nn(),1),As;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(As||(As={}));function ZW(e){switch(e){case 0:case"NULL_VALUE":return As.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return As.UNRECOGNIZED}}function YW(e){switch(e){case As.NULL_VALUE:return"NULL_VALUE";case As.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function eE(){return{fields:{}}}var In={encode(e,t=$n.default.Writer.create()){return Object.entries(e.fields).forEach(([n,r])=>{r!==void 0&&rE.encode({key:n,value:r},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let n=e instanceof $n.default.Reader?e:$n.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=eE();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;let o=rE.decode(n,n.uint32());o.value!==void 0&&(i.fields[o.key]=o.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{fields:X2(e.fields)?Object.entries(e.fields).reduce((t,[n,r])=>(t[n]=r,t),{}):{}}},toJSON(e){let t={};if(e.fields){let n=Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([r,i])=>{t.fields[r]=i}))}return t},create(e){return In.fromPartial(e??{})},fromPartial(e){let t=eE();return t.fields=Object.entries(e.fields??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=i),n),{}),t},wrap(e){let t=eE();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function Y2(){return{key:"",value:void 0}}var rE={encode(e,t=$n.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&ya.encode(ya.wrap(e.value),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof $n.default.Reader?e:$n.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Y2();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=ya.unwrap(ya.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:Lu(e.key)?globalThis.String(e.key):"",value:Lu(e?.value)?e.value:void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},create(e){return rE.fromPartial(e??{})},fromPartial(e){let t=Y2();return t.key=e.key??"",t.value=e.value??void 0,t}};function tE(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var ya={encode(e,t=$n.default.Writer.create()){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&In.encode(In.wrap(e.structValue),t.uint32(42).fork()).ldelim(),e.listValue!==void 0&&Mu.encode(Mu.wrap(e.listValue),t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof $n.default.Reader?e:$n.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=tE();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.nullValue=n.int32();continue;case 2:if(a!==17)break;i.numberValue=n.double();continue;case 3:if(a!==26)break;i.stringValue=n.string();continue;case 4:if(a!==32)break;i.boolValue=n.bool();continue;case 5:if(a!==42)break;i.structValue=In.unwrap(In.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.listValue=Mu.unwrap(Mu.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{nullValue:Lu(e.nullValue)?ZW(e.nullValue):void 0,numberValue:Lu(e.numberValue)?globalThis.Number(e.numberValue):void 0,stringValue:Lu(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:Lu(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,structValue:X2(e.structValue)?e.structValue:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=YW(e.nullValue)),e.numberValue!==void 0&&(t.numberValue=e.numberValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.structValue!==void 0&&(t.structValue=e.structValue),e.listValue!==void 0&&(t.listValue=e.listValue),t},create(e){return ya.fromPartial(e??{})},fromPartial(e){let t=tE();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=tE();if(e===null)t.nullValue=As.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new globalThis.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function nE(){return{values:[]}}var Mu={encode(e,t=$n.default.Writer.create()){for(let n of e.values)ya.encode(ya.wrap(n),t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $n.default.Reader?e:$n.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=nE();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.values.push(ya.unwrap(ya.decode(n,n.uint32())));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values),t},create(e){return Mu.fromPartial(e??{})},fromPartial(e){let t=nE();return t.values=e.values?.map(n=>n)||[],t},wrap(e){let t=nE();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e}};function X2(e){return typeof e=="object"&&e!==null}function Lu(e){return e!=null}var Ns=An(Nn(),1);function $2(){return{seconds:BigInt("0"),nanos:0}}var to={encode(e,t=Ns.default.Writer.create()){if(e.seconds!==BigInt("0")){if(BigInt.asIntN(64,e.seconds)!==e.seconds)throw new globalThis.Error("value provided for field message.seconds of type int64 too large");t.uint32(8).int64(e.seconds.toString())}return e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let n=e instanceof Ns.default.Reader?e:Ns.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=$2();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.seconds=XW(n.int64());continue;case 2:if(a!==16)break;i.nanos=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{seconds:j2(e.seconds)?BigInt(e.seconds):BigInt("0"),nanos:j2(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==BigInt("0")&&(t.seconds=e.seconds.toString()),e.nanos!==0&&(t.nanos=Math.round(e.nanos)),t},create(e){return to.fromPartial(e??{})},fromPartial(e){let t=$2();return t.seconds=e.seconds??BigInt("0"),t.nanos=e.nanos??0,t}};function XW(e){return BigInt(e.toString())}Ns.default.util.Long!==Ut&&(Ns.default.util.Long=Ut,Ns.default.configure());function j2(e){return e!=null}var Fe=An(Nn(),1);var eO;(function(e){e[e.FREE=0]="FREE",e[e.DEV=1]="DEV",e[e.PRO=2]="PRO",e[e.ENTERPRISE=3]="ENTERPRISE",e[e.ANONYMOUS=16]="ANONYMOUS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(eO||(eO={}));var tO;(function(e){e[e.ORG_MEMBER=0]="ORG_MEMBER",e[e.ORG_ADMIN=1]="ORG_ADMIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(tO||(tO={}));var nO;(function(e){e[e.AND=0]="AND",e[e.OR=1]="OR",e[e.THEN=2]="THEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(nO||(nO={}));var rO;(function(e){e[e.READ=0]="READ",e[e.WRITE=1]="WRITE",e[e.ADMIN=2]="ADMIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(rO||(rO={}));var iO;(function(e){e[e.CREDIT_CARD=0]="CREDIT_CARD",e[e.INVOICE_FIAT=1]="INVOICE_FIAT",e[e.INVOICE_CRYPTO=2]="INVOICE_CRYPTO",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(iO||(iO={}));var aO;(function(e){e[e.GENERAL=0]="GENERAL",e[e.PROCESSOR_UPLOAD_FAILED=101]="PROCESSOR_UPLOAD_FAILED",e[e.PROCESSOR_UPLOAD_SUCCESS=102]="PROCESSOR_UPLOAD_SUCCESS",e[e.PROCESSOR_OBSOLETED=103]="PROCESSOR_OBSOLETED",e[e.PROCESSOR_STOPPED=104]="PROCESSOR_STOPPED",e[e.PROCESSOR_ACTIVATED=105]="PROCESSOR_ACTIVATED",e[e.PROCESSOR_GENERAL=106]="PROCESSOR_GENERAL",e[e.PROCESSOR_ERROR=107]="PROCESSOR_ERROR",e[e.EXPORT_TASK_FAILED=201]="EXPORT_TASK_FAILED",e[e.EXPORT_TASK_SUCCESS=202]="EXPORT_TASK_SUCCESS",e[e.BILLING_INVOICE=301]="BILLING_INVOICE",e[e.BILLING_PAYMENT=302]="BILLING_PAYMENT",e[e.BILLING_SUBSCRIPTION=303]="BILLING_SUBSCRIPTION",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(aO||(aO={}));var oO;(function(e){e[e.PENDING=0]="PENDING",e[e.SET_USERNAME=1]="SET_USERNAME",e[e.BANNED=9]="BANNED",e[e.ACTIVE=10]="ACTIVE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(oO||(oO={}));var sO;(function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(sO||(sO={}));var uO;(function(e){e[e.SENTIO=0]="SENTIO",e[e.SUBGRAPH=1]="SUBGRAPH",e[e.ACTION=2]="ACTION",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(uO||(uO={}));var lO;(function(e){e[e.AVG=0]="AVG",e[e.SUM=1]="SUM",e[e.MIN=2]="MIN",e[e.MAX=3]="MAX",e[e.COUNT=4]="COUNT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(lO||(lO={}));var cO;(function(e){e[e.EQ=0]="EQ",e[e.NEQ=1]="NEQ",e[e.EXISTS=9]="EXISTS",e[e.NOT_EXISTS=10]="NOT_EXISTS",e[e.GT=2]="GT",e[e.GTE=3]="GTE",e[e.LT=4]="LT",e[e.LTE=5]="LTE",e[e.BETWEEN=7]="BETWEEN",e[e.NOT_BETWEEN=8]="NOT_BETWEEN",e[e.CONTAINS=11]="CONTAINS",e[e.NOT_CONTAINS=12]="NOT_CONTAINS",e[e.IN_COHORTS=13]="IN_COHORTS",e[e.NOT_IN_COHORTS=14]="NOT_IN_COHORTS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(cO||(cO={}));var dO;(function(e){e[e.EVENTS=0]="EVENTS",e[e.COHORTS=1]="COHORTS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(dO||(dO={}));var fO;(function(e){e[e.SUM=0]="SUM",e[e.CUMULATIVE_SUM=6]="CUMULATIVE_SUM",e[e.AVG=1]="AVG",e[e.MEDIAN=2]="MEDIAN",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.DISTINCT_COUNT=5]="DISTINCT_COUNT",e[e.CUMULATIVE_DISTINCT_COUNT=9]="CUMULATIVE_DISTINCT_COUNT",e[e.CUMULATIVE_COUNT=12]="CUMULATIVE_COUNT",e[e.LAST=7]="LAST",e[e.CUMULATIVE_LAST=10]="CUMULATIVE_LAST",e[e.FIRST=8]="FIRST",e[e.CUMULATIVE_FIRST=11]="CUMULATIVE_FIRST",e[e.PERCENTILE_25TH=20]="PERCENTILE_25TH",e[e.PERCENTILE_75TH=21]="PERCENTILE_75TH",e[e.PERCENTILE_90TH=22]="PERCENTILE_90TH",e[e.PERCENTILE_95TH=23]="PERCENTILE_95TH",e[e.PERCENTILE_99TH=24]="PERCENTILE_99TH",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(fO||(fO={}));var hO;(function(e){e[e.EQ=0]="EQ",e[e.NEQ=1]="NEQ",e[e.GT=2]="GT",e[e.GTE=3]="GTE",e[e.LT=4]="LT",e[e.LTE=5]="LTE",e[e.BETWEEN=7]="BETWEEN",e[e.NOT_BETWEEN=8]="NOT_BETWEEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(hO||(hO={}));var pO;(function(e){e[e.SUM=0]="SUM",e[e.AVG=1]="AVG",e[e.MEDIAN=2]="MEDIAN",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.DISTINCT_COUNT=5]="DISTINCT_COUNT",e[e.LAST=6]="LAST",e[e.FIRST=7]="FIRST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(pO||(pO={}));var mO;(function(e){e[e.PROCESSOR=0]="PROCESSOR",e[e.UI=1]="UI",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(mO||(mO={}));var gO;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.EMAIL=1]="EMAIL",e[e.SLACK=2]="SLACK",e[e.TELEGRAM=3]="TELEGRAM",e[e.WEBHOOK=4]="WEBHOOK",e[e.DISCORD=5]="DISCORD",e[e.PAGERDUTY=6]="PAGERDUTY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(gO||(gO={}));var yO;(function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.LIST=3]="LIST",e[e.TIME=4]="TIME",e[e.MAP=5]="MAP",e[e.JSON=6]="JSON",e[e.TOKEN=7]="TOKEN",e[e.DYNAMIC=8]="DYNAMIC",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(yO||(yO={}));var vO;(function(e){e[e.OnOrAfter=0]="OnOrAfter",e[e.On=1]="On",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(vO||(vO={}));var SO;(function(e){e[e.Disable=0]="Disable",e[e.FirstInTimeRange=1]="FirstInTimeRange",e[e.FirstInGlobal=2]="FirstInGlobal",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(SO||(SO={}));var bO;(function(e){e[e.Day=0]="Day",e[e.Week=1]="Week",e[e.Month=2]="Month",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(bO||(bO={}));var TO;(function(e){e[e.SUM=0]="SUM",e[e.AVG=1]="AVG",e[e.MEDIAN=2]="MEDIAN",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.DISTINCT_COUNT=5]="DISTINCT_COUNT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(TO||(TO={}));var Os;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Os||(Os={}));function $W(e){switch(e){case 0:case"NULL_VALUE":return Os.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return Os.UNRECOGNIZED}}function jW(e){switch(e){case Os.NULL_VALUE:return"NULL_VALUE";case Os.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function EO(){return{symbol:void 0,address:void 0}}var jn={encode(e,t=Fe.default.Writer.create()){return e.symbol!==void 0&&t.uint32(10).string(e.symbol),e.address!==void 0&&Fu.encode(e.address,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof Fe.default.Reader?e:Fe.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=EO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.symbol=n.string();continue;case 2:if(a!==18)break;i.address=Fu.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{symbol:tt(e.symbol)?globalThis.String(e.symbol):void 0,address:tt(e.address)?Fu.fromJSON(e.address):void 0}},toJSON(e){let t={};return e.symbol!==void 0&&(t.symbol=e.symbol),e.address!==void 0&&(t.address=Fu.toJSON(e.address)),t},create(e){return jn.fromPartial(e??{})},fromPartial(e){let t=EO();return t.symbol=e.symbol??void 0,t.address=e.address!==void 0&&e.address!==null?Fu.fromPartial(e.address):void 0,t}};function CO(){return{address:"",chain:""}}var Fu={encode(e,t=Fe.default.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.chain!==""&&t.uint32(18).string(e.chain),t},decode(e,t){let n=e instanceof Fe.default.Reader?e:Fe.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=CO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=n.string();continue;case 2:if(a!==18)break;i.chain=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{address:tt(e.address)?globalThis.String(e.address):"",chain:tt(e.chain)?globalThis.String(e.chain):""}},toJSON(e){let t={};return e.address!==""&&(t.address=e.address),e.chain!==""&&(t.chain=e.chain),t},create(e){return Fu.fromPartial(e??{})},fromPartial(e){let t=CO();return t.address=e.address??"",t.chain=e.chain??"",t}};function kO(){return{nullValue:void 0,intValue:void 0,int64Value:void 0,floatValue:void 0,bytesValue:void 0,boolValue:void 0,stringValue:void 0,timestampValue:void 0,bigintValue:void 0,bigdecimalValue:void 0,listValue:void 0,structValue:void 0,tokenValue:void 0}}var he={encode(e,t=Fe.default.Writer.create()){if(e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.intValue!==void 0&&t.uint32(16).int32(e.intValue),e.int64Value!==void 0){if(BigInt.asIntN(64,e.int64Value)!==e.int64Value)throw new globalThis.Error("value provided for field message.int64Value of type int64 too large");t.uint32(104).int64(e.int64Value.toString())}return e.floatValue!==void 0&&t.uint32(25).double(e.floatValue),e.bytesValue!==void 0&&t.uint32(34).bytes(e.bytesValue),e.boolValue!==void 0&&t.uint32(40).bool(e.boolValue),e.stringValue!==void 0&&t.uint32(50).string(e.stringValue),e.timestampValue!==void 0&&to.encode(xO(e.timestampValue),t.uint32(58).fork()).ldelim(),e.bigintValue!==void 0&&Vt.encode(e.bigintValue,t.uint32(66).fork()).ldelim(),e.bigdecimalValue!==void 0&&br.encode(e.bigdecimalValue,t.uint32(74).fork()).ldelim(),e.listValue!==void 0&&ft.encode(e.listValue,t.uint32(82).fork()).ldelim(),e.structValue!==void 0&&er.encode(e.structValue,t.uint32(90).fork()).ldelim(),e.tokenValue!==void 0&&Is.encode(e.tokenValue,t.uint32(98).fork()).ldelim(),t},decode(e,t){let n=e instanceof Fe.default.Reader?e:Fe.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=kO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.nullValue=n.int32();continue;case 2:if(a!==16)break;i.intValue=n.int32();continue;case 13:if(a!==104)break;i.int64Value=e5(n.int64());continue;case 3:if(a!==25)break;i.floatValue=n.double();continue;case 4:if(a!==34)break;i.bytesValue=n.bytes();continue;case 5:if(a!==40)break;i.boolValue=n.bool();continue;case 6:if(a!==50)break;i.stringValue=n.string();continue;case 7:if(a!==58)break;i.timestampValue=aE(to.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.bigintValue=Vt.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.bigdecimalValue=br.decode(n,n.uint32());continue;case 10:if(a!==82)break;i.listValue=ft.decode(n,n.uint32());continue;case 11:if(a!==90)break;i.structValue=er.decode(n,n.uint32());continue;case 12:if(a!==98)break;i.tokenValue=Is.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{nullValue:tt(e.nullValue)?$W(e.nullValue):void 0,intValue:tt(e.intValue)?globalThis.Number(e.intValue):void 0,int64Value:tt(e.int64Value)?BigInt(e.int64Value):void 0,floatValue:tt(e.floatValue)?globalThis.Number(e.floatValue):void 0,bytesValue:tt(e.bytesValue)?PO(e.bytesValue):void 0,boolValue:tt(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,stringValue:tt(e.stringValue)?globalThis.String(e.stringValue):void 0,timestampValue:tt(e.timestampValue)?BO(e.timestampValue):void 0,bigintValue:tt(e.bigintValue)?Vt.fromJSON(e.bigintValue):void 0,bigdecimalValue:tt(e.bigdecimalValue)?br.fromJSON(e.bigdecimalValue):void 0,listValue:tt(e.listValue)?ft.fromJSON(e.listValue):void 0,structValue:tt(e.structValue)?er.fromJSON(e.structValue):void 0,tokenValue:tt(e.tokenValue)?Is.fromJSON(e.tokenValue):void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=jW(e.nullValue)),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.int64Value!==void 0&&(t.int64Value=e.int64Value.toString()),e.floatValue!==void 0&&(t.floatValue=e.floatValue),e.bytesValue!==void 0&&(t.bytesValue=wO(e.bytesValue)),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.timestampValue!==void 0&&(t.timestampValue=e.timestampValue.toISOString()),e.bigintValue!==void 0&&(t.bigintValue=Vt.toJSON(e.bigintValue)),e.bigdecimalValue!==void 0&&(t.bigdecimalValue=br.toJSON(e.bigdecimalValue)),e.listValue!==void 0&&(t.listValue=ft.toJSON(e.listValue)),e.structValue!==void 0&&(t.structValue=er.toJSON(e.structValue)),e.tokenValue!==void 0&&(t.tokenValue=Is.toJSON(e.tokenValue)),t},create(e){return he.fromPartial(e??{})},fromPartial(e){let t=kO();return t.nullValue=e.nullValue??void 0,t.intValue=e.intValue??void 0,t.int64Value=e.int64Value??void 0,t.floatValue=e.floatValue??void 0,t.bytesValue=e.bytesValue??void 0,t.boolValue=e.boolValue??void 0,t.stringValue=e.stringValue??void 0,t.timestampValue=e.timestampValue??void 0,t.bigintValue=e.bigintValue!==void 0&&e.bigintValue!==null?Vt.fromPartial(e.bigintValue):void 0,t.bigdecimalValue=e.bigdecimalValue!==void 0&&e.bigdecimalValue!==null?br.fromPartial(e.bigdecimalValue):void 0,t.listValue=e.listValue!==void 0&&e.listValue!==null?ft.fromPartial(e.listValue):void 0,t.structValue=e.structValue!==void 0&&e.structValue!==null?er.fromPartial(e.structValue):void 0,t.tokenValue=e.tokenValue!==void 0&&e.tokenValue!==null?Is.fromPartial(e.tokenValue):void 0,t}};function _O(){return{fields:{}}}var er={encode(e,t=Fe.default.Writer.create()){return Object.entries(e.fields).forEach(([n,r])=>{iE.encode({key:n,value:r},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let n=e instanceof Fe.default.Reader?e:Fe.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=_O();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;let o=iE.decode(n,n.uint32());o.value!==void 0&&(i.fields[o.key]=o.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{fields:t5(e.fields)?Object.entries(e.fields).reduce((t,[n,r])=>(t[n]=he.fromJSON(r),t),{}):{}}},toJSON(e){let t={};if(e.fields){let n=Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([r,i])=>{t.fields[r]=he.toJSON(i)}))}return t},create(e){return er.fromPartial(e??{})},fromPartial(e){let t=_O();return t.fields=Object.entries(e.fields??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=he.fromPartial(i)),n),{}),t}};function AO(){return{key:"",value:void 0}}var iE={encode(e,t=Fe.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&he.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof Fe.default.Reader?e:Fe.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=AO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=he.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:tt(e.key)?globalThis.String(e.key):"",value:tt(e.value)?he.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=he.toJSON(e.value)),t},create(e){return iE.fromPartial(e??{})},fromPartial(e){let t=AO();return t.key=e.key??"",t.value=e.value!==void 0&&e.value!==null?he.fromPartial(e.value):void 0,t}};function NO(){return{values:[]}}var ft={encode(e,t=Fe.default.Writer.create()){for(let n of e.values)he.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof Fe.default.Reader?e:Fe.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=NO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.values.push(he.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?e.values.map(t=>he.fromJSON(t)):[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values.map(n=>he.toJSON(n))),t},create(e){return ft.fromPartial(e??{})},fromPartial(e){let t=NO();return t.values=e.values?.map(n=>he.fromPartial(n))||[],t}};function IO(){return{value:void 0,exp:0}}var br={encode(e,t=Fe.default.Writer.create()){return e.value!==void 0&&Vt.encode(e.value,t.uint32(10).fork()).ldelim(),e.exp!==0&&t.uint32(16).int32(e.exp),t},decode(e,t){let n=e instanceof Fe.default.Reader?e:Fe.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=IO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.value=Vt.decode(n,n.uint32());continue;case 2:if(a!==16)break;i.exp=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{value:tt(e.value)?Vt.fromJSON(e.value):void 0,exp:tt(e.exp)?globalThis.Number(e.exp):0}},toJSON(e){let t={};return e.value!==void 0&&(t.value=Vt.toJSON(e.value)),e.exp!==0&&(t.exp=Math.round(e.exp)),t},create(e){return br.fromPartial(e??{})},fromPartial(e){let t=IO();return t.value=e.value!==void 0&&e.value!==null?Vt.fromPartial(e.value):void 0,t.exp=e.exp??0,t}};function OO(){return{negative:!1,data:new Uint8Array(0)}}var Vt={encode(e,t=Fe.default.Writer.create()){return e.negative!==!1&&t.uint32(8).bool(e.negative),e.data.length!==0&&t.uint32(18).bytes(e.data),t},decode(e,t){let n=e instanceof Fe.default.Reader?e:Fe.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=OO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.negative=n.bool();continue;case 2:if(a!==18)break;i.data=n.bytes();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{negative:tt(e.negative)?globalThis.Boolean(e.negative):!1,data:tt(e.data)?PO(e.data):new Uint8Array(0)}},toJSON(e){let t={};return e.negative!==!1&&(t.negative=e.negative),e.data.length!==0&&(t.data=wO(e.data)),t},create(e){return Vt.fromPartial(e??{})},fromPartial(e){let t=OO();return t.negative=e.negative??!1,t.data=e.data??new Uint8Array(0),t}};function RO(){return{token:void 0,amount:void 0,specifiedAt:void 0}}var Is={encode(e,t=Fe.default.Writer.create()){return e.token!==void 0&&jn.encode(e.token,t.uint32(10).fork()).ldelim(),e.amount!==void 0&&br.encode(e.amount,t.uint32(18).fork()).ldelim(),e.specifiedAt!==void 0&&to.encode(xO(e.specifiedAt),t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof Fe.default.Reader?e:Fe.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=RO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.token=jn.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.amount=br.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.specifiedAt=aE(to.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{token:tt(e.token)?jn.fromJSON(e.token):void 0,amount:tt(e.amount)?br.fromJSON(e.amount):void 0,specifiedAt:tt(e.specifiedAt)?BO(e.specifiedAt):void 0}},toJSON(e){let t={};return e.token!==void 0&&(t.token=jn.toJSON(e.token)),e.amount!==void 0&&(t.amount=br.toJSON(e.amount)),e.specifiedAt!==void 0&&(t.specifiedAt=e.specifiedAt.toISOString()),t},create(e){return Is.fromPartial(e??{})},fromPartial(e){let t=RO();return t.token=e.token!==void 0&&e.token!==null?jn.fromPartial(e.token):void 0,t.amount=e.amount!==void 0&&e.amount!==null?br.fromPartial(e.amount):void 0,t.specifiedAt=e.specifiedAt??void 0,t}};function PO(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{let t=globalThis.atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}}function wO(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{let t=[];return e.forEach(n=>{t.push(globalThis.String.fromCharCode(n))}),globalThis.btoa(t.join(""))}}function xO(e){let t=BigInt(Math.trunc(e.getTime()/1e3)),n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function aE(e){let t=(globalThis.Number(e.seconds.toString())||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function BO(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):aE(to.fromJSON(e))}function e5(e){return BigInt(e.toString())}Fe.default.util.Long!==Ut&&(Fe.default.util.Long=Ut,Fe.default.configure());function t5(e){return typeof e=="object"&&e!==null}function tt(e){return e!=null}var Tr;(function(e){e[e.UNKNOWN_TYPE=0]="UNKNOWN_TYPE",e[e.COUNTER=1]="COUNTER",e[e.GAUGE=2]="GAUGE",e[e.HISTOGRAM=3]="HISTOGRAM",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Tr||(Tr={}));function r5(e){switch(e){case 0:case"UNKNOWN_TYPE":return Tr.UNKNOWN_TYPE;case 1:case"COUNTER":return Tr.COUNTER;case 2:case"GAUGE":return Tr.GAUGE;case 3:case"HISTOGRAM":return Tr.HISTOGRAM;case-1:case"UNRECOGNIZED":default:return Tr.UNRECOGNIZED}}function i5(e){switch(e){case Tr.UNKNOWN_TYPE:return"UNKNOWN_TYPE";case Tr.COUNTER:return"COUNTER";case Tr.GAUGE:return"GAUGE";case Tr.HISTOGRAM:return"HISTOGRAM";case Tr.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var ln;(function(e){e[e.COUNT=0]="COUNT",e[e.SUM=1]="SUM",e[e.AVG=2]="AVG",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.LAST=5]="LAST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ln||(ln={}));function a5(e){switch(e){case 0:case"COUNT":return ln.COUNT;case 1:case"SUM":return ln.SUM;case 2:case"AVG":return ln.AVG;case 3:case"MIN":return ln.MIN;case 4:case"MAX":return ln.MAX;case 5:case"LAST":return ln.LAST;case-1:case"UNRECOGNIZED":default:return ln.UNRECOGNIZED}}function o5(e){switch(e){case ln.COUNT:return"COUNT";case ln.SUM:return"SUM";case ln.AVG:return"AVG";case ln.MIN:return"MIN";case ln.MAX:return"MAX";case ln.LAST:return"LAST";case ln.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var Er;(function(e){e[e.ADDRESS=0]="ADDRESS",e[e.OBJECT=1]="OBJECT",e[e.WRAPPED_OBJECT=2]="WRAPPED_OBJECT",e[e.TYPE=3]="TYPE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Er||(Er={}));function s5(e){switch(e){case 0:case"ADDRESS":return Er.ADDRESS;case 1:case"OBJECT":return Er.OBJECT;case 2:case"WRAPPED_OBJECT":return Er.WRAPPED_OBJECT;case 3:case"TYPE":return Er.TYPE;case-1:case"UNRECOGNIZED":default:return Er.UNRECOGNIZED}}function u5(e){switch(e){case Er.ADDRESS:return"ADDRESS";case Er.OBJECT:return"OBJECT";case Er.WRAPPED_OBJECT:return"WRAPPED_OBJECT";case Er.TYPE:return"TYPE";case Er.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var Li;(function(e){e[e.ERC20=0]="ERC20",e[e.ERC721=1]="ERC721",e[e.ERC1155=2]="ERC1155",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Li||(Li={}));function l5(e){switch(e){case 0:case"ERC20":return Li.ERC20;case 1:case"ERC721":return Li.ERC721;case 2:case"ERC1155":return Li.ERC1155;case-1:case"UNRECOGNIZED":default:return Li.UNRECOGNIZED}}function c5(e){switch(e){case Li.ERC20:return"ERC20";case Li.ERC721:return"ERC721";case Li.ERC1155:return"ERC1155";case Li.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var de;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.ETH_LOG=1]="ETH_LOG",e[e.ETH_BLOCK=2]="ETH_BLOCK",e[e.ETH_TRACE=5]="ETH_TRACE",e[e.ETH_TRANSACTION=11]="ETH_TRANSACTION",e[e.SOL_INSTRUCTION=4]="SOL_INSTRUCTION",e[e.APT_EVENT=6]="APT_EVENT",e[e.APT_CALL=7]="APT_CALL",e[e.APT_RESOURCE=8]="APT_RESOURCE",e[e.SUI_EVENT=3]="SUI_EVENT",e[e.SUI_CALL=9]="SUI_CALL",e[e.SUI_OBJECT=10]="SUI_OBJECT",e[e.SUI_OBJECT_CHANGE=12]="SUI_OBJECT_CHANGE",e[e.FUEL_CALL=13]="FUEL_CALL",e[e.FUEL_RECEIPT=19]="FUEL_RECEIPT",e[e.FUEL_TRANSACTION=20]="FUEL_TRANSACTION",e[e.FUEL_BLOCK=17]="FUEL_BLOCK",e[e.COSMOS_CALL=14]="COSMOS_CALL",e[e.STARKNET_EVENT=15]="STARKNET_EVENT",e[e.BTC_TRANSACTION=16]="BTC_TRANSACTION",e[e.BTC_BLOCK=18]="BTC_BLOCK",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(de||(de={}));function d5(e){switch(e){case 0:case"UNKNOWN":return de.UNKNOWN;case 1:case"ETH_LOG":return de.ETH_LOG;case 2:case"ETH_BLOCK":return de.ETH_BLOCK;case 5:case"ETH_TRACE":return de.ETH_TRACE;case 11:case"ETH_TRANSACTION":return de.ETH_TRANSACTION;case 4:case"SOL_INSTRUCTION":return de.SOL_INSTRUCTION;case 6:case"APT_EVENT":return de.APT_EVENT;case 7:case"APT_CALL":return de.APT_CALL;case 8:case"APT_RESOURCE":return de.APT_RESOURCE;case 3:case"SUI_EVENT":return de.SUI_EVENT;case 9:case"SUI_CALL":return de.SUI_CALL;case 10:case"SUI_OBJECT":return de.SUI_OBJECT;case 12:case"SUI_OBJECT_CHANGE":return de.SUI_OBJECT_CHANGE;case 13:case"FUEL_CALL":return de.FUEL_CALL;case 19:case"FUEL_RECEIPT":return de.FUEL_RECEIPT;case 20:case"FUEL_TRANSACTION":return de.FUEL_TRANSACTION;case 17:case"FUEL_BLOCK":return de.FUEL_BLOCK;case 14:case"COSMOS_CALL":return de.COSMOS_CALL;case 15:case"STARKNET_EVENT":return de.STARKNET_EVENT;case 16:case"BTC_TRANSACTION":return de.BTC_TRANSACTION;case 18:case"BTC_BLOCK":return de.BTC_BLOCK;case-1:case"UNRECOGNIZED":default:return de.UNRECOGNIZED}}function f5(e){switch(e){case de.UNKNOWN:return"UNKNOWN";case de.ETH_LOG:return"ETH_LOG";case de.ETH_BLOCK:return"ETH_BLOCK";case de.ETH_TRACE:return"ETH_TRACE";case de.ETH_TRANSACTION:return"ETH_TRANSACTION";case de.SOL_INSTRUCTION:return"SOL_INSTRUCTION";case de.APT_EVENT:return"APT_EVENT";case de.APT_CALL:return"APT_CALL";case de.APT_RESOURCE:return"APT_RESOURCE";case de.SUI_EVENT:return"SUI_EVENT";case de.SUI_CALL:return"SUI_CALL";case de.SUI_OBJECT:return"SUI_OBJECT";case de.SUI_OBJECT_CHANGE:return"SUI_OBJECT_CHANGE";case de.FUEL_CALL:return"FUEL_CALL";case de.FUEL_RECEIPT:return"FUEL_RECEIPT";case de.FUEL_TRANSACTION:return"FUEL_TRANSACTION";case de.FUEL_BLOCK:return"FUEL_BLOCK";case de.COSMOS_CALL:return"COSMOS_CALL";case de.STARKNET_EVENT:return"STARKNET_EVENT";case de.BTC_TRANSACTION:return"BTC_TRANSACTION";case de.BTC_BLOCK:return"BTC_BLOCK";case de.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var Vn;(function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARNING=2]="WARNING",e[e.ERROR=3]="ERROR",e[e.CRITICAL=4]="CRITICAL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Vn||(Vn={}));function h5(e){switch(e){case 0:case"DEBUG":return Vn.DEBUG;case 1:case"INFO":return Vn.INFO;case 2:case"WARNING":return Vn.WARNING;case 3:case"ERROR":return Vn.ERROR;case 4:case"CRITICAL":return Vn.CRITICAL;case-1:case"UNRECOGNIZED":default:return Vn.UNRECOGNIZED}}function p5(e){switch(e){case Vn.DEBUG:return"DEBUG";case Vn.INFO:return"INFO";case Vn.WARNING:return"WARNING";case Vn.ERROR:return"ERROR";case Vn.CRITICAL:return"CRITICAL";case Vn.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var DO;(function(e){e[e.AVG=0]="AVG",e[e.MEDIAN=1]="MEDIAN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(DO||(DO={}));var cn;(function(e){e[e.STRING=0]="STRING",e[e.DOUBLE=1]="DOUBLE",e[e.BOOL=2]="BOOL",e[e.TIMESTAMP=3]="TIMESTAMP",e[e.BIG_INTEGER=4]="BIG_INTEGER",e[e.BIG_DECIMAL=5]="BIG_DECIMAL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(cn||(cn={}));function m5(e){switch(e){case 0:case"STRING":return cn.STRING;case 1:case"DOUBLE":return cn.DOUBLE;case 2:case"BOOL":return cn.BOOL;case 3:case"TIMESTAMP":return cn.TIMESTAMP;case 4:case"BIG_INTEGER":return cn.BIG_INTEGER;case 5:case"BIG_DECIMAL":return cn.BIG_DECIMAL;case-1:case"UNRECOGNIZED":default:return cn.UNRECOGNIZED}}function g5(e){switch(e){case cn.STRING:return"STRING";case cn.DOUBLE:return"DOUBLE";case cn.BOOL:return"BOOL";case cn.TIMESTAMP:return"TIMESTAMP";case cn.BIG_INTEGER:return"BIG_INTEGER";case cn.BIG_DECIMAL:return"BIG_DECIMAL";case cn.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var MO;(function(e){e[e.EQ=0]="EQ",e[e.NE=1]="NE",e[e.GT=2]="GT",e[e.GE=3]="GE",e[e.LT=4]="LT",e[e.LE=5]="LE",e[e.IN=6]="IN",e[e.NOT_IN=7]="NOT_IN",e[e.LIKE=8]="LIKE",e[e.NOT_LIKE=9]="NOT_LIKE",e[e.HAS_ALL=10]="HAS_ALL",e[e.HAS_ANY=11]="HAS_ANY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(MO||(MO={}));function LO(){return{name:"",version:""}}var Uu={encode(e,t=_.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.version!==""&&t.uint32(26).string(e.version),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=LO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 3:if(a!==26)break;i.version=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:A(e.name)?globalThis.String(e.name):"",version:A(e.version)?globalThis.String(e.version):""}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.version!==""&&(t.version=e.version),t},create(e){return Uu.fromPartial(e??{})},fromPartial(e){let t=LO();return t.name=e.name??"",t.version=e.version??"",t}};function FO(){return{sequential:!1,forceExactBlockTime:!1,processBindingTimeout:0,skipStartBlockValidation:!1,rpcRetryTimes:0,ethAbiDecoderConfig:void 0}}var qu={encode(e,t=_.default.Writer.create()){return e.sequential!==!1&&t.uint32(8).bool(e.sequential),e.forceExactBlockTime!==!1&&t.uint32(16).bool(e.forceExactBlockTime),e.processBindingTimeout!==0&&t.uint32(24).int32(e.processBindingTimeout),e.skipStartBlockValidation!==!1&&t.uint32(32).bool(e.skipStartBlockValidation),e.rpcRetryTimes!==0&&t.uint32(40).int32(e.rpcRetryTimes),e.ethAbiDecoderConfig!==void 0&&Vu.encode(e.ethAbiDecoderConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=FO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.sequential=n.bool();continue;case 2:if(a!==16)break;i.forceExactBlockTime=n.bool();continue;case 3:if(a!==24)break;i.processBindingTimeout=n.int32();continue;case 4:if(a!==32)break;i.skipStartBlockValidation=n.bool();continue;case 5:if(a!==40)break;i.rpcRetryTimes=n.int32();continue;case 6:if(a!==50)break;i.ethAbiDecoderConfig=Vu.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{sequential:A(e.sequential)?globalThis.Boolean(e.sequential):!1,forceExactBlockTime:A(e.forceExactBlockTime)?globalThis.Boolean(e.forceExactBlockTime):!1,processBindingTimeout:A(e.processBindingTimeout)?globalThis.Number(e.processBindingTimeout):0,skipStartBlockValidation:A(e.skipStartBlockValidation)?globalThis.Boolean(e.skipStartBlockValidation):!1,rpcRetryTimes:A(e.rpcRetryTimes)?globalThis.Number(e.rpcRetryTimes):0,ethAbiDecoderConfig:A(e.ethAbiDecoderConfig)?Vu.fromJSON(e.ethAbiDecoderConfig):void 0}},toJSON(e){let t={};return e.sequential!==!1&&(t.sequential=e.sequential),e.forceExactBlockTime!==!1&&(t.forceExactBlockTime=e.forceExactBlockTime),e.processBindingTimeout!==0&&(t.processBindingTimeout=Math.round(e.processBindingTimeout)),e.skipStartBlockValidation!==!1&&(t.skipStartBlockValidation=e.skipStartBlockValidation),e.rpcRetryTimes!==0&&(t.rpcRetryTimes=Math.round(e.rpcRetryTimes)),e.ethAbiDecoderConfig!==void 0&&(t.ethAbiDecoderConfig=Vu.toJSON(e.ethAbiDecoderConfig)),t},create(e){return qu.fromPartial(e??{})},fromPartial(e){let t=FO();return t.sequential=e.sequential??!1,t.forceExactBlockTime=e.forceExactBlockTime??!1,t.processBindingTimeout=e.processBindingTimeout??0,t.skipStartBlockValidation=e.skipStartBlockValidation??!1,t.rpcRetryTimes=e.rpcRetryTimes??0,t.ethAbiDecoderConfig=e.ethAbiDecoderConfig!==void 0&&e.ethAbiDecoderConfig!==null?Vu.fromPartial(e.ethAbiDecoderConfig):void 0,t}};function UO(){return{enabled:!1,workerCount:void 0,skipWhenDecodeFailed:void 0}}var Vu={encode(e,t=_.default.Writer.create()){return e.enabled!==!1&&t.uint32(8).bool(e.enabled),e.workerCount!==void 0&&t.uint32(16).int32(e.workerCount),e.skipWhenDecodeFailed!==void 0&&t.uint32(24).bool(e.skipWhenDecodeFailed),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=UO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.enabled=n.bool();continue;case 2:if(a!==16)break;i.workerCount=n.int32();continue;case 3:if(a!==24)break;i.skipWhenDecodeFailed=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{enabled:A(e.enabled)?globalThis.Boolean(e.enabled):!1,workerCount:A(e.workerCount)?globalThis.Number(e.workerCount):void 0,skipWhenDecodeFailed:A(e.skipWhenDecodeFailed)?globalThis.Boolean(e.skipWhenDecodeFailed):void 0}},toJSON(e){let t={};return e.enabled!==!1&&(t.enabled=e.enabled),e.workerCount!==void 0&&(t.workerCount=Math.round(e.workerCount)),e.skipWhenDecodeFailed!==void 0&&(t.skipWhenDecodeFailed=e.skipWhenDecodeFailed),t},create(e){return Vu.fromPartial(e??{})},fromPartial(e){let t=UO();return t.enabled=e.enabled??!1,t.workerCount=e.workerCount??void 0,t.skipWhenDecodeFailed=e.skipWhenDecodeFailed??void 0,t}};function qO(){return{config:void 0,executionConfig:void 0,contractConfigs:[],templateInstances:[],accountConfigs:[],metricConfigs:[],eventTrackingConfigs:[],exportConfigs:[],eventLogConfigs:[],dbSchema:void 0}}var uE={encode(e,t=_.default.Writer.create()){e.config!==void 0&&Uu.encode(e.config,t.uint32(10).fork()).ldelim(),e.executionConfig!==void 0&&qu.encode(e.executionConfig,t.uint32(74).fork()).ldelim();for(let n of e.contractConfigs)Ju.encode(n,t.uint32(18).fork()).ldelim();for(let n of e.templateInstances)ju.encode(n,t.uint32(26).fork()).ldelim();for(let n of e.accountConfigs)$u.encode(n,t.uint32(34).fork()).ldelim();for(let n of e.metricConfigs)Ku.encode(n,t.uint32(42).fork()).ldelim();for(let n of e.eventTrackingConfigs)zu.encode(n,t.uint32(50).fork()).ldelim();for(let n of e.exportConfigs)Qu.encode(n,t.uint32(58).fork()).ldelim();for(let n of e.eventLogConfigs)Zu.encode(n,t.uint32(66).fork()).ldelim();return e.dbSchema!==void 0&&Wu.encode(e.dbSchema,t.uint32(82).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=qO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.config=Uu.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.executionConfig=qu.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.contractConfigs.push(Ju.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.templateInstances.push(ju.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.accountConfigs.push($u.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.metricConfigs.push(Ku.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.eventTrackingConfigs.push(zu.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.exportConfigs.push(Qu.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.eventLogConfigs.push(Zu.decode(n,n.uint32()));continue;case 10:if(a!==82)break;i.dbSchema=Wu.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{config:A(e.config)?Uu.fromJSON(e.config):void 0,executionConfig:A(e.executionConfig)?qu.fromJSON(e.executionConfig):void 0,contractConfigs:globalThis.Array.isArray(e?.contractConfigs)?e.contractConfigs.map(t=>Ju.fromJSON(t)):[],templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>ju.fromJSON(t)):[],accountConfigs:globalThis.Array.isArray(e?.accountConfigs)?e.accountConfigs.map(t=>$u.fromJSON(t)):[],metricConfigs:globalThis.Array.isArray(e?.metricConfigs)?e.metricConfigs.map(t=>Ku.fromJSON(t)):[],eventTrackingConfigs:globalThis.Array.isArray(e?.eventTrackingConfigs)?e.eventTrackingConfigs.map(t=>zu.fromJSON(t)):[],exportConfigs:globalThis.Array.isArray(e?.exportConfigs)?e.exportConfigs.map(t=>Qu.fromJSON(t)):[],eventLogConfigs:globalThis.Array.isArray(e?.eventLogConfigs)?e.eventLogConfigs.map(t=>Zu.fromJSON(t)):[],dbSchema:A(e.dbSchema)?Wu.fromJSON(e.dbSchema):void 0}},toJSON(e){let t={};return e.config!==void 0&&(t.config=Uu.toJSON(e.config)),e.executionConfig!==void 0&&(t.executionConfig=qu.toJSON(e.executionConfig)),e.contractConfigs?.length&&(t.contractConfigs=e.contractConfigs.map(n=>Ju.toJSON(n))),e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(n=>ju.toJSON(n))),e.accountConfigs?.length&&(t.accountConfigs=e.accountConfigs.map(n=>$u.toJSON(n))),e.metricConfigs?.length&&(t.metricConfigs=e.metricConfigs.map(n=>Ku.toJSON(n))),e.eventTrackingConfigs?.length&&(t.eventTrackingConfigs=e.eventTrackingConfigs.map(n=>zu.toJSON(n))),e.exportConfigs?.length&&(t.exportConfigs=e.exportConfigs.map(n=>Qu.toJSON(n))),e.eventLogConfigs?.length&&(t.eventLogConfigs=e.eventLogConfigs.map(n=>Zu.toJSON(n))),e.dbSchema!==void 0&&(t.dbSchema=Wu.toJSON(e.dbSchema)),t},create(e){return uE.fromPartial(e??{})},fromPartial(e){let t=qO();return t.config=e.config!==void 0&&e.config!==null?Uu.fromPartial(e.config):void 0,t.executionConfig=e.executionConfig!==void 0&&e.executionConfig!==null?qu.fromPartial(e.executionConfig):void 0,t.contractConfigs=e.contractConfigs?.map(n=>Ju.fromPartial(n))||[],t.templateInstances=e.templateInstances?.map(n=>ju.fromPartial(n))||[],t.accountConfigs=e.accountConfigs?.map(n=>$u.fromPartial(n))||[],t.metricConfigs=e.metricConfigs?.map(n=>Ku.fromPartial(n))||[],t.eventTrackingConfigs=e.eventTrackingConfigs?.map(n=>zu.fromPartial(n))||[],t.exportConfigs=e.exportConfigs?.map(n=>Qu.fromPartial(n))||[],t.eventLogConfigs=e.eventLogConfigs?.map(n=>Zu.fromPartial(n))||[],t.dbSchema=e.dbSchema!==void 0&&e.dbSchema!==null?Wu.fromPartial(e.dbSchema):void 0,t}};function VO(){return{contract:void 0,intervalConfigs:[],moveIntervalConfigs:[],logConfigs:[],traceConfigs:[],transactionConfig:[],moveEventConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],fuelTransactionConfigs:[],assetConfigs:[],fuelReceiptConfigs:[],cosmosLogConfigs:[],starknetEventConfigs:[],btcTransactionConfigs:[],instructionConfig:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),processorType:""}}var Ju={encode(e,t=_.default.Writer.create()){e.contract!==void 0&&Zr.encode(e.contract,t.uint32(10).fork()).ldelim();for(let n of e.intervalConfigs)dn.encode(n,t.uint32(90).fork()).ldelim();for(let n of e.moveIntervalConfigs)Kr.encode(n,t.uint32(154).fork()).ldelim();for(let n of e.logConfigs)Yr.encode(n,t.uint32(26).fork()).ldelim();for(let n of e.traceConfigs)el.encode(n,t.uint32(18).fork()).ldelim();for(let n of e.transactionConfig)tl.encode(n,t.uint32(58).fork()).ldelim();for(let n of e.moveEventConfigs)fl.encode(n,t.uint32(74).fork()).ldelim();for(let n of e.moveCallConfigs)Xr.encode(n,t.uint32(82).fork()).ldelim();for(let n of e.moveResourceChangeConfigs)$r.encode(n,t.uint32(98).fork()).ldelim();for(let n of e.fuelTransactionConfigs)Tl.encode(n,t.uint32(162).fork()).ldelim();for(let n of e.assetConfigs)nl.encode(n,t.uint32(114).fork()).ldelim();for(let n of e.fuelReceiptConfigs)il.encode(n,t.uint32(170).fork()).ldelim();for(let n of e.cosmosLogConfigs)sl.encode(n,t.uint32(130).fork()).ldelim();for(let n of e.starknetEventConfigs)gl.encode(n,t.uint32(138).fork()).ldelim();for(let n of e.btcTransactionConfigs)yl.encode(n,t.uint32(146).fork()).ldelim();if(e.instructionConfig!==void 0&&ll.encode(e.instructionConfig,t.uint32(50).fork()).ldelim(),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");t.uint32(32).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");t.uint32(40).uint64(e.endBlock.toString())}return e.processorType!==""&&t.uint32(66).string(e.processorType),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=VO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.contract=Zr.decode(n,n.uint32());continue;case 11:if(a!==90)break;i.intervalConfigs.push(dn.decode(n,n.uint32()));continue;case 19:if(a!==154)break;i.moveIntervalConfigs.push(Kr.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.logConfigs.push(Yr.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.traceConfigs.push(el.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.transactionConfig.push(tl.decode(n,n.uint32()));continue;case 9:if(a!==74)break;i.moveEventConfigs.push(fl.decode(n,n.uint32()));continue;case 10:if(a!==82)break;i.moveCallConfigs.push(Xr.decode(n,n.uint32()));continue;case 12:if(a!==98)break;i.moveResourceChangeConfigs.push($r.decode(n,n.uint32()));continue;case 20:if(a!==162)break;i.fuelTransactionConfigs.push(Tl.decode(n,n.uint32()));continue;case 14:if(a!==114)break;i.assetConfigs.push(nl.decode(n,n.uint32()));continue;case 21:if(a!==170)break;i.fuelReceiptConfigs.push(il.decode(n,n.uint32()));continue;case 16:if(a!==130)break;i.cosmosLogConfigs.push(sl.decode(n,n.uint32()));continue;case 17:if(a!==138)break;i.starknetEventConfigs.push(gl.decode(n,n.uint32()));continue;case 18:if(a!==146)break;i.btcTransactionConfigs.push(yl.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.instructionConfig=ll.decode(n,n.uint32());continue;case 4:if(a!==32)break;i.startBlock=Rl(n.uint64());continue;case 5:if(a!==40)break;i.endBlock=Rl(n.uint64());continue;case 8:if(a!==66)break;i.processorType=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{contract:A(e.contract)?Zr.fromJSON(e.contract):void 0,intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(t=>dn.fromJSON(t)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(t=>Kr.fromJSON(t)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(t=>Yr.fromJSON(t)):[],traceConfigs:globalThis.Array.isArray(e?.traceConfigs)?e.traceConfigs.map(t=>el.fromJSON(t)):[],transactionConfig:globalThis.Array.isArray(e?.transactionConfig)?e.transactionConfig.map(t=>tl.fromJSON(t)):[],moveEventConfigs:globalThis.Array.isArray(e?.moveEventConfigs)?e.moveEventConfigs.map(t=>fl.fromJSON(t)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(t=>Xr.fromJSON(t)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(t=>$r.fromJSON(t)):[],fuelTransactionConfigs:globalThis.Array.isArray(e?.fuelTransactionConfigs)?e.fuelTransactionConfigs.map(t=>Tl.fromJSON(t)):[],assetConfigs:globalThis.Array.isArray(e?.assetConfigs)?e.assetConfigs.map(t=>nl.fromJSON(t)):[],fuelReceiptConfigs:globalThis.Array.isArray(e?.fuelReceiptConfigs)?e.fuelReceiptConfigs.map(t=>il.fromJSON(t)):[],cosmosLogConfigs:globalThis.Array.isArray(e?.cosmosLogConfigs)?e.cosmosLogConfigs.map(t=>sl.fromJSON(t)):[],starknetEventConfigs:globalThis.Array.isArray(e?.starknetEventConfigs)?e.starknetEventConfigs.map(t=>gl.fromJSON(t)):[],btcTransactionConfigs:globalThis.Array.isArray(e?.btcTransactionConfigs)?e.btcTransactionConfigs.map(t=>yl.fromJSON(t)):[],instructionConfig:A(e.instructionConfig)?ll.fromJSON(e.instructionConfig):void 0,startBlock:A(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:A(e.endBlock)?BigInt(e.endBlock):BigInt("0"),processorType:A(e.processorType)?globalThis.String(e.processorType):""}},toJSON(e){let t={};return e.contract!==void 0&&(t.contract=Zr.toJSON(e.contract)),e.intervalConfigs?.length&&(t.intervalConfigs=e.intervalConfigs.map(n=>dn.toJSON(n))),e.moveIntervalConfigs?.length&&(t.moveIntervalConfigs=e.moveIntervalConfigs.map(n=>Kr.toJSON(n))),e.logConfigs?.length&&(t.logConfigs=e.logConfigs.map(n=>Yr.toJSON(n))),e.traceConfigs?.length&&(t.traceConfigs=e.traceConfigs.map(n=>el.toJSON(n))),e.transactionConfig?.length&&(t.transactionConfig=e.transactionConfig.map(n=>tl.toJSON(n))),e.moveEventConfigs?.length&&(t.moveEventConfigs=e.moveEventConfigs.map(n=>fl.toJSON(n))),e.moveCallConfigs?.length&&(t.moveCallConfigs=e.moveCallConfigs.map(n=>Xr.toJSON(n))),e.moveResourceChangeConfigs?.length&&(t.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(n=>$r.toJSON(n))),e.fuelTransactionConfigs?.length&&(t.fuelTransactionConfigs=e.fuelTransactionConfigs.map(n=>Tl.toJSON(n))),e.assetConfigs?.length&&(t.assetConfigs=e.assetConfigs.map(n=>nl.toJSON(n))),e.fuelReceiptConfigs?.length&&(t.fuelReceiptConfigs=e.fuelReceiptConfigs.map(n=>il.toJSON(n))),e.cosmosLogConfigs?.length&&(t.cosmosLogConfigs=e.cosmosLogConfigs.map(n=>sl.toJSON(n))),e.starknetEventConfigs?.length&&(t.starknetEventConfigs=e.starknetEventConfigs.map(n=>gl.toJSON(n))),e.btcTransactionConfigs?.length&&(t.btcTransactionConfigs=e.btcTransactionConfigs.map(n=>yl.toJSON(n))),e.instructionConfig!==void 0&&(t.instructionConfig=ll.toJSON(e.instructionConfig)),e.startBlock!==BigInt("0")&&(t.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(t.endBlock=e.endBlock.toString()),e.processorType!==""&&(t.processorType=e.processorType),t},create(e){return Ju.fromPartial(e??{})},fromPartial(e){let t=VO();return t.contract=e.contract!==void 0&&e.contract!==null?Zr.fromPartial(e.contract):void 0,t.intervalConfigs=e.intervalConfigs?.map(n=>dn.fromPartial(n))||[],t.moveIntervalConfigs=e.moveIntervalConfigs?.map(n=>Kr.fromPartial(n))||[],t.logConfigs=e.logConfigs?.map(n=>Yr.fromPartial(n))||[],t.traceConfigs=e.traceConfigs?.map(n=>el.fromPartial(n))||[],t.transactionConfig=e.transactionConfig?.map(n=>tl.fromPartial(n))||[],t.moveEventConfigs=e.moveEventConfigs?.map(n=>fl.fromPartial(n))||[],t.moveCallConfigs=e.moveCallConfigs?.map(n=>Xr.fromPartial(n))||[],t.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(n=>$r.fromPartial(n))||[],t.fuelTransactionConfigs=e.fuelTransactionConfigs?.map(n=>Tl.fromPartial(n))||[],t.assetConfigs=e.assetConfigs?.map(n=>nl.fromPartial(n))||[],t.fuelReceiptConfigs=e.fuelReceiptConfigs?.map(n=>il.fromPartial(n))||[],t.cosmosLogConfigs=e.cosmosLogConfigs?.map(n=>sl.fromPartial(n))||[],t.starknetEventConfigs=e.starknetEventConfigs?.map(n=>gl.fromPartial(n))||[],t.btcTransactionConfigs=e.btcTransactionConfigs?.map(n=>yl.fromPartial(n))||[],t.instructionConfig=e.instructionConfig!==void 0&&e.instructionConfig!==null?ll.fromPartial(e.instructionConfig):void 0,t.startBlock=e.startBlock??BigInt("0"),t.endBlock=e.endBlock??BigInt("0"),t.processorType=e.processorType??"",t}};function JO(){return{gqlSchema:""}}var Wu={encode(e,t=_.default.Writer.create()){return e.gqlSchema!==""&&t.uint32(10).string(e.gqlSchema),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=JO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.gqlSchema=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{gqlSchema:A(e.gqlSchema)?globalThis.String(e.gqlSchema):""}},toJSON(e){let t={};return e.gqlSchema!==""&&(t.gqlSchema=e.gqlSchema),t},create(e){return Wu.fromPartial(e??{})},fromPartial(e){let t=JO();return t.gqlSchema=e.gqlSchema??"",t}};function WO(){return{}}var Hu={encode(e,t=_.default.Writer.create()){return t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=WO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return Hu.fromPartial(e??{})},fromPartial(e){return WO()}};function HO(){return{retentionEventName:"",days:0}}var Gu={encode(e,t=_.default.Writer.create()){return e.retentionEventName!==""&&t.uint32(18).string(e.retentionEventName),e.days!==0&&t.uint32(24).int32(e.days),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=HO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.retentionEventName=n.string();continue;case 3:if(a!==24)break;i.days=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{retentionEventName:A(e.retentionEventName)?globalThis.String(e.retentionEventName):"",days:A(e.days)?globalThis.Number(e.days):0}},toJSON(e){let t={};return e.retentionEventName!==""&&(t.retentionEventName=e.retentionEventName),e.days!==0&&(t.days=Math.round(e.days)),t},create(e){return Gu.fromPartial(e??{})},fromPartial(e){let t=HO();return t.retentionEventName=e.retentionEventName??"",t.days=e.days??0,t}};function GO(){return{eventName:"",totalByDay:!1,unique:!1,totalPerEntity:void 0,distinctAggregationByDays:[],retentionConfig:void 0}}var zu={encode(e,t=_.default.Writer.create()){e.eventName!==""&&t.uint32(10).string(e.eventName),e.totalByDay!==!1&&t.uint32(16).bool(e.totalByDay),e.unique!==!1&&t.uint32(24).bool(e.unique),e.totalPerEntity!==void 0&&Hu.encode(e.totalPerEntity,t.uint32(34).fork()).ldelim(),t.uint32(42).fork();for(let n of e.distinctAggregationByDays)t.int32(n);return t.ldelim(),e.retentionConfig!==void 0&&Gu.encode(e.retentionConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=GO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.eventName=n.string();continue;case 2:if(a!==16)break;i.totalByDay=n.bool();continue;case 3:if(a!==24)break;i.unique=n.bool();continue;case 4:if(a!==34)break;i.totalPerEntity=Hu.decode(n,n.uint32());continue;case 5:if(a===40){i.distinctAggregationByDays.push(n.int32());continue}if(a===42){let o=n.uint32()+n.pos;for(;n.pos<o;)i.distinctAggregationByDays.push(n.int32());continue}break;case 6:if(a!==50)break;i.retentionConfig=Gu.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{eventName:A(e.eventName)?globalThis.String(e.eventName):"",totalByDay:A(e.totalByDay)?globalThis.Boolean(e.totalByDay):!1,unique:A(e.unique)?globalThis.Boolean(e.unique):!1,totalPerEntity:A(e.totalPerEntity)?Hu.fromJSON(e.totalPerEntity):void 0,distinctAggregationByDays:globalThis.Array.isArray(e?.distinctAggregationByDays)?e.distinctAggregationByDays.map(t=>globalThis.Number(t)):[],retentionConfig:A(e.retentionConfig)?Gu.fromJSON(e.retentionConfig):void 0}},toJSON(e){let t={};return e.eventName!==""&&(t.eventName=e.eventName),e.totalByDay!==!1&&(t.totalByDay=e.totalByDay),e.unique!==!1&&(t.unique=e.unique),e.totalPerEntity!==void 0&&(t.totalPerEntity=Hu.toJSON(e.totalPerEntity)),e.distinctAggregationByDays?.length&&(t.distinctAggregationByDays=e.distinctAggregationByDays.map(n=>Math.round(n))),e.retentionConfig!==void 0&&(t.retentionConfig=Gu.toJSON(e.retentionConfig)),t},create(e){return zu.fromPartial(e??{})},fromPartial(e){let t=GO();return t.eventName=e.eventName??"",t.totalByDay=e.totalByDay??!1,t.unique=e.unique??!1,t.totalPerEntity=e.totalPerEntity!==void 0&&e.totalPerEntity!==null?Hu.fromPartial(e.totalPerEntity):void 0,t.distinctAggregationByDays=e.distinctAggregationByDays?.map(n=>n)||[],t.retentionConfig=e.retentionConfig!==void 0&&e.retentionConfig!==null?Gu.fromPartial(e.retentionConfig):void 0,t}};function zO(){return{name:"",channel:""}}var Qu={encode(e,t=_.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.channel!==""&&t.uint32(18).string(e.channel),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=zO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==18)break;i.channel=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:A(e.name)?globalThis.String(e.name):"",channel:A(e.channel)?globalThis.String(e.channel):""}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.channel!==""&&(t.channel=e.channel),t},create(e){return Qu.fromPartial(e??{})},fromPartial(e){let t=zO();return t.name=e.name??"",t.channel=e.channel??"",t}};function QO(){return{name:"",description:"",unit:"",sparse:!1,persistentBetweenVersion:!1,type:0,aggregationConfig:void 0}}var Ku={encode(e,t=_.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.description!==""&&t.uint32(26).string(e.description),e.unit!==""&&t.uint32(18).string(e.unit),e.sparse!==!1&&t.uint32(32).bool(e.sparse),e.persistentBetweenVersion!==!1&&t.uint32(40).bool(e.persistentBetweenVersion),e.type!==0&&t.uint32(56).int32(e.type),e.aggregationConfig!==void 0&&Xu.encode(e.aggregationConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=QO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 3:if(a!==26)break;i.description=n.string();continue;case 2:if(a!==18)break;i.unit=n.string();continue;case 4:if(a!==32)break;i.sparse=n.bool();continue;case 5:if(a!==40)break;i.persistentBetweenVersion=n.bool();continue;case 7:if(a!==56)break;i.type=n.int32();continue;case 6:if(a!==50)break;i.aggregationConfig=Xu.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:A(e.name)?globalThis.String(e.name):"",description:A(e.description)?globalThis.String(e.description):"",unit:A(e.unit)?globalThis.String(e.unit):"",sparse:A(e.sparse)?globalThis.Boolean(e.sparse):!1,persistentBetweenVersion:A(e.persistentBetweenVersion)?globalThis.Boolean(e.persistentBetweenVersion):!1,type:A(e.type)?r5(e.type):0,aggregationConfig:A(e.aggregationConfig)?Xu.fromJSON(e.aggregationConfig):void 0}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.description!==""&&(t.description=e.description),e.unit!==""&&(t.unit=e.unit),e.sparse!==!1&&(t.sparse=e.sparse),e.persistentBetweenVersion!==!1&&(t.persistentBetweenVersion=e.persistentBetweenVersion),e.type!==0&&(t.type=i5(e.type)),e.aggregationConfig!==void 0&&(t.aggregationConfig=Xu.toJSON(e.aggregationConfig)),t},create(e){return Ku.fromPartial(e??{})},fromPartial(e){let t=QO();return t.name=e.name??"",t.description=e.description??"",t.unit=e.unit??"",t.sparse=e.sparse??!1,t.persistentBetweenVersion=e.persistentBetweenVersion??!1,t.type=e.type??0,t.aggregationConfig=e.aggregationConfig!==void 0&&e.aggregationConfig!==null?Xu.fromPartial(e.aggregationConfig):void 0,t}};function KO(){return{name:"",fields:[]}}var Zu={encode(e,t=_.default.Writer.create()){e.name!==""&&t.uint32(10).string(e.name);for(let n of e.fields)Qr.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=KO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==18)break;i.fields.push(Qr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:A(e.name)?globalThis.String(e.name):"",fields:globalThis.Array.isArray(e?.fields)?e.fields.map(t=>Qr.fromJSON(t)):[]}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.fields?.length&&(t.fields=e.fields.map(n=>Qr.toJSON(n))),t},create(e){return Zu.fromPartial(e??{})},fromPartial(e){let t=KO();return t.name=e.name??"",t.fields=e.fields?.map(n=>Qr.fromPartial(n))||[],t}};function ZO(){return{fields:[]}}var Yu={encode(e,t=_.default.Writer.create()){for(let n of e.fields)Qr.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ZO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.fields.push(Qr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{fields:globalThis.Array.isArray(e?.fields)?e.fields.map(t=>Qr.fromJSON(t)):[]}},toJSON(e){let t={};return e.fields?.length&&(t.fields=e.fields.map(n=>Qr.toJSON(n))),t},create(e){return Yu.fromPartial(e??{})},fromPartial(e){let t=ZO();return t.fields=e.fields?.map(n=>Qr.fromPartial(n))||[],t}};function YO(){return{name:"",basicType:void 0,coinType:void 0,structType:void 0}}var Qr={encode(e,t=_.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.basicType!==void 0&&t.uint32(16).int32(e.basicType),e.coinType!==void 0&&jn.encode(e.coinType,t.uint32(26).fork()).ldelim(),e.structType!==void 0&&Yu.encode(e.structType,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=YO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==16)break;i.basicType=n.int32();continue;case 3:if(a!==26)break;i.coinType=jn.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.structType=Yu.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:A(e.name)?globalThis.String(e.name):"",basicType:A(e.basicType)?m5(e.basicType):void 0,coinType:A(e.coinType)?jn.fromJSON(e.coinType):void 0,structType:A(e.structType)?Yu.fromJSON(e.structType):void 0}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.basicType!==void 0&&(t.basicType=g5(e.basicType)),e.coinType!==void 0&&(t.coinType=jn.toJSON(e.coinType)),e.structType!==void 0&&(t.structType=Yu.toJSON(e.structType)),t},create(e){return Qr.fromPartial(e??{})},fromPartial(e){let t=YO();return t.name=e.name??"",t.basicType=e.basicType??void 0,t.coinType=e.coinType!==void 0&&e.coinType!==null?jn.fromPartial(e.coinType):void 0,t.structType=e.structType!==void 0&&e.structType!==null?Yu.fromPartial(e.structType):void 0,t}};function XO(){return{intervalInMinutes:[],types:[],discardOrigin:!1}}var Xu={encode(e,t=_.default.Writer.create()){t.uint32(10).fork();for(let n of e.intervalInMinutes)t.int32(n);t.ldelim(),t.uint32(18).fork();for(let n of e.types)t.int32(n);return t.ldelim(),e.discardOrigin!==!1&&t.uint32(24).bool(e.discardOrigin),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=XO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a===8){i.intervalInMinutes.push(n.int32());continue}if(a===10){let o=n.uint32()+n.pos;for(;n.pos<o;)i.intervalInMinutes.push(n.int32());continue}break;case 2:if(a===16){i.types.push(n.int32());continue}if(a===18){let o=n.uint32()+n.pos;for(;n.pos<o;)i.types.push(n.int32());continue}break;case 3:if(a!==24)break;i.discardOrigin=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{intervalInMinutes:globalThis.Array.isArray(e?.intervalInMinutes)?e.intervalInMinutes.map(t=>globalThis.Number(t)):[],types:globalThis.Array.isArray(e?.types)?e.types.map(t=>a5(t)):[],discardOrigin:A(e.discardOrigin)?globalThis.Boolean(e.discardOrigin):!1}},toJSON(e){let t={};return e.intervalInMinutes?.length&&(t.intervalInMinutes=e.intervalInMinutes.map(n=>Math.round(n))),e.types?.length&&(t.types=e.types.map(n=>o5(n))),e.discardOrigin!==!1&&(t.discardOrigin=e.discardOrigin),t},create(e){return Xu.fromPartial(e??{})},fromPartial(e){let t=XO();return t.intervalInMinutes=e.intervalInMinutes?.map(n=>n)||[],t.types=e.types?.map(n=>n)||[],t.discardOrigin=e.discardOrigin??!1,t}};function $O(){return{chainId:"",address:"",startBlock:BigInt("0"),intervalConfigs:[],moveIntervalConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],logConfigs:[]}}var $u={encode(e,t=_.default.Writer.create()){if(e.chainId!==""&&t.uint32(10).string(e.chainId),e.address!==""&&t.uint32(18).string(e.address),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");t.uint32(24).uint64(e.startBlock.toString())}for(let n of e.intervalConfigs)dn.encode(n,t.uint32(34).fork()).ldelim();for(let n of e.moveIntervalConfigs)Kr.encode(n,t.uint32(58).fork()).ldelim();for(let n of e.moveCallConfigs)Xr.encode(n,t.uint32(66).fork()).ldelim();for(let n of e.moveResourceChangeConfigs)$r.encode(n,t.uint32(74).fork()).ldelim();for(let n of e.logConfigs)Yr.encode(n,t.uint32(50).fork()).ldelim();return t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=$O();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=n.string();continue;case 2:if(a!==18)break;i.address=n.string();continue;case 3:if(a!==24)break;i.startBlock=Rl(n.uint64());continue;case 4:if(a!==34)break;i.intervalConfigs.push(dn.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.moveIntervalConfigs.push(Kr.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.moveCallConfigs.push(Xr.decode(n,n.uint32()));continue;case 9:if(a!==74)break;i.moveResourceChangeConfigs.push($r.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.logConfigs.push(Yr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{chainId:A(e.chainId)?globalThis.String(e.chainId):"",address:A(e.address)?globalThis.String(e.address):"",startBlock:A(e.startBlock)?BigInt(e.startBlock):BigInt("0"),intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(t=>dn.fromJSON(t)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(t=>Kr.fromJSON(t)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(t=>Xr.fromJSON(t)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(t=>$r.fromJSON(t)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(t=>Yr.fromJSON(t)):[]}},toJSON(e){let t={};return e.chainId!==""&&(t.chainId=e.chainId),e.address!==""&&(t.address=e.address),e.startBlock!==BigInt("0")&&(t.startBlock=e.startBlock.toString()),e.intervalConfigs?.length&&(t.intervalConfigs=e.intervalConfigs.map(n=>dn.toJSON(n))),e.moveIntervalConfigs?.length&&(t.moveIntervalConfigs=e.moveIntervalConfigs.map(n=>Kr.toJSON(n))),e.moveCallConfigs?.length&&(t.moveCallConfigs=e.moveCallConfigs.map(n=>Xr.toJSON(n))),e.moveResourceChangeConfigs?.length&&(t.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(n=>$r.toJSON(n))),e.logConfigs?.length&&(t.logConfigs=e.logConfigs.map(n=>Yr.toJSON(n))),t},create(e){return $u.fromPartial(e??{})},fromPartial(e){let t=$O();return t.chainId=e.chainId??"",t.address=e.address??"",t.startBlock=e.startBlock??BigInt("0"),t.intervalConfigs=e.intervalConfigs?.map(n=>dn.fromPartial(n))||[],t.moveIntervalConfigs=e.moveIntervalConfigs?.map(n=>Kr.fromPartial(n))||[],t.moveCallConfigs=e.moveCallConfigs?.map(n=>Xr.fromPartial(n))||[],t.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(n=>$r.fromPartial(n))||[],t.logConfigs=e.logConfigs?.map(n=>Yr.fromPartial(n))||[],t}};function jO(){return{recentInterval:0,backfillInterval:0}}var zr={encode(e,t=_.default.Writer.create()){return e.recentInterval!==0&&t.uint32(8).int32(e.recentInterval),e.backfillInterval!==0&&t.uint32(16).int32(e.backfillInterval),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=jO();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.recentInterval=n.int32();continue;case 2:if(a!==16)break;i.backfillInterval=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{recentInterval:A(e.recentInterval)?globalThis.Number(e.recentInterval):0,backfillInterval:A(e.backfillInterval)?globalThis.Number(e.backfillInterval):0}},toJSON(e){let t={};return e.recentInterval!==0&&(t.recentInterval=Math.round(e.recentInterval)),e.backfillInterval!==0&&(t.backfillInterval=Math.round(e.backfillInterval)),t},create(e){return zr.fromPartial(e??{})},fromPartial(e){let t=jO();return t.recentInterval=e.recentInterval??0,t.backfillInterval=e.backfillInterval??0,t}};function eR(){return{handlerId:0,minutes:0,minutesInterval:void 0,slot:0,slotInterval:void 0,fetchConfig:void 0,handlerName:""}}var dn={encode(e,t=_.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.minutes!==0&&t.uint32(16).int32(e.minutes),e.minutesInterval!==void 0&&zr.encode(e.minutesInterval,t.uint32(34).fork()).ldelim(),e.slot!==0&&t.uint32(24).int32(e.slot),e.slotInterval!==void 0&&zr.encode(e.slotInterval,t.uint32(42).fork()).ldelim(),e.fetchConfig!==void 0&&vt.encode(e.fetchConfig,t.uint32(50).fork()).ldelim(),e.handlerName!==""&&t.uint32(58).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=eR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=n.int32();continue;case 2:if(a!==16)break;i.minutes=n.int32();continue;case 4:if(a!==34)break;i.minutesInterval=zr.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.slot=n.int32();continue;case 5:if(a!==42)break;i.slotInterval=zr.decode(n,n.uint32());continue;case 6:if(a!==50)break;i.fetchConfig=vt.decode(n,n.uint32());continue;case 7:if(a!==58)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,minutes:A(e.minutes)?globalThis.Number(e.minutes):0,minutesInterval:A(e.minutesInterval)?zr.fromJSON(e.minutesInterval):void 0,slot:A(e.slot)?globalThis.Number(e.slot):0,slotInterval:A(e.slotInterval)?zr.fromJSON(e.slotInterval):void 0,fetchConfig:A(e.fetchConfig)?vt.fromJSON(e.fetchConfig):void 0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.minutes!==0&&(t.minutes=Math.round(e.minutes)),e.minutesInterval!==void 0&&(t.minutesInterval=zr.toJSON(e.minutesInterval)),e.slot!==0&&(t.slot=Math.round(e.slot)),e.slotInterval!==void 0&&(t.slotInterval=zr.toJSON(e.slotInterval)),e.fetchConfig!==void 0&&(t.fetchConfig=vt.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return dn.fromPartial(e??{})},fromPartial(e){let t=eR();return t.handlerId=e.handlerId??0,t.minutes=e.minutes??0,t.minutesInterval=e.minutesInterval!==void 0&&e.minutesInterval!==null?zr.fromPartial(e.minutesInterval):void 0,t.slot=e.slot??0,t.slotInterval=e.slotInterval!==void 0&&e.slotInterval!==null?zr.fromPartial(e.slotInterval):void 0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?vt.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function tR(){return{intervalConfig:void 0,type:"",ownerType:0,resourceFetchConfig:void 0,fetchConfig:void 0}}var Kr={encode(e,t=_.default.Writer.create()){return e.intervalConfig!==void 0&&dn.encode(e.intervalConfig,t.uint32(10).fork()).ldelim(),e.type!==""&&t.uint32(18).string(e.type),e.ownerType!==0&&t.uint32(24).int32(e.ownerType),e.resourceFetchConfig!==void 0&&dl.encode(e.resourceFetchConfig,t.uint32(34).fork()).ldelim(),e.fetchConfig!==void 0&&fn.encode(e.fetchConfig,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=tR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.intervalConfig=dn.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.type=n.string();continue;case 3:if(a!==24)break;i.ownerType=n.int32();continue;case 4:if(a!==34)break;i.resourceFetchConfig=dl.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.fetchConfig=fn.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{intervalConfig:A(e.intervalConfig)?dn.fromJSON(e.intervalConfig):void 0,type:A(e.type)?globalThis.String(e.type):"",ownerType:A(e.ownerType)?s5(e.ownerType):0,resourceFetchConfig:A(e.resourceFetchConfig)?dl.fromJSON(e.resourceFetchConfig):void 0,fetchConfig:A(e.fetchConfig)?fn.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.intervalConfig!==void 0&&(t.intervalConfig=dn.toJSON(e.intervalConfig)),e.type!==""&&(t.type=e.type),e.ownerType!==0&&(t.ownerType=u5(e.ownerType)),e.resourceFetchConfig!==void 0&&(t.resourceFetchConfig=dl.toJSON(e.resourceFetchConfig)),e.fetchConfig!==void 0&&(t.fetchConfig=fn.toJSON(e.fetchConfig)),t},create(e){return Kr.fromPartial(e??{})},fromPartial(e){let t=tR();return t.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?dn.fromPartial(e.intervalConfig):void 0,t.type=e.type??"",t.ownerType=e.ownerType??0,t.resourceFetchConfig=e.resourceFetchConfig!==void 0&&e.resourceFetchConfig!==null?dl.fromPartial(e.resourceFetchConfig):void 0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?fn.fromPartial(e.fetchConfig):void 0,t}};function nR(){return{name:"",chainId:"",address:"",abi:""}}var Zr={encode(e,t=_.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.chainId!==""&&t.uint32(18).string(e.chainId),e.address!==""&&t.uint32(26).string(e.address),e.abi!==""&&t.uint32(34).string(e.abi),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=nR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==18)break;i.chainId=n.string();continue;case 3:if(a!==26)break;i.address=n.string();continue;case 4:if(a!==34)break;i.abi=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:A(e.name)?globalThis.String(e.name):"",chainId:A(e.chainId)?globalThis.String(e.chainId):"",address:A(e.address)?globalThis.String(e.address):"",abi:A(e.abi)?globalThis.String(e.abi):""}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.chainId!==""&&(t.chainId=e.chainId),e.address!==""&&(t.address=e.address),e.abi!==""&&(t.abi=e.abi),t},create(e){return Zr.fromPartial(e??{})},fromPartial(e){let t=nR();return t.name=e.name??"",t.chainId=e.chainId??"",t.address=e.address??"",t.abi=e.abi??"",t}};function rR(){return{contract:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),templateId:0,baseLabels:void 0}}var ju={encode(e,t=_.default.Writer.create()){if(e.contract!==void 0&&Zr.encode(e.contract,t.uint32(10).fork()).ldelim(),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");t.uint32(16).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");t.uint32(24).uint64(e.endBlock.toString())}return e.templateId!==0&&t.uint32(32).int32(e.templateId),e.baseLabels!==void 0&&In.encode(In.wrap(e.baseLabels),t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=rR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.contract=Zr.decode(n,n.uint32());continue;case 2:if(a!==16)break;i.startBlock=Rl(n.uint64());continue;case 3:if(a!==24)break;i.endBlock=Rl(n.uint64());continue;case 4:if(a!==32)break;i.templateId=n.int32();continue;case 5:if(a!==42)break;i.baseLabels=In.unwrap(In.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{contract:A(e.contract)?Zr.fromJSON(e.contract):void 0,startBlock:A(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:A(e.endBlock)?BigInt(e.endBlock):BigInt("0"),templateId:A(e.templateId)?globalThis.Number(e.templateId):0,baseLabels:Pm(e.baseLabels)?e.baseLabels:void 0}},toJSON(e){let t={};return e.contract!==void 0&&(t.contract=Zr.toJSON(e.contract)),e.startBlock!==BigInt("0")&&(t.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(t.endBlock=e.endBlock.toString()),e.templateId!==0&&(t.templateId=Math.round(e.templateId)),e.baseLabels!==void 0&&(t.baseLabels=e.baseLabels),t},create(e){return ju.fromPartial(e??{})},fromPartial(e){let t=rR();return t.contract=e.contract!==void 0&&e.contract!==null?Zr.fromPartial(e.contract):void 0,t.startBlock=e.startBlock??BigInt("0"),t.endBlock=e.endBlock??BigInt("0"),t.templateId=e.templateId??0,t.baseLabels=e.baseLabels??void 0,t}};function iR(){return{transaction:!1,transactionReceipt:!1,transactionReceiptLogs:!1,block:!1,trace:!1}}var vt={encode(e,t=_.default.Writer.create()){return e.transaction!==!1&&t.uint32(8).bool(e.transaction),e.transactionReceipt!==!1&&t.uint32(16).bool(e.transactionReceipt),e.transactionReceiptLogs!==!1&&t.uint32(40).bool(e.transactionReceiptLogs),e.block!==!1&&t.uint32(24).bool(e.block),e.trace!==!1&&t.uint32(32).bool(e.trace),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=iR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.transaction=n.bool();continue;case 2:if(a!==16)break;i.transactionReceipt=n.bool();continue;case 5:if(a!==40)break;i.transactionReceiptLogs=n.bool();continue;case 3:if(a!==24)break;i.block=n.bool();continue;case 4:if(a!==32)break;i.trace=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:A(e.transaction)?globalThis.Boolean(e.transaction):!1,transactionReceipt:A(e.transactionReceipt)?globalThis.Boolean(e.transactionReceipt):!1,transactionReceiptLogs:A(e.transactionReceiptLogs)?globalThis.Boolean(e.transactionReceiptLogs):!1,block:A(e.block)?globalThis.Boolean(e.block):!1,trace:A(e.trace)?globalThis.Boolean(e.trace):!1}},toJSON(e){let t={};return e.transaction!==!1&&(t.transaction=e.transaction),e.transactionReceipt!==!1&&(t.transactionReceipt=e.transactionReceipt),e.transactionReceiptLogs!==!1&&(t.transactionReceiptLogs=e.transactionReceiptLogs),e.block!==!1&&(t.block=e.block),e.trace!==!1&&(t.trace=e.trace),t},create(e){return vt.fromPartial(e??{})},fromPartial(e){let t=iR();return t.transaction=e.transaction??!1,t.transactionReceipt=e.transactionReceipt??!1,t.transactionReceiptLogs=e.transactionReceiptLogs??!1,t.block=e.block??!1,t.trace=e.trace??!1,t}};function aR(){return{signature:"",handlerId:0,fetchConfig:void 0,handlerName:""}}var el={encode(e,t=_.default.Writer.create()){return e.signature!==""&&t.uint32(10).string(e.signature),e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&vt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=aR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.signature=n.string();continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=vt.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{signature:A(e.signature)?globalThis.String(e.signature):"",handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:A(e.fetchConfig)?vt.fromJSON(e.fetchConfig):void 0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.signature!==""&&(t.signature=e.signature),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=vt.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return el.fromPartial(e??{})},fromPartial(e){let t=aR();return t.signature=e.signature??"",t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?vt.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function oR(){return{handlerId:0,fetchConfig:void 0,handlerName:""}}var tl={encode(e,t=_.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.fetchConfig!==void 0&&vt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=oR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=vt.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:A(e.fetchConfig)?vt.fromJSON(e.fetchConfig):void 0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=vt.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return tl.fromPartial(e??{})},fromPartial(e){let t=oR();return t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?vt.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function sR(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}var Yr={encode(e,t=_.default.Writer.create()){for(let n of e.filters)ul.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&vt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=sR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(ul.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=vt.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>ul.fromJSON(t)):[],handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:A(e.fetchConfig)?vt.fromJSON(e.fetchConfig):void 0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>ul.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=vt.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Yr.fromPartial(e??{})},fromPartial(e){let t=sR();return t.filters=e.filters?.map(n=>ul.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?vt.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function uR(){return{filters:[],handlerId:0,handlerName:""}}var nl={encode(e,t=_.default.Writer.create()){for(let n of e.filters)rl.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=uR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(rl.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>rl.fromJSON(t)):[],handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>rl.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return nl.fromPartial(e??{})},fromPartial(e){let t=uR();return t.filters=e.filters?.map(n=>rl.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function lR(){return{assetId:void 0,fromAddress:void 0,toAddress:void 0}}var rl={encode(e,t=_.default.Writer.create()){return e.assetId!==void 0&&t.uint32(10).string(e.assetId),e.fromAddress!==void 0&&t.uint32(18).string(e.fromAddress),e.toAddress!==void 0&&t.uint32(26).string(e.toAddress),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=lR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.assetId=n.string();continue;case 2:if(a!==18)break;i.fromAddress=n.string();continue;case 3:if(a!==26)break;i.toAddress=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{assetId:A(e.assetId)?globalThis.String(e.assetId):void 0,fromAddress:A(e.fromAddress)?globalThis.String(e.fromAddress):void 0,toAddress:A(e.toAddress)?globalThis.String(e.toAddress):void 0}},toJSON(e){let t={};return e.assetId!==void 0&&(t.assetId=e.assetId),e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),t},create(e){return rl.fromPartial(e??{})},fromPartial(e){let t=lR();return t.assetId=e.assetId??void 0,t.fromAddress=e.fromAddress??void 0,t.toAddress=e.toAddress??void 0,t}};function cR(){return{log:void 0,transfer:void 0,handlerId:0,handlerName:""}}var il={encode(e,t=_.default.Writer.create()){return e.log!==void 0&&ol.encode(e.log,t.uint32(10).fork()).ldelim(),e.transfer!==void 0&&al.encode(e.transfer,t.uint32(18).fork()).ldelim(),e.handlerId!==0&&t.uint32(24).int32(e.handlerId),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=cR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.log=ol.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.transfer=al.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.handlerId=n.int32();continue;case 4:if(a!==34)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{log:A(e.log)?ol.fromJSON(e.log):void 0,transfer:A(e.transfer)?al.fromJSON(e.transfer):void 0,handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.log!==void 0&&(t.log=ol.toJSON(e.log)),e.transfer!==void 0&&(t.transfer=al.toJSON(e.transfer)),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return il.fromPartial(e??{})},fromPartial(e){let t=cR();return t.log=e.log!==void 0&&e.log!==null?ol.fromPartial(e.log):void 0,t.transfer=e.transfer!==void 0&&e.transfer!==null?al.fromPartial(e.transfer):void 0,t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function dR(){return{assetId:"",from:"",to:""}}var al={encode(e,t=_.default.Writer.create()){return e.assetId!==""&&t.uint32(34).string(e.assetId),e.from!==""&&t.uint32(10).string(e.from),e.to!==""&&t.uint32(18).string(e.to),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=dR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 4:if(a!==34)break;i.assetId=n.string();continue;case 1:if(a!==10)break;i.from=n.string();continue;case 2:if(a!==18)break;i.to=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{assetId:A(e.assetId)?globalThis.String(e.assetId):"",from:A(e.from)?globalThis.String(e.from):"",to:A(e.to)?globalThis.String(e.to):""}},toJSON(e){let t={};return e.assetId!==""&&(t.assetId=e.assetId),e.from!==""&&(t.from=e.from),e.to!==""&&(t.to=e.to),t},create(e){return al.fromPartial(e??{})},fromPartial(e){let t=dR();return t.assetId=e.assetId??"",t.from=e.from??"",t.to=e.to??"",t}};function fR(){return{logIds:[]}}var ol={encode(e,t=_.default.Writer.create()){for(let n of e.logIds)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=fR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logIds.push(n.string());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{logIds:globalThis.Array.isArray(e?.logIds)?e.logIds.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.logIds?.length&&(t.logIds=e.logIds),t},create(e){return ol.fromPartial(e??{})},fromPartial(e){let t=fR();return t.logIds=e.logIds?.map(n=>n)||[],t}};function hR(){return{logFilters:[],handlerId:0,handlerName:""}}var sl={encode(e,t=_.default.Writer.create()){for(let n of e.logFilters)t.uint32(10).string(n);return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=hR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logFilters.push(n.string());continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{logFilters:globalThis.Array.isArray(e?.logFilters)?e.logFilters.map(t=>globalThis.String(t)):[],handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.logFilters?.length&&(t.logFilters=e.logFilters),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return sl.fromPartial(e??{})},fromPartial(e){let t=hR();return t.logFilters=e.logFilters?.map(n=>n)||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function pR(){return{topics:[],address:void 0,addressType:void 0}}var ul={encode(e,t=_.default.Writer.create()){for(let n of e.topics)El.encode(n,t.uint32(10).fork()).ldelim();return e.address!==void 0&&t.uint32(18).string(e.address),e.addressType!==void 0&&t.uint32(24).int32(e.addressType),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=pR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.topics.push(El.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.address=n.string();continue;case 3:if(a!==24)break;i.addressType=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{topics:globalThis.Array.isArray(e?.topics)?e.topics.map(t=>El.fromJSON(t)):[],address:A(e.address)?globalThis.String(e.address):void 0,addressType:A(e.addressType)?l5(e.addressType):void 0}},toJSON(e){let t={};return e.topics?.length&&(t.topics=e.topics.map(n=>El.toJSON(n))),e.address!==void 0&&(t.address=e.address),e.addressType!==void 0&&(t.addressType=c5(e.addressType)),t},create(e){return ul.fromPartial(e??{})},fromPartial(e){let t=pR();return t.topics=e.topics?.map(n=>El.fromPartial(n))||[],t.address=e.address??void 0,t.addressType=e.addressType??void 0,t}};function mR(){return{innerInstruction:!1,parsedInstruction:!1,rawDataInstruction:!1}}var ll={encode(e,t=_.default.Writer.create()){return e.innerInstruction!==!1&&t.uint32(8).bool(e.innerInstruction),e.parsedInstruction!==!1&&t.uint32(16).bool(e.parsedInstruction),e.rawDataInstruction!==!1&&t.uint32(24).bool(e.rawDataInstruction),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=mR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.innerInstruction=n.bool();continue;case 2:if(a!==16)break;i.parsedInstruction=n.bool();continue;case 3:if(a!==24)break;i.rawDataInstruction=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{innerInstruction:A(e.innerInstruction)?globalThis.Boolean(e.innerInstruction):!1,parsedInstruction:A(e.parsedInstruction)?globalThis.Boolean(e.parsedInstruction):!1,rawDataInstruction:A(e.rawDataInstruction)?globalThis.Boolean(e.rawDataInstruction):!1}},toJSON(e){let t={};return e.innerInstruction!==!1&&(t.innerInstruction=e.innerInstruction),e.parsedInstruction!==!1&&(t.parsedInstruction=e.parsedInstruction),e.rawDataInstruction!==!1&&(t.rawDataInstruction=e.rawDataInstruction),t},create(e){return ll.fromPartial(e??{})},fromPartial(e){let t=mR();return t.innerInstruction=e.innerInstruction??!1,t.parsedInstruction=e.parsedInstruction??!1,t.rawDataInstruction=e.rawDataInstruction??!1,t}};function gR(){return{moveTypePrefix:""}}var cl={encode(e,t=_.default.Writer.create()){return e.moveTypePrefix!==""&&t.uint32(10).string(e.moveTypePrefix),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=gR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.moveTypePrefix=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{moveTypePrefix:A(e.moveTypePrefix)?globalThis.String(e.moveTypePrefix):""}},toJSON(e){let t={};return e.moveTypePrefix!==""&&(t.moveTypePrefix=e.moveTypePrefix),t},create(e){return cl.fromPartial(e??{})},fromPartial(e){let t=gR();return t.moveTypePrefix=e.moveTypePrefix??"",t}};function yR(){return{resourceChanges:!1,allEvents:!1,inputs:!1,resourceConfig:void 0,supportMultisigFunc:void 0,includeFailedTransaction:void 0}}var fn={encode(e,t=_.default.Writer.create()){return e.resourceChanges!==!1&&t.uint32(8).bool(e.resourceChanges),e.allEvents!==!1&&t.uint32(16).bool(e.allEvents),e.inputs!==!1&&t.uint32(32).bool(e.inputs),e.resourceConfig!==void 0&&cl.encode(e.resourceConfig,t.uint32(26).fork()).ldelim(),e.supportMultisigFunc!==void 0&&t.uint32(40).bool(e.supportMultisigFunc),e.includeFailedTransaction!==void 0&&t.uint32(48).bool(e.includeFailedTransaction),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=yR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.resourceChanges=n.bool();continue;case 2:if(a!==16)break;i.allEvents=n.bool();continue;case 4:if(a!==32)break;i.inputs=n.bool();continue;case 3:if(a!==26)break;i.resourceConfig=cl.decode(n,n.uint32());continue;case 5:if(a!==40)break;i.supportMultisigFunc=n.bool();continue;case 6:if(a!==48)break;i.includeFailedTransaction=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{resourceChanges:A(e.resourceChanges)?globalThis.Boolean(e.resourceChanges):!1,allEvents:A(e.allEvents)?globalThis.Boolean(e.allEvents):!1,inputs:A(e.inputs)?globalThis.Boolean(e.inputs):!1,resourceConfig:A(e.resourceConfig)?cl.fromJSON(e.resourceConfig):void 0,supportMultisigFunc:A(e.supportMultisigFunc)?globalThis.Boolean(e.supportMultisigFunc):void 0,includeFailedTransaction:A(e.includeFailedTransaction)?globalThis.Boolean(e.includeFailedTransaction):void 0}},toJSON(e){let t={};return e.resourceChanges!==!1&&(t.resourceChanges=e.resourceChanges),e.allEvents!==!1&&(t.allEvents=e.allEvents),e.inputs!==!1&&(t.inputs=e.inputs),e.resourceConfig!==void 0&&(t.resourceConfig=cl.toJSON(e.resourceConfig)),e.supportMultisigFunc!==void 0&&(t.supportMultisigFunc=e.supportMultisigFunc),e.includeFailedTransaction!==void 0&&(t.includeFailedTransaction=e.includeFailedTransaction),t},create(e){return fn.fromPartial(e??{})},fromPartial(e){let t=yR();return t.resourceChanges=e.resourceChanges??!1,t.allEvents=e.allEvents??!1,t.inputs=e.inputs??!1,t.resourceConfig=e.resourceConfig!==void 0&&e.resourceConfig!==null?cl.fromPartial(e.resourceConfig):void 0,t.supportMultisigFunc=e.supportMultisigFunc??void 0,t.includeFailedTransaction=e.includeFailedTransaction??void 0,t}};function vR(){return{owned:!1}}var dl={encode(e,t=_.default.Writer.create()){return e.owned!==!1&&t.uint32(8).bool(e.owned),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=vR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.owned=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{owned:A(e.owned)?globalThis.Boolean(e.owned):!1}},toJSON(e){let t={};return e.owned!==!1&&(t.owned=e.owned),t},create(e){return dl.fromPartial(e??{})},fromPartial(e){let t=vR();return t.owned=e.owned??!1,t}};function SR(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}var fl={encode(e,t=_.default.Writer.create()){for(let n of e.filters)hl.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&fn.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=SR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(hl.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=fn.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>hl.fromJSON(t)):[],handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:A(e.fetchConfig)?fn.fromJSON(e.fetchConfig):void 0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>hl.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=fn.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return fl.fromPartial(e??{})},fromPartial(e){let t=SR();return t.filters=e.filters?.map(n=>hl.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?fn.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function bR(){return{type:"",account:"",eventAccount:""}}var hl={encode(e,t=_.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.account!==""&&t.uint32(18).string(e.account),e.eventAccount!==""&&t.uint32(26).string(e.eventAccount),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=bR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=n.string();continue;case 2:if(a!==18)break;i.account=n.string();continue;case 3:if(a!==26)break;i.eventAccount=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{type:A(e.type)?globalThis.String(e.type):"",account:A(e.account)?globalThis.String(e.account):"",eventAccount:A(e.eventAccount)?globalThis.String(e.eventAccount):""}},toJSON(e){let t={};return e.type!==""&&(t.type=e.type),e.account!==""&&(t.account=e.account),e.eventAccount!==""&&(t.eventAccount=e.eventAccount),t},create(e){return hl.fromPartial(e??{})},fromPartial(e){let t=bR();return t.type=e.type??"",t.account=e.account??"",t.eventAccount=e.eventAccount??"",t}};function TR(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}var Xr={encode(e,t=_.default.Writer.create()){for(let n of e.filters)pl.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&fn.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=TR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(pl.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=fn.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>pl.fromJSON(t)):[],handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:A(e.fetchConfig)?fn.fromJSON(e.fetchConfig):void 0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>pl.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=fn.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Xr.fromPartial(e??{})},fromPartial(e){let t=TR();return t.filters=e.filters?.map(n=>pl.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?fn.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function ER(){return{type:"",handlerId:0,handlerName:""}}var $r={encode(e,t=_.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ER();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=n.string();continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{type:A(e.type)?globalThis.String(e.type):"",handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.type!==""&&(t.type=e.type),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return $r.fromPartial(e??{})},fromPartial(e){let t=ER();return t.type=e.type??"",t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function CR(){return{function:"",typeArguments:[],withTypeArguments:!1,includeFailed:!1,publicKeyPrefix:"",fromAndToAddress:void 0}}var pl={encode(e,t=_.default.Writer.create()){e.function!==""&&t.uint32(10).string(e.function);for(let n of e.typeArguments)t.uint32(18).string(n);return e.withTypeArguments!==!1&&t.uint32(24).bool(e.withTypeArguments),e.includeFailed!==!1&&t.uint32(32).bool(e.includeFailed),e.publicKeyPrefix!==""&&t.uint32(42).string(e.publicKeyPrefix),e.fromAndToAddress!==void 0&&ml.encode(e.fromAndToAddress,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=CR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.function=n.string();continue;case 2:if(a!==18)break;i.typeArguments.push(n.string());continue;case 3:if(a!==24)break;i.withTypeArguments=n.bool();continue;case 4:if(a!==32)break;i.includeFailed=n.bool();continue;case 5:if(a!==42)break;i.publicKeyPrefix=n.string();continue;case 6:if(a!==50)break;i.fromAndToAddress=ml.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{function:A(e.function)?globalThis.String(e.function):"",typeArguments:globalThis.Array.isArray(e?.typeArguments)?e.typeArguments.map(t=>globalThis.String(t)):[],withTypeArguments:A(e.withTypeArguments)?globalThis.Boolean(e.withTypeArguments):!1,includeFailed:A(e.includeFailed)?globalThis.Boolean(e.includeFailed):!1,publicKeyPrefix:A(e.publicKeyPrefix)?globalThis.String(e.publicKeyPrefix):"",fromAndToAddress:A(e.fromAndToAddress)?ml.fromJSON(e.fromAndToAddress):void 0}},toJSON(e){let t={};return e.function!==""&&(t.function=e.function),e.typeArguments?.length&&(t.typeArguments=e.typeArguments),e.withTypeArguments!==!1&&(t.withTypeArguments=e.withTypeArguments),e.includeFailed!==!1&&(t.includeFailed=e.includeFailed),e.publicKeyPrefix!==""&&(t.publicKeyPrefix=e.publicKeyPrefix),e.fromAndToAddress!==void 0&&(t.fromAndToAddress=ml.toJSON(e.fromAndToAddress)),t},create(e){return pl.fromPartial(e??{})},fromPartial(e){let t=CR();return t.function=e.function??"",t.typeArguments=e.typeArguments?.map(n=>n)||[],t.withTypeArguments=e.withTypeArguments??!1,t.includeFailed=e.includeFailed??!1,t.publicKeyPrefix=e.publicKeyPrefix??"",t.fromAndToAddress=e.fromAndToAddress!==void 0&&e.fromAndToAddress!==null?ml.fromPartial(e.fromAndToAddress):void 0,t}};function kR(){return{from:"",to:""}}var ml={encode(e,t=_.default.Writer.create()){return e.from!==""&&t.uint32(10).string(e.from),e.to!==""&&t.uint32(18).string(e.to),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=kR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.from=n.string();continue;case 2:if(a!==18)break;i.to=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{from:A(e.from)?globalThis.String(e.from):"",to:A(e.to)?globalThis.String(e.to):""}},toJSON(e){let t={};return e.from!==""&&(t.from=e.from),e.to!==""&&(t.to=e.to),t},create(e){return ml.fromPartial(e??{})},fromPartial(e){let t=kR();return t.from=e.from??"",t.to=e.to??"",t}};function _R(){return{filters:[],handlerId:0,handlerName:""}}var gl={encode(e,t=_.default.Writer.create()){for(let n of e.filters)bl.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=_R();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(bl.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>bl.fromJSON(t)):[],handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>bl.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return gl.fromPartial(e??{})},fromPartial(e){let t=_R();return t.filters=e.filters?.map(n=>bl.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function AR(){return{filters:[],handlerId:0,handlerName:""}}var yl={encode(e,t=_.default.Writer.create()){for(let n of e.filters)jr.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=AR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(jr.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>jr.fromJSON(t)):[],handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>jr.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return yl.fromPartial(e??{})},fromPartial(e){let t=AR();return t.filters=e.filters?.map(n=>jr.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function NR(){return{inputFilter:void 0,outputFilter:void 0,filter:[]}}var jr={encode(e,t=_.default.Writer.create()){e.inputFilter!==void 0&&vl.encode(e.inputFilter,t.uint32(10).fork()).ldelim(),e.outputFilter!==void 0&&Sl.encode(e.outputFilter,t.uint32(18).fork()).ldelim();for(let n of e.filter)hn.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=NR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.inputFilter=vl.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.outputFilter=Sl.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.filter.push(hn.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{inputFilter:A(e.inputFilter)?vl.fromJSON(e.inputFilter):void 0,outputFilter:A(e.outputFilter)?Sl.fromJSON(e.outputFilter):void 0,filter:globalThis.Array.isArray(e?.filter)?e.filter.map(t=>hn.fromJSON(t)):[]}},toJSON(e){let t={};return e.inputFilter!==void 0&&(t.inputFilter=vl.toJSON(e.inputFilter)),e.outputFilter!==void 0&&(t.outputFilter=Sl.toJSON(e.outputFilter)),e.filter?.length&&(t.filter=e.filter.map(n=>hn.toJSON(n))),t},create(e){return jr.fromPartial(e??{})},fromPartial(e){let t=NR();return t.inputFilter=e.inputFilter!==void 0&&e.inputFilter!==null?vl.fromPartial(e.inputFilter):void 0,t.outputFilter=e.outputFilter!==void 0&&e.outputFilter!==null?Sl.fromPartial(e.outputFilter):void 0,t.filter=e.filter?.map(n=>hn.fromPartial(n))||[],t}};function IR(){return{eq:void 0,gt:void 0,gte:void 0,lt:void 0,lte:void 0,ne:void 0,prefix:void 0,contains:void 0,notContains:void 0,lengthEq:void 0,lengthGt:void 0,lengthLt:void 0,hasAny:void 0,hasAll:void 0,in:void 0}}var va={encode(e,t=_.default.Writer.create()){return e.eq!==void 0&&he.encode(e.eq,t.uint32(10).fork()).ldelim(),e.gt!==void 0&&he.encode(e.gt,t.uint32(18).fork()).ldelim(),e.gte!==void 0&&he.encode(e.gte,t.uint32(26).fork()).ldelim(),e.lt!==void 0&&he.encode(e.lt,t.uint32(34).fork()).ldelim(),e.lte!==void 0&&he.encode(e.lte,t.uint32(42).fork()).ldelim(),e.ne!==void 0&&he.encode(e.ne,t.uint32(50).fork()).ldelim(),e.prefix!==void 0&&t.uint32(58).string(e.prefix),e.contains!==void 0&&t.uint32(66).string(e.contains),e.notContains!==void 0&&t.uint32(74).string(e.notContains),e.lengthEq!==void 0&&t.uint32(80).int32(e.lengthEq),e.lengthGt!==void 0&&t.uint32(88).int32(e.lengthGt),e.lengthLt!==void 0&&t.uint32(96).int32(e.lengthLt),e.hasAny!==void 0&&ft.encode(e.hasAny,t.uint32(106).fork()).ldelim(),e.hasAll!==void 0&&ft.encode(e.hasAll,t.uint32(114).fork()).ldelim(),e.in!==void 0&&ft.encode(e.in,t.uint32(122).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=IR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.eq=he.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.gt=he.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.gte=he.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.lt=he.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.lte=he.decode(n,n.uint32());continue;case 6:if(a!==50)break;i.ne=he.decode(n,n.uint32());continue;case 7:if(a!==58)break;i.prefix=n.string();continue;case 8:if(a!==66)break;i.contains=n.string();continue;case 9:if(a!==74)break;i.notContains=n.string();continue;case 10:if(a!==80)break;i.lengthEq=n.int32();continue;case 11:if(a!==88)break;i.lengthGt=n.int32();continue;case 12:if(a!==96)break;i.lengthLt=n.int32();continue;case 13:if(a!==106)break;i.hasAny=ft.decode(n,n.uint32());continue;case 14:if(a!==114)break;i.hasAll=ft.decode(n,n.uint32());continue;case 15:if(a!==122)break;i.in=ft.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{eq:A(e.eq)?he.fromJSON(e.eq):void 0,gt:A(e.gt)?he.fromJSON(e.gt):void 0,gte:A(e.gte)?he.fromJSON(e.gte):void 0,lt:A(e.lt)?he.fromJSON(e.lt):void 0,lte:A(e.lte)?he.fromJSON(e.lte):void 0,ne:A(e.ne)?he.fromJSON(e.ne):void 0,prefix:A(e.prefix)?globalThis.String(e.prefix):void 0,contains:A(e.contains)?globalThis.String(e.contains):void 0,notContains:A(e.notContains)?globalThis.String(e.notContains):void 0,lengthEq:A(e.lengthEq)?globalThis.Number(e.lengthEq):void 0,lengthGt:A(e.lengthGt)?globalThis.Number(e.lengthGt):void 0,lengthLt:A(e.lengthLt)?globalThis.Number(e.lengthLt):void 0,hasAny:A(e.hasAny)?ft.fromJSON(e.hasAny):void 0,hasAll:A(e.hasAll)?ft.fromJSON(e.hasAll):void 0,in:A(e.in)?ft.fromJSON(e.in):void 0}},toJSON(e){let t={};return e.eq!==void 0&&(t.eq=he.toJSON(e.eq)),e.gt!==void 0&&(t.gt=he.toJSON(e.gt)),e.gte!==void 0&&(t.gte=he.toJSON(e.gte)),e.lt!==void 0&&(t.lt=he.toJSON(e.lt)),e.lte!==void 0&&(t.lte=he.toJSON(e.lte)),e.ne!==void 0&&(t.ne=he.toJSON(e.ne)),e.prefix!==void 0&&(t.prefix=e.prefix),e.contains!==void 0&&(t.contains=e.contains),e.notContains!==void 0&&(t.notContains=e.notContains),e.lengthEq!==void 0&&(t.lengthEq=Math.round(e.lengthEq)),e.lengthGt!==void 0&&(t.lengthGt=Math.round(e.lengthGt)),e.lengthLt!==void 0&&(t.lengthLt=Math.round(e.lengthLt)),e.hasAny!==void 0&&(t.hasAny=ft.toJSON(e.hasAny)),e.hasAll!==void 0&&(t.hasAll=ft.toJSON(e.hasAll)),e.in!==void 0&&(t.in=ft.toJSON(e.in)),t},create(e){return va.fromPartial(e??{})},fromPartial(e){let t=IR();return t.eq=e.eq!==void 0&&e.eq!==null?he.fromPartial(e.eq):void 0,t.gt=e.gt!==void 0&&e.gt!==null?he.fromPartial(e.gt):void 0,t.gte=e.gte!==void 0&&e.gte!==null?he.fromPartial(e.gte):void 0,t.lt=e.lt!==void 0&&e.lt!==null?he.fromPartial(e.lt):void 0,t.lte=e.lte!==void 0&&e.lte!==null?he.fromPartial(e.lte):void 0,t.ne=e.ne!==void 0&&e.ne!==null?he.fromPartial(e.ne):void 0,t.prefix=e.prefix??void 0,t.contains=e.contains??void 0,t.notContains=e.notContains??void 0,t.lengthEq=e.lengthEq??void 0,t.lengthGt=e.lengthGt??void 0,t.lengthLt=e.lengthLt??void 0,t.hasAny=e.hasAny!==void 0&&e.hasAny!==null?ft.fromPartial(e.hasAny):void 0,t.hasAll=e.hasAll!==void 0&&e.hasAll!==null?ft.fromPartial(e.hasAll):void 0,t.in=e.in!==void 0&&e.in!==null?ft.fromPartial(e.in):void 0,t}};function OR(){return{conditions:{}}}var hn={encode(e,t=_.default.Writer.create()){return Object.entries(e.conditions).forEach(([n,r])=>{oE.encode({key:n,value:r},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=OR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;let o=oE.decode(n,n.uint32());o.value!==void 0&&(i.conditions[o.key]=o.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{conditions:Pm(e.conditions)?Object.entries(e.conditions).reduce((t,[n,r])=>(t[n]=va.fromJSON(r),t),{}):{}}},toJSON(e){let t={};if(e.conditions){let n=Object.entries(e.conditions);n.length>0&&(t.conditions={},n.forEach(([r,i])=>{t.conditions[r]=va.toJSON(i)}))}return t},create(e){return hn.fromPartial(e??{})},fromPartial(e){let t=OR();return t.conditions=Object.entries(e.conditions??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=va.fromPartial(i)),n),{}),t}};function RR(){return{key:"",value:void 0}}var oE={encode(e,t=_.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&va.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=RR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=va.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:A(e.key)?globalThis.String(e.key):"",value:A(e.value)?va.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=va.toJSON(e.value)),t},create(e){return oE.fromPartial(e??{})},fromPartial(e){let t=RR();return t.key=e.key??"",t.value=e.value!==void 0&&e.value!==null?va.fromPartial(e.value):void 0,t}};function PR(){return{filters:[]}}var ei={encode(e,t=_.default.Writer.create()){for(let n of e.filters)hn.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=PR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(hn.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>hn.fromJSON(t)):[]}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>hn.toJSON(n))),t},create(e){return ei.fromPartial(e??{})},fromPartial(e){let t=PR();return t.filters=e.filters?.map(n=>hn.fromPartial(n))||[],t}};function wR(){return{filters:void 0,preVOut:void 0,preTransaction:void 0}}var vl={encode(e,t=_.default.Writer.create()){return e.filters!==void 0&&ei.encode(e.filters,t.uint32(10).fork()).ldelim(),e.preVOut!==void 0&&hn.encode(e.preVOut,t.uint32(18).fork()).ldelim(),e.preTransaction!==void 0&&jr.encode(e.preTransaction,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=wR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters=ei.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.preVOut=hn.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.preTransaction=jr.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:A(e.filters)?ei.fromJSON(e.filters):void 0,preVOut:A(e.preVOut)?hn.fromJSON(e.preVOut):void 0,preTransaction:A(e.preTransaction)?jr.fromJSON(e.preTransaction):void 0}},toJSON(e){let t={};return e.filters!==void 0&&(t.filters=ei.toJSON(e.filters)),e.preVOut!==void 0&&(t.preVOut=hn.toJSON(e.preVOut)),e.preTransaction!==void 0&&(t.preTransaction=jr.toJSON(e.preTransaction)),t},create(e){return vl.fromPartial(e??{})},fromPartial(e){let t=wR();return t.filters=e.filters!==void 0&&e.filters!==null?ei.fromPartial(e.filters):void 0,t.preVOut=e.preVOut!==void 0&&e.preVOut!==null?hn.fromPartial(e.preVOut):void 0,t.preTransaction=e.preTransaction!==void 0&&e.preTransaction!==null?jr.fromPartial(e.preTransaction):void 0,t}};function xR(){return{filters:void 0}}var Sl={encode(e,t=_.default.Writer.create()){return e.filters!==void 0&&ei.encode(e.filters,t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=xR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters=ei.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:A(e.filters)?ei.fromJSON(e.filters):void 0}},toJSON(e){let t={};return e.filters!==void 0&&(t.filters=ei.toJSON(e.filters)),t},create(e){return Sl.fromPartial(e??{})},fromPartial(e){let t=xR();return t.filters=e.filters!==void 0&&e.filters!==null?ei.fromPartial(e.filters):void 0,t}};function BR(){return{address:"",keys:[]}}var bl={encode(e,t=_.default.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(let n of e.keys)t.uint32(18).string(n);return t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=BR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=n.string();continue;case 2:if(a!==18)break;i.keys.push(n.string());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{address:A(e.address)?globalThis.String(e.address):"",keys:globalThis.Array.isArray(e?.keys)?e.keys.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.address!==""&&(t.address=e.address),e.keys?.length&&(t.keys=e.keys),t},create(e){return bl.fromPartial(e??{})},fromPartial(e){let t=BR();return t.address=e.address??"",t.keys=e.keys?.map(n=>n)||[],t}};function DR(){return{handlerId:0,handlerName:""}}var Tl={encode(e,t=_.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.handlerName!==""&&t.uint32(18).string(e.handlerName),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=DR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=n.int32();continue;case 2:if(a!==18)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{handlerId:A(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:A(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Tl.fromPartial(e??{})},fromPartial(e){let t=DR();return t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function MR(){return{hashes:[]}}var El={encode(e,t=_.default.Writer.create()){for(let n of e.hashes)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=MR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.hashes.push(n.string());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{hashes:globalThis.Array.isArray(e?.hashes)?e.hashes.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.hashes?.length&&(t.hashes=e.hashes),t},create(e){return El.fromPartial(e??{})},fromPartial(e){let t=MR();return t.hashes=e.hashes?.map(n=>n)||[],t}};function LR(){return{configUpdated:!1,error:void 0}}var Cl={encode(e,t=_.default.Writer.create()){return e.configUpdated!==!1&&t.uint32(8).bool(e.configUpdated),e.error!==void 0&&t.uint32(18).string(e.error),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=LR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.configUpdated=n.bool();continue;case 2:if(a!==18)break;i.error=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{configUpdated:A(e.configUpdated)?globalThis.Boolean(e.configUpdated):!1,error:A(e.error)?globalThis.String(e.error):void 0}},toJSON(e){let t={};return e.configUpdated!==!1&&(t.configUpdated=e.configUpdated),e.error!==void 0&&(t.error=e.error),t},create(e){return Cl.fromPartial(e??{})},fromPartial(e){let t=LR();return t.configUpdated=e.configUpdated??!1,t.error=e.error??void 0,t}};function FR(){return{gauges:[],counters:[],events:[],exports:[],states:void 0}}var Rs={encode(e,t=_.default.Writer.create()){for(let n of e.gauges)Al.encode(n,t.uint32(10).fork()).ldelim();for(let n of e.counters)Nl.encode(n,t.uint32(18).fork()).ldelim();for(let n of e.events)Il.encode(n,t.uint32(34).fork()).ldelim();for(let n of e.exports)Ol.encode(n,t.uint32(42).fork()).ldelim();return e.states!==void 0&&Cl.encode(e.states,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=FR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.gauges.push(Al.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.counters.push(Nl.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.events.push(Il.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.exports.push(Ol.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.states=Cl.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{gauges:globalThis.Array.isArray(e?.gauges)?e.gauges.map(t=>Al.fromJSON(t)):[],counters:globalThis.Array.isArray(e?.counters)?e.counters.map(t=>Nl.fromJSON(t)):[],events:globalThis.Array.isArray(e?.events)?e.events.map(t=>Il.fromJSON(t)):[],exports:globalThis.Array.isArray(e?.exports)?e.exports.map(t=>Ol.fromJSON(t)):[],states:A(e.states)?Cl.fromJSON(e.states):void 0}},toJSON(e){let t={};return e.gauges?.length&&(t.gauges=e.gauges.map(n=>Al.toJSON(n))),e.counters?.length&&(t.counters=e.counters.map(n=>Nl.toJSON(n))),e.events?.length&&(t.events=e.events.map(n=>Il.toJSON(n))),e.exports?.length&&(t.exports=e.exports.map(n=>Ol.toJSON(n))),e.states!==void 0&&(t.states=Cl.toJSON(e.states)),t},create(e){return Rs.fromPartial(e??{})},fromPartial(e){let t=FR();return t.gauges=e.gauges?.map(n=>Al.fromPartial(n))||[],t.counters=e.counters?.map(n=>Nl.fromPartial(n))||[],t.events=e.events?.map(n=>Il.fromPartial(n))||[],t.exports=e.exports?.map(n=>Ol.fromPartial(n))||[],t.states=e.states!==void 0&&e.states!==null?Cl.fromPartial(e.states):void 0,t}};function UR(){return{context:void 0,calldata:""}}var kl={encode(e,t=_.default.Writer.create()){return e.context!==void 0&&_l.encode(e.context,t.uint32(10).fork()).ldelim(),e.calldata!==""&&t.uint32(18).string(e.calldata),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=UR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.context=_l.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.calldata=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{context:A(e.context)?_l.fromJSON(e.context):void 0,calldata:A(e.calldata)?globalThis.String(e.calldata):""}},toJSON(e){let t={};return e.context!==void 0&&(t.context=_l.toJSON(e.context)),e.calldata!==""&&(t.calldata=e.calldata),t},create(e){return kl.fromPartial(e??{})},fromPartial(e){let t=UR();return t.context=e.context!==void 0&&e.context!==null?_l.fromPartial(e.context):void 0,t.calldata=e.calldata??"",t}};function qR(){return{chainId:"",address:"",blockTag:""}}var _l={encode(e,t=_.default.Writer.create()){return e.chainId!==""&&t.uint32(10).string(e.chainId),e.address!==""&&t.uint32(18).string(e.address),e.blockTag!==""&&t.uint32(26).string(e.blockTag),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=qR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=n.string();continue;case 2:if(a!==18)break;i.address=n.string();continue;case 3:if(a!==26)break;i.blockTag=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{chainId:A(e.chainId)?globalThis.String(e.chainId):"",address:A(e.address)?globalThis.String(e.address):"",blockTag:A(e.blockTag)?globalThis.String(e.blockTag):""}},toJSON(e){let t={};return e.chainId!==""&&(t.chainId=e.chainId),e.address!==""&&(t.address=e.address),e.blockTag!==""&&(t.blockTag=e.blockTag),t},create(e){return _l.fromPartial(e??{})},fromPartial(e){let t=qR();return t.chainId=e.chainId??"",t.address=e.address??"",t.blockTag=e.blockTag??"",t}};function VR(){return{ethCallParams:[]}}var lE={encode(e,t=_.default.Writer.create()){for(let n of e.ethCallParams)kl.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=VR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.ethCallParams.push(kl.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{ethCallParams:globalThis.Array.isArray(e?.ethCallParams)?e.ethCallParams.map(t=>kl.fromJSON(t)):[]}},toJSON(e){let t={};return e.ethCallParams?.length&&(t.ethCallParams=e.ethCallParams.map(n=>kl.toJSON(n))),t},create(e){return lE.fromPartial(e??{})},fromPartial(e){let t=VR();return t.ethCallParams=e.ethCallParams?.map(n=>kl.fromPartial(n))||[],t}};function JR(){return{address:"",contractName:"",blockNumber:BigInt("0"),transactionHash:"",chainId:"",transactionIndex:0,logIndex:0,name:"",labels:{}}}var St={encode(e,t=_.default.Writer.create()){if(e.address!==""&&t.uint32(10).string(e.address),e.contractName!==""&&t.uint32(74).string(e.contractName),e.blockNumber!==BigInt("0")){if(BigInt.asUintN(64,e.blockNumber)!==e.blockNumber)throw new globalThis.Error("value provided for field message.blockNumber of type uint64 too large");t.uint32(16).uint64(e.blockNumber.toString())}return e.transactionHash!==""&&t.uint32(50).string(e.transactionHash),e.chainId!==""&&t.uint32(42).string(e.chainId),e.transactionIndex!==0&&t.uint32(24).int32(e.transactionIndex),e.logIndex!==0&&t.uint32(32).int32(e.logIndex),e.name!==""&&t.uint32(82).string(e.name),Object.entries(e.labels).forEach(([n,r])=>{sE.encode({key:n,value:r},t.uint32(58).fork()).ldelim()}),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=JR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=n.string();continue;case 9:if(a!==74)break;i.contractName=n.string();continue;case 2:if(a!==16)break;i.blockNumber=Rl(n.uint64());continue;case 6:if(a!==50)break;i.transactionHash=n.string();continue;case 5:if(a!==42)break;i.chainId=n.string();continue;case 3:if(a!==24)break;i.transactionIndex=n.int32();continue;case 4:if(a!==32)break;i.logIndex=n.int32();continue;case 10:if(a!==82)break;i.name=n.string();continue;case 7:if(a!==58)break;let o=sE.decode(n,n.uint32());o.value!==void 0&&(i.labels[o.key]=o.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{address:A(e.address)?globalThis.String(e.address):"",contractName:A(e.contractName)?globalThis.String(e.contractName):"",blockNumber:A(e.blockNumber)?BigInt(e.blockNumber):BigInt("0"),transactionHash:A(e.transactionHash)?globalThis.String(e.transactionHash):"",chainId:A(e.chainId)?globalThis.String(e.chainId):"",transactionIndex:A(e.transactionIndex)?globalThis.Number(e.transactionIndex):0,logIndex:A(e.logIndex)?globalThis.Number(e.logIndex):0,name:A(e.name)?globalThis.String(e.name):"",labels:Pm(e.labels)?Object.entries(e.labels).reduce((t,[n,r])=>(t[n]=String(r),t),{}):{}}},toJSON(e){let t={};if(e.address!==""&&(t.address=e.address),e.contractName!==""&&(t.contractName=e.contractName),e.blockNumber!==BigInt("0")&&(t.blockNumber=e.blockNumber.toString()),e.transactionHash!==""&&(t.transactionHash=e.transactionHash),e.chainId!==""&&(t.chainId=e.chainId),e.transactionIndex!==0&&(t.transactionIndex=Math.round(e.transactionIndex)),e.logIndex!==0&&(t.logIndex=Math.round(e.logIndex)),e.name!==""&&(t.name=e.name),e.labels){let n=Object.entries(e.labels);n.length>0&&(t.labels={},n.forEach(([r,i])=>{t.labels[r]=i}))}return t},create(e){return St.fromPartial(e??{})},fromPartial(e){let t=JR();return t.address=e.address??"",t.contractName=e.contractName??"",t.blockNumber=e.blockNumber??BigInt("0"),t.transactionHash=e.transactionHash??"",t.chainId=e.chainId??"",t.transactionIndex=e.transactionIndex??0,t.logIndex=e.logIndex??0,t.name=e.name??"",t.labels=Object.entries(e.labels??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=globalThis.String(i)),n),{}),t}};function WR(){return{key:"",value:""}}var sE={encode(e,t=_.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==""&&t.uint32(18).string(e.value),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=WR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:A(e.key)?globalThis.String(e.key):"",value:A(e.value)?globalThis.String(e.value):""}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==""&&(t.value=e.value),t},create(e){return sE.fromPartial(e??{})},fromPartial(e){let t=WR();return t.key=e.key??"",t.value=e.value??"",t}};function HR(){return{bigDecimal:void 0,doubleValue:void 0,bigInteger:void 0}}var ti={encode(e,t=_.default.Writer.create()){return e.bigDecimal!==void 0&&t.uint32(10).string(e.bigDecimal),e.doubleValue!==void 0&&t.uint32(17).double(e.doubleValue),e.bigInteger!==void 0&&Vt.encode(e.bigInteger,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=HR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bigDecimal=n.string();continue;case 2:if(a!==17)break;i.doubleValue=n.double();continue;case 3:if(a!==26)break;i.bigInteger=Vt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{bigDecimal:A(e.bigDecimal)?globalThis.String(e.bigDecimal):void 0,doubleValue:A(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,bigInteger:A(e.bigInteger)?Vt.fromJSON(e.bigInteger):void 0}},toJSON(e){let t={};return e.bigDecimal!==void 0&&(t.bigDecimal=e.bigDecimal),e.doubleValue!==void 0&&(t.doubleValue=e.doubleValue),e.bigInteger!==void 0&&(t.bigInteger=Vt.toJSON(e.bigInteger)),t},create(e){return ti.fromPartial(e??{})},fromPartial(e){let t=HR();return t.bigDecimal=e.bigDecimal??void 0,t.doubleValue=e.doubleValue??void 0,t.bigInteger=e.bigInteger!==void 0&&e.bigInteger!==null?Vt.fromPartial(e.bigInteger):void 0,t}};function GR(){return{from:0}}var bt={encode(e,t=_.default.Writer.create()){return e.from!==0&&t.uint32(8).int32(e.from),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=GR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.from=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{from:A(e.from)?d5(e.from):0}},toJSON(e){let t={};return e.from!==0&&(t.from=f5(e.from)),t},create(e){return bt.fromPartial(e??{})},fromPartial(e){let t=GR();return t.from=e.from??0,t}};function zR(){return{metadata:void 0,metricValue:void 0,runtimeInfo:void 0}}var Al={encode(e,t=_.default.Writer.create()){return e.metadata!==void 0&&St.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&ti.encode(e.metricValue,t.uint32(18).fork()).ldelim(),e.runtimeInfo!==void 0&&bt.encode(e.runtimeInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=zR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=St.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.metricValue=ti.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.runtimeInfo=bt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:A(e.metadata)?St.fromJSON(e.metadata):void 0,metricValue:A(e.metricValue)?ti.fromJSON(e.metricValue):void 0,runtimeInfo:A(e.runtimeInfo)?bt.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=St.toJSON(e.metadata)),e.metricValue!==void 0&&(t.metricValue=ti.toJSON(e.metricValue)),e.runtimeInfo!==void 0&&(t.runtimeInfo=bt.toJSON(e.runtimeInfo)),t},create(e){return Al.fromPartial(e??{})},fromPartial(e){let t=zR();return t.metadata=e.metadata!==void 0&&e.metadata!==null?St.fromPartial(e.metadata):void 0,t.metricValue=e.metricValue!==void 0&&e.metricValue!==null?ti.fromPartial(e.metricValue):void 0,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?bt.fromPartial(e.runtimeInfo):void 0,t}};function QR(){return{metadata:void 0,metricValue:void 0,add:!1,runtimeInfo:void 0}}var Nl={encode(e,t=_.default.Writer.create()){return e.metadata!==void 0&&St.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&ti.encode(e.metricValue,t.uint32(18).fork()).ldelim(),e.add!==!1&&t.uint32(24).bool(e.add),e.runtimeInfo!==void 0&&bt.encode(e.runtimeInfo,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=QR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=St.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.metricValue=ti.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.add=n.bool();continue;case 4:if(a!==34)break;i.runtimeInfo=bt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:A(e.metadata)?St.fromJSON(e.metadata):void 0,metricValue:A(e.metricValue)?ti.fromJSON(e.metricValue):void 0,add:A(e.add)?globalThis.Boolean(e.add):!1,runtimeInfo:A(e.runtimeInfo)?bt.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=St.toJSON(e.metadata)),e.metricValue!==void 0&&(t.metricValue=ti.toJSON(e.metricValue)),e.add!==!1&&(t.add=e.add),e.runtimeInfo!==void 0&&(t.runtimeInfo=bt.toJSON(e.runtimeInfo)),t},create(e){return Nl.fromPartial(e??{})},fromPartial(e){let t=QR();return t.metadata=e.metadata!==void 0&&e.metadata!==null?St.fromPartial(e.metadata):void 0,t.metricValue=e.metricValue!==void 0&&e.metricValue!==null?ti.fromPartial(e.metricValue):void 0,t.add=e.add??!1,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?bt.fromPartial(e.runtimeInfo):void 0,t}};function KR(){return{metadata:void 0,distinctEntityId:"",attributes:void 0,severity:0,message:"",runtimeInfo:void 0,attributes2:void 0,noMetric:!1}}var Il={encode(e,t=_.default.Writer.create()){return e.metadata!==void 0&&St.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.distinctEntityId!==""&&t.uint32(18).string(e.distinctEntityId),e.attributes!==void 0&&In.encode(In.wrap(e.attributes),t.uint32(50).fork()).ldelim(),e.severity!==0&&t.uint32(56).int32(e.severity),e.message!==""&&t.uint32(66).string(e.message),e.runtimeInfo!==void 0&&bt.encode(e.runtimeInfo,t.uint32(42).fork()).ldelim(),e.attributes2!==void 0&&er.encode(e.attributes2,t.uint32(74).fork()).ldelim(),e.noMetric!==!1&&t.uint32(24).bool(e.noMetric),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=KR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=St.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.distinctEntityId=n.string();continue;case 6:if(a!==50)break;i.attributes=In.unwrap(In.decode(n,n.uint32()));continue;case 7:if(a!==56)break;i.severity=n.int32();continue;case 8:if(a!==66)break;i.message=n.string();continue;case 5:if(a!==42)break;i.runtimeInfo=bt.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.attributes2=er.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.noMetric=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:A(e.metadata)?St.fromJSON(e.metadata):void 0,distinctEntityId:A(e.distinctEntityId)?globalThis.String(e.distinctEntityId):"",attributes:Pm(e.attributes)?e.attributes:void 0,severity:A(e.severity)?h5(e.severity):0,message:A(e.message)?globalThis.String(e.message):"",runtimeInfo:A(e.runtimeInfo)?bt.fromJSON(e.runtimeInfo):void 0,attributes2:A(e.attributes2)?er.fromJSON(e.attributes2):void 0,noMetric:A(e.noMetric)?globalThis.Boolean(e.noMetric):!1}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=St.toJSON(e.metadata)),e.distinctEntityId!==""&&(t.distinctEntityId=e.distinctEntityId),e.attributes!==void 0&&(t.attributes=e.attributes),e.severity!==0&&(t.severity=p5(e.severity)),e.message!==""&&(t.message=e.message),e.runtimeInfo!==void 0&&(t.runtimeInfo=bt.toJSON(e.runtimeInfo)),e.attributes2!==void 0&&(t.attributes2=er.toJSON(e.attributes2)),e.noMetric!==!1&&(t.noMetric=e.noMetric),t},create(e){return Il.fromPartial(e??{})},fromPartial(e){let t=KR();return t.metadata=e.metadata!==void 0&&e.metadata!==null?St.fromPartial(e.metadata):void 0,t.distinctEntityId=e.distinctEntityId??"",t.attributes=e.attributes??void 0,t.severity=e.severity??0,t.message=e.message??"",t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?bt.fromPartial(e.runtimeInfo):void 0,t.attributes2=e.attributes2!==void 0&&e.attributes2!==null?er.fromPartial(e.attributes2):void 0,t.noMetric=e.noMetric??!1,t}};function ZR(){return{metadata:void 0,payload:"",runtimeInfo:void 0}}var Ol={encode(e,t=_.default.Writer.create()){return e.metadata!==void 0&&St.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.payload!==""&&t.uint32(18).string(e.payload),e.runtimeInfo!==void 0&&bt.encode(e.runtimeInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof _.default.Reader?e:_.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ZR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=St.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.payload=n.string();continue;case 3:if(a!==26)break;i.runtimeInfo=bt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:A(e.metadata)?St.fromJSON(e.metadata):void 0,payload:A(e.payload)?globalThis.String(e.payload):"",runtimeInfo:A(e.runtimeInfo)?bt.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=St.toJSON(e.metadata)),e.payload!==""&&(t.payload=e.payload),e.runtimeInfo!==void 0&&(t.runtimeInfo=bt.toJSON(e.runtimeInfo)),t},create(e){return Ol.fromPartial(e??{})},fromPartial(e){let t=ZR();return t.metadata=e.metadata!==void 0&&e.metadata!==null?St.fromPartial(e.metadata):void 0,t.payload=e.payload??"",t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?bt.fromPartial(e.runtimeInfo):void 0,t}};function Rl(e){return BigInt(e.toString())}_.default.util.Long!==Ut&&(_.default.util.Long=Ut,_.default.configure());function Pm(e){return typeof e=="object"&&e!==null}function A(e){return e!=null}import{AsyncLocalStorage as y5}from"node:async_hooks";var YR=class{name;supportedHandlers=[];async configure(t){}async start(t){}stateDiff(t){return!1}async processBinding(t,n){return Rs.create()}async preprocessBinding(t,n){return lE.create()}async startServer(t){}shutdownServer(){}},Sa=class e{static INSTANCE=new e;dbContextLocalStorage=new y5;plugins=[];typesToPlugin=new Map;register(t){if(!this.plugins.find(n=>n.name===t.name)){this.plugins.push(t);for(let n of t.supportedHandlers){let r=this.typesToPlugin.get(n);if(r)throw new Error(`Duplicate plugin for ${n}: ${r.name} and ${t.name}`);this.typesToPlugin.set(n,t)}}}configure(t){return Promise.all(this.plugins.map(n=>n.configure(t)))}start(t,n){return Promise.all(this.plugins.map(r=>r.start(t)))}startServer(t){return Promise.all(this.plugins.map(n=>n.startServer(t)))}shutdown(){this.plugins.forEach(t=>t.shutdownServer())}stateDiff(t){return this.plugins.some(n=>n.stateDiff(t))}processBinding(t,n,r){let i=this.typesToPlugin.get(t.handlerType);if(!i)throw new Error(`No plugin for ${t.handlerType}`);return this.dbContextLocalStorage.run(r,()=>i.processBinding(t,n))}preprocessBinding(t,n,r){let i=this.typesToPlugin.get(t.handlerType);if(!i)throw new Error(`No plugin for ${t.handlerType}`);return this.dbContextLocalStorage.run(r,()=>i.preprocessBinding(t,n))}};import("node:process").then(e=>e.stdout.write(""));var S=An(Nn(),1);var wm=An(Nn(),1);function XR(){return{}}var bh={encode(e,t=wm.default.Writer.create()){return t},decode(e,t){let n=e instanceof wm.default.Reader?e:wm.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=XR();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return bh.fromPartial(e??{})},fromPartial(e){return XR()}};import("node:process").then(e=>e.stdout.write(""));var tr=An(Nn(),1);function v5(e){switch(e){case 0:case"NULL_VALUE":return 0;case-1:case"UNRECOGNIZED":default:return-1}}function S5(e){switch(e){case 0:return"NULL_VALUE";case-1:default:return"UNRECOGNIZED"}}function cE(){return{fields:{}}}var P={encode(e,t=tr.default.Writer.create()){return Object.entries(e.fields).forEach(([n,r])=>{r!==void 0&&hE.encode({key:n,value:r},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let n=e instanceof tr.default.Reader?e:tr.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=cE();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;let o=hE.decode(n,n.uint32());o.value!==void 0&&(i.fields[o.key]=o.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{fields:jR(e.fields)?Object.entries(e.fields).reduce((t,[n,r])=>(t[n]=r,t),{}):{}}},toJSON(e){let t={};if(e.fields){let n=Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([r,i])=>{t.fields[r]=i}))}return t},create(e){return P.fromPartial(e??{})},fromPartial(e){let t=cE();return t.fields=Object.entries(e.fields??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=i),n),{}),t},wrap(e){let t=cE();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function $R(){return{key:"",value:void 0}}var hE={encode(e,t=tr.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&ba.encode(ba.wrap(e.value),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof tr.default.Reader?e:tr.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=$R();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=ba.unwrap(ba.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:Pl(e.key)?globalThis.String(e.key):"",value:Pl(e?.value)?e.value:void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},create(e){return hE.fromPartial(e??{})},fromPartial(e){let t=$R();return t.key=e.key??"",t.value=e.value??void 0,t}};function dE(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var ba={encode(e,t=tr.default.Writer.create()){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&P.encode(P.wrap(e.structValue),t.uint32(42).fork()).ldelim(),e.listValue!==void 0&&Fi.encode(Fi.wrap(e.listValue),t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof tr.default.Reader?e:tr.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=dE();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.nullValue=n.int32();continue;case 2:if(a!==17)break;i.numberValue=n.double();continue;case 3:if(a!==26)break;i.stringValue=n.string();continue;case 4:if(a!==32)break;i.boolValue=n.bool();continue;case 5:if(a!==42)break;i.structValue=P.unwrap(P.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.listValue=Fi.unwrap(Fi.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{nullValue:Pl(e.nullValue)?v5(e.nullValue):void 0,numberValue:Pl(e.numberValue)?globalThis.Number(e.numberValue):void 0,stringValue:Pl(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:Pl(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,structValue:jR(e.structValue)?e.structValue:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=S5(e.nullValue)),e.numberValue!==void 0&&(t.numberValue=e.numberValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.structValue!==void 0&&(t.structValue=e.structValue),e.listValue!==void 0&&(t.listValue=e.listValue),t},create(e){return ba.fromPartial(e??{})},fromPartial(e){let t=dE();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=dE();if(e===null)t.nullValue=0;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new globalThis.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function fE(){return{values:[]}}var Fi={encode(e,t=tr.default.Writer.create()){for(let n of e.values)ba.encode(ba.wrap(n),t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof tr.default.Reader?e:tr.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=fE();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.values.push(ba.unwrap(ba.decode(n,n.uint32())));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values),t},create(e){return Fi.fromPartial(e??{})},fromPartial(e){let t=fE();return t.values=e.values?.map(n=>n)||[],t},wrap(e){let t=fE();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e}};function jR(e){return typeof e=="object"&&e!==null}function Pl(e){return e!=null}import("node:process").then(e=>e.stdout.write(""));var Ps=An(Nn(),1);function e3(){return{seconds:BigInt("0"),nanos:0}}var Se={encode(e,t=Ps.default.Writer.create()){if(e.seconds!==BigInt("0")){if(BigInt.asIntN(64,e.seconds)!==e.seconds)throw new globalThis.Error("value provided for field message.seconds of type int64 too large");t.uint32(8).int64(e.seconds.toString())}return e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let n=e instanceof Ps.default.Reader?e:Ps.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=e3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.seconds=b5(n.int64());continue;case 2:if(a!==16)break;i.nanos=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{seconds:t3(e.seconds)?BigInt(e.seconds):BigInt("0"),nanos:t3(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==BigInt("0")&&(t.seconds=e.seconds.toString()),e.nanos!==0&&(t.nanos=Math.round(e.nanos)),t},create(e){return Se.fromPartial(e??{})},fromPartial(e){let t=e3();return t.seconds=e.seconds??BigInt("0"),t.nanos=e.nanos??0,t}};function b5(e){return BigInt(e.toString())}Ps.default.util.Long!==Ut&&(Ps.default.util.Long=Ut,Ps.default.configure());function t3(e){return e!=null}import("node:process").then(e=>e.stdout.write(""));var Ne=An(Nn(),1);function T5(e){switch(e){case 0:case"NULL_VALUE":return 0;case-1:case"UNRECOGNIZED":default:return-1}}function E5(e){switch(e){case 0:return"NULL_VALUE";case-1:default:return"UNRECOGNIZED"}}function n3(){return{symbol:void 0,address:void 0}}var Cr={encode(e,t=Ne.default.Writer.create()){return e.symbol!==void 0&&t.uint32(10).string(e.symbol),e.address!==void 0&&wl.encode(e.address,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof Ne.default.Reader?e:Ne.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=n3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.symbol=n.string();continue;case 2:if(a!==18)break;i.address=wl.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{symbol:nt(e.symbol)?globalThis.String(e.symbol):void 0,address:nt(e.address)?wl.fromJSON(e.address):void 0}},toJSON(e){let t={};return e.symbol!==void 0&&(t.symbol=e.symbol),e.address!==void 0&&(t.address=wl.toJSON(e.address)),t},create(e){return Cr.fromPartial(e??{})},fromPartial(e){let t=n3();return t.symbol=e.symbol??void 0,t.address=e.address!==void 0&&e.address!==null?wl.fromPartial(e.address):void 0,t}};function r3(){return{address:"",chain:""}}var wl={encode(e,t=Ne.default.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.chain!==""&&t.uint32(18).string(e.chain),t},decode(e,t){let n=e instanceof Ne.default.Reader?e:Ne.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=r3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=n.string();continue;case 2:if(a!==18)break;i.chain=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{address:nt(e.address)?globalThis.String(e.address):"",chain:nt(e.chain)?globalThis.String(e.chain):""}},toJSON(e){let t={};return e.address!==""&&(t.address=e.address),e.chain!==""&&(t.chain=e.chain),t},create(e){return wl.fromPartial(e??{})},fromPartial(e){let t=r3();return t.address=e.address??"",t.chain=e.chain??"",t}};function i3(){return{nullValue:void 0,intValue:void 0,int64Value:void 0,floatValue:void 0,bytesValue:void 0,boolValue:void 0,stringValue:void 0,timestampValue:void 0,bigintValue:void 0,bigdecimalValue:void 0,listValue:void 0,structValue:void 0,tokenValue:void 0}}var ge={encode(e,t=Ne.default.Writer.create()){if(e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.intValue!==void 0&&t.uint32(16).int32(e.intValue),e.int64Value!==void 0){if(BigInt.asIntN(64,e.int64Value)!==e.int64Value)throw new globalThis.Error("value provided for field message.int64Value of type int64 too large");t.uint32(104).int64(e.int64Value.toString())}return e.floatValue!==void 0&&t.uint32(25).double(e.floatValue),e.bytesValue!==void 0&&t.uint32(34).bytes(e.bytesValue),e.boolValue!==void 0&&t.uint32(40).bool(e.boolValue),e.stringValue!==void 0&&t.uint32(50).string(e.stringValue),e.timestampValue!==void 0&&Se.encode(p3(e.timestampValue),t.uint32(58).fork()).ldelim(),e.bigintValue!==void 0&&Kt.encode(e.bigintValue,t.uint32(66).fork()).ldelim(),e.bigdecimalValue!==void 0&&ni.encode(e.bigdecimalValue,t.uint32(74).fork()).ldelim(),e.listValue!==void 0&&Ze.encode(e.listValue,t.uint32(82).fork()).ldelim(),e.structValue!==void 0&&Ke.encode(e.structValue,t.uint32(90).fork()).ldelim(),e.tokenValue!==void 0&&xl.encode(e.tokenValue,t.uint32(98).fork()).ldelim(),t},decode(e,t){let n=e instanceof Ne.default.Reader?e:Ne.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=i3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.nullValue=n.int32();continue;case 2:if(a!==16)break;i.intValue=n.int32();continue;case 13:if(a!==104)break;i.int64Value=C5(n.int64());continue;case 3:if(a!==25)break;i.floatValue=n.double();continue;case 4:if(a!==34)break;i.bytesValue=n.bytes();continue;case 5:if(a!==40)break;i.boolValue=n.bool();continue;case 6:if(a!==50)break;i.stringValue=n.string();continue;case 7:if(a!==58)break;i.timestampValue=mE(Se.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.bigintValue=Kt.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.bigdecimalValue=ni.decode(n,n.uint32());continue;case 10:if(a!==82)break;i.listValue=Ze.decode(n,n.uint32());continue;case 11:if(a!==90)break;i.structValue=Ke.decode(n,n.uint32());continue;case 12:if(a!==98)break;i.tokenValue=xl.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{nullValue:nt(e.nullValue)?T5(e.nullValue):void 0,intValue:nt(e.intValue)?globalThis.Number(e.intValue):void 0,int64Value:nt(e.int64Value)?BigInt(e.int64Value):void 0,floatValue:nt(e.floatValue)?globalThis.Number(e.floatValue):void 0,bytesValue:nt(e.bytesValue)?f3(e.bytesValue):void 0,boolValue:nt(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,stringValue:nt(e.stringValue)?globalThis.String(e.stringValue):void 0,timestampValue:nt(e.timestampValue)?m3(e.timestampValue):void 0,bigintValue:nt(e.bigintValue)?Kt.fromJSON(e.bigintValue):void 0,bigdecimalValue:nt(e.bigdecimalValue)?ni.fromJSON(e.bigdecimalValue):void 0,listValue:nt(e.listValue)?Ze.fromJSON(e.listValue):void 0,structValue:nt(e.structValue)?Ke.fromJSON(e.structValue):void 0,tokenValue:nt(e.tokenValue)?xl.fromJSON(e.tokenValue):void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=E5(e.nullValue)),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.int64Value!==void 0&&(t.int64Value=e.int64Value.toString()),e.floatValue!==void 0&&(t.floatValue=e.floatValue),e.bytesValue!==void 0&&(t.bytesValue=h3(e.bytesValue)),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.timestampValue!==void 0&&(t.timestampValue=e.timestampValue.toISOString()),e.bigintValue!==void 0&&(t.bigintValue=Kt.toJSON(e.bigintValue)),e.bigdecimalValue!==void 0&&(t.bigdecimalValue=ni.toJSON(e.bigdecimalValue)),e.listValue!==void 0&&(t.listValue=Ze.toJSON(e.listValue)),e.structValue!==void 0&&(t.structValue=Ke.toJSON(e.structValue)),e.tokenValue!==void 0&&(t.tokenValue=xl.toJSON(e.tokenValue)),t},create(e){return ge.fromPartial(e??{})},fromPartial(e){let t=i3();return t.nullValue=e.nullValue??void 0,t.intValue=e.intValue??void 0,t.int64Value=e.int64Value??void 0,t.floatValue=e.floatValue??void 0,t.bytesValue=e.bytesValue??void 0,t.boolValue=e.boolValue??void 0,t.stringValue=e.stringValue??void 0,t.timestampValue=e.timestampValue??void 0,t.bigintValue=e.bigintValue!==void 0&&e.bigintValue!==null?Kt.fromPartial(e.bigintValue):void 0,t.bigdecimalValue=e.bigdecimalValue!==void 0&&e.bigdecimalValue!==null?ni.fromPartial(e.bigdecimalValue):void 0,t.listValue=e.listValue!==void 0&&e.listValue!==null?Ze.fromPartial(e.listValue):void 0,t.structValue=e.structValue!==void 0&&e.structValue!==null?Ke.fromPartial(e.structValue):void 0,t.tokenValue=e.tokenValue!==void 0&&e.tokenValue!==null?xl.fromPartial(e.tokenValue):void 0,t}};function a3(){return{fields:{}}}var Ke={encode(e,t=Ne.default.Writer.create()){return Object.entries(e.fields).forEach(([n,r])=>{pE.encode({key:n,value:r},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let n=e instanceof Ne.default.Reader?e:Ne.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=a3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;let o=pE.decode(n,n.uint32());o.value!==void 0&&(i.fields[o.key]=o.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{fields:k5(e.fields)?Object.entries(e.fields).reduce((t,[n,r])=>(t[n]=ge.fromJSON(r),t),{}):{}}},toJSON(e){let t={};if(e.fields){let n=Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([r,i])=>{t.fields[r]=ge.toJSON(i)}))}return t},create(e){return Ke.fromPartial(e??{})},fromPartial(e){let t=a3();return t.fields=Object.entries(e.fields??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=ge.fromPartial(i)),n),{}),t}};function o3(){return{key:"",value:void 0}}var pE={encode(e,t=Ne.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&ge.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof Ne.default.Reader?e:Ne.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=o3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=ge.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:nt(e.key)?globalThis.String(e.key):"",value:nt(e.value)?ge.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=ge.toJSON(e.value)),t},create(e){return pE.fromPartial(e??{})},fromPartial(e){let t=o3();return t.key=e.key??"",t.value=e.value!==void 0&&e.value!==null?ge.fromPartial(e.value):void 0,t}};function s3(){return{values:[]}}var Ze={encode(e,t=Ne.default.Writer.create()){for(let n of e.values)ge.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof Ne.default.Reader?e:Ne.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=s3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.values.push(ge.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?e.values.map(t=>ge.fromJSON(t)):[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values.map(n=>ge.toJSON(n))),t},create(e){return Ze.fromPartial(e??{})},fromPartial(e){let t=s3();return t.values=e.values?.map(n=>ge.fromPartial(n))||[],t}};function u3(){return{entities:[]}}var ws={encode(e,t=Ne.default.Writer.create()){for(let n of e.entities)Ke.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof Ne.default.Reader?e:Ne.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=u3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entities.push(Ke.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entities:globalThis.Array.isArray(e?.entities)?e.entities.map(t=>Ke.fromJSON(t)):[]}},toJSON(e){let t={};return e.entities?.length&&(t.entities=e.entities.map(n=>Ke.toJSON(n))),t},create(e){return ws.fromPartial(e??{})},fromPartial(e){let t=u3();return t.entities=e.entities?.map(n=>Ke.fromPartial(n))||[],t}};function l3(){return{value:void 0,exp:0}}var ni={encode(e,t=Ne.default.Writer.create()){return e.value!==void 0&&Kt.encode(e.value,t.uint32(10).fork()).ldelim(),e.exp!==0&&t.uint32(16).int32(e.exp),t},decode(e,t){let n=e instanceof Ne.default.Reader?e:Ne.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=l3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.value=Kt.decode(n,n.uint32());continue;case 2:if(a!==16)break;i.exp=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{value:nt(e.value)?Kt.fromJSON(e.value):void 0,exp:nt(e.exp)?globalThis.Number(e.exp):0}},toJSON(e){let t={};return e.value!==void 0&&(t.value=Kt.toJSON(e.value)),e.exp!==0&&(t.exp=Math.round(e.exp)),t},create(e){return ni.fromPartial(e??{})},fromPartial(e){let t=l3();return t.value=e.value!==void 0&&e.value!==null?Kt.fromPartial(e.value):void 0,t.exp=e.exp??0,t}};function c3(){return{negative:!1,data:new Uint8Array(0)}}var Kt={encode(e,t=Ne.default.Writer.create()){return e.negative!==!1&&t.uint32(8).bool(e.negative),e.data.length!==0&&t.uint32(18).bytes(e.data),t},decode(e,t){let n=e instanceof Ne.default.Reader?e:Ne.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=c3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.negative=n.bool();continue;case 2:if(a!==18)break;i.data=n.bytes();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{negative:nt(e.negative)?globalThis.Boolean(e.negative):!1,data:nt(e.data)?f3(e.data):new Uint8Array(0)}},toJSON(e){let t={};return e.negative!==!1&&(t.negative=e.negative),e.data.length!==0&&(t.data=h3(e.data)),t},create(e){return Kt.fromPartial(e??{})},fromPartial(e){let t=c3();return t.negative=e.negative??!1,t.data=e.data??new Uint8Array(0),t}};function d3(){return{token:void 0,amount:void 0,specifiedAt:void 0}}var xl={encode(e,t=Ne.default.Writer.create()){return e.token!==void 0&&Cr.encode(e.token,t.uint32(10).fork()).ldelim(),e.amount!==void 0&&ni.encode(e.amount,t.uint32(18).fork()).ldelim(),e.specifiedAt!==void 0&&Se.encode(p3(e.specifiedAt),t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof Ne.default.Reader?e:Ne.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=d3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.token=Cr.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.amount=ni.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.specifiedAt=mE(Se.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{token:nt(e.token)?Cr.fromJSON(e.token):void 0,amount:nt(e.amount)?ni.fromJSON(e.amount):void 0,specifiedAt:nt(e.specifiedAt)?m3(e.specifiedAt):void 0}},toJSON(e){let t={};return e.token!==void 0&&(t.token=Cr.toJSON(e.token)),e.amount!==void 0&&(t.amount=ni.toJSON(e.amount)),e.specifiedAt!==void 0&&(t.specifiedAt=e.specifiedAt.toISOString()),t},create(e){return xl.fromPartial(e??{})},fromPartial(e){let t=d3();return t.token=e.token!==void 0&&e.token!==null?Cr.fromPartial(e.token):void 0,t.amount=e.amount!==void 0&&e.amount!==null?ni.fromPartial(e.amount):void 0,t.specifiedAt=e.specifiedAt??void 0,t}};function f3(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{let t=globalThis.atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}}function h3(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{let t=[];return e.forEach(n=>{t.push(globalThis.String.fromCharCode(n))}),globalThis.btoa(t.join(""))}}function p3(e){let t=BigInt(Math.trunc(e.getTime()/1e3)),n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function mE(e){let t=(globalThis.Number(e.seconds.toString())||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function m3(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):mE(Se.fromJSON(e))}function C5(e){return BigInt(e.toString())}Ne.default.util.Long!==Ut&&(Ne.default.util.Long=Ut,Ne.default.configure());function k5(e){return typeof e=="object"&&e!==null}function nt(e){return e!=null}import("node:process").then(e=>e.stdout.write(""));function _5(e){switch(e){case 0:case"UNKNOWN_TYPE":return 0;case 1:case"COUNTER":return 1;case 2:case"GAUGE":return 2;case 3:case"HISTOGRAM":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function A5(e){switch(e){case 0:return"UNKNOWN_TYPE";case 1:return"COUNTER";case 2:return"GAUGE";case 3:return"HISTOGRAM";case-1:default:return"UNRECOGNIZED"}}function N5(e){switch(e){case 0:case"COUNT":return 0;case 1:case"SUM":return 1;case 2:case"AVG":return 2;case 3:case"MIN":return 3;case 4:case"MAX":return 4;case 5:case"LAST":return 5;case-1:case"UNRECOGNIZED":default:return-1}}function I5(e){switch(e){case 0:return"COUNT";case 1:return"SUM";case 2:return"AVG";case 3:return"MIN";case 4:return"MAX";case 5:return"LAST";case-1:default:return"UNRECOGNIZED"}}function O5(e){switch(e){case 0:case"ADDRESS":return 0;case 1:case"OBJECT":return 1;case 2:case"WRAPPED_OBJECT":return 2;case 3:case"TYPE":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function R5(e){switch(e){case 0:return"ADDRESS";case 1:return"OBJECT";case 2:return"WRAPPED_OBJECT";case 3:return"TYPE";case-1:default:return"UNRECOGNIZED"}}function P5(e){switch(e){case 0:case"ERC20":return 0;case 1:case"ERC721":return 1;case 2:case"ERC1155":return 2;case-1:case"UNRECOGNIZED":default:return-1}}function w5(e){switch(e){case 0:return"ERC20";case 1:return"ERC721";case 2:return"ERC1155";case-1:default:return"UNRECOGNIZED"}}function yw(e){switch(e){case 0:case"UNKNOWN":return 0;case 1:case"ETH_LOG":return 1;case 2:case"ETH_BLOCK":return 2;case 5:case"ETH_TRACE":return 5;case 11:case"ETH_TRANSACTION":return 11;case 4:case"SOL_INSTRUCTION":return 4;case 6:case"APT_EVENT":return 6;case 7:case"APT_CALL":return 7;case 8:case"APT_RESOURCE":return 8;case 3:case"SUI_EVENT":return 3;case 9:case"SUI_CALL":return 9;case 10:case"SUI_OBJECT":return 10;case 12:case"SUI_OBJECT_CHANGE":return 12;case 13:case"FUEL_CALL":return 13;case 19:case"FUEL_RECEIPT":return 19;case 20:case"FUEL_TRANSACTION":return 20;case 17:case"FUEL_BLOCK":return 17;case 14:case"COSMOS_CALL":return 14;case 15:case"STARKNET_EVENT":return 15;case 16:case"BTC_TRANSACTION":return 16;case 18:case"BTC_BLOCK":return 18;case-1:case"UNRECOGNIZED":default:return-1}}function vw(e){switch(e){case 0:return"UNKNOWN";case 1:return"ETH_LOG";case 2:return"ETH_BLOCK";case 5:return"ETH_TRACE";case 11:return"ETH_TRANSACTION";case 4:return"SOL_INSTRUCTION";case 6:return"APT_EVENT";case 7:return"APT_CALL";case 8:return"APT_RESOURCE";case 3:return"SUI_EVENT";case 9:return"SUI_CALL";case 10:return"SUI_OBJECT";case 12:return"SUI_OBJECT_CHANGE";case 13:return"FUEL_CALL";case 19:return"FUEL_RECEIPT";case 20:return"FUEL_TRANSACTION";case 17:return"FUEL_BLOCK";case 14:return"COSMOS_CALL";case 15:return"STARKNET_EVENT";case 16:return"BTC_TRANSACTION";case 18:return"BTC_BLOCK";case-1:default:return"UNRECOGNIZED"}}function Sw(e){switch(e){case 0:case"DEBUG":return 0;case 1:case"INFO":return 1;case 2:case"WARNING":return 2;case 3:case"ERROR":return 3;case 4:case"CRITICAL":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function bw(e){switch(e){case 0:return"DEBUG";case 1:return"INFO";case 2:return"WARNING";case 3:return"ERROR";case 4:return"CRITICAL";case-1:default:return"UNRECOGNIZED"}}function x5(e){switch(e){case 0:case"STRING":return 0;case 1:case"DOUBLE":return 1;case 2:case"BOOL":return 2;case 3:case"TIMESTAMP":return 3;case 4:case"BIG_INTEGER":return 4;case 5:case"BIG_DECIMAL":return 5;case-1:case"UNRECOGNIZED":default:return-1}}function B5(e){switch(e){case 0:return"STRING";case 1:return"DOUBLE";case 2:return"BOOL";case 3:return"TIMESTAMP";case 4:return"BIG_INTEGER";case 5:return"BIG_DECIMAL";case-1:default:return"UNRECOGNIZED"}}function D5(e){switch(e){case 0:case"EQ":return 0;case 1:case"NE":return 1;case 2:case"GT":return 2;case 3:case"GE":return 3;case 4:case"LT":return 4;case 5:case"LE":return 5;case 6:case"IN":return 6;case 7:case"NOT_IN":return 7;case 8:case"LIKE":return 8;case 9:case"NOT_LIKE":return 9;case 10:case"HAS_ALL":return 10;case 11:case"HAS_ANY":return 11;case-1:case"UNRECOGNIZED":default:return-1}}function M5(e){switch(e){case 0:return"EQ";case 1:return"NE";case 2:return"GT";case 3:return"GE";case 4:return"LT";case 5:return"LE";case 6:return"IN";case 7:return"NOT_IN";case 8:return"LIKE";case 9:return"NOT_LIKE";case 10:return"HAS_ALL";case 11:return"HAS_ANY";case-1:default:return"UNRECOGNIZED"}}function g3(){return{name:"",version:""}}var Bl={encode(e,t=S.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.version!==""&&t.uint32(26).string(e.version),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=g3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 3:if(a!==26)break;i.version=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:T(e.name)?globalThis.String(e.name):"",version:T(e.version)?globalThis.String(e.version):""}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.version!==""&&(t.version=e.version),t},create(e){return Bl.fromPartial(e??{})},fromPartial(e){let t=g3();return t.name=e.name??"",t.version=e.version??"",t}};function y3(){return{sequential:!1,forceExactBlockTime:!1,processBindingTimeout:0,skipStartBlockValidation:!1,rpcRetryTimes:0,ethAbiDecoderConfig:void 0}}var Dl={encode(e,t=S.default.Writer.create()){return e.sequential!==!1&&t.uint32(8).bool(e.sequential),e.forceExactBlockTime!==!1&&t.uint32(16).bool(e.forceExactBlockTime),e.processBindingTimeout!==0&&t.uint32(24).int32(e.processBindingTimeout),e.skipStartBlockValidation!==!1&&t.uint32(32).bool(e.skipStartBlockValidation),e.rpcRetryTimes!==0&&t.uint32(40).int32(e.rpcRetryTimes),e.ethAbiDecoderConfig!==void 0&&Ml.encode(e.ethAbiDecoderConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=y3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.sequential=n.bool();continue;case 2:if(a!==16)break;i.forceExactBlockTime=n.bool();continue;case 3:if(a!==24)break;i.processBindingTimeout=n.int32();continue;case 4:if(a!==32)break;i.skipStartBlockValidation=n.bool();continue;case 5:if(a!==40)break;i.rpcRetryTimes=n.int32();continue;case 6:if(a!==50)break;i.ethAbiDecoderConfig=Ml.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{sequential:T(e.sequential)?globalThis.Boolean(e.sequential):!1,forceExactBlockTime:T(e.forceExactBlockTime)?globalThis.Boolean(e.forceExactBlockTime):!1,processBindingTimeout:T(e.processBindingTimeout)?globalThis.Number(e.processBindingTimeout):0,skipStartBlockValidation:T(e.skipStartBlockValidation)?globalThis.Boolean(e.skipStartBlockValidation):!1,rpcRetryTimes:T(e.rpcRetryTimes)?globalThis.Number(e.rpcRetryTimes):0,ethAbiDecoderConfig:T(e.ethAbiDecoderConfig)?Ml.fromJSON(e.ethAbiDecoderConfig):void 0}},toJSON(e){let t={};return e.sequential!==!1&&(t.sequential=e.sequential),e.forceExactBlockTime!==!1&&(t.forceExactBlockTime=e.forceExactBlockTime),e.processBindingTimeout!==0&&(t.processBindingTimeout=Math.round(e.processBindingTimeout)),e.skipStartBlockValidation!==!1&&(t.skipStartBlockValidation=e.skipStartBlockValidation),e.rpcRetryTimes!==0&&(t.rpcRetryTimes=Math.round(e.rpcRetryTimes)),e.ethAbiDecoderConfig!==void 0&&(t.ethAbiDecoderConfig=Ml.toJSON(e.ethAbiDecoderConfig)),t},create(e){return Dl.fromPartial(e??{})},fromPartial(e){let t=y3();return t.sequential=e.sequential??!1,t.forceExactBlockTime=e.forceExactBlockTime??!1,t.processBindingTimeout=e.processBindingTimeout??0,t.skipStartBlockValidation=e.skipStartBlockValidation??!1,t.rpcRetryTimes=e.rpcRetryTimes??0,t.ethAbiDecoderConfig=e.ethAbiDecoderConfig!==void 0&&e.ethAbiDecoderConfig!==null?Ml.fromPartial(e.ethAbiDecoderConfig):void 0,t}};function v3(){return{enabled:!1,workerCount:void 0,skipWhenDecodeFailed:void 0}}var Ml={encode(e,t=S.default.Writer.create()){return e.enabled!==!1&&t.uint32(8).bool(e.enabled),e.workerCount!==void 0&&t.uint32(16).int32(e.workerCount),e.skipWhenDecodeFailed!==void 0&&t.uint32(24).bool(e.skipWhenDecodeFailed),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=v3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.enabled=n.bool();continue;case 2:if(a!==16)break;i.workerCount=n.int32();continue;case 3:if(a!==24)break;i.skipWhenDecodeFailed=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{enabled:T(e.enabled)?globalThis.Boolean(e.enabled):!1,workerCount:T(e.workerCount)?globalThis.Number(e.workerCount):void 0,skipWhenDecodeFailed:T(e.skipWhenDecodeFailed)?globalThis.Boolean(e.skipWhenDecodeFailed):void 0}},toJSON(e){let t={};return e.enabled!==!1&&(t.enabled=e.enabled),e.workerCount!==void 0&&(t.workerCount=Math.round(e.workerCount)),e.skipWhenDecodeFailed!==void 0&&(t.skipWhenDecodeFailed=e.skipWhenDecodeFailed),t},create(e){return Ml.fromPartial(e??{})},fromPartial(e){let t=v3();return t.enabled=e.enabled??!1,t.workerCount=e.workerCount??void 0,t.skipWhenDecodeFailed=e.skipWhenDecodeFailed??void 0,t}};function S3(){return{}}var Tw={encode(e,t=S.default.Writer.create()){return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=S3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return Tw.fromPartial(e??{})},fromPartial(e){return S3()}};function b3(){return{config:void 0,executionConfig:void 0,contractConfigs:[],templateInstances:[],accountConfigs:[],metricConfigs:[],eventTrackingConfigs:[],exportConfigs:[],eventLogConfigs:[],dbSchema:void 0}}var Ew={encode(e,t=S.default.Writer.create()){e.config!==void 0&&Bl.encode(e.config,t.uint32(10).fork()).ldelim(),e.executionConfig!==void 0&&Dl.encode(e.executionConfig,t.uint32(74).fork()).ldelim();for(let n of e.contractConfigs)Ll.encode(n,t.uint32(18).fork()).ldelim();for(let n of e.templateInstances)si.encode(n,t.uint32(26).fork()).ldelim();for(let n of e.accountConfigs)Ql.encode(n,t.uint32(34).fork()).ldelim();for(let n of e.metricConfigs)Wl.encode(n,t.uint32(42).fork()).ldelim();for(let n of e.eventTrackingConfigs)Vl.encode(n,t.uint32(50).fork()).ldelim();for(let n of e.exportConfigs)Jl.encode(n,t.uint32(58).fork()).ldelim();for(let n of e.eventLogConfigs)Hl.encode(n,t.uint32(66).fork()).ldelim();return e.dbSchema!==void 0&&Fl.encode(e.dbSchema,t.uint32(82).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=b3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.config=Bl.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.executionConfig=Dl.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.contractConfigs.push(Ll.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.templateInstances.push(si.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.accountConfigs.push(Ql.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.metricConfigs.push(Wl.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.eventTrackingConfigs.push(Vl.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.exportConfigs.push(Jl.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.eventLogConfigs.push(Hl.decode(n,n.uint32()));continue;case 10:if(a!==82)break;i.dbSchema=Fl.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{config:T(e.config)?Bl.fromJSON(e.config):void 0,executionConfig:T(e.executionConfig)?Dl.fromJSON(e.executionConfig):void 0,contractConfigs:globalThis.Array.isArray(e?.contractConfigs)?e.contractConfigs.map(t=>Ll.fromJSON(t)):[],templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>si.fromJSON(t)):[],accountConfigs:globalThis.Array.isArray(e?.accountConfigs)?e.accountConfigs.map(t=>Ql.fromJSON(t)):[],metricConfigs:globalThis.Array.isArray(e?.metricConfigs)?e.metricConfigs.map(t=>Wl.fromJSON(t)):[],eventTrackingConfigs:globalThis.Array.isArray(e?.eventTrackingConfigs)?e.eventTrackingConfigs.map(t=>Vl.fromJSON(t)):[],exportConfigs:globalThis.Array.isArray(e?.exportConfigs)?e.exportConfigs.map(t=>Jl.fromJSON(t)):[],eventLogConfigs:globalThis.Array.isArray(e?.eventLogConfigs)?e.eventLogConfigs.map(t=>Hl.fromJSON(t)):[],dbSchema:T(e.dbSchema)?Fl.fromJSON(e.dbSchema):void 0}},toJSON(e){let t={};return e.config!==void 0&&(t.config=Bl.toJSON(e.config)),e.executionConfig!==void 0&&(t.executionConfig=Dl.toJSON(e.executionConfig)),e.contractConfigs?.length&&(t.contractConfigs=e.contractConfigs.map(n=>Ll.toJSON(n))),e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(n=>si.toJSON(n))),e.accountConfigs?.length&&(t.accountConfigs=e.accountConfigs.map(n=>Ql.toJSON(n))),e.metricConfigs?.length&&(t.metricConfigs=e.metricConfigs.map(n=>Wl.toJSON(n))),e.eventTrackingConfigs?.length&&(t.eventTrackingConfigs=e.eventTrackingConfigs.map(n=>Vl.toJSON(n))),e.exportConfigs?.length&&(t.exportConfigs=e.exportConfigs.map(n=>Jl.toJSON(n))),e.eventLogConfigs?.length&&(t.eventLogConfigs=e.eventLogConfigs.map(n=>Hl.toJSON(n))),e.dbSchema!==void 0&&(t.dbSchema=Fl.toJSON(e.dbSchema)),t},create(e){return Ew.fromPartial(e??{})},fromPartial(e){let t=b3();return t.config=e.config!==void 0&&e.config!==null?Bl.fromPartial(e.config):void 0,t.executionConfig=e.executionConfig!==void 0&&e.executionConfig!==null?Dl.fromPartial(e.executionConfig):void 0,t.contractConfigs=e.contractConfigs?.map(n=>Ll.fromPartial(n))||[],t.templateInstances=e.templateInstances?.map(n=>si.fromPartial(n))||[],t.accountConfigs=e.accountConfigs?.map(n=>Ql.fromPartial(n))||[],t.metricConfigs=e.metricConfigs?.map(n=>Wl.fromPartial(n))||[],t.eventTrackingConfigs=e.eventTrackingConfigs?.map(n=>Vl.fromPartial(n))||[],t.exportConfigs=e.exportConfigs?.map(n=>Jl.fromPartial(n))||[],t.eventLogConfigs=e.eventLogConfigs?.map(n=>Hl.fromPartial(n))||[],t.dbSchema=e.dbSchema!==void 0&&e.dbSchema!==null?Fl.fromPartial(e.dbSchema):void 0,t}};function T3(){return{contract:void 0,intervalConfigs:[],moveIntervalConfigs:[],logConfigs:[],traceConfigs:[],transactionConfig:[],moveEventConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],fuelCallConfigs:[],fuelTransactionConfigs:[],assetConfigs:[],fuelLogConfigs:[],fuelReceiptConfigs:[],cosmosLogConfigs:[],starknetEventConfigs:[],btcTransactionConfigs:[],instructionConfig:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),processorType:""}}var Ll={encode(e,t=S.default.Writer.create()){e.contract!==void 0&&oi.encode(e.contract,t.uint32(10).fork()).ldelim();for(let n of e.intervalConfigs)Tt.encode(n,t.uint32(90).fork()).ldelim();for(let n of e.moveIntervalConfigs)ai.encode(n,t.uint32(154).fork()).ldelim();for(let n of e.logConfigs)ui.encode(n,t.uint32(26).fork()).ldelim();for(let n of e.traceConfigs)Zl.encode(n,t.uint32(18).fork()).ldelim();for(let n of e.transactionConfig)Yl.encode(n,t.uint32(58).fork()).ldelim();for(let n of e.moveEventConfigs)uc.encode(n,t.uint32(74).fork()).ldelim();for(let n of e.moveCallConfigs)li.encode(n,t.uint32(82).fork()).ldelim();for(let n of e.moveResourceChangeConfigs)ci.encode(n,t.uint32(98).fork()).ldelim();for(let n of e.fuelCallConfigs)vc.encode(n,t.uint32(106).fork()).ldelim();for(let n of e.fuelTransactionConfigs)Sc.encode(n,t.uint32(162).fork()).ldelim();for(let n of e.assetConfigs)Xl.encode(n,t.uint32(114).fork()).ldelim();for(let n of e.fuelLogConfigs)jl.encode(n,t.uint32(122).fork()).ldelim();for(let n of e.fuelReceiptConfigs)ec.encode(n,t.uint32(170).fork()).ldelim();for(let n of e.cosmosLogConfigs)rc.encode(n,t.uint32(130).fork()).ldelim();for(let n of e.starknetEventConfigs)fc.encode(n,t.uint32(138).fork()).ldelim();for(let n of e.btcTransactionConfigs)hc.encode(n,t.uint32(146).fork()).ldelim();if(e.instructionConfig!==void 0&&ac.encode(e.instructionConfig,t.uint32(50).fork()).ldelim(),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");t.uint32(32).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");t.uint32(40).uint64(e.endBlock.toString())}return e.processorType!==""&&t.uint32(66).string(e.processorType),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=T3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.contract=oi.decode(n,n.uint32());continue;case 11:if(a!==90)break;i.intervalConfigs.push(Tt.decode(n,n.uint32()));continue;case 19:if(a!==154)break;i.moveIntervalConfigs.push(ai.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.logConfigs.push(ui.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.traceConfigs.push(Zl.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.transactionConfig.push(Yl.decode(n,n.uint32()));continue;case 9:if(a!==74)break;i.moveEventConfigs.push(uc.decode(n,n.uint32()));continue;case 10:if(a!==82)break;i.moveCallConfigs.push(li.decode(n,n.uint32()));continue;case 12:if(a!==98)break;i.moveResourceChangeConfigs.push(ci.decode(n,n.uint32()));continue;case 13:if(a!==106)break;i.fuelCallConfigs.push(vc.decode(n,n.uint32()));continue;case 20:if(a!==162)break;i.fuelTransactionConfigs.push(Sc.decode(n,n.uint32()));continue;case 14:if(a!==114)break;i.assetConfigs.push(Xl.decode(n,n.uint32()));continue;case 15:if(a!==122)break;i.fuelLogConfigs.push(jl.decode(n,n.uint32()));continue;case 21:if(a!==170)break;i.fuelReceiptConfigs.push(ec.decode(n,n.uint32()));continue;case 16:if(a!==130)break;i.cosmosLogConfigs.push(rc.decode(n,n.uint32()));continue;case 17:if(a!==138)break;i.starknetEventConfigs.push(fc.decode(n,n.uint32()));continue;case 18:if(a!==146)break;i.btcTransactionConfigs.push(hc.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.instructionConfig=ac.decode(n,n.uint32());continue;case 4:if(a!==32)break;i.startBlock=Jt(n.uint64());continue;case 5:if(a!==40)break;i.endBlock=Jt(n.uint64());continue;case 8:if(a!==66)break;i.processorType=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{contract:T(e.contract)?oi.fromJSON(e.contract):void 0,intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(t=>Tt.fromJSON(t)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(t=>ai.fromJSON(t)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(t=>ui.fromJSON(t)):[],traceConfigs:globalThis.Array.isArray(e?.traceConfigs)?e.traceConfigs.map(t=>Zl.fromJSON(t)):[],transactionConfig:globalThis.Array.isArray(e?.transactionConfig)?e.transactionConfig.map(t=>Yl.fromJSON(t)):[],moveEventConfigs:globalThis.Array.isArray(e?.moveEventConfigs)?e.moveEventConfigs.map(t=>uc.fromJSON(t)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(t=>li.fromJSON(t)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(t=>ci.fromJSON(t)):[],fuelCallConfigs:globalThis.Array.isArray(e?.fuelCallConfigs)?e.fuelCallConfigs.map(t=>vc.fromJSON(t)):[],fuelTransactionConfigs:globalThis.Array.isArray(e?.fuelTransactionConfigs)?e.fuelTransactionConfigs.map(t=>Sc.fromJSON(t)):[],assetConfigs:globalThis.Array.isArray(e?.assetConfigs)?e.assetConfigs.map(t=>Xl.fromJSON(t)):[],fuelLogConfigs:globalThis.Array.isArray(e?.fuelLogConfigs)?e.fuelLogConfigs.map(t=>jl.fromJSON(t)):[],fuelReceiptConfigs:globalThis.Array.isArray(e?.fuelReceiptConfigs)?e.fuelReceiptConfigs.map(t=>ec.fromJSON(t)):[],cosmosLogConfigs:globalThis.Array.isArray(e?.cosmosLogConfigs)?e.cosmosLogConfigs.map(t=>rc.fromJSON(t)):[],starknetEventConfigs:globalThis.Array.isArray(e?.starknetEventConfigs)?e.starknetEventConfigs.map(t=>fc.fromJSON(t)):[],btcTransactionConfigs:globalThis.Array.isArray(e?.btcTransactionConfigs)?e.btcTransactionConfigs.map(t=>hc.fromJSON(t)):[],instructionConfig:T(e.instructionConfig)?ac.fromJSON(e.instructionConfig):void 0,startBlock:T(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:T(e.endBlock)?BigInt(e.endBlock):BigInt("0"),processorType:T(e.processorType)?globalThis.String(e.processorType):""}},toJSON(e){let t={};return e.contract!==void 0&&(t.contract=oi.toJSON(e.contract)),e.intervalConfigs?.length&&(t.intervalConfigs=e.intervalConfigs.map(n=>Tt.toJSON(n))),e.moveIntervalConfigs?.length&&(t.moveIntervalConfigs=e.moveIntervalConfigs.map(n=>ai.toJSON(n))),e.logConfigs?.length&&(t.logConfigs=e.logConfigs.map(n=>ui.toJSON(n))),e.traceConfigs?.length&&(t.traceConfigs=e.traceConfigs.map(n=>Zl.toJSON(n))),e.transactionConfig?.length&&(t.transactionConfig=e.transactionConfig.map(n=>Yl.toJSON(n))),e.moveEventConfigs?.length&&(t.moveEventConfigs=e.moveEventConfigs.map(n=>uc.toJSON(n))),e.moveCallConfigs?.length&&(t.moveCallConfigs=e.moveCallConfigs.map(n=>li.toJSON(n))),e.moveResourceChangeConfigs?.length&&(t.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(n=>ci.toJSON(n))),e.fuelCallConfigs?.length&&(t.fuelCallConfigs=e.fuelCallConfigs.map(n=>vc.toJSON(n))),e.fuelTransactionConfigs?.length&&(t.fuelTransactionConfigs=e.fuelTransactionConfigs.map(n=>Sc.toJSON(n))),e.assetConfigs?.length&&(t.assetConfigs=e.assetConfigs.map(n=>Xl.toJSON(n))),e.fuelLogConfigs?.length&&(t.fuelLogConfigs=e.fuelLogConfigs.map(n=>jl.toJSON(n))),e.fuelReceiptConfigs?.length&&(t.fuelReceiptConfigs=e.fuelReceiptConfigs.map(n=>ec.toJSON(n))),e.cosmosLogConfigs?.length&&(t.cosmosLogConfigs=e.cosmosLogConfigs.map(n=>rc.toJSON(n))),e.starknetEventConfigs?.length&&(t.starknetEventConfigs=e.starknetEventConfigs.map(n=>fc.toJSON(n))),e.btcTransactionConfigs?.length&&(t.btcTransactionConfigs=e.btcTransactionConfigs.map(n=>hc.toJSON(n))),e.instructionConfig!==void 0&&(t.instructionConfig=ac.toJSON(e.instructionConfig)),e.startBlock!==BigInt("0")&&(t.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(t.endBlock=e.endBlock.toString()),e.processorType!==""&&(t.processorType=e.processorType),t},create(e){return Ll.fromPartial(e??{})},fromPartial(e){let t=T3();return t.contract=e.contract!==void 0&&e.contract!==null?oi.fromPartial(e.contract):void 0,t.intervalConfigs=e.intervalConfigs?.map(n=>Tt.fromPartial(n))||[],t.moveIntervalConfigs=e.moveIntervalConfigs?.map(n=>ai.fromPartial(n))||[],t.logConfigs=e.logConfigs?.map(n=>ui.fromPartial(n))||[],t.traceConfigs=e.traceConfigs?.map(n=>Zl.fromPartial(n))||[],t.transactionConfig=e.transactionConfig?.map(n=>Yl.fromPartial(n))||[],t.moveEventConfigs=e.moveEventConfigs?.map(n=>uc.fromPartial(n))||[],t.moveCallConfigs=e.moveCallConfigs?.map(n=>li.fromPartial(n))||[],t.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(n=>ci.fromPartial(n))||[],t.fuelCallConfigs=e.fuelCallConfigs?.map(n=>vc.fromPartial(n))||[],t.fuelTransactionConfigs=e.fuelTransactionConfigs?.map(n=>Sc.fromPartial(n))||[],t.assetConfigs=e.assetConfigs?.map(n=>Xl.fromPartial(n))||[],t.fuelLogConfigs=e.fuelLogConfigs?.map(n=>jl.fromPartial(n))||[],t.fuelReceiptConfigs=e.fuelReceiptConfigs?.map(n=>ec.fromPartial(n))||[],t.cosmosLogConfigs=e.cosmosLogConfigs?.map(n=>rc.fromPartial(n))||[],t.starknetEventConfigs=e.starknetEventConfigs?.map(n=>fc.fromPartial(n))||[],t.btcTransactionConfigs=e.btcTransactionConfigs?.map(n=>hc.fromPartial(n))||[],t.instructionConfig=e.instructionConfig!==void 0&&e.instructionConfig!==null?ac.fromPartial(e.instructionConfig):void 0,t.startBlock=e.startBlock??BigInt("0"),t.endBlock=e.endBlock??BigInt("0"),t.processorType=e.processorType??"",t}};function E3(){return{gqlSchema:""}}var Fl={encode(e,t=S.default.Writer.create()){return e.gqlSchema!==""&&t.uint32(10).string(e.gqlSchema),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=E3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.gqlSchema=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{gqlSchema:T(e.gqlSchema)?globalThis.String(e.gqlSchema):""}},toJSON(e){let t={};return e.gqlSchema!==""&&(t.gqlSchema=e.gqlSchema),t},create(e){return Fl.fromPartial(e??{})},fromPartial(e){let t=E3();return t.gqlSchema=e.gqlSchema??"",t}};function C3(){return{}}var Ul={encode(e,t=S.default.Writer.create()){return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=C3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return Ul.fromPartial(e??{})},fromPartial(e){return C3()}};function k3(){return{retentionEventName:"",days:0}}var ql={encode(e,t=S.default.Writer.create()){return e.retentionEventName!==""&&t.uint32(18).string(e.retentionEventName),e.days!==0&&t.uint32(24).int32(e.days),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=k3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.retentionEventName=n.string();continue;case 3:if(a!==24)break;i.days=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{retentionEventName:T(e.retentionEventName)?globalThis.String(e.retentionEventName):"",days:T(e.days)?globalThis.Number(e.days):0}},toJSON(e){let t={};return e.retentionEventName!==""&&(t.retentionEventName=e.retentionEventName),e.days!==0&&(t.days=Math.round(e.days)),t},create(e){return ql.fromPartial(e??{})},fromPartial(e){let t=k3();return t.retentionEventName=e.retentionEventName??"",t.days=e.days??0,t}};function _3(){return{eventName:"",totalByDay:!1,unique:!1,totalPerEntity:void 0,distinctAggregationByDays:[],retentionConfig:void 0}}var Vl={encode(e,t=S.default.Writer.create()){e.eventName!==""&&t.uint32(10).string(e.eventName),e.totalByDay!==!1&&t.uint32(16).bool(e.totalByDay),e.unique!==!1&&t.uint32(24).bool(e.unique),e.totalPerEntity!==void 0&&Ul.encode(e.totalPerEntity,t.uint32(34).fork()).ldelim(),t.uint32(42).fork();for(let n of e.distinctAggregationByDays)t.int32(n);return t.ldelim(),e.retentionConfig!==void 0&&ql.encode(e.retentionConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=_3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.eventName=n.string();continue;case 2:if(a!==16)break;i.totalByDay=n.bool();continue;case 3:if(a!==24)break;i.unique=n.bool();continue;case 4:if(a!==34)break;i.totalPerEntity=Ul.decode(n,n.uint32());continue;case 5:if(a===40){i.distinctAggregationByDays.push(n.int32());continue}if(a===42){let o=n.uint32()+n.pos;for(;n.pos<o;)i.distinctAggregationByDays.push(n.int32());continue}break;case 6:if(a!==50)break;i.retentionConfig=ql.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{eventName:T(e.eventName)?globalThis.String(e.eventName):"",totalByDay:T(e.totalByDay)?globalThis.Boolean(e.totalByDay):!1,unique:T(e.unique)?globalThis.Boolean(e.unique):!1,totalPerEntity:T(e.totalPerEntity)?Ul.fromJSON(e.totalPerEntity):void 0,distinctAggregationByDays:globalThis.Array.isArray(e?.distinctAggregationByDays)?e.distinctAggregationByDays.map(t=>globalThis.Number(t)):[],retentionConfig:T(e.retentionConfig)?ql.fromJSON(e.retentionConfig):void 0}},toJSON(e){let t={};return e.eventName!==""&&(t.eventName=e.eventName),e.totalByDay!==!1&&(t.totalByDay=e.totalByDay),e.unique!==!1&&(t.unique=e.unique),e.totalPerEntity!==void 0&&(t.totalPerEntity=Ul.toJSON(e.totalPerEntity)),e.distinctAggregationByDays?.length&&(t.distinctAggregationByDays=e.distinctAggregationByDays.map(n=>Math.round(n))),e.retentionConfig!==void 0&&(t.retentionConfig=ql.toJSON(e.retentionConfig)),t},create(e){return Vl.fromPartial(e??{})},fromPartial(e){let t=_3();return t.eventName=e.eventName??"",t.totalByDay=e.totalByDay??!1,t.unique=e.unique??!1,t.totalPerEntity=e.totalPerEntity!==void 0&&e.totalPerEntity!==null?Ul.fromPartial(e.totalPerEntity):void 0,t.distinctAggregationByDays=e.distinctAggregationByDays?.map(n=>n)||[],t.retentionConfig=e.retentionConfig!==void 0&&e.retentionConfig!==null?ql.fromPartial(e.retentionConfig):void 0,t}};function A3(){return{name:"",channel:""}}var Jl={encode(e,t=S.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.channel!==""&&t.uint32(18).string(e.channel),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=A3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==18)break;i.channel=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:T(e.name)?globalThis.String(e.name):"",channel:T(e.channel)?globalThis.String(e.channel):""}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.channel!==""&&(t.channel=e.channel),t},create(e){return Jl.fromPartial(e??{})},fromPartial(e){let t=A3();return t.name=e.name??"",t.channel=e.channel??"",t}};function N3(){return{name:"",description:"",unit:"",sparse:!1,persistentBetweenVersion:!1,type:0,aggregationConfig:void 0}}var Wl={encode(e,t=S.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.description!==""&&t.uint32(26).string(e.description),e.unit!==""&&t.uint32(18).string(e.unit),e.sparse!==!1&&t.uint32(32).bool(e.sparse),e.persistentBetweenVersion!==!1&&t.uint32(40).bool(e.persistentBetweenVersion),e.type!==0&&t.uint32(56).int32(e.type),e.aggregationConfig!==void 0&&zl.encode(e.aggregationConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=N3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 3:if(a!==26)break;i.description=n.string();continue;case 2:if(a!==18)break;i.unit=n.string();continue;case 4:if(a!==32)break;i.sparse=n.bool();continue;case 5:if(a!==40)break;i.persistentBetweenVersion=n.bool();continue;case 7:if(a!==56)break;i.type=n.int32();continue;case 6:if(a!==50)break;i.aggregationConfig=zl.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:T(e.name)?globalThis.String(e.name):"",description:T(e.description)?globalThis.String(e.description):"",unit:T(e.unit)?globalThis.String(e.unit):"",sparse:T(e.sparse)?globalThis.Boolean(e.sparse):!1,persistentBetweenVersion:T(e.persistentBetweenVersion)?globalThis.Boolean(e.persistentBetweenVersion):!1,type:T(e.type)?_5(e.type):0,aggregationConfig:T(e.aggregationConfig)?zl.fromJSON(e.aggregationConfig):void 0}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.description!==""&&(t.description=e.description),e.unit!==""&&(t.unit=e.unit),e.sparse!==!1&&(t.sparse=e.sparse),e.persistentBetweenVersion!==!1&&(t.persistentBetweenVersion=e.persistentBetweenVersion),e.type!==0&&(t.type=A5(e.type)),e.aggregationConfig!==void 0&&(t.aggregationConfig=zl.toJSON(e.aggregationConfig)),t},create(e){return Wl.fromPartial(e??{})},fromPartial(e){let t=N3();return t.name=e.name??"",t.description=e.description??"",t.unit=e.unit??"",t.sparse=e.sparse??!1,t.persistentBetweenVersion=e.persistentBetweenVersion??!1,t.type=e.type??0,t.aggregationConfig=e.aggregationConfig!==void 0&&e.aggregationConfig!==null?zl.fromPartial(e.aggregationConfig):void 0,t}};function I3(){return{name:"",fields:[]}}var Hl={encode(e,t=S.default.Writer.create()){e.name!==""&&t.uint32(10).string(e.name);for(let n of e.fields)ii.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=I3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==18)break;i.fields.push(ii.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:T(e.name)?globalThis.String(e.name):"",fields:globalThis.Array.isArray(e?.fields)?e.fields.map(t=>ii.fromJSON(t)):[]}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.fields?.length&&(t.fields=e.fields.map(n=>ii.toJSON(n))),t},create(e){return Hl.fromPartial(e??{})},fromPartial(e){let t=I3();return t.name=e.name??"",t.fields=e.fields?.map(n=>ii.fromPartial(n))||[],t}};function O3(){return{fields:[]}}var Gl={encode(e,t=S.default.Writer.create()){for(let n of e.fields)ii.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=O3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.fields.push(ii.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{fields:globalThis.Array.isArray(e?.fields)?e.fields.map(t=>ii.fromJSON(t)):[]}},toJSON(e){let t={};return e.fields?.length&&(t.fields=e.fields.map(n=>ii.toJSON(n))),t},create(e){return Gl.fromPartial(e??{})},fromPartial(e){let t=O3();return t.fields=e.fields?.map(n=>ii.fromPartial(n))||[],t}};function R3(){return{name:"",basicType:void 0,coinType:void 0,structType:void 0}}var ii={encode(e,t=S.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.basicType!==void 0&&t.uint32(16).int32(e.basicType),e.coinType!==void 0&&Cr.encode(e.coinType,t.uint32(26).fork()).ldelim(),e.structType!==void 0&&Gl.encode(e.structType,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=R3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==16)break;i.basicType=n.int32();continue;case 3:if(a!==26)break;i.coinType=Cr.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.structType=Gl.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:T(e.name)?globalThis.String(e.name):"",basicType:T(e.basicType)?x5(e.basicType):void 0,coinType:T(e.coinType)?Cr.fromJSON(e.coinType):void 0,structType:T(e.structType)?Gl.fromJSON(e.structType):void 0}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.basicType!==void 0&&(t.basicType=B5(e.basicType)),e.coinType!==void 0&&(t.coinType=Cr.toJSON(e.coinType)),e.structType!==void 0&&(t.structType=Gl.toJSON(e.structType)),t},create(e){return ii.fromPartial(e??{})},fromPartial(e){let t=R3();return t.name=e.name??"",t.basicType=e.basicType??void 0,t.coinType=e.coinType!==void 0&&e.coinType!==null?Cr.fromPartial(e.coinType):void 0,t.structType=e.structType!==void 0&&e.structType!==null?Gl.fromPartial(e.structType):void 0,t}};function P3(){return{intervalInMinutes:[],types:[],discardOrigin:!1}}var zl={encode(e,t=S.default.Writer.create()){t.uint32(10).fork();for(let n of e.intervalInMinutes)t.int32(n);t.ldelim(),t.uint32(18).fork();for(let n of e.types)t.int32(n);return t.ldelim(),e.discardOrigin!==!1&&t.uint32(24).bool(e.discardOrigin),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=P3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a===8){i.intervalInMinutes.push(n.int32());continue}if(a===10){let o=n.uint32()+n.pos;for(;n.pos<o;)i.intervalInMinutes.push(n.int32());continue}break;case 2:if(a===16){i.types.push(n.int32());continue}if(a===18){let o=n.uint32()+n.pos;for(;n.pos<o;)i.types.push(n.int32());continue}break;case 3:if(a!==24)break;i.discardOrigin=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{intervalInMinutes:globalThis.Array.isArray(e?.intervalInMinutes)?e.intervalInMinutes.map(t=>globalThis.Number(t)):[],types:globalThis.Array.isArray(e?.types)?e.types.map(t=>N5(t)):[],discardOrigin:T(e.discardOrigin)?globalThis.Boolean(e.discardOrigin):!1}},toJSON(e){let t={};return e.intervalInMinutes?.length&&(t.intervalInMinutes=e.intervalInMinutes.map(n=>Math.round(n))),e.types?.length&&(t.types=e.types.map(n=>I5(n))),e.discardOrigin!==!1&&(t.discardOrigin=e.discardOrigin),t},create(e){return zl.fromPartial(e??{})},fromPartial(e){let t=P3();return t.intervalInMinutes=e.intervalInMinutes?.map(n=>n)||[],t.types=e.types?.map(n=>n)||[],t.discardOrigin=e.discardOrigin??!1,t}};function w3(){return{chainId:"",address:"",startBlock:BigInt("0"),intervalConfigs:[],aptosIntervalConfigs:[],moveIntervalConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],logConfigs:[]}}var Ql={encode(e,t=S.default.Writer.create()){if(e.chainId!==""&&t.uint32(10).string(e.chainId),e.address!==""&&t.uint32(18).string(e.address),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");t.uint32(24).uint64(e.startBlock.toString())}for(let n of e.intervalConfigs)Tt.encode(n,t.uint32(34).fork()).ldelim();for(let n of e.aptosIntervalConfigs)Kl.encode(n,t.uint32(42).fork()).ldelim();for(let n of e.moveIntervalConfigs)ai.encode(n,t.uint32(58).fork()).ldelim();for(let n of e.moveCallConfigs)li.encode(n,t.uint32(66).fork()).ldelim();for(let n of e.moveResourceChangeConfigs)ci.encode(n,t.uint32(74).fork()).ldelim();for(let n of e.logConfigs)ui.encode(n,t.uint32(50).fork()).ldelim();return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=w3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=n.string();continue;case 2:if(a!==18)break;i.address=n.string();continue;case 3:if(a!==24)break;i.startBlock=Jt(n.uint64());continue;case 4:if(a!==34)break;i.intervalConfigs.push(Tt.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.aptosIntervalConfigs.push(Kl.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.moveIntervalConfigs.push(ai.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.moveCallConfigs.push(li.decode(n,n.uint32()));continue;case 9:if(a!==74)break;i.moveResourceChangeConfigs.push(ci.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.logConfigs.push(ui.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{chainId:T(e.chainId)?globalThis.String(e.chainId):"",address:T(e.address)?globalThis.String(e.address):"",startBlock:T(e.startBlock)?BigInt(e.startBlock):BigInt("0"),intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(t=>Tt.fromJSON(t)):[],aptosIntervalConfigs:globalThis.Array.isArray(e?.aptosIntervalConfigs)?e.aptosIntervalConfigs.map(t=>Kl.fromJSON(t)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(t=>ai.fromJSON(t)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(t=>li.fromJSON(t)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(t=>ci.fromJSON(t)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(t=>ui.fromJSON(t)):[]}},toJSON(e){let t={};return e.chainId!==""&&(t.chainId=e.chainId),e.address!==""&&(t.address=e.address),e.startBlock!==BigInt("0")&&(t.startBlock=e.startBlock.toString()),e.intervalConfigs?.length&&(t.intervalConfigs=e.intervalConfigs.map(n=>Tt.toJSON(n))),e.aptosIntervalConfigs?.length&&(t.aptosIntervalConfigs=e.aptosIntervalConfigs.map(n=>Kl.toJSON(n))),e.moveIntervalConfigs?.length&&(t.moveIntervalConfigs=e.moveIntervalConfigs.map(n=>ai.toJSON(n))),e.moveCallConfigs?.length&&(t.moveCallConfigs=e.moveCallConfigs.map(n=>li.toJSON(n))),e.moveResourceChangeConfigs?.length&&(t.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(n=>ci.toJSON(n))),e.logConfigs?.length&&(t.logConfigs=e.logConfigs.map(n=>ui.toJSON(n))),t},create(e){return Ql.fromPartial(e??{})},fromPartial(e){let t=w3();return t.chainId=e.chainId??"",t.address=e.address??"",t.startBlock=e.startBlock??BigInt("0"),t.intervalConfigs=e.intervalConfigs?.map(n=>Tt.fromPartial(n))||[],t.aptosIntervalConfigs=e.aptosIntervalConfigs?.map(n=>Kl.fromPartial(n))||[],t.moveIntervalConfigs=e.moveIntervalConfigs?.map(n=>ai.fromPartial(n))||[],t.moveCallConfigs=e.moveCallConfigs?.map(n=>li.fromPartial(n))||[],t.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(n=>ci.fromPartial(n))||[],t.logConfigs=e.logConfigs?.map(n=>ui.fromPartial(n))||[],t}};function x3(){return{recentInterval:0,backfillInterval:0}}var ri={encode(e,t=S.default.Writer.create()){return e.recentInterval!==0&&t.uint32(8).int32(e.recentInterval),e.backfillInterval!==0&&t.uint32(16).int32(e.backfillInterval),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=x3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.recentInterval=n.int32();continue;case 2:if(a!==16)break;i.backfillInterval=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{recentInterval:T(e.recentInterval)?globalThis.Number(e.recentInterval):0,backfillInterval:T(e.backfillInterval)?globalThis.Number(e.backfillInterval):0}},toJSON(e){let t={};return e.recentInterval!==0&&(t.recentInterval=Math.round(e.recentInterval)),e.backfillInterval!==0&&(t.backfillInterval=Math.round(e.backfillInterval)),t},create(e){return ri.fromPartial(e??{})},fromPartial(e){let t=x3();return t.recentInterval=e.recentInterval??0,t.backfillInterval=e.backfillInterval??0,t}};function B3(){return{handlerId:0,minutes:0,minutesInterval:void 0,slot:0,slotInterval:void 0,fetchConfig:void 0,handlerName:""}}var Tt={encode(e,t=S.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.minutes!==0&&t.uint32(16).int32(e.minutes),e.minutesInterval!==void 0&&ri.encode(e.minutesInterval,t.uint32(34).fork()).ldelim(),e.slot!==0&&t.uint32(24).int32(e.slot),e.slotInterval!==void 0&&ri.encode(e.slotInterval,t.uint32(42).fork()).ldelim(),e.fetchConfig!==void 0&&Et.encode(e.fetchConfig,t.uint32(50).fork()).ldelim(),e.handlerName!==""&&t.uint32(58).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=B3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=n.int32();continue;case 2:if(a!==16)break;i.minutes=n.int32();continue;case 4:if(a!==34)break;i.minutesInterval=ri.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.slot=n.int32();continue;case 5:if(a!==42)break;i.slotInterval=ri.decode(n,n.uint32());continue;case 6:if(a!==50)break;i.fetchConfig=Et.decode(n,n.uint32());continue;case 7:if(a!==58)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,minutes:T(e.minutes)?globalThis.Number(e.minutes):0,minutesInterval:T(e.minutesInterval)?ri.fromJSON(e.minutesInterval):void 0,slot:T(e.slot)?globalThis.Number(e.slot):0,slotInterval:T(e.slotInterval)?ri.fromJSON(e.slotInterval):void 0,fetchConfig:T(e.fetchConfig)?Et.fromJSON(e.fetchConfig):void 0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.minutes!==0&&(t.minutes=Math.round(e.minutes)),e.minutesInterval!==void 0&&(t.minutesInterval=ri.toJSON(e.minutesInterval)),e.slot!==0&&(t.slot=Math.round(e.slot)),e.slotInterval!==void 0&&(t.slotInterval=ri.toJSON(e.slotInterval)),e.fetchConfig!==void 0&&(t.fetchConfig=Et.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Tt.fromPartial(e??{})},fromPartial(e){let t=B3();return t.handlerId=e.handlerId??0,t.minutes=e.minutes??0,t.minutesInterval=e.minutesInterval!==void 0&&e.minutesInterval!==null?ri.fromPartial(e.minutesInterval):void 0,t.slot=e.slot??0,t.slotInterval=e.slotInterval!==void 0&&e.slotInterval!==null?ri.fromPartial(e.slotInterval):void 0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?Et.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function D3(){return{intervalConfig:void 0,type:""}}var Kl={encode(e,t=S.default.Writer.create()){return e.intervalConfig!==void 0&&Tt.encode(e.intervalConfig,t.uint32(10).fork()).ldelim(),e.type!==""&&t.uint32(18).string(e.type),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=D3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.intervalConfig=Tt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.type=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{intervalConfig:T(e.intervalConfig)?Tt.fromJSON(e.intervalConfig):void 0,type:T(e.type)?globalThis.String(e.type):""}},toJSON(e){let t={};return e.intervalConfig!==void 0&&(t.intervalConfig=Tt.toJSON(e.intervalConfig)),e.type!==""&&(t.type=e.type),t},create(e){return Kl.fromPartial(e??{})},fromPartial(e){let t=D3();return t.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?Tt.fromPartial(e.intervalConfig):void 0,t.type=e.type??"",t}};function M3(){return{intervalConfig:void 0,type:"",ownerType:0,resourceFetchConfig:void 0,fetchConfig:void 0}}var ai={encode(e,t=S.default.Writer.create()){return e.intervalConfig!==void 0&&Tt.encode(e.intervalConfig,t.uint32(10).fork()).ldelim(),e.type!==""&&t.uint32(18).string(e.type),e.ownerType!==0&&t.uint32(24).int32(e.ownerType),e.resourceFetchConfig!==void 0&&sc.encode(e.resourceFetchConfig,t.uint32(34).fork()).ldelim(),e.fetchConfig!==void 0&&pn.encode(e.fetchConfig,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=M3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.intervalConfig=Tt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.type=n.string();continue;case 3:if(a!==24)break;i.ownerType=n.int32();continue;case 4:if(a!==34)break;i.resourceFetchConfig=sc.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.fetchConfig=pn.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{intervalConfig:T(e.intervalConfig)?Tt.fromJSON(e.intervalConfig):void 0,type:T(e.type)?globalThis.String(e.type):"",ownerType:T(e.ownerType)?O5(e.ownerType):0,resourceFetchConfig:T(e.resourceFetchConfig)?sc.fromJSON(e.resourceFetchConfig):void 0,fetchConfig:T(e.fetchConfig)?pn.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.intervalConfig!==void 0&&(t.intervalConfig=Tt.toJSON(e.intervalConfig)),e.type!==""&&(t.type=e.type),e.ownerType!==0&&(t.ownerType=R5(e.ownerType)),e.resourceFetchConfig!==void 0&&(t.resourceFetchConfig=sc.toJSON(e.resourceFetchConfig)),e.fetchConfig!==void 0&&(t.fetchConfig=pn.toJSON(e.fetchConfig)),t},create(e){return ai.fromPartial(e??{})},fromPartial(e){let t=M3();return t.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?Tt.fromPartial(e.intervalConfig):void 0,t.type=e.type??"",t.ownerType=e.ownerType??0,t.resourceFetchConfig=e.resourceFetchConfig!==void 0&&e.resourceFetchConfig!==null?sc.fromPartial(e.resourceFetchConfig):void 0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?pn.fromPartial(e.fetchConfig):void 0,t}};function L3(){return{name:"",chainId:"",address:"",abi:""}}var oi={encode(e,t=S.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.chainId!==""&&t.uint32(18).string(e.chainId),e.address!==""&&t.uint32(26).string(e.address),e.abi!==""&&t.uint32(34).string(e.abi),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=L3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==18)break;i.chainId=n.string();continue;case 3:if(a!==26)break;i.address=n.string();continue;case 4:if(a!==34)break;i.abi=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:T(e.name)?globalThis.String(e.name):"",chainId:T(e.chainId)?globalThis.String(e.chainId):"",address:T(e.address)?globalThis.String(e.address):"",abi:T(e.abi)?globalThis.String(e.abi):""}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.chainId!==""&&(t.chainId=e.chainId),e.address!==""&&(t.address=e.address),e.abi!==""&&(t.abi=e.abi),t},create(e){return oi.fromPartial(e??{})},fromPartial(e){let t=L3();return t.name=e.name??"",t.chainId=e.chainId??"",t.address=e.address??"",t.abi=e.abi??"",t}};function F3(){return{contract:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),templateId:0,baseLabels:void 0}}var si={encode(e,t=S.default.Writer.create()){if(e.contract!==void 0&&oi.encode(e.contract,t.uint32(10).fork()).ldelim(),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");t.uint32(16).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");t.uint32(24).uint64(e.endBlock.toString())}return e.templateId!==0&&t.uint32(32).int32(e.templateId),e.baseLabels!==void 0&&P.encode(P.wrap(e.baseLabels),t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=F3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.contract=oi.decode(n,n.uint32());continue;case 2:if(a!==16)break;i.startBlock=Jt(n.uint64());continue;case 3:if(a!==24)break;i.endBlock=Jt(n.uint64());continue;case 4:if(a!==32)break;i.templateId=n.int32();continue;case 5:if(a!==42)break;i.baseLabels=P.unwrap(P.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{contract:T(e.contract)?oi.fromJSON(e.contract):void 0,startBlock:T(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:T(e.endBlock)?BigInt(e.endBlock):BigInt("0"),templateId:T(e.templateId)?globalThis.Number(e.templateId):0,baseLabels:we(e.baseLabels)?e.baseLabels:void 0}},toJSON(e){let t={};return e.contract!==void 0&&(t.contract=oi.toJSON(e.contract)),e.startBlock!==BigInt("0")&&(t.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(t.endBlock=e.endBlock.toString()),e.templateId!==0&&(t.templateId=Math.round(e.templateId)),e.baseLabels!==void 0&&(t.baseLabels=e.baseLabels),t},create(e){return si.fromPartial(e??{})},fromPartial(e){let t=F3();return t.contract=e.contract!==void 0&&e.contract!==null?oi.fromPartial(e.contract):void 0,t.startBlock=e.startBlock??BigInt("0"),t.endBlock=e.endBlock??BigInt("0"),t.templateId=e.templateId??0,t.baseLabels=e.baseLabels??void 0,t}};function U3(){return{templateInstances:[]}}var Cw={encode(e,t=S.default.Writer.create()){for(let n of e.templateInstances)si.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=U3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.templateInstances.push(si.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>si.fromJSON(t)):[]}},toJSON(e){let t={};return e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(n=>si.toJSON(n))),t},create(e){return Cw.fromPartial(e??{})},fromPartial(e){let t=U3();return t.templateInstances=e.templateInstances?.map(n=>si.fromPartial(n))||[],t}};function q3(){return{transaction:!1,transactionReceipt:!1,transactionReceiptLogs:!1,block:!1,trace:!1}}var Et={encode(e,t=S.default.Writer.create()){return e.transaction!==!1&&t.uint32(8).bool(e.transaction),e.transactionReceipt!==!1&&t.uint32(16).bool(e.transactionReceipt),e.transactionReceiptLogs!==!1&&t.uint32(40).bool(e.transactionReceiptLogs),e.block!==!1&&t.uint32(24).bool(e.block),e.trace!==!1&&t.uint32(32).bool(e.trace),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=q3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.transaction=n.bool();continue;case 2:if(a!==16)break;i.transactionReceipt=n.bool();continue;case 5:if(a!==40)break;i.transactionReceiptLogs=n.bool();continue;case 3:if(a!==24)break;i.block=n.bool();continue;case 4:if(a!==32)break;i.trace=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:T(e.transaction)?globalThis.Boolean(e.transaction):!1,transactionReceipt:T(e.transactionReceipt)?globalThis.Boolean(e.transactionReceipt):!1,transactionReceiptLogs:T(e.transactionReceiptLogs)?globalThis.Boolean(e.transactionReceiptLogs):!1,block:T(e.block)?globalThis.Boolean(e.block):!1,trace:T(e.trace)?globalThis.Boolean(e.trace):!1}},toJSON(e){let t={};return e.transaction!==!1&&(t.transaction=e.transaction),e.transactionReceipt!==!1&&(t.transactionReceipt=e.transactionReceipt),e.transactionReceiptLogs!==!1&&(t.transactionReceiptLogs=e.transactionReceiptLogs),e.block!==!1&&(t.block=e.block),e.trace!==!1&&(t.trace=e.trace),t},create(e){return Et.fromPartial(e??{})},fromPartial(e){let t=q3();return t.transaction=e.transaction??!1,t.transactionReceipt=e.transactionReceipt??!1,t.transactionReceiptLogs=e.transactionReceiptLogs??!1,t.block=e.block??!1,t.trace=e.trace??!1,t}};function V3(){return{signature:"",handlerId:0,fetchConfig:void 0,handlerName:""}}var Zl={encode(e,t=S.default.Writer.create()){return e.signature!==""&&t.uint32(10).string(e.signature),e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&Et.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=V3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.signature=n.string();continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=Et.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{signature:T(e.signature)?globalThis.String(e.signature):"",handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:T(e.fetchConfig)?Et.fromJSON(e.fetchConfig):void 0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.signature!==""&&(t.signature=e.signature),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=Et.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Zl.fromPartial(e??{})},fromPartial(e){let t=V3();return t.signature=e.signature??"",t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?Et.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function J3(){return{handlerId:0,fetchConfig:void 0,handlerName:""}}var Yl={encode(e,t=S.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.fetchConfig!==void 0&&Et.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=J3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=Et.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:T(e.fetchConfig)?Et.fromJSON(e.fetchConfig):void 0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=Et.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Yl.fromPartial(e??{})},fromPartial(e){let t=J3();return t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?Et.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function W3(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}var ui={encode(e,t=S.default.Writer.create()){for(let n of e.filters)ic.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&Et.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=W3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(ic.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=Et.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>ic.fromJSON(t)):[],handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:T(e.fetchConfig)?Et.fromJSON(e.fetchConfig):void 0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>ic.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=Et.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return ui.fromPartial(e??{})},fromPartial(e){let t=W3();return t.filters=e.filters?.map(n=>ic.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?Et.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function H3(){return{filters:[],handlerId:0,handlerName:""}}var Xl={encode(e,t=S.default.Writer.create()){for(let n of e.filters)$l.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=H3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push($l.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>$l.fromJSON(t)):[],handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>$l.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Xl.fromPartial(e??{})},fromPartial(e){let t=H3();return t.filters=e.filters?.map(n=>$l.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function G3(){return{assetId:void 0,fromAddress:void 0,toAddress:void 0}}var $l={encode(e,t=S.default.Writer.create()){return e.assetId!==void 0&&t.uint32(10).string(e.assetId),e.fromAddress!==void 0&&t.uint32(18).string(e.fromAddress),e.toAddress!==void 0&&t.uint32(26).string(e.toAddress),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=G3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.assetId=n.string();continue;case 2:if(a!==18)break;i.fromAddress=n.string();continue;case 3:if(a!==26)break;i.toAddress=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{assetId:T(e.assetId)?globalThis.String(e.assetId):void 0,fromAddress:T(e.fromAddress)?globalThis.String(e.fromAddress):void 0,toAddress:T(e.toAddress)?globalThis.String(e.toAddress):void 0}},toJSON(e){let t={};return e.assetId!==void 0&&(t.assetId=e.assetId),e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),t},create(e){return $l.fromPartial(e??{})},fromPartial(e){let t=G3();return t.assetId=e.assetId??void 0,t.fromAddress=e.fromAddress??void 0,t.toAddress=e.toAddress??void 0,t}};function z3(){return{logIds:[],handlerId:0,handlerName:""}}var jl={encode(e,t=S.default.Writer.create()){for(let n of e.logIds)t.uint32(10).string(n);return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=z3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logIds.push(n.string());continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{logIds:globalThis.Array.isArray(e?.logIds)?e.logIds.map(t=>globalThis.String(t)):[],handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.logIds?.length&&(t.logIds=e.logIds),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return jl.fromPartial(e??{})},fromPartial(e){let t=z3();return t.logIds=e.logIds?.map(n=>n)||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function Q3(){return{log:void 0,transfer:void 0,handlerId:0,handlerName:""}}var ec={encode(e,t=S.default.Writer.create()){return e.log!==void 0&&nc.encode(e.log,t.uint32(10).fork()).ldelim(),e.transfer!==void 0&&tc.encode(e.transfer,t.uint32(18).fork()).ldelim(),e.handlerId!==0&&t.uint32(24).int32(e.handlerId),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Q3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.log=nc.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.transfer=tc.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.handlerId=n.int32();continue;case 4:if(a!==34)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{log:T(e.log)?nc.fromJSON(e.log):void 0,transfer:T(e.transfer)?tc.fromJSON(e.transfer):void 0,handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.log!==void 0&&(t.log=nc.toJSON(e.log)),e.transfer!==void 0&&(t.transfer=tc.toJSON(e.transfer)),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return ec.fromPartial(e??{})},fromPartial(e){let t=Q3();return t.log=e.log!==void 0&&e.log!==null?nc.fromPartial(e.log):void 0,t.transfer=e.transfer!==void 0&&e.transfer!==null?tc.fromPartial(e.transfer):void 0,t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function K3(){return{assetId:"",from:"",to:""}}var tc={encode(e,t=S.default.Writer.create()){return e.assetId!==""&&t.uint32(34).string(e.assetId),e.from!==""&&t.uint32(10).string(e.from),e.to!==""&&t.uint32(18).string(e.to),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=K3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 4:if(a!==34)break;i.assetId=n.string();continue;case 1:if(a!==10)break;i.from=n.string();continue;case 2:if(a!==18)break;i.to=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{assetId:T(e.assetId)?globalThis.String(e.assetId):"",from:T(e.from)?globalThis.String(e.from):"",to:T(e.to)?globalThis.String(e.to):""}},toJSON(e){let t={};return e.assetId!==""&&(t.assetId=e.assetId),e.from!==""&&(t.from=e.from),e.to!==""&&(t.to=e.to),t},create(e){return tc.fromPartial(e??{})},fromPartial(e){let t=K3();return t.assetId=e.assetId??"",t.from=e.from??"",t.to=e.to??"",t}};function Z3(){return{logIds:[]}}var nc={encode(e,t=S.default.Writer.create()){for(let n of e.logIds)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Z3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logIds.push(n.string());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{logIds:globalThis.Array.isArray(e?.logIds)?e.logIds.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.logIds?.length&&(t.logIds=e.logIds),t},create(e){return nc.fromPartial(e??{})},fromPartial(e){let t=Z3();return t.logIds=e.logIds?.map(n=>n)||[],t}};function Y3(){return{logFilters:[],handlerId:0,handlerName:""}}var rc={encode(e,t=S.default.Writer.create()){for(let n of e.logFilters)t.uint32(10).string(n);return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Y3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logFilters.push(n.string());continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{logFilters:globalThis.Array.isArray(e?.logFilters)?e.logFilters.map(t=>globalThis.String(t)):[],handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.logFilters?.length&&(t.logFilters=e.logFilters),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return rc.fromPartial(e??{})},fromPartial(e){let t=Y3();return t.logFilters=e.logFilters?.map(n=>n)||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function X3(){return{topics:[],address:void 0,addressType:void 0}}var ic={encode(e,t=S.default.Writer.create()){for(let n of e.topics)bc.encode(n,t.uint32(10).fork()).ldelim();return e.address!==void 0&&t.uint32(18).string(e.address),e.addressType!==void 0&&t.uint32(24).int32(e.addressType),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=X3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.topics.push(bc.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.address=n.string();continue;case 3:if(a!==24)break;i.addressType=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{topics:globalThis.Array.isArray(e?.topics)?e.topics.map(t=>bc.fromJSON(t)):[],address:T(e.address)?globalThis.String(e.address):void 0,addressType:T(e.addressType)?P5(e.addressType):void 0}},toJSON(e){let t={};return e.topics?.length&&(t.topics=e.topics.map(n=>bc.toJSON(n))),e.address!==void 0&&(t.address=e.address),e.addressType!==void 0&&(t.addressType=w5(e.addressType)),t},create(e){return ic.fromPartial(e??{})},fromPartial(e){let t=X3();return t.topics=e.topics?.map(n=>bc.fromPartial(n))||[],t.address=e.address??void 0,t.addressType=e.addressType??void 0,t}};function $3(){return{innerInstruction:!1,parsedInstruction:!1,rawDataInstruction:!1}}var ac={encode(e,t=S.default.Writer.create()){return e.innerInstruction!==!1&&t.uint32(8).bool(e.innerInstruction),e.parsedInstruction!==!1&&t.uint32(16).bool(e.parsedInstruction),e.rawDataInstruction!==!1&&t.uint32(24).bool(e.rawDataInstruction),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=$3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.innerInstruction=n.bool();continue;case 2:if(a!==16)break;i.parsedInstruction=n.bool();continue;case 3:if(a!==24)break;i.rawDataInstruction=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{innerInstruction:T(e.innerInstruction)?globalThis.Boolean(e.innerInstruction):!1,parsedInstruction:T(e.parsedInstruction)?globalThis.Boolean(e.parsedInstruction):!1,rawDataInstruction:T(e.rawDataInstruction)?globalThis.Boolean(e.rawDataInstruction):!1}},toJSON(e){let t={};return e.innerInstruction!==!1&&(t.innerInstruction=e.innerInstruction),e.parsedInstruction!==!1&&(t.parsedInstruction=e.parsedInstruction),e.rawDataInstruction!==!1&&(t.rawDataInstruction=e.rawDataInstruction),t},create(e){return ac.fromPartial(e??{})},fromPartial(e){let t=$3();return t.innerInstruction=e.innerInstruction??!1,t.parsedInstruction=e.parsedInstruction??!1,t.rawDataInstruction=e.rawDataInstruction??!1,t}};function j3(){return{moveTypePrefix:""}}var oc={encode(e,t=S.default.Writer.create()){return e.moveTypePrefix!==""&&t.uint32(10).string(e.moveTypePrefix),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=j3();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.moveTypePrefix=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{moveTypePrefix:T(e.moveTypePrefix)?globalThis.String(e.moveTypePrefix):""}},toJSON(e){let t={};return e.moveTypePrefix!==""&&(t.moveTypePrefix=e.moveTypePrefix),t},create(e){return oc.fromPartial(e??{})},fromPartial(e){let t=j3();return t.moveTypePrefix=e.moveTypePrefix??"",t}};function eP(){return{resourceChanges:!1,allEvents:!1,inputs:!1,resourceConfig:void 0,supportMultisigFunc:void 0,includeFailedTransaction:void 0}}var pn={encode(e,t=S.default.Writer.create()){return e.resourceChanges!==!1&&t.uint32(8).bool(e.resourceChanges),e.allEvents!==!1&&t.uint32(16).bool(e.allEvents),e.inputs!==!1&&t.uint32(32).bool(e.inputs),e.resourceConfig!==void 0&&oc.encode(e.resourceConfig,t.uint32(26).fork()).ldelim(),e.supportMultisigFunc!==void 0&&t.uint32(40).bool(e.supportMultisigFunc),e.includeFailedTransaction!==void 0&&t.uint32(48).bool(e.includeFailedTransaction),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=eP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.resourceChanges=n.bool();continue;case 2:if(a!==16)break;i.allEvents=n.bool();continue;case 4:if(a!==32)break;i.inputs=n.bool();continue;case 3:if(a!==26)break;i.resourceConfig=oc.decode(n,n.uint32());continue;case 5:if(a!==40)break;i.supportMultisigFunc=n.bool();continue;case 6:if(a!==48)break;i.includeFailedTransaction=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{resourceChanges:T(e.resourceChanges)?globalThis.Boolean(e.resourceChanges):!1,allEvents:T(e.allEvents)?globalThis.Boolean(e.allEvents):!1,inputs:T(e.inputs)?globalThis.Boolean(e.inputs):!1,resourceConfig:T(e.resourceConfig)?oc.fromJSON(e.resourceConfig):void 0,supportMultisigFunc:T(e.supportMultisigFunc)?globalThis.Boolean(e.supportMultisigFunc):void 0,includeFailedTransaction:T(e.includeFailedTransaction)?globalThis.Boolean(e.includeFailedTransaction):void 0}},toJSON(e){let t={};return e.resourceChanges!==!1&&(t.resourceChanges=e.resourceChanges),e.allEvents!==!1&&(t.allEvents=e.allEvents),e.inputs!==!1&&(t.inputs=e.inputs),e.resourceConfig!==void 0&&(t.resourceConfig=oc.toJSON(e.resourceConfig)),e.supportMultisigFunc!==void 0&&(t.supportMultisigFunc=e.supportMultisigFunc),e.includeFailedTransaction!==void 0&&(t.includeFailedTransaction=e.includeFailedTransaction),t},create(e){return pn.fromPartial(e??{})},fromPartial(e){let t=eP();return t.resourceChanges=e.resourceChanges??!1,t.allEvents=e.allEvents??!1,t.inputs=e.inputs??!1,t.resourceConfig=e.resourceConfig!==void 0&&e.resourceConfig!==null?oc.fromPartial(e.resourceConfig):void 0,t.supportMultisigFunc=e.supportMultisigFunc??void 0,t.includeFailedTransaction=e.includeFailedTransaction??void 0,t}};function tP(){return{owned:!1}}var sc={encode(e,t=S.default.Writer.create()){return e.owned!==!1&&t.uint32(8).bool(e.owned),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=tP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.owned=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{owned:T(e.owned)?globalThis.Boolean(e.owned):!1}},toJSON(e){let t={};return e.owned!==!1&&(t.owned=e.owned),t},create(e){return sc.fromPartial(e??{})},fromPartial(e){let t=tP();return t.owned=e.owned??!1,t}};function nP(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}var uc={encode(e,t=S.default.Writer.create()){for(let n of e.filters)lc.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&pn.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=nP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(lc.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=pn.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>lc.fromJSON(t)):[],handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:T(e.fetchConfig)?pn.fromJSON(e.fetchConfig):void 0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>lc.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=pn.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return uc.fromPartial(e??{})},fromPartial(e){let t=nP();return t.filters=e.filters?.map(n=>lc.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?pn.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function rP(){return{type:"",account:"",eventAccount:""}}var lc={encode(e,t=S.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.account!==""&&t.uint32(18).string(e.account),e.eventAccount!==""&&t.uint32(26).string(e.eventAccount),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=rP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=n.string();continue;case 2:if(a!==18)break;i.account=n.string();continue;case 3:if(a!==26)break;i.eventAccount=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{type:T(e.type)?globalThis.String(e.type):"",account:T(e.account)?globalThis.String(e.account):"",eventAccount:T(e.eventAccount)?globalThis.String(e.eventAccount):""}},toJSON(e){let t={};return e.type!==""&&(t.type=e.type),e.account!==""&&(t.account=e.account),e.eventAccount!==""&&(t.eventAccount=e.eventAccount),t},create(e){return lc.fromPartial(e??{})},fromPartial(e){let t=rP();return t.type=e.type??"",t.account=e.account??"",t.eventAccount=e.eventAccount??"",t}};function iP(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}var li={encode(e,t=S.default.Writer.create()){for(let n of e.filters)cc.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&pn.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=iP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(cc.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=pn.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>cc.fromJSON(t)):[],handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:T(e.fetchConfig)?pn.fromJSON(e.fetchConfig):void 0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>cc.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=pn.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return li.fromPartial(e??{})},fromPartial(e){let t=iP();return t.filters=e.filters?.map(n=>cc.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?pn.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function aP(){return{type:"",handlerId:0,handlerName:""}}var ci={encode(e,t=S.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=aP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=n.string();continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{type:T(e.type)?globalThis.String(e.type):"",handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.type!==""&&(t.type=e.type),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return ci.fromPartial(e??{})},fromPartial(e){let t=aP();return t.type=e.type??"",t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function oP(){return{function:"",typeArguments:[],withTypeArguments:!1,includeFailed:!1,publicKeyPrefix:"",fromAndToAddress:void 0}}var cc={encode(e,t=S.default.Writer.create()){e.function!==""&&t.uint32(10).string(e.function);for(let n of e.typeArguments)t.uint32(18).string(n);return e.withTypeArguments!==!1&&t.uint32(24).bool(e.withTypeArguments),e.includeFailed!==!1&&t.uint32(32).bool(e.includeFailed),e.publicKeyPrefix!==""&&t.uint32(42).string(e.publicKeyPrefix),e.fromAndToAddress!==void 0&&dc.encode(e.fromAndToAddress,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=oP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.function=n.string();continue;case 2:if(a!==18)break;i.typeArguments.push(n.string());continue;case 3:if(a!==24)break;i.withTypeArguments=n.bool();continue;case 4:if(a!==32)break;i.includeFailed=n.bool();continue;case 5:if(a!==42)break;i.publicKeyPrefix=n.string();continue;case 6:if(a!==50)break;i.fromAndToAddress=dc.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{function:T(e.function)?globalThis.String(e.function):"",typeArguments:globalThis.Array.isArray(e?.typeArguments)?e.typeArguments.map(t=>globalThis.String(t)):[],withTypeArguments:T(e.withTypeArguments)?globalThis.Boolean(e.withTypeArguments):!1,includeFailed:T(e.includeFailed)?globalThis.Boolean(e.includeFailed):!1,publicKeyPrefix:T(e.publicKeyPrefix)?globalThis.String(e.publicKeyPrefix):"",fromAndToAddress:T(e.fromAndToAddress)?dc.fromJSON(e.fromAndToAddress):void 0}},toJSON(e){let t={};return e.function!==""&&(t.function=e.function),e.typeArguments?.length&&(t.typeArguments=e.typeArguments),e.withTypeArguments!==!1&&(t.withTypeArguments=e.withTypeArguments),e.includeFailed!==!1&&(t.includeFailed=e.includeFailed),e.publicKeyPrefix!==""&&(t.publicKeyPrefix=e.publicKeyPrefix),e.fromAndToAddress!==void 0&&(t.fromAndToAddress=dc.toJSON(e.fromAndToAddress)),t},create(e){return cc.fromPartial(e??{})},fromPartial(e){let t=oP();return t.function=e.function??"",t.typeArguments=e.typeArguments?.map(n=>n)||[],t.withTypeArguments=e.withTypeArguments??!1,t.includeFailed=e.includeFailed??!1,t.publicKeyPrefix=e.publicKeyPrefix??"",t.fromAndToAddress=e.fromAndToAddress!==void 0&&e.fromAndToAddress!==null?dc.fromPartial(e.fromAndToAddress):void 0,t}};function sP(){return{from:"",to:""}}var dc={encode(e,t=S.default.Writer.create()){return e.from!==""&&t.uint32(10).string(e.from),e.to!==""&&t.uint32(18).string(e.to),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=sP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.from=n.string();continue;case 2:if(a!==18)break;i.to=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{from:T(e.from)?globalThis.String(e.from):"",to:T(e.to)?globalThis.String(e.to):""}},toJSON(e){let t={};return e.from!==""&&(t.from=e.from),e.to!==""&&(t.to=e.to),t},create(e){return dc.fromPartial(e??{})},fromPartial(e){let t=sP();return t.from=e.from??"",t.to=e.to??"",t}};function uP(){return{filters:[],handlerId:0,handlerName:""}}var fc={encode(e,t=S.default.Writer.create()){for(let n of e.filters)gc.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=uP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(gc.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>gc.fromJSON(t)):[],handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>gc.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return fc.fromPartial(e??{})},fromPartial(e){let t=uP();return t.filters=e.filters?.map(n=>gc.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function lP(){return{filters:[],handlerId:0,handlerName:""}}var hc={encode(e,t=S.default.Writer.create()){for(let n of e.filters)di.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=lP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(di.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>di.fromJSON(t)):[],handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>di.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return hc.fromPartial(e??{})},fromPartial(e){let t=lP();return t.filters=e.filters?.map(n=>di.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function cP(){return{inputFilter:void 0,outputFilter:void 0,filter:[]}}var di={encode(e,t=S.default.Writer.create()){e.inputFilter!==void 0&&pc.encode(e.inputFilter,t.uint32(10).fork()).ldelim(),e.outputFilter!==void 0&&mc.encode(e.outputFilter,t.uint32(18).fork()).ldelim();for(let n of e.filter)mn.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=cP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.inputFilter=pc.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.outputFilter=mc.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.filter.push(mn.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{inputFilter:T(e.inputFilter)?pc.fromJSON(e.inputFilter):void 0,outputFilter:T(e.outputFilter)?mc.fromJSON(e.outputFilter):void 0,filter:globalThis.Array.isArray(e?.filter)?e.filter.map(t=>mn.fromJSON(t)):[]}},toJSON(e){let t={};return e.inputFilter!==void 0&&(t.inputFilter=pc.toJSON(e.inputFilter)),e.outputFilter!==void 0&&(t.outputFilter=mc.toJSON(e.outputFilter)),e.filter?.length&&(t.filter=e.filter.map(n=>mn.toJSON(n))),t},create(e){return di.fromPartial(e??{})},fromPartial(e){let t=cP();return t.inputFilter=e.inputFilter!==void 0&&e.inputFilter!==null?pc.fromPartial(e.inputFilter):void 0,t.outputFilter=e.outputFilter!==void 0&&e.outputFilter!==null?mc.fromPartial(e.outputFilter):void 0,t.filter=e.filter?.map(n=>mn.fromPartial(n))||[],t}};function dP(){return{eq:void 0,gt:void 0,gte:void 0,lt:void 0,lte:void 0,ne:void 0,prefix:void 0,contains:void 0,notContains:void 0,lengthEq:void 0,lengthGt:void 0,lengthLt:void 0,hasAny:void 0,hasAll:void 0,in:void 0}}var Ta={encode(e,t=S.default.Writer.create()){return e.eq!==void 0&&ge.encode(e.eq,t.uint32(10).fork()).ldelim(),e.gt!==void 0&&ge.encode(e.gt,t.uint32(18).fork()).ldelim(),e.gte!==void 0&&ge.encode(e.gte,t.uint32(26).fork()).ldelim(),e.lt!==void 0&&ge.encode(e.lt,t.uint32(34).fork()).ldelim(),e.lte!==void 0&&ge.encode(e.lte,t.uint32(42).fork()).ldelim(),e.ne!==void 0&&ge.encode(e.ne,t.uint32(50).fork()).ldelim(),e.prefix!==void 0&&t.uint32(58).string(e.prefix),e.contains!==void 0&&t.uint32(66).string(e.contains),e.notContains!==void 0&&t.uint32(74).string(e.notContains),e.lengthEq!==void 0&&t.uint32(80).int32(e.lengthEq),e.lengthGt!==void 0&&t.uint32(88).int32(e.lengthGt),e.lengthLt!==void 0&&t.uint32(96).int32(e.lengthLt),e.hasAny!==void 0&&Ze.encode(e.hasAny,t.uint32(106).fork()).ldelim(),e.hasAll!==void 0&&Ze.encode(e.hasAll,t.uint32(114).fork()).ldelim(),e.in!==void 0&&Ze.encode(e.in,t.uint32(122).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=dP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.eq=ge.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.gt=ge.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.gte=ge.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.lt=ge.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.lte=ge.decode(n,n.uint32());continue;case 6:if(a!==50)break;i.ne=ge.decode(n,n.uint32());continue;case 7:if(a!==58)break;i.prefix=n.string();continue;case 8:if(a!==66)break;i.contains=n.string();continue;case 9:if(a!==74)break;i.notContains=n.string();continue;case 10:if(a!==80)break;i.lengthEq=n.int32();continue;case 11:if(a!==88)break;i.lengthGt=n.int32();continue;case 12:if(a!==96)break;i.lengthLt=n.int32();continue;case 13:if(a!==106)break;i.hasAny=Ze.decode(n,n.uint32());continue;case 14:if(a!==114)break;i.hasAll=Ze.decode(n,n.uint32());continue;case 15:if(a!==122)break;i.in=Ze.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{eq:T(e.eq)?ge.fromJSON(e.eq):void 0,gt:T(e.gt)?ge.fromJSON(e.gt):void 0,gte:T(e.gte)?ge.fromJSON(e.gte):void 0,lt:T(e.lt)?ge.fromJSON(e.lt):void 0,lte:T(e.lte)?ge.fromJSON(e.lte):void 0,ne:T(e.ne)?ge.fromJSON(e.ne):void 0,prefix:T(e.prefix)?globalThis.String(e.prefix):void 0,contains:T(e.contains)?globalThis.String(e.contains):void 0,notContains:T(e.notContains)?globalThis.String(e.notContains):void 0,lengthEq:T(e.lengthEq)?globalThis.Number(e.lengthEq):void 0,lengthGt:T(e.lengthGt)?globalThis.Number(e.lengthGt):void 0,lengthLt:T(e.lengthLt)?globalThis.Number(e.lengthLt):void 0,hasAny:T(e.hasAny)?Ze.fromJSON(e.hasAny):void 0,hasAll:T(e.hasAll)?Ze.fromJSON(e.hasAll):void 0,in:T(e.in)?Ze.fromJSON(e.in):void 0}},toJSON(e){let t={};return e.eq!==void 0&&(t.eq=ge.toJSON(e.eq)),e.gt!==void 0&&(t.gt=ge.toJSON(e.gt)),e.gte!==void 0&&(t.gte=ge.toJSON(e.gte)),e.lt!==void 0&&(t.lt=ge.toJSON(e.lt)),e.lte!==void 0&&(t.lte=ge.toJSON(e.lte)),e.ne!==void 0&&(t.ne=ge.toJSON(e.ne)),e.prefix!==void 0&&(t.prefix=e.prefix),e.contains!==void 0&&(t.contains=e.contains),e.notContains!==void 0&&(t.notContains=e.notContains),e.lengthEq!==void 0&&(t.lengthEq=Math.round(e.lengthEq)),e.lengthGt!==void 0&&(t.lengthGt=Math.round(e.lengthGt)),e.lengthLt!==void 0&&(t.lengthLt=Math.round(e.lengthLt)),e.hasAny!==void 0&&(t.hasAny=Ze.toJSON(e.hasAny)),e.hasAll!==void 0&&(t.hasAll=Ze.toJSON(e.hasAll)),e.in!==void 0&&(t.in=Ze.toJSON(e.in)),t},create(e){return Ta.fromPartial(e??{})},fromPartial(e){let t=dP();return t.eq=e.eq!==void 0&&e.eq!==null?ge.fromPartial(e.eq):void 0,t.gt=e.gt!==void 0&&e.gt!==null?ge.fromPartial(e.gt):void 0,t.gte=e.gte!==void 0&&e.gte!==null?ge.fromPartial(e.gte):void 0,t.lt=e.lt!==void 0&&e.lt!==null?ge.fromPartial(e.lt):void 0,t.lte=e.lte!==void 0&&e.lte!==null?ge.fromPartial(e.lte):void 0,t.ne=e.ne!==void 0&&e.ne!==null?ge.fromPartial(e.ne):void 0,t.prefix=e.prefix??void 0,t.contains=e.contains??void 0,t.notContains=e.notContains??void 0,t.lengthEq=e.lengthEq??void 0,t.lengthGt=e.lengthGt??void 0,t.lengthLt=e.lengthLt??void 0,t.hasAny=e.hasAny!==void 0&&e.hasAny!==null?Ze.fromPartial(e.hasAny):void 0,t.hasAll=e.hasAll!==void 0&&e.hasAll!==null?Ze.fromPartial(e.hasAll):void 0,t.in=e.in!==void 0&&e.in!==null?Ze.fromPartial(e.in):void 0,t}};function fP(){return{conditions:{}}}var mn={encode(e,t=S.default.Writer.create()){return Object.entries(e.conditions).forEach(([n,r])=>{gE.encode({key:n,value:r},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=fP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;let o=gE.decode(n,n.uint32());o.value!==void 0&&(i.conditions[o.key]=o.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{conditions:we(e.conditions)?Object.entries(e.conditions).reduce((t,[n,r])=>(t[n]=Ta.fromJSON(r),t),{}):{}}},toJSON(e){let t={};if(e.conditions){let n=Object.entries(e.conditions);n.length>0&&(t.conditions={},n.forEach(([r,i])=>{t.conditions[r]=Ta.toJSON(i)}))}return t},create(e){return mn.fromPartial(e??{})},fromPartial(e){let t=fP();return t.conditions=Object.entries(e.conditions??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=Ta.fromPartial(i)),n),{}),t}};function hP(){return{key:"",value:void 0}}var gE={encode(e,t=S.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&Ta.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=hP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=Ta.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:T(e.key)?globalThis.String(e.key):"",value:T(e.value)?Ta.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=Ta.toJSON(e.value)),t},create(e){return gE.fromPartial(e??{})},fromPartial(e){let t=hP();return t.key=e.key??"",t.value=e.value!==void 0&&e.value!==null?Ta.fromPartial(e.value):void 0,t}};function pP(){return{filters:[]}}var fi={encode(e,t=S.default.Writer.create()){for(let n of e.filters)mn.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=pP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(mn.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>mn.fromJSON(t)):[]}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>mn.toJSON(n))),t},create(e){return fi.fromPartial(e??{})},fromPartial(e){let t=pP();return t.filters=e.filters?.map(n=>mn.fromPartial(n))||[],t}};function mP(){return{filters:void 0,preVOut:void 0,preTransaction:void 0}}var pc={encode(e,t=S.default.Writer.create()){return e.filters!==void 0&&fi.encode(e.filters,t.uint32(10).fork()).ldelim(),e.preVOut!==void 0&&mn.encode(e.preVOut,t.uint32(18).fork()).ldelim(),e.preTransaction!==void 0&&di.encode(e.preTransaction,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=mP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters=fi.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.preVOut=mn.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.preTransaction=di.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:T(e.filters)?fi.fromJSON(e.filters):void 0,preVOut:T(e.preVOut)?mn.fromJSON(e.preVOut):void 0,preTransaction:T(e.preTransaction)?di.fromJSON(e.preTransaction):void 0}},toJSON(e){let t={};return e.filters!==void 0&&(t.filters=fi.toJSON(e.filters)),e.preVOut!==void 0&&(t.preVOut=mn.toJSON(e.preVOut)),e.preTransaction!==void 0&&(t.preTransaction=di.toJSON(e.preTransaction)),t},create(e){return pc.fromPartial(e??{})},fromPartial(e){let t=mP();return t.filters=e.filters!==void 0&&e.filters!==null?fi.fromPartial(e.filters):void 0,t.preVOut=e.preVOut!==void 0&&e.preVOut!==null?mn.fromPartial(e.preVOut):void 0,t.preTransaction=e.preTransaction!==void 0&&e.preTransaction!==null?di.fromPartial(e.preTransaction):void 0,t}};function gP(){return{filters:void 0}}var mc={encode(e,t=S.default.Writer.create()){return e.filters!==void 0&&fi.encode(e.filters,t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=gP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters=fi.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:T(e.filters)?fi.fromJSON(e.filters):void 0}},toJSON(e){let t={};return e.filters!==void 0&&(t.filters=fi.toJSON(e.filters)),t},create(e){return mc.fromPartial(e??{})},fromPartial(e){let t=gP();return t.filters=e.filters!==void 0&&e.filters!==null?fi.fromPartial(e.filters):void 0,t}};function yP(){return{address:"",keys:[]}}var gc={encode(e,t=S.default.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(let n of e.keys)t.uint32(18).string(n);return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=yP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=n.string();continue;case 2:if(a!==18)break;i.keys.push(n.string());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{address:T(e.address)?globalThis.String(e.address):"",keys:globalThis.Array.isArray(e?.keys)?e.keys.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.address!==""&&(t.address=e.address),e.keys?.length&&(t.keys=e.keys),t},create(e){return gc.fromPartial(e??{})},fromPartial(e){let t=yP();return t.address=e.address??"",t.keys=e.keys?.map(n=>n)||[],t}};function vP(){return{function:"",includeFailed:!1}}var yc={encode(e,t=S.default.Writer.create()){return e.function!==""&&t.uint32(10).string(e.function),e.includeFailed!==!1&&t.uint32(16).bool(e.includeFailed),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=vP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.function=n.string();continue;case 2:if(a!==16)break;i.includeFailed=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{function:T(e.function)?globalThis.String(e.function):"",includeFailed:T(e.includeFailed)?globalThis.Boolean(e.includeFailed):!1}},toJSON(e){let t={};return e.function!==""&&(t.function=e.function),e.includeFailed!==!1&&(t.includeFailed=e.includeFailed),t},create(e){return yc.fromPartial(e??{})},fromPartial(e){let t=vP();return t.function=e.function??"",t.includeFailed=e.includeFailed??!1,t}};function SP(){return{filters:[],handlerId:0,handlerName:""}}var vc={encode(e,t=S.default.Writer.create()){for(let n of e.filters)yc.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=SP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(yc.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>yc.fromJSON(t)):[],handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>yc.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return vc.fromPartial(e??{})},fromPartial(e){let t=SP();return t.filters=e.filters?.map(n=>yc.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function bP(){return{handlerId:0,handlerName:""}}var Sc={encode(e,t=S.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.handlerName!==""&&t.uint32(18).string(e.handlerName),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=bP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=n.int32();continue;case 2:if(a!==18)break;i.handlerName=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{handlerId:T(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:T(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Sc.fromPartial(e??{})},fromPartial(e){let t=bP();return t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function TP(){return{hashes:[]}}var bc={encode(e,t=S.default.Writer.create()){for(let n of e.hashes)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=TP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.hashes.push(n.string());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{hashes:globalThis.Array.isArray(e?.hashes)?e.hashes.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.hashes?.length&&(t.hashes=e.hashes),t},create(e){return bc.fromPartial(e??{})},fromPartial(e){let t=TP();return t.hashes=e.hashes?.map(n=>n)||[],t}};function EP(){return{bindings:[]}}var kw={encode(e,t=S.default.Writer.create()){for(let n of e.bindings)gn.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=EP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bindings.push(gn.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{bindings:globalThis.Array.isArray(e?.bindings)?e.bindings.map(t=>gn.fromJSON(t)):[]}},toJSON(e){let t={};return e.bindings?.length&&(t.bindings=e.bindings.map(n=>gn.toJSON(n))),t},create(e){return kw.fromPartial(e??{})},fromPartial(e){let t=EP();return t.bindings=e.bindings?.map(n=>gn.fromPartial(n))||[],t}};function CP(){return{result:void 0,configUpdated:!1}}var _w={encode(e,t=S.default.Writer.create()){return e.result!==void 0&&nr.encode(e.result,t.uint32(10).fork()).ldelim(),e.configUpdated!==!1&&t.uint32(32).bool(e.configUpdated),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=CP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.result=nr.decode(n,n.uint32());continue;case 4:if(a!==32)break;i.configUpdated=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{result:T(e.result)?nr.fromJSON(e.result):void 0,configUpdated:T(e.configUpdated)?globalThis.Boolean(e.configUpdated):!1}},toJSON(e){let t={};return e.result!==void 0&&(t.result=nr.toJSON(e.result)),e.configUpdated!==!1&&(t.configUpdated=e.configUpdated),t},create(e){return _w.fromPartial(e??{})},fromPartial(e){let t=CP();return t.result=e.result!==void 0&&e.result!==null?nr.fromPartial(e.result):void 0,t.configUpdated=e.configUpdated??!1,t}};function kP(){return{processId:0,binding:void 0,dbResult:void 0}}var Aw={encode(e,t=S.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.binding!==void 0&&gn.encode(e.binding,t.uint32(18).fork()).ldelim(),e.dbResult!==void 0&&hi.encode(e.dbResult,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=kP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=n.int32();continue;case 2:if(a!==18)break;i.binding=gn.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.dbResult=hi.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{processId:T(e.processId)?globalThis.Number(e.processId):0,binding:T(e.binding)?gn.fromJSON(e.binding):void 0,dbResult:T(e.dbResult)?hi.fromJSON(e.dbResult):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.binding!==void 0&&(t.binding=gn.toJSON(e.binding)),e.dbResult!==void 0&&(t.dbResult=hi.toJSON(e.dbResult)),t},create(e){return Aw.fromPartial(e??{})},fromPartial(e){let t=kP();return t.processId=e.processId??0,t.binding=e.binding!==void 0&&e.binding!==null?gn.fromPartial(e.binding):void 0,t.dbResult=e.dbResult!==void 0&&e.dbResult!==null?hi.fromPartial(e.dbResult):void 0,t}};function _P(){return{processId:0,dbRequest:void 0,result:void 0}}var Nw={encode(e,t=S.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.dbRequest!==void 0&&pi.encode(e.dbRequest,t.uint32(18).fork()).ldelim(),e.result!==void 0&&nr.encode(e.result,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=_P();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=n.int32();continue;case 2:if(a!==18)break;i.dbRequest=pi.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.result=nr.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{processId:T(e.processId)?globalThis.Number(e.processId):0,dbRequest:T(e.dbRequest)?pi.fromJSON(e.dbRequest):void 0,result:T(e.result)?nr.fromJSON(e.result):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.dbRequest!==void 0&&(t.dbRequest=pi.toJSON(e.dbRequest)),e.result!==void 0&&(t.result=nr.toJSON(e.result)),t},create(e){return Nw.fromPartial(e??{})},fromPartial(e){let t=_P();return t.processId=e.processId??0,t.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?pi.fromPartial(e.dbRequest):void 0,t.result=e.result!==void 0&&e.result!==null?nr.fromPartial(e.result):void 0,t}};function AP(){return{processId:0,bindings:void 0,dbResult:void 0}}var Iw={encode(e,t=S.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.bindings!==void 0&&Tc.encode(e.bindings,t.uint32(18).fork()).ldelim(),e.dbResult!==void 0&&hi.encode(e.dbResult,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=AP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=n.int32();continue;case 2:if(a!==18)break;i.bindings=Tc.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.dbResult=hi.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{processId:T(e.processId)?globalThis.Number(e.processId):0,bindings:T(e.bindings)?Tc.fromJSON(e.bindings):void 0,dbResult:T(e.dbResult)?hi.fromJSON(e.dbResult):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.bindings!==void 0&&(t.bindings=Tc.toJSON(e.bindings)),e.dbResult!==void 0&&(t.dbResult=hi.toJSON(e.dbResult)),t},create(e){return Iw.fromPartial(e??{})},fromPartial(e){let t=AP();return t.processId=e.processId??0,t.bindings=e.bindings!==void 0&&e.bindings!==null?Tc.fromPartial(e.bindings):void 0,t.dbResult=e.dbResult!==void 0&&e.dbResult!==null?hi.fromPartial(e.dbResult):void 0,t}};function NP(){return{bindings:[]}}var Tc={encode(e,t=S.default.Writer.create()){for(let n of e.bindings)gn.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=NP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bindings.push(gn.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{bindings:globalThis.Array.isArray(e?.bindings)?e.bindings.map(t=>gn.fromJSON(t)):[]}},toJSON(e){let t={};return e.bindings?.length&&(t.bindings=e.bindings.map(n=>gn.toJSON(n))),t},create(e){return Tc.fromPartial(e??{})},fromPartial(e){let t=NP();return t.bindings=e.bindings?.map(n=>gn.fromPartial(n))||[],t}};function IP(){return{processId:0,dbRequest:void 0}}var Ow={encode(e,t=S.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.dbRequest!==void 0&&pi.encode(e.dbRequest,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=IP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=n.int32();continue;case 2:if(a!==18)break;i.dbRequest=pi.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{processId:T(e.processId)?globalThis.Number(e.processId):0,dbRequest:T(e.dbRequest)?pi.fromJSON(e.dbRequest):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.dbRequest!==void 0&&(t.dbRequest=pi.toJSON(e.dbRequest)),t},create(e){return Ow.fromPartial(e??{})},fromPartial(e){let t=IP();return t.processId=e.processId??0,t.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?pi.fromPartial(e.dbRequest):void 0,t}};function OP(){return{opId:BigInt("0"),data:void 0,list:void 0,error:void 0,entities:void 0,entityList:void 0,nextCursor:void 0}}var hi={encode(e,t=S.default.Writer.create()){if(e.opId!==BigInt("0")){if(BigInt.asUintN(64,e.opId)!==e.opId)throw new globalThis.Error("value provided for field message.opId of type uint64 too large");t.uint32(8).uint64(e.opId.toString())}return e.data!==void 0&&P.encode(P.wrap(e.data),t.uint32(18).fork()).ldelim(),e.list!==void 0&&Fi.encode(Fi.wrap(e.list),t.uint32(34).fork()).ldelim(),e.error!==void 0&&t.uint32(26).string(e.error),e.entities!==void 0&&ws.encode(e.entities,t.uint32(50).fork()).ldelim(),e.entityList!==void 0&&Cc.encode(e.entityList,t.uint32(58).fork()).ldelim(),e.nextCursor!==void 0&&t.uint32(42).string(e.nextCursor),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=OP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.opId=Jt(n.uint64());continue;case 2:if(a!==18)break;i.data=P.unwrap(P.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.list=Fi.unwrap(Fi.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.error=n.string();continue;case 6:if(a!==50)break;i.entities=ws.decode(n,n.uint32());continue;case 7:if(a!==58)break;i.entityList=Cc.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.nextCursor=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{opId:T(e.opId)?BigInt(e.opId):BigInt("0"),data:we(e.data)?e.data:void 0,list:globalThis.Array.isArray(e.list)?[...e.list]:void 0,error:T(e.error)?globalThis.String(e.error):void 0,entities:T(e.entities)?ws.fromJSON(e.entities):void 0,entityList:T(e.entityList)?Cc.fromJSON(e.entityList):void 0,nextCursor:T(e.nextCursor)?globalThis.String(e.nextCursor):void 0}},toJSON(e){let t={};return e.opId!==BigInt("0")&&(t.opId=e.opId.toString()),e.data!==void 0&&(t.data=e.data),e.list!==void 0&&(t.list=e.list),e.error!==void 0&&(t.error=e.error),e.entities!==void 0&&(t.entities=ws.toJSON(e.entities)),e.entityList!==void 0&&(t.entityList=Cc.toJSON(e.entityList)),e.nextCursor!==void 0&&(t.nextCursor=e.nextCursor),t},create(e){return hi.fromPartial(e??{})},fromPartial(e){let t=OP();return t.opId=e.opId??BigInt("0"),t.data=e.data??void 0,t.list=e.list??void 0,t.error=e.error??void 0,t.entities=e.entities!==void 0&&e.entities!==null?ws.fromPartial(e.entities):void 0,t.entityList=e.entityList!==void 0&&e.entityList!==null?Cc.fromPartial(e.entityList):void 0,t.nextCursor=e.nextCursor??void 0,t}};function RP(){return{entity:"",genBlockNumber:BigInt("0"),genBlockChain:"",genBlockTime:void 0,data:void 0}}var Ec={encode(e,t=S.default.Writer.create()){if(e.entity!==""&&t.uint32(10).string(e.entity),e.genBlockNumber!==BigInt("0")){if(BigInt.asUintN(64,e.genBlockNumber)!==e.genBlockNumber)throw new globalThis.Error("value provided for field message.genBlockNumber of type uint64 too large");t.uint32(16).uint64(e.genBlockNumber.toString())}return e.genBlockChain!==""&&t.uint32(26).string(e.genBlockChain),e.genBlockTime!==void 0&&Se.encode(yn(e.genBlockTime),t.uint32(34).fork()).ldelim(),e.data!==void 0&&Ke.encode(e.data,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=RP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=n.string();continue;case 2:if(a!==16)break;i.genBlockNumber=Jt(n.uint64());continue;case 3:if(a!==26)break;i.genBlockChain=n.string();continue;case 4:if(a!==34)break;i.genBlockTime=Zt(Se.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.data=Ke.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entity:T(e.entity)?globalThis.String(e.entity):"",genBlockNumber:T(e.genBlockNumber)?BigInt(e.genBlockNumber):BigInt("0"),genBlockChain:T(e.genBlockChain)?globalThis.String(e.genBlockChain):"",genBlockTime:T(e.genBlockTime)?vn(e.genBlockTime):void 0,data:T(e.data)?Ke.fromJSON(e.data):void 0}},toJSON(e){let t={};return e.entity!==""&&(t.entity=e.entity),e.genBlockNumber!==BigInt("0")&&(t.genBlockNumber=e.genBlockNumber.toString()),e.genBlockChain!==""&&(t.genBlockChain=e.genBlockChain),e.genBlockTime!==void 0&&(t.genBlockTime=e.genBlockTime.toISOString()),e.data!==void 0&&(t.data=Ke.toJSON(e.data)),t},create(e){return Ec.fromPartial(e??{})},fromPartial(e){let t=RP();return t.entity=e.entity??"",t.genBlockNumber=e.genBlockNumber??BigInt("0"),t.genBlockChain=e.genBlockChain??"",t.genBlockTime=e.genBlockTime??void 0,t.data=e.data!==void 0&&e.data!==null?Ke.fromPartial(e.data):void 0,t}};function PP(){return{entities:[]}}var Cc={encode(e,t=S.default.Writer.create()){for(let n of e.entities)Ec.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=PP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entities.push(Ec.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entities:globalThis.Array.isArray(e?.entities)?e.entities.map(t=>Ec.fromJSON(t)):[]}},toJSON(e){let t={};return e.entities?.length&&(t.entities=e.entities.map(n=>Ec.toJSON(n))),t},create(e){return Cc.fromPartial(e??{})},fromPartial(e){let t=PP();return t.entities=e.entities?.map(n=>Ec.fromPartial(n))||[],t}};function wP(){return{opId:BigInt("0"),get:void 0,upsert:void 0,delete:void 0,list:void 0}}var pi={encode(e,t=S.default.Writer.create()){if(e.opId!==BigInt("0")){if(BigInt.asUintN(64,e.opId)!==e.opId)throw new globalThis.Error("value provided for field message.opId of type uint64 too large");t.uint32(8).uint64(e.opId.toString())}return e.get!==void 0&&kc.encode(e.get,t.uint32(18).fork()).ldelim(),e.upsert!==void 0&&Ac.encode(e.upsert,t.uint32(26).fork()).ldelim(),e.delete!==void 0&&Nc.encode(e.delete,t.uint32(34).fork()).ldelim(),e.list!==void 0&&_c.encode(e.list,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=wP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.opId=Jt(n.uint64());continue;case 2:if(a!==18)break;i.get=kc.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.upsert=Ac.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.delete=Nc.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.list=_c.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{opId:T(e.opId)?BigInt(e.opId):BigInt("0"),get:T(e.get)?kc.fromJSON(e.get):void 0,upsert:T(e.upsert)?Ac.fromJSON(e.upsert):void 0,delete:T(e.delete)?Nc.fromJSON(e.delete):void 0,list:T(e.list)?_c.fromJSON(e.list):void 0}},toJSON(e){let t={};return e.opId!==BigInt("0")&&(t.opId=e.opId.toString()),e.get!==void 0&&(t.get=kc.toJSON(e.get)),e.upsert!==void 0&&(t.upsert=Ac.toJSON(e.upsert)),e.delete!==void 0&&(t.delete=Nc.toJSON(e.delete)),e.list!==void 0&&(t.list=_c.toJSON(e.list)),t},create(e){return pi.fromPartial(e??{})},fromPartial(e){let t=wP();return t.opId=e.opId??BigInt("0"),t.get=e.get!==void 0&&e.get!==null?kc.fromPartial(e.get):void 0,t.upsert=e.upsert!==void 0&&e.upsert!==null?Ac.fromPartial(e.upsert):void 0,t.delete=e.delete!==void 0&&e.delete!==null?Nc.fromPartial(e.delete):void 0,t.list=e.list!==void 0&&e.list!==null?_c.fromPartial(e.list):void 0,t}};function xP(){return{entity:"",id:""}}var kc={encode(e,t=S.default.Writer.create()){return e.entity!==""&&t.uint32(10).string(e.entity),e.id!==""&&t.uint32(18).string(e.id),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=xP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=n.string();continue;case 2:if(a!==18)break;i.id=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entity:T(e.entity)?globalThis.String(e.entity):"",id:T(e.id)?globalThis.String(e.id):""}},toJSON(e){let t={};return e.entity!==""&&(t.entity=e.entity),e.id!==""&&(t.id=e.id),t},create(e){return kc.fromPartial(e??{})},fromPartial(e){let t=xP();return t.entity=e.entity??"",t.id=e.id??"",t}};function BP(){return{entity:"",filters:[],cursor:"",pageSize:void 0}}var _c={encode(e,t=S.default.Writer.create()){e.entity!==""&&t.uint32(10).string(e.entity);for(let n of e.filters)Ic.encode(n,t.uint32(34).fork()).ldelim();return e.cursor!==""&&t.uint32(42).string(e.cursor),e.pageSize!==void 0&&t.uint32(48).uint32(e.pageSize),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=BP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=n.string();continue;case 4:if(a!==34)break;i.filters.push(Ic.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.cursor=n.string();continue;case 6:if(a!==48)break;i.pageSize=n.uint32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entity:T(e.entity)?globalThis.String(e.entity):"",filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>Ic.fromJSON(t)):[],cursor:T(e.cursor)?globalThis.String(e.cursor):"",pageSize:T(e.pageSize)?globalThis.Number(e.pageSize):void 0}},toJSON(e){let t={};return e.entity!==""&&(t.entity=e.entity),e.filters?.length&&(t.filters=e.filters.map(n=>Ic.toJSON(n))),e.cursor!==""&&(t.cursor=e.cursor),e.pageSize!==void 0&&(t.pageSize=Math.round(e.pageSize)),t},create(e){return _c.fromPartial(e??{})},fromPartial(e){let t=BP();return t.entity=e.entity??"",t.filters=e.filters?.map(n=>Ic.fromPartial(n))||[],t.cursor=e.cursor??"",t.pageSize=e.pageSize??void 0,t}};function DP(){return{entity:[],id:[],data:[],entityData:[]}}var Ac={encode(e,t=S.default.Writer.create()){for(let n of e.entity)t.uint32(10).string(n);for(let n of e.id)t.uint32(18).string(n);for(let n of e.data)P.encode(P.wrap(n),t.uint32(26).fork()).ldelim();for(let n of e.entityData)Ke.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=DP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity.push(n.string());continue;case 2:if(a!==18)break;i.id.push(n.string());continue;case 3:if(a!==26)break;i.data.push(P.unwrap(P.decode(n,n.uint32())));continue;case 4:if(a!==34)break;i.entityData.push(Ke.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entity:globalThis.Array.isArray(e?.entity)?e.entity.map(t=>globalThis.String(t)):[],id:globalThis.Array.isArray(e?.id)?e.id.map(t=>globalThis.String(t)):[],data:globalThis.Array.isArray(e?.data)?[...e.data]:[],entityData:globalThis.Array.isArray(e?.entityData)?e.entityData.map(t=>Ke.fromJSON(t)):[]}},toJSON(e){let t={};return e.entity?.length&&(t.entity=e.entity),e.id?.length&&(t.id=e.id),e.data?.length&&(t.data=e.data),e.entityData?.length&&(t.entityData=e.entityData.map(n=>Ke.toJSON(n))),t},create(e){return Ac.fromPartial(e??{})},fromPartial(e){let t=DP();return t.entity=e.entity?.map(n=>n)||[],t.id=e.id?.map(n=>n)||[],t.data=e.data?.map(n=>n)||[],t.entityData=e.entityData?.map(n=>Ke.fromPartial(n))||[],t}};function MP(){return{entity:[],id:[]}}var Nc={encode(e,t=S.default.Writer.create()){for(let n of e.entity)t.uint32(10).string(n);for(let n of e.id)t.uint32(18).string(n);return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=MP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity.push(n.string());continue;case 2:if(a!==18)break;i.id.push(n.string());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entity:globalThis.Array.isArray(e?.entity)?e.entity.map(t=>globalThis.String(t)):[],id:globalThis.Array.isArray(e?.id)?e.id.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.entity?.length&&(t.entity=e.entity),e.id?.length&&(t.id=e.id),t},create(e){return Nc.fromPartial(e??{})},fromPartial(e){let t=MP();return t.entity=e.entity?.map(n=>n)||[],t.id=e.id?.map(n=>n)||[],t}};function LP(){return{field:"",op:0,value:void 0}}var Ic={encode(e,t=S.default.Writer.create()){return e.field!==""&&t.uint32(10).string(e.field),e.op!==0&&t.uint32(16).int32(e.op),e.value!==void 0&&Ze.encode(e.value,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=LP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.field=n.string();continue;case 2:if(a!==16)break;i.op=n.int32();continue;case 3:if(a!==26)break;i.value=Ze.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{field:T(e.field)?globalThis.String(e.field):"",op:T(e.op)?D5(e.op):0,value:T(e.value)?Ze.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.field!==""&&(t.field=e.field),e.op!==0&&(t.op=M5(e.op)),e.value!==void 0&&(t.value=Ze.toJSON(e.value)),t},create(e){return Ic.fromPartial(e??{})},fromPartial(e){let t=LP();return t.field=e.field??"",t.op=e.op??0,t.value=e.value!==void 0&&e.value!==null?Ze.fromPartial(e.value):void 0,t}};function FP(){return{ethLog:void 0,ethBlock:void 0,ethTransaction:void 0,ethTrace:void 0,solInstruction:void 0,aptEvent:void 0,aptCall:void 0,aptResource:void 0,suiEvent:void 0,suiCall:void 0,suiObject:void 0,suiObjectChange:void 0,fuelLog:void 0,fuelCall:void 0,fuelTransaction:void 0,fuelBlock:void 0,cosmosCall:void 0,starknetEvents:void 0,btcTransaction:void 0,btcBlock:void 0}}var Oc={encode(e,t=S.default.Writer.create()){return e.ethLog!==void 0&&Rc.encode(e.ethLog,t.uint32(18).fork()).ldelim(),e.ethBlock!==void 0&&Pc.encode(e.ethBlock,t.uint32(26).fork()).ldelim(),e.ethTransaction!==void 0&&wc.encode(e.ethTransaction,t.uint32(34).fork()).ldelim(),e.ethTrace!==void 0&&xc.encode(e.ethTrace,t.uint32(42).fork()).ldelim(),e.solInstruction!==void 0&&Bc.encode(e.solInstruction,t.uint32(50).fork()).ldelim(),e.aptEvent!==void 0&&Dc.encode(e.aptEvent,t.uint32(58).fork()).ldelim(),e.aptCall!==void 0&&Mc.encode(e.aptCall,t.uint32(66).fork()).ldelim(),e.aptResource!==void 0&&Lc.encode(e.aptResource,t.uint32(74).fork()).ldelim(),e.suiEvent!==void 0&&Fc.encode(e.suiEvent,t.uint32(82).fork()).ldelim(),e.suiCall!==void 0&&Uc.encode(e.suiCall,t.uint32(90).fork()).ldelim(),e.suiObject!==void 0&&qc.encode(e.suiObject,t.uint32(98).fork()).ldelim(),e.suiObjectChange!==void 0&&Vc.encode(e.suiObjectChange,t.uint32(106).fork()).ldelim(),e.fuelLog!==void 0&&Jc.encode(e.fuelLog,t.uint32(162).fork()).ldelim(),e.fuelCall!==void 0&&Hc.encode(e.fuelCall,t.uint32(114).fork()).ldelim(),e.fuelTransaction!==void 0&&Wc.encode(e.fuelTransaction,t.uint32(170).fork()).ldelim(),e.fuelBlock!==void 0&&Gc.encode(e.fuelBlock,t.uint32(146).fork()).ldelim(),e.cosmosCall!==void 0&&zc.encode(e.cosmosCall,t.uint32(122).fork()).ldelim(),e.starknetEvents!==void 0&&Qc.encode(e.starknetEvents,t.uint32(130).fork()).ldelim(),e.btcTransaction!==void 0&&Kc.encode(e.btcTransaction,t.uint32(138).fork()).ldelim(),e.btcBlock!==void 0&&Zc.encode(e.btcBlock,t.uint32(154).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=FP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.ethLog=Rc.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.ethBlock=Pc.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.ethTransaction=wc.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.ethTrace=xc.decode(n,n.uint32());continue;case 6:if(a!==50)break;i.solInstruction=Bc.decode(n,n.uint32());continue;case 7:if(a!==58)break;i.aptEvent=Dc.decode(n,n.uint32());continue;case 8:if(a!==66)break;i.aptCall=Mc.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.aptResource=Lc.decode(n,n.uint32());continue;case 10:if(a!==82)break;i.suiEvent=Fc.decode(n,n.uint32());continue;case 11:if(a!==90)break;i.suiCall=Uc.decode(n,n.uint32());continue;case 12:if(a!==98)break;i.suiObject=qc.decode(n,n.uint32());continue;case 13:if(a!==106)break;i.suiObjectChange=Vc.decode(n,n.uint32());continue;case 20:if(a!==162)break;i.fuelLog=Jc.decode(n,n.uint32());continue;case 14:if(a!==114)break;i.fuelCall=Hc.decode(n,n.uint32());continue;case 21:if(a!==170)break;i.fuelTransaction=Wc.decode(n,n.uint32());continue;case 18:if(a!==146)break;i.fuelBlock=Gc.decode(n,n.uint32());continue;case 15:if(a!==122)break;i.cosmosCall=zc.decode(n,n.uint32());continue;case 16:if(a!==130)break;i.starknetEvents=Qc.decode(n,n.uint32());continue;case 17:if(a!==138)break;i.btcTransaction=Kc.decode(n,n.uint32());continue;case 19:if(a!==154)break;i.btcBlock=Zc.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{ethLog:T(e.ethLog)?Rc.fromJSON(e.ethLog):void 0,ethBlock:T(e.ethBlock)?Pc.fromJSON(e.ethBlock):void 0,ethTransaction:T(e.ethTransaction)?wc.fromJSON(e.ethTransaction):void 0,ethTrace:T(e.ethTrace)?xc.fromJSON(e.ethTrace):void 0,solInstruction:T(e.solInstruction)?Bc.fromJSON(e.solInstruction):void 0,aptEvent:T(e.aptEvent)?Dc.fromJSON(e.aptEvent):void 0,aptCall:T(e.aptCall)?Mc.fromJSON(e.aptCall):void 0,aptResource:T(e.aptResource)?Lc.fromJSON(e.aptResource):void 0,suiEvent:T(e.suiEvent)?Fc.fromJSON(e.suiEvent):void 0,suiCall:T(e.suiCall)?Uc.fromJSON(e.suiCall):void 0,suiObject:T(e.suiObject)?qc.fromJSON(e.suiObject):void 0,suiObjectChange:T(e.suiObjectChange)?Vc.fromJSON(e.suiObjectChange):void 0,fuelLog:T(e.fuelLog)?Jc.fromJSON(e.fuelLog):void 0,fuelCall:T(e.fuelCall)?Hc.fromJSON(e.fuelCall):void 0,fuelTransaction:T(e.fuelTransaction)?Wc.fromJSON(e.fuelTransaction):void 0,fuelBlock:T(e.fuelBlock)?Gc.fromJSON(e.fuelBlock):void 0,cosmosCall:T(e.cosmosCall)?zc.fromJSON(e.cosmosCall):void 0,starknetEvents:T(e.starknetEvents)?Qc.fromJSON(e.starknetEvents):void 0,btcTransaction:T(e.btcTransaction)?Kc.fromJSON(e.btcTransaction):void 0,btcBlock:T(e.btcBlock)?Zc.fromJSON(e.btcBlock):void 0}},toJSON(e){let t={};return e.ethLog!==void 0&&(t.ethLog=Rc.toJSON(e.ethLog)),e.ethBlock!==void 0&&(t.ethBlock=Pc.toJSON(e.ethBlock)),e.ethTransaction!==void 0&&(t.ethTransaction=wc.toJSON(e.ethTransaction)),e.ethTrace!==void 0&&(t.ethTrace=xc.toJSON(e.ethTrace)),e.solInstruction!==void 0&&(t.solInstruction=Bc.toJSON(e.solInstruction)),e.aptEvent!==void 0&&(t.aptEvent=Dc.toJSON(e.aptEvent)),e.aptCall!==void 0&&(t.aptCall=Mc.toJSON(e.aptCall)),e.aptResource!==void 0&&(t.aptResource=Lc.toJSON(e.aptResource)),e.suiEvent!==void 0&&(t.suiEvent=Fc.toJSON(e.suiEvent)),e.suiCall!==void 0&&(t.suiCall=Uc.toJSON(e.suiCall)),e.suiObject!==void 0&&(t.suiObject=qc.toJSON(e.suiObject)),e.suiObjectChange!==void 0&&(t.suiObjectChange=Vc.toJSON(e.suiObjectChange)),e.fuelLog!==void 0&&(t.fuelLog=Jc.toJSON(e.fuelLog)),e.fuelCall!==void 0&&(t.fuelCall=Hc.toJSON(e.fuelCall)),e.fuelTransaction!==void 0&&(t.fuelTransaction=Wc.toJSON(e.fuelTransaction)),e.fuelBlock!==void 0&&(t.fuelBlock=Gc.toJSON(e.fuelBlock)),e.cosmosCall!==void 0&&(t.cosmosCall=zc.toJSON(e.cosmosCall)),e.starknetEvents!==void 0&&(t.starknetEvents=Qc.toJSON(e.starknetEvents)),e.btcTransaction!==void 0&&(t.btcTransaction=Kc.toJSON(e.btcTransaction)),e.btcBlock!==void 0&&(t.btcBlock=Zc.toJSON(e.btcBlock)),t},create(e){return Oc.fromPartial(e??{})},fromPartial(e){let t=FP();return t.ethLog=e.ethLog!==void 0&&e.ethLog!==null?Rc.fromPartial(e.ethLog):void 0,t.ethBlock=e.ethBlock!==void 0&&e.ethBlock!==null?Pc.fromPartial(e.ethBlock):void 0,t.ethTransaction=e.ethTransaction!==void 0&&e.ethTransaction!==null?wc.fromPartial(e.ethTransaction):void 0,t.ethTrace=e.ethTrace!==void 0&&e.ethTrace!==null?xc.fromPartial(e.ethTrace):void 0,t.solInstruction=e.solInstruction!==void 0&&e.solInstruction!==null?Bc.fromPartial(e.solInstruction):void 0,t.aptEvent=e.aptEvent!==void 0&&e.aptEvent!==null?Dc.fromPartial(e.aptEvent):void 0,t.aptCall=e.aptCall!==void 0&&e.aptCall!==null?Mc.fromPartial(e.aptCall):void 0,t.aptResource=e.aptResource!==void 0&&e.aptResource!==null?Lc.fromPartial(e.aptResource):void 0,t.suiEvent=e.suiEvent!==void 0&&e.suiEvent!==null?Fc.fromPartial(e.suiEvent):void 0,t.suiCall=e.suiCall!==void 0&&e.suiCall!==null?Uc.fromPartial(e.suiCall):void 0,t.suiObject=e.suiObject!==void 0&&e.suiObject!==null?qc.fromPartial(e.suiObject):void 0,t.suiObjectChange=e.suiObjectChange!==void 0&&e.suiObjectChange!==null?Vc.fromPartial(e.suiObjectChange):void 0,t.fuelLog=e.fuelLog!==void 0&&e.fuelLog!==null?Jc.fromPartial(e.fuelLog):void 0,t.fuelCall=e.fuelCall!==void 0&&e.fuelCall!==null?Hc.fromPartial(e.fuelCall):void 0,t.fuelTransaction=e.fuelTransaction!==void 0&&e.fuelTransaction!==null?Wc.fromPartial(e.fuelTransaction):void 0,t.fuelBlock=e.fuelBlock!==void 0&&e.fuelBlock!==null?Gc.fromPartial(e.fuelBlock):void 0,t.cosmosCall=e.cosmosCall!==void 0&&e.cosmosCall!==null?zc.fromPartial(e.cosmosCall):void 0,t.starknetEvents=e.starknetEvents!==void 0&&e.starknetEvents!==null?Qc.fromPartial(e.starknetEvents):void 0,t.btcTransaction=e.btcTransaction!==void 0&&e.btcTransaction!==null?Kc.fromPartial(e.btcTransaction):void 0,t.btcBlock=e.btcBlock!==void 0&&e.btcBlock!==null?Zc.fromPartial(e.btcBlock):void 0,t}};function UP(){return{log:void 0,timestamp:void 0,transaction:void 0,transactionReceipt:void 0,block:void 0,rawLog:"",rawTransaction:void 0,rawTransactionReceipt:void 0,rawBlock:void 0}}var Rc={encode(e,t=S.default.Writer.create()){return e.log!==void 0&&P.encode(P.wrap(e.log),t.uint32(26).fork()).ldelim(),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(34).fork()).ldelim(),e.transaction!==void 0&&P.encode(P.wrap(e.transaction),t.uint32(18).fork()).ldelim(),e.transactionReceipt!==void 0&&P.encode(P.wrap(e.transactionReceipt),t.uint32(42).fork()).ldelim(),e.block!==void 0&&P.encode(P.wrap(e.block),t.uint32(50).fork()).ldelim(),e.rawLog!==""&&t.uint32(58).string(e.rawLog),e.rawTransaction!==void 0&&t.uint32(66).string(e.rawTransaction),e.rawTransactionReceipt!==void 0&&t.uint32(74).string(e.rawTransactionReceipt),e.rawBlock!==void 0&&t.uint32(82).string(e.rawBlock),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=UP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 3:if(a!==26)break;i.log=P.unwrap(P.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.transaction=P.unwrap(P.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.transactionReceipt=P.unwrap(P.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.block=P.unwrap(P.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.rawLog=n.string();continue;case 8:if(a!==66)break;i.rawTransaction=n.string();continue;case 9:if(a!==74)break;i.rawTransactionReceipt=n.string();continue;case 10:if(a!==82)break;i.rawBlock=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{log:we(e.log)?e.log:void 0,timestamp:T(e.timestamp)?vn(e.timestamp):void 0,transaction:we(e.transaction)?e.transaction:void 0,transactionReceipt:we(e.transactionReceipt)?e.transactionReceipt:void 0,block:we(e.block)?e.block:void 0,rawLog:T(e.rawLog)?globalThis.String(e.rawLog):"",rawTransaction:T(e.rawTransaction)?globalThis.String(e.rawTransaction):void 0,rawTransactionReceipt:T(e.rawTransactionReceipt)?globalThis.String(e.rawTransactionReceipt):void 0,rawBlock:T(e.rawBlock)?globalThis.String(e.rawBlock):void 0}},toJSON(e){let t={};return e.log!==void 0&&(t.log=e.log),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.transaction!==void 0&&(t.transaction=e.transaction),e.transactionReceipt!==void 0&&(t.transactionReceipt=e.transactionReceipt),e.block!==void 0&&(t.block=e.block),e.rawLog!==""&&(t.rawLog=e.rawLog),e.rawTransaction!==void 0&&(t.rawTransaction=e.rawTransaction),e.rawTransactionReceipt!==void 0&&(t.rawTransactionReceipt=e.rawTransactionReceipt),e.rawBlock!==void 0&&(t.rawBlock=e.rawBlock),t},create(e){return Rc.fromPartial(e??{})},fromPartial(e){let t=UP();return t.log=e.log??void 0,t.timestamp=e.timestamp??void 0,t.transaction=e.transaction??void 0,t.transactionReceipt=e.transactionReceipt??void 0,t.block=e.block??void 0,t.rawLog=e.rawLog??"",t.rawTransaction=e.rawTransaction??void 0,t.rawTransactionReceipt=e.rawTransactionReceipt??void 0,t.rawBlock=e.rawBlock??void 0,t}};function qP(){return{block:void 0}}var Pc={encode(e,t=S.default.Writer.create()){return e.block!==void 0&&P.encode(P.wrap(e.block),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=qP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.block=P.unwrap(P.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{block:we(e.block)?e.block:void 0}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),t},create(e){return Pc.fromPartial(e??{})},fromPartial(e){let t=qP();return t.block=e.block??void 0,t}};function VP(){return{transaction:void 0,timestamp:void 0,transactionReceipt:void 0,block:void 0,trace:void 0,rawTransaction:"",rawTransactionReceipt:void 0,rawBlock:void 0,rawTrace:void 0}}var wc={encode(e,t=S.default.Writer.create()){return e.transaction!==void 0&&P.encode(P.wrap(e.transaction),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(42).fork()).ldelim(),e.transactionReceipt!==void 0&&P.encode(P.wrap(e.transactionReceipt),t.uint32(26).fork()).ldelim(),e.block!==void 0&&P.encode(P.wrap(e.block),t.uint32(50).fork()).ldelim(),e.trace!==void 0&&P.encode(P.wrap(e.trace),t.uint32(58).fork()).ldelim(),e.rawTransaction!==""&&t.uint32(66).string(e.rawTransaction),e.rawTransactionReceipt!==void 0&&t.uint32(74).string(e.rawTransactionReceipt),e.rawBlock!==void 0&&t.uint32(82).string(e.rawBlock),e.rawTrace!==void 0&&t.uint32(90).string(e.rawTrace),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=VP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 4:if(a!==34)break;i.transaction=P.unwrap(P.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.transactionReceipt=P.unwrap(P.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.block=P.unwrap(P.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.trace=P.unwrap(P.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.rawTransaction=n.string();continue;case 9:if(a!==74)break;i.rawTransactionReceipt=n.string();continue;case 10:if(a!==82)break;i.rawBlock=n.string();continue;case 11:if(a!==90)break;i.rawTrace=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:we(e.transaction)?e.transaction:void 0,timestamp:T(e.timestamp)?vn(e.timestamp):void 0,transactionReceipt:we(e.transactionReceipt)?e.transactionReceipt:void 0,block:we(e.block)?e.block:void 0,trace:we(e.trace)?e.trace:void 0,rawTransaction:T(e.rawTransaction)?globalThis.String(e.rawTransaction):"",rawTransactionReceipt:T(e.rawTransactionReceipt)?globalThis.String(e.rawTransactionReceipt):void 0,rawBlock:T(e.rawBlock)?globalThis.String(e.rawBlock):void 0,rawTrace:T(e.rawTrace)?globalThis.String(e.rawTrace):void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.transactionReceipt!==void 0&&(t.transactionReceipt=e.transactionReceipt),e.block!==void 0&&(t.block=e.block),e.trace!==void 0&&(t.trace=e.trace),e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),e.rawTransactionReceipt!==void 0&&(t.rawTransactionReceipt=e.rawTransactionReceipt),e.rawBlock!==void 0&&(t.rawBlock=e.rawBlock),e.rawTrace!==void 0&&(t.rawTrace=e.rawTrace),t},create(e){return wc.fromPartial(e??{})},fromPartial(e){let t=VP();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t.transactionReceipt=e.transactionReceipt??void 0,t.block=e.block??void 0,t.trace=e.trace??void 0,t.rawTransaction=e.rawTransaction??"",t.rawTransactionReceipt=e.rawTransactionReceipt??void 0,t.rawBlock=e.rawBlock??void 0,t.rawTrace=e.rawTrace??void 0,t}};function JP(){return{trace:void 0,timestamp:void 0,transaction:void 0,transactionReceipt:void 0,block:void 0}}var xc={encode(e,t=S.default.Writer.create()){return e.trace!==void 0&&P.encode(P.wrap(e.trace),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(42).fork()).ldelim(),e.transaction!==void 0&&P.encode(P.wrap(e.transaction),t.uint32(18).fork()).ldelim(),e.transactionReceipt!==void 0&&P.encode(P.wrap(e.transactionReceipt),t.uint32(26).fork()).ldelim(),e.block!==void 0&&P.encode(P.wrap(e.block),t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=JP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 4:if(a!==34)break;i.trace=P.unwrap(P.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.transaction=P.unwrap(P.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.transactionReceipt=P.unwrap(P.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.block=P.unwrap(P.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{trace:we(e.trace)?e.trace:void 0,timestamp:T(e.timestamp)?vn(e.timestamp):void 0,transaction:we(e.transaction)?e.transaction:void 0,transactionReceipt:we(e.transactionReceipt)?e.transactionReceipt:void 0,block:we(e.block)?e.block:void 0}},toJSON(e){let t={};return e.trace!==void 0&&(t.trace=e.trace),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.transaction!==void 0&&(t.transaction=e.transaction),e.transactionReceipt!==void 0&&(t.transactionReceipt=e.transactionReceipt),e.block!==void 0&&(t.block=e.block),t},create(e){return xc.fromPartial(e??{})},fromPartial(e){let t=JP();return t.trace=e.trace??void 0,t.timestamp=e.timestamp??void 0,t.transaction=e.transaction??void 0,t.transactionReceipt=e.transactionReceipt??void 0,t.block=e.block??void 0,t}};function WP(){return{instructionData:"",slot:BigInt("0"),programAccountId:"",accounts:[],parsed:void 0}}var Bc={encode(e,t=S.default.Writer.create()){if(e.instructionData!==""&&t.uint32(10).string(e.instructionData),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(16).uint64(e.slot.toString())}e.programAccountId!==""&&t.uint32(26).string(e.programAccountId);for(let n of e.accounts)t.uint32(42).string(n);return e.parsed!==void 0&&P.encode(P.wrap(e.parsed),t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=WP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.instructionData=n.string();continue;case 2:if(a!==16)break;i.slot=Jt(n.uint64());continue;case 3:if(a!==26)break;i.programAccountId=n.string();continue;case 5:if(a!==42)break;i.accounts.push(n.string());continue;case 4:if(a!==34)break;i.parsed=P.unwrap(P.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{instructionData:T(e.instructionData)?globalThis.String(e.instructionData):"",slot:T(e.slot)?BigInt(e.slot):BigInt("0"),programAccountId:T(e.programAccountId)?globalThis.String(e.programAccountId):"",accounts:globalThis.Array.isArray(e?.accounts)?e.accounts.map(t=>globalThis.String(t)):[],parsed:we(e.parsed)?e.parsed:void 0}},toJSON(e){let t={};return e.instructionData!==""&&(t.instructionData=e.instructionData),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),e.programAccountId!==""&&(t.programAccountId=e.programAccountId),e.accounts?.length&&(t.accounts=e.accounts),e.parsed!==void 0&&(t.parsed=e.parsed),t},create(e){return Bc.fromPartial(e??{})},fromPartial(e){let t=WP();return t.instructionData=e.instructionData??"",t.slot=e.slot??BigInt("0"),t.programAccountId=e.programAccountId??"",t.accounts=e.accounts?.map(n=>n)||[],t.parsed=e.parsed??void 0,t}};function HP(){return{rawEvent:"",eventIndex:0,transaction:void 0,rawTransaction:""}}var Dc={encode(e,t=S.default.Writer.create()){return e.rawEvent!==""&&t.uint32(10).string(e.rawEvent),e.eventIndex!==0&&t.uint32(32).int32(e.eventIndex),e.transaction!==void 0&&P.encode(P.wrap(e.transaction),t.uint32(18).fork()).ldelim(),e.rawTransaction!==""&&t.uint32(26).string(e.rawTransaction),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=HP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.rawEvent=n.string();continue;case 4:if(a!==32)break;i.eventIndex=n.int32();continue;case 2:if(a!==18)break;i.transaction=P.unwrap(P.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.rawTransaction=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{rawEvent:T(e.rawEvent)?globalThis.String(e.rawEvent):"",eventIndex:T(e.eventIndex)?globalThis.Number(e.eventIndex):0,transaction:we(e.transaction)?e.transaction:void 0,rawTransaction:T(e.rawTransaction)?globalThis.String(e.rawTransaction):""}},toJSON(e){let t={};return e.rawEvent!==""&&(t.rawEvent=e.rawEvent),e.eventIndex!==0&&(t.eventIndex=Math.round(e.eventIndex)),e.transaction!==void 0&&(t.transaction=e.transaction),e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),t},create(e){return Dc.fromPartial(e??{})},fromPartial(e){let t=HP();return t.rawEvent=e.rawEvent??"",t.eventIndex=e.eventIndex??0,t.transaction=e.transaction??void 0,t.rawTransaction=e.rawTransaction??"",t}};function GP(){return{transaction:void 0,rawTransaction:""}}var Mc={encode(e,t=S.default.Writer.create()){return e.transaction!==void 0&&P.encode(P.wrap(e.transaction),t.uint32(18).fork()).ldelim(),e.rawTransaction!==""&&t.uint32(26).string(e.rawTransaction),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=GP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.transaction=P.unwrap(P.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.rawTransaction=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:we(e.transaction)?e.transaction:void 0,rawTransaction:T(e.rawTransaction)?globalThis.String(e.rawTransaction):""}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),t},create(e){return Mc.fromPartial(e??{})},fromPartial(e){let t=GP();return t.transaction=e.transaction??void 0,t.rawTransaction=e.rawTransaction??"",t}};function zP(){return{resources:[],version:BigInt("0"),timestampMicros:BigInt("0"),rawResources:[]}}var Lc={encode(e,t=S.default.Writer.create()){for(let n of e.resources)P.encode(P.wrap(n),t.uint32(34).fork()).ldelim();if(e.version!==BigInt("0")){if(BigInt.asIntN(64,e.version)!==e.version)throw new globalThis.Error("value provided for field message.version of type int64 too large");t.uint32(16).int64(e.version.toString())}if(e.timestampMicros!==BigInt("0")){if(BigInt.asIntN(64,e.timestampMicros)!==e.timestampMicros)throw new globalThis.Error("value provided for field message.timestampMicros of type int64 too large");t.uint32(40).int64(e.timestampMicros.toString())}for(let n of e.rawResources)t.uint32(50).string(n);return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=zP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 4:if(a!==34)break;i.resources.push(P.unwrap(P.decode(n,n.uint32())));continue;case 2:if(a!==16)break;i.version=Jt(n.int64());continue;case 5:if(a!==40)break;i.timestampMicros=Jt(n.int64());continue;case 6:if(a!==50)break;i.rawResources.push(n.string());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{resources:globalThis.Array.isArray(e?.resources)?[...e.resources]:[],version:T(e.version)?BigInt(e.version):BigInt("0"),timestampMicros:T(e.timestampMicros)?BigInt(e.timestampMicros):BigInt("0"),rawResources:globalThis.Array.isArray(e?.rawResources)?e.rawResources.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.resources?.length&&(t.resources=e.resources),e.version!==BigInt("0")&&(t.version=e.version.toString()),e.timestampMicros!==BigInt("0")&&(t.timestampMicros=e.timestampMicros.toString()),e.rawResources?.length&&(t.rawResources=e.rawResources),t},create(e){return Lc.fromPartial(e??{})},fromPartial(e){let t=zP();return t.resources=e.resources?.map(n=>n)||[],t.version=e.version??BigInt("0"),t.timestampMicros=e.timestampMicros??BigInt("0"),t.rawResources=e.rawResources?.map(n=>n)||[],t}};function QP(){return{transaction:void 0,rawEvent:"",rawTransaction:"",timestamp:void 0,slot:BigInt("0")}}var Fc={encode(e,t=S.default.Writer.create()){if(e.transaction!==void 0&&P.encode(P.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.rawEvent!==""&&t.uint32(34).string(e.rawEvent),e.rawTransaction!==""&&t.uint32(42).string(e.rawTransaction),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(18).fork()).ldelim(),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(24).uint64(e.slot.toString())}return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=QP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=P.unwrap(P.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.rawEvent=n.string();continue;case 5:if(a!==42)break;i.rawTransaction=n.string();continue;case 2:if(a!==18)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue;case 3:if(a!==24)break;i.slot=Jt(n.uint64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:we(e.transaction)?e.transaction:void 0,rawEvent:T(e.rawEvent)?globalThis.String(e.rawEvent):"",rawTransaction:T(e.rawTransaction)?globalThis.String(e.rawTransaction):"",timestamp:T(e.timestamp)?vn(e.timestamp):void 0,slot:T(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.rawEvent!==""&&(t.rawEvent=e.rawEvent),e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Fc.fromPartial(e??{})},fromPartial(e){let t=QP();return t.transaction=e.transaction??void 0,t.rawEvent=e.rawEvent??"",t.rawTransaction=e.rawTransaction??"",t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function KP(){return{transaction:void 0,rawTransaction:"",timestamp:void 0,slot:BigInt("0")}}var Uc={encode(e,t=S.default.Writer.create()){if(e.transaction!==void 0&&P.encode(P.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.rawTransaction!==""&&t.uint32(34).string(e.rawTransaction),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(18).fork()).ldelim(),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(24).uint64(e.slot.toString())}return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=KP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=P.unwrap(P.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.rawTransaction=n.string();continue;case 2:if(a!==18)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue;case 3:if(a!==24)break;i.slot=Jt(n.uint64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:we(e.transaction)?e.transaction:void 0,rawTransaction:T(e.rawTransaction)?globalThis.String(e.rawTransaction):"",timestamp:T(e.timestamp)?vn(e.timestamp):void 0,slot:T(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Uc.fromPartial(e??{})},fromPartial(e){let t=KP();return t.transaction=e.transaction??void 0,t.rawTransaction=e.rawTransaction??"",t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function ZP(){return{objects:[],self:void 0,rawObjects:[],rawSelf:void 0,objectId:"",objectVersion:BigInt("0"),objectDigest:"",timestamp:void 0,slot:BigInt("0")}}var qc={encode(e,t=S.default.Writer.create()){for(let n of e.objects)P.encode(P.wrap(n),t.uint32(10).fork()).ldelim();e.self!==void 0&&P.encode(P.wrap(e.self),t.uint32(34).fork()).ldelim();for(let n of e.rawObjects)t.uint32(82).string(n);if(e.rawSelf!==void 0&&t.uint32(74).string(e.rawSelf),e.objectId!==""&&t.uint32(42).string(e.objectId),e.objectVersion!==BigInt("0")){if(BigInt.asUintN(64,e.objectVersion)!==e.objectVersion)throw new globalThis.Error("value provided for field message.objectVersion of type uint64 too large");t.uint32(48).uint64(e.objectVersion.toString())}if(e.objectDigest!==""&&t.uint32(58).string(e.objectDigest),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(18).fork()).ldelim(),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(24).uint64(e.slot.toString())}return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ZP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.objects.push(P.unwrap(P.decode(n,n.uint32())));continue;case 4:if(a!==34)break;i.self=P.unwrap(P.decode(n,n.uint32()));continue;case 10:if(a!==82)break;i.rawObjects.push(n.string());continue;case 9:if(a!==74)break;i.rawSelf=n.string();continue;case 5:if(a!==42)break;i.objectId=n.string();continue;case 6:if(a!==48)break;i.objectVersion=Jt(n.uint64());continue;case 7:if(a!==58)break;i.objectDigest=n.string();continue;case 2:if(a!==18)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue;case 3:if(a!==24)break;i.slot=Jt(n.uint64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{objects:globalThis.Array.isArray(e?.objects)?[...e.objects]:[],self:we(e.self)?e.self:void 0,rawObjects:globalThis.Array.isArray(e?.rawObjects)?e.rawObjects.map(t=>globalThis.String(t)):[],rawSelf:T(e.rawSelf)?globalThis.String(e.rawSelf):void 0,objectId:T(e.objectId)?globalThis.String(e.objectId):"",objectVersion:T(e.objectVersion)?BigInt(e.objectVersion):BigInt("0"),objectDigest:T(e.objectDigest)?globalThis.String(e.objectDigest):"",timestamp:T(e.timestamp)?vn(e.timestamp):void 0,slot:T(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.objects?.length&&(t.objects=e.objects),e.self!==void 0&&(t.self=e.self),e.rawObjects?.length&&(t.rawObjects=e.rawObjects),e.rawSelf!==void 0&&(t.rawSelf=e.rawSelf),e.objectId!==""&&(t.objectId=e.objectId),e.objectVersion!==BigInt("0")&&(t.objectVersion=e.objectVersion.toString()),e.objectDigest!==""&&(t.objectDigest=e.objectDigest),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return qc.fromPartial(e??{})},fromPartial(e){let t=ZP();return t.objects=e.objects?.map(n=>n)||[],t.self=e.self??void 0,t.rawObjects=e.rawObjects?.map(n=>n)||[],t.rawSelf=e.rawSelf??void 0,t.objectId=e.objectId??"",t.objectVersion=e.objectVersion??BigInt("0"),t.objectDigest=e.objectDigest??"",t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function YP(){return{changes:[],rawChanges:[],timestamp:void 0,txDigest:"",slot:BigInt("0")}}var Vc={encode(e,t=S.default.Writer.create()){for(let n of e.changes)P.encode(P.wrap(n),t.uint32(10).fork()).ldelim();for(let n of e.rawChanges)t.uint32(42).string(n);if(e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(18).fork()).ldelim(),e.txDigest!==""&&t.uint32(34).string(e.txDigest),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(24).uint64(e.slot.toString())}return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=YP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.changes.push(P.unwrap(P.decode(n,n.uint32())));continue;case 5:if(a!==42)break;i.rawChanges.push(n.string());continue;case 2:if(a!==18)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.txDigest=n.string();continue;case 3:if(a!==24)break;i.slot=Jt(n.uint64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{changes:globalThis.Array.isArray(e?.changes)?[...e.changes]:[],rawChanges:globalThis.Array.isArray(e?.rawChanges)?e.rawChanges.map(t=>globalThis.String(t)):[],timestamp:T(e.timestamp)?vn(e.timestamp):void 0,txDigest:T(e.txDigest)?globalThis.String(e.txDigest):"",slot:T(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.changes?.length&&(t.changes=e.changes),e.rawChanges?.length&&(t.rawChanges=e.rawChanges),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.txDigest!==""&&(t.txDigest=e.txDigest),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Vc.fromPartial(e??{})},fromPartial(e){let t=YP();return t.changes=e.changes?.map(n=>n)||[],t.rawChanges=e.rawChanges?.map(n=>n)||[],t.timestamp=e.timestamp??void 0,t.txDigest=e.txDigest??"",t.slot=e.slot??BigInt("0"),t}};function XP(){return{transaction:void 0,timestamp:void 0,receiptIndex:BigInt("0")}}var Jc={encode(e,t=S.default.Writer.create()){if(e.transaction!==void 0&&P.encode(P.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(18).fork()).ldelim(),e.receiptIndex!==BigInt("0")){if(BigInt.asIntN(64,e.receiptIndex)!==e.receiptIndex)throw new globalThis.Error("value provided for field message.receiptIndex of type int64 too large");t.uint32(24).int64(e.receiptIndex.toString())}return t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=XP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=P.unwrap(P.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue;case 3:if(a!==24)break;i.receiptIndex=Jt(n.int64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:we(e.transaction)?e.transaction:void 0,timestamp:T(e.timestamp)?vn(e.timestamp):void 0,receiptIndex:T(e.receiptIndex)?BigInt(e.receiptIndex):BigInt("0")}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.receiptIndex!==BigInt("0")&&(t.receiptIndex=e.receiptIndex.toString()),t},create(e){return Jc.fromPartial(e??{})},fromPartial(e){let t=XP();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t.receiptIndex=e.receiptIndex??BigInt("0"),t}};function $P(){return{transaction:void 0,timestamp:void 0}}var Wc={encode(e,t=S.default.Writer.create()){return e.transaction!==void 0&&P.encode(P.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=$P();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=P.unwrap(P.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:we(e.transaction)?e.transaction:void 0,timestamp:T(e.timestamp)?vn(e.timestamp):void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return Wc.fromPartial(e??{})},fromPartial(e){let t=$P();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t}};function jP(){return{transaction:void 0,timestamp:void 0}}var Hc={encode(e,t=S.default.Writer.create()){return e.transaction!==void 0&&P.encode(P.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=jP();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=P.unwrap(P.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:we(e.transaction)?e.transaction:void 0,timestamp:T(e.timestamp)?vn(e.timestamp):void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return Hc.fromPartial(e??{})},fromPartial(e){let t=jP();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t}};function ew(){return{block:void 0,timestamp:void 0}}var Gc={encode(e,t=S.default.Writer.create()){return e.block!==void 0&&P.encode(P.wrap(e.block),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ew();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.block=P.unwrap(P.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{block:we(e.block)?e.block:void 0,timestamp:T(e.timestamp)?vn(e.timestamp):void 0}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return Gc.fromPartial(e??{})},fromPartial(e){let t=ew();return t.block=e.block??void 0,t.timestamp=e.timestamp??void 0,t}};function tw(){return{transaction:void 0,timestamp:void 0}}var zc={encode(e,t=S.default.Writer.create()){return e.transaction!==void 0&&P.encode(P.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=tw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=P.unwrap(P.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:we(e.transaction)?e.transaction:void 0,timestamp:T(e.timestamp)?vn(e.timestamp):void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return zc.fromPartial(e??{})},fromPartial(e){let t=tw();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t}};function nw(){return{result:void 0,timestamp:void 0}}var Qc={encode(e,t=S.default.Writer.create()){return e.result!==void 0&&P.encode(P.wrap(e.result),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=nw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.result=P.unwrap(P.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{result:we(e.result)?e.result:void 0,timestamp:T(e.timestamp)?vn(e.timestamp):void 0}},toJSON(e){let t={};return e.result!==void 0&&(t.result=e.result),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return Qc.fromPartial(e??{})},fromPartial(e){let t=nw();return t.result=e.result??void 0,t.timestamp=e.timestamp??void 0,t}};function rw(){return{transaction:void 0,timestamp:void 0}}var Kc={encode(e,t=S.default.Writer.create()){return e.transaction!==void 0&&P.encode(P.wrap(e.transaction),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=rw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 4:if(a!==34)break;i.transaction=P.unwrap(P.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:we(e.transaction)?e.transaction:void 0,timestamp:T(e.timestamp)?vn(e.timestamp):void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return Kc.fromPartial(e??{})},fromPartial(e){let t=rw();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t}};function iw(){return{block:void 0,timestamp:void 0}}var Zc={encode(e,t=S.default.Writer.create()){return e.block!==void 0&&P.encode(P.wrap(e.block),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Se.encode(yn(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=iw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.block=P.unwrap(P.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Zt(Se.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{block:we(e.block)?e.block:void 0,timestamp:T(e.timestamp)?vn(e.timestamp):void 0}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return Zc.fromPartial(e??{})},fromPartial(e){let t=iw();return t.block=e.block??void 0,t.timestamp=e.timestamp??void 0,t}};function aw(){return{data:void 0,handlerType:0,handlerIds:[]}}var gn={encode(e,t=S.default.Writer.create()){e.data!==void 0&&Oc.encode(e.data,t.uint32(10).fork()).ldelim(),e.handlerType!==0&&t.uint32(24).int32(e.handlerType),t.uint32(34).fork();for(let n of e.handlerIds)t.int32(n);return t.ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=aw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.data=Oc.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.handlerType=n.int32();continue;case 4:if(a===32){i.handlerIds.push(n.int32());continue}if(a===34){let o=n.uint32()+n.pos;for(;n.pos<o;)i.handlerIds.push(n.int32());continue}break}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{data:T(e.data)?Oc.fromJSON(e.data):void 0,handlerType:T(e.handlerType)?yw(e.handlerType):0,handlerIds:globalThis.Array.isArray(e?.handlerIds)?e.handlerIds.map(t=>globalThis.Number(t)):[]}},toJSON(e){let t={};return e.data!==void 0&&(t.data=Oc.toJSON(e.data)),e.handlerType!==0&&(t.handlerType=vw(e.handlerType)),e.handlerIds?.length&&(t.handlerIds=e.handlerIds.map(n=>Math.round(n))),t},create(e){return gn.fromPartial(e??{})},fromPartial(e){let t=aw();return t.data=e.data!==void 0&&e.data!==null?Oc.fromPartial(e.data):void 0,t.handlerType=e.handlerType??0,t.handlerIds=e.handlerIds?.map(n=>n)||[],t}};function ow(){return{configUpdated:!1,error:void 0}}var no={encode(e,t=S.default.Writer.create()){return e.configUpdated!==!1&&t.uint32(8).bool(e.configUpdated),e.error!==void 0&&t.uint32(18).string(e.error),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ow();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.configUpdated=n.bool();continue;case 2:if(a!==18)break;i.error=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{configUpdated:T(e.configUpdated)?globalThis.Boolean(e.configUpdated):!1,error:T(e.error)?globalThis.String(e.error):void 0}},toJSON(e){let t={};return e.configUpdated!==!1&&(t.configUpdated=e.configUpdated),e.error!==void 0&&(t.error=e.error),t},create(e){return no.fromPartial(e??{})},fromPartial(e){let t=ow();return t.configUpdated=e.configUpdated??!1,t.error=e.error??void 0,t}};function sw(){return{gauges:[],counters:[],logs:[],events:[],exports:[],states:void 0}}var nr={encode(e,t=S.default.Writer.create()){for(let n of e.gauges)Yc.encode(n,t.uint32(10).fork()).ldelim();for(let n of e.counters)Xc.encode(n,t.uint32(18).fork()).ldelim();for(let n of e.logs)$c.encode(n,t.uint32(26).fork()).ldelim();for(let n of e.events)jc.encode(n,t.uint32(34).fork()).ldelim();for(let n of e.exports)ed.encode(n,t.uint32(42).fork()).ldelim();return e.states!==void 0&&no.encode(e.states,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=sw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.gauges.push(Yc.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.counters.push(Xc.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.logs.push($c.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.events.push(jc.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.exports.push(ed.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.states=no.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{gauges:globalThis.Array.isArray(e?.gauges)?e.gauges.map(t=>Yc.fromJSON(t)):[],counters:globalThis.Array.isArray(e?.counters)?e.counters.map(t=>Xc.fromJSON(t)):[],logs:globalThis.Array.isArray(e?.logs)?e.logs.map(t=>$c.fromJSON(t)):[],events:globalThis.Array.isArray(e?.events)?e.events.map(t=>jc.fromJSON(t)):[],exports:globalThis.Array.isArray(e?.exports)?e.exports.map(t=>ed.fromJSON(t)):[],states:T(e.states)?no.fromJSON(e.states):void 0}},toJSON(e){let t={};return e.gauges?.length&&(t.gauges=e.gauges.map(n=>Yc.toJSON(n))),e.counters?.length&&(t.counters=e.counters.map(n=>Xc.toJSON(n))),e.logs?.length&&(t.logs=e.logs.map(n=>$c.toJSON(n))),e.events?.length&&(t.events=e.events.map(n=>jc.toJSON(n))),e.exports?.length&&(t.exports=e.exports.map(n=>ed.toJSON(n))),e.states!==void 0&&(t.states=no.toJSON(e.states)),t},create(e){return nr.fromPartial(e??{})},fromPartial(e){let t=sw();return t.gauges=e.gauges?.map(n=>Yc.fromPartial(n))||[],t.counters=e.counters?.map(n=>Xc.fromPartial(n))||[],t.logs=e.logs?.map(n=>$c.fromPartial(n))||[],t.events=e.events?.map(n=>jc.fromPartial(n))||[],t.exports=e.exports?.map(n=>ed.fromPartial(n))||[],t.states=e.states!==void 0&&e.states!==null?no.fromPartial(e.states):void 0,t}};function uw(){return{address:"",contractName:"",blockNumber:BigInt("0"),transactionHash:"",chainId:"",transactionIndex:0,logIndex:0,name:"",labels:{}}}var rt={encode(e,t=S.default.Writer.create()){if(e.address!==""&&t.uint32(10).string(e.address),e.contractName!==""&&t.uint32(74).string(e.contractName),e.blockNumber!==BigInt("0")){if(BigInt.asUintN(64,e.blockNumber)!==e.blockNumber)throw new globalThis.Error("value provided for field message.blockNumber of type uint64 too large");t.uint32(16).uint64(e.blockNumber.toString())}return e.transactionHash!==""&&t.uint32(50).string(e.transactionHash),e.chainId!==""&&t.uint32(42).string(e.chainId),e.transactionIndex!==0&&t.uint32(24).int32(e.transactionIndex),e.logIndex!==0&&t.uint32(32).int32(e.logIndex),e.name!==""&&t.uint32(82).string(e.name),Object.entries(e.labels).forEach(([n,r])=>{yE.encode({key:n,value:r},t.uint32(58).fork()).ldelim()}),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=uw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=n.string();continue;case 9:if(a!==74)break;i.contractName=n.string();continue;case 2:if(a!==16)break;i.blockNumber=Jt(n.uint64());continue;case 6:if(a!==50)break;i.transactionHash=n.string();continue;case 5:if(a!==42)break;i.chainId=n.string();continue;case 3:if(a!==24)break;i.transactionIndex=n.int32();continue;case 4:if(a!==32)break;i.logIndex=n.int32();continue;case 10:if(a!==82)break;i.name=n.string();continue;case 7:if(a!==58)break;let o=yE.decode(n,n.uint32());o.value!==void 0&&(i.labels[o.key]=o.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{address:T(e.address)?globalThis.String(e.address):"",contractName:T(e.contractName)?globalThis.String(e.contractName):"",blockNumber:T(e.blockNumber)?BigInt(e.blockNumber):BigInt("0"),transactionHash:T(e.transactionHash)?globalThis.String(e.transactionHash):"",chainId:T(e.chainId)?globalThis.String(e.chainId):"",transactionIndex:T(e.transactionIndex)?globalThis.Number(e.transactionIndex):0,logIndex:T(e.logIndex)?globalThis.Number(e.logIndex):0,name:T(e.name)?globalThis.String(e.name):"",labels:we(e.labels)?Object.entries(e.labels).reduce((t,[n,r])=>(t[n]=String(r),t),{}):{}}},toJSON(e){let t={};if(e.address!==""&&(t.address=e.address),e.contractName!==""&&(t.contractName=e.contractName),e.blockNumber!==BigInt("0")&&(t.blockNumber=e.blockNumber.toString()),e.transactionHash!==""&&(t.transactionHash=e.transactionHash),e.chainId!==""&&(t.chainId=e.chainId),e.transactionIndex!==0&&(t.transactionIndex=Math.round(e.transactionIndex)),e.logIndex!==0&&(t.logIndex=Math.round(e.logIndex)),e.name!==""&&(t.name=e.name),e.labels){let n=Object.entries(e.labels);n.length>0&&(t.labels={},n.forEach(([r,i])=>{t.labels[r]=i}))}return t},create(e){return rt.fromPartial(e??{})},fromPartial(e){let t=uw();return t.address=e.address??"",t.contractName=e.contractName??"",t.blockNumber=e.blockNumber??BigInt("0"),t.transactionHash=e.transactionHash??"",t.chainId=e.chainId??"",t.transactionIndex=e.transactionIndex??0,t.logIndex=e.logIndex??0,t.name=e.name??"",t.labels=Object.entries(e.labels??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=globalThis.String(i)),n),{}),t}};function lw(){return{key:"",value:""}}var yE={encode(e,t=S.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==""&&t.uint32(18).string(e.value),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=lw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:T(e.key)?globalThis.String(e.key):"",value:T(e.value)?globalThis.String(e.value):""}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==""&&(t.value=e.value),t},create(e){return yE.fromPartial(e??{})},fromPartial(e){let t=lw();return t.key=e.key??"",t.value=e.value??"",t}};function cw(){return{bigDecimal:void 0,doubleValue:void 0,bigInteger:void 0}}var mi={encode(e,t=S.default.Writer.create()){return e.bigDecimal!==void 0&&t.uint32(10).string(e.bigDecimal),e.doubleValue!==void 0&&t.uint32(17).double(e.doubleValue),e.bigInteger!==void 0&&Kt.encode(e.bigInteger,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=cw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bigDecimal=n.string();continue;case 2:if(a!==17)break;i.doubleValue=n.double();continue;case 3:if(a!==26)break;i.bigInteger=Kt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{bigDecimal:T(e.bigDecimal)?globalThis.String(e.bigDecimal):void 0,doubleValue:T(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,bigInteger:T(e.bigInteger)?Kt.fromJSON(e.bigInteger):void 0}},toJSON(e){let t={};return e.bigDecimal!==void 0&&(t.bigDecimal=e.bigDecimal),e.doubleValue!==void 0&&(t.doubleValue=e.doubleValue),e.bigInteger!==void 0&&(t.bigInteger=Kt.toJSON(e.bigInteger)),t},create(e){return mi.fromPartial(e??{})},fromPartial(e){let t=cw();return t.bigDecimal=e.bigDecimal??void 0,t.doubleValue=e.doubleValue??void 0,t.bigInteger=e.bigInteger!==void 0&&e.bigInteger!==null?Kt.fromPartial(e.bigInteger):void 0,t}};function dw(){return{from:0}}var it={encode(e,t=S.default.Writer.create()){return e.from!==0&&t.uint32(8).int32(e.from),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=dw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.from=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{from:T(e.from)?yw(e.from):0}},toJSON(e){let t={};return e.from!==0&&(t.from=vw(e.from)),t},create(e){return it.fromPartial(e??{})},fromPartial(e){let t=dw();return t.from=e.from??0,t}};function fw(){return{metadata:void 0,metricValue:void 0,runtimeInfo:void 0}}var Yc={encode(e,t=S.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&mi.encode(e.metricValue,t.uint32(18).fork()).ldelim(),e.runtimeInfo!==void 0&&it.encode(e.runtimeInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=fw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.metricValue=mi.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.runtimeInfo=it.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:T(e.metadata)?rt.fromJSON(e.metadata):void 0,metricValue:T(e.metricValue)?mi.fromJSON(e.metricValue):void 0,runtimeInfo:T(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.metricValue!==void 0&&(t.metricValue=mi.toJSON(e.metricValue)),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),t},create(e){return Yc.fromPartial(e??{})},fromPartial(e){let t=fw();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.fromPartial(e.metadata):void 0,t.metricValue=e.metricValue!==void 0&&e.metricValue!==null?mi.fromPartial(e.metricValue):void 0,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?it.fromPartial(e.runtimeInfo):void 0,t}};function hw(){return{metadata:void 0,metricValue:void 0,add:!1,runtimeInfo:void 0}}var Xc={encode(e,t=S.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&mi.encode(e.metricValue,t.uint32(18).fork()).ldelim(),e.add!==!1&&t.uint32(24).bool(e.add),e.runtimeInfo!==void 0&&it.encode(e.runtimeInfo,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=hw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.metricValue=mi.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.add=n.bool();continue;case 4:if(a!==34)break;i.runtimeInfo=it.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:T(e.metadata)?rt.fromJSON(e.metadata):void 0,metricValue:T(e.metricValue)?mi.fromJSON(e.metricValue):void 0,add:T(e.add)?globalThis.Boolean(e.add):!1,runtimeInfo:T(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.metricValue!==void 0&&(t.metricValue=mi.toJSON(e.metricValue)),e.add!==!1&&(t.add=e.add),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),t},create(e){return Xc.fromPartial(e??{})},fromPartial(e){let t=hw();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.fromPartial(e.metadata):void 0,t.metricValue=e.metricValue!==void 0&&e.metricValue!==null?mi.fromPartial(e.metricValue):void 0,t.add=e.add??!1,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?it.fromPartial(e.runtimeInfo):void 0,t}};function pw(){return{metadata:void 0,level:0,message:"",attributes:"",attributes2:void 0,runtimeInfo:void 0}}var $c={encode(e,t=S.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.level!==0&&t.uint32(16).int32(e.level),e.message!==""&&t.uint32(26).string(e.message),e.attributes!==""&&t.uint32(50).string(e.attributes),e.attributes2!==void 0&&P.encode(P.wrap(e.attributes2),t.uint32(58).fork()).ldelim(),e.runtimeInfo!==void 0&&it.encode(e.runtimeInfo,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=pw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==16)break;i.level=n.int32();continue;case 3:if(a!==26)break;i.message=n.string();continue;case 6:if(a!==50)break;i.attributes=n.string();continue;case 7:if(a!==58)break;i.attributes2=P.unwrap(P.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.runtimeInfo=it.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:T(e.metadata)?rt.fromJSON(e.metadata):void 0,level:T(e.level)?Sw(e.level):0,message:T(e.message)?globalThis.String(e.message):"",attributes:T(e.attributes)?globalThis.String(e.attributes):"",attributes2:we(e.attributes2)?e.attributes2:void 0,runtimeInfo:T(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.level!==0&&(t.level=bw(e.level)),e.message!==""&&(t.message=e.message),e.attributes!==""&&(t.attributes=e.attributes),e.attributes2!==void 0&&(t.attributes2=e.attributes2),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),t},create(e){return $c.fromPartial(e??{})},fromPartial(e){let t=pw();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.fromPartial(e.metadata):void 0,t.level=e.level??0,t.message=e.message??"",t.attributes=e.attributes??"",t.attributes2=e.attributes2??void 0,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?it.fromPartial(e.runtimeInfo):void 0,t}};function mw(){return{metadata:void 0,distinctEntityId:"",attributes:void 0,severity:0,message:"",runtimeInfo:void 0,attributes2:void 0,noMetric:!1}}var jc={encode(e,t=S.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.distinctEntityId!==""&&t.uint32(18).string(e.distinctEntityId),e.attributes!==void 0&&P.encode(P.wrap(e.attributes),t.uint32(50).fork()).ldelim(),e.severity!==0&&t.uint32(56).int32(e.severity),e.message!==""&&t.uint32(66).string(e.message),e.runtimeInfo!==void 0&&it.encode(e.runtimeInfo,t.uint32(42).fork()).ldelim(),e.attributes2!==void 0&&Ke.encode(e.attributes2,t.uint32(74).fork()).ldelim(),e.noMetric!==!1&&t.uint32(24).bool(e.noMetric),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=mw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.distinctEntityId=n.string();continue;case 6:if(a!==50)break;i.attributes=P.unwrap(P.decode(n,n.uint32()));continue;case 7:if(a!==56)break;i.severity=n.int32();continue;case 8:if(a!==66)break;i.message=n.string();continue;case 5:if(a!==42)break;i.runtimeInfo=it.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.attributes2=Ke.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.noMetric=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:T(e.metadata)?rt.fromJSON(e.metadata):void 0,distinctEntityId:T(e.distinctEntityId)?globalThis.String(e.distinctEntityId):"",attributes:we(e.attributes)?e.attributes:void 0,severity:T(e.severity)?Sw(e.severity):0,message:T(e.message)?globalThis.String(e.message):"",runtimeInfo:T(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0,attributes2:T(e.attributes2)?Ke.fromJSON(e.attributes2):void 0,noMetric:T(e.noMetric)?globalThis.Boolean(e.noMetric):!1}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.distinctEntityId!==""&&(t.distinctEntityId=e.distinctEntityId),e.attributes!==void 0&&(t.attributes=e.attributes),e.severity!==0&&(t.severity=bw(e.severity)),e.message!==""&&(t.message=e.message),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),e.attributes2!==void 0&&(t.attributes2=Ke.toJSON(e.attributes2)),e.noMetric!==!1&&(t.noMetric=e.noMetric),t},create(e){return jc.fromPartial(e??{})},fromPartial(e){let t=mw();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.fromPartial(e.metadata):void 0,t.distinctEntityId=e.distinctEntityId??"",t.attributes=e.attributes??void 0,t.severity=e.severity??0,t.message=e.message??"",t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?it.fromPartial(e.runtimeInfo):void 0,t.attributes2=e.attributes2!==void 0&&e.attributes2!==null?Ke.fromPartial(e.attributes2):void 0,t.noMetric=e.noMetric??!1,t}};function gw(){return{metadata:void 0,payload:"",runtimeInfo:void 0}}var ed={encode(e,t=S.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.payload!==""&&t.uint32(18).string(e.payload),e.runtimeInfo!==void 0&&it.encode(e.runtimeInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof S.default.Reader?e:S.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=gw();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.payload=n.string();continue;case 3:if(a!==26)break;i.runtimeInfo=it.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:T(e.metadata)?rt.fromJSON(e.metadata):void 0,payload:T(e.payload)?globalThis.String(e.payload):"",runtimeInfo:T(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.payload!==""&&(t.payload=e.payload),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),t},create(e){return ed.fromPartial(e??{})},fromPartial(e){let t=gw();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.fromPartial(e.metadata):void 0,t.payload=e.payload??"",t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?it.fromPartial(e.runtimeInfo):void 0,t}},PTe={name:"Processor",fullName:"processor.Processor",methods:{start:{name:"Start",requestType:Cw,requestStream:!1,responseType:bh,responseStream:!1,options:{}},stop:{name:"Stop",requestType:bh,requestStream:!1,responseType:bh,responseStream:!1,options:{}},getConfig:{name:"GetConfig",requestType:Tw,requestStream:!1,responseType:Ew,responseStream:!1,options:{}},processBindings:{name:"ProcessBindings",requestType:kw,requestStream:!1,responseType:_w,responseStream:!1,options:{}},processBindingsStream:{name:"ProcessBindingsStream",requestType:Aw,requestStream:!0,responseType:Nw,responseStream:!0,options:{}},preprocessBindingsStream:{name:"PreprocessBindingsStream",requestType:Iw,requestStream:!0,responseType:Ow,responseStream:!0,options:{}}}};function yn(e){let t=BigInt(Math.trunc(e.getTime()/1e3)),n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function Zt(e){let t=(globalThis.Number(e.seconds.toString())||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function vn(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):Zt(Se.fromJSON(e))}function Jt(e){return BigInt(e.toString())}S.default.util.Long!==Ut&&(S.default.util.Long=Ut,S.default.configure());function we(e){return typeof e=="object"&&e!==null}function T(e){return e!=null}import("node:process").then(e=>e.stdout.write(""));function Rw(e){let t={...nr.create(),states:no.create()};for(let n of e)t.counters=t.counters.concat(n.counters),t.gauges=t.gauges.concat(n.gauges),t.events=t.events.concat(n.events),t.exports=t.exports.concat(n.exports),t.states={configUpdated:t.states?.configUpdated||n.states?.configUpdated||!1};return t}function xm(e){return e.message+`
25
- `+e.stack}var BTe="user_processor";function vE(e){if(!e.context)throw new Error("null context for eth call");let{chainId:t,address:n,blockTag:r}=e.context;return`${t}|${n}|${r}|${e.calldata}`.toLowerCase()}function DTe(e){let[t,n,r,i,a,o]=e.match(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/)??[];return{semVer:t,major:parseInt(n),minor:parseInt(r),patch:parseInt(i),prerelease:a,buildmetadata:o}}function MTe(e,t){let{major:n,minor:r,patch:i,prerelease:a}=e,{major:o,minor:s,patch:u,prerelease:l}=t;if(n!==o)return n-o;if(r!==s)return r-s;if(i!==u)return i-u;if(a&&l){let[c,d]=a.split("."),[f,h]=l.split(".");return c!==f?c.localeCompare(f):parseInt(d)-parseInt(h)}else{if(a)return-1;if(l)return 1}return 0}import("node:process").then(e=>e.stdout.write(""));var xs=class e{static INSTANCE=new e;concurrency=8;chainQueryAPI="";priceFeedAPI="";chainServer=new Map;batchCount=1};import("node:process").then(e=>e.stdout.write(""));var zd={execution:{sequential:!1,forceExactBlockTime:!1}};function p6(){m6(zd.execution)}function m6(e){let t=Reflect.ownKeys(e);for(let n of t){let r=e[n];(r&&typeof r=="object"||typeof r=="function")&&m6(r)}return Object.freeze(e)}import("node:process").then(e=>e.stdout.write(""));CF();import{AsyncLocalStorage as vee}from"node:async_hooks";var Y1=()=>vp.getMeter("processor"),_e=class{constructor(t){this.name=t}_counter;value=0;get counter(){return this._counter||(this._counter=Y1().createCounter(this.name)),this._counter}add(t,n){this.counter.add(t,n),this.value+=t}get(){return this.value}},Yd=class{constructor(t){this.name=t}_gauge;value=0;get gauge(){return this._gauge||(this._gauge=Y1().createGauge(this.name)),this._gauge}record(t,n){this.gauge.record(t,n),this.value=t}get(){return this.value}},Sp=class{constructor(t){this.name=t}_histogram;value=0;get histogram(){return this._histogram||(this._histogram=Y1().createHistogram(this.name)),this._histogram}record(t,n){this.histogram.record(t,n),this.value=t}get(){return this.value}},kF={send_counts:{get:new _e("store_get_send"),upsert:new _e("store_upsert_send"),list:new _e("store_list_send"),delete:new _e("store_delete_send")},recv_counts:{get:new _e("store_get_recv"),upsert:new _e("store_upsert_recv"),list:new _e("store_list_recv"),delete:new _e("store_delete_recv")},request_times:{get:new _e("store_get_time"),upsert:new _e("store_upsert_time"),list:new _e("store_list_time"),delete:new _e("store_delete_time")},request_errors:{get:new _e("store_get_error"),upsert:new _e("store_upsert_error"),list:new _e("store_list_error"),delete:new _e("store_delete_error")},batched_total_count:new _e("batched_total_count"),batched_request_count:new _e("batched_request_count"),unsolved_requests:new Yd("store_unsolved_requests"),stats(){return{send_counts:{get:this.send_counts.get.get(),upsert:this.send_counts.upsert.get(),list:this.send_counts.list.get(),delete:this.send_counts.delete.get()},recv_counts:{get:this.recv_counts.get.get(),upsert:this.recv_counts.upsert.get(),list:this.recv_counts.list.get(),delete:this.recv_counts.delete.get()},request_times:{get:this.request_times.get.get(),upsert:this.request_times.upsert.get(),list:this.request_times.list.get(),delete:this.request_times.delete.get()},request_errors:{get:this.request_errors.get.get(),upsert:this.request_errors.upsert.get(),list:this.request_errors.list.get(),delete:this.request_errors.delete.get()},batched_total_count:this.batched_total_count.get(),batched_request_count:this.batched_request_count.get(),unsolved_requests:this.unsolved_requests.get(),average_request_time:{get:this.request_times.get.get()/this.send_counts.get.get(),upsert:this.request_times.upsert.get()/this.send_counts.upsert.get(),list:this.request_times.list.get()/this.send_counts.list.get()}}}},_F={hit_count:new _e("provider_hit_count"),miss_count:new _e("provider_miss_count"),queue_size:new Yd("provider_queue_size"),total_duration:new _e("provider_total_duration"),total_queued:new _e("provider_total_queued"),stats(){return{hit_count:this.hit_count.get(),miss_count:this.miss_count.get(),queue_size:this.queue_size.get(),total_duration:this.total_duration.get(),total_queued:this.total_queued.get(),average_queue_time:this.total_queued.get()/(this.hit_count.get()+this.miss_count.get()),average_duration:this.total_duration.get()/(this.hit_count.get()+this.miss_count.get())}}},tu={process_binding_count:new _e("process_binding_count"),process_binding_time:new _e("process_binding_time"),process_binding_error:new _e("process_binding_error"),process_ethcall_count:new _e("process_ethcall_count"),process_eventemit_count:new _e("process_eventemit_count"),process_metricrecord_count:new _e("process_metricrecord_count"),process_pricecall_count:new _e("process_pricecall_count"),process_template_count:new _e("process_template_count"),process_handler_duration:new Yd("process_handler_duration"),processor_handler_duration:new Sp("processor_handler_duration"),processor_rpc_duration:new Sp("processor_rpc_duration"),processor_rpc_queue_duration:new Sp("processor_rpc_queue_duration"),processor_template_instance_count:new _e("process_template_instance_count"),processor_worker_run_time:new _e("processor_worker_run_time"),processor_worker_wait_time:new _e("processor_worker_wait_time"),processor_worker_queue_size:new Yd("processor_worker_queue_size"),processor_worker_completed:new _e("processor_worker_completed"),stats(){return{process_binding_count:this.process_binding_count.get(),process_binding_time:this.process_binding_time.get(),process_binding_error:this.process_binding_error.get(),process_ethcall_count:this.process_ethcall_count.get(),process_eventemit_count:this.process_eventemit_count.get(),process_metricrecord_count:this.process_metricrecord_count.get(),process_pricecall_count:this.process_pricecall_count.get(),process_template_count:this.process_template_count.get(),process_handler_duration:this.process_handler_duration.get(),processor_handler_duration:this.processor_handler_duration.get(),processor_rpc_duration:this.processor_rpc_duration.get(),processor_rpc_queue_duration:this.processor_rpc_queue_duration.get(),processor_template_instance_count:this.processor_template_instance_count.get(),processor_worker_run_time:this.processor_worker_run_time.get(),processor_worker_wait_time:this.processor_worker_wait_time.get(),processor_worker_queue_size:this.processor_worker_queue_size.get(),processor_worker_completed:this.processor_worker_completed.get()}}},AF=new vee;import("node:process").then(e=>e.stdout.write(""));import*as Xd from"node:process";var{request_errors:See,unsolved_requests:NF,request_times:IF,batched_request_count:bee,batched_total_count:Tee,send_counts:OF,recv_counts:Eee}=kF,RF=Xd.env.STORE_BATCH_MAX_IDLE?parseInt(Xd.env.STORE_BATCH_MAX_IDLE):1,PF=Xd.env.STORE_BATCH_SIZE?parseInt(Xd.env.STORE_BATCH_SIZE):10,X1=Xd.env.STORE_UPSERT_NO_WAIT==="true",wF=new Error("timeout"),sy=class e{constructor(t,n){this.subject=t;this.processId=n}static opCounter=0n;defers=new Map;statsInterval;pendings=[];newPromise(t,n){return new Promise((r,i)=>{this.defers.set(t,{resolve:r,reject:i,requestType:n}),NF.record(this.defers.size,{processId:this.processId})})}sendRequest(t,n){if(RF>0&&PF>1&&t.upsert)return this.sendUpsertInBatch(t.upsert);let r=Object.keys(t)[0],i=e.opCounter++,a=this.newPromise(i,r),o=Date.now(),s=[a],u;if(n){let l=new Promise((c,d)=>u=setTimeout(d,n*1e3,wF));s.push(l)}return this.subject.next({dbRequest:{...t,opId:i},processId:this.processId}),OF[r]?.add(1),r==="upsert"&&X1?(this.pendings.push(a),Promise.resolve({opId:i})):Promise.race(s).then(l=>(n&&console.debug("db request",r,"op",i," took",Date.now()-o,"ms"),IF[r]?.add(Date.now()-o),l)).catch(l=>{throw l===wF&&console.error("db request",r,"op:",i," timeout"),See[r]?.add(1),l}).finally(()=>{u&&clearTimeout(u)})}result(t){let n=t.opId,r=this.defers.get(n);r&&(r.requestType&&Eee[r.requestType]?.add(1),t.error?r.reject(new Error(t.error)):r.resolve(t),this.defers.delete(n)),NF.record(this.defers.size,{processId:this.processId})}error(t,n){console.error("process error",t,n);let r=Rs.create({states:{error:n?.toString()}});this.subject.next({result:r,processId:t})}close(){for(let[t,n]of this.defers)n.reject(new Error("context closed before db response, processId: "+this.processId+" opId: "+t));this.defers.clear(),this.statsInterval&&clearInterval(this.statsInterval)}upsertBatch=void 0;async sendUpsertInBatch(t){if(this.upsertBatch){let{request:n,promise:r}=this.upsertBatch;return n.entity=this.upsertBatch.request.entity.concat(t.entity),n.entityData=this.upsertBatch.request.entityData.concat(t.entityData),n.id=this.upsertBatch.request.id.concat(t.id),n.entity.length>=PF&&this.sendBatch(),X1?{opId:this.upsertBatch.opId}:r}else{let n=e.opCounter++,r=setTimeout(()=>{this.sendBatch()},RF),i=Date.now(),a=this.newPromise(n,"upsert").finally(()=>{IF.upsert.add(Date.now()-i)});return this.upsertBatch={opId:n,request:t,promise:a,timer:r},X1?(this.pendings.push(a),{opId:this.upsertBatch.opId}):a}}sendBatch(){if(this.upsertBatch){let{request:t,opId:n,timer:r}=this.upsertBatch;clearTimeout(r),this.upsertBatch=void 0,this.subject.next({dbRequest:{upsert:t,opId:n},processId:this.processId}),OF.upsert?.add(1),bee.add(1),Tee.add(t.entity.length)}}async awaitPendings(){await Promise.all(this.pendings)}};import("node:process").then(e=>e.stdout.write(""));var xF="6.13.1";function Cee(e,t,n){let r=t.split("|").map(a=>a.trim());for(let a=0;a<r.length;a++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}let i=new Error(`invalid value for type ${t}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${n}`,i.value=e,i}async function kt(e){let t=Object.keys(e);return(await Promise.all(t.map(r=>Promise.resolve(e[r])))).reduce((r,i,a)=>(r[t[a]]=i,r),{})}function K(e,t,n){for(let r in t){let i=t[r],a=n?n[r]:null;a&&Cee(i,a,r),Object.defineProperty(e,r,{enumerable:!0,value:i,writable:!1})}}function $d(e){if(e==null)return"null";if(Array.isArray(e))return"[ "+e.map($d).join(", ")+" ]";if(e instanceof Uint8Array){let t="0123456789abcdef",n="0x";for(let r=0;r<e.length;r++)n+=t[e[r]>>4],n+=t[e[r]&15];return n}if(typeof e=="object"&&typeof e.toJSON=="function")return $d(e.toJSON());switch(typeof e){case"boolean":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"number":return e.toString();case"string":return JSON.stringify(e);case"object":{let t=Object.keys(e);return t.sort(),"{ "+t.map(n=>`${$d(n)}: ${$d(e[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function lt(e,t){return e&&e.code===t}function jd(e){return lt(e,"CALL_EXCEPTION")}function Je(e,t,n){let r=e;{let a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${$d(n)}`);for(let o in n){if(o==="shortMessage")continue;let s=n[o];a.push(o+"="+$d(s))}}a.push(`code=${t}`),a.push(`version=${xF}`),a.length&&(e+=" ("+a.join(", ")+")")}let i;switch(t){case"INVALID_ARGUMENT":i=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(e);break;default:i=new Error(e)}return K(i,{code:t}),n&&Object.assign(i,n),i.shortMessage==null&&K(i,{shortMessage:r}),i}function B(e,t,n,r){if(!e)throw Je(t,n,r)}function k(e,t,n,r){B(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function bp(e,t,n){n==null&&(n=""),n&&(n=": "+n),B(e>=t,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:e,expectedCount:t}),B(e<=t,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})}var kee=["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test".normalize(t)!=="test")throw new Error("bad");if(t==="NFD"&&"\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken");e.push(t)}catch{}return e},[]);function $1(e){B(kee.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}function Po(e,t,n){if(n==null&&(n=""),e!==t){let r=n,i="new";n&&(r+=".",i+=" "+n),B(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function DF(e,t,n){if(e instanceof Uint8Array)return n?new Uint8Array(e):e;if(typeof e=="string"&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){let r=new Uint8Array((e.length-2)/2),i=2;for(let a=0;a<r.length;a++)r[a]=parseInt(e.substring(i,i+2),16),i+=2;return r}k(!1,"invalid BytesLike value",t||"value",e)}function ue(e,t){return DF(e,t,!1)}function ht(e,t){return DF(e,t,!0)}function Ce(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t=="number"&&e.length!==2+2*t||t===!0&&e.length%2!==0)}function nu(e){return Ce(e,!0)||e instanceof Uint8Array}var BF="0123456789abcdef";function W(e){let t=ue(e),n="0x";for(let r=0;r<t.length;r++){let i=t[r];n+=BF[(i&240)>>4]+BF[i&15]}return n}function Ue(e){return"0x"+e.map(t=>W(t).substring(2)).join("")}function ia(e){return Ce(e,!0)?(e.length-2)/2:ue(e).length}function ot(e,t,n){let r=ue(e);return n!=null&&n>r.length&&B(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),W(r.slice(t??0,n??r.length))}function MF(e,t,n){let r=ue(e);B(t>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:t,offset:t+1});let i=new Uint8Array(t);return i.fill(0),n?i.set(r,t-r.length):i.set(r,0),W(i)}function lr(e,t){return MF(e,t,!0)}function j1(e,t){return MF(e,t,!1)}var uy=BigInt(0),ki=BigInt(1),ef=9007199254740991;function eA(e,t){let n=Ep(e,"value"),r=BigInt(pe(t,"width"));if(B(n>>r===uy,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>r-ki){let i=(ki<<r)-ki;return-((~n&i)+ki)}return n}function Tp(e,t){let n=z(e,"value"),r=BigInt(pe(t,"width")),i=ki<<r-ki;if(n<uy){n=-n,B(n<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});let a=(ki<<r)-ki;return(~n&a)+ki}else B(n<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});return n}function wo(e,t){let n=Ep(e,"value"),r=BigInt(pe(t,"bits"));return n&(ki<<r)-ki}function z(e,t){switch(typeof e){case"bigint":return e;case"number":return k(Number.isInteger(e),"underflow",t||"value",e),k(e>=-ef&&e<=ef,"overflow",t||"value",e),BigInt(e);case"string":try{if(e==="")throw new Error("empty string");return e[0]==="-"&&e[1]!=="-"?-BigInt(e.substring(1)):BigInt(e)}catch(n){k(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}k(!1,"invalid BigNumberish value",t||"value",e)}function Ep(e,t){let n=z(e,t);return B(n>=uy,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}var LF="0123456789abcdef";function tf(e){if(e instanceof Uint8Array){let t="0x0";for(let n of e)t+=LF[n>>4],t+=LF[n&15];return BigInt(t)}return z(e)}function pe(e,t){switch(typeof e){case"bigint":return k(e>=-ef&&e<=ef,"overflow",t||"value",e),Number(e);case"number":return k(Number.isInteger(e),"underflow",t||"value",e),k(e>=-ef&&e<=ef,"overflow",t||"value",e),e;case"string":try{if(e==="")throw new Error("empty string");return pe(BigInt(e),t)}catch(n){k(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}k(!1,"invalid numeric value",t||"value",e)}function tA(e){return pe(tf(e))}function zn(e,t){let r=Ep(e,"value").toString(16);if(t==null)r.length%2&&(r="0"+r);else{let i=pe(t,"width");for(B(i*2>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});r.length<i*2;)r="0"+r}return"0x"+r}function Ot(e){let t=Ep(e,"value");if(t===uy)return new Uint8Array([]);let n=t.toString(16);n.length%2&&(n="0"+n);let r=new Uint8Array(n.length/2);for(let i=0;i<r.length;i++){let a=i*2;r[i]=parseInt(n.substring(a,a+2),16)}return r}function aa(e){let t=W(nu(e)?e:Ot(e)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return t===""&&(t="0"),"0x"+t}var FF="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var ZAe=BigInt(0),UF=BigInt(58);function nA(e){let t=ue(e),n=tf(t),r="";for(;n;)r=FF[Number(n%UF)]+r,n/=UF;for(let i=0;i<t.length&&!t[i];i++)r=FF[0]+r;return r}function qF(e){return ht(Buffer.from(e,"base64"))}function VF(e){return Buffer.from(ue(e)).toString("base64")}var ru=class{filter;emitter;#e;constructor(t,n,r){this.#e=n,K(this,{emitter:t,filter:r})}async removeListener(){this.#e!=null&&await this.emitter.off(this.filter,this.#e)}};function _ee(e,t,n,r,i){k(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",n)}function JF(e,t,n,r,i){if(e==="BAD_PREFIX"||e==="UNEXPECTED_CONTINUE"){let a=0;for(let o=t+1;o<n.length&&n[o]>>6===2;o++)a++;return a}return e==="OVERRUN"?n.length-t-1:0}function Aee(e,t,n,r,i){return e==="OVERLONG"?(k(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),JF(e,t,n,r,i))}var WF=Object.freeze({error:_ee,ignore:JF,replace:Aee});function Nee(e,t){t==null&&(t=WF.error);let n=ue(e,"bytes"),r=[],i=0;for(;i<n.length;){let a=n[i++];if(!(a>>7)){r.push(a);continue}let o=null,s=null;if((a&224)===192)o=1,s=127;else if((a&240)===224)o=2,s=2047;else if((a&248)===240)o=3,s=65535;else{(a&192)===128?i+=t("UNEXPECTED_CONTINUE",i-1,n,r):i+=t("BAD_PREFIX",i-1,n,r);continue}if(i-1+o>=n.length){i+=t("OVERRUN",i-1,n,r);continue}let u=a&(1<<8-o-1)-1;for(let l=0;l<o;l++){let c=n[i];if((c&192)!=128){i+=t("MISSING_CONTINUE",i,n,r),u=null;break}u=u<<6|c&63,i++}if(u!==null){if(u>1114111){i+=t("OUT_OF_RANGE",i-1-o,n,r,u);continue}if(u>=55296&&u<=57343){i+=t("UTF16_SURROGATE",i-1-o,n,r,u);continue}if(u<=s){i+=t("OVERLONG",i-1-o,n,r,u);continue}r.push(u)}}return r}function Dn(e,t){k(typeof e=="string","invalid string value","str",e),t!=null&&($1(t),e=e.normalize(t));let n=[];for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i<128)n.push(i);else if(i<2048)n.push(i>>6|192),n.push(i&63|128);else if((i&64512)==55296){r++;let a=e.charCodeAt(r);k(r<e.length&&(a&64512)===56320,"invalid surrogate pair","str",e);let o=65536+((i&1023)<<10)+(a&1023);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128)}return new Uint8Array(n)}function Iee(e){return e.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function xo(e,t){return Iee(Nee(e,t))}import Oee from"http";import Ree from"https";import{gunzipSync as Pee}from"zlib";function ly(e){async function t(n,r){B(r==null||!r.cancelled,"request cancelled before sending","CANCELLED");let i=n.url.split(":")[0].toLowerCase();B(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),B(i==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a=n.method,o=Object.assign({},n.headers),s={method:a,headers:o};e&&e.agent&&(s.agent=e.agent);let u=null;try{u=new AbortController,s.abort=u.signal}catch(d){console.log(d)}let l=(i==="http"?Oee:Ree).request(n.url,s);l.setTimeout(n.timeout);let c=n.body;return c&&l.write(Buffer.from(c)),l.end(),new Promise((d,f)=>{r&&r.addListener(()=>{u&&u.abort(),f(Je("request cancelled","CANCELLED"))}),l.on("timeout",()=>{let h;if(c)try{h=JSON.parse(Buffer.from(c).toString("utf8"))}catch{}f(Je("request timeout","TIMEOUT",{payload:h}))}),l.once("response",h=>{let g=h.statusCode||0,p=h.statusMessage||"",b=Object.keys(h.headers||{}).reduce((C,N)=>{let I=h.headers[N]||"";return Array.isArray(I)&&(I=I.join(", ")),C[N]=I,C},{}),v=null;h.on("data",C=>{if(r)try{r.checkSignal()}catch(N){return f(N)}if(v==null)v=C;else{let N=new Uint8Array(v.length+C.length);N.set(v,0),N.set(C,v.length),v=N}}),h.on("end",()=>{b["content-encoding"]==="gzip"&&v&&(v=ue(Pee(v))),d({statusCode:g,statusMessage:p,headers:b,body:v})}),h.on("error",C=>{C.response={statusCode:g,statusMessage:p,headers:b,body:v},f(C)})}),l.on("error",h=>{f(h)})})}return t}var lNe=ly({});var wee=12,xee=250,HF=ly(),Bee=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),Dee=new RegExp("^ipfs://(ipfs/)?(.*)$","i"),rA=!1;async function zF(e,t){try{let n=e.match(Bee);if(!n)throw new Error("invalid data");return new La(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?qF(n[3]):Mee(n[3]))}catch{return new La(599,"BAD REQUEST (invalid data: URI)",{},null,new cr(e))}}function QF(e){async function t(n,r){try{let i=n.match(Dee);if(!i)throw new Error("invalid link");return new cr(`${e}${i[2]}`)}catch{return new La(599,"BAD REQUEST (invalid IPFS URI)",{},null,new cr(n))}}return t}var cy={data:zF,ipfs:QF("https://gateway.ipfs.io/ipfs/")},KF=new WeakMap,fy=class{#e;#t;constructor(t){this.#e=[],this.#t=!1,KF.set(t,()=>{if(!this.#t){this.#t=!0;for(let n of this.#e)setTimeout(()=>{n()},0);this.#e=[]}})}addListener(t){B(!this.#t,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#e.push(t)}get cancelled(){return this.#t}checkSignal(){B(!this.cancelled,"cancelled","CANCELLED",{})}};function dy(e){if(e==null)throw new Error("missing signal; should not happen");return e.checkSignal(),e}var cr=class e{#e;#t;#n;#r;#a;#s;#i;#d;#l;#u;#o;#p;#c;#f;#h;get url(){return this.#s}set url(t){this.#s=String(t)}get body(){return this.#i==null?null:new Uint8Array(this.#i)}set body(t){if(t==null)this.#i=void 0,this.#d=void 0;else if(typeof t=="string")this.#i=Dn(t),this.#d="text/plain";else if(t instanceof Uint8Array)this.#i=t,this.#d="application/octet-stream";else if(typeof t=="object")this.#i=Dn(JSON.stringify(t)),this.#d="application/json";else throw new Error("invalid body")}hasBody(){return this.#i!=null}get method(){return this.#r?this.#r:this.hasBody()?"POST":"GET"}set method(t){t==null&&(t=""),this.#r=String(t).toUpperCase()}get headers(){let t=Object.assign({},this.#n);return this.#l&&(t.authorization=`Basic ${VF(Dn(this.#l))}`),this.allowGzip&&(t["accept-encoding"]="gzip"),t["content-type"]==null&&this.#d&&(t["content-type"]=this.#d),this.body&&(t["content-length"]=String(this.body.length)),t}getHeader(t){return this.headers[t.toLowerCase()]}setHeader(t,n){this.#n[String(t).toLowerCase()]=String(n)}clearHeaders(){this.#n={}}[Symbol.iterator](){let t=this.headers,n=Object.keys(t),r=0;return{next:()=>{if(r<n.length){let i=n[r++];return{value:[i,t[i]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#l||null}setCredentials(t,n){k(!t.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#l=`${t}:${n}`}get allowGzip(){return this.#t}set allowGzip(t){this.#t=!!t}get allowInsecureAuthentication(){return!!this.#e}set allowInsecureAuthentication(t){this.#e=!!t}get timeout(){return this.#a}set timeout(t){k(t>=0,"timeout must be non-zero","timeout",t),this.#a=t}get preflightFunc(){return this.#u||null}set preflightFunc(t){this.#u=t}get processFunc(){return this.#o||null}set processFunc(t){this.#o=t}get retryFunc(){return this.#p||null}set retryFunc(t){this.#p=t}get getUrlFunc(){return this.#h||HF}set getUrlFunc(t){this.#h=t}constructor(t){this.#s=String(t),this.#e=!1,this.#t=!0,this.#n={},this.#r="",this.#a=3e5,this.#f={slotInterval:xee,maxAttempts:wee},this.#h=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#i?W(this.#i):"null"}>`}setThrottleParams(t){t.slotInterval!=null&&(this.#f.slotInterval=t.slotInterval),t.maxAttempts!=null&&(this.#f.maxAttempts=t.maxAttempts)}async#m(t,n,r,i,a){if(t>=this.#f.maxAttempts)return a.makeServerError("exceeded maximum retry limit");B(GF()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await Lee(r);let o=this.clone(),s=(o.url.split(":")[0]||"").toLowerCase();if(s in cy){let c=await cy[s](o.url,dy(i.#c));if(c instanceof La){let d=c;if(this.processFunc){dy(i.#c);try{d=await this.processFunc(o,d)}catch(f){(f.throttle==null||typeof f.stall!="number")&&d.makeServerError("error in post-processing function",f).assertOk()}}return d}o=c}this.preflightFunc&&(o=await this.preflightFunc(o));let u=await this.getUrlFunc(o,dy(i.#c)),l=new La(u.statusCode,u.statusMessage,u.headers,u.body,i);if(l.statusCode===301||l.statusCode===302){try{let c=l.headers.location||"";return o.redirect(c).#m(t+1,n,0,i,l)}catch{}return l}else if(l.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,l,t))){let c=l.headers["retry-after"],d=this.#f.slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return typeof c=="string"&&c.match(/^[1-9][0-9]*$/)&&(d=parseInt(c)),o.clone().#m(t+1,n,d,i,l)}if(this.processFunc){dy(i.#c);try{l=await this.processFunc(o,l)}catch(c){(c.throttle==null||typeof c.stall!="number")&&l.makeServerError("error in post-processing function",c).assertOk();let d=this.#f.slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return c.stall>=0&&(d=c.stall),o.clone().#m(t+1,n,d,i,l)}}return l}send(){return B(this.#c==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#c=new fy(this),this.#m(0,GF()+this.timeout,0,this,new La(0,"",{},null,this))}cancel(){B(this.#c!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});let t=KF.get(this);if(!t)throw new Error("missing signal; should not happen");t()}redirect(t){let n=this.url.split(":")[0].toLowerCase(),r=t.split(":")[0].toLowerCase();B(this.method==="GET"&&(n!=="https"||r!=="http")&&t.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(t)})`});let i=new e(t);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,i.#n=Object.assign({},this.#n),this.#i&&(i.#i=new Uint8Array(this.#i)),i.#d=this.#d,i}clone(){let t=new e(this.url);return t.#r=this.#r,this.#i&&(t.#i=this.#i),t.#d=this.#d,t.#n=Object.assign({},this.#n),t.#l=this.#l,this.allowGzip&&(t.allowGzip=!0),t.timeout=this.timeout,this.allowInsecureAuthentication&&(t.allowInsecureAuthentication=!0),t.#u=this.#u,t.#o=this.#o,t.#p=this.#p,t.#f=Object.assign({},this.#f),t.#h=this.#h,t}static lockConfig(){rA=!0}static getGateway(t){return cy[t.toLowerCase()]||null}static registerGateway(t,n){if(t=t.toLowerCase(),t==="http"||t==="https")throw new Error(`cannot intercept ${t}; use registerGetUrl`);if(rA)throw new Error("gateways locked");cy[t]=n}static registerGetUrl(t){if(rA)throw new Error("gateways locked");HF=t}static createGetUrlFunc(t){return ly(t)}static createDataGateway(){return zF}static createIpfsGatewayFunc(t){return QF(t)}},La=class e{#e;#t;#n;#r;#a;#s;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#r?W(this.#r):"null"}>`}get statusCode(){return this.#e}get statusMessage(){return this.#t}get headers(){return Object.assign({},this.#n)}get body(){return this.#r==null?null:new Uint8Array(this.#r)}get bodyText(){try{return this.#r==null?"":xo(this.#r)}catch{B(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{B(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){let t=this.headers,n=Object.keys(t),r=0;return{next:()=>{if(r<n.length){let i=n[r++];return{value:[i,t[i]],done:!1}}return{value:void 0,done:!0}}}}constructor(t,n,r,i,a){this.#e=t,this.#t=n,this.#n=Object.keys(r).reduce((o,s)=>(o[s.toLowerCase()]=String(r[s]),o),{}),this.#r=i==null?null:new Uint8Array(i),this.#a=a||null,this.#s={message:""}}makeServerError(t,n){let r;t?r=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${t})`:(t=`${this.statusCode} ${this.statusMessage}`,r=`CLIENT ESCALATED SERVER ERROR (${t})`);let i=new e(599,r,this.headers,this.body,this.#a||void 0);return i.#s={message:t,error:n},i}throwThrottleError(t,n){n==null?n=-1:k(Number.isInteger(n)&&n>=0,"invalid stall timeout","stall",n);let r=new Error(t||"throttling requests");throw K(r,{stall:n,throttle:!0}),r}getHeader(t){return this.headers[t.toLowerCase()]}hasBody(){return this.#r!=null}get request(){return this.#a}ok(){return this.#s.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:t,error:n}=this.#s;t===""&&(t=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let i=null;try{this.#r&&(i=xo(this.#r))}catch{}B(!1,t,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};function GF(){return new Date().getTime()}function Mee(e){return Dn(e.replace(/%([0-9a-f][0-9a-f])/gi,(t,n)=>String.fromCharCode(parseInt(n,16))))}function Lee(e){return new Promise(t=>setTimeout(t,e))}function Fee(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function ZF(e,t,n){let r=0;for(let i=0;i<n;i++)r=r*256+e[t+i];return r}function YF(e,t,n,r){let i=[];for(;n<t+1+r;){let a=XF(e,n);i.push(a.result),n+=a.consumed,B(n<=t+1+r,"child data too short","BUFFER_OVERRUN",{buffer:e,length:r,offset:t})}return{consumed:1+r,result:i}}function XF(e,t){B(e.length!==0,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});let n=r=>{B(r<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:r})};if(e[t]>=248){let r=e[t]-247;n(t+1+r);let i=ZF(e,t+1,r);return n(t+1+r+i),YF(e,t,t+1+r,r+i)}else if(e[t]>=192){let r=e[t]-192;return n(t+1+r),YF(e,t,t+1,r)}else if(e[t]>=184){let r=e[t]-183;n(t+1+r);let i=ZF(e,t+1,r);n(t+1+r+i);let a=W(e.slice(t+1+r,t+1+r+i));return{consumed:1+r+i,result:a}}else if(e[t]>=128){let r=e[t]-128;n(t+1+r);let i=W(e.slice(t+1,t+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:Fee(e[t])}}function nf(e){let t=ue(e,"data"),n=XF(t,0);return k(n.consumed===t.length,"unexpected junk after rlp payload","data",e),n.result}function $F(e){let t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function eU(e){if(Array.isArray(e)){let r=[];if(e.forEach(function(a){r=r.concat(eU(a))}),r.length<=55)return r.unshift(192+r.length),r;let i=$F(r.length);return i.unshift(247+i.length),i.concat(r)}let t=Array.prototype.slice.call(ue(e,"object"));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;let n=$F(t.length);return n.unshift(183+n.length),n.concat(t)}var jF="0123456789abcdef";function oa(e){let t="0x";for(let n of eU(e))t+=jF[n>>4],t+=jF[n&15];return t}var en=32,iA=new Uint8Array(en),Uee=["then"],hy={},rU=new WeakMap;function iu(e){return rU.get(e)}function tU(e,t){rU.set(e,t)}function Cp(e,t){let n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw n.error=t,n}function aA(e,t,n){return e.indexOf(null)>=0?t.map((r,i)=>r instanceof sa?aA(iu(r),r,n):r):e.reduce((r,i,a)=>{let o=t.getValue(i);return i in r||(n&&o instanceof sa&&(o=aA(iu(o),o,n)),r[i]=o),r},{})}var sa=class e extends Array{#e;constructor(...t){let n=t[0],r=t[1],i=(t[2]||[]).slice(),a=!0;n!==hy&&(r=t,i=[],a=!1),super(r.length),r.forEach((u,l)=>{this[l]=u});let o=i.reduce((u,l)=>(typeof l=="string"&&u.set(l,(u.get(l)||0)+1),u),new Map);if(tU(this,Object.freeze(r.map((u,l)=>{let c=i[l];return c!=null&&o.get(c)===1?c:null}))),this.#e=[],this.#e==null&&this.#e,!a)return;Object.freeze(this);let s=new Proxy(this,{get:(u,l,c)=>{if(typeof l=="string"){if(l.match(/^[0-9]+$/)){let f=pe(l,"%index");if(f<0||f>=this.length)throw new RangeError("out of result range");let h=u[f];return h instanceof Error&&Cp(`index ${f}`,h),h}if(Uee.indexOf(l)>=0)return Reflect.get(u,l,c);let d=u[l];if(d instanceof Function)return function(...f){return d.apply(this===c?u:this,f)};if(!(l in u))return u.getValue.apply(this===c?u:this,[l])}return Reflect.get(u,l,c)}});return tU(s,iu(this)),s}toArray(t){let n=[];return this.forEach((r,i)=>{r instanceof Error&&Cp(`index ${i}`,r),t&&r instanceof e&&(r=r.toArray(t)),n.push(r)}),n}toObject(t){let n=iu(this);return n.reduce((r,i,a)=>(B(i!=null,`value at index ${a} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),aA(n,this,t)),{})}slice(t,n){t==null&&(t=0),t<0&&(t+=this.length,t<0&&(t=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);let r=iu(this),i=[],a=[];for(let o=t;o<n;o++)i.push(this[o]),a.push(r[o]);return new e(hy,i,a)}filter(t,n){let r=iu(this),i=[],a=[];for(let o=0;o<this.length;o++){let s=this[o];s instanceof Error&&Cp(`index ${o}`,s),t.call(n,s,o,this)&&(i.push(s),a.push(r[o]))}return new e(hy,i,a)}map(t,n){let r=[];for(let i=0;i<this.length;i++){let a=this[i];a instanceof Error&&Cp(`index ${i}`,a),r.push(t.call(n,a,i,this))}return r}getValue(t){let n=iu(this).indexOf(t);if(n===-1)return;let r=this[n];return r instanceof Error&&Cp(`property ${JSON.stringify(t)}`,r.error),r}static fromItems(t,n){return new e(hy,t,n)}};function nU(e){let t=Ot(e);return B(t.length<=en,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:en,offset:t.length}),t.length!==en&&(t=ht(Ue([iA.slice(t.length%en),t]))),t}var Rt=class{name;type;localName;dynamic;constructor(t,n,r,i){K(this,{name:t,type:n,localName:r,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,n){k(!1,t,this.localName,n)}},au=class{#e;#t;constructor(){this.#e=[],this.#t=0}get data(){return Ue(this.#e)}get length(){return this.#t}#n(t){return this.#e.push(t),this.#t+=t.length,t.length}appendWriter(t){return this.#n(ht(t.data))}writeBytes(t){let n=ht(t),r=n.length%en;return r&&(n=ht(Ue([n,iA.slice(r)]))),this.#n(n)}writeValue(t){return this.#n(nU(t))}writeUpdatableValue(){let t=this.#e.length;return this.#e.push(iA),this.#t+=en,n=>{this.#e[t]=nU(n)}}},py=class e{allowLoose;#e;#t;#n;#r;#a;constructor(t,n,r){K(this,{allowLoose:!!n}),this.#e=ht(t),this.#n=0,this.#r=null,this.#a=r??1024,this.#t=0}get data(){return W(this.#e)}get dataLength(){return this.#e.length}get consumed(){return this.#t}get bytes(){return new Uint8Array(this.#e)}#s(t){if(this.#r)return this.#r.#s(t);this.#n+=t,B(this.#a<1||this.#n<=this.#a*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#a} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:ht(this.#e),offset:this.#t,length:t,info:{bytesRead:this.#n,dataLength:this.dataLength}})}#i(t,n,r){let i=Math.ceil(n/en)*en;return this.#t+i>this.#e.length&&(this.allowLoose&&r&&this.#t+n<=this.#e.length?i=n:B(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:ht(this.#e),length:this.#e.length,offset:this.#t+i})),this.#e.slice(this.#t,this.#t+i)}subReader(t){let n=new e(this.#e.slice(this.#t+t),this.allowLoose,this.#a);return n.#r=this,n}readBytes(t,n){let r=this.#i(0,t,!!n);return this.#s(t),this.#t+=r.length,r.slice(0,t)}readValue(){return tf(this.readBytes(en))}readIndex(){return tA(this.readBytes(en))}};import{createHash as oA,createHmac as JNe,pbkdf2Sync as WNe,randomBytes as HNe}from"crypto";function kp(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function _p(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function iU(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");kp(e.outputLen),kp(e.blockLen)}function Fa(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function my(e,t){_p(e);let n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}var gy=BigInt(4294967295),aU=BigInt(32);function qee(e,t=!1){return t?{h:Number(e&gy),l:Number(e>>aU&gy)}:{h:Number(e>>aU&gy)|0,l:Number(e&gy)|0}}function oU(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:a,l:o}=qee(e[i],t);[n[i],r[i]]=[a,o]}return[n,r]}var sU=(e,t,n)=>e<<n|t>>>32-n,uU=(e,t,n)=>t<<n|e>>>32-n,lU=(e,t,n)=>t<<n-32|e>>>64-n,cU=(e,t,n)=>e<<n-32|t>>>64-n;import*as Ap from"node:crypto";var yy=Ap&&typeof Ap=="object"&&"webcrypto"in Ap?Ap.webcrypto:void 0;var dU=e=>e instanceof Uint8Array;var fU=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),vy=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),_i=(e,t)=>e<<32-t|e>>>t,Vee=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Vee)throw new Error("Non little-endian hardware is not supported");function Jee(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Do(e){if(typeof e=="string"&&(e=Jee(e)),!dU(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function hU(...e){let t=new Uint8Array(e.reduce((r,i)=>r+i.length,0)),n=0;return e.forEach(r=>{if(!dU(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}var Bo=class{clone(){return this._cloneInto()}},ZNe={}.toString;function Sy(e){let t=r=>e().update(Do(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function pU(e){let t=(r,i)=>e(i).update(Do(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}function mU(e=32){if(yy&&typeof yy.getRandomValues=="function")return yy.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}var[vU,SU,bU]=[[],[],[]],Wee=BigInt(0),Np=BigInt(1),Hee=BigInt(2),Gee=BigInt(7),zee=BigInt(256),Qee=BigInt(113);for(let e=0,t=Np,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],vU.push(2*(5*r+n)),SU.push((e+1)*(e+2)/2%64);let i=Wee;for(let a=0;a<7;a++)t=(t<<Np^(t>>Gee)*Qee)%zee,t&Hee&&(i^=Np<<(Np<<BigInt(a))-Np);bU.push(i)}var[Kee,Zee]=oU(bU,!0),gU=(e,t,n)=>n>32?lU(e,t,n):sU(e,t,n),yU=(e,t,n)=>n>32?cU(e,t,n):uU(e,t,n);function Yee(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){let s=(o+8)%10,u=(o+2)%10,l=n[u],c=n[u+1],d=gU(l,c,1)^n[s],f=yU(l,c,1)^n[s+1];for(let h=0;h<50;h+=10)e[o+h]^=d,e[o+h+1]^=f}let i=e[2],a=e[3];for(let o=0;o<24;o++){let s=SU[o],u=gU(i,a,s),l=yU(i,a,s),c=vU[o];i=e[c],a=e[c+1],e[c]=u,e[c+1]=l}for(let o=0;o<50;o+=10){for(let s=0;s<10;s++)n[s]=e[o+s];for(let s=0;s<10;s++)e[o+s]^=~n[(s+2)%10]&n[(s+4)%10]}e[0]^=Kee[r],e[1]^=Zee[r]}n.fill(0)}var by=class e extends Bo{constructor(t,n,r,i=!1,a=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,kp(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=fU(this.state)}keccak(){Yee(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){Fa(this);let{blockLen:n,state:r}=this;t=Do(t);let i=t.length;for(let a=0;a<i;){let o=Math.min(n-this.pos,i-a);for(let s=0;s<o;s++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:n,pos:r,blockLen:i}=this;t[r]^=n,n&128&&r===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){Fa(this,!1),_p(t),this.finish();let n=this.state,{blockLen:r}=this;for(let i=0,a=t.length;i<a;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,a-i);t.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return kp(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(my(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return t||(t=new e(n,r,i,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}},Mo=(e,t,n)=>Sy(()=>new by(t,e,n)),eIe=Mo(6,144,224/8),tIe=Mo(6,136,256/8),nIe=Mo(6,104,384/8),rIe=Mo(6,72,512/8),iIe=Mo(1,144,224/8),TU=Mo(1,136,256/8),aIe=Mo(1,104,384/8),oIe=Mo(1,72,512/8),EU=(e,t,n)=>pU((r={})=>new by(t,e,r.dkLen===void 0?n:r.dkLen,!0)),sIe=EU(31,168,128/8),uIe=EU(31,136,256/8);var CU=!1,kU=function(e){return TU(e)},_U=kU;function We(e){let t=ue(e,"data");return W(_U(t))}We._=kU;We.lock=function(){CU=!0};We.register=function(e){if(CU)throw new TypeError("keccak256 is locked");_U=e};Object.freeze(We);function Xee(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),u=r?4:0,l=r?0:4;e.setUint32(t+u,o,r),e.setUint32(t+l,s,r)}var Ty=class extends Bo{constructor(t,n,r,i){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=vy(this.buffer)}update(t){Fa(this);let{view:n,buffer:r,blockLen:i}=this;t=Do(t);let a=t.length;for(let o=0;o<a;){let s=Math.min(i-this.pos,a-o);if(s===i){let u=vy(t);for(;i<=a-o;o+=i)this.process(u,o);continue}r.set(t.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Fa(this),my(t,this),this.finished=!0;let{buffer:n,view:r,blockLen:i,isLE:a}=this,{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(r,0),o=0);for(let d=o;d<i;d++)n[d]=0;Xee(r,i-8,BigInt(this.length*8),a),this.process(r,0);let s=vy(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let l=u/4,c=this.get();if(l>c.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)s.setUint32(4*d,c[d],a)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:n,buffer:r,length:i,finished:a,destroyed:o,pos:s}=this;return t.length=i,t.pos=s,t.finished=a,t.destroyed=o,i%n&&t.buffer.set(r),t}};var $ee=(e,t,n)=>e&t^~e&n,jee=(e,t,n)=>e&t^e&n^t&n,ete=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Lo=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Fo=new Uint32Array(64),sA=class extends Ty{constructor(){super(64,32,8,!1),this.A=Lo[0]|0,this.B=Lo[1]|0,this.C=Lo[2]|0,this.D=Lo[3]|0,this.E=Lo[4]|0,this.F=Lo[5]|0,this.G=Lo[6]|0,this.H=Lo[7]|0}get(){let{A:t,B:n,C:r,D:i,E:a,F:o,G:s,H:u}=this;return[t,n,r,i,a,o,s,u]}set(t,n,r,i,a,o,s,u){this.A=t|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=a|0,this.F=o|0,this.G=s|0,this.H=u|0}process(t,n){for(let d=0;d<16;d++,n+=4)Fo[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){let f=Fo[d-15],h=Fo[d-2],g=_i(f,7)^_i(f,18)^f>>>3,p=_i(h,17)^_i(h,19)^h>>>10;Fo[d]=p+Fo[d-7]+g+Fo[d-16]|0}let{A:r,B:i,C:a,D:o,E:s,F:u,G:l,H:c}=this;for(let d=0;d<64;d++){let f=_i(s,6)^_i(s,11)^_i(s,25),h=c+f+$ee(s,u,l)+ete[d]+Fo[d]|0,p=(_i(r,2)^_i(r,13)^_i(r,22))+jee(r,i,a)|0;c=l,l=u,u=s,s=o+h|0,o=a,a=i,i=r,r=h+p|0}r=r+this.A|0,i=i+this.B|0,a=a+this.C|0,o=o+this.D|0,s=s+this.E|0,u=u+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(r,i,a,o,s,u,l,c)}roundClean(){Fo.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var AU=Sy(()=>new sA);var Ey=class extends Bo{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,iU(t);let r=Do(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,a=new Uint8Array(i);a.set(r.length>i?t.create().update(r).digest():r);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=t.create();for(let o=0;o<a.length;o++)a[o]^=106;this.oHash.update(a),a.fill(0)}update(t){return Fa(this),this.iHash.update(t),this}digestInto(t){Fa(this),_p(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:n,iHash:r,finished:i,destroyed:a,blockLen:o,outputLen:s}=this;return t=t,t.finished=i,t.destroyed=a,t.blockLen=o,t.outputLen=s,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},uA=(e,t,n)=>new Ey(e,t).update(n).digest();uA.create=(e,t)=>new Ey(e,t);var NU=function(e){return oA("sha256").update(e).digest()},IU=function(e){return oA("sha512").update(e).digest()},OU=NU,RU=IU,PU=!1,wU=!1;function Uo(e){let t=ue(e,"data");return W(OU(t))}Uo._=NU;Uo.lock=function(){PU=!0};Uo.register=function(e){if(PU)throw new Error("sha256 is locked");OU=e};Object.freeze(Uo);function Cy(e){let t=ue(e,"data");return W(RU(t))}Cy._=IU;Cy.lock=function(){wU=!0};Cy.register=function(e){if(wU)throw new Error("sha512 is locked");RU=e};Object.freeze(Uo);var fA={};gh(fA,{bitGet:()=>ste,bitLen:()=>ote,bitMask:()=>Ip,bitSet:()=>ute,bytesToHex:()=>ou,bytesToNumberBE:()=>Ua,bytesToNumberLE:()=>Ay,concatBytes:()=>rf,createHmacDrbg:()=>dA,ensureBytes:()=>dr,equalBytes:()=>ite,hexToBytes:()=>su,hexToNumber:()=>cA,numberToBytesBE:()=>qo,numberToBytesLE:()=>Ny,numberToHexUnpadded:()=>DU,numberToVarBytesBE:()=>rte,utf8ToBytes:()=>ate,validateObject:()=>Vo});var BU=BigInt(0),ky=BigInt(1),tte=BigInt(2),_y=e=>e instanceof Uint8Array,nte=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ou(e){if(!_y(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=nte[e[n]];return t}function DU(e){let t=e.toString(16);return t.length&1?`0${t}`:t}function cA(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}function su(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(t/2);for(let r=0;r<n.length;r++){let i=r*2,a=e.slice(i,i+2),o=Number.parseInt(a,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");n[r]=o}return n}function Ua(e){return cA(ou(e))}function Ay(e){if(!_y(e))throw new Error("Uint8Array expected");return cA(ou(Uint8Array.from(e).reverse()))}function qo(e,t){return su(e.toString(16).padStart(t*2,"0"))}function Ny(e,t){return qo(e,t).reverse()}function rte(e){return su(DU(e))}function dr(e,t,n){let r;if(typeof t=="string")try{r=su(t)}catch(a){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${a}`)}else if(_y(t))r=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);let i=r.length;if(typeof n=="number"&&i!==n)throw new Error(`${e} expected ${n} bytes, got ${i}`);return r}function rf(...e){let t=new Uint8Array(e.reduce((r,i)=>r+i.length,0)),n=0;return e.forEach(r=>{if(!_y(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function ite(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ate(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function ote(e){let t;for(t=0;e>BU;e>>=ky,t+=1);return t}function ste(e,t){return e>>BigInt(t)&ky}var ute=(e,t,n)=>e|(n?ky:BU)<<BigInt(t),Ip=e=>(tte<<BigInt(e-1))-ky,lA=e=>new Uint8Array(e),xU=e=>Uint8Array.from(e);function dA(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=lA(e),i=lA(e),a=0,o=()=>{r.fill(1),i.fill(0),a=0},s=(...d)=>n(i,r,...d),u=(d=lA())=>{i=s(xU([0]),d),r=s(),d.length!==0&&(i=s(xU([1]),d),r=s())},l=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let d=0,f=[];for(;d<t;){r=s();let h=r.slice();f.push(h),d+=r.length}return rf(...f)};return(d,f)=>{o(),u(d);let h;for(;!(h=f(l()));)u();return o(),h}}var lte={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Vo(e,t,n={}){let r=(i,a,o)=>{let s=lte[a];if(typeof s!="function")throw new Error(`Invalid validator "${a}", expected function`);let u=e[i];if(!(o&&u===void 0)&&!s(u,e))throw new Error(`Invalid param ${String(i)}=${u} (${typeof u}), expected ${a}`)};for(let[i,a]of Object.entries(t))r(i,a,!1);for(let[i,a]of Object.entries(n))r(i,a,!0);return e}var Ft=BigInt(0),mt=BigInt(1),uu=BigInt(2),cte=BigInt(3),hA=BigInt(4),MU=BigInt(5),LU=BigInt(8),dte=BigInt(9),fte=BigInt(16);function En(e,t){let n=e%t;return n>=Ft?n:t+n}function hte(e,t,n){if(n<=Ft||t<Ft)throw new Error("Expected power/modulo > 0");if(n===mt)return Ft;let r=mt;for(;t>Ft;)t&mt&&(r=r*e%n),e=e*e%n,t>>=mt;return r}function fr(e,t,n){let r=e;for(;t-- >Ft;)r*=r,r%=n;return r}function Iy(e,t){if(e===Ft||t<=Ft)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=En(e,t),r=t,i=Ft,a=mt,o=mt,s=Ft;for(;n!==Ft;){let l=r/n,c=r%n,d=i-o*l,f=a-s*l;r=n,n=c,i=o,a=s,o=d,s=f}if(r!==mt)throw new Error("invert: does not exist");return En(i,t)}function pte(e){let t=(e-mt)/uu,n,r,i;for(n=e-mt,r=0;n%uu===Ft;n/=uu,r++);for(i=uu;i<e&&hte(i,t,e)!==e-mt;i++);if(r===1){let o=(e+mt)/hA;return function(u,l){let c=u.pow(l,o);if(!u.eql(u.sqr(c),l))throw new Error("Cannot find square root");return c}}let a=(n+mt)/uu;return function(s,u){if(s.pow(u,t)===s.neg(s.ONE))throw new Error("Cannot find square root");let l=r,c=s.pow(s.mul(s.ONE,i),n),d=s.pow(u,a),f=s.pow(u,n);for(;!s.eql(f,s.ONE);){if(s.eql(f,s.ZERO))return s.ZERO;let h=1;for(let p=s.sqr(f);h<l&&!s.eql(p,s.ONE);h++)p=s.sqr(p);let g=s.pow(c,mt<<BigInt(l-h-1));c=s.sqr(g),d=s.mul(d,g),f=s.mul(f,c),l=h}return d}}function mte(e){if(e%hA===cte){let t=(e+mt)/hA;return function(r,i){let a=r.pow(i,t);if(!r.eql(r.sqr(a),i))throw new Error("Cannot find square root");return a}}if(e%LU===MU){let t=(e-MU)/LU;return function(r,i){let a=r.mul(i,uu),o=r.pow(a,t),s=r.mul(i,o),u=r.mul(r.mul(s,uu),o),l=r.mul(s,r.sub(u,r.ONE));if(!r.eql(r.sqr(l),i))throw new Error("Cannot find square root");return l}}return e%fte,pte(e)}var gte=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function pA(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=gte.reduce((r,i)=>(r[i]="function",r),t);return Vo(e,n)}function yte(e,t,n){if(n<Ft)throw new Error("Expected power > 0");if(n===Ft)return e.ONE;if(n===mt)return t;let r=e.ONE,i=t;for(;n>Ft;)n&mt&&(r=e.mul(r,i)),i=e.sqr(i),n>>=mt;return r}function vte(e,t){let n=new Array(t.length),r=t.reduce((a,o,s)=>e.is0(o)?a:(n[s]=a,e.mul(a,o)),e.ONE),i=e.inv(r);return t.reduceRight((a,o,s)=>e.is0(o)?a:(n[s]=e.mul(a,n[s]),e.mul(a,o)),i),n}function mA(e,t){let n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function FU(e,t,n=!1,r={}){if(e<=Ft)throw new Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:i,nByteLength:a}=mA(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=mte(e),s=Object.freeze({ORDER:e,BITS:i,BYTES:a,MASK:Ip(i),ZERO:Ft,ONE:mt,create:u=>En(u,e),isValid:u=>{if(typeof u!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof u}`);return Ft<=u&&u<e},is0:u=>u===Ft,isOdd:u=>(u&mt)===mt,neg:u=>En(-u,e),eql:(u,l)=>u===l,sqr:u=>En(u*u,e),add:(u,l)=>En(u+l,e),sub:(u,l)=>En(u-l,e),mul:(u,l)=>En(u*l,e),pow:(u,l)=>yte(s,u,l),div:(u,l)=>En(u*Iy(l,e),e),sqrN:u=>u*u,addN:(u,l)=>u+l,subN:(u,l)=>u-l,mulN:(u,l)=>u*l,inv:u=>Iy(u,e),sqrt:r.sqrt||(u=>o(s,u)),invertBatch:u=>vte(s,u),cmov:(u,l,c)=>c?l:u,toBytes:u=>n?Ny(u,a):qo(u,a),fromBytes:u=>{if(u.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${u.length}`);return n?Ay(u):Ua(u)}});return Object.freeze(s)}function UU(e){if(typeof e!="bigint")throw new Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function gA(e){let t=UU(e);return t+Math.ceil(t/2)}function qU(e,t,n=!1){let r=e.length,i=UU(t),a=gA(t);if(r<16||r<a||r>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);let o=n?Ua(e):Ay(e),s=En(o,t-mt)+mt;return n?Ny(s,i):qo(s,i)}var bte=BigInt(0),yA=BigInt(1);function VU(e,t){let n=(i,a)=>{let o=a.negate();return i?o:a},r=i=>{let a=Math.ceil(t/i)+1,o=2**(i-1);return{windows:a,windowSize:o}};return{constTimeNegate:n,unsafeLadder(i,a){let o=e.ZERO,s=i;for(;a>bte;)a&yA&&(o=o.add(s)),s=s.double(),a>>=yA;return o},precomputeWindow(i,a){let{windows:o,windowSize:s}=r(a),u=[],l=i,c=l;for(let d=0;d<o;d++){c=l,u.push(c);for(let f=1;f<s;f++)c=c.add(l),u.push(c);l=c.double()}return u},wNAF(i,a,o){let{windows:s,windowSize:u}=r(i),l=e.ZERO,c=e.BASE,d=BigInt(2**i-1),f=2**i,h=BigInt(i);for(let g=0;g<s;g++){let p=g*u,b=Number(o&d);o>>=h,b>u&&(b-=f,o+=yA);let v=p,C=p+Math.abs(b)-1,N=g%2!==0,I=b<0;b===0?c=c.add(n(N,a[v])):l=l.add(n(I,a[C]))}return{p:l,f:c}},wNAFCached(i,a,o,s){let u=i._WINDOW_SIZE||1,l=a.get(i);return l||(l=this.precomputeWindow(i,u),u!==1&&a.set(i,s(l))),this.wNAF(u,l,o)}}}function vA(e){return pA(e.Fp),Vo(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...mA(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function Tte(e){let t=vA(e);Vo(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}var{bytesToNumberBE:Ete,hexToBytes:Cte}=fA,lu={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){let{Err:t}=lu;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");let n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Ete(r),l:e.subarray(n+2)}},toSig(e){let{Err:t}=lu,n=typeof e=="string"?Cte(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");let{d:i,l:a}=lu._parseInt(n.subarray(2)),{d:o,l:s}=lu._parseInt(a);if(s.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(e){let t=l=>Number.parseInt(l[0],16)&8?"00"+l:l,n=l=>{let c=l.toString(16);return c.length&1?`0${c}`:c},r=t(n(e.s)),i=t(n(e.r)),a=r.length/2,o=i.length/2,s=n(a),u=n(o);return`30${n(o+a+4)}02${u}${i}02${s}${r}`}},qa=BigInt(0),Lr=BigInt(1),wIe=BigInt(2),JU=BigInt(3),xIe=BigInt(4);function kte(e){let t=Tte(e),{Fp:n}=t,r=t.toBytes||((g,p,b)=>{let v=p.toAffine();return rf(Uint8Array.from([4]),n.toBytes(v.x),n.toBytes(v.y))}),i=t.fromBytes||(g=>{let p=g.subarray(1),b=n.fromBytes(p.subarray(0,n.BYTES)),v=n.fromBytes(p.subarray(n.BYTES,2*n.BYTES));return{x:b,y:v}});function a(g){let{a:p,b}=t,v=n.sqr(g),C=n.mul(v,g);return n.add(n.add(C,n.mul(g,p)),b)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function o(g){return typeof g=="bigint"&&qa<g&&g<t.n}function s(g){if(!o(g))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function u(g){let{allowedPrivateKeyLengths:p,nByteLength:b,wrapPrivateKey:v,n:C}=t;if(p&&typeof g!="bigint"){if(g instanceof Uint8Array&&(g=ou(g)),typeof g!="string"||!p.includes(g.length))throw new Error("Invalid key");g=g.padStart(b*2,"0")}let N;try{N=typeof g=="bigint"?g:Ua(dr("private key",g,b))}catch{throw new Error(`private key must be ${b} bytes, hex or bigint, not ${typeof g}`)}return v&&(N=En(N,C)),s(N),N}let l=new Map;function c(g){if(!(g instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(p,b,v){if(this.px=p,this.py=b,this.pz=v,p==null||!n.isValid(p))throw new Error("x required");if(b==null||!n.isValid(b))throw new Error("y required");if(v==null||!n.isValid(v))throw new Error("z required")}static fromAffine(p){let{x:b,y:v}=p||{};if(!p||!n.isValid(b)||!n.isValid(v))throw new Error("invalid affine point");if(p instanceof d)throw new Error("projective point not allowed");let C=N=>n.eql(N,n.ZERO);return C(b)&&C(v)?d.ZERO:new d(b,v,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let b=n.invertBatch(p.map(v=>v.pz));return p.map((v,C)=>v.toAffine(b[C])).map(d.fromAffine)}static fromHex(p){let b=d.fromAffine(i(dr("pointHex",p)));return b.assertValidity(),b}static fromPrivateKey(p){return d.BASE.multiply(u(p))}_setWindowSize(p){this._WINDOW_SIZE=p,l.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y:b}=this.toAffine();if(!n.isValid(p)||!n.isValid(b))throw new Error("bad point: x or y not FE");let v=n.sqr(b),C=a(p);if(!n.eql(v,C))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(n.isOdd)return!n.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){c(p);let{px:b,py:v,pz:C}=this,{px:N,py:I,pz:M}=p,x=n.eql(n.mul(b,M),n.mul(N,C)),U=n.eql(n.mul(v,M),n.mul(I,C));return x&&U}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){let{a:p,b}=t,v=n.mul(b,JU),{px:C,py:N,pz:I}=this,M=n.ZERO,x=n.ZERO,U=n.ZERO,G=n.mul(C,C),le=n.mul(N,N),j=n.mul(I,I),w=n.mul(C,N);return w=n.add(w,w),U=n.mul(C,I),U=n.add(U,U),M=n.mul(p,U),x=n.mul(v,j),x=n.add(M,x),M=n.sub(le,x),x=n.add(le,x),x=n.mul(M,x),M=n.mul(w,M),U=n.mul(v,U),j=n.mul(p,j),w=n.sub(G,j),w=n.mul(p,w),w=n.add(w,U),U=n.add(G,G),G=n.add(U,G),G=n.add(G,j),G=n.mul(G,w),x=n.add(x,G),j=n.mul(N,I),j=n.add(j,j),G=n.mul(j,w),M=n.sub(M,G),U=n.mul(j,le),U=n.add(U,U),U=n.add(U,U),new d(M,x,U)}add(p){c(p);let{px:b,py:v,pz:C}=this,{px:N,py:I,pz:M}=p,x=n.ZERO,U=n.ZERO,G=n.ZERO,le=t.a,j=n.mul(t.b,JU),w=n.mul(b,N),Ee=n.mul(v,I),D=n.mul(C,M),E=n.add(b,v),R=n.add(N,I);E=n.mul(E,R),R=n.add(w,Ee),E=n.sub(E,R),R=n.add(b,C);let q=n.add(N,M);return R=n.mul(R,q),q=n.add(w,D),R=n.sub(R,q),q=n.add(v,C),x=n.add(I,M),q=n.mul(q,x),x=n.add(Ee,D),q=n.sub(q,x),G=n.mul(le,R),x=n.mul(j,D),G=n.add(x,G),x=n.sub(Ee,G),G=n.add(Ee,G),U=n.mul(x,G),Ee=n.add(w,w),Ee=n.add(Ee,w),D=n.mul(le,D),R=n.mul(j,R),Ee=n.add(Ee,D),D=n.sub(w,D),D=n.mul(le,D),R=n.add(R,D),w=n.mul(Ee,R),U=n.add(U,w),w=n.mul(q,R),x=n.mul(E,x),x=n.sub(x,w),w=n.mul(E,Ee),G=n.mul(q,G),G=n.add(G,w),new d(x,U,G)}subtract(p){return this.add(p.negate())}is0(){return this.equals(d.ZERO)}wNAF(p){return h.wNAFCached(this,l,p,b=>{let v=n.invertBatch(b.map(C=>C.pz));return b.map((C,N)=>C.toAffine(v[N])).map(d.fromAffine)})}multiplyUnsafe(p){let b=d.ZERO;if(p===qa)return b;if(s(p),p===Lr)return this;let{endo:v}=t;if(!v)return h.unsafeLadder(this,p);let{k1neg:C,k1:N,k2neg:I,k2:M}=v.splitScalar(p),x=b,U=b,G=this;for(;N>qa||M>qa;)N&Lr&&(x=x.add(G)),M&Lr&&(U=U.add(G)),G=G.double(),N>>=Lr,M>>=Lr;return C&&(x=x.negate()),I&&(U=U.negate()),U=new d(n.mul(U.px,v.beta),U.py,U.pz),x.add(U)}multiply(p){s(p);let b=p,v,C,{endo:N}=t;if(N){let{k1neg:I,k1:M,k2neg:x,k2:U}=N.splitScalar(b),{p:G,f:le}=this.wNAF(M),{p:j,f:w}=this.wNAF(U);G=h.constTimeNegate(I,G),j=h.constTimeNegate(x,j),j=new d(n.mul(j.px,N.beta),j.py,j.pz),v=G.add(j),C=le.add(w)}else{let{p:I,f:M}=this.wNAF(b);v=I,C=M}return d.normalizeZ([v,C])[0]}multiplyAndAddUnsafe(p,b,v){let C=d.BASE,N=(M,x)=>x===qa||x===Lr||!M.equals(C)?M.multiplyUnsafe(x):M.multiply(x),I=N(this,b).add(N(p,v));return I.is0()?void 0:I}toAffine(p){let{px:b,py:v,pz:C}=this,N=this.is0();p==null&&(p=N?n.ONE:n.inv(C));let I=n.mul(b,p),M=n.mul(v,p),x=n.mul(C,p);if(N)return{x:n.ZERO,y:n.ZERO};if(!n.eql(x,n.ONE))throw new Error("invZ was invalid");return{x:I,y:M}}isTorsionFree(){let{h:p,isTorsionFree:b}=t;if(p===Lr)return!0;if(b)return b(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:b}=t;return p===Lr?this:b?b(d,this):this.multiplyUnsafe(t.h)}toRawBytes(p=!0){return this.assertValidity(),r(d,this,p)}toHex(p=!0){return ou(this.toRawBytes(p))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);let f=t.nBitLength,h=VU(d,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:u,weierstrassEquation:a,isWithinCurveOrder:o}}function _te(e){let t=vA(e);return Vo(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function WU(e){let t=_te(e),{Fp:n,n:r}=t,i=n.BYTES+1,a=2*n.BYTES+1;function o(R){return qa<R&&R<n.ORDER}function s(R){return En(R,r)}function u(R){return Iy(R,r)}let{ProjectivePoint:l,normPrivateKeyToScalar:c,weierstrassEquation:d,isWithinCurveOrder:f}=kte({...t,toBytes(R,q,ne){let se=q.toAffine(),ce=n.toBytes(se.x),me=rf;return ne?me(Uint8Array.from([q.hasEvenY()?2:3]),ce):me(Uint8Array.from([4]),ce,n.toBytes(se.y))},fromBytes(R){let q=R.length,ne=R[0],se=R.subarray(1);if(q===i&&(ne===2||ne===3)){let ce=Ua(se);if(!o(ce))throw new Error("Point is not on curve");let me=d(ce),Ve=n.sqrt(me),Ae=(Ve&Lr)===Lr;return(ne&1)===1!==Ae&&(Ve=n.neg(Ve)),{x:ce,y:Ve}}else if(q===a&&ne===4){let ce=n.fromBytes(se.subarray(0,n.BYTES)),me=n.fromBytes(se.subarray(n.BYTES,2*n.BYTES));return{x:ce,y:me}}else throw new Error(`Point of length ${q} was invalid. Expected ${i} compressed bytes or ${a} uncompressed bytes`)}}),h=R=>ou(qo(R,t.nByteLength));function g(R){let q=r>>Lr;return R>q}function p(R){return g(R)?s(-R):R}let b=(R,q,ne)=>Ua(R.slice(q,ne));class v{constructor(q,ne,se){this.r=q,this.s=ne,this.recovery=se,this.assertValidity()}static fromCompact(q){let ne=t.nByteLength;return q=dr("compactSignature",q,ne*2),new v(b(q,0,ne),b(q,ne,2*ne))}static fromDER(q){let{r:ne,s:se}=lu.toSig(dr("DER",q));return new v(ne,se)}assertValidity(){if(!f(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!f(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(q){return new v(this.r,this.s,q)}recoverPublicKey(q){let{r:ne,s:se,recovery:ce}=this,me=U(dr("msgHash",q));if(ce==null||![0,1,2,3].includes(ce))throw new Error("recovery id invalid");let Ve=ce===2||ce===3?ne+t.n:ne;if(Ve>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");let Ae=ce&1?"03":"02",Le=l.fromHex(Ae+h(Ve)),$e=u(Ve),Qe=s(-me*$e),gt=s(se*$e),_n=l.BASE.multiplyAndAddUnsafe(Le,Qe,gt);if(!_n)throw new Error("point at infinify");return _n.assertValidity(),_n}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new v(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return su(this.toDERHex())}toDERHex(){return lu.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return su(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}let C={isValidPrivateKey(R){try{return c(R),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{let R=gA(t.n);return qU(t.randomBytes(R),t.n)},precompute(R=8,q=l.BASE){return q._setWindowSize(R),q.multiply(BigInt(3)),q}};function N(R,q=!0){return l.fromPrivateKey(R).toRawBytes(q)}function I(R){let q=R instanceof Uint8Array,ne=typeof R=="string",se=(q||ne)&&R.length;return q?se===i||se===a:ne?se===2*i||se===2*a:R instanceof l}function M(R,q,ne=!0){if(I(R))throw new Error("first arg must be private key");if(!I(q))throw new Error("second arg must be public key");return l.fromHex(q).multiply(c(R)).toRawBytes(ne)}let x=t.bits2int||function(R){let q=Ua(R),ne=R.length*8-t.nBitLength;return ne>0?q>>BigInt(ne):q},U=t.bits2int_modN||function(R){return s(x(R))},G=Ip(t.nBitLength);function le(R){if(typeof R!="bigint")throw new Error("bigint expected");if(!(qa<=R&&R<G))throw new Error(`bigint expected < 2^${t.nBitLength}`);return qo(R,t.nByteLength)}function j(R,q,ne=w){if(["recovered","canonical"].some(L=>L in ne))throw new Error("sign() legacy options not supported");let{hash:se,randomBytes:ce}=t,{lowS:me,prehash:Ve,extraEntropy:Ae}=ne;me==null&&(me=!0),R=dr("msgHash",R),Ve&&(R=dr("prehashed msgHash",se(R)));let Le=U(R),$e=c(q),Qe=[le($e),le(Le)];if(Ae!=null){let L=Ae===!0?ce(n.BYTES):Ae;Qe.push(dr("extraEntropy",L))}let gt=rf(...Qe),_n=Le;function Nt(L){let F=x(L);if(!f(F))return;let H=u(F),X=l.BASE.multiply(F).toAffine(),Y=s(X.x);if(Y===qa)return;let fe=s(H*s(_n+Y*$e));if(fe===qa)return;let je=(X.x===Y?0:2)|Number(X.y&Lr),qr=fe;return me&&g(fe)&&(qr=p(fe),je^=1),new v(Y,qr,je)}return{seed:gt,k2sig:Nt}}let w={lowS:t.lowS,prehash:!1},Ee={lowS:t.lowS,prehash:!1};function D(R,q,ne=w){let{seed:se,k2sig:ce}=j(R,q,ne),me=t;return dA(me.hash.outputLen,me.nByteLength,me.hmac)(se,ce)}l.BASE._setWindowSize(8);function E(R,q,ne,se=Ee){let ce=R;if(q=dr("msgHash",q),ne=dr("publicKey",ne),"strict"in se)throw new Error("options.strict was renamed to lowS");let{lowS:me,prehash:Ve}=se,Ae,Le;try{if(typeof ce=="string"||ce instanceof Uint8Array)try{Ae=v.fromDER(ce)}catch(X){if(!(X instanceof lu.Err))throw X;Ae=v.fromCompact(ce)}else if(typeof ce=="object"&&typeof ce.r=="bigint"&&typeof ce.s=="bigint"){let{r:X,s:Y}=ce;Ae=new v(X,Y)}else throw new Error("PARSE");Le=l.fromHex(ne)}catch(X){if(X.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(me&&Ae.hasHighS())return!1;Ve&&(q=t.hash(q));let{r:$e,s:Qe}=Ae,gt=U(q),_n=u(Qe),Nt=s(gt*_n),L=s($e*_n),F=l.BASE.multiplyAndAddUnsafe(Le,Nt,L)?.toAffine();return F?s(F.x)===$e:!1}return{CURVE:t,getPublicKey:N,getSharedSecret:M,sign:D,verify:E,ProjectivePoint:l,Signature:v,utils:C}}function Ate(e){return{hash:e,hmac:(t,...n)=>uA(e,t,hU(...n)),randomBytes:mU}}function HU(e,t){let n=r=>WU({...e,...Ate(r)});return Object.freeze({...n(t),create:n})}var QU=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),GU=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Nte=BigInt(1),SA=BigInt(2),zU=(e,t)=>(e+t/SA)/t;function Ite(e){let t=QU,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),u=BigInt(88),l=e*e*e%t,c=l*l*e%t,d=fr(c,n,t)*c%t,f=fr(d,n,t)*c%t,h=fr(f,SA,t)*l%t,g=fr(h,i,t)*h%t,p=fr(g,a,t)*g%t,b=fr(p,s,t)*p%t,v=fr(b,u,t)*b%t,C=fr(v,s,t)*p%t,N=fr(C,n,t)*c%t,I=fr(N,o,t)*g%t,M=fr(I,r,t)*l%t,x=fr(M,SA,t);if(!bA.eql(bA.sqr(x),e))throw new Error("Cannot find square root");return x}var bA=FU(QU,void 0,void 0,{sqrt:Ite}),Va=HU({a:BigInt(0),b:BigInt(7),Fp:bA,n:GU,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=GU,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Nte*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),s=zU(a*e,t),u=zU(-r*e,t),l=En(e-s*n-u*i,t),c=En(-s*r-u*a,t),d=l>o,f=c>o;if(d&&(l=t-l),f&&(c=t-c),l>o||c>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:f,k2:c}}}},AU),JIe=BigInt(0);var WIe=Va.ProjectivePoint;var Ja="0x0000000000000000000000000000000000000000";var Oy="0x0000000000000000000000000000000000000000000000000000000000000000";var KU=BigInt(0),ZU=BigInt(1),YU=BigInt(2),XU=BigInt(27),$U=BigInt(28),Ry=BigInt(35),af={};function jU(e){return lr(Ot(e),32)}var Mn=class e{#e;#t;#n;#r;get r(){return this.#e}set r(t){k(ia(t)===32,"invalid r","value",t),this.#e=W(t)}get s(){return this.#t}set s(t){k(ia(t)===32,"invalid s","value",t);let n=W(t);k(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),this.#t=n}get v(){return this.#n}set v(t){let n=pe(t,"value");k(n===27||n===28,"invalid v","v",t),this.#n=n}get networkV(){return this.#r}get legacyChainId(){let t=this.networkV;return t==null?null:e.getChainId(t)}get yParity(){return this.v===27?0:1}get yParityAndS(){let t=ue(this.s);return this.yParity&&(t[0]|=128),W(t)}get compactSerialized(){return Ue([this.r,this.yParityAndS])}get serialized(){return Ue([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(t,n,r,i){Po(t,af,"Signature"),this.#e=n,this.#t=r,this.#n=i,this.#r=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){let t=new e(af,this.r,this.s,this.v);return this.networkV&&(t.#r=this.networkV),t}toJSON(){let t=this.networkV;return{_type:"signature",networkV:t!=null?t.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(t){let n=z(t,"v");return n==XU||n==$U?KU:(k(n>=Ry,"invalid EIP-155 v","v",t),(n-Ry)/YU)}static getChainIdV(t,n){return z(t)*YU+BigInt(35+n-27)}static getNormalizedV(t){let n=z(t);return n===KU||n===XU?27:n===ZU||n===$U?28:(k(n>=Ry,"invalid v","v",t),n&ZU?27:28)}static from(t){function n(l,c){k(l,c,"signature",t)}if(t==null)return new e(af,Oy,Oy,27);if(typeof t=="string"){let l=ue(t,"signature");if(l.length===64){let c=W(l.slice(0,32)),d=l.slice(32,64),f=d[0]&128?28:27;return d[0]&=127,new e(af,c,W(d),f)}if(l.length===65){let c=W(l.slice(0,32)),d=l.slice(32,64);n((d[0]&128)===0,"non-canonical s");let f=e.getNormalizedV(l[64]);return new e(af,c,W(d),f)}n(!1,"invalid raw signature length")}if(t instanceof e)return t.clone();let r=t.r;n(r!=null,"missing r");let i=jU(r),a=function(l,c){if(l!=null)return jU(l);if(c!=null){n(Ce(c,32),"invalid yParityAndS");let d=ue(c);return d[0]&=127,W(d)}n(!1,"missing s")}(t.s,t.yParityAndS);n((ue(a)[0]&128)==0,"non-canonical s");let{networkV:o,v:s}=function(l,c,d){if(l!=null){let f=z(l);return{networkV:f>=Ry?f:void 0,v:e.getNormalizedV(f)}}if(c!=null)return n(Ce(c,32),"invalid yParityAndS"),{v:ue(c)[0]&128?28:27};if(d!=null){switch(pe(d,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(t.v,t.yParityAndS,t.yParity),u=new e(af,i,a,s);return o&&(u.#r=o),n(t.yParity==null||pe(t.yParity,"sig.yParity")===u.yParity,"yParity mismatch"),n(t.yParityAndS==null||t.yParityAndS===u.yParityAndS,"yParityAndS mismatch"),u}};var Jo=class e{#e;constructor(t){k(ia(t)===32,"invalid private key","privateKey","[REDACTED]"),this.#e=W(t)}get privateKey(){return this.#e}get publicKey(){return e.computePublicKey(this.#e)}get compressedPublicKey(){return e.computePublicKey(this.#e,!0)}sign(t){k(ia(t)===32,"invalid digest length","digest",t);let n=Va.sign(ht(t),ht(this.#e),{lowS:!0});return Mn.from({r:zn(n.r,32),s:zn(n.s,32),v:n.recovery?28:27})}computeSharedSecret(t){let n=e.computePublicKey(t);return W(Va.getSharedSecret(ht(this.#e),ue(n),!1))}static computePublicKey(t,n){let r=ue(t,"key");if(r.length===32){let a=Va.getPublicKey(r,!!n);return W(a)}if(r.length===64){let a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}let i=Va.ProjectivePoint.fromHex(r);return W(i.toRawBytes(n))}static recoverPublicKey(t,n){k(ia(t)===32,"invalid digest length","digest",t);let r=Mn.from(n),i=Va.Signature.fromCompact(ht(Ue([r.r,r.s])));i=i.addRecoveryBit(r.yParity);let a=i.recoverPublicKey(ht(t));return k(a!=null,"invalid signautre for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(t,n,r){let i=Va.ProjectivePoint.fromHex(e.computePublicKey(t).substring(2)),a=Va.ProjectivePoint.fromHex(e.computePublicKey(n).substring(2));return"0x"+i.add(a).toHex(!!r)}};var Ote=BigInt(0),Rte=BigInt(36);function e4(e){e=e.toLowerCase();let t=e.substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=t[i].charCodeAt(0);let r=ue(We(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(r[i>>1]&15)>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}var TA={};for(let e=0;e<10;e++)TA[String(e)]=String(e);for(let e=0;e<26;e++)TA[String.fromCharCode(65+e)]=String(10+e);var t4=15;function Pte(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(r=>TA[r]).join("");for(;t.length>=t4;){let r=t.substring(0,t4);t=parseInt(r,10)%97+t.substring(r.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}var wte=function(){let e={};for(let t=0;t<36;t++){let n="0123456789abcdefghijklmnopqrstuvwxyz"[t];e[n]=BigInt(t)}return e}();function xte(e){e=e.toLowerCase();let t=Ote;for(let n=0;n<e.length;n++)t=t*Rte+wte[e[n]];return t}function be(e){if(k(typeof e=="string","invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);let t=e4(e);return k(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){k(e.substring(2,4)===Pte(e),"bad icap checksum","address",e);let t=xte(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return e4("0x"+t)}k(!1,"invalid address","address",e)}function EA(e){let t=be(e.from),r=z(e.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,be(ot(We(oa([t,r])),12))}function Py(e){return e&&typeof e.getAddress=="function"}async function CA(e,t){let n=await t;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(B(typeof e!="string","unconfigured name","UNCONFIGURED_NAME",{value:e}),k(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),be(n)}function Pt(e,t){if(typeof e=="string")return e.match(/^0x[0-9a-f]{40}$/i)?be(e):(B(t!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),CA(e,t.resolveName(e)));if(Py(e))return CA(e,e.getAddress());if(e&&typeof e.then=="function")return CA(e,e);k(!1,"unsupported addressable value","target",e)}var Ai={};function $(e,t){let n=!1;return t<0&&(n=!0,t*=-1),new Xe(Ai,`${n?"":"u"}int${t}`,e,{signed:n,width:t})}function Me(e,t){return new Xe(Ai,`bytes${t||""}`,e,{size:t})}var n4=Symbol.for("_ethers_typed"),Xe=class e{type;value;#e;_typedSymbol;constructor(t,n,r,i){i==null&&(i=null),Po(Ai,t,"Typed"),K(this,{_typedSymbol:n4,type:n,value:r}),this.#e=i,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(t=>t.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#e}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#e===!0?-1:this.#e===!1?this.value.length:null}static from(t,n){return new e(Ai,t,n)}static uint8(t){return $(t,8)}static uint16(t){return $(t,16)}static uint24(t){return $(t,24)}static uint32(t){return $(t,32)}static uint40(t){return $(t,40)}static uint48(t){return $(t,48)}static uint56(t){return $(t,56)}static uint64(t){return $(t,64)}static uint72(t){return $(t,72)}static uint80(t){return $(t,80)}static uint88(t){return $(t,88)}static uint96(t){return $(t,96)}static uint104(t){return $(t,104)}static uint112(t){return $(t,112)}static uint120(t){return $(t,120)}static uint128(t){return $(t,128)}static uint136(t){return $(t,136)}static uint144(t){return $(t,144)}static uint152(t){return $(t,152)}static uint160(t){return $(t,160)}static uint168(t){return $(t,168)}static uint176(t){return $(t,176)}static uint184(t){return $(t,184)}static uint192(t){return $(t,192)}static uint200(t){return $(t,200)}static uint208(t){return $(t,208)}static uint216(t){return $(t,216)}static uint224(t){return $(t,224)}static uint232(t){return $(t,232)}static uint240(t){return $(t,240)}static uint248(t){return $(t,248)}static uint256(t){return $(t,256)}static uint(t){return $(t,256)}static int8(t){return $(t,-8)}static int16(t){return $(t,-16)}static int24(t){return $(t,-24)}static int32(t){return $(t,-32)}static int40(t){return $(t,-40)}static int48(t){return $(t,-48)}static int56(t){return $(t,-56)}static int64(t){return $(t,-64)}static int72(t){return $(t,-72)}static int80(t){return $(t,-80)}static int88(t){return $(t,-88)}static int96(t){return $(t,-96)}static int104(t){return $(t,-104)}static int112(t){return $(t,-112)}static int120(t){return $(t,-120)}static int128(t){return $(t,-128)}static int136(t){return $(t,-136)}static int144(t){return $(t,-144)}static int152(t){return $(t,-152)}static int160(t){return $(t,-160)}static int168(t){return $(t,-168)}static int176(t){return $(t,-176)}static int184(t){return $(t,-184)}static int192(t){return $(t,-192)}static int200(t){return $(t,-200)}static int208(t){return $(t,-208)}static int216(t){return $(t,-216)}static int224(t){return $(t,-224)}static int232(t){return $(t,-232)}static int240(t){return $(t,-240)}static int248(t){return $(t,-248)}static int256(t){return $(t,-256)}static int(t){return $(t,-256)}static bytes1(t){return Me(t,1)}static bytes2(t){return Me(t,2)}static bytes3(t){return Me(t,3)}static bytes4(t){return Me(t,4)}static bytes5(t){return Me(t,5)}static bytes6(t){return Me(t,6)}static bytes7(t){return Me(t,7)}static bytes8(t){return Me(t,8)}static bytes9(t){return Me(t,9)}static bytes10(t){return Me(t,10)}static bytes11(t){return Me(t,11)}static bytes12(t){return Me(t,12)}static bytes13(t){return Me(t,13)}static bytes14(t){return Me(t,14)}static bytes15(t){return Me(t,15)}static bytes16(t){return Me(t,16)}static bytes17(t){return Me(t,17)}static bytes18(t){return Me(t,18)}static bytes19(t){return Me(t,19)}static bytes20(t){return Me(t,20)}static bytes21(t){return Me(t,21)}static bytes22(t){return Me(t,22)}static bytes23(t){return Me(t,23)}static bytes24(t){return Me(t,24)}static bytes25(t){return Me(t,25)}static bytes26(t){return Me(t,26)}static bytes27(t){return Me(t,27)}static bytes28(t){return Me(t,28)}static bytes29(t){return Me(t,29)}static bytes30(t){return Me(t,30)}static bytes31(t){return Me(t,31)}static bytes32(t){return Me(t,32)}static address(t){return new e(Ai,"address",t)}static bool(t){return new e(Ai,"bool",!!t)}static bytes(t){return new e(Ai,"bytes",t)}static string(t){return new e(Ai,"string",t)}static array(t,n){throw new Error("not implemented yet")}static tuple(t,n){throw new Error("not implemented yet")}static overrides(t){return new e(Ai,"overrides",Object.assign({},t))}static isTyped(t){return t&&typeof t=="object"&&"_typedSymbol"in t&&t._typedSymbol===n4}static dereference(t,n){if(e.isTyped(t)){if(t.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${t.type}`);return t.value}return t}};var wy=class extends Rt{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,n){let r=Xe.dereference(n,"string");try{r=be(r)}catch(i){return this._throwError(i.message,n)}return t.writeValue(r)}decode(t){return be(zn(t.readValue(),20))}};var xy=class extends Rt{coder;constructor(t){super(t.name,t.type,"_",t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,n){return this.coder.encode(t,n)}decode(t){return this.coder.decode(t)}};function kA(e,t,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let u={};r=t.map(l=>{let c=l.localName;return B(c,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:n}),B(!u[c],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:n}),u[c]=!0,n[c]})}else k(!1,"invalid tuple value","tuple",n);k(t.length===r.length,"types/value length mismatch","tuple",n);let i=new au,a=new au,o=[];t.forEach((u,l)=>{let c=r[l];if(u.dynamic){let d=a.length;u.encode(a,c);let f=i.writeUpdatableValue();o.push(h=>{f(h+d)})}else u.encode(i,c)}),o.forEach(u=>{u(i.length)});let s=e.appendWriter(i);return s+=e.appendWriter(a),s}function _A(e,t){let n=[],r=[],i=e.subReader(0);return t.forEach(a=>{let o=null;if(a.dynamic){let s=e.readIndex(),u=i.subReader(s);try{o=a.decode(u)}catch(l){if(lt(l,"BUFFER_OVERRUN"))throw l;o=l,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(e)}catch(s){if(lt(s,"BUFFER_OVERRUN"))throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),sa.fromItems(n,r)}var By=class extends Rt{coder;length;constructor(t,n,r){let i=t.type+"["+(n>=0?n:"")+"]",a=n===-1||t.dynamic;super("array",i,r,a),K(this,{coder:t,length:n})}defaultValue(){let t=this.coder.defaultValue(),n=[];for(let r=0;r<this.length;r++)n.push(t);return n}encode(t,n){let r=Xe.dereference(n,"array");Array.isArray(r)||this._throwError("expected array value",r);let i=this.length;i===-1&&(i=r.length,t.writeValue(r.length)),bp(r.length,i,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let o=0;o<r.length;o++)a.push(this.coder);return kA(t,a,r)}decode(t){let n=this.length;n===-1&&(n=t.readIndex(),B(n*en<=t.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:t.bytes,offset:n*en,length:t.dataLength}));let r=[];for(let i=0;i<n;i++)r.push(new xy(this.coder));return _A(t,r)}};var Dy=class extends Rt{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,n){let r=Xe.dereference(n,"bool");return t.writeValue(r?1:0)}decode(t){return!!t.readValue()}};var Op=class extends Rt{constructor(t,n){super(t,t,n,!0)}defaultValue(){return"0x"}encode(t,n){n=ht(n);let r=t.writeValue(n.length);return r+=t.writeBytes(n),r}decode(t){return t.readBytes(t.readIndex(),!0)}},My=class extends Op{constructor(t){super("bytes",t)}decode(t){return W(super.decode(t))}};var Ly=class extends Rt{size;constructor(t,n){let r="bytes"+String(t);super(r,r,n,!1),K(this,{size:t},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(t,n){let r=ht(Xe.dereference(n,this.type));return r.length!==this.size&&this._throwError("incorrect data length",n),t.writeBytes(r)}decode(t){return W(t.readBytes(this.size))}};var Bte=new Uint8Array([]),Fy=class extends Rt{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,n){return n!=null&&this._throwError("not null",n),t.writeBytes(Bte)}decode(t){return t.readBytes(0),null}};var Dte=BigInt(0),Mte=BigInt(1),Lte=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Uy=class extends Rt{size;signed;constructor(t,n,r){let i=(n?"int":"uint")+t*8;super(i,i,r,!1),K(this,{size:t,signed:n},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(t,n){let r=z(Xe.dereference(n,this.type)),i=wo(Lte,en*8);if(this.signed){let a=wo(i,this.size*8-1);(r>a||r<-(a+Mte))&&this._throwError("value out-of-bounds",n),r=Tp(r,8*en)}else(r<Dte||r>wo(i,this.size*8))&&this._throwError("value out-of-bounds",n);return t.writeValue(r)}decode(t){let n=wo(t.readValue(),this.size*8);return this.signed&&(n=eA(n,this.size*8)),n}};var qy=class extends Op{constructor(t){super("string",t)}defaultValue(){return""}encode(t,n){return super.encode(t,Dn(Xe.dereference(n,"string")))}decode(t){return xo(super.decode(t))}};var cu=class extends Rt{coders;constructor(t,n){let r=!1,i=[];t.forEach(o=>{o.dynamic&&(r=!0),i.push(o.type)});let a="tuple("+i.join(",")+")";super("tuple",a,n,r),K(this,{coders:Object.freeze(t.slice())})}defaultValue(){let t=[];this.coders.forEach(r=>{t.push(r.defaultValue())});let n=this.coders.reduce((r,i)=>{let a=i.localName;return a&&(r[a]||(r[a]=0),r[a]++),r},{});return this.coders.forEach((r,i)=>{let a=r.localName;!a||n[a]!==1||(a==="length"&&(a="_length"),t[a]==null&&(t[a]=t[i]))}),Object.freeze(t)}encode(t,n){let r=Xe.dereference(n,"tuple");return kA(t,this.coders,r)}decode(t){return _A(t,this.coders)}};function Ni(e){return We(Dn(e))}var Fte="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI",r4=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),i4=4;function Ute(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),i=1,a=[0,1];for(let M=1;M<r;M++)a.push(i+=n());let o=n(),s=t;t+=o;let u=0,l=0;function c(){return u==0&&(l=l<<8|e[t++],u=8),l>>--u&1}let d=31,f=2**d,h=f>>>1,g=h>>1,p=f-1,b=0;for(let M=0;M<d;M++)b=b<<1|c();let v=[],C=0,N=f;for(;;){let M=Math.floor(((b-C+1)*i-1)/N),x=0,U=r;for(;U-x>1;){let j=x+U>>>1;M<a[j]?U=j:x=j}if(x==0)break;v.push(x);let G=C+Math.floor(N*a[x]/i),le=C+Math.floor(N*a[x+1]/i)-1;for(;!((G^le)&h);)b=b<<1&p|c(),G=G<<1&p,le=le<<1&p|1;for(;G&~le&g;)b=b&h|b<<1&p>>>1|c(),G=G<<1^h,le=(le^h)<<1|h|1;C=G,N=1+le-G}let I=r-4;return v.map(M=>{switch(M-I){case 3:return I+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return I+256+(e[s++]<<8|e[s++]);case 1:return I+e[s++];default:return M-1}})}function qte(e){let t=0;return()=>e[t++]}function u4(e){return qte(Ute(Vte(e)))}function Vte(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>t[i.charCodeAt(0)]=a);let n=e.length,r=new Uint8Array(6*n>>3);for(let i=0,a=0,o=0,s=0;i<n;i++)s=s<<6|t[e.charCodeAt(i)],o+=6,o>=8&&(r[a++]=s>>(o-=8));return r}function Jte(e){return e&1?~e>>1:e>>1}function Wte(e,t){let n=Array(e);for(let r=0,i=0;r<e;r++)n[r]=i+=Jte(t());return n}function wp(e,t=0){let n=[];for(;;){let r=e(),i=e();if(!i)break;t+=r;for(let a=0;a<i;a++)n.push(t+a);t+=i+1}return n}function l4(e){return xp(()=>{let t=wp(e);if(t.length)return t})}function c4(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(Hte(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(Gte(n,e))}return t.flat()}function xp(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function d4(e,t,n){let r=Array(e).fill().map(()=>[]);for(let i=0;i<t;i++)Wte(e,n).forEach((a,o)=>r[o].push(a));return r}function Hte(e,t){let n=1+t(),r=t(),i=xp(t);return d4(i.length,1+e,t).flatMap((o,s)=>{let[u,...l]=o;return Array(i[s]).fill().map((c,d)=>{let f=d*r;return[u+d*n,l.map(h=>h+f)]})})}function Gte(e,t){let n=1+t();return d4(n,1+e,t).map(i=>[i[0],i.slice(1)])}function zte(e){let t=[],n=wp(e);return i(r([]),[]),t;function r(a){let o=e(),s=xp(()=>{let u=wp(e).map(l=>n[l]);if(u.length)return r(u)});return{S:o,B:s,Q:a}}function i({S:a,B:o},s,u){if(!(a&4&&u===s[s.length-1])){a&2&&(u=s[s.length-1]),a&1&&t.push(s);for(let l of o)for(let c of l.Q)i(l,[...s,c],u)}}}function Qte(e){return e.toString(16).toUpperCase().padStart(2,"0")}function f4(e){return`{${Qte(e)}}`}function Kte(e){let t=[];for(let n=0,r=e.length;n<r;){let i=e.codePointAt(n);n+=i<65536?1:2,t.push(i)}return t}function uf(e){let n=e.length;if(n<4096)return String.fromCodePoint(...e);let r=[];for(let i=0;i<n;)r.push(String.fromCodePoint(...e.slice(i,i+=4096)));return r.join("")}function Zte(e,t){let n=e.length,r=n-t.length;for(let i=0;r==0&&i<n;i++)r=e[i]-t[i];return r}var Yte="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g",Bp=44032,Jy=4352,Wy=4449,Hy=4519,h4=19,p4=21,lf=28,Gy=p4*lf,Xte=h4*Gy,$te=Bp+Xte,jte=Jy+h4,ene=Wy+p4,tne=Hy+lf;function Rp(e){return e>>24&255}function m4(e){return e&16777215}var NA,a4,IA,Vy;function nne(){let e=u4(Yte);NA=new Map(l4(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),a4=new Set(wp(e)),IA=new Map,Vy=new Map;for(let[t,n]of c4(e)){if(!a4.has(t)&&n.length==2){let[r,i]=n,a=Vy.get(r);a||(a=new Map,Vy.set(r,a)),a.set(i,t)}IA.set(t,n.reverse())}}function g4(e){return e>=Bp&&e<$te}function rne(e,t){if(e>=Jy&&e<jte&&t>=Wy&&t<ene)return Bp+(e-Jy)*Gy+(t-Wy)*lf;if(g4(e)&&t>Hy&&t<tne&&(e-Bp)%lf==0)return e+(t-Hy);{let n=Vy.get(e);return n&&(n=n.get(t),n)?n:-1}}function y4(e){NA||nne();let t=[],n=[],r=!1;function i(a){let o=NA.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if(g4(a)){let o=a-Bp,s=o/Gy|0,u=o%Gy/lf|0,l=o%lf;i(Jy+s),i(Wy+u),l>0&&i(Hy+l)}else{let o=IA.get(a);o?n.push(...o):i(a)}if(!n.length)break;a=n.pop()}if(r&&t.length>1){let a=Rp(t[0]);for(let o=1;o<t.length;o++){let s=Rp(t[o]);if(s==0||a<=s){a=s;continue}let u=o-1;for(;;){let l=t[u+1];if(t[u+1]=t[u],t[u]=l,!u||(a=Rp(t[--u]),a<=s))break}a=Rp(t[o])}}return t}function ine(e){let t=[],n=[],r=-1,i=0;for(let a of e){let o=Rp(a),s=m4(a);if(r==-1)o==0?r=s:t.push(s);else if(i>0&&i>=o)o==0?(t.push(r,...n),n.length=0,r=s):n.push(s),i=o;else{let u=rne(r,s);u>=0?r=u:i==0&&o==0?(t.push(r),r=s):(n.push(s),i=o)}}return r>=0&&t.push(r,...n),t}function v4(e){return y4(e).map(m4)}function ane(e){return ine(y4(e))}var o4=45;var S4=".",b4=65039,T4=1,zy=e=>Array.from(e);function Dp(e,t){return e.P.has(t)||e.Q.has(t)}var OA=class extends Array{get is_emoji(){return!0}},RA,E4,fu,PA,C4,one,sf,AA,of,du,s4,wA;function xA(){if(RA)return;let e=u4(Fte),t=()=>wp(e),n=()=>new Set(t()),r=(c,d)=>d.forEach(f=>c.add(f));RA=new Map(c4(e)),E4=n(),fu=t(),PA=new Set(t().map(c=>fu[c])),fu=new Set(fu),C4=n(),one=n();let i=l4(e),a=e(),o=()=>{let c=new Set;return t().forEach(d=>r(c,i[d])),r(c,t()),c};sf=xp(c=>{let d=xp(e).map(f=>f+96);if(d.length){let f=c>=a;d[0]-=32,d=uf(d),f&&(d=`Restricted[${d}]`);let h=o(),g=o(),p=!e();return{N:d,P:h,Q:g,M:p,R:f}}}),AA=n(),of=new Map;let s=t().concat(zy(AA)).sort((c,d)=>c-d);s.forEach((c,d)=>{let f=e(),h=s[d]=f?s[d-f]:{V:[],M:new Map};h.V.push(c),AA.has(c)||of.set(c,h)});for(let{V:c,M:d}of new Set(of.values())){let f=[];for(let g of c){let p=sf.filter(v=>Dp(v,g)),b=f.find(({G:v})=>p.some(C=>v.has(C)));b||(b={G:new Set,V:[]},f.push(b)),b.V.push(g),r(b.G,p)}let h=f.flatMap(g=>zy(g.G));for(let{G:g,V:p}of f){let b=new Set(h.filter(v=>!g.has(v)));for(let v of p)d.set(v,b)}}du=new Set;let u=new Set,l=c=>du.has(c)?u.add(c):du.add(c);for(let c of sf){for(let d of c.P)l(d);for(let d of c.Q)l(d)}for(let c of du)!of.has(c)&&!u.has(c)&&of.set(c,T4);r(du,v4(du)),s4=zte(e).map(c=>OA.from(c)).sort(Zte),wA=new Map;for(let c of s4){let d=[wA];for(let f of c){let h=d.map(g=>{let p=g.get(f);return p||(p=new Map,g.set(f,p)),p});f===b4?d.push(...h):d=h}for(let f of d)f.V=c}}function BA(e){return(k4(e)?"":`${DA(Qy([e]))} `)+f4(e)}function DA(e){return`"${e}"\u200E`}function sne(e){if(e.length>=4&&e[2]==o4&&e[3]==o4)throw new Error(`invalid label extension: "${uf(e.slice(0,4))}"`)}function une(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function lne(e){let t=e[0],n=r4.get(t);if(n)throw Pp(`leading ${n}`);let r=e.length,i=-1;for(let a=1;a<r;a++){t=e[a];let o=r4.get(t);if(o){if(i==a)throw Pp(`${n} + ${o}`);i=a+1,n=o}}if(i==r)throw Pp(`trailing ${n}`)}function Qy(e,t=1/0,n=f4){let r=[];cne(e[0])&&r.push("\u25CC"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let i=0,a=e.length;for(let o=0;o<a;o++){let s=e[o];k4(s)&&(r.push(uf(e.slice(i,o))),r.push(n(s)),i=o+1)}return r.push(uf(e.slice(i,a))),r.join("")}function cne(e){return xA(),fu.has(e)}function k4(e){return xA(),C4.has(e)}function _4(e){return pne(dne(e,ane,yne))}function dne(e,t,n){if(!e)return[];xA();let r=0;return e.split(S4).map(i=>{let a=Kte(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=gne(a,t,n),u=s.length,l;if(!u)throw new Error("empty label");let c=o.output=s.flat();if(une(c),!(o.emoji=u>1||s[0].is_emoji)&&c.every(f=>f<128))sne(c),l="ASCII";else{let f=s.flatMap(h=>h.is_emoji?[]:h);if(!f.length)l="Emoji";else{if(fu.has(c[0]))throw Pp("leading combining mark");for(let p=1;p<u;p++){let b=s[p];if(!b.is_emoji&&fu.has(b[0]))throw Pp(`emoji + combining mark: "${uf(s[p-1])} + ${Qy([b[0]])}"`)}lne(c);let h=zy(new Set(f)),[g]=hne(h);mne(g,f),fne(g,h),l=g.N}}o.type=l}catch(s){o.error=s}return o})}function fne(e,t){let n,r=[];for(let i of t){let a=of.get(i);if(a===T4)return;if(a){let o=a.M.get(i);if(n=n?n.filter(s=>o.has(s)):zy(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>Dp(i,a)))throw new Error(`whole-script confusable: ${e.N}/${i.N}`)}}function hne(e){let t=sf;for(let n of e){let r=t.filter(i=>Dp(i,n));if(!r.length)throw sf.some(i=>Dp(i,n))?N4(t[0],n):A4(n);if(t=r,r.length==1)break}return t}function pne(e){return e.map(({input:t,error:n,output:r})=>{if(n){let i=n.message;throw new Error(e.length==1?i:`Invalid label ${DA(Qy(t,63))}: ${i}`)}return uf(r)}).join(S4)}function A4(e){return new Error(`disallowed character: ${BA(e)}`)}function N4(e,t){let n=BA(t),r=sf.find(i=>i.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function Pp(e){return new Error(`illegal placement: ${e}`)}function mne(e,t){for(let n of t)if(!Dp(e,n))throw N4(e,n);if(e.M){let n=v4(t);for(let r=1,i=n.length;r<i;r++)if(PA.has(n[r])){let a=r+1;for(let o;a<i&&PA.has(o=n[a]);a++)for(let s=r;s<a;s++)if(n[s]==o)throw new Error(`duplicate non-spacing marks: ${BA(o)}`);if(a-r>i4)throw new Error(`excessive non-spacing marks: ${DA(Qy(n.slice(r-1,a)))} (${a-r}/${i4})`);r=a}}}function gne(e,t,n){let r=[],i=[];for(e=e.slice().reverse();e.length;){let a=vne(e);if(a)i.length&&(r.push(t(i)),i=[]),r.push(n(a));else{let o=e.pop();if(du.has(o))i.push(o);else{let s=RA.get(o);if(s)i.push(...s);else if(!E4.has(o))throw A4(o)}}}return i.length&&r.push(t(i)),r}function yne(e){return e.filter(t=>t!=b4)}function vne(e,t){let n=wA,r,i=e.length;for(;i&&(n=n.get(e[--i]),!!n);){let{V:a}=n;a&&(r=a,t&&t.push(...e.slice(i).reverse()),e.length=i)}return r}var O4=new Uint8Array(32);O4.fill(0);function I4(e){return k(e.length!==0,"invalid ENS name; empty component","comp",e),e}function R4(e){let t=Dn(P4(e)),n=[];if(e.length===0)return n;let r=0;for(let i=0;i<t.length;i++)t[i]===46&&(n.push(I4(t.slice(r,i))),r=i+1);return k(r<t.length,"invalid ENS name; empty component","name",e),n.push(I4(t.slice(r))),n}function P4(e){try{if(e.length===0)throw new Error("empty label");return _4(e)}catch(t){k(!1,`invalid ENS name (${t.message})`,"name",e)}}function cf(e){k(typeof e=="string","invalid ENS name; not a string","name",e),k(e.length,"invalid ENS name (empty label)","name",e);let t=O4,n=R4(e);for(;n.length;)t=We(Ue([t,We(n.pop())]));return W(t)}function MA(e,t){let n=t??63;return k(n<=255,"DNS encoded label cannot exceed 255","length",n),W(Ue(R4(e).map(r=>{k(r.length<=n,`label ${JSON.stringify(e)} exceeds ${n} bytes`,"name",e);let i=new Uint8Array(r.length+1);return i.set(r,1),i[0]=i.length-1,i})))+"00"}function LA(e,t){return{address:be(e),storageKeys:t.map((n,r)=>(k(Ce(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function hr(e){if(Array.isArray(e))return e.map((n,r)=>Array.isArray(n)?(k(n.length===2,"invalid slot set",`value[${r}]`,n),LA(n[0],n[1])):(k(n!=null&&typeof n=="object","invalid address-slot set","value",e),LA(n.address,n.storageKeys)));k(e!=null&&typeof e=="object","invalid access list","value",e);let t=Object.keys(e).map(n=>{let r=e[n].reduce((i,a)=>(i[a]=!0,i),{});return LA(n,Object.keys(r).sort())});return t.sort((n,r)=>n.address.localeCompare(r.address)),t}function Sne(e){let t;return typeof e=="string"?t=Jo.computePublicKey(e,!1):t=e.publicKey,be(We("0x"+t.substring(4)).substring(26))}function w4(e,t){return Sne(Jo.recoverPublicKey(e,t))}var Qt=BigInt(0),bne=BigInt(2),Tne=BigInt(27),Ene=BigInt(28),Cne=BigInt(35),kne=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),FA=4096*32;function x4(e,t){let n=e.toString(16);for(;n.length<2;)n="0"+n;return n+=Uo(t).substring(4),"0x"+n}function Ky(e){return e==="0x"?null:be(e)}function UA(e,t){try{return hr(e)}catch(n){k(!1,n.message,t,e)}}function Mp(e,t){return e==="0x"?0:pe(e,t)}function _t(e,t){if(e==="0x")return Qt;let n=z(e,t);return k(n<=kne,"value exceeds uint size",t,n),n}function st(e,t){let n=z(e,"value"),r=Ot(n);return k(r.length<=32,"value too large",`tx.${t}`,n),r}function qA(e){return hr(e).map(t=>[t.address,t.storageKeys])}function _ne(e,t){k(Array.isArray(e),`invalid ${t}`,"value",e);for(let n=0;n<e.length;n++)k(Ce(e[n],32),"invalid ${ param } hash",`value[${n}]`,e[n]);return e}function Ane(e){let t=nf(e);k(Array.isArray(t)&&(t.length===9||t.length===6),"invalid field count for legacy transaction","data",e);let n={type:0,nonce:Mp(t[0],"nonce"),gasPrice:_t(t[1],"gasPrice"),gasLimit:_t(t[2],"gasLimit"),to:Ky(t[3]),value:_t(t[4],"value"),data:W(t[5]),chainId:Qt};if(t.length===6)return n;let r=_t(t[6],"v"),i=_t(t[7],"r"),a=_t(t[8],"s");if(i===Qt&&a===Qt)n.chainId=r;else{let o=(r-Cne)/bne;o<Qt&&(o=Qt),n.chainId=o,k(o!==Qt||r===Tne||r===Ene,"non-canonical legacy v","v",t[6]),n.signature=Mn.from({r:lr(t[7],32),s:lr(t[8],32),v:r})}return n}function Nne(e,t){let n=[st(e.nonce,"nonce"),st(e.gasPrice||0,"gasPrice"),st(e.gasLimit,"gasLimit"),e.to||"0x",st(e.value,"value"),e.data],r=Qt;if(e.chainId!=Qt)r=z(e.chainId,"tx.chainId"),k(!t||t.networkV==null||t.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){let a=e.signature.legacyChainId;a!=null&&(r=a)}if(!t)return r!==Qt&&(n.push(Ot(r)),n.push("0x"),n.push("0x")),oa(n);let i=BigInt(27+t.yParity);return r!==Qt?i=Mn.getChainIdV(r,t.v):BigInt(t.v)!==i&&k(!1,"tx.chainId/sig.v mismatch","sig",t),n.push(Ot(i)),n.push(Ot(t.r)),n.push(Ot(t.s)),oa(n)}function VA(e,t){let n;try{if(n=Mp(t[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{k(!1,"invalid yParity","yParity",t[0])}let r=lr(t[1],32),i=lr(t[2],32),a=Mn.from({r,s:i,yParity:n});e.signature=a}function Ine(e){let t=nf(ue(e).slice(1));k(Array.isArray(t)&&(t.length===9||t.length===12),"invalid field count for transaction type: 2","data",W(e));let n={type:2,chainId:_t(t[0],"chainId"),nonce:Mp(t[1],"nonce"),maxPriorityFeePerGas:_t(t[2],"maxPriorityFeePerGas"),maxFeePerGas:_t(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:_t(t[4],"gasLimit"),to:Ky(t[5]),value:_t(t[6],"value"),data:W(t[7]),accessList:UA(t[8],"accessList")};return t.length===9||VA(n,t.slice(9)),n}function One(e,t){let n=[st(e.chainId,"chainId"),st(e.nonce,"nonce"),st(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),st(e.maxFeePerGas||0,"maxFeePerGas"),st(e.gasLimit,"gasLimit"),e.to||"0x",st(e.value,"value"),e.data,qA(e.accessList||[])];return t&&(n.push(st(t.yParity,"yParity")),n.push(Ot(t.r)),n.push(Ot(t.s))),Ue(["0x02",oa(n)])}function Rne(e){let t=nf(ue(e).slice(1));k(Array.isArray(t)&&(t.length===8||t.length===11),"invalid field count for transaction type: 1","data",W(e));let n={type:1,chainId:_t(t[0],"chainId"),nonce:Mp(t[1],"nonce"),gasPrice:_t(t[2],"gasPrice"),gasLimit:_t(t[3],"gasLimit"),to:Ky(t[4]),value:_t(t[5],"value"),data:W(t[6]),accessList:UA(t[7],"accessList")};return t.length===8||VA(n,t.slice(8)),n}function Pne(e,t){let n=[st(e.chainId,"chainId"),st(e.nonce,"nonce"),st(e.gasPrice||0,"gasPrice"),st(e.gasLimit,"gasLimit"),e.to||"0x",st(e.value,"value"),e.data,qA(e.accessList||[])];return t&&(n.push(st(t.yParity,"recoveryParam")),n.push(Ot(t.r)),n.push(Ot(t.s))),Ue(["0x01",oa(n)])}function wne(e){let t=nf(ue(e).slice(1)),n="3",r=null;if(t.length===4&&Array.isArray(t[0])){n="3 (network format)";let a=t[1],o=t[2],s=t[3];k(Array.isArray(a),"invalid network format: blobs not an array","fields[1]",a),k(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),k(Array.isArray(s),"invalid network format: proofs not an array","fields[3]",s),k(a.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",t),k(a.length===s.length,"invalid network format: blobs/proofs length mismatch","fields",t),r=[];for(let u=0;u<t[1].length;u++)r.push({data:a[u],commitment:o[u],proof:s[u]});t=t[0]}k(Array.isArray(t)&&(t.length===11||t.length===14),`invalid field count for transaction type: ${n}`,"data",W(e));let i={type:3,chainId:_t(t[0],"chainId"),nonce:Mp(t[1],"nonce"),maxPriorityFeePerGas:_t(t[2],"maxPriorityFeePerGas"),maxFeePerGas:_t(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:_t(t[4],"gasLimit"),to:Ky(t[5]),value:_t(t[6],"value"),data:W(t[7]),accessList:UA(t[8],"accessList"),maxFeePerBlobGas:_t(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10]};r&&(i.blobs=r),k(i.to!=null,`invalid address for transaction type: ${n}`,"data",e),k(Array.isArray(i.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let a=0;a<i.blobVersionedHashes.length;a++)k(Ce(i.blobVersionedHashes[a],32),`invalid blobVersionedHash at index ${a}: must be length 32`,"data",e);return t.length===11||VA(i,t.slice(11)),i}function xne(e,t,n){let r=[st(e.chainId,"chainId"),st(e.nonce,"nonce"),st(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),st(e.maxFeePerGas||0,"maxFeePerGas"),st(e.gasLimit,"gasLimit"),e.to||Ja,st(e.value,"value"),e.data,qA(e.accessList||[]),st(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),_ne(e.blobVersionedHashes||[],"blobVersionedHashes")];return t&&(r.push(st(t.yParity,"yParity")),r.push(Ot(t.r)),r.push(Ot(t.s)),n)?Ue(["0x03",oa([r,n.map(i=>i.data),n.map(i=>i.commitment),n.map(i=>i.proof)])]):Ue(["0x03",oa(r)])}var hu=class e{#e;#t;#n;#r;#a;#s;#i;#d;#l;#u;#o;#p;#c;#f;#h;#m;get type(){return this.#e}set type(t){switch(t){case null:this.#e=null;break;case 0:case"legacy":this.#e=0;break;case 1:case"berlin":case"eip-2930":this.#e=1;break;case 2:case"london":case"eip-1559":this.#e=2;break;case 3:case"cancun":case"eip-4844":this.#e=3;break;default:k(!1,"unsupported transaction type","type",t)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){let t=this.#t;return t==null&&this.type===3?Ja:t}set to(t){this.#t=t==null?null:be(t)}get nonce(){return this.#r}set nonce(t){this.#r=pe(t,"value")}get gasLimit(){return this.#a}set gasLimit(t){this.#a=z(t)}get gasPrice(){let t=this.#s;return t==null&&(this.type===0||this.type===1)?Qt:t}set gasPrice(t){this.#s=t==null?null:z(t,"gasPrice")}get maxPriorityFeePerGas(){let t=this.#i;return t??(this.type===2||this.type===3?Qt:null)}set maxPriorityFeePerGas(t){this.#i=t==null?null:z(t,"maxPriorityFeePerGas")}get maxFeePerGas(){let t=this.#d;return t??(this.type===2||this.type===3?Qt:null)}set maxFeePerGas(t){this.#d=t==null?null:z(t,"maxFeePerGas")}get data(){return this.#n}set data(t){this.#n=W(t)}get value(){return this.#l}set value(t){this.#l=z(t,"value")}get chainId(){return this.#u}set chainId(t){this.#u=z(t)}get signature(){return this.#o||null}set signature(t){this.#o=t==null?null:Mn.from(t)}get accessList(){let t=this.#p||null;return t??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(t){this.#p=t==null?null:hr(t)}get maxFeePerBlobGas(){let t=this.#c;return t==null&&this.type===3?Qt:t}set maxFeePerBlobGas(t){this.#c=t==null?null:z(t,"maxFeePerBlobGas")}get blobVersionedHashes(){let t=this.#f;return t==null&&this.type===3?[]:t}set blobVersionedHashes(t){if(t!=null){k(Array.isArray(t),"blobVersionedHashes must be an Array","value",t),t=t.slice();for(let n=0;n<t.length;n++)k(Ce(t[n],32),"invalid blobVersionedHash",`value[${n}]`,t[n])}this.#f=t}get blobs(){return this.#m==null?null:this.#m.map(t=>Object.assign({},t))}set blobs(t){if(t==null){this.#m=null;return}let n=[],r=[];for(let i=0;i<t.length;i++){let a=t[i];if(nu(a)){B(this.#h,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=ue(a);if(k(o.length<=FA,"blob is too large",`blobs[${i}]`,a),o.length!==FA){let l=new Uint8Array(FA);l.set(o),o=l}let s=this.#h.blobToKzgCommitment(o),u=W(this.#h.computeBlobKzgProof(o,s));n.push({data:W(o),commitment:W(s),proof:u}),r.push(x4(1,s))}else{let o=W(a.commitment);n.push({data:W(a.data),commitment:o,proof:W(a.proof)}),r.push(x4(1,o))}}this.#m=n,this.#f=r}get kzg(){return this.#h}set kzg(t){this.#h=t}constructor(){this.#e=null,this.#t=null,this.#r=0,this.#a=Qt,this.#s=null,this.#i=null,this.#d=null,this.#n="0x",this.#l=Qt,this.#u=Qt,this.#o=null,this.#p=null,this.#c=null,this.#f=null,this.#m=null,this.#h=null}get hash(){return this.signature==null?null:We(this.#g(!0,!1))}get unsignedHash(){return We(this.unsignedSerialized)}get from(){return this.signature==null?null:w4(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:Jo.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}#g(t,n){B(!t||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});let r=t?this.signature:null;switch(this.inferType()){case 0:return Nne(this,r);case 1:return Pne(this,r);case 2:return One(this,r);case 3:return xne(this,r,n?this.blobs:null)}B(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#g(!0,!0)}get unsignedSerialized(){return this.#g(!1,!1)}inferType(){let t=this.inferTypes();return t.indexOf(2)>=0?2:t.pop()}inferTypes(){let t=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,i=this.#c!=null||this.#f;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&B(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),B(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),B(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});let a=[];return this.type!=null?a.push(this.type):n?a.push(2):t?(a.push(1),r||a.push(0)):r?(a.push(1),a.push(2)):(i&&this.to||(a.push(0),a.push(1),a.push(2)),a.push(3)),a.sort(),a}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return e.from(this)}toJSON(){let t=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:t(this.gasLimit),gasPrice:t(this.gasPrice),maxPriorityFeePerGas:t(this.maxPriorityFeePerGas),maxFeePerGas:t(this.maxFeePerGas),value:t(this.value),chainId:t(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(t){if(t==null)return new e;if(typeof t=="string"){let r=ue(t);if(r[0]>=127)return e.from(Ane(r));switch(r[0]){case 1:return e.from(Rne(r));case 2:return e.from(Ine(r));case 3:return e.from(wne(r))}B(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}let n=new e;return t.type!=null&&(n.type=t.type),t.to!=null&&(n.to=t.to),t.nonce!=null&&(n.nonce=t.nonce),t.gasLimit!=null&&(n.gasLimit=t.gasLimit),t.gasPrice!=null&&(n.gasPrice=t.gasPrice),t.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=t.maxPriorityFeePerGas),t.maxFeePerGas!=null&&(n.maxFeePerGas=t.maxFeePerGas),t.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=t.maxFeePerBlobGas),t.data!=null&&(n.data=t.data),t.value!=null&&(n.value=t.value),t.chainId!=null&&(n.chainId=t.chainId),t.signature!=null&&(n.signature=Mn.from(t.signature)),t.accessList!=null&&(n.accessList=t.accessList),t.blobVersionedHashes!=null&&(n.blobVersionedHashes=t.blobVersionedHashes),t.kzg!=null&&(n.kzg=t.kzg),t.blobs!=null&&(n.blobs=t.blobs),t.hash!=null&&(k(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",t),k(n.hash===t.hash,"hash mismatch","tx",t)),t.from!=null&&(k(n.isSigned(),"unsigned transaction cannot define '.from'","tx",t),k(n.from.toLowerCase()===(t.from||"").toLowerCase(),"from mismatch","tx",t)),n}};var L4=new Uint8Array(32);L4.fill(0);var Bne=BigInt(-1),F4=BigInt(0),U4=BigInt(1),Dne=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Mne(e){let t=ue(e),n=t.length%32;return n?Ue([t,L4.slice(n)]):W(t)}var Lne=zn(U4,32),Fne=zn(F4,32),B4={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},JA=["name","version","chainId","verifyingContract","salt"];function D4(e){return function(t){return k(typeof t=="string",`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}var Une={name:D4("name"),version:D4("version"),chainId:function(e){let t=z(e,"domain.chainId");return k(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):aa(t)},verifyingContract:function(e){try{return be(e).toLowerCase()}catch{}k(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){let t=ue(e,"domain.salt");return k(t.length===32,'invalid domain value "salt"',"domain.salt",e),W(t)}};function WA(e){{let t=e.match(/^(u?)int(\d+)$/);if(t){let n=t[1]==="",r=parseInt(t[2]);k(r%8===0&&r!==0&&r<=256&&t[2]===String(r),"invalid numeric width","type",e);let i=wo(Dne,n?r-1:r),a=n?(i+U4)*Bne:F4;return function(o){let s=z(o,"value");return k(s>=a&&s<=i,`value out-of-bounds for ${e}`,"value",s),zn(n?Tp(s,256):s,32)}}}{let t=e.match(/^bytes(\d+)$/);if(t){let n=parseInt(t[1]);return k(n!==0&&n<=32&&t[1]===String(n),"invalid bytes width","type",e),function(r){let i=ue(r);return k(i.length===n,`invalid length for ${e}`,"value",r),Mne(r)}}}switch(e){case"address":return function(t){return lr(be(t),32)};case"bool":return function(t){return t?Lne:Fne};case"bytes":return function(t){return We(t)};case"string":return function(t){return Ni(t)}}return null}function M4(e,t){return`${e}(${t.map(({name:n,type:r})=>r+" "+n).join(",")})`}function Zy(e){let t=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return t?{base:t[1],index:t[2]+t[4],array:{base:t[1],prefix:t[1]+t[2],count:t[5]?parseInt(t[5]):-1}}:{base:e}}var df=class e{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#n;constructor(t){this.#t=new Map,this.#n=new Map;let n=new Map,r=new Map,i=new Map,a={};Object.keys(t).forEach(u=>{a[u]=t[u].map(({name:l,type:c})=>{let{base:d,index:f}=Zy(c);return d==="int"&&!t.int&&(d="int256"),d==="uint"&&!t.uint&&(d="uint256"),{name:l,type:d+(f||"")}}),n.set(u,new Set),r.set(u,[]),i.set(u,new Set)}),this.#e=JSON.stringify(a);for(let u in a){let l=new Set;for(let c of a[u]){k(!l.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(u)}`,"types",t),l.add(c.name);let d=Zy(c.type).base;k(d!==u,`circular type reference to ${JSON.stringify(d)}`,"types",t),!WA(d)&&(k(r.has(d),`unknown type ${JSON.stringify(d)}`,"types",t),r.get(d).push(u),n.get(u).add(d))}}let o=Array.from(r.keys()).filter(u=>r.get(u).length===0);k(o.length!==0,"missing primary type","types",t),k(o.length===1,`ambiguous primary types or unused types: ${o.map(u=>JSON.stringify(u)).join(", ")}`,"types",t),K(this,{primaryType:o[0]});function s(u,l){k(!l.has(u),`circular type reference to ${JSON.stringify(u)}`,"types",t),l.add(u);for(let c of n.get(u))if(r.has(c)){s(c,l);for(let d of l)i.get(d).add(c)}l.delete(u)}s(this.primaryType,new Set);for(let[u,l]of i){let c=Array.from(l);c.sort(),this.#t.set(u,M4(u,a[u])+c.map(d=>M4(d,a[d])).join(""))}}getEncoder(t){let n=this.#n.get(t);return n||(n=this.#r(t),this.#n.set(t,n)),n}#r(t){{let i=WA(t);if(i)return i}let n=Zy(t).array;if(n){let i=n.prefix,a=this.getEncoder(i);return o=>{k(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let s=o.map(a);return this.#t.has(i)&&(s=s.map(We)),We(Ue(s))}}let r=this.types[t];if(r){let i=Ni(this.#t.get(t));return a=>{let o=r.map(({name:s,type:u})=>{let l=this.getEncoder(u)(a[s]);return this.#t.has(u)?We(l):l});return o.unshift(i),Ue(o)}}k(!1,`unknown type: ${t}`,"type",t)}encodeType(t){let n=this.#t.get(t);return k(n,`unknown type: ${JSON.stringify(t)}`,"name",t),n}encodeData(t,n){return this.getEncoder(t)(n)}hashStruct(t,n){return We(this.encodeData(t,n))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,n,r){if(WA(t))return r(t,n);let i=Zy(t).array;if(i)return k(i.count===-1||i.count===n.length,`array length mismatch; expected length ${i.count}`,"value",n),n.map(o=>this._visit(i.prefix,o,r));let a=this.types[t];if(a)return a.reduce((o,{name:s,type:u})=>(o[s]=this._visit(u,n[s],r),o),{});k(!1,`unknown type: ${t}`,"type",t)}visit(t,n){return this._visit(this.primaryType,t,n)}static from(t){return new e(t)}static getPrimaryType(t){return e.from(t).primaryType}static hashStruct(t,n,r){return e.from(n).hashStruct(t,r)}static hashDomain(t){let n=[];for(let r in t){if(t[r]==null)continue;let i=B4[r];k(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),n.push({name:r,type:i})}return n.sort((r,i)=>JA.indexOf(r.name)-JA.indexOf(i.name)),e.hashStruct("EIP712Domain",{EIP712Domain:n},t)}static encode(t,n,r){return Ue(["0x1901",e.hashDomain(t),e.from(n).hash(r)])}static hash(t,n,r){return We(e.encode(t,n,r))}static async resolveNames(t,n,r,i){t=Object.assign({},t);for(let s in t)t[s]==null&&delete t[s];let a={};t.verifyingContract&&!Ce(t.verifyingContract,20)&&(a[t.verifyingContract]="0x");let o=e.from(n);o.visit(r,(s,u)=>(s==="address"&&!Ce(u,20)&&(a[u]="0x"),u));for(let s in a)a[s]=await i(s);return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),r=o.visit(r,(s,u)=>s==="address"&&a[u]?a[u]:u),{domain:t,value:r}}static getPayload(t,n,r){e.hashDomain(t);let i={},a=[];JA.forEach(u=>{let l=t[u];l!=null&&(i[u]=Une[u](l),a.push({name:u,type:B4[u]}))});let o=e.from(n);n=o.types;let s=Object.assign({},n);return k(s.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(u,l)=>{if(u.match(/^bytes(\d*)/))return W(ue(l));if(u.match(/^u?int/))return z(l).toString();switch(u){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return k(typeof l=="string","invalid string","value",l),l}k(!1,"unsupported type","type",u)})}}};function Ln(e){let t=new Set;return e.forEach(n=>t.add(n)),Object.freeze(t)}var qne="external public payable override",Vne=Ln(qne.split(" ")),Z4="constant external internal payable private public pure view override",Jne=Ln(Z4.split(" ")),Y4="constructor error event fallback function receive struct",X4=Ln(Y4.split(" ")),$4="calldata memory storage payable indexed",Wne=Ln($4.split(" ")),Hne="tuple returns",Gne=[Y4,$4,Hne,Z4].join(" "),zne=Ln(Gne.split(" ")),Qne={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Kne=new RegExp("^(\\s*)"),Zne=new RegExp("^([0-9]+)"),Yne=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),j4=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),e7=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),Ii=class e{#e;#t;get offset(){return this.#e}get length(){return this.#t.length-this.#e}constructor(t){this.#e=0,this.#t=t.slice()}clone(){return new e(this.#t)}reset(){this.#e=0}#n(t=0,n=0){return new e(this.#t.slice(t,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-t,linkBack:r.linkBack-t,linkNext:r.linkNext-t}))))}popKeyword(t){let n=this.peek();if(n.type!=="KEYWORD"||!t.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(t){if(this.peek().type!==t){let n=this.peek();throw new Error(`expected ${t}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){let t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");let n=this.#n(this.#e+1,t.match+1);return this.#e=t.match+1,n}popParams(){let t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");let n=[];for(;this.#e<t.match-1;){let r=this.peek().linkNext;n.push(this.#n(this.#e+1,r)),this.#e=r}return this.#e=t.match+1,n}peek(){if(this.#e>=this.#t.length)throw new Error("out-of-bounds");return this.#t[this.#e]}peekKeyword(t){let n=this.peekType("KEYWORD");return n!=null&&t.has(n)?n:null}peekType(t){if(this.length===0)return null;let n=this.peek();return n.type===t?n.text:null}pop(){let t=this.peek();return this.#e++,t}toString(){let t=[];for(let n=this.#e;n<this.#t.length;n++){let r=this.#t[n];t.push(`${r.type}:${r.text}`)}return`<TokenString ${t.join(" ")}>`}};function Qo(e){let t=[],n=o=>{let s=a<e.length?JSON.stringify(e[a]):"$EOI";throw new Error(`invalid token ${s} at ${a}: ${o}`)},r=[],i=[],a=0;for(;a<e.length;){let o=e.substring(a),s=o.match(Kne);s&&(a+=s[1].length,o=e.substring(a));let u={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:a,value:-1};t.push(u);let l=Qne[o[0]]||"";if(l){if(u.type=l,u.text=o[0],a++,l==="OPEN_PAREN")r.push(t.length-1),i.push(t.length-1);else if(l=="CLOSE_PAREN")r.length===0&&n("no matching open bracket"),u.match=r.pop(),t[u.match].match=t.length-1,u.depth--,u.linkBack=i.pop(),t[u.linkBack].linkNext=t.length-1;else if(l==="COMMA")u.linkBack=i.pop(),t[u.linkBack].linkNext=t.length-1,i.push(t.length-1);else if(l==="OPEN_BRACKET")u.type="BRACKET";else if(l==="CLOSE_BRACKET"){let c=t.pop().text;if(t.length>0&&t[t.length-1].type==="NUMBER"){let d=t.pop().text;c=d+c,t[t.length-1].value=pe(d)}if(t.length===0||t[t.length-1].type!=="BRACKET")throw new Error("missing opening bracket");t[t.length-1].text+=c}continue}if(s=o.match(Yne),s){if(u.text=s[1],a+=u.text.length,zne.has(u.text)){u.type="KEYWORD";continue}if(u.text.match(e7)){u.type="TYPE";continue}u.type="ID";continue}if(s=o.match(Zne),s){u.text=s[1],u.type="NUMBER",a+=u.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new Ii(t.map(o=>Object.freeze(o)))}function q4(e,t){let n=[];for(let r in t.keys())e.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function Yy(e,t){if(t.peekKeyword(X4)){let n=t.pop().text;if(n!==e)throw new Error(`expected ${e}, got ${n}`)}return t.popType("ID")}function Ha(e,t){let n=new Set;for(;;){let r=e.peekType("KEYWORD");if(r==null||t&&!t.has(r))break;if(e.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function t7(e){let t=Ha(e,Jne);return q4(t,Ln("constant payable nonpayable".split(" "))),q4(t,Ln("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function Wa(e,t){return e.popParams().map(n=>wt.from(n,t))}function n7(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return z(e.pop().text);throw new Error("invalid gas")}return null}function pu(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}var Xne=new RegExp(/^(.*)\[([0-9]*)\]$/);function V4(e){let t=e.match(e7);if(k(t,"invalid type","type",e),e==="uint")return"uint256";if(e==="int")return"int256";if(t[2]){let n=parseInt(t[2]);k(n!==0&&n<=32,"invalid bytes length","type",e)}else if(t[3]){let n=parseInt(t[3]);k(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",e)}return e}var pt={},Qn=Symbol.for("_ethers_internal"),J4="_ParamTypeInternal",W4="_ErrorInternal",H4="_EventInternal",G4="_ConstructorInternal",z4="_FallbackInternal",Q4="_FunctionInternal",K4="_StructInternal",wt=class e{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(t,n,r,i,a,o,s,u){if(Po(t,pt,"ParamType"),Object.defineProperty(this,Qn,{value:J4}),o&&(o=Object.freeze(o.slice())),i==="array"){if(s==null||u==null)throw new Error("")}else if(s!=null||u!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");K(this,{name:n,type:r,baseType:i,indexed:a,components:o,arrayLength:s,arrayChildren:u})}format(t){if(t==null&&(t="sighash"),t==="json"){let r=this.name||"";if(this.isArray()){let a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}let i={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(t)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(t),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(t)).join(t==="full"?", ":",")+")":n+=this.type,t!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),t==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(t,n){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");let r=this;return t.map(i=>r.arrayChildren.walk(i,n))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");let r=this;return t.map((i,a)=>r.components[a].walk(i,n))}return n(this.type,t)}#e(t,n,r,i){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");let o=this.arrayChildren,s=n.slice();s.forEach((u,l)=>{o.#e(t,u,r,c=>{s[l]=c})}),i(s);return}if(this.isTuple()){let o=this.components,s;if(Array.isArray(n))s=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");s=o.map(u=>{if(!u.name)throw new Error("cannot use object value with unnamed components");if(!(u.name in n))throw new Error(`missing value for component ${u.name}`);return n[u.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");s.forEach((u,l)=>{o[l].#e(t,u,r,c=>{s[l]=c})}),i(s);return}let a=r(this.type,n);a.then?t.push(async function(){i(await a)}()):i(a)}async walkAsync(t,n){let r=[],i=[t];return this.#e(r,t,n,a=>{i[0]=a}),r.length&&await Promise.all(r),i[0]}static from(t,n){if(e.isParamType(t))return t;if(typeof t=="string")try{return e.from(Qo(t),n)}catch{k(!1,"invalid param type","obj",t)}else if(t instanceof Ii){let s="",u="",l=null;Ha(t,Ln(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(u="tuple",l=t.popParams().map(p=>e.from(p)),s=`tuple(${l.map(p=>p.format()).join(",")})`):(s=V4(t.popType("TYPE")),u=s);let c=null,d=null;for(;t.length&&t.peekType("BRACKET");){let p=t.pop();c=new e(pt,"",s,u,null,l,d,c),d=p.value,s+=p.text,u="array",l=null}let f=null;if(Ha(t,Wne).has("indexed")){if(!n)throw new Error("");f=!0}let g=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new e(pt,g,s,u,f,l,d,c)}let r=t.name;k(!r||typeof r=="string"&&r.match(j4),"invalid name","obj.name",r);let i=t.indexed;i==!0?(k(n,"parameter cannot be indexed","obj.indexed",t.indexed),i=!0):i=!1;let a=t.type,o=a.match(Xne);if(o){let s=parseInt(o[2]||"-1"),u=e.from({type:o[1],components:t.components});return new e(pt,r||"",a,"array",i,null,s,u)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){let s=t.components!=null?t.components.map(l=>e.from(l)):null;return new e(pt,r||"",a,"tuple",i,s,null,null)}return a=V4(t.type),new e(pt,r||"",a,a,i,null,null,null)}static isParamType(t){return t&&t[Qn]===J4}},zo=class e{type;inputs;constructor(t,n,r){Po(t,pt,"Fragment"),r=Object.freeze(r.slice()),K(this,{type:n,inputs:r})}static from(t){if(typeof t=="string"){try{e.from(JSON.parse(t))}catch{}return e.from(Qo(t))}if(t instanceof Ii)switch(t.peekKeyword(X4)){case"constructor":return Ho.from(t);case"error":return pr.from(t);case"event":return Wo.from(t);case"fallback":case"receive":return Fp.from(t);case"function":return Go.from(t);case"struct":return ff.from(t)}else if(typeof t=="object"){switch(t.type){case"constructor":return Ho.from(t);case"error":return pr.from(t);case"event":return Wo.from(t);case"fallback":case"receive":return Fp.from(t);case"function":return Go.from(t);case"struct":return ff.from(t)}B(!1,`unsupported type: ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}k(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return Ho.isFragment(t)}static isError(t){return pr.isFragment(t)}static isEvent(t){return Wo.isFragment(t)}static isFunction(t){return Go.isFragment(t)}static isStruct(t){return ff.isFragment(t)}},mu=class extends zo{name;constructor(t,n,r,i){super(t,n,i),k(typeof r=="string"&&r.match(j4),"invalid identifier","name",r),i=Object.freeze(i.slice()),K(this,{name:r})}};function Lp(e,t){return"("+t.map(n=>n.format(e)).join(e==="full"?", ":",")+")"}var pr=class e extends mu{constructor(t,n,r){super(t,"error",n,r),Object.defineProperty(this,Qn,{value:W4})}get selector(){return Ni(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});let n=[];return t!=="sighash"&&n.push("error"),n.push(this.name+Lp(t,this.inputs)),n.join(" ")}static from(t){if(e.isFragment(t))return t;if(typeof t=="string")return e.from(Qo(t));if(t instanceof Ii){let n=Yy("error",t),r=Wa(t);return pu(t),new e(pt,n,r)}return new e(pt,t.name,t.inputs?t.inputs.map(wt.from):[])}static isFragment(t){return t&&t[Qn]===W4}},Wo=class e extends mu{anonymous;constructor(t,n,r,i){super(t,"event",n,r),Object.defineProperty(this,Qn,{value:H4}),K(this,{anonymous:i})}get topicHash(){return Ni(this.format("sighash"))}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});let n=[];return t!=="sighash"&&n.push("event"),n.push(this.name+Lp(t,this.inputs)),t!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(t,n){return n=(n||[]).map(i=>wt.from(i)),new e(pt,t,n,!1).topicHash}static from(t){if(e.isFragment(t))return t;if(typeof t=="string")try{return e.from(Qo(t))}catch{k(!1,"invalid event fragment","obj",t)}else if(t instanceof Ii){let n=Yy("event",t),r=Wa(t,!0),i=!!Ha(t,Ln(["anonymous"])).has("anonymous");return pu(t),new e(pt,n,r,i)}return new e(pt,t.name,t.inputs?t.inputs.map(n=>wt.from(n,!0)):[],!!t.anonymous)}static isFragment(t){return t&&t[Qn]===H4}},Ho=class e extends zo{payable;gas;constructor(t,n,r,i,a){super(t,n,r),Object.defineProperty(this,Qn,{value:G4}),K(this,{payable:i,gas:a})}format(t){if(B(t!=null&&t!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});let n=[`constructor${Lp(t,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(t){if(e.isFragment(t))return t;if(typeof t=="string")try{return e.from(Qo(t))}catch{k(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof Ii){Ha(t,Ln(["constructor"]));let n=Wa(t),r=!!Ha(t,Vne).has("payable"),i=n7(t);return pu(t),new e(pt,"constructor",n,r,i)}return new e(pt,"constructor",t.inputs?t.inputs.map(wt.from):[],!!t.payable,t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[Qn]===G4}},Fp=class e extends zo{payable;constructor(t,n,r){super(t,"fallback",n),Object.defineProperty(this,Qn,{value:z4}),K(this,{payable:r})}format(t){let n=this.inputs.length===0?"receive":"fallback";if(t==="json"){let r=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:r})}return`${n}()${this.payable?" payable":""}`}static from(t){if(e.isFragment(t))return t;if(typeof t=="string")try{return e.from(Qo(t))}catch{k(!1,"invalid fallback fragment","obj",t)}else if(t instanceof Ii){let n=t.toString(),r=t.peekKeyword(Ln(["fallback","receive"]));if(k(r,"type must be fallback or receive","obj",n),t.popKeyword(Ln(["fallback","receive"]))==="receive"){let s=Wa(t);return k(s.length===0,"receive cannot have arguments","obj.inputs",s),Ha(t,Ln(["payable"])),pu(t),new e(pt,[],!0)}let a=Wa(t);a.length?k(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(s=>s.format("minimal")).join(", ")):a=[wt.from("bytes")];let o=t7(t);if(k(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),Ha(t,Ln(["returns"])).has("returns")){let s=Wa(t);k(s.length===1&&s[0].type==="bytes","invalid fallback outputs","obj.outputs",s.map(u=>u.format("minimal")).join(", "))}return pu(t),new e(pt,a,o==="payable")}if(t.type==="receive")return new e(pt,[],!0);if(t.type==="fallback"){let n=[wt.from("bytes")],r=t.stateMutability==="payable";return new e(pt,n,r)}k(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[Qn]===z4}},Go=class e extends mu{constant;outputs;stateMutability;payable;gas;constructor(t,n,r,i,a,o){super(t,"function",n,i),Object.defineProperty(this,Qn,{value:Q4}),a=Object.freeze(a.slice()),K(this,{constant:r==="view"||r==="pure",gas:o,outputs:a,payable:r==="payable",stateMutability:r})}get selector(){return Ni(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t))),outputs:this.outputs.map(r=>JSON.parse(r.format(t)))});let n=[];return t!=="sighash"&&n.push("function"),n.push(this.name+Lp(t,this.inputs)),t!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(Lp(t,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(t,n){return n=(n||[]).map(i=>wt.from(i)),new e(pt,t,"view",n,[],null).selector}static from(t){if(e.isFragment(t))return t;if(typeof t=="string")try{return e.from(Qo(t))}catch{k(!1,"invalid function fragment","obj",t)}else if(t instanceof Ii){let r=Yy("function",t),i=Wa(t),a=t7(t),o=[];Ha(t,Ln(["returns"])).has("returns")&&(o=Wa(t));let s=n7(t);return pu(t),new e(pt,r,a,i,o,s)}let n=t.stateMutability;return n==null&&(n="payable",typeof t.constant=="boolean"?(n="view",t.constant||(n="payable",typeof t.payable=="boolean"&&!t.payable&&(n="nonpayable"))):typeof t.payable=="boolean"&&!t.payable&&(n="nonpayable")),new e(pt,t.name,n,t.inputs?t.inputs.map(wt.from):[],t.outputs?t.outputs.map(wt.from):[],t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[Qn]===Q4}},ff=class e extends mu{constructor(t,n,r){super(t,"struct",n,r),Object.defineProperty(this,Qn,{value:K4})}format(){throw new Error("@TODO")}static from(t){if(typeof t=="string")try{return e.from(Qo(t))}catch{k(!1,"invalid struct fragment","obj",t)}else if(t instanceof Ii){let n=Yy("struct",t),r=Wa(t);return pu(t),new e(pt,n,r)}return new e(pt,t.name,t.inputs?t.inputs.map(wt.from):[])}static isFragment(t){return t&&t[Qn]===K4}};var Oi=new Map;Oi.set(0,"GENERIC_PANIC");Oi.set(1,"ASSERT_FALSE");Oi.set(17,"OVERFLOW");Oi.set(18,"DIVIDE_BY_ZERO");Oi.set(33,"ENUM_RANGE_ERROR");Oi.set(34,"BAD_STORAGE_DATA");Oi.set(49,"STACK_UNDERFLOW");Oi.set(50,"ARRAY_RANGE_ERROR");Oi.set(65,"OUT_OF_MEMORY");Oi.set(81,"UNINITIALIZED_FUNCTION_CALL");var $ne=new RegExp(/^bytes([0-9]*)$/),jne=new RegExp(/^(u?int)([0-9]*)$/),HA=null,r7=1024;function ere(e,t,n,r){let i="missing revert data",a=null,o=null,s=null;if(n){i="execution reverted";let l=ue(n);if(n=W(n),l.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(l.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(W(l.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],l.slice(4))[0],s={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(W(l.slice(0,4))==="0x4e487b71")try{let c=Number(r.decode(["uint256"],l.slice(4))[0]);s={signature:"Panic(uint256)",name:"Panic",args:[c]},a=`Panic due to ${Oi.get(c)||"UNKNOWN"}(${c})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}let u={to:t.to?be(t.to):null,data:t.data||"0x"};return t.from&&(u.from=be(t.from)),Je(i,"CALL_EXCEPTION",{action:e,data:n,reason:a,transaction:u,invocation:o,revert:s})}var Ga=class e{#e(t){if(t.isArray())return new By(this.#e(t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new cu(t.components.map(r=>this.#e(r)),t.name);switch(t.baseType){case"address":return new wy(t.name);case"bool":return new Dy(t.name);case"string":return new qy(t.name);case"bytes":return new My(t.name);case"":return new Fy(t.name)}let n=t.type.match(jne);if(n){let r=parseInt(n[2]||"256");return k(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",t),new Uy(r/8,n[1]==="int",t.name)}if(n=t.type.match($ne),n){let r=parseInt(n[1]);return k(r!==0&&r<=32,"invalid bytes length","param",t),new Ly(r,t.name)}k(!1,"invalid type","type",t.type)}getDefaultValue(t){let n=t.map(i=>this.#e(wt.from(i)));return new cu(n,"_").defaultValue()}encode(t,n){bp(n.length,t.length,"types/values length mismatch");let r=t.map(o=>this.#e(wt.from(o))),i=new cu(r,"_"),a=new au;return i.encode(a,n),a.data}decode(t,n,r){let i=t.map(o=>this.#e(wt.from(o)));return new cu(i,"_").decode(new py(n,r,r7))}static _setDefaultMaxInflation(t){k(typeof t=="number"&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),r7=t}static defaultAbiCoder(){return HA==null&&(HA=new e),HA}static getBuiltinCallException(t,n,r){return ere(t,n,r,e.defaultAbiCoder())}};var Up=class{fragment;name;signature;topic;args;constructor(t,n,r){let i=t.name,a=t.format();K(this,{fragment:t,name:i,signature:a,topic:n,args:r})}},qp=class{fragment;name;args;signature;selector;value;constructor(t,n,r,i){let a=t.name,o=t.format();K(this,{fragment:t,name:a,args:r,signature:o,selector:n,value:i})}},Vp=class{fragment;name;args;signature;selector;constructor(t,n,r){let i=t.name,a=t.format();K(this,{fragment:t,name:i,args:r,signature:a,selector:n})}},hf=class{hash;_isIndexed;static isIndexed(t){return!!(t&&t._isIndexed)}constructor(t){K(this,{hash:t,_isIndexed:!0})}},i7={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},a7={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let t="unknown panic code";return e>=0&&e<=255&&i7[e.toString()]&&(t=i7[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${t})`}}},Ko=class e{fragments;deploy;fallback;receive;#e;#t;#n;#r;constructor(t){let n=[];typeof t=="string"?n=JSON.parse(t):n=t,this.#n=new Map,this.#e=new Map,this.#t=new Map;let r=[];for(let o of n)try{r.push(zo.from(o))}catch(s){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,s.message)}K(this,{fragments:Object.freeze(r)});let i=null,a=!1;this.#r=this.getAbiCoder(),this.fragments.forEach((o,s)=>{let u;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}K(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(k(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${s}]`,o),i=o,a=i.payable);return;case"function":u=this.#n;break;case"event":u=this.#t;break;case"error":u=this.#e;break;default:return}let l=o.format();u.has(l)||u.set(l,o)}),this.deploy||K(this,{deploy:Ho.from("constructor()")}),K(this,{fallback:i,receive:a})}format(t){let n=t?"minimal":"full";return this.fragments.map(i=>i.format(n))}formatJson(){let t=this.fragments.map(n=>n.format("json"));return JSON.stringify(t.map(n=>JSON.parse(n)))}getAbiCoder(){return Ga.defaultAbiCoder()}#a(t,n,r){if(Ce(t)){let a=t.toLowerCase();for(let o of this.#n.values())if(a===o.selector)return o;return null}if(t.indexOf("(")===-1){let a=[];for(let[o,s]of this.#n)o.split("(")[0]===t&&a.push(s);if(n){let o=n.length>0?n[n.length-1]:null,s=n.length,u=!0;Xe.isTyped(o)&&o.type==="overrides"&&(u=!1,s--);for(let l=a.length-1;l>=0;l--){let c=a[l].inputs.length;c!==s&&(!u||c!==s-1)&&a.splice(l,1)}for(let l=a.length-1;l>=0;l--){let c=a[l].inputs;for(let d=0;d<n.length;d++)if(Xe.isTyped(n[d])){if(d>=c.length){if(n[d].type==="overrides")continue;a.splice(l,1);break}if(n[d].type!==c[d].baseType){a.splice(l,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){let o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){let o=a.map(s=>JSON.stringify(s.format())).join(", ");k(!1,`ambiguous function description (i.e. matches ${o})`,"key",t)}return a[0]}let i=this.#n.get(Go.from(t).format());return i||null}getFunctionName(t){let n=this.#a(t,null,!1);return k(n,"no matching function","key",t),n.name}hasFunction(t){return!!this.#a(t,null,!1)}getFunction(t,n){return this.#a(t,n||null,!0)}forEachFunction(t){let n=Array.from(this.#n.keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;r<n.length;r++){let i=n[r];t(this.#n.get(i),r)}}#s(t,n,r){if(Ce(t)){let a=t.toLowerCase();for(let o of this.#t.values())if(a===o.topicHash)return o;return null}if(t.indexOf("(")===-1){let a=[];for(let[o,s]of this.#t)o.split("(")[0]===t&&a.push(s);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length<n.length&&a.splice(o,1);for(let o=a.length-1;o>=0;o--){let s=a[o].inputs;for(let u=0;u<n.length;u++)if(Xe.isTyped(n[u])&&n[u].type!==s[u].baseType){a.splice(o,1);break}}}if(a.length===0)return null;if(a.length>1&&r){let o=a.map(s=>JSON.stringify(s.format())).join(", ");k(!1,`ambiguous event description (i.e. matches ${o})`,"key",t)}return a[0]}let i=this.#t.get(Wo.from(t).format());return i||null}getEventName(t){let n=this.#s(t,null,!1);return k(n,"no matching event","key",t),n.name}hasEvent(t){return!!this.#s(t,null,!1)}getEvent(t,n){return this.#s(t,n||null,!0)}forEachEvent(t){let n=Array.from(this.#t.keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;r<n.length;r++){let i=n[r];t(this.#t.get(i),r)}}getError(t,n){if(Ce(t)){let i=t.toLowerCase();if(a7[i])return pr.from(a7[i].signature);for(let a of this.#e.values())if(i===a.selector)return a;return null}if(t.indexOf("(")===-1){let i=[];for(let[a,o]of this.#e)a.split("(")[0]===t&&i.push(o);if(i.length===0)return t==="Error"?pr.from("error Error(string)"):t==="Panic"?pr.from("error Panic(uint256)"):null;if(i.length>1){let a=i.map(o=>JSON.stringify(o.format())).join(", ");k(!1,`ambiguous error description (i.e. ${a})`,"name",t)}return i[0]}if(t=pr.from(t).format(),t==="Error(string)")return pr.from("error Error(string)");if(t==="Panic(uint256)")return pr.from("error Panic(uint256)");let r=this.#e.get(t);return r||null}forEachError(t){let n=Array.from(this.#e.keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;r<n.length;r++){let i=n[r];t(this.#e.get(i),r)}}_decodeParams(t,n){return this.#r.decode(t,n)}_encodeParams(t,n){return this.#r.encode(t,n)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,n){if(typeof t=="string"){let r=this.getError(t);k(r,"unknown error","fragment",t),t=r}return k(ot(n,0,4)===t.selector,`data signature does not match error ${t.name}.`,"data",n),this._decodeParams(t.inputs,ot(n,4))}encodeErrorResult(t,n){if(typeof t=="string"){let r=this.getError(t);k(r,"unknown error","fragment",t),t=r}return Ue([t.selector,this._encodeParams(t.inputs,n||[])])}decodeFunctionData(t,n){if(typeof t=="string"){let r=this.getFunction(t);k(r,"unknown function","fragment",t),t=r}return k(ot(n,0,4)===t.selector,`data signature does not match function ${t.name}.`,"data",n),this._decodeParams(t.inputs,ot(n,4))}encodeFunctionData(t,n){if(typeof t=="string"){let r=this.getFunction(t);k(r,"unknown function","fragment",t),t=r}return Ue([t.selector,this._encodeParams(t.inputs,n||[])])}decodeFunctionResult(t,n){if(typeof t=="string"){let a=this.getFunction(t);k(a,"unknown function","fragment",t),t=a}let r="invalid length for result data",i=ht(n);if(i.length%32===0)try{return this.#r.decode(t.outputs,i)}catch{r="could not decode result data"}B(!1,r,"BAD_DATA",{value:W(i),info:{method:t.name,signature:t.format()}})}makeError(t,n){let r=ue(t,"data"),i=Ga.getBuiltinCallException("call",n,r);if(i.message.startsWith("execution reverted (unknown custom error)")){let s=W(r.slice(0,4)),u=this.getError(s);if(u)try{let l=this.#r.decode(u.inputs,r.slice(4));i.revert={name:u.name,signature:u.format(),args:l},i.reason=i.revert.signature,i.message=`execution reverted: ${i.reason}`}catch{i.message="execution reverted (coult not decode custom error)"}}let o=this.parseTransaction(n);return o&&(i.invocation={method:o.name,signature:o.signature,args:o.args}),i}encodeFunctionResult(t,n){if(typeof t=="string"){let r=this.getFunction(t);k(r,"unknown function","fragment",t),t=r}return W(this.#r.encode(t.outputs,n||[]))}encodeFilterTopics(t,n){if(typeof t=="string"){let a=this.getEvent(t);k(a,"unknown event","eventFragment",t),t=a}B(n.length<=t.inputs.length,`too many arguments for ${t.format()}`,"UNEXPECTED_ARGUMENT",{count:n.length,expectedCount:t.inputs.length});let r=[];t.anonymous||r.push(t.topicHash);let i=(a,o)=>a.type==="string"?Ni(o):a.type==="bytes"?We(W(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=zn(o):a.type.match(/^bytes/)?o=j1(o,32):a.type==="address"&&this.#r.encode(["address"],[o]),lr(W(o),32));for(n.forEach((a,o)=>{let s=t.inputs[o];if(!s.indexed){k(a==null,"cannot filter non-indexed parameters; must be null","contract."+s.name,a);return}a==null?r.push(null):s.baseType==="array"||s.baseType==="tuple"?k(!1,"filtering with tuples or arrays not supported","contract."+s.name,a):Array.isArray(a)?r.push(a.map(u=>i(s,u))):r.push(i(s,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(t,n){if(typeof t=="string"){let o=this.getEvent(t);k(o,"unknown event","eventFragment",t),t=o}let r=[],i=[],a=[];return t.anonymous||r.push(t.topicHash),k(n.length===t.inputs.length,"event arguments/values mismatch","values",n),t.inputs.forEach((o,s)=>{let u=n[s];if(o.indexed)if(o.type==="string")r.push(Ni(u));else if(o.type==="bytes")r.push(We(u));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(this.#r.encode([o.type],[u]))}else i.push(o),a.push(u)}),{data:this.#r.encode(i,a),topics:r}}decodeEventLog(t,n,r){if(typeof t=="string"){let h=this.getEvent(t);k(h,"unknown event","eventFragment",t),t=h}if(r!=null&&!t.anonymous){let h=t.topicHash;k(Ce(r[0],32)&&r[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}let i=[],a=[],o=[];t.inputs.forEach((h,g)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(i.push(wt.from({type:"bytes32",name:h.name})),o.push(!0)):(i.push(h),o.push(!1)):(a.push(h),o.push(!1))});let s=r!=null?this.#r.decode(i,Ue(r)):null,u=this.#r.decode(a,n,!0),l=[],c=[],d=0,f=0;return t.inputs.forEach((h,g)=>{let p=null;if(h.indexed)if(s==null)p=new hf(null);else if(o[g])p=new hf(s[f++]);else try{p=s[f++]}catch(b){p=b}else try{p=u[d++]}catch(b){p=b}l.push(p),c.push(h.name||null)}),sa.fromItems(l,c)}parseTransaction(t){let n=ue(t.data,"tx.data"),r=z(t.value!=null?t.value:0,"tx.value"),i=this.getFunction(W(n.slice(0,4)));if(!i)return null;let a=this.#r.decode(i.inputs,n.slice(4));return new qp(i,i.selector,a,r)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){let n=this.getEvent(t.topics[0]);return!n||n.anonymous?null:new Up(n,n.topicHash,this.decodeEventLog(n,t.data,t.topics))}parseError(t){let n=W(t),r=this.getError(ot(n,0,4));if(!r)return null;let i=this.#r.decode(r.inputs,ot(n,4));return new Vp(r,r.selector,i)}static from(t){return t instanceof e?t:typeof t=="string"?new e(JSON.parse(t)):typeof t.formatJson=="function"?new e(t.formatJson()):typeof t.format=="function"?new e(t.format("json")):new e(t)}};var s7=BigInt(0);function pf(e){return e??null}function At(e){return e==null?null:e.toString()}var mf=class{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(t,n,r){K(this,{gasPrice:pf(t),maxFeePerGas:pf(n),maxPriorityFeePerGas:pf(r)})}toJSON(){let{gasPrice:t,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:At(t),maxFeePerGas:At(n),maxPriorityFeePerGas:At(r)}}};function Yo(e){let t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=W(e.data));let n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(let i of n)!(i in e)||e[i]==null||(t[i]=z(e[i],`request.${i}`));let r="type,nonce".split(/,/);for(let i of r)!(i in e)||e[i]==null||(t[i]=pe(e[i],`request.${i}`));return e.accessList&&(t.accessList=hr(e.accessList)),"blockTag"in e&&(t.blockTag=e.blockTag),"enableCcipRead"in e&&(t.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(t.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(t.kzg=e.kzg),"blobs"in e&&e.blobs&&(t.blobs=e.blobs.map(i=>nu(i)?W(i):Object.assign({},i))),t}var Jp=class{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#e;constructor(t,n){this.#e=t.transactions.map(r=>typeof r!="string"?new Zo(r,n):r),K(this,{provider:n,hash:pf(t.hash),number:t.number,timestamp:t.timestamp,parentHash:t.parentHash,parentBeaconBlockRoot:t.parentBeaconBlockRoot,nonce:t.nonce,difficulty:t.difficulty,gasLimit:t.gasLimit,gasUsed:t.gasUsed,blobGasUsed:t.blobGasUsed,excessBlobGas:t.excessBlobGas,miner:t.miner,prevRandao:pf(t.prevRandao),extraData:t.extraData,baseFeePerGas:pf(t.baseFeePerGas),stateRoot:t.stateRoot,receiptsRoot:t.receiptsRoot})}get transactions(){return this.#e.map(t=>typeof t=="string"?t:t.hash)}get prefetchedTransactions(){let t=this.#e.slice();return t.length===0?[]:(B(typeof t[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),t)}toJSON(){let{baseFeePerGas:t,difficulty:n,extraData:r,gasLimit:i,gasUsed:a,hash:o,miner:s,prevRandao:u,nonce:l,number:c,parentHash:d,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:g,timestamp:p,transactions:b}=this;return{_type:"Block",baseFeePerGas:At(t),difficulty:At(n),extraData:r,gasLimit:At(i),gasUsed:At(a),blobGasUsed:At(this.blobGasUsed),excessBlobGas:At(this.excessBlobGas),hash:o,miner:s,prevRandao:u,nonce:l,number:c,parentHash:d,timestamp:p,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:g,transactions:b}}[Symbol.iterator](){let t=0,n=this.transactions;return{next:()=>t<this.length?{value:n[t++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#e.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(t){let n;if(typeof t=="number")n=this.#e[t];else{let r=t.toLowerCase();for(let i of this.#e)if(typeof i=="string"){if(i!==r)continue;n=i;break}else{if(i.hash===r)continue;n=i;break}}if(n==null)throw new Error("no such tx");return typeof n=="string"?await this.provider.getTransaction(n):n}getPrefetchedTransaction(t){let n=this.prefetchedTransactions;if(typeof t=="number")return n[t];t=t.toLowerCase();for(let r of n)if(r.hash===t)return r;k(!1,"no matching transaction","indexOrHash",t)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return tre(this)}},Ri=class{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(t,n){this.provider=n;let r=Object.freeze(t.topics.slice());K(this,{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,removed:t.removed,address:t.address,data:t.data,topics:r,index:t.index,transactionIndex:t.transactionIndex})}toJSON(){let{address:t,blockHash:n,blockNumber:r,data:i,index:a,removed:o,topics:s,transactionHash:u,transactionIndex:l}=this;return{_type:"log",address:t,blockHash:n,blockNumber:r,data:i,index:a,removed:o,topics:s,transactionHash:u,transactionIndex:l}}async getBlock(){let t=await this.provider.getBlock(this.blockHash);return B(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransaction(){let t=await this.provider.getTransaction(this.transactionHash);return B(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransactionReceipt(){let t=await this.provider.getTransactionReceipt(this.transactionHash);return B(!!t,"failed to find transaction receipt","UNKNOWN_ERROR",{}),t}removedEvent(){return nre(this)}},gu=class{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#e;constructor(t,n){this.#e=Object.freeze(t.logs.map(i=>new Ri(i,n)));let r=s7;t.effectiveGasPrice!=null?r=t.effectiveGasPrice:t.gasPrice!=null&&(r=t.gasPrice),K(this,{provider:n,to:t.to,from:t.from,contractAddress:t.contractAddress,hash:t.hash,index:t.index,blockHash:t.blockHash,blockNumber:t.blockNumber,logsBloom:t.logsBloom,gasUsed:t.gasUsed,cumulativeGasUsed:t.cumulativeGasUsed,blobGasUsed:t.blobGasUsed,gasPrice:r,blobGasPrice:t.blobGasPrice,type:t.type,status:t.status,root:t.root})}get logs(){return this.#e}toJSON(){let{to:t,from:n,contractAddress:r,hash:i,index:a,blockHash:o,blockNumber:s,logsBloom:u,logs:l,status:c,root:d}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:s,contractAddress:r,cumulativeGasUsed:At(this.cumulativeGasUsed),from:n,gasPrice:At(this.gasPrice),blobGasUsed:At(this.blobGasUsed),blobGasPrice:At(this.blobGasPrice),gasUsed:At(this.gasUsed),hash:i,index:a,logs:l,logsBloom:u,root:d,status:c,to:t}}get length(){return this.logs.length}[Symbol.iterator](){let t=0;return{next:()=>t<this.length?{value:this.logs[t++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){let t=await this.provider.getBlock(this.blockHash);if(t==null)throw new Error("TODO");return t}async getTransaction(){let t=await this.provider.getTransaction(this.hash);if(t==null)throw new Error("TODO");return t}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return l7(this)}reorderedEvent(t){return B(!t||t.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),u7(this,t)}},Zo=class e{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;#e;constructor(t,n){this.provider=n,this.blockNumber=t.blockNumber!=null?t.blockNumber:null,this.blockHash=t.blockHash!=null?t.blockHash:null,this.hash=t.hash,this.index=t.index,this.type=t.type,this.from=t.from,this.to=t.to||null,this.gasLimit=t.gasLimit,this.nonce=t.nonce,this.data=t.data,this.value=t.value,this.gasPrice=t.gasPrice,this.maxPriorityFeePerGas=t.maxPriorityFeePerGas!=null?t.maxPriorityFeePerGas:null,this.maxFeePerGas=t.maxFeePerGas!=null?t.maxFeePerGas:null,this.maxFeePerBlobGas=t.maxFeePerBlobGas!=null?t.maxFeePerBlobGas:null,this.chainId=t.chainId,this.signature=t.signature,this.accessList=t.accessList!=null?t.accessList:null,this.blobVersionedHashes=t.blobVersionedHashes!=null?t.blobVersionedHashes:null,this.#e=-1}toJSON(){let{blockNumber:t,blockHash:n,index:r,hash:i,type:a,to:o,from:s,nonce:u,data:l,signature:c,accessList:d,blobVersionedHashes:f}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:t,blockHash:n,blobVersionedHashes:f,chainId:At(this.chainId),data:l,from:s,gasLimit:At(this.gasLimit),gasPrice:At(this.gasPrice),hash:i,maxFeePerGas:At(this.maxFeePerGas),maxPriorityFeePerGas:At(this.maxPriorityFeePerGas),maxFeePerBlobGas:At(this.maxFeePerBlobGas),nonce:u,signature:c,to:o,index:r,type:a,value:At(this.value)}}async getBlock(){let t=this.blockNumber;if(t==null){let r=await this.getTransaction();r&&(t=r.blockNumber)}if(t==null)return null;let n=this.provider.getBlock(t);if(n==null)throw new Error("TODO");return n}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){let{tx:n,blockNumber:r}=await kt({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return n==null||n.blockNumber==null?0:r-n.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(t,n){let r=t??1,i=n??0,a=this.#e,o=-1,s=a===-1,u=async()=>{if(s)return null;let{blockNumber:f,nonce:h}=await kt({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){a=f;return}if(s)return null;let g=await this.getTransaction();if(!(g&&g.blockNumber!=null))for(o===-1&&(o=a-3,o<this.#e&&(o=this.#e));o<=f;){if(s)return null;let p=await this.provider.getBlock(o,!0);if(p==null)return;for(let b of p)if(b===this.hash)return;for(let b=0;b<p.length;b++){let v=await p.getTransaction(b);if(v.from===this.from&&v.nonce===this.nonce){if(s)return null;let C=await this.provider.getTransactionReceipt(v.hash);if(C==null||f-C.blockNumber+1<r)return;let N="replaced";v.data===this.data&&v.to===this.to&&v.value===this.value?N="repriced":v.data==="0x"&&v.from===v.to&&v.value===s7&&(N="cancelled"),B(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:N==="replaced"||N==="cancelled",reason:N,replacement:v.replaceableTransaction(a),hash:v.hash,receipt:C})}}o++}},l=f=>{if(f==null||f.status!==0)return f;B(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:f.to,from:f.from,data:""},receipt:f})},c=await this.provider.getTransactionReceipt(this.hash);if(r===0)return l(c);if(c){if(await c.confirmations()>=r)return l(c)}else if(await u(),r===0)return null;return await new Promise((f,h)=>{let g=[],p=()=>{g.forEach(v=>v())};if(g.push(()=>{s=!0}),i>0){let v=setTimeout(()=>{p(),h(Je("wait for transaction timeout","TIMEOUT"))},i);g.push(()=>{clearTimeout(v)})}let b=async v=>{if(await v.confirmations()>=r){p();try{f(l(v))}catch(C){h(C)}}};if(g.push(()=>{this.provider.off(this.hash,b)}),this.provider.on(this.hash,b),a>=0){let v=async()=>{try{await u()}catch(C){if(lt(C,"TRANSACTION_REPLACED")){p(),h(C);return}}s||this.provider.once("block",v)};g.push(()=>{this.provider.off("block",v)}),this.provider.once("block",v)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return B(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),l7(this)}reorderedEvent(t){return B(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),B(!t||t.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),u7(this,t)}replaceableTransaction(t){k(Number.isInteger(t)&&t>=0,"invalid startBlock","startBlock",t);let n=new e(this,this.provider);return n.#e=t,n}};function tre(e){return{orphan:"drop-block",hash:e.hash,number:e.number}}function u7(e,t){return{orphan:"reorder-transaction",tx:e,other:t}}function l7(e){return{orphan:"drop-transaction",tx:e}}function nre(e){return{orphan:"drop-log",log:{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,address:e.address,data:e.data,topics:Object.freeze(e.topics.slice()),index:e.index}}}var gf=class extends Ri{interface;fragment;args;constructor(t,n,r){super(t,t.provider);let i=n.decodeEventLog(r,t.data,t.topics);K(this,{args:i,fragment:r,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}},Wp=class extends Ri{error;constructor(t,n){super(t,t.provider),K(this,{error:n})}},GA=class extends gu{#e;constructor(t,n,r){super(r,n),this.#e=t}get logs(){return super.logs.map(t=>{let n=t.topics.length?this.#e.getEvent(t.topics[0]):null;if(n)try{return new gf(t,this.#e,n)}catch(r){return new Wp(t,r)}return t})}},yf=class extends Zo{#e;constructor(t,n,r){super(r,n),this.#e=t}async wait(t,n){let r=await super.wait(t,n);return r==null?null:new GA(this.#e,this.provider,r)}},Hp=class extends ru{log;constructor(t,n,r,i){super(t,n,r),K(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}},Xy=class extends Hp{constructor(t,n,r,i,a){super(t,n,r,new gf(a,t.interface,i));let o=t.interface.decodeEventLog(i,this.log.data,this.log.topics);K(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};var c7=BigInt(0);function f7(e){return e&&typeof e.call=="function"}function h7(e){return e&&typeof e.estimateGas=="function"}function tv(e){return e&&typeof e.resolveName=="function"}function p7(e){return e&&typeof e.sendTransaction=="function"}function m7(e){if(e!=null){if(tv(e))return e;if(e.provider)return e.provider}}var zA=class{#e;fragment;constructor(t,n,r){if(K(this,{fragment:n}),n.inputs.length<r.length)throw new Error("too many arguments");let i=vu(t.runner,"resolveName"),a=tv(i)?i:null;this.#e=async function(){let o=await Promise.all(n.inputs.map((s,u)=>r[u]==null?null:s.walkAsync(r[u],(c,d)=>c==="address"?Array.isArray(d)?Promise.all(d.map(f=>Pt(f,a))):Pt(d,a):d)));return t.interface.encodeFilterTopics(n,o)}()}getTopicFilter(){return this.#e}};function vu(e,t){return e==null?null:typeof e[t]=="function"?e:e.provider&&typeof e.provider[t]=="function"?e.provider:null}function yu(e){return e==null?null:e.provider||null}async function g7(e,t){let n=Xe.dereference(e,"overrides");k(typeof n=="object","invalid overrides parameter","overrides",e);let r=Yo(n);return k(r.to==null||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),k(r.data==null||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function rre(e,t,n){let r=vu(e,"resolveName"),i=tv(r)?r:null;return await Promise.all(t.map((a,o)=>a.walkAsync(n[o],(s,u)=>(u=Xe.dereference(u,s),s==="address"?Pt(u,i):u))))}function ire(e){let t=async function(o){let s=await g7(o,["data"]);s.to=await e.getAddress(),s.from&&(s.from=await Pt(s.from,m7(e.runner)));let u=e.interface,l=z(s.value||c7,"overrides.value")===c7,c=(s.data||"0x")==="0x";u.fallback&&!u.fallback.payable&&u.receive&&!c&&!l&&k(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),k(u.fallback||c,"cannot send data to receive-only contract","overrides.data",s.data);let d=u.receive||u.fallback&&u.fallback.payable;return k(d||l,"cannot send value to non-payable fallback","overrides.value",s.value),k(u.fallback||c,"cannot send data to receive-only contract","overrides.data",s.data),s},n=async function(o){let s=vu(e.runner,"call");B(f7(s),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let u=await t(o);try{return await s.call(u)}catch(l){throw jd(l)&&l.data?e.interface.makeError(l.data,u):l}},r=async function(o){let s=e.runner;B(p7(s),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let u=await s.sendTransaction(await t(o)),l=yu(e.runner);return new yf(e.interface,l,u)},i=async function(o){let s=vu(e.runner,"estimateGas");return B(h7(s),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await s.estimateGas(await t(o))},a=async o=>await r(o);return K(a,{_contract:e,estimateGas:i,populateTransaction:t,send:r,staticCall:n}),a}function are(e,t){let n=function(...l){let c=e.interface.getFunction(t,l);return B(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:l}}),c},r=async function(...l){let c=n(...l),d={};if(c.inputs.length+1===l.length&&(d=await g7(l.pop()),d.from&&(d.from=await Pt(d.from,m7(e.runner)))),c.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");let f=await rre(e.runner,c.inputs,l);return Object.assign({},d,await kt({to:e.getAddress(),data:e.interface.encodeFunctionData(c,f)}))},i=async function(...l){let c=await s(...l);return c.length===1?c[0]:c},a=async function(...l){let c=e.runner;B(p7(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let d=await c.sendTransaction(await r(...l)),f=yu(e.runner);return new yf(e.interface,f,d)},o=async function(...l){let c=vu(e.runner,"estimateGas");return B(h7(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await r(...l))},s=async function(...l){let c=vu(e.runner,"call");B(f7(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let d;try{d=await r(...l)}catch(g){let p=l.at(-1).blockTag;throw p&&(g.blockNumber=p),g}let f="0x";try{f=await c.call(d)}catch(g){throw jd(g)&&g.data?e.interface.makeError(g.data,d):g}let h=n(...l);return e.interface.decodeFunctionResult(h,f)},u=async(...l)=>n(...l).constant?await i(...l):await a(...l);return K(u,{name:e.interface.getFunctionName(t),_contract:e,_key:t,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:i,staticCallResult:s}),Object.defineProperty(u,"fragment",{configurable:!1,enumerable:!0,get:()=>{let l=e.interface.getFunction(t);return B(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),l}}),u}function ore(e,t){let n=function(...i){let a=e.interface.getEvent(t,i);return B(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:i}}),a},r=function(...i){return new zA(e,n(...i),i)};return K(r,{name:e.interface.getEventName(t),_contract:e,_key:t,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{let i=e.interface.getEvent(t);return B(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),i}}),r}var jy=Symbol.for("_ethersInternal_contract"),y7=new WeakMap;function sre(e,t){y7.set(e[jy],t)}function mr(e){return y7.get(e[jy])}function ure(e){return e&&typeof e=="object"&&"getTopicFilter"in e&&typeof e.getTopicFilter=="function"&&e.fragment}async function ZA(e,t){let n,r=null;if(Array.isArray(t)){let a=function(o){if(Ce(o,32))return o;let s=e.interface.getEvent(o);return k(s,"unknown fragment","name",o),s.topicHash};n=t.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else t==="*"?n=[null]:typeof t=="string"?Ce(t,32)?n=[t]:(r=e.interface.getEvent(t),k(r,"unknown fragment","event",t),n=[r.topicHash]):ure(t)?n=await t.getTopicFilter():"fragment"in t?(r=t.fragment,n=[r.topicHash]):k(!1,"unknown event name","event",t);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){let o=Array.from(new Set(a.map(s=>s.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});let i=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:i,topics:n}}async function Gp(e,t){let{subs:n}=mr(e);return n.get((await ZA(e,t)).tag)||null}async function d7(e,t,n){let r=yu(e.runner);B(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});let{fragment:i,tag:a,topics:o}=await ZA(e,n),{addr:s,subs:u}=mr(e),l=u.get(a);if(!l){let d={address:s||e,topics:o},f=b=>{let v=i;if(v==null)try{v=e.interface.getEvent(b.topics[0])}catch{}if(v){let C=v,N=i?e.interface.decodeEventLog(i,b.data,b.topics):[];KA(e,n,N,I=>new Xy(e,I,n,C,b))}else KA(e,n,[],C=>new Hp(e,C,n,b))},h=[];l={tag:a,listeners:[],start:()=>{h.length||h.push(r.on(d,f))},stop:async()=>{if(h.length==0)return;let b=h;h=[],await Promise.all(b),r.off(d,f)}},u.set(a,l)}return l}var QA=Promise.resolve();async function lre(e,t,n,r){await QA;let i=await Gp(e,t);if(!i)return!1;let a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:s})=>{let u=Array.from(n);r&&u.push(r(s?null:o));try{o.call(e,...u)}catch{}return!s}),i.listeners.length===0&&(i.stop(),mr(e).subs.delete(i.tag)),a>0}async function KA(e,t,n,r){try{await QA}catch{}let i=lre(e,t,n,r);return QA=i,await i}var $y=["then"],ev=class e{target;interface;runner;filters;[jy];fallback;constructor(t,n,r,i){k(typeof t=="string"||Py(t),"invalid value for Contract target","target",t),r==null&&(r=null);let a=Ko.from(n);K(this,{target:t,runner:r,interface:a}),Object.defineProperty(this,jy,{value:{}});let o,s=null,u=null;if(i){let d=yu(r);u=new yf(this.interface,d,i)}let l=new Map;if(typeof t=="string")if(Ce(t))s=t,o=Promise.resolve(t);else{let d=vu(r,"resolveName");if(!tv(d))throw Je("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=d.resolveName(t).then(f=>{if(f==null)throw Je("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:t});return mr(this).addr=f,f})}else o=t.getAddress().then(d=>{if(d==null)throw new Error("TODO");return mr(this).addr=d,d});sre(this,{addrPromise:o,addr:s,deployTx:u,subs:l});let c=new Proxy({},{get:(d,f,h)=>{if(typeof f=="symbol"||$y.indexOf(f)>=0)return Reflect.get(d,f,h);try{return this.getEvent(f)}catch(g){if(!lt(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(d,f)=>$y.indexOf(f)>=0?Reflect.has(d,f):Reflect.has(d,f)||this.interface.hasEvent(String(f))});return K(this,{filters:c}),K(this,{fallback:a.receive||a.fallback?ire(this):null}),new Proxy(this,{get:(d,f,h)=>{if(typeof f=="symbol"||f in d||$y.indexOf(f)>=0)return Reflect.get(d,f,h);try{return d.getFunction(f)}catch(g){if(!lt(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(d,f)=>typeof f=="symbol"||f in d||$y.indexOf(f)>=0?Reflect.has(d,f):d.interface.hasFunction(f)})}connect(t){return new e(this.target,this.interface,t)}attach(t){return new e(t,this.interface,this.runner)}async getAddress(){return await mr(this).addrPromise}async getDeployedCode(){let t=yu(this.runner);B(t,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});let n=await t.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){let t=this.deploymentTransaction();if(t)return await t.wait(),this;if(await this.getDeployedCode()!=null)return this;let r=yu(this.runner);return B(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{let o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);r.once("block",o)}catch(s){a(s)}};o()})}deploymentTransaction(){return mr(this).deployTx}getFunction(t){return typeof t!="string"&&(t=t.format()),are(this,t)}getEvent(t){return typeof t!="string"&&(t=t.format()),ore(this,t)}async queryTransaction(t){throw new Error("@TODO")}async queryFilter(t,n,r){n==null&&(n=0),r==null&&(r="latest");let{addr:i,addrPromise:a}=mr(this),o=i||await a,{fragment:s,topics:u}=await ZA(this,t),l={address:o,topics:u,fromBlock:n,toBlock:r},c=yu(this.runner);return B(c,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await c.getLogs(l)).map(d=>{let f=s;if(f==null)try{f=this.interface.getEvent(d.topics[0])}catch{}if(f)try{return new gf(d,this.interface,f)}catch(h){return new Wp(d,h)}return new Ri(d,c)})}async on(t,n){let r=await d7(this,"on",t);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(t,n){let r=await d7(this,"once",t);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(t,...n){return await KA(this,t,n,null)}async listenerCount(t){if(t){let i=await Gp(this,t);return i?i.listeners.length:0}let{subs:n}=mr(this),r=0;for(let{listeners:i}of n.values())r+=i.length;return r}async listeners(t){if(t){let i=await Gp(this,t);return i?i.listeners.map(({listener:a})=>a):[]}let{subs:n}=mr(this),r=[];for(let{listeners:i}of n.values())r=r.concat(i.map(({listener:a})=>a));return r}async off(t,n){let r=await Gp(this,t);if(!r)return this;if(n){let i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(n==null||r.listeners.length===0)&&(r.stop(),mr(this).subs.delete(r.tag)),this}async removeAllListeners(t){if(t){let n=await Gp(this,t);if(!n)return this;n.stop(),mr(this).subs.delete(n.tag)}else{let{subs:n}=mr(this);for(let{tag:r,stop:i}of n.values())i(),n.delete(r)}return this}async addListener(t,n){return await this.on(t,n)}async removeListener(t,n){return await this.off(t,n)}static buildClass(t){class n extends e{constructor(i,a=null){super(i,t,a)}}return n}static from(t,n,r){return r==null&&(r=null),new this(t,n,r)}};function cre(){return ev}var ua=class extends cre(){};function YA(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):k(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}var nv=class{name;constructor(t){K(this,{name:t})}connect(t){return this}supportsCoinType(t){return!1}async encodeAddress(t,n){throw new Error("unsupported coin")}async decodeAddress(t,n){throw new Error("unsupported coin")}};var S7=new RegExp("^(ipfs)://(.*)$","i"),v7=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),S7,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],vf=class e{provider;address;name;#e;#t;constructor(t,n,r){K(this,{provider:t,address:n,name:r}),this.#e=null,this.#t=new ua(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],t)}async supportsWildcard(){return this.#e==null&&(this.#e=(async()=>{try{return await this.#t.supportsInterface("0x9061b923")}catch(t){if(lt(t,"CALL_EXCEPTION"))return!1;throw this.#e=null,t}})()),await this.#e}async#n(t,n){n=(n||[]).slice();let r=this.#t.interface;n.unshift(cf(this.name));let i=null;await this.supportsWildcard()&&(i=r.getFunction(t),B(i,"missing fragment","UNKNOWN_ERROR",{info:{funcName:t}}),n=[MA(this.name,255),r.encodeFunctionData(i,n)],t="resolve(bytes,bytes)"),n.push({enableCcipRead:!0});try{let a=await this.#t[t](...n);return i?r.decodeFunctionResult(i,a)[0]:a}catch(a){if(!lt(a,"CALL_EXCEPTION"))throw a}return null}async getAddress(t){if(t==null&&(t=60),t===60)try{let a=await this.#n("addr(bytes32)");return a==null||a===Ja?null:a}catch(a){if(lt(a,"CALL_EXCEPTION"))return null;throw a}if(t>=0&&t<2147483648){let a=t+2147483648,o=await this.#n("addr(bytes32,uint)",[a]);if(Ce(o,20))return be(o)}let n=null;for(let a of this.provider.plugins)if(a instanceof nv&&a.supportsCoinType(t)){n=a;break}if(n==null)return null;let r=await this.#n("addr(bytes32,uint)",[t]);if(r==null||r==="0x")return null;let i=await n.decodeAddress(t,r);if(i!=null)return i;B(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${t})`,info:{coinType:t,data:r}})}async getText(t){let n=await this.#n("text(bytes32,string)",[t]);return n==null||n==="0x"?null:n}async getContentHash(){let t=await this.#n("contenthash(bytes32)");if(t==null||t==="0x")return null;let n=t.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){let i=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${i}://${nA("0x"+n[2])}`}let r=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;B(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:t}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){let t=[{type:"name",value:this.name}];try{let n=await this.getText("avatar");if(n==null)return t.push({type:"!avatar",value:""}),{url:null,linkage:t};t.push({type:"avatar",value:n});for(let r=0;r<v7.length;r++){let i=n.match(v7[r]);if(i==null)continue;let a=i[1].toLowerCase();switch(a){case"https":case"data":return t.push({type:"url",value:n}),{linkage:t,url:n};case"ipfs":{let o=YA(n);return t.push({type:"ipfs",value:n}),t.push({type:"url",value:o}),{linkage:t,url:o}}case"erc721":case"erc1155":{let o=a==="erc721"?"tokenURI(uint256)":"uri(uint256)";t.push({type:a,value:n});let s=await this.getAddress();if(s==null)return t.push({type:"!owner",value:""}),{url:null,linkage:t};let u=(i[2]||"").split("/");if(u.length!==2)return t.push({type:`!${a}caip`,value:i[2]||""}),{url:null,linkage:t};let l=u[1],c=new ua(u[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(a==="erc721"){let p=await c.ownerOf(l);if(s!==p)return t.push({type:"!owner",value:p}),{url:null,linkage:t};t.push({type:"owner",value:p})}else if(a==="erc1155"){let p=await c.balanceOf(s,l);if(!p)return t.push({type:"!balance",value:"0"}),{url:null,linkage:t};t.push({type:"balance",value:p.toString()})}let d=await c[o](l);if(d==null||d==="0x")return t.push({type:"!metadata-url",value:""}),{url:null,linkage:t};t.push({type:"metadata-url-base",value:d}),a==="erc1155"&&(d=d.replace("{id}",zn(l,32).substring(2)),t.push({type:"metadata-url-expanded",value:d})),d.match(/^ipfs:/i)&&(d=YA(d)),t.push({type:"metadata-url",value:d});let f={},h=await new cr(d).send();h.assertOk();try{f=h.bodyJson}catch{try{t.push({type:"!metadata",value:h.bodyText})}catch{let v=h.body;return v&&t.push({type:"!metadata",value:W(v)}),{url:null,linkage:t}}return{url:null,linkage:t}}if(!f)return t.push({type:"!metadata",value:""}),{url:null,linkage:t};t.push({type:"metadata",value:JSON.stringify(f)});let g=f.image;if(typeof g!="string")return t.push({type:"!imageUrl",value:""}),{url:null,linkage:t};if(!g.match(/^(https:\/\/|data:)/i)){if(g.match(S7)==null)return t.push({type:"!imageUrl-ipfs",value:g}),{url:null,linkage:t};t.push({type:"imageUrl-ipfs",value:g}),g=YA(g)}return t.push({type:"url",value:g}),{linkage:t,url:g}}}}}catch{}return{linkage:t,url:null}}static async getEnsAddress(t){let n=await t.getNetwork(),r=n.getPlugin("org.ethers.plugins.network.Ens");return B(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:n}}),r.address}static async#r(t,n){let r=await e.getEnsAddress(t);try{let a=await new ua(r,["function resolver(bytes32) view returns (address)"],t).resolver(cf(n),{enableCcipRead:!0});return a===Ja?null:a}catch(i){throw i}return null}static async fromName(t,n){let r=n;for(;;){if(r===""||r==="."||n!=="eth"&&r==="eth")return null;let i=await e.#r(t,r);if(i!=null){let a=new e(t,i,n);return r!==n&&!await a.supportsWildcard()?null:a}r=r.split(".").slice(1).join(".")}}};var b7=BigInt(0);function Re(e,t){return function(n){return n==null?t:e(n)}}function rv(e,t){return n=>{if(t&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>e(r))}}function zp(e,t){return n=>{let r={};for(let i in e){let a=i;if(t&&i in t&&!(a in n)){for(let o of t[i])if(o in n){a=o;break}}try{let o=e[i](n[a]);o!==void 0&&(r[i]=o)}catch(o){let s=o instanceof Error?o.message:"not-an-error";B(!1,`invalid value for value.${i} (${s})`,"BAD_DATA",{value:n})}}return r}}function dre(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}k(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)}function Sf(e){return k(Ce(e,!0),"invalid data","value",e),e}function tn(e){return k(Ce(e,32),"invalid hash","value",e),e}var fre=zp({address:be,blockHash:tn,blockNumber:pe,data:Sf,index:pe,removed:Re(dre,!1),topics:rv(tn),transactionHash:tn,transactionIndex:pe},{index:["logIndex"]});function T7(e){return fre(e)}var hre=zp({hash:Re(tn),parentHash:tn,parentBeaconBlockRoot:Re(tn,null),number:pe,timestamp:pe,nonce:Re(Sf),difficulty:z,gasLimit:z,gasUsed:z,stateRoot:Re(tn,null),receiptsRoot:Re(tn,null),blobGasUsed:Re(z,null),excessBlobGas:Re(z,null),miner:Re(be),prevRandao:Re(tn,null),extraData:Sf,baseFeePerGas:Re(z)},{prevRandao:["mixHash"]});function E7(e){let t=hre(e);return t.transactions=e.transactions.map(n=>typeof n=="string"?n:XA(n)),t}var pre=zp({transactionIndex:pe,blockNumber:pe,transactionHash:tn,address:be,topics:rv(tn),data:Sf,index:pe,blockHash:tn},{index:["logIndex"]});function mre(e){return pre(e)}var gre=zp({to:Re(be,null),from:Re(be,null),contractAddress:Re(be,null),index:pe,root:Re(W),gasUsed:z,blobGasUsed:Re(z,null),logsBloom:Re(Sf),blockHash:tn,hash:tn,logs:rv(mre),blockNumber:pe,cumulativeGasUsed:z,effectiveGasPrice:Re(z),blobGasPrice:Re(z,null),status:Re(pe),type:Re(pe,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function C7(e){return gre(e)}function XA(e){e.to&&z(e.to)===b7&&(e.to="0x0000000000000000000000000000000000000000");let t=zp({hash:tn,index:Re(pe,void 0),type:n=>n==="0x"||n==null?0:pe(n),accessList:Re(hr,null),blobVersionedHashes:Re(rv(tn,!0),null),blockHash:Re(tn,null),blockNumber:Re(pe,null),transactionIndex:Re(pe,null),from:be,gasPrice:Re(z),maxPriorityFeePerGas:Re(z),maxFeePerGas:Re(z),maxFeePerBlobGas:Re(z,null),gasLimit:z,to:Re(be,null),value:z,nonce:pe,data:Sf,creates:Re(be,null),chainId:Re(z,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(t.to==null&&t.creates==null&&(t.creates=EA(t)),(e.type===1||e.type===2)&&e.accessList==null&&(t.accessList=[]),e.signature?t.signature=Mn.from(e.signature):t.signature=Mn.from(e),t.chainId==null){let n=t.signature.legacyChainId;n!=null&&(t.chainId=n)}return t.blockHash&&z(t.blockHash)===b7&&(t.blockHash=null),t}var yre="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",bf=class e{name;constructor(t){K(this,{name:t})}clone(){return new e(this.name)}},Tf=class e extends bf{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(t,n){t==null&&(t=0),super(`org.ethers.network.plugins.GasCost#${t||0}`);let r={effectiveBlock:t};function i(a,o){let s=(n||{})[a];s==null&&(s=o),k(typeof s=="number",`invalud value for ${a}`,"costs",n),r[a]=s}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),K(this,r)}clone(){return new e(this.effectiveBlock,this)}},Ef=class e extends bf{address;targetNetwork;constructor(t,n){super("org.ethers.plugins.network.Ens"),K(this,{address:t||yre,targetNetwork:n??1})}clone(){return new e(this.address,this.targetNetwork)}};var Qp=class extends bf{#e;#t;get url(){return this.#e}get processFunc(){return this.#t}constructor(t,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#e=t,this.#t=n}clone(){return this}};var $A=new Map,nn=class e{#e;#t;#n;constructor(t,n){this.#e=t,this.#t=z(n),this.#n=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#e}set name(t){this.#e=t}get chainId(){return this.#t}set chainId(t){this.#t=z(t,"chainId")}matches(t){if(t==null)return!1;if(typeof t=="string"){try{return this.chainId===z(t)}catch{}return this.name===t}if(typeof t=="number"||typeof t=="bigint"){try{return this.chainId===z(t)}catch{}return!1}if(typeof t=="object"){if(t.chainId!=null){try{return this.chainId===z(t.chainId)}catch{}return!1}return t.name!=null?this.name===t.name:!1}return!1}get plugins(){return Array.from(this.#n.values())}attachPlugin(t){if(this.#n.get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return this.#n.set(t.name,t.clone()),this}getPlugin(t){return this.#n.get(t)||null}getPlugins(t){return this.plugins.filter(n=>n.name.split("#")[0]===t)}clone(){let t=new e(this.name,this.chainId);return this.plugins.forEach(n=>{t.attachPlugin(n.clone())}),t}computeIntrinsicGas(t){let n=this.getPlugin("org.ethers.plugins.network.GasCost")||new Tf,r=n.txBase;if(t.to==null&&(r+=n.txCreate),t.data)for(let i=2;i<t.data.length;i+=2)t.data.substring(i,i+2)==="00"?r+=n.txDataZero:r+=n.txDataNonzero;if(t.accessList){let i=hr(t.accessList);for(let a in i)r+=n.txAccessListAddress+n.txAccessListStorageKey*i[a].storageKeys.length}return r}static from(t){if(vre(),t==null)return e.from("mainnet");if(typeof t=="number"&&(t=BigInt(t)),typeof t=="string"||typeof t=="bigint"){let n=$A.get(t);if(n)return n();if(typeof t=="bigint")return new e("unknown",t);k(!1,"unknown network","network",t)}if(typeof t.clone=="function")return t.clone();if(typeof t=="object"){k(typeof t.name=="string"&&typeof t.chainId=="number","invalid network object name or chainId","network",t);let n=new e(t.name,t.chainId);return(t.ensAddress||t.ensNetwork!=null)&&n.attachPlugin(new Ef(t.ensAddress,t.ensNetwork)),n}k(!1,"invalid network","network",t)}static register(t,n){typeof t=="number"&&(t=BigInt(t));let r=$A.get(t);r&&k(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",t),$A.set(t,n)}};function k7(e,t){let n=String(e);if(!n.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);let r=n.split(".");if(r.length===1&&r.push(""),r.length!==2)throw new Error(`invalid gwei value: ${e}`);for(;r[1].length<t;)r[1]+="0";if(r[1].length>9){let i=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||i++,r[1]=i.toString()}return BigInt(r[0]+r[1])}function _7(e){return new Qp(e,async(t,n,r)=>{r.setHeader("User-Agent","ethers");let i;try{let[a,o]=await Promise.all([r.send(),t()]);i=a;let s=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:k7(s.maxFee,9),maxPriorityFeePerGas:k7(s.maxPriorityFee,9)}}catch(a){B(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:i,error:a})}})}var A7=!1;function vre(){if(A7)return;A7=!0;function e(t,n,r){let i=function(){let a=new nn(t,n);return r.ensNetwork!=null&&a.attachPlugin(new Ef(null,r.ensNetwork)),a.attachPlugin(new Tf),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};nn.register(t,i),nn.register(n,i),r.altNames&&r.altNames.forEach(a=>{nn.register(a,i)})}e("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),e("ropsten",3,{ensNetwork:3}),e("rinkeby",4,{ensNetwork:4}),e("goerli",5,{ensNetwork:5}),e("kovan",42,{ensNetwork:42}),e("sepolia",11155111,{ensNetwork:11155111}),e("holesky",17e3,{ensNetwork:17e3}),e("classic",61,{}),e("classicKotti",6,{}),e("arbitrum",42161,{ensNetwork:1}),e("arbitrum-goerli",421613,{}),e("arbitrum-sepolia",421614,{}),e("base",8453,{ensNetwork:1}),e("base-goerli",84531,{}),e("base-sepolia",84532,{}),e("bnb",56,{ensNetwork:1}),e("bnbt",97,{}),e("linea",59144,{ensNetwork:1}),e("linea-goerli",59140,{}),e("linea-sepolia",59141,{}),e("matic",137,{ensNetwork:1,plugins:[_7("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[_7("https://gasstation-testnet.polygon.technology/v2")]}),e("optimism",10,{ensNetwork:1,plugins:[]}),e("optimism-goerli",420,{}),e("optimism-sepolia",11155420,{}),e("xdai",100,{ensNetwork:1})}function jA(e){return JSON.parse(JSON.stringify(e))}var iv=class{#e;#t;#n;#r;constructor(t){this.#e=t,this.#t=null,this.#n=4e3,this.#r=-2}get pollingInterval(){return this.#n}set pollingInterval(t){this.#n=t}async#a(){try{let t=await this.#e.getBlockNumber();if(this.#r===-2){this.#r=t;return}if(t!==this.#r){for(let n=this.#r+1;n<=t;n++){if(this.#t==null)return;await this.#e.emit("block",n)}this.#r=t}}catch{}this.#t!=null&&(this.#t=this.#e._setTimeout(this.#a.bind(this),this.#n))}start(){this.#t||(this.#t=this.#e._setTimeout(this.#a.bind(this),this.#n),this.#a())}stop(){this.#t&&(this.#e._clearTimeout(this.#t),this.#t=null)}pause(t){this.stop(),t&&(this.#r=-2)}resume(){this.start()}},Kp=class{#e;#t;#n;constructor(t){this.#e=t,this.#n=!1,this.#t=n=>{this._poll(n,this.#e)}}async _poll(t,n){throw new Error("sub-classes must override this")}start(){this.#n||(this.#n=!0,this.#t(-2),this.#e.on("block",this.#t))}stop(){this.#n&&(this.#n=!1,this.#e.off("block",this.#t))}pause(t){this.stop()}resume(){this.start()}},av=class extends Kp{#e;#t;constructor(t,n){super(t),this.#e=n,this.#t=-2}pause(t){t&&(this.#t=-2),super.pause(t)}async _poll(t,n){let r=await n.getBlock(this.#e);r!=null&&(this.#t===-2?this.#t=r.number:r.number>this.#t&&(n.emit(this.#e,r.number),this.#t=r.number))}},ov=class extends Kp{#e;constructor(t,n){super(t),this.#e=jA(n)}async _poll(t,n){throw new Error("@TODO")}},sv=class extends Kp{#e;constructor(t,n){super(t),this.#e=n}async _poll(t,n){let r=await n.getTransactionReceipt(this.#e);r&&n.emit(this.#e,r)}},Xo=class{#e;#t;#n;#r;#a;constructor(t,n){this.#e=t,this.#t=jA(n),this.#n=this.#s.bind(this),this.#r=!1,this.#a=-2}async#s(t){if(this.#a===-2)return;let n=jA(this.#t);n.fromBlock=this.#a+1,n.toBlock=t;let r=await this.#e.getLogs(n);if(r.length===0){this.#a<t-60&&(this.#a=t-60);return}for(let i of r)this.#e.emit(this.#t,i),this.#a=i.blockNumber}start(){this.#r||(this.#r=!0,this.#a===-2&&this.#e.getBlockNumber().then(t=>{this.#a=t}),this.#e.on("block",this.#n))}stop(){this.#r&&(this.#r=!1,this.#e.off("block",this.#n))}pause(t){this.stop(),t&&(this.#a=-2)}resume(){this.start()}};var Sre=BigInt(2),bre=10;function uv(e){return e&&typeof e.then=="function"}function lv(e,t){return e+":"+JSON.stringify(t,(n,r)=>{if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){let i=Object.keys(r);return i.sort(),i.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}var Cf=class{name;constructor(t){K(this,{name:t})}start(){}stop(){}pause(t){}resume(){}};function Tre(e){return JSON.parse(JSON.stringify(e))}function nN(e){return e=Array.from(new Set(e).values()),e.sort(),e}async function eN(e,t){if(e==null)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),typeof e=="string")switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if(Ce(e,32)){let n=e.toLowerCase();return{type:"transaction",tag:lv("tx",{hash:n}),hash:n}}if(e.orphan){let n=e;return{type:"orphan",tag:lv("orphan",n),filter:Tre(n)}}if(e.address||e.topics){let n=e,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?nN(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(n.address){let i=[],a=[],o=s=>{Ce(s)?i.push(s):a.push((async()=>{i.push(await Pt(s,t))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=nN(i.map(s=>s.toLowerCase()))}return{filter:r,tag:lv("event",r),type:"event"}}k(!1,"unknown ProviderEvent","event",e)}function tN(){return new Date().getTime()}var Ere={cacheTimeout:250,pollingInterval:4e3},Zp=class{#e;#t;#n;#r;#a;#s;#i;#d;#l;#u;#o;#p;constructor(t,n){if(this.#p=Object.assign({},Ere,n||{}),t==="any")this.#s=!0,this.#a=null;else if(t){let r=nn.from(t);this.#s=!1,this.#a=Promise.resolve(r),setTimeout(()=>{this.emit("network",r,null)},0)}else this.#s=!1,this.#a=null;this.#d=-1,this.#i=new Map,this.#e=new Map,this.#t=new Map,this.#n=null,this.#r=!1,this.#l=1,this.#u=new Map,this.#o=!1}get pollingInterval(){return this.#p.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#t.values())}attachPlugin(t){if(this.#t.get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return this.#t.set(t.name,t.connect(this)),this}getPlugin(t){return this.#t.get(t)||null}get disableCcipRead(){return this.#o}set disableCcipRead(t){this.#o=!!t}async#c(t){let n=this.#p.cacheTimeout;if(n<0)return await this._perform(t);let r=lv(t.method,t),i=this.#i.get(r);return i||(i=this._perform(t),this.#i.set(r,i),setTimeout(()=>{this.#i.get(r)===i&&this.#i.delete(r)},n)),await i}async ccipReadFetch(t,n,r){if(this.disableCcipRead||r.length===0||t.to==null)return null;let i=t.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let s=0;s<r.length;s++){let u=r[s],l=u.replace("{sender}",i).replace("{data}",a),c=new cr(l);u.indexOf("{data}")===-1&&(c.body={data:a,sender:i}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:c,index:s,urls:r});let d="unknown error",f=await c.send();try{let h=f.bodyJson;if(h.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:c,result:h}),h.data;h.message&&(d=h.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:c,result:h})}catch{}B(f.statusCode<400||f.statusCode>=500,`response not found during CCIP fetch: ${d}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:t,info:{url:u,errorMessage:d}}),o.push(d)}B(!1,`error encountered during CCIP fetch: ${o.map(s=>JSON.stringify(s)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:t,info:{urls:r,errorMessages:o}})}_wrapBlock(t,n){return new Jp(E7(t),this)}_wrapLog(t,n){return new Ri(T7(t),this)}_wrapTransactionReceipt(t,n){return new gu(C7(t),this)}_wrapTransactionResponse(t,n){return new Zo(XA(t),this)}_detectNetwork(){B(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(t){B(!1,`unsupported method: ${t.method}`,"UNSUPPORTED_OPERATION",{operation:t.method,info:t})}async getBlockNumber(){let t=pe(await this.#c({method:"getBlockNumber"}),"%response");return this.#d>=0&&(this.#d=t),t}_getAddress(t){return Pt(t,this)}_getBlockTag(t){if(t==null)return"latest";switch(t){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return t}if(Ce(t))return Ce(t,32)?t:aa(t);if(typeof t=="bigint"&&(t=pe(t,"blockTag")),typeof t=="number")return t>=0?aa(t):this.#d>=0?aa(this.#d+t):this.getBlockNumber().then(n=>aa(n+t));k(!1,"invalid blockTag","blockTag",t)}_getFilter(t){let n=(t.topics||[]).map(u=>u==null?null:Array.isArray(u)?nN(u.map(l=>l.toLowerCase())):u.toLowerCase()),r="blockHash"in t?t.blockHash:void 0,i=(u,l,c)=>{let d;switch(u.length){case 0:break;case 1:d=u[0];break;default:u.sort(),d=u}if(r&&(l!=null||c!=null))throw new Error("invalid filter");let f={};return d&&(f.address=d),n.length&&(f.topics=n),l&&(f.fromBlock=l),c&&(f.toBlock=c),r&&(f.blockHash=r),f},a=[];if(t.address)if(Array.isArray(t.address))for(let u of t.address)a.push(this._getAddress(u));else a.push(this._getAddress(t.address));let o;"fromBlock"in t&&(o=this._getBlockTag(t.fromBlock));let s;return"toBlock"in t&&(s=this._getBlockTag(t.toBlock)),a.filter(u=>typeof u!="string").length||o!=null&&typeof o!="string"||s!=null&&typeof s!="string"?Promise.all([Promise.all(a),o,s]).then(u=>i(u[0],u[1],u[2])):i(a,o,s)}_getTransactionRequest(t){let n=Yo(t),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;let a=Pt(n[i],this);uv(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){let i=this._getBlockTag(n.blockTag);uv(i)?r.push(async function(){n.blockTag=await i}()):n.blockTag=i}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(this.#a==null){let i=(async()=>{try{let a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw this.#a===i&&(this.#a=null),a}})();return this.#a=i,(await i).clone()}let t=this.#a,[n,r]=await Promise.all([t,this._detectNetwork()]);return n.chainId!==r.chainId&&(this.#s?(this.emit("network",r,n),this.#a===t&&(this.#a=Promise.resolve(r))):B(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){let t=await this.getNetwork(),n=async()=>{let{_block:i,gasPrice:a,priorityFee:o}=await kt({_block:this.#g("latest",!1),gasPrice:(async()=>{try{let c=await this.#c({method:"getGasPrice"});return z(c,"%response")}catch{}return null})(),priorityFee:(async()=>{try{let c=await this.#c({method:"getPriorityFee"});return z(c,"%response")}catch{}return null})()}),s=null,u=null,l=this._wrapBlock(i,t);return l&&l.baseFeePerGas&&(u=o??BigInt("1000000000"),s=l.baseFeePerGas*Sre+u),new mf(a,s,u)},r=t.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){let i=new cr(r.url),a=await r.processFunc(n,this,i);return new mf(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(t){let n=this._getTransactionRequest(t);return uv(n)&&(n=await n),z(await this.#c({method:"estimateGas",transaction:n}),"%response")}async#f(t,n,r){B(r<bre,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},t,{blockTag:n,enableCcipRead:!0})});let i=Yo(t);try{return W(await this._perform({method:"call",transaction:i,blockTag:n}))}catch(a){if(!this.disableCcipRead&&jd(a)&&a.data&&r>=0&&n==="latest"&&i.to!=null&&ot(a.data,0,4)==="0x556f1830"){let o=a.data,s=await Pt(i.to,this),u;try{u=Nre(ot(a.data,4))}catch(d){B(!1,d.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}B(u.sender.toLowerCase()===s.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:u.errorArgs}});let l=await this.ccipReadFetch(i,u.calldata,u.urls);B(l!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:u.errorArgs}});let c={to:s,data:Ue([u.selector,Are([l,u.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:c});try{let d=await this.#f(c,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},c),result:d}),d}catch(d){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},c),error:d}),d}}throw a}}async#h(t){let{value:n}=await kt({network:this.getNetwork(),value:t});return n}async call(t){let{tx:n,blockTag:r}=await kt({tx:this._getTransactionRequest(t),blockTag:this._getBlockTag(t.blockTag)});return await this.#h(this.#f(n,r,t.enableCcipRead?0:-1))}async#m(t,n,r){let i=this._getAddress(n),a=this._getBlockTag(r);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await this.#h(this.#c(Object.assign(t,{address:i,blockTag:a})))}async getBalance(t,n){return z(await this.#m({method:"getBalance"},t,n),"%response")}async getTransactionCount(t,n){return pe(await this.#m({method:"getTransactionCount"},t,n),"%response")}async getCode(t,n){return W(await this.#m({method:"getCode"},t,n))}async getStorage(t,n,r){let i=z(n,"position");return W(await this.#m({method:"getStorage",position:i},t,r))}async broadcastTransaction(t){let{blockNumber:n,hash:r,network:i}=await kt({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:t}),network:this.getNetwork()}),a=hu.from(t);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(n)}async#g(t,n){if(Ce(t,32))return await this.#c({method:"getBlock",blockHash:t,includeTransactions:n});let r=this._getBlockTag(t);return typeof r!="string"&&(r=await r),await this.#c({method:"getBlock",blockTag:r,includeTransactions:n})}async getBlock(t,n){let{network:r,params:i}=await kt({network:this.getNetwork(),params:this.#g(t,!!n)});return i==null?null:this._wrapBlock(i,r)}async getTransaction(t){let{network:n,params:r}=await kt({network:this.getNetwork(),params:this.#c({method:"getTransaction",hash:t})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(t){let{network:n,params:r}=await kt({network:this.getNetwork(),params:this.#c({method:"getTransactionReceipt",hash:t})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){let i=await this.#c({method:"getTransaction",hash:t});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(t){let{result:n}=await kt({network:this.getNetwork(),result:this.#c({method:"getTransactionResult",hash:t})});return n==null?null:W(n)}async getLogs(t){let n=this._getFilter(t);uv(n)&&(n=await n);let{network:r,params:i}=await kt({network:this.getNetwork(),params:this.#c({method:"getLogs",filter:n})});return i.map(a=>this._wrapLog(a,r))}_getProvider(t){B(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(t){return await vf.fromName(this,t)}async getAvatar(t){let n=await this.getResolver(t);return n?await n.getAvatar():null}async resolveName(t){let n=await this.getResolver(t);return n?await n.getAddress():null}async lookupAddress(t){t=be(t);let n=cf(t.substring(2).toLowerCase()+".addr.reverse");try{let r=await vf.getEnsAddress(this),a=await new ua(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===Ja)return null;let s=await new ua(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(s)!==t?null:s}catch(r){if(lt(r,"BAD_DATA")&&r.value==="0x"||lt(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(t,n,r){let i=n??1;return i===0?this.getTransactionReceipt(t):new Promise(async(a,o)=>{let s=null,u=async l=>{try{let c=await this.getTransactionReceipt(t);if(c!=null&&l-c.blockNumber+1>=i){a(c),s&&(clearTimeout(s),s=null);return}}catch(c){console.log("EEE",c)}this.once("block",u)};r!=null&&(s=setTimeout(()=>{s!=null&&(s=null,this.off("block",u),o(Je("timeout","TIMEOUT",{reason:"timeout"})))},r)),u(await this.getBlockNumber())})}async waitForBlock(t){B(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(t){let n=this.#u.get(t);n&&(n.timer&&clearTimeout(n.timer),this.#u.delete(t))}_setTimeout(t,n){n==null&&(n=0);let r=this.#l++,i=()=>{this.#u.delete(r),t()};if(this.paused)this.#u.set(r,{timer:null,func:i,time:n});else{let a=setTimeout(i,n);this.#u.set(r,{timer:a,func:i,time:tN()})}return r}_forEachSubscriber(t){for(let n of this.#e.values())t(n.subscriber)}_getSubscriber(t){switch(t.type){case"debug":case"error":case"network":return new Cf(t.type);case"block":{let n=new iv(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new av(this,t.type);case"event":return new Xo(this,t.filter);case"transaction":return new sv(this,t.hash);case"orphan":return new ov(this,t.filter)}throw new Error(`unsupported event: ${t.type}`)}_recoverSubscriber(t,n){for(let r of this.#e.values())if(r.subscriber===t){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),this.#n!=null&&n.pause(this.#n);break}}async#S(t,n){let r=await eN(t,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await eN({orphan:"drop-log",log:n[0]},this)),this.#e.get(r.tag)||null}async#b(t){let n=await eN(t,this),r=n.tag,i=this.#e.get(r);return i||(i={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#e.set(r,i)),i}async on(t,n){let r=await this.#b(t);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,this.#n!=null&&r.subscriber.pause(this.#n)),this}async once(t,n){let r=await this.#b(t);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,this.#n!=null&&r.subscriber.pause(this.#n)),this}async emit(t,...n){let r=await this.#S(t,n);if(!r||r.listeners.length===0)return!1;let i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{let s=new ru(this,o?null:a,t);try{a.call(this,...n,s)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),this.#e.delete(r.tag)),i>0}async listenerCount(t){if(t){let r=await this.#S(t);return r?r.listeners.length:0}let n=0;for(let{listeners:r}of this.#e.values())n+=r.length;return n}async listeners(t){if(t){let r=await this.#S(t);return r?r.listeners.map(({listener:i})=>i):[]}let n=[];for(let{listeners:r}of this.#e.values())n=n.concat(r.map(({listener:i})=>i));return n}async off(t,n){let r=await this.#S(t);if(!r)return this;if(n){let i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),this.#e.delete(r.tag)),this}async removeAllListeners(t){if(t){let{tag:n,started:r,subscriber:i}=await this.#b(t);r&&i.stop(),this.#e.delete(n)}else for(let[n,{started:r,subscriber:i}]of this.#e)r&&i.stop(),this.#e.delete(n);return this}async addListener(t,n){return await this.on(t,n)}async removeListener(t,n){return this.off(t,n)}get destroyed(){return this.#r}destroy(){this.removeAllListeners();for(let t of this.#u.keys())this._clearTimeout(t);this.#r=!0}get paused(){return this.#n!=null}set paused(t){!!t!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(t){if(this.#d=-1,this.#n!=null){if(this.#n==!!t)return;B(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(t)),this.#n=!!t;for(let n of this.#u.values())n.timer&&clearTimeout(n.timer),n.time=tN()-n.time}resume(){if(this.#n!=null){this._forEachSubscriber(t=>t.resume()),this.#n=null;for(let t of this.#u.values()){let n=t.time;n<0&&(n=0),t.time=tN(),setTimeout(t.func,n)}}}};function Cre(e,t){try{let n=rN(e,t);if(n)return xo(n)}catch{}return null}function rN(e,t){if(e==="0x")return null;try{let n=pe(ot(e,t,t+32)),r=pe(ot(e,n,n+32));return ot(e,n+32,n+32+r)}catch{}return null}function N7(e){let t=Ot(e);if(t.length>32)throw new Error("internal; should not happen");let n=new Uint8Array(32);return n.set(t,32-t.length),n}function kre(e){if(e.length%32===0)return e;let t=new Uint8Array(Math.ceil(e.length/32)*32);return t.set(e),t}var _re=new Uint8Array([]);function Are(e){let t=[],n=0;for(let r=0;r<e.length;r++)t.push(_re),n+=32;for(let r=0;r<e.length;r++){let i=ue(e[r]);t[r]=N7(n),t.push(N7(i.length)),t.push(kre(i)),n+=32+Math.ceil(i.length/32)*32}return Ue(t)}var I7="0x0000000000000000000000000000000000000000000000000000000000000000";function Nre(e){let t={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};B(ia(e)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});let n=ot(e,0,32);B(ot(n,0,12)===ot(I7,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),t.sender=ot(n,12);try{let r=[],i=pe(ot(e,32,64)),a=pe(ot(e,i,i+32)),o=ot(e,i+32);for(let s=0;s<a;s++){let u=Cre(o,s*32);if(u==null)throw new Error("abort");r.push(u)}t.urls=r}catch{B(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{let r=rN(e,64);if(r==null)throw new Error("abort");t.calldata=r}catch{B(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}B(ot(e,100,128)===ot(I7,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),t.selector=ot(e,96,100);try{let r=rN(e,128);if(r==null)throw new Error("abort");t.extraData=r}catch{B(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return t.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(r=>t[r]),t}function kf(e,t){if(e.provider)return e.provider;B(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function O7(e,t){let n=Yo(t);if(n.to!=null&&(n.to=Pt(n.to,e)),n.from!=null){let r=n.from;n.from=Promise.all([e.getAddress(),Pt(r,e)]).then(([i,a])=>(k(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=e.getAddress();return await kt(n)}var Yp=class{provider;constructor(t){K(this,{provider:t||null})}async getNonce(t){return kf(this,"getTransactionCount").getTransactionCount(await this.getAddress(),t)}async populateCall(t){return await O7(this,t)}async populateTransaction(t){let n=kf(this,"populateTransaction"),r=await O7(this,t);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));let i=await this.provider.getNetwork();if(r.chainId!=null){let o=z(r.chainId);k(o===i.chainId,"transaction chainId mismatch","tx.chainId",t.chainId)}else r.chainId=i.chainId;let a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?k(!1,"eip-1559 transaction do not support gasPrice","tx",t):(r.type===0||r.type===1)&&a&&k(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",t),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){let o=await n.getFeeData();B(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{let o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){let s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(B(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):B(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(r.type===2||r.type===3)&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await kt(r)}async estimateGas(t){return kf(this,"estimateGas").estimateGas(await this.populateCall(t))}async call(t){return kf(this,"call").call(await this.populateCall(t))}async resolveName(t){return await kf(this,"resolveName").resolveName(t)}async sendTransaction(t){let n=kf(this,"sendTransaction"),r=await this.populateTransaction(t);delete r.from;let i=hu.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}};function Ire(e){return JSON.parse(JSON.stringify(e))}var cv=class{#e;#t;#n;#r;#a;#s;constructor(t){this.#e=t,this.#t=null,this.#n=this.#i.bind(this),this.#r=!1,this.#a=null,this.#s=!1}_subscribe(t){throw new Error("subclasses must override this")}_emitResults(t,n){throw new Error("subclasses must override this")}_recover(t){throw new Error("subclasses must override this")}async#i(t){try{this.#t==null&&(this.#t=this._subscribe(this.#e));let n=null;try{n=await this.#t}catch(a){if(!lt(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){this.#t=null,this.#e._recoverSubscriber(this,this._recover(this.#e));return}let r=await this.#e.getNetwork();if(this.#a||(this.#a=r),this.#a.chainId!==r.chainId)throw new Error("chaid changed");if(this.#s)return;let i=await this.#e.send("eth_getFilterChanges",[n]);await this._emitResults(this.#e,i)}catch(n){console.log("@TODO",n)}this.#e.once("block",this.#n)}#d(){let t=this.#t;t&&(this.#t=null,t.then(n=>{this.#e.destroyed||this.#e.send("eth_uninstallFilter",[n])}))}start(){this.#r||(this.#r=!0,this.#i(-2))}stop(){this.#r&&(this.#r=!1,this.#s=!0,this.#d(),this.#e.off("block",this.#n))}pause(t){t&&this.#d(),this.#e.off("block",this.#n)}resume(){this.start()}},dv=class extends cv{#e;constructor(t,n){super(t),this.#e=Ire(n)}_recover(t){return new Xo(t,this.#e)}async _subscribe(t){return await t.send("eth_newFilter",[this.#e])}async _emitResults(t,n){for(let r of n)t.emit(this.#e,t._wrapLog(r,t._network))}},fv=class extends cv{async _subscribe(t){return await t.send("eth_newPendingTransactionFilter",[])}async _emitResults(t,n){for(let r of n)t.emit("pending",r)}};var Ore="bigint,boolean,function,number,string,symbol".split(/,/g);function hv(e){if(e==null||Ore.indexOf(typeof e)>=0||typeof e.getAddress=="function")return e;if(Array.isArray(e))return e.map(hv);if(typeof e=="object")return Object.keys(e).reduce((t,n)=>(t[n]=e[n],t),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function Rre(e){return new Promise(t=>{setTimeout(t,e)})}function _f(e){return e&&e.toLowerCase()}function R7(e){return e&&typeof e.pollingInterval=="number"}var P7={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3},Su=class extends Yp{address;constructor(t,n){super(t),n=be(n),K(this,{address:n})}connect(t){B(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(t){return await this.populateCall(t)}async sendUncheckedTransaction(t){let n=hv(t),r=[];if(n.from){let a=n.from;r.push((async()=>{let o=await Pt(a,this.provider);k(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),n.from=o})())}else n.from=this.address;if(n.gasLimit==null&&r.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){let a=n.to;r.push((async()=>{n.to=await Pt(a,this.provider)})())}r.length&&await Promise.all(r);let i=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(t){let n=await this.provider.getBlockNumber(),r=await this.sendUncheckedTransaction(t);return await new Promise((i,a)=>{let o=[1e3,100],s=0,u=async()=>{try{let l=await this.provider.getTransaction(r);if(l!=null){i(l.replaceableTransaction(n));return}}catch(l){if(lt(l,"CANCELLED")||lt(l,"BAD_DATA")||lt(l,"NETWORK_ERROR")){l.info==null&&(l.info={}),l.info.sendTransactionHash=r,a(l);return}if(lt(l,"INVALID_ARGUMENT")&&(s++,l.info==null&&(l.info={}),l.info.sendTransactionHash=r,s>10)){a(l);return}this.provider.emit("error",Je("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:l}))}this.provider._setTimeout(()=>{u()},o.pop()||4e3)};u()})}async signTransaction(t){let n=hv(t);if(n.from){let i=await Pt(n.from,this.provider);k(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),n.from=i}else n.from=this.address;let r=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[r])}async signMessage(t){let n=typeof t=="string"?Dn(t):t;return await this.provider.send("personal_sign",[W(n),this.address.toLowerCase()])}async signTypedData(t,n,r){let i=hv(r),a=await df.resolveNames(t,n,i,async o=>{let s=await Pt(o);return k(s!=null,"TypedData does not support null address","value",o),s});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(df.getPayload(a.domain,n,a.value))])}async unlock(t){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),t,null])}async _legacySignMessage(t){let n=typeof t=="string"?Dn(t):t;return await this.provider.send("eth_sign",[this.address.toLowerCase(),W(n)])}},Xp=class extends Zp{#e;#t;#n;#r;#a;#s;#i;#d(){if(this.#r)return;let t=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#r=setTimeout(()=>{this.#r=null;let n=this.#n;for(this.#n=[];n.length;){let r=[n.shift()];for(;n.length&&r.length!==this.#e.batchMaxCount;)if(r.push(n.shift()),JSON.stringify(r.map(a=>a.payload)).length>this.#e.batchMaxSize){n.unshift(r.pop());break}(async()=>{let i=r.length===1?r[0].payload:r.map(a=>a.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{let a=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:a});for(let{resolve:o,reject:s,payload:u}of r){if(this.destroyed){s(Je("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}let l=a.filter(c=>c.id===u.id)[0];if(l==null){let c=Je("missing response for request","BAD_DATA",{value:a,info:{payload:u}});this.emit("error",c),s(c);continue}if("error"in l){s(this.getRpcError(u,l));continue}if(u.method==="eth_call")try{if(W(l.result)==="0x"){s(this.getRpcError(u,l));continue}}catch{}o(l.result)}}catch(a){this.emit("debug",{action:"receiveRpcError",error:a});for(let{reject:o}of r)o(a)}})()}},t)}constructor(t,n){super(t,n),this.#t=1,this.#e=Object.assign({},P7,n||{}),this.#n=[],this.#r=null,this.#s=null,this.#i=null;{let i=null,a=new Promise(o=>{i=o});this.#a={promise:a,resolve:i}}let r=this._getOption("staticNetwork");typeof r=="boolean"?(k(!r||t!=="any","staticNetwork cannot be used on special network 'any'","options",n),r&&t!=null&&(this.#s=nn.from(t))):r&&(k(t==null||r.matches(t),"staticNetwork MUST match network object","options",n),this.#s=r)}_getOption(t){return this.#e[t]}get _network(){return B(this.#s,"network is not available yet","NETWORK_ERROR"),this.#s}async _perform(t){if(t.method==="call"||t.method==="estimateGas"){let r=t.transaction;if(r&&r.type!=null&&z(r.type)&&r.maxFeePerGas==null&&r.maxPriorityFeePerGas==null){let i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(t=Object.assign({},t,{transaction:Object.assign({},r,{type:void 0})}))}}let n=this.getRpcRequest(t);return n!=null?await this.send(n.method,n.args):super._perform(t)}async _detectNetwork(){let t=this._getOption("staticNetwork");if(t)if(t===!0){if(this.#s)return this.#s}else return t;return this.#i?await this.#i:this.ready?(this.#i=(async()=>{try{let n=nn.from(z(await this.send("eth_chainId",[])));return this.#i=null,n}catch(n){throw this.#i=null,n}})(),await this.#i):(this.#i=(async()=>{let n={id:this.#t++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let r;try{r=(await this._send(n))[0],this.#i=null}catch(i){throw this.#i=null,this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:r}),"result"in r)return nn.from(z(r.result));throw this.getRpcError(n,r)})(),await this.#i)}_start(){this.#a==null||this.#a.resolve==null||(this.#a.resolve(),this.#a=null,(async()=>{for(;this.#s==null&&!this.destroyed;)try{this.#s=await this._detectNetwork()}catch(t){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Je("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:t}})),await Rre(1e3)}this.#d()})())}async _waitUntilReady(){if(this.#a!=null)return await this.#a.promise}_getSubscriber(t){return t.type==="pending"?new fv(this):t.type==="event"?this._getOption("polling")?new Xo(this,t.filter):new dv(this,t.filter):t.type==="orphan"&&t.filter.orphan==="drop-log"?new Cf("orphan"):super._getSubscriber(t)}get ready(){return this.#a==null}getRpcTransaction(t){let n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(r=>{if(t[r]==null)return;let i=r;r==="gasLimit"&&(i="gas"),n[i]=aa(z(t[r],`tx.${r}`))}),["from","to","data"].forEach(r=>{t[r]!=null&&(n[r]=W(t[r]))}),t.accessList&&(n.accessList=hr(t.accessList)),t.blobVersionedHashes&&(n.blobVersionedHashes=t.blobVersionedHashes.map(r=>r.toLowerCase())),n}getRpcRequest(t){switch(t.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[_f(t.address),t.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[_f(t.address),t.blockTag]};case"getCode":return{method:"eth_getCode",args:[_f(t.address),t.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[_f(t.address),"0x"+t.position.toString(16),t.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[t.signedTransaction]};case"getBlock":if("blockTag"in t)return{method:"eth_getBlockByNumber",args:[t.blockTag,!!t.includeTransactions]};if("blockHash"in t)return{method:"eth_getBlockByHash",args:[t.blockHash,!!t.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[t.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[t.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(t.transaction),t.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(t.transaction)]};case"getLogs":return t.filter&&t.filter.address!=null&&(Array.isArray(t.filter.address)?t.filter.address=t.filter.address.map(_f):t.filter.address=_f(t.filter.address)),{method:"eth_getLogs",args:[t.filter]}}return null}getRpcError(t,n){let{method:r}=t,{error:i,headers:a}=n;if(r==="eth_estimateGas"&&i.message){let u=i.message;if(!u.match(/revert/i)&&u.match(/insufficient funds/i))return Je("insufficient funds","INSUFFICIENT_FUNDS",{transaction:t.params[0],info:{payload:t,error:i}})}if(r==="eth_call"||r==="eth_estimateGas"){let u=aN(i),l=Ga.getBuiltinCallException(r==="eth_call"?"call":"estimateGas",t.params[0],u?u.data:null);return l.info={error:i,payload:t,headers:a},l}let o=JSON.stringify(Pre(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return Je("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[r]||"unknown",reason:"rejected",info:{payload:t,error:i}});if(r==="eth_sendRawTransaction"||r==="eth_sendTransaction"){let u=t.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return Je("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:u,info:{error:i}});if(o.match(/nonce/i)&&o.match(/too low/i))return Je("nonce has already been used","NONCE_EXPIRED",{transaction:u,info:{error:i}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return Je("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:u,info:{error:i}});if(o.match(/only replay-protected/i))return Je("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:r,info:{transaction:u,info:{error:i}}})}let s=!!o.match(/the method .* does not exist/i);return s||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(s=!0),s?Je("unsupported operation","UNSUPPORTED_OPERATION",{operation:t.method,info:{error:i,payload:t}}):Je("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:t})}send(t,n){if(this.destroyed)return Promise.reject(Je("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t}));let r=this.#t++,i=new Promise((a,o)=>{this.#n.push({resolve:a,reject:o,payload:{method:t,params:n,id:r,jsonrpc:"2.0"}})});return this.#d(),i}async getSigner(t){t==null&&(t=0);let n=this.send("eth_accounts",[]);if(typeof t=="number"){let i=await n;if(t>=i.length)throw new Error("no such account");return new Su(this,i[t])}let{accounts:r}=await kt({network:this.getNetwork(),accounts:n});t=be(t);for(let i of r)if(be(i)===t)return new Su(this,t);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new Su(this,n))}destroy(){this.#r&&(clearTimeout(this.#r),this.#r=null);for(let{payload:t,reject:n}of this.#n)n(Je("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t.method}));this.#n=[],super.destroy()}},iN=class extends Xp{#e;constructor(t,n){super(t,n);let r=this._getOption("pollingInterval");r==null&&(r=P7.pollingInterval),this.#e=r}_getSubscriber(t){let n=super._getSubscriber(t);return R7(n)&&(n.pollingInterval=this.#e),n}get pollingInterval(){return this.#e}set pollingInterval(t){if(!Number.isInteger(t)||t<0)throw new Error("invalid interval");this.#e=t,this._forEachSubscriber(n=>{R7(n)&&(n.pollingInterval=this.#e)})}},bu=class extends iN{#e;constructor(t,n,r){t==null&&(t="http://localhost:8545"),super(n,r),typeof t=="string"?this.#e=new cr(t):this.#e=t.clone()}_getConnection(){return this.#e.clone()}async send(t,n){return await this._start(),await super.send(t,n)}async _send(t){let n=this._getConnection();n.body=JSON.stringify(t),n.setHeader("content-type","application/json");let r=await n.send();r.assertOk();let i=r.bodyJson;return Array.isArray(i)||(i=[i]),i.forEach(a=>{let o="error"in a;if(!o)try{W(a.result)==="0x"&&(o=!0)}catch{}if(o){a.headers={};for(let[s,u]of Object.entries(r.headers))s.toLowerCase().includes("sentio")&&(a.headers[s]=u)}}),i}};function aN(e){if(e==null)return null;if(typeof e.message=="string"&&e.message.match(/revert/i)&&Ce(e.data))return{message:e.message,data:e.data};if(typeof e=="object"){for(let t in e){let n=aN(e[t]);if(n)return n}return null}if(typeof e=="string")try{return aN(JSON.parse(e))}catch{}return null}function oN(e,t){if(e!=null){if(typeof e.message=="string"&&t.push(e.message),typeof e=="object")for(let n in e)oN(e[n],t);if(typeof e=="string")try{return oN(JSON.parse(e),t)}catch{}}}function Pre(e){let t=[];return oN(e,t),t}var uN=An(x7(),1);var jp=class extends Error{constructor(t){super(t),this.name="TimeoutError"}},lN=class extends Error{constructor(t){super(),this.name="AbortError",this.message=t}},B7=e=>globalThis.DOMException===void 0?new lN(e):new DOMException(e),D7=e=>{let t=e.reason===void 0?B7("This operation was aborted."):e.reason;return t instanceof Error?t:B7(t)};function cN(e,t){let{milliseconds:n,fallback:r,message:i,customTimers:a={setTimeout,clearTimeout}}=t,o,u=new Promise((l,c)=>{if(typeof n!="number"||Math.sign(n)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);if(t.signal){let{signal:f}=t;f.aborted&&c(D7(f)),f.addEventListener("abort",()=>{c(D7(f))})}if(n===Number.POSITIVE_INFINITY){e.then(l,c);return}let d=new jp;o=a.setTimeout.call(void 0,()=>{if(r){try{l(r())}catch(f){c(f)}return}typeof e.cancel=="function"&&e.cancel(),i===!1?l():i instanceof Error?c(i):(d.message=i??`Promise timed out after ${n} milliseconds`,c(d))},n),(async()=>{try{l(await e)}catch(f){c(f)}})()}).finally(()=>{u.clear()});return u.clear=()=>{a.clearTimeout.call(void 0,o),o=void 0},u}function dN(e,t,n){let r=0,i=e.length;for(;i>0;){let a=Math.trunc(i/2),o=r+a;n(e[o],t)<=0?(r=++o,i-=a+1):i=a}return r}var em=class{#e=[];enqueue(t,n){n={priority:0,...n};let r={priority:n.priority,run:t};if(this.size&&this.#e[this.size-1].priority>=n.priority){this.#e.push(r);return}let i=dN(this.#e,r,(a,o)=>o.priority-a.priority);this.#e.splice(i,0,r)}dequeue(){return this.#e.shift()?.run}filter(t){return this.#e.filter(n=>n.priority===t.priority).map(n=>n.run)}get size(){return this.#e.length}};var tm=class extends uN.default{#e;#t;#n=0;#r;#a;#s=0;#i;#d;#l;#u;#o=0;#p;#c;#f;timeout;constructor(t){if(super(),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:em,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#e=t.carryoverConcurrencyCount,this.#t=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#r=t.intervalCap,this.#a=t.interval,this.#l=new t.queueClass,this.#u=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#f=t.throwOnTimeout===!0,this.#c=t.autoStart===!1}get#h(){return this.#t||this.#n<this.#r}get#m(){return this.#o<this.#p}#g(){this.#o--,this.#T(),this.emit("next")}#S(){this.#k(),this.#E(),this.#d=void 0}get#b(){let t=Date.now();if(this.#i===void 0){let n=this.#s-t;if(n<0)this.#n=this.#e?this.#o:0;else return this.#d===void 0&&(this.#d=setTimeout(()=>{this.#S()},n)),!0}return!1}#T(){if(this.#l.size===0)return this.#i&&clearInterval(this.#i),this.#i=void 0,this.emit("empty"),this.#o===0&&this.emit("idle"),!1;if(!this.#c){let t=!this.#b;if(this.#h&&this.#m){let n=this.#l.dequeue();return n?(this.emit("active"),n(),t&&this.#E(),!0):!1}}return!1}#E(){this.#t||this.#i!==void 0||(this.#i=setInterval(()=>{this.#k()},this.#a),this.#s=Date.now()+this.#a)}#k(){this.#n===0&&this.#o===0&&this.#i&&(clearInterval(this.#i),this.#i=void 0),this.#n=this.#e?this.#o:0,this.#v()}#v(){for(;this.#T(););}get concurrency(){return this.#p}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#p=t,this.#v()}async#R(t){return new Promise((n,r)=>{t.addEventListener("abort",()=>{r(t.reason)},{once:!0})})}async add(t,n={}){return n={timeout:this.timeout,throwOnTimeout:this.#f,...n},new Promise((r,i)=>{this.#l.enqueue(async()=>{this.#o++,this.#n++;try{n.signal?.throwIfAborted();let a=t({signal:n.signal});n.timeout&&(a=cN(Promise.resolve(a),{milliseconds:n.timeout})),n.signal&&(a=Promise.race([a,this.#R(n.signal)]));let o=await a;r(o),this.emit("completed",o)}catch(a){if(a instanceof jp&&!n.throwOnTimeout){r();return}i(a),this.emit("error",a)}finally{this.#g()}},n),this.emit("add"),this.#T()})}async addAll(t,n){return Promise.all(t.map(async r=>this.add(r,n)))}start(){return this.#c?(this.#c=!1,this.#v(),this):this}pause(){this.#c=!0}clear(){this.#l=new this.#u}async onEmpty(){this.#l.size!==0&&await this.#_("empty")}async onSizeLessThan(t){this.#l.size<t||await this.#_("next",()=>this.#l.size<t)}async onIdle(){this.#o===0&&this.#l.size===0||await this.#_("idle")}async#_(t,n){return new Promise(r=>{let i=()=>{n&&!n()||(this.off(t,i),r())};this.on(t,i)})}get size(){return this.#l.size}sizeBy(t){return this.#l.filter(t).length}get pending(){return this.#o}get isPaused(){return this.#c}};var H7=An(F7(),1);var Nf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,q7=new Set,EN=typeof process=="object"&&process?process:{},V7=(e,t,n,r)=>{typeof EN.emitWarning=="function"?EN.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)},yv=globalThis.AbortController,U7=globalThis.AbortSignal;if(typeof yv>"u"){U7=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},yv=class{constructor(){t()}signal=new U7;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let e=EN.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{e&&(e=!1,V7("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var Yre=e=>!q7.has(e),APe=Symbol("type"),$o=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),J7=e=>$o(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?If:null:null,If=class extends Array{constructor(t){super(t),this.fill(0)}},CN=class e{heap;length;static#e=!1;static create(t){let n=J7(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},rm=class e{#e;#t;#n;#r;#a;#s;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#d;#l;#u;#o;#p;#c;#f;#h;#m;#g;#S;#b;#T;#E;#k;#v;static unsafeExposeInternals(t){return{starts:t.#b,ttls:t.#T,sizes:t.#S,keyMap:t.#l,keyList:t.#u,valList:t.#o,next:t.#p,prev:t.#c,get head(){return t.#f},get tail(){return t.#h},free:t.#m,isBackgroundFetch:n=>t.#y(n),backgroundFetch:(n,r,i,a)=>t.#D(n,r,i,a),moveToTail:n=>t.#w(n),indexes:n=>t.#A(n),rindexes:n=>t.#N(n),isStale:n=>t.#C(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#d}get size(){return this.#i}get fetchMethod(){return this.#a}get memoMethod(){return this.#s}get dispose(){return this.#n}get disposeAfter(){return this.#r}constructor(t){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:u,dispose:l,disposeAfter:c,noDisposeOnSet:d,noUpdateTTL:f,maxSize:h=0,maxEntrySize:g=0,sizeCalculation:p,fetchMethod:b,memoMethod:v,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:N,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:M,ignoreFetchAbort:x}=t;if(n!==0&&!$o(n))throw new TypeError("max option must be a nonnegative integer");let U=n?J7(n):Array;if(!U)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=h,this.maxEntrySize=g||this.#t,this.sizeCalculation=p,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(v!==void 0&&typeof v!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#s=v,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=b,this.#k=!!b,this.#l=new Map,this.#u=new Array(n).fill(void 0),this.#o=new Array(n).fill(void 0),this.#p=new U(n),this.#c=new U(n),this.#f=0,this.#h=0,this.#m=CN.create(n),this.#i=0,this.#d=0,typeof l=="function"&&(this.#n=l),typeof c=="function"?(this.#r=c,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#E=!!this.#n,this.#v=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!M,this.ignoreFetchAbort=!!x,this.maxEntrySize!==0){if(this.#t!==0&&!$o(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!$o(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!N,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=$o(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!$o(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let G="LRU_CACHE_UNBOUNDED";Yre(G)&&(q7.add(G),V7("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",G,e))}}getRemainingTTL(t){return this.#l.has(t)?1/0:0}#R(){let t=new If(this.#e),n=new If(this.#e);this.#T=t,this.#b=n,this.#M=(a,o,s=Nf.now())=>{if(n[a]=o!==0?s:0,t[a]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#C(a)&&this.#I(this.#u[a],"expire")},o+1);u.unref&&u.unref()}},this.#_=a=>{n[a]=t[a]!==0?Nf.now():0},this.#O=(a,o)=>{if(t[o]){let s=t[o],u=n[o];if(!s||!u)return;a.ttl=s,a.start=u,a.now=r||i();let l=a.now-u;a.remainingTTL=s-l}};let r=0,i=()=>{let a=Nf.now();if(this.ttlResolution>0){r=a;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return a};this.getRemainingTTL=a=>{let o=this.#l.get(a);if(o===void 0)return 0;let s=t[o],u=n[o];if(!s||!u)return 1/0;let l=(r||i())-u;return s-l},this.#C=a=>{let o=n[a],s=t[a];return!!s&&!!o&&(r||i())-o>s}}#_=()=>{};#O=()=>{};#M=()=>{};#C=()=>!1;#V(){let t=new If(this.#e);this.#d=0,this.#S=t,this.#P=n=>{this.#d-=t[n],t[n]=0},this.#L=(n,r,i,a)=>{if(this.#y(r))return 0;if(!$o(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(r,n),!$o(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#x=(n,r,i)=>{if(t[n]=r,this.#t){let a=this.#t-t[n];for(;this.#d>a;)this.#B(!0)}this.#d+=t[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#d)}}#P=t=>{};#x=(t,n,r)=>{};#L=(t,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#i)for(let n=this.#h;!(!this.#F(n)||((t||!this.#C(n))&&(yield n),n===this.#f));)n=this.#c[n]}*#N({allowStale:t=this.allowStale}={}){if(this.#i)for(let n=this.#f;!(!this.#F(n)||((t||!this.#C(n))&&(yield n),n===this.#h));)n=this.#p[n]}#F(t){return t!==void 0&&this.#l.get(this.#u[t])===t}*entries(){for(let t of this.#A())this.#o[t]!==void 0&&this.#u[t]!==void 0&&!this.#y(this.#o[t])&&(yield[this.#u[t],this.#o[t]])}*rentries(){for(let t of this.#N())this.#o[t]!==void 0&&this.#u[t]!==void 0&&!this.#y(this.#o[t])&&(yield[this.#u[t],this.#o[t]])}*keys(){for(let t of this.#A()){let n=this.#u[t];n!==void 0&&!this.#y(this.#o[t])&&(yield n)}}*rkeys(){for(let t of this.#N()){let n=this.#u[t];n!==void 0&&!this.#y(this.#o[t])&&(yield n)}}*values(){for(let t of this.#A())this.#o[t]!==void 0&&!this.#y(this.#o[t])&&(yield this.#o[t])}*rvalues(){for(let t of this.#N())this.#o[t]!==void 0&&!this.#y(this.#o[t])&&(yield this.#o[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,n={}){for(let r of this.#A()){let i=this.#o[r],a=this.#y(i)?i.__staleWhileFetching:i;if(a!==void 0&&t(a,this.#u[r],this))return this.get(this.#u[r],n)}}forEach(t,n=this){for(let r of this.#A()){let i=this.#o[r],a=this.#y(i)?i.__staleWhileFetching:i;a!==void 0&&t.call(n,a,this.#u[r],this)}}rforEach(t,n=this){for(let r of this.#N()){let i=this.#o[r],a=this.#y(i)?i.__staleWhileFetching:i;a!==void 0&&t.call(n,a,this.#u[r],this)}}purgeStale(){let t=!1;for(let n of this.#N({allowStale:!0}))this.#C(n)&&(this.#I(this.#u[n],"expire"),t=!0);return t}info(t){let n=this.#l.get(t);if(n===void 0)return;let r=this.#o[n],i=this.#y(r)?r.__staleWhileFetching:r;if(i===void 0)return;let a={value:i};if(this.#T&&this.#b){let o=this.#T[n],s=this.#b[n];if(o&&s){let u=o-(Nf.now()-s);a.ttl=u,a.start=Date.now()}}return this.#S&&(a.size=this.#S[n]),a}dump(){let t=[];for(let n of this.#A({allowStale:!0})){let r=this.#u[n],i=this.#o[n],a=this.#y(i)?i.__staleWhileFetching:i;if(a===void 0||r===void 0)continue;let o={value:a};if(this.#T&&this.#b){o.ttl=this.#T[n];let s=Nf.now()-this.#b[n];o.start=Math.floor(Date.now()-s)}this.#S&&(o.size=this.#S[n]),t.unshift([r,o])}return t}load(t){this.clear();for(let[n,r]of t){if(r.start){let i=Date.now()-r.start;r.start=Nf.now()-i}this.set(n,r.value,r)}}set(t,n,r={}){if(n===void 0)return this.delete(t),this;let{ttl:i=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:u}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,c=this.#L(t,n,r.size||0,s);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#I(t,"set"),this;let d=this.#i===0?void 0:this.#l.get(t);if(d===void 0)d=this.#i===0?this.#h:this.#m.length!==0?this.#m.pop():this.#i===this.#e?this.#B(!1):this.#i,this.#u[d]=t,this.#o[d]=n,this.#l.set(t,d),this.#p[this.#h]=d,this.#c[d]=this.#h,this.#h=d,this.#i++,this.#x(d,c,u),u&&(u.set="add"),l=!1;else{this.#w(d);let f=this.#o[d];if(n!==f){if(this.#k&&this.#y(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=f;h!==void 0&&!o&&(this.#E&&this.#n?.(h,t,"set"),this.#v&&this.#g?.push([h,t,"set"]))}else o||(this.#E&&this.#n?.(f,t,"set"),this.#v&&this.#g?.push([f,t,"set"]));if(this.#P(d),this.#x(d,c,u),this.#o[d]=n,u){u.set="replace";let h=f&&this.#y(f)?f.__staleWhileFetching:f;h!==void 0&&(u.oldValue=h)}}else u&&(u.set="update")}if(i!==0&&!this.#T&&this.#R(),this.#T&&(l||this.#M(d,i,a),u&&this.#O(u,d)),!o&&this.#v&&this.#g){let f=this.#g,h;for(;h=f?.shift();)this.#r?.(...h)}return this}pop(){try{for(;this.#i;){let t=this.#o[this.#f];if(this.#B(!0),this.#y(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#v&&this.#g){let t=this.#g,n;for(;n=t?.shift();)this.#r?.(...n)}}}#B(t){let n=this.#f,r=this.#u[n],i=this.#o[n];return this.#k&&this.#y(i)?i.__abortController.abort(new Error("evicted")):(this.#E||this.#v)&&(this.#E&&this.#n?.(i,r,"evict"),this.#v&&this.#g?.push([i,r,"evict"])),this.#P(n),t&&(this.#u[n]=void 0,this.#o[n]=void 0,this.#m.push(n)),this.#i===1?(this.#f=this.#h=0,this.#m.length=0):this.#f=this.#p[n],this.#l.delete(r),this.#i--,n}has(t,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,a=this.#l.get(t);if(a!==void 0){let o=this.#o[a];if(this.#y(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#C(a))i&&(i.has="stale",this.#O(i,a));else return r&&this.#_(a),i&&(i.has="hit",this.#O(i,a)),!0}else i&&(i.has="miss");return!1}peek(t,n={}){let{allowStale:r=this.allowStale}=n,i=this.#l.get(t);if(i===void 0||!r&&this.#C(i))return;let a=this.#o[i];return this.#y(a)?a.__staleWhileFetching:a}#D(t,n,r,i){let a=n===void 0?void 0:this.#o[n];if(this.#y(a))return a;let o=new yv,{signal:s}=r;s?.addEventListener("abort",()=>o.abort(s.reason),{signal:o.signal});let u={signal:o.signal,options:r,context:i},l=(p,b=!1)=>{let{aborted:v}=o.signal,C=r.ignoreFetchAbort&&p!==void 0;if(r.status&&(v&&!b?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,C&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),v&&!C&&!b)return d(o.signal.reason);let N=h;return this.#o[n]===h&&(p===void 0?N.__staleWhileFetching?this.#o[n]=N.__staleWhileFetching:this.#I(t,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(t,p,u.options))),p},c=p=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=p),d(p)),d=p=>{let{aborted:b}=o.signal,v=b&&r.allowStaleOnFetchAbort,C=v||r.allowStaleOnFetchRejection,N=C||r.noDeleteOnFetchRejection,I=h;if(this.#o[n]===h&&(!N||I.__staleWhileFetching===void 0?this.#I(t,"fetch"):v||(this.#o[n]=I.__staleWhileFetching)),C)return r.status&&I.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),I.__staleWhileFetching;if(I.__returned===I)throw p},f=(p,b)=>{let v=this.#a?.(t,a,u);v&&v instanceof Promise&&v.then(C=>p(C===void 0?void 0:C),b),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(p(void 0),r.allowStaleOnFetchAbort&&(p=C=>l(C,!0)))})};r.status&&(r.status.fetchDispatched=!0);let h=new Promise(f).then(l,c),g=Object.assign(h,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return n===void 0?(this.set(t,g,{...u.options,status:void 0}),n=this.#l.get(t)):this.#o[n]=g,g}#y(t){if(!this.#k)return!1;let n=t;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof yv}async fetch(t,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:p,forceRefresh:b=!1,status:v,signal:C}=n;if(!this.#k)return v&&(v.fetch="get"),this.get(t,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:a,status:v});let N={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:o,noDisposeOnSet:s,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:h,status:v,signal:C},I=this.#l.get(t);if(I===void 0){v&&(v.fetch="miss");let M=this.#D(t,I,N,p);return M.__returned=M}else{let M=this.#o[I];if(this.#y(M)){let j=r&&M.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",j&&(v.returnedStale=!0)),j?M.__staleWhileFetching:M.__returned=M}let x=this.#C(I);if(!b&&!x)return v&&(v.fetch="hit"),this.#w(I),i&&this.#_(I),v&&this.#O(v,I),M;let U=this.#D(t,I,N,p),le=U.__staleWhileFetching!==void 0&&r;return v&&(v.fetch=x?"stale":"refresh",le&&x&&(v.returnedStale=!0)),le?U.__staleWhileFetching:U.__returned=U}}async forceFetch(t,n={}){let r=await this.fetch(t,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(t,n={}){let r=this.#s;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:a,...o}=n,s=this.get(t,o);if(!a&&s!==void 0)return s;let u=r(t,s,{options:o,context:i});return this.set(t,u,o),u}get(t,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:o}=n,s=this.#l.get(t);if(s!==void 0){let u=this.#o[s],l=this.#y(u);return o&&this.#O(o,s),this.#C(s)?(o&&(o.get="stale"),l?(o&&r&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?u.__staleWhileFetching:void 0):(a||this.#I(t,"expire"),o&&r&&(o.returnedStale=!0),r?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#w(s),i&&this.#_(s),u))}else o&&(o.get="miss")}#U(t,n){this.#c[n]=t,this.#p[t]=n}#w(t){t!==this.#h&&(t===this.#f?this.#f=this.#p[t]:this.#U(this.#c[t],this.#p[t]),this.#U(this.#h,t),this.#h=t)}delete(t){return this.#I(t,"delete")}#I(t,n){let r=!1;if(this.#i!==0){let i=this.#l.get(t);if(i!==void 0)if(r=!0,this.#i===1)this.#q(n);else{this.#P(i);let a=this.#o[i];if(this.#y(a)?a.__abortController.abort(new Error("deleted")):(this.#E||this.#v)&&(this.#E&&this.#n?.(a,t,n),this.#v&&this.#g?.push([a,t,n])),this.#l.delete(t),this.#u[i]=void 0,this.#o[i]=void 0,i===this.#h)this.#h=this.#c[i];else if(i===this.#f)this.#f=this.#p[i];else{let o=this.#c[i];this.#p[o]=this.#p[i];let s=this.#p[i];this.#c[s]=this.#c[i]}this.#i--,this.#m.push(i)}}if(this.#v&&this.#g?.length){let i=this.#g,a;for(;a=i?.shift();)this.#r?.(...a)}return r}clear(){return this.#q("delete")}#q(t){for(let n of this.#N({allowStale:!0})){let r=this.#o[n];if(this.#y(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#u[n];this.#E&&this.#n?.(r,i,t),this.#v&&this.#g?.push([r,i,t])}}if(this.#l.clear(),this.#o.fill(void 0),this.#u.fill(void 0),this.#T&&this.#b&&(this.#T.fill(0),this.#b.fill(0)),this.#S&&this.#S.fill(0),this.#f=0,this.#h=0,this.#m.length=0,this.#d=0,this.#i=0,this.#v&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#r?.(...r)}}};var{miss_count:Xre,hit_count:$re,queue_size:jre}=_F,DPe=new bu("",nn.from(1)),W7=new Map;function G7(e){e||(e=H7.EthChainId.ETHEREUM);let t=nn.from(parseInt(e)),n=xs.INSTANCE.chainServer.get(e),r=t.chainId.toString()+"-"+n,i=W7.get(r);if(i)return i;if(n===void 0)throw Error("Provider not found for chain "+t.chainId+", configured chains: "+[...xs.INSTANCE.chainServer.keys()].join(" "));return i=new kN(n,t,xs.INSTANCE.concurrency,xs.INSTANCE.batchCount),W7.set(r,i),i}function eie(e,t){return e+":"+JSON.stringify(t,(n,r)=>{if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){let i=Object.keys(r);return i.sort(),i.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}var kN=class extends bu{executor;#e=new rm({max:3e5,maxSize:500*1024*1024});#t=new rm({max:3e5});constructor(t,n,r,i=1){super(t,n,{staticNetwork:n,batchMaxCount:i}),this.executor=new tm({concurrency:r})}async send(t,n){if(t!=="eth_call")return await this.executor.add(()=>super.send(t,n));let r=eie(t,n),i=n[n.length-1],a=this.#e.get(r);if(a)$re.add(1);else{Xre.add(1);let s=AF.getStore(),u=Date.now();a=this.executor.add(()=>{let l=Date.now();tu.processor_rpc_queue_duration.record(l-u,{chain_id:this._network.chainId.toString(),handler:s});let c=!0;return super.send(t,n).catch(d=>{throw c=!1,d}).finally(()=>{tu.processor_rpc_duration.record(Date.now()-l,{chain_id:this._network.chainId.toString(),handler:s,success:c})})}),jre.record(this.executor.size),this.#e.set(r,a,{size:r.length}),i==="latest"&&setTimeout(()=>{this.#e.get(r)===a&&this.#e.delete(r)},60*1e3)}let o;try{o=await a}catch(s){if(this.#e.delete(r),s.code==="TIMEOUT"){let u=this.#t.get(r);if(zd.execution.rpcRetryTimes&&u===void 0&&(u=zd.execution.rpcRetryTimes),u)return this.#t.set(r,u-1),this.send(t,n)}throw s}if(!o)throw Error("Unexpected null response");return o}toString(){return"QueuedStaticJsonRpcProvider"}};import("node:process").then(e=>e.stdout.write(""));var kn=An(VL(),1),mh=An(h6(),1);function vv(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(c){try{l(r.next(c))}catch(d){o(d)}}function u(c){try{l(r.throw(c))}catch(d){o(d)}}function l(c){c.done?a(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})}function z7(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function xt(e){return this instanceof xt?(this.v=e,this):new xt(e)}function im(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,a=[];return i={},s("next"),s("throw"),s("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(h){return function(g){return Promise.resolve(g).then(h,d)}}function s(h,g){r[h]&&(i[h]=function(p){return new Promise(function(b,v){a.push([h,p,b,v])>1||u(h,p)})},g&&(i[h]=g(i[h])))}function u(h,g){try{l(r[h](g))}catch(p){f(a[0][3],p)}}function l(h){h.value instanceof xt?Promise.resolve(h.value.v).then(c,d):f(a[0][2],h)}function c(h){u("next",h)}function d(h){u("throw",h)}function f(h,g){h(g),a.shift(),a.length&&u(a[0][0],a[0][1])}}function Sv(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof z7=="function"?z7(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(o){return new Promise(function(s,u){o=e[a](o),i(s,u,o.done,o.value)})}}function i(a,o,s,u){Promise.resolve(u).then(function(l){a({value:l,done:s})},o)}}function Q7(e,t,n){if(typeof t>"u")return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,i){return e.call(t,r,i)};case 3:return function(r,i,a){return e.call(t,r,i,a)};default:return function(){return e.apply(t,arguments)}}}function jo(e){return vv(this,void 0,void 0,function*(){return e})}var tie=e=>typeof e=="number",K7=e=>typeof e=="boolean",Qa=e=>typeof e=="function",la=e=>e!=null&&Object(e)===e,_N=e=>la(e)&&Qa(e.then);function AN(e){return la(e)&&tie(e.length)}function NN(e){return e!=null&&Qa(e[Symbol.iterator])}function Z7(e){return la(e)&&!Qa(e[Symbol.iterator])&&Qa(e.next)}function IN(e){return la(e)&&Qa(e[Symbol.asyncIterator])}function ON(e){return e!=null&&Object(e)===e&&typeof e.subscribe=="function"}var Y7=e=>la(e)&&Qa(e.pipe)&&Qa(e._read)&&K7(e.readable)&&la(e._readableState),X7=e=>la(e)&&Qa(e.end)&&Qa(e._write)&&K7(e.writable)&&la(e._writableState);function $7(e){let t=Number(e);return isNaN(t)?0:t===0||!isFinite(t)?t:(t>0?1:-1)*Math.floor(Math.abs(t))}var nie=Math.pow(2,53)-1;function j7(e){let t=$7(e);return Math.min(Math.max(t,0),nie)}var Of=class e extends Error{constructor(t="The operation has been aborted"){super(t),Object.setPrototypeOf(this,e.prototype),Error.captureStackTrace(this,this.constructor),this.name="AbortError"}get[Symbol.toStringTag](){return"AbortError"}};function Rf(e){if(e&&e.aborted)throw new Of}Object.defineProperty(Of,Symbol.hasInstance,{writable:!0,configurable:!0,value(e){return la(e)&&(e.constructor.name==="AbortError"||e[Symbol.toStringTag]==="AbortError")}});var rn=class e{forEach(t,n,r){var i,a,o,s;return vv(this,void 0,void 0,function*(){let u=r?new Cv(this,r):this,l=0;try{for(var c=!0,d=Sv(u),f;f=yield d.next(),i=f.done,!i;c=!0){s=f.value,c=!1;let h=s;yield t.call(n,h,l++,r)}}catch(h){a={error:h}}finally{try{!c&&!i&&(o=d.return)&&(yield o.call(d))}finally{if(a)throw a.error}}})}pipe(...t){let n=-1,r=t.length,i=this;for(;++n<r;)i=t[n](e.as(i));return i}static from(t,n=jo,r){let i=Q7(n,r,2);if(NN(t)||IN(t))return new am(t,i);if(_N(t))return new Tv(t,i);if(ON(t))return new Ev(t,i);if(AN(t))return new Pf(t,i);if(Z7(t))return new am({[Symbol.asyncIterator]:()=>t},i);throw new TypeError("Input type not supported")}static as(t){return t instanceof e?t:typeof t=="string"?new Pf([t],jo):NN(t)||IN(t)?new am(t,jo):_N(t)?new Tv(t,jo):ON(t)?new Ev(t,jo):AN(t)?new Pf(t,jo):new Pf([t],jo)}};rn.prototype[Symbol.toStringTag]="AsyncIterableX";Object.defineProperty(rn,Symbol.hasInstance,{writable:!0,configurable:!0,value(e){return!!(e&&e[Symbol.toStringTag]==="AsyncIterableX")}});var rie="value",RN="error",bv=class{constructor(){this._ended=!1,this._values=[],this._resolvers=[]}[Symbol.asyncIterator](){return this}write(t){this._push({type:rie,value:t})}error(t){this._push({type:RN,error:t})}_push(t){if(this._ended)throw new Error("AsyncSink already ended");if(this._resolvers.length>0){let{resolve:n,reject:r}=this._resolvers.shift();t.type===RN?r(t.error):n({done:!1,value:t.value})}else this._values.push(t)}next(){if(this._values.length>0){let{type:t,value:n,error:r}=this._values.shift();return t===RN?Promise.reject(r):Promise.resolve({done:!1,value:n})}return this._ended?Promise.resolve({done:!0}):new Promise((t,n)=>{this._resolvers.push({resolve:t,reject:n})})}end(){for(;this._resolvers.length>0;)this._resolvers.shift().resolve({done:!0});this._ended=!0}},Pf=class extends rn{constructor(t,n){super(),this._source=t,this._selector=n}[Symbol.asyncIterator](){return im(this,arguments,function*(){let n=0,r=j7(this._source.length);for(;n<r;)yield yield xt(yield xt(this._selector(this._source[n],n++)))})}},am=class extends rn{constructor(t,n){super(),this._source=t,this._selector=n}[Symbol.asyncIterator](t){return im(this,arguments,function*(){var r,i,a,o,s,u,l,c;let d=0;if(t&&this._source instanceof rn)try{for(var f=!0,h=Sv(new Cv(this._source,t)),g;g=yield xt(h.next()),r=g.done,!r;f=!0){o=g.value,f=!1;let C=o;yield yield xt(yield xt(this._selector(C,d++)))}}catch(C){i={error:C}}finally{try{!f&&!r&&(a=h.return)&&(yield xt(a.call(h)))}finally{if(i)throw i.error}}else{Rf(t);try{for(var p=!0,b=Sv(this._source),v;v=yield xt(b.next()),s=v.done,!s;p=!0){c=v.value,p=!1;let C=c;Rf(t);let N=yield xt(this._selector(C,d++));Rf(t),yield yield xt(N)}}catch(C){u={error:C}}finally{try{!p&&!s&&(l=b.return)&&(yield xt(l.call(b)))}finally{if(u)throw u.error}}}})}},Tv=class extends rn{constructor(t,n){super(),this._source=t,this._selector=n}[Symbol.asyncIterator](){return im(this,arguments,function*(){let n=yield xt(this._source);yield yield xt(yield xt(this._selector(n,0)))})}},Ev=class extends rn{constructor(t,n){super(),this._observable=t,this._selector=n}[Symbol.asyncIterator](t){return im(this,arguments,function*(){Rf(t);let r=new bv,i=this._observable.subscribe({next(s){r.write(s)},error(s){r.error(s)},complete(){r.end()}});function a(){r.error(new Of)}t&&t.addEventListener("abort",a);let o=0;try{for(let s;!(s=yield xt(r.next())).done;)Rf(t),yield yield xt(yield xt(this._selector(s.value,o++)))}finally{t&&t.removeEventListener("abort",a),i.unsubscribe()}})}},Cv=class{constructor(t,n){this._source=t,this._signal=n}[Symbol.asyncIterator](){return this._source[Symbol.asyncIterator](this._signal)}};try{(e=>{if(e)return;rn.prototype.pipe=n;let t=(r,i=r._writableState||{objectMode:!0})=>i;function n(...r){let i=-1,a,o=r.length,s=this,u;for(;++i<o;)if(u=r[i],typeof u=="function")s=u(rn.as(s));else if(X7(u))return{end:a=!0}=r[i+1]||{},Y7(s)?s.pipe(u,{end:a}):rn.as(s).toNodeStream(t(u)).pipe(u,{end:a});return s}})(typeof window=="object"&&typeof document=="object"&&document.nodeType===9)}catch{}var iie=rn.as,kv=rn.from;var PN=class e extends rn{constructor(t,n){super(),this._source=t,this._signal=n}withAbort(t){return new e(this._source,t)}[Symbol.asyncIterator](){return this._source[Symbol.asyncIterator](this._signal)}};function wN(e){return function(n){return new PN(n,e)}}var QI=An(AW(),1);var gbe=[{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes[]",name:"returnData",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3[]",name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3Value[]",name:"calls",type:"tuple[]"}],name:"aggregate3Value",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"blockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"getBasefee",outputs:[{internalType:"uint256",name:"basefee",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getBlockNumber",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getChainId",outputs:[{internalType:"uint256",name:"chainid",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockCoinbase",outputs:[{internalType:"address",name:"coinbase",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockDifficulty",outputs:[{internalType:"uint256",name:"difficulty",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockGasLimit",outputs:[{internalType:"uint256",name:"gaslimit",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"getEthBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"tryAggregate",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"tryBlockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"}],ybe=[{name:"Mainnet",chainId:1,url:"https://etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Kovan",chainId:42,url:"https://kovan.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Rinkeby",chainId:4,url:"https://rinkeby.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"G\xF6rli",chainId:5,url:"https://goerli.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Ropsten",chainId:3,url:"https://ropsten.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Sepolia",chainId:11155111,url:"https://sepolia.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Holesky",chainId:17e3,url:"https://holesky.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Xterio Chain",chainId:112358,url:"https://xterscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Xterio Testnet",chainId:1637450,url:"https://testnet.xterscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Optimism",chainId:10,url:"https://optimistic.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Optimism Kovan",chainId:69,url:"https://kovan-optimistic.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Optimism G\xF6rli",chainId:420,url:"https://blockscout.com/optimism/goerli/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Optimism Sepolia",chainId:11155420,url:"https://optimism-sepolia.blockscout.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Arbitrum",chainId:42161,url:"https://arbiscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Arbitrum Nova",chainId:42170,url:"https://nova.arbiscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Arbitrum G\xF6rli",chainId:421613,url:"https://goerli-rollup-explorer.arbitrum.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Arbitrum Sepolia",chainId:421614,url:"https://sepolia-explorer.arbitrum.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Arbitrum Rinkeby",chainId:421611,url:"https://testnet.arbiscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Stylus Testnet",chainId:23011913,url:"https://stylus-testnet-explorer.arbitrum.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Polygon",chainId:137,url:"https://polygonscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Mumbai",chainId:80001,url:"https://mumbai.polygonscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Amoy",chainId:80002,url:"https://amoy.polygonscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Polygon zkEVM",chainId:1101,url:"https://zkevm.polygonscan.com/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Polygon zkEVM Testnet",chainId:1442,url:"https://testnet-zkevm.polygonscan.com/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Cardona zkEVM Testnet",chainId:2442,url:"https://cardona-zkevm.polygonscan.com/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Gnosis Chain (xDai)",chainId:100,url:"https://blockscout.com/xdai/mainnet/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Chiado (Gnosis Chain Testnet)",chainId:10200,url:"https://blockscout.chiadochain.net/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Avalanche",chainId:43114,url:"https://snowtrace.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Avalanche Fuji",chainId:43113,url:"https://testnet.snowtrace.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Fantom Testnet",chainId:4002,url:"https://testnet.ftmscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Fantom Opera",chainId:250,url:"https://ftmscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Fantom Sonic",chainId:64240,url:"https://public-sonic.fantom.network/address/0xca11bde05977b3631167028862be2a173976ca11"},{name:"BNB Smart Chain",chainId:56,url:"https://bscscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"BNB Smart Chain Testnet",chainId:97,url:"https://testnet.bscscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"opBNB Testnet",chainId:5611,url:"https://opbnbscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?p=1&tab=Contract"},{name:"opBNB Mainnet",chainId:204,url:"https://mainnet.opbnbscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?p=1&tab=Contract"},{name:"Moonbeam",chainId:1284,url:"https://moonscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Moonriver",chainId:1285,url:"https://moonriver.moonscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Moonbase Alpha Testnet",chainId:1287,url:"https://moonbase.moonscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Palm",chainId:11297108109,url:"https://palm.chainlens.com/contracts/0xca11bde05977b3631167028862be2a173976ca11/sources"},{name:"Palm Testnet",chainId:11297108099,url:"https://testnet.palm.chainlens.com/contracts/0xca11bde05977b3631167028862be2a173976ca11/sources"},{name:"Harmony",chainId:16666e5,url:"https://explorer.harmony.one/address/0xcA11bde05977b3631167028862bE2a173976CA11?activeTab=7"},{name:"Cronos",chainId:25,url:"https://cronoscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Cronos Testnet",chainId:338,url:"https://cronos.org/explorer/testnet3/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Fuse",chainId:122,url:"https://explorer.fuse.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Flare Mainnet",chainId:14,url:"https://flare-explorer.flare.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Songbird Canary Network",chainId:19,url:"https://songbird-explorer.flare.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Coston Testnet",chainId:16,url:"https://coston-explorer.flare.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Coston2 Testnet",chainId:114,url:"https://coston2-explorer.flare.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Boba",chainId:288,url:"https://blockexplorer.boba.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Aurora",chainId:1313161554,url:"https://explorer.mainnet.aurora.dev/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Astar",chainId:592,url:"https://blockscout.com/astar/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Astar zKyoto Testnet",chainId:6038361,url:"https://zkyoto.explorer.startale.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Astar zkEVM",chainId:3776,url:"https://astar-zkevm.explorer.startale.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"OKC",chainId:66,url:"https://www.oklink.com/en/okc/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Heco Chain",chainId:128,url:"https://hecoinfo.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Metis Andromeda",chainId:1088,url:"https://andromeda-explorer.metis.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Metis Goerli",chainId:599,url:"https://goerli.explorer.metisdevops.link/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Metis Sepolia",chainId:59902,url:"https://sepolia-explorer.metisdevops.link/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"RSK",chainId:30,url:"https://explorer.rsk.co/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"RSK Testnet",chainId:31,url:"https://explorer.testnet.rsk.co/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Evmos",chainId:9001,url:"https://evm.evmos.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Evmos Testnet",chainId:9e3,url:"https://evm.evmos.dev/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Thundercore",chainId:108,url:"https://viewblock.io/thundercore/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=code"},{name:"Thundercore Testnet",chainId:18,url:"https://explorer-testnet.thundercore.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Oasis",chainId:42262,url:"https://explorer.emerald.oasis.dev/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Oasis Sapphire",chainId:23294,url:"https://explorer.sapphire.oasis.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Celo",chainId:42220,url:"https://explorer.celo.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Celo Alfajores Testnet",chainId:44787,url:"https://explorer.celo.org/alfajores/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Godwoken",chainId:71402,url:"https://v1.gwscan.com/account/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Godwoken Testnet",chainId:71401,url:"https://gw-explorer.nervosdao.community/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Klaytn",chainId:8217,url:"https://scope.klaytn.com/account/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Klaytn Testnet (Baobab)",chainId:1001,url:"https://baobab.klaytnscope.com/account/0xca11bde05977b3631167028862be2a173976ca11?tabId=contractCode"},{name:"Milkomeda",chainId:2001,url:"https://explorer-mainnet-cardano-evm.c1.milkomeda.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"KCC",chainId:321,url:"https://explorer.kcc.io/en/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Velas",chainId:106,url:"https://evmexplorer.velas.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Telos",chainId:40,url:"https://www.teloscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#contract"},{name:"Step Network",chainId:1234,url:"https://stepscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Canto",chainId:7700,url:"https://tuber.build/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Canto Testnet",chainId:7701,url:"https://testnet.tuber.build/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Iotex",chainId:4689,url:"https://iotexscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#transactions"},{name:"Bitgert",chainId:32520,url:"https://brisescan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Kava",chainId:2222,url:"https://explorer.kava.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Mantle Sepolia Testnet",chainId:5003,url:"https://explorer.sepolia.mantle.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Mantle Testnet",chainId:5001,url:"https://explorer.testnet.mantle.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Mantle",chainId:5e3,url:"https://explorer.mantle.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Shardeum Sphinx",chainId:8082,url:"https://explorer.testnet.mantle.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Base Testnet (Goerli)",chainId:84531,url:"https://goerli.basescan.org/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Base Testnet (Sepolia)",chainId:84532,url:"https://base-sepolia.blockscout.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Base",chainId:8453,url:"https://basescan.org/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Kroma Testnet (Sepolia)",chainId:2358,url:"https://sepolia.kromascan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"DeFiChain EVM Mainnet",chainId:1130,url:"https://meta.defiscan.live/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"DeFiChain EVM Testnet",chainId:1131,url:"https://meta.defiscan.live/address/0xcA11bde05977b3631167028862bE2a173976CA11?network=TestNet"},{name:"Defi Oracle Meta Mainnet",chainId:138,url:"https://blockscout.defi-oracle.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"DFK Chain Test",chainId:335,url:"https://subnets-test.avax.network/defi-kingdoms/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"DFK Chain",chainId:53935,url:"https://subnets.avax.network/defi-kingdoms/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Neon EVM DevNet",chainId:245022926,url:"https://devnet.neonscan.org/address/0xcA11bde05977b3631167028862bE2a173976CA11#contract"},{name:"Linea Sepolia Testnet",chainId:59141,url:"https://sepolia.lineascan.build/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Linea Goerli Testnet",chainId:59140,url:"https://explorer.goerli.linea.build/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Linea Mainnet",chainId:59144,url:"https://lineascan.build/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Hashbit",chainId:11119,url:"https://explorer.hashbit.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Syscoin",chainId:57,url:"https://explorer.syscoin.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Syscoin Rollux Mainnet",chainId:570,url:"https://explorer.rollux.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Syscoin Tannebaum Testnet",chainId:5700,url:"https://tanenbaum.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Syscoin Tannebaum Rollux",chainId:57e3,url:"https://rollux.tanenbaum.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Pulsechain v4 Testnet",chainId:943,url:"https://scan.v4.testnet.pulsechain.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Pulsechain Mainnet",chainId:369,url:"https://scan.pulsechain.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Zora Goerli Testnet",chainId:999,url:"https://testnet.explorer.zora.co/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Zora",chainId:7777777,url:"https://explorer.zora.co/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Zora Sepolia Testnet",chainId:999999999,url:"https://sepolia.explorer.zora.energy/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Darwinia Crab Network",chainId:44,url:"https://crab.subscan.io/account/0xca11bde05977b3631167028862be2a173976ca11"},{name:"Darwinia Network",chainId:46,url:"https://darwinia.subscan.io/account/0xca11bde05977b3631167028862be2a173976ca11"},{name:"Chain Verse Mainnet",chainId:5555,url:"https://explorer.chainverse.info/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Scroll Alpha Testnet",chainId:534353,url:"https://blockscout.scroll.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Scroll Sepolia Testnet",chainId:534351,url:"https://sepolia.scrollscan.dev/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Scroll",chainId:534352,url:"https://scrollscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Xodex",chainId:2415,url:"https://explorer.xo-dex.com/contracts/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"EOS EVM Testnet",chainId:15557,url:"https://explorer.testnet.evm.eosnetwork.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"EOS EVM",chainId:17777,url:"https://explorer.evm.eosnetwork.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Crossbell",chainId:3737,url:"https://scan.crossbell.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Dogechain",chainId:2e3,url:"https://explorer.dogechain.dog/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"MEVerse Chain Testnet",chainId:4759,url:"https://testnet.meversescan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"MEVerse Chain Mainnet",chainId:7518,url:"https://meversescan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"SKALE Calypso Testnet",chainId:974399131,url:"https://giant-half-dual-testnet.explorer.testnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Europa Testnet",chainId:1444673419,url:"https://juicy-low-small-testnet.explorer.testnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Nebula Testnet",chainId:37084624,url:"https://lanky-ill-funny-testnet.explorer.testnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Titan Testnet",chainId:1020352220,url:"https://aware-fake-trim-testnet.explorer.testnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Calypso Hub",chainId:1564830818,url:"https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Europa Liquidity Hub",chainId:2046399126,url:"https://elated-tan-skat.explorer.mainnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Nebula Gaming Hub",chainId:1482601649,url:"https://green-giddy-denebola.explorer.mainnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Titan AI Hub",chainId:1350216234,url:"https://parallel-stormy-spica.explorer.mainnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Ronin Saigon Testnet",chainId:2021,url:"https://saigon-app.roninchain.com/address/ronin:ca11bde05977b3631167028862be2a173976ca11?t=contract"},{name:"Ronin Mainnet",chainId:2020,url:"https://app.roninchain.com/address/ronin:ca11bde05977b3631167028862be2a173976ca11"},{name:"Qitmeer Testnet",chainId:8131,url:"https://testnet-qng.qitmeer.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Qitmeer QNG Mainnet",chainId:813,url:"https://qng.meerscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Q Testnet",chainId:35443,url:"https://explorer.qtestnet.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Q Devnet",chainId:35442,url:"https://explorer.qdevnet.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Q Mainnet",chainId:35441,url:"https://explorer.q.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Neon Mainnet",chainId:245022934,url:"https://neonscan.org/address/0xca11bde05977b3631167028862be2a173976ca11#contract"},{name:"LUKSO Testnet",chainId:4201,url:"https://explorer.execution.testnet.lukso.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"LUKSO Mainnet",chainId:42,url:"https://explorer.execution.mainnet.lukso.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Edgeware EdgeEVM",chainId:2021,url:"https://edgscan.live/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Meter Testnet",chainId:83,url:"https://scan-warringstakes.meter.io/address/0xca11bde05977b3631167028862be2a173976ca11?tab=0&p=1"},{name:"Meter",chainId:82,url:"https://scan.meter.io/address/0xca11bde05977b3631167028862be2a173976ca11?tab=0&p=1"},{name:"Sepolia PGN (Public Goods Network) Testnet",chainId:58008,url:"https://explorer.sepolia.publicgoods.network/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"PGN (Public Goods Network)",chainId:424,url:"https://explorer.publicgoods.network/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"ShimmerEVM",chainId:148,url:"https://explorer.evm.shimmer.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Highbury EVM",chainId:710,url:"https://explorer.furya.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Arthera Testnet",chainId:10243,url:"https://explorer-test.arthera.net/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Arthera Mainnet",chainId:10242,url:"https://explorer.arthera.net/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Manta Pacific Mainnet",chainId:169,url:"https://pacific-explorer.manta.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Jolnir (Taiko Testnet)",chainId:167007,url:"https://explorer.jolnir.taiko.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Katla (Taiko A6 Testnet)",chainId:167008,url:"https://explorer.katla.taiko.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Filecoin Mainnet",chainId:314,url:"https://filfox.info/en/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Filecoin Calibration Testnet",chainId:314159,url:"https://calibration.filscan.io/en/tx/0xdbfa261cd7d17bb40479a0493ad6c0fee435859e37aae73aa7e803f3122cc465/"},{name:"Fusion",chainId:32659,url:"https://fsnscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#contract"},{name:"Fusion Testnet",chainId:46688,url:"https://testnet.fsnscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#contract"},{name:"Xai Testnet",chainId:47279324479,url:"https://testnet-explorer.xai-chain.net/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"JFIN Chain",chainId:3501,url:"https://jfinscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"JFIN Chain Testnet",chainId:3502,url:"https://testnet.jfinscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Chiliz Chain",chainId:88888,url:"https://scan.chiliz.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Chiliz Spicy Testnet",chainId:88882,url:"https://testnet.chiliscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contract/88882/code"},{name:"CORE",chainId:1116,url:"https://scan.coredao.org/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Core Testnet",chainId:1115,url:"https://scan.test.btcs.network/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Ethereum Classic",chainId:61,url:"https://etc.blockscout.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Frame Testnet",chainId:68840142,url:"https://explorer.testnet.frame.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Etherlink Mainnet",chainId:42793,url:"https://explorer.etherlink.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Etherlink Testnet",chainId:128123,url:"https://testnet-explorer.etherlink.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"ZetaChain Athens 3 Testnet",chainId:7001,url:"https://explorer.zetachain.com/address/0xca11bde05977b3631167028862be2a173976ca11"},{name:"ZetaChain ",chainId:7e3,url:"https://explorer.zetachain.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"X1 Testnet",chainId:195,url:"https://www.oklink.com/x1-test/address/0xca11bde05977b3631167028862be2a173976ca11/contract"},{name:"Lumiterra Layer3",chainId:94168,url:"https://scan.layerlumi.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"BitTorrent Chain Mainnet",chainId:199,url:"https://bttcscan.com/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"BTT Chain Testnet",chainId:1029,url:"https://testnet.bttcscan.com/address/0xca11bde05977b3631167028862be2a173976ca11"},{name:"Callisto Mainnet",chainId:820,url:"https://explorer.callisto.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/transactions"},{name:"Areon Network Testnet",chainId:462,url:"https://areonscan.com/contracts/0xca11bde05977b3631167028862be2a173976ca11?page=0"},{name:"Areon Network Mainnet",chainId:463,url:"https://areonscan.com/contracts/0xca11bde05977b3631167028862be2a173976ca11"},{name:"zkFair Mainnet",chainId:42766,url:"https://scan.zkfair.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Mode Mainnet",chainId:34443,url:"https://explorer.mode.network/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Blast Sepolia",chainId:168587773,url:"https://testnet.blastscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contract/168587773/code"},{name:"Blast",chainId:81457,url:"https://blastscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Xai",chainId:660279,url:"https://explorer.xai-chain.net/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"DOS Chain",chainId:7979,url:"https://doscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"DOS Chain Testnet",chainId:3939,url:"https://test.doscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Tron",chainId:728126428,url:"https://tronscan.org/#/contract/TEazPvZwDjDtFeJupyo7QunvnrnUjPH8ED/code",address:"TEazPvZwDjDtFeJupyo7QunvnrnUjPH8ED"},{name:"zkSync Era",chainId:324,url:"https://explorer.zksync.io/address/0xF9cda624FBC7e059355ce98a31693d299FACd963#contract",address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},{name:"zkSync Era Goerli Testnet",chainId:280,url:"https://goerli.explorer.zksync.io/address/0xF9cda624FBC7e059355ce98a31693d299FACd963#contract",address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},{name:"zkSync Era Sepolia Testnet",chainId:300,url:"https://sepolia.explorer.zksync.io/address/0xF9cda624FBC7e059355ce98a31693d299FACd963#contract",address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},{name:"PlayFi Albireo Testnet",chainId:1612127,url:"https://albireo-explorer.playfi.ai/address/0xF9cda624FBC7e059355ce98a31693d299FACd963#contract",address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},{name:"Fraxtal Mainnet",chainId:252,url:"https://fraxscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Fraxtal Holesky Testnet",chainId:2522,url:"https://holesky.fraxscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Omax Mainnet",chainId:311,url:"https://omaxray.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Syndicate Frame Chain",chainId:5101,url:"https://explorer-frame.syndicate.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Dela Sepolia",chainId:9393,url:"https://sepolia-delascan.deperp.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"NeoX Testnet",chainId:12227330,url:"https://xt2scan.ngd.network/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Sanko Testnet",chainId:1992,url:"https://testnet.sankoscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Berachain Testnet (Artio)",chainId:80085,url:"https://artio.beratrail.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Shibarium",chainId:109,url:"https://www.shibariumscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Immutable zkEVM Mainnet",chainId:13371,url:"https://explorer.immutable.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Immutable zkEVM Testnet",chainId:13473,url:"https://explorer.testnet.immutable.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"RSS3 VSL Mainnet",chainId:12553,url:"https://scan.rss3.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"RSS3 VSL Sepolia Testnet",chainId:2331,url:"https://scan.testnet.rss3.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Morph Sepolia Testnet",chainId:2710,url:"https://explorer-testnet.morphl2.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"JIBCHAIN L1",chainId:8899,url:"https://exp-l1.jibchain.net/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Haqq Mainnet",chainId:11235,url:"https://explorer.haqq.network/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Zircuit Sepolia Testnet",chainId:48899,url:"https://explorer.zircuit.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?activeTab=3"},{name:"re.al",chainId:111188,url:"https://explorer.re.al/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Merlin Testnet",chainId:686868,url:"https://testnet-scan.merlinchain.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"IOTA EVM",chainId:8822,url:"https://iota-evm.blockscout.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Planq",chainId:7070,url:"https://evm.planq.network/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Cyber Testnet",chainId:111557560,url:"https://testnet.cyberscan.co/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Unit Zero Stagenet",chainId:88819,url:"https://explorer-stagenet.unit0.dev/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Unit Zero Testnet",chainId:88817,url:"https://explorer-testnet.unit0.dev/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Sei EVM Devnet",chainId:713715,url:"https://seitrace.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Sei EVM Mainnet",chainId:1329,url:"https://seitrace.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?chain=pacific-1&tab=contract"},{name:"Hekla (Taiko A7 Testnet)",chainId:167009,url:"https://explorer.hekla.taiko.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Taiko Mainnet",chainId:167e3,url:"https://taikoscan.io/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Cyber Mainnet",chainId:7560,url:"https://cyberscan.co/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"DreyerX Mainnet",chainId:23451,url:"https://scan.dreyerx.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Sahara Testnet",chainId:313313,url:"https://explorer.saharaa.info/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"BOX Chain",chainId:42299,url:"https://explorerl2new-boxchain-t4zoh9y5dr.t.conduit.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"OX Chain",chainId:6699,url:"https://explorer-ox-chain-2s86s7wp21.t.conduit.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Conflux Espace",chainId:1030,url:"https://evm.confluxscan.net/address/0xca11bde05977b3631167028862be2a173976ca11?tab=contract-viewer"},{name:"BEVM Testnet",chainId:11503,url:"https://scan-testnet.bevm.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Aura Mainnet",chainId:6322,url:"https://aurascan.io/evm-contracts/0xca11bde05977b3631167028862be2a173976ca11"},{name:"Superposition Testnet",chainId:98985,url:"https://testnet-explorer.superposition.so/address/0xcA11bde05977b3631167028862bE2a173976CA11"}],vbe=Object.fromEntries(ybe.map(e=>{let t=e.url.indexOf("0x"),n=t>-1?e.url.slice(t,t+42):"0x"+e.url.slice(-40);return[e.chainId.toString(),n]})),NW=new Ko(gbe);function IW(e){return NW.encodeFunctionData("aggregate",[e])}function OW(e){return NW.decodeFunctionResult("aggregate",e).toObject()}function RW(e){return vbe[e]}import("node:process").then(e=>e.stdout.write(""));var{process_binding_count:Sbe,process_binding_time:bbe,process_binding_error:Tbe}=tu;BigInt.prototype.toJSON=function(){return this.toString()};var PW=class{started=!1;unhandled;loader;shutdownHandler;enablePreprocess;preparedData;constructor(t,n){this.loader=t,this.shutdownHandler=n,this.enablePreprocess=process.env.ENABLE_PREPROCESS?process.env.ENABLE_PREPROCESS.toLowerCase()=="true":!1}async getConfig(t,n){if(!this.started)throw new kn.ServerError(kn.Status.UNAVAILABLE,"Service Not started.");let r=uE.fromPartial({});return await Sa.INSTANCE.configure(r),r}async start(t,n){if(this.started)return{};p6();try{await this.loader()}catch(r){throw new kn.ServerError(kn.Status.INVALID_ARGUMENT,"Failed to load processor: "+xm(r))}return await Sa.INSTANCE.start(t),this.started=!0,{}}async stop(t,n){return console.log("Server Shutting down in 5 seconds"),this.shutdownHandler&&setTimeout(this.shutdownHandler,5e3),{}}async processBindings(t,n){let r=this.enablePreprocess?await this.preprocessBindings(t.bindings,{},void 0,n):{ethCallResults:{}},i=[];for(let s of t.bindings){let u=this.processBinding(s,r);zd.execution.sequential&&await u,i.push(u)}let a;try{a=await Promise.all(i),tu.process_binding_count.add(t.bindings.length)}catch(s){throw tu.process_binding_error.add(t.bindings.length),s}return{result:Rw(a)}}async preprocessBindings(t,n,r,i){let a=[];for(let g of t)a.push(this.preprocessBinding(g,n,r,i));let o;try{o=await Promise.all(a)}catch(g){throw g}let s=new Map,u=new Map;for(let g of o)for(let p of g.ethCallParams){let{chainId:b,blockTag:v}=p.context;u.has(b)||u.set(b,G7(b));let C=[b,v].join("|");s.has(C)||s.set(C,[]),s.get(C).push(p)}let l=Date.now(),c=1,d=[],f=[];for(let g of s.values()){let{chainId:p,blockTag:b}=g[0].context,v=RW(p);if(g.length<=c||!v){for(let N of g)d.push(u.get(p).call({to:N.context.address,data:N.calldata,blockTag:b}).then(I=>[vE(N),I]));continue}let C=128;for(let N=0;N<g.length;N+=C){let I=g.slice(N,N+C),M=I.map(U=>({target:U.context.address,callData:U.calldata})),x=IW(M);f.push(u.get(p).call({to:v,data:x,blockTag:b}).then(U=>{let G=OW(U).returnData;if(G.length!=I.length)throw new Error(`multicall result length mismatch, params: ${I.length}, result: ${G.length}`);let le=[];for(let j=0;j<I.length;j++)le.push([vE(I[j]),G[j]]);return le}))}}let h={};try{h=Object.fromEntries(await Promise.all(d));for(let g of await Promise.all(f))h={...h,...Object.fromEntries(g)}}catch(g){console.error(`eth call error: ${g}`)}return{ethCallResults:h}}async preprocessBinding(t,n,r,i){if(!this.started)throw new kn.ServerError(kn.Status.UNAVAILABLE,"Service Not started.");if(this.unhandled)throw new mh.RichServerError(kn.Status.UNAVAILABLE,"Unhandled exception/rejection in previous request: "+xm(this.unhandled),[mh.DebugInfo.fromPartial({detail:this.unhandled.message,stackEntries:this.unhandled.stack?.split(`
26
- `)})]);return await Sa.INSTANCE.preprocessBinding(t,n,r)}async processBinding(t,n,r){if(!this.started)throw new kn.ServerError(kn.Status.UNAVAILABLE,"Service Not started.");if(this.unhandled)throw new mh.RichServerError(kn.Status.UNAVAILABLE,"Unhandled exception/rejection in previous request: "+xm(this.unhandled),[mh.DebugInfo.fromPartial({detail:this.unhandled.message,stackEntries:this.unhandled.stack?.split(`
27
- `)})]);let i=await Sa.INSTANCE.processBinding(t,n,Sa.INSTANCE.dbContextLocalStorage.getStore());return wW(i,t.handlerType),i}async*processBindingsStream(t,n){if(!this.started)throw new kn.ServerError(kn.Status.UNAVAILABLE,"Service Not started.");let r=new QI.Subject;this.handleRequests(t,r).then(()=>{this.preparedData&&(this.preparedData={ethCallResults:{}}),r.complete()}).catch(i=>{console.error(i),r.error(i)}),yield*kv(r).pipe(wN(n.signal))}async handlePreprocessRequests(t,n){let r=new BT,i={};for await(let a of t)try{if(a.bindings){let o=a.bindings.bindings,s=r.new(a.processId,n),u=Date.now();this.preprocessBindings(o,i,s,void 0).then(l=>{this.preparedData={ethCallResults:{...this.preparedData?.ethCallResults,...l.ethCallResults}},n.next({processId:a.processId})}).catch(l=>{console.debug(l),s.error(a.processId,l)}).finally(()=>{let l=Date.now()-u;console.debug("preprocessBinding",a.processId," took",l,"ms"),r.delete(a.processId)})}a.dbResult&&r.get(a.processId)?.result(a.dbResult)}catch(o){console.error("unexpect error during handle loop",o)}}async*preprocessBindingsStream(t,n){if(!this.started)throw new kn.ServerError(kn.Status.UNAVAILABLE,"Service Not started.");let r=new QI.Subject;this.handlePreprocessRequests(t,r).then(()=>{r.complete()}).catch(i=>{console.error(i),r.error(i)}),yield*kv(r).pipe(wN(n.signal))}async handleRequests(t,n){let r=new BT;for await(let i of t)try{if(i.binding){if(Sbe.add(1),i.binding.handlerType===de.UNKNOWN){n.next({processId:i.processId,result:Rs.create()});continue}let a=i.binding,o=r.new(i.processId,n),s=Date.now();Sa.INSTANCE.processBinding(a,this.preparedData,o).then(async u=>{await o.awaitPendings(),n.next({result:u,processId:i.processId}),wW(u,a.handlerType)}).catch(u=>{console.debug(u),o.error(i.processId,u),Tbe.add(1)}).finally(()=>{let u=Date.now()-s;bbe.add(u),r.delete(i.processId)})}if(i.dbResult){let a=r.get(i.processId);try{a?.result(i.dbResult)}catch{n.error(new Error("db result error, process should stop"))}}}catch(a){console.error("unexpect error during handle loop",a)}}};function wW(e,t){for(let n of[e.gauges,e.counters,e.events,e.exports])n.forEach(r=>{r.runtimeInfo={from:t}})}var BT=class{contexts=new Map;get(t){return this.contexts.get(t)}new(t,n){let r=new sy(n,t);return this.contexts.set(t,r),r}delete(t){this.get(t)?.close(),this.contexts.delete(t)}};import("node:process").then(e=>e.stdout.write(""));export{xe as a,re as b,m as c,gh as d,An as e,Bi as f,Nn as g,uE as h,YR as i,Sa as j,Dl as k,PTe as l,Rw as m,xm as n,BTe as o,vE as p,DTe as q,MTe as r,xs as s,wn as t,Px as u,Ao as v,No as w,Io as x,VL as y,h6 as z,zd as A,jt as B,w6 as C,Qd as D,x6 as E,D6 as F,Q0 as G,Kd as H,Y0 as I,B1 as J,D1 as K,Zd as L,yp as M,iy as N,ay as O,oy as P,V1 as Q,J1 as R,vp as S,Q1 as T,Z1 as U,yee as V,CF as W,kF as X,_F as Y,tu as Z,AF as _,wF as $,sy as aa,rm as ba,DPe as ca,G7 as da,kN as ea,PW as fa};
28
- /*! Bundled license information:
29
-
30
- @grpc/proto-loader/build/src/util.js:
31
- (**
32
- * @license
33
- * Copyright 2018 gRPC authors.
34
- *
35
- * Licensed under the Apache License, Version 2.0 (the "License");
36
- * you may not use this file except in compliance with the License.
37
- * You may obtain a copy of the License at
38
- *
39
- * http://www.apache.org/licenses/LICENSE-2.0
40
- *
41
- * Unless required by applicable law or agreed to in writing, software
42
- * distributed under the License is distributed on an "AS IS" BASIS,
43
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44
- * See the License for the specific language governing permissions and
45
- * limitations under the License.
46
- *
47
- *)
48
-
49
- long/umd/index.js:
50
- (**
51
- * @license
52
- * Copyright 2009 The Closure Library Authors
53
- * Copyright 2020 Daniel Wirtz / The long.js Authors.
54
- *
55
- * Licensed under the Apache License, Version 2.0 (the "License");
56
- * you may not use this file except in compliance with the License.
57
- * You may obtain a copy of the License at
58
- *
59
- * http://www.apache.org/licenses/LICENSE-2.0
60
- *
61
- * Unless required by applicable law or agreed to in writing, software
62
- * distributed under the License is distributed on an "AS IS" BASIS,
63
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
64
- * See the License for the specific language governing permissions and
65
- * limitations under the License.
66
- *
67
- * SPDX-License-Identifier: Apache-2.0
68
- *)
69
-
70
- @grpc/proto-loader/build/src/index.js:
71
- (**
72
- * @license
73
- * Copyright 2018 gRPC authors.
74
- *
75
- * Licensed under the Apache License, Version 2.0 (the "License");
76
- * you may not use this file except in compliance with the License.
77
- * You may obtain a copy of the License at
78
- *
79
- * http://www.apache.org/licenses/LICENSE-2.0
80
- *
81
- * Unless required by applicable law or agreed to in writing, software
82
- * distributed under the License is distributed on an "AS IS" BASIS,
83
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
84
- * See the License for the specific language governing permissions and
85
- * limitations under the License.
86
- *
87
- *)
88
-
89
- long/index.js:
90
- (**
91
- * @license
92
- * Copyright 2009 The Closure Library Authors
93
- * Copyright 2020 Daniel Wirtz / The long.js Authors.
94
- *
95
- * Licensed under the Apache License, Version 2.0 (the "License");
96
- * you may not use this file except in compliance with the License.
97
- * You may obtain a copy of the License at
98
- *
99
- * http://www.apache.org/licenses/LICENSE-2.0
100
- *
101
- * Unless required by applicable law or agreed to in writing, software
102
- * distributed under the License is distributed on an "AS IS" BASIS,
103
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104
- * See the License for the specific language governing permissions and
105
- * limitations under the License.
106
- *
107
- * SPDX-License-Identifier: Apache-2.0
108
- *)
109
-
110
- @noble/hashes/esm/utils.js:
111
- (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
112
-
113
- @noble/curves/esm/abstract/utils.js:
114
- (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
115
-
116
- @noble/curves/esm/abstract/modular.js:
117
- (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
118
-
119
- @noble/curves/esm/abstract/curve.js:
120
- (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
121
-
122
- @noble/curves/esm/abstract/weierstrass.js:
123
- (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
124
-
125
- @noble/curves/esm/_shortw_utils.js:
126
- (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
127
-
128
- @noble/curves/esm/secp256k1.js:
129
- (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
130
- */
131
- //# sourceMappingURL=chunk-VDRKULG2.js.map