koilib 2.4.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/koinos.js +42 -22
- package/dist/koinos.min.js +1 -1
- package/lib/Provider.d.ts +6 -4
- package/lib/Provider.js +42 -22
- package/lib/Provider.js.map +1 -1
- package/lib/interface.d.ts +19 -1
- package/package.json +1 -1
package/dist/koinos.js
CHANGED
|
@@ -11837,7 +11837,7 @@ class Provider {
|
|
|
11837
11837
|
* Function to call "chain.submit_transaction" to send a signed
|
|
11838
11838
|
* transaction to the blockchain. It returns an object with the async
|
|
11839
11839
|
* function "wait", which can be called to wait for the
|
|
11840
|
-
* transaction to be mined.
|
|
11840
|
+
* transaction to be mined (see [[SendTransactionResponse]]).
|
|
11841
11841
|
* @param transaction - Signed transaction
|
|
11842
11842
|
* @example
|
|
11843
11843
|
* ```ts
|
|
@@ -11848,19 +11848,19 @@ class Provider {
|
|
|
11848
11848
|
* });
|
|
11849
11849
|
* console.log("Transaction submitted to the mempool");
|
|
11850
11850
|
* // wait to be mined
|
|
11851
|
-
* const
|
|
11851
|
+
* const blockNumber = await transactionResponse.wait();
|
|
11852
|
+
* // const blockNumber = await transactionResponse.wait("byBlock", 30000);
|
|
11853
|
+
* // const blockId = await transactionResponse.wait("byTransactionId", 30000);
|
|
11852
11854
|
* console.log("Transaction mined")
|
|
11853
11855
|
* ```
|
|
11854
11856
|
*/
|
|
11855
11857
|
async sendTransaction(transaction) {
|
|
11856
11858
|
await this.call("chain.submit_transaction", { transaction });
|
|
11857
|
-
const startTime = Date.now() + 10000;
|
|
11858
11859
|
return {
|
|
11859
|
-
wait: async (type = "
|
|
11860
|
-
|
|
11861
|
-
await sleep(startTime - Date.now() - 1000);
|
|
11860
|
+
wait: async (type = "byBlock", timeout = 30000) => {
|
|
11861
|
+
const iniTime = Date.now();
|
|
11862
11862
|
if (type === "byTransactionId") {
|
|
11863
|
-
|
|
11863
|
+
while (Date.now() < iniTime + timeout) {
|
|
11864
11864
|
await sleep(1000);
|
|
11865
11865
|
const { transactions } = await this.getTransactionsById([
|
|
11866
11866
|
transaction.id,
|
|
@@ -11870,34 +11870,54 @@ class Provider {
|
|
|
11870
11870
|
transactions[0].containing_blocks)
|
|
11871
11871
|
return transactions[0].containing_blocks[0];
|
|
11872
11872
|
}
|
|
11873
|
-
throw new Error(`Transaction not mined after
|
|
11873
|
+
throw new Error(`Transaction not mined after ${timeout} ms`);
|
|
11874
11874
|
}
|
|
11875
11875
|
// byBlock
|
|
11876
|
+
const findTxInBlocks = async (ini, numBlocks, idRef) => {
|
|
11877
|
+
const blocks = await this.getBlocks(ini, numBlocks, idRef);
|
|
11878
|
+
let bNum = 0;
|
|
11879
|
+
blocks.forEach((block) => {
|
|
11880
|
+
if (!block ||
|
|
11881
|
+
!block.block ||
|
|
11882
|
+
!block.block_id ||
|
|
11883
|
+
!block.block.transactions)
|
|
11884
|
+
return;
|
|
11885
|
+
const tx = block.block.transactions.find((t) => t.id === transaction.id);
|
|
11886
|
+
if (tx)
|
|
11887
|
+
bNum = Number(block.block_height);
|
|
11888
|
+
});
|
|
11889
|
+
let lastId = blocks[blocks.length - 1].block_id;
|
|
11890
|
+
return [bNum, lastId];
|
|
11891
|
+
};
|
|
11876
11892
|
let blockNumber = 0;
|
|
11877
11893
|
let iniBlock = 0;
|
|
11878
|
-
|
|
11894
|
+
let previousId = "";
|
|
11895
|
+
while (Date.now() < iniTime + timeout) {
|
|
11879
11896
|
await sleep(1000);
|
|
11880
11897
|
const { head_topology: headTopology } = await this.getHeadInfo();
|
|
11881
|
-
if (
|
|
11898
|
+
if (blockNumber === 0) {
|
|
11882
11899
|
blockNumber = Number(headTopology.height);
|
|
11883
11900
|
iniBlock = blockNumber;
|
|
11884
11901
|
}
|
|
11885
|
-
|
|
11886
|
-
|
|
11902
|
+
if (Number(headTopology.height) === blockNumber - 1 &&
|
|
11903
|
+
previousId &&
|
|
11904
|
+
previousId !== headTopology.id) {
|
|
11905
|
+
const [bNum, lastId] = await findTxInBlocks(iniBlock, Number(headTopology.height) - iniBlock + 1, headTopology.id);
|
|
11906
|
+
if (bNum)
|
|
11907
|
+
return bNum;
|
|
11908
|
+
previousId = lastId;
|
|
11909
|
+
blockNumber = Number(headTopology.height) + 1;
|
|
11887
11910
|
}
|
|
11888
11911
|
if (blockNumber > Number(headTopology.height))
|
|
11889
11912
|
continue;
|
|
11890
|
-
const [
|
|
11891
|
-
if (
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
|
|
11896
|
-
const tx = block.block.transactions.find((t) => t.id === transaction.id);
|
|
11897
|
-
if (tx)
|
|
11898
|
-
return blockNumber.toString();
|
|
11913
|
+
const [bNum, lastId] = await findTxInBlocks(blockNumber, 1, headTopology.id);
|
|
11914
|
+
if (bNum)
|
|
11915
|
+
return bNum;
|
|
11916
|
+
if (!previousId)
|
|
11917
|
+
previousId = lastId;
|
|
11918
|
+
blockNumber += 1;
|
|
11899
11919
|
}
|
|
11900
|
-
throw new Error(`Transaction not mined from
|
|
11920
|
+
throw new Error(`Transaction not mined after ${timeout} ms. Blocks checked from ${iniBlock} to ${blockNumber}`);
|
|
11901
11921
|
},
|
|
11902
11922
|
};
|
|
11903
11923
|
}
|
package/dist/koinos.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see koinos.min.js.LICENSE.txt */
|
|
2
|
-
(()=>{var __webpack_modules__={8820:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var s=e.length,a=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var r=0;if(" "!==e[r]){for(var n=0,i=0;e[r]===a;)n++,r++;for(var o=(e.length-r)*c+1>>>0,u=new Uint8Array(o);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var l=0,p=o-1;(0!==f||l<i)&&-1!==p;p--,l++)f+=s*u[p]>>>0,u[p]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");i=l,r++}if(" "!==e[r]){for(var h=o-i;h!==o&&0===u[h];)h++;for(var d=new Uint8Array(n+(o-h)),y=n;h!==o;)d[y++]=u[h++];return d}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var c=(o-i)*u+1>>>0,f=new Uint8Array(c);i!==o;){for(var l=t[i],p=0,h=c-1;(0!==l||p<n)&&-1!==h;h--,p++)l+=256*f[h]>>>0,f[h]=l%s>>>0,l=l/s>>>0;if(0!==l)throw new Error("Non-zero carry");n=p,i++}for(var d=c-n;d!==c&&0===f[d];)d++;for(var y=a.repeat(r);d<c;++d)y+=e.charAt(f[d]);return y},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},6365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(8359);class i extends n.Hash{constructor(e,t,r,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,n.createView)(this.buffer)}update(e){if(this.destroyed)throw new Error("instance is destroyed");const{view:t,buffer:r,blockLen:i,finished:o}=this;if(o)throw new Error("digest() was already called");const s=(e=(0,n.toBytes)(e)).length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a!==i)r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(t,0),this.pos=0);else{const t=(0,n.createView)(e);for(;i<=s-o;o+=i)this.process(t,o)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length<this.outputLen)throw new Error("_Sha2: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:o}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(r,0),s=0);for(let e=s;e<i;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}(r,i-8,BigInt(8*this.length),o),this.process(r,0);const a=(0,n.createView)(e);this.get().forEach(((e,t)=>a.setUint32(4*t,e,o)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}t.SHA2=i},901:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0}},7050:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const n=r(6365),i=r(8359),o=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),s=Uint8Array.from({length:16},((e,t)=>t)),a=s.map((e=>(9*e+5)%16));let c=[s],u=[a];for(let e=0;e<4;e++)for(let t of[c,u])t.push(t[e].map((e=>o[e])));const f=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),l=c.map(((e,t)=>e.map((e=>f[t][e])))),p=u.map(((e,t)=>e.map((e=>f[t][e])))),h=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),d=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),y=(e,t)=>e<<t|e>>>32-t;function m(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const v=new Uint32Array(16);class g extends n.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)v[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,i=0|this.h1,o=i,s=0|this.h2,a=s,f=0|this.h3,g=f,b=0|this.h4,w=b;for(let e=0;e<5;e++){const t=4-e,_=h[e],A=d[e],O=c[e],x=u[e],E=l[e],S=p[e];for(let t=0;t<16;t++){const n=y(r+m(e,i,s,f)+v[O[t]]+_,E[t])+b|0;r=b,b=f,f=0|y(s,10),s=i,i=n}for(let e=0;e<16;e++){const r=y(n+m(t,o,a,g)+v[x[e]]+A,S[e])+w|0;n=w,w=g,g=0|y(a,10),a=o,o=r}}this.set(this.h1+s+g|0,this.h2+f+w|0,this.h3+b+n|0,this.h4+r+o|0,this.h0+i+a|0)}roundClean(){v.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=g,t.ripemd160=(0,i.wrapConstructor)((()=>new g))},5374:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const n=r(6365),i=r(8359),o=(e,t,r)=>e&t^e&r^t&r,s=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]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class u extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],r=c[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;c[e]=o+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:a,D:u,E:f,F:l,G:p,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,i.rotr)(f,6)^(0,i.rotr)(f,11)^(0,i.rotr)(f,25))+((d=f)&l^~d&p)+s[e]+c[e]|0,y=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+o(r,n,a)|0;h=p,p=l,l=f,f=u+t|0,u=a,a=n,n=r,r=t+y|0}var d;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,u=u+this.D|0,f=f+this.E|0,l=l+this.F|0,p=p+this.G|0,h=h+this.H|0,this.set(r,n,a,u,f,l,p,h)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.sha256=(0,i.wrapConstructor)((()=>new u))},8359:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.assertHash=t.assertBool=t.assertNumber=t.toBytes=t.asyncLoop=t.nextTick=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(901);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function o(e){if("string"==typeof e&&(e=(new TextEncoder).encode(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}function s(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}t.bytesToHex=function(e){let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},t.nextTick=(()=>{const t="function"==typeof e.require&&e.require.bind(e);try{if(t){const{setImmediate:e}=t("timers");return()=>new Promise((t=>e(t)))}}catch(e){}return()=>new Promise((e=>setTimeout(e,0)))})(),t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.toBytes=o,t.assertNumber=s,t.assertBool=function(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},t.assertHash=function(e){if("function"!=typeof e||"function"!=typeof e.init)throw new Error("Hash should be wrapped by utils.wrapConstructor");s(e.outputLen),s(e.blockLen)},t.Hash=class{clone(){return this._cloneInto()}},t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new TypeError("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(o(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.init=t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(o(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.init=t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto.web)return n.crypto.web.getRandomValues(new Uint8Array(e));if(n.crypto.node)return new Uint8Array(n.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},1337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.schnorr=t.verify=t.signSync=t.sign=t.getSharedSecret=t.recoverPublicKey=t.getPublicKey=t.SignResult=t.Signature=t.Point=t.CURVE=void 0;const n={a:0n,b:7n,P:2n**256n-2n**32n-977n,n:2n**256n-432420386565659656852420866394968145599n,h:1n,Gx:55066263022277343669578718895168534326250603453777594175500187360389116729240n,Gy:32670510020758816978083085130507043184471273380659243275938904335757337482424n,beta:0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501een};function i(e){const{a:t,b:r}=n;return A(e**3n+t*e+r)}t.CURVE=n;const o=0n===n.a;class s{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof c))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new s(e.x,e.y,1n)}static toAffineBatch(e){const t=function(e,t=n.P){const r=e.length,i=new Array(r);let o=1n;for(let n=0;n<r;n++)0n!==e[n]&&(i[n]=o,o=A(o*e[n],t));o=x(o,t);for(let n=r-1;n>=0;n--){if(0n===e[n])continue;const r=A(o*e[n],t);e[n]=A(o*i[n],t),o=r}return e}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return s.toAffineBatch(e).map(s.fromAffine)}equals(e){const t=this,r=e,n=A(t.z*t.z),i=A(t.z*n),o=A(r.z*r.z),s=A(r.z*o);return A(t.x*o)===A(n*r.x)&&A(t.y*s)===A(i*r.y)}negate(){return new s(this.x,A(-this.y),this.z)}double(){const e=this.x,t=this.y,r=this.z,n=A(e**2n),i=A(t**2n),o=A(i**2n),a=A(2n*(A(A((e+i)**2n))-n-o)),c=A(3n*n),u=A(c**2n),f=A(u-2n*a),l=A(c*(a-f)-8n*o),p=A(2n*t*r);return new s(f,l,p)}add(e){if(!(e instanceof s))throw new TypeError("JacobianPoint#add: expected JacobianPoint");const t=this.x,r=this.y,n=this.z,i=e.x,o=e.y,a=e.z;if(0n===i||0n===o)return this;if(0n===t||0n===r)return e;const c=A(n**2n),u=A(a**2n),f=A(t*u),l=A(i*c),p=A(r*a*u),h=A(A(o*n)*c),d=A(l-f),y=A(h-p);if(0n===d)return 0n===y?this.double():s.ZERO;const m=A(d**2n),v=A(d*m),g=A(f*m),b=A(y**2n-v-2n*g),w=A(y*(g-b)-p*v),_=A(n*a*d);return new s(b,w,_)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){if(!_(e))throw new TypeError("Point#multiply: expected valid scalar");let t=A(BigInt(e),n.n);if(!o){let e=s.ZERO,r=this;for(;t>0n;)1n&t&&(e=e.add(r)),r=r.double(),t>>=1n;return e}let[r,i,a,c]=k(t),u=s.ZERO,f=s.ZERO,l=this;for(;i>0n||c>0n;)1n&i&&(u=u.add(l)),1n&c&&(f=f.add(l)),l=l.double(),i>>=1n,c>>=1n;return r&&(u=u.negate()),a&&(f=f.negate()),f=new s(A(f.x*n.beta),f.y,f.z),u.add(f)}precomputeWindow(e){const t=o?128/e+1:256/e+1;let r=[],n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(s.BASE)&&(t=c.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&a.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=s.normalizeZ(n),a.set(t,n)));let i=s.ZERO,u=s.ZERO;const f=o?128/r+1:256/r+1,l=2**(r-1),p=BigInt(2**r-1),h=2**r,d=BigInt(r);for(let t=0;t<f;t++){const r=t*l;let o=Number(e&p);if(e>>=d,o>l&&(o-=h,e+=1n),0===o)u=u.add(t%2?n[r].negate():n[r]);else{const e=n[r+Math.abs(o)-1];i=i.add(o<0?e.negate():e)}}return[i,u]}multiply(e,t){if(!_(e))throw new TypeError("Point#multiply: expected valid scalar");let r,i,a=A(BigInt(e),n.n);if(o){const[e,o,c,u]=k(a);let f,l,p,h;[f,p]=this.wNAF(o,t),[l,h]=this.wNAF(u,t),e&&(f=f.negate()),c&&(l=l.negate()),l=new s(A(l.x*n.beta),l.y,l.z),[r,i]=[f.add(l),p.add(h)]}else[r,i]=this.wNAF(a,t);return s.normalizeZ([r,i])[0]}toAffine(e=x(this.z)){const t=e**2n,r=A(this.x*t),n=A(this.y*t*e);return new c(r,n)}}s.BASE=new s(n.Gx,n.Gy,1n),s.ZERO=new s(0n,1n,0n);const a=new WeakMap;class c{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,a.delete(this)}static fromCompressedHex(e){const t=32===e.length,r=b(t?e:e.slice(1));let o=function(e){const{P:t}=n,r=e*e*e%t,i=r*r*e%t,o=O(i,3n)*i%t,s=O(o,3n)*i%t,a=O(s,2n)*r%t,c=O(a,11n)*a%t,u=O(c,22n)*c%t,f=O(u,44n)*u%t,l=O(f,88n)*f%t,p=O(l,44n)*u%t,h=O(p,3n)*i%t,d=O(h,23n)*c%t,y=O(d,6n)*r%t;return O(y,2n)}(i(r));const s=1n===(1n&o);t?s&&(o=A(-o)):1==(1&e[0])!==s&&(o=A(-o));const a=new c(r,o);return a.assertValidity(),a}static fromUncompressedHex(e){const t=b(e.slice(1,33)),r=b(e.slice(33)),n=new c(t,r);return n.assertValidity(),n}static fromHex(e){const t=g(e),r=t[0];if(32===t.length||33===t.length&&(2===r||3===r))return this.fromCompressedHex(t);if(65===t.length&&4===r)return this.fromUncompressedHex(t);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${t.length}`)}static fromPrivateKey(e){return c.BASE.multiply(N(e))}static fromSignature(e,t,r){let i=e instanceof Uint8Array?b(e):m(e);const o=P(t),{r:a,s:u}=o;if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid yParity bit");const f=2+(1&r),l=c.fromHex(`0${f}${h(a)}`),p=s.fromAffine(l).multiplyUnsafe(u),d=s.BASE.multiply(i),y=x(a,n.n),v=p.subtract(d).multiplyUnsafe(y).toAffine();return v.assertValidity(),v}toRawBytes(e=!1){return v(this.toHex(e))}toHex(e=!1){const t=h(this.x);return e?`${1n&this.y?"03":"02"}${t}`:`04${t}${h(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{P:t}=n,{x:r,y:o}=this;if(0n===r||0n===o||r>=t||o>=t)throw new Error(e);if((A(o*o)-i(r))%t!==0n)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new c(this.x,A(-this.y))}double(){return s.fromAffine(this).double().toAffine()}add(e){return s.fromAffine(this).add(s.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return s.fromAffine(this).multiply(e,this).toAffine()}}function u(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}t.Point=c,c.BASE=new c(n.Gx,n.Gy),c.ZERO=new c(0n,0n);class f{constructor(e,t){this.r=e,this.s=t}static fromCompact(e){if("string"!=typeof e&&!(e instanceof Uint8Array))throw new TypeError("Signature.fromCompact: Expected string or Uint8Array");const t=e instanceof Uint8Array?p(e):e;if(128!==t.length)throw new Error("Signature.fromCompact: Expected 64-byte hex");const r=new f(m(t.slice(0,64)),m(t.slice(64,128)));return r.assertValidity(),r}static fromDER(e){const t="Signature.fromDER";if("string"!=typeof e&&!(e instanceof Uint8Array))throw new TypeError(`${t}: Expected string or Uint8Array`);const r=e instanceof Uint8Array?p(e):e,n=w(r.slice(2,4));if("30"!==r.slice(0,2)||n!==r.length-4||"02"!==r.slice(4,6))throw new Error(`${t}: Invalid signature ${r}`);const i=w(r.slice(6,8)),o=8+i,s=r.slice(8,o);if(s.startsWith("00")&&w(s.slice(2,4))<=127)throw new Error(`${t}: Invalid r with trailing length`);const a=m(s);if("02"!==r.slice(o,o+2))throw new Error(`${t}: Invalid r-s separator`);const c=w(r.slice(o+2,o+4)),u=n-c-i-10;if(u>0||-4===u)throw new Error(`${t}: Invalid total length`);if(c>n-i-4)throw new Error(`${t}: Invalid s`);const l=o+4,h=r.slice(l,l+c);if(h.startsWith("00")&&w(h.slice(2,4))<=127)throw new Error(`${t}: Invalid s with trailing length`);const d=m(h),y=new f(a,d);return y.assertValidity(),y}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!T(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!T(t))throw new Error("Invalid Signature: s must be 0 < s < n")}toDERRawBytes(e=!1){return v(this.toDERHex(e))}toDERHex(e=!1){const t=u(y(this.s));if(e)return t;const r=u(y(this.r)),n=y(r.length/2),i=y(t.length/2);return`30${y(r.length/2+t.length/2+4)}02${n}${r}02${i}${t}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return v(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}function l(...e){if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}function p(e){let t="";for(let r=0;r<e.length;r++)t+=e[r].toString(16).padStart(2,"0");return t}function h(e){return e.toString(16).padStart(64,"0")}function d(e){return v(h(e))}function y(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function m(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt(`0x${e}`)}function v(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r;t[r]=Number.parseInt(e.slice(n,n+2),16)}return t}function g(e){return e instanceof Uint8Array?e:v(e)}function b(e){return m(p(e))}function w(e){return 2*Number.parseInt(e,16)}function _(e){return"bigint"==typeof e&&e>0n||!!("number"==typeof e&&e>0&&Number.isSafeInteger(e))}function A(e,t=n.P){const r=e%t;return r>=0?r:t+r}function O(e,t){const{P:r}=n;let i=e;for(;t-- >0n;)i*=i,i%=r;return i}function x(e,t=n.P){if(0n===e||t<=0n)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=A(e,t),i=t,[o,s,a,c]=[0n,1n,1n,0n];for(;0n!==r;){const e=i/r,t=i%r,n=o-a*e,u=s-c*e;[i,r]=[r,t],[o,s]=[a,c],[a,c]=[n,u]}if(1n!==i)throw new Error("invert: does not exist");return A(o,t)}t.Signature=f,t.SignResult=f;const E=(e,t)=>(e+t/2n)/t,S=2n**128n;function k(e){const{n:t}=n,r=0x3086d221a7d46bcde86c90e49284eb15n,i=-0xe4437ed6010e88286f547fa90abfe4c3n,o=r,s=E(o*e,t),a=E(-i*e,t);let c=A(e-s*r-0x114ca50f7a8e2f3f657c1108d9d44cfd8n*a,t),u=A(-s*i-a*o,t);const f=c>S,l=u>S;if(f&&(c=t-c),l&&(u=t-u),c>S||u>S)throw new Error("splitScalarEndo: Endomorphism failed");return[f,c,l,u]}function j(e,t){if(null==e)throw new Error(`sign: expected valid msgHash, not "${e}"`);const r=d("string"==typeof e?m(e):b(e));return[r,b(r),d(t),new Uint8Array(32).fill(1),new Uint8Array(32).fill(0),Uint8Array.from([0]),Uint8Array.from([1])]}function T(e){return 0<e&&e<n.n}function B(e,t,r){const i=b(e);if(!T(i))return;const o=n.n,s=c.BASE.multiply(i),a=A(s.x,o),u=A(x(i,o)*(t+a*r),o);return 0n!==a&&0n!==u?[s,a,u]:void 0}function N(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=m(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=b(e)}if(!T(t))throw new Error("Expected private key: 0 < key < n");return t}function R(e){return e instanceof c?(e.assertValidity(),e):c.fromHex(e)}function P(e){return e instanceof f?(e.assertValidity(),e):f.fromDER(e)}function I(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?33===n||65===n:r?66===n||130===n:e instanceof c}function U(e,t,r=!1){const[i,o,s]=e;let{canonical:a,der:c,recovered:u}=t,l=(i.x===o?0:2)|Number(1n&i.y),p=s;s>n.n>>1n&&a&&(p=n.n-s,l^=1);const h=new f(o,p);h.assertValidity();const d=!1===c?h.toCompactHex():h.toDERHex(),y=r?d:v(d);return u?[y,l]:y}async function C(e,...r){const n=new Uint8Array(e.split("").map((e=>e.charCodeAt(0)))),i=await t.utils.sha256(n);return b(await t.utils.sha256(l(i,i,...r)))}async function D(e,t,r){const i=d(e);return A(await C("BIP0340/challenge",i,t.toRawX(),r),n.n)}function L(e){return 0n===A(e.y,2n)}t.getPublicKey=function(e,t=!1){const r=c.fromPrivateKey(e);return"string"==typeof e?r.toHex(t):r.toRawBytes(t)},t.recoverPublicKey=function(e,t,r){const n=c.fromSignature(e,t,r);return"string"==typeof e?n.toHex():n.toRawBytes()},t.getSharedSecret=function(e,t,r=!1){if(I(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!I(t))throw new TypeError("getSharedSecret: second arg must be public key");const n=R(t);n.assertValidity();const i=n.multiply(N(e));return"string"==typeof e?i.toHex(r):i.toRawBytes(r)},t.sign=async function(e,r,n={}){return U(await async function(e,r){const n=N(r);let[i,o,s,a,c,u,f]=j(e,n);const l=t.utils.hmacSha256;c=await l(c,a,u,s,i),a=await l(c,a),c=await l(c,a,f,s,i),a=await l(c,a);for(let e=0;e<1e3;e++){a=await l(c,a);let e=B(a,o,n);if(e)return e;c=await l(c,a,u),a=await l(c,a)}throw new TypeError("secp256k1: Tried 1,000 k values for sign(), all were invalid")}(e,r),n,"string"==typeof e)},t.signSync=function(e,r,n={}){return U(function(e,r){const n=N(r);let[i,o,s,a,c,u,f]=j(e,n);const l=t.utils.hmacSha256Sync;if(!l)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");if(c=l(c,a,u,s,i),c instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");a=l(c,a),c=l(c,a,f,s,i),a=l(c,a);for(let e=0;e<1e3;e++){a=l(c,a);let e=B(a,o,n);if(e)return e;c=l(c,a,u),a=l(c,a)}throw new TypeError("secp256k1: Tried 1,000 k values for sign(), all were invalid")}(e,r),n,"string"==typeof e)},t.verify=function(e,t,r){const{n:i}=n;let o;try{o=P(e)}catch(e){return!1}const{r:a,s:c}=o,u=function(e){"string"!=typeof e&&(e=p(e));let t=m(e||"0");const r=e.length/2*8-256;return r>0&&(t>>=BigInt(r)),t>=n.n&&(t-=n.n),t}(t);if(0n===u)return!1;const f=s.fromAffine(R(r)),l=x(c,i),h=A(u*l,i),d=A(a*l,i),y=s.BASE.multiply(h),v=f.multiplyUnsafe(d);return A(y.add(v).toAffine().x,i)===a};class ${constructor(e,t){if(this.r=e,this.s=t,e<=0n||t<=0n||e>=n.P||t>=n.n)throw new Error("Invalid signature")}static fromHex(e){const t=g(e);if(64!==t.length)throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${t.length}`);const r=b(t.slice(0,32)),n=b(t.slice(32));return new $(r,n)}toHex(){return h(this.r)+h(this.s)}toRawBytes(){return v(this.toHex())}}async function z(e,t,r){const n=e instanceof $?e:$.fromHex(e),i="string"==typeof t?v(t):t,o=R(r),s=await D(n.r,o,i),a=c.fromPrivateKey(n.s),u=o.multiply(s),f=a.subtract(u);return!(f.equals(c.BASE)||!L(f)||f.x!==n.r)}t.schnorr={Signature:$,getPublicKey:function(e){const t=c.fromPrivateKey(e);return"string"==typeof e?t.toHexX():t.toRawX()},sign:async function(e,r,i=t.utils.randomBytes()){if(null==e)throw new TypeError(`sign: Expected valid message, not "${e}"`);r||(r=0n);const{n:o}=n,s=g(e),a=N(r),u=g(i);if(32!==u.length)throw new TypeError("sign: Expected 32 bytes of aux randomness");const f=c.fromPrivateKey(a),l=L(f)?a:o-a,p=l^await C("BIP0340/aux",u),h=A(await C("BIP0340/nonce",d(p),f.toRawX(),s),o);if(0n===h)throw new Error("sign: Creation of signature failed. k is zero");const y=c.fromPrivateKey(h),m=L(y)?h:o-h,v=await D(y.x,f,s),b=new $(y.x,A(m+v*l,o));if(!await z(b.toRawBytes(),s,f.toRawX()))throw new Error("sign: Invalid signature produced");return"string"==typeof e?b.toHex():b.toRawBytes()},verify:z},c.BASE._setWindowSize(8);const H=(()=>{const e="object"==typeof self&&"crypto"in self?self.crypto:void 0;return{node:e?void 0:r(5102),web:e}})();t.utils={isValidPrivateKey(e){try{return N(e),!0}catch(e){return!1}},randomBytes:(e=32)=>{if(H.web)return H.web.getRandomValues(new Uint8Array(e));if(H.node){const{randomBytes:t}=H.node;return new Uint8Array(t(e).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>{let e=8;for(;e--;){const e=t.utils.randomBytes(32),r=b(e);if(T(r)&&1n!==r)return e}throw new Error("Valid private key was not found in 8 iterations. PRNG is broken")},sha256:async e=>{if(H.web){const t=await H.web.subtle.digest("SHA-256",e.buffer);return new Uint8Array(t)}if(H.node){const{createHash:t}=H.node;return Uint8Array.from(t("sha256").update(e).digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(H.web){const r=await H.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=l(...t),i=await H.web.subtle.sign("HMAC",r,n);return new Uint8Array(i)}if(H.node){const{createHmac:r}=H.node,n=r("sha256",e);for(let e of t)n.update(e);return Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,precompute(e=8,t=c.BASE){const r=t===c.BASE?t:new c(t.x,t.y);return r._setWindowSize(e),r.multiply(3n),r}}},4537:e=>{"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)r[n++]=arguments[i++];return new Promise((function(i,s){r[n]=function(e){if(o)if(o=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(e){o&&(o=!1,s(e))}}))}},7419:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),i=new Array(123),o=0;o<64;)i[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(e,t,r){for(var i,o=null,s=[],a=0,c=0;t<r;){var u=e[t++];switch(c){case 0:s[a++]=n[u>>2],i=(3&u)<<4,c=1;break;case 1:s[a++]=n[i|u>>4],i=(15&u)<<2,c=2;break;case 2:s[a++]=n[i|u>>6],s[a++]=n[63&u],c=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return c&&(s[a++]=n[i],s[a++]=61,1===c&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";r.decode=function(e,t,r){for(var n,o=r,a=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&a>1)break;if(void 0===(u=i[u]))throw Error(s);switch(a){case 0:n=u,a=1;break;case 1:t[r++]=n<<2|(48&u)>>4,n=u,a=2;break;case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,a=3;break;case 3:t[r++]=(3&n)<<6|u,a=0}}if(1===a)throw Error(s);return r-o},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},5124:e=>{"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var n=[];function i(e){if("string"!=typeof e){var r=o();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var s=Object.keys(e),a=new Array(s.length+1),c=new Array(s.length),u=0;u<s.length;)a[u]=s[u],c[u]=e[s[u++]];return a[u]=r,Function.apply(null,a).apply(null,c)}return Function(r)()}for(var f=new Array(arguments.length-1),l=0;l<f.length;)f[l]=arguments[++l];if(l=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=f[l++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),l!==f.length)throw Error("parameter count mismatch");return n.push(e),i}function o(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return i.toString=o,i}e.exports=t,t.verbose=!1},9211:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},9054:(e,t,r)=>{"use strict";e.exports=o;var n=r(4537),i=r(7199)("fs");function o(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&i&&i.readFile?i.readFile(e,(function(n,i){return n&&"undefined"!=typeof XMLHttpRequest?o.xhr(e,t,r):n?r(n):r(null,t.binary?i:i.toString("utf8"))})):o.xhr(e,t,r):n(o,this,e,t)}o.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var i=0;i<n.responseText.length;++i)e.push(255&n.responseText.charCodeAt(i))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},945:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function o(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function a(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:o,e.writeFloatBE=n?o:i,e.readFloatLE=n?s:a,e.readFloatBE=n?a:s}():function(){function t(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function s(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,s=8388607&n;return 255===o?s?NaN:i*(1/0):0===o?1401298464324817e-60*i*s:i*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=s.bind(null,i),e.readFloatBE=s.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function a(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:o,e.writeDoubleBE=n?o:i,e.readDoubleLE=n?s:a,e.readDoubleBE=n?a:s}():function(){function t(e,t,r,n,i,o){var s=n<0?1:0;if(s&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r);else if(n>17976931348623157e292)e(0,i,o+t),e((s<<31|2146435072)>>>0,i,o+r);else{var a;if(n<22250738585072014e-324)e((a=n/5e-324)>>>0,i,o+t),e((s<<31|a/4294967296)>>>0,i,o+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=n*Math.pow(2,-c))>>>0,i,o+t),e((s<<31|c+1023<<20|1048576*a&1048575)>>>0,i,o+r)}}}function s(e,t,r,n,i){var o=e(n,i+t),s=e(n,i+r),a=2*(s>>31)+1,c=s>>>20&2047,u=4294967296*(1048575&s)+o;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=s.bind(null,i,0,4),e.readDoubleBE=s.bind(null,o,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{"use strict";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}module.exports=inquire},8626:(e,t)=>{"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),i="";r&&(i=t.shift()+"/");for(var o=0;o<t.length;)".."===t[o]?o>0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return i+t.join("/")};r.resolve=function(e,t,r){return r||(t=i(t)),n(t)?t:(r||(e=i(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t)}},6662:e=>{"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,s=n;return function(r){if(r<1||r>i)return e(r);s+r>n&&(o=e(n),s=0);var a=t.call(o,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},4997:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,o=[],s=0;t<r;)(n=e[t++])<128?o[s++]=n:n>191&&n<224?o[s++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(n>>10),o[s++]=56320+(1023&n)):o[s++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))},r.write=function(e,t,r){for(var n,i,o=r,s=0;s<e.length;++s)(n=e.charCodeAt(s))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(s+1)))?(n=65536+((1023&n)<<10)+(1023&i),++s,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},9669:(e,t,r)=>{e.exports=r(1609)},5448:(e,t,r)=>{"use strict";var n=r(4867),i=r(6026),o=r(4372),s=r(5327),a=r(4097),c=r(4109),u=r(7985),f=r(5061);e.exports=function(e){return new Promise((function(t,r){var l=e.data,p=e.headers;n.isFormData(l)&&delete p["Content-Type"];var h=new XMLHttpRequest;if(e.auth){var d=e.auth.username||"",y=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";p.Authorization="Basic "+btoa(d+":"+y)}var m=a(e.baseURL,e.url);if(h.open(e.method.toUpperCase(),s(m,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?c(h.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h};i(t,r,o),h=null}},h.onabort=function(){h&&(r(f("Request aborted",e,"ECONNABORTED",h)),h=null)},h.onerror=function(){r(f("Network Error",e,null,h)),h=null},h.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(f(t,e,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var v=(e.withCredentials||u(m))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;v&&(p[e.xsrfHeaderName]=v)}if("setRequestHeader"in h&&n.forEach(p,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete p[t]:h.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){h&&(h.abort(),r(e),h=null)})),l||(l=null),h.send(l)}))}},1609:(e,t,r)=>{"use strict";var n=r(4867),i=r(1849),o=r(321),s=r(7185);function a(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var c=a(r(5655));c.Axios=o,c.create=function(e){return a(s(c.defaults,e))},c.Cancel=r(5263),c.CancelToken=r(4972),c.isCancel=r(6502),c.all=function(e){return Promise.all(e)},c.spread=r(8713),c.isAxiosError=r(6268),e.exports=c,e.exports.default=c},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,r)=>{"use strict";var n=r(5263);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},6502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,r)=>{"use strict";var n=r(4867),i=r(5327),o=r(782),s=r(3572),a=r(7185);function c(e){this.defaults=e,this.interceptors={request:new o,response:new o}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},c.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=c},782:(e,t,r)=>{"use strict";var n=r(4867);function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},4097:(e,t,r)=>{"use strict";var n=r(1793),i=r(7303);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},5061:(e,t,r)=>{"use strict";var n=r(481);e.exports=function(e,t,r,i,o){var s=new Error(e);return n(s,t,r,i,o)}},3572:(e,t,r)=>{"use strict";var n=r(4867),i=r(8527),o=r(6502),s=r(5655);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=i(t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(a(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},7185:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t){t=t||{};var r={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function u(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=c(void 0,e[i])):r[i]=c(e[i],t[i])}n.forEach(i,(function(e){n.isUndefined(t[e])||(r[e]=c(void 0,t[e]))})),n.forEach(o,u),n.forEach(s,(function(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=c(void 0,e[i])):r[i]=c(void 0,t[i])})),n.forEach(a,(function(n){n in t?r[n]=c(e[n],t[n]):n in e&&(r[n]=c(void 0,e[n]))}));var f=i.concat(o).concat(s).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===f.indexOf(e)}));return n.forEach(l,u),r}},6026:(e,t,r)=>{"use strict";var n=r(5061);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},8527:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},5655:(e,t,r)=>{"use strict";var n=r(4867),i=r(6016),o={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,c={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(a=r(5448)),a),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(o)})),e.exports=c},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},5327:(e,t,r)=>{"use strict";var n=r(4867);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},6016:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},4109:(e,t,r)=>{"use strict";var n=r(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,s={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4867:(e,t,r)=>{"use strict";var n=r(1849),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===i.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:c,isUndefined:s,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:f,merge:function e(){var t={};function r(r,n){c(t[n])&&c(r)?t[n]=e(t[n],r):c(r)?t[n]=e({},r):o(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)f(arguments[n],r);return t},extend:function(e,t,r){return f(t,(function(t,i){e[i]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},556:(e,t,r)=>{"use strict";const{encodeText:n}=r(2413);e.exports=class{constructor(e,t,r,i){this.name=e,this.code=t,this.codeBuf=n(this.code),this.alphabet=i,this.codec=r(i)}encode(e){return this.codec.encode(e)}decode(e){for(const t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.codec.decode(e)}}},5077:(e,t,r)=>{"use strict";const n=r(8820),i=r(556),{rfc4648:o}=r(6727),{decodeText:s,encodeText:a}=r(2413),c=[["identity","\0",()=>({encode:s,decode:a}),""],["base2","0",o(1),"01"],["base8","7",o(3),"01234567"],["base10","9",n,"0123456789"],["base16","f",o(4),"0123456789abcdef"],["base16upper","F",o(4),"0123456789ABCDEF"],["base32hex","v",o(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",o(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",o(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",o(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",o(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",n,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],u=c.reduce(((e,t)=>(e[t[0]]=new i(t[0],t[1],t[2],t[3]),e)),{}),f=c.reduce(((e,t)=>(e[t[1]]=u[t[0]],e)),{});e.exports={names:u,codes:f}},6957:(e,t,r)=>{"use strict";const n=r(5077),{encodeText:i,decodeText:o,concat:s}=r(2413);function a(e){if(Object.prototype.hasOwnProperty.call(n.names,e))return n.names[e];if(Object.prototype.hasOwnProperty.call(n.codes,e))return n.codes[e];throw new Error(`Unsupported encoding: ${e}`)}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");const{name:r,codeBuf:n}=a(e);return function(e,t){a(e).decode(o(t))}(r,t),s([n,t],n.length+t.length)}).encode=function(e,t){const r=a(e),n=i(r.encode(t));return s([r.codeBuf,n],r.codeBuf.length+n.length)},t.decode=function(e){e instanceof Uint8Array&&(e=o(e));const t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),a(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=o(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return a(e[0]).name}catch(e){return!1}},t.encoding=a,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=o(e)),a(e[0])};const c=Object.freeze(n.names),u=Object.freeze(n.codes);t.names=c,t.codes=u},6727:e=>{"use strict";e.exports={rfc4648:e=>t=>({encode:r=>((e,t,r)=>{const n="="===t[t.length-1],i=(1<<r)-1;let o="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o})(r,t,e),decode:r=>((e,t,r)=>{const n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let i=e.length;for(;"="===e[i-1];)--i;const o=new Uint8Array(i*r/8|0);let s=0,a=0,c=0;for(let t=0;t<i;++t){const i=n[e[t]];if(void 0===i)throw new SyntaxError("Invalid character "+e[t]);a=a<<r|i,s+=r,s>=8&&(s-=8,o[c++]=255&a>>s)}if(s>=r||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o})(r,t,e)})}},2413:e=>{"use strict";const t=new TextDecoder,r=new TextEncoder;e.exports={decodeText:e=>t.decode(e),encodeText:e=>r.encode(e),concat:function(e,t){const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}}},4492:(e,t,r)=>{"use strict";e.exports=r(8836)},3996:(e,t,r)=>{"use strict";var n=t,i=r(7025),o=r(9935);function s(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",n);for(var o=t.resolvedType.values,s=Object.keys(o),a=0;a<s.length;++a)t.repeated&&o[s[a]]===t.typeDefault&&e("default:"),e("case%j:",s[a])("case %i:",o[s[a]])("m%s=%j",n,o[s[a]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function a(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("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",n,n,n,n,o?"true":"",n);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",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var a=t[n].resolve(),c=o.safeProp(a.name);a.map?(r("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),s(r,a,n,c+"[ks[i]]")("}")("}")):a.repeated?(r("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),s(r,a,n,c+"[i]")("}")("}")):(a.resolvedType instanceof i||r("if(d%s!=null){",c),s(r,a,n,c),a.resolvedType instanceof i||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(o.compareFieldsById);if(!t.length)return o.codegen()("return {}");for(var r=o.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],s=[],c=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?n:t[u].map?s:c).push(t[u]);if(n.length){for(r("if(o.arrays||o.defaults){"),u=0;u<n.length;++u)r("d%s=[]",o.safeProp(n[u].name));r("}")}if(s.length){for(r("if(o.objects||o.defaults){"),u=0;u<s.length;++u)r("d%s={}",o.safeProp(s[u].name));r("}")}if(c.length){for(r("if(o.defaults){"),u=0;u<c.length;++u){var f=c[u],l=o.safeProp(f.name);if(f.resolvedType instanceof i)r("d%s=o.enums===String?%j:%j",l,f.resolvedType.valuesById[f.typeDefault],f.typeDefault);else if(f.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",f.typeDefault.low,f.typeDefault.high,f.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",l)("}else")("d%s=o.longs===String?%j:%i",l,f.typeDefault.toString(),f.typeDefault.toNumber());else if(f.bytes){var p="["+Array.prototype.slice.call(f.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,f.typeDefault))("else{")("d%s=%s",l,p)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else r("d%s=%j",l,f.typeDefault)}r("}")}var h=!1;for(u=0;u<t.length;++u){f=t[u];var d=e._fieldsArray.indexOf(f);l=o.safeProp(f.name),f.map?(h||(h=!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){"),a(r,f,d,l+"[ks2[j]]")("}")):f.repeated?(r("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),a(r,f,d,l+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",l,f.name),a(r,f,d,l),f.partOf&&r("if(o.oneofs)")("d%s=%j",o.safeProp(f.partOf.name),f.name)),r("}")}return r("return d")}},5305:(e,t,r)=>{"use strict";e.exports=function(e){var t=o.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var a=e._fieldsArray[r].resolve(),c=a.resolvedType instanceof n?"int32":a.type,u="m"+o.safeProp(a.name);t("case %i:",a.id),a.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==i.defaults[a.keyType]?t("k=%j",i.defaults[a.keyType]):t("k=null"),void 0!==i.defaults[c]?t("value=%j",i.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===i.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):a.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==i.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,c)("}else"),void 0===i.basic[c]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,r):t("%s.push(r.%s())",u,c)):void 0===i.basic[c]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,r):t("%s=r.%s()",u,c),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var f=e._fieldsArray[r];f.required&&t("if(!m.hasOwnProperty(%j))",f.name)("throw util.ProtocolError(%j,{instance:m})",s(f))}return t("return m")};var n=r(7025),i=r(7063),o=r(9935);function s(e){return"missing required '"+e.name+"'"}},4928:(e,t,r)=>{"use strict";e.exports=function(e){for(var t,r=o.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(o.compareFieldsById),c=0;c<a.length;++c){var u=a[c].resolve(),f=e._fieldsArray.indexOf(u),l=u.resolvedType instanceof n?"int32":u.type,p=i.basic[l];t="m"+o.safeProp(u.name),u.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|i.mapKey[u.keyType],u.keyType),void 0===p?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",f,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|p,l,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==i.packed[l]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",l,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===p?s(r,u,f,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|p)>>>0,l,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===p?s(r,u,f,t):r("w.uint32(%i).%s(%s)",(u.id<<3|p)>>>0,l,t))}return r("return w")};var n=r(7025),i=r(7063),o=r(9935);function s(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},7025:(e,t,r)=>{"use strict";e.exports=s;var n=r(3243);((s.prototype=Object.create(n.prototype)).constructor=s).className="Enum";var i=r(9313),o=r(9935);function s(e,t,r,i,o){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.reserved=void 0,t)for(var s=Object.keys(t),a=0;a<s.length;++a)"number"==typeof t[s[a]]&&(this.valuesById[this.values[s[a]]=t[s[a]]]=s[a])}s.fromJSON=function(e,t){var r=new s(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},s.prototype.add=function(e,t,r){if(!o.isString(e))throw TypeError("name must be a string");if(!o.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},s.prototype.remove=function(e){if(!o.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},s.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},s.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)}},3548:(e,t,r)=>{"use strict";e.exports=u;var n=r(3243);((u.prototype=Object.create(n.prototype)).constructor=u).className="Field";var i,o=r(7025),s=r(7063),a=r(9935),c=/^required|optional|repeated$/;function u(e,t,r,i,o,u,f){if(a.isObject(i)?(f=o,u=i,i=o=void 0):a.isObject(o)&&(f=u,u=o,o=void 0),n.call(this,e,u),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(r))throw TypeError("type must be a string");if(void 0!==i&&!c.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==o&&!a.isString(o))throw TypeError("extend must be a string");"proto3_optional"===i&&(i="optional"),this.rule=i&&"optional"!==i?i:void 0,this.type=r,this.id=t,this.extend=o||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==s.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=f}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=s.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof o)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},u.d=function(e,t,r,n){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(i,o){a.decorateType(i.constructor).add(new u(o,e,t,r,{default:n}))}},u._configure=function(e){i=e}},8836:(e,t,r)=>{"use strict";var n=e.exports=r(9482);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(4928),n.decoder=r(5305),n.verifier=r(4497),n.converter=r(3996),n.ReflectionObject=r(3243),n.Namespace=r(9313),n.Root=r(9424),n.Enum=r(7025),n.Type=r(7645),n.Field=r(3548),n.OneOf=r(7598),n.MapField=r(6039),n.Service=r(7513),n.Method=r(4429),n.Message=r(8368),n.wrappers=r(1667),n.types=r(7063),n.util=r(9935),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},9482:(e,t,r)=>{"use strict";var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(1173),n.BufferWriter=r(3155),n.Reader=r(1408),n.BufferReader=r(593),n.util=r(9693),n.rpc=r(5994),n.roots=r(5054),n.configure=i,i()},6039:(e,t,r)=>{"use strict";e.exports=s;var n=r(3548);((s.prototype=Object.create(n.prototype)).constructor=s).className="MapField";var i=r(7063),o=r(9935);function s(e,t,r,i,s,a){if(n.call(this,e,t,i,void 0,void 0,s,a),!o.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}s.fromJSON=function(e,t){return new s(e,t.id,t.keyType,t.type,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},s.d=function(e,t,r){return"function"==typeof r?r=o.decorateType(r).name:r&&"object"==typeof r&&(r=o.decorateEnum(r).name),function(n,i){o.decorateType(n.constructor).add(new s(i,e,t,r))}}},8368:(e,t,r)=>{"use strict";e.exports=i;var n=r(9693);function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}i.create=function(e){return this.$type.create(e)},i.encode=function(e,t){return this.$type.encode(e,t)},i.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},i.decode=function(e){return this.$type.decode(e)},i.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},i.verify=function(e){return this.$type.verify(e)},i.fromObject=function(e){return this.$type.fromObject(e)},i.toObject=function(e,t){return this.$type.toObject(e,t)},i.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},4429:(e,t,r)=>{"use strict";e.exports=o;var n=r(3243);((o.prototype=Object.create(n.prototype)).constructor=o).className="Method";var i=r(9935);function o(e,t,r,o,s,a,c,u,f){if(i.isObject(s)?(c=s,s=a=void 0):i.isObject(a)&&(c=a,a=void 0),void 0!==t&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(r))throw TypeError("requestType must be a string");if(!i.isString(o))throw TypeError("responseType must be a string");n.call(this,e,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!s||void 0,this.responseType=o,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=f}o.fromJSON=function(e,t){return new o(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},o.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},9313:(e,t,r)=>{"use strict";e.exports=l;var n=r(3243);((l.prototype=Object.create(n.prototype)).constructor=l).className="Namespace";var i,o,s,a=r(3548),c=r(7598),u=r(9935);function f(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function l(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function p(e){return e._nestedArray=null,e}l.fromJSON=function(e,t){return new l(e,t.options).addJSON(t.nested)},l.arrayToJSON=f,l.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},l.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(l.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),l.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",f(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?i.fromJSON:void 0!==t.values?s.fromJSON:void 0!==t.methods?o.fromJSON:void 0!==t.id?a.fromJSON:l.fromJSON)(r[n],t));return this},l.prototype.get=function(e){return this.nested&&this.nested[e]||null},l.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},l.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof i||e instanceof s||e instanceof o||e instanceof l||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof l&&e instanceof l)||t instanceof i||t instanceof o)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),p(this)},l.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),p(this)},l.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof l))throw Error("path conflicts with non-namespace objects")}else r.add(r=new l(n))}return t&&r.addJSON(t),r},l.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof l?e[t++].resolveAll():e[t++].resolve();return this.resolve()},l.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof l&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var i=0;i<this.nestedArray.length;++i)if(this._nestedArray[i]instanceof l&&(n=this._nestedArray[i].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},l.prototype.lookupType=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such type: "+e);return t},l.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},l.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[i,s]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},l.prototype.lookupService=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},l._configure=function(e,t,r){i=e,o=t,s=r}},3243:(e,t,r)=>{"use strict";e.exports=o,o.className="ReflectionObject";var n,i=r(9935);function o(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.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(o.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),o.prototype.toJSON=function(){throw Error()},o.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},o.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},o.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},o.prototype.getOption=function(e){if(this.options)return this.options[e]},o.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},o.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var o=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(o){var s=o[e];i.setProperty(s,r,t)}else(o={})[e]=i.setProperty({},r,t),n.push(o)}else{var a={};a[e]=t,n.push(a)}return this},o.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},o.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},o._configure=function(e){n=e}},7598:(e,t,r)=>{"use strict";e.exports=s;var n=r(3243);((s.prototype=Object.create(n.prototype)).constructor=s).className="OneOf";var i=r(3548),o=r(9935);function s(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}s.fromJSON=function(e,t){return new s(e,t.oneof,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},s.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},s.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}a(this)},s.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){o.decorateType(t.constructor).add(new s(r,e)),Object.defineProperty(t,r,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},1408:(e,t,r)=>{"use strict";e.exports=c;var n,i=r(9693),o=i.LongBits,s=i.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,f="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return i.Buffer?function(e){return(c.create=function(e){return i.Buffer.isBuffer(e)?new n(e):f(e)})(e)}:f};function p(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw a(this,8);return new o(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},c.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){n=e,c.create=l(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return d.call(this)[t](!0)},sfixed64:function(){return d.call(this)[t](!1)}})}},593:(e,t,r)=>{"use strict";e.exports=o;var n=r(1408);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(9693);function o(e){n.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},9424:(e,t,r)=>{"use strict";e.exports=l;var n=r(9313);((l.prototype=Object.create(n.prototype)).constructor=l).className="Root";var i,o,s,a=r(3548),c=r(7025),u=r(7598),f=r(9935);function l(e){n.call(this,"",e),this.deferred=[],this.files=[]}function p(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},l.prototype.resolvePath=f.path.resolve,l.prototype.fetch=f.fetch,l.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var i=this;if(!n)return f.asPromise(e,i,t,r);var a=n===p;function c(e,t){if(n){var r=n;if(n=null,a)throw e;r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in s)return r}return null}function l(e,t){try{if(f.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),f.isString(t)){o.filename=e;var n,s=o(t,i,r),l=0;if(s.imports)for(;l<s.imports.length;++l)(n=u(s.imports[l])||i.resolvePath(e,s.imports[l]))&&h(n);if(s.weakImports)for(l=0;l<s.weakImports.length;++l)(n=u(s.weakImports[l])||i.resolvePath(e,s.weakImports[l]))&&h(n,!0)}else i.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}a||d||c(null,i)}function h(e,t){if(!(i.files.indexOf(e)>-1))if(i.files.push(e),e in s)a?l(e,s[e]):(++d,setTimeout((function(){--d,l(e,s[e])})));else if(a){var r;try{r=f.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}l(e,r)}else++d,i.fetch(e,(function(r,o){--d,n&&(r?t?d||c(null,i):c(r):l(e,o))}))}var d=0;f.isString(t)&&(t=[t]);for(var y,m=0;m<t.length;++m)(y=i.resolvePath("",t[m]))&&h(y);if(a)return i;d||c(null,i)},l.prototype.loadSync=function(e,t){if(!f.isNode)throw Error("not supported");return this.load(e,t,p)},l.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return n.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function d(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.declaringField=t,t.extensionField=n,r.add(n),!0}return!1}l.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||d(0,e)||this.deferred.push(e);else if(e instanceof c)h.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof i)for(var t=0;t<this.deferred.length;)d(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);h.test(e.name)&&(e.parent[e.name]=e)}},l.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)h.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);h.test(e.name)&&delete e.parent[e.name]}},l._configure=function(e,t,r){i=e,o=t,s=r}},5054:e=>{"use strict";e.exports={}},5994:(e,t,r)=>{"use strict";t.Service=r(7948)},7948:(e,t,r)=>{"use strict";e.exports=i;var n=r(9693);function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return n.asPromise(e,a,t,r,i,o);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof i))try{r=i[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7513:(e,t,r)=>{"use strict";e.exports=a;var n=r(9313);((a.prototype=Object.create(n.prototype)).constructor=a).className="Service";var i=r(4429),o=r(9935),s=r(5994);function a(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var r=new a(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),o=0;o<n.length;++o)r.add(i.fromJSON(n[o],t.methods[n[o]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},a.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return o.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=o.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?(this.methods[e.name]=e,e.parent=this,c(this)):n.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof i){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return n.prototype.remove.call(this,e)},a.prototype.create=function(e,t,r){for(var n,i=new s.Service(e,t,r),a=0;a<this.methodsArray.length;++a){var c=o.lcFirst((n=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");i[c]=o.codegen(["r","c"],o.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return i}},7645:(e,t,r)=>{"use strict";e.exports=g;var n=r(9313);((g.prototype=Object.create(n.prototype)).constructor=g).className="Type";var i=r(7025),o=r(7598),s=r(3548),a=r(6039),c=r(7513),u=r(8368),f=r(1408),l=r(1173),p=r(9935),h=r(4928),d=r(5305),y=r(4497),m=r(3996),v=r(1667);function g(e,t){n.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}function b(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(g.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=p.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=p.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=g.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,p.merge(e.prototype,t)),e.$type=e.prototype.$type=this,p.merge(e,u,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:p.oneOfGetter(this._oneofsArray[r].oneof),set:p.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),g.generateConstructor=function(e){for(var t,r=p.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",p.safeProp(t.name)):t.repeated&&r("this%s=[]",p.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},g.fromJSON=function(e,t){var r=new g(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var u=Object.keys(t.fields),f=0;f<u.length;++f)r.add((void 0!==t.fields[u[f]].keyType?a.fromJSON:s.fromJSON)(u[f],t.fields[u[f]]));if(t.oneofs)for(u=Object.keys(t.oneofs),f=0;f<u.length;++f)r.add(o.fromJSON(u[f],t.oneofs[u[f]]));if(t.nested)for(u=Object.keys(t.nested),f=0;f<u.length;++f){var l=t.nested[u[f]];r.add((void 0!==l.id?s.fromJSON:void 0!==l.fields?g.fromJSON:void 0!==l.values?i.fromJSON:void 0!==l.methods?c.fromJSON:n.fromJSON)(u[f],l))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},g.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return p.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},g.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return n.prototype.resolveAll.call(this)},g.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},g.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof s&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),b(this)}return e instanceof o?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),b(this)):n.prototype.add.call(this,e)},g.prototype.remove=function(e){if(e instanceof s&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),b(this)}if(e instanceof o){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),b(this)}return n.prototype.remove.call(this,e)},g.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},g.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},g.prototype.create=function(e){return new this.ctor(e)},g.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=h(this)({Writer:l,types:t,util:p}),this.decode=d(this)({Reader:f,types:t,util:p}),this.verify=y(this)({types:t,util:p}),this.fromObject=m.fromObject(this)({types:t,util:p}),this.toObject=m.toObject(this)({types:t,util:p});var n=v[e];if(n){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(i),i.toObject=this.toObject,this.toObject=n.toObject.bind(i)}return this},g.prototype.encode=function(e,t){return this.setup().encode(e,t)},g.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},g.prototype.decode=function(e,t){return this.setup().decode(e,t)},g.prototype.decodeDelimited=function(e){return e instanceof f||(e=f.create(e)),this.decode(e,e.uint32())},g.prototype.verify=function(e){return this.setup().verify(e)},g.prototype.fromObject=function(e){return this.setup().fromObject(e)},g.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},g.d=function(e){return function(t){p.decorateType(t,e)}}},7063:(e,t,r)=>{"use strict";var n=t,i=r(9935),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function s(e,t){var r=0,n={};for(t|=0;r<e.length;)n[o[r+t]]=e[r++];return n}n.basic=s([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=s([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",i.emptyArray,null]),n.long=s([0,0,0,1,1],7),n.mapKey=s([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=s([1,5,0,0,0,5,5,0,0,0,1,1,0])},9935:(e,t,r)=>{"use strict";var n,i,o=e.exports=r(9693),s=r(5054);o.codegen=r(5124),o.fetch=r(9054),o.path=r(8626),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},o.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],i=e[r++];void 0!==i&&(t[n]=i)}return t};var a=/\\/g,c=/"/g;o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.isReserved(e)?'["'+e.replace(a,"\\\\").replace(c,'\\"')+'"]':"."+e},o.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;o.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},o.compareFieldsById=function(e,t){return e.id-t.id},o.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(o.decorateRoot.remove(e.$type),e.$type.name=t,o.decorateRoot.add(e.$type)),e.$type;n||(n=r(7645));var i=new n(t||e.name);return o.decorateRoot.add(i),i.ctor=e,Object.defineProperty(e,"$type",{value:i,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:i,enumerable:!1}),i};var f=0;o.decorateEnum=function(e){if(e.$type)return e.$type;i||(i=r(7025));var t=new i("Enum"+f++,e);return o.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},o.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var i=r.shift();if(r.length>0)t[i]=e(t[i]||{},r,n);else{var o=t[i];o&&(n=[].concat(o).concat(n)),t[i]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(o,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(r(9424)))}})},1945:(e,t,r)=>{"use strict";e.exports=i;var n=r(9693);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;i.fromHash=function(e){return e===s?o:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},9693:function(e,t,r){"use strict";var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i<n.length;++i)void 0!==e[n[i]]&&r||(e[n[i]]=t[n[i]]);return e}function o(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&i(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}n.asPromise=r(4537),n.base64=r(7419),n.EventEmitter=r(9211),n.float=r(945),n.inquire=r(7199),n.utf8=r(4997),n.pool=r(6662),n.LongBits=r(1945),n.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},4497:(e,t,r)=>{"use strict";e.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var n=0;n<e.fieldsArray.length;++n){var c=e._fieldsArray[n].resolve(),u="m"+i.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)t("if(!util.isObject(%s))",u)("return%j",o(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),a(t,c,"k[i]"),s(t,c,n,u+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",u)("return%j",o(c,"array"))("for(var i=0;i<%s.length;++i){",u),s(t,c,n,u+"[i]")("}");else{if(c.partOf){var f=i.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",f)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",f)}s(t,c,n,u)}c.optional&&t("}")}return t("return null")};var n=r(7025),i=r(9935);function o(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function s(e,t,r,i){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",i)("default:")("return%j",o(t,"enum value"));for(var s=Object.keys(t.resolvedType.values),a=0;a<s.length;++a)e("case %i:",t.resolvedType.values[s[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,i)("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))",i)("return%j",o(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)))",i,i,i,i)("return%j",o(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",o(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",o(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",o(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",o(t,"buffer"))}return e}function a(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",o(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",o(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",o(t,"boolean key"))}return e}},1667:(e,t,r)=>{"use strict";var n=t,i=r(8368);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var o=this.lookup(n);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var s=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),s["@type"]=n,s}return this.toObject(e,t)}}},1173:(e,t,r)=>{"use strict";e.exports=l;var n,i=r(9693),o=i.LongBits,s=i.base64,a=i.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function f(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(l.create=function(){return new n})()}:function(){return new l}};function h(e,t,r){t[r]=255&e}function d(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function m(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=p(),l.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(l.alloc=i.pool(l.alloc,i.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},d.prototype=Object.create(c.prototype),d.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new d((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(y,10,o.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=o.from(e);return this._push(y,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(y,t.length(),t)},l.prototype.bool=function(e){return this._push(h,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=o.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var v=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(i.isString(e)){var r=l.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(v,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},l.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},l._configure=function(e){n=e,l.create=p(),n._configure()}},3155:(e,t,r)=>{"use strict";e.exports=o;var n=r(1173);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(9693);function o(){n.call(this)}function s(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},o.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},o._configure()},9822:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;const n=r(7187),i=r(8593);class o{constructor(e){var t;e.id&&(this.id=i.decodeBase58(e.id)),this.signer=e.signer,this.provider=e.provider||(null===(t=e.signer)||void 0===t?void 0:t.provider),this.abi=e.abi,this.bytecode=e.bytecode,e.serializer?this.serializer=e.serializer:e.abi&&e.abi.types&&(this.serializer=new n.Serializer(e.abi.types)),this.options={rc_limit:1e8,sendTransaction:!0,sendAbis:!0,...e.options},this.functions={},this.signer&&this.provider&&this.abi&&this.abi.methods&&this.serializer&&Object.keys(this.abi.methods).forEach((e=>{this.functions[e]=async(t={},r)=>{if(!this.provider)throw new Error("provider not found");if(!this.abi||!this.abi.methods)throw new Error("Methods are not defined");if(!this.abi.methods[e])throw new Error(`Method ${e} not defined in the ABI`);const n={...this.options,...r},{readOnly:o,output:s,defaultOutput:a,preformatInput:c,preformatOutput:u}=this.abi.methods[e];let f;f="function"==typeof c?c(t):t;const l=await this.encodeOperation({name:e,args:f});if(o){if(!s)throw new Error(`No output defined for ${e}`);const{result:t}=await this.provider.readContract({contract_id:i.encodeBase58(l.call_contract.contract_id),entry_point:l.call_contract.entry_point,args:i.encodeBase64(l.call_contract.args)});let r=a;return t&&(r=await this.serializer.deserialize(t,s)),"function"==typeof u&&(r=u(r)),{operation:l,result:r}}if(!(null==n?void 0:n.sendTransaction))return{operation:l};if(!this.signer)throw new Error("signer not found");const p=await this.signer.encodeTransaction({...n,operations:[l]}),h={};return(null==n?void 0:n.sendAbis)&&(h[i.encodeBase58(this.id)]=this.abi),{operation:l,transaction:p,transactionResponse:await this.signer.sendTransaction(p,h)}}}))}static computeContractId(e){return i.decodeBase58(e)}getId(){if(!this.id)throw new Error("id is not defined");return i.encodeBase58(this.id)}async deploy(e){if(!this.signer)throw new Error("signer not found");if(!this.bytecode)throw new Error("bytecode not found");const t={...this.options,...e},r={upload_contract:{contract_id:o.computeContractId(this.signer.getAddress()),bytecode:this.bytecode}};if(!(null==t?void 0:t.sendTransaction))return{operation:r};const n=await this.signer.encodeTransaction({...t,operations:[r]});return{operation:r,transaction:n,transactionResponse:await this.signer.sendTransaction(n)}}async encodeOperation(e){if(!this.abi||!this.abi.methods||!this.abi.methods[e.name])throw new Error(`Operation ${e.name} unknown`);if(!this.serializer)throw new Error("Serializer is not defined");if(!this.id)throw new Error("Contract id is not defined");const t=this.abi.methods[e.name];let r=new Uint8Array(0);if(t.input){if(!e.args)throw new Error(`No arguments defined for type '${t.input}'`);r=await this.serializer.serialize(e.args,t.input)}return{call_contract:{contract_id:this.id,entry_point:t.entryPoint,args:r}}}async decodeOperation(e){if(!this.id)throw new Error("Contract id is not defined");if(!this.abi||!this.abi.methods)throw new Error("Methods are not defined");if(!this.serializer)throw new Error("Serializer is not defined");if(!e.call_contract)throw new Error("Operation is not CallContractOperation");if(e.call_contract.contract_id!==this.id)throw new Error(`Invalid contract id. Expected: ${i.encodeBase58(this.id)}. Received: ${i.encodeBase58(e.call_contract.contract_id)}`);for(let t=0;t<Object.keys(this.abi.methods).length;t+=1){const r=Object.keys(this.abi.methods)[t],n=this.abi.methods[r];if(e.call_contract.entry_point===n.entryPoint)return n.input?{name:r,args:await this.serializer.deserialize(e.call_contract.args,n.input)}:{name:r}}throw new Error(`Unknown method id ${e.call_contract.entry_point}`)}}t.Contract=o,t.default=o},5635:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;const i=n(r(9669));async function o(e){return new Promise((t=>setTimeout(t,e)))}class s{constructor(e){Array.isArray(e)?this.rpcNodes=e:this.rpcNodes=[e],this.currentNodeId=0,this.onError=()=>!1}async call(e,t){let r={data:{},status:0,statusText:"",headers:{},config:{}},n=!1;for(;!n;)try{const o={id:Math.round(1e3*Math.random()),jsonrpc:"2.0",method:e,params:t},s=this.rpcNodes[this.currentNodeId];r=await i.default.post(s,o,{validateStatus:e=>e<400}),n=!0}catch(e){const t=this.rpcNodes[this.currentNodeId];this.currentNodeId=(this.currentNodeId+1)%this.rpcNodes.length;const r=this.rpcNodes[this.currentNodeId];if(this.onError(e,t,r))throw e}if(r.data.error)throw new Error(JSON.stringify({error:r.data.error,request:{method:e,params:t}}));return r.data.result}async getNonce(e){const{nonce:t}=await this.call("chain.get_account_nonce",{account:e});return t?Number(t):0}async getAccountRc(e){const{rc:t}=await this.call("chain.get_account_rc",{account:e});return t||"0"}async getTransactionsById(e){return this.call("transaction_store.get_transactions_by_id",{transaction_ids:e})}async getBlocksById(e){return this.call("block_store.get_blocks_by_id",{block_id:e,return_block:!0,return_receipt:!1})}async getHeadInfo(){return this.call("chain.get_head_info",{})}async getBlocks(e,t=1,r){let n=r;return n||(n=(await this.getHeadInfo()).head_topology.id),(await this.call("block_store.get_blocks_by_height",{head_block_id:n,ancestor_start_height:e,num_blocks:t,return_block:!0,return_receipt:!1})).block_items}async getBlock(e){return(await this.getBlocks(e,1))[0]}async sendTransaction(e){await this.call("chain.submit_transaction",{transaction:e});const t=Date.now()+1e4;return{wait:async(r="byTransactionId")=>{if(await o(t-Date.now()-1e3),"byTransactionId"===r){for(let t=0;t<30;t+=1){await o(1e3);const{transactions:t}=await this.getTransactionsById([e.id]);if(t&&t[0]&&t[0].containing_blocks)return t[0].containing_blocks[0]}throw new Error("Transaction not mined after 40 seconds")}let n=0,i=0;for(let t=0;t<90;t+=1){await o(1e3);const{head_topology:r}=await this.getHeadInfo();if(0===t?(n=Number(r.height),i=n):n+=1,n>Number(r.height))continue;const[s]=await this.getBlocks(n,1,r.id);if(s&&s.block&&s.block_id&&s.block.transactions&&s.block.transactions.find((t=>t.id===e.id)))return n.toString()}throw new Error(`Transaction not mined from block ${i} to ${n}`)}}}async readContract(e){return this.call("chain.read_contract",e)}}t.Provider=s,t.default=s},7187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Serializer=void 0;const n=r(4492),i=r(8593),o="(koinos_bytes_type)";class s{constructor(e,t){this.bytesConversion=!0,this.types=e,this.root=n.Root.fromJSON(this.types),(null==t?void 0:t.defaultTypeName)&&(this.defaultType=this.root.lookupType(t.defaultTypeName)),t&&void 0!==t.bytesConversion&&(this.bytesConversion=t.bytesConversion)}async serialize(e,t){const r=this.defaultType||this.root.lookupType(t);let n={};this.bytesConversion?Object.keys(r.fields).forEach((t=>{const{options:s,name:a,type:c}=r.fields[t];var u;if("bytes"===c)if(s&&s[o])switch(s[o]){case"BASE58":case"CONTRACT_ID":case"ADDRESS":n[a]=i.decodeBase58(e[a]);break;case"BASE64":n[a]=i.decodeBase64(e[a]);break;case"HEX":case"BLOCK_ID":case"TRANSACTION_ID":n[a]=i.toUint8Array(e[a].replace("0x",""));break;default:throw new Error(`unknown koinos_byte_type ${s[o]}`)}else n[a]=i.decodeBase64(e[a]);else n[a]="string"==typeof(u=e[a])||"number"==typeof u?u:JSON.parse(JSON.stringify(u))})):n=e;const s=r.create(n);return r.encode(s).finish()}async deserialize(e,t){const r="string"==typeof e?i.decodeBase64(e):e,n=this.defaultType||this.root.lookupType(t),s=n.decode(r),a=n.toObject(s,{longs:String});return this.bytesConversion?(Object.keys(n.fields).forEach((e=>{const{options:t,name:r,type:s}=n.fields[e];if("bytes"===s)if(t&&t[o])switch(t[o]){case"BASE58":case"CONTRACT_ID":case"ADDRESS":a[r]=i.encodeBase58(a[r]);break;case"BASE64":a[r]=i.encodeBase64(a[r]);break;case"HEX":case"BLOCK_ID":case"TRANSACTION_ID":a[r]=`0x${i.toHexString(a[r])}`;break;default:throw new Error(`unknown koinos_byte_type ${t[o]}`)}else a[r]=i.encodeBase64(a[r])})),a):a}}t.Serializer=s,t.default=s},6991:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=void 0;const a=r(5374),c=o(r(1337)),u=s(r(6139)),f=r(8593),l=r(7187);class p{constructor(e){this.compressed=void 0===e.compressed||e.compressed,this.privateKey=e.privateKey,this.provider=e.provider,e.serializer?this.serializer=e.serializer:this.serializer=new l.Serializer(u.default,{defaultTypeName:"active_transaction_data",bytesConversion:!1}),"string"==typeof e.privateKey?(this.publicKey=c.getPublicKey(e.privateKey,this.compressed),this.address=f.bitcoinAddress(f.toUint8Array(this.publicKey))):(this.publicKey=c.getPublicKey(e.privateKey,this.compressed),this.address=f.bitcoinAddress(this.publicKey))}static fromWif(e){const t="5"!==e[0],r=f.bitcoinDecode(e);return new p({privateKey:f.toHexString(r),compressed:t})}static fromSeed(e,t){const r=a.sha256(e);return new p({privateKey:r,compressed:t})}getAddress(e=!0){if("string"==typeof this.privateKey){const t=c.getPublicKey(this.privateKey,e);return f.bitcoinAddress(f.toUint8Array(t))}const t=c.getPublicKey(this.privateKey,e);return f.bitcoinAddress(t)}getPrivateKey(e="hex",t){let r;r=this.privateKey instanceof Uint8Array?f.toHexString(this.privateKey):"string"==typeof this.privateKey?this.privateKey:BigInt(this.privateKey).toString(16).padStart(64,"0");const n=void 0===t?this.compressed:t;switch(e){case"hex":return r;case"wif":return f.bitcoinEncode(f.toUint8Array(r),"private",n);default:throw new Error(`Invalid format ${e}`)}}async signTransaction(e){if(!e.active)throw new Error("Active data is not defined");const t=a.sha256(f.decodeBase64(e.active)),[r,n]=await c.sign(t,this.privateKey,{recovered:!0,canonical:!0,der:!1}),i=new Uint8Array(65);i.set([n+31],0),i.set(r,1),e.signature_data=f.encodeBase64(i);const o=`0x1220${f.toHexString(t)}`;return e.id=o,e}async sendTransaction(e,t){if(e.signature_data&&e.id||await this.signTransaction(e),!this.provider)throw new Error("provider is undefined");return this.provider.sendTransaction(e)}static async recoverPublicKey(e,t){if(!e.active)throw new Error("active is not defined");if(!e.signature_data)throw new Error("signature_data is not defined");let r=e.signature_data;t&&"function"==typeof t.transformSignature&&(r=await t.transformSignature(e.signature_data));let n=!0;t&&void 0!==t.compressed&&(n=t.compressed);const i=a.sha256(f.decodeBase64(e.active)),o=f.toHexString(f.decodeBase64(r)),s=Number(`0x${o.slice(0,2)}`)-31,u=o.slice(2,66),l=o.slice(66),p=BigInt(`0x${u}`),h=BigInt(`0x${l}`),d=new c.Signature(p,h),y=c.recoverPublicKey(f.toHexString(i),d.toHex(),s);if(!y)throw new Error("Public key cannot be recovered");return n?c.Point.fromHex(y).toHex(!0):y}static async recoverAddress(e,t){const r=await p.recoverPublicKey(e,t);return f.bitcoinAddress(f.toUint8Array(r))}async encodeTransaction(e){let{nonce:t}=e;if(void 0===e.nonce){if(!this.provider)throw new Error("Cannot get the nonce because provider is undefined. To skip this call set a nonce in the parameters");t=await this.provider.getNonce(this.getAddress())}const r={rc_limit:void 0===e.rc_limit?1e6:e.rc_limit,nonce:t,operations:e.operations?e.operations:[]},n=await this.serializer.serialize(r);return{active:f.encodeBase64(n)}}async decodeTransaction(e){if(!e.active)throw new Error("Active data is not defined");return this.serializer.deserialize(e.active)}}t.Signer=p,t.default=p},5738:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r(8593)),a=r(9822),c=r(6991),u=r(5635),f=r(7187);window.utils=s,window.Contract=a.Contract,window.Signer=c.Signer,window.Provider=u.Provider,window.Serializer=f.Serializer},8593:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolTypes=t.Krc20Abi=t.parseUnits=t.formatUnits=t.bitcoinAddress=t.bitcoinDecode=t.bitcoinEncode=t.decodeBase64=t.encodeBase64=t.decodeBase58=t.encodeBase58=t.toHexString=t.toUint8Array=void 0;const a=o(r(6957)),c=r(5374),u=r(7050),f=s(r(7177)),l=s(r(6139));function p(e){return(new TextDecoder).decode(a.encode("z",e)).slice(1)}function h(e){return a.decode(`z${e}`)}function d(e,t,r=!1){let n,i,o;"public"===t?(n=new Uint8Array(25),i=new Uint8Array(21),n[0]=0,i[0]=0,o=21):(r?(n=new Uint8Array(38),i=new Uint8Array(34),o=34,n[33]=1,i[33]=1):(n=new Uint8Array(37),i=new Uint8Array(33),o=33),n[0]=128,i[0]=128),i.set(e,1);const s=c.sha256(i),a=c.sha256(s),u=new Uint8Array(4);return u.set(a.slice(0,4)),n.set(e,1),n.set(u,o),p(n)}t.toUint8Array=function(e){const t=e.match(/[\dA-F]{2}/gi);if(!t)throw new Error("Invalid hex");return new Uint8Array(t.map((e=>parseInt(e,16))))},t.toHexString=function(e){return Array.from(e).map((e=>`0${Number(e).toString(16)}`.slice(-2))).join("")},t.encodeBase58=p,t.decodeBase58=h,t.encodeBase64=function(e){return(new TextDecoder).decode(a.encode("U",e)).slice(1)},t.decodeBase64=function(e){return a.decode(`U${e}`)},t.bitcoinEncode=d,t.bitcoinDecode=function(e){const t=h(e),r=new Uint8Array(32),n=new Uint8Array(4);return r.set(t.slice(1,33)),"5"!==e[0]?n.set(t.slice(34,38)):n.set(t.slice(33,37)),r},t.bitcoinAddress=function(e){const t=c.sha256(e);return d(u.ripemd160(t),"public")},t.formatUnits=function(e,t){let r="string"==typeof e?e:BigInt(e).toString();const n="-"===r[0]?"-":"";return r=r.replace("-","").padStart(t+1,"0"),`${n}${r.substring(0,r.length-t).replace(/^0+(?=\d)/,"")}.${r.substring(r.length-t)}`.replace(/(\.0+)?(0+)$/,"")},t.parseUnits=function(e,t){const r="-"===e[0]?"-":"";let[n,i]=e.replace("-","").replace(",",".").split(".");return i||(i=""),i=i.padEnd(t,"0"),`${r}${`${n}${i}`.replace(/^0+(?=\d)/,"")}`},t.Krc20Abi={methods:{name:{entryPoint:1995063959,input:"name_arguments",output:"name_result",readOnly:!0},symbol:{entryPoint:2121878308,input:"symbol_arguments",output:"symbol_result",readOnly:!0},decimals:{entryPoint:1507595726,input:"decimals_arguments",output:"decimals_result",readOnly:!0},totalSupply:{entryPoint:3475931666,input:"total_supply_arguments",output:"total_supply_result",readOnly:!0},balanceOf:{entryPoint:358715976,input:"balance_of_arguments",output:"balance_of_result",readOnly:!0,defaultOutput:{value:"0"}},transfer:{entryPoint:1659871890,input:"transfer_arguments",output:"transfer_result"},mint:{entryPoint:3271044060,input:"mint_argumnets",output:"mint_result"}},types:f.default},t.ProtocolTypes=l.default},5102:()=>{},7177:e=>{"use strict";e.exports=JSON.parse('{"nested":{"koinos":{"nested":{"contracts":{"nested":{"token":{"options":{"go_package":"github.com/koinos/koinos-proto-golang/koinos/contracts/token"},"nested":{"name_arguments":{"fields":{}},"name_result":{"fields":{"value":{"type":"string","id":1}}},"symbol_arguments":{"fields":{}},"symbol_result":{"fields":{"value":{"type":"string","id":1}}},"decimals_arguments":{"fields":{}},"decimals_result":{"fields":{"value":{"type":"uint32","id":1}}},"total_supply_arguments":{"fields":{}},"total_supply_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"balance_of_arguments":{"fields":{"owner":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"ADDRESS"}}}},"balance_of_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"transfer_arguments":{"fields":{"from":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"ADDRESS"}},"to":{"type":"bytes","id":2,"options":{"(koinos_bytes_type)":"ADDRESS"}},"value":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"transfer_result":{"fields":{"value":{"type":"bool","id":1}}},"mint_arguments":{"fields":{"to":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"mint_result":{"fields":{"value":{"type":"bool","id":1}}},"balance_object":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"mana_balance_object":{"fields":{"balance":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}},"mana":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"last_mana_update":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}}}}}}}}}}')},6139:e=>{"use strict";e.exports=JSON.parse('{"nested":{"koinos":{"nested":{"protocol":{"options":{"go_package":"github.com/koinos/koinos-proto-golang/koinos/protocol"},"nested":{"contract_call_bundle":{"fields":{"contract_id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"CONTRACT_ID"}},"entry_point":{"type":"uint32","id":2}}},"system_call_target":{"oneofs":{"target":{"oneof":["thunk_id","system_call_bundle"]}},"fields":{"thunk_id":{"type":"uint32","id":1},"system_call_bundle":{"type":"contract_call_bundle","id":2}}},"upload_contract_operation":{"fields":{"contract_id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"CONTRACT_ID"}},"bytecode":{"type":"bytes","id":2}}},"call_contract_operation":{"fields":{"contract_id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"CONTRACT_ID"}},"entry_point":{"type":"uint32","id":2},"args":{"type":"bytes","id":3}}},"set_system_call_operation":{"fields":{"call_id":{"type":"uint32","id":1},"target":{"type":"system_call_target","id":2}}},"operation":{"oneofs":{"op":{"oneof":["upload_contract","call_contract","set_system_call"]}},"fields":{"upload_contract":{"type":"upload_contract_operation","id":1},"call_contract":{"type":"call_contract_operation","id":2},"set_system_call":{"type":"set_system_call_operation","id":3}}},"active_transaction_data":{"fields":{"rc_limit":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}},"nonce":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"operations":{"rule":"repeated","type":"operation","id":3}}},"passive_transaction_data":{"fields":{}},"transaction":{"fields":{"id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"TRANSACTION_ID"}},"active":{"type":"bytes","id":2},"passive":{"type":"bytes","id":3},"signature_data":{"type":"bytes","id":4}}},"active_block_data":{"fields":{"transaction_merkle_root":{"type":"bytes","id":1},"passive_data_merkle_root":{"type":"bytes","id":2},"signer":{"type":"bytes","id":3}}},"passive_block_data":{"fields":{}},"block_header":{"fields":{"previous":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"BLOCK_ID"}},"height":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"timestamp":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"block":{"fields":{"id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"BLOCK_ID"}},"header":{"type":"block_header","id":2},"active":{"type":"bytes","id":3},"passive":{"type":"bytes","id":4},"signature_data":{"type":"bytes","id":5},"transactions":{"rule":"repeated","type":"transaction","id":6}}},"block_receipt":{"fields":{}}}}}}}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__=__webpack_require__(5738)})();
|
|
2
|
+
(()=>{var __webpack_modules__={8820:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var s=e.length,a=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var r=0;if(" "!==e[r]){for(var n=0,i=0;e[r]===a;)n++,r++;for(var o=(e.length-r)*c+1>>>0,u=new Uint8Array(o);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var l=0,h=o-1;(0!==f||l<i)&&-1!==h;h--,l++)f+=s*u[h]>>>0,u[h]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");i=l,r++}if(" "!==e[r]){for(var p=o-i;p!==o&&0===u[p];)p++;for(var d=new Uint8Array(n+(o-p)),y=n;p!==o;)d[y++]=u[p++];return d}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var c=(o-i)*u+1>>>0,f=new Uint8Array(c);i!==o;){for(var l=t[i],h=0,p=c-1;(0!==l||h<n)&&-1!==p;p--,h++)l+=256*f[p]>>>0,f[p]=l%s>>>0,l=l/s>>>0;if(0!==l)throw new Error("Non-zero carry");n=h,i++}for(var d=c-n;d!==c&&0===f[d];)d++;for(var y=a.repeat(r);d<c;++d)y+=e.charAt(f[d]);return y},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},6365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(8359);class i extends n.Hash{constructor(e,t,r,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,n.createView)(this.buffer)}update(e){if(this.destroyed)throw new Error("instance is destroyed");const{view:t,buffer:r,blockLen:i,finished:o}=this;if(o)throw new Error("digest() was already called");const s=(e=(0,n.toBytes)(e)).length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a!==i)r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(t,0),this.pos=0);else{const t=(0,n.createView)(e);for(;i<=s-o;o+=i)this.process(t,o)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length<this.outputLen)throw new Error("_Sha2: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:o}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(r,0),s=0);for(let e=s;e<i;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}(r,i-8,BigInt(8*this.length),o),this.process(r,0);const a=(0,n.createView)(e);this.get().forEach(((e,t)=>a.setUint32(4*t,e,o)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}t.SHA2=i},901:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0}},7050:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const n=r(6365),i=r(8359),o=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),s=Uint8Array.from({length:16},((e,t)=>t)),a=s.map((e=>(9*e+5)%16));let c=[s],u=[a];for(let e=0;e<4;e++)for(let t of[c,u])t.push(t[e].map((e=>o[e])));const f=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),l=c.map(((e,t)=>e.map((e=>f[t][e])))),h=u.map(((e,t)=>e.map((e=>f[t][e])))),p=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),d=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),y=(e,t)=>e<<t|e>>>32-t;function m(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const v=new Uint32Array(16);class g extends n.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)v[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,i=0|this.h1,o=i,s=0|this.h2,a=s,f=0|this.h3,g=f,b=0|this.h4,w=b;for(let e=0;e<5;e++){const t=4-e,_=p[e],A=d[e],O=c[e],x=u[e],E=l[e],S=h[e];for(let t=0;t<16;t++){const n=y(r+m(e,i,s,f)+v[O[t]]+_,E[t])+b|0;r=b,b=f,f=0|y(s,10),s=i,i=n}for(let e=0;e<16;e++){const r=y(n+m(t,o,a,g)+v[x[e]]+A,S[e])+w|0;n=w,w=g,g=0|y(a,10),a=o,o=r}}this.set(this.h1+s+g|0,this.h2+f+w|0,this.h3+b+n|0,this.h4+r+o|0,this.h0+i+a|0)}roundClean(){v.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=g,t.ripemd160=(0,i.wrapConstructor)((()=>new g))},5374:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const n=r(6365),i=r(8359),o=(e,t,r)=>e&t^e&r^t&r,s=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]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class u extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],r=c[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;c[e]=o+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:a,D:u,E:f,F:l,G:h,H:p}=this;for(let e=0;e<64;e++){const t=p+((0,i.rotr)(f,6)^(0,i.rotr)(f,11)^(0,i.rotr)(f,25))+((d=f)&l^~d&h)+s[e]+c[e]|0,y=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+o(r,n,a)|0;p=h,h=l,l=f,f=u+t|0,u=a,a=n,n=r,r=t+y|0}var d;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,u=u+this.D|0,f=f+this.E|0,l=l+this.F|0,h=h+this.G|0,p=p+this.H|0,this.set(r,n,a,u,f,l,h,p)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.sha256=(0,i.wrapConstructor)((()=>new u))},8359:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.assertHash=t.assertBool=t.assertNumber=t.toBytes=t.asyncLoop=t.nextTick=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(901);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function o(e){if("string"==typeof e&&(e=(new TextEncoder).encode(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}function s(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}t.bytesToHex=function(e){let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},t.nextTick=(()=>{const t="function"==typeof e.require&&e.require.bind(e);try{if(t){const{setImmediate:e}=t("timers");return()=>new Promise((t=>e(t)))}}catch(e){}return()=>new Promise((e=>setTimeout(e,0)))})(),t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.toBytes=o,t.assertNumber=s,t.assertBool=function(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},t.assertHash=function(e){if("function"!=typeof e||"function"!=typeof e.init)throw new Error("Hash should be wrapped by utils.wrapConstructor");s(e.outputLen),s(e.blockLen)},t.Hash=class{clone(){return this._cloneInto()}},t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new TypeError("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(o(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.init=t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(o(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.init=t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto.web)return n.crypto.web.getRandomValues(new Uint8Array(e));if(n.crypto.node)return new Uint8Array(n.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},1337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.schnorr=t.verify=t.signSync=t.sign=t.getSharedSecret=t.recoverPublicKey=t.getPublicKey=t.SignResult=t.Signature=t.Point=t.CURVE=void 0;const n={a:0n,b:7n,P:2n**256n-2n**32n-977n,n:2n**256n-432420386565659656852420866394968145599n,h:1n,Gx:55066263022277343669578718895168534326250603453777594175500187360389116729240n,Gy:32670510020758816978083085130507043184471273380659243275938904335757337482424n,beta:0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501een};function i(e){const{a:t,b:r}=n;return A(e**3n+t*e+r)}t.CURVE=n;const o=0n===n.a;class s{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof c))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new s(e.x,e.y,1n)}static toAffineBatch(e){const t=function(e,t=n.P){const r=e.length,i=new Array(r);let o=1n;for(let n=0;n<r;n++)0n!==e[n]&&(i[n]=o,o=A(o*e[n],t));o=x(o,t);for(let n=r-1;n>=0;n--){if(0n===e[n])continue;const r=A(o*e[n],t);e[n]=A(o*i[n],t),o=r}return e}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return s.toAffineBatch(e).map(s.fromAffine)}equals(e){const t=this,r=e,n=A(t.z*t.z),i=A(t.z*n),o=A(r.z*r.z),s=A(r.z*o);return A(t.x*o)===A(n*r.x)&&A(t.y*s)===A(i*r.y)}negate(){return new s(this.x,A(-this.y),this.z)}double(){const e=this.x,t=this.y,r=this.z,n=A(e**2n),i=A(t**2n),o=A(i**2n),a=A(2n*(A(A((e+i)**2n))-n-o)),c=A(3n*n),u=A(c**2n),f=A(u-2n*a),l=A(c*(a-f)-8n*o),h=A(2n*t*r);return new s(f,l,h)}add(e){if(!(e instanceof s))throw new TypeError("JacobianPoint#add: expected JacobianPoint");const t=this.x,r=this.y,n=this.z,i=e.x,o=e.y,a=e.z;if(0n===i||0n===o)return this;if(0n===t||0n===r)return e;const c=A(n**2n),u=A(a**2n),f=A(t*u),l=A(i*c),h=A(r*a*u),p=A(A(o*n)*c),d=A(l-f),y=A(p-h);if(0n===d)return 0n===y?this.double():s.ZERO;const m=A(d**2n),v=A(d*m),g=A(f*m),b=A(y**2n-v-2n*g),w=A(y*(g-b)-h*v),_=A(n*a*d);return new s(b,w,_)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){if(!_(e))throw new TypeError("Point#multiply: expected valid scalar");let t=A(BigInt(e),n.n);if(!o){let e=s.ZERO,r=this;for(;t>0n;)1n&t&&(e=e.add(r)),r=r.double(),t>>=1n;return e}let[r,i,a,c]=k(t),u=s.ZERO,f=s.ZERO,l=this;for(;i>0n||c>0n;)1n&i&&(u=u.add(l)),1n&c&&(f=f.add(l)),l=l.double(),i>>=1n,c>>=1n;return r&&(u=u.negate()),a&&(f=f.negate()),f=new s(A(f.x*n.beta),f.y,f.z),u.add(f)}precomputeWindow(e){const t=o?128/e+1:256/e+1;let r=[],n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(s.BASE)&&(t=c.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&a.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=s.normalizeZ(n),a.set(t,n)));let i=s.ZERO,u=s.ZERO;const f=o?128/r+1:256/r+1,l=2**(r-1),h=BigInt(2**r-1),p=2**r,d=BigInt(r);for(let t=0;t<f;t++){const r=t*l;let o=Number(e&h);if(e>>=d,o>l&&(o-=p,e+=1n),0===o)u=u.add(t%2?n[r].negate():n[r]);else{const e=n[r+Math.abs(o)-1];i=i.add(o<0?e.negate():e)}}return[i,u]}multiply(e,t){if(!_(e))throw new TypeError("Point#multiply: expected valid scalar");let r,i,a=A(BigInt(e),n.n);if(o){const[e,o,c,u]=k(a);let f,l,h,p;[f,h]=this.wNAF(o,t),[l,p]=this.wNAF(u,t),e&&(f=f.negate()),c&&(l=l.negate()),l=new s(A(l.x*n.beta),l.y,l.z),[r,i]=[f.add(l),h.add(p)]}else[r,i]=this.wNAF(a,t);return s.normalizeZ([r,i])[0]}toAffine(e=x(this.z)){const t=e**2n,r=A(this.x*t),n=A(this.y*t*e);return new c(r,n)}}s.BASE=new s(n.Gx,n.Gy,1n),s.ZERO=new s(0n,1n,0n);const a=new WeakMap;class c{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,a.delete(this)}static fromCompressedHex(e){const t=32===e.length,r=b(t?e:e.slice(1));let o=function(e){const{P:t}=n,r=e*e*e%t,i=r*r*e%t,o=O(i,3n)*i%t,s=O(o,3n)*i%t,a=O(s,2n)*r%t,c=O(a,11n)*a%t,u=O(c,22n)*c%t,f=O(u,44n)*u%t,l=O(f,88n)*f%t,h=O(l,44n)*u%t,p=O(h,3n)*i%t,d=O(p,23n)*c%t,y=O(d,6n)*r%t;return O(y,2n)}(i(r));const s=1n===(1n&o);t?s&&(o=A(-o)):1==(1&e[0])!==s&&(o=A(-o));const a=new c(r,o);return a.assertValidity(),a}static fromUncompressedHex(e){const t=b(e.slice(1,33)),r=b(e.slice(33)),n=new c(t,r);return n.assertValidity(),n}static fromHex(e){const t=g(e),r=t[0];if(32===t.length||33===t.length&&(2===r||3===r))return this.fromCompressedHex(t);if(65===t.length&&4===r)return this.fromUncompressedHex(t);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${t.length}`)}static fromPrivateKey(e){return c.BASE.multiply(N(e))}static fromSignature(e,t,r){let i=e instanceof Uint8Array?b(e):m(e);const o=P(t),{r:a,s:u}=o;if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid yParity bit");const f=2+(1&r),l=c.fromHex(`0${f}${p(a)}`),h=s.fromAffine(l).multiplyUnsafe(u),d=s.BASE.multiply(i),y=x(a,n.n),v=h.subtract(d).multiplyUnsafe(y).toAffine();return v.assertValidity(),v}toRawBytes(e=!1){return v(this.toHex(e))}toHex(e=!1){const t=p(this.x);return e?`${1n&this.y?"03":"02"}${t}`:`04${t}${p(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{P:t}=n,{x:r,y:o}=this;if(0n===r||0n===o||r>=t||o>=t)throw new Error(e);if((A(o*o)-i(r))%t!==0n)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new c(this.x,A(-this.y))}double(){return s.fromAffine(this).double().toAffine()}add(e){return s.fromAffine(this).add(s.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return s.fromAffine(this).multiply(e,this).toAffine()}}function u(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}t.Point=c,c.BASE=new c(n.Gx,n.Gy),c.ZERO=new c(0n,0n);class f{constructor(e,t){this.r=e,this.s=t}static fromCompact(e){if("string"!=typeof e&&!(e instanceof Uint8Array))throw new TypeError("Signature.fromCompact: Expected string or Uint8Array");const t=e instanceof Uint8Array?h(e):e;if(128!==t.length)throw new Error("Signature.fromCompact: Expected 64-byte hex");const r=new f(m(t.slice(0,64)),m(t.slice(64,128)));return r.assertValidity(),r}static fromDER(e){const t="Signature.fromDER";if("string"!=typeof e&&!(e instanceof Uint8Array))throw new TypeError(`${t}: Expected string or Uint8Array`);const r=e instanceof Uint8Array?h(e):e,n=w(r.slice(2,4));if("30"!==r.slice(0,2)||n!==r.length-4||"02"!==r.slice(4,6))throw new Error(`${t}: Invalid signature ${r}`);const i=w(r.slice(6,8)),o=8+i,s=r.slice(8,o);if(s.startsWith("00")&&w(s.slice(2,4))<=127)throw new Error(`${t}: Invalid r with trailing length`);const a=m(s);if("02"!==r.slice(o,o+2))throw new Error(`${t}: Invalid r-s separator`);const c=w(r.slice(o+2,o+4)),u=n-c-i-10;if(u>0||-4===u)throw new Error(`${t}: Invalid total length`);if(c>n-i-4)throw new Error(`${t}: Invalid s`);const l=o+4,p=r.slice(l,l+c);if(p.startsWith("00")&&w(p.slice(2,4))<=127)throw new Error(`${t}: Invalid s with trailing length`);const d=m(p),y=new f(a,d);return y.assertValidity(),y}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!T(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!T(t))throw new Error("Invalid Signature: s must be 0 < s < n")}toDERRawBytes(e=!1){return v(this.toDERHex(e))}toDERHex(e=!1){const t=u(y(this.s));if(e)return t;const r=u(y(this.r)),n=y(r.length/2),i=y(t.length/2);return`30${y(r.length/2+t.length/2+4)}02${n}${r}02${i}${t}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return v(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}function l(...e){if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}function h(e){let t="";for(let r=0;r<e.length;r++)t+=e[r].toString(16).padStart(2,"0");return t}function p(e){return e.toString(16).padStart(64,"0")}function d(e){return v(p(e))}function y(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function m(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt(`0x${e}`)}function v(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r;t[r]=Number.parseInt(e.slice(n,n+2),16)}return t}function g(e){return e instanceof Uint8Array?e:v(e)}function b(e){return m(h(e))}function w(e){return 2*Number.parseInt(e,16)}function _(e){return"bigint"==typeof e&&e>0n||!!("number"==typeof e&&e>0&&Number.isSafeInteger(e))}function A(e,t=n.P){const r=e%t;return r>=0?r:t+r}function O(e,t){const{P:r}=n;let i=e;for(;t-- >0n;)i*=i,i%=r;return i}function x(e,t=n.P){if(0n===e||t<=0n)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=A(e,t),i=t,[o,s,a,c]=[0n,1n,1n,0n];for(;0n!==r;){const e=i/r,t=i%r,n=o-a*e,u=s-c*e;[i,r]=[r,t],[o,s]=[a,c],[a,c]=[n,u]}if(1n!==i)throw new Error("invert: does not exist");return A(o,t)}t.Signature=f,t.SignResult=f;const E=(e,t)=>(e+t/2n)/t,S=2n**128n;function k(e){const{n:t}=n,r=0x3086d221a7d46bcde86c90e49284eb15n,i=-0xe4437ed6010e88286f547fa90abfe4c3n,o=r,s=E(o*e,t),a=E(-i*e,t);let c=A(e-s*r-0x114ca50f7a8e2f3f657c1108d9d44cfd8n*a,t),u=A(-s*i-a*o,t);const f=c>S,l=u>S;if(f&&(c=t-c),l&&(u=t-u),c>S||u>S)throw new Error("splitScalarEndo: Endomorphism failed");return[f,c,l,u]}function j(e,t){if(null==e)throw new Error(`sign: expected valid msgHash, not "${e}"`);const r=d("string"==typeof e?m(e):b(e));return[r,b(r),d(t),new Uint8Array(32).fill(1),new Uint8Array(32).fill(0),Uint8Array.from([0]),Uint8Array.from([1])]}function T(e){return 0<e&&e<n.n}function B(e,t,r){const i=b(e);if(!T(i))return;const o=n.n,s=c.BASE.multiply(i),a=A(s.x,o),u=A(x(i,o)*(t+a*r),o);return 0n!==a&&0n!==u?[s,a,u]:void 0}function N(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=m(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=b(e)}if(!T(t))throw new Error("Expected private key: 0 < key < n");return t}function R(e){return e instanceof c?(e.assertValidity(),e):c.fromHex(e)}function P(e){return e instanceof f?(e.assertValidity(),e):f.fromDER(e)}function I(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?33===n||65===n:r?66===n||130===n:e instanceof c}function U(e,t,r=!1){const[i,o,s]=e;let{canonical:a,der:c,recovered:u}=t,l=(i.x===o?0:2)|Number(1n&i.y),h=s;s>n.n>>1n&&a&&(h=n.n-s,l^=1);const p=new f(o,h);p.assertValidity();const d=!1===c?p.toCompactHex():p.toDERHex(),y=r?d:v(d);return u?[y,l]:y}async function C(e,...r){const n=new Uint8Array(e.split("").map((e=>e.charCodeAt(0)))),i=await t.utils.sha256(n);return b(await t.utils.sha256(l(i,i,...r)))}async function D(e,t,r){const i=d(e);return A(await C("BIP0340/challenge",i,t.toRawX(),r),n.n)}function L(e){return 0n===A(e.y,2n)}t.getPublicKey=function(e,t=!1){const r=c.fromPrivateKey(e);return"string"==typeof e?r.toHex(t):r.toRawBytes(t)},t.recoverPublicKey=function(e,t,r){const n=c.fromSignature(e,t,r);return"string"==typeof e?n.toHex():n.toRawBytes()},t.getSharedSecret=function(e,t,r=!1){if(I(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!I(t))throw new TypeError("getSharedSecret: second arg must be public key");const n=R(t);n.assertValidity();const i=n.multiply(N(e));return"string"==typeof e?i.toHex(r):i.toRawBytes(r)},t.sign=async function(e,r,n={}){return U(await async function(e,r){const n=N(r);let[i,o,s,a,c,u,f]=j(e,n);const l=t.utils.hmacSha256;c=await l(c,a,u,s,i),a=await l(c,a),c=await l(c,a,f,s,i),a=await l(c,a);for(let e=0;e<1e3;e++){a=await l(c,a);let e=B(a,o,n);if(e)return e;c=await l(c,a,u),a=await l(c,a)}throw new TypeError("secp256k1: Tried 1,000 k values for sign(), all were invalid")}(e,r),n,"string"==typeof e)},t.signSync=function(e,r,n={}){return U(function(e,r){const n=N(r);let[i,o,s,a,c,u,f]=j(e,n);const l=t.utils.hmacSha256Sync;if(!l)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");if(c=l(c,a,u,s,i),c instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");a=l(c,a),c=l(c,a,f,s,i),a=l(c,a);for(let e=0;e<1e3;e++){a=l(c,a);let e=B(a,o,n);if(e)return e;c=l(c,a,u),a=l(c,a)}throw new TypeError("secp256k1: Tried 1,000 k values for sign(), all were invalid")}(e,r),n,"string"==typeof e)},t.verify=function(e,t,r){const{n:i}=n;let o;try{o=P(e)}catch(e){return!1}const{r:a,s:c}=o,u=function(e){"string"!=typeof e&&(e=h(e));let t=m(e||"0");const r=e.length/2*8-256;return r>0&&(t>>=BigInt(r)),t>=n.n&&(t-=n.n),t}(t);if(0n===u)return!1;const f=s.fromAffine(R(r)),l=x(c,i),p=A(u*l,i),d=A(a*l,i),y=s.BASE.multiply(p),v=f.multiplyUnsafe(d);return A(y.add(v).toAffine().x,i)===a};class ${constructor(e,t){if(this.r=e,this.s=t,e<=0n||t<=0n||e>=n.P||t>=n.n)throw new Error("Invalid signature")}static fromHex(e){const t=g(e);if(64!==t.length)throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${t.length}`);const r=b(t.slice(0,32)),n=b(t.slice(32));return new $(r,n)}toHex(){return p(this.r)+p(this.s)}toRawBytes(){return v(this.toHex())}}async function z(e,t,r){const n=e instanceof $?e:$.fromHex(e),i="string"==typeof t?v(t):t,o=R(r),s=await D(n.r,o,i),a=c.fromPrivateKey(n.s),u=o.multiply(s),f=a.subtract(u);return!(f.equals(c.BASE)||!L(f)||f.x!==n.r)}t.schnorr={Signature:$,getPublicKey:function(e){const t=c.fromPrivateKey(e);return"string"==typeof e?t.toHexX():t.toRawX()},sign:async function(e,r,i=t.utils.randomBytes()){if(null==e)throw new TypeError(`sign: Expected valid message, not "${e}"`);r||(r=0n);const{n:o}=n,s=g(e),a=N(r),u=g(i);if(32!==u.length)throw new TypeError("sign: Expected 32 bytes of aux randomness");const f=c.fromPrivateKey(a),l=L(f)?a:o-a,h=l^await C("BIP0340/aux",u),p=A(await C("BIP0340/nonce",d(h),f.toRawX(),s),o);if(0n===p)throw new Error("sign: Creation of signature failed. k is zero");const y=c.fromPrivateKey(p),m=L(y)?p:o-p,v=await D(y.x,f,s),b=new $(y.x,A(m+v*l,o));if(!await z(b.toRawBytes(),s,f.toRawX()))throw new Error("sign: Invalid signature produced");return"string"==typeof e?b.toHex():b.toRawBytes()},verify:z},c.BASE._setWindowSize(8);const H=(()=>{const e="object"==typeof self&&"crypto"in self?self.crypto:void 0;return{node:e?void 0:r(5102),web:e}})();t.utils={isValidPrivateKey(e){try{return N(e),!0}catch(e){return!1}},randomBytes:(e=32)=>{if(H.web)return H.web.getRandomValues(new Uint8Array(e));if(H.node){const{randomBytes:t}=H.node;return new Uint8Array(t(e).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>{let e=8;for(;e--;){const e=t.utils.randomBytes(32),r=b(e);if(T(r)&&1n!==r)return e}throw new Error("Valid private key was not found in 8 iterations. PRNG is broken")},sha256:async e=>{if(H.web){const t=await H.web.subtle.digest("SHA-256",e.buffer);return new Uint8Array(t)}if(H.node){const{createHash:t}=H.node;return Uint8Array.from(t("sha256").update(e).digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(H.web){const r=await H.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=l(...t),i=await H.web.subtle.sign("HMAC",r,n);return new Uint8Array(i)}if(H.node){const{createHmac:r}=H.node,n=r("sha256",e);for(let e of t)n.update(e);return Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,precompute(e=8,t=c.BASE){const r=t===c.BASE?t:new c(t.x,t.y);return r._setWindowSize(e),r.multiply(3n),r}}},4537:e=>{"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)r[n++]=arguments[i++];return new Promise((function(i,s){r[n]=function(e){if(o)if(o=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(e){o&&(o=!1,s(e))}}))}},7419:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),i=new Array(123),o=0;o<64;)i[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(e,t,r){for(var i,o=null,s=[],a=0,c=0;t<r;){var u=e[t++];switch(c){case 0:s[a++]=n[u>>2],i=(3&u)<<4,c=1;break;case 1:s[a++]=n[i|u>>4],i=(15&u)<<2,c=2;break;case 2:s[a++]=n[i|u>>6],s[a++]=n[63&u],c=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return c&&(s[a++]=n[i],s[a++]=61,1===c&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";r.decode=function(e,t,r){for(var n,o=r,a=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&a>1)break;if(void 0===(u=i[u]))throw Error(s);switch(a){case 0:n=u,a=1;break;case 1:t[r++]=n<<2|(48&u)>>4,n=u,a=2;break;case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,a=3;break;case 3:t[r++]=(3&n)<<6|u,a=0}}if(1===a)throw Error(s);return r-o},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},5124:e=>{"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var n=[];function i(e){if("string"!=typeof e){var r=o();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var s=Object.keys(e),a=new Array(s.length+1),c=new Array(s.length),u=0;u<s.length;)a[u]=s[u],c[u]=e[s[u++]];return a[u]=r,Function.apply(null,a).apply(null,c)}return Function(r)()}for(var f=new Array(arguments.length-1),l=0;l<f.length;)f[l]=arguments[++l];if(l=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=f[l++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),l!==f.length)throw Error("parameter count mismatch");return n.push(e),i}function o(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return i.toString=o,i}e.exports=t,t.verbose=!1},9211:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},9054:(e,t,r)=>{"use strict";e.exports=o;var n=r(4537),i=r(7199)("fs");function o(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&i&&i.readFile?i.readFile(e,(function(n,i){return n&&"undefined"!=typeof XMLHttpRequest?o.xhr(e,t,r):n?r(n):r(null,t.binary?i:i.toString("utf8"))})):o.xhr(e,t,r):n(o,this,e,t)}o.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var i=0;i<n.responseText.length;++i)e.push(255&n.responseText.charCodeAt(i))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},945:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function o(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function a(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:o,e.writeFloatBE=n?o:i,e.readFloatLE=n?s:a,e.readFloatBE=n?a:s}():function(){function t(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function s(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,s=8388607&n;return 255===o?s?NaN:i*(1/0):0===o?1401298464324817e-60*i*s:i*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=s.bind(null,i),e.readFloatBE=s.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function a(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:o,e.writeDoubleBE=n?o:i,e.readDoubleLE=n?s:a,e.readDoubleBE=n?a:s}():function(){function t(e,t,r,n,i,o){var s=n<0?1:0;if(s&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r);else if(n>17976931348623157e292)e(0,i,o+t),e((s<<31|2146435072)>>>0,i,o+r);else{var a;if(n<22250738585072014e-324)e((a=n/5e-324)>>>0,i,o+t),e((s<<31|a/4294967296)>>>0,i,o+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=n*Math.pow(2,-c))>>>0,i,o+t),e((s<<31|c+1023<<20|1048576*a&1048575)>>>0,i,o+r)}}}function s(e,t,r,n,i){var o=e(n,i+t),s=e(n,i+r),a=2*(s>>31)+1,c=s>>>20&2047,u=4294967296*(1048575&s)+o;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=s.bind(null,i,0,4),e.readDoubleBE=s.bind(null,o,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{"use strict";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}module.exports=inquire},8626:(e,t)=>{"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),i="";r&&(i=t.shift()+"/");for(var o=0;o<t.length;)".."===t[o]?o>0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return i+t.join("/")};r.resolve=function(e,t,r){return r||(t=i(t)),n(t)?t:(r||(e=i(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t)}},6662:e=>{"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,s=n;return function(r){if(r<1||r>i)return e(r);s+r>n&&(o=e(n),s=0);var a=t.call(o,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},4997:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,o=[],s=0;t<r;)(n=e[t++])<128?o[s++]=n:n>191&&n<224?o[s++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(n>>10),o[s++]=56320+(1023&n)):o[s++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))},r.write=function(e,t,r){for(var n,i,o=r,s=0;s<e.length;++s)(n=e.charCodeAt(s))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(s+1)))?(n=65536+((1023&n)<<10)+(1023&i),++s,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},9669:(e,t,r)=>{e.exports=r(1609)},5448:(e,t,r)=>{"use strict";var n=r(4867),i=r(6026),o=r(4372),s=r(5327),a=r(4097),c=r(4109),u=r(7985),f=r(5061);e.exports=function(e){return new Promise((function(t,r){var l=e.data,h=e.headers;n.isFormData(l)&&delete h["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var d=e.auth.username||"",y=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";h.Authorization="Basic "+btoa(d+":"+y)}var m=a(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),s(m,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?c(p.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};i(t,r,o),p=null}},p.onabort=function(){p&&(r(f("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){r(f("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(f(t,e,"ECONNABORTED",p)),p=null},n.isStandardBrowserEnv()){var v=(e.withCredentials||u(m))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;v&&(h[e.xsrfHeaderName]=v)}if("setRequestHeader"in p&&n.forEach(h,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete h[t]:p.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),r(e),p=null)})),l||(l=null),p.send(l)}))}},1609:(e,t,r)=>{"use strict";var n=r(4867),i=r(1849),o=r(321),s=r(7185);function a(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var c=a(r(5655));c.Axios=o,c.create=function(e){return a(s(c.defaults,e))},c.Cancel=r(5263),c.CancelToken=r(4972),c.isCancel=r(6502),c.all=function(e){return Promise.all(e)},c.spread=r(8713),c.isAxiosError=r(6268),e.exports=c,e.exports.default=c},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,r)=>{"use strict";var n=r(5263);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},6502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,r)=>{"use strict";var n=r(4867),i=r(5327),o=r(782),s=r(3572),a=r(7185);function c(e){this.defaults=e,this.interceptors={request:new o,response:new o}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},c.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=c},782:(e,t,r)=>{"use strict";var n=r(4867);function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},4097:(e,t,r)=>{"use strict";var n=r(1793),i=r(7303);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},5061:(e,t,r)=>{"use strict";var n=r(481);e.exports=function(e,t,r,i,o){var s=new Error(e);return n(s,t,r,i,o)}},3572:(e,t,r)=>{"use strict";var n=r(4867),i=r(8527),o=r(6502),s=r(5655);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=i(t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(a(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},7185:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t){t=t||{};var r={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function u(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=c(void 0,e[i])):r[i]=c(e[i],t[i])}n.forEach(i,(function(e){n.isUndefined(t[e])||(r[e]=c(void 0,t[e]))})),n.forEach(o,u),n.forEach(s,(function(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=c(void 0,e[i])):r[i]=c(void 0,t[i])})),n.forEach(a,(function(n){n in t?r[n]=c(e[n],t[n]):n in e&&(r[n]=c(void 0,e[n]))}));var f=i.concat(o).concat(s).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===f.indexOf(e)}));return n.forEach(l,u),r}},6026:(e,t,r)=>{"use strict";var n=r(5061);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},8527:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},5655:(e,t,r)=>{"use strict";var n=r(4867),i=r(6016),o={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,c={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(a=r(5448)),a),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(o)})),e.exports=c},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},5327:(e,t,r)=>{"use strict";var n=r(4867);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},6016:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},4109:(e,t,r)=>{"use strict";var n=r(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,s={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4867:(e,t,r)=>{"use strict";var n=r(1849),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===i.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:c,isUndefined:s,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:f,merge:function e(){var t={};function r(r,n){c(t[n])&&c(r)?t[n]=e(t[n],r):c(r)?t[n]=e({},r):o(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)f(arguments[n],r);return t},extend:function(e,t,r){return f(t,(function(t,i){e[i]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},556:(e,t,r)=>{"use strict";const{encodeText:n}=r(2413);e.exports=class{constructor(e,t,r,i){this.name=e,this.code=t,this.codeBuf=n(this.code),this.alphabet=i,this.codec=r(i)}encode(e){return this.codec.encode(e)}decode(e){for(const t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.codec.decode(e)}}},5077:(e,t,r)=>{"use strict";const n=r(8820),i=r(556),{rfc4648:o}=r(6727),{decodeText:s,encodeText:a}=r(2413),c=[["identity","\0",()=>({encode:s,decode:a}),""],["base2","0",o(1),"01"],["base8","7",o(3),"01234567"],["base10","9",n,"0123456789"],["base16","f",o(4),"0123456789abcdef"],["base16upper","F",o(4),"0123456789ABCDEF"],["base32hex","v",o(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",o(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",o(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",o(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",o(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",n,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],u=c.reduce(((e,t)=>(e[t[0]]=new i(t[0],t[1],t[2],t[3]),e)),{}),f=c.reduce(((e,t)=>(e[t[1]]=u[t[0]],e)),{});e.exports={names:u,codes:f}},6957:(e,t,r)=>{"use strict";const n=r(5077),{encodeText:i,decodeText:o,concat:s}=r(2413);function a(e){if(Object.prototype.hasOwnProperty.call(n.names,e))return n.names[e];if(Object.prototype.hasOwnProperty.call(n.codes,e))return n.codes[e];throw new Error(`Unsupported encoding: ${e}`)}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");const{name:r,codeBuf:n}=a(e);return function(e,t){a(e).decode(o(t))}(r,t),s([n,t],n.length+t.length)}).encode=function(e,t){const r=a(e),n=i(r.encode(t));return s([r.codeBuf,n],r.codeBuf.length+n.length)},t.decode=function(e){e instanceof Uint8Array&&(e=o(e));const t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),a(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=o(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return a(e[0]).name}catch(e){return!1}},t.encoding=a,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=o(e)),a(e[0])};const c=Object.freeze(n.names),u=Object.freeze(n.codes);t.names=c,t.codes=u},6727:e=>{"use strict";e.exports={rfc4648:e=>t=>({encode:r=>((e,t,r)=>{const n="="===t[t.length-1],i=(1<<r)-1;let o="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o})(r,t,e),decode:r=>((e,t,r)=>{const n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let i=e.length;for(;"="===e[i-1];)--i;const o=new Uint8Array(i*r/8|0);let s=0,a=0,c=0;for(let t=0;t<i;++t){const i=n[e[t]];if(void 0===i)throw new SyntaxError("Invalid character "+e[t]);a=a<<r|i,s+=r,s>=8&&(s-=8,o[c++]=255&a>>s)}if(s>=r||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o})(r,t,e)})}},2413:e=>{"use strict";const t=new TextDecoder,r=new TextEncoder;e.exports={decodeText:e=>t.decode(e),encodeText:e=>r.encode(e),concat:function(e,t){const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}}},4492:(e,t,r)=>{"use strict";e.exports=r(8836)},3996:(e,t,r)=>{"use strict";var n=t,i=r(7025),o=r(9935);function s(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",n);for(var o=t.resolvedType.values,s=Object.keys(o),a=0;a<s.length;++a)t.repeated&&o[s[a]]===t.typeDefault&&e("default:"),e("case%j:",s[a])("case %i:",o[s[a]])("m%s=%j",n,o[s[a]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function a(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("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",n,n,n,n,o?"true":"",n);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",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var a=t[n].resolve(),c=o.safeProp(a.name);a.map?(r("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),s(r,a,n,c+"[ks[i]]")("}")("}")):a.repeated?(r("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),s(r,a,n,c+"[i]")("}")("}")):(a.resolvedType instanceof i||r("if(d%s!=null){",c),s(r,a,n,c),a.resolvedType instanceof i||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(o.compareFieldsById);if(!t.length)return o.codegen()("return {}");for(var r=o.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],s=[],c=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?n:t[u].map?s:c).push(t[u]);if(n.length){for(r("if(o.arrays||o.defaults){"),u=0;u<n.length;++u)r("d%s=[]",o.safeProp(n[u].name));r("}")}if(s.length){for(r("if(o.objects||o.defaults){"),u=0;u<s.length;++u)r("d%s={}",o.safeProp(s[u].name));r("}")}if(c.length){for(r("if(o.defaults){"),u=0;u<c.length;++u){var f=c[u],l=o.safeProp(f.name);if(f.resolvedType instanceof i)r("d%s=o.enums===String?%j:%j",l,f.resolvedType.valuesById[f.typeDefault],f.typeDefault);else if(f.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",f.typeDefault.low,f.typeDefault.high,f.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",l)("}else")("d%s=o.longs===String?%j:%i",l,f.typeDefault.toString(),f.typeDefault.toNumber());else if(f.bytes){var h="["+Array.prototype.slice.call(f.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,f.typeDefault))("else{")("d%s=%s",l,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else r("d%s=%j",l,f.typeDefault)}r("}")}var p=!1;for(u=0;u<t.length;++u){f=t[u];var d=e._fieldsArray.indexOf(f);l=o.safeProp(f.name),f.map?(p||(p=!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){"),a(r,f,d,l+"[ks2[j]]")("}")):f.repeated?(r("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),a(r,f,d,l+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",l,f.name),a(r,f,d,l),f.partOf&&r("if(o.oneofs)")("d%s=%j",o.safeProp(f.partOf.name),f.name)),r("}")}return r("return d")}},5305:(e,t,r)=>{"use strict";e.exports=function(e){var t=o.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var a=e._fieldsArray[r].resolve(),c=a.resolvedType instanceof n?"int32":a.type,u="m"+o.safeProp(a.name);t("case %i:",a.id),a.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==i.defaults[a.keyType]?t("k=%j",i.defaults[a.keyType]):t("k=null"),void 0!==i.defaults[c]?t("value=%j",i.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===i.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):a.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==i.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,c)("}else"),void 0===i.basic[c]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,r):t("%s.push(r.%s())",u,c)):void 0===i.basic[c]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,r):t("%s=r.%s()",u,c),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var f=e._fieldsArray[r];f.required&&t("if(!m.hasOwnProperty(%j))",f.name)("throw util.ProtocolError(%j,{instance:m})",s(f))}return t("return m")};var n=r(7025),i=r(7063),o=r(9935);function s(e){return"missing required '"+e.name+"'"}},4928:(e,t,r)=>{"use strict";e.exports=function(e){for(var t,r=o.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(o.compareFieldsById),c=0;c<a.length;++c){var u=a[c].resolve(),f=e._fieldsArray.indexOf(u),l=u.resolvedType instanceof n?"int32":u.type,h=i.basic[l];t="m"+o.safeProp(u.name),u.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|i.mapKey[u.keyType],u.keyType),void 0===h?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",f,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,l,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==i.packed[l]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",l,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===h?s(r,u,f,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|h)>>>0,l,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===h?s(r,u,f,t):r("w.uint32(%i).%s(%s)",(u.id<<3|h)>>>0,l,t))}return r("return w")};var n=r(7025),i=r(7063),o=r(9935);function s(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},7025:(e,t,r)=>{"use strict";e.exports=s;var n=r(3243);((s.prototype=Object.create(n.prototype)).constructor=s).className="Enum";var i=r(9313),o=r(9935);function s(e,t,r,i,o){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.reserved=void 0,t)for(var s=Object.keys(t),a=0;a<s.length;++a)"number"==typeof t[s[a]]&&(this.valuesById[this.values[s[a]]=t[s[a]]]=s[a])}s.fromJSON=function(e,t){var r=new s(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},s.prototype.add=function(e,t,r){if(!o.isString(e))throw TypeError("name must be a string");if(!o.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},s.prototype.remove=function(e){if(!o.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},s.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},s.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)}},3548:(e,t,r)=>{"use strict";e.exports=u;var n=r(3243);((u.prototype=Object.create(n.prototype)).constructor=u).className="Field";var i,o=r(7025),s=r(7063),a=r(9935),c=/^required|optional|repeated$/;function u(e,t,r,i,o,u,f){if(a.isObject(i)?(f=o,u=i,i=o=void 0):a.isObject(o)&&(f=u,u=o,o=void 0),n.call(this,e,u),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(r))throw TypeError("type must be a string");if(void 0!==i&&!c.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==o&&!a.isString(o))throw TypeError("extend must be a string");"proto3_optional"===i&&(i="optional"),this.rule=i&&"optional"!==i?i:void 0,this.type=r,this.id=t,this.extend=o||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==s.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=f}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=s.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof o)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},u.d=function(e,t,r,n){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(i,o){a.decorateType(i.constructor).add(new u(o,e,t,r,{default:n}))}},u._configure=function(e){i=e}},8836:(e,t,r)=>{"use strict";var n=e.exports=r(9482);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(4928),n.decoder=r(5305),n.verifier=r(4497),n.converter=r(3996),n.ReflectionObject=r(3243),n.Namespace=r(9313),n.Root=r(9424),n.Enum=r(7025),n.Type=r(7645),n.Field=r(3548),n.OneOf=r(7598),n.MapField=r(6039),n.Service=r(7513),n.Method=r(4429),n.Message=r(8368),n.wrappers=r(1667),n.types=r(7063),n.util=r(9935),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},9482:(e,t,r)=>{"use strict";var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(1173),n.BufferWriter=r(3155),n.Reader=r(1408),n.BufferReader=r(593),n.util=r(9693),n.rpc=r(5994),n.roots=r(5054),n.configure=i,i()},6039:(e,t,r)=>{"use strict";e.exports=s;var n=r(3548);((s.prototype=Object.create(n.prototype)).constructor=s).className="MapField";var i=r(7063),o=r(9935);function s(e,t,r,i,s,a){if(n.call(this,e,t,i,void 0,void 0,s,a),!o.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}s.fromJSON=function(e,t){return new s(e,t.id,t.keyType,t.type,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},s.d=function(e,t,r){return"function"==typeof r?r=o.decorateType(r).name:r&&"object"==typeof r&&(r=o.decorateEnum(r).name),function(n,i){o.decorateType(n.constructor).add(new s(i,e,t,r))}}},8368:(e,t,r)=>{"use strict";e.exports=i;var n=r(9693);function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}i.create=function(e){return this.$type.create(e)},i.encode=function(e,t){return this.$type.encode(e,t)},i.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},i.decode=function(e){return this.$type.decode(e)},i.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},i.verify=function(e){return this.$type.verify(e)},i.fromObject=function(e){return this.$type.fromObject(e)},i.toObject=function(e,t){return this.$type.toObject(e,t)},i.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},4429:(e,t,r)=>{"use strict";e.exports=o;var n=r(3243);((o.prototype=Object.create(n.prototype)).constructor=o).className="Method";var i=r(9935);function o(e,t,r,o,s,a,c,u,f){if(i.isObject(s)?(c=s,s=a=void 0):i.isObject(a)&&(c=a,a=void 0),void 0!==t&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(r))throw TypeError("requestType must be a string");if(!i.isString(o))throw TypeError("responseType must be a string");n.call(this,e,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!s||void 0,this.responseType=o,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=f}o.fromJSON=function(e,t){return new o(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},o.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},9313:(e,t,r)=>{"use strict";e.exports=l;var n=r(3243);((l.prototype=Object.create(n.prototype)).constructor=l).className="Namespace";var i,o,s,a=r(3548),c=r(7598),u=r(9935);function f(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function l(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function h(e){return e._nestedArray=null,e}l.fromJSON=function(e,t){return new l(e,t.options).addJSON(t.nested)},l.arrayToJSON=f,l.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},l.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(l.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),l.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",f(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?i.fromJSON:void 0!==t.values?s.fromJSON:void 0!==t.methods?o.fromJSON:void 0!==t.id?a.fromJSON:l.fromJSON)(r[n],t));return this},l.prototype.get=function(e){return this.nested&&this.nested[e]||null},l.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},l.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof i||e instanceof s||e instanceof o||e instanceof l||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof l&&e instanceof l)||t instanceof i||t instanceof o)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),h(this)},l.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),h(this)},l.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof l))throw Error("path conflicts with non-namespace objects")}else r.add(r=new l(n))}return t&&r.addJSON(t),r},l.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof l?e[t++].resolveAll():e[t++].resolve();return this.resolve()},l.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof l&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var i=0;i<this.nestedArray.length;++i)if(this._nestedArray[i]instanceof l&&(n=this._nestedArray[i].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},l.prototype.lookupType=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such type: "+e);return t},l.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},l.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[i,s]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},l.prototype.lookupService=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},l._configure=function(e,t,r){i=e,o=t,s=r}},3243:(e,t,r)=>{"use strict";e.exports=o,o.className="ReflectionObject";var n,i=r(9935);function o(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.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(o.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),o.prototype.toJSON=function(){throw Error()},o.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},o.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},o.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},o.prototype.getOption=function(e){if(this.options)return this.options[e]},o.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},o.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var o=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(o){var s=o[e];i.setProperty(s,r,t)}else(o={})[e]=i.setProperty({},r,t),n.push(o)}else{var a={};a[e]=t,n.push(a)}return this},o.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},o.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},o._configure=function(e){n=e}},7598:(e,t,r)=>{"use strict";e.exports=s;var n=r(3243);((s.prototype=Object.create(n.prototype)).constructor=s).className="OneOf";var i=r(3548),o=r(9935);function s(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}s.fromJSON=function(e,t){return new s(e,t.oneof,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},s.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},s.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}a(this)},s.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){o.decorateType(t.constructor).add(new s(r,e)),Object.defineProperty(t,r,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},1408:(e,t,r)=>{"use strict";e.exports=c;var n,i=r(9693),o=i.LongBits,s=i.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,f="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return i.Buffer?function(e){return(c.create=function(e){return i.Buffer.isBuffer(e)?new n(e):f(e)})(e)}:f};function h(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw a(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|p(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},c.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){n=e,c.create=l(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return d.call(this)[t](!0)},sfixed64:function(){return d.call(this)[t](!1)}})}},593:(e,t,r)=>{"use strict";e.exports=o;var n=r(1408);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(9693);function o(e){n.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},9424:(e,t,r)=>{"use strict";e.exports=l;var n=r(9313);((l.prototype=Object.create(n.prototype)).constructor=l).className="Root";var i,o,s,a=r(3548),c=r(7025),u=r(7598),f=r(9935);function l(e){n.call(this,"",e),this.deferred=[],this.files=[]}function h(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},l.prototype.resolvePath=f.path.resolve,l.prototype.fetch=f.fetch,l.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var i=this;if(!n)return f.asPromise(e,i,t,r);var a=n===h;function c(e,t){if(n){var r=n;if(n=null,a)throw e;r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in s)return r}return null}function l(e,t){try{if(f.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),f.isString(t)){o.filename=e;var n,s=o(t,i,r),l=0;if(s.imports)for(;l<s.imports.length;++l)(n=u(s.imports[l])||i.resolvePath(e,s.imports[l]))&&p(n);if(s.weakImports)for(l=0;l<s.weakImports.length;++l)(n=u(s.weakImports[l])||i.resolvePath(e,s.weakImports[l]))&&p(n,!0)}else i.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}a||d||c(null,i)}function p(e,t){if(!(i.files.indexOf(e)>-1))if(i.files.push(e),e in s)a?l(e,s[e]):(++d,setTimeout((function(){--d,l(e,s[e])})));else if(a){var r;try{r=f.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}l(e,r)}else++d,i.fetch(e,(function(r,o){--d,n&&(r?t?d||c(null,i):c(r):l(e,o))}))}var d=0;f.isString(t)&&(t=[t]);for(var y,m=0;m<t.length;++m)(y=i.resolvePath("",t[m]))&&p(y);if(a)return i;d||c(null,i)},l.prototype.loadSync=function(e,t){if(!f.isNode)throw Error("not supported");return this.load(e,t,h)},l.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return n.prototype.resolveAll.call(this)};var p=/^[A-Z]/;function d(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.declaringField=t,t.extensionField=n,r.add(n),!0}return!1}l.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||d(0,e)||this.deferred.push(e);else if(e instanceof c)p.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof i)for(var t=0;t<this.deferred.length;)d(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);p.test(e.name)&&(e.parent[e.name]=e)}},l.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)p.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);p.test(e.name)&&delete e.parent[e.name]}},l._configure=function(e,t,r){i=e,o=t,s=r}},5054:e=>{"use strict";e.exports={}},5994:(e,t,r)=>{"use strict";t.Service=r(7948)},7948:(e,t,r)=>{"use strict";e.exports=i;var n=r(9693);function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return n.asPromise(e,a,t,r,i,o);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof i))try{r=i[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7513:(e,t,r)=>{"use strict";e.exports=a;var n=r(9313);((a.prototype=Object.create(n.prototype)).constructor=a).className="Service";var i=r(4429),o=r(9935),s=r(5994);function a(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var r=new a(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),o=0;o<n.length;++o)r.add(i.fromJSON(n[o],t.methods[n[o]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},a.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return o.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=o.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?(this.methods[e.name]=e,e.parent=this,c(this)):n.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof i){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return n.prototype.remove.call(this,e)},a.prototype.create=function(e,t,r){for(var n,i=new s.Service(e,t,r),a=0;a<this.methodsArray.length;++a){var c=o.lcFirst((n=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");i[c]=o.codegen(["r","c"],o.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return i}},7645:(e,t,r)=>{"use strict";e.exports=g;var n=r(9313);((g.prototype=Object.create(n.prototype)).constructor=g).className="Type";var i=r(7025),o=r(7598),s=r(3548),a=r(6039),c=r(7513),u=r(8368),f=r(1408),l=r(1173),h=r(9935),p=r(4928),d=r(5305),y=r(4497),m=r(3996),v=r(1667);function g(e,t){n.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}function b(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(g.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=h.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=h.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=g.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,h.merge(e.prototype,t)),e.$type=e.prototype.$type=this,h.merge(e,u,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:h.oneOfGetter(this._oneofsArray[r].oneof),set:h.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),g.generateConstructor=function(e){for(var t,r=h.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",h.safeProp(t.name)):t.repeated&&r("this%s=[]",h.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},g.fromJSON=function(e,t){var r=new g(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var u=Object.keys(t.fields),f=0;f<u.length;++f)r.add((void 0!==t.fields[u[f]].keyType?a.fromJSON:s.fromJSON)(u[f],t.fields[u[f]]));if(t.oneofs)for(u=Object.keys(t.oneofs),f=0;f<u.length;++f)r.add(o.fromJSON(u[f],t.oneofs[u[f]]));if(t.nested)for(u=Object.keys(t.nested),f=0;f<u.length;++f){var l=t.nested[u[f]];r.add((void 0!==l.id?s.fromJSON:void 0!==l.fields?g.fromJSON:void 0!==l.values?i.fromJSON:void 0!==l.methods?c.fromJSON:n.fromJSON)(u[f],l))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},g.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return h.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},g.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return n.prototype.resolveAll.call(this)},g.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},g.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof s&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),b(this)}return e instanceof o?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),b(this)):n.prototype.add.call(this,e)},g.prototype.remove=function(e){if(e instanceof s&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),b(this)}if(e instanceof o){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),b(this)}return n.prototype.remove.call(this,e)},g.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},g.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},g.prototype.create=function(e){return new this.ctor(e)},g.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=p(this)({Writer:l,types:t,util:h}),this.decode=d(this)({Reader:f,types:t,util:h}),this.verify=y(this)({types:t,util:h}),this.fromObject=m.fromObject(this)({types:t,util:h}),this.toObject=m.toObject(this)({types:t,util:h});var n=v[e];if(n){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(i),i.toObject=this.toObject,this.toObject=n.toObject.bind(i)}return this},g.prototype.encode=function(e,t){return this.setup().encode(e,t)},g.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},g.prototype.decode=function(e,t){return this.setup().decode(e,t)},g.prototype.decodeDelimited=function(e){return e instanceof f||(e=f.create(e)),this.decode(e,e.uint32())},g.prototype.verify=function(e){return this.setup().verify(e)},g.prototype.fromObject=function(e){return this.setup().fromObject(e)},g.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},g.d=function(e){return function(t){h.decorateType(t,e)}}},7063:(e,t,r)=>{"use strict";var n=t,i=r(9935),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function s(e,t){var r=0,n={};for(t|=0;r<e.length;)n[o[r+t]]=e[r++];return n}n.basic=s([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=s([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",i.emptyArray,null]),n.long=s([0,0,0,1,1],7),n.mapKey=s([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=s([1,5,0,0,0,5,5,0,0,0,1,1,0])},9935:(e,t,r)=>{"use strict";var n,i,o=e.exports=r(9693),s=r(5054);o.codegen=r(5124),o.fetch=r(9054),o.path=r(8626),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},o.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],i=e[r++];void 0!==i&&(t[n]=i)}return t};var a=/\\/g,c=/"/g;o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.isReserved(e)?'["'+e.replace(a,"\\\\").replace(c,'\\"')+'"]':"."+e},o.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;o.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},o.compareFieldsById=function(e,t){return e.id-t.id},o.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(o.decorateRoot.remove(e.$type),e.$type.name=t,o.decorateRoot.add(e.$type)),e.$type;n||(n=r(7645));var i=new n(t||e.name);return o.decorateRoot.add(i),i.ctor=e,Object.defineProperty(e,"$type",{value:i,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:i,enumerable:!1}),i};var f=0;o.decorateEnum=function(e){if(e.$type)return e.$type;i||(i=r(7025));var t=new i("Enum"+f++,e);return o.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},o.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var i=r.shift();if(r.length>0)t[i]=e(t[i]||{},r,n);else{var o=t[i];o&&(n=[].concat(o).concat(n)),t[i]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(o,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(r(9424)))}})},1945:(e,t,r)=>{"use strict";e.exports=i;var n=r(9693);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;i.fromHash=function(e){return e===s?o:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},9693:function(e,t,r){"use strict";var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i<n.length;++i)void 0!==e[n[i]]&&r||(e[n[i]]=t[n[i]]);return e}function o(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&i(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}n.asPromise=r(4537),n.base64=r(7419),n.EventEmitter=r(9211),n.float=r(945),n.inquire=r(7199),n.utf8=r(4997),n.pool=r(6662),n.LongBits=r(1945),n.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},4497:(e,t,r)=>{"use strict";e.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var n=0;n<e.fieldsArray.length;++n){var c=e._fieldsArray[n].resolve(),u="m"+i.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)t("if(!util.isObject(%s))",u)("return%j",o(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),a(t,c,"k[i]"),s(t,c,n,u+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",u)("return%j",o(c,"array"))("for(var i=0;i<%s.length;++i){",u),s(t,c,n,u+"[i]")("}");else{if(c.partOf){var f=i.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",f)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",f)}s(t,c,n,u)}c.optional&&t("}")}return t("return null")};var n=r(7025),i=r(9935);function o(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function s(e,t,r,i){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",i)("default:")("return%j",o(t,"enum value"));for(var s=Object.keys(t.resolvedType.values),a=0;a<s.length;++a)e("case %i:",t.resolvedType.values[s[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,i)("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))",i)("return%j",o(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)))",i,i,i,i)("return%j",o(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",o(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",o(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",o(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",o(t,"buffer"))}return e}function a(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",o(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",o(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",o(t,"boolean key"))}return e}},1667:(e,t,r)=>{"use strict";var n=t,i=r(8368);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var o=this.lookup(n);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var s=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),s["@type"]=n,s}return this.toObject(e,t)}}},1173:(e,t,r)=>{"use strict";e.exports=l;var n,i=r(9693),o=i.LongBits,s=i.base64,a=i.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function f(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var h=function(){return i.Buffer?function(){return(l.create=function(){return new n})()}:function(){return new l}};function p(e,t,r){t[r]=255&e}function d(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function m(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=h(),l.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(l.alloc=i.pool(l.alloc,i.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},d.prototype=Object.create(c.prototype),d.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new d((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(y,10,o.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=o.from(e);return this._push(y,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(y,t.length(),t)},l.prototype.bool=function(e){return this._push(p,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=o.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var v=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(p,1,0);if(i.isString(e)){var r=l.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(v,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(p,1,0)},l.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},l._configure=function(e){n=e,l.create=h(),n._configure()}},3155:(e,t,r)=>{"use strict";e.exports=o;var n=r(1173);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(9693);function o(){n.call(this)}function s(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},o.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},o._configure()},9822:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;const n=r(7187),i=r(8593);class o{constructor(e){var t;e.id&&(this.id=i.decodeBase58(e.id)),this.signer=e.signer,this.provider=e.provider||(null===(t=e.signer)||void 0===t?void 0:t.provider),this.abi=e.abi,this.bytecode=e.bytecode,e.serializer?this.serializer=e.serializer:e.abi&&e.abi.types&&(this.serializer=new n.Serializer(e.abi.types)),this.options={rc_limit:1e8,sendTransaction:!0,sendAbis:!0,...e.options},this.functions={},this.signer&&this.provider&&this.abi&&this.abi.methods&&this.serializer&&Object.keys(this.abi.methods).forEach((e=>{this.functions[e]=async(t={},r)=>{if(!this.provider)throw new Error("provider not found");if(!this.abi||!this.abi.methods)throw new Error("Methods are not defined");if(!this.abi.methods[e])throw new Error(`Method ${e} not defined in the ABI`);const n={...this.options,...r},{readOnly:o,output:s,defaultOutput:a,preformatInput:c,preformatOutput:u}=this.abi.methods[e];let f;f="function"==typeof c?c(t):t;const l=await this.encodeOperation({name:e,args:f});if(o){if(!s)throw new Error(`No output defined for ${e}`);const{result:t}=await this.provider.readContract({contract_id:i.encodeBase58(l.call_contract.contract_id),entry_point:l.call_contract.entry_point,args:i.encodeBase64(l.call_contract.args)});let r=a;return t&&(r=await this.serializer.deserialize(t,s)),"function"==typeof u&&(r=u(r)),{operation:l,result:r}}if(!(null==n?void 0:n.sendTransaction))return{operation:l};if(!this.signer)throw new Error("signer not found");const h=await this.signer.encodeTransaction({...n,operations:[l]}),p={};return(null==n?void 0:n.sendAbis)&&(p[i.encodeBase58(this.id)]=this.abi),{operation:l,transaction:h,transactionResponse:await this.signer.sendTransaction(h,p)}}}))}static computeContractId(e){return i.decodeBase58(e)}getId(){if(!this.id)throw new Error("id is not defined");return i.encodeBase58(this.id)}async deploy(e){if(!this.signer)throw new Error("signer not found");if(!this.bytecode)throw new Error("bytecode not found");const t={...this.options,...e},r={upload_contract:{contract_id:o.computeContractId(this.signer.getAddress()),bytecode:this.bytecode}};if(!(null==t?void 0:t.sendTransaction))return{operation:r};const n=await this.signer.encodeTransaction({...t,operations:[r]});return{operation:r,transaction:n,transactionResponse:await this.signer.sendTransaction(n)}}async encodeOperation(e){if(!this.abi||!this.abi.methods||!this.abi.methods[e.name])throw new Error(`Operation ${e.name} unknown`);if(!this.serializer)throw new Error("Serializer is not defined");if(!this.id)throw new Error("Contract id is not defined");const t=this.abi.methods[e.name];let r=new Uint8Array(0);if(t.input){if(!e.args)throw new Error(`No arguments defined for type '${t.input}'`);r=await this.serializer.serialize(e.args,t.input)}return{call_contract:{contract_id:this.id,entry_point:t.entryPoint,args:r}}}async decodeOperation(e){if(!this.id)throw new Error("Contract id is not defined");if(!this.abi||!this.abi.methods)throw new Error("Methods are not defined");if(!this.serializer)throw new Error("Serializer is not defined");if(!e.call_contract)throw new Error("Operation is not CallContractOperation");if(e.call_contract.contract_id!==this.id)throw new Error(`Invalid contract id. Expected: ${i.encodeBase58(this.id)}. Received: ${i.encodeBase58(e.call_contract.contract_id)}`);for(let t=0;t<Object.keys(this.abi.methods).length;t+=1){const r=Object.keys(this.abi.methods)[t],n=this.abi.methods[r];if(e.call_contract.entry_point===n.entryPoint)return n.input?{name:r,args:await this.serializer.deserialize(e.call_contract.args,n.input)}:{name:r}}throw new Error(`Unknown method id ${e.call_contract.entry_point}`)}}t.Contract=o,t.default=o},5635:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;const i=n(r(9669));async function o(e){return new Promise((t=>setTimeout(t,e)))}class s{constructor(e){Array.isArray(e)?this.rpcNodes=e:this.rpcNodes=[e],this.currentNodeId=0,this.onError=()=>!1}async call(e,t){let r={data:{},status:0,statusText:"",headers:{},config:{}},n=!1;for(;!n;)try{const o={id:Math.round(1e3*Math.random()),jsonrpc:"2.0",method:e,params:t},s=this.rpcNodes[this.currentNodeId];r=await i.default.post(s,o,{validateStatus:e=>e<400}),n=!0}catch(e){const t=this.rpcNodes[this.currentNodeId];this.currentNodeId=(this.currentNodeId+1)%this.rpcNodes.length;const r=this.rpcNodes[this.currentNodeId];if(this.onError(e,t,r))throw e}if(r.data.error)throw new Error(JSON.stringify({error:r.data.error,request:{method:e,params:t}}));return r.data.result}async getNonce(e){const{nonce:t}=await this.call("chain.get_account_nonce",{account:e});return t?Number(t):0}async getAccountRc(e){const{rc:t}=await this.call("chain.get_account_rc",{account:e});return t||"0"}async getTransactionsById(e){return this.call("transaction_store.get_transactions_by_id",{transaction_ids:e})}async getBlocksById(e){return this.call("block_store.get_blocks_by_id",{block_id:e,return_block:!0,return_receipt:!1})}async getHeadInfo(){return this.call("chain.get_head_info",{})}async getBlocks(e,t=1,r){let n=r;return n||(n=(await this.getHeadInfo()).head_topology.id),(await this.call("block_store.get_blocks_by_height",{head_block_id:n,ancestor_start_height:e,num_blocks:t,return_block:!0,return_receipt:!1})).block_items}async getBlock(e){return(await this.getBlocks(e,1))[0]}async sendTransaction(e){return await this.call("chain.submit_transaction",{transaction:e}),{wait:async(t="byBlock",r=3e4)=>{const n=Date.now();if("byTransactionId"===t){for(;Date.now()<n+r;){await o(1e3);const{transactions:t}=await this.getTransactionsById([e.id]);if(t&&t[0]&&t[0].containing_blocks)return t[0].containing_blocks[0]}throw new Error(`Transaction not mined after ${r} ms`)}const i=async(t,r,n)=>{const i=await this.getBlocks(t,r,n);let o=0;i.forEach((t=>{t&&t.block&&t.block_id&&t.block.transactions&&t.block.transactions.find((t=>t.id===e.id))&&(o=Number(t.block_height))}));let s=i[i.length-1].block_id;return[o,s]};let s=0,a=0,c="";for(;Date.now()<n+r;){await o(1e3);const{head_topology:e}=await this.getHeadInfo();if(0===s&&(s=Number(e.height),a=s),Number(e.height)===s-1&&c&&c!==e.id){const[t,r]=await i(a,Number(e.height)-a+1,e.id);if(t)return t;c=r,s=Number(e.height)+1}if(s>Number(e.height))continue;const[t,r]=await i(s,1,e.id);if(t)return t;c||(c=r),s+=1}throw new Error(`Transaction not mined after ${r} ms. Blocks checked from ${a} to ${s}`)}}}async readContract(e){return this.call("chain.read_contract",e)}}t.Provider=s,t.default=s},7187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Serializer=void 0;const n=r(4492),i=r(8593),o="(koinos_bytes_type)";class s{constructor(e,t){this.bytesConversion=!0,this.types=e,this.root=n.Root.fromJSON(this.types),(null==t?void 0:t.defaultTypeName)&&(this.defaultType=this.root.lookupType(t.defaultTypeName)),t&&void 0!==t.bytesConversion&&(this.bytesConversion=t.bytesConversion)}async serialize(e,t){const r=this.defaultType||this.root.lookupType(t);let n={};this.bytesConversion?Object.keys(r.fields).forEach((t=>{const{options:s,name:a,type:c}=r.fields[t];var u;if("bytes"===c)if(s&&s[o])switch(s[o]){case"BASE58":case"CONTRACT_ID":case"ADDRESS":n[a]=i.decodeBase58(e[a]);break;case"BASE64":n[a]=i.decodeBase64(e[a]);break;case"HEX":case"BLOCK_ID":case"TRANSACTION_ID":n[a]=i.toUint8Array(e[a].replace("0x",""));break;default:throw new Error(`unknown koinos_byte_type ${s[o]}`)}else n[a]=i.decodeBase64(e[a]);else n[a]="string"==typeof(u=e[a])||"number"==typeof u?u:JSON.parse(JSON.stringify(u))})):n=e;const s=r.create(n);return r.encode(s).finish()}async deserialize(e,t){const r="string"==typeof e?i.decodeBase64(e):e,n=this.defaultType||this.root.lookupType(t),s=n.decode(r),a=n.toObject(s,{longs:String});return this.bytesConversion?(Object.keys(n.fields).forEach((e=>{const{options:t,name:r,type:s}=n.fields[e];if("bytes"===s)if(t&&t[o])switch(t[o]){case"BASE58":case"CONTRACT_ID":case"ADDRESS":a[r]=i.encodeBase58(a[r]);break;case"BASE64":a[r]=i.encodeBase64(a[r]);break;case"HEX":case"BLOCK_ID":case"TRANSACTION_ID":a[r]=`0x${i.toHexString(a[r])}`;break;default:throw new Error(`unknown koinos_byte_type ${t[o]}`)}else a[r]=i.encodeBase64(a[r])})),a):a}}t.Serializer=s,t.default=s},6991:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=void 0;const a=r(5374),c=o(r(1337)),u=s(r(6139)),f=r(8593),l=r(7187);class h{constructor(e){this.compressed=void 0===e.compressed||e.compressed,this.privateKey=e.privateKey,this.provider=e.provider,e.serializer?this.serializer=e.serializer:this.serializer=new l.Serializer(u.default,{defaultTypeName:"active_transaction_data",bytesConversion:!1}),"string"==typeof e.privateKey?(this.publicKey=c.getPublicKey(e.privateKey,this.compressed),this.address=f.bitcoinAddress(f.toUint8Array(this.publicKey))):(this.publicKey=c.getPublicKey(e.privateKey,this.compressed),this.address=f.bitcoinAddress(this.publicKey))}static fromWif(e){const t="5"!==e[0],r=f.bitcoinDecode(e);return new h({privateKey:f.toHexString(r),compressed:t})}static fromSeed(e,t){const r=a.sha256(e);return new h({privateKey:r,compressed:t})}getAddress(e=!0){if("string"==typeof this.privateKey){const t=c.getPublicKey(this.privateKey,e);return f.bitcoinAddress(f.toUint8Array(t))}const t=c.getPublicKey(this.privateKey,e);return f.bitcoinAddress(t)}getPrivateKey(e="hex",t){let r;r=this.privateKey instanceof Uint8Array?f.toHexString(this.privateKey):"string"==typeof this.privateKey?this.privateKey:BigInt(this.privateKey).toString(16).padStart(64,"0");const n=void 0===t?this.compressed:t;switch(e){case"hex":return r;case"wif":return f.bitcoinEncode(f.toUint8Array(r),"private",n);default:throw new Error(`Invalid format ${e}`)}}async signTransaction(e){if(!e.active)throw new Error("Active data is not defined");const t=a.sha256(f.decodeBase64(e.active)),[r,n]=await c.sign(t,this.privateKey,{recovered:!0,canonical:!0,der:!1}),i=new Uint8Array(65);i.set([n+31],0),i.set(r,1),e.signature_data=f.encodeBase64(i);const o=`0x1220${f.toHexString(t)}`;return e.id=o,e}async sendTransaction(e,t){if(e.signature_data&&e.id||await this.signTransaction(e),!this.provider)throw new Error("provider is undefined");return this.provider.sendTransaction(e)}static async recoverPublicKey(e,t){if(!e.active)throw new Error("active is not defined");if(!e.signature_data)throw new Error("signature_data is not defined");let r=e.signature_data;t&&"function"==typeof t.transformSignature&&(r=await t.transformSignature(e.signature_data));let n=!0;t&&void 0!==t.compressed&&(n=t.compressed);const i=a.sha256(f.decodeBase64(e.active)),o=f.toHexString(f.decodeBase64(r)),s=Number(`0x${o.slice(0,2)}`)-31,u=o.slice(2,66),l=o.slice(66),h=BigInt(`0x${u}`),p=BigInt(`0x${l}`),d=new c.Signature(h,p),y=c.recoverPublicKey(f.toHexString(i),d.toHex(),s);if(!y)throw new Error("Public key cannot be recovered");return n?c.Point.fromHex(y).toHex(!0):y}static async recoverAddress(e,t){const r=await h.recoverPublicKey(e,t);return f.bitcoinAddress(f.toUint8Array(r))}async encodeTransaction(e){let{nonce:t}=e;if(void 0===e.nonce){if(!this.provider)throw new Error("Cannot get the nonce because provider is undefined. To skip this call set a nonce in the parameters");t=await this.provider.getNonce(this.getAddress())}const r={rc_limit:void 0===e.rc_limit?1e6:e.rc_limit,nonce:t,operations:e.operations?e.operations:[]},n=await this.serializer.serialize(r);return{active:f.encodeBase64(n)}}async decodeTransaction(e){if(!e.active)throw new Error("Active data is not defined");return this.serializer.deserialize(e.active)}}t.Signer=h,t.default=h},5738:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r(8593)),a=r(9822),c=r(6991),u=r(5635),f=r(7187);window.utils=s,window.Contract=a.Contract,window.Signer=c.Signer,window.Provider=u.Provider,window.Serializer=f.Serializer},8593:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolTypes=t.Krc20Abi=t.parseUnits=t.formatUnits=t.bitcoinAddress=t.bitcoinDecode=t.bitcoinEncode=t.decodeBase64=t.encodeBase64=t.decodeBase58=t.encodeBase58=t.toHexString=t.toUint8Array=void 0;const a=o(r(6957)),c=r(5374),u=r(7050),f=s(r(7177)),l=s(r(6139));function h(e){return(new TextDecoder).decode(a.encode("z",e)).slice(1)}function p(e){return a.decode(`z${e}`)}function d(e,t,r=!1){let n,i,o;"public"===t?(n=new Uint8Array(25),i=new Uint8Array(21),n[0]=0,i[0]=0,o=21):(r?(n=new Uint8Array(38),i=new Uint8Array(34),o=34,n[33]=1,i[33]=1):(n=new Uint8Array(37),i=new Uint8Array(33),o=33),n[0]=128,i[0]=128),i.set(e,1);const s=c.sha256(i),a=c.sha256(s),u=new Uint8Array(4);return u.set(a.slice(0,4)),n.set(e,1),n.set(u,o),h(n)}t.toUint8Array=function(e){const t=e.match(/[\dA-F]{2}/gi);if(!t)throw new Error("Invalid hex");return new Uint8Array(t.map((e=>parseInt(e,16))))},t.toHexString=function(e){return Array.from(e).map((e=>`0${Number(e).toString(16)}`.slice(-2))).join("")},t.encodeBase58=h,t.decodeBase58=p,t.encodeBase64=function(e){return(new TextDecoder).decode(a.encode("U",e)).slice(1)},t.decodeBase64=function(e){return a.decode(`U${e}`)},t.bitcoinEncode=d,t.bitcoinDecode=function(e){const t=p(e),r=new Uint8Array(32),n=new Uint8Array(4);return r.set(t.slice(1,33)),"5"!==e[0]?n.set(t.slice(34,38)):n.set(t.slice(33,37)),r},t.bitcoinAddress=function(e){const t=c.sha256(e);return d(u.ripemd160(t),"public")},t.formatUnits=function(e,t){let r="string"==typeof e?e:BigInt(e).toString();const n="-"===r[0]?"-":"";return r=r.replace("-","").padStart(t+1,"0"),`${n}${r.substring(0,r.length-t).replace(/^0+(?=\d)/,"")}.${r.substring(r.length-t)}`.replace(/(\.0+)?(0+)$/,"")},t.parseUnits=function(e,t){const r="-"===e[0]?"-":"";let[n,i]=e.replace("-","").replace(",",".").split(".");return i||(i=""),i=i.padEnd(t,"0"),`${r}${`${n}${i}`.replace(/^0+(?=\d)/,"")}`},t.Krc20Abi={methods:{name:{entryPoint:1995063959,input:"name_arguments",output:"name_result",readOnly:!0},symbol:{entryPoint:2121878308,input:"symbol_arguments",output:"symbol_result",readOnly:!0},decimals:{entryPoint:1507595726,input:"decimals_arguments",output:"decimals_result",readOnly:!0},totalSupply:{entryPoint:3475931666,input:"total_supply_arguments",output:"total_supply_result",readOnly:!0},balanceOf:{entryPoint:358715976,input:"balance_of_arguments",output:"balance_of_result",readOnly:!0,defaultOutput:{value:"0"}},transfer:{entryPoint:1659871890,input:"transfer_arguments",output:"transfer_result"},mint:{entryPoint:3271044060,input:"mint_argumnets",output:"mint_result"}},types:f.default},t.ProtocolTypes=l.default},5102:()=>{},7177:e=>{"use strict";e.exports=JSON.parse('{"nested":{"koinos":{"nested":{"contracts":{"nested":{"token":{"options":{"go_package":"github.com/koinos/koinos-proto-golang/koinos/contracts/token"},"nested":{"name_arguments":{"fields":{}},"name_result":{"fields":{"value":{"type":"string","id":1}}},"symbol_arguments":{"fields":{}},"symbol_result":{"fields":{"value":{"type":"string","id":1}}},"decimals_arguments":{"fields":{}},"decimals_result":{"fields":{"value":{"type":"uint32","id":1}}},"total_supply_arguments":{"fields":{}},"total_supply_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"balance_of_arguments":{"fields":{"owner":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"ADDRESS"}}}},"balance_of_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"transfer_arguments":{"fields":{"from":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"ADDRESS"}},"to":{"type":"bytes","id":2,"options":{"(koinos_bytes_type)":"ADDRESS"}},"value":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"transfer_result":{"fields":{"value":{"type":"bool","id":1}}},"mint_arguments":{"fields":{"to":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"mint_result":{"fields":{"value":{"type":"bool","id":1}}},"balance_object":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"mana_balance_object":{"fields":{"balance":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}},"mana":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"last_mana_update":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}}}}}}}}}}')},6139:e=>{"use strict";e.exports=JSON.parse('{"nested":{"koinos":{"nested":{"protocol":{"options":{"go_package":"github.com/koinos/koinos-proto-golang/koinos/protocol"},"nested":{"contract_call_bundle":{"fields":{"contract_id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"CONTRACT_ID"}},"entry_point":{"type":"uint32","id":2}}},"system_call_target":{"oneofs":{"target":{"oneof":["thunk_id","system_call_bundle"]}},"fields":{"thunk_id":{"type":"uint32","id":1},"system_call_bundle":{"type":"contract_call_bundle","id":2}}},"upload_contract_operation":{"fields":{"contract_id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"CONTRACT_ID"}},"bytecode":{"type":"bytes","id":2}}},"call_contract_operation":{"fields":{"contract_id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"CONTRACT_ID"}},"entry_point":{"type":"uint32","id":2},"args":{"type":"bytes","id":3}}},"set_system_call_operation":{"fields":{"call_id":{"type":"uint32","id":1},"target":{"type":"system_call_target","id":2}}},"operation":{"oneofs":{"op":{"oneof":["upload_contract","call_contract","set_system_call"]}},"fields":{"upload_contract":{"type":"upload_contract_operation","id":1},"call_contract":{"type":"call_contract_operation","id":2},"set_system_call":{"type":"set_system_call_operation","id":3}}},"active_transaction_data":{"fields":{"rc_limit":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}},"nonce":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"operations":{"rule":"repeated","type":"operation","id":3}}},"passive_transaction_data":{"fields":{}},"transaction":{"fields":{"id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"TRANSACTION_ID"}},"active":{"type":"bytes","id":2},"passive":{"type":"bytes","id":3},"signature_data":{"type":"bytes","id":4}}},"active_block_data":{"fields":{"transaction_merkle_root":{"type":"bytes","id":1},"passive_data_merkle_root":{"type":"bytes","id":2},"signer":{"type":"bytes","id":3}}},"passive_block_data":{"fields":{}},"block_header":{"fields":{"previous":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"BLOCK_ID"}},"height":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"timestamp":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"block":{"fields":{"id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"BLOCK_ID"}},"header":{"type":"block_header","id":2},"active":{"type":"bytes","id":3},"passive":{"type":"bytes","id":4},"signature_data":{"type":"bytes","id":5},"transactions":{"rule":"repeated","type":"transaction","id":6}}},"block_receipt":{"fields":{}}}}}}}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__=__webpack_require__(5738)})();
|
package/lib/Provider.d.ts
CHANGED
|
@@ -101,7 +101,7 @@ export declare class Provider {
|
|
|
101
101
|
*/
|
|
102
102
|
getBlocks(height: number, numBlocks?: number, idRef?: string): Promise<{
|
|
103
103
|
block_id: string;
|
|
104
|
-
block_height:
|
|
104
|
+
block_height: string;
|
|
105
105
|
block: BlockJson;
|
|
106
106
|
block_receipt: {
|
|
107
107
|
[x: string]: unknown;
|
|
@@ -112,7 +112,7 @@ export declare class Provider {
|
|
|
112
112
|
*/
|
|
113
113
|
getBlock(height: number): Promise<{
|
|
114
114
|
block_id: string;
|
|
115
|
-
block_height:
|
|
115
|
+
block_height: string;
|
|
116
116
|
block: BlockJson;
|
|
117
117
|
block_receipt: {
|
|
118
118
|
[x: string]: unknown;
|
|
@@ -122,7 +122,7 @@ export declare class Provider {
|
|
|
122
122
|
* Function to call "chain.submit_transaction" to send a signed
|
|
123
123
|
* transaction to the blockchain. It returns an object with the async
|
|
124
124
|
* function "wait", which can be called to wait for the
|
|
125
|
-
* transaction to be mined.
|
|
125
|
+
* transaction to be mined (see [[SendTransactionResponse]]).
|
|
126
126
|
* @param transaction - Signed transaction
|
|
127
127
|
* @example
|
|
128
128
|
* ```ts
|
|
@@ -133,7 +133,9 @@ export declare class Provider {
|
|
|
133
133
|
* });
|
|
134
134
|
* console.log("Transaction submitted to the mempool");
|
|
135
135
|
* // wait to be mined
|
|
136
|
-
* const
|
|
136
|
+
* const blockNumber = await transactionResponse.wait();
|
|
137
|
+
* // const blockNumber = await transactionResponse.wait("byBlock", 30000);
|
|
138
|
+
* // const blockId = await transactionResponse.wait("byTransactionId", 30000);
|
|
137
139
|
* console.log("Transaction mined")
|
|
138
140
|
* ```
|
|
139
141
|
*/
|
package/lib/Provider.js
CHANGED
|
@@ -158,7 +158,7 @@ class Provider {
|
|
|
158
158
|
* Function to call "chain.submit_transaction" to send a signed
|
|
159
159
|
* transaction to the blockchain. It returns an object with the async
|
|
160
160
|
* function "wait", which can be called to wait for the
|
|
161
|
-
* transaction to be mined.
|
|
161
|
+
* transaction to be mined (see [[SendTransactionResponse]]).
|
|
162
162
|
* @param transaction - Signed transaction
|
|
163
163
|
* @example
|
|
164
164
|
* ```ts
|
|
@@ -169,19 +169,19 @@ class Provider {
|
|
|
169
169
|
* });
|
|
170
170
|
* console.log("Transaction submitted to the mempool");
|
|
171
171
|
* // wait to be mined
|
|
172
|
-
* const
|
|
172
|
+
* const blockNumber = await transactionResponse.wait();
|
|
173
|
+
* // const blockNumber = await transactionResponse.wait("byBlock", 30000);
|
|
174
|
+
* // const blockId = await transactionResponse.wait("byTransactionId", 30000);
|
|
173
175
|
* console.log("Transaction mined")
|
|
174
176
|
* ```
|
|
175
177
|
*/
|
|
176
178
|
async sendTransaction(transaction) {
|
|
177
179
|
await this.call("chain.submit_transaction", { transaction });
|
|
178
|
-
const startTime = Date.now() + 10000;
|
|
179
180
|
return {
|
|
180
|
-
wait: async (type = "
|
|
181
|
-
|
|
182
|
-
await sleep(startTime - Date.now() - 1000);
|
|
181
|
+
wait: async (type = "byBlock", timeout = 30000) => {
|
|
182
|
+
const iniTime = Date.now();
|
|
183
183
|
if (type === "byTransactionId") {
|
|
184
|
-
|
|
184
|
+
while (Date.now() < iniTime + timeout) {
|
|
185
185
|
await sleep(1000);
|
|
186
186
|
const { transactions } = await this.getTransactionsById([
|
|
187
187
|
transaction.id,
|
|
@@ -191,34 +191,54 @@ class Provider {
|
|
|
191
191
|
transactions[0].containing_blocks)
|
|
192
192
|
return transactions[0].containing_blocks[0];
|
|
193
193
|
}
|
|
194
|
-
throw new Error(`Transaction not mined after
|
|
194
|
+
throw new Error(`Transaction not mined after ${timeout} ms`);
|
|
195
195
|
}
|
|
196
196
|
// byBlock
|
|
197
|
+
const findTxInBlocks = async (ini, numBlocks, idRef) => {
|
|
198
|
+
const blocks = await this.getBlocks(ini, numBlocks, idRef);
|
|
199
|
+
let bNum = 0;
|
|
200
|
+
blocks.forEach((block) => {
|
|
201
|
+
if (!block ||
|
|
202
|
+
!block.block ||
|
|
203
|
+
!block.block_id ||
|
|
204
|
+
!block.block.transactions)
|
|
205
|
+
return;
|
|
206
|
+
const tx = block.block.transactions.find((t) => t.id === transaction.id);
|
|
207
|
+
if (tx)
|
|
208
|
+
bNum = Number(block.block_height);
|
|
209
|
+
});
|
|
210
|
+
let lastId = blocks[blocks.length - 1].block_id;
|
|
211
|
+
return [bNum, lastId];
|
|
212
|
+
};
|
|
197
213
|
let blockNumber = 0;
|
|
198
214
|
let iniBlock = 0;
|
|
199
|
-
|
|
215
|
+
let previousId = "";
|
|
216
|
+
while (Date.now() < iniTime + timeout) {
|
|
200
217
|
await sleep(1000);
|
|
201
218
|
const { head_topology: headTopology } = await this.getHeadInfo();
|
|
202
|
-
if (
|
|
219
|
+
if (blockNumber === 0) {
|
|
203
220
|
blockNumber = Number(headTopology.height);
|
|
204
221
|
iniBlock = blockNumber;
|
|
205
222
|
}
|
|
206
|
-
|
|
207
|
-
|
|
223
|
+
if (Number(headTopology.height) === blockNumber - 1 &&
|
|
224
|
+
previousId &&
|
|
225
|
+
previousId !== headTopology.id) {
|
|
226
|
+
const [bNum, lastId] = await findTxInBlocks(iniBlock, Number(headTopology.height) - iniBlock + 1, headTopology.id);
|
|
227
|
+
if (bNum)
|
|
228
|
+
return bNum;
|
|
229
|
+
previousId = lastId;
|
|
230
|
+
blockNumber = Number(headTopology.height) + 1;
|
|
208
231
|
}
|
|
209
232
|
if (blockNumber > Number(headTopology.height))
|
|
210
233
|
continue;
|
|
211
|
-
const [
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
const tx = block.block.transactions.find((t) => t.id === transaction.id);
|
|
218
|
-
if (tx)
|
|
219
|
-
return blockNumber.toString();
|
|
234
|
+
const [bNum, lastId] = await findTxInBlocks(blockNumber, 1, headTopology.id);
|
|
235
|
+
if (bNum)
|
|
236
|
+
return bNum;
|
|
237
|
+
if (!previousId)
|
|
238
|
+
previousId = lastId;
|
|
239
|
+
blockNumber += 1;
|
|
220
240
|
}
|
|
221
|
-
throw new Error(`Transaction not mined from
|
|
241
|
+
throw new Error(`Transaction not mined after ${timeout} ms. Blocks checked from ${iniBlock} to ${blockNumber}`);
|
|
222
242
|
},
|
|
223
243
|
};
|
|
224
244
|
}
|
package/lib/Provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../src/Provider.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAQ7C,KAAK,UAAU,KAAK,CAAC,EAAU;IAC7B,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,MAAa,QAAQ;IAwCnB;;;;;;;;;;;OAWG;IACH,YAAY,QAA2B;QACrC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;YAAE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;;YACjD,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAQ,CAAC,CAAC;QAChC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CAAc,MAAc,EAAE,MAAe;QACrD,IAAI,QAAQ,GAGP;YACH,IAAI,EAAE,EAAE;YACR,MAAM,EAAE,CAAC;YACT,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,EAAE;SACX,CAAC;QAEF,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,qCAAqC;QACrC,OAAO,CAAC,OAAO,EAAE;YACf,IAAI;gBACF,MAAM,IAAI,GAAG;oBACX,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;oBACpC,OAAO,EAAE,KAAK;oBACd,MAAM;oBACN,MAAM;iBACP,CAAC;gBAEF,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;gBAE9C,uDAAuD;gBACvD;;;;;;sCAMsB;gBAEtB,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAGxB,GAAG,EAAE,IAAI,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;gBAClD,OAAO,GAAG,IAAI,CAAC;aAChB;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;gBACtD,IAAI,CAAC,aAAa,GAAG,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;gBACrE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;gBAClD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;gBAC7D,IAAI,KAAK;oBAAE,MAAM,CAAC,CAAC;aACpB;SACF;QACD,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK;YACrB,MAAM,IAAI,KAAK,CACb,IAAI,CAAC,SAAS,CAAC;gBACb,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK;gBAC1B,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;aAC5B,CAAC,CACH,CAAC;QACJ,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAW,CAAC;IACnC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,QAAQ,CAAC,OAAe;QAC5B,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAC/B,yBAAyB,EACzB,EAAE,OAAO,EAAE,CACZ,CAAC;QACF,IAAI,CAAC,KAAK;YAAE,OAAO,CAAC,CAAC;QACrB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAe;QAChC,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAiB,sBAAsB,EAAE;YACrE,OAAO;SACR,CAAC,CAAC;QACH,IAAI,CAAC,EAAE;YAAE,OAAO,GAAG,CAAC;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CAAC,cAAwB;QAMhD,OAAO,IAAI,CAAC,IAAI,CAKb,0CAA0C,EAAE;YAC7C,eAAe,EAAE,cAAc;SAChC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,QAAkB;QAOpC,OAAO,IAAI,CAAC,IAAI,CAAC,8BAA8B,EAAE;YAC/C,QAAQ,EAAE,QAAQ;YAClB,YAAY,EAAE,IAAI;YAClB,cAAc,EAAE,KAAK;SACtB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW;QAQf,OAAO,IAAI,CAAC,IAAI,CAOb,qBAAqB,EAAE,EAAE,CAAC,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,SAAS,CACb,MAAc,EACd,SAAS,GAAG,CAAC,EACb,KAAc;QAWd,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;YACtC,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;SACpC;QACD,OAAO,CACL,MAAM,IAAI,CAAC,IAAI,CASZ,kCAAkC,EAAE;YACrC,aAAa,EAAE,UAAU;YACzB,qBAAqB,EAAE,MAAM;YAC7B,UAAU,EAAE,SAAS;YACrB,YAAY,EAAE,IAAI;YAClB,cAAc,EAAE,KAAK;SACtB,CAAC,CACH,CAAC,WAAW,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,MAAc;QAQ3B,OAAO,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../src/Provider.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAQ7C,KAAK,UAAU,KAAK,CAAC,EAAU;IAC7B,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,MAAa,QAAQ;IAwCnB;;;;;;;;;;;OAWG;IACH,YAAY,QAA2B;QACrC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;YAAE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;;YACjD,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAQ,CAAC,CAAC;QAChC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CAAc,MAAc,EAAE,MAAe;QACrD,IAAI,QAAQ,GAGP;YACH,IAAI,EAAE,EAAE;YACR,MAAM,EAAE,CAAC;YACT,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,EAAE;SACX,CAAC;QAEF,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,qCAAqC;QACrC,OAAO,CAAC,OAAO,EAAE;YACf,IAAI;gBACF,MAAM,IAAI,GAAG;oBACX,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;oBACpC,OAAO,EAAE,KAAK;oBACd,MAAM;oBACN,MAAM;iBACP,CAAC;gBAEF,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;gBAE9C,uDAAuD;gBACvD;;;;;;sCAMsB;gBAEtB,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAGxB,GAAG,EAAE,IAAI,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;gBAClD,OAAO,GAAG,IAAI,CAAC;aAChB;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;gBACtD,IAAI,CAAC,aAAa,GAAG,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;gBACrE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;gBAClD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;gBAC7D,IAAI,KAAK;oBAAE,MAAM,CAAC,CAAC;aACpB;SACF;QACD,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK;YACrB,MAAM,IAAI,KAAK,CACb,IAAI,CAAC,SAAS,CAAC;gBACb,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK;gBAC1B,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;aAC5B,CAAC,CACH,CAAC;QACJ,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAW,CAAC;IACnC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,QAAQ,CAAC,OAAe;QAC5B,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAC/B,yBAAyB,EACzB,EAAE,OAAO,EAAE,CACZ,CAAC;QACF,IAAI,CAAC,KAAK;YAAE,OAAO,CAAC,CAAC;QACrB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAe;QAChC,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAiB,sBAAsB,EAAE;YACrE,OAAO;SACR,CAAC,CAAC;QACH,IAAI,CAAC,EAAE;YAAE,OAAO,GAAG,CAAC;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CAAC,cAAwB;QAMhD,OAAO,IAAI,CAAC,IAAI,CAKb,0CAA0C,EAAE;YAC7C,eAAe,EAAE,cAAc;SAChC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,QAAkB;QAOpC,OAAO,IAAI,CAAC,IAAI,CAAC,8BAA8B,EAAE;YAC/C,QAAQ,EAAE,QAAQ;YAClB,YAAY,EAAE,IAAI;YAClB,cAAc,EAAE,KAAK;SACtB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW;QAQf,OAAO,IAAI,CAAC,IAAI,CAOb,qBAAqB,EAAE,EAAE,CAAC,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,SAAS,CACb,MAAc,EACd,SAAS,GAAG,CAAC,EACb,KAAc;QAWd,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;YACtC,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;SACpC;QACD,OAAO,CACL,MAAM,IAAI,CAAC,IAAI,CASZ,kCAAkC,EAAE;YACrC,aAAa,EAAE,UAAU;YACzB,qBAAqB,EAAE,MAAM;YAC7B,UAAU,EAAE,SAAS;YACrB,YAAY,EAAE,IAAI;YAClB,cAAc,EAAE,KAAK;SACtB,CAAC,CACH,CAAC,WAAW,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,MAAc;QAQ3B,OAAO,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,KAAK,CAAC,eAAe,CACnB,WAA4B;QAE5B,MAAM,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;QAC7D,OAAO;YACL,IAAI,EAAE,KAAK,EACT,OAAsC,SAAS,EAC/C,OAAO,GAAG,KAAK,EACf,EAAE;gBACF,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;gBAC3B,IAAI,IAAI,KAAK,iBAAiB,EAAE;oBAC9B,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,OAAO,EAAE;wBACrC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;wBAClB,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC;4BACtD,WAAW,CAAC,EAAY;yBACzB,CAAC,CAAC;wBACH,IACE,YAAY;4BACZ,YAAY,CAAC,CAAC,CAAC;4BACf,YAAY,CAAC,CAAC,CAAC,CAAC,iBAAiB;4BAEjC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;qBAC/C;oBACD,MAAM,IAAI,KAAK,CAAC,+BAA+B,OAAO,KAAK,CAAC,CAAC;iBAC9D;gBAED,UAAU;gBACV,MAAM,cAAc,GAAG,KAAK,EAC1B,GAAW,EACX,SAAiB,EACjB,KAAa,EACc,EAAE;oBAC7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;oBAC3D,IAAI,IAAI,GAAG,CAAC,CAAC;oBACb,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;wBACvB,IACE,CAAC,KAAK;4BACN,CAAC,KAAK,CAAC,KAAK;4BACZ,CAAC,KAAK,CAAC,QAAQ;4BACf,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY;4BAEzB,OAAO;wBACT,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CACtC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,WAAW,CAAC,EAAE,CAC/B,CAAC;wBACF,IAAI,EAAE;4BAAE,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;oBAC5C,CAAC,CAAC,CAAC;oBACH,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC;oBAChD,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;gBACxB,CAAC,CAAC;gBAEF,IAAI,WAAW,GAAG,CAAC,CAAC;gBACpB,IAAI,QAAQ,GAAG,CAAC,CAAC;gBACjB,IAAI,UAAU,GAAG,EAAE,CAAC;gBAEpB,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,OAAO,EAAE;oBACrC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;oBAClB,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;oBACjE,IAAI,WAAW,KAAK,CAAC,EAAE;wBACrB,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;wBAC1C,QAAQ,GAAG,WAAW,CAAC;qBACxB;oBACD,IACE,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,WAAW,GAAG,CAAC;wBAC/C,UAAU;wBACV,UAAU,KAAK,YAAY,CAAC,EAAE,EAC9B;wBACA,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,MAAM,cAAc,CACzC,QAAQ,EACR,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,QAAQ,GAAG,CAAC,EAC1C,YAAY,CAAC,EAAE,CAChB,CAAC;wBACF,IAAI,IAAI;4BAAE,OAAO,IAAI,CAAC;wBACtB,UAAU,GAAG,MAAM,CAAC;wBACpB,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;qBAC/C;oBACD,IAAI,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC;wBAAE,SAAS;oBACxD,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,MAAM,cAAc,CACzC,WAAW,EACX,CAAC,EACD,YAAY,CAAC,EAAE,CAChB,CAAC;oBACF,IAAI,IAAI;wBAAE,OAAO,IAAI,CAAC;oBACtB,IAAI,CAAC,UAAU;wBAAE,UAAU,GAAG,MAAM,CAAC;oBACrC,WAAW,IAAI,CAAC,CAAC;iBAClB;gBACD,MAAM,IAAI,KAAK,CACb,+BAA+B,OAAO,4BAA4B,QAAQ,OAAO,WAAW,EAAE,CAC/F,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,YAAY,CAAC,SAAoC;QAIrD,OAAO,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;IACrD,CAAC;CACF;AAnYD,4BAmYC;AAED,kBAAe,QAAQ,CAAC"}
|
package/lib/interface.d.ts
CHANGED
|
@@ -133,7 +133,25 @@ export interface RecoverPublicKeyOptions {
|
|
|
133
133
|
transformSignature?: (signatureData: string) => Promise<string>;
|
|
134
134
|
}
|
|
135
135
|
export interface SendTransactionResponse {
|
|
136
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Function to wait for a transaction to be mined.
|
|
138
|
+
* This function comes as a response after sending a transaction.
|
|
139
|
+
* See [[Provider.sendTransaction]]
|
|
140
|
+
*
|
|
141
|
+
* @param type - Type must be "byBlock" (default) or "byTransactionId".
|
|
142
|
+
* _byBlock_ will query the blockchain to get blocks and search for the
|
|
143
|
+
* transaction there. _byTransactionId_ will query the "transaction store"
|
|
144
|
+
* microservice to search the transaction by its id. If non of them is
|
|
145
|
+
* specified the function will use "byBlock" (as "byTransactionId"
|
|
146
|
+
* requires the transaction store, which is an optional microservice).
|
|
147
|
+
*
|
|
148
|
+
* When _byBlock_ is used it returns the block number.
|
|
149
|
+
*
|
|
150
|
+
* When _byTransactionId_ is used it returns the block id.
|
|
151
|
+
*
|
|
152
|
+
* @param timeout - Timeout in milliseconds. By default it is 30000
|
|
153
|
+
*/
|
|
154
|
+
wait: (type?: "byBlock" | "byTransactionId", timeout?: number) => Promise<string | number>;
|
|
137
155
|
}
|
|
138
156
|
declare type NumberLike = number | bigint | string;
|
|
139
157
|
export interface UploadContractOperation {
|