@taquito/taquito 17.3.1-beta-RC.0 → 17.3.2
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/README.md +2 -2
- package/dist/lib/estimate/rpc-estimate-provider.js +3 -3
- package/dist/lib/version.js +2 -2
- package/dist/lib/version.js.map +1 -1
- package/dist/taquito.es6.js +5 -5
- package/dist/taquito.es6.js.map +1 -1
- package/dist/taquito.min.js +1 -1
- package/dist/taquito.umd.js +5 -5
- package/dist/taquito.umd.js.map +1 -1
- package/package.json +9 -9
package/dist/taquito.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see taquito.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.taquito=t():e.taquito=t()}(self,(()=>(()=>{var e={9437:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5457);function i(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function o(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function s(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function c(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function u(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function l(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function f(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),l(e/4294967296>>>0,t,r),l(e>>>0,t,r+4),t}function h(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),f(e>>>0,t,r),f(e/4294967296>>>0,t,r+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=i,t.writeInt16BE=i,t.writeUint16LE=o,t.writeInt16LE=o,t.readInt32BE=s,t.readUint32BE=a,t.readInt32LE=c,t.readUint32LE=u,t.writeUint32BE=l,t.writeInt32BE=l,t.writeUint32LE=f,t.writeInt32LE=f,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=s(e,t),n=s(e,t+4);return 4294967296*r+n-4294967296*(n>>31)},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=c(e,t);return 4294967296*c(e,t+4)+r-4294967296*(r>>31)},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=u(e,t);return 4294967296*u(e,t+4)+r},t.writeUint64BE=d,t.writeInt64BE=d,t.writeUint64LE=h,t.writeInt64LE=h,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=e/8+r-1;o>=r;o--)n+=t[o]*i,i*=256;return n},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+e/8;o++)n+=t[o]*i,i*=256;return n},t.writeUintBE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var o=1,s=e/8+i-1;s>=i;s--)r[s]=t/o&255,o*=256;return r},t.writeUintLE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var o=1,s=i;s<i+e/8;s++)r[s]=t/o&255,o*=256;return r},t.readFloat32BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)},t.readFloat32LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)},t.readFloat64BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)},t.readFloat64LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)},t.writeFloat32BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e),t},t.writeFloat32LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e,!0),t},t.writeFloat64BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e),t},t.writeFloat64LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e,!0),t}},6851:(e,t,r)=>{"use strict";var n=r(9437),i=r(2887);t.cn=128,t.k=64,t.Cv=64,t.fg=16,t.fe=16,t.zS=Math.pow(2,32)-1,t.d=255,t.lV=255;var o=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),s=[[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6],[22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8],[14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16],[18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26],[4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18],[24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22],[26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20],[12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10],[20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0],[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6]],a=function(){function e(e,r){if(void 0===e&&(e=64),this.digestLength=e,this.blockSize=t.cn,this._state=new Int32Array(o),this._buffer=new Uint8Array(t.cn),this._bufferLength=0,this._ctr=new Uint32Array(4),this._flag=new Uint32Array(4),this._lastNode=!1,this._finished=!1,this._vtmp=new Uint32Array(32),this._mtmp=new Uint32Array(32),e<1||e>t.k)throw new Error("blake2b: wrong digest length");r&&this.validateConfig(r);var i=0;r&&r.key&&(i=r.key.length);var s=1,a=1;r&&r.tree&&(s=r.tree.fanout,a=r.tree.maxDepth),this._state[0]^=e|i<<8|s<<16|a<<24,r&&r.tree&&(this._state[1]^=r.tree.leafSize,this._state[2]^=r.tree.nodeOffsetLowBits,this._state[3]^=r.tree.nodeOffsetHighBits,this._state[4]^=r.tree.nodeDepth|r.tree.innerDigestLength<<8,this._lastNode=r.tree.lastNode),r&&r.salt&&(this._state[8]^=n.readUint32LE(r.salt,0),this._state[9]^=n.readUint32LE(r.salt,4),this._state[10]^=n.readUint32LE(r.salt,8),this._state[11]^=n.readUint32LE(r.salt,12)),r&&r.personalization&&(this._state[12]^=n.readUint32LE(r.personalization,0),this._state[13]^=n.readUint32LE(r.personalization,4),this._state[14]^=n.readUint32LE(r.personalization,8),this._state[15]^=n.readUint32LE(r.personalization,12)),this._initialState=new Uint32Array(this._state),r&&r.key&&i>0&&(this._paddedKey=new Uint8Array(t.cn),this._paddedKey.set(r.key),this._buffer.set(this._paddedKey),this._bufferLength=t.cn)}return e.prototype.reset=function(){return this._state.set(this._initialState),this._paddedKey?(this._buffer.set(this._paddedKey),this._bufferLength=t.cn):this._bufferLength=0,i.wipe(this._ctr),i.wipe(this._flag),this._finished=!1,this},e.prototype.validateConfig=function(e){if(e.key&&e.key.length>t.Cv)throw new Error("blake2b: wrong key length");if(e.salt&&e.salt.length!==t.fe)throw new Error("blake2b: wrong salt length");if(e.personalization&&e.personalization.length!==t.fg)throw new Error("blake2b: wrong personalization length");if(e.tree){if(e.tree.fanout<0||e.tree.fanout>t.d)throw new Error("blake2b: wrong tree fanout");if(e.tree.maxDepth<0||e.tree.maxDepth>t.lV)throw new Error("blake2b: wrong tree depth");if(e.tree.leafSize<0||e.tree.leafSize>t.zS)throw new Error("blake2b: wrong leaf size");if(e.tree.innerDigestLength<0||e.tree.innerDigestLength>t.k)throw new Error("blake2b: wrong tree inner digest length")}},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw new Error("blake2b: can't update because hash was finished.");var n=t.cn-this._bufferLength,i=0;if(0===r)return this;if(r>n){for(var o=0;o<n;o++)this._buffer[this._bufferLength+o]=e[i+o];this._processBlock(t.cn),i+=n,r-=n,this._bufferLength=0}for(;r>t.cn;){for(o=0;o<t.cn;o++)this._buffer[o]=e[i+o];this._processBlock(t.cn),i+=t.cn,r-=t.cn,this._bufferLength=0}for(o=0;o<r;o++)this._buffer[this._bufferLength+o]=e[i+o];return this._bufferLength+=r,this},e.prototype.finish=function(e){if(!this._finished){for(var r=this._bufferLength;r<t.cn;r++)this._buffer[r]=0;this._flag[0]=4294967295,this._flag[1]=4294967295,this._lastNode&&(this._flag[2]=4294967295,this._flag[3]=4294967295),this._processBlock(this._bufferLength),this._finished=!0}var i=this._buffer.subarray(0,64);for(r=0;r<16;r++)n.writeUint32LE(this._state[r],i,4*r);return e.set(i.subarray(0,e.length)),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.clean=function(){i.wipe(this._vtmp),i.wipe(this._mtmp),i.wipe(this._state),i.wipe(this._buffer),i.wipe(this._initialState),this._paddedKey&&i.wipe(this._paddedKey),this._bufferLength=0,i.wipe(this._ctr),i.wipe(this._flag),this._lastNode=!1,this._finished=!1},e.prototype.saveState=function(){if(this._finished)throw new Error("blake2b: cannot save finished state");return{state:new Uint32Array(this._state),buffer:new Uint8Array(this._buffer),bufferLength:this._bufferLength,ctr:new Uint32Array(this._ctr),flag:new Uint32Array(this._flag),lastNode:this._lastNode,paddedKey:this._paddedKey?new Uint8Array(this._paddedKey):void 0,initialState:new Uint32Array(this._initialState)}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._buffer.set(e.buffer),this._bufferLength=e.bufferLength,this._ctr.set(e.ctr),this._flag.set(e.flag),this._lastNode=e.lastNode,this._paddedKey&&i.wipe(this._paddedKey),this._paddedKey=e.paddedKey?new Uint8Array(e.paddedKey):void 0,this._initialState.set(e.initialState),this},e.prototype.cleanSavedState=function(e){i.wipe(e.state),i.wipe(e.buffer),i.wipe(e.initialState),e.paddedKey&&i.wipe(e.paddedKey),e.bufferLength=0,i.wipe(e.ctr),i.wipe(e.flag),e.lastNode=!1},e.prototype._G=function(e,t,r,n,i,o,s,a,c,u,l,f,d){var h=e[t],p=e[o],b=e[r],m=e[s],g=e[n],v=e[a],y=e[i],_=e[c],w=65535&h,E=h>>>16,O=65535&p,S=p>>>16;E+=b>>>16,O+=65535&m,S+=m>>>16,O+=(E+=(w+=65535&b)>>>16)>>>16,w=65535&(h=65535&w|E<<16),E=h>>>16,O=65535&(p=65535&O|(S+=O>>>16)<<16),S=p>>>16,E+=u>>>16,O+=65535&l,S+=l>>>16,h=65535&(w+=65535&u)|(E+=w>>>16)<<16,w=_^=p=65535&(O+=E>>>16)|(S+=O>>>16)<<16,_=y^=h,y=w,w=65535&g,E=g>>>16,O=65535&v,S=v>>>16,E+=y>>>16,O+=65535&_,S+=_>>>16,w=(b^=g=65535&(w+=65535&y)|(E+=w>>>16)<<16)<<8|(m^=v=65535&(O+=E>>>16)|(S+=O>>>16)<<16)>>>24,b=m<<8|b>>>24,m=w,w=65535&h,E=h>>>16,O=65535&p,S=p>>>16,E+=b>>>16,O+=65535&m,S+=m>>>16,O+=(E+=(w+=65535&b)>>>16)>>>16,w=65535&(h=65535&w|E<<16),E=h>>>16,O=65535&(p=65535&O|(S+=O>>>16)<<16),S=p>>>16,E+=f>>>16,O+=65535&d,S+=d>>>16,w=(y^=h=65535&(w+=65535&f)|(E+=w>>>16)<<16)<<16|(_^=p=65535&(O+=E>>>16)|(S+=O>>>16)<<16)>>>16,y=_<<16|y>>>16,_=w,w=65535&g,E=g>>>16,O=65535&v,S=v>>>16,E+=y>>>16,O+=65535&_,S+=_>>>16,w=(m^=v=65535&(O+=(E+=(w+=65535&y)>>>16)>>>16)|(S+=O>>>16)<<16)<<1|(b^=g=65535&w|E<<16)>>>31,b=b<<1|m>>>31,m=w,e[t]=h,e[o]=p,e[r]=b,e[s]=m,e[n]=g,e[a]=v,e[i]=y,e[c]=_},e.prototype._incrementCounter=function(e){for(var t=0;t<3;t++){var r=this._ctr[t]+e;if(this._ctr[t]=r>>>0,this._ctr[t]===r)return;e=1}},e.prototype._processBlock=function(e){this._incrementCounter(e);var t=this._vtmp;t.set(this._state),t.set(o,16),t[24]^=this._ctr[0],t[25]^=this._ctr[1],t[26]^=this._ctr[2],t[27]^=this._ctr[3],t[28]^=this._flag[0],t[29]^=this._flag[1],t[30]^=this._flag[2],t[31]^=this._flag[3];for(var r=this._mtmp,i=0;i<32;i++)r[i]=n.readUint32LE(this._buffer,4*i);for(var a=0;a<12;a++)this._G(t,0,8,16,24,1,9,17,25,r[s[a][0]],r[s[a][0]+1],r[s[a][1]],r[s[a][1]+1]),this._G(t,2,10,18,26,3,11,19,27,r[s[a][2]],r[s[a][2]+1],r[s[a][3]],r[s[a][3]+1]),this._G(t,4,12,20,28,5,13,21,29,r[s[a][4]],r[s[a][4]+1],r[s[a][5]],r[s[a][5]+1]),this._G(t,6,14,22,30,7,15,23,31,r[s[a][6]],r[s[a][6]+1],r[s[a][7]],r[s[a][7]+1]),this._G(t,0,10,20,30,1,11,21,31,r[s[a][8]],r[s[a][8]+1],r[s[a][9]],r[s[a][9]+1]),this._G(t,2,12,22,24,3,13,23,25,r[s[a][10]],r[s[a][10]+1],r[s[a][11]],r[s[a][11]+1]),this._G(t,4,14,16,26,5,15,17,27,r[s[a][12]],r[s[a][12]+1],r[s[a][13]],r[s[a][13]+1]),this._G(t,6,8,18,28,7,9,19,29,r[s[a][14]],r[s[a][14]+1],r[s[a][15]],r[s[a][15]+1]);for(i=0;i<16;i++)this._state[i]^=t[i]^t[i+16]},e}();t.vp=function(e,r,n){void 0===r&&(r=t.k);var i=new a(r,n);i.update(e);var o=i.digest();return i.clean(),o}},7728:(e,t,r)=>{"use strict";t.T=t.aP=t.KS=t.jQ=void 0;const n=r(1293),i=r(6756),o=r(2887);function s(e){const t=new Float64Array(16);if(e)for(let r=0;r<e.length;r++)t[r]=e[r];return t}t.jQ=64,t.KS=64,t.aP=32;new Uint8Array(32)[0]=9;const a=s(),c=s([1]),u=s([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=s([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=s([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=s([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),h=s([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t){for(let r=0;r<16;r++)e[r]=0|t[r]}function b(e){let t=1;for(let r=0;r<16;r++){let n=e[r]+t+65535;t=Math.floor(n/65536),e[r]=n-65536*t}e[0]+=t-1+37*(t-1)}function m(e,t,r){const n=~(r-1);for(let r=0;r<16;r++){const i=n&(e[r]^t[r]);e[r]^=i,t[r]^=i}}function g(e,t){const r=s(),n=s();for(let e=0;e<16;e++)n[e]=t[e];b(n),b(n),b(n);for(let e=0;e<2;e++){r[0]=n[0]-65517;for(let e=1;e<15;e++)r[e]=n[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);const e=r[15]>>16&1;r[14]&=65535,m(n,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&n[t],e[2*t+1]=n[t]>>8}function v(e,t){let r=0;for(let n=0;n<32;n++)r|=e[n]^t[n];return(1&r-1>>>8)-1}function y(e,t){const r=new Uint8Array(32),n=new Uint8Array(32);return g(r,e),g(n,t),v(r,n)}function _(e){const t=new Uint8Array(32);return g(t,e),1&t[0]}function w(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]+r[n]}function E(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]-r[n]}function O(e,t,r){let n,i,o=0,s=0,a=0,c=0,u=0,l=0,f=0,d=0,h=0,p=0,b=0,m=0,g=0,v=0,y=0,_=0,w=0,E=0,O=0,S=0,A=0,P=0,T=0,R=0,x=0,I=0,M=0,L=0,k=0,N=0,C=0,j=r[0],D=r[1],U=r[2],B=r[3],F=r[4],K=r[5],H=r[6],G=r[7],$=r[8],V=r[9],z=r[10],q=r[11],W=r[12],Z=r[13],J=r[14],Y=r[15];n=t[0],o+=n*j,s+=n*D,a+=n*U,c+=n*B,u+=n*F,l+=n*K,f+=n*H,d+=n*G,h+=n*$,p+=n*V,b+=n*z,m+=n*q,g+=n*W,v+=n*Z,y+=n*J,_+=n*Y,n=t[1],s+=n*j,a+=n*D,c+=n*U,u+=n*B,l+=n*F,f+=n*K,d+=n*H,h+=n*G,p+=n*$,b+=n*V,m+=n*z,g+=n*q,v+=n*W,y+=n*Z,_+=n*J,w+=n*Y,n=t[2],a+=n*j,c+=n*D,u+=n*U,l+=n*B,f+=n*F,d+=n*K,h+=n*H,p+=n*G,b+=n*$,m+=n*V,g+=n*z,v+=n*q,y+=n*W,_+=n*Z,w+=n*J,E+=n*Y,n=t[3],c+=n*j,u+=n*D,l+=n*U,f+=n*B,d+=n*F,h+=n*K,p+=n*H,b+=n*G,m+=n*$,g+=n*V,v+=n*z,y+=n*q,_+=n*W,w+=n*Z,E+=n*J,O+=n*Y,n=t[4],u+=n*j,l+=n*D,f+=n*U,d+=n*B,h+=n*F,p+=n*K,b+=n*H,m+=n*G,g+=n*$,v+=n*V,y+=n*z,_+=n*q,w+=n*W,E+=n*Z,O+=n*J,S+=n*Y,n=t[5],l+=n*j,f+=n*D,d+=n*U,h+=n*B,p+=n*F,b+=n*K,m+=n*H,g+=n*G,v+=n*$,y+=n*V,_+=n*z,w+=n*q,E+=n*W,O+=n*Z,S+=n*J,A+=n*Y,n=t[6],f+=n*j,d+=n*D,h+=n*U,p+=n*B,b+=n*F,m+=n*K,g+=n*H,v+=n*G,y+=n*$,_+=n*V,w+=n*z,E+=n*q,O+=n*W,S+=n*Z,A+=n*J,P+=n*Y,n=t[7],d+=n*j,h+=n*D,p+=n*U,b+=n*B,m+=n*F,g+=n*K,v+=n*H,y+=n*G,_+=n*$,w+=n*V,E+=n*z,O+=n*q,S+=n*W,A+=n*Z,P+=n*J,T+=n*Y,n=t[8],h+=n*j,p+=n*D,b+=n*U,m+=n*B,g+=n*F,v+=n*K,y+=n*H,_+=n*G,w+=n*$,E+=n*V,O+=n*z,S+=n*q,A+=n*W,P+=n*Z,T+=n*J,R+=n*Y,n=t[9],p+=n*j,b+=n*D,m+=n*U,g+=n*B,v+=n*F,y+=n*K,_+=n*H,w+=n*G,E+=n*$,O+=n*V,S+=n*z,A+=n*q,P+=n*W,T+=n*Z,R+=n*J,x+=n*Y,n=t[10],b+=n*j,m+=n*D,g+=n*U,v+=n*B,y+=n*F,_+=n*K,w+=n*H,E+=n*G,O+=n*$,S+=n*V,A+=n*z,P+=n*q,T+=n*W,R+=n*Z,x+=n*J,I+=n*Y,n=t[11],m+=n*j,g+=n*D,v+=n*U,y+=n*B,_+=n*F,w+=n*K,E+=n*H,O+=n*G,S+=n*$,A+=n*V,P+=n*z,T+=n*q,R+=n*W,x+=n*Z,I+=n*J,M+=n*Y,n=t[12],g+=n*j,v+=n*D,y+=n*U,_+=n*B,w+=n*F,E+=n*K,O+=n*H,S+=n*G,A+=n*$,P+=n*V,T+=n*z,R+=n*q,x+=n*W,I+=n*Z,M+=n*J,L+=n*Y,n=t[13],v+=n*j,y+=n*D,_+=n*U,w+=n*B,E+=n*F,O+=n*K,S+=n*H,A+=n*G,P+=n*$,T+=n*V,R+=n*z,x+=n*q,I+=n*W,M+=n*Z,L+=n*J,k+=n*Y,n=t[14],y+=n*j,_+=n*D,w+=n*U,E+=n*B,O+=n*F,S+=n*K,A+=n*H,P+=n*G,T+=n*$,R+=n*V,x+=n*z,I+=n*q,M+=n*W,L+=n*Z,k+=n*J,N+=n*Y,n=t[15],_+=n*j,w+=n*D,E+=n*U,O+=n*B,S+=n*F,A+=n*K,P+=n*H,T+=n*G,R+=n*$,x+=n*V,I+=n*z,M+=n*q,L+=n*W,k+=n*Z,N+=n*J,C+=n*Y,o+=38*w,s+=38*E,a+=38*O,c+=38*S,u+=38*A,l+=38*P,f+=38*T,d+=38*R,h+=38*x,p+=38*I,b+=38*M,m+=38*L,g+=38*k,v+=38*N,y+=38*C,i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-65536*i,n=s+i+65535,i=Math.floor(n/65536),s=n-65536*i,n=a+i+65535,i=Math.floor(n/65536),a=n-65536*i,n=c+i+65535,i=Math.floor(n/65536),c=n-65536*i,n=u+i+65535,i=Math.floor(n/65536),u=n-65536*i,n=l+i+65535,i=Math.floor(n/65536),l=n-65536*i,n=f+i+65535,i=Math.floor(n/65536),f=n-65536*i,n=d+i+65535,i=Math.floor(n/65536),d=n-65536*i,n=h+i+65535,i=Math.floor(n/65536),h=n-65536*i,n=p+i+65535,i=Math.floor(n/65536),p=n-65536*i,n=b+i+65535,i=Math.floor(n/65536),b=n-65536*i,n=m+i+65535,i=Math.floor(n/65536),m=n-65536*i,n=g+i+65535,i=Math.floor(n/65536),g=n-65536*i,n=v+i+65535,i=Math.floor(n/65536),v=n-65536*i,n=y+i+65535,i=Math.floor(n/65536),y=n-65536*i,n=_+i+65535,i=Math.floor(n/65536),_=n-65536*i,o+=i-1+37*(i-1),i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-65536*i,n=s+i+65535,i=Math.floor(n/65536),s=n-65536*i,n=a+i+65535,i=Math.floor(n/65536),a=n-65536*i,n=c+i+65535,i=Math.floor(n/65536),c=n-65536*i,n=u+i+65535,i=Math.floor(n/65536),u=n-65536*i,n=l+i+65535,i=Math.floor(n/65536),l=n-65536*i,n=f+i+65535,i=Math.floor(n/65536),f=n-65536*i,n=d+i+65535,i=Math.floor(n/65536),d=n-65536*i,n=h+i+65535,i=Math.floor(n/65536),h=n-65536*i,n=p+i+65535,i=Math.floor(n/65536),p=n-65536*i,n=b+i+65535,i=Math.floor(n/65536),b=n-65536*i,n=m+i+65535,i=Math.floor(n/65536),m=n-65536*i,n=g+i+65535,i=Math.floor(n/65536),g=n-65536*i,n=v+i+65535,i=Math.floor(n/65536),v=n-65536*i,n=y+i+65535,i=Math.floor(n/65536),y=n-65536*i,n=_+i+65535,i=Math.floor(n/65536),_=n-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=d,e[8]=h,e[9]=p,e[10]=b,e[11]=m,e[12]=g,e[13]=v,e[14]=y,e[15]=_}function S(e,t){O(e,t,t)}function A(e,t){const r=s();let n;for(n=0;n<16;n++)r[n]=t[n];for(n=253;n>=0;n--)S(r,r),2!==n&&4!==n&&O(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}function P(e,t){const r=s(),n=s(),i=s(),o=s(),a=s(),c=s(),u=s(),f=s(),d=s();E(r,e[1],e[0]),E(d,t[1],t[0]),O(r,r,d),w(n,e[0],e[1]),w(d,t[0],t[1]),O(n,n,d),O(i,e[3],t[3]),O(i,i,l),O(o,e[2],t[2]),w(o,o,o),E(a,n,r),E(c,o,i),w(u,o,i),w(f,n,r),O(e[0],a,c),O(e[1],f,u),O(e[2],u,c),O(e[3],a,f)}function T(e,t,r){for(let n=0;n<4;n++)m(e[n],t[n],r)}function R(e,t){const r=s(),n=s(),i=s();A(i,t[2]),O(r,t[0],i),O(n,t[1],i),g(e,n),e[31]^=_(r)<<7}function x(e,t,r){p(e[0],a),p(e[1],c),p(e[2],c),p(e[3],a);for(let n=255;n>=0;--n){const i=r[n/8|0]>>(7&n)&1;T(e,t,i),P(t,e),P(e,e),T(e,t,i)}}function I(e,t){const r=[s(),s(),s(),s()];p(r[0],f),p(r[1],d),p(r[2],c),O(r[3],f,d),x(e,r,t)}function M(e){if(e.length!==t.aP)throw new Error(`ed25519: seed must be ${t.aP} bytes`);const r=(0,i.hash)(e);r[0]&=248,r[31]&=127,r[31]|=64;const n=new Uint8Array(32),o=[s(),s(),s(),s()];I(o,r),R(n,o);const a=new Uint8Array(64);return a.set(e),a.set(n,32),{publicKey:n,secretKey:a}}const L=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function k(e,t){let r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*L[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*L[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*L[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function N(e){const t=new Float64Array(64);for(let r=0;r<64;r++)t[r]=e[r];for(let t=0;t<64;t++)e[t]=0;k(e,t)}function C(e,t){const r=s(),n=s(),i=s(),o=s(),l=s(),f=s(),d=s();return p(e[2],c),function(e,t){for(let r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),S(i,e[1]),O(o,i,u),E(i,i,e[2]),w(o,e[2],o),S(l,o),S(f,l),O(d,f,l),O(r,d,i),O(r,r,o),function(e,t){const r=s();let n;for(n=0;n<16;n++)r[n]=t[n];for(n=250;n>=0;n--)S(r,r),1!==n&&O(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}(r,r),O(r,r,i),O(r,r,o),O(r,r,o),O(e[0],r,o),S(n,e[0]),O(n,n,o),y(n,i)&&O(e[0],e[0],h),S(n,e[0]),O(n,n,o),y(n,i)?-1:(_(e[0])===t[31]>>7&&E(e[0],a,e[0]),O(e[3],e[0],e[1]),0)}t.T=function(e,r,n){const o=new Uint8Array(32),a=[s(),s(),s(),s()],c=[s(),s(),s(),s()];if(n.length!==t.jQ)throw new Error(`ed25519: signature must be ${t.jQ} bytes`);if(C(c,e))return!1;const u=new i.SHA512;u.update(n.subarray(0,32)),u.update(e),u.update(r);const l=u.digest();return N(l),x(a,c,l),I(c,n.subarray(32)),P(a,c),R(o,a),!v(n,o)}},5457:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16&65535)*n+r*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<<t|e>>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},1293:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const n=r(5147),i=r(9437),o=r(2887);function s(e,r=t.defaultRandomSource){return r.randomBytes(e)}t.defaultRandomSource=new n.SystemRandomSource,t.randomBytes=s,t.randomUint32=function(e=t.defaultRandomSource){const r=s(4,e),n=(0,i.readUint32LE)(r);return(0,o.wipe)(r),n};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(e,r=a,n=t.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let i="";const c=r.length,u=256-256%c;for(;e>0;){const t=s(Math.ceil(256*e/u),n);for(let n=0;n<t.length&&e>0;n++){const o=t[n];o<u&&(i+=r.charAt(o%c),e--)}(0,o.wipe)(t)}return i}t.randomString=c,t.randomStringForEntropy=function(e,r=a,n=t.defaultRandomSource){return c(Math.ceil(e/(Math.log(r.length)/Math.LN2)),r,n)}},2017:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0;t.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const t=new Uint8Array(e);for(let e=0;e<t.length;e+=65536)this._crypto.getRandomValues(t.subarray(e,e+Math.min(t.length-e,65536)));return t}}},7879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRandomSource=void 0;const n=r(2887);t.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const e=r(5477);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(e);for(let e=0;e<r.length;e++)r[e]=t[e];return(0,n.wipe)(t),r}}},5147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SystemRandomSource=void 0;const n=r(2017),i=r(7879);t.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new n.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new i.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}},6756:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9437),i=r(2887);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var o=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._tempHi),i.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t/536870912|0,o=t<<3,s=t%128<112?128:256;this._buffer[r]=128;for(var c=r+1;c<s-8;c++)this._buffer[c]=0;n.writeUint32BE(i,this._buffer,s-8),n.writeUint32BE(o,this._buffer,s-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,s),this._finished=!0}for(c=0;c<this.digestLength/8;c++)n.writeUint32BE(this._stateHi[c],e,8*c),n.writeUint32BE(this._stateLo[c],e,8*c+4);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.stateHi),i.wipe(e.stateLo),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=o;var s=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(e,t,r,i,o,a,c){for(var u,l,f,d,h,p,b,m,g=r[0],v=r[1],y=r[2],_=r[3],w=r[4],E=r[5],O=r[6],S=r[7],A=i[0],P=i[1],T=i[2],R=i[3],x=i[4],I=i[5],M=i[6],L=i[7];c>=128;){for(var k=0;k<16;k++){var N=8*k+a;e[k]=n.readUint32BE(o,N),t[k]=n.readUint32BE(o,N+4)}for(k=0;k<80;k++){var C,j,D=g,U=v,B=y,F=_,K=w,H=E,G=O,$=A,V=P,z=T,q=R,W=x,Z=I,J=M;if(h=65535&(l=L),p=l>>>16,b=65535&(u=S),m=u>>>16,h+=65535&(l=(x>>>14|w<<18)^(x>>>18|w<<14)^(w>>>9|x<<23)),p+=l>>>16,b+=65535&(u=(w>>>14|x<<18)^(w>>>18|x<<14)^(x>>>9|w<<23)),m+=u>>>16,h+=65535&(l=x&I^~x&M),p+=l>>>16,b+=65535&(u=w&E^~w&O),m+=u>>>16,u=s[2*k],h+=65535&(l=s[2*k+1]),p+=l>>>16,b+=65535&u,m+=u>>>16,u=e[k%16],p+=(l=t[k%16])>>>16,b+=65535&u,m+=u>>>16,b+=(p+=(h+=65535&l)>>>16)>>>16,h=65535&(l=d=65535&h|p<<16),p=l>>>16,b=65535&(u=f=65535&b|(m+=b>>>16)<<16),m=u>>>16,h+=65535&(l=(A>>>28|g<<4)^(g>>>2|A<<30)^(g>>>7|A<<25)),p+=l>>>16,b+=65535&(u=(g>>>28|A<<4)^(A>>>2|g<<30)^(A>>>7|g<<25)),m+=u>>>16,p+=(l=A&P^A&T^P&T)>>>16,b+=65535&(u=g&v^g&y^v&y),m+=u>>>16,C=65535&(b+=(p+=(h+=65535&l)>>>16)>>>16)|(m+=b>>>16)<<16,j=65535&h|p<<16,h=65535&(l=q),p=l>>>16,b=65535&(u=F),m=u>>>16,p+=(l=d)>>>16,b+=65535&(u=f),m+=u>>>16,v=D,y=U,_=B,w=F=65535&(b+=(p+=(h+=65535&l)>>>16)>>>16)|(m+=b>>>16)<<16,E=K,O=H,S=G,g=C,P=$,T=V,R=z,x=q=65535&h|p<<16,I=W,M=Z,L=J,A=j,k%16==15)for(N=0;N<16;N++)u=e[N],h=65535&(l=t[N]),p=l>>>16,b=65535&u,m=u>>>16,u=e[(N+9)%16],h+=65535&(l=t[(N+9)%16]),p+=l>>>16,b+=65535&u,m+=u>>>16,f=e[(N+1)%16],h+=65535&(l=((d=t[(N+1)%16])>>>1|f<<31)^(d>>>8|f<<24)^(d>>>7|f<<25)),p+=l>>>16,b+=65535&(u=(f>>>1|d<<31)^(f>>>8|d<<24)^f>>>7),m+=u>>>16,f=e[(N+14)%16],p+=(l=((d=t[(N+14)%16])>>>19|f<<13)^(f>>>29|d<<3)^(d>>>6|f<<26))>>>16,b+=65535&(u=(f>>>19|d<<13)^(d>>>29|f<<3)^f>>>6),m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,e[N]=65535&b|m<<16,t[N]=65535&h|p<<16}h=65535&(l=A),p=l>>>16,b=65535&(u=g),m=u>>>16,u=r[0],p+=(l=i[0])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[0]=g=65535&b|m<<16,i[0]=A=65535&h|p<<16,h=65535&(l=P),p=l>>>16,b=65535&(u=v),m=u>>>16,u=r[1],p+=(l=i[1])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[1]=v=65535&b|m<<16,i[1]=P=65535&h|p<<16,h=65535&(l=T),p=l>>>16,b=65535&(u=y),m=u>>>16,u=r[2],p+=(l=i[2])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[2]=y=65535&b|m<<16,i[2]=T=65535&h|p<<16,h=65535&(l=R),p=l>>>16,b=65535&(u=_),m=u>>>16,u=r[3],p+=(l=i[3])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[3]=_=65535&b|m<<16,i[3]=R=65535&h|p<<16,h=65535&(l=x),p=l>>>16,b=65535&(u=w),m=u>>>16,u=r[4],p+=(l=i[4])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[4]=w=65535&b|m<<16,i[4]=x=65535&h|p<<16,h=65535&(l=I),p=l>>>16,b=65535&(u=E),m=u>>>16,u=r[5],p+=(l=i[5])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[5]=E=65535&b|m<<16,i[5]=I=65535&h|p<<16,h=65535&(l=M),p=l>>>16,b=65535&(u=O),m=u>>>16,u=r[6],p+=(l=i[6])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[6]=O=65535&b|m<<16,i[6]=M=65535&h|p<<16,h=65535&(l=L),p=l>>>16,b=65535&(u=S),m=u>>>16,u=r[7],p+=(l=i[7])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[7]=S=65535&b|m<<16,i[7]=L=65535&h|p<<16,a+=128,c-=128}return a}t.hash=function(e){var t=new o;t.update(e);var r=t.digest();return t.clean(),r}},2887:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t<e.length;t++)e[t]=0;return e}},9644:(e,t,r)=>{e.exports=r(5644)},353:(e,t,r)=>{"use strict";var n=r(3044),i=r(6955),o=r(2233),s=r(8030),a=r(7948),c=r(1875),u=r(842),l=r(8618),f=r(1439),d=r(6714);e.exports=function(e){return new Promise((function(t,r){var h,p=e.data,b=e.headers,m=e.responseType;function g(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}n.isFormData(p)&&delete b["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var y=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";b.Authorization="Basic "+btoa(y+":"+_)}var w=a(e.baseURL,e.url);function E(){if(v){var n="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,o={data:m&&"text"!==m&&"json"!==m?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};i((function(e){t(e),g()}),(function(e){r(e),g()}),o),v=null}}if(v.open(e.method.toUpperCase(),s(w,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=E:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(E)},v.onabort=function(){v&&(r(l("Request aborted",e,"ECONNABORTED",v)),v=null)},v.onerror=function(){r(l("Network Error",e,null,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||f.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(l(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},n.isStandardBrowserEnv()){var O=(e.withCredentials||u(w))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;O&&(b[e.xsrfHeaderName]=O)}"setRequestHeader"in v&&n.forEach(b,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete b[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),m&&"json"!==m&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){v&&(r(!e||e&&e.type?new d("canceled"):e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),p||(p=null),v.send(p)}))}},5644:(e,t,r)=>{"use strict";var n=r(3044),i=r(3644),o=r(2215),s=r(2937);var a=function e(t){var r=new o(t),a=i(o.prototype.request,r);return n.extend(a,o.prototype,r),n.extend(a,r),a.create=function(r){return e(s(t,r))},a}(r(1439));a.Axios=o,a.Cancel=r(6714),a.CancelToken=r(4089),a.isCancel=r(8041),a.VERSION=r(9241).version,a.all=function(e){return Promise.all(e)},a.spread=r(783),a.isAxiosError=r(5587),e.exports=a,e.exports.default=a},6714: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},4089:(e,t,r)=>{"use strict";var n=r(6714);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;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},8041:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},2215:(e,t,r)=>{"use strict";var n=r(3044),i=r(8030),o=r(946),s=r(6895),a=r(2937),c=r(7525),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!i){var f=[s,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(l),o=Promise.resolve(t);f.length;)o=o.then(f.shift(),f.shift());return o}for(var d=t;n.length;){var h=n.shift(),p=n.shift();try{d=h(d)}catch(e){p(e);break}}try{o=s(d)}catch(e){return Promise.reject(e)}for(;l.length;)o=o.then(l.shift(),l.shift());return o},l.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){l.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=l},946:(e,t,r)=>{"use strict";var n=r(3044);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),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},7948:(e,t,r)=>{"use strict";var n=r(9192),i=r(8762);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},8618:(e,t,r)=>{"use strict";var n=r(1935);e.exports=function(e,t,r,i,o){var s=new Error(e);return n(s,t,r,i,o)}},6895:(e,t,r)=>{"use strict";var n=r(3044),i=r(8556),o=r(8041),s=r(1439),a=r(6714);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=i.call(e,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 c(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(c(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},1935: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,status:this.response&&this.response.status?this.response.status:null}},e}},2937:(e,t,r)=>{"use strict";var n=r(3044);e.exports=function(e,t){t=t||{};var r={};function i(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 o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function s(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function a(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function c(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||o,i=t(e);n.isUndefined(i)&&t!==c||(r[e]=i)})),r}},6955:(e,t,r)=>{"use strict";var n=r(8618);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)}},8556:(e,t,r)=>{"use strict";var n=r(3044),i=r(1439);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},1439:(e,t,r)=>{"use strict";var n=r(3044),i=r(8868),o=r(1935),s={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=r(353)),c),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)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(a(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||u.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw o(e,this,"E_JSON_PARSE");throw 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){u.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){u.headers[e]=n.merge(s)})),e.exports=u},9241:e=>{e.exports={version:"0.26.0"}},3644: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)}}},8030:(e,t,r)=>{"use strict";var n=r(3044);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}},8762:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},2233:(e,t,r)=>{"use strict";var n=r(3044);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(){}}},9192:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},5587:(e,t,r)=>{"use strict";var n=r(3044);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},842:(e,t,r)=>{"use strict";var n=r(3044);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}},8868:(e,t,r)=>{"use strict";var n=r(3044);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},1875:(e,t,r)=>{"use strict";var n=r(3044),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}},783:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},7525:(e,t,r)=>{"use strict";var n=r(9241).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var o={};i.transitional=function(e,t,r){function i(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new Error(i(n," has been removed"+(t?" in "+t:"")));return t&&!o[n]&&(o[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var o=n[i],s=t[o];if(s){var a=e[o],c=void 0===a||s(a,o,e);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:i}},3044:(e,t,r)=>{"use strict";var n=r(3644),i=Object.prototype.toString;function o(e){return Array.isArray(e)}function s(e){return void 0===e}function a(e){return"[object ArrayBuffer]"===i.call(e)}function c(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(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:a,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"[object FormData]"===i.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&a(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:c,isPlainObject:u,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:l,isStream:function(e){return c(e)&&l(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===i.call(e)},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){u(t[n])&&u(r)?t[n]=e(t[n],r):u(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.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},8166:(e,t,r)=>{"use strict";var n=r(7834).Buffer;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 i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==t[s])throw new TypeError(o+" is ambiguous");t[s]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);for(var r=0,i=0,o=0;e[r]===c;)i++,r++;for(var s=(e.length-r)*u+1>>>0,l=new Uint8Array(s);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var d=0,h=s-1;(0!==f||d<o)&&-1!==h;h--,d++)f+=a*l[h]>>>0,l[h]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=d,r++}for(var p=s-o;p!==s&&0===l[p];)p++;var b=n.allocUnsafe(i+(s-p));b.fill(0,0,i);for(var m=i;p!==s;)b[m++]=l[p++];return b}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,s=t.length;o!==s&&0===t[o];)o++,r++;for(var u=(s-o)*l+1>>>0,f=new Uint8Array(u);o!==s;){for(var d=t[o],h=0,p=u-1;(0!==d||h<i)&&-1!==p;p--,h++)d+=256*f[p]>>>0,f[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");i=h,o++}for(var b=u-i;b!==u&&0===f[b];)b++;for(var m=c.repeat(r);b<u;++b)m+=e.charAt(f[b]);return m},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},5766:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],c=o[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,c)),l=0,f=c>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},6391:function(e,t,r){var n;!function(i){"use strict";var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,c=Math.floor,u="[BigNumber Error] ",l=u+"Number primitive has more than 15 significant digits: ",f=1e14,d=14,h=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],b=1e7,m=1e9;function g(e){var t=0|e;return e>0||e===t?t:t-1}function v(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=d-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function y(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,c=e.e,u=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=c==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(a=(c=i.length)<(u=o.length)?c:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return c==u?0:c>u^r?1:-1}function _(e,t,r,n){if(e<t||e>r||e!==c(e))throw Error(u+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function w(e){var t=e.c.length-1;return g(e.e/d)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function O(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}o=function e(t){var r,n,i,o,S,A,P,T,R,x,I=$.prototype={constructor:$,toString:null,valueOf:null},M=new $(1),L=20,k=4,N=-7,C=21,j=-1e7,D=1e7,U=!1,B=1,F=0,K={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",G=!0;function $(e,t){var r,o,a,u,f,p,b,m,g=this;if(!(g instanceof $))return new $(e,t);if(null==t){if(e&&!0===e._isBigNumber)return g.s=e.s,void(!e.c||e.e>D?g.c=g.e=null:e.e<j?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice()));if((p="number"==typeof e)&&0*e==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,f=e;f>=10;f/=10,u++);return void(u>D?g.c=g.e=null:(g.e=u,g.c=[e]))}m=String(e)}else{if(!s.test(m=String(e)))return i(g,m,p);g.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(u=m.indexOf("."))>-1&&(m=m.replace(".","")),(f=m.search(/e/i))>0?(u<0&&(u=f),u+=+m.slice(f+1),m=m.substring(0,f)):u<0&&(u=m.length)}else{if(_(t,2,H.length,"Base"),10==t&&G)return W(g=new $(e),L+g.e+1,k);if(m=String(e),p="number"==typeof e){if(0*e!=0)return i(g,m,p,t);if(g.s=1/e<0?(m=m.slice(1),-1):1,$.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else g.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(r=H.slice(0,t),u=f=0,b=m.length;f<b;f++)if(r.indexOf(o=m.charAt(f))<0){if("."==o){if(f>u){u=b;continue}}else if(!a&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){a=!0,f=-1,u=0;continue}return i(g,String(e),p,t)}p=!1,(u=(m=n(m,t,10,g.s)).indexOf("."))>-1?m=m.replace(".",""):u=m.length}for(f=0;48===m.charCodeAt(f);f++);for(b=m.length;48===m.charCodeAt(--b););if(m=m.slice(f,++b)){if(b-=f,p&&$.DEBUG&&b>15&&(e>h||e!==c(e)))throw Error(l+g.s*e);if((u=u-f-1)>D)g.c=g.e=null;else if(u<j)g.c=[g.e=0];else{if(g.e=u,g.c=[],f=(u+1)%d,u<0&&(f+=d),f<b){for(f&&g.c.push(+m.slice(0,f)),b-=d;f<b;)g.c.push(+m.slice(f,f+=d));f=d-(m=m.slice(f)).length}else f-=b;for(;f--;m+="0");g.c.push(+m)}}else g.c=[g.e=0]}function V(e,t,r,n){var i,o,s,a,c;if(null==r?r=k:_(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)c=v(e.c),c=1==n||2==n&&(s<=N||s>=C)?E(c,s):O(c,s,"0");else if(o=(e=W(new $(e),t,r)).e,a=(c=v(e.c)).length,1==n||2==n&&(t<=o||o<=N)){for(;a<t;c+="0",a++);c=E(c,o)}else if(t-=s,c=O(c,o,"0"),o+1>a){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-a)>0)for(o+1==a&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function z(e,t){for(var r,n=1,i=new $(e[0]);n<e.length;n++){if(!(r=new $(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function q(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*d-1)>D?e.c=e.e=null:r<j?e.c=[e.e=0]:(e.e=r,e.c=t),e}function W(e,t,r,n){var i,o,s,u,l,h,b,m=e.c,g=p;if(m){e:{for(i=1,u=m[0];u>=10;u/=10,i++);if((o=t-i)<0)o+=d,s=t,b=(l=m[h=0])/g[i-s-1]%10|0;else if((h=a((o+1)/d))>=m.length){if(!n)break e;for(;m.length<=h;m.push(0));l=b=0,i=1,s=(o%=d)-d+1}else{for(l=u=m[h],i=1;u>=10;u/=10,i++);b=(s=(o%=d)-d+i)<0?0:l/g[i-s-1]%10|0}if(n=n||t<0||null!=m[h+1]||(s<0?l:l%g[i-s-1]),n=r<4?(b||n)&&(0==r||r==(e.s<0?3:2)):b>5||5==b&&(4==r||n||6==r&&(o>0?s>0?l/g[i-s]:0:m[h-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=g[(d-t%d)%d],e.e=-t||0):m[0]=e.e=0,e;if(0==o?(m.length=h,u=1,h--):(m.length=h+1,u=g[d-o],m[h]=s>0?c(l/g[i-s]%g[s])*u:0),n)for(;;){if(0==h){for(o=1,s=m[0];s>=10;s/=10,o++);for(s=m[0]+=u,u=1;s>=10;s/=10,u++);o!=u&&(e.e++,m[0]==f&&(m[0]=1));break}if(m[h]+=u,m[h]!=f)break;m[h--]=0,u=1}for(o=m.length;0===m[--o];m.pop());}e.e>D?e.c=e.e=null:e.e<j&&(e.c=[e.e=0])}return e}function Z(e){var t,r=e.e;return null===r?e.toString():(t=v(e.c),t=r<=N||r>=C?E(t,r):O(t,r,"0"),e.s<0?"-"+t:t)}return $.clone=e,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(_(r=e[t],0,m,t),L=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(_(r=e[t],0,8,t),k=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(_(r[0],-m,0,t),_(r[1],0,m,t),N=r[0],C=r[1]):(_(r,-m,m,t),N=-(C=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)_(r[0],-m,-1,t),_(r[1],1,m,t),j=r[0],D=r[1];else{if(_(r,-m,m,t),!r)throw Error(u+t+" cannot be zero: "+r);j=-(D=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(u+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(_(r=e[t],0,9,t),B=r),e.hasOwnProperty(t="POW_PRECISION")&&(_(r=e[t],0,m,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(u+t+" not an object: "+r);K=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);G="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:L,ROUNDING_MODE:k,EXPONENTIAL_AT:[N,C],RANGE:[j,D],CRYPTO:U,MODULO_MODE:B,POW_PRECISION:F,FORMAT:K,ALPHABET:H}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-m&&i<=m&&i===c(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%d)<1&&(t+=d),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=f||r!==c(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(u+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return z(arguments,I.lt)},$.minimum=$.min=function(){return z(arguments,I.gt)},$.random=(o=9007199254740992,S=Math.random()*o&2097151?function(){return c(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,s=0,l=[],f=new $(M);if(null==e?e=L:_(e,0,m),i=a(e/d),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(l.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw U=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(l.push(o%1e14),s+=7);s=i/7}if(!U)for(;s<i;)(o=S())<9e15&&(l[s++]=o%1e14);for(i=l[--s],e%=d,i&&e&&(o=p[d-e],l[s]=c(i/o)*o);0===l[s];l.pop(),s--);if(s<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=d);for(s=1,o=l[0];o>=10;o/=10,s++);s<d&&(n-=d-s)}return f.e=n,f.c=l,f}),$.sum=function(){for(var e=1,t=arguments,r=new $(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,c=e.length;a<c;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var c,u,l,f,d,h,p,b,m=n.indexOf("."),g=L,y=k;for(m>=0&&(f=F,F=0,n=n.replace(".",""),h=(b=new $(i)).pow(n.length-m),F=f,b.c=t(O(v(h.c),h.e,"0"),10,o,e),b.e=b.c.length),l=f=(p=t(n,i,o,a?(c=H,e):(c=e,H))).length;0==p[--f];p.pop());if(!p[0])return c.charAt(0);if(m<0?--l:(h.c=p,h.e=l,h.s=s,p=(h=r(h,b,g,y,o)).c,d=h.r,l=h.e),m=p[u=l+g+1],f=o/2,d=d||u<0||null!=p[u+1],d=y<4?(null!=m||d)&&(0==y||y==(h.s<0?3:2)):m>f||m==f&&(4==y||d||6==y&&1&p[u-1]||y==(h.s<0?8:7)),u<1||!p[0])n=d?O(c.charAt(1),-g,c.charAt(0)):c.charAt(0);else{if(p.length=u,d)for(--o;++p[--u]>o;)p[u]=0,u||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(m=0,n="";m<=f;n+=c.charAt(p[m++]));n=O(n,l,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,c=e.length,u=t%b,l=t/b|0;for(e=e.slice();c--;)a=((i=u*(o=e[c]%b)+(n=l*o+(s=e[c]/b|0)*u)%b*b+a)/r|0)+(n/b|0)+l*s,e[c]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,s,a){var u,l,h,p,b,m,v,y,_,w,E,O,S,A,P,T,R,x=n.s==i.s?1:-1,I=n.c,M=i.c;if(!(I&&I[0]&&M&&M[0]))return new $(n.s&&i.s&&(I?!M||I[0]!=M[0]:M)?I&&0==I[0]||!M?0*x:x/0:NaN);for(_=(y=new $(x)).c=[],x=o+(l=n.e-i.e)+1,a||(a=f,l=g(n.e/d)-g(i.e/d),x=x/d|0),h=0;M[h]==(I[h]||0);h++);if(M[h]>(I[h]||0)&&l--,x<0)_.push(1),p=!0;else{for(A=I.length,T=M.length,h=0,x+=2,(b=c(a/(M[0]+1)))>1&&(M=e(M,b,a),I=e(I,b,a),T=M.length,A=I.length),S=T,E=(w=I.slice(0,T)).length;E<T;w[E++]=0);R=M.slice(),R=[0].concat(R),P=M[0],M[1]>=a/2&&P++;do{if(b=0,(u=t(M,w,T,E))<0){if(O=w[0],T!=E&&(O=O*a+(w[1]||0)),(b=c(O/P))>1)for(b>=a&&(b=a-1),v=(m=e(M,b,a)).length,E=w.length;1==t(m,w,v,E);)b--,r(m,T<v?R:M,v,a),v=m.length,u=1;else 0==b&&(u=b=1),v=(m=M.slice()).length;if(v<E&&(m=[0].concat(m)),r(w,m,E,a),E=w.length,-1==u)for(;t(M,w,T,E)<1;)b++,r(w,T<E?R:M,E,a),E=w.length}else 0===u&&(b++,w=[0]);_[h++]=b,w[0]?w[E++]=I[S]||0:(w=[I[S]],E=1)}while((S++<A||null!=w[0])&&x--);p=null!=w[0],_[0]||_.splice(0,1)}if(a==f){for(h=1,x=_[0];x>=10;x/=10,h++);W(y,o+(y.e=h+l*d-1)+1,s,p)}else y.e=l,y.r=+p;return y}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,P=/^([^.]+)\.$/,T=/^\.([^.]+)$/,R=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(x,"");if(R.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(A,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(P,"$1").replace(T,"0.$1")),t!=o))return new $(o,i);if($.DEBUG)throw Error(u+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},I.absoluteValue=I.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},I.comparedTo=function(e,t){return y(this,new $(e,t))},I.decimalPlaces=I.dp=function(e,t){var r,n,i,o=this;if(null!=e)return _(e,0,m),null==t?t=k:_(t,0,8),W(new $(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-g(this.e/d))*d,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},I.dividedBy=I.div=function(e,t){return r(this,new $(e,t),L,k)},I.dividedToIntegerBy=I.idiv=function(e,t){return r(this,new $(e,t),0,1)},I.exponentiatedBy=I.pow=function(e,t){var r,n,i,o,s,l,f,h,p=this;if((e=new $(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new $(t)),s=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new $(Math.pow(+Z(p),s?e.s*(2-w(e)):+Z(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new $(NaN);(n=!l&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||s&&p.c[1]>=24e7:p.c[0]<8e13||s&&p.c[0]<=9999975e7)))return o=p.s<0&&w(e)?-0:0,p.e>-1&&(o=1/o),new $(l?1/o:o);F&&(o=a(F/d+2))}for(s?(r=new $(.5),l&&(e.s=1),f=w(e)):f=(i=Math.abs(+Z(e)))%2,h=new $(M);;){if(f){if(!(h=h.times(p)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}if(i){if(0===(i=c(i/2)))break;f=i%2}else if(W(e=e.times(r),e.e+1,1),e.e>14)f=w(e);else{if(0===(i=+Z(e)))break;f=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}return n?h:(l&&(h=M.div(h)),t?h.mod(t):o?W(h,F,k,undefined):h)},I.integerValue=function(e){var t=new $(this);return null==e?e=k:_(e,0,8),W(t,t.e+1,e)},I.isEqualTo=I.eq=function(e,t){return 0===y(this,new $(e,t))},I.isFinite=function(){return!!this.c},I.isGreaterThan=I.gt=function(e,t){return y(this,new $(e,t))>0},I.isGreaterThanOrEqualTo=I.gte=function(e,t){return 1===(t=y(this,new $(e,t)))||0===t},I.isInteger=function(){return!!this.c&&g(this.e/d)>this.c.length-2},I.isLessThan=I.lt=function(e,t){return y(this,new $(e,t))<0},I.isLessThanOrEqualTo=I.lte=function(e,t){return-1===(t=y(this,new $(e,t)))||0===t},I.isNaN=function(){return!this.s},I.isNegative=function(){return this.s<0},I.isPositive=function(){return this.s>0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new $(e,t)).s,!a||!t)return new $(NaN);if(a!=t)return e.s=-t,s.plus(e);var c=s.e/d,u=e.e/d,l=s.c,h=e.c;if(!c||!u){if(!l||!h)return l?(e.s=-t,e):new $(h?s:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new $(l[0]?s:3==k?-0:0)}if(c=g(c),u=g(u),l=l.slice(),a=c-u){for((o=a<0)?(a=-a,i=l):(u=c,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=l.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(l[t]!=h[t]){o=l[t]<h[t];break}if(o&&(i=l,l=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=f-1;n>a;){if(l[--n]<h[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=f}l[n]-=h[n]}for(;0==l[0];l.splice(0,1),--u);return l[0]?q(e,l,u):(e.s=3==k?-1:1,e.c=[e.e=0],e)},I.modulo=I.mod=function(e,t){var n,i,o=this;return e=new $(e,t),!o.c||!e.s||e.c&&!e.c[0]?new $(NaN):!e.c||o.c&&!o.c[0]?new $(o):(9==B?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,B),(e=o.minus(n.times(e))).c[0]||1!=B||(e.s=o.s),e)},I.multipliedBy=I.times=function(e,t){var r,n,i,o,s,a,c,u,l,h,p,m,v,y,_,w=this,E=w.c,O=(e=new $(e,t)).c;if(!(E&&O&&E[0]&&O[0]))return!w.s||!e.s||E&&!E[0]&&!O||O&&!O[0]&&!E?e.c=e.e=e.s=null:(e.s*=w.s,E&&O?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=g(w.e/d)+g(e.e/d),e.s*=w.s,(c=E.length)<(h=O.length)&&(v=E,E=O,O=v,i=c,c=h,h=i),i=c+h,v=[];i--;v.push(0));for(y=f,_=b,i=h;--i>=0;){for(r=0,p=O[i]%_,m=O[i]/_|0,o=i+(s=c);o>i;)r=((u=p*(u=E[--s]%_)+(a=m*u+(l=E[s]/_|0)*p)%_*_+v[o]+r)/y|0)+(a/_|0)+m*l,v[o--]=u%y;v[o]=r}return r?++n:v.splice(0,1),q(e,v,n)},I.negated=function(){var e=new $(this);return e.s=-e.s||null,e},I.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new $(e,t)).s,!i||!t)return new $(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/d,s=e.e/d,a=n.c,c=e.c;if(!o||!s){if(!a||!c)return new $(i/0);if(!a[0]||!c[0])return c[0]?e:new $(a[0]?n:0*i)}if(o=g(o),s=g(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=c):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=c.length)<0&&(r=c,c=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+c[t]+i)/f|0,a[t]=f===a[t]?0:a[t]%f;return i&&(a=[i].concat(a),++s),q(e,a,s)},I.precision=I.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return _(e,1,m),null==t?t=k:_(t,0,8),W(new $(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*d+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},I.shiftedBy=function(e){return _(e,-9007199254740991,h),this.times("1e"+e)},I.squareRoot=I.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,c=s.s,u=s.e,l=L+4,f=new $("0.5");if(1!==c||!a||!a[0])return new $(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(c=Math.sqrt(+Z(s)))||c==1/0?(((t=v(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=g((u+1)/2)-(u<0||u%2),n=new $(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new $(c+""),n.c[0])for((c=(u=n.e)+l)<3&&(c=0);;)if(o=n,n=f.times(o.plus(r(s,o,l,1))),v(o.c).slice(0,c)===(t=v(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(W(n,n.e+L+2,1),e=!n.times(n).eq(s));break}if(!i&&(W(o,o.e+L+2,0),o.times(o).eq(s))){n=o;break}l+=4,c+=4,i=1}return W(n,n.e+L+1,k,e)},I.toExponential=function(e,t){return null!=e&&(_(e,0,m),e++),V(this,e,t,1)},I.toFixed=function(e,t){return null!=e&&(_(e,0,m),e=e+this.e+1),V(this,e,t)},I.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=K;else if("object"!=typeof r)throw Error(u+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,s=n.split("."),a=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",f=s[0],d=s[1],h=i.s<0,p=h?f.slice(1):f,b=p.length;if(c&&(o=a,a=c,c=o,b-=o),a>0&&b>0){for(o=b%a||a,f=p.substr(0,o);o<b;o+=a)f+=l+p.substr(o,a);c>0&&(f+=l+p.slice(o)),h&&(f="-"+f)}n=d?f+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):f}return(r.prefix||"")+n+(r.suffix||"")},I.toFraction=function(e){var t,n,i,o,s,a,c,l,f,h,b,m,g=this,y=g.c;if(null!=e&&(!(c=new $(e)).isInteger()&&(c.c||1!==c.s)||c.lt(M)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+Z(c));if(!y)return new $(g);for(t=new $(M),f=n=new $(M),i=l=new $(M),m=v(y),s=t.e=m.length-g.e-1,t.c[0]=p[(a=s%d)<0?d+a:a],e=!e||c.comparedTo(t)>0?s>0?t:f:c,a=D,D=1/0,c=new $(m),l.c[0]=0;h=r(c,t,0,1),1!=(o=n.plus(h.times(i))).comparedTo(e);)n=i,i=o,f=l.plus(h.times(o=f)),l=o,t=c.minus(h.times(o=t)),c=o;return o=r(e.minus(n),i,0,1),l=l.plus(o.times(f)),n=n.plus(o.times(i)),l.s=f.s=g.s,b=r(f,i,s*=2,k).minus(g).abs().comparedTo(r(l,n,s,k).minus(g).abs())<1?[f,i]:[l,n],D=a,b},I.toNumber=function(){return+Z(this)},I.toPrecision=function(e,t){return null!=e&&_(e,1,m),V(this,e,t,2)},I.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=N||o>=C?E(v(r.c),o):O(v(r.c),o,"0"):10===e&&G?t=O(v((r=W(new $(r),L+o+1,k)).c),r.e,"0"):(_(e,2,H.length,"Base"),t=n(O(v(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},I.valueOf=I.toJSON=function(){return Z(this)},I._isBigNumber=!0,null!=t&&$.set(t),$}(),o.default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},651:(e,t,r)=>{const n=r(7967);function i(e,t,r){const n=e[t]+e[r];let i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function o(e,t,r,n){let i=e[t]+r;r<0&&(i+=4294967296);let o=e[t+1]+n;i>=4294967296&&o++,e[t]=i,e[t+1]=o}function s(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,n,s,a){const c=f[s],u=f[s+1],d=f[a],h=f[a+1];i(l,e,t),o(l,e,c,u);let p=l[n]^l[e],b=l[n+1]^l[e+1];l[n]=b,l[n+1]=p,i(l,r,n),p=l[t]^l[r],b=l[t+1]^l[r+1],l[t]=p>>>24^b<<8,l[t+1]=b>>>24^p<<8,i(l,e,t),o(l,e,d,h),p=l[n]^l[e],b=l[n+1]^l[e+1],l[n]=p>>>16^b<<16,l[n+1]=b>>>16^p<<16,i(l,r,n),p=l[t]^l[r],b=l[t+1]^l[r+1],l[t]=b>>>31^p<<1,l[t+1]=p>>>31^b<<1}const c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),l=new Uint32Array(32),f=new Uint32Array(32);function d(e,t){let r=0;for(r=0;r<16;r++)l[r]=e.h[r],l[r+16]=c[r];for(l[24]=l[24]^e.t,l[25]=l[25]^e.t/4294967296,t&&(l[28]=~l[28],l[29]=~l[29]),r=0;r<32;r++)f[r]=s(e.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,u[16*r+0],u[16*r+1]),a(2,10,18,26,u[16*r+2],u[16*r+3]),a(4,12,20,28,u[16*r+4],u[16*r+5]),a(6,14,22,30,u[16*r+6],u[16*r+7]),a(0,10,20,30,u[16*r+8],u[16*r+9]),a(2,12,22,24,u[16*r+10],u[16*r+11]),a(4,14,16,26,u[16*r+12],u[16*r+13]),a(6,8,18,28,u[16*r+14],u[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^l[r]^l[r+16]}const h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,t,r,n){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(n&&16!==n.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};h.fill(0),h[0]=e,t&&(h[1]=t.length),h[2]=1,h[3]=1,r&&h.set(r,32),n&&h.set(n,48);for(let e=0;e<16;e++)i.h[e]=c[e]^s(h,4*e);return t&&(b(i,t),i.c=128),i}function b(e,t){for(let r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,d(e,!1),e.c=0),e.b[e.c++]=t[r]}function m(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;d(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function g(e,t,r,i,o){r=r||64,e=n.normalizeInput(e),i&&(i=n.normalizeInput(i)),o&&(o=n.normalizeInput(o));const s=p(r,t,i,o);return b(s,e),m(s)}e.exports={blake2b:g,blake2bHex:function(e,t,r,i,o){const s=g(e,t,r,i,o);return n.toHex(s)},blake2bInit:p,blake2bUpdate:b,blake2bFinal:m}},9962:(e,t,r)=>{const n=r(7967);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,t,r,n,i,o){u[e]=u[e]+u[t]+i,u[n]=s(u[n]^u[e],16),u[r]=u[r]+u[n],u[t]=s(u[t]^u[r],12),u[e]=u[e]+u[t]+o,u[n]=s(u[n]^u[e],8),u[r]=u[r]+u[n],u[t]=s(u[t]^u[r],7)}function s(e,t){return e>>>t^e<<32-t}const a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),u=new Uint32Array(16),l=new Uint32Array(16);function f(e,t){let r=0;for(r=0;r<8;r++)u[r]=e.h[r],u[r+8]=a[r];for(u[12]^=e.t,u[13]^=e.t/4294967296,t&&(u[14]=~u[14]),r=0;r<16;r++)l[r]=i(e.b,4*r);for(r=0;r<10;r++)o(0,4,8,12,l[c[16*r+0]],l[c[16*r+1]]),o(1,5,9,13,l[c[16*r+2]],l[c[16*r+3]]),o(2,6,10,14,l[c[16*r+4]],l[c[16*r+5]]),o(3,7,11,15,l[c[16*r+6]],l[c[16*r+7]]),o(0,5,10,15,l[c[16*r+8]],l[c[16*r+9]]),o(1,6,11,12,l[c[16*r+10]],l[c[16*r+11]]),o(2,7,8,13,l[c[16*r+12]],l[c[16*r+13]]),o(3,4,9,14,l[c[16*r+14]],l[c[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=u[r]^u[r+8]}function d(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const n={h:new Uint32Array(a),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(h(n,t),n.c=64),n}function h(e,t){for(let r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,f(e,!1),e.c=0),e.b[e.c++]=t[r]}function p(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;f(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function b(e,t,r){r=r||32,e=n.normalizeInput(e);const i=d(r,t);return h(i,e),p(i)}e.exports={blake2s:b,blake2sHex:function(e,t,r){const i=b(e,t,r);return n.toHex(i)},blake2sInit:d,blake2sUpdate:h,blake2sFinal:p}},1395:(e,t,r)=>{const n=r(651),i=r(9962);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},7967:e=>{function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,r,n){let i="\n"+e+" = ";for(let o=0;o<r.length;o+=2){if(32===n)i+=t(r[o]).toUpperCase(),i+=" ",i+=t(r[o+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);i+=t(r[o+1]).toUpperCase(),i+=t(r[o]).toUpperCase()}o%6==4?i+="\n"+new Array(e.length+4).join(" "):o<r.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){let n=(new Date).getTime();const i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=e%256;const o=(new Date).getTime();console.log("Generated random input in "+(o-n)+"ms"),n=o;for(let o=0;o<r;o++){const r=e(i),o=(new Date).getTime(),s=o-n;n=o,console.log("Hashed in "+s+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(s/1e3)*100)/100+" MB PER SECOND")}}}},2197:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(3196).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l<a;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var f=1;for(c=u(e,l,e.length,t),l=0;l<s;l++)f*=t;this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,f=67108863&c,d=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=d;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?l[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=f[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?b+r:l[u-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a<o;a++)u[a]=0}else{for(a=0;a<o-i;a++)u[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[o-a-1]=s}return u},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],f=8191&l,d=l>>>13,h=0|s[1],p=8191&h,b=h>>>13,m=0|s[2],g=8191&m,v=m>>>13,y=0|s[3],_=8191&y,w=y>>>13,E=0|s[4],O=8191&E,S=E>>>13,A=0|s[5],P=8191&A,T=A>>>13,R=0|s[6],x=8191&R,I=R>>>13,M=0|s[7],L=8191&M,k=M>>>13,N=0|s[8],C=8191&N,j=N>>>13,D=0|s[9],U=8191&D,B=D>>>13,F=0|a[0],K=8191&F,H=F>>>13,G=0|a[1],$=8191&G,V=G>>>13,z=0|a[2],q=8191&z,W=z>>>13,Z=0|a[3],J=8191&Z,Y=Z>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],fe=8191&le,de=le>>>13,he=0|a[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(u+(n=Math.imul(f,K))|0)+((8191&(i=(i=Math.imul(f,H))+Math.imul(d,K)|0))<<13)|0;u=((o=Math.imul(d,H))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,H))+Math.imul(b,K)|0,o=Math.imul(b,H);var ge=(u+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,K),i=(i=Math.imul(g,H))+Math.imul(v,K)|0,o=Math.imul(v,H),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,V)|0;var ve=(u+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,q)|0))<<13)|0;u=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,K),i=(i=Math.imul(_,H))+Math.imul(w,K)|0,o=Math.imul(w,H),n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,W)|0;var ye=(u+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,J)|0))<<13)|0;u=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(O,K),i=(i=Math.imul(O,H))+Math.imul(S,K)|0,o=Math.imul(S,H),n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,V)|0,n=n+Math.imul(g,q)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,Y)|0;var _e=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;u=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,H))+Math.imul(T,K)|0,o=Math.imul(T,H),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(_,q)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,q)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var we=(u+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,K),i=(i=Math.imul(x,H))+Math.imul(I,K)|0,o=Math.imul(I,H),n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,V)|0,n=n+Math.imul(O,q)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,Y)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ee=(u+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,se)|0)+Math.imul(d,oe)|0))<<13)|0;u=((o=o+Math.imul(d,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,H))+Math.imul(k,K)|0,o=Math.imul(k,H),n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(P,q)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,Y)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0;var Oe=(u+(n=n+Math.imul(f,ce)|0)|0)+((8191&(i=(i=i+Math.imul(f,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((o=o+Math.imul(d,ue)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(C,K),i=(i=Math.imul(C,H))+Math.imul(j,K)|0,o=Math.imul(j,H),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(x,q)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Se=(u+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;u=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,H))+Math.imul(B,K)|0,o=Math.imul(B,H),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,se)|0,n=n+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(v,ce)|0,o=o+Math.imul(v,ue)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,de)|0;var Ae=(u+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,be)|0)+Math.imul(d,pe)|0))<<13)|0;u=((o=o+Math.imul(d,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,V))+Math.imul(B,$)|0,o=Math.imul(B,V),n=n+Math.imul(C,q)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,Y)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(_,ce)|0,i=(i=i+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,o=o+Math.imul(w,ue)|0,n=n+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Pe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,W))+Math.imul(B,q)|0,o=Math.imul(B,W),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(w,fe)|0,o=o+Math.imul(w,de)|0;var Te=(u+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;u=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,Y))+Math.imul(B,J)|0,o=Math.imul(B,Y),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,se)|0,n=n+Math.imul(P,ce)|0,i=(i=i+Math.imul(P,ue)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,ue)|0,n=n+Math.imul(O,fe)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,de)|0;var Re=(u+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,be)|0)+Math.imul(w,pe)|0))<<13)|0;u=((o=o+Math.imul(w,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(B,Q)|0,o=Math.imul(B,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,de)|0;var xe=(u+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(B,re)|0,o=Math.imul(B,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,se)|0,n=n+Math.imul(L,ce)|0,i=(i=i+Math.imul(L,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(I,fe)|0,o=o+Math.imul(I,de)|0;var Ie=(u+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,be)|0)+Math.imul(T,pe)|0))<<13)|0;u=((o=o+Math.imul(T,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,se))+Math.imul(B,oe)|0,o=Math.imul(B,se),n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(j,ce)|0,o=o+Math.imul(j,ue)|0,n=n+Math.imul(L,fe)|0,i=(i=i+Math.imul(L,de)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,de)|0;var Me=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,ce),i=(i=Math.imul(U,ue))+Math.imul(B,ce)|0,o=Math.imul(B,ue),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,de)|0;var Le=(u+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,be)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(U,fe),i=(i=Math.imul(U,de))+Math.imul(B,fe)|0,o=Math.imul(B,de);var ke=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(j,pe)|0))<<13)|0;u=((o=o+Math.imul(j,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Ne=(u+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,be))+Math.imul(B,pe)|0))<<13)|0;return u=((o=Math.imul(B,be))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c[0]=me,c[1]=ge,c[2]=ve,c[3]=ye,c[4]=_e,c[5]=we,c[6]=Ee,c[7]=Oe,c[8]=Se,c[9]=Ae,c[10]=Pe,c[11]=Te,c[12]=Re,c[13]=xe,c[14]=Ie,c[15]=Me,c[16]=Le,c[17]=ke,c[18]=Ne,0!==u&&(c[19]=u,r.length++),r};function b(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=h),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,f=(0|e.words[l])*(0|t.words[u]),d=67108863&f;a=67108863&(d=d+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):b(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},m.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var f=c,d=u,h=0;h<s;h++){var p=r[l+h],b=n[l+h],m=r[l+h+s],g=n[l+h+s],v=f*m-d*g;g=f*g+d*m,m=v,r[l+h]=p+m,n[l+h]=b+g,r[l+h+s]=p-m,n[l+h+s]=b-g,h!==a&&(v=c*f-u*d,d=c*d+u*f,f=v)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,u,n),this.transform(s,o,a,c,n,i),this.transform(u,o,l,f,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-c[h]*f[h];c[h]=a[h]*f[h]+c[h]*l[h],a[h]=p}return this.conjugate(a,c,n),this.transform(a,c,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<r;this.words[t]=c|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=r;if(i-=s,i=Math.max(0,i),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var c=(0|e.words[i])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var f=c-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=d)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(f)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(c)):(r.isub(t),a.isub(i),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new O(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(y,v),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(_,v),i(w,v),i(E,v),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new _;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return g[e]=t,t},O.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var b=h,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var g=this.pow(f,new o(1).iushln(p-m-1));d=d.redMul(g),f=g.redSqr(),h=h.redMul(f),p=m}return d},O.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},O.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var f=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new S(e)},i(S,O),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},2745:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(8087);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},7022:(e,t,r)=>{var n=r(8166);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8616:(e,t,r)=>{"use strict";var n=r(7022),i=r(7834).Buffer;e.exports=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=e(t);return n.encode(i.concat([t,r],t.length+4))},decode:function(e){var r=t(n.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=n.decodeUnsafe(e);if(r)return t(r)}}}},4075:(e,t,r)=>{"use strict";var n=r(6162),i=r(8616);e.exports=i((function(e){var t=n("sha256").update(e).digest();return n("sha256").update(t).digest()}))},8834:(e,t,r)=>{"use strict";const n=r(5766),i=r(2333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|b(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||J(e.length)?a(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function b(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function _(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(J(n))return s;e[r+s]=n}return s}function w(e,t,r,n){return W(z(t,e.length-r),e,r,n)}function E(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function O(e,t,r,n){return W(q(t),e,r,n)}function S(e,t,r,n){return W(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=T));return r}(n)}t.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},c.allocUnsafe=function(e){return f(e)},c.allocUnsafeSlow=function(e){return f(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Z(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=b,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?P(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==l[e]){o=u[e],s=l[e];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function x(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function I(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function M(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function L(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function N(e,t,r,n,i){H(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function C(e,t,r,n,i){H(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return t=+t,r>>>=0,o||j(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,o){return t=+t,r>>>=0,o||j(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){k(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){k(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=X((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=X((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=X((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=X((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const B={};function F(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function K(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,i,o)}function G(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw G(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=K(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=K(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},3973:(e,t,r)=>{var n=r(7834).Buffer,i=r(4851).Transform,o=r(214).s;function s(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(1285)(s,i),s.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},s.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=s},6162:(e,t,r)=>{"use strict";var n=r(1285),i=r(7993),o=r(1445),s=r(9065),a=r(3973);function c(e){a.call(this,"digest"),this._hash=e}n(c,a),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new c(s(e))}},7554:(e,t,r)=>{"use strict";var n=t;n.version=r(763).i8,n.utils=r(8288),n.rand=r(2745),n.curve=r(8610),n.curves=r(1479),n.ec=r(8596),n.eddsa=r(9208)},8919:(e,t,r)=>{"use strict";var n=r(2197),i=r(8288),o=i.getNAF,s=i.getJSF,a=i.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,c,u=[];for(s=0;s<n.length;s+=r.step){c=0;for(var l=s+r.step-1;l>=s;l--)c=(c<<1)+n[l];u.push(c)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(s=0;s<u.length;s++)(c=u[s])===h?d=d.mixedAdd(r.points[s]):c===-h&&(d=d.mixedAdd(r.points[s].neg()));f=f.add(d)}return f.toP()},c.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(t,r,this._bitLength),c=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(var l=0;u>=0&&0===s[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var f=s[u];a(0!==f),c="affine"===e.type?f>0?c.mixedAdd(i[f-1>>1]):c.mixedAdd(i[-f-1>>1].neg()):f>0?c.add(i[f-1>>1]):c.add(i[-f-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){var a,c,u,l=this._wnafT1,f=this._wnafT2,d=this._wnafT3,h=0;for(a=0;a<n;a++){var p=(u=t[a])._getNAFPoints(e);l[a]=p.wnd,f[a]=p.points}for(a=n-1;a>=1;a-=2){var b=a-1,m=a;if(1===l[b]&&1===l[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=s(r[b],r[m]);for(h=Math.max(y[0].length,h),d[b]=new Array(h),d[m]=new Array(h),c=0;c<h;c++){var _=0|y[0][c],w=0|y[1][c];d[b][c]=v[3*(_+1)+(w+1)],d[m][c]=0,f[b]=g}}else d[b]=o(r[b],l[b],this._bitLength),d[m]=o(r[m],l[m],this._bitLength),h=Math.max(d[b].length,h),h=Math.max(d[m].length,h)}var E=this.jpoint(null,null,null),O=this._wnafT4;for(a=h;a>=0;a--){for(var S=0;a>=0;){var A=!0;for(c=0;c<n;c++)O[c]=0|d[c][a],0!==O[c]&&(A=!1);if(!A)break;S++,a--}if(a>=0&&S++,E=E.dblp(S),a<0)break;for(c=0;c<n;c++){var P=O[c];0!==P&&(P>0?u=f[c][P-1>>1]:P<0&&(u=f[c][-P-1>>1].neg()),E="affine"===u.type?E.mixedAdd(u):E.add(u))}}for(a=0;a<n;a++)f[a]=null;return i?E:E.toP()},c.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(e){return this.encode(e,!0)},u.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},u.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},u.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},u.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},u.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},7105:(e,t,r)=>{"use strict";var n=r(8288),i=r(2197),o=r(1285),s=r(8919),a=n.assert;function c(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function u(e,t,r,n,o){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(c,s),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)},c.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(u,s.BasePoint),c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},c.prototype.point=function(e,t,r,n){return new u(this,e,t,r,n)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),c=i.redMul(s),u=o.redMul(a),l=i.redMul(a),f=s.redMul(o);return this.curve.point(c,u,f,l)},u.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(e=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=s.redSub(a).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=a.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),c=r.redAdd(t),u=o.redMul(s),l=a.redMul(c),f=o.redMul(c),d=s.redMul(a);return this.curve.point(u,l,d,f)},u.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),c=i.redSub(a),u=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),f=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(f,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},8610:(e,t,r)=>{"use strict";var n=t;n.base=r(8919),n.short=r(7715),n.mont=r(5125),n.edwards=r(7105)},5125:(e,t,r)=>{"use strict";var n=r(2197),i=r(1285),o=r(8919),s=r(8288);function a(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(c,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new c(this,e,t)},a.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},7715:(e,t,r)=>{"use strict";var n=r(8288),i=r(2197),o=r(1285),s=r(8919),a=n.assert;function c(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(c,s),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,c,u,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new i(1),b=new i(0),m=new i(0),g=new i(1),v=0;0!==d.cmpn(0);){var y=h.div(d);u=h.sub(y.mul(d)),l=m.sub(y.mul(p));var _=g.sub(y.mul(b));if(!n&&u.cmp(f)<0)t=c.neg(),r=p,n=u.neg(),o=l;else if(n&&2==++v)break;c=u,h=d,d=u,m=p,p=l,g=b,b=_}s=u.neg(),a=l;var w=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(w)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*o]=a,n[2*o+1]=c,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return u},o(u,s.BasePoint),c.prototype.point=function(e,t,r){return new u(this,e,t,r)},c.prototype.pointFromJSON=function(e,t){return u.fromJSON(this,e,t)},u.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),c.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),f=n.redMul(u),d=c.redSqr().redIAdd(l).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,h,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),f=a.redSqr().redIAdd(u).redISub(l).redISub(l),d=a.redMul(l.redISub(f)).redISub(i.redMul(u)),h=this.z.redMul(s);return this.curve.jpoint(f,d,h)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),f=u.redSqr(),d=f.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(f),b=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=h.redMul(m);g=g.redIAdd(g).redISub(d);var v=u.redMul(a);t+1<e&&(c=c.redMul(d)),o=b,a=v,u=g}return this.curve.jpoint(o,u.redMul(i),a)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),f=this.y.redSqr(),d=f.redSqr(),h=this.x.redAdd(f).redSqr().redISub(l).redISub(d);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),b=p.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},l.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),f=this.y.redSqr(),d=this.x.redMul(f),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(l);var m=f.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},l.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),f=u.redISub(l),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=a.redMul(f).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.x.redMul(a).redISub(l);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(f,d,h)},l.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},l.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},l.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},1479:(e,t,r)=>{"use strict";var n,i=t,o=r(3506),s=r(8610),a=r(8288).assert;function c(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(7983)}catch(e){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},8596:(e,t,r)=>{"use strict";var n=r(2197),i=r(8873),o=r(8288),s=r(1479),a=r(2745),c=o.assert,u=r(2307),l=r(1798);function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=f,f.prototype.keyPair=function(e){return new u(this,e)},f.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),c=e.toArray("be",s),u=new i({hash:this.hash,entropy:a,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),d=0;;d++){var h=o.k?o.k(d):new n(u.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(f)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var g=h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),v^=1),new l({r:m,s:g,recoveryParam:v})}}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new l(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(e).umod(this.n),f=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(e,t,r,i){c((3&r)===r,"The recovery param is more than two bits"),t=new l(t,i);var o=this.n,s=new n(e),a=t.r,u=t.s,f=1&r,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var h=t.r.invm(o),p=o.sub(s).mul(h).umod(o),b=u.mul(h).umod(o);return this.g.mulAdd(p,a,b)},f.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new l(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},2307:(e,t,r)=>{"use strict";var n=r(2197),i=r(8288).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},1798:(e,t,r)=>{"use strict";var n=r(2197),i=r(8288),o=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function u(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function l(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=c(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=c(e,r);if(!1===s)return!1;var u=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var l=c(e,r);if(!1===l)return!1;if(e.length!==l+r.place)return!1;var f=e.slice(r.place,l+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(u),this.s=new n(f),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,e)}},9208:(e,t,r)=>{"use strict";var n=r(3506),i=r(1479),o=r(8288),s=o.assert,a=o.parseBytes,c=r(851),u=r(6117);function l(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=l,l.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),c=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},l.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(e){return c.fromPublic(this,e)},l.prototype.keyFromSecret=function(e){return c.fromSecret(this,e)},l.prototype.makeSignature=function(e){return e instanceof u?e:new u(this,e)},l.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},l.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},l.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(e){return o.intFromLE(e)},l.prototype.isPoint=function(e){return e instanceof this.pointClass}},851:(e,t,r)=>{"use strict";var n=r(8288),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},6117:(e,t,r)=>{"use strict";var n=r(2197),i=r(8288),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function c(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},7983:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},8288:(e,t,r)=>{"use strict";var n=t,i=r(2197),o=r(9561),s=r(3022);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,c=o.andln(i-1);o.isOdd()?(a=c>(i>>1)-1?(i>>1)-c:c,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(s),a=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},2699:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}b(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&b(e,"error",t,r)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,o,s,u;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function b(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,l=p(c,u);for(r=0;r<u;++r)n(l[r],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},o.prototype.listenerCount=h,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},5695:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},o={key:n,value:e[n]};return r(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,s;if(Array.isArray(t)){for(s="[",r=0;r<t.length;r++)r&&(s+=","),s+=e(t[r])||"null";return s+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=o.push(t)-1,c=Object.keys(t).sort(i&&i(t));for(s="",r=0;r<c.length;r++){var u=c[r],l=e(t[u]);l&&(s&&(s+=","),s+=JSON.stringify(u)+":"+l)}return o.splice(a,1),"{"+s+"}"}}(e)}},4485:(e,t,r)=>{"use strict";var n=r(7834).Buffer,i=r(696).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(1285)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var s=0,a=8*e.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},3506:(e,t,r)=>{var n=t;n.utils=r(212),n.common=r(4495),n.sha=r(5530),n.ripemd=r(1396),n.hmac=r(5047),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},4495:(e,t,r)=>{"use strict";var n=r(212),i=r(9561);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},5047:(e,t,r)=>{"use strict";var n=r(212),i=r(9561);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},1396:(e,t,r)=>{"use strict";var n=r(212),i=r(4495),o=n.rotl32,s=n.sum32,a=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(l,u),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],l=this.h[4],v=r,y=n,_=i,w=u,E=l,O=0;O<80;O++){var S=s(o(c(r,f(O,n,i,u),e[p[O]+t],d(O)),m[O]),l);r=l,l=u,u=o(i,10),i=n,n=S,S=s(o(c(v,f(79-O,y,_,w),e[b[O]+t],h(O)),g[O]),E),v=E,E=w,w=o(_,10),_=y,y=S}S=a(this.h[1],i,w),this.h[1]=a(this.h[2],u,E),this.h[2]=a(this.h[3],l,v),this.h[3]=a(this.h[4],r,y),this.h[4]=a(this.h[0],n,_),this.h[0]=S},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},5530:(e,t,r)=>{"use strict";t.sha1=r(5079),t.sha224=r(3823),t.sha256=r(8032),t.sha384=r(5328),t.sha512=r(168)},5079:(e,t,r)=>{"use strict";var n=r(212),i=r(4495),o=r(713),s=n.rotl32,a=n.sum32,c=n.sum32_5,u=o.ft_1,l=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,l),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],l=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=c(s(i,5),u(p,o,l,d),h,r[n],f[p]);h=d,d=l,l=s(o,30),o=i,i=b}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],l),this.h[3]=a(this.h[3],d),this.h[4]=a(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},3823:(e,t,r)=>{"use strict";var n=r(212),i=r(8032);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},8032:(e,t,r)=>{"use strict";var n=r(212),i=r(4495),o=r(713),s=r(9561),a=n.sum32,c=n.sum32_4,u=n.sum32_5,l=o.ch32,f=o.maj32,d=o.s0_256,h=o.s1_256,p=o.g0_256,b=o.g1_256,m=i.BlockHash,g=[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];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(v,m),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=c(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],m=this.h[2],g=this.h[3],v=this.h[4],y=this.h[5],_=this.h[6],w=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=u(w,h(v),l(v,y,_),this.k[n],r[n]),O=a(d(i),f(i,o,m));w=_,_=y,y=v,v=a(g,E),g=m,m=o,o=i,i=a(E,O)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],m),this.h[3]=a(this.h[3],g),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],y),this.h[6]=a(this.h[6],_),this.h[7]=a(this.h[7],w)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},5328:(e,t,r)=>{"use strict";var n=r(212),i=r(168);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},168:(e,t,r)=>{"use strict";var n=r(212),i=r(4495),o=r(9561),s=n.rotr64_hi,a=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,l=n.sum64,f=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,m=n.sum64_5_lo,g=i.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function _(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function w(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function O(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function S(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function P(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function R(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}function M(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(y,g),e.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=I(r[n-4],r[n-3]),o=M(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=R(r[n-30],r[n-29]),u=x(r[n-30],r[n-29]),l=r[n-32],f=r[n-31];r[n]=h(i,o,s,a,c,u,l,f),r[n+1]=p(i,o,s,a,c,u,l,f)}},y.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],h=this.h[6],p=this.h[7],g=this.h[8],v=this.h[9],y=this.h[10],R=this.h[11],x=this.h[12],I=this.h[13],M=this.h[14],L=this.h[15];o(this.k.length===r.length);for(var k=0;k<r.length;k+=2){var N=M,C=L,j=P(g,v),D=T(g,v),U=_(g,v,y,R,x),B=w(g,v,y,R,x,I),F=this.k[k],K=this.k[k+1],H=r[k],G=r[k+1],$=b(N,C,j,D,U,B,F,K,H,G),V=m(N,C,j,D,U,B,F,K,H,G);N=S(n,i),C=A(n,i),j=E(n,i,s,a,c),D=O(n,i,s,a,c,u);var z=f(N,C,j,D),q=d(N,C,j,D);M=x,L=I,x=y,I=R,y=g,R=v,g=f(h,p,$,V),v=d(p,p,$,V),h=c,p=u,c=s,u=a,s=n,a=i,n=f($,V,z,q),i=d($,V,z,q)}l(this.h,0,n,i),l(this.h,2,s,a),l(this.h,4,c,u),l(this.h,6,h,p),l(this.h,8,g,v),l(this.h,10,y,R),l(this.h,12,x,I),l(this.h,14,M,L)},y.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},713:(e,t,r)=>{"use strict";var n=r(212).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},212:(e,t,r)=>{"use strict";var n=r(9561),i=r(1285);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=s(i)),r+=c(i.toString(16))}return r},t.zero2=a,t.zero8=c,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var s=new Array(o/4),a=0,c=t;a<s.length;a++,c+=4){var u;u="big"===i?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],s[a]=u>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+r+i+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,c,u){var l=0,f=t;return l+=(f=f+n>>>0)<t?1:0,l+=(f=f+o>>>0)<o?1:0,l+=(f=f+a>>>0)<a?1:0,e+r+i+s+c+(l+=(f=f+u>>>0)<u?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,c,u){return t+n+o+a+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},8873:(e,t,r)=>{"use strict";var n=r(3506),i=r(3022),o=r(9561);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,i.encode(s,t)}},2333:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=d,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=u}return(h?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,f=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+f>=1?d/c:d*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*c-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+h]=255&s,h+=p,s/=256,u-=8);e[r+h-p]|=128*b}},1285:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7993:(e,t,r)=>{"use strict";var n=r(1285),i=r(4485),o=r(7834).Buffer,s=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<<t|e>>>32-t}function u(e,t,r,n,i,o,s){return c(e+(t&r|~t&n)+i+o|0,s)+t|0}function l(e,t,r,n,i,o,s){return c(e+(t&n|r&~n)+i+o|0,s)+t|0}function f(e,t,r,n,i,o,s){return c(e+(t^r^n)+i+o|0,s)+t|0}function d(e,t,r,n,i,o,s){return c(e+(r^(t|~n))+i+o|0,s)+t|0}n(a,i),a.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=u(r,n,i,o,e[0],3614090360,7),o=u(o,r,n,i,e[1],3905402710,12),i=u(i,o,r,n,e[2],606105819,17),n=u(n,i,o,r,e[3],3250441966,22),r=u(r,n,i,o,e[4],4118548399,7),o=u(o,r,n,i,e[5],1200080426,12),i=u(i,o,r,n,e[6],2821735955,17),n=u(n,i,o,r,e[7],4249261313,22),r=u(r,n,i,o,e[8],1770035416,7),o=u(o,r,n,i,e[9],2336552879,12),i=u(i,o,r,n,e[10],4294925233,17),n=u(n,i,o,r,e[11],2304563134,22),r=u(r,n,i,o,e[12],1804603682,7),o=u(o,r,n,i,e[13],4254626195,12),i=u(i,o,r,n,e[14],2792965006,17),r=l(r,n=u(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=l(o,r,n,i,e[6],3225465664,9),i=l(i,o,r,n,e[11],643717713,14),n=l(n,i,o,r,e[0],3921069994,20),r=l(r,n,i,o,e[5],3593408605,5),o=l(o,r,n,i,e[10],38016083,9),i=l(i,o,r,n,e[15],3634488961,14),n=l(n,i,o,r,e[4],3889429448,20),r=l(r,n,i,o,e[9],568446438,5),o=l(o,r,n,i,e[14],3275163606,9),i=l(i,o,r,n,e[3],4107603335,14),n=l(n,i,o,r,e[8],1163531501,20),r=l(r,n,i,o,e[13],2850285829,5),o=l(o,r,n,i,e[2],4243563512,9),i=l(i,o,r,n,e[7],1735328473,14),r=f(r,n=l(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=f(o,r,n,i,e[8],2272392833,11),i=f(i,o,r,n,e[11],1839030562,16),n=f(n,i,o,r,e[14],4259657740,23),r=f(r,n,i,o,e[1],2763975236,4),o=f(o,r,n,i,e[4],1272893353,11),i=f(i,o,r,n,e[7],4139469664,16),n=f(n,i,o,r,e[10],3200236656,23),r=f(r,n,i,o,e[13],681279174,4),o=f(o,r,n,i,e[0],3936430074,11),i=f(i,o,r,n,e[3],3572445317,16),n=f(n,i,o,r,e[6],76029189,23),r=f(r,n,i,o,e[9],3654602809,4),o=f(o,r,n,i,e[12],3873151461,11),i=f(i,o,r,n,e[15],530742520,16),r=d(r,n=f(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=d(o,r,n,i,e[7],1126891415,10),i=d(i,o,r,n,e[14],2878612391,15),n=d(n,i,o,r,e[5],4237533241,21),r=d(r,n,i,o,e[12],1700485571,6),o=d(o,r,n,i,e[3],2399980690,10),i=d(i,o,r,n,e[10],4293915773,15),n=d(n,i,o,r,e[1],2240044497,21),r=d(r,n,i,o,e[8],1873313359,6),o=d(o,r,n,i,e[15],4264355552,10),i=d(i,o,r,n,e[6],2734768916,15),n=d(n,i,o,r,e[13],1309151649,21),r=d(r,n,i,o,e[4],4149444226,6),o=d(o,r,n,i,e[11],3174756917,10),i=d(i,o,r,n,e[2],718787259,15),n=d(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=a},9561:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},3022:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},4452:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,s,a;if("string"==typeof t&&(o="not ",t.substr(!s||s<0?0:+s,o.length)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},7073:(e,t,r)=>{"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var i=r(8051),o=r(2557);r(1285)(u,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var c=s[a];u.prototype[c]||(u.prototype[c]=o.prototype[c])}function u(e){if(!(this instanceof u))return new u(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||process.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},5163:(e,t,r)=>{"use strict";e.exports=i;var n=r(7640);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(1285)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},8051:(e,t,r)=>{"use strict";var n;e.exports=S,S.ReadableState=O;r(2699).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=r(5010),s=r(8834).Buffer,a=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,u=r(6602);c=u&&u.debuglog?u.debuglog("stream"):function(){};var l,f,d,h=r(6637),p=r(2262),b=r(7605).getHighWaterMark,m=r(4452).q,g=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,y=m.ERR_METHOD_NOT_IMPLEMENTED,_=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(1285)(S,o);var w=p.errorOrDestroy,E=["error","close","destroy","pause","resume"];function O(e,t,i){n=n||r(7073),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=b(this,e,"readableHighWaterMark",i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(214).s),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(7073),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new O(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function A(e,t,r,n,i){c("readableAddChunk",t);var o,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?x(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}(e,u);else if(i||(o=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof a||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(u,t)),o)w(e,o);else if(u.objectMode||t&&t.length>0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)u.endEmitted?w(e,new _):P(e,u,t,!0);else if(u.ended)w(e,new v);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?P(e,u,t,!1):M(e,u)):P(e,u,t,!1)}else n||(u.reading=!1,M(e,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function P(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&x(e)),M(e,t)}Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),S.prototype.destroy=p.destroy,S.prototype._undestroy=p.undestroy,S.prototype._destroy=function(e,t){t(e)},S.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},S.prototype.unshift=function(e){return A(this,e,null,!0,!1)},S.prototype.isPaused=function(){return!1===this._readableState.flowing},S.prototype.setEncoding=function(e){l||(l=r(214).s);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var T=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function x(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(I,e))}function I(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,j(e)}function M(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function k(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function N(e){c("readable nexttick read 0"),e.read(0)}function C(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(B,t,e))}function B(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}S.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):x(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(n=e>0?D(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},S.prototype._read=function(e){w(this,new y("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?a:b;function s(t,i){c("onunpipe"),t===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,c("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function a(){c("onend"),e.end()}n.endEmitted?process.nextTick(o):r.once("end",o),e.on("unpipe",s);var u=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,j(e))}}(r);e.on("drain",u);var l=!1;function f(t){c("ondata");var i=e.write(t);c("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==F(n.pipes,e))&&!l&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){c("onerror",t),b(),e.removeListener("error",d),0===i(e,"error")&&w(e,t)}function h(){e.removeListener("finish",p),b()}function p(){c("onfinish"),e.removeListener("close",h),b()}function b(){c("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",h),e.once("finish",p),e.emit("pipe",r),n.flowing||(c("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=F(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},S.prototype.on=function(e,t){var r=o.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?x(this):n.reading||process.nextTick(N,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(k,this),r},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(k,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(C,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<E.length;o++)e.on(E[o],this.emit.bind(this,E[o]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(1029)),f(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),S._fromList=D,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(e,t){return void 0===d&&(d=r(352)),d(S,e,t)})},7640:(e,t,r)=>{"use strict";e.exports=l;var n=r(4452).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(7073);function u(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);c.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,r){d(e,t,r)}))}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(1285)(l,c),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,(function(e){t(e)}))}},2557:(e,t,r)=>{"use strict";function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=S,S.WritableState=O;var o={deprecate:r(5803)},s=r(5010),a=r(8834).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var u,l=r(2262),f=r(7605).getHighWaterMark,d=r(4452).q,h=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENTED,b=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,g=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,y=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,w=l.errorOrDestroy;function E(){}function O(e,t,o){i=i||r(7073),e=e||{},"boolean"!=typeof o&&(o=t instanceof i),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(I,e,t),e._writableState.errorEmitted=!0,w(e,n)):(i(n),e._writableState.errorEmitted=!0,w(e,n),I(e,t))}(e,r,n,t,i);else{var o=R(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?process.nextTick(P,e,r,o,i):P(e,r,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function S(e){var t=this instanceof(i=i||r(7073));if(!t&&!u.call(S,this))return new S(e);this._writableState=new O(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),s.call(this)}function A(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function P(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),I(e,t)}function T(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,o=new Array(i),s=t.corkedRequestsFree;s.entry=r;for(var a=0,c=!0;r;)o[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;o.allBuffers=c,A(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new n(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,f=r.callback;if(A(e,t,!1,t.objectMode?1:u.length,u,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final((function(r){t.pendingcb--,r&&w(e,r),t.prefinished=!0,e.emit("prefinish"),I(e,t)}))}function I(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(x,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(1285)(S,s),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!u.call(this,e)||this===S&&(e&&e._writableState instanceof O)}})):u=function(e){return e instanceof this},S.prototype.pipe=function(){w(this,new m)},S.prototype.write=function(e,t,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=e,a.isBuffer(n)||n instanceof c);return s&&!a.isBuffer(e)&&(e=function(e){return a.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=E),i.ending?function(e,t){var r=new y;w(e,r),process.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i;return null===r?i=new v:"string"==typeof r||t.objectMode||(i=new h("chunk",["string","Buffer"],r)),!i||(w(e,i),process.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=a.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var c=t.objectMode?1:n.length;t.length+=c;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,c,n,i,o);return u}(this,i,s,e,t,r)),o},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},S.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new p("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,I(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=l.destroy,S.prototype._undestroy=l.undestroy,S.prototype._destroy=function(e,t){t(e)}},1029:(e,t,r)=>{"use strict";var n;function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(9885),s=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[s];if(null!==t){var r=e[d].read();null!==r&&(e[l]=null,e[s]=null,e[a]=null,t(h(r,!1)))}}function b(e){process.nextTick(p,e)}var m=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((i(n={get stream(){return this[d]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[c]?r(e[c]):t(h(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[u]?r(h(void 0,!0)):t[f](r,n)}),n)}}(n,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(h(i,!1));r=new Promise(this[f])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),m);e.exports=function(e){var t,r=Object.create(g,(i(t={},d,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,u,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[d].read();n?(r[l]=null,r[s]=null,r[a]=null,e(h(n,!1))):(r[s]=e,r[a]=t)},writable:!0}),t));return r[l]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[a];return null!==t&&(r[l]=null,r[s]=null,r[a]=null,t(e)),void(r[c]=e)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[a]=null,n(h(void 0,!0))),r[u]=!0})),e.on("readable",b.bind(null,r)),r}},6637:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var c=r(8834).Buffer,u=r(4854).inspect,l=u&&u.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,n;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t,r,n,i=c.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,c.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return u(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},2262:e=>{"use strict";function t(e,t){n(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,e)):process.nextTick(n,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!i&&e?o._writableState?o._writableState.errorEmitted?process.nextTick(r,o):(o._writableState.errorEmitted=!0,process.nextTick(t,o,e)):process.nextTick(t,o,e):i?(process.nextTick(r,o),i(e)):process.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},9885:(e,t,r)=>{"use strict";var n=r(4452).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,c=function(){t.writable||l()},u=t._writableState&&t._writableState.finished,l=function(){a=!1,u=!0,s||o.call(t)},f=t._readableState&&t._readableState.endEmitted,d=function(){s=!1,f=!0,a||o.call(t)},h=function(e){o.call(t,e)},p=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!u?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},b=function(){t.req.on("finish",l)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?a&&!t._writableState&&(t.on("end",c),t.on("close",c)):(t.on("complete",l),t.on("abort",p),t.req?b():t.on("request",b)),t.on("end",d),t.on("finish",l),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",b),t.req&&t.req.removeListener("finish",l),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",l),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},352:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},3495:(e,t,r)=>{"use strict";var n;var i=r(4452).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function c(e){e()}function u(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var l,f=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var d=t.map((function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(9885)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var c=!1;return function(t){if(!a&&!c)return c=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,(function(e){l||(l=e),e&&d.forEach(c),o||(d.forEach(c),f(l))}))}));return t.reduce(u)}},7605:(e,t,r)=>{"use strict";var n=r(4452).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},5010:(e,t,r)=>{e.exports=r(2699).EventEmitter},696:(e,t,r)=>{(t=e.exports=r(8051)).Stream=t,t.Readable=t,t.Writable=r(2557),t.Duplex=r(7073),t.Transform=r(7640),t.PassThrough=r(5163),t.finished=r(9885),t.pipeline=r(3495)},1445:(e,t,r)=>{"use strict";var n=r(8834).Buffer,i=r(1285),o=r(4485),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],f=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function h(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function b(e,t,r,n,i,o,s,a){return p(e+(t^r^n)+o+s|0,a)+i|0}function m(e,t,r,n,i,o,s,a){return p(e+(t&r|~t&n)+o+s|0,a)+i|0}function g(e,t,r,n,i,o,s,a){return p(e+((t|~r)^n)+o+s|0,a)+i|0}function v(e,t,r,n,i,o,s,a){return p(e+(t&n|r&~n)+o+s|0,a)+i|0}function y(e,t,r,n,i,o,s,a){return p(e+(t^(r|~n))+o+s|0,a)+i|0}i(h,o),h.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,h=0|this._e,_=0|this._a,w=0|this._b,E=0|this._c,O=0|this._d,S=0|this._e,A=0;A<80;A+=1){var P,T;A<16?(P=b(r,n,i,o,h,e[a[A]],f[0],u[A]),T=y(_,w,E,O,S,e[c[A]],d[0],l[A])):A<32?(P=m(r,n,i,o,h,e[a[A]],f[1],u[A]),T=v(_,w,E,O,S,e[c[A]],d[1],l[A])):A<48?(P=g(r,n,i,o,h,e[a[A]],f[2],u[A]),T=g(_,w,E,O,S,e[c[A]],d[2],l[A])):A<64?(P=v(r,n,i,o,h,e[a[A]],f[3],u[A]),T=m(_,w,E,O,S,e[c[A]],d[3],l[A])):(P=y(r,n,i,o,h,e[a[A]],f[4],u[A]),T=b(_,w,E,O,S,e[c[A]],d[4],l[A])),r=h,h=o,o=p(i,10),i=n,n=P,_=S,S=O,O=p(E,10),E=w,w=T}var R=this._b+i+O|0;this._b=this._c+o+S|0,this._c=this._d+h+_|0,this._d=this._e+r+w|0,this._e=this._a+n+E|0,this._a=R},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},977: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.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.interval=t.iif=t.generate=t.fromEventPattern=t.fromEvent=t.from=t.forkJoin=t.empty=t.defer=t.connectable=t.concat=t.combineLatest=t.bindNodeCallback=t.bindCallback=t.UnsubscriptionError=t.TimeoutError=t.SequenceError=t.ObjectUnsubscribedError=t.NotFoundError=t.EmptyError=t.ArgumentOutOfRangeError=t.firstValueFrom=t.lastValueFrom=t.isObservable=t.identity=t.noop=t.pipe=t.NotificationKind=t.Notification=t.Subscriber=t.Subscription=t.Scheduler=t.VirtualAction=t.VirtualTimeScheduler=t.animationFrameScheduler=t.animationFrame=t.queueScheduler=t.queue=t.asyncScheduler=t.async=t.asapScheduler=t.asap=t.AsyncSubject=t.ReplaySubject=t.BehaviorSubject=t.Subject=t.animationFrames=t.observable=t.ConnectableObservable=t.Observable=void 0,t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.combineLatestWith=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=t.config=t.NEVER=t.EMPTY=t.scheduled=t.zip=t.using=t.timer=t.throwError=t.range=t.race=t.partition=t.pairs=t.onErrorResumeNext=t.of=t.never=t.merge=void 0,t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.pairwise=t.onErrorResumeNextWith=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=t.mergeAll=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=void 0,t.zipWith=t.zipAll=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=void 0;var o=r(4174);Object.defineProperty(t,"Observable",{enumerable:!0,get:function(){return o.Observable}});var s=r(7165);Object.defineProperty(t,"ConnectableObservable",{enumerable:!0,get:function(){return s.ConnectableObservable}});var a=r(4595);Object.defineProperty(t,"observable",{enumerable:!0,get:function(){return a.observable}});var c=r(2447);Object.defineProperty(t,"animationFrames",{enumerable:!0,get:function(){return c.animationFrames}});var u=r(5294);Object.defineProperty(t,"Subject",{enumerable:!0,get:function(){return u.Subject}});var l=r(8114);Object.defineProperty(t,"BehaviorSubject",{enumerable:!0,get:function(){return l.BehaviorSubject}});var f=r(8806);Object.defineProperty(t,"ReplaySubject",{enumerable:!0,get:function(){return f.ReplaySubject}});var d=r(9960);Object.defineProperty(t,"AsyncSubject",{enumerable:!0,get:function(){return d.AsyncSubject}});var h=r(3769);Object.defineProperty(t,"asap",{enumerable:!0,get:function(){return h.asap}}),Object.defineProperty(t,"asapScheduler",{enumerable:!0,get:function(){return h.asapScheduler}});var p=r(7152);Object.defineProperty(t,"async",{enumerable:!0,get:function(){return p.async}}),Object.defineProperty(t,"asyncScheduler",{enumerable:!0,get:function(){return p.asyncScheduler}});var b=r(4093);Object.defineProperty(t,"queue",{enumerable:!0,get:function(){return b.queue}}),Object.defineProperty(t,"queueScheduler",{enumerable:!0,get:function(){return b.queueScheduler}});var m=r(8989);Object.defineProperty(t,"animationFrame",{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(t,"animationFrameScheduler",{enumerable:!0,get:function(){return m.animationFrameScheduler}});var g=r(2929);Object.defineProperty(t,"VirtualTimeScheduler",{enumerable:!0,get:function(){return g.VirtualTimeScheduler}}),Object.defineProperty(t,"VirtualAction",{enumerable:!0,get:function(){return g.VirtualAction}});var v=r(6949);Object.defineProperty(t,"Scheduler",{enumerable:!0,get:function(){return v.Scheduler}});var y=r(4666);Object.defineProperty(t,"Subscription",{enumerable:!0,get:function(){return y.Subscription}});var _=r(7747);Object.defineProperty(t,"Subscriber",{enumerable:!0,get:function(){return _.Subscriber}});var w=r(9828);Object.defineProperty(t,"Notification",{enumerable:!0,get:function(){return w.Notification}}),Object.defineProperty(t,"NotificationKind",{enumerable:!0,get:function(){return w.NotificationKind}});var E=r(5250);Object.defineProperty(t,"pipe",{enumerable:!0,get:function(){return E.pipe}});var O=r(7116);Object.defineProperty(t,"noop",{enumerable:!0,get:function(){return O.noop}});var S=r(8987);Object.defineProperty(t,"identity",{enumerable:!0,get:function(){return S.identity}});var A=r(3659);Object.defineProperty(t,"isObservable",{enumerable:!0,get:function(){return A.isObservable}});var P=r(4798);Object.defineProperty(t,"lastValueFrom",{enumerable:!0,get:function(){return P.lastValueFrom}});var T=r(7327);Object.defineProperty(t,"firstValueFrom",{enumerable:!0,get:function(){return T.firstValueFrom}});var R=r(9216);Object.defineProperty(t,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return R.ArgumentOutOfRangeError}});var x=r(9088);Object.defineProperty(t,"EmptyError",{enumerable:!0,get:function(){return x.EmptyError}});var I=r(5722);Object.defineProperty(t,"NotFoundError",{enumerable:!0,get:function(){return I.NotFoundError}});var M=r(8499);Object.defineProperty(t,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return M.ObjectUnsubscribedError}});var L=r(7298);Object.defineProperty(t,"SequenceError",{enumerable:!0,get:function(){return L.SequenceError}});var k=r(1316);Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return k.TimeoutError}});var N=r(4043);Object.defineProperty(t,"UnsubscriptionError",{enumerable:!0,get:function(){return N.UnsubscriptionError}});var C=r(6238);Object.defineProperty(t,"bindCallback",{enumerable:!0,get:function(){return C.bindCallback}});var j=r(2375);Object.defineProperty(t,"bindNodeCallback",{enumerable:!0,get:function(){return j.bindNodeCallback}});var D=r(508);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return D.combineLatest}});var U=r(3364);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return U.concat}});var B=r(5360);Object.defineProperty(t,"connectable",{enumerable:!0,get:function(){return B.connectable}});var F=r(9623);Object.defineProperty(t,"defer",{enumerable:!0,get:function(){return F.defer}});var K=r(6929);Object.defineProperty(t,"empty",{enumerable:!0,get:function(){return K.empty}});var H=r(9220);Object.defineProperty(t,"forkJoin",{enumerable:!0,get:function(){return H.forkJoin}});var G=r(4417);Object.defineProperty(t,"from",{enumerable:!0,get:function(){return G.from}});var $=r(9671);Object.defineProperty(t,"fromEvent",{enumerable:!0,get:function(){return $.fromEvent}});var V=r(7357);Object.defineProperty(t,"fromEventPattern",{enumerable:!0,get:function(){return V.fromEventPattern}});var z=r(3482);Object.defineProperty(t,"generate",{enumerable:!0,get:function(){return z.generate}});var q=r(550);Object.defineProperty(t,"iif",{enumerable:!0,get:function(){return q.iif}});var W=r(3154);Object.defineProperty(t,"interval",{enumerable:!0,get:function(){return W.interval}});var Z=r(2039);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return Z.merge}});var J=r(2980);Object.defineProperty(t,"never",{enumerable:!0,get:function(){return J.never}});var Y=r(1377);Object.defineProperty(t,"of",{enumerable:!0,get:function(){return Y.of}});var X=r(8362);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return X.onErrorResumeNext}});var Q=r(968);Object.defineProperty(t,"pairs",{enumerable:!0,get:function(){return Q.pairs}});var ee=r(6394);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ee.partition}});var te=r(6849);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return te.race}});var re=r(7284);Object.defineProperty(t,"range",{enumerable:!0,get:function(){return re.range}});var ne=r(40);Object.defineProperty(t,"throwError",{enumerable:!0,get:function(){return ne.throwError}});var ie=r(8069);Object.defineProperty(t,"timer",{enumerable:!0,get:function(){return ie.timer}});var oe=r(3348);Object.defineProperty(t,"using",{enumerable:!0,get:function(){return oe.using}});var se=r(4981);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return se.zip}});var ae=r(2862);Object.defineProperty(t,"scheduled",{enumerable:!0,get:function(){return ae.scheduled}});var ce=r(6929);Object.defineProperty(t,"EMPTY",{enumerable:!0,get:function(){return ce.EMPTY}});var ue=r(2980);Object.defineProperty(t,"NEVER",{enumerable:!0,get:function(){return ue.NEVER}}),i(r(2793),t);var le=r(9179);Object.defineProperty(t,"config",{enumerable:!0,get:function(){return le.config}});var fe=r(2605);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return fe.audit}});var de=r(4152);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return de.auditTime}});var he=r(5149);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return he.buffer}});var pe=r(3189);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return pe.bufferCount}});var be=r(9459);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return be.bufferTime}});var me=r(8145);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return me.bufferToggle}});var ge=r(7764);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return ge.bufferWhen}});var ve=r(3056);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return ve.catchError}});var ye=r(498);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return ye.combineAll}});var _e=r(7484);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return _e.combineLatestAll}});var we=r(4755);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return we.combineLatestWith}});var Ee=r(482);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return Ee.concatAll}});var Oe=r(1774);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return Oe.concatMap}});var Se=r(3977);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return Se.concatMapTo}});var Ae=r(7672);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return Ae.concatWith}});var Pe=r(5561);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return Pe.connect}});var Te=r(8259);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return Te.count}});var Re=r(3473);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return Re.debounce}});var xe=r(8390);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return xe.debounceTime}});var Ie=r(4562);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return Ie.defaultIfEmpty}});var Me=r(8151);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return Me.delay}});var Le=r(744);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return Le.delayWhen}});var ke=r(8590);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return ke.dematerialize}});var Ne=r(8406);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return Ne.distinct}});var Ce=r(7300);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return Ce.distinctUntilChanged}});var je=r(4405);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return je.distinctUntilKeyChanged}});var De=r(2787);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return De.elementAt}});var Ue=r(1665);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return Ue.endWith}});var Be=r(1511);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return Be.every}});var Fe=r(5592);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return Fe.exhaust}});var Ke=r(2008);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return Ke.exhaustAll}});var He=r(4019);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return He.exhaustMap}});var Ge=r(9101);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return Ge.expand}});var $e=r(7261);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return $e.filter}});var Ve=r(5381);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return Ve.finalize}});var ze=r(4127);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return ze.find}});var qe=r(9727);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return qe.findIndex}});var We=r(7418);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return We.first}});var Ze=r(7533);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return Ze.groupBy}});var Je=r(9186);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return Je.ignoreElements}});var Ye=r(7757);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return Ye.isEmpty}});var Xe=r(3374);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return Xe.last}});var Qe=r(6269);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return Qe.map}});var et=r(5471);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return et.mapTo}});var tt=r(1160);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return tt.materialize}});var rt=r(1890);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return rt.max}});var nt=r(400);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return nt.mergeAll}});var it=r(9121);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return it.flatMap}});var ot=r(6086);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ot.mergeMap}});var st=r(1244);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return st.mergeMapTo}});var at=r(3699);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return at.mergeScan}});var ct=r(8220);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ct.mergeWith}});var ut=r(770);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ut.min}});var lt=r(8413);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return lt.multicast}});var ft=r(9314);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return ft.observeOn}});var dt=r(1899);Object.defineProperty(t,"onErrorResumeNextWith",{enumerable:!0,get:function(){return dt.onErrorResumeNextWith}});var ht=r(1186);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ht.pairwise}});var pt=r(9532);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return pt.pluck}});var bt=r(5745);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return bt.publish}});var mt=r(8103);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return mt.publishBehavior}});var gt=r(2610);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return gt.publishLast}});var vt=r(5299);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return vt.publishReplay}});var yt=r(3820);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return yt.raceWith}});var _t=r(8083);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return _t.reduce}});var wt=r(2588);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return wt.repeat}});var Et=r(9249);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return Et.repeatWhen}});var Ot=r(4486);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return Ot.retry}});var St=r(9112);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return St.retryWhen}});var At=r(4508);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return At.refCount}});var Pt=r(778);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Pt.sample}});var Tt=r(7701);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Tt.sampleTime}});var Rt=r(8167);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Rt.scan}});var xt=r(7821);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return xt.sequenceEqual}});var It=r(2645);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return It.share}});var Mt=r(7566);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Mt.shareReplay}});var Lt=r(4610);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return Lt.single}});var kt=r(5735);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return kt.skip}});var Nt=r(3252);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Nt.skipLast}});var Ct=r(1779);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return Ct.skipUntil}});var jt=r(5454);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return jt.skipWhile}});var Dt=r(1923);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Dt.startWith}});var Ut=r(9130);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Ut.subscribeOn}});var Bt=r(1695);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Bt.switchAll}});var Ft=r(6649);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Ft.switchMap}});var Kt=r(3054);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Kt.switchMapTo}});var Ht=r(2890);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Ht.switchScan}});var Gt=r(9438);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Gt.take}});var $t=r(4125);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return $t.takeLast}});var Vt=r(9008);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Vt.takeUntil}});var zt=r(5884);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return zt.takeWhile}});var qt=r(5383);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return qt.tap}});var Wt=r(1016);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return Wt.throttle}});var Zt=r(567);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Zt.throttleTime}});var Jt=r(1332);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return Jt.throwIfEmpty}});var Yt=r(1149);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Yt.timeInterval}});var Xt=r(1316);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Xt.timeout}});var Qt=r(4972);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Qt.timeoutWith}});var er=r(1275);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return er.timestamp}});var tr=r(9867);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return tr.toArray}});var rr=r(7649);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return rr.window}});var nr=r(5612);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return nr.windowCount}});var ir=r(9972);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return ir.windowTime}});var or=r(9593);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return or.windowToggle}});var sr=r(6307);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return sr.windowWhen}});var ar=r(5512);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return ar.withLatestFrom}});var cr=r(1221);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return cr.zipAll}});var ur=r(7594);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return ur.zipWith}})},9960:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncSubject=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return i(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))},t}(r(5294).Subject);t.AsyncSubject=o},8114:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BehaviorSubject=void 0;var o=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(r(5294).Subject);t.BehaviorSubject=o},9828:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeNotification=t.Notification=t.NotificationKind=void 0;var n=r(6929),i=r(1377),o=r(40),s=r(2935);!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(t.NotificationKind||(t.NotificationKind={}));var a=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){return c(this,e)},e.prototype.do=function(e,t,r){var n=this,i=n.kind,o=n.value,s=n.error;return"N"===i?null==e?void 0:e(o):"E"===i?null==t?void 0:t(s):null==r?void 0:r()},e.prototype.accept=function(e,t,r){var n;return s.isFunction(null===(n=e)||void 0===n?void 0:n.next)?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,s=e.error,a="N"===t?i.of(r):"E"===t?o.throwError((function(){return s})):"C"===t?n.EMPTY:0;if(!a)throw new TypeError("Unexpected notification kind "+t);return a},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();function c(e,t){var r,n,i,o=e,s=o.kind,a=o.value,c=o.error;if("string"!=typeof s)throw new TypeError('Invalid notification, missing "kind"');"N"===s?null===(r=t.next)||void 0===r||r.call(t,a):"E"===s?null===(n=t.error)||void 0===n||n.call(t,c):null===(i=t.complete)||void 0===i||i.call(t)}t.Notification=a,t.observeNotification=c},3005:(e,t)=>{"use strict";function r(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.createNotification=t.nextNotification=t.errorNotification=t.COMPLETE_NOTIFICATION=void 0,t.COMPLETE_NOTIFICATION=r("C",void 0,void 0),t.errorNotification=function(e){return r("E",void 0,e)},t.nextNotification=function(e){return r("N",e,void 0)},t.createNotification=r},4174:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var n=r(7747),i=r(4666),o=r(4595),s=r(5250),a=r(9179),c=r(2935),u=r(5444),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var o,s=this,a=(o=e)&&o instanceof n.Subscriber||function(e){return e&&c.isFunction(e.next)&&c.isFunction(e.error)&&c.isFunction(e.complete)}(o)&&i.isSubscription(o)?e:new n.SafeSubscriber(e,t,r);return u.errorContext((function(){var e=s,t=e.operator,r=e.source;a.add(t?t.call(a,r):r?s._subscribe(a):s._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=f(t))((function(t,i){var o=new n.SafeSubscriber({next:function(t){try{e(t)}catch(e){i(e),o.unsubscribe()}},error:i,complete:t});r.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:a.config.Promise)&&void 0!==t?t:Promise}t.Observable=l},8806:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ReplaySubject=void 0;var o=r(5294),s=r(9168),a=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=s.dateTimestampProvider);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return i(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,c=1;c<n.length&&n[c]<=s;c+=2)a=c;a&&n.splice(0,a+1)}},t}(o.Subject);t.ReplaySubject=a},6949:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=void 0;var n=r(9168),i=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=n.dateTimestampProvider.now,e}();t.Scheduler=i},5294:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousSubject=t.Subject=void 0;var s=r(4174),a=r(4666),c=r(8499),u=r(1291),l=r(5444),f=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype.lift=function(e){var t=new d(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new c.ObjectUnsubscribedError},t.prototype.next=function(e){var t=this;l.errorContext((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=o(t.currentObservers),s=i.next();!s.done;s=i.next()){s.value.next(e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;l.errorContext((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;l.errorContext((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?a.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new a.Subscription((function(){t.currentObservers=null,u.arrRemove(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new s.Observable;return e.source=this,e},t.create=function(e,t){return new d(e,t)},t}(s.Observable);t.Subject=f;var d=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return i(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:a.EMPTY_SUBSCRIPTION},t}(f);t.AnonymousSubject=d},7747:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_OBSERVER=t.SafeSubscriber=t.Subscriber=void 0;var o=r(2935),s=r(4666),a=r(9179),c=r(1600),u=r(7116),l=r(3005),f=r(1577),d=r(5444),h=function(e){function r(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,s.isSubscription(r)&&r.add(n)):n.destination=t.EMPTY_OBSERVER,n}return i(r,e),r.create=function(e,t,r){return new g(e,t,r)},r.prototype.next=function(e){this.isStopped?y(l.nextNotification(e),this):this._next(e)},r.prototype.error=function(e){this.isStopped?y(l.errorNotification(e),this):(this.isStopped=!0,this._error(e))},r.prototype.complete=function(){this.isStopped?y(l.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(e){this.destination.next(e)},r.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(s.Subscription);t.Subscriber=h;var p=Function.prototype.bind;function b(e,t){return p.call(e,t)}var m=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){v(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){v(e)}else v(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){v(e)}},e}(),g=function(e){function t(t,r,n){var i,s,c=e.call(this)||this;o.isFunction(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:c&&a.config.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return c.unsubscribe()},i={next:t.next&&b(t.next,s),error:t.error&&b(t.error,s),complete:t.complete&&b(t.complete,s)}):i=t;return c.destination=new m(i),c}return i(t,e),t}(h);function v(e){a.config.useDeprecatedSynchronousErrorHandling?d.captureError(e):c.reportUnhandledError(e)}function y(e,t){var r=a.config.onStoppedNotification;r&&f.timeoutProvider.setTimeout((function(){return r(e,t)}))}t.SafeSubscriber=g,t.EMPTY_OBSERVER={closed:!0,next:u.noop,error:function(e){throw e},complete:u.noop}},4666:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.isSubscription=t.EMPTY_SUBSCRIPTION=t.Subscription=void 0;var s=r(2935),a=r(4043),c=r(1291),u=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,c,u;if(!this.closed){this.closed=!0;var f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var d=n(f),h=d.next();!h.done;h=d.next()){h.value.remove(this)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}else f.remove(this);var p=this.initialTeardown;if(s.isFunction(p))try{p()}catch(e){u=e instanceof a.UnsubscriptionError?e.errors:[e]}var b=this._finalizers;if(b){this._finalizers=null;try{for(var m=n(b),g=m.next();!g.done;g=m.next()){var v=g.value;try{l(v)}catch(e){u=null!=u?u:[],e instanceof a.UnsubscriptionError?u=o(o([],i(u)),i(e.errors)):u.push(e)}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(c=m.return)&&c.call(m)}finally{if(r)throw r.error}}}if(u)throw new a.UnsubscriptionError(u)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&c.arrRemove(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&c.arrRemove(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function l(e){s.isFunction(e)?e():e.unsubscribe()}t.Subscription=u,t.EMPTY_SUBSCRIPTION=u.EMPTY,t.isSubscription=function(e){return e instanceof u||e&&"closed"in e&&s.isFunction(e.remove)&&s.isFunction(e.add)&&s.isFunction(e.unsubscribe)}},9179:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=void 0,t.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},7327:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.firstValueFrom=void 0;var n=r(9088),i=r(7747);t.firstValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(o,s){var a=new i.SafeSubscriber({next:function(e){o(e),a.unsubscribe()},error:s,complete:function(){r?o(t.defaultValue):s(new n.EmptyError)}});e.subscribe(a)}))}},4798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastValueFrom=void 0;var n=r(9088);t.lastValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(i,o){var s,a=!1;e.subscribe({next:function(e){s=e,a=!0},error:o,complete:function(){a?i(s):r?i(t.defaultValue):o(new n.EmptyError)}})}))}},7165:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectableObservable=void 0;var o=r(4174),s=r(4666),a=r(4508),c=r(7326),u=r(6097),l=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,u.hasLift(t)&&(n.lift=t.lift),n}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new s.Subscription;var r=this.getSubject();t.add(this.source.subscribe(c.createOperatorSubscriber(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=s.Subscription.EMPTY)}return t},t.prototype.refCount=function(){return a.refCount()(this)},t}(o.Observable);t.ConnectableObservable=l},6238:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallback=void 0;var n=r(9706);t.bindCallback=function(e,t,r){return n.bindCallbackInternals(!1,e,t,r)}},9706:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallbackInternals=void 0;var o=r(9668),s=r(4174),a=r(9130),c=r(9364),u=r(9314),l=r(9960);t.bindCallbackInternals=function e(t,r,f,d){if(f){if(!o.isScheduler(f))return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r,d).apply(this,n).pipe(c.mapOneOrManyArgs(f))};d=f}return d?function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r).apply(this,n).pipe(a.subscribeOn(d),u.observeOn(d))}:function(){for(var e=this,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var c=new l.AsyncSubject,u=!0;return new s.Observable((function(s){var a=c.subscribe(s);if(u){u=!1;var l=!1,f=!1;r.apply(e,i(i([],n(o)),[function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(t){var n=e.shift();if(null!=n)return void c.error(n)}c.next(1<e.length?e:e[0]),f=!0,l&&c.complete()}])),f&&c.complete(),l=!0}return a}))}}},2375:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindNodeCallback=void 0;var n=r(9706);t.bindNodeCallback=function(e,t,r){return n.bindCallbackInternals(!0,e,t,r)}},508:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestInit=t.combineLatest=void 0;var n=r(4174),i=r(2398),o=r(4417),s=r(8987),a=r(9364),c=r(4544),u=r(4800),l=r(7326),f=r(5267);function d(e,t,r){return void 0===r&&(r=s.identity),function(n){h(t,(function(){for(var i=e.length,s=new Array(i),a=i,c=i,u=function(i){h(t,(function(){var u=o.from(e[i],t),f=!1;u.subscribe(l.createOperatorSubscriber(n,(function(e){s[i]=e,f||(f=!0,c--),c||n.next(r(s.slice()))}),(function(){--a||n.complete()})))}),n)},f=0;f<i;f++)u(f)}),n)}}function h(e,t,r){e?f.executeSchedule(r,e,t):t()}t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=c.popScheduler(e),l=c.popResultSelector(e),f=i.argsArgArrayOrObject(e),h=f.args,p=f.keys;if(0===h.length)return o.from([],r);var b=new n.Observable(d(h,r,p?function(e){return u.createObject(p,e)}:s.identity));return l?b.pipe(a.mapOneOrManyArgs(l)):b},t.combineLatestInit=d},3364:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var n=r(482),i=r(4544),o=r(4417);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.concatAll()(o.from(e,i.popScheduler(e)))}},5360:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connectable=void 0;var n=r(5294),i=r(4174),o=r(9623),s={connector:function(){return new n.Subject},resetOnDisconnect:!0};t.connectable=function(e,t){void 0===t&&(t=s);var r=null,n=t.connector,a=t.resetOnDisconnect,c=void 0===a||a,u=n(),l=new i.Observable((function(e){return u.subscribe(e)}));return l.connect=function(){return r&&!r.closed||(r=o.defer((function(){return e})).subscribe(u),c&&r.add((function(){return u=n()}))),r},l}},9623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defer=void 0;var n=r(4174),i=r(6958);t.defer=function(e){return new n.Observable((function(t){i.innerFrom(e()).subscribe(t)}))}},2447:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrames=void 0;var n=r(4174),i=r(2261),o=r(9015);function s(e){return new n.Observable((function(t){var r=e||i.performanceTimestampProvider,n=r.now(),s=0,a=function(){t.closed||(s=o.animationFrameProvider.requestAnimationFrame((function(i){s=0;var o=r.now();t.next({timestamp:e?o:i,elapsed:o-n}),a()})))};return a(),function(){s&&o.animationFrameProvider.cancelAnimationFrame(s)}}))}t.animationFrames=function(e){return e?s(e):a};var a=s()},6929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.empty=t.EMPTY=void 0;var n=r(4174);t.EMPTY=new n.Observable((function(e){return e.complete()})),t.empty=function(e){return e?function(e){return new n.Observable((function(t){return e.schedule((function(){return t.complete()}))}))}(e):t.EMPTY}},9220:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forkJoin=void 0;var n=r(4174),i=r(2398),o=r(6958),s=r(4544),a=r(7326),c=r(9364),u=r(4800);t.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popResultSelector(e),l=i.argsArgArrayOrObject(e),f=l.args,d=l.keys,h=new n.Observable((function(e){var t=f.length;if(t)for(var r=new Array(t),n=t,i=t,s=function(t){var s=!1;o.innerFrom(f[t]).subscribe(a.createOperatorSubscriber(e,(function(e){s||(s=!0,i--),r[t]=e}),(function(){return n--}),void 0,(function(){n&&s||(i||e.next(d?u.createObject(d,r):r),e.complete())})))},c=0;c<t;c++)s(c);else e.complete()}));return r?h.pipe(c.mapOneOrManyArgs(r)):h}},4417:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.from=void 0;var n=r(2862),i=r(6958);t.from=function(e,t){return t?n.scheduled(e,t):i.innerFrom(e)}},9671:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0}),t.fromEvent=void 0;var i=r(6958),o=r(4174),s=r(6086),a=r(5445),c=r(2935),u=r(9364),l=["addListener","removeListener"],f=["addEventListener","removeEventListener"],d=["on","off"];function h(e,t){return function(r){return function(n){return e[r](t,n)}}}t.fromEvent=function e(t,r,p,b){if(c.isFunction(p)&&(b=p,p=void 0),b)return e(t,r,p).pipe(u.mapOneOrManyArgs(b));var m=n(function(e){return c.isFunction(e.addEventListener)&&c.isFunction(e.removeEventListener)}(t)?f.map((function(e){return function(n){return t[e](r,n,p)}})):function(e){return c.isFunction(e.addListener)&&c.isFunction(e.removeListener)}(t)?l.map(h(t,r)):function(e){return c.isFunction(e.on)&&c.isFunction(e.off)}(t)?d.map(h(t,r)):[],2),g=m[0],v=m[1];if(!g&&a.isArrayLike(t))return s.mergeMap((function(t){return e(t,r,p)}))(i.innerFrom(t));if(!g)throw new TypeError("Invalid event target");return new o.Observable((function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return g(t),function(){return v(t)}}))}},7357:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromEventPattern=void 0;var n=r(4174),i=r(2935),o=r(9364);t.fromEventPattern=function e(t,r,s){return s?e(t,r).pipe(o.mapOneOrManyArgs(s)):new n.Observable((function(e){var n=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1===t.length?t[0]:t)},o=t(n);return i.isFunction(r)?function(){return r(n,o)}:void 0}))}},6884:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromSubscribable=void 0;var n=r(4174);t.fromSubscribable=function(e){return new n.Observable((function(t){return e.subscribe(t)}))}},3482:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generate=void 0;var i=r(8987),o=r(9668),s=r(9623),a=r(2485);t.generate=function(e,t,r,c,u){var l,f,d,h;function p(){var e;return n(this,(function(n){switch(n.label){case 0:e=h,n.label=1;case 1:return t&&!t(e)?[3,4]:[4,d(e)];case 2:n.sent(),n.label=3;case 3:return e=r(e),[3,1];case 4:return[2]}}))}return 1===arguments.length?(h=(l=e).initialState,t=l.condition,r=l.iterate,f=l.resultSelector,d=void 0===f?i.identity:f,u=l.scheduler):(h=e,!c||o.isScheduler(c)?(d=i.identity,u=c):d=c),s.defer(u?function(){return a.scheduleIterable(p(),u)}:p)}},550:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iif=void 0;var n=r(9623);t.iif=function(e,t,r){return n.defer((function(){return e()?t:r}))}},6958:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof s?s(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.fromReadableStreamLike=t.fromAsyncIterable=t.fromIterable=t.fromPromise=t.fromArrayLike=t.fromInteropObservable=t.innerFrom=void 0;var a=r(5445),c=r(4283),u=r(4174),l=r(3124),f=r(3260),d=r(7756),h=r(8131),p=r(2221),b=r(2935),m=r(1600),g=r(4595);function v(e){return new u.Observable((function(t){var r=e[g.observable]();if(b.isFunction(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function y(e){return new u.Observable((function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()}))}function _(e){return new u.Observable((function(t){e.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,m.reportUnhandledError)}))}function w(e){return new u.Observable((function(t){var r,n;try{for(var i=s(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()}))}function E(e){return new u.Observable((function(t){(function(e,t){var r,s,a,c;return n(this,void 0,void 0,(function(){var n,u;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,11]),r=o(e),i.label=1;case 1:return[4,r.next()];case 2:if((s=i.sent()).done)return[3,4];if(n=s.value,t.next(n),t.closed)return[2];i.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=i.sent(),a={error:u},[3,11];case 6:return i.trys.push([6,,9,10]),s&&!s.done&&(c=r.return)?[4,c.call(r)]:[3,8];case 7:i.sent(),i.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function O(e){return E(p.readableStreamLikeToAsyncGenerator(e))}t.innerFrom=function(e){if(e instanceof u.Observable)return e;if(null!=e){if(l.isInteropObservable(e))return v(e);if(a.isArrayLike(e))return y(e);if(c.isPromise(e))return _(e);if(f.isAsyncIterable(e))return E(e);if(h.isIterable(e))return w(e);if(p.isReadableStreamLike(e))return O(e)}throw d.createInvalidObservableTypeError(e)},t.fromInteropObservable=v,t.fromArrayLike=y,t.fromPromise=_,t.fromIterable=w,t.fromAsyncIterable=E,t.fromReadableStreamLike=O},3154:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.interval=void 0;var n=r(7152),i=r(8069);t.interval=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=n.asyncScheduler),e<0&&(e=0),i.timer(e,e,t)}},2039:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var n=r(400),i=r(6958),o=r(6929),s=r(4544),a=r(4417);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popScheduler(e),c=s.popNumber(e,1/0),u=e;return u.length?1===u.length?i.innerFrom(u[0]):n.mergeAll(c)(a.from(u,r)):o.EMPTY}},2980:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.never=t.NEVER=void 0;var n=r(4174),i=r(7116);t.NEVER=new n.Observable(i.noop),t.never=function(){return t.NEVER}},1377:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.of=void 0;var n=r(4544),i=r(4417);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n.popScheduler(e);return i.from(e,r)}},8362:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=void 0;var n=r(4174),i=r(5034),o=r(7326),s=r(7116),a=r(6958);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.argsOrArgArray(e);return new n.Observable((function(e){var t=0,n=function(){if(t<r.length){var i=void 0;try{i=a.innerFrom(r[t++])}catch(e){return void n()}var c=new o.OperatorSubscriber(e,void 0,s.noop,s.noop);i.subscribe(c),c.add(n)}else e.complete()};n()}))}},968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairs=void 0;var n=r(4417);t.pairs=function(e,t){return n.from(Object.entries(e),t)}},6394:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(8781),i=r(7261),o=r(6958);t.partition=function(e,t,r){return[i.filter(t,r)(o.innerFrom(e)),i.filter(n.not(t,r))(o.innerFrom(e))]}},6849:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.raceInit=t.race=void 0;var n=r(4174),i=r(6958),o=r(5034),s=r(7326);function a(e){return function(t){for(var r=[],n=function(n){r.push(i.innerFrom(e[n]).subscribe(s.createOperatorSubscriber(t,(function(e){if(r){for(var i=0;i<r.length;i++)i!==n&&r[i].unsubscribe();r=null}t.next(e)}))))},o=0;r&&!t.closed&&o<e.length;o++)n(o)}}t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=o.argsOrArgArray(e)).length?i.innerFrom(e[0]):new n.Observable(a(e))},t.raceInit=a},7284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.range=void 0;var n=r(4174),i=r(6929);t.range=function(e,t,r){if(null==t&&(t=e,e=0),t<=0)return i.EMPTY;var o=t+e;return new n.Observable(r?function(t){var n=e;return r.schedule((function(){n<o?(t.next(n++),this.schedule()):t.complete()}))}:function(t){for(var r=e;r<o&&!t.closed;)t.next(r++);t.complete()})}},40:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwError=void 0;var n=r(4174),i=r(2935);t.throwError=function(e,t){var r=i.isFunction(e)?e:function(){return e},o=function(e){return e.error(r())};return new n.Observable(t?function(e){return t.schedule(o,0,e)}:o)}},8069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timer=void 0;var n=r(4174),i=r(7152),o=r(9668),s=r(4426);t.timer=function(e,t,r){void 0===e&&(e=0),void 0===r&&(r=i.async);var a=-1;return null!=t&&(o.isScheduler(t)?r=t:a=t),new n.Observable((function(t){var n=s.isValidDate(e)?+e-r.now():e;n<0&&(n=0);var i=0;return r.schedule((function(){t.closed||(t.next(i++),0<=a?this.schedule(void 0,a):t.complete())}),n)}))}},3348:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.using=void 0;var n=r(4174),i=r(6958),o=r(6929);t.using=function(e,t){return new n.Observable((function(r){var n=e(),s=t(n);return(s?i.innerFrom(s):o.EMPTY).subscribe(r),function(){n&&n.unsubscribe()}}))}},4981:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(4174),s=r(6958),a=r(5034),c=r(6929),u=r(7326),l=r(4544);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e),f=a.argsOrArgArray(e);return f.length?new o.Observable((function(e){var t=f.map((function(){return[]})),o=f.map((function(){return!1}));e.add((function(){t=o=null}));for(var a=function(a){s.innerFrom(f[a]).subscribe(u.createOperatorSubscriber(e,(function(s){if(t[a].push(s),t.every((function(e){return e.length}))){var c=t.map((function(e){return e.shift()}));e.next(r?r.apply(void 0,i([],n(c))):c),t.some((function(e,t){return!e.length&&o[t]}))&&e.complete()}}),(function(){o[a]=!0,!t[a].length&&e.complete()})))},c=0;!e.closed&&c<f.length;c++)a(c);return function(){t=o=null}})):c.EMPTY}},7326:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorSubscriber=t.createOperatorSubscriber=void 0;var o=r(7747);t.createOperatorSubscriber=function(e,t,r,n,i){return new s(e,t,r,n,i)};var s=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return i(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(o.Subscriber);t.OperatorSubscriber=s},2605:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.audit=void 0;var n=r(6097),i=r(6958),o=r(7326);t.audit=function(e){return n.operate((function(t,r){var n=!1,s=null,a=null,c=!1,u=function(){if(null==a||a.unsubscribe(),a=null,n){n=!1;var e=s;s=null,r.next(e)}c&&r.complete()},l=function(){a=null,c&&r.complete()};t.subscribe(o.createOperatorSubscriber(r,(function(t){n=!0,s=t,a||i.innerFrom(e(t)).subscribe(a=o.createOperatorSubscriber(r,u,l))}),(function(){c=!0,(!n||!a||a.closed)&&r.complete()})))}))}},4152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.auditTime=void 0;var n=r(7152),i=r(2605),o=r(8069);t.auditTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.audit((function(){return o.timer(e,t)}))}},5149:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buffer=void 0;var n=r(6097),i=r(7116),o=r(7326),s=r(6958);t.buffer=function(e){return n.operate((function(t,r){var n=[];return t.subscribe(o.createOperatorSubscriber(r,(function(e){return n.push(e)}),(function(){r.next(n),r.complete()}))),s.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){var e=n;n=[],r.next(e)}),i.noop)),function(){n=null}}))}},3189:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferCount=void 0;var i=r(6097),o=r(7326),s=r(1291);t.bufferCount=function(e,t){return void 0===t&&(t=null),t=null!=t?t:e,i.operate((function(r,i){var a=[],c=0;r.subscribe(o.createOperatorSubscriber(i,(function(r){var o,u,l,f,d=null;c++%t==0&&a.push([]);try{for(var h=n(a),p=h.next();!p.done;p=h.next()){(g=p.value).push(r),e<=g.length&&(d=null!=d?d:[]).push(g)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(u=h.return)&&u.call(h)}finally{if(o)throw o.error}}if(d)try{for(var b=n(d),m=b.next();!m.done;m=b.next()){var g=m.value;s.arrRemove(a,g),i.next(g)}}catch(e){l={error:e}}finally{try{m&&!m.done&&(f=b.return)&&f.call(b)}finally{if(l)throw l.error}}}),(function(){var e,t;try{for(var r=n(a),o=r.next();!o.done;o=r.next()){var s=o.value;i.next(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.complete()}),void 0,(function(){a=null})))}))}},9459:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferTime=void 0;var i=r(4666),o=r(6097),s=r(7326),a=r(1291),c=r(7152),u=r(4544),l=r(5267);t.bufferTime=function(e){for(var t,r,f=[],d=1;d<arguments.length;d++)f[d-1]=arguments[d];var h=null!==(t=u.popScheduler(f))&&void 0!==t?t:c.asyncScheduler,p=null!==(r=f[0])&&void 0!==r?r:null,b=f[1]||1/0;return o.operate((function(t,r){var o=[],c=!1,u=function(e){var t=e.buffer;e.subs.unsubscribe(),a.arrRemove(o,e),r.next(t),c&&f()},f=function(){if(o){var t=new i.Subscription;r.add(t);var n={buffer:[],subs:t};o.push(n),l.executeSchedule(t,h,(function(){return u(n)}),e)}};null!==p&&p>=0?l.executeSchedule(r,h,f,p,!0):c=!0,f();var d=s.createOperatorSubscriber(r,(function(e){var t,r,i=o.slice();try{for(var s=n(i),a=s.next();!a.done;a=s.next()){var c=a.value,l=c.buffer;l.push(e),b<=l.length&&u(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}),(function(){for(;null==o?void 0:o.length;)r.next(o.shift().buffer);null==d||d.unsubscribe(),r.complete(),r.unsubscribe()}),void 0,(function(){return o=null}));t.subscribe(d)}))}},8145:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferToggle=void 0;var i=r(4666),o=r(6097),s=r(6958),a=r(7326),c=r(7116),u=r(1291);t.bufferToggle=function(e,t){return o.operate((function(r,o){var l=[];s.innerFrom(e).subscribe(a.createOperatorSubscriber(o,(function(e){var r=[];l.push(r);var n=new i.Subscription;n.add(s.innerFrom(t(e)).subscribe(a.createOperatorSubscriber(o,(function(){u.arrRemove(l,r),o.next(r),n.unsubscribe()}),c.noop)))}),c.noop)),r.subscribe(a.createOperatorSubscriber(o,(function(e){var t,r;try{for(var i=n(l),o=i.next();!o.done;o=i.next()){o.value.push(e)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}),(function(){for(;l.length>0;)o.next(l.shift());o.complete()})))}))}},7764:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bufferWhen=void 0;var n=r(6097),i=r(7116),o=r(7326),s=r(6958);t.bufferWhen=function(e){return n.operate((function(t,r){var n=null,a=null,c=function(){null==a||a.unsubscribe();var t=n;n=[],t&&r.next(t),s.innerFrom(e()).subscribe(a=o.createOperatorSubscriber(r,c,i.noop))};c(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==n?void 0:n.push(e)}),(function(){n&&r.next(n),r.complete()}),void 0,(function(){return n=a=null})))}))}},3056:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catchError=void 0;var n=r(6958),i=r(7326),o=r(6097);t.catchError=function e(t){return o.operate((function(r,o){var s,a=null,c=!1;a=r.subscribe(i.createOperatorSubscriber(o,void 0,void 0,(function(i){s=n.innerFrom(t(i,e(t)(r))),a?(a.unsubscribe(),a=null,s.subscribe(o)):c=!0}))),c&&(a.unsubscribe(),a=null,s.subscribe(o))}))}},498:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineAll=void 0;var n=r(7484);t.combineAll=n.combineLatestAll},6527:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatest=void 0;var o=r(508),s=r(6097),a=r(5034),c=r(9364),u=r(5250),l=r(4544);t.combineLatest=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var f=l.popResultSelector(t);return f?u.pipe(e.apply(void 0,i([],n(t))),c.mapOneOrManyArgs(f)):s.operate((function(e,r){o.combineLatestInit(i([e],n(a.argsOrArgArray(t))))(r)}))}},7484:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestAll=void 0;var n=r(508),i=r(2208);t.combineLatestAll=function(e){return i.joinAllInternals(n.combineLatest,e)}},4755:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestWith=void 0;var o=r(6527);t.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.combineLatest.apply(void 0,i([],n(e)))}},3792:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var o=r(6097),s=r(482),a=r(4544),c=r(4417);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=a.popScheduler(e);return o.operate((function(t,o){s.concatAll()(c.from(i([t],n(e)),r)).subscribe(o)}))}},482:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatAll=void 0;var n=r(400);t.concatAll=function(){return n.mergeAll(1)}},1774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMap=void 0;var n=r(6086),i=r(2935);t.concatMap=function(e,t){return i.isFunction(t)?n.mergeMap(e,t,1):n.mergeMap(e,1)}},3977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMapTo=void 0;var n=r(1774),i=r(2935);t.concatMapTo=function(e,t){return i.isFunction(t)?n.concatMap((function(){return e}),t):n.concatMap((function(){return e}))}},7672:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concatWith=void 0;var o=r(3792);t.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.concat.apply(void 0,i([],n(e)))}},5561:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;var n=r(5294),i=r(6958),o=r(6097),s=r(6884),a={connector:function(){return new n.Subject}};t.connect=function(e,t){void 0===t&&(t=a);var r=t.connector;return o.operate((function(t,n){var o=r();i.innerFrom(e(s.fromSubscribable(o))).subscribe(n),n.add(t.subscribe(o))}))}},8259:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.count=void 0;var n=r(8083);t.count=function(e){return n.reduce((function(t,r,n){return!e||e(r,n)?t+1:t}),0)}},3473:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0;var n=r(6097),i=r(7116),o=r(7326),s=r(6958);t.debounce=function(e){return n.operate((function(t,r){var n=!1,a=null,c=null,u=function(){if(null==c||c.unsubscribe(),c=null,n){n=!1;var e=a;a=null,r.next(e)}};t.subscribe(o.createOperatorSubscriber(r,(function(t){null==c||c.unsubscribe(),n=!0,a=t,c=o.createOperatorSubscriber(r,u,i.noop),s.innerFrom(e(t)).subscribe(c)}),(function(){u(),r.complete()}),void 0,(function(){a=c=null})))}))}},8390:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounceTime=void 0;var n=r(7152),i=r(6097),o=r(7326);t.debounceTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.operate((function(r,n){var i=null,s=null,a=null,c=function(){if(i){i.unsubscribe(),i=null;var e=s;s=null,n.next(e)}};function u(){var r=a+e,o=t.now();if(o<r)return i=this.schedule(void 0,r-o),void n.add(i);c()}r.subscribe(o.createOperatorSubscriber(n,(function(r){s=r,a=t.now(),i||(i=t.schedule(u,e),n.add(i))}),(function(){c(),n.complete()}),void 0,(function(){s=i=null})))}))}},4562:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultIfEmpty=void 0;var n=r(6097),i=r(7326);t.defaultIfEmpty=function(e){return n.operate((function(t,r){var n=!1;t.subscribe(i.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){n||r.next(e),r.complete()})))}))}},8151:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0;var n=r(7152),i=r(744),o=r(8069);t.delay=function(e,t){void 0===t&&(t=n.asyncScheduler);var r=o.timer(e,t);return i.delayWhen((function(){return r}))}},744:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delayWhen=void 0;var n=r(3364),i=r(9438),o=r(9186),s=r(5471),a=r(6086),c=r(6958);t.delayWhen=function e(t,r){return r?function(s){return n.concat(r.pipe(i.take(1),o.ignoreElements()),s.pipe(e(t)))}:a.mergeMap((function(e,r){return c.innerFrom(t(e,r)).pipe(i.take(1),s.mapTo(e))}))}},8590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dematerialize=void 0;var n=r(9828),i=r(6097),o=r(7326);t.dematerialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){return n.observeNotification(e,t)})))}))}},8406:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinct=void 0;var n=r(6097),i=r(7326),o=r(7116),s=r(6958);t.distinct=function(e,t){return n.operate((function(r,n){var a=new Set;r.subscribe(i.createOperatorSubscriber(n,(function(t){var r=e?e(t):t;a.has(r)||(a.add(r),n.next(t))}))),t&&s.innerFrom(t).subscribe(i.createOperatorSubscriber(n,(function(){return a.clear()}),o.noop))}))}},7300:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilChanged=void 0;var n=r(8987),i=r(6097),o=r(7326);function s(e,t){return e===t}t.distinctUntilChanged=function(e,t){return void 0===t&&(t=n.identity),e=null!=e?e:s,i.operate((function(r,n){var i,s=!0;r.subscribe(o.createOperatorSubscriber(n,(function(r){var o=t(r);!s&&e(i,o)||(s=!1,i=o,n.next(r))})))}))}},4405:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilKeyChanged=void 0;var n=r(7300);t.distinctUntilKeyChanged=function(e,t){return n.distinctUntilChanged((function(r,n){return t?t(r[e],n[e]):r[e]===n[e]}))}},2787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementAt=void 0;var n=r(9216),i=r(7261),o=r(1332),s=r(4562),a=r(9438);t.elementAt=function(e,t){if(e<0)throw new n.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(c){return c.pipe(i.filter((function(t,r){return r===e})),a.take(1),r?s.defaultIfEmpty(t):o.throwIfEmpty((function(){return new n.ArgumentOutOfRangeError})))}}},1665:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.endWith=void 0;var o=r(3364),s=r(1377);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return o.concat(t,s.of.apply(void 0,i([],n(e))))}}},1511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.every=void 0;var n=r(6097),i=r(7326);t.every=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(i){e.call(t,i,o++,r)||(n.next(!1),n.complete())}),(function(){n.next(!0),n.complete()})))}))}},5592:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaust=void 0;var n=r(2008);t.exhaust=n.exhaustAll},2008:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustAll=void 0;var n=r(4019),i=r(8987);t.exhaustAll=function(){return n.exhaustMap(i.identity)}},4019:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustMap=void 0;var n=r(6269),i=r(6958),o=r(6097),s=r(7326);t.exhaustMap=function e(t,r){return r?function(o){return o.pipe(e((function(e,o){return i.innerFrom(t(e,o)).pipe(n.map((function(t,n){return r(e,t,o,n)})))})))}:o.operate((function(e,r){var n=0,o=null,a=!1;e.subscribe(s.createOperatorSubscriber(r,(function(e){o||(o=s.createOperatorSubscriber(r,void 0,(function(){o=null,a&&r.complete()})),i.innerFrom(t(e,n++)).subscribe(o))}),(function(){a=!0,!o&&r.complete()})))}))}},9101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expand=void 0;var n=r(6097),i=r(5926);t.expand=function(e,t,r){return void 0===t&&(t=1/0),t=(t||0)<1?1/0:t,n.operate((function(n,o){return i.mergeInternals(n,o,e,t,void 0,!0,r)}))}},7261:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filter=void 0;var n=r(6097),i=r(7326);t.filter=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){return e.call(t,r,o++)&&n.next(r)})))}))}},5381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.finalize=void 0;var n=r(6097);t.finalize=function(e){return n.operate((function(t,r){try{t.subscribe(r)}finally{r.add(e)}}))}},4127:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFind=t.find=void 0;var n=r(6097),i=r(7326);function o(e,t,r){var n="index"===r;return function(r,o){var s=0;r.subscribe(i.createOperatorSubscriber(o,(function(i){var a=s++;e.call(t,i,a,r)&&(o.next(n?a:i),o.complete())}),(function(){o.next(n?-1:void 0),o.complete()})))}}t.find=function(e,t){return n.operate(o(e,t,"value"))},t.createFind=o},9727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findIndex=void 0;var n=r(6097),i=r(4127);t.findIndex=function(e,t){return n.operate(i.createFind(e,t,"index"))}},7418:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.first=void 0;var n=r(9088),i=r(7261),o=r(9438),s=r(4562),a=r(1332),c=r(8987);t.first=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter((function(t,r){return e(t,r,u)})):c.identity,o.take(1),r?s.defaultIfEmpty(t):a.throwIfEmpty((function(){return new n.EmptyError})))}}},9121:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flatMap=void 0;var n=r(6086);t.flatMap=n.mergeMap},7533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupBy=void 0;var n=r(4174),i=r(6958),o=r(5294),s=r(6097),a=r(7326);t.groupBy=function(e,t,r,c){return s.operate((function(s,u){var l;t&&"function"!=typeof t?(r=t.duration,l=t.element,c=t.connector):l=t;var f=new Map,d=function(e){f.forEach(e),e(u)},h=function(e){return d((function(t){return t.error(e)}))},p=0,b=!1,m=new a.OperatorSubscriber(u,(function(t){try{var s=e(t),d=f.get(s);if(!d){f.set(s,d=c?c():new o.Subject);var g=(y=s,_=d,(w=new n.Observable((function(e){p++;var t=_.subscribe(e);return function(){t.unsubscribe(),0==--p&&b&&m.unsubscribe()}}))).key=y,w);if(u.next(g),r){var v=a.createOperatorSubscriber(d,(function(){d.complete(),null==v||v.unsubscribe()}),void 0,void 0,(function(){return f.delete(s)}));m.add(i.innerFrom(r(g)).subscribe(v))}}d.next(l?l(t):t)}catch(e){h(e)}var y,_,w}),(function(){return d((function(e){return e.complete()}))}),h,(function(){return f.clear()}),(function(){return b=!0,0===p}));s.subscribe(m)}))}},9186:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ignoreElements=void 0;var n=r(6097),i=r(7326),o=r(7116);t.ignoreElements=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,o.noop))}))}},7757:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=void 0;var n=r(6097),i=r(7326);t.isEmpty=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,(function(){t.next(!1),t.complete()}),(function(){t.next(!0),t.complete()})))}))}},2208:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.joinAllInternals=void 0;var n=r(8987),i=r(9364),o=r(5250),s=r(6086),a=r(9867);t.joinAllInternals=function(e,t){return o.pipe(a.toArray(),s.mergeMap((function(t){return e(t)})),t?i.mapOneOrManyArgs(t):n.identity)}},3374:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.last=void 0;var n=r(9088),i=r(7261),o=r(4125),s=r(1332),a=r(4562),c=r(8987);t.last=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter((function(t,r){return e(t,r,u)})):c.identity,o.takeLast(1),r?a.defaultIfEmpty(t):s.throwIfEmpty((function(){return new n.EmptyError})))}}},6269:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.map=void 0;var n=r(6097),i=r(7326);t.map=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){n.next(e.call(t,r,o++))})))}))}},5471:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTo=void 0;var n=r(6269);t.mapTo=function(e){return n.map((function(){return e}))}},1160:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.materialize=void 0;var n=r(9828),i=r(6097),o=r(7326);t.materialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){t.next(n.Notification.createNext(e))}),(function(){t.next(n.Notification.createComplete()),t.complete()}),(function(e){t.next(n.Notification.createError(e)),t.complete()})))}))}},1890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.max=void 0;var n=r(8083),i=r(2935);t.max=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}},3982:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var o=r(6097),s=r(5034),a=r(400),c=r(4544),u=r(4417);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=c.popScheduler(e),l=c.popNumber(e,1/0);return e=s.argsOrArgArray(e),o.operate((function(t,o){a.mergeAll(l)(u.from(i([t],n(e)),r)).subscribe(o)}))}},400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=void 0;var n=r(6086),i=r(8987);t.mergeAll=function(e){return void 0===e&&(e=1/0),n.mergeMap(i.identity,e)}},5926:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeInternals=void 0;var n=r(6958),i=r(5267),o=r(7326);t.mergeInternals=function(e,t,r,s,a,c,u,l){var f=[],d=0,h=0,p=!1,b=function(){!p||f.length||d||t.complete()},m=function(e){return d<s?g(e):f.push(e)},g=function(e){c&&t.next(e),d++;var l=!1;n.innerFrom(r(e,h++)).subscribe(o.createOperatorSubscriber(t,(function(e){null==a||a(e),c?m(e):t.next(e)}),(function(){l=!0}),void 0,(function(){if(l)try{d--;for(var e=function(){var e=f.shift();u?i.executeSchedule(t,u,(function(){return g(e)})):g(e)};f.length&&d<s;)e();b()}catch(e){t.error(e)}})))};return e.subscribe(o.createOperatorSubscriber(t,m,(function(){p=!0,b()}))),function(){null==l||l()}}},6086:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMap=void 0;var n=r(6269),i=r(6958),o=r(6097),s=r(5926),a=r(2935);t.mergeMap=function e(t,r,c){return void 0===c&&(c=1/0),a.isFunction(r)?e((function(e,o){return n.map((function(t,n){return r(e,t,o,n)}))(i.innerFrom(t(e,o)))}),c):("number"==typeof r&&(c=r),o.operate((function(e,r){return s.mergeInternals(e,r,t,c)})))}},1244:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMapTo=void 0;var n=r(6086),i=r(2935);t.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),i.isFunction(t)?n.mergeMap((function(){return e}),t,r):("number"==typeof t&&(r=t),n.mergeMap((function(){return e}),r))}},3699:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeScan=void 0;var n=r(6097),i=r(5926);t.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),n.operate((function(n,o){var s=t;return i.mergeInternals(n,o,(function(t,r){return e(s,t,r)}),r,(function(e){s=e}),!1,void 0,(function(){return s=null}))}))}},8220:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mergeWith=void 0;var o=r(3982);t.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.merge.apply(void 0,i([],n(e)))}},770:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.min=void 0;var n=r(8083),i=r(2935);t.min=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)<0?t:r}:function(e,t){return e<t?e:t})}},8413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multicast=void 0;var n=r(7165),i=r(2935),o=r(5561);t.multicast=function(e,t){var r=i.isFunction(e)?e:function(){return e};return i.isFunction(t)?o.connect(t,{connector:r}):function(e){return new n.ConnectableObservable(e,r)}}},9314:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeOn=void 0;var n=r(5267),i=r(6097),o=r(7326);t.observeOn=function(e,t){return void 0===t&&(t=0),i.operate((function(r,i){r.subscribe(o.createOperatorSubscriber(i,(function(r){return n.executeSchedule(i,e,(function(){return i.next(r)}),t)}),(function(){return n.executeSchedule(i,e,(function(){return i.complete()}),t)}),(function(r){return n.executeSchedule(i,e,(function(){return i.error(r)}),t)})))}))}},1899:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=t.onErrorResumeNextWith=void 0;var o=r(5034),s=r(8362);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=o.argsOrArgArray(e);return function(e){return s.onErrorResumeNext.apply(void 0,i([e],n(r)))}}t.onErrorResumeNextWith=a,t.onErrorResumeNext=a},1186:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairwise=void 0;var n=r(6097),i=r(7326);t.pairwise=function(){return n.operate((function(e,t){var r,n=!1;e.subscribe(i.createOperatorSubscriber(t,(function(e){var i=r;r=e,n&&t.next([i,e]),n=!0})))}))}},9857:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(8781),i=r(7261);t.partition=function(e,t){return function(r){return[i.filter(e,t)(r),i.filter(n.not(e,t))(r)]}}},9532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pluck=void 0;var n=r(6269);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw new Error("list of properties cannot be empty.");return n.map((function(t){for(var n=t,i=0;i<r;i++){var o=null==n?void 0:n[e[i]];if(void 0===o)return;n=o}return n}))}},5745:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publish=void 0;var n=r(5294),i=r(8413),o=r(5561);t.publish=function(e){return e?function(t){return o.connect(e)(t)}:function(e){return i.multicast(new n.Subject)(e)}}},8103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishBehavior=void 0;var n=r(8114),i=r(7165);t.publishBehavior=function(e){return function(t){var r=new n.BehaviorSubject(e);return new i.ConnectableObservable(t,(function(){return r}))}}},2610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishLast=void 0;var n=r(9960),i=r(7165);t.publishLast=function(){return function(e){var t=new n.AsyncSubject;return new i.ConnectableObservable(e,(function(){return t}))}}},5299:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishReplay=void 0;var n=r(8806),i=r(8413),o=r(2935);t.publishReplay=function(e,t,r,s){r&&!o.isFunction(r)&&(s=r);var a=o.isFunction(r)?r:void 0;return function(r){return i.multicast(new n.ReplaySubject(e,t,s),a)(r)}}},6699:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.race=void 0;var o=r(5034),s=r(3820);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.raceWith.apply(void 0,i([],n(o.argsOrArgArray(e))))}},3820:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.raceWith=void 0;var o=r(6849),s=r(6097),a=r(8987);t.raceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length?s.operate((function(t,r){o.raceInit(i([t],n(e)))(r)})):a.identity}},8083:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduce=void 0;var n=r(7235),i=r(6097);t.reduce=function(e,t){return i.operate(n.scanInternals(e,t,arguments.length>=2,!1,!0))}},4508:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refCount=void 0;var n=r(6097),i=r(7326);t.refCount=function(){return n.operate((function(e,t){var r=null;e._refCount++;var n=i.createOperatorSubscriber(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))}},2588:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeat=void 0;var n=r(6929),i=r(6097),o=r(7326),s=r(6958),a=r(8069);t.repeat=function(e){var t,r,c=1/0;return null!=e&&("object"==typeof e?(t=e.count,c=void 0===t?1/0:t,r=e.delay):c=e),c<=0?function(){return n.EMPTY}:i.operate((function(e,t){var n,i=0,u=function(){if(null==n||n.unsubscribe(),n=null,null!=r){var e="number"==typeof r?a.timer(r):s.innerFrom(r(i)),c=o.createOperatorSubscriber(t,(function(){c.unsubscribe(),l()}));e.subscribe(c)}else l()},l=function(){var r=!1;n=e.subscribe(o.createOperatorSubscriber(t,void 0,(function(){++i<c?n?u():r=!0:t.complete()}))),r&&u()};l()}))}},9249:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeatWhen=void 0;var n=r(6958),i=r(5294),o=r(6097),s=r(7326);t.repeatWhen=function(e){return o.operate((function(t,r){var o,a,c=!1,u=!1,l=!1,f=function(){return l&&u&&(r.complete(),!0)},d=function(){l=!1,o=t.subscribe(s.createOperatorSubscriber(r,void 0,(function(){l=!0,!f()&&(a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){o?d():c=!0}),(function(){u=!0,f()})))),a).next()}))),c&&(o.unsubscribe(),o=null,c=!1,d())};d()}))}},4486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retry=void 0;var n=r(6097),i=r(7326),o=r(8987),s=r(8069),a=r(6958);t.retry=function(e){var t;void 0===e&&(e=1/0);var r=(t=e&&"object"==typeof e?e:{count:e}).count,c=void 0===r?1/0:r,u=t.delay,l=t.resetOnSuccess,f=void 0!==l&&l;return c<=0?o.identity:n.operate((function(e,t){var r,n=0,o=function(){var l=!1;r=e.subscribe(i.createOperatorSubscriber(t,(function(e){f&&(n=0),t.next(e)}),void 0,(function(e){if(n++<c){var f=function(){r?(r.unsubscribe(),r=null,o()):l=!0};if(null!=u){var d="number"==typeof u?s.timer(u):a.innerFrom(u(e,n)),h=i.createOperatorSubscriber(t,(function(){h.unsubscribe(),f()}),(function(){t.complete()}));d.subscribe(h)}else f()}else t.error(e)}))),l&&(r.unsubscribe(),r=null,o())};o()}))}},9112:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retryWhen=void 0;var n=r(6958),i=r(5294),o=r(6097),s=r(7326);t.retryWhen=function(e){return o.operate((function(t,r){var o,a,c=!1,u=function(){o=t.subscribe(s.createOperatorSubscriber(r,void 0,void 0,(function(t){a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){return o?u():c=!0})))),a&&a.next(t)}))),c&&(o.unsubscribe(),o=null,c=!1,u())};u()}))}},778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sample=void 0;var n=r(6958),i=r(6097),o=r(7116),s=r(7326);t.sample=function(e){return i.operate((function(t,r){var i=!1,a=null;t.subscribe(s.createOperatorSubscriber(r,(function(e){i=!0,a=e}))),n.innerFrom(e).subscribe(s.createOperatorSubscriber(r,(function(){if(i){i=!1;var e=a;a=null,r.next(e)}}),o.noop))}))}},7701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleTime=void 0;var n=r(7152),i=r(778),o=r(3154);t.sampleTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.sample(o.interval(e,t))}},8167:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scan=void 0;var n=r(6097),i=r(7235);t.scan=function(e,t){return n.operate(i.scanInternals(e,t,arguments.length>=2,!0))}},7235:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scanInternals=void 0;var n=r(7326);t.scanInternals=function(e,t,r,i,o){return function(s,a){var c=r,u=t,l=0;s.subscribe(n.createOperatorSubscriber(a,(function(t){var r=l++;u=c?e(u,t,r):(c=!0,t),i&&a.next(u)}),o&&function(){c&&a.next(u),a.complete()}))}}},7821:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sequenceEqual=void 0;var n=r(6097),i=r(7326),o=r(6958);t.sequenceEqual=function(e,t){return void 0===t&&(t=function(e,t){return e===t}),n.operate((function(r,n){var s={buffer:[],complete:!1},a={buffer:[],complete:!1},c=function(e){n.next(e),n.complete()},u=function(e,r){var o=i.createOperatorSubscriber(n,(function(n){var i=r.buffer,o=r.complete;0===i.length?o?c(!1):e.buffer.push(n):!t(n,i.shift())&&c(!1)}),(function(){e.complete=!0;var t=r.complete,n=r.buffer;t&&c(0===n.length),null==o||o.unsubscribe()}));return o};r.subscribe(u(s,a)),o.innerFrom(e).subscribe(u(a,s))}))}},2645:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.share=void 0;var o=r(6958),s=r(5294),a=r(7747),c=r(6097);function u(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(!0!==t){if(!1!==t){var c=new a.SafeSubscriber({next:function(){c.unsubscribe(),e()}});return o.innerFrom(t.apply(void 0,i([],n(r)))).subscribe(c)}}else e()}t.share=function(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new s.Subject}:t,n=e.resetOnError,i=void 0===n||n,l=e.resetOnComplete,f=void 0===l||l,d=e.resetOnRefCountZero,h=void 0===d||d;return function(e){var t,n,s,l=0,d=!1,p=!1,b=function(){null==n||n.unsubscribe(),n=void 0},m=function(){b(),t=s=void 0,d=p=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return c.operate((function(e,c){l++,p||d||b();var v=s=null!=s?s:r();c.add((function(){0!==--l||p||d||(n=u(g,h))})),v.subscribe(c),!t&&l>0&&(t=new a.SafeSubscriber({next:function(e){return v.next(e)},error:function(e){p=!0,b(),n=u(m,i,e),v.error(e)},complete:function(){d=!0,b(),n=u(m,f),v.complete()}}),o.innerFrom(e).subscribe(t))}))(e)}}},7566:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shareReplay=void 0;var n=r(8806),i=r(2645);t.shareReplay=function(e,t,r){var o,s,a,c,u=!1;return e&&"object"==typeof e?(o=e.bufferSize,c=void 0===o?1/0:o,s=e.windowTime,t=void 0===s?1/0:s,u=void 0!==(a=e.refCount)&&a,r=e.scheduler):c=null!=e?e:1/0,i.share({connector:function(){return new n.ReplaySubject(c,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},4610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.single=void 0;var n=r(9088),i=r(7298),o=r(5722),s=r(6097),a=r(7326);t.single=function(e){return s.operate((function(t,r){var s,c=!1,u=!1,l=0;t.subscribe(a.createOperatorSubscriber(r,(function(n){u=!0,e&&!e(n,l++,t)||(c&&r.error(new i.SequenceError("Too many matching values")),c=!0,s=n)}),(function(){c?(r.next(s),r.complete()):r.error(u?new o.NotFoundError("No matching values"):new n.EmptyError)})))}))}},5735:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skip=void 0;var n=r(7261);t.skip=function(e){return n.filter((function(t,r){return e<=r}))}},3252:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipLast=void 0;var n=r(8987),i=r(6097),o=r(7326);t.skipLast=function(e){return e<=0?n.identity:i.operate((function(t,r){var n=new Array(e),i=0;return t.subscribe(o.createOperatorSubscriber(r,(function(t){var o=i++;if(o<e)n[o]=t;else{var s=o%e,a=n[s];n[s]=t,r.next(a)}}))),function(){n=null}}))}},1779:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipUntil=void 0;var n=r(6097),i=r(7326),o=r(6958),s=r(7116);t.skipUntil=function(e){return n.operate((function(t,r){var n=!1,a=i.createOperatorSubscriber(r,(function(){null==a||a.unsubscribe(),n=!0}),s.noop);o.innerFrom(e).subscribe(a),t.subscribe(i.createOperatorSubscriber(r,(function(e){return n&&r.next(e)})))}))}},5454:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipWhile=void 0;var n=r(6097),i=r(7326);t.skipWhile=function(e){return n.operate((function(t,r){var n=!1,o=0;t.subscribe(i.createOperatorSubscriber(r,(function(t){return(n||(n=!e(t,o++)))&&r.next(t)})))}))}},1923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startWith=void 0;var n=r(3364),i=r(4544),o=r(6097);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.popScheduler(e);return o.operate((function(t,i){(r?n.concat(e,t,r):n.concat(e,t)).subscribe(i)}))}},9130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeOn=void 0;var n=r(6097);t.subscribeOn=function(e,t){return void 0===t&&(t=0),n.operate((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}},1695:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchAll=void 0;var n=r(6649),i=r(8987);t.switchAll=function(){return n.switchMap(i.identity)}},6649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMap=void 0;var n=r(6958),i=r(6097),o=r(7326);t.switchMap=function(e,t){return i.operate((function(r,i){var s=null,a=0,c=!1,u=function(){return c&&!s&&i.complete()};r.subscribe(o.createOperatorSubscriber(i,(function(r){null==s||s.unsubscribe();var c=0,l=a++;n.innerFrom(e(r,l)).subscribe(s=o.createOperatorSubscriber(i,(function(e){return i.next(t?t(r,e,l,c++):e)}),(function(){s=null,u()})))}),(function(){c=!0,u()})))}))}},3054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMapTo=void 0;var n=r(6649),i=r(2935);t.switchMapTo=function(e,t){return i.isFunction(t)?n.switchMap((function(){return e}),t):n.switchMap((function(){return e}))}},2890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchScan=void 0;var n=r(6649),i=r(6097);t.switchScan=function(e,t){return i.operate((function(r,i){var o=t;return n.switchMap((function(t,r){return e(o,t,r)}),(function(e,t){return o=t,t}))(r).subscribe(i),function(){o=null}}))}},9438:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.take=void 0;var n=r(6929),i=r(6097),o=r(7326);t.take=function(e){return e<=0?function(){return n.EMPTY}:i.operate((function(t,r){var n=0;t.subscribe(o.createOperatorSubscriber(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}},4125:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.takeLast=void 0;var i=r(6929),o=r(6097),s=r(7326);t.takeLast=function(e){return e<=0?function(){return i.EMPTY}:o.operate((function(t,r){var i=[];t.subscribe(s.createOperatorSubscriber(r,(function(t){i.push(t),e<i.length&&i.shift()}),(function(){var e,t;try{for(var o=n(i),s=o.next();!s.done;s=o.next()){var a=s.value;r.next(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}r.complete()}),void 0,(function(){i=null})))}))}},9008:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeUntil=void 0;var n=r(6097),i=r(7326),o=r(6958),s=r(7116);t.takeUntil=function(e){return n.operate((function(t,r){o.innerFrom(e).subscribe(i.createOperatorSubscriber(r,(function(){return r.complete()}),s.noop)),!r.closed&&t.subscribe(r)}))}},5884:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeWhile=void 0;var n=r(6097),i=r(7326);t.takeWhile=function(e,t){return void 0===t&&(t=!1),n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){var i=e(r,o++);(i||t)&&n.next(r),!i&&n.complete()})))}))}},5383:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tap=void 0;var n=r(2935),i=r(6097),o=r(7326),s=r(8987);t.tap=function(e,t,r){var a=n.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return a?i.operate((function(e,t){var r;null===(r=a.subscribe)||void 0===r||r.call(a);var n=!0;e.subscribe(o.createOperatorSubscriber(t,(function(e){var r;null===(r=a.next)||void 0===r||r.call(a,e),t.next(e)}),(function(){var e;n=!1,null===(e=a.complete)||void 0===e||e.call(a),t.complete()}),(function(e){var r;n=!1,null===(r=a.error)||void 0===r||r.call(a,e),t.error(e)}),(function(){var e,t;n&&(null===(e=a.unsubscribe)||void 0===e||e.call(a)),null===(t=a.finalize)||void 0===t||t.call(a)})))})):s.identity}},1016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=void 0;var n=r(6097),i=r(7326),o=r(6958);t.throttle=function(e,t){return n.operate((function(r,n){var s=null!=t?t:{},a=s.leading,c=void 0===a||a,u=s.trailing,l=void 0!==u&&u,f=!1,d=null,h=null,p=!1,b=function(){null==h||h.unsubscribe(),h=null,l&&(v(),p&&n.complete())},m=function(){h=null,p&&n.complete()},g=function(t){return h=o.innerFrom(e(t)).subscribe(i.createOperatorSubscriber(n,b,m))},v=function(){if(f){f=!1;var e=d;d=null,n.next(e),!p&&g(e)}};r.subscribe(i.createOperatorSubscriber(n,(function(e){f=!0,d=e,(!h||h.closed)&&(c?v():g(e))}),(function(){p=!0,(!(l&&f&&h)||h.closed)&&n.complete()})))}))}},567:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttleTime=void 0;var n=r(7152),i=r(1016),o=r(8069);t.throttleTime=function(e,t,r){void 0===t&&(t=n.asyncScheduler);var s=o.timer(e,t);return i.throttle((function(){return s}),r)}},1332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfEmpty=void 0;var n=r(9088),i=r(6097),o=r(7326);function s(){return new n.EmptyError}t.throwIfEmpty=function(e){return void 0===e&&(e=s),i.operate((function(t,r){var n=!1;t.subscribe(o.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){return n?r.complete():r.error(e())})))}))}},1149:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeInterval=t.timeInterval=void 0;var n=r(7152),i=r(6097),o=r(7326);t.timeInterval=function(e){return void 0===e&&(e=n.asyncScheduler),i.operate((function(t,r){var n=e.now();t.subscribe(o.createOperatorSubscriber(r,(function(t){var i=e.now(),o=i-n;n=i,r.next(new s(t,o))})))}))};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},1316:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeout=t.TimeoutError=void 0;var n=r(7152),i=r(4426),o=r(6097),s=r(6958),a=r(3126),c=r(7326),u=r(5267);function l(e){throw new t.TimeoutError(e)}t.TimeoutError=a.createErrorClass((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}})),t.timeout=function(e,t){var r=i.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e,a=r.first,f=r.each,d=r.with,h=void 0===d?l:d,p=r.scheduler,b=void 0===p?null!=t?t:n.asyncScheduler:p,m=r.meta,g=void 0===m?null:m;if(null==a&&null==f)throw new TypeError("No timeout provided.");return o.operate((function(e,t){var r,n,i=null,o=0,l=function(e){n=u.executeSchedule(t,b,(function(){try{r.unsubscribe(),s.innerFrom(h({meta:g,lastValue:i,seen:o})).subscribe(t)}catch(e){t.error(e)}}),e)};r=e.subscribe(c.createOperatorSubscriber(t,(function(e){null==n||n.unsubscribe(),o++,t.next(i=e),f>0&&l(f)}),void 0,void 0,(function(){(null==n?void 0:n.closed)||null==n||n.unsubscribe(),i=null}))),!o&&l(null!=a?"number"==typeof a?a:+a-b.now():f)}))}},4972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutWith=void 0;var n=r(7152),i=r(4426),o=r(1316);t.timeoutWith=function(e,t,r){var s,a,c;if(r=null!=r?r:n.async,i.isValidDate(e)?s=e:"number"==typeof e&&(a=e),!t)throw new TypeError("No observable provided to switch to");if(c=function(){return t},null==s&&null==a)throw new TypeError("No timeout provided.");return o.timeout({first:s,each:a,scheduler:r,with:c})}},1275:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timestamp=void 0;var n=r(9168),i=r(6269);t.timestamp=function(e){return void 0===e&&(e=n.dateTimestampProvider),i.map((function(t){return{value:t,timestamp:e.now()}}))}},9867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0;var n=r(8083),i=r(6097),o=function(e,t){return e.push(t),e};t.toArray=function(){return i.operate((function(e,t){n.reduce(o,[])(e).subscribe(t)}))}},7649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.window=void 0;var n=r(5294),i=r(6097),o=r(7326),s=r(7116),a=r(6958);t.window=function(e){return i.operate((function(t,r){var i=new n.Subject;r.next(i.asObservable());var c=function(e){i.error(e),r.error(e)};return t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==i?void 0:i.next(e)}),(function(){i.complete(),r.complete()}),c)),a.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){i.complete(),r.next(i=new n.Subject)}),s.noop,c)),function(){null==i||i.unsubscribe(),i=null}}))}},5612:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowCount=void 0;var i=r(5294),o=r(6097),s=r(7326);t.windowCount=function(e,t){void 0===t&&(t=0);var r=t>0?t:e;return o.operate((function(t,o){var a=[new i.Subject],c=0;o.next(a[0].asObservable()),t.subscribe(s.createOperatorSubscriber(o,(function(t){var s,u;try{for(var l=n(a),f=l.next();!f.done;f=l.next()){f.value.next(t)}}catch(e){s={error:e}}finally{try{f&&!f.done&&(u=l.return)&&u.call(l)}finally{if(s)throw s.error}}var d=c-e+1;if(d>=0&&d%r==0&&a.shift().complete(),++c%r==0){var h=new i.Subject;a.push(h),o.next(h.asObservable())}}),(function(){for(;a.length>0;)a.shift().complete();o.complete()}),(function(e){for(;a.length>0;)a.shift().error(e);o.error(e)}),(function(){null,a=null})))}))}},9972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowTime=void 0;var n=r(5294),i=r(7152),o=r(4666),s=r(6097),a=r(7326),c=r(1291),u=r(4544),l=r(5267);t.windowTime=function(e){for(var t,r,f=[],d=1;d<arguments.length;d++)f[d-1]=arguments[d];var h=null!==(t=u.popScheduler(f))&&void 0!==t?t:i.asyncScheduler,p=null!==(r=f[0])&&void 0!==r?r:null,b=f[1]||1/0;return s.operate((function(t,r){var i=[],s=!1,u=function(e){var t=e.window,r=e.subs;t.complete(),r.unsubscribe(),c.arrRemove(i,e),s&&f()},f=function(){if(i){var t=new o.Subscription;r.add(t);var s=new n.Subject,a={window:s,subs:t,seen:0};i.push(a),r.next(s.asObservable()),l.executeSchedule(t,h,(function(){return u(a)}),e)}};null!==p&&p>=0?l.executeSchedule(r,h,f,p,!0):s=!0,f();var d=function(e){return i.slice().forEach(e)},m=function(e){d((function(t){var r=t.window;return e(r)})),e(r),r.unsubscribe()};return t.subscribe(a.createOperatorSubscriber(r,(function(e){d((function(t){t.window.next(e),b<=++t.seen&&u(t)}))}),(function(){return m((function(e){return e.complete()}))}),(function(e){return m((function(t){return t.error(e)}))}))),function(){i=null}}))}},9593:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowToggle=void 0;var i=r(5294),o=r(4666),s=r(6097),a=r(6958),c=r(7326),u=r(7116),l=r(1291);t.windowToggle=function(e,t){return s.operate((function(r,s){var f=[],d=function(e){for(;0<f.length;)f.shift().error(e);s.error(e)};a.innerFrom(e).subscribe(c.createOperatorSubscriber(s,(function(e){var r=new i.Subject;f.push(r);var n,h=new o.Subscription;try{n=a.innerFrom(t(e))}catch(e){return void d(e)}s.next(r.asObservable()),h.add(n.subscribe(c.createOperatorSubscriber(s,(function(){l.arrRemove(f,r),r.complete(),h.unsubscribe()}),u.noop,d)))}),u.noop)),r.subscribe(c.createOperatorSubscriber(s,(function(e){var t,r,i=f.slice();try{for(var o=n(i),s=o.next();!s.done;s=o.next()){s.value.next(e)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}),(function(){for(;0<f.length;)f.shift().complete();s.complete()}),d,(function(){for(;0<f.length;)f.shift().unsubscribe()})))}))}},6307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowWhen=void 0;var n=r(5294),i=r(6097),o=r(7326),s=r(6958);t.windowWhen=function(e){return i.operate((function(t,r){var i,a,c=function(e){i.error(e),r.error(e)},u=function(){var t;null==a||a.unsubscribe(),null==i||i.complete(),i=new n.Subject,r.next(i.asObservable());try{t=s.innerFrom(e())}catch(e){return void c(e)}t.subscribe(a=o.createOperatorSubscriber(r,u,u,c))};u(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return i.next(e)}),(function(){i.complete(),r.complete()}),c,(function(){null==a||a.unsubscribe(),i=null})))}))}},5512:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.withLatestFrom=void 0;var o=r(6097),s=r(7326),a=r(6958),c=r(8987),u=r(7116),l=r(4544);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e);return o.operate((function(t,o){for(var l=e.length,f=new Array(l),d=e.map((function(){return!1})),h=!1,p=function(t){a.innerFrom(e[t]).subscribe(s.createOperatorSubscriber(o,(function(e){f[t]=e,h||d[t]||(d[t]=!0,(h=d.every(c.identity))&&(d=null))}),u.noop))},b=0;b<l;b++)p(b);t.subscribe(s.createOperatorSubscriber(o,(function(e){if(h){var t=i([e],n(f));o.next(r?r.apply(void 0,i([],n(t))):t)}})))}))}},586:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(4981),s=r(6097);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.operate((function(t,r){o.zip.apply(void 0,i([t],n(e))).subscribe(r)}))}},1221:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zipAll=void 0;var n=r(4981),i=r(2208);t.zipAll=function(e){return i.joinAllInternals(n.zip,e)}},7594:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zipWith=void 0;var o=r(586);t.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.zip.apply(void 0,i([],n(e)))}},7456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleArray=void 0;var n=r(4174);t.scheduleArray=function(e,t){return new n.Observable((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}},4271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleAsyncIterable=void 0;var n=r(4174),i=r(5267);t.scheduleAsyncIterable=function(e,t){if(!e)throw new Error("Iterable cannot be null");return new n.Observable((function(r){i.executeSchedule(r,t,(function(){var n=e[Symbol.asyncIterator]();i.executeSchedule(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}},2485:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleIterable=void 0;var n=r(4174),i=r(7630),o=r(2935),s=r(5267);t.scheduleIterable=function(e,t){return new n.Observable((function(r){var n;return s.executeSchedule(r,t,(function(){n=e[i.iterator](),s.executeSchedule(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){return void r.error(e)}i?r.complete():r.next(t)}),0,!0)})),function(){return o.isFunction(null==n?void 0:n.return)&&n.return()}}))}},5892:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleObservable=void 0;var n=r(6958),i=r(9314),o=r(9130);t.scheduleObservable=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},6976:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schedulePromise=void 0;var n=r(6958),i=r(9314),o=r(9130);t.schedulePromise=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},4260:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleReadableStreamLike=void 0;var n=r(4271),i=r(2221);t.scheduleReadableStreamLike=function(e,t){return n.scheduleAsyncIterable(i.readableStreamLikeToAsyncGenerator(e),t)}},2862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduled=void 0;var n=r(5892),i=r(6976),o=r(7456),s=r(2485),a=r(4271),c=r(3124),u=r(4283),l=r(5445),f=r(8131),d=r(3260),h=r(7756),p=r(2221),b=r(4260);t.scheduled=function(e,t){if(null!=e){if(c.isInteropObservable(e))return n.scheduleObservable(e,t);if(l.isArrayLike(e))return o.scheduleArray(e,t);if(u.isPromise(e))return i.schedulePromise(e,t);if(d.isAsyncIterable(e))return a.scheduleAsyncIterable(e,t);if(f.isIterable(e))return s.scheduleIterable(e,t);if(p.isReadableStreamLike(e))return b.scheduleReadableStreamLike(e,t)}throw h.createInvalidObservableTypeError(e)}},2502:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=void 0;var o=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(4666).Subscription);t.Action=o},2142:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameAction=void 0;var o=r(9462),s=r(9015),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.animationFrameProvider.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.animationFrameProvider.cancelAnimationFrame(r),t._scheduled=void 0)},t}(o.AsyncAction);t.AnimationFrameAction=a},7104:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(9812).AsyncScheduler);t.AnimationFrameScheduler=o},4151:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapAction=void 0;var o=r(9462),s=r(4409),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.immediateProvider.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.immediateProvider.clearImmediate(r),t._scheduled===r&&(t._scheduled=void 0))},t}(o.AsyncAction);t.AsapAction=a},4726:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(9812).AsyncScheduler);t.AsapScheduler=o},9462:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=void 0;var o=r(2502),s=r(7549),a=r(1291),c=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return i(t,e),t.prototype.schedule=function(e,t){var r;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),s.intervalProvider.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&s.intervalProvider.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,a.arrRemove(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(o.Action);t.AsyncAction=c},9812:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncScheduler=void 0;var o=r(6949),s=function(e){function t(t,r){void 0===r&&(r=o.Scheduler.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return i(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(o.Scheduler);t.AsyncScheduler=s},5336:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=void 0;var o=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.flush(this),0)},t}(r(9462).AsyncAction);t.QueueAction=o},3667:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(9812).AsyncScheduler);t.QueueScheduler=o},2929:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualAction=t.VirtualTimeScheduler=void 0;var o=r(9462),s=r(4666),a=function(e){function t(t,r){void 0===t&&(t=c),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return i(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(r(9812).AsyncScheduler);t.VirtualTimeScheduler=a;var c=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return i(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return s.Subscription.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(o.AsyncAction);t.VirtualAction=c},8989:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrame=t.animationFrameScheduler=void 0;var n=r(2142),i=r(7104);t.animationFrameScheduler=new i.AnimationFrameScheduler(n.AnimationFrameAction),t.animationFrame=t.animationFrameScheduler},9015:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrameProvider=void 0;var o=r(4666);t.animationFrameProvider={schedule:function(e){var r=requestAnimationFrame,n=cancelAnimationFrame,i=t.animationFrameProvider.delegate;i&&(r=i.requestAnimationFrame,n=i.cancelAnimationFrame);var s=r((function(t){n=void 0,e(t)}));return new o.Subscription((function(){return null==n?void 0:n(s)}))},requestAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.requestAnimationFrame)||requestAnimationFrame).apply(void 0,i([],n(e)))},cancelAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,i([],n(e)))},delegate:void 0}},3769:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asap=t.asapScheduler=void 0;var n=r(4151),i=r(4726);t.asapScheduler=new i.AsapScheduler(n.AsapAction),t.asap=t.asapScheduler},7152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.async=t.asyncScheduler=void 0;var n=r(9462),i=r(9812);t.asyncScheduler=new i.AsyncScheduler(n.AsyncAction),t.async=t.asyncScheduler},9168:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateTimestampProvider=void 0,t.dateTimestampProvider={now:function(){return(t.dateTimestampProvider.delegate||Date).now()},delegate:void 0}},4409:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.immediateProvider=void 0;var o=r(998),s=o.Immediate.setImmediate,a=o.Immediate.clearImmediate;t.immediateProvider={setImmediate:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.immediateProvider.delegate;return((null==o?void 0:o.setImmediate)||s).apply(void 0,i([],n(e)))},clearImmediate:function(e){var r=t.immediateProvider.delegate;return((null==r?void 0:r.clearImmediate)||a)(e)},delegate:void 0}},7549:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.intervalProvider=void 0,t.intervalProvider={setInterval:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.intervalProvider.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,n([e,i],r(o))):setInterval.apply(void 0,n([e,i],r(o)))},clearInterval:function(e){var r=t.intervalProvider.delegate;return((null==r?void 0:r.clearInterval)||clearInterval)(e)},delegate:void 0}},2261:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.performanceTimestampProvider=void 0,t.performanceTimestampProvider={now:function(){return(t.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}},4093:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queue=t.queueScheduler=void 0;var n=r(5336),i=r(3667);t.queueScheduler=new i.QueueScheduler(n.QueueAction),t.queue=t.queueScheduler},1577:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutProvider=void 0,t.timeoutProvider={setTimeout:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.timeoutProvider.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,n([e,i],r(o))):setTimeout.apply(void 0,n([e,i],r(o)))},clearTimeout:function(e){var r=t.timeoutProvider.delegate;return((null==r?void 0:r.clearTimeout)||clearTimeout)(e)},delegate:void 0}},7630:(e,t)=>{"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.iterator=t.getSymbolIterator=void 0,t.getSymbolIterator=r,t.iterator=r()},4595:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable=void 0,t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},2793:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9216:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=void 0;var n=r(3126);t.ArgumentOutOfRangeError=n.createErrorClass((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}))},9088:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=void 0;var n=r(3126);t.EmptyError=n.createErrorClass((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}))},998:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTools=t.Immediate=void 0;var r,n=1,i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=n++;return i[t]=!0,r||(r=Promise.resolve()),r.then((function(){return o(t)&&e()})),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},5722:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotFoundError=void 0;var n=r(3126);t.NotFoundError=n.createErrorClass((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}}))},8499:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=void 0;var n=r(3126);t.ObjectUnsubscribedError=n.createErrorClass((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}))},7298:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceError=void 0;var n=r(3126);t.SequenceError=n.createErrorClass((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}))},4043:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=void 0;var n=r(3126);t.UnsubscriptionError=n.createErrorClass((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}))},4544:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.popNumber=t.popScheduler=t.popResultSelector=void 0;var n=r(2935),i=r(9668);function o(e){return e[e.length-1]}t.popResultSelector=function(e){return n.isFunction(o(e))?e.pop():void 0},t.popScheduler=function(e){return i.isScheduler(o(e))?e.pop():void 0},t.popNumber=function(e,t){return"number"==typeof o(e)?e.pop():t}},2398:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsArgArrayOrObject=void 0;var r=Array.isArray,n=Object.getPrototypeOf,i=Object.prototype,o=Object.keys;t.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(r(t))return{args:t,keys:null};if((a=t)&&"object"==typeof a&&n(a)===i){var s=o(t);return{args:s.map((function(e){return t[e]})),keys:s}}}var a;return{args:e,keys:null}}},5034:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsOrArgArray=void 0;var r=Array.isArray;t.argsOrArgArray=function(e){return 1===e.length&&r(e[0])?e[0]:e}},1291:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrRemove=void 0,t.arrRemove=function(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}},3126:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErrorClass=void 0,t.createErrorClass=function(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},4800:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObject=void 0,t.createObject=function(e,t){return e.reduce((function(e,r,n){return e[r]=t[n],e}),{})}},5444:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.captureError=t.errorContext=void 0;var n=r(9179),i=null;t.errorContext=function(e){if(n.config.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,o=r.errorThrown,s=r.error;if(i=null,o)throw s}}else e()},t.captureError=function(e){n.config.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},5267:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeSchedule=void 0,t.executeSchedule=function(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}},8987:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=void 0,t.identity=function(e){return e}},5445:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=void 0,t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},3260:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=void 0;var n=r(2935);t.isAsyncIterable=function(e){return Symbol.asyncIterator&&n.isFunction(null==e?void 0:e[Symbol.asyncIterator])}},4426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidDate=void 0,t.isValidDate=function(e){return e instanceof Date&&!isNaN(e)}},2935:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e}},3124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInteropObservable=void 0;var n=r(4595),i=r(2935);t.isInteropObservable=function(e){return i.isFunction(e[n.observable])}},8131:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIterable=void 0;var n=r(7630),i=r(2935);t.isIterable=function(e){return i.isFunction(null==e?void 0:e[n.iterator])}},3659:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObservable=void 0;var n=r(4174),i=r(2935);t.isObservable=function(e){return!!e&&(e instanceof n.Observable||i.isFunction(e.lift)&&i.isFunction(e.subscribe))}},4283:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=void 0;var n=r(2935);t.isPromise=function(e){return n.isFunction(null==e?void 0:e.then)}},2221:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},i=this&&this.__await||function(e){return this instanceof i?(this.v=e,this):new i(e)},o=this&&this.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){s.push([e,t,r,n])>1||c(e,t)}))})}function c(e,t){try{(r=o[e](t)).value instanceof i?Promise.resolve(r.value.v).then(u,l):f(s[0][2],r)}catch(e){f(s[0][3],e)}var r}function u(e){c("next",e)}function l(e){c("throw",e)}function f(e,t){e(t),s.shift(),s.length&&c(s[0][0],s[0][1])}};Object.defineProperty(t,"__esModule",{value:!0}),t.isReadableStreamLike=t.readableStreamLikeToAsyncGenerator=void 0;var s=r(2935);t.readableStreamLikeToAsyncGenerator=function(e){return o(this,arguments,(function(){var t,r,o;return n(this,(function(n){switch(n.label){case 0:t=e.getReader(),n.label=1;case 1:n.trys.push([1,,9,10]),n.label=2;case 2:return[4,i(t.read())];case 3:return r=n.sent(),o=r.value,r.done?[4,i(void 0)]:[3,5];case 4:return[2,n.sent()];case 5:return[4,i(o)];case 6:return[4,n.sent()];case 7:return n.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))},t.isReadableStreamLike=function(e){return s.isFunction(null==e?void 0:e.getReader)}},9668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=void 0;var n=r(2935);t.isScheduler=function(e){return e&&n.isFunction(e.schedule)}},6097:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.operate=t.hasLift=void 0;var n=r(2935);function i(e){return n.isFunction(null==e?void 0:e.lift)}t.hasLift=i,t.operate=function(e){return function(t){if(i(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},9364:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mapOneOrManyArgs=void 0;var o=r(6269),s=Array.isArray;t.mapOneOrManyArgs=function(e){return o.map((function(t){return function(e,t){return s(t)?e.apply(void 0,i([],n(t))):e(t)}(e,t)}))}},7116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=void 0,t.noop=function(){}},8781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=void 0,t.not=function(e,t){return function(r,n){return!e.call(t,r,n)}}},5250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pipeFromArray=t.pipe=void 0;var n=r(8987);function i(e){return 0===e.length?n.identity:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},1600:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportUnhandledError=void 0;var n=r(9179),i=r(1577);t.reportUnhandledError=function(e){i.timeoutProvider.setTimeout((function(){var t=n.config.onUnhandledError;if(!t)throw e;t(e)}))}},7756:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInvalidObservableTypeError=void 0,t.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},9002:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=t.merge=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.concat=t.combineLatestWith=t.combineLatest=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=void 0,t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.race=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.partition=t.pairwise=t.onErrorResumeNext=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=void 0,t.zipWith=t.zipAll=t.zip=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=void 0;var n=r(2605);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return n.audit}});var i=r(4152);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return i.auditTime}});var o=r(5149);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return o.buffer}});var s=r(3189);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return s.bufferCount}});var a=r(9459);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return a.bufferTime}});var c=r(8145);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return c.bufferToggle}});var u=r(7764);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return u.bufferWhen}});var l=r(3056);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return l.catchError}});var f=r(498);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return f.combineAll}});var d=r(7484);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return d.combineLatestAll}});var h=r(6527);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return h.combineLatest}});var p=r(4755);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return p.combineLatestWith}});var b=r(3792);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return b.concat}});var m=r(482);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return m.concatAll}});var g=r(1774);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return g.concatMap}});var v=r(3977);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return v.concatMapTo}});var y=r(7672);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return y.concatWith}});var _=r(5561);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return _.connect}});var w=r(8259);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return w.count}});var E=r(3473);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return E.debounce}});var O=r(8390);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return O.debounceTime}});var S=r(4562);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return S.defaultIfEmpty}});var A=r(8151);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return A.delay}});var P=r(744);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return P.delayWhen}});var T=r(8590);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return T.dematerialize}});var R=r(8406);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return R.distinct}});var x=r(7300);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return x.distinctUntilChanged}});var I=r(4405);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return I.distinctUntilKeyChanged}});var M=r(2787);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return M.elementAt}});var L=r(1665);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return L.endWith}});var k=r(1511);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return k.every}});var N=r(5592);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return N.exhaust}});var C=r(2008);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return C.exhaustAll}});var j=r(4019);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return j.exhaustMap}});var D=r(9101);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return D.expand}});var U=r(7261);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return U.filter}});var B=r(5381);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return B.finalize}});var F=r(4127);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return F.find}});var K=r(9727);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return K.findIndex}});var H=r(7418);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return H.first}});var G=r(7533);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return G.groupBy}});var $=r(9186);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return $.ignoreElements}});var V=r(7757);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return V.isEmpty}});var z=r(3374);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return z.last}});var q=r(6269);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return q.map}});var W=r(5471);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return W.mapTo}});var Z=r(1160);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return Z.materialize}});var J=r(1890);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return J.max}});var Y=r(3982);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return Y.merge}});var X=r(400);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return X.mergeAll}});var Q=r(9121);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return Q.flatMap}});var ee=r(6086);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ee.mergeMap}});var te=r(1244);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return te.mergeMapTo}});var re=r(3699);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return re.mergeScan}});var ne=r(8220);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ne.mergeWith}});var ie=r(770);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ie.min}});var oe=r(8413);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return oe.multicast}});var se=r(9314);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return se.observeOn}});var ae=r(1899);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return ae.onErrorResumeNext}});var ce=r(1186);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ce.pairwise}});var ue=r(9857);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ue.partition}});var le=r(9532);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return le.pluck}});var fe=r(5745);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return fe.publish}});var de=r(8103);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return de.publishBehavior}});var he=r(2610);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return he.publishLast}});var pe=r(5299);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return pe.publishReplay}});var be=r(6699);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return be.race}});var me=r(3820);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return me.raceWith}});var ge=r(8083);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return ge.reduce}});var ve=r(2588);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return ve.repeat}});var ye=r(9249);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return ye.repeatWhen}});var _e=r(4486);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return _e.retry}});var we=r(9112);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return we.retryWhen}});var Ee=r(4508);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return Ee.refCount}});var Oe=r(778);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Oe.sample}});var Se=r(7701);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Se.sampleTime}});var Ae=r(8167);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Ae.scan}});var Pe=r(7821);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Pe.sequenceEqual}});var Te=r(2645);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return Te.share}});var Re=r(7566);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Re.shareReplay}});var xe=r(4610);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return xe.single}});var Ie=r(5735);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return Ie.skip}});var Me=r(3252);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Me.skipLast}});var Le=r(1779);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return Le.skipUntil}});var ke=r(5454);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return ke.skipWhile}});var Ne=r(1923);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Ne.startWith}});var Ce=r(9130);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Ce.subscribeOn}});var je=r(1695);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return je.switchAll}});var De=r(6649);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return De.switchMap}});var Ue=r(3054);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Ue.switchMapTo}});var Be=r(2890);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Be.switchScan}});var Fe=r(9438);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Fe.take}});var Ke=r(4125);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return Ke.takeLast}});var He=r(9008);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return He.takeUntil}});var Ge=r(5884);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return Ge.takeWhile}});var $e=r(5383);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return $e.tap}});var Ve=r(1016);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return Ve.throttle}});var ze=r(567);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return ze.throttleTime}});var qe=r(1332);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return qe.throwIfEmpty}});var We=r(1149);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return We.timeInterval}});var Ze=r(1316);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Ze.timeout}});var Je=r(4972);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Je.timeoutWith}});var Ye=r(1275);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return Ye.timestamp}});var Xe=r(9867);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return Xe.toArray}});var Qe=r(7649);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return Qe.window}});var et=r(5612);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return et.windowCount}});var tt=r(9972);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return tt.windowTime}});var rt=r(9593);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return rt.windowToggle}});var nt=r(6307);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return nt.windowWhen}});var it=r(5512);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return it.withLatestFrom}});var ot=r(586);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return ot.zip}});var st=r(1221);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return st.zipAll}});var at=r(7594);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return at.zipWith}})},7834:(e,t,r)=>{var n=r(8834),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},3327:(e,t,r)=>{var n=r(7834).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,s=this._len,a=0;a<o;){for(var c=s%i,u=Math.min(o-a,i-c),l=0;l<u;l++)r[c+l]=e[a+l];a+=u,(s+=u)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},9065:(e,t,r)=>{var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(8820),n.sha1=r(7885),n.sha224=r(8321),n.sha256=r(4424),n.sha384=r(213),n.sha512=r(5596)},8820:(e,t,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,i.call(this,64,56)}function u(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,c=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=n)<<5|t>>>27)+l(h,i,o,a)+c+r[d]+s[h];c=a,a=o,o=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},7885:(e,t,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,i.call(this,64,56)}function u(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,c=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),b=u(n)+f(p,i,o,a)+c+r[h]+s[p]|0;c=a,a=o,o=l(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},8321:(e,t,r)=>{var n=r(1285),i=r(4424),o=r(3327),s=r(7834).Buffer,a=new Array(64);function c(){this.init(),this._w=a,o.call(this,64,56)}n(c,i),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=c},4424:(e,t,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,s=[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 Array(64);function c(){this.init(),this._w=a,i.call(this,64,56)}function u(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(c,i),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,c=0|this._e,p=0|this._f,b=0|this._g,m=0|this._h,g=0;g<16;++g)r[g]=e.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((t=r[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[g-7]+h(r[g-15])+r[g-16];for(var v=0;v<64;++v){var y=m+d(c)+u(c,p,b)+s[v]+r[v]|0,_=f(n)+l(n,i,o)|0;m=b,b=p,p=c,c=a+y|0,a=o,o=i,i=n,n=y+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=m+this._h|0},c.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},213:(e,t,r)=>{var n=r(1285),i=r(5596),o=r(3327),s=r(7834).Buffer,a=new Array(160);function c(){this.init(),this._w=a,o.call(this,128,112)}n(c,i),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=s.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=c},5596:(e,t,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function c(){this.init(),this._w=a,i.call(this,128,112)}function u(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>0?1:0}n(c,i),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,c=0|this._fh,v=0|this._gh,y=0|this._hh,_=0|this._al,w=0|this._bl,E=0|this._cl,O=0|this._dl,S=0|this._el,A=0|this._fl,P=0|this._gl,T=0|this._hl,R=0;R<32;R+=2)t[R]=e.readInt32BE(4*R),t[R+1]=e.readInt32BE(4*R+4);for(;R<160;R+=2){var x=t[R-30],I=t[R-30+1],M=h(x,I),L=p(I,x),k=b(x=t[R-4],I=t[R-4+1]),N=m(I,x),C=t[R-14],j=t[R-14+1],D=t[R-32],U=t[R-32+1],B=L+j|0,F=M+C+g(B,L)|0;F=(F=F+k+g(B=B+N|0,N)|0)+D+g(B=B+U|0,U)|0,t[R]=F,t[R+1]=B}for(var K=0;K<160;K+=2){F=t[K],B=t[K+1];var H=l(r,n,i),G=l(_,w,E),$=f(r,_),V=f(_,r),z=d(a,S),q=d(S,a),W=s[K],Z=s[K+1],J=u(a,c,v),Y=u(S,A,P),X=T+q|0,Q=y+z+g(X,T)|0;Q=(Q=(Q=Q+J+g(X=X+Y|0,Y)|0)+W+g(X=X+Z|0,Z)|0)+F+g(X=X+B|0,B)|0;var ee=V+G|0,te=$+H+g(ee,V)|0;y=v,T=P,v=c,P=A,c=a,A=S,a=o+Q+g(S=O+X|0,O)|0,o=i,O=E,i=n,E=w,n=r,w=_,r=Q+te+g(_=X+ee|0,X)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+E|0,this._dl=this._dl+O|0,this._el=this._el+S|0,this._fl=this._fl+A|0,this._gl=this._gl+P|0,this._hl=this._hl+T|0,this._ah=this._ah+r+g(this._al,_)|0,this._bh=this._bh+n+g(this._bl,w)|0,this._ch=this._ch+i+g(this._cl,E)|0,this._dh=this._dh+o+g(this._dl,O)|0,this._eh=this._eh+a+g(this._el,S)|0,this._fh=this._fh+c+g(this._fl,A)|0,this._gh=this._gh+v+g(this._gl,P)|0,this._hh=this._hh+y+g(this._hl,T)|0},c.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},4851:(e,t,r)=>{e.exports=i;var n=r(2699).EventEmitter;function i(){n.call(this)}r(1285)(i,n),i.Readable=r(8051),i.Writable=r(2557),i.Duplex=r(7073),i.Transform=r(7640),i.PassThrough=r(5163),i.finished=r(9885),i.pipeline=r(3495),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",c));var s=!1;function a(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",u),e.on("error",u),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},214:(e,t,r)=>{"use strict";var n=r(7834).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(i=s(t[n]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(i=s(t[n]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},8743:e=>{e.exports=function(e){return ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e)}},5803:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},227:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DeprecationError:()=>A,InvalidAddressError:()=>l,InvalidAmountError:()=>d,InvalidBlockHashError:()=>f,InvalidChainIdError:()=>w,InvalidContractAddressError:()=>_,InvalidDerivationPathError:()=>h,InvalidHexStringError:()=>p,InvalidKeyError:()=>g,InvalidKeyHashError:()=>E,InvalidMessageError:()=>b,InvalidOperationHashError:()=>O,InvalidOperationKindError:()=>S,InvalidPublicKeyError:()=>v,InvalidSignatureError:()=>y,InvalidViewParameterError:()=>m,NetworkError:()=>c,ParameterValidationError:()=>i,PermissionDeniedError:()=>u,ProhibitedActionError:()=>P,PublicKeyNotFoundError:()=>T,RpcError:()=>o,TaquitoError:()=>n,TezosToolkitConfigError:()=>s,UnsupportedActionError:()=>a});class n extends Error{}class i extends n{}class o extends n{}class s extends n{}class a extends n{}class c extends n{}class u extends n{}class l extends i{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidAddressError",this.message=`Invalid address "${e}"`,this.message+=t?` ${t}.`:"."}}class f extends i{constructor(e,t){super(),this.blockHash=e,this.errorDetail=t,this.name="InvalidBlockHashError",this.message=`Invalid block hash "${e}"`,this.message+=t?` ${t}.`:"."}}class d extends i{constructor(e){super(),this.amount=e,this.name="InvalidAmountError",this.message=`Invalid amount "${e}"`}}class h extends i{constructor(e,t){super(),this.derivationPath=e,this.errorDetail=t,this.name="InvalidDerivationPathError",this.message=`Invalid derivation path "${e}"`,this.message+=t?` ${t}.`:"."}}class p extends i{constructor(e,t){super(),this.hexString=e,this.errorDetail=t,this.name="InvalidHexStringError",this.message=`Invalid hex string "${e}"`,this.message+=t?` ${t}.`:"."}}class b extends i{constructor(e,t){super(),this.msg=e,this.errorDetail=t,this.name="InvalidMessageError",this.message=`Invalid message "${e}"`,this.message+=t?` ${t}.`:"."}}class m extends i{constructor(e,t,r,n){super(),this.viewName=e,this.sigs=t,this.args=r,this.cause=n,this.name="InvalidViewParameterError",this.message=`Invalid view arguments ${JSON.stringify(r)} received for name "${e}" expecting one of the following signatures ${JSON.stringify(t)}.`}}class g extends i{constructor(e){super(),this.errorDetail=e,this.name="InvalidKeyError",this.message="Invalid private key",this.message+=e?` ${e}.`:"."}}class v extends i{constructor(e,t){super(),this.publicKey=e,this.errorDetail=t,this.name="InvalidPublicKeyError",this.message=`Invalid public key "${e}"`,this.message+=t?` ${t}.`:"."}}class y extends i{constructor(e,t){super(),this.signature=e,this.errorDetail=t,this.name="InvalidSignatureError",this.message=`Invalid signature "${e}"`,this.message+=t?` ${t}.`:"."}}class _ extends i{constructor(e,t){super(),this.contractAddress=e,this.errorDetail=t,this.name="InvalidContractAddressError",this.message=`Invalid contract address "${e}"`,this.message+=t?` ${t}.`:"."}}class w extends i{constructor(e,t){super(),this.chainId=e,this.errorDetail=t,this.name="InvalidChainIdError",this.message=`Invalid chain id "${e}"`,this.message+=t?` ${t}.`:"."}}class E extends i{constructor(e,t){super(),this.keyHash=e,this.errorDetail=t,this.name="InvalidKeyHashError",this.message=`Invalid public key hash "${e}"`,this.message+=t?` ${t}.`:"."}}class O extends i{constructor(e,t){super(),this.operationHash=e,this.errorDetail=t,this.name="InvalidOperationHashError",this.message=`Invalid operation hash "${e}"`,this.message+=t?` ${t}.`:"."}}class S extends i{constructor(e,t){super(),this.operationKind=e,this.errorDetail=t,this.name="InvalidOperationKindError",this.message=`Invalid operation kind "${e}"`,this.message+=t?` ${t}.`:"."}}class A extends a{constructor(e){super(),this.message=e,this.name="DeprecationError"}}class P extends a{constructor(e){super(),this.message=e,this.name="ProhibitedActionError"}}class T extends n{constructor(e,t){super(),this.pkh=e,this.cause=t,this.name="PublicKeyNotFoundError",this.message=`Public key not found of this address "${e}" in either wallet or contract API.`}}},5543:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HttpBackend:()=>O,HttpRequestFailed:()=>b,HttpResponseError:()=>m,STATUS_CODE:()=>g,VERSION:()=>v});var n=r(9644),i=r.n(n),o=r(227);function s(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const a=r(6955),c=r(8030),u=r(7948),{isUndefined:l,isStandardBrowserEnv:f,isFormData:d}=r(3044);function h(e,t){return s(this,void 0,void 0,(function*(){try{const r=yield fetch(e);let n={ok:r.ok,status:r.status,statusText:r.statusText,headers:new Headers(r.headers),config:t,request:e};if(r.status>=400)return p("Response Error",t,"ERR_NETWORK",e,n);if(n={ok:r.ok,status:r.status,statusText:r.statusText,headers:new Headers(r.headers),config:t,request:e},r.status>=200&&204!==r.status)switch(t.responseType){case"arraybuffer":n.data=yield r.arrayBuffer();break;case"blob":n.data=yield r.blob();break;case"json":n.data=yield r.json();break;default:n.data=yield r.text()}return n}catch(r){return p("Network Error",t,"ERR_NETWORK",e)}}))}function p(e,t,r,n,i){return function(e,t,r,n,i){e.config=t,r&&(e.code=r);return e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:"description"in this?this.description:void 0,number:"number"in this?this.number:void 0,fileName:"fileName"in this?this.fileName:void 0,lineNumber:"lineNumber"in this?this.lineNumber:void 0,columnNumber:"columnNumber"in this?this.columnNumber:void 0,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}(new Error(e),t,r,n,i)}class b extends o.NetworkError{constructor(e,t,r){super(),this.method=e,this.url=t,this.cause=r,this.name="HttpRequestFailed",this.message=`${e} ${t} ${String(r)}`}}class m extends o.NetworkError{constructor(e,t,r,n,i){super(),this.message=e,this.status=t,this.statusText=r,this.body=n,this.url=i,this.name="HttpResponse"}}var g;!function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(g||(g={}));const v={commitHash:"e1b1d6976a564f925c01cf66e28df9acb0085c3d",version:"17.3.1-beta-RC.0"};var y;const _="undefined"!=typeof process&&!!(null===(y=null===process||void 0===process?void 0:process.versions)||void 0===y?void 0:y.node),w=_?void 0:function(e){return s(this,void 0,void 0,(function*(){const t=function(e){var t;const r=new Headers(e.headers);if(e.auth){const t=e.auth.username||"",n=e.auth.password?decodeURI(encodeURIComponent(e.auth.password)):"";r.set("Authorization",`Basic ${btoa(t+":"+n)}`)}const n=null===(t=e.method)||void 0===t?void 0:t.toUpperCase(),i={headers:r,method:n};"GET"!==n&&"HEAD"!==n&&(i.body=e.data,d(i.body)&&f()&&r.delete("Content-Type"));const o=e;"mode"in o&&(i.mode=o.mode);"cache"in o&&(i.cache=o.cache);"integrity"in o&&(i.integrity=o.integrity);"redirect"in o&&(i.redirect=o.redirect);"referrer"in o&&(i.referrer=o.referrer);l(o.withCredentials)||(i.credentials=o.withCredentials?"include":"omit");const s=u(o.baseURL,o.url),a=c(s,o.params,o.paramsSerializer);return new Request(a,i)}(e),r=[h(t,e)];e.timeout&&e.timeout>0&&r.push(new Promise((r=>{setTimeout((()=>{const n=e.timeoutErrorMessage?e.timeoutErrorMessage:"timeout of "+e.timeout+"ms exceeded";r(p(n,e,"ECONNABORTED",t))}),e.timeout)})));const n=yield Promise.race(r);return new Promise(((t,r)=>{if(n instanceof Error)r(n);else{const i=e;"settle"in i&&"[object Function]"===Object.prototype.toString.call(i.settle)?i.settle(t,r,n):a(t,r,n)}}))}))};var E;!function(e){e.TEXT="text",e.JSON="json"}(E||(E={}));class O{constructor(e=3e4){this.timeout=e}serialize(e){if(!e)return"";const t=[];for(const r in e)if(e.hasOwnProperty(r)&&void 0!==e[r]){const n="function"==typeof e[r].toJSON?e[r].toJSON():e[r];if(null===n){t.push(encodeURIComponent(r));continue}if(Array.isArray(n)){n.forEach((e=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(e))}));continue}t.push(encodeURIComponent(r)+"="+encodeURIComponent(n))}const r=t.join("&");return r?`?${r}`:""}createRequest({url:e,method:t,timeout:r=this.timeout,query:n,headers:o={},json:a=!0},c){return s(this,void 0,void 0,(function*(){const s=e+this.serialize(n);let u,l;o["Content-Type"]||(o["Content-Type"]="application/json"),a?u=E.JSON:(u=E.TEXT,l=[e=>e]);try{return(yield i().request({url:s,method:null!=t?t:"GET",headers:o,responseType:u,transformResponse:l,timeout:r,data:c,adapter:w})).data}catch(e){if(i().isAxiosError(e)&&e.response||!_&&e.response){let t;throw t="object"==typeof e.response.data?JSON.stringify(e.response.data):e.response.data,new m(`Http error response: (${e.response.status}) ${t}`,e.response.status,e.response.statusText,t,s)}throw new b(String(t),s,e)}}))}}},5078:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CODEC:()=>c,LocalForger:()=>Ue,ProtocolsHash:()=>Ne,Uint8ArrayConsumer:()=>T,VERSION:()=>Ce,decoders:()=>Ie,encoders:()=>Me,getCodec:()=>De,localForger:()=>Be,opMapping:()=>u,opMappingReverse:()=>l});var n=r(4632),i=r(227),o=r(2558);const s=e=>e.reduce(((e,t)=>e+t.toString(16).padStart(2,"0")),""),a=(e,t=8)=>e.toString(16).padStart(t,"0");var c;!function(e){e.SECRET="secret",e.RAW="raw",e.TZ1="tz1",e.BRANCH="branch",e.ZARITH="zarith",e.PUBLIC_KEY="public_key",e.PKH="pkh",e.DELEGATE="delegate",e.SCRIPT="script",e.BALLOT_STATEMENT="ballotStmt",e.PROPOSAL="proposal",e.PROPOSAL_ARR="proposalArr",e.INT32="int32",e.INT16="int16",e.PARAMETERS="parameters",e.ADDRESS="address",e.SMART_CONTRACT_ADDRESS="smart_contract_address",e.SMART_ROLLUP_ADDRESS="smart_rollup_address",e.SMART_ROLLUP_COMMITMENT_HASH="smart_rollup_commitment_hash",e.VALUE="value",e.PADDED_BYTES="padded_bytes",e.SMART_ROLLUP_MESSAGE="smart_rollup_message",e.MANAGER="manager",e.BLOCK_PAYLOAD_HASH="blockPayloadHash",e.ENTRYPOINT="entrypoint",e.OPERATION="operation",e.OP_ACTIVATE_ACCOUNT="activate_account",e.OP_DELEGATION="delegation",e.OP_TRANSACTION="transaction",e.OP_ORIGINATION="origination",e.OP_BALLOT="ballot",e.OP_FAILING_NOOP="failing_noop",e.OP_ENDORSEMENT="endorsement",e.OP_SEED_NONCE_REVELATION="seed_nonce_revelation",e.OP_REVEAL="reveal",e.OP_PROPOSALS="proposals",e.OP_REGISTER_GLOBAL_CONSTANT="register_global_constant",e.OP_TRANSFER_TICKET="transfer_ticket",e.OP_TX_ROLLUP_ORIGINATION="tx_rollup_origination",e.OP_TX_ROLLUP_SUBMIT_BATCH="tx_rollup_submit_batch",e.BURN_LIMIT="burn_limit",e.TX_ROLLUP_ORIGINATION_PARAM="tx_rollup_origination_param",e.TX_ROLLUP_ID="tx_rollup_id",e.TX_ROLLUP_BATCH_CONTENT="tx_rollup_batch_content",e.OP_INCREASE_PAID_STORAGE="increase_paid_storage",e.OP_UPDATE_CONSENSUS_KEY="update_consensus_key",e.OP_DRAIN_DELEGATE="drain_delegate",e.DEPOSITS_LIMIT="deposits_limit",e.OP_SET_DEPOSITS_LIMIT="set_deposits_limit",e.OP_SMART_ROLLUP_ORIGINATE="smart_rollup_originate",e.PVM_KIND="pvm_kind",e.OP_SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",e.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message"}(c||(c={}));const u={"00":"parameter","01":"storage","02":"code","03":"False","04":"Elt","05":"Left","06":"None","07":"Pair","08":"Right","09":"Some","0a":"True","0b":"Unit","0c":"PACK","0d":"UNPACK","0e":"BLAKE2B","0f":"SHA256",10:"SHA512",11:"ABS",12:"ADD",13:"AMOUNT",14:"AND",15:"BALANCE",16:"CAR",17:"CDR",18:"CHECK_SIGNATURE",19:"COMPARE","1a":"CONCAT","1b":"CONS","1c":"CREATE_ACCOUNT","1d":"CREATE_CONTRACT","1e":"IMPLICIT_ACCOUNT","1f":"DIP",20:"DROP",21:"DUP",22:"EDIV",23:"EMPTY_MAP",24:"EMPTY_SET",25:"EQ",26:"EXEC",27:"FAILWITH",28:"GE",29:"GET","2a":"GT","2b":"HASH_KEY","2c":"IF","2d":"IF_CONS","2e":"IF_LEFT","2f":"IF_NONE",30:"INT",31:"LAMBDA",32:"LE",33:"LEFT",34:"LOOP",35:"LSL",36:"LSR",37:"LT",38:"MAP",39:"MEM","3a":"MUL","3b":"NEG","3c":"NEQ","3d":"NIL","3e":"NONE","3f":"NOT",40:"NOW",41:"OR",42:"PAIR",43:"PUSH",44:"RIGHT",45:"SIZE",46:"SOME",47:"SOURCE",48:"SENDER",49:"SELF","4a":"STEPS_TO_QUOTA","4b":"SUB","4c":"SWAP","4d":"TRANSFER_TOKENS","4e":"SET_DELEGATE","4f":"UNIT",50:"UPDATE",51:"XOR",52:"ITER",53:"LOOP_LEFT",54:"ADDRESS",55:"CONTRACT",56:"ISNAT",57:"CAST",58:"RENAME",59:"bool","5a":"contract","5b":"int","5c":"key","5d":"key_hash","5e":"lambda","5f":"list",60:"map",61:"big_map",62:"nat",63:"option",64:"or",65:"pair",66:"set",67:"signature",68:"string",69:"bytes","6a":"mutez","6b":"timestamp","6c":"unit","6d":"operation","6e":"address","6f":"SLICE",70:"DIG",71:"DUG",72:"EMPTY_BIG_MAP",73:"APPLY",74:"chain_id",75:"CHAIN_ID",76:"LEVEL",77:"SELF_ADDRESS",78:"never",79:"NEVER","7a":"UNPAIR","7b":"VOTING_POWER","7c":"TOTAL_VOTING_POWER","7d":"KECCAK","7e":"SHA3","7f":"PAIRING_CHECK",80:"bls12_381_g1",81:"bls12_381_g2",82:"bls12_381_fr",83:"sapling_state",84:"sapling_transaction_deprecated",85:"SAPLING_EMPTY_STATE",86:"SAPLING_VERIFY_UPDATE",87:"ticket",88:"TICKET_DEPRECATED",89:"READ_TICKET","8a":"SPLIT_TICKET","8b":"JOIN_TICKETS","8c":"GET_AND_UPDATE","8d":"chest","8e":"chest_key","8f":"OPEN_CHEST",90:"VIEW",91:"view",92:"constant",93:"SUB_MUTEZ",94:"tx_rollup_l2_address",95:"MIN_BLOCK_TIME",96:"sapling_transaction",97:"EMIT",98:"Lambda_rec",99:"LAMBDA_REC","9a":"TICKET","9b":"BYTES","9c":"NAT"},l=(()=>{const e={};return Object.keys(u).forEach((t=>{e[u[t]]=t})),e})(),f={4:"activate_account",107:"reveal",110:"delegation",108:"transaction",109:"origination",6:"ballot",21:"endorsement",1:"seed_nonce_revelation",5:"proposals",111:"register_global_constant",150:"tx_rollup_origination",151:"tx_rollup_submit_batch",158:"transfer_ticket",112:"set_deposits_limit",113:"increase_paid_storage",114:"update_consensus_key",9:"drain_delegate",200:"smart_rollup_originate",201:"smart_rollup_add_messages",206:"smart_rollup_execute_outbox_message",17:"failing_noop"},d=(()=>{const e={};return Object.keys(f).forEach((t=>{const r="string"==typeof t?parseInt(t,10):t;e[f[r]]=a(r,2)})),e})(),h={"00":"default","01":"root","02":"do","03":"set_delegate","04":"remove_delegate","05":"deposit"},p=(()=>{const e={};return Object.keys(h).forEach((t=>{e[h[t]]=t})),e})();class b extends i.ParameterValidationError{constructor(e,t){super(),this.operation=e,this.errorDetail=t,this.name="InvalidOperationSchemaError",this.message="Invalid operation content recevied",t&&(this.message+=` ${t}.`)}}class m extends i.ParameterValidationError{constructor(e){super(),this.entrypoint=e,this.name="OversizedEntryPointError",this.message=`Invalid entrypoint length "${e.length}", maximum length is "31".`}}class g extends i.ParameterValidationError{constructor(e){super(),this.ballotValue=e,this.name="InvalidBallotValueError",this.message=`Invalid ballot value "${e}" expecting one of the following: "yay", "nay", "pass".`}}class v extends i.ParameterValidationError{constructor(e){super(),this.ballotValue=e,this.name="DecodeBallotValueError",this.message=`Invalid ballot value "${e}", cannot be decoded.`}}class y extends i.ParameterValidationError{constructor(e){super(),this.value=e,this.name="UnexpectedMichelsonValueError",this.message=`Invalid Michelson value "${e}", unalbe to encode.`}}class _ extends i.ParameterValidationError{constructor(e){super(),this.message=e,this.name="OperationDecodingError"}}class w extends i.ParameterValidationError{constructor(e){super(),this.message=e,this.name="OperationEncodingError"}}class E extends i.ParameterValidationError{constructor(e){super(),this.op=e,this.name="UnsupportedOperationError",this.message=`Unsupported operation "${e}", can submit an issue on our github for feature request.`}}class O extends i.ParameterValidationError{constructor(e){super(),this.pvm=e,this.name="UnsupportedPvmKindError",this.message=`Invalid Pvm kind "${e}" expecting either "arith" or "wasm_2_0_0".`}}class S extends i.ParameterValidationError{constructor(e){super(),this.pvm=e,this.name="DecodePvmKindError",this.message=`Invalid Pvm kind "${e}", cannot be decoded.`}}class A extends i.ParameterValidationError{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidSmartRollupAddress",this.message=`Invalid smart rollup address "${e}"`,t&&(this.message+=` ${t}.`)}}class P extends i.ParameterValidationError{constructor(e,t){super(),this.hash=e,this.errorDetail=t,this.name="InvalidSmartRollupCommitmentHashError",this.message=`Invalid smart rollup commitment hash "${e}"`,t&&(this.message+=` ${t}.`)}}class T{constructor(e,t=0){this.arr=e,this.offset=t}static fromHexString(e){const t=e.toLowerCase();if(/^(([a-f]|\d){2})*$/.test(t)){const e=new Uint8Array((t.match(/([a-z]|\d){2}/g)||[]).map((e=>parseInt(e,16))));return new T(e)}throw new i.InvalidHexStringError(t)}consume(e){const t=this.arr.subarray(this.offset,this.offset+e);return this.offset+=e,t}get(e){return this.arr[this.offset+e]}length(){return this.arr.length-this.offset}slice(e,t){return new T(this.arr.slice(e,t))}}const R=e=>{if(Array.isArray(e)){const t=e.map((e=>R(e))).join(""),r=t.length/2;return`02${a(r)}${t}`}if((e=>"prim"in e)(e))return D(e);if((e=>"bytes"in e&&"string"==typeof e.bytes)(e))return M(e);if((e=>"string"in e&&"string"==typeof e.string)(e))return k(e);if((e=>"int"in e&&"string"==typeof e.int)(e))return C(e);throw new y(JSON.stringify(e))},x=e=>{const t=e.consume(1);switch(t[0]){case 10:return L(e);case 1:return N(e);case 0:return j(e);case 2:{const t=new T(I(e)),r=[];for(;t.length()>0;)r.push(x(t));return r}default:return U(e,t)}},I=(e,t=4)=>{const r=e.consume(t),n=parseInt(Buffer.from(r).toString("hex"),16);return e.consume(n)},M=e=>{if(!/^([A-Fa-f0-9]{2})*$/.test(e.bytes))throw new i.InvalidHexStringError(e.bytes);const t=e.bytes.length/2;return`0a${a(t)}${e.bytes}`},L=e=>{const t=I(e);return{bytes:Buffer.from(t).toString("hex")}},k=e=>{const t=Buffer.from(e.string,"utf8").toString("hex"),r=t.length/2;return`01${a(r)}${t}`},N=e=>{const t=I(e);return{string:Buffer.from(t).toString("utf8")}},C=({int:e})=>{const t=new o.O(e,10),r="-"===t.toString(2)[0]?"1":"0",n=t.toString(2).replace(/-/g,""),i=n.length<=6?6:(n.length-6)%7?n.length+7-(n.length-6)%7:n.length,s=n.padStart(i,"0").match(/\d{6,7}/g).reverse();s[0]=r+s[0];return`00${s.map(((e,t)=>parseInt((t===s.length-1?"0":"1")+e,2).toString(16).padStart(2,"0"))).join("")}`},j=e=>{let t=e.consume(1)[0];const r=[];for(;128&t;)r.push(t),t=e.consume(1)[0];r.push(t);const n=!!(64&r[0]);r[0]=127&r[0];const i=r.map(((e,t)=>e.toString(2).slice(0===t?-6:-7).padStart(0===t?6:7,"0"))).reverse();let s=new o.O(i.join(""),2);return n&&(s=s.times(-1)),{int:s.toFixed()}},D=e=>{const t=+Array.isArray(e.annots),r=Array.isArray(e.args)?e.args.length:0,n=a(Math.min(2*r+t+3,9),2),i=l[e.prim];let o=(e.args||[]).map((e=>R(e))).join("");const s=Array.isArray(e.annots)?K(e.annots):"";return"LAMBDA"!==e.prim&&"LAMBDA_REC"!==e.prim||!r||(o=a(o.length/2)+o+a(0)),("pair"===e.prim||"Pair"===e.prim)&&r>2&&(o=""===s?a(o.length/2)+o+a(0):a(o.length/2)+o),"view"===e.prim&&e.args&&(o=a(o.length/2)+o+a(0)),`${n}${i}${o}${s}`},U=(e,t)=>{const r=(t[0]-3)%2==1;let n=Math.floor((t[0]-3)/2);const i=e.consume(1)[0].toString(16).padStart(2,"0"),o={prim:u[i]};if("LAMBDA"!==u[i]&&"LAMBDA_REC"!==u[i]||e.consume(4),"view"===u[i])return 0!=n?B(e,o):o;let s,a;("pair"===u[i]||"Pair"===u[i])&&n>2&&(s=F(e),n=0,a=H(e));const c=new Array(n).fill(0).map((()=>x(e)));return"LAMBDA"!==u[i]&&"LAMBDA_REC"!==u[i]||e.consume(4),s?o.args=s:c.length&&(o.args=c),a&&""!==a[0]?o.annots=a:r&&(o.annots=H(e)),o},B=(e,t)=>(e.consume(4),t.args=new Array(4).fill(0).map((()=>x(e))),e.consume(4),t),F=e=>{const t=new T(I(e)),r=[];for(;t.length()>0;)r.push(x(t));return r},K=e=>{const t=e.map((e=>Buffer.from(e,"utf8").toString("hex"))).join("20"),r=t.length/2;return`${a(r)}${t}`},H=e=>{const t=e.consume(4),r=parseInt(Buffer.from(t).toString("hex"),16),n=e.consume(r);return Buffer.from(n).toString("hex").split("20").map((e=>Buffer.from(e,"hex").toString("utf8")))},G=e=>t=>(0,n.buf2hex)(Buffer.from((0,n.b58cdecode)(t,n.prefix[e]))),$=e=>t=>{const r=t.consume(n.prefixLength[e]);return(0,n.b58cencode)(r,n.prefix[e])},V=$(n.Prefix.TZ1),z=$(n.Prefix.B),q=e=>{const t=e.consume(1);return 0===t[0]?$(n.Prefix.TZ1)(e):1===t[0]?$(n.Prefix.TZ2)(e):2===t[0]?$(n.Prefix.TZ3)(e):void 0},W=G(n.Prefix.B),Z=G(n.Prefix.TZ1),J=e=>e?"ff":"00",Y=e=>G(n.Prefix.P)(e),X=e=>$(n.Prefix.P)(e),Q=e=>{switch(e.substring(0,3)){case n.Prefix.TZ1:return"00"+G(n.Prefix.TZ1)(e);case n.Prefix.TZ2:return"01"+G(n.Prefix.TZ2)(e);case n.Prefix.TZ3:return"02"+G(n.Prefix.TZ3)(e);case n.Prefix.TZ4:return"03"+G(n.Prefix.TZ4)(e);default:throw new n.InvalidKeyHashError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting one for the following "${n.Prefix.TZ1}", "${n.Prefix.TZ2}", "${n.Prefix.TZ3}" or "${n.Prefix.TZ4}".`)}},ee=e=>{const t=[];let r=new o.Z(e,10);if(r.isNaN())throw new TypeError(`Invalid zarith number ${e}`);for(;;){if(r.lt(128)){r.lt(16)&&t.push("0"),t.push(r.toString(16));break}{let e=r.mod(128);r=r.minus(e),r=r.dividedBy(128),e=e.plus(128),t.push(e.toString(16))}}return t.join("")},te=e=>{let t=0;for(;t<e.length()&&0!=(128&e.get(t));)t+=1;let r=new o.Z(0);for(let n=t;n>=0;n-=1){const t=127&e.get(n);r=r.multipliedBy(128),r=r.plus(t)}return e.consume(t+1),new o.Z(r).toString()},re=G(n.Prefix.VH),ne=$(n.Prefix.VH),ie=G(n.Prefix.TXR1),oe=$(n.Prefix.TXR1),se={branch:c.BRANCH,contents:[c.OPERATION]},ae={pkh:c.TZ1,secret:c.SECRET},ce={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,public_key:c.PUBLIC_KEY},ue={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,delegate:c.DELEGATE},le={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,amount:c.ZARITH,destination:c.ADDRESS,parameters:c.PARAMETERS},fe={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,balance:c.ZARITH,delegate:c.DELEGATE,script:c.SCRIPT},de={source:c.PKH,period:c.INT32,proposal:c.PROPOSAL,ballot:c.BALLOT_STATEMENT},he={slot:c.INT16,level:c.INT32,round:c.INT32,block_payload_hash:c.BLOCK_PAYLOAD_HASH},pe={level:c.INT32,nonce:c.RAW},be={source:c.PKH,period:c.INT32,proposals:c.PROPOSAL_ARR},me={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,value:c.VALUE},ge={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,ticket_contents:c.VALUE,ticket_ty:c.VALUE,ticket_ticketer:c.ADDRESS,ticket_amount:c.ZARITH,destination:c.ADDRESS,entrypoint:c.ENTRYPOINT},ve={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,tx_rollup_origination:c.TX_ROLLUP_ORIGINATION_PARAM},ye={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,rollup:c.TX_ROLLUP_ID,content:c.TX_ROLLUP_BATCH_CONTENT,burn_limit:c.BURN_LIMIT},_e={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,amount:c.ZARITH,destination:c.SMART_CONTRACT_ADDRESS},we={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,pk:c.PUBLIC_KEY},Ee={consensus_key:c.PKH,delegate:c.PKH,destination:c.PKH},Oe={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,limit:c.DEPOSITS_LIMIT},Se={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,pvm_kind:c.PVM_KIND,kernel:c.PADDED_BYTES,origination_proof:c.PADDED_BYTES,parameters_ty:c.VALUE},Ae={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,message:c.SMART_ROLLUP_MESSAGE},Pe={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,rollup:c.SMART_ROLLUP_ADDRESS,cemented_commitment:c.SMART_ROLLUP_COMMITMENT_HASH,output_proof:c.PADDED_BYTES},Te={arbitrary:c.PADDED_BYTES},Re=e=>t=>r=>Object.keys(t).reduce(((n,i)=>{const o=t[i];if(r&&Array.isArray(o)){const t=e[o[0]],s=r[i];if(!Array.isArray(s))throw new w(`Invalid operation value "${JSON.stringify(s)}" of key "${i}, expected value to be Array.`);return n+s.reduce(((e,r)=>e+t(r)),"")}return n+(0,e[o])(r[i])}),""),xe=e=>t=>r=>Object.keys(t).reduce(((n,i)=>{const o=t[i];if(Array.isArray(o)){const t=e[o[0]],s=[],a=r.length();for(;r.length()>0;)if(s.push(t(r)),a===r.length())throw new _("Unable to decode value");return Object.assign(Object.assign({},n),{[i]:s})}{const t=(0,e[o])(r);return void 0!==t?Object.assign(Object.assign({},n),{[i]:t}):Object.assign({},n)}}),{}),Ie={[c.SECRET]:e=>s(e.consume(20)),[c.RAW]:e=>s(e.consume(32)),[c.TZ1]:V,[c.BRANCH]:z,[c.ZARITH]:te,[c.PUBLIC_KEY]:e=>{switch(e.consume(1)[0]){case 0:return $(n.Prefix.EDPK)(e);case 1:return $(n.Prefix.SPPK)(e);case 2:return $(n.Prefix.P2PK)(e);default:throw new n.InvalidPublicKeyError(e.toString(),(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED))}},[c.PKH]:q,[c.DELEGATE]:e=>{const t=(e=>255===e.consume(1)[0])(e);if(t)return q(e)},[c.INT32]:e=>{const t=e.consume(4);let r=0;for(let e=0;e<t.length;e++)r|=t[e]<<8*(t.length-(e+1));return r},[c.SCRIPT]:e=>{const t=I(e),r=I(e);return{code:x(new T(t)),storage:x(new T(r))}},[c.BALLOT_STATEMENT]:e=>{const t=e.consume(1);switch(t[0]){case 0:return"yay";case 1:return"nay";case 2:return"pass";default:throw new v(t[0].toString())}},[c.PROPOSAL]:X,[c.PROPOSAL_ARR]:e=>{const t=[];for(e.consume(4);e.length()>0;)t.push(X(e));return t},[c.PARAMETERS]:e=>{if(0!==e.consume(1)[0]){const t=(e=>{const t=a(e.consume(1)[0],2);if(t in h)return h[t];{const t=I(e,1),r=Buffer.from(t).toString("utf8");if(r.length>31)throw new m(r);return r}})(e),r=I(e);return{entrypoint:t,value:x(new T(r))}}},[c.ADDRESS]:e=>{switch(e.consume(1)[0]){case 0:return q(e);case 1:{const t=$(n.Prefix.KT1)(e);return e.consume(1),t}default:throw new i.InvalidAddressError(e.toString(),": Unable to decode.")}},[c.SMART_ROLLUP_ADDRESS]:e=>{const t=$(n.Prefix.SR1)(e);if(t.substring(0,3)!==n.Prefix.SR1)throw new A(t,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SR1}'.`);return t},[c.SMART_CONTRACT_ADDRESS]:e=>{if(1===e.consume(1)[0]){const t=$(n.Prefix.KT1)(e);return e.consume(1),t}throw new i.InvalidContractAddressError(e.toString(),(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED))},[c.SMART_ROLLUP_COMMITMENT_HASH]:e=>{const t=$(n.Prefix.SRC1)(e);if(t.substring(0,4)!==n.Prefix.SRC1)throw new P(t,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SRC1}'`);return t},[c.VALUE]:e=>{const t=I(e);return x(new T(t))},[c.INT16]:e=>{const t=e.consume(2);let r=0;for(let e=0;e<t.length;e++)r|=t[e]<<8*(t.length-(e+1));return r},[c.BLOCK_PAYLOAD_HASH]:ne,[c.ENTRYPOINT]:e=>{const t=I(e);return Buffer.from(t).toString("utf8")},[c.TX_ROLLUP_ORIGINATION_PARAM]:e=>({}),[c.TX_ROLLUP_ID]:oe,[c.TX_ROLLUP_BATCH_CONTENT]:e=>{const t=I(e);return Buffer.from(t).toString("hex")},[c.BURN_LIMIT]:e=>{const t=e.consume(1);if("00"!==Buffer.from(t).toString("hex"))return te(e)},[c.DEPOSITS_LIMIT]:e=>{const t=e.consume(1);if("00"!==Buffer.from(t).toString("hex"))return te(e)},[c.PVM_KIND]:e=>{const t=e.consume(1);switch(t[0]){case 0:return"arith";case 1:return"wasm_2_0_0";default:throw new S(t[0].toString())}},[c.PADDED_BYTES]:e=>{const t=I(e);return Buffer.from(t).toString("hex")},[c.SMART_ROLLUP_MESSAGE]:e=>{const t=I(e);return((e,t=4)=>{const r=[];let n=e;for(;n.length();){const e=n.consume(t),i=parseInt(Buffer.from(e).toString("hex"),16);r.push(n.consume(i)),n=n.slice(i+t)}return r})(new T(t)).map((e=>Buffer.from(e).toString("hex")))}};Ie[c.OPERATION]=(e=>t=>{const r=t.consume(1),n=f[r[0]];if(void 0===n)throw new E(r[0].toString());const i=e[n](t);if("object"!=typeof i)throw new _("Invalid operation, cannot be decoded.");return Object.assign({kind:n},i)})(Ie),Ie[c.OP_ACTIVATE_ACCOUNT]=e=>xe(Ie)(ae)(e),Ie[c.OP_FAILING_NOOP]=e=>xe(Ie)(Te)(e),Ie[c.OP_DELEGATION]=e=>xe(Ie)(ue)(e),Ie[c.OP_TRANSACTION]=e=>xe(Ie)(le)(e),Ie[c.OP_ORIGINATION]=e=>xe(Ie)(fe)(e),Ie[c.OP_BALLOT]=e=>xe(Ie)(de)(e),Ie[c.OP_ENDORSEMENT]=e=>xe(Ie)(he)(e),Ie[c.OP_SEED_NONCE_REVELATION]=e=>xe(Ie)(pe)(e),Ie[c.OP_PROPOSALS]=e=>xe(Ie)(be)(e),Ie[c.OP_REVEAL]=e=>xe(Ie)(ce)(e),Ie[c.OP_REGISTER_GLOBAL_CONSTANT]=e=>xe(Ie)(me)(e),Ie[c.OP_TRANSFER_TICKET]=e=>xe(Ie)(ge)(e),Ie[c.OP_TX_ROLLUP_ORIGINATION]=e=>xe(Ie)(ve)(e),Ie[c.OP_TX_ROLLUP_SUBMIT_BATCH]=e=>xe(Ie)(ye)(e),Ie[c.OP_INCREASE_PAID_STORAGE]=e=>xe(Ie)(_e)(e),Ie[c.OP_UPDATE_CONSENSUS_KEY]=e=>xe(Ie)(we)(e),Ie[c.OP_DRAIN_DELEGATE]=e=>xe(Ie)(Ee)(e),Ie[c.OP_SMART_ROLLUP_ORIGINATE]=e=>xe(Ie)(Se)(e),Ie[c.OP_SMART_ROLLUP_ADD_MESSAGES]=e=>xe(Ie)(Ae)(e),Ie[c.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=e=>xe(Ie)(Pe)(e),Ie[c.MANAGER]=xe(Ie)(se),Ie[c.OP_SET_DEPOSITS_LIMIT]=e=>xe(Ie)(Oe)(e);const Me={[c.SECRET]:e=>e,[c.RAW]:e=>e,[c.TZ1]:Z,[c.BRANCH]:W,[c.ZARITH]:ee,[c.PUBLIC_KEY]:e=>{switch(e.substring(0,4)){case n.Prefix.EDPK:return"00"+G(n.Prefix.EDPK)(e);case n.Prefix.SPPK:return"01"+G(n.Prefix.SPPK)(e);case n.Prefix.P2PK:return"02"+G(n.Prefix.P2PK)(e);default:throw new n.InvalidPublicKeyError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting one of the following '${n.Prefix.EDPK}', '${n.Prefix.SPPK}', '${n.Prefix.P2PK}' or '${n.Prefix.BLPK}'.`)}},[c.PKH]:Q,[c.DELEGATE]:e=>e?J(!0)+Q(e):J(!1),[c.SCRIPT]:e=>{const t=R(e.code),r=R(e.storage);return`${a(t.length/2,8)}${t}${a(r.length/2,8)}${r}`},[c.BALLOT_STATEMENT]:e=>{switch(e){case"yay":return"00";case"nay":return"01";case"pass":return"02";default:throw new g(e)}},[c.PROPOSAL]:Y,[c.PROPOSAL_ARR]:e=>a(32*e.length)+e.map((e=>Y(e))).join(""),[c.INT32]:e=>{const t=parseInt(String(e),10),r=[];for(let e=0;e<4;e++){const n=8*(4-(e+1));r.push((t&255<<n)>>n)}return Buffer.from(r).toString("hex")},[c.PARAMETERS]:e=>{if(!e||"default"===e.entrypoint&&"prim"in e.value&&"Unit"===e.value.prim)return"00";const t=(e=>{if(e in p)return`${p[e]}`;if(e.length>31)throw new m(e);return`ff${R({string:e}).slice(8)}`})(e.entrypoint),r=R(e.value);return`ff${t}${(r.length/2).toString(16).padStart(8,"0")}${r}`},[c.ADDRESS]:e=>{switch(e.substring(0,3)){case n.Prefix.TZ1:case n.Prefix.TZ2:case n.Prefix.TZ3:case n.Prefix.TZ4:return"00"+Q(e);case n.Prefix.KT1:return"01"+G(n.Prefix.KT1)(e)+"00";default:throw new i.InvalidAddressError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting one of the following prefix '${n.Prefix.TZ1}', ${n.Prefix.TZ2}', '${n.Prefix.TZ3}', '${n.Prefix.TZ4}' or '${n.Prefix.KT1}'.`)}},[c.SMART_ROLLUP_ADDRESS]:e=>{if(e.substring(0,3)!==n.Prefix.SR1)throw new A(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SR1}'.`);return G(n.Prefix.SR1)(e)},[c.SMART_CONTRACT_ADDRESS]:e=>{if(e.substring(0,3)===n.Prefix.KT1)return"01"+G(n.Prefix.KT1)(e)+"00";throw new i.InvalidContractAddressError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.KT1}'.`)},[c.SMART_ROLLUP_COMMITMENT_HASH]:e=>{if(e.substring(0,4)===n.Prefix.SRC1)return G(n.Prefix.SRC1)(e);throw new P(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SRC1}'`)},[c.VALUE]:e=>{const t=R(e);return`${a(t.length/2)}${t}`},[c.INT16]:e=>{const t=parseInt(String(e),10),r=[];for(let e=0;e<2;e++){const n=8*(2-(e+1));r.push((t&255<<n)>>n)}return Buffer.from(r).toString("hex")},[c.BLOCK_PAYLOAD_HASH]:re,[c.ENTRYPOINT]:e=>`${R({string:e}).slice(2)}`,[c.TX_ROLLUP_ORIGINATION_PARAM]:e=>"",[c.TX_ROLLUP_ID]:ie,[c.TX_ROLLUP_BATCH_CONTENT]:e=>`${a(e.length/2)}${e}`,[c.BURN_LIMIT]:e=>e?`ff${ee(e)}`:"00",[c.DEPOSITS_LIMIT]:e=>e?`ff${ee(e)}`:"00",[c.PVM_KIND]:e=>{switch(e){case"arith":return"00";case"wasm_2_0_0":return"01";default:throw new O(e)}},[c.PADDED_BYTES]:(e,t=8)=>`${a(e.length/2,t)}${e}`,[c.SMART_ROLLUP_MESSAGE]:e=>{const t=e.reduce(((e,t)=>e+`${a(t.length/2)}${t}`),"");return`${a(t.length/2)}${t}`}};Me[c.OPERATION]=(e=>t=>{if(!(t.kind in e)||!(t.kind in d))throw new i.InvalidOperationKindError(t.kind);return d[t.kind]+e[t.kind](t)})(Me),Me[c.OP_ACTIVATE_ACCOUNT]=e=>Re(Me)(ae)(e),Me[c.OP_DELEGATION]=e=>Re(Me)(ue)(e),Me[c.OP_TRANSACTION]=e=>Re(Me)(le)(e),Me[c.OP_ORIGINATION]=e=>Re(Me)(fe)(e),Me[c.OP_BALLOT]=e=>Re(Me)(de)(e),Me[c.OP_ENDORSEMENT]=e=>Re(Me)(he)(e),Me[c.OP_SEED_NONCE_REVELATION]=e=>Re(Me)(pe)(e),Me[c.OP_PROPOSALS]=e=>Re(Me)(be)(e),Me[c.OP_REVEAL]=e=>Re(Me)(ce)(e),Me[c.OP_REGISTER_GLOBAL_CONSTANT]=e=>Re(Me)(me)(e),Me[c.OP_TRANSFER_TICKET]=e=>Re(Me)(ge)(e),Me[c.OP_TX_ROLLUP_ORIGINATION]=e=>Re(Me)(ve)(e),Me[c.OP_TX_ROLLUP_SUBMIT_BATCH]=e=>Re(Me)(ye)(e),Me[c.OP_INCREASE_PAID_STORAGE]=e=>Re(Me)(_e)(e),Me[c.OP_UPDATE_CONSENSUS_KEY]=e=>Re(Me)(we)(e),Me[c.OP_DRAIN_DELEGATE]=e=>Re(Me)(Ee)(e),Me[c.OP_SMART_ROLLUP_ORIGINATE]=e=>Re(Me)(Se)(e),Me[c.OP_SMART_ROLLUP_ADD_MESSAGES]=e=>Re(Me)(Ae)(e),Me[c.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=e=>Re(Me)(Pe)(e),Me[c.MANAGER]=Re(Me)(se),Me[c.OP_SET_DEPOSITS_LIMIT]=e=>Re(Me)(Oe)(e),Me[c.OP_FAILING_NOOP]=e=>Re(Me)(Te)(e);const Le={activate_account:ae,reveal:ce,delegation:ue,transaction:le,origination:fe,ballot:de,endorsement:he,seed_nonce_revelation:pe,proposals:be,register_global_constant:me,transfer_ticket:ge,tx_rollup_origination:ve,tx_rollup_submit_batch:ye,increase_paid_storage:_e,update_consensus_key:we,drain_delegate:Ee,set_deposits_limit:Oe,smart_rollup_originate:Se,smart_rollup_add_messages:Ae,smart_rollup_execute_outbox_message:Pe,failing_noop:Te},ke=e=>{const t=e.kind,r=Object.keys(e),n=(i="kind",r.filter((e=>e!==i)));var i;const o=Object.keys(Le[t]);return s=n,o.filter((e=>!s.includes(e)));var s};var Ne;!function(e){e.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",e.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",e.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",e.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",e.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",e.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",e.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",e.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",e.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",e.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",e.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",e.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",e.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",e.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",e.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(Ne||(Ne={}));const Ce={commitHash:"e1b1d6976a564f925c01cf66e28df9acb0085c3d",version:"17.3.1-beta-RC.0"},je=Ne.PtMumbai2;function De(e,t){return{encoder:Me[e],decoder:t=>{const r=T.fromHexString(t);return Ie[e](r)}}}class Ue{constructor(e=je){this.protocolHash=e,this.codec=De(c.MANAGER,this.protocolHash)}forge(e){const t=(0,n.validateBlock)(e.branch);if(t!==n.ValidationResult.VALID)throw new i.InvalidBlockHashError(e.branch,(0,n.invalidDetail)(t));for(const t of e.contents){if(r=t.kind,!Object.keys(Le).includes(r))throw new i.InvalidOperationKindError(t.kind);const e=ke(t);if(1===e.length){if("delegation"===t.kind&&"delegate"===e[0])continue;if("origination"===t.kind&&"delegate"===e[0])continue;if("transaction"===t.kind&&"parameters"===e[0])continue;if("set_deposits_limit"===t.kind&&"limit"===e[0])continue;if("tx_rollup_submit_batch"===t.kind&&"burn_limit"===e[0])continue;throw new b(t,`missing properties "${e.join(", ")}"`)}if(e.length>1)throw new b(t,`missing properties "${e.join(", ")}"`)}var r;const o=this.codec.encoder(e).toLowerCase();return Promise.resolve(o)}parse(e){return Promise.resolve(this.codec.decoder(e))}}const Be=new Ue},9985:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Contract:()=>nr,DefaultProtocol:()=>b,JSONParseError:()=>j,MacroError:()=>y,MichelineParseError:()=>C,MichelsonError:()=>ue,MichelsonInstructionError:()=>Ct,MichelsonTypeError:()=>fe,MichelsonValidationError:()=>Le,Parser:()=>K,ProtoGreaterOrEqual:()=>g,ProtoInferiorTo:()=>v,Protocol:()=>p,VERSION:()=>cr,assertContractValid:()=>Zt,assertDataListIfAny:()=>ot,assertDataValid:()=>Jt,assertMichelsonBigMapStorableType:()=>qe,assertMichelsonComparableType:()=>He,assertMichelsonContract:()=>Qe,assertMichelsonData:()=>Xe,assertMichelsonInstruction:()=>Ke,assertMichelsonPackableType:()=>Ge,assertMichelsonPassableType:()=>ze,assertMichelsonPushableType:()=>$e,assertMichelsonStorableType:()=>Ve,assertMichelsonType:()=>Je,assertTypeAnnotationsValid:()=>Ft,assertTypesEqual:()=>Xt,assertViewNameValid:()=>Ze,contractEntryPoint:()=>qt,contractEntryPoints:()=>Wt,contractSection:()=>$t,contractViews:()=>Vt,decodeAddressBytes:()=>Lt,decodePublicKeyBytes:()=>Nt,decodePublicKeyHashBytes:()=>kt,dummyContract:()=>ir,emitMicheline:()=>z,formatError:()=>ar,formatStack:()=>or,functionType:()=>Yt,instructionIDs:()=>xe,isContractValid:()=>er,isDataValid:()=>tr,isInstruction:()=>it,isMichelsonCode:()=>rt,isMichelsonData:()=>tt,isMichelsonError:()=>le,isMichelsonScript:()=>et,isMichelsonType:()=>nt,isTypeAnnotationsValid:()=>Qt,isTypeEqual:()=>rr,packData:()=>Pt,packDataBytes:()=>Tt,refContract:()=>h,sourceReference:()=>i,traceDumpFunc:()=>sr,unpackData:()=>It,unpackDataBytes:()=>Mt});var n=r(227);const i=Symbol("source_reference");class o extends n.TaquitoError{constructor(e,t,r){super(),this.src=e,this.idx=t,this.message=r,this.name="ScanError"}}var s;!function(e){e[e.Comment=0]="Comment",e[e.Number=1]="Number",e[e.String=2]="String",e[e.Bytes=3]="Bytes",e[e.Ident=4]="Ident"}(s||(s={}));const a=new RegExp("\\s"),c=new RegExp("[:@%_A-Za-z]"),u=new RegExp("[@%_\\.A-Za-z0-9]"),l=new RegExp("[0-9]"),f=new RegExp("[0-9a-fA-F]");function*d(e,t=!1){let r=0;for(;r<e.length;){for(;r<e.length&&a.test(e[r]);)r++;if(r===e.length)return;const n=e[r],i=r;if(c.test(n)){for(r++;r<e.length&&u.test(e[r]);)r++;yield{t:s.Ident,v:e.slice(i,r),first:i,last:r}}else if(e.length-r>1&&"0x"===e.substring(r,r+2)){for(r+=2;r<e.length&&f.test(e[r]);)r++;if(0!=(r-i&1))throw new o(e,r,"Bytes literal length is expected to be power of two");yield{t:s.Bytes,v:e.slice(i,r),first:i,last:r}}else if(l.test(n)||"-"===n){"-"===n&&r++;const t=r;for(;r<e.length&&l.test(e[r]);)r++;if(t===r)throw new o(e,r,"Number literal is too short");yield{t:s.Number,v:e.slice(i,r),first:i,last:r}}else if('"'===n){r++;let t=!1;for(;r<e.length&&(t||'"'!==e[r]);r++)t=!t&&"\\"===e[r];if(r===e.length)throw new o(e,r,"Unterminated string literal");r++,yield{t:s.String,v:e.slice(i,r),first:i,last:r}}else if("#"===n){for(r++;r<e.length&&"\n"!==e[r];)r++;t&&(yield{t:s.Comment,v:e.slice(i,r),first:i,last:r})}else if(e.length-r>1&&"/*"===e.substring(r,r+2)){for(r+=2;r<e.length&&!(e.length-r>1&&"*/"===e.substring(r,r+2));)r++;if(r===e.length)throw new o(e,r,"Unterminated C style comment");r+=2,t&&(yield{t:s.Comment,v:e.slice(i,r),first:i,last:r})}else{if("("!==n&&")"!==n&&"{"!==n&&"}"!==n&&";"!==n)throw new o(e,r,`Invalid character at offset ${r}: \`${n}'`);r++,yield{t:n,v:n,first:i,last:r}}}}const h=Symbol("ref_contract");var p;!function(e){e.Ps9mPmXa="Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P",e.PtCJ7pwo="PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY",e.PsYLVpVv="PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",e.PsddFKi3="PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",e.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",e.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",e.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",e.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",e.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",e.PtEdoTez="PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq",e.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",e.PsFLoren="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PtGRANAD="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtHangzH="PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r",e.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",e.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",e.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",e.PtJakarta="PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw",e.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",e.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",e.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",e.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",e.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",e.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",e.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(p||(p={}));const b=p.Psithaca2,m={Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P:0,PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY:1,PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt:2,PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP:3,Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd:4,PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU:5,PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS:5,PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb:6,PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo:7,PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq:8,PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA:8,PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i:9,PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV:10,PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r:11,PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx:11,PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP:12,Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A:12,PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw:13,PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY:13,PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg:14,PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW:15,PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc:16,PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1:16,PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf:17,ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK:18};function g(e,t){return m[e]>=m[t]}function v(e,t){return m[e]<m[t]}class y extends n.TaquitoError{constructor(e,t){super(),this.prim=e,this.message=t,this.name="MacroError"}}function _(e,t){var r,n;if(0===t&&void 0===e.args||(null===(r=e.args)||void 0===r?void 0:r.length)===t)return!0;throw new y(e,`macro ${e.prim} expects ${t} arguments, was given ${null===(n=e.args)||void 0===n?void 0:n.length}`)}function w(e){if(void 0===e.annots)return!0;throw new y(e,`unexpected annotation on macro ${e.prim}: ${e.annots}`)}function E(e,t){if("int"in t)return!0;throw new y(e,`macro ${e.prim} expects int argument`)}function O(e,t,r,n){let i=0,o=0;const s=[null,null];let a;if(i===t.length)throw new y(e,`unexpected end: ${e.prim}`);let c,u=t[i++];switch(u){case"P":{const{r:s,n:c,an:u}=O(e,t.slice(i),r.slice(o),n);a=s,i+=c,o+=u;break}case"A":o!==r.length&&(s[0]=r[o++]);break;default:throw new y(e,`${e.prim}: unexpected character: ${u}`)}if(i===t.length)throw new y(e,`unexpected end: ${e.prim}`);switch(u=t[i++],u){case"P":{const{r:s,n:a,an:u}=O(e,t.slice(i),r.slice(o),n);c=s.map((([e,t])=>[e+1,t])),i+=a,o+=u;break}case"I":o!==r.length&&(s[1]=r[o++]);break;default:throw new y(e,`${e.prim}: unexpected character: ${u}`)}return{r:n(a,c,[0,s]),n:i,an:o}}function S(e,t,r,n){const i=t[0];switch(i){case"A":return t.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CAR",annots:["@%%"]},S(e,t.slice(1),[],n)]]},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%@","%@",...r]}]:n.a;case"D":return t.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CDR",annots:["@%%"]},S(e,t.slice(1),[],n)]]},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%@",...r]}]:n.d;default:throw new y(e,`${e.prim}: unexpected character: ${i}`)}}function A(e,t){let r=e.length;for(;r>0&&e[r-1]===t;)r--;return e.slice(0,r)}function P(e){const t=[],r=[];if(void 0!==e)for(const n of e)(0!==n.length&&"%"===n[0]?t:r).push(n);return{fields:t,rest:r}}function T({prim:e,annots:t,args:r}){return Object.assign(Object.assign({prim:e},t&&{annots:t}),r&&{args:r})}const R=/^P[PAI]{3,}R$/,x=/^UNP[PAI]{2,}R$/,I=/^C[AD]{2,}R$/,M=/^SET_C[AD]+R$/,L=/^MAP_C[AD]+R$/,k=/^DI{2,}P$/,N=/^DU+P$/;class C extends n.TaquitoError{constructor(e,t){super(),this.token=e,this.message=t,this.name="MichelineParseError"}}class j extends n.TaquitoError{constructor(e,t){super(),this.node=e,this.message=t,this.name="JSONParseError"}}const D=new C(null,"Unexpected EOF");function U(e){return e.t===s.Ident&&("@"===e.v[0]||"%"===e.v[0]||":"===e.v[0])}const B=new RegExp("^-?[0-9]+$"),F=new RegExp("^([0-9a-fA-F]{2})*$");class K{constructor(e){this.opt=e}expand(e){var t,r,n;if(void 0!==(null===(t=this.opt)||void 0===t?void 0:t.expandGlobalConstant)&&"constant"===e.prim){const t=function(e,t){return void 0!==e.args&&1===e.args.length&&"string"in e.args[0]&&e.args[0].string in t?t[e.args[0].string]:e}(e,this.opt.expandGlobalConstant);return t!==e&&(t[i]=Object.assign(Object.assign({},e[i]||{first:0,last:0}),{globalConstant:e})),t}if(void 0===(null===(r=this.opt)||void 0===r?void 0:r.expandMacros)||(null===(n=this.opt)||void 0===n?void 0:n.expandMacros)){const t=function(e,t){const r=(null==t?void 0:t.protocol)||b;function n(e){return void 0!==e?[{prim:"RENAME",annots:e}]:[]}switch(e.prim){case"CMPEQ":case"CMPNEQ":case"CMPLT":case"CMPGT":case"CMPLE":case"CMPGE":if(_(e,0))return[{prim:"COMPARE"},T({prim:e.prim.slice(3),annots:e.annots})];break;case"IFEQ":case"IFNEQ":case"IFLT":case"IFGT":case"IFLE":case"IFGE":if(_(e,2))return[{prim:e.prim.slice(2)},T({prim:"IF",annots:e.annots,args:e.args})];break;case"IFCMPEQ":case"IFCMPNEQ":case"IFCMPLT":case"IFCMPGT":case"IFCMPLE":case"IFCMPGE":if(_(e,2))return[{prim:"COMPARE"},{prim:e.prim.slice(5)},T({prim:"IF",annots:e.annots,args:e.args})];break;case"FAIL":if(_(e,0)&&w(e))return[{prim:"UNIT"},{prim:"FAILWITH"}];break;case"ASSERT":if(_(e,0)&&w(e))return[{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_EQ":case"ASSERT_NEQ":case"ASSERT_LT":case"ASSERT_GT":case"ASSERT_LE":case"ASSERT_GE":if(_(e,0)&&w(e))return[{prim:e.prim.slice(7)},{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_CMPEQ":case"ASSERT_CMPNEQ":case"ASSERT_CMPLT":case"ASSERT_CMPGT":case"ASSERT_CMPLE":case"ASSERT_CMPGE":if(_(e,0)&&w(e))return[[{prim:"COMPARE"},{prim:e.prim.slice(10)}],{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_NONE":if(_(e,0)&&w(e))return[{prim:"IF_NONE",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_SOME":if(_(e,0))return[{prim:"IF_NONE",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],n(e.annots)]}];break;case"ASSERT_LEFT":if(_(e,0))return[{prim:"IF_LEFT",args:[n(e.annots),[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_RIGHT":if(_(e,0))return[{prim:"IF_LEFT",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],n(e.annots)]}];break;case"IF_SOME":if(_(e,2))return[T({prim:"IF_NONE",annots:e.annots,args:[e.args[1],e.args[0]]})];break;case"IF_RIGHT":if(_(e,2))return[T({prim:"IF_LEFT",annots:e.annots,args:[e.args[1],e.args[0]]})];break;case"CAR":case"CDR":if(void 0===e.args)return e;if(_(e,1)&&E(e,e.args[0])){const t=parseInt(e.args[0].int,10);return T({prim:"GET",args:[{int:"CAR"===e.prim?String(2*t+1):String(2*t)}],annots:e.annots})}}if(R.test(e.prim)&&_(e,0)){const{fields:t,rest:r}=P(e.annots),{r:n}=O(e,e.prim.slice(1),t,((e,t,r)=>[...e||[],...t||[],r]));return n.map((([e,t],i)=>{const o=[...A(t,null).map((e=>null===e?"%":e)),...0===e&&i===n.length-1?r:[]],s=T({prim:"PAIR",annots:0!==o.length?o:void 0});return 0===e?s:{prim:"DIP",args:1===e?[[s]]:[{int:String(e)},[s]]}}))}if(x.test(e.prim)){if(v(r,p.PtEdo2Zk)&&_(e,0)){const{r:t}=O(e,e.prim.slice(3),e.annots||[],((e,t,r)=>[r,...t||[],...e||[]]));return t.map((([e,t])=>{const r=[{prim:"DUP"},T({prim:"CAR",annots:null!==t[0]?[t[0]]:void 0}),{prim:"DIP",args:[[T({prim:"CDR",annots:null!==t[1]?[t[1]]:void 0})]]}];return 0===e?r:{prim:"DIP",args:1===e?[[r]]:[{int:String(e)},[r]]}}))}if("UNPAIR"===e.prim)return e;if(_(e,0)){const{r:t}=O(e,e.prim.slice(3),[],((e,t,r)=>[r,...t||[],...e||[]]));return t.map((([e])=>{const t=T({prim:"UNPAIR"});return 0===e?t:{prim:"DIP",args:1===e?[[t]]:[{int:String(e)},[t]]}}))}}if(I.test(e.prim)&&_(e,0)){const t=[...e.prim.slice(1,e.prim.length-1)];return t.map(((r,n)=>{const i=n===t.length-1?e.annots:void 0;switch(r){case"A":return T({prim:"CAR",annots:i});case"D":return T({prim:"CDR",annots:i});default:throw new y(e,`unexpected character: ${r}`)}}))}if(M.test(e.prim)&&_(e,0)){const{fields:t,rest:r}=P(e.annots);if(t.length>1)throw new y(e,`unexpected annotation on macro ${e.prim}: ${t}`);const n=0!==t.length?{a:[{prim:"DUP"},{prim:"CAR",annots:t},{prim:"DROP"},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:[t[0],"%@"]}],d:[{prim:"DUP"},{prim:"CDR",annots:t},{prim:"DROP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",t[0]]}]}:{a:[{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%","%@"]}],d:[{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%"]}]};return S(e,e.prim.slice(5,e.prim.length-1),r,n)}if(L.test(e.prim)&&_(e,1)){const{fields:t}=P(e.annots);if(t.length>1)throw new y(e,`unexpected annotation on macro ${e.prim}: ${t}`);const r={a:[{prim:"DUP"},{prim:"CDR",annots:["@%%"]},{prim:"DIP",args:[[T({prim:"CAR",annots:0!==t.length?["@"+t[0].slice(1)]:void 0}),e.args[0]]]},{prim:"SWAP"},{prim:"PAIR",annots:[0!==t.length?t[0]:"%","%@"]}],d:[{prim:"DUP"},T({prim:"CDR",annots:0!==t.length?["@"+t[0].slice(1)]:void 0}),e.args[0],{prim:"SWAP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",0!==t.length?t[0]:"%"]}]};return S(e,e.prim.slice(5,e.prim.length-1),[],r)}if(k.test(e.prim)&&_(e,1)){let t=0;for(;"I"===e.prim[1+t];)t++;return T({prim:"DIP",args:[{int:String(t)},e.args[0]]})}if(N.test(e.prim)){let t=0;for(;"U"===e.prim[1+t];)t++;if(v(r,p.PtEdo2Zk)){if(1===t){if(void 0===e.args)return e;_(e,1)&&E(e,e.args[0])&&(t=parseInt(e.args[0].int,10))}else _(e,0);return 1===t?[T({prim:"DUP",annots:e.annots})]:2===t?[{prim:"DIP",args:[[T({prim:"DUP",annots:e.annots})]]},{prim:"SWAP"}]:[{prim:"DIP",args:[{int:String(t-1)},[T({prim:"DUP",annots:e.annots})]]},{prim:"DIG",args:[{int:String(t)}]}]}if(1===t)return e;if(_(e,0))return T({prim:"DUP",args:[{int:String(t)}],annots:e.annots})}return e}(e,this.opt);return t!==e&&(t[i]=Object.assign(Object.assign({},e[i]||{first:0,last:0}),{macro:e})),t}return e}parseListExpr(e,t){var r;const n={first:t.first,last:t.last},o="("===t.t;let a;if(o){if(a=e.next(),a.done)throw D;n.last=a.value.last}else a={value:t};if(a.value.t!==s.Ident)throw new C(a.value,`not an identifier: ${a.value.v}`);const c={prim:a.value.v,[i]:n};for(;;){const t=e.next();if(t.done){if(o)throw D;break}if(")"===t.value.t){if(!o)throw new C(t.value,"unexpected closing bracket");n.last=t.value.last;break}if(U(t.value))c.annots=c.annots||[],c.annots.push(t.value.v),n.last=t.value.last;else{c.args=c.args||[];const o=this.parseExpr(e,t.value);n.last=(null===(r=o[i])||void 0===r?void 0:r.last)||n.last,c.args.push(o)}}return this.expand(c)}parseArgs(e,t){var r;const n={first:t.first,last:t.last},o={prim:t.v,[i]:n};for(;;){const t=e.next();if(t.done||"}"===t.value.t||";"===t.value.t)return[o,t];if(U(t.value))n.last=t.value.last,o.annots=o.annots||[],o.annots.push(t.value.v);else{const s=this.parseExpr(e,t.value);n.last=(null===(r=s[i])||void 0===r?void 0:r.last)||n.last,o.args=o.args||[],o.args.push(s)}}}parseSequenceExpr(e,t){var r,n;const o={first:t.first,last:t.last},a=[];a[i]=o;const c="{"===t.t;let u="{"===t.t?null:{value:t};for(;;){if(null===u&&(u=e.next(),u.done||(o.last=u.value.last)),u.done){if(c)throw D;return a}if("}"===u.value.t){if(c)return a;throw new C(u.value,"unexpected closing bracket")}if(u.value.t===s.Ident){const[t,n]=this.parseArgs(e,u.value);o.last=(null===(r=t[i])||void 0===r?void 0:r.last)||o.last,a.push(this.expand(t)),u=n}else{const t=this.parseExpr(e,u.value);o.last=(null===(n=t[i])||void 0===n?void 0:n.last)||o.last,a.push(t),u=null}null===u&&(u=e.next(),u.done||(o.last=u.value.last)),u.done||";"!==u.value.t||(u=null)}}parseExpr(e,t){switch(t.t){case s.Ident:return this.expand({prim:t.v,[i]:{first:t.first,last:t.last}});case s.Number:return{int:t.v,[i]:{first:t.first,last:t.last}};case s.String:return{string:JSON.parse(t.v),[i]:{first:t.first,last:t.last}};case s.Bytes:return{bytes:t.v.slice(2),[i]:{first:t.first,last:t.last}};case"{":return this.parseSequenceExpr(e,t);default:return this.parseListExpr(e,t)}}parseSequence(e){if("string"!=typeof e)throw new TypeError(`string type was expected, got ${typeof e} instead`);const t=d(e),r=t.next();return r.done?null:this.parseSequenceExpr(t,r.value)}parseList(e){if("string"!=typeof e)throw new TypeError(`string type was expected, got ${typeof e} instead`);const t=d(e),r=t.next();return r.done?null:this.parseListExpr(t,r.value)}parseMichelineExpression(e){if("string"!=typeof e)throw new TypeError(`string type was expected, got ${typeof e} instead`);const t=d(e),r=t.next();return r.done?null:this.parseExpr(t,r.value)}parseScript(e){return this.parseSequence(e)}parseData(e){return this.parseList(e)}parseJSON(e){if("object"!=typeof e)throw new TypeError(`object type was expected, got ${typeof e} instead`);if(Array.isArray(e)){const t=[];for(const r of e){if(null===r||"object"!=typeof r)throw new j(r,`unexpected sequence element: ${r}`);t.push(this.parseJSON(r))}return t}if("prim"in e){const t=e;if("string"==typeof t.prim&&(void 0===t.annots||Array.isArray(t.annots))&&(void 0===t.args||Array.isArray(t.args))){const e={prim:t.prim};if(void 0!==t.annots){for(const e of t.annots)if("string"!=typeof e)throw new j(e,`string expected: ${e}`);e.annots=t.annots}if(void 0!==t.args){e.args=[];for(const r of t.args){if(null===r||"object"!=typeof r)throw new j(r,`unexpected argument: ${r}`);e.args.push(this.parseJSON(r))}}return this.expand(e)}throw new j(e,`malformed prim expression: ${e}`)}if("string"in e){if("string"==typeof e.string)return{string:e.string};throw new j(e,`malformed string literal: ${e}`)}if("int"in e){if("string"==typeof e.int&&B.test(e.int))return{int:e.int};throw new j(e,`malformed int literal: ${e}`)}if("bytes"in e){if("string"==typeof e.bytes&&F.test(e.bytes))return{bytes:e.bytes};throw new j(e,`malformed bytes literal: ${e}`)}throw new j(e,`unexpected object: ${e}`)}}class H{constructor(e,t=0){this.opt=e,this.lev=t}indent(e=0){var t;let r="";if(void 0!==(null===(t=this.opt)||void 0===t?void 0:t.indent))for(let t=this.lev+e;t>0;t--)r+=this.opt.indent;return r}get lf(){var e;return(null===(e=this.opt)||void 0===e?void 0:e.newline)||""}get lfsp(){var e;return(null===(e=this.opt)||void 0===e?void 0:e.newline)||" "}down(e){return new H(this.opt,this.lev+e)}}function G(e){return"prim"in e&&(void 0!==e.annots&&0!==e.annots.length||void 0!==e.args&&0!==e.args.length)}function $(e){if(void 0!==e.args)for(const t of e.args)if(Array.isArray(t)||G(t))return!0;return!1}function V(e,t,r){var n;const o=null===(n=e[i])||void 0===n?void 0:n.macro;if(r&&o)return V(o,t,r);if(Array.isArray(e))return function(e,t,r){let n="{"+t.lf,i=e.length;for(const o of e){if(n+=t.indent(1),"prim"in o){if(n+=o.prim,void 0!==o.annots)for(const e of o.annots)n+=" "+e;if(void 0!==o.args){const e=$(o);for(const i of o.args)n+=e?t.lfsp+t.indent(2)+V(i,t.down(2),r):" "+V(i,t,r)}}else n+=V(o,t.down(1),r);n+=i>1?";"+t.lfsp:t.lf,i--}return n+t.indent()+"}"}(e,t,r);if("string"in e)return JSON.stringify(e.string);if("int"in e)return e.int;if("bytes"in e)return"0x"+e.bytes;{if(!(void 0!==e.annots&&0!==e.annots.length||void 0!==e.args&&0!==e.args.length))return e.prim;let n="("+e.prim;if(void 0!==e.annots)for(const t of e.annots)n+=" "+t;if(void 0!==e.args){const i=$(e);for(const o of e.args)n+=i?t.lfsp+t.indent(1)+V(o,t.down(1),r):" "+V(o,t,r)}return n+")"}}function z(e,t,r=!1){if("object"!=typeof e)throw new TypeError(`object type was expected, got ${typeof e} instead`);return V(e,new H(t),r)}const q=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],W=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998];class Z extends n.TaquitoError{constructor(e){super(),this.message=e,this.name="Base58DecodingError"}}function J(e){const t=(e.length+9)%64,r=0===t?0:64-t;if(e.length>268435455)throw new n.InvalidMessageError("",`: Invalid length ${e.length} is too big -- SHA-256.`);const i=e.length<<3,o=[...e,128,...new Array(r).fill(0),0,0,0,0,i>>24&255,i>>16&255,i>>8&255,255&i];function s(e,t){return e>>>t|e<<32-t}const a=[...q],c=new Array(64),u=new Array(8);for(let e=0;e<o.length;e+=64){let t=e,r=0;for(;r<16;)c[r]=o[t]<<24|o[t+1]<<16|o[t+2]<<8|o[t+3],t+=4,r++;for(;r<64;){const e=s(c[r-15],7)^s(c[r-15],18)^c[r-15]>>>3,t=s(c[r-2],17)^s(c[r-2],19)^c[r-2]>>>10;c[r]=(0|t)+c[r-7]+e+c[r-16]|0,r++}for(let e=0;e<8;e++)u[e]=a[e];for(let e=0;e<64;e++){const t=s(u[0],2)^s(u[0],13)^s(u[0],22),r=s(u[4],6)^s(u[4],11)^s(u[4],25),n=u[7]+r+(u[4]&u[5]^~u[4]&u[6])+W[e]+c[e]|0,i=t+(u[0]&u[1]^u[0]&u[2]^u[1]&u[2])|0;u[7]=u[6],u[6]=u[5],u[5]=u[4],u[4]=u[3]+n|0,u[3]=u[2],u[2]=u[1],u[1]=u[0],u[0]=n+i|0}for(let e=0;e<8;e++)a[e]=a[e]+u[e]|0}const l=[];for(const e of a)l.push(e>>24&255),l.push(e>>16&255),l.push(e>>8&255),l.push(255&e);return l}const Y=[0,1,2,3,4,5,6,7,8,-1,-1,-1,-1,-1,-1,-1,9,10,11,12,13,14,15,16,-1,17,18,19,20,21,-1,22,23,24,25,26,27,28,29,30,31,32,-1,-1,-1,-1,-1,-1,33,34,35,36,37,38,39,40,41,42,43,-1,44,45,46,47,48,49,50,51,52,53,54,55,56,57],X=[0,1,2,3,4,5,6,7,8,16,17,18,19,20,21,22,23,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,48,49,50,51,52,53,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73];function Q(e,t){const r=e.charCodeAt(t)-49;if(r>=Y.length||-1===Y[r])throw new Z(`Unexpected character at position ${t}: ${e[t]}`);return Y[r]}function ee(e){const t=function(e){const t=[];let r=0;for(;r<e.length&&0===Q(e,r);)r++;let n=r;for(;r<e.length;){let n=Q(e,r++),i=0;for(;0!==n||i<t.length;){const e=58*(t[i]||0)+n;t[i++]=e%256,n=Math.floor(e/256)}}for(;n-- >0;)t.push(0);return t.reverse()}(e);if(t.length<4)throw new Z(`Data is too short ${t.length}`);const r=t.slice(0,t.length-4),n=t.slice(t.length-4),i=J(J(r));if(n[0]!==i[0]||n[1]!==i[1]||n[2]!==i[2]||n[3]!==i[3])throw new Z("Invalid checksum");return r}function te(e){const t=J(J(e));return function(e){const t=[];let r=0;for(;r<e.length&&0===e[r];)r++;let n=r;for(;r<e.length;){let n=e[r++],i=0;for(;0!==n||i<t.length;){const e=256*(t[i]||0)+n;t[i++]=e%58,n=Math.floor(e/58)}}for(;n-- >0;)t.push(0);return t.reverse(),String.fromCharCode(...t.map((e=>X[e]+49)))}([...e,...t.slice(0,4)])}class re extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidMichelsonError"}}class ne extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidTypeExpressionError"}}class ie extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidDataExpressionError"}}class oe extends n.ParameterValidationError{constructor(e){super(),this.entrypoint=e,this.name="InvalidEntrypointError",this.message=`Contract has no entrypoint named: "${e}"`}}class se extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="TezosIdEncodeError"}}class ae extends n.TaquitoError{constructor(e){super(),this.message=e,this.name="LongIntegerError"}}class ce extends n.TaquitoError{constructor(e){super(),this.hexByte=e,this.name="HexParseError",this.message=`Unable to parse hex byte "${e}"`}}class ue extends n.TaquitoError{constructor(e,t){super(),this.val=e,this.message=t,this.name="MichelsonError"}}function le(e){return e instanceof ue}class fe extends ue{constructor(e,t,r){super(e,t),this.val=e,this.message=t,this.name="MichelsonTypeError",void 0!==r&&(this.data=r)}}class de{constructor(e){if(this.neg=!1,this.buf=[],void 0!==e)if("string"==typeof e)for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(0===t&&45===r)this.neg=!0;else{if(r<48||r>57)throw new ae(`unexpected character in integer constant "${e[t]}"`);this.append(r-48)}}else e<0?(this.neg=!0,this.append(-e)):this.append(e)}append(e){let t=0;for(;0!==e||t<this.buf.length;){const r=10*(this.buf[t]||0)+e;this.buf[t++]=r%256,e=Math.floor(r/256)}}cmp(e){if(this.neg!==e.neg)return(e.neg?1:0)-(this.neg?1:0);{let t=0;if(this.buf.length!==e.buf.length)t=this.buf.length<e.buf.length?-1:1;else if(0!==this.buf.length){let r=e.buf.length-1;for(;r>=0&&this.buf[r]===e.buf[r];)r--;t=r<0?0:this.buf[r]<e.buf[r]?-1:1}return this.neg?0===t?0:-t:t}}get sign(){return 0===this.buf.length?0:this.neg?-1:1}}function he(e){const t=[];for(let r=0;r<e.length;r+=2){const n=parseInt(e.slice(r,r+2),16);if(Number.isNaN(n))return null;t.push(n)}return t}function pe(e){try{return new de(e),!0}catch(e){return!1}}function be(e){try{return new de(e).sign>=0}catch(e){return!1}}const me=/^(@%|@%%|%@|[@:%]([_0-9a-zA-Z][_0-9a-zA-Z.%@]*)?)$/;function ge(e,t){if(Array.isArray(e))return{};let r,n,i;if(void 0!==e.annots)for(const o of e.annots)if(0!==o.length){if(!me.test(o)||!(null==t?void 0:t.specialVar)&&("@%"===o||"@%%"===o)||!(null==t?void 0:t.specialFields)&&"%@"===o)throw new ue(e,`${e.prim}: unexpected annotation: ${o}`);switch(o[0]){case"%":((null==t?void 0:t.emptyFields)||o.length>1)&&(r=r||[],r.push(o));break;case":":o.length>1&&(n=n||[],n.push(o));break;case"@":((null==t?void 0:t.emptyVar)||o.length>1)&&(i=i||[],i.push(o))}}return{f:r,t:n,v:i}}const ve={BlockHash:[32,[1,52]],OperationHash:[32,[5,116]],OperationListHash:[32,[133,233]],OperationListListHash:[32,[29,159,109]],ProtocolHash:[32,[2,170]],ContextHash:[32,[79,199]],ED25519PublicKeyHash:[20,[6,161,159]],SECP256K1PublicKeyHash:[20,[6,161,161]],P256PublicKeyHash:[20,[6,161,164]],ContractHash:[20,[2,90,121]],CryptoboxPublicKeyHash:[16,[153,103]],ED25519Seed:[32,[13,15,58,7]],ED25519PublicKey:[32,[13,15,37,217]],SECP256K1SecretKey:[32,[17,162,224,201]],P256SecretKey:[32,[16,81,238,189]],ED25519EncryptedSeed:[56,[7,90,60,179,41]],SECP256K1EncryptedSecretKey:[56,[9,237,241,174,150]],P256EncryptedSecretKey:[56,[9,48,57,115,171]],SECP256K1PublicKey:[33,[3,254,226,86]],P256PublicKey:[33,[3,178,139,127]],SECP256K1Scalar:[33,[38,248,136]],SECP256K1Element:[33,[5,92,0]],ED25519SecretKey:[64,[43,246,78,7]],ED25519Signature:[64,[9,245,205,134,18]],SECP256K1Signature:[64,[13,115,101,19,63]],P256Signature:[64,[54,240,44,52]],GenericSignature:[64,[4,130,43]],ChainID:[4,[87,82,0]],RollupAddress:[20,[1,128,120,31]],TxRollupL2Address:[20,[6,161,166]]};function ye(e,...t){const r=ee(e);for(const e of t){const[t,n]=ve[e];if(r.length===t+n.length){let t=0;for(;t<n.length&&r[t]===n[t];)t++;if(t===n.length)return[e,r.slice(n.length)]}}return null}function _e(e,t){const[r,n]=ve[e];if(t.length!==r)throw new se(`Incorrect data length for ${e}: ${t.length}`);return te([...n,...t])}function we(e,t){const r=t,n=Array.isArray(r)?r:r.args;if(2===n.length){return"pair"===e?{prim:"pair",args:n}:{prim:"Pair",args:n}}return Object.assign(Object.assign({},Array.isArray(r)?{prim:e}:r),{args:[n[0],{prim:e,args:n.slice(1)}]})}function Ee(e){return Array.isArray(e)||"pair"===e.prim}function Oe(e){return Array.isArray(e)||"prim"in e&&"Pair"===e.prim}const Se=/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])[T ]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):([0-5][0-9]))$/;function Ae(e){if("string"in e){if(be(e.string))return new Date(parseInt(e.string,10));if(Se.test(e.string)){const t=new Date(e.string);if(!Number.isNaN(t.valueOf))return t}}else if(pe(e.int))return new Date(parseInt(e.int,10));return null}function Pe(e){return e.map((e=>(e>>4&15).toString(16)+(15&e).toString(16))).join("")}const Te=31,Re={ABS:!0,ADD:!0,ADDRESS:!0,AMOUNT:!0,AND:!0,APPLY:!0,BALANCE:!0,BLAKE2B:!0,CAR:!0,CDR:!0,CHAIN_ID:!0,CHECK_SIGNATURE:!0,COMPARE:!0,CONCAT:!0,CONS:!0,EDIV:!0,EQ:!0,EXEC:!0,FAILWITH:!0,GE:!0,GET_AND_UPDATE:!0,GT:!0,HASH_KEY:!0,IMPLICIT_ACCOUNT:!0,INT:!0,ISNAT:!0,JOIN_TICKETS:!0,KECCAK:!0,LE:!0,LEVEL:!0,LSL:!0,LSR:!0,LT:!0,MEM:!0,MUL:!0,NEG:!0,NEQ:!0,NEVER:!0,NOT:!0,NOW:!0,OR:!0,PACK:!0,PAIRING_CHECK:!0,READ_TICKET:!0,SAPLING_VERIFY_UPDATE:!0,SELF:!0,SELF_ADDRESS:!0,SENDER:!0,SET_DELEGATE:!0,SHA256:!0,SHA3:!0,SHA512:!0,SIZE:!0,SLICE:!0,SOME:!0,SOURCE:!0,SPLIT_TICKET:!0,SUB:!0,SWAP:!0,TICKET:!0,TICKET_DEPRECATED:!0,TOTAL_VOTING_POWER:!0,TRANSFER_TOKENS:!0,UNIT:!0,VOTING_POWER:!0,XOR:!0,RENAME:!0,OPEN_CHEST:!0,SUB_MUTEZ:!0,MIN_BLOCK_TIME:!0,BYTES:!0,NAT:!0},xe=Object.assign({},Re,{CONTRACT:!0,CREATE_CONTRACT:!0,DIG:!0,DIP:!0,DROP:!0,DUG:!0,DUP:!0,EMIT:!0,EMPTY_BIG_MAP:!0,EMPTY_MAP:!0,EMPTY_SET:!0,GET:!0,IF:!0,IF_CONS:!0,IF_LEFT:!0,IF_NONE:!0,ITER:!0,LAMBDA:!0,LAMBDA_REC:!0,LEFT:!0,LOOP:!0,LOOP_LEFT:!0,MAP:!0,NIL:!0,NONE:!0,PAIR:!0,PUSH:!0,RIGHT:!0,SAPLING_EMPTY_STATE:!0,UNPACK:!0,UNPAIR:!0,UPDATE:!0,CAST:!0,VIEW:!0}),Ie={unit:!0,never:!0,bool:!0,int:!0,nat:!0,string:!0,chain_id:!0,bytes:!0,mutez:!0,key_hash:!0,key:!0,signature:!0,timestamp:!0,address:!0,tx_rollup_l2_address:!0},Me=Object.assign({},Ie,{or:!0,pair:!0,set:!0,big_map:!0,contract:!0,lambda:!0,list:!0,map:!0,operation:!0,option:!0,bls12_381_g1:!0,bls12_381_g2:!0,bls12_381_fr:!0,sapling_transaction:!0,sapling_transaction_deprecated:!0,sapling_state:!0,ticket:!0,chest_key:!0,chest:!0});class Le extends ue{constructor(e,t){super(e,t),this.val=e,this.message=t,this.name="MichelsonValidationError"}}function ke(e){return"prim"in e}function Ne(e){if(ke(e))return!0;throw new Le(e,"prim expression expected")}function Ce(e){if(Array.isArray(e))return!0;throw new Le(e,"sequence expression expected")}function je(e){if(function(e){return Array.isArray(e)||"prim"in e}(e))return!0;throw new Le(e,"prim or sequence expression expected")}function De(e){if("-"===e.int[0])throw new Le(e,"natural number expected")}function Ue(e){if("int"in e)return!0;throw new Le(e,"int literal expected")}function Be(e){if("string"in e)return!0;throw new Le(e,"string literal expected")}function Fe(e,t){var r;if(0===t&&void 0===e.args||(null===(r=e.args)||void 0===r?void 0:r.length)===t)return!0;throw new Le(e,`${t} arguments expected`)}function Ke(e){var t,r;if(Array.isArray(e)){for(const t of e){if(!Array.isArray(t)&&!ke(t))throw new Le(e,"sequence or prim expected");Ke(t)}return!0}if(Ne(e)){if(Object.prototype.hasOwnProperty.call(Re,e.prim))return Fe(e,0),!0;switch(e.prim){case"DROP":case"PAIR":case"UNPAIR":case"DUP":case"UPDATE":case"GET":void 0!==e.args&&Fe(e,1)&&Ue(e.args[0])&&De(e.args[0]);break;case"DIG":case"DUG":case"SAPLING_EMPTY_STATE":Fe(e,1)&&Ue(e.args[0])&&De(e.args[0]);break;case"NONE":case"LEFT":case"RIGHT":case"NIL":case"CAST":Fe(e,1)&&Je(e.args[0]);break;case"UNPACK":Fe(e,1)&&Ge(e.args[0]);break;case"CONTRACT":Fe(e,1)&&ze(e.args[0]);break;case"IF_NONE":case"IF_LEFT":case"IF_CONS":case"IF":Fe(e,2)&&(Ce(e.args[0])&&Ke(e.args[0]),Ce(e.args[1])&&Ke(e.args[1]));break;case"MAP":case"ITER":case"LOOP":case"LOOP_LEFT":Fe(e,1)&&Ke(e.args[0]);break;case"CREATE_CONTRACT":Fe(e,1)&&Qe(e.args[0]);break;case"DIP":if(2===(null===(t=e.args)||void 0===t?void 0:t.length))Ue(e.args[0])&&De(e.args[0]),Ce(e.args[1])&&Ke(e.args[1]);else{if(1!==(null===(r=e.args)||void 0===r?void 0:r.length))throw new Le(e,"1 or 2 arguments expected");Ce(e.args[0])&&Ke(e.args[0])}break;case"PUSH":Fe(e,2)&&($e(e.args[0]),Xe(e.args[1]));break;case"EMPTY_SET":Fe(e,1)&&He(e.args[0]);break;case"EMPTY_MAP":Fe(e,2)&&(He(e.args[0]),Je(e.args[1]));break;case"EMPTY_BIG_MAP":Fe(e,2)&&(He(e.args[0]),qe(e.args[1]));break;case"LAMBDA_REC":case"LAMBDA":Fe(e,3)&&(Je(e.args[0]),Je(e.args[1]),Ce(e.args[2])&&Ke(e.args[2]));break;case"VIEW":Fe(e,2)&&(Be(e.args[0])&&Ze(e.args[0]),Je(e.args[1])&&$e(e.args[1]));break;case"EMIT":e.args&&e.args.length>0?Fe(e,1):Fe(e,0);break;default:throw new Le(e,"instruction expected")}}return!0}function He(e){if(je(e))if(Array.isArray(e)||"pair"===e.prim||"or"===e.prim||"option"===e.prim)Ye(e,(e=>He(e)));else if(!Object.prototype.hasOwnProperty.call(Ie,e.prim))throw new Le(e,`${e.prim}: type is not comparable`);return!0}function Ge(e){if(je(e)&&ke(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"big_map"===e.prim||"operation"===e.prim||"sapling_state"===e.prim||"ticket"===e.prim)throw new Le(e,`${e.prim}: type can't be used inside PACK/UNPACK instructions`);Ye(e,(e=>Ge(e)))}return!0}function $e(e){if(je(e)&&ke(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"big_map"===e.prim||"operation"===e.prim||"sapling_state"===e.prim||"ticket"===e.prim||"contract"===e.prim)throw new Le(e,`${e.prim}: type can't be pushed`);Ye(e,(e=>$e(e)))}return!0}function Ve(e){if(je(e)&&ke(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"operation"===e.prim||"contract"===e.prim)throw new Le(e,`${e.prim}: type can't be used as part of a storage`);Ye(e,(e=>Ve(e)))}return!0}function ze(e){if(je(e)&&ke(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"operation"===e.prim)throw new Le(e,`${e.prim}: type can't be used as part of a parameter`);Ye(e,(e=>ze(e)))}return!0}function qe(e){if(je(e)&&ke(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"big_map"===e.prim||"operation"===e.prim||"sapling_state"===e.prim)throw new Le(e,`${e.prim}: type can't be used inside a big_map`);Ye(e,(e=>qe(e)))}return!0}const We=new RegExp("^[a-zA-Z0-9_.%@]*$");function Ze(e){if(e.string.length>Te)throw new Le(e,`view name too long: ${e.string}`);if(!We.test(e.string))throw new Le(e,`invalid character(s) in view name: ${e.string}`)}function Je(e){if(je(e)&&ke(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim))throw new Le(e,"type expected");Ye(e,(e=>Je(e)))}return!0}function Ye(e,t){if(Array.isArray(e)||"pair"===e.prim){const r=Array.isArray(e)?e:e.args;if(void 0===r||r.length<2)throw new Le(e,"at least 2 arguments expected");return r.forEach((e=>{je(e)&&t(e)})),!0}switch(e.prim){case"option":case"list":Fe(e,1)&&je(e.args[0])&&t(e.args[0]);break;case"contract":Fe(e,1)&&ze(e.args[0]);break;case"or":Fe(e,2)&&je(e.args[0])&&je(e.args[1])&&(t(e.args[0]),t(e.args[1]));break;case"lambda":Fe(e,2)&&(Je(e.args[0]),Je(e.args[1]));break;case"set":Fe(e,1)&&He(e.args[0]);break;case"map":Fe(e,2)&&je(e.args[0])&&je(e.args[1])&&(He(e.args[0]),t(e.args[1]));break;case"big_map":Fe(e,2)&&je(e.args[0])&&je(e.args[1])&&(He(e.args[0]),qe(e.args[1]),t(e.args[1]));break;case"ticket":Fe(e,1)&&je(e.args[0])&&He(e.args[0]);break;case"sapling_state":case"sapling_transaction":Fe(e,1)&&Ue(e.args[0]);break;default:Fe(e,0)}return!0}function Xe(e){if("int"in e||"string"in e||"bytes"in e)return!0;if(Array.isArray(e)){let t=0;for(const r of e)ke(r)&&"Elt"===r.prim?(Fe(r,2)&&(Xe(r.args[0]),Xe(r.args[1])),t++):Xe(r);if(0!==t&&t!==e.length)throw new Le(e,"data entries and map elements can't be intermixed");return!0}if(!ke(e))throw new Le(e,"data entry expected");switch(e.prim){case"Unit":case"True":case"False":case"None":Fe(e,0);break;case"Pair":if(void 0===e.args||e.args.length<2)throw new Le(e,"at least 2 arguments expected");for(const t of e.args)Xe(t);break;case"Left":case"Right":case"Some":Fe(e,1)&&Xe(e.args[0]);break;case"Lambda_rec":e.args&&Ke(e.args);break;default:if(!Object.prototype.hasOwnProperty.call(xe,e.prim))throw new Le(e,"data entry or instruction expected");Ke(e)}return!0}function Qe(e){if(Ce(e)){const t={},r={};for(const n of e)if(Ne(n)){if("view"!==n.prim){if(n.prim in t)throw new Le(e,`duplicate contract section: ${n.prim}`);t[n.prim]=!0}switch(n.prim){case"code":Fe(n,1)&&Ce(n.args[0])&&Ke(n.args[0]);break;case"parameter":if(Fe(n,1)&&ze(n.args[0]),n.annots)throw new Le(n,"Annotation must be part of the parameter type");break;case"storage":Fe(n,1)&&Ve(n.args[0]);break;case"view":if(Fe(n,4)){if(Be(n.args[0])){const t=n.args[0];if(t.string in r)throw new Le(e,`duplicate view name: ${t.string}`);r[t.string]=!0,Ze(t)}$e(n.args[1]),$e(n.args[2]),Ce(n.args[3])&&Ke(n.args[3])}break;default:throw new Le(e,`unexpected contract section: ${n.prim}`)}}}return!0}function et(e){try{return Qe(e),!0}catch(e){return!1}}function tt(e){try{return Xe(e),!0}catch(e){return!1}}function rt(e){try{return Ke(e),!0}catch(e){return!1}}function nt(e){try{return Je(e),!0}catch(e){return!1}}function it(e){return Object.prototype.hasOwnProperty.call(xe,e.prim)}function ot(e){if(!Array.isArray(e))return!1;for(const t of e)if("prim"in t){if(it(t))throw new ue(e,`Instruction outside of a lambda: ${JSON.stringify(e)}`);if("Elt"===t.prim)throw new ue(e,`Elt item outside of a map literal: ${JSON.stringify(e)}`)}return!0}"function"==typeof SuppressedError&&SuppressedError;const st=["parameter","storage","code","False","Elt","Left","None","Pair","Right","Some","True","Unit","PACK","UNPACK","BLAKE2B","SHA256","SHA512","ABS","ADD","AMOUNT","AND","BALANCE","CAR","CDR","CHECK_SIGNATURE","COMPARE","CONCAT","CONS","CREATE_ACCOUNT","CREATE_CONTRACT","IMPLICIT_ACCOUNT","DIP","DROP","DUP","EDIV","EMPTY_MAP","EMPTY_SET","EQ","EXEC","FAILWITH","GE","GET","GT","HASH_KEY","IF","IF_CONS","IF_LEFT","IF_NONE","INT","LAMBDA","LE","LEFT","LOOP","LSL","LSR","LT","MAP","MEM","MUL","NEG","NEQ","NIL","NONE","NOT","NOW","OR","PAIR","PUSH","RIGHT","SIZE","SOME","SOURCE","SENDER","SELF","STEPS_TO_QUOTA","SUB","SWAP","TRANSFER_TOKENS","SET_DELEGATE","UNIT","UPDATE","XOR","ITER","LOOP_LEFT","ADDRESS","CONTRACT","ISNAT","CAST","RENAME","bool","contract","int","key","key_hash","lambda","list","map","big_map","nat","option","or","pair","set","signature","string","bytes","mutez","timestamp","unit","operation","address","SLICE","DIG","DUG","EMPTY_BIG_MAP","APPLY","chain_id","CHAIN_ID","LEVEL","SELF_ADDRESS","never","NEVER","UNPAIR","VOTING_POWER","TOTAL_VOTING_POWER","KECCAK","SHA3","PAIRING_CHECK","bls12_381_g1","bls12_381_g2","bls12_381_fr","sapling_state","sapling_transaction_deprecated","SAPLING_EMPTY_STATE","SAPLING_VERIFY_UPDATE","ticket","TICKET_DEPRECATED","READ_TICKET","SPLIT_TICKET","JOIN_TICKETS","GET_AND_UPDATE","chest","chest_key","OPEN_CHEST","VIEW","view","constant","SUB_MUTEZ","tx_rollup_l2_address","MIN_BLOCK_TIME","sapling_transaction","EMIT","Lambda_rec","LAMBDA_REC","TICKET","BYTES","NAT"],at=Object.assign({},...st.map(((e,t)=>({[e]:t}))));var ct;!function(e){e[e.Int=0]="Int",e[e.String=1]="String",e[e.Sequence=2]="Sequence",e[e.Prim0=3]="Prim0",e[e.Prim0Annot=4]="Prim0Annot",e[e.Prim1=5]="Prim1",e[e.Prim1Annot=6]="Prim1Annot",e[e.Prim2=7]="Prim2",e[e.Prim2Annot=8]="Prim2Annot",e[e.Prim=9]="Prim",e[e.Bytes=10]="Bytes"}(ct||(ct={}));class ut{constructor(){this.buffer=[]}get length(){return this.buffer.length}writeBytes(e){this.buffer.push(...e.map((e=>255&e)))}writeUint8(e){const t=0|e;this.buffer.push(255&t)}writeUint16(e){const t=0|e;this.buffer.push(t>>8&255),this.buffer.push(255&t)}writeUint32(e){const t=0|e;this.buffer.push(t>>24&255),this.buffer.push(t>>16&255),this.buffer.push(t>>8&255),this.buffer.push(255&t)}writeInt8(e){this.writeUint8(e)}writeInt16(e){this.writeUint16(e)}writeInt32(e){this.writeUint32(e)}}const lt=new Error("bounds out of range");class ft{constructor(e,t=0,r=e.length){this.buffer=e,this.idx=t,this.cap=r}get length(){return this.cap-this.idx}readBytes(e){if(this.cap-this.idx<e)throw lt;const t=this.buffer.slice(this.idx,this.idx+e);return this.idx+=e,t}reader(e){if(this.cap-this.idx<e)throw lt;const t=new ft(this.buffer,this.idx,this.idx+e);return this.idx+=e,t}copy(){return new ft(this.buffer,this.idx,this.cap)}readUint8(){if(this.cap-this.idx<1)throw lt;return this.buffer[this.idx++]>>>0}readUint16(){if(this.cap-this.idx<2)throw lt;return(this.buffer[this.idx++]<<8|this.buffer[this.idx++])>>>0}readUint32(){if(this.cap-this.idx<4)throw lt;return(this.buffer[this.idx++]<<24|this.buffer[this.idx++]<<16|this.buffer[this.idx++]<<8|this.buffer[this.idx++])>>>0}readInt8(){if(this.cap-this.idx<1)throw lt;return this.buffer[this.idx++]<<24>>24}readInt16(){if(this.cap-this.idx<2)throw lt;return(this.buffer[this.idx++]<<8|this.buffer[this.idx++])<<16>>16}readInt32(){if(this.cap-this.idx<4)throw lt;return this.buffer[this.idx++]<<24|this.buffer[this.idx++]<<16|this.buffer[this.idx++]<<8|this.buffer[this.idx++]}}var dt,ht,pt;function bt(e){let t;const r=e.readUint8();switch(r){case ht.ED25519:t="ED25519PublicKeyHash";break;case ht.SECP256K1:t="SECP256K1PublicKeyHash";break;case ht.P256:t="P256PublicKeyHash";break;default:throw new Error(`unknown public key hash tag: ${r}`)}return{type:t,hash:e.readBytes(20)}}function mt(e){let t;const r=e.readUint8();switch(r){case dt.Implicit:t=bt(e);break;case dt.Originated:t={type:"ContractHash",hash:e.readBytes(20)},e.readBytes(1);break;default:throw new Error(`unknown address tag: ${r}`)}if(0!==e.length){const r=new TextDecoder;t.entryPoint=r.decode(new Uint8Array(e.readBytes(e.length)))}return t}function gt(e,t){let r;switch(e.type){case"ED25519PublicKeyHash":r=ht.ED25519;break;case"SECP256K1PublicKeyHash":r=ht.SECP256K1;break;case"P256PublicKeyHash":r=ht.P256;break;default:throw new Error(`unexpected address type: ${e.type}`)}t.writeUint8(r),t.writeBytes(Array.from(e.hash))}function vt(e){let t,r;const n=e.readUint8();switch(n){case pt.ED25519:r="ED25519PublicKey",t=32;break;case pt.SECP256K1:r="SECP256K1PublicKey",t=33;break;case pt.P256:r="P256PublicKey",t=33;break;default:throw new Error(`unknown public key tag: ${n}`)}return{type:r,publicKey:e.readBytes(t)}}function yt(e,t,r){var n,i;const[o,s]=r(e);if(Array.isArray(o)){const e=new ut;for(const t of o){const r=s.next();if(r.done)throw new Error("REPORT ME: iterator is done");yt(t,e,r.value)}return t.writeUint8(ct.Sequence),t.writeUint32(e.length),void t.writeBytes(e.buffer)}if("string"in o){const e=(new TextEncoder).encode(o.string);return t.writeUint8(ct.String),t.writeUint32(e.length),void t.writeBytes(Array.from(e))}if("int"in o){t.writeUint8(ct.Int);let e=BigInt(o.int);const r=e<0;r&&(e=-e);let n=0;do{const i=0===n?BigInt(6):BigInt(7);let o=e&(BigInt(1)<<i)-BigInt(1);e>>=i,e&&(o|=BigInt(128)),0===n&&r&&(o|=BigInt(64)),t.writeUint8(Number(o)),n++}while(e);return}if("bytes"in o){const e=function(e){const t=[];for(let r=0;r<e.length;r+=2){const n=e.slice(r,r+2),i=parseInt(n,16);if(Number.isNaN(i))throw new ce(n);t.push(i)}return t}(o.bytes);return t.writeUint8(ct.Bytes),t.writeUint32(e.length),void t.writeBytes(e)}const a=at[o.prim];if(void 0===a)throw new TypeError(`Can't encode primary: ${o.prim}`);const c=((null===(n=o.args)||void 0===n?void 0:n.length)||0)<3?ct.Prim0+2*((null===(i=o.args)||void 0===i?void 0:i.length)||0)+(void 0===o.annots||0===o.annots.length?0:1):ct.Prim;if(t.writeUint8(c),t.writeUint8(a),void 0!==o.args)if(o.args.length<3)for(const e of o.args){const r=s.next();if(r.done)throw new Error("REPORT ME: iterator is done");yt(e,t,r.value)}else{const e=new ut;for(const t of o.args){const r=s.next();if(r.done)throw new Error("REPORT ME: iterator is done");yt(t,e,r.value)}t.writeUint32(e.length),t.writeBytes(e.buffer)}if(void 0!==o.annots&&0!==o.annots.length){const e=(new TextEncoder).encode(o.annots.join(" "));t.writeUint32(e.length),t.writeBytes(Array.from(e))}else void 0!==o.args&&o.args.length>=3&&t.writeUint32(0)}function _t(e,t){function*r(){for(;;)yield xt}const[n,i]=t,o=e.readUint8();switch(o){case ct.Int:{const t=[];let r;do{r=e.readInt8(),t.push(r)}while(0!=(128&r));let n=BigInt(0),o=!1;for(let e=t.length-1;e>=0;e--){const r=0===e?BigInt(6):BigInt(7),i=BigInt(t[e]);n<<=r,n|=i&(BigInt(1)<<r)-BigInt(1),0===e&&(o=!!(i&BigInt(64)))}return o&&(n=-n),i({int:String(n)})}case ct.String:{const t=e.readUint32(),r=e.readBytes(t);return i({string:(new TextDecoder).decode(new Uint8Array(r))})}case ct.Bytes:{const t=e.readUint32(),r=e.readBytes(t);return i({bytes:Pe(Array.from(r))})}case ct.Sequence:{const t=e.readUint32();let o=[],s=e.copy(),a=r();for(let r=0;r<2;r++){const r=s.reader(t);for(o=[];r.length>0;){const e=a.next();if(e.done)throw new Error("REPORT ME: iterator is done");o.push(_t(r,e.value))}a=n(o),s=e}return i(o)}default:{if(o>9)throw new Error(`Unknown tag: ${o}`);const t=e.readUint8();if(t>=st.length)throw new Error(`Unknown primitive tag: ${t}`);const s=st[t],a=o-3>>1;let c={prim:s},u=r(),l=e.copy();for(let t=0;t<2;t++){if(c={prim:s},a<3)for(let e=0;e<a;e++){const e=u.next();if(e.done)throw new Error("REPORT ME: iterator is done");c.args=c.args||[],c.args.push(_t(l,e.value))}else{c.args=c.args||[];const e=l.readUint32(),t=l.reader(e);for(;t.length>0;){const e=u.next();if(e.done)throw new Error("REPORT ME: iterator is done");c.args.push(_t(t,e.value))}}u=n(c),l=e}if(1==(o-3&1)||3===a){const t=e.readUint32();if(0!==t){const r=e.readBytes(t),n=new TextDecoder;c.annots=n.decode(new Uint8Array(r)).split(" ")}}return i(c)}}}!function(e){e[e.Implicit=0]="Implicit",e[e.Originated=1]="Originated"}(dt||(dt={})),function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e[e.P256=2]="P256"}(ht||(ht={})),function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e[e.P256=2]="P256"}(pt||(pt={}));const wt=e=>"prim"in e&&("Left"===e.prim||"Right"===e.prim),Et=e=>"prim"in e&&("Some"===e.prim||"None"===e.prim),Ot=e=>{if(Ee(e))return t=>{if(!Oe(t))throw new fe(e,`pair expected: ${JSON.stringify(t)}`,t);ot(t);const r=we("pair",e);return[we("Pair",t),function*(){for(const e of r.args)yield Ot(e)}()]};switch(e.prim){case"or":return t=>{if(!wt(t))throw new fe(e,`or expected: ${JSON.stringify(t)}`,t);return[t,function*(){yield Ot(e.args["Left"===t.prim?0:1])}()]};case"option":return t=>{if(!Et(t))throw new fe(e,`option expected: ${JSON.stringify(t)}`,t);return[t,function*(){"Some"===t.prim&&(yield Ot(e.args[0]))}()]};case"list":case"set":return t=>{if(!Array.isArray(t))throw new fe(e,`${e.prim} expected: ${JSON.stringify(t)}`,t);return[t,function*(){for(const r of t)yield Ot(e.args[0])}()]};case"map":return t=>{if(!Array.isArray(t))throw new fe(e,`map expected: ${JSON.stringify(t)}`,t);return[t,function*(){for(const r of t)yield t=>{if(!("prim"in t)||"Elt"!==t.prim)throw new fe(e,`map element expected: ${JSON.stringify(t)}`,t);return[t,function*(){for(const t of e.args)yield Ot(t)}()]}}()]};case"chain_id":return t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`chain id expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ChainID");if(null===n)throw new fe(e,`chain id base58 expected: ${t.string}`,t);r={bytes:Pe(n[1])}}else r=t;return[r,[][Symbol.iterator]()]};case"signature":return t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`signature expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature");if(null===n)throw new fe(e,`signature base58 expected: ${t.string}`,t);r={bytes:Pe(n[1])}}else r=t;return[r,[][Symbol.iterator]()]};case"key_hash":return t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`key hash expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash");if(null===n)throw new fe(e,`key hash base58 expected: ${t.string}`,t);const i=new ut;gt({type:n[0],hash:n[1]},i),r={bytes:Pe(i.buffer)}}else r=t;return[r,[][Symbol.iterator]()]};case"key":return t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`public key expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey");if(null===n)throw new fe(e,`public key base58 expected: ${t.string}`,t);const i=new ut;!function(e,t){let r;switch(e.type){case"ED25519PublicKey":r=pt.ED25519;break;case"SECP256K1PublicKey":r=pt.SECP256K1;break;case"P256PublicKey":r=pt.P256;break;default:throw new Error(`unexpected public key type: ${e.type}`)}t.writeUint8(r),t.writeBytes(Array.from(e.publicKey))}({type:n[0],publicKey:n[1]},i),r={bytes:Pe(i.buffer)}}else r=t;return[r,[][Symbol.iterator]()]};case"address":return t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`address expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=t.string.split("%"),i=ye(n[0],"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash");if(null===i)throw new fe(e,`address base58 expected: ${t.string}`,t);const o=new ut;!function(e,t){if("ContractHash"===e.type?(t.writeUint8(dt.Originated),t.writeBytes(Array.from(e.hash)),t.writeUint8(0)):(t.writeUint8(dt.Implicit),gt(e,t)),void 0!==e.entryPoint&&""!==e.entryPoint&&"default"!==e.entryPoint){const r=(new TextEncoder).encode(e.entryPoint);t.writeBytes(Array.from(r))}}({type:i[0],hash:i[1],entryPoint:n.length>1?n[1]:void 0},o),r={bytes:Pe(o.buffer)}}else r=t;return[r,[][Symbol.iterator]()]};case"timestamp":return t=>{if(!("string"in t)&&!("int"in t))throw new fe(e,`timestamp expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=Ae(t);if(null===n)throw new fe(e,`can't parse date: ${t.string}`,t);r={int:String(Math.floor(n.getTime()/1e3))}}else r=t;return[r,[][Symbol.iterator]()]};default:return At}},St=e=>"prim"in e&&"PUSH"===e.prim,At=e=>St(e)?(Ke(e),[e,function*(){yield At,yield Ot(e.args[0])}()]):[e,function*(){for(;;)yield At}()];function Pt(e,t){const r=new ut;return r.writeUint8(5),yt(e,r,void 0!==t?Ot(t):At),r.buffer}function Tt(e,t){return{bytes:Pe(Pt(e,t))}}const Rt=e=>{if(Ee(e))return[t=>{if(!Oe(t))throw new fe(e,`pair expected: ${JSON.stringify(t)}`,t);const r=we("pair",e);return function*(){for(const e of r.args)yield Rt(e)}()},e=>e];switch(e.prim){case"or":return[t=>{if(!wt(t))throw new fe(e,`or expected: ${JSON.stringify(t)}`,t);return function*(){yield Rt(e.args["Left"===t.prim?0:1])}()},e=>e];case"option":return[t=>{if(!Et(t))throw new fe(e,`option expected: ${JSON.stringify(t)}`,t);return function*(){"Some"===t.prim&&(yield Rt(e.args[0]))}()},e=>e];case"list":case"set":return[t=>{if(!Array.isArray(t))throw new fe(e,`${e.prim} expected: ${JSON.stringify(t)}`,t);return function*(){for(;;)yield Rt(e.args[0])}()},e=>e];case"map":return[t=>{if(!Array.isArray(t))throw new fe(e,`map expected: ${JSON.stringify(t)}`,t);return function*(){for(;;)yield[t=>{if(!("prim"in t)||"Elt"!==t.prim)throw new fe(e,`map element expected: ${JSON.stringify(t)}`,t);return function*(){for(const t of e.args)yield Rt(t)}()},e=>e]}()},e=>e];case"chain_id":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`chain id expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new fe(e,`can't parse bytes: ${t.bytes}`,t);return{string:_e("ChainID",r)}}];case"signature":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`signature expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new fe(e,`can't parse bytes: ${t.bytes}`,t);return{string:_e("GenericSignature",r)}}];case"key_hash":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`key hash expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new fe(e,`can't parse bytes: ${t.bytes}`,t);const n=bt(new ft(new Uint8Array(r)));return{string:_e(n.type,n.hash)+(n.entryPoint?"%"+n.entryPoint:"")}}];case"key":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`public key expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new fe(e,`can't parse bytes: ${t.bytes}`,t);const n=vt(new ft(new Uint8Array(r)));return{string:_e(n.type,n.publicKey)}}];case"address":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`address expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new fe(e,`can't parse bytes: ${t.bytes}`,t);const n=mt(new ft(new Uint8Array(r)));return{string:_e(n.type,n.hash)+(n.entryPoint?"%"+n.entryPoint:"")}}];case"timestamp":return[()=>[][Symbol.iterator](),t=>{if(!("int"in t)&&!("string"in t))throw new fe(e,`address expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;return{string:new Date(1e3*parseInt(t.int,10)).toISOString().slice(0,19)+"Z"}}];default:return xt}},xt=[e=>St(e)?(Ke(e),function*(){yield xt,yield Rt(e.args[0])}()):function*(){for(;;)yield xt}(),e=>e];function It(e,t){const r=new ft(e);if(5!==r.readUint8())throw new Error("incorrect packed data magic number");const n=_t(r,void 0!==t?Rt(t):xt);if(Xe(n))return n;throw new Error}function Mt(e,t){const r=he(e.bytes);if(null===r)throw new Error(`can't parse bytes: "${e.bytes}"`);return It(r,t)}function Lt(e){const t=he(e.bytes);if(null===t)throw new Error(`can't parse bytes: "${e.bytes}"`);return mt(new ft(new Uint8Array(t)))}function kt(e){const t=he(e.bytes);if(null===t)throw new Error(`can't parse bytes: "${e.bytes}"`);return bt(new ft(new Uint8Array(t)))}function Nt(e){const t=he(e.bytes);if(null===t)throw new Error(`can't parse bytes: "${e.bytes}"`);return vt(new ft(new Uint8Array(t)))}class Ct extends ue{constructor(e,t,r){super(e,r),this.val=e,this.stackState=t,this.message=r,this.name="MichelsonInstructionError"}}function jt(e){return Array.isArray(e)?"pair":e.prim}function Dt(e){return"prim"in e?e.args:e}function Ut(e,t,r=!1){if(jt(e)!==jt(t))throw new fe(e,`types mismatch: ${jt(e)} != ${jt(t)}`,void 0);const n=[ge(e),ge(t)];if(n[0].t&&n[1].t&&n[0].t[0]!==n[1].t[0])throw new fe(e,`${jt(e)}: type names mismatch: ${n[0].t[0]} != ${n[1].t[0]}`,void 0);if(r&&n[0].f&&n[1].f&&n[0].f[0]!==n[1].f[0])throw new fe(e,`${jt(e)}: field names mismatch: ${n[0].f[0]} != ${n[1].f}`,void 0);if(Ee(e)){const r=we("pair",e),n=we("pair",t);return Ut(r.args[0],n.args[0],!0),void Ut(r.args[1],n.args[1],!0)}switch(e.prim){case"option":case"list":case"contract":case"set":case"ticket":Ut(e.args[0],t.args[0]);break;case"or":Ut(e.args[0],t.args[0],!0),Ut(e.args[1],t.args[1],!0);break;case"lambda":case"map":case"big_map":Ut(e.args[0],t.args[0]),Ut(e.args[1],t.args[1]);break;case"sapling_state":case"sapling_transaction":if(parseInt(e.args[0].int,10)!==parseInt(t.args[0].int,10))throw new fe(e,`${jt(e)}: type argument mismatch: ${e.args[0].int} != ${t.args[0].int}`,void 0)}}function Bt(e,t){if(e.length!==t.length)throw new fe(e,`stack length mismatch: ${e.length} != ${t.length}`,void 0);for(let r=0;r<e.length;r++)Ut(e[r],t[r])}function Ft(e,t=!1){var r,n,i;if(!Array.isArray(e)){const o=ge(e);if(((null===(r=o.t)||void 0===r?void 0:r.length)||0)>1)throw new fe(e,`${e.prim}: at most one type annotation allowed: ${e.annots}`,void 0);if(t){if(((null===(n=o.f)||void 0===n?void 0:n.length)||0)>1)throw new fe(e,`${e.prim}: at most one field annotation allowed: ${e.annots}`,void 0)}else if(((null===(i=o.f)||void 0===i?void 0:i.length)||0)>0)throw new fe(e,`${e.prim}: field annotations aren't allowed: ${e.annots}`,void 0)}if(Ee(e)){const t=Dt(e);for(const e of t)Ft(e,!0)}else switch(e.prim){case"option":case"list":case"contract":case"set":Ft(e.args[0]);break;case"or":for(const t of e.args)Ft(t,!0);break;case"lambda":case"map":case"big_map":Ft(e.args[0]),Ft(e.args[1])}}function Kt(e){if(!Array.isArray(e))return!1;for(const t of e)if(!(Array.isArray(t)&&Kt(t)||"prim"in t&&it(t)))return!1;return!0}function Ht(e,t,r){if(Ee(t)){if(Oe(e)){ot(e);const n=we("Pair",e),i=we("pair",t);return Ht(n.args[0],i.args[0],r),void Ht(n.args[1],i.args[1],r)}throw new fe(t,`pair expected: ${JSON.stringify(e)}`,e)}switch(t.prim){case"int":if("int"in e&&pe(e.int))return;throw new fe(t,`integer value expected: ${JSON.stringify(e)}`,e);case"nat":case"mutez":if("int"in e&&be(e.int))return;throw new fe(t,`natural value expected: ${JSON.stringify(e)}`,e);case"string":if("string"in e)return;throw new fe(t,`string value expected: ${JSON.stringify(e)}`,e);case"bytes":case"bls12_381_g1":case"bls12_381_g2":if("bytes"in e&&null!==he(e.bytes))return;throw new fe(t,`bytes value expected: ${JSON.stringify(e)}`,e);case"bool":if("prim"in e&&("True"===e.prim||"False"===e.prim))return;throw new fe(t,`boolean value expected: ${JSON.stringify(e)}`,e);case"key_hash":if("string"in e&&null!==ye(e.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash"))return;if("bytes"in e)try{return void kt(e)}catch(e){}throw new fe(t,`key hash expected: ${JSON.stringify(e)}`,e);case"timestamp":if(("string"in e||"int"in e)&&null!==Ae(e))return;throw new fe(t,`timestamp expected: ${JSON.stringify(e)}`,e);case"address":if("string"in e){let t=e.string;const r=e.string.indexOf("%");if(r>=0&&(t=e.string.slice(0,r)),null!==ye(t,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash","TxRollupL2Address","RollupAddress"))return}else if("bytes"in e)try{return void Lt(e)}catch(e){}throw new fe(t,`address expected: ${JSON.stringify(e)}`,e);case"key":if("string"in e&&null!==ye(e.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey"))return;if("bytes"in e)try{return void Nt(e)}catch(e){}throw new fe(t,`public key expected: ${JSON.stringify(e)}`,e);case"unit":if("prim"in e&&"Unit"===e.prim)return;throw new fe(t,`unit value expected: ${JSON.stringify(e)}`,e);case"signature":if("bytes"in e||"string"in e&&null!==ye(e.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature"))return;throw new fe(t,`signature expected: ${JSON.stringify(e)}`,e);case"chain_id":if("bytes"in e||"string"in e){if(null!==("string"in e?ee(e.string):he(e.bytes)))return}throw new fe(t,`chain id expected: ${JSON.stringify(e)}`,e);case"option":if("prim"in e){if("None"===e.prim)return;if("Some"===e.prim)return void Ht(e.args[0],t.args[0],r)}throw new fe(t,`option expected: ${JSON.stringify(e)}`,e);case"list":case"set":if(ot(e)){for(const n of e)Ht(n,t.args[0],r);return}throw new fe(t,`${t.prim} expected: ${JSON.stringify(e)}`,e);case"or":if("prim"in e){if("Left"===e.prim)return void Ht(e.args[0],t.args[0],r);if("Right"===e.prim)return void Ht(e.args[0],t.args[1],r)}throw new fe(t,`union (or) expected: ${JSON.stringify(e)}`,e);case"lambda":if(Kt(e)){const n=Gt(e,[t.args[0]],r);if("failed"in n)throw new fe(t,`function is failed with error type: ${n.failed}`,e);if(1!==n.length)throw new fe(t,"function must return a value",e);return void Ut(t.args[1],n[0])}throw new fe(t,`function expected: ${JSON.stringify(e)}`,e);case"map":case"big_map":if(Array.isArray(e)){for(const n of e){if(!("prim"in n)||"Elt"!==n.prim)throw new fe(t,`map elements expected: ${JSON.stringify(e)}`,e);Ht(n.args[0],t.args[0],r),Ht(n.args[1],t.args[1],r)}return}throw new fe(t,`${t.prim} expected: ${JSON.stringify(e)}`,e);case"bls12_381_fr":if("int"in e&&pe(e.int)||"bytes"in e&&null!==he(e.bytes))return;throw new fe(t,`BLS12-381 element expected: ${JSON.stringify(e)}`,e);case"sapling_state":if(Array.isArray(e))return;throw new fe(t,`sapling state expected: ${JSON.stringify(e)}`,e);case"ticket":return void Ht(e,{prim:"pair",args:[{prim:"address"},t.args[0],{prim:"nat"}]},r);default:throw new fe(t,`type ${jt(t)} don't have Michelson literal representation`,e)}}function Gt(e,t,r){const n=(null==r?void 0:r.protocol)||b;if(Array.isArray(e))return function(e,t,r){let n=t,i=t,o=0;for(const t of e){const e=Gt(t,i,r);if(n=e,"failed"in e)break;i=e,o++}if("failed"in n&&0==n.level&&(!("prim"in n.failed)||"never"!==n.failed.prim)&&o!==e.length-1)throw new Ct(e,n,"FAIL must appear in a tail position");if(void 0!==(null==r?void 0:r.traceCallback)){const i={op:e,in:t,out:n};r.traceCallback(i)}return"failed"in n?{failed:n.failed,level:n.level+1}:n}(e,t,r);const i=e;function o(e,...r){if(t.length<r.length+e)throw new Ct(i,t,`${i.prim}: stack must have at least ${r.length} element(s)`);let n=e;for(const e of r){if(null!==e&&0!==e.length){let r=0;for(;r<e.length&&e[r]!==jt(t[n]);)r++;if(r===e.length)throw new Ct(i,t,`${i.prim}: stack type mismatch: [${n}] expected to be ${e}, got ${jt(t[n])} instead`)}n++}return t.slice(e,r.length+e)}function s(e){return(...r)=>{try{return e(...r)}catch(e){throw e instanceof ue?new Ct(i,t,e.message):e}}}function a(e){return r=>{try{return e(r)}catch(e){throw e instanceof ue?new Ct(i,t,e.message):e}}}const c=s(ge),u=s(Bt),l=s(Ut),f=a(He),d=a(Ge),m=a(Ve),g=a($e),y=a(qe);function _(e,r){const n=c(i,Object.assign(Object.assign({},r),{emptyFields:void 0!==e.f&&e.f>1,emptyVar:void 0!==e.v&&e.v>1})),o=(e,r,n)=>{if(e&&e.length>(r||0))throw new Ct(i,t,`${i.prim}: at most ${r||0} ${n} annotations allowed`)};return o(n.f,e.f,"field"),o(n.t,e.t,"type"),o(n.v,e.v,"variable"),n}function w(e,t){const r=e,n=Array.isArray(r)?{prim:"pair",args:r}:r,i=c(n),o=void 0!==t.v||void 0!==t.t||void 0!==t.f?[...(null===t.v?i.v:t.v)||[],...(null===t.t?i.t:t.t)||[],...(null===t.f?i.f:t.f)||[]]:void 0,s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(n,["annots"]);return Object.assign(Object.assign({},s),o&&0!==o.length&&{annots:o})}function E(e,t){const r=_({v:1});return w(e,{v:void 0!==r.v?r.v:void 0!==t?[t]:null,t:null})}function O(e,r,n,o,s){var a,u,l,f;const d=null===(a=c(r).f)||void 0===a?void 0:a[0],h=null===(u=n.f)||void 0===u?void 0:u[o];if(void 0!==h&&"%"!==h&&void 0!==d&&h!==d)throw new Ct(i,t,`${i.prim}: field names doesn't match: ${h} !== ${d}`);const p=null===(l=n.v)||void 0===l?void 0:l[o],b=null===(f=c(e).v)||void 0===f?void 0:f[0];return w(r,{t:null,v:p?"@%"===p?d?["@"+d.slice(1)]:void 0:"@%%"===p?b?["@"+b.slice(1)+"."+(d?d.slice(1):s)]:d?["@"+d.slice(1)]:void 0:[p]:null})}function S(e,r,n=r){const o=we("pair",e);if(1===n)return[o.args[0]];if(2===n)return o.args;const s=o.args[1];if(Ee(s))return[o.args[0],...S(s,r,n-1)];throw new Ct(i,t,`${i.prim}: at least ${r} fields are expected`)}function A(e,r,n=r){if(0===n)return e;const o=we("pair",e);if(1===n)return o.args[0];const s=o.args[1];if(Ee(s))return A(s,r,n-2);if(2===n)return s;throw new Ct(i,t,`${i.prim}: at least ${r+1} fields are expected`)}function P(e,r,n,o=n){if(0===o)return r;const s=we("pair",e);if(1===o)return Object.assign(Object.assign({},s),{args:[r,s.args[1]]});const a=s.args[1];if(Ee(a))return Object.assign(Object.assign({},s),{args:[s.args[0],P(a,r,n,o-2)]});if(2===o)return Object.assign(Object.assign({},s),{args:[s.args[0],r]});throw new Ct(i,t,`${i.prim}: at least ${n+1} fields are expected`)}const T=(e,t)=>["@"+(e.v?e.v[0].slice(1)+".":"")+t];function R(e,t){return"failed"in e||"failed"in t?"failed"in e?t:e:(u(e,t),e)}const x=(e=>{var i,s,a,b,x;switch(e.prim){case"DUP":{const r=e.args?parseInt(e.args[0].int,10):1;if(0===r)throw new Ct(e,t,"DUP 0 is forbidden");const n=o(r-1,null)[0];if("ticket"===jt(n))throw new Ct(e,t,"ticket can't be DUPed");return[n,...t]}case"SWAP":{const e=o(0,null,null);return _({}),[e[1],e[0],...t.slice(2)]}case"SOME":return[w({prim:"option",args:[o(0,null)[0]]},_({t:1,v:1})),...t.slice(1)];case"UNIT":return[w({prim:"unit"},_({v:1,t:1})),...t];case"PAIR":{const r=e.args?parseInt(e.args[0].int,10):2;if(r<2)throw new Ct(e,t,`PAIR ${r} is forbidden`);const n=o(0,...new Array(r).fill(null)),i=_({f:r,t:1,v:1},{specialFields:!0}),s=e=>{const t=e.lastIndexOf(".");return e.slice(t>0?t+1:1)},a=n.map(((e,t)=>{var r;const n=c(e);return w(e,{v:null,t:null,f:i.f&&i.f.length>t&&"%"!==i.f[t]?"%@"===i.f[t]?n.v?["%"+s((null===(r=n.v)||void 0===r?void 0:r[0])||"")]:void 0:[i.f[t]]:void 0})}));return[w({prim:"pair",args:a},{t:i.t,v:i.v}),...t.slice(r)]}case"UNPAIR":{const r=e.args?parseInt(e.args[0].int,10):2;if(r<2)throw new Ct(e,t,`UNPAIR ${r} is forbidden`);const n=o(0,["pair"])[0],i=_({f:2,v:2},{specialVar:!0});return[...S(n,r).map(((e,t)=>O(n,e,i,t,0===t?"car":"cdr"))),...t.slice(1)]}case"CAR":case"CDR":{const r=we("pair",o(0,["pair"])[0]);return[O(r,r.args["CAR"===e.prim?0:1],_({f:1,v:1},{specialVar:!0}),0,e.prim.toLocaleLowerCase()),...t.slice(1)]}case"CONS":{const e=o(0,null,["list"]);return l(e[0],e[1].args[0]),[E({prim:"list",args:[e[1].args[0]]}),...t.slice(2)]}case"SIZE":return o(0,["string","list","set","map","bytes"]),[E({prim:"nat"}),...t.slice(1)];case"MEM":{const e=o(0,null,["set","map","big_map"]);return f(e[0]),l(e[0],e[1].args[0]),[E({prim:"bool"}),...t.slice(2)]}case"GET":if(e.args){const r=parseInt(e.args[0].int,10);return[E(A(o(0,["pair"])[0],r)),...t.slice(1)]}{const e=o(0,null,["map","big_map"]);return f(e[0]),l(e[0],e[1].args[0]),[E({prim:"option",args:[e[1].args[1]]}),...t.slice(2)]}case"UPDATE":if(e.args){const r=parseInt(e.args[0].int,10),n=o(0,null,["pair"]);return[E(P(n[1],n[0],r)),...t.slice(2)]}{const e=o(0,null,["bool","option"]);if(f(e[0]),"bool"===e[1].prim){const r=o(2,["set"]);return l(e[0],r[0].args[0]),[E({prim:"set",args:[w(e[0],{t:null})]}),...t.slice(3)]}const r=o(2,["map","big_map"]);return l(e[0],r[0].args[0]),"map"===r[0].prim?[E({prim:"map",args:[w(e[0],{t:null}),w(e[1].args[0],{t:null})]}),...t.slice(3)]:(y(e[1].args[0]),[E({prim:"big_map",args:[w(e[0],{t:null}),w(e[1].args[0],{t:null})]}),...t.slice(3)])}case"GET_AND_UPDATE":{const e=_({v:2}),r=o(0,null,["option"],["map","big_map"]);f(r[0]),l(r[0],r[2].args[0]),l(r[1].args[0],r[2].args[1]);const n=null===(i=e.v)||void 0===i?void 0:i.map((e=>"@"!==e?[e]:void 0));return"map"===r[2].prim?[w({prim:"option",args:[r[2].args[1]]},{v:null==n?void 0:n[0]}),w({prim:"map",args:[w(r[0],{t:null}),w(r[1].args[0],{t:null})]},{v:null==n?void 0:n[1]}),...t.slice(3)]:(y(r[1].args[0]),[w({prim:"option",args:[r[2].args[1]]},{v:null==n?void 0:n[0]}),w({prim:"big_map",args:[w(r[0],{t:null}),w(r[1].args[0],{t:null})]},{v:null==n?void 0:n[1]}),...t.slice(3)])}case"EXEC":{const e=o(0,null,["lambda"]);return l(e[0],e[1].args[0]),[E(e[1].args[1]),...t.slice(2)]}case"APPLY":{const r=o(0,null,["lambda"]);if(m(r[0]),g(r[0]),!Ee(r[1].args[0]))throw new Ct(e,t,`${e.prim}: function's argument must be a pair: ${jt(r[1].args[0])}`);const n=r[1].args[0];return l(r[0],Dt(n)[0]),[E({prim:"lambda",args:[Dt(n)[1],r[1].args[1]]}),...t.slice(2)]}case"FAILWITH":{const e=o(0,null)[0];return v(n,p.PtEdo2Zk)||d(e),{failed:e,level:0}}case"NEVER":return o(0,["never"]),{failed:{prim:"never"},level:0};case"RENAME":return[E(o(0,null)[0]),...t.slice(1)];case"CONCAT":{const r=o(0,["string","list","bytes"]);if("list"===r[0].prim){if("string"!==jt(r[0].args[0])&&"bytes"!==jt(r[0].args[0]))throw new Ct(e,t,`${e.prim}: can't concatenate list of ${jt(r[0].args[0])}'s`);return[E(r[0].args[0]),...t.slice(1)]}const n=o(1,["string","bytes"]);if(r[0].prim!==n[0].prim)throw new Ct(e,t,`${e.prim}: can't concatenate ${r[0].prim} with ${n[0].prim}`);return[E(n[0]),...t.slice(2)]}case"SLICE":return[E({prim:"option",args:[o(0,["nat"],["nat"],["string","bytes"])[2]]},"@slice"),...t.slice(3)];case"PACK":{const e=o(0,null)[0];return d(e),[E({prim:"bytes"},"@packed"),...t.slice(1)]}case"ADD":{const r=o(0,["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if("nat"===r[0].prim&&"int"===r[1].prim||"int"===r[0].prim&&"nat"===r[1].prim)return[E({prim:"int"}),...t.slice(2)];if("int"===r[0].prim&&"timestamp"===r[1].prim||"timestamp"===r[0].prim&&"int"===r[1].prim)return[E({prim:"timestamp"}),...t.slice(2)];if(("int"===r[0].prim||"nat"===r[0].prim||"mutez"===r[0].prim||"bls12_381_g1"===r[0].prim||"bls12_381_g2"===r[0].prim||"bls12_381_fr"===r[0].prim)&&r[0].prim===r[1].prim)return[E(r[0]),...t.slice(2)];throw new Ct(e,t,`${e.prim}: can't add ${r[0].prim} to ${r[1].prim}`)}case"SUB":{const r=v(n,p.PsiThaCa)?o(0,["nat","int","timestamp","mutez"],["nat","int","timestamp","mutez"]):o(0,["nat","int","timestamp"],["nat","int","timestamp"]);if(("nat"===r[0].prim||"int"===r[0].prim)&&("nat"===r[1].prim||"int"===r[1].prim)||"timestamp"===r[0].prim&&"timestamp"===r[1].prim)return[E({prim:"int"}),...t.slice(2)];if("timestamp"===r[0].prim&&"int"===r[1].prim)return[E({prim:"timestamp"}),...t.slice(2)];if("mutez"===r[0].prim&&"mutez"===r[1].prim)return[E({prim:"mutez"}),...t.slice(2)];throw new Ct(e,t,`${e.prim}: can't subtract ${r[0].prim} from ${r[1].prim}`)}case"SUB_MUTEZ":return o(0,["mutez"],["mutez"]),[E({prim:"option",args:[{prim:"mutez"}]}),...t.slice(2)];case"MUL":{const r=o(0,["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if("nat"===r[0].prim&&"int"===r[1].prim||"int"===r[0].prim&&"nat"===r[1].prim)return[E({prim:"int"}),...t.slice(2)];if("nat"===r[0].prim&&"mutez"===r[1].prim||"mutez"===r[0].prim&&"nat"===r[1].prim)return[E({prim:"mutez"}),...t.slice(2)];if(("bls12_381_g1"===r[0].prim||"bls12_381_g2"===r[0].prim||"bls12_381_fr"===r[0].prim)&&"bls12_381_fr"===r[1].prim||("nat"===r[0].prim||"int"===r[0].prim)&&r[0].prim===r[1].prim)return[E(r[0]),...t.slice(2)];if(("nat"===r[0].prim||"int"===r[0].prim)&&"bls12_381_fr"===r[1].prim||("nat"===r[1].prim||"int"===r[1].prim)&&"bls12_381_fr"===r[0].prim)return[E({prim:"bls12_381_fr"}),...t.slice(2)];throw new Ct(e,t,`${e.prim}: can't multiply ${r[0].prim} by ${r[1].prim}`)}case"EDIV":{const r=(e,t)=>({prim:"option",args:[{prim:"pair",args:[{prim:e},{prim:t}]}]}),n=o(0,["nat","int","mutez"],["nat","int","mutez"]);if("nat"===n[0].prim&&"nat"===n[1].prim)return[E(r("nat","nat")),...t.slice(2)];if(!("nat"!==n[0].prim&&"int"!==n[0].prim||"nat"!==n[1].prim&&"int"!==n[1].prim))return[E(r("int","nat")),...t.slice(2)];if("mutez"===n[0].prim&&"nat"===n[1].prim)return[E(r("mutez","mutez")),...t.slice(2)];if("mutez"===n[0].prim&&"mutez"===n[1].prim)return[E(r("nat","mutez")),...t.slice(2)];throw new Ct(e,t,`${e.prim}: can't euclideally divide ${n[0].prim} by ${n[1].prim}`)}case"ABS":return o(0,["int"]),[E({prim:"nat"}),...t.slice(1)];case"ISNAT":return o(0,["int"]),[E({prim:"option",args:[{prim:"nat"}]}),...t.slice(1)];case"INT":return o(0,["nat","bls12_381_fr","bytes"]),[E({prim:"int"}),...t.slice(1)];case"BYTES":return o(0,["nat","int"]),[E({prim:"bytes"}),...t.slice(1)];case"NAT":return o(0,["bytes"]),[E({prim:"nat"}),...t.slice(1)];case"NEG":{const e=o(0,["nat","int","bls12_381_g1","bls12_381_g2","bls12_381_fr"])[0];return"nat"===e.prim||"int"===e.prim?[E({prim:"int"}),...t.slice(1)]:[E(e),...t.slice(1)]}case"LSL":case"LSR":return o(0,["nat","bytes"],["nat","bytes"]),[E({prim:"nat"}),...t.slice(2)];case"OR":case"XOR":{const r=o(0,["nat","bytes","bool"],["nat","bytes","bool"]);if(r[0].prim!==r[1].prim)throw new Ct(e,t,`${e.prim}: both arguments must be of the same type: ${r[0].prim}, ${r[1].prim}`);return[E(r[1]),...t.slice(2)]}case"AND":{const r=o(0,["nat","bytes","bool","int"],["nat","bytes","bool"]);if(("int"!==r[0].prim||"nat"!==r[1].prim)&&r[0].prim!==r[1].prim)throw new Ct(e,t,`${e.prim}: both arguments must be of the same type: ${r[0].prim}, ${r[1].prim}`);return[E(r[1]),...t.slice(2)]}case"NOT":return"bool"===o(0,["nat","bytes","bool","int"])[0].prim?[E({prim:"bool"}),...t.slice(1)]:[E({prim:"int"}),...t.slice(1)];case"COMPARE":{const e=o(0,null,null);return f(e[0]),f(e[1]),[E({prim:"int"}),...t.slice(2)]}case"EQ":case"NEQ":case"LT":case"GT":case"LE":case"GE":return o(0,["int"]),[E({prim:"bool"}),...t.slice(1)];case"SELF":{if(void 0===(null==r?void 0:r.contract))throw new Ct(e,t,`${e.prim}: contract required`);const n=_({f:1,v:1}),i=qt(r.contract,null===(s=n.f)||void 0===s?void 0:s[0]);if(null===i)throw new Ct(e,t,`${e.prim}: contract has no entrypoint ${i}`);return[w({prim:"contract",args:[i]},{v:n.v?n.v:["@self"]}),...t]}case"TRANSFER_TOKENS":{const e=o(0,null,["mutez"],["contract"]);return l(e[0],e[2].args[0]),[E({prim:"operation"}),...t.slice(3)]}case"SET_DELEGATE":{const r=o(0,["option"])[0];if("key_hash"!==jt(r.args[0]))throw new Ct(e,t,`${e.prim}: key hash expected: ${jt(r.args[0])}`);return[E({prim:"operation"}),...t.slice(1)]}case"IMPLICIT_ACCOUNT":return o(0,["key_hash"]),[E({prim:"contract",args:[{prim:"unit"}]}),...t.slice(1)];case"NOW":return[E({prim:"timestamp"},"@now"),...t];case"AMOUNT":return[E({prim:"mutez"},"@amount"),...t];case"BALANCE":return[E({prim:"mutez"},"@balance"),...t];case"CHECK_SIGNATURE":return o(0,["key"],["signature"],["bytes"]),[E({prim:"bool"}),...t.slice(3)];case"BLAKE2B":case"SHA256":case"SHA512":case"KECCAK":case"SHA3":return o(0,["bytes"]),[E({prim:"bytes"}),...t.slice(1)];case"HASH_KEY":return o(0,["key"]),[E({prim:"key_hash"}),...t.slice(1)];case"SOURCE":return[E({prim:"address"},"@source"),...t];case"SENDER":return[E({prim:"address"},"@sender"),...t];case"ADDRESS":{const e=o(0,["contract"])[0],r=_({v:1});return[w({prim:"address",[h]:e},{v:r.v?r.v:T(c(e),"address")}),...t.slice(1)]}case"SELF_ADDRESS":{const e={prim:"address"};return void 0!==(null==r?void 0:r.contract)&&(e[h]={prim:"contract",args:[$t(r.contract,"parameter").args[0]]}),[E(e,"@address"),...t]}case"CHAIN_ID":return[E({prim:"chain_id"}),...t];case"DROP":{_({});const r=void 0!==e.args?parseInt(e.args[0].int,10):1;return o(r-1,null),t.slice(r)}case"DIG":{_({});const r=parseInt(e.args[0].int,10);return[o(r,null)[0],...t.slice(0,r),...t.slice(r+1)]}case"DUG":{_({});const r=parseInt(e.args[0].int,10);return[...t.slice(1,r+1),o(0,null)[0],...t.slice(r+1)]}case"NONE":return Ft(e.args[0]),[w({prim:"option",args:[e.args[0]]},_({t:1,v:1})),...t];case"LEFT":case"RIGHT":{const r=o(0,null)[0],n=_({f:2,t:1,v:1},{specialFields:!0}),i=c(r),s=[w(r,{t:null,v:null,f:n.f&&n.f.length>0&&"%"!==n.f[0]?"%@"===n.f[0]?i.v?["%"+i.v[0].slice(1)]:void 0:n.f:void 0}),w(e.args[0],{t:null,f:n.f&&n.f.length>1&&"%"!==n.f[1]?n.f:void 0})];return[w({prim:"or",args:"LEFT"===e.prim?s:[s[1],s[0]]},{t:n.t,v:n.v}),...t.slice(1)]}case"NIL":return Ft(e.args[0]),[w({prim:"list",args:[e.args[0]]},_({t:1,v:1})),...t];case"UNPACK":return o(0,["bytes"]),Ft(e.args[0]),[E({prim:"option",args:[e.args[0]]},"@unpacked"),...t.slice(1)];case"CONTRACT":{const r=o(0,["address"])[0];Ft(e.args[0]);const n=_({v:1,f:1}),i=r[h];if(void 0!==i){const r=qt(i,null===(a=n.f)||void 0===a?void 0:a[0]);if(null===r)throw new Ct(e,t,`${e.prim}: contract has no entrypoint ${r}`);l(r,e.args[0])}return[w({prim:"option",args:[{prim:"contract",args:[e.args[0]]}]},{v:n.v?n.v:T(c(r),"contract")}),...t.slice(1)]}case"CAST":{_({});const r=o(0,null)[0];return Ft(e.args[0]),l(e.args[0],r),[e.args[0],...t.slice(1)]}case"IF_NONE":{_({});const n=o(0,["option"])[0],i=t.slice(1);return R(Gt(e.args[0],i,r),Gt(e.args[1],[w(n.args[0],{t:null,v:T(c(n),"some")}),...i],r))}case"IF_LEFT":{_({});const n=o(0,["or"])[0],i=c(n),s=c(n.args[0]),a=c(n.args[1]),u=t.slice(1);return R(Gt(e.args[0],[w(n.args[0],{t:null,v:T(i,s.f?s.f[0].slice(1):"left")}),...u],r),Gt(e.args[1],[w(n.args[1],{t:null,v:T(i,a.f?a.f[0].slice(1):"right")}),...u],r))}case"IF_CONS":{_({});const n=o(0,["list"])[0],i=c(n),s=t.slice(1);return R(Gt(e.args[0],[w(n.args[0],{t:null,v:T(i,"hd")}),w(n,{t:null,v:T(i,"tl")}),...s],r),Gt(e.args[1],s,r))}case"IF":{_({}),o(0,["bool"]);const n=t.slice(1);return R(Gt(e.args[0],n,r),Gt(e.args[1],n,r))}case"MAP":{const n=o(0,["list","map","option"])[0],i=t.slice(1),s="map"===n.prim?{prim:"pair",args:n.args}:n.args[0],a=Gt(e.args[0],[w(s,{t:null,v:T(c(n),"elt")}),...i],r);if("failed"in a){if(!("prim"in a.failed)||"never"!==a.failed.prim)throw new Ct(e,t,`${e.prim}: FAIL is not allowed in MAP`);return{failed:a.failed,level:a.level+1}}if(a.length<1)throw new Ct(e,t,`${e.prim}: function must return a value`);return u(a.slice(1),i),"list"===n.prim?[E({prim:"list",args:[a[0]]}),...i]:"map"===n.prim?[E({prim:"map",args:[n.args[0],a[0]]}),...i]:[E({prim:"option",args:[a[0]]}),...i]}case"ITER":{_({});const n=o(0,["set","list","map"])[0],i=t.slice(1),s="map"===n.prim?{prim:"pair",args:n.args}:n.args[0],a=Gt(e.args[0],[w(s,{t:null,v:T(c(n),"elt")}),...i],r);return"failed"in a?{failed:a.failed,level:a.level+1}:(u(a,i),i)}case"LOOP":{_({}),o(0,["bool"]);const n=t.slice(1),i=Gt(e.args[0],n,r);return"failed"in i?{failed:i.failed,level:i.level+1}:(u(i,[{prim:"bool"},...n]),n)}case"LOOP_LEFT":{_({});const n=o(0,["or"])[0],i=t.slice(1),s=Gt(e.args[0],[w(n.args[0],{t:null,v:T(c(n),"left")}),...i],r);return"failed"in s?{failed:s.failed,level:s.level+1}:(u(s,[n,...i]),[w(n.args[1],{t:null,v:_({v:1}).v}),...i])}case"DIP":{_({});const n=2===e.args.length?parseInt(e.args[0].int,10):1;o(n-1,null);const i=t.slice(0,n),s=t.slice(n),a=2===e.args.length?Gt(e.args[1],s,r):Gt(e.args[0],s,r);return"failed"in a?{failed:a.failed,level:a.level+1}:[...i,...a]}case"CREATE_CONTRACT":{const r=_({v:2}),n=o(0,["option"],["mutez"],null);if("key_hash"!==jt(n[0].args[0]))throw new Ct(e,t,`${e.prim}: key hash expected: ${jt(n[0].args[0])}`);m(n[2])&&(Zt(e.args[0]),Ut($t(e.args[0],"storage").args[0],n[2]));const i=null===(b=r.v)||void 0===b?void 0:b.map((e=>"@"!==e?[e]:void 0));return[w({prim:"operation"},{v:null==i?void 0:i[0]}),w({prim:"address",[h]:{prim:"contract",args:[$t(e.args[0],"parameter").args[0]]}},{v:null==i?void 0:i[1]}),...t.slice(3)]}case"PUSH":return Ft(e.args[0]),Ht(e.args[1],e.args[0],Object.assign(Object.assign({},r),{contract:void 0})),[E(e.args[0]),...t];case"EMPTY_SET":return Ft(e.args[0]),f(e.args[0]),[w({prim:"set",args:e.args},_({t:1,v:1})),...t];case"EMPTY_MAP":return Ft(e.args[0]),f(e.args[0]),Ft(e.args[1]),[w({prim:"map",args:e.args},_({t:1,v:1})),...t];case"EMPTY_BIG_MAP":return Ft(e.args[0]),f(e.args[0]),Ft(e.args[1]),y(e.args[0]),[w({prim:"big_map",args:e.args},_({t:1,v:1})),...t];case"LAMBDA_REC":case"LAMBDA":{Ft(e.args[0]),Ft(e.args[1]);const n=[e.args[0]];"LAMBDA_REC"===e.prim&&n.push({prim:"lambda",args:[e.args[0],e.args[1]]});const i=Gt(e.args[2],n,Object.assign(Object.assign({},r),{contract:void 0}));if("failed"in i)return{failed:i.failed,level:i.level+1};if(1!==i.length)throw new Ct(e,t,`${e.prim}: function must return a value`);return l(e.args[1],i[0]),[E({prim:"lambda",args:[e.args[0],e.args[1]]}),...t]}case"LEVEL":return[E({prim:"nat"},"@level"),...t];case"TOTAL_VOTING_POWER":case"MIN_BLOCK_TIME":return[E({prim:"nat"}),...t];case"VOTING_POWER":return o(0,["key_hash"]),[E({prim:"nat"}),...t.slice(1)];case"TICKET":{const e=o(0,null,["nat"])[0];return f(e),v(n,p.PtLimaPtL)?[w({prim:"ticket",args:[e]},_({t:1,v:1})),...t.slice(2)]:[E({prim:"option",args:[w({prim:"ticket",args:[e]},_({t:1,v:1}))]}),...t.slice(2)]}case"JOIN_TICKETS":{const r=we("pair",o(0,["pair"])[0]);if("ticket"!==jt(r.args[0]))throw new Ct(e,t,`${e.prim}: ticket expected: ${jt(r.args[0])}`);return l(r.args[0],r.args[1]),[E({prim:"option",args:[w(r.args[0],{t:null})]}),...t.slice(1)]}case"SPLIT_TICKET":{const r=o(0,["ticket"],["pair"]),n=we("pair",r[1]);if("nat"!==jt(n.args[0]))throw new Ct(e,t,`${e.prim}: nat expected: ${jt(n.args[0])}`);return l(n.args[0],n.args[1]),[E({prim:"option",args:[{prim:"pair",args:[w(r[0],{t:null}),w(r[0],{t:null})]}]}),...t.slice(2)]}case"READ_TICKET":{const e=_({v:2}),r=o(0,["ticket"])[0],n=null===(x=e.v)||void 0===x?void 0:x.map((e=>"@"!==e?[e]:void 0));return[w({prim:"pair",args:[{prim:"address"},w(r.args[0],{t:null}),{prim:"nat"}]},{v:null==n?void 0:n[0]}),w(r,{v:null==n?void 0:n[1],t:null}),...t.slice(1)]}case"PAIRING_CHECK":{const r=o(0,["list"])[0].args[0];if(!Ee(r))throw new Ct(e,t,`${e.prim}: pair expected: ${jt(r)}`);const n=we("pair",r);if("bls12_381_g1"!==jt(n.args[0]))throw new Ct(e,t,`${e.prim}: bls12_381_g1 expected: ${jt(n.args[0])}`);if("bls12_381_g2"!==jt(n.args[1]))throw new Ct(e,t,`${e.prim}: bls12_381_g2 expected: ${jt(n.args[1])}`);return[E({prim:"bool"}),...t.slice(1)]}case"SAPLING_EMPTY_STATE":return[w({prim:"sapling_state",args:[e.args[0]]},_({v:1,t:1})),...t];case"SAPLING_VERIFY_UPDATE":{const r=o(0,["sapling_transaction"],["sapling_state"]);if(parseInt(r[0].args[0].int,10)!==parseInt(r[1].args[0].int,10))throw new Ct(e,t,`${e.prim}: sapling memo size mismatch: ${r[0].args[0].int} != ${r[1].args[0].int}`);return v(n,p.PtJakarta)?[E({prim:"option",args:[{prim:"pair",args:[{prim:"int"},w(r[1],{t:null})]}]}),...t.slice(2)]:[E({prim:"option",args:[{prim:"pair",args:[{prim:"bytes"},{prim:"pair",args:[{prim:"int"},w(r[1],{t:null})]}]}]}),...t.slice(2)]}case"OPEN_CHEST":return o(0,["chest_key"],["chest"],["nat"]),[E({prim:"or",args:[{prim:"bytes"},{prim:"bool"}]}),...t.slice(3)];case"VIEW":{const r=o(0,null,["address"]);return g(r[0]),[E({prim:"option",args:[e.args[1]]}),...t.slice(2)]}case"EMIT":{const r=_({f:1,t:1});if(e.args){const n=o(0,null);return l(n[0],e.args[0]),[w({prim:"operation"},r),...t.slice(1)]}return[w({prim:"operation"},r),...t.slice(1)]}default:throw new ue(e,`unexpected instruction: ${e.prim}`)}})(i);if(void 0!==(null==r?void 0:r.traceCallback)){const e={op:i,in:t,out:x};r.traceCallback(e)}return x}function $t(e,t){for(const r of e)if(r.prim===t)return r;throw new ue(e,`missing contract section: ${t}`)}function Vt(e){const t={};for(const r of e)"view"===r.prim&&(t[r.args[0].string]=r);return t}function zt(e){if(Array.isArray(e))for(const t of e)if("prim"in t&&("parameter"===t.prim||"storage"===t.prim||"code"===t.prim))return!0;return!1}function qt(e,t){t=t||"%default";const r=Wt(e).find((e=>e[0]===t));return void 0!==r?r[1]:"%default"===t?zt(e)?$t(e,"parameter").args[0]:e:null}function Wt(e){if(zt(e)){const t=$t(e,"parameter"),r=Wt(t.args[0]),n=ge(t);return n.f?[[n.f[0],t.args[0]],...r]:r}if(t=e,Array.isArray(t)||"or"===t.prim){const t=Dt(e),r=e=>{const r=ge(t[e]);if("or"===jt(t[e])){const n=Wt(t[e]);return r.f?[[r.f[0],t[e]],...n]:n}return r.f?[[r.f[0],t[e]]]:[]};return[...r(0),...r(1)]}var t;return[]}function Zt(e,t){const r=(r,n,i,o)=>{Ft(r,!0),Ft(n);const s=Gt(o,[{prim:"pair",args:[Object.assign(Object.assign({},r),{annots:["@parameter"]}),Object.assign(Object.assign({},n),{annots:["@storage"]})]}],Object.assign(Object.assign({},t),{contract:e}));if("failed"in s)return s;try{Bt(s,[i])}catch(e){throw e instanceof ue?new Ct(o,s,e.message):e}return s},n=$t(e,"parameter").args[0],i=$t(e,"storage").args[0],o=r(n,i,{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},i]},$t(e,"code").args[0]);for(const t of Object.values(Vt(e)))r(t.args[1],i,t.args[2],t.args[3]);return o}function Jt(e,t,r){Ft(t),Ht(e,t,r||null)}function Yt(e,t,r){for(const e of t)Ft(e);if(void 0!==(null==r?void 0:r.contract))for(const e of["parameter","storage"]){Ft($t(r.contract,e).args[0])}return Gt(e,t,r||null)}function Xt(e,t,r=!1){if(Array.isArray(e)){for(const t of e)Ft(t);for(const e of t)Ft(e)}else Ft(e),Ft(t);Ut(e,t,r)}function Qt(e,t=!1){try{return Ft(e,t),!0}catch(e){return!1}}function er(e,t){try{return Zt(e,t)}catch(e){return null}}function tr(e,t,r){try{return Jt(e,t,r),!0}catch(e){return!1}}function rr(e,t,r=!1){try{return Xt(e,t,r),!0}catch(e){return!1}}class nr{constructor(e,t){this.contract=e,this.ctx=Object.assign({contract:e},t),this.output=Zt(e,this.ctx)}static parse(e,t){const r=new K(t),n="string"==typeof e?r.parseScript(e):r.parseJSON(e);if(null===n)throw new re("empty Michelson");if(Qe(n))return new nr(n,t)}static parseTypeExpression(e,t){const r=new K(t),n="string"==typeof e?r.parseScript(e):r.parseJSON(e);if(null===n)throw new ne("empty type expression");if(Je(n))return Ft(n),n}static parseDataExpression(e,t){const r=new K(t),n="string"==typeof e?r.parseScript(e):r.parseJSON(e);if(null===n)throw new ie("empty data expression");if(Xe(n))return n;throw void 0}section(e){return $t(this.contract,e)}entryPoints(){return Wt(this.contract)}entryPoint(e){return qt(this.contract,e)}assertDataValid(e,t){Jt(e,t,this.ctx)}isDataValid(e,t){return tr(e,t,this.ctx)}assertParameterValid(e,t){const r=this.entryPoint(e||void 0);if(null===r)throw new oe(null==e?void 0:e.toString());this.assertDataValid(t,r)}isParameterValid(e,t){try{return this.assertParameterValid(e,t),!0}catch(e){return!1}}functionType(e,t){return Yt(e,t,this.ctx)}}const ir=new nr([{prim:"parameter",args:[{prim:"unit"}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PAIR"}]]}]);function or(e){return"failed"in e?`[FAILED: ${z(e.failed)}]`:e.map(((e,t)=>{const r=ge(e);return`[${t}${r.v?"/"+r.v[0]:""}]: ${z(e)}`})).join("\n")}function sr(e,t){return r=>{var n;if(Array.isArray(r)&&!e)return;const o=null===(n=r.op[i])||void 0===n?void 0:n.macro,s=`${o?"Macro":"Op"}: ${o?z(o,void 0,!0)+" / ":""}${z(r.op)}\nInput:\n${or(r.in)}\nOutput:\n${or(r.out)}\n`;t(s)}}function ar(e){var t;if(e instanceof Ct){const r=null===(t=e.val[i])||void 0===t?void 0:t.macro;return`${r?"Macro":"Op"}: ${r?z(r,void 0,!0)+" / ":""}${z(e.val)}\nStack:\n${or(e.stackState)}\n`}if(e instanceof fe){return`Type: ${Array.isArray(e.val)?"["+e.val.map(((e,t)=>`[${t}]: ${z(e)}`)).join("; ")+"]":z(e.val)}\n${e.data?`Data: ${z(e.data)}\n`:""}\n`}return`Value: ${z(e.val)}`}const cr={commitHash:"e1b1d6976a564f925c01cf66e28df9acb0085c3d",version:"17.3.1-beta-RC.0"}},8899:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressValidationError:()=>T,BigMapEncodingError:()=>He,BigMapValidationError:()=>m,BytesValidationError:()=>F,ChainIDValidationError:()=>ne,ContractValidationError:()=>N,EncodeTicketError:()=>oe,EventSchema:()=>Xe,IntValidationError:()=>$,InvalidBigMapDiffError:()=>Ke,InvalidBigMapSchemaError:()=>Fe,InvalidMapTypeError:()=>u,InvalidRpcResponseError:()=>Be,InvalidScriptError:()=>Ue,KeyHashValidationError:()=>Z,KeyValidationError:()=>q,ListValidationError:()=>j,MapTypecheckError:()=>f,MapValidationError:()=>x,MichelsonMap:()=>d,MissingArgumentError:()=>$e,MutezValidationError:()=>U,NatValidationError:()=>S,OrValidationError:()=>v,ParameterEncodingError:()=>De,ParameterSchema:()=>Je,SaplingStateValue:()=>tt,Schema:()=>Ze,SetValidationError:()=>te,SignatureValidationError:()=>Y,StorageEncodingError:()=>Ge,Token:()=>p,TokenArgumentValidationError:()=>_,TokenComparisonError:()=>w,UnitValue:()=>et,VERSION:()=>Qe,ViewSchema:()=>Ye,deepEqual:()=>We});var n,i=r(5695),o=r.n(i),s=r(227),a=r(2558),c=r(4632);class u extends s.TaquitoError{constructor(e,t){super(),this.mapType=e,this.reason=t,this.message=`The map type '${JSON.stringify(e)}' is invalid. Reason: ${t}.`,this.name="InvalidMapTypeError"}}const l=Symbol.for("taquito-michelson-map-type-symbol");class f extends s.TaquitoError{constructor(e,t,r,n){super(),this.value=e,this.type=t,this.reason=n,this.name="MapTypecheckError",this.message=`The ${r} provided: ${JSON.stringify(e)} is not compatible with the expected michelson type: ${JSON.stringify(t)}. Reason: ${JSON.stringify(n)}.`,this.name="MapTypecheckError"}}class d{constructor(e){this.valueMap=new Map,this.keyMap=new Map,this[n]=!0,e&&this.setType(e)}static isMichelsonMap(e){return e&&!0===e[l]}setType(e){!function(e){if(!("prim"in e))throw new u(e,"Missing 'prim' field");if(!["map","big_map"].includes(e.prim))throw new u(e,"The prim field should be 'map' or 'big_map'");if(!("args"in e))throw new u(e,"Missing 'args' field");if(!Array.isArray(e.args))throw new u(e,"The 'args' field should be an array");if(2!==e.args.length)throw new u(e,"The 'args' field should have 2 elements")}(e),this.keySchema=new Ze(e.args[0]),this.valueSchema=new Ze(e.args[1])}removeType(){this.keySchema=void 0,this.valueSchema=void 0}static fromLiteral(e,t){const r=new d(t);return Object.keys(e).forEach((t=>{r.set(t,e[t])})),r}typecheckKey(e){this.keySchema&&this.keySchema.Typecheck(e)}typecheckValue(e){this.valueSchema&&this.valueSchema.Typecheck(e)}assertTypecheckValue(e){try{this.typecheckValue(e)}catch(t){throw new f(e,this.valueSchema,"value",t)}}assertTypecheckKey(e){try{this.typecheckKey(e)}catch(t){throw new f(e,this.keySchema,"key",t)}}serializeDeterministically(e){return o()(e)}*keys(){for(const[e]of this.entries())yield e}*values(){for(const[,e]of this.entries())yield e}*entries(){for(const e of this.valueMap.keys())yield[this.keyMap.get(e),this.valueMap.get(e)]}get(e){this.assertTypecheckKey(e);const t=this.serializeDeterministically(e);return this.valueMap.get(t)}set(e,t){this.assertTypecheckKey(e),this.assertTypecheckValue(t);const r=this.serializeDeterministically(e);this.keyMap.set(r,e),this.valueMap.set(r,t)}delete(e){this.assertTypecheckKey(e),this.keyMap.delete(this.serializeDeterministically(e)),this.valueMap.delete(this.serializeDeterministically(e))}has(e){this.assertTypecheckKey(e);const t=this.serializeDeterministically(e);return this.keyMap.has(t)&&this.valueMap.has(t)}clear(){this.keyMap.clear(),this.valueMap.clear()}get size(){return this.keyMap.size}forEach(e){for(const[t,r]of this.entries())e(r,t,this)}}n=l;class h extends s.TaquitoError{constructor(e,t,r){super(),this.value=e,this.token=t,this.name="TokenValidationError";const n=this.token.annot(),i=n?`[${n}] `:"";this.message=`${i}${r}`}}class p{constructor(e,t,r){this.val=e,this.idx=t,this.fac=r,this.createToken=this.fac}typeWithoutAnnotations(){const e=t=>{if("object"==typeof t){if(Array.isArray(t)){return t.map((t=>e(t)))}const r=t;return r.args?{prim:r.prim,args:r.args.map((t=>e(t)))}:{prim:r.prim}}return t};return(t=this.val).args?{prim:t.prim,args:t.args.map((t=>e(t)))}:{prim:t.prim};var t}annot(){return(Array.isArray(this.val.annots)&&this.val.annots.length>0?this.val.annots[0]:String(this.idx)).replace(/(%|:)(_Liq_entry_)?/,"")}hasAnnotations(){return Array.isArray(this.val.annots)&&this.val.annots.length}get tokenVal(){return this.val}ExtractSignature(){return[[this.ExtractSchema()]]}}class b extends p{compare(e,t){return e===t?0:e<t?-1:1}}class m extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="BigMapValidationError"}}class g extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}ExtractSchema(){return{big_map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:g.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}validate(e){if(!d.isMichelsonMap(e))throw new m(e,this,`Value ${JSON.stringify(e)} is not a MichelsonMap`)}objLitToMichelsonMap(e){return e instanceof d?e:"object"==typeof e?0===Object.keys(e).length?new d:d.fromLiteral(e):e}Encode(e){const t=this.objLitToMichelsonMap(e.pop());return this.validate(t),Array.from(t.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(t.get(e))]})))}EncodeObject(e,t){const r=this.objLitToMichelsonMap(e);return this.validate(r),t&&t[g.prim]?t[g.prim](r,this.val):Array.from(r.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(r.get(e))]})))}Execute(e,t){if(t&&t[g.prim])return t[g.prim](e,this.val);if(Array.isArray(e)){const t=new d(this.val);return e.forEach((e=>{t.set(this.KeySchema.ToKey(e.args[0]),this.ValueSchema.Execute(e.args[1]))})),t}if("int"in e)return e.int;throw new m(e,this,`Big map is expecting either an array (Athens) or an object with an int property (Babylon). Got ${JSON.stringify(e)}`)}findAndReturnTokens(e,t){return g.prim===e&&t.push(this),this.KeySchema.findAndReturnTokens(e,t),this.ValueSchema.findAndReturnTokens(e,t),t}}g.prim="big_map";class v extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="OrValidationError"}}class y extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Encode(e){const t=e[e.length-1],r=this.createToken(this.val.args[0],this.idx);let n=1;r instanceof y&&(n=Object.keys(r.ExtractSchema()).length);const i=this.createToken(this.val.args[1],this.idx+n);if(String(r.annot())!==String(t)||r instanceof y){if(String(i.annot())!==String(t)||i instanceof y){if(r instanceof y){const t=r.Encode(e);if(t)return{prim:"Left",args:[t]}}if(i instanceof y){const t=i.Encode(e);if(t)return{prim:"Right",args:[t]}}return null}return e.pop(),{prim:"Right",args:[i.Encode(e)]}}return e.pop(),{prim:"Left",args:[r.Encode(e)]}}ExtractSignature(){const e=this.createToken(this.val.args[0],this.idx);let t=1;e instanceof y&&(t=Object.keys(e.ExtractSchema()).length);const r=this.createToken(this.val.args[1],this.idx+t),n=[];if(e instanceof y)n.push(...e.ExtractSignature());else for(const t of e.ExtractSignature())n.push([e.annot(),...t]);if(r instanceof y)n.push(...r.ExtractSignature());else for(const e of r.ExtractSignature())n.push([r.annot(),...e]);return n}EncodeObject(e,t){this.validateJavascriptObject(e);const r=Object.keys(e)[0],n=this.createToken(this.val.args[0],this.idx);let i=1;n instanceof y&&(i=Object.keys(n.ExtractSchema()).length);const o=this.createToken(this.val.args[1],this.idx+i);if(String(n.annot())!==String(r)||n instanceof y){if(String(o.annot())!==String(r)||o instanceof y){if(n instanceof y){const r=n.EncodeObject(e,t);if(r)return{prim:"Left",args:[r]}}if(o instanceof y){const r=o.EncodeObject(e,t);if(r)return{prim:"Right",args:[r]}}return null}return{prim:"Right",args:[o.EncodeObject(e[r],t)]}}return{prim:"Left",args:[n.EncodeObject(e[r],t)]}}validateJavascriptObject(e){if("object"!=typeof e||Array.isArray(e)||null===e||1!==Object.keys(e).length)throw new v(e,this,`EncodeObject expects an object with a single key but got: ${JSON.stringify(e)}`)}Execute(e,t){const r=this.createToken(this.val.args[0],this.idx);let n=1;r instanceof y&&(n=Object.keys(r.ExtractSchema()).length);const i=this.createToken(this.val.args[1],this.idx+n);if("Right"===e.prim)return i instanceof y?i.Execute(e.args[0],t):{[i.annot()]:i.Execute(e.args[0],t)};if("Left"===e.prim)return r instanceof y?r.Execute(e.args[0],t):{[r.annot()]:r.Execute(e.args[0],t)};throw new v(e,this,`Was expecting Left or Right prim but got: ${JSON.stringify(e.prim)}`)}traversal(e,t,r){const n=this.createToken(this.val.args[0],this.idx);let i,o=1;n instanceof y?(i=e(n),o=Object.keys(n.ExtractSchema()).length):i={[n.annot()]:e(n)};const s=this.createToken(this.val.args[1],this.idx+o);let a;a=s instanceof y?t(s):{[s.annot()]:t(s)};return r(i,a)}ExtractSchema(){return this.traversal((e=>e.ExtractSchema()),(e=>e.ExtractSchema()),((e,t)=>Object.assign(Object.assign({},e),t)))}generateSchema(){return{__michelsonType:y.prim,schema:this.traversal((e=>e instanceof y?e.generateSchema().schema:e.generateSchema()),(e=>e instanceof y?e.generateSchema().schema:e.generateSchema()),((e,t)=>Object.assign(Object.assign({},e),t)))}}findToken(e){const t=this.createToken(this.val.args[0],this.idx);let r=1;t instanceof y&&(r=Object.keys(t.ExtractSchema()).length);const n=this.createToken(this.val.args[1],this.idx+r);if(String(t.annot())===String(e)&&!(t instanceof y)&&t instanceof b)return t;if(String(n.annot())===String(e)&&!(n instanceof y)&&n instanceof b)return n;if(t instanceof y){const r=t.findToken(e);if(r)return r}if(n instanceof y){const t=n.findToken(e);if(t)return t}return null}compare(e,t){const r=Object.keys(e)[0];if(r!==Object.keys(t)[0]){return JSON.stringify(this.EncodeObject(e))<JSON.stringify(this.EncodeObject(t))?-1:1}{const n=this.findToken(r);if(n instanceof b)return n.compare(e[r],t[r])}}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:this.EncodeObject(e),type:this.typeWithoutAnnotations()}}findAndReturnTokens(e,t){return y.prim===e&&t.push(this),this.traversal((r=>r.findAndReturnTokens(e,t)),(r=>r.findAndReturnTokens(e,t)),((e,t)=>Object.assign(Object.assign({},e),t))),t}}y.prim="or";class _ extends s.TaquitoError{constructor(e){super(e),this.message=e,this.name="TokenArgumentValidationError"}}class w extends s.TaquitoError{constructor(e,t){super(),this.val1=e,this.val2=t,this.name="TokenComparisonError",this.message=`Tokens ${JSON.stringify(e)} and ${JSON.stringify(t)} are not comparable`}}function E(e,t=O.prim){if(Array.isArray(e))return E({prim:t,args:e},t);if(void 0===e.args)throw new _(`The value ${JSON.stringify(e)} is an invalid PairToken with no arguments, a pair must have two or more arguments.`);return e.args.length>2?[e.args[0],{prim:t,args:e.args.slice(1)}]:[e.args[0],e.args[1]]}class O extends b{constructor(e,t,r){super(Array.isArray(e)?{prim:O.prim,args:e}:e.prim?e:{prim:O.prim,args:e},t,r)}args(){return E(this.val)}tokens(){let e=0;return this.args().map((t=>{const r=this.createToken(t,this.idx+e);return r instanceof O?e+=Object.keys(r.ExtractSchema()).length:e++,r}))}Encode(e){return{prim:"Pair",args:this.tokens().map((t=>t.Encode(e)))}}ExtractSignature(){const e=this.args(),t=this.createToken(e[0],this.idx);let r=1;t instanceof y&&(r=Object.keys(t.ExtractSchema()).length);const n=this.createToken(e[1],this.idx+r),i=[];for(const e of t.ExtractSignature())for(const t of n.ExtractSignature())i.push([...e,...t]);return i}ToBigMapKey(e){return{key:this.EncodeObject(e),type:this.typeWithoutAnnotations()}}ToKey(e){return this.Execute(e)}EncodeObject(e,t){const[r,n]=this.tokens();let i,o;return i=r instanceof O&&!r.hasAnnotations()?e:e[r.annot()],o=n instanceof O&&!n.hasAnnotations()?e:e[n.annot()],{prim:"Pair",args:[r.EncodeObject(i,t),n.EncodeObject(o,t)]}}traversal(e,t){const r=this.args(),n=this.createToken(r[0],this.idx);let i,o=1;n instanceof O&&!n.hasAnnotations()?(i=e(n),n instanceof O&&(o=Object.keys(n.ExtractSchema()).length)):i={[n.annot()]:e(n)};const s=this.createToken(r[1],this.idx+o);let a;a=s instanceof O&&!s.hasAnnotations()?t(s):{[s.annot()]:t(s)};return Object.assign(Object.assign({},i),a)}Execute(e,t){const r=E(e,"Pair");return this.traversal((e=>e.Execute(r[0],t)),(e=>e.Execute(r[1],t)))}ExtractSchema(){return this.traversal((e=>e.ExtractSchema()),(e=>e.ExtractSchema()))}generateSchema(){return{__michelsonType:O.prim,schema:this.traversal((e=>e instanceof O&&!e.hasAnnotations()?e.generateSchema().schema:e.generateSchema()),(e=>e instanceof O&&!e.hasAnnotations()?e.generateSchema().schema:e.generateSchema()))}}compare(e,t){const[r,n]=this.tokens(),i=(e,t)=>e instanceof O&&!e.hasAnnotations()?t:t[e.annot()];if(r instanceof b&&n instanceof b){const o=r.compare(i(r,e),i(r,t));return 0===o?n.compare(i(n,e),i(n,t)):o}throw new w(e,t)}findAndReturnTokens(e,t){return O.prim===e&&t.push(this),this.tokens().map((r=>r.findAndReturnTokens(e,t))),t}}O.prim="pair";class S extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="NatValidationError"}}class A extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return new a.Z(e[Object.keys(e)[0]])}Encode(e){const t=e.pop();return this.validate(t),{int:new a.Z(t).toFixed()}}validate(e){const t=new a.Z(e);if(t.isNaN())throw new S(e,this,`Value is not a number: ${JSON.stringify(e)}`);if(t.isNegative())throw new S(e,this,`Value cannot be negative: ${JSON.stringify(e)}`)}EncodeObject(e,t){return this.validate(e),t&&t[A.prim]?t[A.prim](e):{int:new a.Z(e).toFixed()}}ExtractSchema(){return A.prim}generateSchema(){return{__michelsonType:A.prim,schema:A.prim}}ToBigMapKey(e){return{key:{int:String(e)},type:{prim:A.prim}}}ToKey({int:e}){return new a.Z(e)}compare(e,t){const r=Number(e),n=Number(t);return r===n?0:r<n?-1:1}findAndReturnTokens(e,t){return A.prim===e&&t.push(this),t}}A.prim="nat";class P extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e[Object.keys(e)[0]]}ExtractSchema(){return P.prim}generateSchema(){return{__michelsonType:P.prim,schema:P.prim}}Encode(e){return{string:e.pop()}}EncodeObject(e,t){return t&&t[P.prim]?t[P.prim](e):{string:e}}ToKey({string:e}){return e}ToBigMapKey(e){return{key:{string:e},type:{prim:P.prim}}}findAndReturnTokens(e,t){return P.prim===e&&t.push(this),t}}P.prim="string";class T extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="AddressValidationError"}}class R extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}ToBigMapKey(e){return{key:{bytes:(0,c.b58decode)(e)},type:{prim:"bytes"}}}validate(e){if((0,c.validateAddress)(e)!==c.ValidationResult.VALID)throw new T(e,this,`Address is not valid: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[R.prim]?t[R.prim](e):{string:e}}Execute(e){if(e.string)return e.string;if(!e.bytes)throw new T(e,this,`cannot be missing both string and bytes: ${JSON.stringify(e)}`);return(0,c.encodePubKey)(e.bytes)}ExtractSchema(){return R.prim}generateSchema(){return{__michelsonType:R.prim,schema:R.prim}}ToKey({bytes:e,string:t}){if(t)return t;if(!e)throw new T({bytes:e,string:t},this,`cannot be missing both string and bytes ${JSON.stringify({string:t,bytes:e})}`);return(0,c.encodePubKey)(e)}compare(e,t){const r=e=>e.startsWith("tz"),n=r(e),i=r(t);return n&&!i?-1:i&&!n?1:super.compare(e,t)}findAndReturnTokens(e,t){return R.prim===e&&t.push(this),t}}R.prim="address";class x extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="MapValidationError"}}class I extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}validate(e){if(!d.isMichelsonMap(e))throw new x(e,this,`Value ${JSON.stringify(e)} is not a valid MichelsonMap`)}Execute(e,t){const r=new d(this.val);return e.forEach((e=>{r.set(this.KeySchema.ToKey(e.args[0]),this.ValueSchema.Execute(e.args[1],t))})),r}objLitToMichelsonMap(e){return e instanceof d?e:"object"==typeof e?0===Object.keys(e).length?new d:d.fromLiteral(e):e}Encode(e){const t=this.objLitToMichelsonMap(e.pop());return this.validate(t),Array.from(t.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(t.get(e))]})))}EncodeObject(e,t){const r=this.objLitToMichelsonMap(e);return this.validate(r),t&&t[I.prim]?t[I.prim](r):Array.from(r.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(r.get(e))]})))}ExtractSchema(){return{map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:I.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}findAndReturnTokens(e,t){return I.prim===e&&t.push(this),this.KeySchema.findAndReturnTokens(e,t),this.ValueSchema.findAndReturnTokens(e,t),t}}I.prim="map";class M extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return"true"===String(e.prim).toLowerCase()}Encode(e){return{prim:e.pop()?"True":"False"}}EncodeObject(e,t){return t&&t[M.prim]?t[M.prim](e):{prim:e?"True":"False"}}ExtractSchema(){return M.prim}generateSchema(){return{__michelsonType:M.prim,schema:M.prim}}ToBigMapKey(e){return{key:this.EncodeObject(e),type:{prim:M.prim}}}ToKey(e){return this.EncodeObject(e)}compare(e,t){return e&&t||!e&&!t?0:e?1:-1}findAndReturnTokens(e,t){return M.prim===e&&t.push(this),t}}M.prim="bool";class L extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="TxRollupL2AddressValidationError"}}class k extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}ToBigMapKey(e){return{key:{bytes:(0,c.b58decodeL2Address)(e)},type:{prim:"bytes"}}}validate(e){if((0,c.validateAddress)(e)!==c.ValidationResult.VALID)throw new L(e,this,`tx_rollup_l2_address is not valid: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();if(!t)throw new L(t,this,`arg missing to encode: this -> "${JSON.stringify(t)}"`);return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[k.prim]?t[k.prim](e):{string:e}}Execute(e){if(e.string)return e.string;if(!e.bytes)throw new L(e,this,`value cannot be missing string and byte value. must have one ${JSON.stringify(e)}`);return(0,c.encodeL2Address)(e.bytes)}ExtractSchema(){return k.prim}generateSchema(){return{__michelsonType:k.prim,schema:k.prim}}ToKey({bytes:e,string:t}){if(t)return t;if(!e)throw new L(e,this,`value cannot be missing string and byte value. must have one: bytes = ${JSON.stringify(e)}`);return(0,c.encodeL2Address)(e)}findAndReturnTokens(e,t){return k.prim===e&&t.push(this),t}}k.prim="tx_rollup_l2_address";class N extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ContractValidationError"}}class C extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if((0,c.validateAddress)(e)!==c.ValidationResult.VALID)throw new N(e,this,`Value ${JSON.stringify(e)} is not a valid contract address.`);return null}Execute(e){if(e.string)return e.string;if(!e.bytes)throw new N(e,this,`Value ${JSON.stringify(e)} is not a valid contract address. must contain bytes or string.`);return(0,c.encodePubKey)(e.bytes)}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[C.prim]?t[C.prim](e):{string:e}}ExtractSchema(){return C.prim}generateSchema(){const e=this.createToken(this.val.args[0],0);return{__michelsonType:C.prim,schema:{parameter:this.val.args[0]?e.generateSchema():{}}}}findAndReturnTokens(e,t){return C.prim===e&&t.push(this),t}}C.prim="contract";class j extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ListValidationError"}}class D extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get valueSchema(){return this.createToken(this.val.args[0],this.idx)}validate(e){if(!Array.isArray(e))throw new j(e,this,`Value ${JSON.stringify(e)} is not a valid array`)}Encode(e){const t=e.pop();this.validate(t);const r=this.createToken(this.val.args[0],0);return t.reduce(((e,t)=>[...e,r.EncodeObject(t)]),[])}Execute(e,t){const r=this.createToken(this.val.args[0],0);return this.validate(e),e.reduce(((e,n)=>[...e,r.Execute(n,t)]),[])}EncodeObject(e,t){const r=this.createToken(this.val.args[0],0);return this.validate(e),t&&t[D.prim]?t[D.prim](e):e.reduce(((e,t)=>[...e,r.EncodeObject(t)]),[])}ExtractSchema(){return{[D.prim]:this.valueSchema.ExtractSchema()}}generateSchema(){return{__michelsonType:D.prim,schema:this.valueSchema.generateSchema()}}findAndReturnTokens(e,t){return D.prim===e&&t.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(e,t),t}}D.prim="list";class U extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="MutezValidationError"}}class B extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return new a.Z(e[Object.keys(e)[0]])}ExtractSchema(){return B.prim}generateSchema(){return{__michelsonType:B.prim,schema:B.prim}}validate(e){if(new a.Z(e).isNaN())throw new U(e,this,`Value is not a number: ${e}`)}Encode(e){const t=e.pop();return this.validate(t),{int:String(t).toString()}}EncodeObject(e,t){return this.validate(e),t&&t[B.prim]?t[B.prim](e):{int:String(e).toString()}}ToBigMapKey(e){return{key:{int:String(e)},type:{prim:B.prim}}}ToKey({int:e}){return e}compare(e,t){const r=Number(e),n=Number(t);return r===n?0:r<n?-1:1}findAndReturnTokens(e,t){return B.prim===e&&t.push(this),t}}B.prim="mutez";class F extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="BytesValidationError"}}class K extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}ToBigMapKey(e){return{key:{bytes:e},type:{prim:K.prim}}}validate(e){if("string"!=typeof e||!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new F(e,this,`Invalid bytes: ${e}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=(0,c.stripHexPrefix)(this.convertUint8ArrayToHexString(t)),this.validate(t),{bytes:String(t).toString()}}EncodeObject(e,t){return"string"==typeof(e=this.convertUint8ArrayToHexString(e))&&(e=(0,c.stripHexPrefix)(e)),this.validate(e),t&&t[K.prim]?t[K.prim](e):{bytes:String(e).toString()}}Execute(e){return e.bytes}ExtractSchema(){return K.prim}generateSchema(){return{__michelsonType:K.prim,schema:K.prim}}ToKey({bytes:e,string:t}){return t||e}findAndReturnTokens(e,t){return K.prim===e&&t.push(this),t}}K.prim="bytes";class H extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}subToken(){return this.createToken(this.val.args[0],this.idx)}schema(){return this.createToken(this.val.args[0],0)}annot(){return Array.isArray(this.val.annots)?super.annot():this.createToken(this.val.args[0],this.idx).annot()}Encode(e){const t=e;return null==t?{prim:"None"}:!Array.isArray(t)||void 0!==t[t.length-1]&&null!==t[t.length-1]?{prim:"Some",args:[this.schema().Encode(e)]}:(t.pop(),{prim:"None"})}EncodeObject(e,t){let r=e;return null==r?{prim:"None"}:(r="object"==typeof r&&"Some"in r?r.Some:r,{prim:"Some",args:[this.schema().EncodeObject(r,t)]})}Execute(e,t){return"None"===e.prim?null:{Some:this.schema().Execute(e.args[0],t)}}ExtractSchema(){return{Some:this.schema().ExtractSchema()}}generateSchema(){return{__michelsonType:H.prim,schema:this.schema().generateSchema()}}ExtractSignature(){return[...this.schema().ExtractSignature()]}get KeySchema(){return this.schema()}compare(e,t){return e?t?this.KeySchema.compare(e,t):1:-1}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:this.EncodeObject(e),type:this.typeWithoutAnnotations()}}findAndReturnTokens(e,t){return H.prim===e&&t.push(this),this.subToken().findAndReturnTokens(e,t),t}}H.prim="option";class G extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string&&/^\d+$/.test(e.string)?new Date(1e3*Number(e.string)).toISOString():e.string?new Date(e.string).toISOString():e.int?new Date(1e3*Number(e.int)).toISOString():void 0}Encode(e){const t=e.pop();return"number"==typeof t?{int:String(t)}:{string:t}}EncodeObject(e,t){return t&&t[G.prim]?t[G.prim](e):"number"==typeof e?{int:String(e)}:{string:e}}ExtractSchema(){return G.prim}generateSchema(){return{__michelsonType:G.prim,schema:G.prim}}ToKey({string:e}){return e}ToBigMapKey(e){return{key:{string:e},type:{prim:G.prim}}}findAndReturnTokens(e,t){return G.prim===e&&t.push(this),t}}G.prim="timestamp";class $ extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="IntValidationError"}}class V extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return new a.Z(e[Object.keys(e)[0]])}ExtractSchema(){return V.prim}generateSchema(){return{__michelsonType:V.prim,schema:V.prim}}validate(e){if(new a.Z(e).isNaN())throw new $(e,this,`Value is not a number: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();return this.validate(t),{int:new a.Z(t).toFixed()}}EncodeObject(e,t){return this.validate(e),t&&t[V.prim]?t[V.prim](e):{int:new a.Z(e).toFixed()}}ToBigMapKey(e){return{key:{int:String(e)},type:{prim:V.prim}}}ToKey({int:e}){return e}compare(e,t){const r=Number(e),n=Number(t);return r===n?0:r<n?-1:1}findAndReturnTokens(e,t){return V.prim===e&&t.push(this),t}}V.prim="int";class z extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Encode(e){return e.pop(),{prim:"Unit"}}EncodeObject(e,t){return t&&t[z.prim]?t[z.prim](e):{prim:"Unit"}}Execute(e){return et}ExtractSchema(){return z.prim}generateSchema(){return{__michelsonType:z.prim,schema:z.prim}}compare(e,t){return 0}ToKey(e){return et}ToBigMapKey(e){return{key:{prim:"Unit"},type:{prim:z.prim}}}findAndReturnTokens(e,t){return z.prim===e&&t.push(this),t}}z.prim="unit";class q extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="KeyValidationError"}}class W extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string?e.string:(0,c.encodeKey)(e.bytes)}validate(e){if((0,c.validatePublicKey)(e)!==c.ValidationResult.VALID)throw new q(e,this,"Key is not valid")}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[W.prim]?t[W.prim](e):{string:e}}ExtractSchema(){return W.prim}generateSchema(){return{__michelsonType:W.prim,schema:W.prim}}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:{string:e},type:{prim:W.prim}}}compare(e,t){const r=this.getPrefix(e),n=this.getPrefix(t);if(r===c.Prefix.EDPK&&n!==c.Prefix.EDPK)return-1;if(r===c.Prefix.SPPK&&n!==c.Prefix.SPPK)return n===c.Prefix.EDPK?1:-1;if(r===c.Prefix.P2PK){if(n!==c.Prefix.P2PK)return 1;const r=this.getP256PublicKeyComparableBytes(e),i=this.getP256PublicKeyComparableBytes(t);return Buffer.compare(r,i)}return super.compare(e,t)}getPrefix(e){return e.substring(0,4)}getP256PublicKeyComparableBytes(e){return(0,c.b58cdecode)(e,c.prefix[c.Prefix.P2PK]).slice(1)}findAndReturnTokens(e,t){return W.prim===e&&t.push(this),t}}W.prim="key";class Z extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="KeyHashValidationError"}}class J extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string?e.string:(0,c.encodeKeyHash)(e.bytes)}validate(e){if((0,c.validateKeyHash)(e)!==c.ValidationResult.VALID)throw new Z(e,this,`KeyHash is not valid: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[J.prim]?t[J.prim](e):{string:e}}ExtractSchema(){return J.prim}generateSchema(){return{__michelsonType:J.prim,schema:J.prim}}ToKey({string:e,bytes:t}){return e||(0,c.encodeKeyHash)(t)}ToBigMapKey(e){return{key:{string:e},type:{prim:J.prim}}}findAndReturnTokens(e,t){return J.prim===e&&t.push(this),t}}J.prim="key_hash";class Y extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SignatureValidationError"}}class X extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string?e.string:e.bytes}validate(e){if((0,c.validateSignature)(e)!==c.ValidationResult.VALID)throw new Y(e,this,"Signature is not valid")}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[X.prim]?t[X.prim](e):{string:e}}ExtractSchema(){return X.prim}generateSchema(){return{__michelsonType:X.prim,schema:X.prim}}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:{string:e},type:{prim:X.prim}}}findAndReturnTokens(e,t){return X.prim===e&&t.push(this),t}}X.prim="signature";class Q extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get paramSchema(){return this.createToken(this.val.args[0],this.idx)}get returnSchema(){return this.createToken(this.val.args[1],this.idx+1)}Execute(e){return e.string?e.string:e}Encode(e){return e.pop()}EncodeObject(e,t){return t&&t[Q.prim]?t[Q.prim](e):e}ExtractSchema(){return{[Q.prim]:{parameters:this.paramSchema.ExtractSchema(),returns:this.returnSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:Q.prim,schema:{parameters:this.paramSchema.generateSchema(),returns:this.returnSchema.generateSchema()}}}findAndReturnTokens(e,t){return Q.prim===e&&t.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(e,t),this.createToken(this.val.args[1],this.idx).findAndReturnTokens(e,t),t}}Q.prim="lambda";class ee extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string}Encode(...e){return{string:e.pop()}}EncodeObject(e,t){return t&&t[ee.prim]?t[ee.prim](e):{string:e}}ExtractSchema(){return ee.prim}generateSchema(){return{__michelsonType:ee.prim,schema:ee.prim}}findAndReturnTokens(e,t){return ee.prim===e&&t.push(this),t}}ee.prim="operation";class te extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SetValidationError"}}class re extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get KeySchema(){return this.createToken(this.val.args[0],0)}validate(e){if(!Array.isArray(e))throw new te(e,this,`Value ${JSON.stringify(e)} is not an array`)}Encode(e){const t=e.pop();return this.validate(t),t.sort(((e,t)=>this.KeySchema.compare(e,t))).reduce(((e,t)=>[...e,this.KeySchema.EncodeObject(t)]),[])}Execute(e,t){return e.reduce(((e,r)=>[...e,this.KeySchema.Execute(r,t)]),[])}EncodeObject(e,t){return this.validate(e),t&&t[re.prim]?t[re.prim](e):e.sort(((e,t)=>this.KeySchema.compare(e,t))).reduce(((e,t)=>[...e,this.KeySchema.EncodeObject(t)]),[])}ExtractSchema(){return re.prim}generateSchema(){return{__michelsonType:re.prim,schema:this.KeySchema.generateSchema()}}findAndReturnTokens(e,t){return re.prim===e&&t.push(this),this.KeySchema.findAndReturnTokens(e,t),t}}re.prim="set";class ne extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ChainIDValidationError"}}class ie extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if((0,c.validateChain)(e)!==c.ValidationResult.VALID)throw new ne(e,this,`Value ${JSON.stringify(e)} is not a valid ChainID`)}Execute(e){return e[Object.keys(e)[0]]}ExtractSchema(){return ie.prim}generateSchema(){return{__michelsonType:ie.prim,schema:ie.prim}}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[ie.prim]?t[ie.prim](e):{string:e}}ToKey({string:e}){return e}ToBigMapKey(e){return{key:{string:e},type:{prim:ie.prim}}}findAndReturnTokens(e,t){return ie.prim===e&&t.push(this),t}}ie.prim="chain_id";class oe extends s.TaquitoError{constructor(){super(),this.name="TicketEncodeError",this.message="Tickets cannot be sent to the blockchain; they are created on-chain"}}const se={prim:"contract"},ae={prim:"int"};class ce extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get valueToken(){return this.createToken(this.val.args[0],this.idx)}Encode(e){throw new oe}EncodeObject(e,t){if(t&&t[ce.prim])return t[ce.prim](e,this.val);throw new oe}Execute(e,t){if(t&&t[ce.prim])return t[ce.prim](e,this.val);const r=this.createToken(se,this.idx),n=this.valueToken,i=this.createToken(ae,this.idx);return void 0===e.args[2]&&void 0!==e.args[1].args?{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1].args[0],t),amount:i.Execute(e.args[1].args[1],t)}:{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1],t),amount:i.Execute(e.args[2],t)}}ExtractSchema(){return{ticketer:C.prim,value:this.valueToken.ExtractSchema(),amount:V.prim}}generateSchema(){return{__michelsonType:ce.prim,schema:{value:this.valueToken.generateSchema(),ticketer:{__michelsonType:C.prim,schema:C.prim},amount:{__michelsonType:V.prim,schema:V.prim}}}}findAndReturnTokens(e,t){return ce.prim===e&&t.push(this),this.valueToken.findAndReturnTokens(e,t),t}}ce.prim="ticket";class ue extends s.TaquitoError{constructor(){super(),this.name="TicketDeprecatedEncodeError",this.message="Ticket_deprecated cannot be sent to the blockchain; they are created on-chain"}}const le={prim:"contract"},fe={prim:"int"};class de extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get valueToken(){return this.createToken(this.val.args[0],this.idx)}Encode(e){throw new ue}EncodeObject(e,t){if(t&&t[de.prim])return t[de.prim](e,this.val);throw new ue}Execute(e,t){if(t&&t[de.prim])return t[de.prim](e,this.val);const r=this.createToken(le,this.idx),n=this.valueToken,i=this.createToken(fe,this.idx);return void 0===e.args[2]&&void 0!==e.args[1].args?{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1].args[0],t),amount:i.Execute(e.args[1].args[1],t)}:{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1],t),amount:i.Execute(e.args[2],t)}}ExtractSchema(){return{ticketer:C.prim,value:this.valueToken.ExtractSchema(),amount:V.prim}}generateSchema(){return{__michelsonType:de.prim,schema:{value:this.valueToken.generateSchema(),ticketer:{__michelsonType:C.prim,schema:C.prim},amount:{__michelsonType:V.prim,schema:V.prim}}}}findAndReturnTokens(e,t){return de.prim===e&&t.push(this),this.valueToken.findAndReturnTokens(e,t),t}}de.prim="ticket_deprecated";class he extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="NeverTokenError"}}class pe extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Encode(e){const t=e.pop();throw new he(t,this,`Assigning a value to the type never is forbidden. Trying to assign ${JSON.stringify(t)}.`)}EncodeObject(e,t){if(t&&t[pe.prim])return t[pe.prim](e);throw new he(e,this,`Assigning a value to the type never is forbidden. Trying to assign ${JSON.stringify(e)}.`)}Execute(e){throw new he(e,this,`There is no literal value for the type never. Trying to execute ${JSON.stringify(e)}.`)}ExtractSchema(){return pe.prim}generateSchema(){return{__michelsonType:pe.prim,schema:pe.prim}}findAndReturnTokens(e,t){return pe.prim===e&&t.push(this),t}}pe.prim="never";class be extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SaplingStateValidationError"}}class me extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}isValid(e){return"object"==typeof e&&0===Object.keys(e).length}Execute(e,t){if(t&&t[me.prim])return t[me.prim](e,this.val);if("int"in e)return e.int;throw new be(e,this,`Sapling state is expecting an object with an int property. Got ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();if(this.isValid(t))return[];throw new be(t,this,`Invalid sapling_state. Received: ${JSON.stringify(t)} while expecting: {}`)}EncodeObject(e,t){if(t&&t[me.prim])return t[me.prim](e);if(this.isValid(e))return[];throw new be(e,this,`Invalid sapling_state. Received: ${JSON.stringify(e)} while expecting: {}`)}ExtractSchema(){return{[me.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:me.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(e,t){return me.prim===e&&t.push(this),t}}me.prim="sapling_state";class ge extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SaplingTransactionValidationError"}}class ve extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){throw new ge(e,this,`There is no literal value for the sapling_transaction type. Got: ${JSON.stringify(e)}.`)}validateBytes(e){const t=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(e);if(t&&t[2].length%2==0)return t[2];throw new ge(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.validateBytes(this.convertUint8ArrayToHexString(t)),{bytes:String(t).toString()}}EncodeObject(e,t){return e=this.validateBytes(this.convertUint8ArrayToHexString(e)),t&&t[ve.prim]?t[ve.prim](e):{bytes:String(e).toString()}}ExtractSchema(){return{[ve.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:ve.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(e,t){return ve.prim===e&&t.push(this),t}}ve.prim="sapling_transaction";class ye extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SaplingTransactionDeprecatedValidationError"}}class _e extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){throw new ye(e,this,`There is no literal value for the sapling_transaction_deprecated type. Got: ${JSON.stringify(e)}.`)}validateBytes(e){const t=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(e);if(t&&t[2].length%2==0)return t[2];throw new ye(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.validateBytes(this.convertUint8ArrayToHexString(t)),{bytes:String(t).toString()}}EncodeObject(e,t){return e=this.validateBytes(this.convertUint8ArrayToHexString(e)),t&&t[_e.prim]?t[_e.prim](e):{bytes:String(e).toString()}}ExtractSchema(){return{[_e.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:_e.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(e,t){return _e.prim===e&&t.push(this),t}}_e.prim="sapling_transaction_deprecated";class we extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="Bls12381frValidationError"}}class Ee extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new we(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return"number"==typeof t?{int:t.toString()}:(t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t})}EncodeObject(e,t){return t&&t[Ee.prim]?t[Ee.prim](e):"number"==typeof e?{int:e.toString()}:(e=this.convertUint8ArrayToHexString(e),this.validate(e),{bytes:e})}Execute(e){return e.bytes}ExtractSchema(){return Ee.prim}generateSchema(){return{__michelsonType:Ee.prim,schema:Ee.prim}}findAndReturnTokens(e,t){return Ee.prim===e&&t.push(this),t}}Ee.prim="bls12_381_fr";class Oe extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="Bls12381g1ValidationError"}}class Se extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Oe(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Se.prim]?t[Se.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Se.prim}generateSchema(){return{__michelsonType:Se.prim,schema:Se.prim}}findAndReturnTokens(e,t){return Se.prim===e&&t.push(this),t}}Se.prim="bls12_381_g1";class Ae extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="Bls12381g2ValidationError"}}class Pe extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Ae(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Pe.prim]?t[Pe.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Pe.prim}generateSchema(){return{__michelsonType:Pe.prim,schema:Pe.prim}}findAndReturnTokens(e,t){return Pe.prim===e&&t.push(this),t}}Pe.prim="bls12_381_g2";class Te extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ChestValidationError"}}class Re extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Te(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Re.prim]?t[Re.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Re.prim}generateSchema(){return{__michelsonType:Re.prim,schema:Re.prim}}findAndReturnTokens(e,t){return Re.prim===e&&t.push(this),t}}Re.prim="chest";class xe extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ChestKeyValidationError"}}class Ie extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new xe(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Ie.prim]?t[Ie.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Ie.prim}generateSchema(){return{__michelsonType:Ie.prim,schema:Ie.prim}}findAndReturnTokens(e,t){return Ie.prim===e&&t.push(this),t}}Ie.prim="chest_key";class Me extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="GlobalConstantEncodingError"}}class Le extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="GlobalConstantDecodingError"}}class ke extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e,t){if(t&&t[ke.prim])return t[ke.prim](e,this.val);throw new Le(e,this,`Unable to decode a value represented by a global constants. Please provide an expanded script to the Michelson-Encoder or semantics for the decoding. The following global constant hash was encountered: ${this.val.args[0].string}.`)}Encode(e){throw new Me(e,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}EncodeObject(e,t){if(t&&t[ke.prim])return t[ke.prim](e);throw new Me(e,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}ExtractSchema(){return ke.prim}generateSchema(){return{__michelsonType:ke.prim,schema:{hash:this.val.args[0].string}}}findAndReturnTokens(e,t){return ke.prim===e&&t.push(this),t}}ke.prim="constant";const Ne=[O,A,P,g,R,k,I,M,y,C,D,B,K,H,G,V,z,W,J,X,Q,ee,re,ie,ce,de,pe,me,ve,_e,Ee,Se,Pe,Re,Ie,ke];class Ce extends s.TaquitoError{constructor(e,t){super(e),this.message=e,this.data=t,this.name="Invalid token error"}}function je(e,t){if(Array.isArray(e))return new O(e,t,je);const r=Ne.find((t=>t.prim===e.prim));if(!r)throw new Ce(`Malformed data: ${JSON.stringify(e)}. Expected a value with a valid prim property`,e);return new r(e,t,je)}class De extends s.InvalidViewParameterError{constructor(e,t,r,n){super(e,t,r,n),this.viewName=e,this.sigs=t,this.args=r,this.cause=n,this.name="ParameterEncodingError",this.message=`Could not encode parameter ${JSON.stringify(r)} received for name "${e}" expecting one of the following signatures ${JSON.stringify(t)}`}}class Ue extends s.TaquitoError{constructor(e,t){super(),this.script=e,this.reason=t,this.name="InvalidScriptError";let r="Invalid on-chain view found in the following script.";t&&(r+=` Reason: ${t}.`),r+=`Script: ${JSON.stringify(e)}`,this.message=r}}class Be extends s.TaquitoError{constructor(e,t){super(),this.script=e,this.reason=t,this.name="InvalidRpcResponseError";let r="Invalid RPC response passed as argument(s).";t&&(r+=` Reason: ${t}.`),r+=` Received: ${JSON.stringify(e)}`,this.message=r}}class Fe extends s.TaquitoError{constructor(e){super(e),this.message=e,this.name="InvalidBigMapSchemaError"}}class Ke extends s.TaquitoError{constructor(e,t){super(e),this.message=e,this.value=t,this.name="InvalidBigMapDiffError"}}class He extends s.TaquitoError{constructor(e,t,r,n){super(),this.details=t,this.schema=r,this.value=n,this.name="BigMapEncodingError",this.message=`Unable to encode the big map ${e}. Schema is: ${JSON.stringify(r)}. The ${e} is: ${JSON.stringify(n)}. Error details: ${t}`}}class Ge extends s.TaquitoError{constructor(e,t,r,n,i){super(),this.details=t,this.schema=r,this.value=n,this.semantics=i,this.name="StorageEncodingError",this.message=`Unable to encode ${e}. The schema is: ${JSON.stringify(r)}, the value is: ${JSON.stringify(n)}.${i?`And the semantic is: ${JSON.stringify(i)}`:""}. Error details: ${t}`}}class $e extends s.TaquitoError{constructor(e){super(e),this.message=e,this.name="MissingArgumentError"}}var Ve;const ze=Symbol.for("taquito-schema-type-symbol");function qe(e,t=O.prim){var r,n;if(Array.isArray(e))return qe({prim:t,args:e},t);const i=e;return i.prim===t&&i.args&&i.args.length>2?Object.assign(Object.assign({},i),{args:[null===(r=i.args)||void 0===r?void 0:r[0],{prim:t,args:null===(n=i.args)||void 0===n?void 0:n.slice(1)}]}):i}function We(e,t){if(void 0===e||void 0===t)return e===t;const r=qe(e),n=qe(t);return r.prim===n.prim&&(void 0===r.args&&void 0===n.args||void 0!==r.args&&void 0!==n.args&&r.args.length===n.args.length&&r.args.every(((e,t)=>{var r,i;return We(e,null!==(i=null===(r=n.args)||void 0===r?void 0:r[t])&&void 0!==i?i:{})})))&&(void 0===r.annots&&void 0===n.annots||void 0!==r.annots&&void 0!==n.annots&&r.annots.length===n.annots.length&&r.annots.every(((e,t)=>{var r;return e===(null===(r=n.annots)||void 0===r?void 0:r[t])})))}class Ze{constructor(e){if(this.val=e,this[Ve]=!0,this.root=je(e,0),this.root instanceof g)this.bigMap=this.root;else if(this.isExpressionExtended(e)&&"pair"===e.prim){const t=e.args[0];this.isExpressionExtended(t)&&"big_map"===t.prim&&(this.bigMap=new g(t,0,je))}}static isSchema(e){return e&&!0===e[ze]}static fromRPCResponse(e){if(!e)throw new Be(e,"the RPC response is empty");if(!e.script)throw new Be(e,"the RPC response has no script");if(!Array.isArray(e.script.code))throw new Be(e,"The response.script.code should be an array");let t=e.script.code;for(;1===t.length&&Array.isArray(t[0]);)t=t[0];const r=t.find((e=>"prim"in e&&"storage"===e.prim));if(!r||!Array.isArray(r.args))throw new Be(e,'The response.script.code has an element of type {prim: "storage"}, but its args is not an array');return new Ze(r.args[0])}isExpressionExtended(e){return"prim"in e&&Array.isArray(e.args)}removeTopLevelAnnotation(e){return(this.root instanceof O||this.root instanceof y)&&this.root.hasAnnotations()&&"object"==typeof e&&1===Object.keys(e).length?e[Object.keys(e)[0]]:e}Execute(e,t){const r=this.root.Execute(e,t);return this.removeTopLevelAnnotation(r)}Typecheck(e){this.root instanceof g&&Number.isInteger(Number(e))||this.root instanceof ce&&e.ticketer&&e.value&&e.amount||this.root instanceof de&&e.ticketer&&e.value&&e.amount||this.root instanceof I&&this.root.ValueSchema instanceof g||this.root.EncodeObject(e)}ExecuteOnBigMapDiff(e,t){if(!this.bigMap)throw new Fe("Big map schema is undefined");if(!Array.isArray(e))throw new Ke(`Big map diff must be an array, got: ${JSON.stringify(e)}`,e);const r=e.map((({key:e,value:t})=>({args:[e,t]})));return this.bigMap.Execute(r,t)}ExecuteOnBigMapValue(e,t){if(!this.bigMap)throw new Fe("Big map schema is undefined");return this.bigMap.ValueSchema.Execute(e,t)}EncodeBigMapKey(e){if(!this.bigMap)throw new Fe("Big map schema is undefined");try{return this.bigMap.KeySchema.ToBigMapKey(e)}catch(t){throw new He("key",t,this.bigMap.KeySchema,e)}}Encode(e,t){try{return this.root.EncodeObject(e,t)}catch(r){if(r instanceof h)throw r;throw new Ge("storage object",r,this.root,e,t)}}ExtractSchema(){return this.removeTopLevelAnnotation(this.root.ExtractSchema())}generateSchema(){return this.removeTopLevelAnnotation(this.root.generateSchema())}ComputeState(e,t){if(!this.bigMap)throw new Fe("Big map schema is undefined");const r=e.reduce(((e,t)=>Object.assign(Object.assign({},e),this.ExecuteOnBigMapDiff(t.contents[0].metadata.operation_result.big_map_diff))),{});return Object.assign(Object.assign({},this.Execute(t)),{[this.bigMap.annot()]:r})}FindFirstInTopLevelPair(e,t){return this.findValue(this.root.val,e,t)}findValue(e,t,r){if(We(r,e))return t;if(Array.isArray(e)||"pair"===e.prim){const n=qe(e),i=qe(t,"Pair");if(void 0===n.args||void 0===i.args)throw new $e("Tokens have no arguments");if(n.args[0])return this.findValue(n.args[0],i.args[0],r)||this.findValue(n.args[1],i.args[1],r)}}findToken(e){return this.root.findAndReturnTokens(e,[])}}Ve=ze;class Je{constructor(e){this.root=je(e,0)}static fromRPCResponse(e){if(!e)throw new Be(e,"the RPC response is empty");if(!e.script)throw new Be(e,"the RPC response has no script");if(!Array.isArray(e.script.code))throw new Be(e,"The response.script.code should be an array");const t=e.script.code.find((e=>"prim"in e&&"parameter"===e.prim));if(!t)throw new Be(e,'The response.script.code should have an element of type {prim: "parameter"}');if(!Array.isArray(t.args))throw new Be(e,'The response.script.code has an element of type {prim: "parameter"}, but its args is not an array');return new Je(t.args[0])}get isMultipleEntryPoint(){return this.root instanceof y||this.root instanceof H&&this.root.subToken()instanceof y}get hasAnnotation(){return!this.isMultipleEntryPoint||"0"!==Object.keys(this.ExtractSchema())[0]}Execute(e,t){return this.root.Execute(e,t)}Encode(...e){try{return this.root.Encode(e.reverse())}catch(t){if(t instanceof h)throw t;throw new De("Unable to encode parameter",this.root,e,t)}}EncodeObject(e,t){try{return this.root.EncodeObject(e,t)}catch(t){if(t instanceof h)throw t;throw new De("Unable to encode parameter object",this.root,e,t)}}ExtractSchema(){return this.root.ExtractSchema()}generateSchema(){return this.root.generateSchema()}ExtractSignatures(){return this.root.ExtractSignature()}}class Ye{constructor(e){if(!e)throw new Ue(e,"the args are not defined");if(4!==e.length)throw new Ue(e,"there should be exactly 4 arguments");if(!("string"in e[0])||!e[0].string)throw new Ue(e,"The first argument should be a string, representing the view name. It should be in the form: { string: 'viewName' }");this.viewName=e[0].string,this.viewArgsType=e[1],this.viewReturnType=e[2],this.instructions=e[3],this.rootArgsType=je(this.viewArgsType,0),this.rootReturnType=je(this.viewReturnType,0)}static fromRPCResponse(e){const t=[],r=e&&e.script&&Array.isArray(e.script.code)&&e.script.code.filter((e=>"view"===e.prim));return r&&r.forEach((e=>{t.push(new Ye(e.args))})),t}encodeViewArgs(e){try{return this.rootArgsType.EncodeObject(e)}catch(t){throw new De(this.viewName,void 0,e,t)}}decodeViewResult(e,t){return this.rootReturnType.Execute(e,t)}extractArgsSchema(){return this.rootArgsType.ExtractSchema()}extractResultSchema(){return this.rootReturnType.ExtractSchema()}}class Xe{constructor(e,t){this.tag=e,this.type=t}static fromMichelineValue(e){var t,r;return new Xe(null===(t=e.annots)||void 0===t?void 0:t[0],null===(r=e.args)||void 0===r?void 0:r[0])}static fromRPCResponse(e){const t=[];return e.script.code.forEach((e=>{"prim"in e&&"code"===e.prim&&"args"in e&&e.args&&t.push(...Xe.extractEventsRecursively(e.args))})),Xe.removeDuplicates(t)}static removeDuplicates(e){const t=[];return e.forEach((e=>{-1===t.findIndex((t=>t.tag===e.tag&&We(t.type,e.type)))&&t.push(e)})),t}static extractEventsRecursively(e){return Array.isArray(e)?e.flatMap((e=>Xe.extractEventsRecursively(e))):"prim"in e?"EMIT"===e.prim?[Xe.fromMichelineValue(e)]:"args"in e&&e.args?e.args.flatMap((e=>Xe.extractEventsRecursively(e))):[]:[]}}const Qe={commitHash:"e1b1d6976a564f925c01cf66e28df9acb0085c3d",version:"17.3.1-beta-RC.0"},et=Symbol(),tt={}},6368:(e,t,r)=>{"use strict";r.r(t),r.d(t,{METADATA_BALANCE_UPDATES_CATEGORY:()=>b,OPERATION_METADATA:()=>p,OpKind:()=>O,PvmKind:()=>m,RpcClient:()=>A,RpcClientCache:()=>h,SmartRollupInputProofKind:()=>v,SmartRollupRefutationOptions:()=>g,SmartRollupRefuteGameEndedPlayerOutcomes:()=>w,SmartRollupRefuteGameEndedReason:()=>E,SmartRollupRefuteGameStatusOptions:()=>_,SmartRollupRefuteRevealProofKind:()=>y,VERSION:()=>S,castToBigNumber:()=>d,defaultChain:()=>u,defaultRPCOptions:()=>l});var n=r(5543),i=r(2558),o=r(4632),s=r(227);function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function c(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const u="main",l={block:"head"};var f;function d(e,t){const r=Array.isArray(e);void 0===t&&(t=Object.keys(e));const n=r?[]:{};return t.forEach((t=>{const r=e[t];let o;if(void 0!==r){if(Array.isArray(r))return o=d(r),void(n[t]=o);o=new i.Z(r),n[t]=o}})),n}!function(e){e.GET_BAKING_RIGHTS="getBakingRights",e.GET_BALLOTS="getBallots",e.GET_BALLOT_LIST="getBallotList",e.GET_BIG_MAP_KEY="getBigMapKey",e.GET_BIG_MAP_EXPR="getBigMapExpr",e.GET_BLOCK_HASH="getBlockHash",e.GET_BLOCK="getBlock",e.GET_BLOCK_HEADER="getBlockHeader",e.GET_BLOCK_METADATA="getBlockMetadata",e.GET_BALANCE="getBalance",e.GET_CHAIN_ID="getChainId",e.GET_CONSTANTS="getConstants",e.GET_CONTRACT="getContract",e.GET_CURRENT_PERIOD="getCurrentPeriod",e.GET_CURRENT_PROPOSAL="getCurrentProposal",e.GET_CURRENT_QUORUM="getCurrentQuorum",e.GET_DELEGATE="getDelegate",e.GET_DELEGATES="getDelegates",e.GET_VOTING_INFO="getVotingInfo",e.GET_ENDORSING_RIGHTS="getEndorsingRights",e.GET_ENTRYPOINTS="getEntrypoints",e.GET_LIVE_BLOCKS="getLiveBlocks",e.GET_MANAGER_KEY="getManagerKey",e.GET_NORMALIZED_SCRIPT="getNormalizedScript",e.GET_PROPOSALS="getProposals",e.GET_PROTOCOLS="getProtocols",e.GET_SAPLING_DIFF_BY_CONTRACT="getSaplingDiffByContract",e.GET_SAPLING_DIFF_BY_ID="getSaplingDiffById",e.GET_SCRIPT="getScript",e.GET_STORAGE="getStorage",e.GET_SUCCESSOR_PERIOD="getSuccessorPeriod",e.GET_TX_ROLLUP_INBOX="getTxRollupInbox",e.GET_TX_ROLLUP_STATE="getTxRollupState",e.GET_VOTES_LISTINGS="getVotesListings",e.PACK_DATA="packData",e.GET_STORAGE_USED_SPACE="getStorageUsedSpace",e.GET_STORAGE_PAID_SPACE="getStoragePaidSpace",e.GET_TICKET_BALANCE="getTicketBalance",e.GET_ALL_TICKET_BALANCES="getAllTicketBalances",e.GET_PENDING_OPERATIONS="getPendingOperations",e.GET_ORIGINATION_PROOF="getOriginationProof"}(f||(f={}));class h{constructor(e,t=1e3){this.rpcClient=e,this.ttl=t,this._cache={}}getAllCachedData(){return this._cache}deleteAllCachedData(){for(const e in this._cache)delete this._cache[e]}formatCacheKey(e,t,r,n){let i="";return r.forEach((e=>{i="object"==typeof e?i+JSON.stringify(e)+"/":i+e+"/"})),n?`${e}/${t}/${i}${JSON.stringify(n)}/`:`${e}/${t}/${i}`}has(e){return e in this._cache}get(e){return this._cache[e].response}put(e,t){const r=setTimeout((()=>this.remove(e)),this.ttl);Object.assign(this._cache,{[e]:{handle:r,response:t}})}remove(e){e in this._cache&&delete this._cache[e]}validateAddress(e){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t))}validateContract(e){const t=(0,o.validateContractAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidContractAddressError(e,(0,o.invalidDetail)(t))}getBlockHash({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BLOCK_HASH,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlockHash({block:e});return this.put(t,r),r}}))}getLiveBlocks({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_LIVE_BLOCKS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getLiveBlocks({block:e});return this.put(t,r),r}}))}getBalance(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BALANCE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getBalance(e,{block:t});return this.put(r,n),n}}))}getStorage(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateContract(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_STORAGE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStorage(e,{block:t});return this.put(r,n),n}}))}getScript(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateContract(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_SCRIPT,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getScript(e,{block:t});return this.put(r,n),n}}))}getNormalizedScript(e,t={unparsing_mode:"Readable"},{block:r}=l){return c(this,void 0,void 0,(function*(){this.validateContract(e);const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_NORMALIZED_SCRIPT,[r,e],t);if(this.has(n))return this.get(n);{const i=this.rpcClient.getNormalizedScript(e,t,{block:r});return this.put(n,i),i}}))}getContract(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_CONTRACT,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getContract(e,{block:t});return this.put(r,n),n}}))}getManagerKey(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_MANAGER_KEY,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getManagerKey(e,{block:t});return this.put(r,n),n}}))}getDelegate(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_DELEGATE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getDelegate(e,{block:t});return this.put(r,n),n}}))}getBigMapKey(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BIG_MAP_KEY,[r,e],t);if(this.has(n))return this.get(n);{const i=this.rpcClient.getBigMapKey(e,t,{block:r});return this.put(n,i),i}}))}getBigMapExpr(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BIG_MAP_EXPR,[r,e,t]);if(this.has(n))return this.get(n);{const i=this.rpcClient.getBigMapExpr(e,t,{block:r});return this.put(n,i),i}}))}getDelegates(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_DELEGATES,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getDelegates(e,{block:t});return this.put(r,n),n}}))}getVotingInfo(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_VOTING_INFO,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getVotingInfo(e,{block:t});return this.put(r,n),n}}))}getConstants({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_CONSTANTS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getConstants({block:e});return this.put(t,r),r}}))}getBlock({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BLOCK,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlock({block:e});return this.put(t,r),r}}))}getBlockHeader({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BLOCK_HEADER,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlockHeader({block:e});return this.put(t,r),r}}))}getBlockMetadata({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BLOCK_METADATA,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlockMetadata({block:e});return this.put(t,r),r}}))}getBakingRights(e={},{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BAKING_RIGHTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getBakingRights(e,{block:t});return this.put(r,n),n}}))}getEndorsingRights(e={},{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_ENDORSING_RIGHTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getEndorsingRights(e,{block:t});return this.put(r,n),n}}))}getBallotList({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BALLOT_LIST,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBallotList({block:e});return this.put(t,r),r}}))}getBallots({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BALLOTS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBallots({block:e});return this.put(t,r),r}}))}getCurrentProposal({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_CURRENT_PROPOSAL,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getCurrentProposal({block:e});return this.put(t,r),r}}))}getCurrentQuorum({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_CURRENT_QUORUM,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getCurrentQuorum({block:e});return this.put(t,r),r}}))}getVotesListings({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_VOTES_LISTINGS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getVotesListings({block:e});return this.put(t,r),r}}))}getProposals({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_PROPOSALS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getProposals({block:e});return this.put(t,r),r}}))}forgeOperations(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.rpcClient.forgeOperations(e,{block:t})}))}injectOperation(e){return c(this,void 0,void 0,(function*(){return this.rpcClient.injectOperation(e)}))}preapplyOperations(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.rpcClient.preapplyOperations(e,{block:t})}))}getEntrypoints(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateContract(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_ENTRYPOINTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getEntrypoints(e,{block:t});return this.put(r,n),n}}))}runOperation(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.rpcClient.runOperation(e,{block:t})}))}simulateOperation(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.rpcClient.simulateOperation(e,{block:t})}))}runCode(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.rpcClient.runCode(e,{block:t})}))}runScriptView(e,{block:t}=l){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]);return c(this,void 0,void 0,(function*(){return this.rpcClient.runScriptView(Object.assign({unparsing_mode:r},n),{block:t})}))}runView(e,{block:t}=l){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]);return c(this,void 0,void 0,(function*(){return this.rpcClient.runView(Object.assign({unparsing_mode:r},n),{block:t})}))}getChainId(){return c(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_CHAIN_ID,[]);if(this.has(e))return this.get(e);{const t=this.rpcClient.getChainId();return this.put(e,t),t}}))}packData(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.PACK_DATA,[t],e);if(this.has(r))return this.get(r);{const n=this.rpcClient.packData(e,{block:t});return this.put(r,n),n}}))}getRpcUrl(){return this.rpcClient.getRpcUrl()}getCurrentPeriod({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_CURRENT_PERIOD,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getCurrentPeriod({block:e});return this.put(t,r),r}}))}getSuccessorPeriod({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_SUCCESSOR_PERIOD,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getSuccessorPeriod({block:e});return this.put(t,r),r}}))}getSaplingDiffById(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_SAPLING_DIFF_BY_ID,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getSaplingDiffById(e,{block:t});return this.put(r,n),n}}))}getSaplingDiffByContract(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_SAPLING_DIFF_BY_CONTRACT,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getSaplingDiffByContract(e,{block:t});return this.put(r,n),n}}))}getProtocols({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_PROTOCOLS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getProtocols({block:e});return this.put(t,r),r}}))}getTxRollupState(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_TX_ROLLUP_STATE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getTxRollupState(e,{block:t});return this.put(r,n),n}}))}getTxRollupInbox(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_TX_ROLLUP_INBOX,[r,e,t]);if(this.has(n))return this.get(n);{const i=this.rpcClient.getTxRollupInbox(e,t,{block:r});return this.put(n,i),i}}))}getStorageUsedSpace(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_STORAGE_USED_SPACE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStorageUsedSpace(e,{block:t});return this.put(r,n),n}}))}getStoragePaidSpace(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_STORAGE_PAID_SPACE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStoragePaidSpace(e,{block:t});return this.put(r,n),n}}))}getTicketBalance(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_TICKET_BALANCE,[r,e],t);if(this.has(n))return this.get(n);{const i=this.rpcClient.getTicketBalance(e,t,{block:r});return this.put(n,i),i}}))}getAllTicketBalances(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_ALL_TICKET_BALANCES,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getAllTicketBalances(e,{block:t});return this.put(r,n),n}}))}getPendingOperations(e={}){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_PENDING_OPERATIONS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getPendingOperations(e);return this.put(t,r),r}}))}getOriginationProof(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_ORIGINATION_PROOF,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getOriginationProof(e,{block:t});return this.put(r,n),n}}))}}var p,b,m,g,v,y,_,w,E,O;!function(e){e.TOO_LARGE="too large"}(p||(p={})),function(e){e.BAKING_REWARDS="baking rewards",e.REWARDS="rewards",e.FEES="fees",e.DEPOSITS="deposits",e.LEGACY_REWARDS="legacy_rewards",e.LEGACY_FEES="legacy_fees",e.LEGACY_DEPOSITS="legacy_deposits",e.BLOCK_FEES="block fees",e.NONCE_REVELATION_REWARDS="nonce revelation rewards",e.DOUBLE_SIGNING_EVIDENCE_REWARDS="double signing evidence rewards",e.ENDORSING_REWARDS="endorsing rewards",e.BAKING_BONUSES="baking bonuses",e.STORAGE_FEES="storage fees",e.PUNISHMENTS="punishments",e.LOST_ENDORSING_REWARDS="lost endorsing rewards",e.SUBSIDY="subsidy",e.BURNED="burned",e.COMMITMENT="commitment",e.BOOTSTRAP="bootstrap",e.INVOICE="invoice",e.MINTED="minted",e.TX_ROLLUP_REJECTION_REWARDS="tx_rollup_rejection_rewards",e.TX_ROLLUP_REJECTION_PUNISHMENTS="tx_rollup_rejection_punishments",e.BONDS="bonds"}(b||(b={})),function(e){e.WASM2="wasm_2_0_0",e.ARITH="arith"}(m||(m={})),function(e){e.START="start",e.MOVE="move"}(g||(g={})),function(e){e.INBOX_PROOF="inbox_proof",e.REVEAL_PROOF="reveal_proof",e.FIRST_INPUT="first_input"}(v||(v={})),function(e){e.RAW_DATA_PROOF="raw_data_proof",e.METADATA_PROOF="metadata_proof",e.DAL_PAGE_PROOF="dal_page_proof"}(y||(y={})),function(e){e.ONGOING="ongoing",e.ENDED="ended"}(_||(_={})),function(e){e.LOSER="loser",e.DRAW="draw"}(w||(w={})),function(e){e.CONFLICT_RESOLVED="conflict_resolved",e.TIMEOUT="timeout"}(E||(E={})),function(e){e.ORIGINATION="origination",e.DELEGATION="delegation",e.REVEAL="reveal",e.TRANSACTION="transaction",e.ACTIVATION="activate_account",e.ENDORSEMENT="endorsement",e.PREENDORSEMENT="preendorsement",e.SET_DEPOSITS_LIMIT="set_deposits_limit",e.DOUBLE_PREENDORSEMENT_EVIDENCE="double_preendorsement_evidence",e.ENDORSEMENT_WITH_SLOT="endorsement_with_slot",e.SEED_NONCE_REVELATION="seed_nonce_revelation",e.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",e.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",e.PROPOSALS="proposals",e.BALLOT="ballot",e.FAILING_NOOP="failing_noop",e.REGISTER_GLOBAL_CONSTANT="register_global_constant",e.TX_ROLLUP_ORIGINATION="tx_rollup_origination",e.TX_ROLLUP_SUBMIT_BATCH="tx_rollup_submit_batch",e.TX_ROLLUP_COMMIT="tx_rollup_commit",e.TX_ROLLUP_RETURN_BOND="tx_rollup_return_bond",e.TX_ROLLUP_FINALIZE_COMMITMENT="tx_rollup_finalize_commitment",e.TX_ROLLUP_REMOVE_COMMITMENT="tx_rollup_remove_commitment",e.TX_ROLLUP_REJECTION="tx_rollup_rejection",e.TX_ROLLUP_DISPATCH_TICKETS="tx_rollup_dispatch_tickets",e.TRANSFER_TICKET="transfer_ticket",e.INCREASE_PAID_STORAGE="increase_paid_storage",e.UPDATE_CONSENSUS_KEY="update_consensus_key",e.DRAIN_DELEGATE="drain_delegate",e.VDF_REVELATION="vdf_revelation",e.EVENT="event",e.TICKET_UPDATES="ticket_updates",e.SMART_ROLLUP_ORIGINATE="smart_rollup_originate",e.SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",e.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message",e.SMART_ROLLUP_PUBLISH="smart_rollup_publish",e.SMART_ROLLUP_CEMENT="smart_rollup_cement",e.SMART_ROLLUP_RECOVER_BOND="smart_rollup_recover_bond",e.SMART_ROLLUP_REFUTE="smart_rollup_refute",e.SMART_ROLLUP_TIMEOUT="smart_rollup_timeout"}(O||(O={}));const S={commitHash:"e1b1d6976a564f925c01cf66e28df9acb0085c3d",version:"17.3.1-beta-RC.0"};class A{constructor(e,t=u,r=new n.HttpBackend){this.url=e,this.chain=t,this.httpBackend=r}createURL(e){return`${this.url.replace(/\/+$/g,"")}${e}`}validateAddress(e){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t))}validateContract(e){const t=(0,o.validateContractAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidContractAddressError(e,(0,o.invalidDetail)(t))}getBlockHash({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/hash`),method:"GET"})}))}getLiveBlocks({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/live_blocks`),method:"GET"})}))}getBalance(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/balance`),method:"GET"});return new i.Z(r)}))}getStorage(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.validateContract(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/storage`),method:"GET"})}))}getScript(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.validateContract(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/script`),method:"GET"})}))}getNormalizedScript(e,t={unparsing_mode:"Readable"},{block:r}=l){return c(this,void 0,void 0,(function*(){return this.validateContract(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${e}/script/normalized`),method:"POST"},t)}))}getContract(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}`),method:"GET"});return Object.assign(Object.assign({},r),{balance:new i.Z(r.balance)})}))}getManagerKey(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.validateAddress(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/manager_key`),method:"GET"})}))}getDelegate(e,{block:t}=l){return c(this,void 0,void 0,(function*(){let r;this.validateAddress(e);try{r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/delegate`),method:"GET"})}catch(e){if(!(e instanceof n.HttpResponseError&&e.status===n.STATUS_CODE.NOT_FOUND))throw e;r=null}return r}))}getBigMapKey(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){return this.validateAddress(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${e}/big_map_get`),method:"POST"},t)}))}getBigMapExpr(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/big_maps/${e}/${t}`),method:"GET"})}))}getDelegates(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/delegates/${e}`),method:"GET"}),n=d(r,["balance","full_balance","current_frozen_deposits","frozen_deposits","frozen_balance","frozen_deposits_limit","staking_balance","delegated_balance","voting_power"]);return Object.assign(Object.assign(Object.assign({},r),n),{frozen_balance_by_cycle:r.frozen_balance_by_cycle?r.frozen_balance_by_cycle.map((e=>{var{deposit:t,deposits:r,fees:n,rewards:i}=e,o=a(e,["deposit","deposits","fees","rewards"]);const s=d({deposit:t,deposits:r,fees:n,rewards:i},["deposit","deposits","fees","rewards"]);return Object.assign(Object.assign({},o),{deposit:s.deposit,deposits:s.deposits,fees:s.fees,rewards:s.rewards})})):void 0})}))}getVotingInfo(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.validateAddress(e),yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/delegates/${e}/voting_info`),method:"GET"})}))}getConstants({block:e}=l){return c(this,void 0,void 0,(function*(){const t=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/constants`),method:"GET"}),r=d(t,["time_between_blocks","hard_gas_limit_per_operation","hard_gas_limit_per_block","proof_of_work_threshold","tokens_per_roll","seed_nonce_revelation_tip","block_security_deposit","endorsement_security_deposit","block_reward","endorsement_reward","cost_per_byte","hard_storage_limit_per_operation","test_chain_duration","baking_reward_per_endorsement","delay_per_missing_endorsement","minimal_block_delay","liquidity_baking_subsidy","cache_layout","baking_reward_fixed_portion","baking_reward_bonus_per_slot","endorsing_reward_per_slot","double_baking_punishment","delay_increment_per_round","tx_rollup_commitment_bond","vdf_difficulty","sc_rollup_stake_amount","minimal_stake"]);return Object.assign(Object.assign({},t),r)}))}getBlock({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}`),method:"GET"})}))}getBlockHeader({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/header`),method:"GET"})}))}getBlockMetadata({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/metadata`),method:"GET"})}))}getBakingRights(e={},{block:t}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/baking_rights`),method:"GET",query:e})}))}getEndorsingRights(e={},{block:t}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/endorsing_rights`),method:"GET",query:e})}))}getBallotList({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/ballot_list`),method:"GET"})}))}getBallots({block:e}=l){return c(this,void 0,void 0,(function*(){return d(yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/ballots`),method:"GET"}),["yay","nay","pass"])}))}getCurrentProposal({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/current_proposal`),method:"GET"})}))}getCurrentQuorum({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/current_quorum`),method:"GET"})}))}getVotesListings({block:e}=l){return c(this,void 0,void 0,(function*(){const t=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/listings`),method:"GET"});return t.map((e=>(e.voting_power&&(e.voting_power=new i.Z(e.voting_power)),e))),t}))}getProposals({block:e}=l){return c(this,void 0,void 0,(function*(){const t=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/proposals`),method:"GET"});return t.map((e=>e[1]=new i.Z(e[1]))),t}))}forgeOperations(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/forge/operations`),method:"POST"},e)}))}injectOperation(e){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL("/injection/operation"),method:"POST"},e)}))}preapplyOperations(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/preapply/operations`),method:"POST"},e)}))}getEntrypoints(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateContract(e);return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/entrypoints`),method:"GET"})}))}runOperation(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/run_operation`),method:"POST"},e)}))}simulateOperation(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/simulate_operation`),method:"POST"},e)}))}runCode(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/run_code`),method:"POST"},e)}))}runScriptView(e,{block:t}=l){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]);return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/run_script_view`),method:"POST"},Object.assign({unparsing_mode:r},n))}))}runView(e,{block:t}=l){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]);return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/run_view`),method:"POST"},Object.assign({unparsing_mode:r},n))}))}getChainId(){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/chain_id`),method:"GET"})}))}packData(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/pack_data`),method:"POST"},e),{gas:n}=r,o=a(r,["gas"]);let s=n;const c=new i.Z(n||"");return c.isNaN()||(s=c),Object.assign({gas:s},o)}))}getRpcUrl(){return this.url}getCurrentPeriod({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/current_period`),method:"GET"})}))}getSuccessorPeriod({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/successor_period`),method:"GET"})}))}getSaplingDiffById(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/sapling/${e}/get_diff`),method:"GET"})}))}getSaplingDiffByContract(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/single_sapling_get_diff`),method:"GET"})}))}getProtocols({block:e}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/protocols`),method:"GET"})}))}getTxRollupState(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/tx_rollup/${e}/state`),method:"GET"})}))}getTxRollupInbox(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/tx_rollup/${e}/inbox/${t}`),method:"GET"})}))}getStorageUsedSpace(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/storage/used_space`),method:"GET"})}))}getStoragePaidSpace(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/storage/paid_space`),method:"GET"})}))}getTicketBalance(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${e}/ticket_balance`),method:"POST"},t)}))}getAllTicketBalances(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/all_ticket_balances`),method:"GET"})}))}getPendingOperations(e={}){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/mempool/pending_operations`),method:"GET",query:e})}))}getOriginationProof(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/smart_rollups/all/origination_proof`),method:"POST"},e)}))}}},4632:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DeprecationError:()=>f.DeprecationError,InvalidAddressError:()=>f.InvalidAddressError,InvalidBlockHashError:()=>f.InvalidBlockHashError,InvalidChainIdError:()=>f.InvalidChainIdError,InvalidContractAddressError:()=>f.InvalidContractAddressError,InvalidHexStringError:()=>f.InvalidHexStringError,InvalidKeyError:()=>f.InvalidKeyError,InvalidKeyHashError:()=>f.InvalidKeyHashError,InvalidMessageError:()=>f.InvalidMessageError,InvalidOperationHashError:()=>f.InvalidOperationHashError,InvalidOperationKindError:()=>f.InvalidOperationKindError,InvalidProtocolHashError:()=>E,InvalidPublicKeyError:()=>f.InvalidPublicKeyError,InvalidSignatureError:()=>f.InvalidSignatureError,Prefix:()=>n,ProhibitedActionError:()=>f.ProhibitedActionError,VERSION:()=>q,ValidationResult:()=>S,ValueConversionError:()=>O,b58cdecode:()=>te,b58cencode:()=>ee,b58decode:()=>re,b58decodeL2Address:()=>ne,buf2hex:()=>fe,bytes2Char:()=>pe,char2Bytes:()=>he,encodeExpr:()=>X,encodeKey:()=>se,encodeKeyHash:()=>ae,encodeL2Address:()=>oe,encodeOpHash:()=>Q,encodePubKey:()=>ie,format:()=>Y,getPkhfromPk:()=>de,hex2Bytes:()=>be,hex2buf:()=>ce,invalidDetail:()=>V,isValidPrefix:()=>A,mergebuf:()=>ue,mic2arr:()=>le,num2PaddedHex:()=>ge,prefix:()=>g,prefixLength:()=>v,stripHexPrefix:()=>ve,toHexBuf:()=>me,validateAddress:()=>C,validateBlock:()=>G,validateChain:()=>j,validateContractAddress:()=>D,validateKeyHash:()=>U,validateOperation:()=>K,validatePkAndExtractPrefix:()=>_,validateProtocol:()=>H,validatePublicKey:()=>F,validateSignature:()=>B,validateSmartRollupAddress:()=>z,validateSpendingKey:()=>$,verifySignature:()=>y});var n,i=r(8834),o=r(7728),s=r(6851),a=r(1395),c=r.n(a),u=r(4075),l=r.n(u),f=r(227),d=r(2558),h=r(7554),p=r.n(h),b=r(8743),m=r.n(b);!function(e){e.TZ1="tz1",e.TZ2="tz2",e.TZ3="tz3",e.TZ4="tz4",e.KT="KT",e.KT1="KT1",e.EDSK2="edsk2",e.SPSK="spsk",e.P2SK="p2sk",e.EDPK="edpk",e.SPPK="sppk",e.P2PK="p2pk",e.BLPK="BLpk",e.EDESK="edesk",e.SPESK="spesk",e.P2ESK="p2esk",e.EDSK="edsk",e.EDSIG="edsig",e.SPSIG="spsig",e.P2SIG="p2sig",e.SIG="sig",e.NET="Net",e.NCE="nce",e.B="B",e.O="o",e.LO="Lo",e.LLO="LLo",e.P="P",e.CO="Co",e.ID="id",e.EXPR="expr",e.TZ="TZ",e.VH="vh",e.SASK="sask",e.ZET1="zet1",e.TXR1="txr1",e.TXI="txi",e.TXM="txm",e.TXC="txc",e.TXMR="txmr",e.TXRL="txM",e.TXW="txw",e.SR1="sr1",e.SRC1="src1"}(n||(n={}));const g={[n.TZ1]:new Uint8Array([6,161,159]),[n.TZ2]:new Uint8Array([6,161,161]),[n.TZ3]:new Uint8Array([6,161,164]),[n.TZ4]:new Uint8Array([6,161,166]),[n.KT]:new Uint8Array([2,90,121]),[n.KT1]:new Uint8Array([2,90,121]),[n.EDSK]:new Uint8Array([43,246,78,7]),[n.EDSK2]:new Uint8Array([13,15,58,7]),[n.SPSK]:new Uint8Array([17,162,224,201]),[n.P2SK]:new Uint8Array([16,81,238,189]),[n.EDPK]:new Uint8Array([13,15,37,217]),[n.SPPK]:new Uint8Array([3,254,226,86]),[n.P2PK]:new Uint8Array([3,178,139,127]),[n.BLPK]:new Uint8Array([6,149,135,204]),[n.EDESK]:new Uint8Array([7,90,60,179,41]),[n.SPESK]:new Uint8Array([9,237,241,174,150]),[n.P2ESK]:new Uint8Array([9,48,57,115,171]),[n.EDSIG]:new Uint8Array([9,245,205,134,18]),[n.SPSIG]:new Uint8Array([13,115,101,19,63]),[n.P2SIG]:new Uint8Array([54,240,44,52]),[n.SIG]:new Uint8Array([4,130,43]),[n.NET]:new Uint8Array([87,82,0]),[n.NCE]:new Uint8Array([69,220,169]),[n.B]:new Uint8Array([1,52]),[n.O]:new Uint8Array([5,116]),[n.LO]:new Uint8Array([133,233]),[n.LLO]:new Uint8Array([29,159,109]),[n.P]:new Uint8Array([2,170]),[n.CO]:new Uint8Array([79,179]),[n.ID]:new Uint8Array([153,103]),[n.EXPR]:new Uint8Array([13,44,64,27]),[n.TZ]:new Uint8Array([2,90,121]),[n.VH]:new Uint8Array([1,106,242]),[n.SASK]:new Uint8Array([11,237,20,92]),[n.ZET1]:new Uint8Array([18,71,40,223]),[n.TXR1]:new Uint8Array([1,128,120,31]),[n.TXI]:new Uint8Array([79,148,196]),[n.TXM]:new Uint8Array([79,149,30]),[n.TXC]:new Uint8Array([79,148,17]),[n.TXMR]:new Uint8Array([18,7,206,87]),[n.TXRL]:new Uint8Array([79,146,82]),[n.TXW]:new Uint8Array([79,150,72]),[n.SR1]:new Uint8Array([6,124,117]),[n.SRC1]:new Uint8Array([17,165,134,138])},v={[n.TZ1]:20,[n.TZ2]:20,[n.TZ3]:20,[n.TZ4]:20,[n.KT]:20,[n.KT1]:20,[n.EDPK]:32,[n.SPPK]:33,[n.P2PK]:33,[n.BLPK]:48,[n.EDSIG]:64,[n.SPSIG]:64,[n.P2SIG]:64,[n.SIG]:64,[n.NET]:4,[n.B]:32,[n.P]:32,[n.O]:32,[n.VH]:32,[n.SASK]:169,[n.ZET1]:43,[n.TXR1]:20,[n.TXI]:32,[n.TXM]:32,[n.TXC]:32,[n.TXMR]:32,[n.TXRL]:32,[n.TXW]:32,[n.SR1]:20,[n.SRC1]:32};function y(e,t,r,i){const a=_(t),c=function(e){const t=e.startsWith("sig")?e.substring(0,3):e.substring(0,5),r=B(e);if(r!==S.VALID)throw new f.InvalidSignatureError(e,V(r));return t}(r),u=te(t,g[a]),l=te(r,g[c]);let d=ce(function(e){if(""===e)throw new f.InvalidMessageError(e,"can't be empty");return e}(e));void 0!==i&&(d=ue(i,d));const h=(0,s.vp)(d,32);return a===n.EDPK?function(e,t,r){try{return(0,o.T)(r,t,e)}catch(e){return!1}}(l,h,u):a===n.SPPK?function(e,t,r){const n=new(p().ec)("secp256k1").keyFromPublic(r);return w(e,t,n)}(l,h,u):a===n.P2PK&&function(e,t,r){const n=new(p().ec)("p256").keyFromPublic(r);return w(e,t,n)}(l,h,u)}function _(e){if(""===e)throw new f.InvalidPublicKeyError(e,"can't be empty");const t=e.substring(0,4),r=F(e);if(r!==S.VALID)throw new f.InvalidPublicKeyError(e,V(r));return t}function w(e,t,r){const n=fe(m()(e)).match(/([a-f\d]{64})/gi);if(n)try{const[e,i]=n;return r.verify(t,{r:e,s:i})}catch(e){return!1}return!1}class E extends f.ParameterValidationError{constructor(e,t){super(),this.protocolHash=e,this.errorDetails=t,this.name="InvalidProtocolHashError",this.name="InvalidProtocolHashError",this.message=`The protocol hash '${e}' is invalid`,t&&(this.message+=`: ${t}`)}}class O extends f.UnsupportedActionError{constructor(e,t){super(),this.value=e,this.desiredType=t,this.name="ValueConversionError",this.message=`Unable to convert ${e} to a ${t}`}}var S;function A(e){return"string"==typeof e&&e in g}function P(e,t){const r=new RegExp(`^(${t.join("|")})`).exec(e);if(!r||0===r.length)return S.NO_PREFIX_MATCHED;const n=r[0];if(!A(n))return S.NO_PREFIX_MATCHED;e.includes("%")&&(e=e.split("%")[0]);if(!/^(KT1\w{33})$/.test(e)&&"KT1"===n)return S.INVALID_CHECKSUM;let i=l().decodeUnsafe(e);return i?(i=i.slice(g[n].length),i.length!==v[n]?S.INVALID_LENGTH:S.VALID):S.INVALID_CHECKSUM}!function(e){e[e.NO_PREFIX_MATCHED=0]="NO_PREFIX_MATCHED",e[e.INVALID_CHECKSUM=1]="INVALID_CHECKSUM",e[e.INVALID_LENGTH=2]="INVALID_LENGTH",e[e.VALID=3]="VALID"}(S||(S={}));const T=[n.TZ1,n.TZ2,n.TZ3,n.TZ4],R=[n.KT1,n.TXR1],x=[n.EDSIG,n.P2SIG,n.SPSIG,n.SIG],I=[n.EDPK,n.SPPK,n.P2PK,n.BLPK],M=[n.O],L=[n.P],k=[n.B],N=[n.SR1];function C(e){return P(e,[...T,...R,...N])}function j(e){return P(e,[n.NET])}function D(e){return P(e,R)}function U(e){return P(e,T)}function B(e){return P(e,x)}function F(e){return P(e,I)}function K(e){return P(e,M)}function H(e){return P(e,L)}function G(e){return P(e,k)}function $(e){return P(e,[n.SASK])}function V(e){switch(e){case S.NO_PREFIX_MATCHED:return"with unsupported prefix";case S.INVALID_CHECKSUM:return"failed checksum";case S.INVALID_LENGTH:return"with incorrect length";default:return""}}function z(e){return P(e,[...N])}const q={commitHash:"e1b1d6976a564f925c01cf66e28df9acb0085c3d",version:"17.3.1-beta-RC.0"},W=6,Z=3;function J(e){switch(e){case"tz":return W;case"mtz":return Z;default:return 0}}function Y(e="mutez",t="mutez",r){const n=new d.Z(r);return n.isNaN()?r:n.multipliedBy(Math.pow(10,J(e))).dividedBy(Math.pow(10,J(t)))}function X(e){return ee(c().blake2b(ce(e),void 0,32),g.expr)}function Q(e){return ee(c().blake2b(ce(e),void 0,32),g.o)}function ee(e,t){const r="string"==typeof e?Uint8Array.from(i.Buffer.from(e,"hex")):e,n=new Uint8Array(t.length+r.length);return n.set(t),n.set(r,t.length),l().encode(i.Buffer.from(n.buffer))}const te=(e,t)=>l().decode(e).slice(t.length);function re(e){const t=l().decode(e),r={[g.tz1.toString()]:"0000",[g.tz2.toString()]:"0001",[g.tz3.toString()]:"0002"},n={[g.txr1.toString()]:"02"},i=r[new Uint8Array(t.slice(0,3)).toString()],o=n[new Uint8Array(t.slice(0,4)).toString()];if(i){return i+fe(t.slice(3))}if(o){return o+fe(t.slice(4))+"00"}return"01"+fe(t.slice(3,42))+"00"}function ne(e){const t=l().decode(e);return fe(t.slice(3,42))}function ie(e){if("00"===e.substring(0,2)){const t={"0000":g.tz1,"0001":g.tz2,"0002":g.tz3};return ee(e.substring(4),t[e.substring(0,4)])}return"02"===e.substring(0,2)?ee(e.substring(2,e.length-2),g.txr1):ee(e.substring(2,42),g.KT)}function oe(e){return ee(e,g.tz4)}function se(e){if("0"===e[0]){const t={"00":new Uint8Array([13,15,37,217]),"01":new Uint8Array([3,254,226,86]),"02":new Uint8Array([3,178,139,127])};return ee(e.substring(2),t[e.substring(0,2)])}}function ae(e){if("0"===e[0]){const t={"00":new Uint8Array([6,161,159]),"01":new Uint8Array([6,161,161]),"02":new Uint8Array([6,161,164])};return ee(e.substring(2),t[e.substring(0,2)])}}const ce=e=>{if(e.length%2!=0)throw new f.InvalidHexStringError(e,": Expecting even number of characters");const t=ve(e);if(!t.match(/^([\da-f]{2})*$/gi))throw new f.InvalidHexStringError(e,": Only characters 0-9, a-f and A-F are expected. Optionally, it can be prefixed with '0x'");const r=new Uint8Array(t.length/2);let n=0;for(let i=0;i<t.length;i+=2){const o=parseInt(t.slice(i,i+2),16);if(Number.isNaN(o))throw new O(e,"Uint8Array");r[n++]=o}return r},ue=(e,t)=>{const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r},le=function e(t){let r=[];if(Object.prototype.hasOwnProperty.call(t,"prim"))"Pair"===t.prim?(r.push(e(t.args[0])),r=r.concat(e(t.args[1]))):"Elt"===t.prim?r={key:e(t.args[0]),val:e(t.args[1])}:"True"===t.prim?r=!0:"False"===t.prim&&(r=!1);else if(Array.isArray(t)){const n=t.length;for(let i=0;i<n;i++){const n=e(t[i]);void 0!==n.key?(Array.isArray(r)&&(r={keys:[],vals:[]}),r.keys.push(n.key),r.vals.push(n.val)):r.push(n)}}else r=Object.prototype.hasOwnProperty.call(t,"string")?t.string:Object.prototype.hasOwnProperty.call(t,"int")?parseInt(t.int,10):t;return r},fe=e=>{const t=new Uint8Array(e),r=[];return t.forEach((e=>{const t=`00${e.toString(16)}`.slice(-2);r.push(t)})),r.join("")},de=e=>{let t,r;const i=_(e),o=te(e,g[i]);switch(i){case n.EDPK:t=g[n.TZ1],r=v[n.TZ1];break;case n.SPPK:t=g[n.TZ2],r=v[n.TZ2];break;case n.P2PK:t=g[n.TZ3],r=v[n.TZ3];break;case n.BLPK:t=g[n.TZ4],r=v[n.TZ4]}return ee((0,s.vp)(o,r),t)};function he(e){return i.Buffer.from(e,"utf8").toString("hex")}function pe(e){return i.Buffer.from(ce(e)).toString("utf8")}function be(e){const t=ve(e);if(!t.match(/^(0x)?([\da-f]{2})*$/gi))throw new f.InvalidHexStringError(e,": Expecting even number of characters: 0-9, a-z, A-Z, optionally prefixed with 0x");return i.Buffer.from(t,"hex")}function me(e,t=8){return i.Buffer.from(ge(e,t),"hex")}function ge(e,t=8){if(new d.Z(e).isPositive()){const r=Math.ceil(t/4),n=e.toString(16);let i=n.length>=r?n.length:r;return i=i%2==0?i:i+1,function(e,t){const r="0";if(e.length>=t)return e;{const n=t-e.length;return r.repeat(n)+e}}(n,i)}return new d.Z(2).pow(t).minus(new d.Z(e).abs()).toString(16)}function ve(e){return e.startsWith("0x")?e.slice(2):e}},150:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RPCBatchProvider=t.OperationBatch=t.BATCH_KINDS=void 0;const i=r(9480),o=r(3650),s=r(6368),a=r(4632),c=r(227),u=r(6003),l=r(3793);t.BATCH_KINDS=[s.OpKind.ACTIVATION,s.OpKind.ORIGINATION,s.OpKind.TRANSACTION,s.OpKind.DELEGATION];class f extends u.Provider{constructor(e,t){super(e),this.estimator=t,this.operations=[],this.prepare=new l.PrepareProvider(this.context)}withTransfer(e){const t=a.validateAddress(e.to);if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());if(t!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.to,a.invalidDetail(t));return this.operations.push(Object.assign({kind:s.OpKind.TRANSACTION},e)),this}withTransferTicket(e){const t=a.validateAddress(e.destination);if(t!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.destination,a.invalidDetail(t));return this.operations.push(Object.assign({kind:s.OpKind.TRANSFER_TICKET},e)),this}withContractCall(e,t={}){return this.withTransfer(e.toTransferParams(t))}withDelegation(e){var t;const r=a.validateAddress(e.source);if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,a.invalidDetail(r));const n=a.validateAddress(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.delegate,a.invalidDetail(n));return this.operations.push(Object.assign({kind:s.OpKind.DELEGATION},e)),this}withActivation({pkh:e,secret:t}){const r=a.validateKeyHash(e);if(r!==a.ValidationResult.VALID)throw new c.InvalidKeyHashError(e,a.invalidDetail(r));return this.operations.push({kind:s.OpKind.ACTIVATION,pkh:e,secret:t}),this}withOrigination(e){return this.operations.push(Object.assign({kind:s.OpKind.ORIGINATION},e)),this}withRegisterGlobalConstant(e){return this.operations.push(Object.assign({kind:s.OpKind.REGISTER_GLOBAL_CONSTANT},e)),this}withIncreasePaidStorage(e){return this.operations.push(Object.assign({kind:s.OpKind.INCREASE_PAID_STORAGE},e)),this}withSmartRollupAddMessages(e){return this.operations.push(Object.assign({kind:s.OpKind.SMART_ROLLUP_ADD_MESSAGES},e)),this}withSmartRollupOriginate(e){return this.operations.push(Object.assign({kind:s.OpKind.SMART_ROLLUP_ORIGINATE},e)),this}getRPCOp(e){return n(this,void 0,void 0,(function*(){switch(e.kind){case s.OpKind.TRANSACTION:return i.createTransferOperation(Object.assign({},e));case s.OpKind.ORIGINATION:return i.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign({},e)));case s.OpKind.DELEGATION:return i.createSetDelegateOperation(Object.assign({},e));case s.OpKind.REGISTER_GLOBAL_CONSTANT:return i.createRegisterGlobalConstantOperation(Object.assign({},e));case s.OpKind.INCREASE_PAID_STORAGE:return i.createIncreasePaidStorageOperation(Object.assign({},e));case s.OpKind.TRANSFER_TICKET:return i.createTransferTicketOperation(Object.assign({},e));case s.OpKind.SMART_ROLLUP_ADD_MESSAGES:return i.createSmartRollupAddMessagesOperation(Object.assign({},e));case s.OpKind.SMART_ROLLUP_ORIGINATE:return i.createSmartRollupOriginateOperation(Object.assign({},e));default:throw new c.InvalidOperationKindError(JSON.stringify(e.kind))}}))}with(e){for(const t of e)switch(t.kind){case s.OpKind.TRANSACTION:this.withTransfer(t);break;case s.OpKind.ORIGINATION:this.withOrigination(t);break;case s.OpKind.DELEGATION:this.withDelegation(t);break;case s.OpKind.ACTIVATION:this.withActivation(t);break;case s.OpKind.REGISTER_GLOBAL_CONSTANT:this.withRegisterGlobalConstant(t);break;case s.OpKind.INCREASE_PAID_STORAGE:this.withIncreasePaidStorage(t);break;case s.OpKind.TRANSFER_TICKET:this.withTransferTicket(t);break;case s.OpKind.SMART_ROLLUP_ADD_MESSAGES:this.withSmartRollupAddMessages(t);break;case s.OpKind.SMART_ROLLUP_ORIGINATE:this.withSmartRollupOriginate(t);break;default:throw new c.InvalidOperationKindError(JSON.stringify(t.kind))}return this}send(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=e&&e.source||t,n=yield this.estimator.batch(this.operations);n.length!==this.operations.length&&n.shift();const i=yield this.prepare.batch(this.operations,n),s=yield this.forge(i),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(s);return new o.BatchOperation(a,i.opOb.contents,r,u,l,c)}))}}t.OperationBatch=f;t.RPCBatchProvider=class{constructor(e,t){this.context=e,this.estimator=t}batch(e){const t=new f(this.context,this.estimator);return Array.isArray(e)&&t.with(e),t}}},4593:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.getRevealGasLimit=t.ChainIds=t.protocols=t.Protocols=t.COST_PER_BYTE=t.DEFAULT_STORAGE_LIMIT=t.DEFAULT_FEE=t.DEFAULT_GAS_LIMIT=void 0,function(e){e[e.DELEGATION=10600]="DELEGATION",e[e.ORIGINATION=10600]="ORIGINATION",e[e.TRANSFER=10600]="TRANSFER",e[e.REVEAL_TZ1=1e3]="REVEAL_TZ1",e[e.REVEAL_TZ2=1e3]="REVEAL_TZ2",e[e.REVEAL_TZ3=2e3]="REVEAL_TZ3",e[e.REVEAL_TZ4=2e3]="REVEAL_TZ4"}(r=t.DEFAULT_GAS_LIMIT||(t.DEFAULT_GAS_LIMIT={})),function(e){e[e.DELEGATION=1257]="DELEGATION",e[e.ORIGINATION=1e4]="ORIGINATION",e[e.TRANSFER=1e4]="TRANSFER",e[e.REVEAL=374]="REVEAL"}(t.DEFAULT_FEE||(t.DEFAULT_FEE={})),function(e){e[e.DELEGATION=0]="DELEGATION",e[e.ORIGINATION=257]="ORIGINATION",e[e.TRANSFER=257]="TRANSFER",e[e.REVEAL=0]="REVEAL"}(t.DEFAULT_STORAGE_LIMIT||(t.DEFAULT_STORAGE_LIMIT={})),t.COST_PER_BYTE=250,function(e){e.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",e.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",e.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",e.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",e.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",e.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",e.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",e.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",e.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",e.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",e.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",e.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",e.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",e.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",e.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",e.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(n=t.Protocols||(t.Protocols={})),t.protocols={"004":[n.Pt24m4xi],"005":[n.PsBABY5H,n.PsBabyM1],"006":[n.PsCARTHA],"007":[n.PsDELPH1],"008":[n.PtEdo2Zk],"009":[n.PsFLorena],"010":[n.PtGRANADs],"011":[n.PtHangz2],"012":[n.PsiThaCa,n.Psithaca2],"013":[n.PtJakart2],"014":[n.PtKathman],"015":[n.PtLimaPtL],"016":[n.PtMumbai2],"017":[n.PtNairobi],"018":[n.ProtoALpha]},function(e){e.MAINNET="NetXdQprcVkpaWU",e.CARTHAGENET="NetXjD3HPJJjmcd",e.DELPHINET="NetXm8tYqnMWky1",e.EDONET="NetXSgo1ZT2DRUG",e.FLORENCENET="NetXxkAx4woPLyu",e.GRANADANET="NetXz969SFaFn8k",e.HANGZHOUNET="NetXZSsxBpMQeAT",e.ITHACANET="NetXbhmtAbMukLc",e.ITHACANET2="NetXnHfVqm9iesp",e.JAKARTANET2="NetXLH1uAxK7CCh",e.KATHMANDUNET="NetXazhm4yetmff",e.LIMANET="NetXizpkH94bocH",e.MUMBAINET="NetXQw6nWSnrJ5t",e.MUMBAINET2="NetXgbcrNtXD2yA",e.NAIROBINET="NetXyuzvDo2Ugzb"}(t.ChainIds||(t.ChainIds={}));t.getRevealGasLimit=e=>Math.round(11*i(e)/10);const i=e=>{switch(e.substring(0,3)){case"tz1":return r.REVEAL_TZ1;case"tz2":return r.REVEAL_TZ2;case"tz3":return r.REVEAL_TZ3;case"tz4":return r.REVEAL_TZ4;default:throw new Error(`Cannot estimate reveal gas limit for ${e}`)}}},4984:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.defaultConfigConfirmation=void 0;const i=r(6368),o=r(5744),s=r(1067),a=r(8286),c=r(992),u=r(4782),l=r(1151),f=r(150),d=r(635),h=r(5286),p=r(6395),b=r(977),m=r(9494),g=r(259),v=r(5032),y=r(6713),_=r(2021);t.defaultConfigConfirmation={defaultConfirmationCount:1,confirmationPollingTimeoutSecond:180};class w{constructor(e,r=new s.NoopSigner,n,w=new b.BehaviorSubject(Object.assign({},t.defaultConfigConfirmation)),E,O,S,A,P,T,R,x){this._rpc=e,this._signer=r,this._proto=n,this._config=w,this.providerDecorator=[],this.tz=new c.RpcTzProvider(this),this.estimate=new u.RPCEstimateProvider(this),this.contract=new l.RpcContractProvider(this,this.estimate),this.prepare=new _.PrepareProvider(this),this.batch=new f.RPCBatchProvider(this,this.estimate),this.wallet=new d.Wallet(this),this.withExtensions=()=>{let e=this.clone();return this.providerDecorator.forEach((t=>{e=t(e)})),e},"string"==typeof this._rpc?this._rpcClient=new i.RpcClient(this._rpc):this._rpcClient=this._rpc,this._forger=E||new y.TaquitoLocalForger(this),this._injector=O||new o.RpcInjector(this),this.operationFactory=new a.OperationFactory(this),this._walletProvider=A||new d.LegacyWalletProvider(this),this._parser=P||new h.MichelCodecParser(this),this._packer=S||new p.RpcPacker(this),this._globalConstantsProvider=T||new m.NoopGlobalConstantsProvider,this._readProvider=R||new g.RpcReadAdapter(this._rpcClient),this._stream=x||new v.PollingSubscribeProvider(this)}get config(){return this._config.getValue()}set config(e){this._config.next(Object.assign({},e))}setPartialConfig(e){this._config.next(Object.assign(Object.assign({},this._config.getValue()),e))}get rpc(){return this._rpcClient}set rpc(e){this._rpcClient=e}get injector(){return this._injector}set injector(e){this._injector=e}get forger(){return this._forger}set forger(e){this._forger=e}get signer(){return this._signer}set signer(e){this._signer=e}get walletProvider(){return this._walletProvider}set walletProvider(e){this._walletProvider=e}set proto(e){this._proto=e}get proto(){return this._proto}get parser(){return this._parser}set parser(e){this._parser=e}get packer(){return this._packer}set packer(e){this._packer=e}get globalConstantsProvider(){return this._globalConstantsProvider}set globalConstantsProvider(e){this._globalConstantsProvider=e}get readProvider(){return this._readProvider}set readProvider(e){this._readProvider=e}get stream(){return this._stream}set stream(e){this._stream=e}isAnyProtocolActive(e=[]){return n(this,void 0,void 0,(function*(){if(this._proto)return e.includes(this._proto);{const t=yield this.readProvider.getNextProtocol("head");return e.includes(t)}}))}isAnySignerConfigured(){return!(this.signer instanceof s.NoopSigner)}clone(){return new w(this.rpc,this.signer,this.proto,this._config,this.forger,this._injector,this.packer,this._walletProvider,this._parser,this._globalConstantsProvider,this._readProvider,this._stream)}registerProviderDecorator(e){this.providerDecorator.push(e)}}t.Context=w},5225:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BigMapAbstraction=void 0;const i=r(5543);t.BigMapAbstraction=class{constructor(e,t,r){this.id=e,this.schema=t,this.provider=r}get(e,t){return n(this,void 0,void 0,(function*(){try{return yield this.provider.getBigMapKeyByID(this.id.toString(),e,this.schema,t)}catch(e){if(e instanceof i.HttpResponseError&&e.status===i.STATUS_CODE.NOT_FOUND)return;throw e}}))}getMultipleValues(e,t,r=5){return n(this,void 0,void 0,(function*(){return this.provider.getBigMapKeysByID(this.id.toString(),e,this.schema,t,r)}))}toJSON(){return this.id.toString()}toString(){return this.id.toString()}}},191:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compose=void 0,t.compose=function(e,t){return(r,n)=>t(e(r,n),n)}},2298:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractMethodFactory=void 0;const n=r(3687),i=r(4397),o=r(3849);t.ContractMethodFactory=class{constructor(e,t){this.provider=e,this.contractAddress=t}createContractMethodFlatParams(e,t,r,n=!0,o=!1){return new i.ContractMethod(this.provider,this.contractAddress,e,t,r,n,o)}createContractMethodObjectParam(e,t,r,i=!0,o=!1){return new n.ContractMethodObject(this.provider,this.contractAddress,e,t,r,i,o)}createContractViewObjectParam(e,t,r,n,i){return new o.OnChainView(e,t,this.contractAddress,r,n,i)}}},4397:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractMethod=void 0;const n=r(635),i=r(1863),o=r(6700);t.ContractMethod=class{constructor(e,t,r,n,i,o=!0,s=!1){this.provider=e,this.address=t,this.parameterSchema=r,this.name=n,this.args=i,this.isMultipleEntrypoint=o,this.isAnonymous=s}validateArgs(e,t,r){const n=t.ExtractSignatures();if(!n.find((t=>t.length===e.length)))throw new o.InvalidParameterError(r,n,e)}get schema(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}getSignature(){if(!this.isAnonymous){const e=this.parameterSchema.ExtractSignatures();return 1==e.length?e[0]:e}{const e=this.parameterSchema.ExtractSignatures().find((e=>e[0]===this.name));if(e)return e.shift(),e}}send(e={}){return this.provider instanceof n.Wallet?this.provider.transfer(this.toTransferParams(e)).send():this.provider.transfer(this.toTransferParams(e))}toTransferParams({fee:e,gasLimit:t,storageLimit:r,source:n,amount:o=0,mutez:s=!1}={}){return{to:this.address,amount:o,fee:e,mutez:s,source:n,gasLimit:t,storageLimit:r,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:i.DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.Encode(this.name,...this.args):this.parameterSchema.Encode(...this.args)}}}}},4662:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractMethodObject=void 0;const n=r(635),i=r(1863);t.ContractMethodObject=class{constructor(e,t,r,n,i="unit",o=!0,s=!1){this.provider=e,this.address=t,this.parameterSchema=r,this.name=n,this.args=i,this.isMultipleEntrypoint=o,this.isAnonymous=s}getSignature(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}send(e={}){return this.provider instanceof n.Wallet?this.provider.transfer(this.toTransferParams(e)).send():this.provider.transfer(this.toTransferParams(e))}toTransferParams({fee:e,gasLimit:t,storageLimit:r,source:n,amount:o=0,mutez:s=!1}={}){return{to:this.address,amount:o,fee:e,mutez:s,source:n,gasLimit:t,storageLimit:r,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:i.DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.EncodeObject({[this.name]:this.args}):this.parameterSchema.EncodeObject(this.args)}}}}},3849:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OnChainView=void 0;const i=r(4632),o=r(6700),s=r(227);t.OnChainView=class{constructor(e,t,r,n,i,o="Unit"){this._rpc=e,this._readProvider=t,this._contractAddress=r,this._smartContractViewSchema=n,this._contractStorageType=i,this._args=o}getSignature(){return{parameter:this._smartContractViewSchema.extractArgsSchema(),result:this._smartContractViewSchema.extractResultSchema()}}executeView(e){return n(this,void 0,void 0,(function*(){this.verifyContextExecution(e);const t=yield this._readProvider.getChainId(),r=this.transformArgsToMichelson(),n={contract:this._contractAddress,view:this._smartContractViewSchema.viewName,input:r,chain_id:t,source:e.viewCaller};return e.source&&(n.payer=e.source),this.executeViewAndDecodeResult(n)}))}verifyContextExecution(e){if(e.source&&i.validateAddress(e.source)!==i.ValidationResult.VALID)throw new o.InvalidViewSimulationContext(`The source account who initialized the view execution is invalid: ${e.source}.`);if(!e.viewCaller||i.validateAddress(e.viewCaller)!==i.ValidationResult.VALID)throw new o.InvalidViewSimulationContext(`The contract which is the caller of view is invalid: ${e.viewCaller}.`)}transformArgsToMichelson(){try{return this._smartContractViewSchema.encodeViewArgs(this._args)}catch(e){throw new s.InvalidViewParameterError(this._smartContractViewSchema.viewName,this.getSignature(),this._args,e)}}adaptViewCodeToContext(e,t,r){const n={BALANCE:[{prim:"PUSH",args:[{prim:"mutez"},{int:r}]}],SENDER:[{prim:"PUSH",args:[{prim:"address"},{string:t}]}],SELF_ADDRESS:[{prim:"PUSH",args:[{prim:"address"},{string:this._contractAddress}]}],AMOUNT:[{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]}]};return e.forEach(((i,o)=>{i.prim in n&&(e[o]=Object(n)[i.prim]),i.args&&0!==i.args.length?this.adaptViewCodeToContext(i.args,t,r):Array.isArray(i)&&this.adaptViewCodeToContext(i,t,r)})),e}executeViewAndDecodeResult(e){return n(this,void 0,void 0,(function*(){let t;try{t=(yield this._rpc.runScriptView(e)).data}catch(e){const t=o.validateAndExtractFailwith(e);throw t?new o.ViewSimulationError(`The simulation of the on-chain view named ${this._smartContractViewSchema.viewName} failed with: ${JSON.stringify(t)}`,this._smartContractViewSchema.viewName,t,e):e}return this._smartContractViewSchema.decodeViewResult(t)}))}}},1863:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractAbstraction=t.ContractView=t.DEFAULT_SMART_CONTRACT_METHOD_NAME=void 0;const i=r(8899),o=r(4632),s=r(2298),a=r(6700),c=r(227);t.DEFAULT_SMART_CONTRACT_METHOD_NAME="default";class u{constructor(e,t,r,n,i,o,s){this.currentContract=e,this.name=t,this.callbackParametersSchema=r,this.parameterSchema=n,this.args=i,this.rpc=o,this.readProvider=s}read(e){return n(this,void 0,void 0,(function*(){const t=o.validateChain(null!=e?e:"");if(o.validateContractAddress(null!=e?e:"")==o.ValidationResult.VALID)throw new c.DeprecationError("Since version 12, the lambda view no longer depends on a lambda contract. The read method no longer accepts a contract address as a parameter.");if(e&&t!==o.ValidationResult.VALID)throw new c.InvalidChainIdError(e,o.invalidDetail(t));const r=this.parameterSchema.Encode(...this.args),n=yield this.rpc.runView({contract:this.currentContract.address,entrypoint:this.name,input:r,chain_id:e||(yield this.readProvider.getChainId())});return this.callbackParametersSchema.Execute(n.data)}))}}t.ContractView=u;t.ContractAbstraction=class{constructor(e,t,r,n,o,a,c){this.address=e,this.script=t,this.storageProvider=n,this.entrypoints=o,this.rpc=a,this.readProvider=c,this.methods={},this.methodsObject={},this.views={},this.contractViews={},this.contractMethodFactory=new s.ContractMethodFactory(r,e),this.schema=i.Schema.fromRPCResponse({script:this.script}),this.parameterSchema=i.ParameterSchema.fromRPCResponse({script:this.script}),this.viewSchema=i.ViewSchema.fromRPCResponse({script:this.script}),0!==this.viewSchema.length&&this._initializeOnChainViews(this,a,this.readProvider,this.viewSchema),this.eventSchema=i.EventSchema.fromRPCResponse({script:this.script}),this._initializeMethods(this,this.entrypoints.entrypoints,this.rpc,this.readProvider)}_initializeMethods(e,r,n,o){const s=this.parameterSchema,c=Object.keys(r);if(s.isMultipleEntryPoint){c.forEach((t=>{const s=new i.ParameterSchema(r[t]);if(this.methods[t]=function(...r){return e.contractMethodFactory.createContractMethodFlatParams(s,t,r)},this.methodsObject[t]=function(r){return e.contractMethodFactory.createContractMethodObjectParam(s,t,r)},(e=>{let t=!1;if("prim"in e&&"pair"===e.prim&&e.args){const r=e.args[e.args.length-1];"prim"in r&&"contract"===r.prim&&(t=!0)}return t})(r[t])){const s=function(...s){const c=r[t].args[0],l=new i.ParameterSchema(c),f=r[t].args[1].args[0],d=new i.ParameterSchema(f);return((e,t,r)=>{const n=t.ExtractSignatures();if(!n.find((t=>t.length===e.length)))throw new a.InvalidParameterError(r,n,e)})(s,l,t),new u(e,t,d,l,s,n,o)};this.views[t]=s}}));Object.keys(s.ExtractSchema()).filter((e=>-1===Object.keys(r).indexOf(e))).forEach((t=>{this.methods[t]=function(...r){return e.contractMethodFactory.createContractMethodFlatParams(s,t,r,!1,!0)},this.methodsObject[t]=function(r){return e.contractMethodFactory.createContractMethodObjectParam(s,t,r,!1,!0)}}))}else{const r=this.parameterSchema;this.methods[t.DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(...n){return e.contractMethodFactory.createContractMethodFlatParams(r,t.DEFAULT_SMART_CONTRACT_METHOD_NAME,n,!1)},this.methodsObject[t.DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(n){return e.contractMethodFactory.createContractMethodObjectParam(r,t.DEFAULT_SMART_CONTRACT_METHOD_NAME,n,!1)}}}_initializeOnChainViews(e,t,r,n){const i=this.schema.val;n.forEach((n=>{this.contractViews[n.viewName]=function(o){return e.contractMethodFactory.createContractViewObjectParam(t,r,n,i,o)}}))}storage(){return this.storageProvider.getStorage(this.address,this.schema)}bigMap(e){return this.storageProvider.getBigMapKey(this.address,e,this.schema)}}},6700:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidBalanceError=t.OriginationParameterError=t.RevealOperationError=t.InvalidViewSimulationContext=t.validateAndExtractFailwith=t.ViewSimulationError=t.InvalidInitParameter=t.InvalidCodeParameter=t.InvalidDelegationSource=t.InvalidParameterError=void 0;const n=r(227);class i extends n.ParameterValidationError{constructor(e,t,r){super(),this.smartContractMethodName=e,this.sigs=t,this.invalidParams=r,this.name="InvalidParameterError",this.message=`${e} Received ${r.length} arguments while expecting one of the following signatures (${JSON.stringify(t)})`}}t.InvalidParameterError=i;class o extends n.ParameterValidationError{constructor(e){super(),this.source=e,this.name="InvalidDelegationSource",this.message=`Since Babylon delegation source can no longer be a contract address ${e}. Please use the smart contract abstraction to set your delegate.`}}t.InvalidDelegationSource=o;class s extends n.ParameterValidationError{constructor(e,t){super(),this.message=e,this.data=t,this.name="InvalidCodeParameter"}}t.InvalidCodeParameter=s;class a extends n.ParameterValidationError{constructor(e,t){super(),this.message=e,this.data=t,this.name="InvalidInitParameter"}}t.InvalidInitParameter=a;class c extends n.RpcError{constructor(e,t,r,n){super(),this.message=e,this.viewName=t,this.failWith=r,this.cause=n,this.name="ViewSimulationError"}}t.ViewSimulationError=c;t.validateAndExtractFailwith=e=>{if(u(e.body)){const t=JSON.parse(e.body);if(Array.isArray(t)&&"with"in t[t.length-1])return t[t.length-1].with}};const u=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};class l extends n.ParameterValidationError{constructor(e){super(),this.info=e,this.name="InvalidViewSimulationContext",this.message=`${e} Please configure the context of the view execution in the executeView method.`}}t.InvalidViewSimulationContext=l;class f extends n.RpcError{constructor(e){super(),this.message=e,this.name="RevealOperationError"}}t.RevealOperationError=f;class d extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name}}t.OriginationParameterError=d;class h extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidBalanceError"}}t.InvalidBalanceError=h},238: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.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.compose=void 0,i(r(1863),t),i(r(6700),t),i(r(2619),t),i(r(4007),t),i(r(9480),t),i(r(120),t);var o=r(191);Object.defineProperty(t,"compose",{enumerable:!0,get:function(){return o.compose}}),i(r(4662),t),i(r(4397),t),i(r(3687),t),i(r(5491),t)},2619:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MANAGER_LAMBDA=void 0;t.MANAGER_LAMBDA={setDelegate:e=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:e}]},{prim:"SOME"},{prim:"SET_DELEGATE"},{prim:"CONS"}],removeDelegate:()=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"NONE",args:[{prim:"key_hash"}]},{prim:"SET_DELEGATE"},{prim:"CONS"}],transferImplicit:(e,t)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:e}]},{prim:"IMPLICIT_ACCOUNT"},{prim:"PUSH",args:[{prim:"mutez"},{int:`${t}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}],transferToContract:(e,t)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"address"},{string:e}]},{prim:"CONTRACT",args:[{prim:"unit"}]},{prim:"IF_NONE",args:[[{prim:"UNIT"},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"mutez"},{int:`${t}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}]}},9480:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.createSmartRollupOriginateOperation=t.createSmartRollupAddMessagesOperation=t.createUpdateConsensusKeyOperation=t.createProposalsOperation=t.createBallotOperation=t.createDrainDelegateOperation=t.createIncreasePaidStorageOperation=t.createTransferTicketOperation=t.createRegisterGlobalConstantOperation=t.createRevealOperation=t.createRegisterDelegateOperation=t.createSetDelegateOperation=t.createTransferOperation=t.createOriginationOperation=t.createActivationOperation=void 0;const i=r(8899),o=r(6368),s=r(4593),a=r(4632),c=r(6700);t.createActivationOperation=({pkh:e,secret:t})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.ACTIVATION,pkh:e,secret:t}}));t.createOriginationOperation=({code:e,init:t,balance:r="0",delegate:u,storage:l,fee:f=s.DEFAULT_FEE.ORIGINATION,gasLimit:d=s.DEFAULT_GAS_LIMIT.ORIGINATION,storageLimit:h=s.DEFAULT_STORAGE_LIMIT.ORIGINATION,mutez:p=!1})=>n(void 0,void 0,void 0,(function*(){if(void 0!==l&&void 0!==t)throw new c.OriginationParameterError("Storage and Init cannot be set a the same time. Please either use storage or init but not both.");if(!Array.isArray(e))throw new c.InvalidCodeParameter("Wrong code parameter type, expected an array",e);let n;if(void 0!==l){const t=e.find((e=>"prim"in e&&"storage"===e.prim));if(void 0===(null==t?void 0:t.args))throw new c.InvalidCodeParameter("The storage section is missing from the script",e);n=new i.Schema(t.args[0]).Encode(l)}else{if(void 0===t||"object"!=typeof t)throw new c.InvalidInitParameter("Wrong init parameter type, expected JSON Michelson",t);n=t}const s={code:e,storage:n};if(isNaN(Number(r)))throw new c.InvalidBalanceError(`Invalid Balance "${r}", cannot be converted to a number`);const b={kind:o.OpKind.ORIGINATION,fee:f,gas_limit:d,storage_limit:h,balance:p?r.toString():a.format("tz","mutez",r).toString(),script:s};return u&&(b.delegate=u),b}));t.createTransferOperation=({to:e,amount:t,parameter:r,fee:i=s.DEFAULT_FEE.TRANSFER,gasLimit:c=s.DEFAULT_GAS_LIMIT.TRANSFER,storageLimit:u=s.DEFAULT_STORAGE_LIMIT.TRANSFER,mutez:l=!1})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.TRANSACTION,fee:i,gas_limit:c,storage_limit:u,amount:l?t.toString():a.format("tz","mutez",t).toString(),destination:e,parameters:r}}));t.createSetDelegateOperation=({delegate:e,source:t,fee:r=s.DEFAULT_FEE.DELEGATION,gasLimit:i=s.DEFAULT_GAS_LIMIT.DELEGATION,storageLimit:a=s.DEFAULT_STORAGE_LIMIT.DELEGATION})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.DELEGATION,source:t,fee:r,gas_limit:i,storage_limit:a,delegate:e}}));t.createRegisterDelegateOperation=({fee:e=s.DEFAULT_FEE.DELEGATION,gasLimit:t=s.DEFAULT_GAS_LIMIT.DELEGATION,storageLimit:r=s.DEFAULT_STORAGE_LIMIT.DELEGATION},i)=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.DELEGATION,fee:e,gas_limit:t,storage_limit:r,delegate:i}}));t.createRevealOperation=({fee:e=s.DEFAULT_FEE.REVEAL,gasLimit:t,storageLimit:r=s.DEFAULT_STORAGE_LIMIT.REVEAL},i,a)=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.REVEAL,fee:e,public_key:a,source:i,gas_limit:null!=t?t:s.getRevealGasLimit(i),storage_limit:r}}));t.createRegisterGlobalConstantOperation=({value:e,source:t,fee:r,gasLimit:i,storageLimit:s})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.REGISTER_GLOBAL_CONSTANT,value:e,fee:r,gas_limit:i,storage_limit:s,source:t}}));t.createTransferTicketOperation=({ticketContents:e,ticketTy:t,ticketTicketer:r,ticketAmount:i,destination:s,entrypoint:a,source:c,fee:u,gasLimit:l,storageLimit:f})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.TRANSFER_TICKET,fee:u,gas_limit:l,storage_limit:f,source:c,ticket_contents:e,ticket_ty:t,ticket_ticketer:r,ticket_amount:i,destination:s,entrypoint:a}}));t.createIncreasePaidStorageOperation=({source:e,fee:t,gasLimit:r,storageLimit:i,amount:s,destination:a})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.INCREASE_PAID_STORAGE,source:e,fee:t,gas_limit:r,storage_limit:i,amount:s,destination:a}}));t.createDrainDelegateOperation=({consensus_key:e,delegate:t,destination:r})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.DRAIN_DELEGATE,consensus_key:e,delegate:t,destination:r}}));t.createBallotOperation=({source:e,proposal:t,ballot:r})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.BALLOT,source:e,proposal:t,ballot:r}}));t.createProposalsOperation=({source:e,proposals:t})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.PROPOSALS,source:e,proposals:t}}));t.createUpdateConsensusKeyOperation=({source:e,fee:t,gasLimit:r,storageLimit:i,pk:s})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.UPDATE_CONSENSUS_KEY,source:e,fee:t,gas_limit:r,storage_limit:i,pk:s}}));t.createSmartRollupAddMessagesOperation=({source:e,fee:t,gasLimit:r,storageLimit:i,message:s})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.SMART_ROLLUP_ADD_MESSAGES,source:e,fee:t,gas_limit:r,storage_limit:i,message:s}}));t.createSmartRollupOriginateOperation=({source:e,fee:t,gasLimit:r,storageLimit:i,pvmKind:s,kernel:a,originationProof:c,parametersType:u})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.SMART_ROLLUP_ORIGINATE,source:e,fee:t,gas_limit:r,storage_limit:i,pvm_kind:s,kernel:a,origination_proof:c,parameters_ty:u}}))},1151:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcContractProvider=void 0;const i=r(5543),o=r(8899),s=r(6368),a=r(4632),c=r(227),u=r(150),l=r(9785),f=r(6646),d=r(5544),h=r(2342),p=r(1846),b=r(1863),m=r(6700),g=r(22),v=r(8983),y=r(106),_=r(3729),w=r(738),E=r(7279),O=r(4384),S=r(2864),A=r(5847),P=r(6003),T=r(3793);class R extends P.Provider{constructor(e,t){super(e),this.estimator=t,this.contractProviderTypeSymbol=Symbol.for("taquito-contract-provider-type-symbol"),this.prepare=new T.PrepareProvider(this.context)}getStorage(e,t){return n(this,void 0,void 0,(function*(){const r=a.validateContractAddress(e);if(r!==a.ValidationResult.VALID)throw new c.InvalidContractAddressError(e,a.invalidDetail(r));const n=yield this.context.readProvider.getScript(e,"head");let i;return t||(t=n),i=o.Schema.isSchema(t)?t:o.Schema.fromRPCResponse({script:t}),i.Execute(n.storage,g.smartContractAbstractionSemantic(this))}))}getBigMapKey(e,t,r){return n(this,void 0,void 0,(function*(){const n=a.validateContractAddress(e);if(n!==a.ValidationResult.VALID)throw new c.InvalidContractAddressError(e,a.invalidDetail(n));let i;r||(r=(yield this.rpc.getContract(e)).script),i=o.Schema.isSchema(r)?r:o.Schema.fromRPCResponse({script:r});const s=i.EncodeBigMapKey(t),u=yield this.rpc.getBigMapKey(e,s);return i.ExecuteOnBigMapValue(u)}))}getBigMapKeyByID(e,t,r,i){return n(this,void 0,void 0,(function*(){const{key:n,type:o}=r.EncodeBigMapKey(t),{packed:s}=yield this.context.packer.packData({data:n,type:o}),c=a.encodeExpr(s),u=i?yield this.context.readProvider.getBigMapValue({id:e.toString(),expr:c},i):yield this.context.readProvider.getBigMapValue({id:e.toString(),expr:c},"head");return r.ExecuteOnBigMapValue(u,g.smartContractAbstractionSemantic(this))}))}getBigMapKeysByID(e,t,r,i,s=5){return n(this,void 0,void 0,(function*(){const n=yield this.getBlockForRequest(t,i),a=new o.MichelsonMap;let c=0,u=[];for(;c<t.length;){const i=t.slice(c,c+s).map((t=>this.getBigMapValueOrUndefined(t,e,r,n)));u=[...u,...yield Promise.all(i)],c+=s}for(let e=0;e<u.length;e++)a.set(t[e],u[e]);return a}))}getBlockForRequest(e,t){return n(this,void 0,void 0,(function*(){return 1===e.length||void 0!==t?t:yield this.context.readProvider.getBlockLevel("head")}))}getBigMapValueOrUndefined(e,t,r,o){return n(this,void 0,void 0,(function*(){try{return yield this.getBigMapKeyByID(t,e,r,o)}catch(e){if(e instanceof i.HttpResponseError&&e.status===i.STATUS_CODE.NOT_FOUND)return;throw e}}))}getSaplingDiffByID(e,t){return n(this,void 0,void 0,(function*(){return t?yield this.context.readProvider.getSaplingDiffById({id:e.toString()},t):yield this.context.readProvider.getSaplingDiffById({id:e.toString()},"head")}))}originate(e){return n(this,void 0,void 0,(function*(){const t=yield this.estimate(e,this.estimator.originate.bind(this.estimator)),r=yield this.prepare.originate(Object.assign(Object.assign({},e),t)),n=r.opOb.contents.find((e=>e.kind===s.OpKind.ORIGINATION)),i=yield this.forge(r),{hash:o,context:a,forgedBytes:c,opResponse:u}=yield this.signAndInject(i);return new f.OriginationOperation(o,n,c,u,a,this)}))}setDelegate(e){var t;return n(this,void 0,void 0,(function*(){const r=a.validateAddress(e.source);if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,a.invalidDetail(r));const n=a.validateAddress(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.delegate,a.invalidDetail(n));if(/kt1/i.test(e.source))throw new m.InvalidDelegationSource(e.source);const i=yield this.signer.publicKeyHash(),o=e.source||i,u=yield this.estimate(e,this.estimator.setDelegate.bind(this.estimator)),f=yield this.prepare.delegation(Object.assign(Object.assign({},e),u)),d=f.opOb.contents.find((e=>e.kind===s.OpKind.DELEGATION)),h=yield this.forge(f),{hash:p,context:b,forgedBytes:g,opResponse:v}=yield this.signAndInject(h);return new l.DelegateOperation(p,d,o,g,v,b)}))}registerDelegate(e){return n(this,void 0,void 0,(function*(){const t=yield this.estimate(e,this.estimator.registerDelegate.bind(this.estimator)),r=yield this.signer.publicKeyHash(),n=yield this.prepare.registerDelegate(Object.assign(Object.assign({},e),t)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.DELEGATION)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:f}=yield this.signAndInject(o);return new l.DelegateOperation(a,i,r,u,f,c)}))}transfer(e){var t;return n(this,void 0,void 0,(function*(){const r=a.validateAddress(e.to);if(r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.to,a.invalidDetail(r));const n=a.validateAddress(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,a.invalidDetail(n));if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());const i=yield this.signer.publicKeyHash(),o=yield this.estimate(e,this.estimator.transfer.bind(this.estimator)),u=e.source||i,l=yield this.prepare.transaction(Object.assign(Object.assign({},e),o)),f=l.opOb.contents.find((e=>e.kind===s.OpKind.TRANSACTION)),d=yield this.forge(l),{hash:h,context:b,forgedBytes:m,opResponse:g}=yield this.signAndInject(d);return new p.TransactionOperation(h,f,u,m,g,b)}))}transferTicket(e){var t,r;return n(this,void 0,void 0,(function*(){const n=a.validateAddress(e.destination);if(n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.destination,a.invalidDetail(n));const i=a.validateAddress(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&i!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,a.invalidDetail(i));const o=yield this.signer.publicKeyHash(),u=null!==(r=e.source)&&void 0!==r?r:o,l=yield this.estimate(e,this.estimator.transferTicket.bind(this.estimator)),f=yield this.prepare.transferTicket(Object.assign(Object.assign({},e),l)),d=f.opOb.contents.find((e=>e.kind===s.OpKind.TRANSFER_TICKET)),h=yield this.forge(f),{hash:p,context:b,forgedBytes:m,opResponse:g}=yield this.signAndInject(h);return new v.TransferTicketOperation(p,d,u,m,g,b)}))}reveal(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimator.reveal(e);if(r){const i=yield this.estimate(e,(()=>n(this,void 0,void 0,(function*(){return r})))),o=yield this.prepare.reveal(Object.assign(Object.assign({},e),i)),a=o.opOb.contents.find((e=>e.kind===s.OpKind.REVEAL)),c=yield this.forge(o),{hash:u,context:l,forgedBytes:f,opResponse:d}=yield this.signAndInject(c);return new h.RevealOperation(u,a,t,f,d,l)}throw new m.RevealOperationError(`The publicKeyHash '${t}' has already been revealed.`)}))}registerGlobalConstant(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.registerGlobalConstant.bind(this.estimator)),n=yield this.prepare.registerGlobalConstant(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.REGISTER_GLOBAL_CONSTANT)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new d.RegisterGlobalConstantOperation(a,i,t,u,l,c)}))}increasePaidStorage(e){return n(this,void 0,void 0,(function*(){if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.increasePaidStorage.bind(this.estimator)),n=yield this.prepare.increasePaidStorage(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.INCREASE_PAID_STORAGE)),o=yield this.forge(n),{hash:a,context:u,forgedBytes:l,opResponse:f}=yield this.signAndInject(o);return new y.IncreasePaidStorageOperation(a,i,t,l,f,u)}))}drainDelegate(e){return n(this,void 0,void 0,(function*(){const t=yield this.prepare.drainDelegate(e),r=t.opOb.contents.find((e=>e.kind===s.OpKind.DRAIN_DELEGATE)),n=yield this.forge(t),{hash:i,context:o,forgedBytes:a,opResponse:c}=yield this.signAndInject(n);return new w.DrainDelegateOperation(i,r,a,c,o)}))}ballot(e){var t,r;return n(this,void 0,void 0,(function*(){const n=yield this.signer.publicKeyHash(),i=a.validateAddress(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&i!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,a.invalidDetail(i));const o=null!==(r=e.source)&&void 0!==r?r:n,u=yield this.prepare.ballot(Object.assign(Object.assign({},e),{source:o})),l=u.opOb.contents.find((e=>e.kind===s.OpKind.BALLOT)),f=yield this.forge(u),{hash:d,context:h,forgedBytes:p,opResponse:b}=yield this.signAndInject(f);return new _.BallotOperation(d,l,n,p,b,h)}))}proposals(e){var t,r;return n(this,void 0,void 0,(function*(){const n=yield this.signer.publicKeyHash(),i=a.validateAddress(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&i!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,a.invalidDetail(i));const o=null!==(r=e.source)&&void 0!==r?r:n,u=yield this.prepare.proposals(Object.assign(Object.assign({},e),{source:o})),l=u.opOb.contents.find((e=>e.kind===s.OpKind.PROPOSALS)),f=yield this.forge(u),{hash:d,context:h,forgedBytes:p,opResponse:b}=yield this.signAndInject(f);return new E.ProposalsOperation(d,l,n,p,b,h)}))}updateConsensusKey(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.updateConsensusKey.bind(this.estimator)),n=yield this.prepare.updateConsensusKey(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.UPDATE_CONSENSUS_KEY)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new O.UpdateConsensusKeyOperation(a,i,t,u,l,c)}))}smartRollupAddMessages(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.smartRollupAddMessages.bind(this.estimator)),n=yield this.prepare.smartRollupAddMessages(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.SMART_ROLLUP_ADD_MESSAGES)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new S.SmartRollupAddMessagesOperation(a,i,t,u,l,c)}))}smartRollupOriginate(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.smartRollupOriginate.bind(this.estimator)),n=yield this.rpc.getOriginationProof({kind:e.pvmKind,kernel:e.kernel}),i=Object.assign(Object.assign({},e),{originationProof:n}),o=yield this.prepare.smartRollupOriginate(Object.assign(Object.assign({},i),r)),a=o.opOb.contents.find((e=>e.kind===s.OpKind.SMART_ROLLUP_ORIGINATE)),c=yield this.forge(o),{hash:u,context:l,forgedBytes:f,opResponse:d}=yield this.signAndInject(c);return new A.SmartRollupOriginateOperation(u,a,t,f,d,l)}))}failingNoop(e){return n(this,void 0,void 0,(function*(){const t={kind:s.OpKind.FAILING_NOOP,arbitrary:e.arbitrary},r=yield this.context.readProvider.getBlockHash(e.basedOnBlock),n=yield this.context.forger.forge({branch:r,contents:[t]}),{prefixSig:i}=yield this.signer.sign(n,new Uint8Array([3]));return{signature:i,bytes:n,signedContent:{branch:r,contents:[{kind:s.OpKind.FAILING_NOOP,arbitrary:e.arbitrary}]}}}))}at(e,t=(e=>e)){return n(this,void 0,void 0,(function*(){const r=a.validateContractAddress(e);if(r!==a.ValidationResult.VALID)throw new c.InvalidContractAddressError(e,a.invalidDetail(r));const n=this.context.withExtensions().rpc,i=this.context.withExtensions().readProvider,o=yield i.getScript(e,"head"),s=yield i.getEntrypoints(e),u=new b.ContractAbstraction(e,o,this,this,s,n,i);return t(u,this.context)}))}batch(e){const t=new u.OperationBatch(this.context,this.estimator);return Array.isArray(e)&&t.with(e),t}}t.RpcContractProvider=R},5491:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SaplingStateAbstraction=void 0;t.SaplingStateAbstraction=class{constructor(e,t){this.id=e,this.provider=t}getSaplingDiff(e){return r(this,void 0,void 0,(function*(){return this.provider.getSaplingDiffByID(this.id.toString(),e)}))}getId(){return this.id.toString()}}},22:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smartContractAbstractionSemantic=void 0;const n=r(8899),i=r(5225),o=r(6391),s=r(5491);t.smartContractAbstractionSemantic=e=>({big_map:(t,r)=>{if(t&&"int"in t&&void 0!==t.int){const s=new n.Schema(r);return new i.BigMapAbstraction(new o.default(t.int),s,e)}return{}},sapling_state:t=>t&&"int"in t&&void 0!==t.int?new s.SaplingStateAbstraction(new o.default(t.int),e):{}})},120:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_LAMBDA=void 0;t.VIEW_LAMBDA={code:[{prim:"parameter",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},{prim:"unit"}]}]}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"UNIT"},{prim:"EXEC"}]]}],storage:"Unit"}},7642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RPCResponseError=t.ConfirmationTimeoutError=t.InvalidConfirmationCountError=void 0;const n=r(227);class i extends n.ParameterValidationError{constructor(e){super(),this.invalidConfirmations=e,this.name="InvalidConfirmationCountError",this.message=`Invalid confirmation count ${e} expecting at least 1`}}t.InvalidConfirmationCountError=i;class o extends n.NetworkError{constructor(e){super(),this.message=e,this.name="ConfirmationTimeoutError"}}t.ConfirmationTimeoutError=o;class s extends n.RpcError{constructor(e,t){super(),this.message=e,this.cause=t,this.name="RPCResponseError"}}t.RPCResponseError=s},1826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RevealEstimateError=void 0;const n=r(227);class i extends n.TaquitoError{constructor(){super(),this.name="RevealEstimateError",this.message="Public key is unknown, unable to estimate the reveal operation in Wallet API."}}t.RevealEstimateError=i},1243:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4705:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Estimate=void 0;const r=100;class n{constructor(e,t,r,n,i=100){this._milligasLimit=e,this._storageLimit=t,this.opSize=r,this.minimalFeePerStorageByteMutez=n,this.baseFeeMutez=i}get burnFeeMutez(){return this.roundUp(Number(this.storageLimit)*Number(this.minimalFeePerStorageByteMutez))}get storageLimit(){const e=Math.max(Number(this._storageLimit),0);return e>0?e:0}get gasLimit(){return this.roundUp(Number(this._milligasLimit)/1e3+100)}get operationFeeMutez(){return.1*(Number(this._milligasLimit)/1e3+100)+1*Number(this.opSize)}roundUp(e){return Math.ceil(Number(e))}get minimalFeeMutez(){return this.roundUp(r+this.operationFeeMutez)}get suggestedFeeMutez(){return this.roundUp(this.operationFeeMutez+200)}get usingBaseFeeMutez(){return Math.max(Number(this.baseFeeMutez),r)+this.roundUp(this.operationFeeMutez)}get totalCost(){return this.minimalFeeMutez+this.burnFeeMutez}get consumedMilligas(){return Number(this._milligasLimit)}static createEstimateInstanceFromProperties(e){let t,r=0,i=0,o=0,s=0;return e.forEach((e=>{r+=e.milligasLimit,i+=e.storageLimit,o+=e.opSize,s=Math.max(e.minimalFeePerStorageByteMutez,s),e.baseFeeMutez&&(t=t?t+e.baseFeeMutez:e.baseFeeMutez)})),new n(r,i,o,s,t)}static createArrayEstimateInstancesFromProperties(e){return e.map((e=>new n(e.milligasLimit,e.storageLimit,e.opSize,e.minimalFeePerStorageByteMutez,e.baseFeeMutez)))}}t.Estimate=n},8794: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.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4705),t),i(r(1243),t),i(r(4782),t),i(r(1826),t)},4782:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.RPCEstimateProvider=void 0;const o=r(835),s=r(807),a=r(4705),c=r(4632),u=r(1826),l=r(6003),f=r(2021),d=r(227);class h extends l.Provider{constructor(){super(...arguments),this.ALLOCATION_STORAGE=257,this.ORIGINATION_STORAGE=257,this.OP_SIZE_REVEAL=128,this.prepare=new f.PrepareProvider(this.context)}getKeys(){return n(this,void 0,void 0,(function*(){const e=this.context.isAnySignerConfigured();return{publicKeyHash:e?yield this.signer.publicKeyHash():yield this.context.walletProvider.getPKH(),publicKey:e?yield this.signer.publicKey():void 0}}))}getEstimationPropertiesFromOperationContent(e,t,r){const n=o.flattenOperationResult({contents:[e]});let i=0,a=0;return n.forEach((e=>{a+="originated_contracts"in e&&void 0!==e.originated_contracts?e.originated_contracts.length*this.ORIGINATION_STORAGE:0,a+="allocated_destination_contract"in e?this.ALLOCATION_STORAGE:0,i+=Number(e.consumed_milligas)||0,a+="paid_storage_size_diff"in e&&Number(e.paid_storage_size_diff)||0,a+="storage_size"in e&&"global_address"in e&&Number(e.storage_size)||0,a+="genesis_commitment_hash"in e?Number(e.size):0})),s.isOpWithFee(e)?{milligasLimit:i||0,storageLimit:Number(a||0),opSize:t,minimalFeePerStorageByteMutez:r.toNumber()}:{milligasLimit:0,storageLimit:0,opSize:t,minimalFeePerStorageByteMutez:r.toNumber(),baseFeeMutez:0}}calculateEstimates(e,t){return n(this,void 0,void 0,(function*(){const{opbytes:r,opOb:{branch:n,contents:i}}=yield this.forge(e),s={operation:{branch:n,contents:i},chain_id:yield this.context.readProvider.getChainId()},{opResponse:a}=yield this.simulate(s),{cost_per_byte:c}=t,u=[...o.flattenErrors(a,"backtracked"),...o.flattenErrors(a)];if(u.length)throw new o.TezosOperationError(u,"Error occurred during estimation");let l=1;return Array.isArray(e.opOb.contents)&&e.opOb.contents.length>1&&(l="reveal"===a.contents[0].kind?e.opOb.contents.length-1:e.opOb.contents.length),a.contents.map((e=>this.getEstimationPropertiesFromOperationContent(e,"reveal"===e.kind?this.OP_SIZE_REVEAL/2:r.length/2/l,c)))}))}originate(e){return n(this,void 0,void 0,(function*(){const t=yield this.prepare.originate(e),r=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.calculateEstimates(t,r);return"reveal"===t.opOb.contents[0].kind&&n.shift(),a.Estimate.createEstimateInstanceFromProperties(n)}))}transfer(e){var t,{fee:r,storageLimit:o,gasLimit:s}=e,u=i(e,["fee","storageLimit","gasLimit"]);return n(this,void 0,void 0,(function*(){const e=c.validateAddress(u.to);if(e!==c.ValidationResult.VALID)throw new d.InvalidAddressError(u.to,c.invalidDetail(e));const n=c.validateAddress(null!==(t=u.source)&&void 0!==t?t:"");if(u.source&&n!==c.ValidationResult.VALID)throw new d.InvalidAddressError(u.source,c.invalidDetail(n));if(u.amount<0)throw new d.InvalidAmountError(u.amount.toString());const i=yield this.prepare.transaction(Object.assign({fee:r,storageLimit:o,gasLimit:s},u)),l=yield this.context.readProvider.getProtocolConstants("head"),f=yield this.calculateEstimates(i,l);return"reveal"===i.opOb.contents[0].kind&&f.shift(),a.Estimate.createEstimateInstanceFromProperties(f)}))}transferTicket(e){var t,{fee:r,storageLimit:o,gasLimit:s}=e,u=i(e,["fee","storageLimit","gasLimit"]);return n(this,void 0,void 0,(function*(){const e=c.validateAddress(u.destination);if(e!==c.ValidationResult.VALID)throw new d.InvalidAddressError(u.destination,c.invalidDetail(e));const n=c.validateAddress(null!==(t=u.source)&&void 0!==t?t:"");if(u.source&&n!==c.ValidationResult.VALID)throw new d.InvalidAddressError(u.source,c.invalidDetail(n));const i=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.prepare.transferTicket(Object.assign({fee:r,storageLimit:o,gasLimit:s},u)),f=yield this.calculateEstimates(l,i);return"reveal"===l.opOb.contents[0].kind&&f.shift(),a.Estimate.createEstimateInstanceFromProperties(f)}))}setDelegate(e){var t,{fee:r,gasLimit:o,storageLimit:s}=e,u=i(e,["fee","gasLimit","storageLimit"]);return n(this,void 0,void 0,(function*(){const e=c.validateAddress(u.source);if(u.source&&e!==c.ValidationResult.VALID)throw new d.InvalidAddressError(u.source,c.invalidDetail(e));const n=c.validateAddress(null!==(t=u.delegate)&&void 0!==t?t:"");if(u.delegate&&n!==c.ValidationResult.VALID)throw new d.InvalidAddressError(u.delegate,c.invalidDetail(n));const i=yield this.prepare.delegation(Object.assign({fee:r,storageLimit:s,gasLimit:o},u)),l=yield this.context.readProvider.getProtocolConstants("head"),f=yield this.calculateEstimates(i,l);return"reveal"===i.opOb.contents[0].kind&&f.shift(),a.Estimate.createEstimateInstanceFromProperties(f)}))}batch(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.batch(e),n=yield this.calculateEstimates(r,t);return a.Estimate.createArrayEstimateInstancesFromProperties(n)}))}registerDelegate(e,t){var{fee:r,storageLimit:o,gasLimit:s}=e,c=i(e,["fee","storageLimit","gasLimit"]);return n(this,void 0,void 0,(function*(){const e=(yield this.getKeys()).publicKeyHash,n=yield this.context.readProvider.getProtocolConstants("head"),i=t||e,u=yield this.prepare.registerDelegate(Object.assign({fee:r,storageLimit:o,gasLimit:s},c),i),l=yield this.calculateEstimates(u,n);return"reveal"===u.opOb.contents[0].kind&&l.shift(),a.Estimate.createEstimateInstanceFromProperties(l)}))}reveal(e){return n(this,void 0,void 0,(function*(){const{publicKeyHash:t,publicKey:r}=yield this.getKeys();if(!r)throw new u.RevealEstimateError;if(yield this.isAccountRevealRequired(t)){const t=yield this.context.readProvider.getProtocolConstants("head"),r=e?yield this.prepare.reveal(e):yield this.prepare.reveal({}),n=yield this.calculateEstimates(r,t);return a.Estimate.createEstimateInstanceFromProperties(n)}}))}registerGlobalConstant(e){var{fee:t,storageLimit:r,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);return n(this,void 0,void 0,(function*(){const e=yield this.prepare.registerGlobalConstant(Object.assign({fee:t,storageLimit:r,gasLimit:o},s)),n=yield this.context.readProvider.getProtocolConstants("head"),i=yield this.calculateEstimates(e,n);return"reveal"===e.opOb.contents[0].kind&&i.shift(),a.Estimate.createEstimateInstanceFromProperties(i)}))}increasePaidStorage(e){var{fee:t,storageLimit:r,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);return n(this,void 0,void 0,(function*(){if(s.amount<0)throw new d.InvalidAmountError(s.amount.toString());const e=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.prepare.increasePaidStorage(Object.assign({fee:t,storageLimit:r,gasLimit:o},s)),i=yield this.calculateEstimates(n,e);return"reveal"===n.opOb.contents[0].kind&&i.shift(),a.Estimate.createEstimateInstanceFromProperties(i)}))}updateConsensusKey(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.updateConsensusKey(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&n.shift(),a.Estimate.createEstimateInstanceFromProperties(n)}))}smartRollupAddMessages(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.smartRollupAddMessages(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&n.shift(),a.Estimate.createEstimateInstanceFromProperties(n)}))}smartRollupOriginate(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.smartRollupOriginate(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&n.shift(),a.Estimate.createEstimateInstanceFromProperties(n)}))}contractCall(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.contractCall(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&n.shift(),a.Estimate.createEstimateInstanceFromProperties(n)}))}}t.RPCEstimateProvider=h},7336:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeForger=void 0;const i=r(3557);t.CompositeForger=class{constructor(e){if(this.forgers=e,0===e.length)throw new i.UnspecifiedForgerError}forge({branch:e,contents:t}){return n(this,void 0,void 0,(function*(){const r=yield Promise.all(this.forgers.map((r=>r.forge({branch:e,contents:t}))));if(0===r.length)throw new i.UnspecifiedForgerError;let n=r.pop();for(;r.length;){const e=r.pop();if(e!==n)throw new i.ForgingMismatchError([n,e]);n=e}return n}))}}},3557:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnspecifiedForgerError=t.ForgingMismatchError=void 0;const n=r(227);class i extends n.TaquitoError{constructor(e){super(),this.results=e,this.name="ForgingMismatchError",this.message="Forging mismatch error"}}t.ForgingMismatchError=i;class o extends n.TezosToolkitConfigError{constructor(){super(),this.name="UnspecifiedForgerError",this.message="No forger has been configured. Please configure new CompositeForger([rpcForger, localForger]) with your TezosToolkit instance."}}t.UnspecifiedForgerError=o},794:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RpcForger=void 0;t.RpcForger=class{constructor(e){this.context=e}forge({branch:e,contents:t}){return this.context.rpc.forgeOperations({branch:e,contents:t})}}},6713:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TaquitoLocalForger=void 0;const i=r(5078);t.TaquitoLocalForger=class{constructor(e){this.context=e}getNextProto(){return n(this,void 0,void 0,(function*(){if(!this.context.proto){const e=yield this.context.readProvider.getNextProtocol("head");this.context.proto=e}return this.context.proto}))}forge({branch:e,contents:t}){return n(this,void 0,void 0,(function*(){return new i.LocalForger(yield this.getNextProto()).forge({branch:e,contents:t})}))}}},5505:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGlobalConstantsProvider=void 0;const i=r(3739);t.DefaultGlobalConstantsProvider=class{constructor(){this._globalConstantsLibrary={}}loadGlobalConstant(e){for(const t in e)Object.assign(this._globalConstantsLibrary,{[t]:e[t]})}getGlobalConstantByHash(e){return n(this,void 0,void 0,(function*(){const t=this._globalConstantsLibrary[e];if(!t)throw new i.GlobalConstantNotFound(e);return t}))}}},3739:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnconfiguredGlobalConstantsProviderError=t.GlobalConstantNotFound=void 0;const n=r(227);class i extends n.TaquitoError{constructor(e){super(),this.hash=e,this.name="GlobalConstantNotFound",this.message=`Please load the value associated with the constant ${e} using the loadGlobalConstant method of the DefaultGlobalConstantsProvider.`}}t.GlobalConstantNotFound=i;class o extends n.TezosToolkitConfigError{constructor(){super(),this.name="UnconfiguredGlobalConstantsProviderError",this.message="No global constants provider has been configured. Please configure one by calling setGlobalConstantsProvider({globalConstantsProvider}) on your TezosToolkit instance."}}t.UnconfiguredGlobalConstantsProviderError=o},3171:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9494:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopGlobalConstantsProvider=void 0;const i=r(3739);t.NoopGlobalConstantsProvider=class{getGlobalConstantByHash(e){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredGlobalConstantsProviderError}))}}},5180:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatErrorMessage=void 0;const n=r(5543);t.formatErrorMessage=function(e,t){const r=JSON.parse(e.body);if(r[0]&&r[0].kind&&r[0].msg){const i=JSON.stringify({kind:r[0].kind,id:r[0].id,msg:r[0].msg.replace(t,"")});return new n.HttpResponseError(`Http error response: (${e.status}) ${i}`,e.status,e.statusText,i,e.url)}return e}},134:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5744:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcInjector=void 0;const i=r(5180),o=r(5543);t.RpcInjector=class{constructor(e){this.context=e}inject(e){return n(this,void 0,void 0,(function*(){let t;try{t=yield this.context.rpc.injectOperation(e)}catch(e){const t=". You may want to use --replace to provide adequate fee and replace it";throw e instanceof o.HttpResponseError&&e.message.includes(t)?i.formatErrorMessage(e,t):e}return t}))}}},3729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BallotOperation=void 0;const n=r(8361);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"ballot"===e.kind));return e||void 0}get period(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.period}get proposal(){return this.params.proposal}get ballot(){return this.params.ballot}}t.BallotOperation=i},3650:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BatchOperation=void 0;const n=r(6391),i=r(150),o=r(835),s=r(8361),a=r(807);class c extends s.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}sumProp(e,t){return e.reduce(((e,r)=>t in r?Number(r[t])+e:e),0)}getOriginatedContractAddresses(){const e=this.results.filter((e=>"origination"===e.kind));let t=[];for(const r of e)r.metadata.operation_result.originated_contracts&&(t=[...t,...r.metadata.operation_result.originated_contracts]);return t}get status(){return this.results.filter((e=>-1!==i.BATCH_KINDS.indexOf(e.kind))).map((e=>{if(a.hasMetadataWithResult(e)){return e.metadata.operation_result.status}return"unknown"}))[0]||"unknown"}get fee(){return this.sumProp(this.params,"fee")}get gasLimit(){return this.sumProp(this.params,"gas_limit")}get storageLimit(){return this.sumProp(this.params,"storage_limit")}get consumedGas(){return n.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.default.ROUND_UP}),new n.default(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(o.flattenOperationResult({contents:this.results}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(o.flattenOperationResult({contents:this.results}),"paid_storage_size_diff"))}get errors(){return o.flattenErrors({contents:this.results})}}t.BatchOperation=c},9785:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelegateOperation=void 0;const n=r(6391),i=r(8361);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"delegation"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get delegate(){return this.params.delegate}get isRegisterOperation(){return this.delegate===this.source}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),this.consumedMilliGas?new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.DelegateOperation=o},738:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DrainDelegateOperation=void 0;const n=r(8361);class i extends n.Operation{constructor(e,t,r,n,i){super(e,r,n,i),this.params=t}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"drain_delegate"===e.kind)),t=e&&e.metadata&&e.metadata.balance_updates;return t||void 0}get consensusKey(){return this.params.consensus_key}get delegate(){return this.params.delegate}get destination(){return this.params.destination}}t.DrainDelegateOperation=i},835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidEstimateValueError=t.OriginationOperationError=t.flattenErrors=t.flattenOperationResult=t.TezosPreapplyFailureError=t.TezosOperationError=void 0;const n=r(227),i=r(807);class o extends n.RpcError{constructor(e,t){super(),this.errors=e,this.errorDetails=t,this.name="TezosOperationError";const r=e[e.length-1];this.id=r.id,this.kind=r.kind,this.message=`(${this.kind}) ${this.id}`,"with"in r&&(r.with.string?this.message=r.with.string:r.with.int?this.message=r.with.int:this.message=JSON.stringify(r.with))}}t.TezosOperationError=o;class s extends Error{constructor(e){super(),this.result=e,this.name="TezosPreapplyFailureError",this.message="Preapply returned an unexpected result"}}t.TezosPreapplyFailureError=s;t.flattenOperationResult=e=>{const t=Array.isArray(e)?e:[e],r=[];for(let e=0;e<t.length;e++)for(let n=0;n<t[e].contents.length;n++){const o=t[e].contents[n];i.hasMetadataWithResult(o)&&"fee"in o&&(r.push(Object.assign({fee:o.fee},o.metadata.operation_result)),Array.isArray(o.metadata.internal_operation_results)&&o.metadata.internal_operation_results.forEach((e=>r.push(e.result))))}return r};t.flattenErrors=(e,t="failed")=>{const r=Array.isArray(e)?e:[e];let n=[];for(let e=0;e<r.length;e++)for(let o=0;o<r[e].contents.length;o++){const s=r[e].contents[o];if(i.hasMetadata(s)&&(i.hasMetadataWithResult(s)&&s.metadata.operation_result.status===t&&(n=n.concat(s.metadata.operation_result.errors||[])),i.hasMetadataWithInternalOperationResult(s)&&Array.isArray(s.metadata.internal_operation_results)))for(const e of s.metadata.internal_operation_results)"result"in e&&e.result.status===t&&(n=n.concat(e.result.errors||[]))}return n};class a extends n.TaquitoError{constructor(e){super(),this.message=e,this.name="OriginationOperationError"}}t.OriginationOperationError=a;class c extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidEstimateValueError"}}t.InvalidEstimateValueError=c},106:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IncreasePaidStorageOperation=void 0;const n=r(8361);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"increase_paid_storage"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get amount(){return this.params.amount}get destination(){return this.params.destination}}t.IncreasePaidStorageOperation=i},3323:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Operation=t.DrainDelegateOperation=t.BallotOperation=t.TransactionOperation=t.OriginationOperation=t.DelegateOperation=t.BatchOperation=t.InvalidEstimateValueError=t.TezosPreapplyFailureError=t.TezosOperationError=t.OpKind=void 0;var n=r(807);Object.defineProperty(t,"OpKind",{enumerable:!0,get:function(){return n.OpKind}});var i=r(835);Object.defineProperty(t,"TezosOperationError",{enumerable:!0,get:function(){return i.TezosOperationError}}),Object.defineProperty(t,"TezosPreapplyFailureError",{enumerable:!0,get:function(){return i.TezosPreapplyFailureError}}),Object.defineProperty(t,"InvalidEstimateValueError",{enumerable:!0,get:function(){return i.InvalidEstimateValueError}});var o=r(3650);Object.defineProperty(t,"BatchOperation",{enumerable:!0,get:function(){return o.BatchOperation}});var s=r(9785);Object.defineProperty(t,"DelegateOperation",{enumerable:!0,get:function(){return s.DelegateOperation}});var a=r(6646);Object.defineProperty(t,"OriginationOperation",{enumerable:!0,get:function(){return a.OriginationOperation}});var c=r(1846);Object.defineProperty(t,"TransactionOperation",{enumerable:!0,get:function(){return c.TransactionOperation}});var u=r(3729);Object.defineProperty(t,"BallotOperation",{enumerable:!0,get:function(){return u.BallotOperation}});var l=r(738);Object.defineProperty(t,"DrainDelegateOperation",{enumerable:!0,get:function(){return l.DrainDelegateOperation}});var f=r(8361);Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return f.Operation}})},8361:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Operation=void 0;const i=r(977),o=r(9002),s=r(807),a=r(4632),c=r(552),u=r(7642),l=r(227);t.Operation=class{constructor(e,t,r,n){if(this.hash=e,this.raw=t,this.results=r,this.context=n,this._pollingConfig$=new i.ReplaySubject(1),this.currentHead$=this._pollingConfig$.pipe(o.switchMap((e=>new i.BehaviorSubject(e).pipe(o.timeout({each:1e3*e.timeout,with:()=>i.throwError((()=>new u.ConfirmationTimeoutError("Confirmation polling timed out")))})))),o.switchMap((()=>i.defer((()=>c.createObservableFromSubscription(this.context.stream.subscribeBlock("head")))).pipe(o.switchMap((e=>{var t,r;const n=null!==(r=null===(t=this.lastHead)||void 0===t?void 0:t.header.level)&&void 0!==r?r:e.header.level-1;return i.range(n+1,e.header.level-n-1).pipe(o.concatMap((e=>this.context.readProvider.getBlock(e))),o.endWith(e))})),o.tap((e=>this.lastHead=e))))),o.shareReplay({refCount:!0})),this.confirmed$=this.currentHead$.pipe(o.map((e=>{for(let t=3;t>=0;t--)e.operations[t].forEach((t=>{t.hash===this.hash&&(this._foundAt=e.header.level)}));if(e.header.level-this._foundAt>=0)return this._foundAt})),o.filter((e=>void 0!==e)),o.first(),o.shareReplay()),this._foundAt=Number.POSITIVE_INFINITY,a.validateOperation(this.hash)!==a.ValidationResult.VALID)throw new l.InvalidOperationHashError(this.hash);this.confirmed$.pipe(o.first(),o.catchError((()=>i.of(i.EMPTY)))).subscribe()}get includedInBlock(){return this._foundAt}get revealOperation(){return Array.isArray(this.results)&&this.results.find((e=>"reveal"===e.kind))}get revealStatus(){return this.revealOperation?this.revealOperation.metadata.operation_result.status:"unknown"}get status(){return this.results.map((e=>s.hasMetadataWithResult(e)?e.metadata.operation_result.status:"unknown"))[0]||"unknown"}confirmation(e,t){return n(this,void 0,void 0,(function*(){if(void 0!==e&&e<1)throw new u.InvalidConfirmationCountError(e);const{defaultConfirmationCount:r,confirmationPollingTimeoutSecond:n}=this.context.config;this._pollingConfig$.next({timeout:t||n});const i=void 0!==e?e:r;return new Promise(((e,t)=>{this.confirmed$.pipe(o.switchMap((()=>this.currentHead$)),o.filter((e=>e.header.level-this._foundAt>=i-1)),o.first()).subscribe((t=>{e(this._foundAt+(i-1))}),t)}))}))}}},6646:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OriginationOperation=void 0;const i=r(6391),o=r(835),s=r(8361),a=r(807);class c extends s.Operation{constructor(e,t,r,n,i,o){super(e,r,n,i),this.params=t,this.contractProvider=o;const s=this.operationResults&&this.operationResults.originated_contracts;Array.isArray(s)&&(this.contractAddress=s[0])}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"origination"===e.kind)),t=e&&a.hasMetadataWithResult(e)&&e.metadata.operation_result;return t||void 0}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get storageDiff(){const e=this.operationResults&&this.operationResults.paid_storage_size_diff;return e||void 0}get storageSize(){const e=this.operationResults&&this.operationResults.storage_size;return e||void 0}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}contract(e,t){return n(this,void 0,void 0,(function*(){if(!this.contractAddress)throw new o.OriginationOperationError("No contract was originated in this operation");return yield this.confirmation(e,t),this.contractProvider.at(this.contractAddress)}))}}t.OriginationOperation=c},7279:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProposalsOperation=void 0;const n=r(8361);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"proposals"===e.kind));return e||void 0}get proposals(){return this.params.proposals}get period(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.period}}t.ProposalsOperation=i},5544:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RegisterGlobalConstantOperation=void 0;const n=r(6391),i=r(8361);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r,this.globalConstantHash=this.operationResults&&this.operationResults.global_address}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"register_global_constant"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get registeredExpression(){return this.params.value}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),this.consumedMilliGas?new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}}t.RegisterGlobalConstantOperation=o},2342:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RevealOperation=void 0;const n=r(6391),i=r(835),o=r(8361);class s extends o.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"reveal"===e.kind));return e?[e]:[]}get status(){const e=this.operationResults[0];return e?e.metadata.operation_result.status:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get publicKey(){return this.params.public_key}sumProp(e,t){return e.reduce(((e,r)=>t in r?Number(r[t])+e:e),0)}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(i.flattenOperationResult({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(i.flattenOperationResult({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp(i.flattenOperationResult({contents:this.operationResults}),"storage_size"))}get errors(){return i.flattenErrors({contents:this.operationResults})}}t.RevealOperation=s},2864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartRollupAddMessagesOperation=void 0;const n=r(8361);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"smart_rollup_add_messages"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get message(){return this.params.message}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.SmartRollupAddMessagesOperation=i},5847:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartRollupOriginateOperation=void 0;const n=r(6368),i=r(8361);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>e.kind===n.OpKind.SMART_ROLLUP_ORIGINATE)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get pvmKind(){return this.params.pvm_kind}get kernel(){return this.params.kernel}get originationProof(){return this.params.origination_proof}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.SmartRollupOriginateOperation=o},1846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionOperation=void 0;const n=r(6391),i=r(835),o=r(8361);class s extends o.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"transaction"===e.kind));return e?[e]:[]}get status(){const e=this.operationResults[0];return e?e.metadata.operation_result.status:"unknown"}get amount(){return new n.default(this.params.amount)}get destination(){return this.params.destination}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}sumProp(e,t){return e.reduce(((e,r)=>t in r?Number(r[t])+e:e),0)}get consumedGas(){return n.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.default.ROUND_UP}),new n.default(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(i.flattenOperationResult({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(i.flattenOperationResult({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp(i.flattenOperationResult({contents:this.operationResults}),"storage_size"))}get errors(){return i.flattenErrors({contents:this.operationResults})}}t.TransactionOperation=s},8983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransferTicketOperation=void 0;const n=r(6368),i=r(6391),o=r(3323);class s extends o.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>e.kind===n.OpKind.TRANSFER_TICKET)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}}t.TransferTicketOperation=s},807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasMetadataWithInternalOperationResult=t.hasMetadataWithResult=t.hasMetadata=t.isSourceOp=t.isOpRequireReveal=t.isOpWithFee=t.isKind=t.findWithKind=t.attachKind=t.OpKind=void 0;var n=r(6368);Object.defineProperty(t,"OpKind",{enumerable:!0,get:function(){return n.OpKind}});t.attachKind=(e,t)=>Object.assign(Object.assign({},e),{kind:t});t.findWithKind=(e,r)=>{if(Array.isArray(e)){const n=e.find((e=>e.kind===r));if(n&&t.isKind(n,r))return n}};t.isKind=(e,t)=>e.kind===t;t.isOpWithFee=e=>-1!==["transaction","delegation","origination","reveal","register_global_constant","increase_paid_storage","tx_rollup_origination","tx_rollup_submit_batch","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate"].indexOf(e.kind);t.isOpRequireReveal=e=>-1!==["transaction","delegation","origination","register_global_constant","increase_paid_storage","tx_rollup_origination","tx_rollup_submit_batch","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate"].indexOf(e.kind);t.isSourceOp=e=>-1!==["transaction","delegation","origination","reveal","ballot"].indexOf(e.kind);t.hasMetadata=e=>"metadata"in e;t.hasMetadataWithResult=e=>t.hasMetadata(e)&&"operation_result"in e.metadata;t.hasMetadataWithInternalOperationResult=e=>t.hasMetadata(e)&&"internal_operation_results"in e.metadata},4384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UpdateConsensusKeyOperation=void 0;const n=r(8361);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"update_consensus_key"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get pk(){return this.params.pk}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.UpdateConsensusKeyOperation=i},4762:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9406:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.MichelCodecPacker=void 0;const i=r(9985);t.MichelCodecPacker=class{packData(e){return n(this,void 0,void 0,(function*(){const{bytes:t}=i.packDataBytes(e.data,e.type);return{packed:t}}))}}},6395:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcPacker=void 0;t.RpcPacker=class{constructor(e){this.context=e}packData(e){return r(this,void 0,void 0,(function*(){return this.context.rpc.packData(e)}))}}},9813:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5286:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.MichelCodecParser=void 0;const i=r(9985),o=r(6700),s=r(8899);t.MichelCodecParser=class{constructor(e){this.context=e}getNextProto(){return n(this,void 0,void 0,(function*(){if(!this.context.proto){const e=yield this.context.readProvider.getNextProtocol("head");this.context.proto=e}return this.context.proto}))}parseScript(e){return n(this,void 0,void 0,(function*(){return new i.Parser({protocol:yield this.getNextProto()}).parseScript(e)}))}parseMichelineExpression(e){return n(this,void 0,void 0,(function*(){return new i.Parser({protocol:yield this.getNextProto()}).parseMichelineExpression(e)}))}parseJSON(e){return n(this,void 0,void 0,(function*(){return new i.Parser({protocol:yield this.getNextProto()}).parseJSON(e)}))}prepareCodeOrigination(e){return n(this,void 0,void 0,(function*(){const t=e;if(t.code=yield this.formatCodeParam(e.code),e.init)t.init=yield this.formatInitParam(e.init);else if(e.storage){const r=t.code.find((e=>"prim"in e&&"storage"===e.prim));if(!(null==r?void 0:r.args))throw new o.InvalidCodeParameter("The storage section is missing from the script",e.code);const n=new s.Schema(r.args[0]),a=yield this.findGlobalConstantsHashAndValue(n);if(0!==Object.keys(a).length){const n=new i.Parser({expandGlobalConstant:a}).parseJSON(r.args[0]),o=new s.Schema(n);t.init=o.Encode(e.storage)}else t.init=n.Encode(e.storage);delete t.storage}return t}))}formatCodeParam(e){return n(this,void 0,void 0,(function*(){let t;if("string"==typeof e){const r=yield this.parseScript(e);if(null===r)throw new o.InvalidCodeParameter("Unable to parse",e);t=r}else{const r=yield this.parseJSON(e),n=["parameter","storage","code"];t=r.sort(((e,t)=>n.indexOf(e.prim)-n.indexOf(t.prim)))}return t}))}formatInitParam(e){return n(this,void 0,void 0,(function*(){let t;if("string"==typeof e){const r=yield this.parseMichelineExpression(e);if(null===r)throw new o.InvalidInitParameter("Invalid init parameter",e);t=r}else t=yield this.parseJSON(e);return t}))}findGlobalConstantsHashAndValue(e){return n(this,void 0,void 0,(function*(){const t=e.findToken("constant"),r={};if(0!==t.length)for(const e of t){const t=e.tokenVal.args;if(t){const e=t[0];if(e.string){const t=e.string,n=yield this.context.globalConstantsProvider.getGlobalConstantByHash(t);Object.assign(r,{[t]:n})}}}return r}))}}},3259:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopParser=void 0;t.NoopParser=class{prepareCodeOrigination(e){return r(this,void 0,void 0,(function*(){return e}))}}},3793: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.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8078),t),i(r(2021),t)},8078:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2021:function(e,t,r){"use strict";var n,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__classPrivateFieldSet||function(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r},s=this&&this.__classPrivateFieldGet||function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},a=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.PrepareProvider=void 0;const c=r(6368),u=r(807),l=r(4593),f=r(7642),d=r(227),h=r(238),p=r(6003),b=r(6391),m=(e,t)=>{var r,n,i;return{fee:null!==(r=e.fee)&&void 0!==r?r:t.fee,gasLimit:null!==(n=e.gasLimit)&&void 0!==n?n:t.gasLimit,storageLimit:null!==(i=e.storageLimit)&&void 0!==i?i:t.storageLimit}};class g extends p.Provider{constructor(e){super(e),this.context=e,n.set(this,void 0),o(this,n,{})}getBlockHash(e){return i(this,void 0,void 0,(function*(){return this.context.readProvider.getBlockHash(null!=e?e:"head~2")}))}getProtocolHash(){return i(this,void 0,void 0,(function*(){return this.context.readProvider.getNextProtocol("head")}))}getHeadCounter(e){var t;return i(this,void 0,void 0,(function*(){return null!==(t=this.context.readProvider.getCounter(e,"head"))&&void 0!==t?t:"0"}))}adjustGasForBatchOperation(e,t,r){return b.default.min(t,e.div(r+1))}getAccountLimits(e,t,r){return i(this,void 0,void 0,(function*(){const n=yield this.context.readProvider.getBalance(e,"head"),{hard_gas_limit_per_operation:i,hard_gas_limit_per_block:o,hard_storage_limit_per_operation:s,cost_per_byte:a}=t;return{fee:0,gasLimit:r?Math.floor(this.adjustGasForBatchOperation(o,i,r).toNumber()):i.toNumber(),storageLimit:Math.floor(b.default.min(n.dividedBy(a),s).toNumber())}}))}getFee(e,t,r){(!s(this,n)[t]||s(this,n)[t]<r)&&(s(this,n)[t]=r);return{counter:`${++s(this,n)[t]}`,fee:void 0===e.fee?"0":`${e.fee}`,gas_limit:void 0===e.gas_limit?"0":`${e.gas_limit}`,storage_limit:void 0===e.storage_limit?"0":`${e.storage_limit}`}}getSource(e,t,r){return{source:void 0===e.source?r||t:e.source}}addRevealOperationIfNeeded(e,t){return i(this,void 0,void 0,(function*(){if(u.isOpRequireReveal(e)){const r=[e],{publicKey:n,pkh:i}=yield this.getKeys();if(yield this.isAccountRevealRequired(t)){if(!n)throw new d.PublicKeyNotFoundError(i);return r.unshift(yield h.createRevealOperation({fee:l.DEFAULT_FEE.REVEAL,storageLimit:l.DEFAULT_STORAGE_LIMIT.REVEAL,gasLimit:l.getRevealGasLimit(i)},t,n)),r}}return e}))}getKeys(){return i(this,void 0,void 0,(function*(){const e=this.context.isAnySignerConfigured();return{pkh:e?yield this.signer.publicKeyHash():yield this.context.walletProvider.getPKH(),publicKey:e?yield this.signer.publicKey():void 0}}))}convertIntoArray(e){return Array.isArray(e)?[...e]:[e]}constructOpContents(e,t,r,n,i){return e.map((e=>{switch(e.kind){case c.OpKind.ACTIVATION:case c.OpKind.DRAIN_DELEGATE:return Object.assign({},e);case c.OpKind.ORIGINATION:return Object.assign(Object.assign(Object.assign(Object.assign({},e),{balance:void 0!==e.balance?`${e.balance}`:"0"}),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.TRANSACTION:{const i=Object.assign(Object.assign(Object.assign(Object.assign({},e),{amount:void 0!==e.amount?`${e.amount}`:"0"}),this.getSource(e,r,n)),this.getFee(e,r,t));if(i.source.toLowerCase().startsWith("kt1"))throw new d.DeprecationError(`KT1 addresses are not supported as source since ${l.Protocols.PsBabyM1}`);return i}case c.OpKind.REVEAL:case c.OpKind.DELEGATION:case c.OpKind.REGISTER_GLOBAL_CONSTANT:case c.OpKind.UPDATE_CONSENSUS_KEY:case c.OpKind.SMART_ROLLUP_ADD_MESSAGES:case c.OpKind.SMART_ROLLUP_ORIGINATE:return Object.assign(Object.assign(Object.assign({},e),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.TRANSFER_TICKET:return Object.assign(Object.assign(Object.assign(Object.assign({},e),{ticket_amount:`${e.ticket_amount}`}),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.INCREASE_PAID_STORAGE:return Object.assign(Object.assign(Object.assign(Object.assign({},e),{amount:`${e.amount}`}),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.BALLOT:case c.OpKind.PROPOSALS:if(void 0===i)throw new f.RPCResponseError("Failed to get the current voting period index");return Object.assign(Object.assign({},e),{period:null==i?void 0:i.voting_period.index});default:throw new d.InvalidOperationKindError(e.kind)}}))}activate({pkh:e,secret:t}){return i(this,void 0,void 0,(function*(){const r=yield h.createActivationOperation({pkh:e,secret:t}),i=this.convertIntoArray(r),s=yield this.getBlockHash(),a=yield this.getProtocolHash();o(this,n,{});const c=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:s,contents:this.constructOpContents(i,c,e),protocol:a},counter:c}}))}reveal({fee:e,gasLimit:t,storageLimit:r}){return i(this,void 0,void 0,(function*(){const{pkh:i,publicKey:s}=yield this.getKeys();if(!s)throw new d.PublicKeyNotFoundError(i);const a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getAccountLimits(i,a),u=m({fee:e,storageLimit:r,gasLimit:t},c),l=yield h.createRevealOperation({fee:u.fee,gasLimit:u.gasLimit,storageLimit:u.storageLimit},i,s),f=this.convertIntoArray(l),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{});const g=parseInt(yield this.getHeadCounter(i),10);return{opOb:{branch:p,contents:this.constructOpContents(f,g,i),protocol:b},counter:g}}))}originate(e,t){var{fee:r,storageLimit:s,gasLimit:c}=e,u=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),l=yield h.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign(Object.assign({},u),m({fee:r,storageLimit:s,gasLimit:c},a)))),f=yield this.addRevealOperationIfNeeded(l,e),d=this.convertIntoArray(f),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{});const g=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:p,contents:this.constructOpContents(d,g,e,t),protocol:b},counter:g}}))}transaction(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),u=yield h.createTransferOperation(Object.assign(Object.assign({},c),m({fee:t,storageLimit:r,gasLimit:s},a))),l=yield this.addRevealOperationIfNeeded(u,e),f=this.convertIntoArray(l),d=yield this.getBlockHash(),p=yield this.getProtocolHash();o(this,n,{});const b=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:d,contents:this.constructOpContents(f,b,e,c.source),protocol:p},counter:b}}))}delegation(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),u=yield h.createSetDelegateOperation(Object.assign(Object.assign({},c),m({fee:t,storageLimit:r,gasLimit:s},a))),l=yield this.addRevealOperationIfNeeded(u,e),f=this.convertIntoArray(l),d=yield this.getBlockHash(),p=yield this.getProtocolHash();o(this,n,{});const b=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:d,contents:this.constructOpContents(f,b,e,c.source),protocol:p},counter:b}}))}registerDelegate({fee:e,storageLimit:t,gasLimit:r},s){return i(this,void 0,void 0,(function*(){const{pkh:i}=yield this.getKeys(),a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getAccountLimits(i,a),u=m({fee:e,storageLimit:t,gasLimit:r},c),l=yield h.createRegisterDelegateOperation({fee:u.fee,storageLimit:u.storageLimit,gasLimit:u.gasLimit},i),f=yield this.addRevealOperationIfNeeded(l,i),d=this.convertIntoArray(f),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{});const g=parseInt(yield this.getHeadCounter(i),10);return{opOb:{branch:p,contents:this.constructOpContents(d,g,i,s),protocol:b},counter:g}}))}registerGlobalConstant(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),u=yield h.createRegisterGlobalConstantOperation(Object.assign(Object.assign({},c),m({fee:t,storageLimit:r,gasLimit:s},a))),l=yield this.addRevealOperationIfNeeded(u,e),f=this.convertIntoArray(l),d=yield this.getBlockHash(),p=yield this.getProtocolHash();o(this,n,{});const b=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:d,contents:this.constructOpContents(f,b,e,c.source),protocol:p},counter:b}}))}updateConsensusKey(e,t){var{fee:r,storageLimit:s,gasLimit:c}=e,u=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),l=yield h.createUpdateConsensusKeyOperation(Object.assign(Object.assign({},u),m({fee:r,storageLimit:s,gasLimit:c},a))),f=yield this.addRevealOperationIfNeeded(l,e),d=this.convertIntoArray(f),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{});const g=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:p,contents:this.constructOpContents(d,g,e,t),protocol:b},counter:g}}))}increasePaidStorage(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),u=yield h.createIncreasePaidStorageOperation(Object.assign(Object.assign({},c),m({fee:t,storageLimit:r,gasLimit:s},a))),l=yield this.addRevealOperationIfNeeded(u,e),f=this.convertIntoArray(l),d=yield this.getBlockHash(),p=yield this.getProtocolHash();o(this,n,{});const b=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:d,contents:this.constructOpContents(f,b,e,c.source),protocol:p},counter:b}}))}ballot(e){return i(this,void 0,void 0,(function*(){const{pkh:t}=yield this.getKeys(),r=yield h.createBallotOperation(Object.assign({},e)),i=this.convertIntoArray(r),s=yield this.getBlockHash(),a=yield this.getProtocolHash();o(this,n,{});const c=parseInt(yield this.getHeadCounter(t),10);let u;try{u=yield this.rpc.getCurrentPeriod()}catch(e){throw new f.RPCResponseError("Failed to get the current voting period index")}return{opOb:{branch:s,contents:this.constructOpContents(i,c,t,void 0,u),protocol:a},counter:c}}))}proposals(e){return i(this,void 0,void 0,(function*(){const{pkh:t}=yield this.getKeys(),r=yield h.createProposalsOperation(Object.assign({},e)),i=this.convertIntoArray(r),s=yield this.getBlockHash(),a=yield this.getProtocolHash();o(this,n,{});const c=parseInt(yield this.getHeadCounter(t),10);let u;try{u=yield this.rpc.getCurrentPeriod()}catch(e){throw new f.RPCResponseError("Failed to get the current voting period index")}return{opOb:{branch:s,contents:this.constructOpContents(i,c,t,void 0,u),protocol:a},counter:c}}))}drainDelegate(e,t){return i(this,void 0,void 0,(function*(){const{pkh:r}=yield this.getKeys(),i=yield h.createDrainDelegateOperation(Object.assign({},e)),s=this.convertIntoArray(i),a=yield this.getBlockHash(),c=yield this.getProtocolHash();o(this,n,{});const u=parseInt(yield this.getHeadCounter(r),10);return{opOb:{branch:a,contents:this.constructOpContents(s,u,r,t),protocol:c},counter:u}}))}transferTicket(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),u=yield h.createTransferTicketOperation(Object.assign(Object.assign({},c),m({fee:t,storageLimit:r,gasLimit:s},a))),l=yield this.addRevealOperationIfNeeded(u,e),f=this.convertIntoArray(l),d=yield this.getBlockHash(),p=yield this.getProtocolHash();o(this,n,{});const b=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:d,contents:this.constructOpContents(f,b,e,c.source),protocol:p},counter:b}}))}smartRollupAddMessages(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),u=yield h.createSmartRollupAddMessagesOperation(Object.assign(Object.assign({},c),m({fee:t,storageLimit:r,gasLimit:s},a))),l=yield this.addRevealOperationIfNeeded(u,e),f=this.convertIntoArray(l),d=yield this.getBlockHash(),p=yield this.getProtocolHash();o(this,n,{});const b=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:d,contents:this.constructOpContents(f,b,e,c.source),protocol:p},counter:b}}))}smartRollupOriginate(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.rpc.getOriginationProof({kind:c.pvmKind,kernel:c.kernel}),a=yield this.context.readProvider.getProtocolConstants("head"),u=yield this.getAccountLimits(e,a),l=yield h.createSmartRollupOriginateOperation(Object.assign(Object.assign(Object.assign({},m({fee:t,storageLimit:r,gasLimit:s},u)),c),{originationProof:i})),f=yield this.addRevealOperationIfNeeded(l,e),d=this.convertIntoArray(f),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{});const g=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:p,contents:this.constructOpContents(d,g,e,c.source),protocol:b},counter:g}}))}batch(e,t){return i(this,void 0,void 0,(function*(){const{pkh:r,publicKey:i}=yield this.getKeys(),s=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(r,s,e.length),c=yield this.isRevealOpNeeded(e,r),f=[];if(t)for(const r of e)if(u.isOpWithFee(r)){const e=t.shift(),n=m(r,{fee:e.suggestedFeeMutez,storageLimit:e.storageLimit,gasLimit:e.gasLimit});f.push(yield this.getRPCOp(Object.assign(Object.assign({},r),n)))}else f.push(Object.assign({},r));else for(const t of e)if(u.isOpWithFee(t)){const e=m(t,a);f.push(yield this.getRPCOp(Object.assign(Object.assign({},t),e)))}else f.push(Object.assign({},t));if(c){if(!i)throw new d.PublicKeyNotFoundError(r);f.unshift(yield h.createRevealOperation({fee:l.DEFAULT_FEE.REVEAL,storageLimit:l.DEFAULT_STORAGE_LIMIT.REVEAL,gasLimit:l.getRevealGasLimit(r)},r,i))}const p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{});const g=parseInt(yield this.getHeadCounter(r),10);return{opOb:{branch:p,contents:this.constructOpContents(f,g,r),protocol:b},counter:g}}))}contractCall(e){var t,r,s;return i(this,void 0,void 0,(function*(){const i=yield this.getBlockHash(),a=yield this.getProtocolHash(),{pkh:u}=yield this.getKeys();o(this,n,{});const l=parseInt(yield this.getHeadCounter(u),10),f=e.toTransferParams(),d=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.getAccountLimits(u,d),p=m({fee:f.fee,storageLimit:f.storageLimit,gasLimit:f.gasLimit},h),b={kind:c.OpKind.TRANSACTION,fee:null!==(t=f.fee)&&void 0!==t?t:p.fee,gas_limit:null!==(r=f.gasLimit)&&void 0!==r?r:p.gasLimit,storage_limit:null!==(s=f.storageLimit)&&void 0!==s?s:p.storageLimit,amount:String(f.amount),destination:f.to,parameters:f.parameter},g=yield this.addRevealOperationIfNeeded(b,u),v=this.convertIntoArray(g);return{opOb:{branch:i,contents:this.constructOpContents(v,l,u),protocol:a},counter:l}}))}toPreapply(e){return i(this,void 0,void 0,(function*(){const{opOb:{contents:t,branch:r,protocol:n}}=e,i=this.toForge(e),o=yield this.context.forger.forge(i);return[{contents:t,branch:r,protocol:n,signature:(yield this.context.signer.sign(o,new Uint8Array([3]))).prefixSig}]}))}toForge({opOb:{contents:e,branch:t}}){return{branch:t,contents:e}}}t.PrepareProvider=g,n=new WeakMap},6003:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;const o=r(807),s=r(835),a=r(9480),c=r(6368),u=r(4632);t.Provider=class{constructor(e){this.context=e}get rpc(){return this.context.rpc}get signer(){return this.context.signer}forge({opOb:{branch:e,contents:t,protocol:r},counter:i}){return n(this,void 0,void 0,(function*(){return{opbytes:yield this.context.forger.forge({branch:e,contents:t}),opOb:{branch:e,contents:t,protocol:r},counter:i}}))}estimate(e,t){var{fee:r,gasLimit:o,storageLimit:a}=e,c=i(e,["fee","gasLimit","storageLimit"]);return n(this,void 0,void 0,(function*(){let e=r,n=o,i=a;if(e&&e%1!=0)throw new s.InvalidEstimateValueError(`Fee value must not be a decimal: ${e}`);if(n&&n%1!=0)throw new s.InvalidEstimateValueError(`Gas Limit value must not be a decimal: ${n}`);if(i&&i%1!=0)throw new s.InvalidEstimateValueError(`Storage Limit value must not be a decimal: ${i}`);if(void 0===r||void 0===o||void 0===a){const s=yield t(Object.assign({fee:r,gasLimit:o,storageLimit:a},c));null!=e||(e=s.suggestedFeeMutez),null!=n||(n=s.gasLimit),null!=i||(i=s.storageLimit)}return{fee:e,gasLimit:n,storageLimit:i}}))}getRPCOp(e){return n(this,void 0,void 0,(function*(){switch(e.kind){case c.OpKind.TRANSACTION:return a.createTransferOperation(Object.assign({},e));case c.OpKind.ORIGINATION:return a.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign({},e)));case c.OpKind.DELEGATION:return a.createSetDelegateOperation(Object.assign({},e));case c.OpKind.REGISTER_GLOBAL_CONSTANT:return a.createRegisterGlobalConstantOperation(Object.assign({},e));case c.OpKind.INCREASE_PAID_STORAGE:return a.createIncreasePaidStorageOperation(Object.assign({},e));case c.OpKind.TRANSFER_TICKET:return a.createTransferTicketOperation(Object.assign({},e));case c.OpKind.SMART_ROLLUP_ADD_MESSAGES:return a.createSmartRollupAddMessagesOperation(Object.assign({},e));case c.OpKind.SMART_ROLLUP_ORIGINATE:return a.createSmartRollupOriginateOperation(Object.assign({},e));default:throw new u.InvalidOperationKindError(e.kind)}}))}runOperation(e){return n(this,void 0,void 0,(function*(){return{opResponse:yield this.rpc.runOperation(e),op:e,context:this.context.clone()}}))}simulate(e){return n(this,void 0,void 0,(function*(){return{opResponse:yield this.rpc.simulateOperation(e),op:e,context:this.context.clone()}}))}isRevealOpNeeded(e,t){return n(this,void 0,void 0,(function*(){return!(!(yield this.isAccountRevealRequired(t))||!this.isRevealRequiredForOpType(e))}))}isAccountRevealRequired(e){return n(this,void 0,void 0,(function*(){return!(yield this.context.readProvider.isAccountRevealed(e,"head"))}))}isRevealRequiredForOpType(e){let t=!1;for(const r of e)o.isOpRequireReveal(r)&&(t=!0);return t}signAndInject(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.sign(e.opbytes,new Uint8Array([3]));e.opbytes=t.sbytes,e.opOb.signature=t.prefixSig;const r=[],n=yield this.rpc.preapplyOperations([e.opOb]);if(!Array.isArray(n))throw new s.TezosPreapplyFailureError(n);for(let e=0;e<n.length;e++)for(let t=0;t<n[e].contents.length;t++)r.push(n[e].contents[t]);const i=s.flattenErrors(n);if(i.length)throw new s.TezosOperationError(i,"Error occurred during validation simulation of operation");return{hash:yield this.context.injector.inject(e.opbytes),forgedBytes:e,opResponse:r,context:this.context.clone()}}))}}},259:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcReadAdapter=void 0;t.RpcReadAdapter=class{constructor(e){this.rpc=e}getBalance(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getBalance(e,{block:String(t)})}))}getDelegate(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getDelegate(e,{block:String(t)})}))}getNextProtocol(e){return r(this,void 0,void 0,(function*(){return(yield this.rpc.getProtocols({block:String(e)})).next_protocol}))}getProtocolConstants(e){return r(this,void 0,void 0,(function*(){const{time_between_blocks:t,minimal_block_delay:r,hard_gas_limit_per_operation:n,hard_gas_limit_per_block:i,hard_storage_limit_per_operation:o,cost_per_byte:s,tx_rollup_origination_size:a,smart_rollup_origination_size:c}=yield this.rpc.getConstants({block:String(e)});return{time_between_blocks:t,minimal_block_delay:r,hard_gas_limit_per_operation:n,hard_gas_limit_per_block:i,hard_storage_limit_per_operation:o,cost_per_byte:s,tx_rollup_origination_size:a,smart_rollup_origination_size:c}}))}getScript(e,t){return r(this,void 0,void 0,(function*(){const{script:r}=yield this.rpc.getContract(e,{block:String(t)});return r}))}getStorage(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getStorage(e,{block:String(t)})}))}getBlockHash(e){return r(this,void 0,void 0,(function*(){const{hash:t}=yield this.rpc.getBlockHeader({block:String(e)});return t}))}getBlockLevel(e){return r(this,void 0,void 0,(function*(){const{level:t}=yield this.rpc.getBlockHeader({block:String(e)});return t}))}getCounter(e,t){return r(this,void 0,void 0,(function*(){const{counter:r}=yield this.rpc.getContract(e,{block:String(t)});return r||"0"}))}getBlockTimestamp(e){return r(this,void 0,void 0,(function*(){const{timestamp:t}=yield this.rpc.getBlockHeader({block:String(e)});return t}))}getBigMapValue(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getBigMapExpr(e.id,e.expr,{block:String(t)})}))}getSaplingDiffById(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getSaplingDiffById(e.id,{block:String(t)})}))}getSaplingDiffByContract(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getSaplingDiffByContract(e,{block:String(t)})}))}getEntrypoints(e){return r(this,void 0,void 0,(function*(){return this.rpc.getEntrypoints(e)}))}getChainId(){return r(this,void 0,void 0,(function*(){return this.rpc.getChainId()}))}isAccountRevealed(e,t){return r(this,void 0,void 0,(function*(){const r=yield this.rpc.getManagerKey(e,{block:String(t)});return r&&"object"==typeof r?!!r.key:!!r}))}getBlock(e){return r(this,void 0,void 0,(function*(){return this.rpc.getBlock({block:String(e)})}))}getLiveBlocks(e){return this.rpc.getLiveBlocks({block:String(e)})}}},7591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnconfiguredSignerError=void 0;const n=r(227);class i extends n.TezosToolkitConfigError{constructor(){super(),this.name="UnconfiguredSignerError",this.message="No signer has been configured. Please configure one by calling setProvider({signer}) on your TezosToolkit instance."}}t.UnconfiguredSignerError=i},1527:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1067:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopSigner=void 0;const i=r(7591);t.NoopSigner=class{publicKey(){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}publicKeyHash(){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}secretKey(){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}sign(e,t){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}}},552:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObservableFromSubscription=void 0;const n=r(977);t.createObservableFromSubscription=function(e){return new n.Observable((t=>(e.on("data",(e=>{t.next(e)})),e.on("error",(e=>{t.error(e)})),e.on("close",(()=>{t.complete()})),()=>{e.close()})))}},3320:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidFilterExpressionError=t.UnsupportedEventError=void 0;const n=r(227);class i extends n.ParameterValidationError{constructor(e){super(),this.type=e,this.name="UnsupportedEventError",this.message=`Unsupported event type "${e}" expecting one of the "data", "error", or "close".`}}t.UnsupportedEventError=i;class o extends n.ParameterValidationError{constructor(e){super(),this.invalidExpression=e,this.name="InvalidFilterExpressionError",this.message="Invalid filter expression expecting the object to contain either and/or property"}}t.InvalidFilterExpressionError=o},8176:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateFilter=t.evaluateExpression=t.evaluateOpFilter=t.eventFilter=void 0;const n=r(3320);t.eventFilter=(e,t,r,n)=>"event"===e.kind&&((!r||e.tag===r)&&((!t||e.source===t)&&(!n||"applied"===e.result.status)));t.evaluateOpFilter=(e,t)=>"opHash"in t?((e,t)=>e.hash===t.opHash)(e,t):"source"in t?((e,t)=>{switch(e.kind){case"endorsement":return"metadata"in e&&e.metadata.delegate===t.source;case"activate_account":return"metadata"in e&&e.pkh===t.source;default:return"source"in e&&e.source===t.source}})(e,t):"kind"in t?((e,t)=>"kind"in e&&e.kind===t.kind)(e,t):"destination"in t&&((e,t)=>{switch(e.kind){case"delegation":return e.delegate===t.destination;case"origination":if("metadata"in e&&"operation_result"in e.metadata&&"originated_contracts"in e.metadata.operation_result&&Array.isArray(e.metadata.operation_result.originated_contracts))return e.metadata.operation_result.originated_contracts.some((e=>e===t.destination));break;case"transaction":return e.destination===t.destination;default:return!1}})(e,t);t.evaluateExpression=(e,r)=>{if(Array.isArray(r.and))return r.and.every((r=>t.evaluateFilter(e,r)));if(Array.isArray(r.or))return r.or.some((r=>t.evaluateFilter(e,r)));throw new n.InvalidFilterExpressionError(r)};t.evaluateFilter=(e,r)=>{const n=[];return Array.isArray(r)?n.push(...r):n.push(r),n.every((r=>"and"in r||"or"in r?t.evaluateExpression(e,r):t.evaluateOpFilter(e,r)))}},440:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableSubscription=t.UnsupportedEventError=void 0;const n=r(977),i=r(9002),o=r(3320);var s=r(3320);Object.defineProperty(t,"UnsupportedEventError",{enumerable:!0,get:function(){return s.UnsupportedEventError}});t.ObservableSubscription=class{constructor(e,t=!1,r=i.retry()){this.shouldRetry=t,this.operatorFunction=r,this.errorListeners=[],this.messageListeners=[],this.closeListeners=[],this.completed$=new n.Subject,e.pipe(i.takeUntil(this.completed$),i.tap((e=>{this.call(this.messageListeners,e)}),(e=>{this.call(this.errorListeners,e)}),(()=>{this.call(this.closeListeners)})),this.shouldRetry?r:i.tap(),i.catchError((()=>n.NEVER))).subscribe()}call(e,t){for(const r of e)try{r(t)}catch(e){console.error(e)}}remove(e,t){const r=e.indexOf(t);-1!==r&&e.splice(r,1)}on(e,t){switch(e){case"data":this.messageListeners.push(t);break;case"error":this.errorListeners.push(t);break;case"close":this.closeListeners.push(t);break;default:throw new o.UnsupportedEventError(e)}}off(e,t){switch(e){case"data":this.remove(this.messageListeners,t);break;case"error":this.remove(this.errorListeners,t);break;case"close":this.remove(this.closeListeners,t);break;default:throw new o.UnsupportedEventError(e)}}close(){this.completed$.next()}}},5032:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PollingSubscribeProvider=t.defaultConfigStreamer=void 0;const i=r(977),o=r(9002),s=r(8176),a=r(4435),c=r(6391);t.defaultConfigStreamer={shouldObservableSubscriptionRetry:!1,observableSubscriptionRetryFunction:o.retry()};t.PollingSubscribeProvider=class{constructor(e,r={}){this.context=e,this._config$=new i.BehaviorSubject(Object.assign(Object.assign({},t.defaultConfigStreamer),r)),this.timer$=this._config$.pipe(o.pluck("pollingIntervalMilliseconds"),o.switchMap((e=>e?i.timer(0,e):i.from(this.getConfirmationPollingInterval()).pipe(o.switchMap((e=>i.timer(0,e))))))),this.newBlock$=this.timer$.pipe(o.switchMap((()=>(e=>i.from(e.rpc.getBlock()).pipe(o.first()))(this.context))),o.distinctUntilKeyChanged("hash"),o.publish(),o.refCount())}get config(){return this._config$.getValue()}getConfirmationPollingInterval(){return n(this,void 0,void 0,(function*(){if(!this.config.pollingIntervalMilliseconds){const e=5e3,t=1e3;try{const r=yield this.context.readProvider.getProtocolConstants("head"),n=(r.minimal_block_delay?r.minimal_block_delay.multipliedBy(1e3):r.time_between_blocks?r.time_between_blocks[0].multipliedBy(1e3):new c.default(e)).dividedBy(3);this.config.pollingIntervalMilliseconds=0===n.toNumber()?t:n.toNumber()}catch(t){return e}}return this.config.pollingIntervalMilliseconds}))}subscribeBlock(e){return new a.ObservableSubscription(this.newBlock$,this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribe(e){return new a.ObservableSubscription(this.newBlock$.pipe(o.pluck("hash")),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeOperation(e){return new a.ObservableSubscription(this.newBlock$.pipe((e=>o.concatMap((t=>new i.Observable((r=>{for(const n of t.operations)for(const t of n)for(const n of t.contents)s.evaluateFilter(Object.assign({hash:t.hash},n),e)&&r.next(Object.assign({hash:t.hash},n));r.complete()})))))(e)),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeEvent(e){return new a.ObservableSubscription(this.newBlock$.pipe((t=e,o.concatMap((e=>new i.Observable((r=>{for(const n of e.operations)for(const i of n)for(const n of i.contents){const o=n.metadata.internal_operation_results;if(o)for(const n of o)s.eventFilter(n,null==t?void 0:t.address,null==t?void 0:t.tag,null==t?void 0:t.excludeFailedOperations)&&r.next(Object.assign({opHash:i.hash,blockHash:e.hash,level:e.header.level},n))}r.complete()})))))),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction);var t}}},2353: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.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.TezosToolkit=t.TaquitoLocalForger=t.RpcReadAdapter=t.ObservableSubscription=t.PollingSubscribeProvider=t.OperationBatch=t.RpcForger=t.CompositeForger=t.UnitValue=t.MichelsonMap=void 0;const o=r(6368),s=r(4984),a=r(4632),c=r(9494),u=r(6395),l=r(259),f=r(1067),d=r(5032),h=r(8023),p=r(635),b=r(6713),m=r(5286),g=r(5744);var v=r(8899);Object.defineProperty(t,"MichelsonMap",{enumerable:!0,get:function(){return v.MichelsonMap}}),Object.defineProperty(t,"UnitValue",{enumerable:!0,get:function(){return v.UnitValue}}),i(r(4593),t),i(r(4984),t),i(r(238),t),i(r(5225),t);var y=r(7336);Object.defineProperty(t,"CompositeForger",{enumerable:!0,get:function(){return y.CompositeForger}});var _=r(794);Object.defineProperty(t,"RpcForger",{enumerable:!0,get:function(){return _.RpcForger}}),i(r(3323),t);var w=r(150);Object.defineProperty(t,"OperationBatch",{enumerable:!0,get:function(){return w.OperationBatch}}),i(r(1527),t),i(r(440),t);var E=r(5032);Object.defineProperty(t,"PollingSubscribeProvider",{enumerable:!0,get:function(){return E.PollingSubscribeProvider}});var O=r(4435);Object.defineProperty(t,"ObservableSubscription",{enumerable:!0,get:function(){return O.ObservableSubscription}}),i(r(4946),t),i(r(635),t),i(r(134),t),i(r(5744),t),i(r(9813),t),i(r(5286),t),i(r(3259),t),i(r(4762),t),i(r(9406),t),i(r(6395),t),i(r(5505),t),i(r(3739),t),i(r(3171),t);var S=r(259);Object.defineProperty(t,"RpcReadAdapter",{enumerable:!0,get:function(){return S.RpcReadAdapter}}),i(r(8794),t);var A=r(6713);Object.defineProperty(t,"TaquitoLocalForger",{enumerable:!0,get:function(){return A.TaquitoLocalForger}}),i(r(3793),t);t.TezosToolkit=class{constructor(e){this._rpc=e,this._options={},this.format=a.format,"string"==typeof this._rpc?this._rpcClient=new o.RpcClient(this._rpc):this._rpcClient=this._rpc,this._context=new s.Context(e),this._wallet=new p.Wallet(this._context),this.setProvider({rpc:this._rpcClient}),this.batch=this._context.batch.batch.bind(this._context.batch)}setProvider({rpc:e,stream:t,signer:r,protocol:n,config:i,forger:o,wallet:s,packer:a,globalConstantsProvider:c,readProvider:u,parserProvider:l,injectorProvider:f}){this.setRpcProvider(e),this.setStreamProvider(t),this.setSignerProvider(r),this.setForgerProvider(o),this.setWalletProvider(s),this.setPackerProvider(a),this.setGlobalConstantsProvider(c),this.setReadProvider(u),this.setParserProvider(l),this.setInjectorProvider(f),this._context.proto=n,i&&this._context.setPartialConfig(i)}setSignerProvider(e){this._options.signer||void 0!==e?void 0!==e&&(this._context.signer=e,this._options.signer=e):(this._context.signer=new f.NoopSigner,this._options.signer=e)}setRpcProvider(e){"string"==typeof e?this._rpcClient=new o.RpcClient(e):void 0===e||(this._rpcClient=e),this._options.rpc=this._rpcClient,this._context.rpc=this._rpcClient}setForgerProvider(e){if(void 0!==e)this._options.forger=e,this._context.forger=e;else if(void 0===this._options.forger){const e=this.getFactory(b.TaquitoLocalForger)();this._options.forger=e,this._context.forger=e}}setStreamProvider(e){if("string"==typeof e){const t=new d.PollingSubscribeProvider(new s.Context(new o.RpcClient(e)));this._options.stream=t,this._context.stream=t}else if(void 0!==e)this._options.stream=e,this._context.stream=e;else if(void 0===this._options.stream){const e=this.getFactory(d.PollingSubscribeProvider)();this._options.stream=e,this._context.stream=e}}setWalletProvider(e){if(this._options.wallet||void 0!==e)void 0!==e&&(this._options.wallet=e,this._context.walletProvider=e);else{const e=this.getFactory(p.LegacyWalletProvider)();this._options.wallet=e,this._context.walletProvider=e}}setPackerProvider(e){if(this._options.packer||void 0!==e)void 0!==e&&(this._context.packer=e,this._options.packer=e);else{const e=this.getFactory(u.RpcPacker)();this._context.packer=e,this._options.packer=e}}setGlobalConstantsProvider(e){if(this._options.globalConstantsProvider||void 0!==e)void 0!==e&&(this._context.globalConstantsProvider=e,this._options.globalConstantsProvider=e);else{const e=new c.NoopGlobalConstantsProvider;this._context.globalConstantsProvider=e,this._options.globalConstantsProvider=e}}setReadProvider(e){const t=e||new l.RpcReadAdapter(this._context.rpc);this._options.readProvider=t,this._context.readProvider=t}setParserProvider(e){if(this._options.parserProvider||void 0!==e)void 0!==e&&(this._context.parser=e,this._options.parserProvider=e);else{const e=new m.MichelCodecParser(this._context);this._context.parser=e,this._options.parserProvider=e}}setInjectorProvider(e){if(this._options.injectorProvider||void 0!==e)void 0!==e&&(this._context.injector=e,this._options.injectorProvider=e);else{const e=new g.RpcInjector(this._context);this._context.injector=e,this._options.injectorProvider=e}}get tz(){return this._context.tz}get contract(){return this._context.contract}get prepare(){return this._context.prepare}get wallet(){return this._wallet}get operation(){return this._context.operationFactory}get estimate(){return this._context.estimate}get stream(){return this._context.stream}get rpc(){return this._context.rpc}get signer(){return this._context.signer}get globalConstants(){return this._context.globalConstantsProvider}addExtension(e){Array.isArray(e)?e.forEach((e=>e.configureContext(this._context))):e.configureContext(this._context)}getFactory(e){return(...t)=>new e(this._context,...t)}getVersionInfo(){return h.VERSION}}},4946:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},992:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcTzProvider=void 0;const i=r(8361),o=r(4632),s=r(227),a=r(6003),c=r(3793);class u extends a.Provider{constructor(e){super(e),this.prepare=new c.PrepareProvider(this.context)}getBalance(e){return n(this,void 0,void 0,(function*(){const t=o.validateAddress(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,o.invalidDetail(t));return this.context.readProvider.getBalance(e,"head")}))}getDelegate(e){return n(this,void 0,void 0,(function*(){const t=o.validateAddress(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,o.invalidDetail(t));return this.context.readProvider.getDelegate(e,"head")}))}activate(e,t){return n(this,void 0,void 0,(function*(){const r=o.validateKeyHash(e);if(r!==o.ValidationResult.VALID)throw new o.InvalidKeyHashError(e,o.invalidDetail(r));const n=yield this.prepare.activate({pkh:e,secret:t}),s=yield this.forge(n),a=`${s.opbytes}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`;return new i.Operation(yield this.rpc.injectOperation(a),Object.assign(Object.assign({},s),{opbytes:a}),[],this.context.clone())}))}}t.RpcTzProvider=u},8023:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION={commitHash:"e1b1d6976a564f925c01cf66e28df9acb0085c3d",version:"17.3.1-beta-RC.0"}},1626:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BatchWalletOperation=void 0;const i=r(6368),o=r(150),s=r(807),a=r(2809),c=r(2323);class u extends a.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t,this.getOriginatedContractAddresses=()=>n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e){const t=e.filter((e=>"origination"===e.kind));let r=[];for(const e of t)e.metadata.operation_result.originated_contracts&&(r=[...r,...e.metadata.operation_result.originated_contracts]);return r}throw new c.ObservableError("Unable to fetch operation results")}))}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===i.OpKind.REVEAL));throw new c.ObservableError("Unable to fetch operation results")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.operationResults();if(e)return e.filter((e=>-1!==o.BATCH_KINDS.indexOf(e.kind))).map((e=>{if(s.hasMetadataWithResult(e)){return e.metadata.operation_result.status}return"unknown"}))[0]||"unknown";throw new c.ObservableError("Unable to fetch operation results")}))}}t.BatchWalletOperation=u},4364:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DelegationWalletOperation=void 0;const i=r(6368),o=r(2809),s=r(2323);class a extends o.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===i.OpKind.REVEAL));throw new s.ObservableError("Unable to fetch operation result")}))}delegationOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===i.OpKind.DELEGATION));throw new s.ObservableError("Unable to fetch operation result")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.delegationOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.DelegationWalletOperation=a},2323:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableError=t.ConfirmationUndefinedError=void 0;const n=r(227);class i extends n.TezosToolkitConfigError{constructor(){super(),this.name="ConfirmationUndefinedError",this.message="Default confirmation count can not be undefined"}}t.ConfirmationUndefinedError=i;class o extends n.NetworkError{constructor(e){super(),this.message=e,this.name="ObservableError"}}t.ObservableError=o},7832:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.IncreasePaidStorageWalletOperation=void 0;const i=r(2809),o=r(6368),s=r(2323);class a extends i.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===o.OpKind.REVEAL));throw new s.ObservableError("Unable to fetch operation result")}))}increasePaidStorageOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===o.OpKind.INCREASE_PAID_STORAGE));throw new s.ObservableError("Unable to fetch operation result")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.increasePaidStorageOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.IncreasePaidStorageWalletOperation=a},635: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.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5277),t),i(r(2809),t),i(r(4685),t),i(r(7654),t),i(r(4364),t),i(r(7432),t),i(r(8562),t)},7432:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8562:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.LegacyWalletProvider=void 0;const i=r(807);t.LegacyWalletProvider=class{constructor(e){this.context=e}getPKH(){return n(this,void 0,void 0,(function*(){return this.context.signer.publicKeyHash()}))}mapTransferParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return i.attachKind(yield e(),i.OpKind.TRANSACTION)}))}mapOriginateParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return i.attachKind(yield e(),i.OpKind.ORIGINATION)}))}mapDelegateParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return i.attachKind(yield e(),i.OpKind.DELEGATION)}))}mapIncreasePaidStorageWalletParams(e){return n(this,void 0,void 0,(function*(){return i.attachKind(yield e(),i.OpKind.INCREASE_PAID_STORAGE)}))}sendOperations(e){return n(this,void 0,void 0,(function*(){return(yield this.context.batch.batch(e).send()).hash}))}sign(e,t){return n(this,void 0,void 0,(function*(){const{prefixSig:r}=yield this.context.signer.sign(e,t);return r}))}getPK(){return this.context.signer.publicKey()}}},8286:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OperationFactory=t.createNewPollingBasedHeadObservable=t.timeoutAfter=void 0;const i=r(977),o=r(9002),s=r(552),a=r(1626),c=r(4364),u=r(7832),l=r(2809),f=r(7654),d=r(4685),h=r(7642);function p(e){return function(t){return new i.BehaviorSubject(null).pipe(o.timeout({each:e,with:()=>i.throwError((()=>new h.ConfirmationTimeoutError("Confirmation polling timed out")))}),o.mergeMap((()=>t)))}}t.timeoutAfter=p;t.createNewPollingBasedHeadObservable=(e,t,r)=>e.pipe(p(1e3*t.config.confirmationPollingTimeoutSecond),o.share({connector:()=>new i.ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1}));t.OperationFactory=class{constructor(e){this.context=e,this.sharedHeadObs=i.defer((()=>s.createObservableFromSubscription(this.context.stream.subscribeBlock("head"))))}createNewHeadObservable(){return n(this,void 0,void 0,(function*(){return t.createNewPollingBasedHeadObservable(this.sharedHeadObs,this.context)}))}createPastBlockWalker(e,t=1){return i.from(this.context.readProvider.getBlock(e)).pipe(o.switchMap((e=>1===t?i.of(e):i.range(e.header.level,t-1).pipe(o.startWith(e),o.concatMap((e=>n(this,void 0,void 0,(function*(){return this.context.readProvider.getBlock("number"==typeof e?e:e.header.level)}))))))))}createHeadObservableFromConfig({blockIdentifier:e}){return n(this,void 0,void 0,(function*(){const t=[];return e&&t.push(this.createPastBlockWalker(e)),t.push(yield this.createNewHeadObservable()),i.concat(...t)}))}createOperation(e,t={}){return n(this,void 0,void 0,(function*(){return new l.WalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createBatchOperation(e,t={}){return n(this,void 0,void 0,(function*(){return new a.BatchWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createTransactionOperation(e,t={}){return n(this,void 0,void 0,(function*(){return new d.TransactionWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createDelegationOperation(e,t={}){return n(this,void 0,void 0,(function*(){return new c.DelegationWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createOriginationOperation(e,t={}){return n(this,void 0,void 0,(function*(){return new f.OriginationWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createIncreasePaidStorageOperation(e,t={}){return n(this,void 0,void 0,(function*(){return new u.IncreasePaidStorageWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}}},2809:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletOperation=void 0;const i=r(977),o=r(9002),s=r(6298),a=r(4632),c=r(7642),u=r(2323),l=r(227);t.WalletOperation=class{constructor(e,t,r){if(this.opHash=e,this.context=t,this._newHead$=r,this._operationResult=new i.ReplaySubject(1),this._includedInBlock=new i.ReplaySubject(1),this._included=!1,this.newHead$=this._newHead$.pipe(o.switchMap((e=>{var t,r;const n=null!==(r=null===(t=this.lastHead)||void 0===t?void 0:t.header.level)&&void 0!==r?r:e.header.level-1;return i.range(n+1,e.header.level-n-1).pipe(o.concatMap((e=>this.context.readProvider.getBlock(e))),o.endWith(e))})),o.tap((e=>this.lastHead=e)),o.share({connector:()=>new i.ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1})),this.confirmed$=this.newHead$.pipe(o.map((e=>{for(const t of e.operations)for(const r of t)if(r.hash===this.opHash)return this._included=!0,this._includedInBlock.next(e),this._operationResult.next(r.contents),e})),o.filter((e=>void 0!==e)),o.first(),o.share({connector:()=>new i.ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1})),a.validateOperation(this.opHash)!==a.ValidationResult.VALID)throw new l.InvalidOperationHashError(this.opHash);this.confirmed$.pipe(o.first(),o.catchError((()=>i.of(void 0)))).subscribe()}operationResults(){return n(this,void 0,void 0,(function*(){return this._operationResult.pipe(o.first()).toPromise()}))}receipt(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new u.ObservableError("Unable to get operation results");return s.receiptFromOperation(e)}))}getCurrentConfirmation(){return n(this,void 0,void 0,(function*(){return this._included?i.combineLatest([this._includedInBlock,i.from(this.context.readProvider.getBlock("head"))]).pipe(o.map((([e,t])=>t.header.level-e.header.level+1)),o.first()).toPromise():0}))}isInCurrentBranch(e="head"){return n(this,void 0,void 0,(function*(){if(!this._included)return!0;const t=yield this.context.readProvider.getBlockLevel(e),r=yield this._includedInBlock.pipe(o.first()).toPromise();if(!r)throw new u.ObservableError("Inclusion block is undefined");const n=t-r.header.level;if(n<=0)return!0;const i=Math.min(r.header.level+n,r.header.level+60);return new Set(yield this.context.readProvider.getLiveBlocks(i)).has(r.hash)}))}confirmationObservable(e){if(void 0!==e&&e<1)throw new c.InvalidConfirmationCountError(e);const{defaultConfirmationCount:t}=this.context.config,r=void 0!==e?e:t;if(void 0===r)throw new u.ConfirmationUndefinedError;return i.combineLatest([this._includedInBlock,this.newHead$]).pipe(o.distinctUntilChanged((([,e],[,t])=>e.hash===t.hash)),o.map((([e,t])=>({block:t,expectedConfirmation:r,currentConfirmation:t.header.level-e.header.level+1,completed:t.header.level-e.header.level>=r-1,isInCurrentBranch:()=>this.isInCurrentBranch(t.hash)}))),o.takeWhile((({completed:e})=>!e),!0))}confirmation(e){return this.confirmationObservable(e).toPromise()}}},7654:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OriginationWalletOperation=void 0;const i=r(6368),o=r(807),s=r(2809),a=r(2323);class c extends s.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}originationOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return o.findWithKind(e,i.OpKind.ORIGINATION);throw new a.ObservableError("Unable to fetch operation result")}))}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return o.findWithKind(e,i.OpKind.REVEAL);throw new a.ObservableError("Unable to fetch operation result")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.originationOperation();return e?e.metadata.operation_result.status:"unknown"}))}contract(){return n(this,void 0,void 0,(function*(){const e=yield this.originationOperation(),t=((null==e?void 0:e.metadata.operation_result.originated_contracts)||[])[0];return this.context.wallet.at(t)}))}}t.OriginationWalletOperation=c},6298:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.receiptFromOperation=void 0;const n=r(6391),i=r(4593),o=r(835);t.receiptFromOperation=(e,{ALLOCATION_BURN:t,ORIGINATION_BURN:r}={ALLOCATION_BURN:257,ORIGINATION_BURN:257})=>{n.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.default.ROUND_UP});const s=o.flattenOperationResult({contents:e});let a=new n.default(0),c=new n.default(0),u=new n.default(0),l=new n.default(0),f=new n.default(0),d=new n.default(0);return s.forEach((e=>{u=u.plus(e.fee||0),l=l.plus(Array.isArray(e.originated_contracts)?e.originated_contracts.length*r:0),f=f.plus("allocated_destination_contract"in e?t:0),a=a.plus(e.consumed_milligas||0),d=d.plus("paid_storage_size_diff"in e&&Number(e.paid_storage_size_diff)||0)})),c=c.plus(f).plus(l).plus(d),{totalFee:u,totalMilliGas:a,totalGas:a.dividedBy(1e3),totalStorage:c,totalAllocationBurn:f,totalOriginationBurn:l,totalPaidStorageDiff:d,totalStorageBurn:new n.default(c.multipliedBy(i.COST_PER_BYTE))}}},4685:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionWalletOperation=void 0;const i=r(2809),o=r(6368),s=r(2323);class a extends i.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new s.ObservableError("operationResult returned undefined");return e.find((e=>e.kind===o.OpKind.REVEAL))}))}transactionOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new s.ObservableError("operationResult returned undefined");return e.find((e=>e.kind===o.OpKind.TRANSACTION))}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.transactionOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.TransactionWalletOperation=a},5277:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=t.WalletOperationBatch=void 0;const i=r(238),o=r(807),s=r(227),a=r(4632);class c{constructor(e,t){this.walletProvider=e,this.context=t,this.operations=[]}withTransfer(e){const t=a.validateAddress(e.to);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.to,a.invalidDetail(t));return this.operations.push(Object.assign({kind:o.OpKind.TRANSACTION},e)),this}withContractCall(e,t={}){return this.withTransfer(e.toTransferParams(t))}withDelegation(e){var t;const r=a.validateAddress(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&r!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.delegate,a.invalidDetail(r));return this.operations.push(Object.assign({kind:o.OpKind.DELEGATION},e)),this}withOrigination(e){return this.operations.push(Object.assign({kind:o.OpKind.ORIGINATION},e)),this}withIncreasePaidStorage(e){const t=a.validateAddress(e.destination);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.destination,a.invalidDetail(t));return this.operations.push(Object.assign({kind:o.OpKind.INCREASE_PAID_STORAGE},e)),this}mapOperation(e){return n(this,void 0,void 0,(function*(){switch(e.kind){case o.OpKind.TRANSACTION:return this.walletProvider.mapTransferParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e}))));case o.OpKind.ORIGINATION:return this.walletProvider.mapOriginateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return this.context.parser.prepareCodeOrigination(Object.assign({},e))}))));case o.OpKind.DELEGATION:return this.walletProvider.mapDelegateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e}))));case o.OpKind.INCREASE_PAID_STORAGE:return this.walletProvider.mapIncreasePaidStorageWalletParams((()=>n(this,void 0,void 0,(function*(){return e}))));default:throw new s.InvalidOperationKindError(JSON.stringify(e.kind))}}))}with(e){for(const t of e)switch(t.kind){case o.OpKind.TRANSACTION:this.withTransfer(t);break;case o.OpKind.ORIGINATION:this.withOrigination(t);break;case o.OpKind.DELEGATION:this.withDelegation(t);break;case o.OpKind.INCREASE_PAID_STORAGE:this.withIncreasePaidStorage(t);break;default:throw new s.InvalidOperationKindError(JSON.stringify(t.kind))}return this}send(){return n(this,void 0,void 0,(function*(){const e=[];for(const t of this.operations)e.push(yield this.mapOperation(t));const t=yield this.walletProvider.sendOperations(e);return this.context.operationFactory.createBatchOperation(t)}))}}t.WalletOperationBatch=c;t.Wallet=class{constructor(e){this.context=e,this.walletCommand=e=>({send:e})}get walletProvider(){return this.context.walletProvider}pkh({forceRefetch:e}={}){return n(this,void 0,void 0,(function*(){return this._pkh&&!e||(this._pkh=yield this.walletProvider.getPKH()),this._pkh}))}originate(e){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapOriginateParamsToWalletParams((()=>this.context.parser.prepareCodeOrigination(Object.assign({},e)))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createOriginationOperation(r)}))))}setDelegate(e){var t;const r=a.validateAddress(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&r!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.delegate,a.invalidDetail(r));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapDelegateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createDelegationOperation(r)}))))}signFailingNoop(e){return n(this,void 0,void 0,(function*(){const t={kind:o.OpKind.FAILING_NOOP,arbitrary:e.arbitrary},r=yield this.context.readProvider.getBlockHash(e.basedOnBlock),n=yield this.context.forger.forge({branch:r,contents:[t]});return{signature:yield this.walletProvider.sign(n,Uint8Array.from([3])),bytes:n,signedContent:{branch:r,contents:[{kind:o.OpKind.FAILING_NOOP,arbitrary:e.arbitrary}]}}}))}registerDelegate(){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const e=yield this.walletProvider.mapDelegateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return{delegate:yield this.pkh()}})))),t=yield this.walletProvider.sendOperations([e]);return this.context.operationFactory.createDelegationOperation(t)}))))}transfer(e){const t=a.validateAddress(e.to);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.to,a.invalidDetail(t));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapTransferParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createTransactionOperation(r)}))))}increasePaidStorage(e){const t=a.validateAddress(e.destination);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.destination,a.invalidDetail(t));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapIncreasePaidStorageWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createIncreasePaidStorageOperation(r)}))))}batch(e){const t=new c(this.walletProvider,this.context);return Array.isArray(e)&&t.with(e),t}at(e,t=(e=>e)){return n(this,void 0,void 0,(function*(){const r=a.validateContractAddress(e);if(r!==a.ValidationResult.VALID)throw new s.InvalidContractAddressError(e,a.invalidDetail(r));const n=this.context.withExtensions().rpc,o=this.context.withExtensions().readProvider,c=yield o.getScript(e,"head"),u=yield o.getEntrypoints(e),l=new i.ContractAbstraction(e,c,this,this.context.contract,u,n,o);return t(l,this.context)}))}getPK(){return this.walletProvider.getPK()}}},5477:()=>{},3196:()=>{},8087:()=>{},4854:()=>{},6602:()=>{},2558:(e,t,r)=>{"use strict";r.d(t,{O:()=>w,Z:()=>E});var n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,s="[BigNumber Error] ",a=s+"Number primitive has more than 15 significant digits: ",c=1e14,u=14,l=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,h=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function b(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=u-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function m(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,c=e.e,u=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=c==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(a=(c=i.length)<(u=o.length)?c:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return c==u?0:c>u^r?1:-1}function g(e,t,r,n){if(e<t||e>r||e!==o(e))throw Error(s+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function v(e){var t=e.c.length-1;return p(e.e/u)==t&&e.c[t]%2!=0}function y(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function _(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var w=function e(t){var r,w,E,O,S,A,P,T,R,x,I=$.prototype={constructor:$,toString:null,valueOf:null},M=new $(1),L=20,k=4,N=-7,C=21,j=-1e7,D=1e7,U=!1,B=1,F=0,K={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",G=!0;function $(e,t){var r,i,s,c,f,d,h,p,b=this;if(!(b instanceof $))return new $(e,t);if(null==t){if(e&&!0===e._isBigNumber)return b.s=e.s,void(!e.c||e.e>D?b.c=b.e=null:e.e<j?b.c=[b.e=0]:(b.e=e.e,b.c=e.c.slice()));if((d="number"==typeof e)&&0*e==0){if(b.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,f=e;f>=10;f/=10,c++);return void(c>D?b.c=b.e=null:(b.e=c,b.c=[e]))}p=String(e)}else{if(!n.test(p=String(e)))return E(b,p,d);b.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(c=p.indexOf("."))>-1&&(p=p.replace(".","")),(f=p.search(/e/i))>0?(c<0&&(c=f),c+=+p.slice(f+1),p=p.substring(0,f)):c<0&&(c=p.length)}else{if(g(t,2,H.length,"Base"),10==t&&G)return W(b=new $(e),L+b.e+1,k);if(p=String(e),d="number"==typeof e){if(0*e!=0)return E(b,p,d,t);if(b.s=1/e<0?(p=p.slice(1),-1):1,$.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(a+e)}else b.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=H.slice(0,t),c=f=0,h=p.length;f<h;f++)if(r.indexOf(i=p.charAt(f))<0){if("."==i){if(f>c){c=h;continue}}else if(!s&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){s=!0,f=-1,c=0;continue}return E(b,String(e),d,t)}d=!1,(c=(p=w(p,t,10,b.s)).indexOf("."))>-1?p=p.replace(".",""):c=p.length}for(f=0;48===p.charCodeAt(f);f++);for(h=p.length;48===p.charCodeAt(--h););if(p=p.slice(f,++h)){if(h-=f,d&&$.DEBUG&&h>15&&(e>l||e!==o(e)))throw Error(a+b.s*e);if((c=c-f-1)>D)b.c=b.e=null;else if(c<j)b.c=[b.e=0];else{if(b.e=c,b.c=[],f=(c+1)%u,c<0&&(f+=u),f<h){for(f&&b.c.push(+p.slice(0,f)),h-=u;f<h;)b.c.push(+p.slice(f,f+=u));f=u-(p=p.slice(f)).length}else f-=h;for(;f--;p+="0");b.c.push(+p)}}else b.c=[b.e=0]}function V(e,t,r,n){var i,o,s,a,c;if(null==r?r=k:g(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)c=b(e.c),c=1==n||2==n&&(s<=N||s>=C)?y(c,s):_(c,s,"0");else if(o=(e=W(new $(e),t,r)).e,a=(c=b(e.c)).length,1==n||2==n&&(t<=o||o<=N)){for(;a<t;c+="0",a++);c=y(c,o)}else if(t-=s,c=_(c,o,"0"),o+1>a){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-a)>0)for(o+1==a&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function z(e,t){for(var r,n=1,i=new $(e[0]);n<e.length;n++){if(!(r=new $(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function q(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*u-1)>D?e.c=e.e=null:r<j?e.c=[e.e=0]:(e.e=r,e.c=t),e}function W(e,t,r,n){var s,a,l,d,h,p,b,m=e.c,g=f;if(m){e:{for(s=1,d=m[0];d>=10;d/=10,s++);if((a=t-s)<0)a+=u,l=t,b=(h=m[p=0])/g[s-l-1]%10|0;else if((p=i((a+1)/u))>=m.length){if(!n)break e;for(;m.length<=p;m.push(0));h=b=0,s=1,l=(a%=u)-u+1}else{for(h=d=m[p],s=1;d>=10;d/=10,s++);b=(l=(a%=u)-u+s)<0?0:h/g[s-l-1]%10|0}if(n=n||t<0||null!=m[p+1]||(l<0?h:h%g[s-l-1]),n=r<4?(b||n)&&(0==r||r==(e.s<0?3:2)):b>5||5==b&&(4==r||n||6==r&&(a>0?l>0?h/g[s-l]:0:m[p-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=g[(u-t%u)%u],e.e=-t||0):m[0]=e.e=0,e;if(0==a?(m.length=p,d=1,p--):(m.length=p+1,d=g[u-a],m[p]=l>0?o(h/g[s-l]%g[l])*d:0),n)for(;;){if(0==p){for(a=1,l=m[0];l>=10;l/=10,a++);for(l=m[0]+=d,d=1;l>=10;l/=10,d++);a!=d&&(e.e++,m[0]==c&&(m[0]=1));break}if(m[p]+=d,m[p]!=c)break;m[p--]=0,d=1}for(a=m.length;0===m[--a];m.pop());}e.e>D?e.c=e.e=null:e.e<j&&(e.c=[e.e=0])}return e}function Z(e){var t,r=e.e;return null===r?e.toString():(t=b(e.c),t=r<=N||r>=C?y(t,r):_(t,r,"0"),e.s<0?"-"+t:t)}return $.clone=e,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(s+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(g(r=e[t],0,h,t),L=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(g(r=e[t],0,8,t),k=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(g(r[0],-h,0,t),g(r[1],0,h,t),N=r[0],C=r[1]):(g(r,-h,h,t),N=-(C=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)g(r[0],-h,-1,t),g(r[1],1,h,t),j=r[0],D=r[1];else{if(g(r,-h,h,t),!r)throw Error(s+t+" cannot be zero: "+r);j=-(D=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(s+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(s+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(g(r=e[t],0,9,t),B=r),e.hasOwnProperty(t="POW_PRECISION")&&(g(r=e[t],0,h,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(s+t+" not an object: "+r);K=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(s+t+" invalid: "+r);G="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:L,ROUNDING_MODE:k,EXPONENTIAL_AT:[N,C],RANGE:[j,D],CRYPTO:U,MODULO_MODE:B,POW_PRECISION:F,FORMAT:K,ALPHABET:H}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-h&&i<=h&&i===o(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%u)<1&&(t+=u),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=c||r!==o(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(s+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return z(arguments,I.lt)},$.minimum=$.min=function(){return z(arguments,I.gt)},$.random=(O=9007199254740992,S=Math.random()*O&2097151?function(){return o(Math.random()*O)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,a,c,l=0,d=[],p=new $(M);if(null==e?e=L:g(e,0,h),a=i(e/u),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));l<a;)(c=131072*t[l]+(t[l+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(d.push(c%1e14),l+=2);l=a/2}else{if(!crypto.randomBytes)throw U=!1,Error(s+"crypto unavailable");for(t=crypto.randomBytes(a*=7);l<a;)(c=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])>=9e15?crypto.randomBytes(7).copy(t,l):(d.push(c%1e14),l+=7);l=a/7}if(!U)for(;l<a;)(c=S())<9e15&&(d[l++]=c%1e14);for(a=d[--l],e%=u,a&&e&&(c=f[u-e],d[l]=o(a/c)*c);0===d[l];d.pop(),l--);if(l<0)d=[n=0];else{for(n=-1;0===d[0];d.splice(0,1),n-=u);for(l=1,c=d[0];c>=10;c/=10,l++);l<u&&(n-=u-l)}return p.e=n,p.c=d,p}),$.sum=function(){for(var e=1,t=arguments,r=new $(t[0]);e<t.length;)r=r.plus(t[e++]);return r},w=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,c=e.length;a<c;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var c,u,l,f,d,h,p,m,g=n.indexOf("."),v=L,y=k;for(g>=0&&(f=F,F=0,n=n.replace(".",""),h=(m=new $(i)).pow(n.length-g),F=f,m.c=t(_(b(h.c),h.e,"0"),10,o,e),m.e=m.c.length),l=f=(p=t(n,i,o,a?(c=H,e):(c=e,H))).length;0==p[--f];p.pop());if(!p[0])return c.charAt(0);if(g<0?--l:(h.c=p,h.e=l,h.s=s,p=(h=r(h,m,v,y,o)).c,d=h.r,l=h.e),g=p[u=l+v+1],f=o/2,d=d||u<0||null!=p[u+1],d=y<4?(null!=g||d)&&(0==y||y==(h.s<0?3:2)):g>f||g==f&&(4==y||d||6==y&&1&p[u-1]||y==(h.s<0?8:7)),u<1||!p[0])n=d?_(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(p.length=u,d)for(--o;++p[--u]>o;)p[u]=0,u||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(g=0,n="";g<=f;n+=c.charAt(p[g++]));n=_(n,l,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,c=e.length,u=t%d,l=t/d|0;for(e=e.slice();c--;)a=((i=u*(o=e[c]%d)+(n=l*o+(s=e[c]/d|0)*u)%d*d+a)/r|0)+(n/d|0)+l*s,e[c]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,s,a,l){var f,d,h,b,m,g,v,y,_,w,E,O,S,A,P,T,R,x=n.s==i.s?1:-1,I=n.c,M=i.c;if(!(I&&I[0]&&M&&M[0]))return new $(n.s&&i.s&&(I?!M||I[0]!=M[0]:M)?I&&0==I[0]||!M?0*x:x/0:NaN);for(_=(y=new $(x)).c=[],x=s+(d=n.e-i.e)+1,l||(l=c,d=p(n.e/u)-p(i.e/u),x=x/u|0),h=0;M[h]==(I[h]||0);h++);if(M[h]>(I[h]||0)&&d--,x<0)_.push(1),b=!0;else{for(A=I.length,T=M.length,h=0,x+=2,(m=o(l/(M[0]+1)))>1&&(M=e(M,m,l),I=e(I,m,l),T=M.length,A=I.length),S=T,E=(w=I.slice(0,T)).length;E<T;w[E++]=0);R=M.slice(),R=[0].concat(R),P=M[0],M[1]>=l/2&&P++;do{if(m=0,(f=t(M,w,T,E))<0){if(O=w[0],T!=E&&(O=O*l+(w[1]||0)),(m=o(O/P))>1)for(m>=l&&(m=l-1),v=(g=e(M,m,l)).length,E=w.length;1==t(g,w,v,E);)m--,r(g,T<v?R:M,v,l),v=g.length,f=1;else 0==m&&(f=m=1),v=(g=M.slice()).length;if(v<E&&(g=[0].concat(g)),r(w,g,E,l),E=w.length,-1==f)for(;t(M,w,T,E)<1;)m++,r(w,T<E?R:M,E,l),E=w.length}else 0===f&&(m++,w=[0]);_[h++]=m,w[0]?w[E++]=I[S]||0:(w=[I[S]],E=1)}while((S++<A||null!=w[0])&&x--);b=null!=w[0],_[0]||_.splice(0,1)}if(l==c){for(h=1,x=_[0];x>=10;x/=10,h++);W(y,s+(y.e=h+d*u-1)+1,a,b)}else y.e=d,y.r=+b;return y}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,P=/^([^.]+)\.$/,T=/^\.([^.]+)$/,R=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,E=function(e,t,r,n){var i,o=r?t:t.replace(x,"");if(R.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(A,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(P,"$1").replace(T,"0.$1")),t!=o))return new $(o,i);if($.DEBUG)throw Error(s+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},I.absoluteValue=I.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},I.comparedTo=function(e,t){return m(this,new $(e,t))},I.decimalPlaces=I.dp=function(e,t){var r,n,i,o=this;if(null!=e)return g(e,0,h),null==t?t=k:g(t,0,8),W(new $(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-p(this.e/u))*u,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},I.dividedBy=I.div=function(e,t){return r(this,new $(e,t),L,k)},I.dividedToIntegerBy=I.idiv=function(e,t){return r(this,new $(e,t),0,1)},I.exponentiatedBy=I.pow=function(e,t){var r,n,a,c,l,f,d,h,p=this;if((e=new $(e)).c&&!e.isInteger())throw Error(s+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new $(t)),l=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new $(Math.pow(+Z(p),l?e.s*(2-v(e)):+Z(e))),t?h.mod(t):h;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new $(NaN);(n=!f&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||l&&p.c[1]>=24e7:p.c[0]<8e13||l&&p.c[0]<=9999975e7)))return c=p.s<0&&v(e)?-0:0,p.e>-1&&(c=1/c),new $(f?1/c:c);F&&(c=i(F/u+2))}for(l?(r=new $(.5),f&&(e.s=1),d=v(e)):d=(a=Math.abs(+Z(e)))%2,h=new $(M);;){if(d){if(!(h=h.times(p)).c)break;c?h.c.length>c&&(h.c.length=c):n&&(h=h.mod(t))}if(a){if(0===(a=o(a/2)))break;d=a%2}else if(W(e=e.times(r),e.e+1,1),e.e>14)d=v(e);else{if(0===(a=+Z(e)))break;d=a%2}p=p.times(p),c?p.c&&p.c.length>c&&(p.c.length=c):n&&(p=p.mod(t))}return n?h:(f&&(h=M.div(h)),t?h.mod(t):c?W(h,F,k,undefined):h)},I.integerValue=function(e){var t=new $(this);return null==e?e=k:g(e,0,8),W(t,t.e+1,e)},I.isEqualTo=I.eq=function(e,t){return 0===m(this,new $(e,t))},I.isFinite=function(){return!!this.c},I.isGreaterThan=I.gt=function(e,t){return m(this,new $(e,t))>0},I.isGreaterThanOrEqualTo=I.gte=function(e,t){return 1===(t=m(this,new $(e,t)))||0===t},I.isInteger=function(){return!!this.c&&p(this.e/u)>this.c.length-2},I.isLessThan=I.lt=function(e,t){return m(this,new $(e,t))<0},I.isLessThanOrEqualTo=I.lte=function(e,t){return-1===(t=m(this,new $(e,t)))||0===t},I.isNaN=function(){return!this.s},I.isNegative=function(){return this.s<0},I.isPositive=function(){return this.s>0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new $(e,t)).s,!a||!t)return new $(NaN);if(a!=t)return e.s=-t,s.plus(e);var l=s.e/u,f=e.e/u,d=s.c,h=e.c;if(!l||!f){if(!d||!h)return d?(e.s=-t,e):new $(h?s:NaN);if(!d[0]||!h[0])return h[0]?(e.s=-t,e):new $(d[0]?s:3==k?-0:0)}if(l=p(l),f=p(f),d=d.slice(),a=l-f){for((o=a<0)?(a=-a,i=d):(f=l,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=d.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(d[t]!=h[t]){o=d[t]<h[t];break}if(o&&(i=d,d=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=d.length))>0)for(;t--;d[r++]=0);for(t=c-1;n>a;){if(d[--n]<h[n]){for(r=n;r&&!d[--r];d[r]=t);--d[r],d[n]+=c}d[n]-=h[n]}for(;0==d[0];d.splice(0,1),--f);return d[0]?q(e,d,f):(e.s=3==k?-1:1,e.c=[e.e=0],e)},I.modulo=I.mod=function(e,t){var n,i,o=this;return e=new $(e,t),!o.c||!e.s||e.c&&!e.c[0]?new $(NaN):!e.c||o.c&&!o.c[0]?new $(o):(9==B?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,B),(e=o.minus(n.times(e))).c[0]||1!=B||(e.s=o.s),e)},I.multipliedBy=I.times=function(e,t){var r,n,i,o,s,a,l,f,h,b,m,g,v,y,_,w=this,E=w.c,O=(e=new $(e,t)).c;if(!(E&&O&&E[0]&&O[0]))return!w.s||!e.s||E&&!E[0]&&!O||O&&!O[0]&&!E?e.c=e.e=e.s=null:(e.s*=w.s,E&&O?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=p(w.e/u)+p(e.e/u),e.s*=w.s,(l=E.length)<(b=O.length)&&(v=E,E=O,O=v,i=l,l=b,b=i),i=l+b,v=[];i--;v.push(0));for(y=c,_=d,i=b;--i>=0;){for(r=0,m=O[i]%_,g=O[i]/_|0,o=i+(s=l);o>i;)r=((f=m*(f=E[--s]%_)+(a=g*f+(h=E[s]/_|0)*m)%_*_+v[o]+r)/y|0)+(a/_|0)+g*h,v[o--]=f%y;v[o]=r}return r?++n:v.splice(0,1),q(e,v,n)},I.negated=function(){var e=new $(this);return e.s=-e.s||null,e},I.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new $(e,t)).s,!i||!t)return new $(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/u,s=e.e/u,a=n.c,l=e.c;if(!o||!s){if(!a||!l)return new $(i/0);if(!a[0]||!l[0])return l[0]?e:new $(a[0]?n:0*i)}if(o=p(o),s=p(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=l):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=l.length)<0&&(r=l,l=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+l[t]+i)/c|0,a[t]=c===a[t]?0:a[t]%c;return i&&(a=[i].concat(a),++s),q(e,a,s)},I.precision=I.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return g(e,1,h),null==t?t=k:g(t,0,8),W(new $(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*u+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},I.shiftedBy=function(e){return g(e,-9007199254740991,l),this.times("1e"+e)},I.squareRoot=I.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,c=s.s,u=s.e,l=L+4,f=new $("0.5");if(1!==c||!a||!a[0])return new $(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(c=Math.sqrt(+Z(s)))||c==1/0?(((t=b(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=p((u+1)/2)-(u<0||u%2),n=new $(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new $(c+""),n.c[0])for((c=(u=n.e)+l)<3&&(c=0);;)if(o=n,n=f.times(o.plus(r(s,o,l,1))),b(o.c).slice(0,c)===(t=b(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(W(n,n.e+L+2,1),e=!n.times(n).eq(s));break}if(!i&&(W(o,o.e+L+2,0),o.times(o).eq(s))){n=o;break}l+=4,c+=4,i=1}return W(n,n.e+L+1,k,e)},I.toExponential=function(e,t){return null!=e&&(g(e,0,h),e++),V(this,e,t,1)},I.toFixed=function(e,t){return null!=e&&(g(e,0,h),e=e+this.e+1),V(this,e,t)},I.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=K;else if("object"!=typeof r)throw Error(s+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),c=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",f=a[0],d=a[1],h=i.s<0,p=h?f.slice(1):f,b=p.length;if(u&&(o=c,c=u,u=o,b-=o),c>0&&b>0){for(o=b%c||c,f=p.substr(0,o);o<b;o+=c)f+=l+p.substr(o,c);u>0&&(f+=l+p.slice(o)),h&&(f="-"+f)}n=d?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):f}return(r.prefix||"")+n+(r.suffix||"")},I.toFraction=function(e){var t,n,i,o,a,c,l,d,h,p,m,g,v=this,y=v.c;if(null!=e&&(!(l=new $(e)).isInteger()&&(l.c||1!==l.s)||l.lt(M)))throw Error(s+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+Z(l));if(!y)return new $(v);for(t=new $(M),h=n=new $(M),i=d=new $(M),g=b(y),a=t.e=g.length-v.e-1,t.c[0]=f[(c=a%u)<0?u+c:c],e=!e||l.comparedTo(t)>0?a>0?t:h:l,c=D,D=1/0,l=new $(g),d.c[0]=0;p=r(l,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,h=d.plus(p.times(o=h)),d=o,t=l.minus(p.times(o=t)),l=o;return o=r(e.minus(n),i,0,1),d=d.plus(o.times(h)),n=n.plus(o.times(i)),d.s=h.s=v.s,m=r(h,i,a*=2,k).minus(v).abs().comparedTo(r(d,n,a,k).minus(v).abs())<1?[h,i]:[d,n],D=c,m},I.toNumber=function(){return+Z(this)},I.toPrecision=function(e,t){return null!=e&&g(e,1,h),V(this,e,t,2)},I.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=i<=N||i>=C?y(b(r.c),i):_(b(r.c),i,"0"):10===e&&G?t=_(b((r=W(new $(r),L+i+1,k)).c),r.e,"0"):(g(e,2,H.length,"Base"),t=w(_(b(r.c),i,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},I.valueOf=I.toJSON=function(){return Z(this)},I._isBigNumber=!0,I[Symbol.toStringTag]="BigNumber",I[Symbol.for("nodejs.util.inspect.custom")]=I.valueOf,null!=t&&$.set(t),$}();const E=w},763:e=>{"use strict";e.exports={i8:"6.5.4"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(2353)})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.taquito=t():e.taquito=t()}(self,(()=>(()=>{var e={9437:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5457);function i(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function o(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function s(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function c(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function u(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function l(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function f(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),l(e/4294967296>>>0,t,r),l(e>>>0,t,r+4),t}function h(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),f(e>>>0,t,r),f(e/4294967296>>>0,t,r+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=i,t.writeInt16BE=i,t.writeUint16LE=o,t.writeInt16LE=o,t.readInt32BE=s,t.readUint32BE=a,t.readInt32LE=c,t.readUint32LE=u,t.writeUint32BE=l,t.writeInt32BE=l,t.writeUint32LE=f,t.writeInt32LE=f,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=s(e,t),n=s(e,t+4);return 4294967296*r+n-4294967296*(n>>31)},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=c(e,t);return 4294967296*c(e,t+4)+r-4294967296*(r>>31)},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=u(e,t);return 4294967296*u(e,t+4)+r},t.writeUint64BE=d,t.writeInt64BE=d,t.writeUint64LE=h,t.writeInt64LE=h,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=e/8+r-1;o>=r;o--)n+=t[o]*i,i*=256;return n},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+e/8;o++)n+=t[o]*i,i*=256;return n},t.writeUintBE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var o=1,s=e/8+i-1;s>=i;s--)r[s]=t/o&255,o*=256;return r},t.writeUintLE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var o=1,s=i;s<i+e/8;s++)r[s]=t/o&255,o*=256;return r},t.readFloat32BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)},t.readFloat32LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)},t.readFloat64BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)},t.readFloat64LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)},t.writeFloat32BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e),t},t.writeFloat32LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e,!0),t},t.writeFloat64BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e),t},t.writeFloat64LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e,!0),t}},6851:(e,t,r)=>{"use strict";var n=r(9437),i=r(2887);t.cn=128,t.k=64,t.Cv=64,t.fg=16,t.fe=16,t.zS=Math.pow(2,32)-1,t.d=255,t.lV=255;var o=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),s=[[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6],[22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8],[14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16],[18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26],[4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18],[24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22],[26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20],[12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10],[20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0],[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6]],a=function(){function e(e,r){if(void 0===e&&(e=64),this.digestLength=e,this.blockSize=t.cn,this._state=new Int32Array(o),this._buffer=new Uint8Array(t.cn),this._bufferLength=0,this._ctr=new Uint32Array(4),this._flag=new Uint32Array(4),this._lastNode=!1,this._finished=!1,this._vtmp=new Uint32Array(32),this._mtmp=new Uint32Array(32),e<1||e>t.k)throw new Error("blake2b: wrong digest length");r&&this.validateConfig(r);var i=0;r&&r.key&&(i=r.key.length);var s=1,a=1;r&&r.tree&&(s=r.tree.fanout,a=r.tree.maxDepth),this._state[0]^=e|i<<8|s<<16|a<<24,r&&r.tree&&(this._state[1]^=r.tree.leafSize,this._state[2]^=r.tree.nodeOffsetLowBits,this._state[3]^=r.tree.nodeOffsetHighBits,this._state[4]^=r.tree.nodeDepth|r.tree.innerDigestLength<<8,this._lastNode=r.tree.lastNode),r&&r.salt&&(this._state[8]^=n.readUint32LE(r.salt,0),this._state[9]^=n.readUint32LE(r.salt,4),this._state[10]^=n.readUint32LE(r.salt,8),this._state[11]^=n.readUint32LE(r.salt,12)),r&&r.personalization&&(this._state[12]^=n.readUint32LE(r.personalization,0),this._state[13]^=n.readUint32LE(r.personalization,4),this._state[14]^=n.readUint32LE(r.personalization,8),this._state[15]^=n.readUint32LE(r.personalization,12)),this._initialState=new Uint32Array(this._state),r&&r.key&&i>0&&(this._paddedKey=new Uint8Array(t.cn),this._paddedKey.set(r.key),this._buffer.set(this._paddedKey),this._bufferLength=t.cn)}return e.prototype.reset=function(){return this._state.set(this._initialState),this._paddedKey?(this._buffer.set(this._paddedKey),this._bufferLength=t.cn):this._bufferLength=0,i.wipe(this._ctr),i.wipe(this._flag),this._finished=!1,this},e.prototype.validateConfig=function(e){if(e.key&&e.key.length>t.Cv)throw new Error("blake2b: wrong key length");if(e.salt&&e.salt.length!==t.fe)throw new Error("blake2b: wrong salt length");if(e.personalization&&e.personalization.length!==t.fg)throw new Error("blake2b: wrong personalization length");if(e.tree){if(e.tree.fanout<0||e.tree.fanout>t.d)throw new Error("blake2b: wrong tree fanout");if(e.tree.maxDepth<0||e.tree.maxDepth>t.lV)throw new Error("blake2b: wrong tree depth");if(e.tree.leafSize<0||e.tree.leafSize>t.zS)throw new Error("blake2b: wrong leaf size");if(e.tree.innerDigestLength<0||e.tree.innerDigestLength>t.k)throw new Error("blake2b: wrong tree inner digest length")}},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw new Error("blake2b: can't update because hash was finished.");var n=t.cn-this._bufferLength,i=0;if(0===r)return this;if(r>n){for(var o=0;o<n;o++)this._buffer[this._bufferLength+o]=e[i+o];this._processBlock(t.cn),i+=n,r-=n,this._bufferLength=0}for(;r>t.cn;){for(o=0;o<t.cn;o++)this._buffer[o]=e[i+o];this._processBlock(t.cn),i+=t.cn,r-=t.cn,this._bufferLength=0}for(o=0;o<r;o++)this._buffer[this._bufferLength+o]=e[i+o];return this._bufferLength+=r,this},e.prototype.finish=function(e){if(!this._finished){for(var r=this._bufferLength;r<t.cn;r++)this._buffer[r]=0;this._flag[0]=4294967295,this._flag[1]=4294967295,this._lastNode&&(this._flag[2]=4294967295,this._flag[3]=4294967295),this._processBlock(this._bufferLength),this._finished=!0}var i=this._buffer.subarray(0,64);for(r=0;r<16;r++)n.writeUint32LE(this._state[r],i,4*r);return e.set(i.subarray(0,e.length)),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.clean=function(){i.wipe(this._vtmp),i.wipe(this._mtmp),i.wipe(this._state),i.wipe(this._buffer),i.wipe(this._initialState),this._paddedKey&&i.wipe(this._paddedKey),this._bufferLength=0,i.wipe(this._ctr),i.wipe(this._flag),this._lastNode=!1,this._finished=!1},e.prototype.saveState=function(){if(this._finished)throw new Error("blake2b: cannot save finished state");return{state:new Uint32Array(this._state),buffer:new Uint8Array(this._buffer),bufferLength:this._bufferLength,ctr:new Uint32Array(this._ctr),flag:new Uint32Array(this._flag),lastNode:this._lastNode,paddedKey:this._paddedKey?new Uint8Array(this._paddedKey):void 0,initialState:new Uint32Array(this._initialState)}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._buffer.set(e.buffer),this._bufferLength=e.bufferLength,this._ctr.set(e.ctr),this._flag.set(e.flag),this._lastNode=e.lastNode,this._paddedKey&&i.wipe(this._paddedKey),this._paddedKey=e.paddedKey?new Uint8Array(e.paddedKey):void 0,this._initialState.set(e.initialState),this},e.prototype.cleanSavedState=function(e){i.wipe(e.state),i.wipe(e.buffer),i.wipe(e.initialState),e.paddedKey&&i.wipe(e.paddedKey),e.bufferLength=0,i.wipe(e.ctr),i.wipe(e.flag),e.lastNode=!1},e.prototype._G=function(e,t,r,n,i,o,s,a,c,u,l,f,d){var h=e[t],p=e[o],b=e[r],m=e[s],g=e[n],v=e[a],y=e[i],_=e[c],w=65535&h,E=h>>>16,O=65535&p,S=p>>>16;E+=b>>>16,O+=65535&m,S+=m>>>16,O+=(E+=(w+=65535&b)>>>16)>>>16,w=65535&(h=65535&w|E<<16),E=h>>>16,O=65535&(p=65535&O|(S+=O>>>16)<<16),S=p>>>16,E+=u>>>16,O+=65535&l,S+=l>>>16,h=65535&(w+=65535&u)|(E+=w>>>16)<<16,w=_^=p=65535&(O+=E>>>16)|(S+=O>>>16)<<16,_=y^=h,y=w,w=65535&g,E=g>>>16,O=65535&v,S=v>>>16,E+=y>>>16,O+=65535&_,S+=_>>>16,w=(b^=g=65535&(w+=65535&y)|(E+=w>>>16)<<16)<<8|(m^=v=65535&(O+=E>>>16)|(S+=O>>>16)<<16)>>>24,b=m<<8|b>>>24,m=w,w=65535&h,E=h>>>16,O=65535&p,S=p>>>16,E+=b>>>16,O+=65535&m,S+=m>>>16,O+=(E+=(w+=65535&b)>>>16)>>>16,w=65535&(h=65535&w|E<<16),E=h>>>16,O=65535&(p=65535&O|(S+=O>>>16)<<16),S=p>>>16,E+=f>>>16,O+=65535&d,S+=d>>>16,w=(y^=h=65535&(w+=65535&f)|(E+=w>>>16)<<16)<<16|(_^=p=65535&(O+=E>>>16)|(S+=O>>>16)<<16)>>>16,y=_<<16|y>>>16,_=w,w=65535&g,E=g>>>16,O=65535&v,S=v>>>16,E+=y>>>16,O+=65535&_,S+=_>>>16,w=(m^=v=65535&(O+=(E+=(w+=65535&y)>>>16)>>>16)|(S+=O>>>16)<<16)<<1|(b^=g=65535&w|E<<16)>>>31,b=b<<1|m>>>31,m=w,e[t]=h,e[o]=p,e[r]=b,e[s]=m,e[n]=g,e[a]=v,e[i]=y,e[c]=_},e.prototype._incrementCounter=function(e){for(var t=0;t<3;t++){var r=this._ctr[t]+e;if(this._ctr[t]=r>>>0,this._ctr[t]===r)return;e=1}},e.prototype._processBlock=function(e){this._incrementCounter(e);var t=this._vtmp;t.set(this._state),t.set(o,16),t[24]^=this._ctr[0],t[25]^=this._ctr[1],t[26]^=this._ctr[2],t[27]^=this._ctr[3],t[28]^=this._flag[0],t[29]^=this._flag[1],t[30]^=this._flag[2],t[31]^=this._flag[3];for(var r=this._mtmp,i=0;i<32;i++)r[i]=n.readUint32LE(this._buffer,4*i);for(var a=0;a<12;a++)this._G(t,0,8,16,24,1,9,17,25,r[s[a][0]],r[s[a][0]+1],r[s[a][1]],r[s[a][1]+1]),this._G(t,2,10,18,26,3,11,19,27,r[s[a][2]],r[s[a][2]+1],r[s[a][3]],r[s[a][3]+1]),this._G(t,4,12,20,28,5,13,21,29,r[s[a][4]],r[s[a][4]+1],r[s[a][5]],r[s[a][5]+1]),this._G(t,6,14,22,30,7,15,23,31,r[s[a][6]],r[s[a][6]+1],r[s[a][7]],r[s[a][7]+1]),this._G(t,0,10,20,30,1,11,21,31,r[s[a][8]],r[s[a][8]+1],r[s[a][9]],r[s[a][9]+1]),this._G(t,2,12,22,24,3,13,23,25,r[s[a][10]],r[s[a][10]+1],r[s[a][11]],r[s[a][11]+1]),this._G(t,4,14,16,26,5,15,17,27,r[s[a][12]],r[s[a][12]+1],r[s[a][13]],r[s[a][13]+1]),this._G(t,6,8,18,28,7,9,19,29,r[s[a][14]],r[s[a][14]+1],r[s[a][15]],r[s[a][15]+1]);for(i=0;i<16;i++)this._state[i]^=t[i]^t[i+16]},e}();t.vp=function(e,r,n){void 0===r&&(r=t.k);var i=new a(r,n);i.update(e);var o=i.digest();return i.clean(),o}},7728:(e,t,r)=>{"use strict";t.T=t.aP=t.KS=t.jQ=void 0;const n=r(1293),i=r(6756),o=r(2887);function s(e){const t=new Float64Array(16);if(e)for(let r=0;r<e.length;r++)t[r]=e[r];return t}t.jQ=64,t.KS=64,t.aP=32;new Uint8Array(32)[0]=9;const a=s(),c=s([1]),u=s([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=s([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=s([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=s([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),h=s([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t){for(let r=0;r<16;r++)e[r]=0|t[r]}function b(e){let t=1;for(let r=0;r<16;r++){let n=e[r]+t+65535;t=Math.floor(n/65536),e[r]=n-65536*t}e[0]+=t-1+37*(t-1)}function m(e,t,r){const n=~(r-1);for(let r=0;r<16;r++){const i=n&(e[r]^t[r]);e[r]^=i,t[r]^=i}}function g(e,t){const r=s(),n=s();for(let e=0;e<16;e++)n[e]=t[e];b(n),b(n),b(n);for(let e=0;e<2;e++){r[0]=n[0]-65517;for(let e=1;e<15;e++)r[e]=n[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);const e=r[15]>>16&1;r[14]&=65535,m(n,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&n[t],e[2*t+1]=n[t]>>8}function v(e,t){let r=0;for(let n=0;n<32;n++)r|=e[n]^t[n];return(1&r-1>>>8)-1}function y(e,t){const r=new Uint8Array(32),n=new Uint8Array(32);return g(r,e),g(n,t),v(r,n)}function _(e){const t=new Uint8Array(32);return g(t,e),1&t[0]}function w(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]+r[n]}function E(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]-r[n]}function O(e,t,r){let n,i,o=0,s=0,a=0,c=0,u=0,l=0,f=0,d=0,h=0,p=0,b=0,m=0,g=0,v=0,y=0,_=0,w=0,E=0,O=0,S=0,A=0,P=0,T=0,R=0,x=0,I=0,M=0,L=0,k=0,N=0,C=0,j=r[0],D=r[1],U=r[2],B=r[3],F=r[4],K=r[5],H=r[6],G=r[7],$=r[8],V=r[9],z=r[10],q=r[11],W=r[12],Z=r[13],J=r[14],Y=r[15];n=t[0],o+=n*j,s+=n*D,a+=n*U,c+=n*B,u+=n*F,l+=n*K,f+=n*H,d+=n*G,h+=n*$,p+=n*V,b+=n*z,m+=n*q,g+=n*W,v+=n*Z,y+=n*J,_+=n*Y,n=t[1],s+=n*j,a+=n*D,c+=n*U,u+=n*B,l+=n*F,f+=n*K,d+=n*H,h+=n*G,p+=n*$,b+=n*V,m+=n*z,g+=n*q,v+=n*W,y+=n*Z,_+=n*J,w+=n*Y,n=t[2],a+=n*j,c+=n*D,u+=n*U,l+=n*B,f+=n*F,d+=n*K,h+=n*H,p+=n*G,b+=n*$,m+=n*V,g+=n*z,v+=n*q,y+=n*W,_+=n*Z,w+=n*J,E+=n*Y,n=t[3],c+=n*j,u+=n*D,l+=n*U,f+=n*B,d+=n*F,h+=n*K,p+=n*H,b+=n*G,m+=n*$,g+=n*V,v+=n*z,y+=n*q,_+=n*W,w+=n*Z,E+=n*J,O+=n*Y,n=t[4],u+=n*j,l+=n*D,f+=n*U,d+=n*B,h+=n*F,p+=n*K,b+=n*H,m+=n*G,g+=n*$,v+=n*V,y+=n*z,_+=n*q,w+=n*W,E+=n*Z,O+=n*J,S+=n*Y,n=t[5],l+=n*j,f+=n*D,d+=n*U,h+=n*B,p+=n*F,b+=n*K,m+=n*H,g+=n*G,v+=n*$,y+=n*V,_+=n*z,w+=n*q,E+=n*W,O+=n*Z,S+=n*J,A+=n*Y,n=t[6],f+=n*j,d+=n*D,h+=n*U,p+=n*B,b+=n*F,m+=n*K,g+=n*H,v+=n*G,y+=n*$,_+=n*V,w+=n*z,E+=n*q,O+=n*W,S+=n*Z,A+=n*J,P+=n*Y,n=t[7],d+=n*j,h+=n*D,p+=n*U,b+=n*B,m+=n*F,g+=n*K,v+=n*H,y+=n*G,_+=n*$,w+=n*V,E+=n*z,O+=n*q,S+=n*W,A+=n*Z,P+=n*J,T+=n*Y,n=t[8],h+=n*j,p+=n*D,b+=n*U,m+=n*B,g+=n*F,v+=n*K,y+=n*H,_+=n*G,w+=n*$,E+=n*V,O+=n*z,S+=n*q,A+=n*W,P+=n*Z,T+=n*J,R+=n*Y,n=t[9],p+=n*j,b+=n*D,m+=n*U,g+=n*B,v+=n*F,y+=n*K,_+=n*H,w+=n*G,E+=n*$,O+=n*V,S+=n*z,A+=n*q,P+=n*W,T+=n*Z,R+=n*J,x+=n*Y,n=t[10],b+=n*j,m+=n*D,g+=n*U,v+=n*B,y+=n*F,_+=n*K,w+=n*H,E+=n*G,O+=n*$,S+=n*V,A+=n*z,P+=n*q,T+=n*W,R+=n*Z,x+=n*J,I+=n*Y,n=t[11],m+=n*j,g+=n*D,v+=n*U,y+=n*B,_+=n*F,w+=n*K,E+=n*H,O+=n*G,S+=n*$,A+=n*V,P+=n*z,T+=n*q,R+=n*W,x+=n*Z,I+=n*J,M+=n*Y,n=t[12],g+=n*j,v+=n*D,y+=n*U,_+=n*B,w+=n*F,E+=n*K,O+=n*H,S+=n*G,A+=n*$,P+=n*V,T+=n*z,R+=n*q,x+=n*W,I+=n*Z,M+=n*J,L+=n*Y,n=t[13],v+=n*j,y+=n*D,_+=n*U,w+=n*B,E+=n*F,O+=n*K,S+=n*H,A+=n*G,P+=n*$,T+=n*V,R+=n*z,x+=n*q,I+=n*W,M+=n*Z,L+=n*J,k+=n*Y,n=t[14],y+=n*j,_+=n*D,w+=n*U,E+=n*B,O+=n*F,S+=n*K,A+=n*H,P+=n*G,T+=n*$,R+=n*V,x+=n*z,I+=n*q,M+=n*W,L+=n*Z,k+=n*J,N+=n*Y,n=t[15],_+=n*j,w+=n*D,E+=n*U,O+=n*B,S+=n*F,A+=n*K,P+=n*H,T+=n*G,R+=n*$,x+=n*V,I+=n*z,M+=n*q,L+=n*W,k+=n*Z,N+=n*J,C+=n*Y,o+=38*w,s+=38*E,a+=38*O,c+=38*S,u+=38*A,l+=38*P,f+=38*T,d+=38*R,h+=38*x,p+=38*I,b+=38*M,m+=38*L,g+=38*k,v+=38*N,y+=38*C,i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-65536*i,n=s+i+65535,i=Math.floor(n/65536),s=n-65536*i,n=a+i+65535,i=Math.floor(n/65536),a=n-65536*i,n=c+i+65535,i=Math.floor(n/65536),c=n-65536*i,n=u+i+65535,i=Math.floor(n/65536),u=n-65536*i,n=l+i+65535,i=Math.floor(n/65536),l=n-65536*i,n=f+i+65535,i=Math.floor(n/65536),f=n-65536*i,n=d+i+65535,i=Math.floor(n/65536),d=n-65536*i,n=h+i+65535,i=Math.floor(n/65536),h=n-65536*i,n=p+i+65535,i=Math.floor(n/65536),p=n-65536*i,n=b+i+65535,i=Math.floor(n/65536),b=n-65536*i,n=m+i+65535,i=Math.floor(n/65536),m=n-65536*i,n=g+i+65535,i=Math.floor(n/65536),g=n-65536*i,n=v+i+65535,i=Math.floor(n/65536),v=n-65536*i,n=y+i+65535,i=Math.floor(n/65536),y=n-65536*i,n=_+i+65535,i=Math.floor(n/65536),_=n-65536*i,o+=i-1+37*(i-1),i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-65536*i,n=s+i+65535,i=Math.floor(n/65536),s=n-65536*i,n=a+i+65535,i=Math.floor(n/65536),a=n-65536*i,n=c+i+65535,i=Math.floor(n/65536),c=n-65536*i,n=u+i+65535,i=Math.floor(n/65536),u=n-65536*i,n=l+i+65535,i=Math.floor(n/65536),l=n-65536*i,n=f+i+65535,i=Math.floor(n/65536),f=n-65536*i,n=d+i+65535,i=Math.floor(n/65536),d=n-65536*i,n=h+i+65535,i=Math.floor(n/65536),h=n-65536*i,n=p+i+65535,i=Math.floor(n/65536),p=n-65536*i,n=b+i+65535,i=Math.floor(n/65536),b=n-65536*i,n=m+i+65535,i=Math.floor(n/65536),m=n-65536*i,n=g+i+65535,i=Math.floor(n/65536),g=n-65536*i,n=v+i+65535,i=Math.floor(n/65536),v=n-65536*i,n=y+i+65535,i=Math.floor(n/65536),y=n-65536*i,n=_+i+65535,i=Math.floor(n/65536),_=n-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=d,e[8]=h,e[9]=p,e[10]=b,e[11]=m,e[12]=g,e[13]=v,e[14]=y,e[15]=_}function S(e,t){O(e,t,t)}function A(e,t){const r=s();let n;for(n=0;n<16;n++)r[n]=t[n];for(n=253;n>=0;n--)S(r,r),2!==n&&4!==n&&O(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}function P(e,t){const r=s(),n=s(),i=s(),o=s(),a=s(),c=s(),u=s(),f=s(),d=s();E(r,e[1],e[0]),E(d,t[1],t[0]),O(r,r,d),w(n,e[0],e[1]),w(d,t[0],t[1]),O(n,n,d),O(i,e[3],t[3]),O(i,i,l),O(o,e[2],t[2]),w(o,o,o),E(a,n,r),E(c,o,i),w(u,o,i),w(f,n,r),O(e[0],a,c),O(e[1],f,u),O(e[2],u,c),O(e[3],a,f)}function T(e,t,r){for(let n=0;n<4;n++)m(e[n],t[n],r)}function R(e,t){const r=s(),n=s(),i=s();A(i,t[2]),O(r,t[0],i),O(n,t[1],i),g(e,n),e[31]^=_(r)<<7}function x(e,t,r){p(e[0],a),p(e[1],c),p(e[2],c),p(e[3],a);for(let n=255;n>=0;--n){const i=r[n/8|0]>>(7&n)&1;T(e,t,i),P(t,e),P(e,e),T(e,t,i)}}function I(e,t){const r=[s(),s(),s(),s()];p(r[0],f),p(r[1],d),p(r[2],c),O(r[3],f,d),x(e,r,t)}function M(e){if(e.length!==t.aP)throw new Error(`ed25519: seed must be ${t.aP} bytes`);const r=(0,i.hash)(e);r[0]&=248,r[31]&=127,r[31]|=64;const n=new Uint8Array(32),o=[s(),s(),s(),s()];I(o,r),R(n,o);const a=new Uint8Array(64);return a.set(e),a.set(n,32),{publicKey:n,secretKey:a}}const L=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function k(e,t){let r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*L[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*L[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*L[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function N(e){const t=new Float64Array(64);for(let r=0;r<64;r++)t[r]=e[r];for(let t=0;t<64;t++)e[t]=0;k(e,t)}function C(e,t){const r=s(),n=s(),i=s(),o=s(),l=s(),f=s(),d=s();return p(e[2],c),function(e,t){for(let r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),S(i,e[1]),O(o,i,u),E(i,i,e[2]),w(o,e[2],o),S(l,o),S(f,l),O(d,f,l),O(r,d,i),O(r,r,o),function(e,t){const r=s();let n;for(n=0;n<16;n++)r[n]=t[n];for(n=250;n>=0;n--)S(r,r),1!==n&&O(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}(r,r),O(r,r,i),O(r,r,o),O(r,r,o),O(e[0],r,o),S(n,e[0]),O(n,n,o),y(n,i)&&O(e[0],e[0],h),S(n,e[0]),O(n,n,o),y(n,i)?-1:(_(e[0])===t[31]>>7&&E(e[0],a,e[0]),O(e[3],e[0],e[1]),0)}t.T=function(e,r,n){const o=new Uint8Array(32),a=[s(),s(),s(),s()],c=[s(),s(),s(),s()];if(n.length!==t.jQ)throw new Error(`ed25519: signature must be ${t.jQ} bytes`);if(C(c,e))return!1;const u=new i.SHA512;u.update(n.subarray(0,32)),u.update(e),u.update(r);const l=u.digest();return N(l),x(a,c,l),I(c,n.subarray(32)),P(a,c),R(o,a),!v(n,o)}},5457:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16&65535)*n+r*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<<t|e>>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},1293:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const n=r(5147),i=r(9437),o=r(2887);function s(e,r=t.defaultRandomSource){return r.randomBytes(e)}t.defaultRandomSource=new n.SystemRandomSource,t.randomBytes=s,t.randomUint32=function(e=t.defaultRandomSource){const r=s(4,e),n=(0,i.readUint32LE)(r);return(0,o.wipe)(r),n};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(e,r=a,n=t.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let i="";const c=r.length,u=256-256%c;for(;e>0;){const t=s(Math.ceil(256*e/u),n);for(let n=0;n<t.length&&e>0;n++){const o=t[n];o<u&&(i+=r.charAt(o%c),e--)}(0,o.wipe)(t)}return i}t.randomString=c,t.randomStringForEntropy=function(e,r=a,n=t.defaultRandomSource){return c(Math.ceil(e/(Math.log(r.length)/Math.LN2)),r,n)}},2017:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0;t.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const t=new Uint8Array(e);for(let e=0;e<t.length;e+=65536)this._crypto.getRandomValues(t.subarray(e,e+Math.min(t.length-e,65536)));return t}}},7879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRandomSource=void 0;const n=r(2887);t.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const e=r(5477);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(e);for(let e=0;e<r.length;e++)r[e]=t[e];return(0,n.wipe)(t),r}}},5147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SystemRandomSource=void 0;const n=r(2017),i=r(7879);t.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new n.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new i.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}},6756:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9437),i=r(2887);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var o=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._tempHi),i.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t/536870912|0,o=t<<3,s=t%128<112?128:256;this._buffer[r]=128;for(var c=r+1;c<s-8;c++)this._buffer[c]=0;n.writeUint32BE(i,this._buffer,s-8),n.writeUint32BE(o,this._buffer,s-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,s),this._finished=!0}for(c=0;c<this.digestLength/8;c++)n.writeUint32BE(this._stateHi[c],e,8*c),n.writeUint32BE(this._stateLo[c],e,8*c+4);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.stateHi),i.wipe(e.stateLo),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=o;var s=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(e,t,r,i,o,a,c){for(var u,l,f,d,h,p,b,m,g=r[0],v=r[1],y=r[2],_=r[3],w=r[4],E=r[5],O=r[6],S=r[7],A=i[0],P=i[1],T=i[2],R=i[3],x=i[4],I=i[5],M=i[6],L=i[7];c>=128;){for(var k=0;k<16;k++){var N=8*k+a;e[k]=n.readUint32BE(o,N),t[k]=n.readUint32BE(o,N+4)}for(k=0;k<80;k++){var C,j,D=g,U=v,B=y,F=_,K=w,H=E,G=O,$=A,V=P,z=T,q=R,W=x,Z=I,J=M;if(h=65535&(l=L),p=l>>>16,b=65535&(u=S),m=u>>>16,h+=65535&(l=(x>>>14|w<<18)^(x>>>18|w<<14)^(w>>>9|x<<23)),p+=l>>>16,b+=65535&(u=(w>>>14|x<<18)^(w>>>18|x<<14)^(x>>>9|w<<23)),m+=u>>>16,h+=65535&(l=x&I^~x&M),p+=l>>>16,b+=65535&(u=w&E^~w&O),m+=u>>>16,u=s[2*k],h+=65535&(l=s[2*k+1]),p+=l>>>16,b+=65535&u,m+=u>>>16,u=e[k%16],p+=(l=t[k%16])>>>16,b+=65535&u,m+=u>>>16,b+=(p+=(h+=65535&l)>>>16)>>>16,h=65535&(l=d=65535&h|p<<16),p=l>>>16,b=65535&(u=f=65535&b|(m+=b>>>16)<<16),m=u>>>16,h+=65535&(l=(A>>>28|g<<4)^(g>>>2|A<<30)^(g>>>7|A<<25)),p+=l>>>16,b+=65535&(u=(g>>>28|A<<4)^(A>>>2|g<<30)^(A>>>7|g<<25)),m+=u>>>16,p+=(l=A&P^A&T^P&T)>>>16,b+=65535&(u=g&v^g&y^v&y),m+=u>>>16,C=65535&(b+=(p+=(h+=65535&l)>>>16)>>>16)|(m+=b>>>16)<<16,j=65535&h|p<<16,h=65535&(l=q),p=l>>>16,b=65535&(u=F),m=u>>>16,p+=(l=d)>>>16,b+=65535&(u=f),m+=u>>>16,v=D,y=U,_=B,w=F=65535&(b+=(p+=(h+=65535&l)>>>16)>>>16)|(m+=b>>>16)<<16,E=K,O=H,S=G,g=C,P=$,T=V,R=z,x=q=65535&h|p<<16,I=W,M=Z,L=J,A=j,k%16==15)for(N=0;N<16;N++)u=e[N],h=65535&(l=t[N]),p=l>>>16,b=65535&u,m=u>>>16,u=e[(N+9)%16],h+=65535&(l=t[(N+9)%16]),p+=l>>>16,b+=65535&u,m+=u>>>16,f=e[(N+1)%16],h+=65535&(l=((d=t[(N+1)%16])>>>1|f<<31)^(d>>>8|f<<24)^(d>>>7|f<<25)),p+=l>>>16,b+=65535&(u=(f>>>1|d<<31)^(f>>>8|d<<24)^f>>>7),m+=u>>>16,f=e[(N+14)%16],p+=(l=((d=t[(N+14)%16])>>>19|f<<13)^(f>>>29|d<<3)^(d>>>6|f<<26))>>>16,b+=65535&(u=(f>>>19|d<<13)^(d>>>29|f<<3)^f>>>6),m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,e[N]=65535&b|m<<16,t[N]=65535&h|p<<16}h=65535&(l=A),p=l>>>16,b=65535&(u=g),m=u>>>16,u=r[0],p+=(l=i[0])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[0]=g=65535&b|m<<16,i[0]=A=65535&h|p<<16,h=65535&(l=P),p=l>>>16,b=65535&(u=v),m=u>>>16,u=r[1],p+=(l=i[1])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[1]=v=65535&b|m<<16,i[1]=P=65535&h|p<<16,h=65535&(l=T),p=l>>>16,b=65535&(u=y),m=u>>>16,u=r[2],p+=(l=i[2])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[2]=y=65535&b|m<<16,i[2]=T=65535&h|p<<16,h=65535&(l=R),p=l>>>16,b=65535&(u=_),m=u>>>16,u=r[3],p+=(l=i[3])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[3]=_=65535&b|m<<16,i[3]=R=65535&h|p<<16,h=65535&(l=x),p=l>>>16,b=65535&(u=w),m=u>>>16,u=r[4],p+=(l=i[4])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[4]=w=65535&b|m<<16,i[4]=x=65535&h|p<<16,h=65535&(l=I),p=l>>>16,b=65535&(u=E),m=u>>>16,u=r[5],p+=(l=i[5])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[5]=E=65535&b|m<<16,i[5]=I=65535&h|p<<16,h=65535&(l=M),p=l>>>16,b=65535&(u=O),m=u>>>16,u=r[6],p+=(l=i[6])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[6]=O=65535&b|m<<16,i[6]=M=65535&h|p<<16,h=65535&(l=L),p=l>>>16,b=65535&(u=S),m=u>>>16,u=r[7],p+=(l=i[7])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[7]=S=65535&b|m<<16,i[7]=L=65535&h|p<<16,a+=128,c-=128}return a}t.hash=function(e){var t=new o;t.update(e);var r=t.digest();return t.clean(),r}},2887:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t<e.length;t++)e[t]=0;return e}},9644:(e,t,r)=>{e.exports=r(5644)},353:(e,t,r)=>{"use strict";var n=r(3044),i=r(6955),o=r(2233),s=r(8030),a=r(7948),c=r(1875),u=r(842),l=r(8618),f=r(1439),d=r(6714);e.exports=function(e){return new Promise((function(t,r){var h,p=e.data,b=e.headers,m=e.responseType;function g(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}n.isFormData(p)&&delete b["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var y=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";b.Authorization="Basic "+btoa(y+":"+_)}var w=a(e.baseURL,e.url);function E(){if(v){var n="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,o={data:m&&"text"!==m&&"json"!==m?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};i((function(e){t(e),g()}),(function(e){r(e),g()}),o),v=null}}if(v.open(e.method.toUpperCase(),s(w,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=E:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(E)},v.onabort=function(){v&&(r(l("Request aborted",e,"ECONNABORTED",v)),v=null)},v.onerror=function(){r(l("Network Error",e,null,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||f.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(l(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},n.isStandardBrowserEnv()){var O=(e.withCredentials||u(w))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;O&&(b[e.xsrfHeaderName]=O)}"setRequestHeader"in v&&n.forEach(b,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete b[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),m&&"json"!==m&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){v&&(r(!e||e&&e.type?new d("canceled"):e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),p||(p=null),v.send(p)}))}},5644:(e,t,r)=>{"use strict";var n=r(3044),i=r(3644),o=r(2215),s=r(2937);var a=function e(t){var r=new o(t),a=i(o.prototype.request,r);return n.extend(a,o.prototype,r),n.extend(a,r),a.create=function(r){return e(s(t,r))},a}(r(1439));a.Axios=o,a.Cancel=r(6714),a.CancelToken=r(4089),a.isCancel=r(8041),a.VERSION=r(9241).version,a.all=function(e){return Promise.all(e)},a.spread=r(783),a.isAxiosError=r(5587),e.exports=a,e.exports.default=a},6714: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},4089:(e,t,r)=>{"use strict";var n=r(6714);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;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},8041:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},2215:(e,t,r)=>{"use strict";var n=r(3044),i=r(8030),o=r(946),s=r(6895),a=r(2937),c=r(7525),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!i){var f=[s,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(l),o=Promise.resolve(t);f.length;)o=o.then(f.shift(),f.shift());return o}for(var d=t;n.length;){var h=n.shift(),p=n.shift();try{d=h(d)}catch(e){p(e);break}}try{o=s(d)}catch(e){return Promise.reject(e)}for(;l.length;)o=o.then(l.shift(),l.shift());return o},l.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){l.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=l},946:(e,t,r)=>{"use strict";var n=r(3044);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),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},7948:(e,t,r)=>{"use strict";var n=r(9192),i=r(8762);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},8618:(e,t,r)=>{"use strict";var n=r(1935);e.exports=function(e,t,r,i,o){var s=new Error(e);return n(s,t,r,i,o)}},6895:(e,t,r)=>{"use strict";var n=r(3044),i=r(8556),o=r(8041),s=r(1439),a=r(6714);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=i.call(e,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 c(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(c(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},1935: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,status:this.response&&this.response.status?this.response.status:null}},e}},2937:(e,t,r)=>{"use strict";var n=r(3044);e.exports=function(e,t){t=t||{};var r={};function i(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 o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function s(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function a(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function c(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||o,i=t(e);n.isUndefined(i)&&t!==c||(r[e]=i)})),r}},6955:(e,t,r)=>{"use strict";var n=r(8618);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)}},8556:(e,t,r)=>{"use strict";var n=r(3044),i=r(1439);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},1439:(e,t,r)=>{"use strict";var n=r(3044),i=r(8868),o=r(1935),s={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=r(353)),c),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)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(a(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||u.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw o(e,this,"E_JSON_PARSE");throw 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){u.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){u.headers[e]=n.merge(s)})),e.exports=u},9241:e=>{e.exports={version:"0.26.0"}},3644: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)}}},8030:(e,t,r)=>{"use strict";var n=r(3044);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}},8762:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},2233:(e,t,r)=>{"use strict";var n=r(3044);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(){}}},9192:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},5587:(e,t,r)=>{"use strict";var n=r(3044);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},842:(e,t,r)=>{"use strict";var n=r(3044);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}},8868:(e,t,r)=>{"use strict";var n=r(3044);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},1875:(e,t,r)=>{"use strict";var n=r(3044),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}},783:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},7525:(e,t,r)=>{"use strict";var n=r(9241).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var o={};i.transitional=function(e,t,r){function i(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new Error(i(n," has been removed"+(t?" in "+t:"")));return t&&!o[n]&&(o[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var o=n[i],s=t[o];if(s){var a=e[o],c=void 0===a||s(a,o,e);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:i}},3044:(e,t,r)=>{"use strict";var n=r(3644),i=Object.prototype.toString;function o(e){return Array.isArray(e)}function s(e){return void 0===e}function a(e){return"[object ArrayBuffer]"===i.call(e)}function c(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(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:a,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"[object FormData]"===i.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&a(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:c,isPlainObject:u,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:l,isStream:function(e){return c(e)&&l(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===i.call(e)},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){u(t[n])&&u(r)?t[n]=e(t[n],r):u(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.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},8166:(e,t,r)=>{"use strict";var n=r(7834).Buffer;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 i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==t[s])throw new TypeError(o+" is ambiguous");t[s]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);for(var r=0,i=0,o=0;e[r]===c;)i++,r++;for(var s=(e.length-r)*u+1>>>0,l=new Uint8Array(s);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var d=0,h=s-1;(0!==f||d<o)&&-1!==h;h--,d++)f+=a*l[h]>>>0,l[h]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=d,r++}for(var p=s-o;p!==s&&0===l[p];)p++;var b=n.allocUnsafe(i+(s-p));b.fill(0,0,i);for(var m=i;p!==s;)b[m++]=l[p++];return b}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,s=t.length;o!==s&&0===t[o];)o++,r++;for(var u=(s-o)*l+1>>>0,f=new Uint8Array(u);o!==s;){for(var d=t[o],h=0,p=u-1;(0!==d||h<i)&&-1!==p;p--,h++)d+=256*f[p]>>>0,f[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");i=h,o++}for(var b=u-i;b!==u&&0===f[b];)b++;for(var m=c.repeat(r);b<u;++b)m+=e.charAt(f[b]);return m},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},5766:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],c=o[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,c)),l=0,f=c>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},6391:function(e,t,r){var n;!function(i){"use strict";var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,c=Math.floor,u="[BigNumber Error] ",l=u+"Number primitive has more than 15 significant digits: ",f=1e14,d=14,h=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],b=1e7,m=1e9;function g(e){var t=0|e;return e>0||e===t?t:t-1}function v(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=d-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function y(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,c=e.e,u=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=c==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(a=(c=i.length)<(u=o.length)?c:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return c==u?0:c>u^r?1:-1}function _(e,t,r,n){if(e<t||e>r||e!==c(e))throw Error(u+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function w(e){var t=e.c.length-1;return g(e.e/d)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function O(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}o=function e(t){var r,n,i,o,S,A,P,T,R,x,I=$.prototype={constructor:$,toString:null,valueOf:null},M=new $(1),L=20,k=4,N=-7,C=21,j=-1e7,D=1e7,U=!1,B=1,F=0,K={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",G=!0;function $(e,t){var r,o,a,u,f,p,b,m,g=this;if(!(g instanceof $))return new $(e,t);if(null==t){if(e&&!0===e._isBigNumber)return g.s=e.s,void(!e.c||e.e>D?g.c=g.e=null:e.e<j?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice()));if((p="number"==typeof e)&&0*e==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,f=e;f>=10;f/=10,u++);return void(u>D?g.c=g.e=null:(g.e=u,g.c=[e]))}m=String(e)}else{if(!s.test(m=String(e)))return i(g,m,p);g.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(u=m.indexOf("."))>-1&&(m=m.replace(".","")),(f=m.search(/e/i))>0?(u<0&&(u=f),u+=+m.slice(f+1),m=m.substring(0,f)):u<0&&(u=m.length)}else{if(_(t,2,H.length,"Base"),10==t&&G)return W(g=new $(e),L+g.e+1,k);if(m=String(e),p="number"==typeof e){if(0*e!=0)return i(g,m,p,t);if(g.s=1/e<0?(m=m.slice(1),-1):1,$.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else g.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(r=H.slice(0,t),u=f=0,b=m.length;f<b;f++)if(r.indexOf(o=m.charAt(f))<0){if("."==o){if(f>u){u=b;continue}}else if(!a&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){a=!0,f=-1,u=0;continue}return i(g,String(e),p,t)}p=!1,(u=(m=n(m,t,10,g.s)).indexOf("."))>-1?m=m.replace(".",""):u=m.length}for(f=0;48===m.charCodeAt(f);f++);for(b=m.length;48===m.charCodeAt(--b););if(m=m.slice(f,++b)){if(b-=f,p&&$.DEBUG&&b>15&&(e>h||e!==c(e)))throw Error(l+g.s*e);if((u=u-f-1)>D)g.c=g.e=null;else if(u<j)g.c=[g.e=0];else{if(g.e=u,g.c=[],f=(u+1)%d,u<0&&(f+=d),f<b){for(f&&g.c.push(+m.slice(0,f)),b-=d;f<b;)g.c.push(+m.slice(f,f+=d));f=d-(m=m.slice(f)).length}else f-=b;for(;f--;m+="0");g.c.push(+m)}}else g.c=[g.e=0]}function V(e,t,r,n){var i,o,s,a,c;if(null==r?r=k:_(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)c=v(e.c),c=1==n||2==n&&(s<=N||s>=C)?E(c,s):O(c,s,"0");else if(o=(e=W(new $(e),t,r)).e,a=(c=v(e.c)).length,1==n||2==n&&(t<=o||o<=N)){for(;a<t;c+="0",a++);c=E(c,o)}else if(t-=s,c=O(c,o,"0"),o+1>a){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-a)>0)for(o+1==a&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function z(e,t){for(var r,n,i=1,o=new $(e[0]);i<e.length;i++)(!(n=new $(e[i])).s||(r=y(o,n))===t||0===r&&o.s===t)&&(o=n);return o}function q(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*d-1)>D?e.c=e.e=null:r<j?e.c=[e.e=0]:(e.e=r,e.c=t),e}function W(e,t,r,n){var i,o,s,u,l,h,b,m=e.c,g=p;if(m){e:{for(i=1,u=m[0];u>=10;u/=10,i++);if((o=t-i)<0)o+=d,s=t,l=m[h=0],b=c(l/g[i-s-1]%10);else if((h=a((o+1)/d))>=m.length){if(!n)break e;for(;m.length<=h;m.push(0));l=b=0,i=1,s=(o%=d)-d+1}else{for(l=u=m[h],i=1;u>=10;u/=10,i++);b=(s=(o%=d)-d+i)<0?0:c(l/g[i-s-1]%10)}if(n=n||t<0||null!=m[h+1]||(s<0?l:l%g[i-s-1]),n=r<4?(b||n)&&(0==r||r==(e.s<0?3:2)):b>5||5==b&&(4==r||n||6==r&&(o>0?s>0?l/g[i-s]:0:m[h-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=g[(d-t%d)%d],e.e=-t||0):m[0]=e.e=0,e;if(0==o?(m.length=h,u=1,h--):(m.length=h+1,u=g[d-o],m[h]=s>0?c(l/g[i-s]%g[s])*u:0),n)for(;;){if(0==h){for(o=1,s=m[0];s>=10;s/=10,o++);for(s=m[0]+=u,u=1;s>=10;s/=10,u++);o!=u&&(e.e++,m[0]==f&&(m[0]=1));break}if(m[h]+=u,m[h]!=f)break;m[h--]=0,u=1}for(o=m.length;0===m[--o];m.pop());}e.e>D?e.c=e.e=null:e.e<j&&(e.c=[e.e=0])}return e}function Z(e){var t,r=e.e;return null===r?e.toString():(t=v(e.c),t=r<=N||r>=C?E(t,r):O(t,r,"0"),e.s<0?"-"+t:t)}return $.clone=e,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(_(r=e[t],0,m,t),L=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(_(r=e[t],0,8,t),k=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(_(r[0],-m,0,t),_(r[1],0,m,t),N=r[0],C=r[1]):(_(r,-m,m,t),N=-(C=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)_(r[0],-m,-1,t),_(r[1],1,m,t),j=r[0],D=r[1];else{if(_(r,-m,m,t),!r)throw Error(u+t+" cannot be zero: "+r);j=-(D=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(u+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(_(r=e[t],0,9,t),B=r),e.hasOwnProperty(t="POW_PRECISION")&&(_(r=e[t],0,m,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(u+t+" not an object: "+r);K=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);G="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:L,ROUNDING_MODE:k,EXPONENTIAL_AT:[N,C],RANGE:[j,D],CRYPTO:U,MODULO_MODE:B,POW_PRECISION:F,FORMAT:K,ALPHABET:H}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-m&&i<=m&&i===c(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%d)<1&&(t+=d),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=f||r!==c(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(u+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return z(arguments,-1)},$.minimum=$.min=function(){return z(arguments,1)},$.random=(o=9007199254740992,S=Math.random()*o&2097151?function(){return c(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,s=0,l=[],f=new $(M);if(null==e?e=L:_(e,0,m),i=a(e/d),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(l.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw U=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(l.push(o%1e14),s+=7);s=i/7}if(!U)for(;s<i;)(o=S())<9e15&&(l[s++]=o%1e14);for(i=l[--s],e%=d,i&&e&&(o=p[d-e],l[s]=c(i/o)*o);0===l[s];l.pop(),s--);if(s<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=d);for(s=1,o=l[0];o>=10;o/=10,s++);s<d&&(n-=d-s)}return f.e=n,f.c=l,f}),$.sum=function(){for(var e=1,t=arguments,r=new $(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,c=e.length;a<c;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var c,u,l,f,d,h,p,b,m=n.indexOf("."),g=L,y=k;for(m>=0&&(f=F,F=0,n=n.replace(".",""),h=(b=new $(i)).pow(n.length-m),F=f,b.c=t(O(v(h.c),h.e,"0"),10,o,e),b.e=b.c.length),l=f=(p=t(n,i,o,a?(c=H,e):(c=e,H))).length;0==p[--f];p.pop());if(!p[0])return c.charAt(0);if(m<0?--l:(h.c=p,h.e=l,h.s=s,p=(h=r(h,b,g,y,o)).c,d=h.r,l=h.e),m=p[u=l+g+1],f=o/2,d=d||u<0||null!=p[u+1],d=y<4?(null!=m||d)&&(0==y||y==(h.s<0?3:2)):m>f||m==f&&(4==y||d||6==y&&1&p[u-1]||y==(h.s<0?8:7)),u<1||!p[0])n=d?O(c.charAt(1),-g,c.charAt(0)):c.charAt(0);else{if(p.length=u,d)for(--o;++p[--u]>o;)p[u]=0,u||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(m=0,n="";m<=f;n+=c.charAt(p[m++]));n=O(n,l,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,c=e.length,u=t%b,l=t/b|0;for(e=e.slice();c--;)a=((i=u*(o=e[c]%b)+(n=l*o+(s=e[c]/b|0)*u)%b*b+a)/r|0)+(n/b|0)+l*s,e[c]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,s,a){var u,l,h,p,b,m,v,y,_,w,E,O,S,A,P,T,R,x=n.s==i.s?1:-1,I=n.c,M=i.c;if(!(I&&I[0]&&M&&M[0]))return new $(n.s&&i.s&&(I?!M||I[0]!=M[0]:M)?I&&0==I[0]||!M?0*x:x/0:NaN);for(_=(y=new $(x)).c=[],x=o+(l=n.e-i.e)+1,a||(a=f,l=g(n.e/d)-g(i.e/d),x=x/d|0),h=0;M[h]==(I[h]||0);h++);if(M[h]>(I[h]||0)&&l--,x<0)_.push(1),p=!0;else{for(A=I.length,T=M.length,h=0,x+=2,(b=c(a/(M[0]+1)))>1&&(M=e(M,b,a),I=e(I,b,a),T=M.length,A=I.length),S=T,E=(w=I.slice(0,T)).length;E<T;w[E++]=0);R=M.slice(),R=[0].concat(R),P=M[0],M[1]>=a/2&&P++;do{if(b=0,(u=t(M,w,T,E))<0){if(O=w[0],T!=E&&(O=O*a+(w[1]||0)),(b=c(O/P))>1)for(b>=a&&(b=a-1),v=(m=e(M,b,a)).length,E=w.length;1==t(m,w,v,E);)b--,r(m,T<v?R:M,v,a),v=m.length,u=1;else 0==b&&(u=b=1),v=(m=M.slice()).length;if(v<E&&(m=[0].concat(m)),r(w,m,E,a),E=w.length,-1==u)for(;t(M,w,T,E)<1;)b++,r(w,T<E?R:M,E,a),E=w.length}else 0===u&&(b++,w=[0]);_[h++]=b,w[0]?w[E++]=I[S]||0:(w=[I[S]],E=1)}while((S++<A||null!=w[0])&&x--);p=null!=w[0],_[0]||_.splice(0,1)}if(a==f){for(h=1,x=_[0];x>=10;x/=10,h++);W(y,o+(y.e=h+l*d-1)+1,s,p)}else y.e=l,y.r=+p;return y}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,P=/^([^.]+)\.$/,T=/^\.([^.]+)$/,R=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(x,"");if(R.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(A,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(P,"$1").replace(T,"0.$1")),t!=o))return new $(o,i);if($.DEBUG)throw Error(u+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},I.absoluteValue=I.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},I.comparedTo=function(e,t){return y(this,new $(e,t))},I.decimalPlaces=I.dp=function(e,t){var r,n,i,o=this;if(null!=e)return _(e,0,m),null==t?t=k:_(t,0,8),W(new $(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-g(this.e/d))*d,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},I.dividedBy=I.div=function(e,t){return r(this,new $(e,t),L,k)},I.dividedToIntegerBy=I.idiv=function(e,t){return r(this,new $(e,t),0,1)},I.exponentiatedBy=I.pow=function(e,t){var r,n,i,o,s,l,f,h,p=this;if((e=new $(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new $(t)),s=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new $(Math.pow(+Z(p),s?e.s*(2-w(e)):+Z(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new $(NaN);(n=!l&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||s&&p.c[1]>=24e7:p.c[0]<8e13||s&&p.c[0]<=9999975e7)))return o=p.s<0&&w(e)?-0:0,p.e>-1&&(o=1/o),new $(l?1/o:o);F&&(o=a(F/d+2))}for(s?(r=new $(.5),l&&(e.s=1),f=w(e)):f=(i=Math.abs(+Z(e)))%2,h=new $(M);;){if(f){if(!(h=h.times(p)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}if(i){if(0===(i=c(i/2)))break;f=i%2}else if(W(e=e.times(r),e.e+1,1),e.e>14)f=w(e);else{if(0===(i=+Z(e)))break;f=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}return n?h:(l&&(h=M.div(h)),t?h.mod(t):o?W(h,F,k,undefined):h)},I.integerValue=function(e){var t=new $(this);return null==e?e=k:_(e,0,8),W(t,t.e+1,e)},I.isEqualTo=I.eq=function(e,t){return 0===y(this,new $(e,t))},I.isFinite=function(){return!!this.c},I.isGreaterThan=I.gt=function(e,t){return y(this,new $(e,t))>0},I.isGreaterThanOrEqualTo=I.gte=function(e,t){return 1===(t=y(this,new $(e,t)))||0===t},I.isInteger=function(){return!!this.c&&g(this.e/d)>this.c.length-2},I.isLessThan=I.lt=function(e,t){return y(this,new $(e,t))<0},I.isLessThanOrEqualTo=I.lte=function(e,t){return-1===(t=y(this,new $(e,t)))||0===t},I.isNaN=function(){return!this.s},I.isNegative=function(){return this.s<0},I.isPositive=function(){return this.s>0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new $(e,t)).s,!a||!t)return new $(NaN);if(a!=t)return e.s=-t,s.plus(e);var c=s.e/d,u=e.e/d,l=s.c,h=e.c;if(!c||!u){if(!l||!h)return l?(e.s=-t,e):new $(h?s:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new $(l[0]?s:3==k?-0:0)}if(c=g(c),u=g(u),l=l.slice(),a=c-u){for((o=a<0)?(a=-a,i=l):(u=c,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=l.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(l[t]!=h[t]){o=l[t]<h[t];break}if(o&&(i=l,l=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=f-1;n>a;){if(l[--n]<h[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=f}l[n]-=h[n]}for(;0==l[0];l.splice(0,1),--u);return l[0]?q(e,l,u):(e.s=3==k?-1:1,e.c=[e.e=0],e)},I.modulo=I.mod=function(e,t){var n,i,o=this;return e=new $(e,t),!o.c||!e.s||e.c&&!e.c[0]?new $(NaN):!e.c||o.c&&!o.c[0]?new $(o):(9==B?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,B),(e=o.minus(n.times(e))).c[0]||1!=B||(e.s=o.s),e)},I.multipliedBy=I.times=function(e,t){var r,n,i,o,s,a,c,u,l,h,p,m,v,y,_,w=this,E=w.c,O=(e=new $(e,t)).c;if(!(E&&O&&E[0]&&O[0]))return!w.s||!e.s||E&&!E[0]&&!O||O&&!O[0]&&!E?e.c=e.e=e.s=null:(e.s*=w.s,E&&O?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=g(w.e/d)+g(e.e/d),e.s*=w.s,(c=E.length)<(h=O.length)&&(v=E,E=O,O=v,i=c,c=h,h=i),i=c+h,v=[];i--;v.push(0));for(y=f,_=b,i=h;--i>=0;){for(r=0,p=O[i]%_,m=O[i]/_|0,o=i+(s=c);o>i;)r=((u=p*(u=E[--s]%_)+(a=m*u+(l=E[s]/_|0)*p)%_*_+v[o]+r)/y|0)+(a/_|0)+m*l,v[o--]=u%y;v[o]=r}return r?++n:v.splice(0,1),q(e,v,n)},I.negated=function(){var e=new $(this);return e.s=-e.s||null,e},I.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new $(e,t)).s,!i||!t)return new $(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/d,s=e.e/d,a=n.c,c=e.c;if(!o||!s){if(!a||!c)return new $(i/0);if(!a[0]||!c[0])return c[0]?e:new $(a[0]?n:0*i)}if(o=g(o),s=g(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=c):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=c.length)<0&&(r=c,c=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+c[t]+i)/f|0,a[t]=f===a[t]?0:a[t]%f;return i&&(a=[i].concat(a),++s),q(e,a,s)},I.precision=I.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return _(e,1,m),null==t?t=k:_(t,0,8),W(new $(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*d+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},I.shiftedBy=function(e){return _(e,-9007199254740991,h),this.times("1e"+e)},I.squareRoot=I.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,c=s.s,u=s.e,l=L+4,f=new $("0.5");if(1!==c||!a||!a[0])return new $(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(c=Math.sqrt(+Z(s)))||c==1/0?(((t=v(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=g((u+1)/2)-(u<0||u%2),n=new $(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new $(c+""),n.c[0])for((c=(u=n.e)+l)<3&&(c=0);;)if(o=n,n=f.times(o.plus(r(s,o,l,1))),v(o.c).slice(0,c)===(t=v(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(W(n,n.e+L+2,1),e=!n.times(n).eq(s));break}if(!i&&(W(o,o.e+L+2,0),o.times(o).eq(s))){n=o;break}l+=4,c+=4,i=1}return W(n,n.e+L+1,k,e)},I.toExponential=function(e,t){return null!=e&&(_(e,0,m),e++),V(this,e,t,1)},I.toFixed=function(e,t){return null!=e&&(_(e,0,m),e=e+this.e+1),V(this,e,t)},I.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=K;else if("object"!=typeof r)throw Error(u+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,s=n.split("."),a=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",f=s[0],d=s[1],h=i.s<0,p=h?f.slice(1):f,b=p.length;if(c&&(o=a,a=c,c=o,b-=o),a>0&&b>0){for(o=b%a||a,f=p.substr(0,o);o<b;o+=a)f+=l+p.substr(o,a);c>0&&(f+=l+p.slice(o)),h&&(f="-"+f)}n=d?f+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):f}return(r.prefix||"")+n+(r.suffix||"")},I.toFraction=function(e){var t,n,i,o,s,a,c,l,f,h,b,m,g=this,y=g.c;if(null!=e&&(!(c=new $(e)).isInteger()&&(c.c||1!==c.s)||c.lt(M)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+Z(c));if(!y)return new $(g);for(t=new $(M),f=n=new $(M),i=l=new $(M),m=v(y),s=t.e=m.length-g.e-1,t.c[0]=p[(a=s%d)<0?d+a:a],e=!e||c.comparedTo(t)>0?s>0?t:f:c,a=D,D=1/0,c=new $(m),l.c[0]=0;h=r(c,t,0,1),1!=(o=n.plus(h.times(i))).comparedTo(e);)n=i,i=o,f=l.plus(h.times(o=f)),l=o,t=c.minus(h.times(o=t)),c=o;return o=r(e.minus(n),i,0,1),l=l.plus(o.times(f)),n=n.plus(o.times(i)),l.s=f.s=g.s,b=r(f,i,s*=2,k).minus(g).abs().comparedTo(r(l,n,s,k).minus(g).abs())<1?[f,i]:[l,n],D=a,b},I.toNumber=function(){return+Z(this)},I.toPrecision=function(e,t){return null!=e&&_(e,1,m),V(this,e,t,2)},I.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=N||o>=C?E(v(r.c),o):O(v(r.c),o,"0"):10===e&&G?t=O(v((r=W(new $(r),L+o+1,k)).c),r.e,"0"):(_(e,2,H.length,"Base"),t=n(O(v(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},I.valueOf=I.toJSON=function(){return Z(this)},I._isBigNumber=!0,null!=t&&$.set(t),$}(),o.default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},651:(e,t,r)=>{const n=r(7967);function i(e,t,r){const n=e[t]+e[r];let i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function o(e,t,r,n){let i=e[t]+r;r<0&&(i+=4294967296);let o=e[t+1]+n;i>=4294967296&&o++,e[t]=i,e[t+1]=o}function s(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,n,s,a){const c=f[s],u=f[s+1],d=f[a],h=f[a+1];i(l,e,t),o(l,e,c,u);let p=l[n]^l[e],b=l[n+1]^l[e+1];l[n]=b,l[n+1]=p,i(l,r,n),p=l[t]^l[r],b=l[t+1]^l[r+1],l[t]=p>>>24^b<<8,l[t+1]=b>>>24^p<<8,i(l,e,t),o(l,e,d,h),p=l[n]^l[e],b=l[n+1]^l[e+1],l[n]=p>>>16^b<<16,l[n+1]=b>>>16^p<<16,i(l,r,n),p=l[t]^l[r],b=l[t+1]^l[r+1],l[t]=b>>>31^p<<1,l[t+1]=p>>>31^b<<1}const c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),l=new Uint32Array(32),f=new Uint32Array(32);function d(e,t){let r=0;for(r=0;r<16;r++)l[r]=e.h[r],l[r+16]=c[r];for(l[24]=l[24]^e.t,l[25]=l[25]^e.t/4294967296,t&&(l[28]=~l[28],l[29]=~l[29]),r=0;r<32;r++)f[r]=s(e.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,u[16*r+0],u[16*r+1]),a(2,10,18,26,u[16*r+2],u[16*r+3]),a(4,12,20,28,u[16*r+4],u[16*r+5]),a(6,14,22,30,u[16*r+6],u[16*r+7]),a(0,10,20,30,u[16*r+8],u[16*r+9]),a(2,12,22,24,u[16*r+10],u[16*r+11]),a(4,14,16,26,u[16*r+12],u[16*r+13]),a(6,8,18,28,u[16*r+14],u[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^l[r]^l[r+16]}const h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,t,r,n){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(n&&16!==n.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};h.fill(0),h[0]=e,t&&(h[1]=t.length),h[2]=1,h[3]=1,r&&h.set(r,32),n&&h.set(n,48);for(let e=0;e<16;e++)i.h[e]=c[e]^s(h,4*e);return t&&(b(i,t),i.c=128),i}function b(e,t){for(let r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,d(e,!1),e.c=0),e.b[e.c++]=t[r]}function m(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;d(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function g(e,t,r,i,o){r=r||64,e=n.normalizeInput(e),i&&(i=n.normalizeInput(i)),o&&(o=n.normalizeInput(o));const s=p(r,t,i,o);return b(s,e),m(s)}e.exports={blake2b:g,blake2bHex:function(e,t,r,i,o){const s=g(e,t,r,i,o);return n.toHex(s)},blake2bInit:p,blake2bUpdate:b,blake2bFinal:m}},9962:(e,t,r)=>{const n=r(7967);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,t,r,n,i,o){u[e]=u[e]+u[t]+i,u[n]=s(u[n]^u[e],16),u[r]=u[r]+u[n],u[t]=s(u[t]^u[r],12),u[e]=u[e]+u[t]+o,u[n]=s(u[n]^u[e],8),u[r]=u[r]+u[n],u[t]=s(u[t]^u[r],7)}function s(e,t){return e>>>t^e<<32-t}const a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),u=new Uint32Array(16),l=new Uint32Array(16);function f(e,t){let r=0;for(r=0;r<8;r++)u[r]=e.h[r],u[r+8]=a[r];for(u[12]^=e.t,u[13]^=e.t/4294967296,t&&(u[14]=~u[14]),r=0;r<16;r++)l[r]=i(e.b,4*r);for(r=0;r<10;r++)o(0,4,8,12,l[c[16*r+0]],l[c[16*r+1]]),o(1,5,9,13,l[c[16*r+2]],l[c[16*r+3]]),o(2,6,10,14,l[c[16*r+4]],l[c[16*r+5]]),o(3,7,11,15,l[c[16*r+6]],l[c[16*r+7]]),o(0,5,10,15,l[c[16*r+8]],l[c[16*r+9]]),o(1,6,11,12,l[c[16*r+10]],l[c[16*r+11]]),o(2,7,8,13,l[c[16*r+12]],l[c[16*r+13]]),o(3,4,9,14,l[c[16*r+14]],l[c[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=u[r]^u[r+8]}function d(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const n={h:new Uint32Array(a),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(h(n,t),n.c=64),n}function h(e,t){for(let r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,f(e,!1),e.c=0),e.b[e.c++]=t[r]}function p(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;f(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function b(e,t,r){r=r||32,e=n.normalizeInput(e);const i=d(r,t);return h(i,e),p(i)}e.exports={blake2s:b,blake2sHex:function(e,t,r){const i=b(e,t,r);return n.toHex(i)},blake2sInit:d,blake2sUpdate:h,blake2sFinal:p}},1395:(e,t,r)=>{const n=r(651),i=r(9962);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},7967:e=>{function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,r,n){let i="\n"+e+" = ";for(let o=0;o<r.length;o+=2){if(32===n)i+=t(r[o]).toUpperCase(),i+=" ",i+=t(r[o+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);i+=t(r[o+1]).toUpperCase(),i+=t(r[o]).toUpperCase()}o%6==4?i+="\n"+new Array(e.length+4).join(" "):o<r.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){let n=(new Date).getTime();const i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=e%256;const o=(new Date).getTime();console.log("Generated random input in "+(o-n)+"ms"),n=o;for(let o=0;o<r;o++){const r=e(i),o=(new Date).getTime(),s=o-n;n=o,console.log("Hashed in "+s+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(s/1e3)*100)/100+" MB PER SECOND")}}}},2197:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(3196).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l<a;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var f=1;for(c=u(e,l,e.length,t),l=0;l<s;l++)f*=t;this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,f=67108863&c,d=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=d;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?l[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=f[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?b+r:l[u-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a<o;a++)u[a]=0}else{for(a=0;a<o-i;a++)u[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[o-a-1]=s}return u},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],f=8191&l,d=l>>>13,h=0|s[1],p=8191&h,b=h>>>13,m=0|s[2],g=8191&m,v=m>>>13,y=0|s[3],_=8191&y,w=y>>>13,E=0|s[4],O=8191&E,S=E>>>13,A=0|s[5],P=8191&A,T=A>>>13,R=0|s[6],x=8191&R,I=R>>>13,M=0|s[7],L=8191&M,k=M>>>13,N=0|s[8],C=8191&N,j=N>>>13,D=0|s[9],U=8191&D,B=D>>>13,F=0|a[0],K=8191&F,H=F>>>13,G=0|a[1],$=8191&G,V=G>>>13,z=0|a[2],q=8191&z,W=z>>>13,Z=0|a[3],J=8191&Z,Y=Z>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],fe=8191&le,de=le>>>13,he=0|a[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(u+(n=Math.imul(f,K))|0)+((8191&(i=(i=Math.imul(f,H))+Math.imul(d,K)|0))<<13)|0;u=((o=Math.imul(d,H))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,H))+Math.imul(b,K)|0,o=Math.imul(b,H);var ge=(u+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,K),i=(i=Math.imul(g,H))+Math.imul(v,K)|0,o=Math.imul(v,H),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,V)|0;var ve=(u+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,q)|0))<<13)|0;u=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,K),i=(i=Math.imul(_,H))+Math.imul(w,K)|0,o=Math.imul(w,H),n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,W)|0;var ye=(u+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,J)|0))<<13)|0;u=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(O,K),i=(i=Math.imul(O,H))+Math.imul(S,K)|0,o=Math.imul(S,H),n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,V)|0,n=n+Math.imul(g,q)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,Y)|0;var _e=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;u=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,H))+Math.imul(T,K)|0,o=Math.imul(T,H),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(_,q)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,q)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var we=(u+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,K),i=(i=Math.imul(x,H))+Math.imul(I,K)|0,o=Math.imul(I,H),n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,V)|0,n=n+Math.imul(O,q)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,Y)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ee=(u+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,se)|0)+Math.imul(d,oe)|0))<<13)|0;u=((o=o+Math.imul(d,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,H))+Math.imul(k,K)|0,o=Math.imul(k,H),n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(P,q)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,Y)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0;var Oe=(u+(n=n+Math.imul(f,ce)|0)|0)+((8191&(i=(i=i+Math.imul(f,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((o=o+Math.imul(d,ue)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(C,K),i=(i=Math.imul(C,H))+Math.imul(j,K)|0,o=Math.imul(j,H),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(x,q)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Se=(u+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;u=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,H))+Math.imul(B,K)|0,o=Math.imul(B,H),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,se)|0,n=n+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(v,ce)|0,o=o+Math.imul(v,ue)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,de)|0;var Ae=(u+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,be)|0)+Math.imul(d,pe)|0))<<13)|0;u=((o=o+Math.imul(d,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,V))+Math.imul(B,$)|0,o=Math.imul(B,V),n=n+Math.imul(C,q)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,Y)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(_,ce)|0,i=(i=i+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,o=o+Math.imul(w,ue)|0,n=n+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Pe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,W))+Math.imul(B,q)|0,o=Math.imul(B,W),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(w,fe)|0,o=o+Math.imul(w,de)|0;var Te=(u+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;u=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,Y))+Math.imul(B,J)|0,o=Math.imul(B,Y),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,se)|0,n=n+Math.imul(P,ce)|0,i=(i=i+Math.imul(P,ue)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,ue)|0,n=n+Math.imul(O,fe)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,de)|0;var Re=(u+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,be)|0)+Math.imul(w,pe)|0))<<13)|0;u=((o=o+Math.imul(w,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(B,Q)|0,o=Math.imul(B,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,de)|0;var xe=(u+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(B,re)|0,o=Math.imul(B,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,se)|0,n=n+Math.imul(L,ce)|0,i=(i=i+Math.imul(L,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(I,fe)|0,o=o+Math.imul(I,de)|0;var Ie=(u+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,be)|0)+Math.imul(T,pe)|0))<<13)|0;u=((o=o+Math.imul(T,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,se))+Math.imul(B,oe)|0,o=Math.imul(B,se),n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(j,ce)|0,o=o+Math.imul(j,ue)|0,n=n+Math.imul(L,fe)|0,i=(i=i+Math.imul(L,de)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,de)|0;var Me=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,ce),i=(i=Math.imul(U,ue))+Math.imul(B,ce)|0,o=Math.imul(B,ue),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,de)|0;var Le=(u+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,be)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(U,fe),i=(i=Math.imul(U,de))+Math.imul(B,fe)|0,o=Math.imul(B,de);var ke=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(j,pe)|0))<<13)|0;u=((o=o+Math.imul(j,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Ne=(u+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,be))+Math.imul(B,pe)|0))<<13)|0;return u=((o=Math.imul(B,be))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c[0]=me,c[1]=ge,c[2]=ve,c[3]=ye,c[4]=_e,c[5]=we,c[6]=Ee,c[7]=Oe,c[8]=Se,c[9]=Ae,c[10]=Pe,c[11]=Te,c[12]=Re,c[13]=xe,c[14]=Ie,c[15]=Me,c[16]=Le,c[17]=ke,c[18]=Ne,0!==u&&(c[19]=u,r.length++),r};function b(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=h),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,f=(0|e.words[l])*(0|t.words[u]),d=67108863&f;a=67108863&(d=d+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):b(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},m.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var f=c,d=u,h=0;h<s;h++){var p=r[l+h],b=n[l+h],m=r[l+h+s],g=n[l+h+s],v=f*m-d*g;g=f*g+d*m,m=v,r[l+h]=p+m,n[l+h]=b+g,r[l+h+s]=p-m,n[l+h+s]=b-g,h!==a&&(v=c*f-u*d,d=c*d+u*f,f=v)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,u,n),this.transform(s,o,a,c,n,i),this.transform(u,o,l,f,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-c[h]*f[h];c[h]=a[h]*f[h]+c[h]*l[h],a[h]=p}return this.conjugate(a,c,n),this.transform(a,c,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<r;this.words[t]=c|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=r;if(i-=s,i=Math.max(0,i),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var c=(0|e.words[i])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var f=c-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=d)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(f)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(c)):(r.isub(t),a.isub(i),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new O(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(y,v),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(_,v),i(w,v),i(E,v),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new _;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return g[e]=t,t},O.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var b=h,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var g=this.pow(f,new o(1).iushln(p-m-1));d=d.redMul(g),f=g.redSqr(),h=h.redMul(f),p=m}return d},O.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},O.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var f=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new S(e)},i(S,O),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},2745:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(8087);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},7022:(e,t,r)=>{var n=r(8166);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8616:(e,t,r)=>{"use strict";var n=r(7022),i=r(7834).Buffer;e.exports=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=e(t);return n.encode(i.concat([t,r],t.length+4))},decode:function(e){var r=t(n.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=n.decodeUnsafe(e);if(r)return t(r)}}}},4075:(e,t,r)=>{"use strict";var n=r(6162),i=r(8616);e.exports=i((function(e){var t=n("sha256").update(e).digest();return n("sha256").update(t).digest()}))},8834:(e,t,r)=>{"use strict";const n=r(5766),i=r(2333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|b(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||J(e.length)?a(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function b(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function _(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(J(n))return s;e[r+s]=n}return s}function w(e,t,r,n){return W(z(t,e.length-r),e,r,n)}function E(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function O(e,t,r,n){return W(q(t),e,r,n)}function S(e,t,r,n){return W(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=T));return r}(n)}t.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},c.allocUnsafe=function(e){return f(e)},c.allocUnsafeSlow=function(e){return f(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Z(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=b,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?P(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==l[e]){o=u[e],s=l[e];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function x(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function I(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function M(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function L(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function N(e,t,r,n,i){H(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function C(e,t,r,n,i){H(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return t=+t,r>>>=0,o||j(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,o){return t=+t,r>>>=0,o||j(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){k(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){k(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=X((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=X((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=X((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=X((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const B={};function F(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function K(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,i,o)}function G(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw G(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=K(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=K(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},3973:(e,t,r)=>{var n=r(7834).Buffer,i=r(4851).Transform,o=r(214).s;function s(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(1285)(s,i),s.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},s.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=s},6162:(e,t,r)=>{"use strict";var n=r(1285),i=r(7993),o=r(1445),s=r(9065),a=r(3973);function c(e){a.call(this,"digest"),this._hash=e}n(c,a),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new c(s(e))}},7554:(e,t,r)=>{"use strict";var n=t;n.version=r(763).i8,n.utils=r(8288),n.rand=r(2745),n.curve=r(8610),n.curves=r(1479),n.ec=r(8596),n.eddsa=r(9208)},8919:(e,t,r)=>{"use strict";var n=r(2197),i=r(8288),o=i.getNAF,s=i.getJSF,a=i.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,c,u=[];for(s=0;s<n.length;s+=r.step){c=0;for(var l=s+r.step-1;l>=s;l--)c=(c<<1)+n[l];u.push(c)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(s=0;s<u.length;s++)(c=u[s])===h?d=d.mixedAdd(r.points[s]):c===-h&&(d=d.mixedAdd(r.points[s].neg()));f=f.add(d)}return f.toP()},c.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(t,r,this._bitLength),c=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(var l=0;u>=0&&0===s[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var f=s[u];a(0!==f),c="affine"===e.type?f>0?c.mixedAdd(i[f-1>>1]):c.mixedAdd(i[-f-1>>1].neg()):f>0?c.add(i[f-1>>1]):c.add(i[-f-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){var a,c,u,l=this._wnafT1,f=this._wnafT2,d=this._wnafT3,h=0;for(a=0;a<n;a++){var p=(u=t[a])._getNAFPoints(e);l[a]=p.wnd,f[a]=p.points}for(a=n-1;a>=1;a-=2){var b=a-1,m=a;if(1===l[b]&&1===l[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=s(r[b],r[m]);for(h=Math.max(y[0].length,h),d[b]=new Array(h),d[m]=new Array(h),c=0;c<h;c++){var _=0|y[0][c],w=0|y[1][c];d[b][c]=v[3*(_+1)+(w+1)],d[m][c]=0,f[b]=g}}else d[b]=o(r[b],l[b],this._bitLength),d[m]=o(r[m],l[m],this._bitLength),h=Math.max(d[b].length,h),h=Math.max(d[m].length,h)}var E=this.jpoint(null,null,null),O=this._wnafT4;for(a=h;a>=0;a--){for(var S=0;a>=0;){var A=!0;for(c=0;c<n;c++)O[c]=0|d[c][a],0!==O[c]&&(A=!1);if(!A)break;S++,a--}if(a>=0&&S++,E=E.dblp(S),a<0)break;for(c=0;c<n;c++){var P=O[c];0!==P&&(P>0?u=f[c][P-1>>1]:P<0&&(u=f[c][-P-1>>1].neg()),E="affine"===u.type?E.mixedAdd(u):E.add(u))}}for(a=0;a<n;a++)f[a]=null;return i?E:E.toP()},c.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(e){return this.encode(e,!0)},u.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},u.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},u.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},u.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},u.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},7105:(e,t,r)=>{"use strict";var n=r(8288),i=r(2197),o=r(1285),s=r(8919),a=n.assert;function c(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function u(e,t,r,n,o){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(c,s),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)},c.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(u,s.BasePoint),c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},c.prototype.point=function(e,t,r,n){return new u(this,e,t,r,n)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),c=i.redMul(s),u=o.redMul(a),l=i.redMul(a),f=s.redMul(o);return this.curve.point(c,u,f,l)},u.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(e=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=s.redSub(a).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=a.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),c=r.redAdd(t),u=o.redMul(s),l=a.redMul(c),f=o.redMul(c),d=s.redMul(a);return this.curve.point(u,l,d,f)},u.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),c=i.redSub(a),u=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),f=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(f,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},8610:(e,t,r)=>{"use strict";var n=t;n.base=r(8919),n.short=r(7715),n.mont=r(5125),n.edwards=r(7105)},5125:(e,t,r)=>{"use strict";var n=r(2197),i=r(1285),o=r(8919),s=r(8288);function a(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(c,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new c(this,e,t)},a.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},7715:(e,t,r)=>{"use strict";var n=r(8288),i=r(2197),o=r(1285),s=r(8919),a=n.assert;function c(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(c,s),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,c,u,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new i(1),b=new i(0),m=new i(0),g=new i(1),v=0;0!==d.cmpn(0);){var y=h.div(d);u=h.sub(y.mul(d)),l=m.sub(y.mul(p));var _=g.sub(y.mul(b));if(!n&&u.cmp(f)<0)t=c.neg(),r=p,n=u.neg(),o=l;else if(n&&2==++v)break;c=u,h=d,d=u,m=p,p=l,g=b,b=_}s=u.neg(),a=l;var w=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(w)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*o]=a,n[2*o+1]=c,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return u},o(u,s.BasePoint),c.prototype.point=function(e,t,r){return new u(this,e,t,r)},c.prototype.pointFromJSON=function(e,t){return u.fromJSON(this,e,t)},u.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),c.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),f=n.redMul(u),d=c.redSqr().redIAdd(l).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,h,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),f=a.redSqr().redIAdd(u).redISub(l).redISub(l),d=a.redMul(l.redISub(f)).redISub(i.redMul(u)),h=this.z.redMul(s);return this.curve.jpoint(f,d,h)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),f=u.redSqr(),d=f.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(f),b=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=h.redMul(m);g=g.redIAdd(g).redISub(d);var v=u.redMul(a);t+1<e&&(c=c.redMul(d)),o=b,a=v,u=g}return this.curve.jpoint(o,u.redMul(i),a)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),f=this.y.redSqr(),d=f.redSqr(),h=this.x.redAdd(f).redSqr().redISub(l).redISub(d);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),b=p.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},l.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),f=this.y.redSqr(),d=this.x.redMul(f),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(l);var m=f.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},l.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),f=u.redISub(l),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=a.redMul(f).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.x.redMul(a).redISub(l);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(f,d,h)},l.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},l.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},l.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},1479:(e,t,r)=>{"use strict";var n,i=t,o=r(3506),s=r(8610),a=r(8288).assert;function c(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(7983)}catch(e){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},8596:(e,t,r)=>{"use strict";var n=r(2197),i=r(8873),o=r(8288),s=r(1479),a=r(2745),c=o.assert,u=r(2307),l=r(1798);function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=f,f.prototype.keyPair=function(e){return new u(this,e)},f.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),c=e.toArray("be",s),u=new i({hash:this.hash,entropy:a,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),d=0;;d++){var h=o.k?o.k(d):new n(u.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(f)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var g=h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),v^=1),new l({r:m,s:g,recoveryParam:v})}}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new l(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(e).umod(this.n),f=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(e,t,r,i){c((3&r)===r,"The recovery param is more than two bits"),t=new l(t,i);var o=this.n,s=new n(e),a=t.r,u=t.s,f=1&r,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var h=t.r.invm(o),p=o.sub(s).mul(h).umod(o),b=u.mul(h).umod(o);return this.g.mulAdd(p,a,b)},f.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new l(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},2307:(e,t,r)=>{"use strict";var n=r(2197),i=r(8288).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},1798:(e,t,r)=>{"use strict";var n=r(2197),i=r(8288),o=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function u(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function l(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=c(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=c(e,r);if(!1===s)return!1;var u=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var l=c(e,r);if(!1===l)return!1;if(e.length!==l+r.place)return!1;var f=e.slice(r.place,l+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(u),this.s=new n(f),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,e)}},9208:(e,t,r)=>{"use strict";var n=r(3506),i=r(1479),o=r(8288),s=o.assert,a=o.parseBytes,c=r(851),u=r(6117);function l(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=l,l.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),c=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},l.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(e){return c.fromPublic(this,e)},l.prototype.keyFromSecret=function(e){return c.fromSecret(this,e)},l.prototype.makeSignature=function(e){return e instanceof u?e:new u(this,e)},l.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},l.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},l.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(e){return o.intFromLE(e)},l.prototype.isPoint=function(e){return e instanceof this.pointClass}},851:(e,t,r)=>{"use strict";var n=r(8288),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},6117:(e,t,r)=>{"use strict";var n=r(2197),i=r(8288),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function c(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},7983:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},8288:(e,t,r)=>{"use strict";var n=t,i=r(2197),o=r(9561),s=r(3022);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,c=o.andln(i-1);o.isOdd()?(a=c>(i>>1)-1?(i>>1)-c:c,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(s),a=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},2699:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}b(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&b(e,"error",t,r)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,o,s,u;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function b(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,l=p(c,u);for(r=0;r<u;++r)n(l[r],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},o.prototype.listenerCount=h,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},5695:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},o={key:n,value:e[n]};return r(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,s;if(Array.isArray(t)){for(s="[",r=0;r<t.length;r++)r&&(s+=","),s+=e(t[r])||"null";return s+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=o.push(t)-1,c=Object.keys(t).sort(i&&i(t));for(s="",r=0;r<c.length;r++){var u=c[r],l=e(t[u]);l&&(s&&(s+=","),s+=JSON.stringify(u)+":"+l)}return o.splice(a,1),"{"+s+"}"}}(e)}},4485:(e,t,r)=>{"use strict";var n=r(7834).Buffer,i=r(696).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(1285)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var s=0,a=8*e.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},3506:(e,t,r)=>{var n=t;n.utils=r(212),n.common=r(4495),n.sha=r(5530),n.ripemd=r(1396),n.hmac=r(5047),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},4495:(e,t,r)=>{"use strict";var n=r(212),i=r(9561);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},5047:(e,t,r)=>{"use strict";var n=r(212),i=r(9561);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},1396:(e,t,r)=>{"use strict";var n=r(212),i=r(4495),o=n.rotl32,s=n.sum32,a=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(l,u),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],l=this.h[4],v=r,y=n,_=i,w=u,E=l,O=0;O<80;O++){var S=s(o(c(r,f(O,n,i,u),e[p[O]+t],d(O)),m[O]),l);r=l,l=u,u=o(i,10),i=n,n=S,S=s(o(c(v,f(79-O,y,_,w),e[b[O]+t],h(O)),g[O]),E),v=E,E=w,w=o(_,10),_=y,y=S}S=a(this.h[1],i,w),this.h[1]=a(this.h[2],u,E),this.h[2]=a(this.h[3],l,v),this.h[3]=a(this.h[4],r,y),this.h[4]=a(this.h[0],n,_),this.h[0]=S},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},5530:(e,t,r)=>{"use strict";t.sha1=r(5079),t.sha224=r(3823),t.sha256=r(8032),t.sha384=r(5328),t.sha512=r(168)},5079:(e,t,r)=>{"use strict";var n=r(212),i=r(4495),o=r(713),s=n.rotl32,a=n.sum32,c=n.sum32_5,u=o.ft_1,l=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,l),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],l=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=c(s(i,5),u(p,o,l,d),h,r[n],f[p]);h=d,d=l,l=s(o,30),o=i,i=b}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],l),this.h[3]=a(this.h[3],d),this.h[4]=a(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},3823:(e,t,r)=>{"use strict";var n=r(212),i=r(8032);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},8032:(e,t,r)=>{"use strict";var n=r(212),i=r(4495),o=r(713),s=r(9561),a=n.sum32,c=n.sum32_4,u=n.sum32_5,l=o.ch32,f=o.maj32,d=o.s0_256,h=o.s1_256,p=o.g0_256,b=o.g1_256,m=i.BlockHash,g=[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];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(v,m),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=c(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],m=this.h[2],g=this.h[3],v=this.h[4],y=this.h[5],_=this.h[6],w=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=u(w,h(v),l(v,y,_),this.k[n],r[n]),O=a(d(i),f(i,o,m));w=_,_=y,y=v,v=a(g,E),g=m,m=o,o=i,i=a(E,O)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],m),this.h[3]=a(this.h[3],g),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],y),this.h[6]=a(this.h[6],_),this.h[7]=a(this.h[7],w)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},5328:(e,t,r)=>{"use strict";var n=r(212),i=r(168);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},168:(e,t,r)=>{"use strict";var n=r(212),i=r(4495),o=r(9561),s=n.rotr64_hi,a=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,l=n.sum64,f=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,m=n.sum64_5_lo,g=i.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function _(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function w(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function O(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function S(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function P(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function R(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}function M(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(y,g),e.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=I(r[n-4],r[n-3]),o=M(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=R(r[n-30],r[n-29]),u=x(r[n-30],r[n-29]),l=r[n-32],f=r[n-31];r[n]=h(i,o,s,a,c,u,l,f),r[n+1]=p(i,o,s,a,c,u,l,f)}},y.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],h=this.h[6],p=this.h[7],g=this.h[8],v=this.h[9],y=this.h[10],R=this.h[11],x=this.h[12],I=this.h[13],M=this.h[14],L=this.h[15];o(this.k.length===r.length);for(var k=0;k<r.length;k+=2){var N=M,C=L,j=P(g,v),D=T(g,v),U=_(g,v,y,R,x),B=w(g,v,y,R,x,I),F=this.k[k],K=this.k[k+1],H=r[k],G=r[k+1],$=b(N,C,j,D,U,B,F,K,H,G),V=m(N,C,j,D,U,B,F,K,H,G);N=S(n,i),C=A(n,i),j=E(n,i,s,a,c),D=O(n,i,s,a,c,u);var z=f(N,C,j,D),q=d(N,C,j,D);M=x,L=I,x=y,I=R,y=g,R=v,g=f(h,p,$,V),v=d(p,p,$,V),h=c,p=u,c=s,u=a,s=n,a=i,n=f($,V,z,q),i=d($,V,z,q)}l(this.h,0,n,i),l(this.h,2,s,a),l(this.h,4,c,u),l(this.h,6,h,p),l(this.h,8,g,v),l(this.h,10,y,R),l(this.h,12,x,I),l(this.h,14,M,L)},y.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},713:(e,t,r)=>{"use strict";var n=r(212).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},212:(e,t,r)=>{"use strict";var n=r(9561),i=r(1285);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=s(i)),r+=c(i.toString(16))}return r},t.zero2=a,t.zero8=c,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var s=new Array(o/4),a=0,c=t;a<s.length;a++,c+=4){var u;u="big"===i?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],s[a]=u>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+r+i+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,c,u){var l=0,f=t;return l+=(f=f+n>>>0)<t?1:0,l+=(f=f+o>>>0)<o?1:0,l+=(f=f+a>>>0)<a?1:0,e+r+i+s+c+(l+=(f=f+u>>>0)<u?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,c,u){return t+n+o+a+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},8873:(e,t,r)=>{"use strict";var n=r(3506),i=r(3022),o=r(9561);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,i.encode(s,t)}},2333:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=d,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=u}return(h?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,f=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+f>=1?d/c:d*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*c-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+h]=255&s,h+=p,s/=256,u-=8);e[r+h-p]|=128*b}},1285:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7993:(e,t,r)=>{"use strict";var n=r(1285),i=r(4485),o=r(7834).Buffer,s=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<<t|e>>>32-t}function u(e,t,r,n,i,o,s){return c(e+(t&r|~t&n)+i+o|0,s)+t|0}function l(e,t,r,n,i,o,s){return c(e+(t&n|r&~n)+i+o|0,s)+t|0}function f(e,t,r,n,i,o,s){return c(e+(t^r^n)+i+o|0,s)+t|0}function d(e,t,r,n,i,o,s){return c(e+(r^(t|~n))+i+o|0,s)+t|0}n(a,i),a.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=u(r,n,i,o,e[0],3614090360,7),o=u(o,r,n,i,e[1],3905402710,12),i=u(i,o,r,n,e[2],606105819,17),n=u(n,i,o,r,e[3],3250441966,22),r=u(r,n,i,o,e[4],4118548399,7),o=u(o,r,n,i,e[5],1200080426,12),i=u(i,o,r,n,e[6],2821735955,17),n=u(n,i,o,r,e[7],4249261313,22),r=u(r,n,i,o,e[8],1770035416,7),o=u(o,r,n,i,e[9],2336552879,12),i=u(i,o,r,n,e[10],4294925233,17),n=u(n,i,o,r,e[11],2304563134,22),r=u(r,n,i,o,e[12],1804603682,7),o=u(o,r,n,i,e[13],4254626195,12),i=u(i,o,r,n,e[14],2792965006,17),r=l(r,n=u(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=l(o,r,n,i,e[6],3225465664,9),i=l(i,o,r,n,e[11],643717713,14),n=l(n,i,o,r,e[0],3921069994,20),r=l(r,n,i,o,e[5],3593408605,5),o=l(o,r,n,i,e[10],38016083,9),i=l(i,o,r,n,e[15],3634488961,14),n=l(n,i,o,r,e[4],3889429448,20),r=l(r,n,i,o,e[9],568446438,5),o=l(o,r,n,i,e[14],3275163606,9),i=l(i,o,r,n,e[3],4107603335,14),n=l(n,i,o,r,e[8],1163531501,20),r=l(r,n,i,o,e[13],2850285829,5),o=l(o,r,n,i,e[2],4243563512,9),i=l(i,o,r,n,e[7],1735328473,14),r=f(r,n=l(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=f(o,r,n,i,e[8],2272392833,11),i=f(i,o,r,n,e[11],1839030562,16),n=f(n,i,o,r,e[14],4259657740,23),r=f(r,n,i,o,e[1],2763975236,4),o=f(o,r,n,i,e[4],1272893353,11),i=f(i,o,r,n,e[7],4139469664,16),n=f(n,i,o,r,e[10],3200236656,23),r=f(r,n,i,o,e[13],681279174,4),o=f(o,r,n,i,e[0],3936430074,11),i=f(i,o,r,n,e[3],3572445317,16),n=f(n,i,o,r,e[6],76029189,23),r=f(r,n,i,o,e[9],3654602809,4),o=f(o,r,n,i,e[12],3873151461,11),i=f(i,o,r,n,e[15],530742520,16),r=d(r,n=f(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=d(o,r,n,i,e[7],1126891415,10),i=d(i,o,r,n,e[14],2878612391,15),n=d(n,i,o,r,e[5],4237533241,21),r=d(r,n,i,o,e[12],1700485571,6),o=d(o,r,n,i,e[3],2399980690,10),i=d(i,o,r,n,e[10],4293915773,15),n=d(n,i,o,r,e[1],2240044497,21),r=d(r,n,i,o,e[8],1873313359,6),o=d(o,r,n,i,e[15],4264355552,10),i=d(i,o,r,n,e[6],2734768916,15),n=d(n,i,o,r,e[13],1309151649,21),r=d(r,n,i,o,e[4],4149444226,6),o=d(o,r,n,i,e[11],3174756917,10),i=d(i,o,r,n,e[2],718787259,15),n=d(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=a},9561:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},3022:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},4452:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,s,a;if("string"==typeof t&&(o="not ",t.substr(!s||s<0?0:+s,o.length)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},7073:(e,t,r)=>{"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var i=r(8051),o=r(2557);r(1285)(u,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var c=s[a];u.prototype[c]||(u.prototype[c]=o.prototype[c])}function u(e){if(!(this instanceof u))return new u(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||process.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},5163:(e,t,r)=>{"use strict";e.exports=i;var n=r(7640);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(1285)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},8051:(e,t,r)=>{"use strict";var n;e.exports=S,S.ReadableState=O;r(2699).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=r(5010),s=r(8834).Buffer,a=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,u=r(6602);c=u&&u.debuglog?u.debuglog("stream"):function(){};var l,f,d,h=r(6637),p=r(2262),b=r(7605).getHighWaterMark,m=r(4452).q,g=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,y=m.ERR_METHOD_NOT_IMPLEMENTED,_=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(1285)(S,o);var w=p.errorOrDestroy,E=["error","close","destroy","pause","resume"];function O(e,t,i){n=n||r(7073),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=b(this,e,"readableHighWaterMark",i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(214).s),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(7073),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new O(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function A(e,t,r,n,i){c("readableAddChunk",t);var o,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?x(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}(e,u);else if(i||(o=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof a||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(u,t)),o)w(e,o);else if(u.objectMode||t&&t.length>0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)u.endEmitted?w(e,new _):P(e,u,t,!0);else if(u.ended)w(e,new v);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?P(e,u,t,!1):M(e,u)):P(e,u,t,!1)}else n||(u.reading=!1,M(e,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function P(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&x(e)),M(e,t)}Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),S.prototype.destroy=p.destroy,S.prototype._undestroy=p.undestroy,S.prototype._destroy=function(e,t){t(e)},S.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},S.prototype.unshift=function(e){return A(this,e,null,!0,!1)},S.prototype.isPaused=function(){return!1===this._readableState.flowing},S.prototype.setEncoding=function(e){l||(l=r(214).s);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var T=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function x(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(I,e))}function I(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,j(e)}function M(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function k(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function N(e){c("readable nexttick read 0"),e.read(0)}function C(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(B,t,e))}function B(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}S.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):x(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(n=e>0?D(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},S.prototype._read=function(e){w(this,new y("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?a:b;function s(t,i){c("onunpipe"),t===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,c("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function a(){c("onend"),e.end()}n.endEmitted?process.nextTick(o):r.once("end",o),e.on("unpipe",s);var u=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,j(e))}}(r);e.on("drain",u);var l=!1;function f(t){c("ondata");var i=e.write(t);c("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==F(n.pipes,e))&&!l&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){c("onerror",t),b(),e.removeListener("error",d),0===i(e,"error")&&w(e,t)}function h(){e.removeListener("finish",p),b()}function p(){c("onfinish"),e.removeListener("close",h),b()}function b(){c("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",h),e.once("finish",p),e.emit("pipe",r),n.flowing||(c("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=F(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},S.prototype.on=function(e,t){var r=o.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?x(this):n.reading||process.nextTick(N,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(k,this),r},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(k,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(C,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<E.length;o++)e.on(E[o],this.emit.bind(this,E[o]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(1029)),f(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),S._fromList=D,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(e,t){return void 0===d&&(d=r(352)),d(S,e,t)})},7640:(e,t,r)=>{"use strict";e.exports=l;var n=r(4452).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(7073);function u(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);c.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,r){d(e,t,r)}))}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(1285)(l,c),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,(function(e){t(e)}))}},2557:(e,t,r)=>{"use strict";function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=S,S.WritableState=O;var o={deprecate:r(5803)},s=r(5010),a=r(8834).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var u,l=r(2262),f=r(7605).getHighWaterMark,d=r(4452).q,h=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENTED,b=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,g=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,y=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,w=l.errorOrDestroy;function E(){}function O(e,t,o){i=i||r(7073),e=e||{},"boolean"!=typeof o&&(o=t instanceof i),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(I,e,t),e._writableState.errorEmitted=!0,w(e,n)):(i(n),e._writableState.errorEmitted=!0,w(e,n),I(e,t))}(e,r,n,t,i);else{var o=R(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?process.nextTick(P,e,r,o,i):P(e,r,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function S(e){var t=this instanceof(i=i||r(7073));if(!t&&!u.call(S,this))return new S(e);this._writableState=new O(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),s.call(this)}function A(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function P(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),I(e,t)}function T(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,o=new Array(i),s=t.corkedRequestsFree;s.entry=r;for(var a=0,c=!0;r;)o[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;o.allBuffers=c,A(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new n(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,f=r.callback;if(A(e,t,!1,t.objectMode?1:u.length,u,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final((function(r){t.pendingcb--,r&&w(e,r),t.prefinished=!0,e.emit("prefinish"),I(e,t)}))}function I(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(x,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(1285)(S,s),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!u.call(this,e)||this===S&&(e&&e._writableState instanceof O)}})):u=function(e){return e instanceof this},S.prototype.pipe=function(){w(this,new m)},S.prototype.write=function(e,t,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=e,a.isBuffer(n)||n instanceof c);return s&&!a.isBuffer(e)&&(e=function(e){return a.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=E),i.ending?function(e,t){var r=new y;w(e,r),process.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i;return null===r?i=new v:"string"==typeof r||t.objectMode||(i=new h("chunk",["string","Buffer"],r)),!i||(w(e,i),process.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=a.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var c=t.objectMode?1:n.length;t.length+=c;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,c,n,i,o);return u}(this,i,s,e,t,r)),o},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},S.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new p("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,I(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=l.destroy,S.prototype._undestroy=l.undestroy,S.prototype._destroy=function(e,t){t(e)}},1029:(e,t,r)=>{"use strict";var n;function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(9885),s=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[s];if(null!==t){var r=e[d].read();null!==r&&(e[l]=null,e[s]=null,e[a]=null,t(h(r,!1)))}}function b(e){process.nextTick(p,e)}var m=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((i(n={get stream(){return this[d]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[c]?r(e[c]):t(h(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[u]?r(h(void 0,!0)):t[f](r,n)}),n)}}(n,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(h(i,!1));r=new Promise(this[f])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),m);e.exports=function(e){var t,r=Object.create(g,(i(t={},d,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,u,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[d].read();n?(r[l]=null,r[s]=null,r[a]=null,e(h(n,!1))):(r[s]=e,r[a]=t)},writable:!0}),t));return r[l]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[a];return null!==t&&(r[l]=null,r[s]=null,r[a]=null,t(e)),void(r[c]=e)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[a]=null,n(h(void 0,!0))),r[u]=!0})),e.on("readable",b.bind(null,r)),r}},6637:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var c=r(8834).Buffer,u=r(4854).inspect,l=u&&u.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,n;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t,r,n,i=c.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,c.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return u(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},2262:e=>{"use strict";function t(e,t){n(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,e)):process.nextTick(n,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!i&&e?o._writableState?o._writableState.errorEmitted?process.nextTick(r,o):(o._writableState.errorEmitted=!0,process.nextTick(t,o,e)):process.nextTick(t,o,e):i?(process.nextTick(r,o),i(e)):process.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},9885:(e,t,r)=>{"use strict";var n=r(4452).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,c=function(){t.writable||l()},u=t._writableState&&t._writableState.finished,l=function(){a=!1,u=!0,s||o.call(t)},f=t._readableState&&t._readableState.endEmitted,d=function(){s=!1,f=!0,a||o.call(t)},h=function(e){o.call(t,e)},p=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!u?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},b=function(){t.req.on("finish",l)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?a&&!t._writableState&&(t.on("end",c),t.on("close",c)):(t.on("complete",l),t.on("abort",p),t.req?b():t.on("request",b)),t.on("end",d),t.on("finish",l),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",b),t.req&&t.req.removeListener("finish",l),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",l),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},352:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},3495:(e,t,r)=>{"use strict";var n;var i=r(4452).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function c(e){e()}function u(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var l,f=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var d=t.map((function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(9885)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var c=!1;return function(t){if(!a&&!c)return c=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,(function(e){l||(l=e),e&&d.forEach(c),o||(d.forEach(c),f(l))}))}));return t.reduce(u)}},7605:(e,t,r)=>{"use strict";var n=r(4452).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},5010:(e,t,r)=>{e.exports=r(2699).EventEmitter},696:(e,t,r)=>{(t=e.exports=r(8051)).Stream=t,t.Readable=t,t.Writable=r(2557),t.Duplex=r(7073),t.Transform=r(7640),t.PassThrough=r(5163),t.finished=r(9885),t.pipeline=r(3495)},1445:(e,t,r)=>{"use strict";var n=r(8834).Buffer,i=r(1285),o=r(4485),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],f=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function h(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function b(e,t,r,n,i,o,s,a){return p(e+(t^r^n)+o+s|0,a)+i|0}function m(e,t,r,n,i,o,s,a){return p(e+(t&r|~t&n)+o+s|0,a)+i|0}function g(e,t,r,n,i,o,s,a){return p(e+((t|~r)^n)+o+s|0,a)+i|0}function v(e,t,r,n,i,o,s,a){return p(e+(t&n|r&~n)+o+s|0,a)+i|0}function y(e,t,r,n,i,o,s,a){return p(e+(t^(r|~n))+o+s|0,a)+i|0}i(h,o),h.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,h=0|this._e,_=0|this._a,w=0|this._b,E=0|this._c,O=0|this._d,S=0|this._e,A=0;A<80;A+=1){var P,T;A<16?(P=b(r,n,i,o,h,e[a[A]],f[0],u[A]),T=y(_,w,E,O,S,e[c[A]],d[0],l[A])):A<32?(P=m(r,n,i,o,h,e[a[A]],f[1],u[A]),T=v(_,w,E,O,S,e[c[A]],d[1],l[A])):A<48?(P=g(r,n,i,o,h,e[a[A]],f[2],u[A]),T=g(_,w,E,O,S,e[c[A]],d[2],l[A])):A<64?(P=v(r,n,i,o,h,e[a[A]],f[3],u[A]),T=m(_,w,E,O,S,e[c[A]],d[3],l[A])):(P=y(r,n,i,o,h,e[a[A]],f[4],u[A]),T=b(_,w,E,O,S,e[c[A]],d[4],l[A])),r=h,h=o,o=p(i,10),i=n,n=P,_=S,S=O,O=p(E,10),E=w,w=T}var R=this._b+i+O|0;this._b=this._c+o+S|0,this._c=this._d+h+_|0,this._d=this._e+r+w|0,this._e=this._a+n+E|0,this._a=R},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},977: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.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.interval=t.iif=t.generate=t.fromEventPattern=t.fromEvent=t.from=t.forkJoin=t.empty=t.defer=t.connectable=t.concat=t.combineLatest=t.bindNodeCallback=t.bindCallback=t.UnsubscriptionError=t.TimeoutError=t.SequenceError=t.ObjectUnsubscribedError=t.NotFoundError=t.EmptyError=t.ArgumentOutOfRangeError=t.firstValueFrom=t.lastValueFrom=t.isObservable=t.identity=t.noop=t.pipe=t.NotificationKind=t.Notification=t.Subscriber=t.Subscription=t.Scheduler=t.VirtualAction=t.VirtualTimeScheduler=t.animationFrameScheduler=t.animationFrame=t.queueScheduler=t.queue=t.asyncScheduler=t.async=t.asapScheduler=t.asap=t.AsyncSubject=t.ReplaySubject=t.BehaviorSubject=t.Subject=t.animationFrames=t.observable=t.ConnectableObservable=t.Observable=void 0,t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.combineLatestWith=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=t.config=t.NEVER=t.EMPTY=t.scheduled=t.zip=t.using=t.timer=t.throwError=t.range=t.race=t.partition=t.pairs=t.onErrorResumeNext=t.of=t.never=t.merge=void 0,t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.pairwise=t.onErrorResumeNextWith=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=t.mergeAll=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=void 0,t.zipWith=t.zipAll=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=void 0;var o=r(4174);Object.defineProperty(t,"Observable",{enumerable:!0,get:function(){return o.Observable}});var s=r(7165);Object.defineProperty(t,"ConnectableObservable",{enumerable:!0,get:function(){return s.ConnectableObservable}});var a=r(4595);Object.defineProperty(t,"observable",{enumerable:!0,get:function(){return a.observable}});var c=r(2447);Object.defineProperty(t,"animationFrames",{enumerable:!0,get:function(){return c.animationFrames}});var u=r(5294);Object.defineProperty(t,"Subject",{enumerable:!0,get:function(){return u.Subject}});var l=r(8114);Object.defineProperty(t,"BehaviorSubject",{enumerable:!0,get:function(){return l.BehaviorSubject}});var f=r(8806);Object.defineProperty(t,"ReplaySubject",{enumerable:!0,get:function(){return f.ReplaySubject}});var d=r(9960);Object.defineProperty(t,"AsyncSubject",{enumerable:!0,get:function(){return d.AsyncSubject}});var h=r(3769);Object.defineProperty(t,"asap",{enumerable:!0,get:function(){return h.asap}}),Object.defineProperty(t,"asapScheduler",{enumerable:!0,get:function(){return h.asapScheduler}});var p=r(7152);Object.defineProperty(t,"async",{enumerable:!0,get:function(){return p.async}}),Object.defineProperty(t,"asyncScheduler",{enumerable:!0,get:function(){return p.asyncScheduler}});var b=r(4093);Object.defineProperty(t,"queue",{enumerable:!0,get:function(){return b.queue}}),Object.defineProperty(t,"queueScheduler",{enumerable:!0,get:function(){return b.queueScheduler}});var m=r(8989);Object.defineProperty(t,"animationFrame",{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(t,"animationFrameScheduler",{enumerable:!0,get:function(){return m.animationFrameScheduler}});var g=r(2929);Object.defineProperty(t,"VirtualTimeScheduler",{enumerable:!0,get:function(){return g.VirtualTimeScheduler}}),Object.defineProperty(t,"VirtualAction",{enumerable:!0,get:function(){return g.VirtualAction}});var v=r(6949);Object.defineProperty(t,"Scheduler",{enumerable:!0,get:function(){return v.Scheduler}});var y=r(4666);Object.defineProperty(t,"Subscription",{enumerable:!0,get:function(){return y.Subscription}});var _=r(7747);Object.defineProperty(t,"Subscriber",{enumerable:!0,get:function(){return _.Subscriber}});var w=r(9828);Object.defineProperty(t,"Notification",{enumerable:!0,get:function(){return w.Notification}}),Object.defineProperty(t,"NotificationKind",{enumerable:!0,get:function(){return w.NotificationKind}});var E=r(5250);Object.defineProperty(t,"pipe",{enumerable:!0,get:function(){return E.pipe}});var O=r(7116);Object.defineProperty(t,"noop",{enumerable:!0,get:function(){return O.noop}});var S=r(8987);Object.defineProperty(t,"identity",{enumerable:!0,get:function(){return S.identity}});var A=r(3659);Object.defineProperty(t,"isObservable",{enumerable:!0,get:function(){return A.isObservable}});var P=r(4798);Object.defineProperty(t,"lastValueFrom",{enumerable:!0,get:function(){return P.lastValueFrom}});var T=r(7327);Object.defineProperty(t,"firstValueFrom",{enumerable:!0,get:function(){return T.firstValueFrom}});var R=r(9216);Object.defineProperty(t,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return R.ArgumentOutOfRangeError}});var x=r(9088);Object.defineProperty(t,"EmptyError",{enumerable:!0,get:function(){return x.EmptyError}});var I=r(5722);Object.defineProperty(t,"NotFoundError",{enumerable:!0,get:function(){return I.NotFoundError}});var M=r(8499);Object.defineProperty(t,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return M.ObjectUnsubscribedError}});var L=r(7298);Object.defineProperty(t,"SequenceError",{enumerable:!0,get:function(){return L.SequenceError}});var k=r(1316);Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return k.TimeoutError}});var N=r(4043);Object.defineProperty(t,"UnsubscriptionError",{enumerable:!0,get:function(){return N.UnsubscriptionError}});var C=r(6238);Object.defineProperty(t,"bindCallback",{enumerable:!0,get:function(){return C.bindCallback}});var j=r(2375);Object.defineProperty(t,"bindNodeCallback",{enumerable:!0,get:function(){return j.bindNodeCallback}});var D=r(508);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return D.combineLatest}});var U=r(3364);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return U.concat}});var B=r(5360);Object.defineProperty(t,"connectable",{enumerable:!0,get:function(){return B.connectable}});var F=r(9623);Object.defineProperty(t,"defer",{enumerable:!0,get:function(){return F.defer}});var K=r(6929);Object.defineProperty(t,"empty",{enumerable:!0,get:function(){return K.empty}});var H=r(9220);Object.defineProperty(t,"forkJoin",{enumerable:!0,get:function(){return H.forkJoin}});var G=r(4417);Object.defineProperty(t,"from",{enumerable:!0,get:function(){return G.from}});var $=r(9671);Object.defineProperty(t,"fromEvent",{enumerable:!0,get:function(){return $.fromEvent}});var V=r(7357);Object.defineProperty(t,"fromEventPattern",{enumerable:!0,get:function(){return V.fromEventPattern}});var z=r(3482);Object.defineProperty(t,"generate",{enumerable:!0,get:function(){return z.generate}});var q=r(550);Object.defineProperty(t,"iif",{enumerable:!0,get:function(){return q.iif}});var W=r(3154);Object.defineProperty(t,"interval",{enumerable:!0,get:function(){return W.interval}});var Z=r(2039);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return Z.merge}});var J=r(2980);Object.defineProperty(t,"never",{enumerable:!0,get:function(){return J.never}});var Y=r(1377);Object.defineProperty(t,"of",{enumerable:!0,get:function(){return Y.of}});var X=r(8362);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return X.onErrorResumeNext}});var Q=r(968);Object.defineProperty(t,"pairs",{enumerable:!0,get:function(){return Q.pairs}});var ee=r(6394);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ee.partition}});var te=r(6849);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return te.race}});var re=r(7284);Object.defineProperty(t,"range",{enumerable:!0,get:function(){return re.range}});var ne=r(40);Object.defineProperty(t,"throwError",{enumerable:!0,get:function(){return ne.throwError}});var ie=r(8069);Object.defineProperty(t,"timer",{enumerable:!0,get:function(){return ie.timer}});var oe=r(3348);Object.defineProperty(t,"using",{enumerable:!0,get:function(){return oe.using}});var se=r(4981);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return se.zip}});var ae=r(2862);Object.defineProperty(t,"scheduled",{enumerable:!0,get:function(){return ae.scheduled}});var ce=r(6929);Object.defineProperty(t,"EMPTY",{enumerable:!0,get:function(){return ce.EMPTY}});var ue=r(2980);Object.defineProperty(t,"NEVER",{enumerable:!0,get:function(){return ue.NEVER}}),i(r(2793),t);var le=r(9179);Object.defineProperty(t,"config",{enumerable:!0,get:function(){return le.config}});var fe=r(2605);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return fe.audit}});var de=r(4152);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return de.auditTime}});var he=r(5149);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return he.buffer}});var pe=r(3189);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return pe.bufferCount}});var be=r(9459);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return be.bufferTime}});var me=r(8145);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return me.bufferToggle}});var ge=r(7764);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return ge.bufferWhen}});var ve=r(3056);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return ve.catchError}});var ye=r(498);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return ye.combineAll}});var _e=r(7484);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return _e.combineLatestAll}});var we=r(4755);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return we.combineLatestWith}});var Ee=r(482);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return Ee.concatAll}});var Oe=r(1774);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return Oe.concatMap}});var Se=r(3977);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return Se.concatMapTo}});var Ae=r(7672);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return Ae.concatWith}});var Pe=r(5561);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return Pe.connect}});var Te=r(8259);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return Te.count}});var Re=r(3473);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return Re.debounce}});var xe=r(8390);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return xe.debounceTime}});var Ie=r(4562);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return Ie.defaultIfEmpty}});var Me=r(8151);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return Me.delay}});var Le=r(744);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return Le.delayWhen}});var ke=r(8590);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return ke.dematerialize}});var Ne=r(8406);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return Ne.distinct}});var Ce=r(7300);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return Ce.distinctUntilChanged}});var je=r(4405);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return je.distinctUntilKeyChanged}});var De=r(2787);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return De.elementAt}});var Ue=r(1665);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return Ue.endWith}});var Be=r(1511);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return Be.every}});var Fe=r(5592);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return Fe.exhaust}});var Ke=r(2008);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return Ke.exhaustAll}});var He=r(4019);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return He.exhaustMap}});var Ge=r(9101);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return Ge.expand}});var $e=r(7261);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return $e.filter}});var Ve=r(5381);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return Ve.finalize}});var ze=r(4127);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return ze.find}});var qe=r(9727);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return qe.findIndex}});var We=r(7418);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return We.first}});var Ze=r(7533);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return Ze.groupBy}});var Je=r(9186);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return Je.ignoreElements}});var Ye=r(7757);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return Ye.isEmpty}});var Xe=r(3374);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return Xe.last}});var Qe=r(6269);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return Qe.map}});var et=r(5471);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return et.mapTo}});var tt=r(1160);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return tt.materialize}});var rt=r(1890);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return rt.max}});var nt=r(400);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return nt.mergeAll}});var it=r(9121);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return it.flatMap}});var ot=r(6086);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ot.mergeMap}});var st=r(1244);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return st.mergeMapTo}});var at=r(3699);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return at.mergeScan}});var ct=r(8220);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ct.mergeWith}});var ut=r(770);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ut.min}});var lt=r(8413);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return lt.multicast}});var ft=r(9314);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return ft.observeOn}});var dt=r(1899);Object.defineProperty(t,"onErrorResumeNextWith",{enumerable:!0,get:function(){return dt.onErrorResumeNextWith}});var ht=r(1186);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ht.pairwise}});var pt=r(9532);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return pt.pluck}});var bt=r(5745);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return bt.publish}});var mt=r(8103);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return mt.publishBehavior}});var gt=r(2610);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return gt.publishLast}});var vt=r(5299);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return vt.publishReplay}});var yt=r(3820);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return yt.raceWith}});var _t=r(8083);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return _t.reduce}});var wt=r(2588);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return wt.repeat}});var Et=r(9249);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return Et.repeatWhen}});var Ot=r(4486);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return Ot.retry}});var St=r(9112);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return St.retryWhen}});var At=r(4508);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return At.refCount}});var Pt=r(778);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Pt.sample}});var Tt=r(7701);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Tt.sampleTime}});var Rt=r(8167);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Rt.scan}});var xt=r(7821);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return xt.sequenceEqual}});var It=r(2645);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return It.share}});var Mt=r(7566);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Mt.shareReplay}});var Lt=r(4610);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return Lt.single}});var kt=r(5735);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return kt.skip}});var Nt=r(3252);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Nt.skipLast}});var Ct=r(1779);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return Ct.skipUntil}});var jt=r(5454);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return jt.skipWhile}});var Dt=r(1923);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Dt.startWith}});var Ut=r(9130);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Ut.subscribeOn}});var Bt=r(1695);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Bt.switchAll}});var Ft=r(6649);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Ft.switchMap}});var Kt=r(3054);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Kt.switchMapTo}});var Ht=r(2890);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Ht.switchScan}});var Gt=r(9438);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Gt.take}});var $t=r(4125);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return $t.takeLast}});var Vt=r(9008);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Vt.takeUntil}});var zt=r(5884);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return zt.takeWhile}});var qt=r(5383);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return qt.tap}});var Wt=r(1016);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return Wt.throttle}});var Zt=r(567);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Zt.throttleTime}});var Jt=r(1332);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return Jt.throwIfEmpty}});var Yt=r(1149);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Yt.timeInterval}});var Xt=r(1316);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Xt.timeout}});var Qt=r(4972);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Qt.timeoutWith}});var er=r(1275);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return er.timestamp}});var tr=r(9867);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return tr.toArray}});var rr=r(7649);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return rr.window}});var nr=r(5612);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return nr.windowCount}});var ir=r(9972);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return ir.windowTime}});var or=r(9593);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return or.windowToggle}});var sr=r(6307);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return sr.windowWhen}});var ar=r(5512);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return ar.withLatestFrom}});var cr=r(1221);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return cr.zipAll}});var ur=r(7594);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return ur.zipWith}})},9960:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncSubject=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return i(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))},t}(r(5294).Subject);t.AsyncSubject=o},8114:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BehaviorSubject=void 0;var o=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(r(5294).Subject);t.BehaviorSubject=o},9828:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeNotification=t.Notification=t.NotificationKind=void 0;var n=r(6929),i=r(1377),o=r(40),s=r(2935);!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(t.NotificationKind||(t.NotificationKind={}));var a=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){return c(this,e)},e.prototype.do=function(e,t,r){var n=this,i=n.kind,o=n.value,s=n.error;return"N"===i?null==e?void 0:e(o):"E"===i?null==t?void 0:t(s):null==r?void 0:r()},e.prototype.accept=function(e,t,r){var n;return s.isFunction(null===(n=e)||void 0===n?void 0:n.next)?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,s=e.error,a="N"===t?i.of(r):"E"===t?o.throwError((function(){return s})):"C"===t?n.EMPTY:0;if(!a)throw new TypeError("Unexpected notification kind "+t);return a},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();function c(e,t){var r,n,i,o=e,s=o.kind,a=o.value,c=o.error;if("string"!=typeof s)throw new TypeError('Invalid notification, missing "kind"');"N"===s?null===(r=t.next)||void 0===r||r.call(t,a):"E"===s?null===(n=t.error)||void 0===n||n.call(t,c):null===(i=t.complete)||void 0===i||i.call(t)}t.Notification=a,t.observeNotification=c},3005:(e,t)=>{"use strict";function r(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.createNotification=t.nextNotification=t.errorNotification=t.COMPLETE_NOTIFICATION=void 0,t.COMPLETE_NOTIFICATION=r("C",void 0,void 0),t.errorNotification=function(e){return r("E",void 0,e)},t.nextNotification=function(e){return r("N",e,void 0)},t.createNotification=r},4174:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var n=r(7747),i=r(4666),o=r(4595),s=r(5250),a=r(9179),c=r(2935),u=r(5444),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var o,s=this,a=(o=e)&&o instanceof n.Subscriber||function(e){return e&&c.isFunction(e.next)&&c.isFunction(e.error)&&c.isFunction(e.complete)}(o)&&i.isSubscription(o)?e:new n.SafeSubscriber(e,t,r);return u.errorContext((function(){var e=s,t=e.operator,r=e.source;a.add(t?t.call(a,r):r?s._subscribe(a):s._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=f(t))((function(t,i){var o=new n.SafeSubscriber({next:function(t){try{e(t)}catch(e){i(e),o.unsubscribe()}},error:i,complete:t});r.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:a.config.Promise)&&void 0!==t?t:Promise}t.Observable=l},8806:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ReplaySubject=void 0;var o=r(5294),s=r(9168),a=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=s.dateTimestampProvider);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return i(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,c=1;c<n.length&&n[c]<=s;c+=2)a=c;a&&n.splice(0,a+1)}},t}(o.Subject);t.ReplaySubject=a},6949:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=void 0;var n=r(9168),i=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=n.dateTimestampProvider.now,e}();t.Scheduler=i},5294:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousSubject=t.Subject=void 0;var s=r(4174),a=r(4666),c=r(8499),u=r(1291),l=r(5444),f=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype.lift=function(e){var t=new d(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new c.ObjectUnsubscribedError},t.prototype.next=function(e){var t=this;l.errorContext((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=o(t.currentObservers),s=i.next();!s.done;s=i.next()){s.value.next(e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;l.errorContext((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;l.errorContext((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?a.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new a.Subscription((function(){t.currentObservers=null,u.arrRemove(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new s.Observable;return e.source=this,e},t.create=function(e,t){return new d(e,t)},t}(s.Observable);t.Subject=f;var d=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return i(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:a.EMPTY_SUBSCRIPTION},t}(f);t.AnonymousSubject=d},7747:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_OBSERVER=t.SafeSubscriber=t.Subscriber=void 0;var o=r(2935),s=r(4666),a=r(9179),c=r(1600),u=r(7116),l=r(3005),f=r(1577),d=r(5444),h=function(e){function r(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,s.isSubscription(r)&&r.add(n)):n.destination=t.EMPTY_OBSERVER,n}return i(r,e),r.create=function(e,t,r){return new g(e,t,r)},r.prototype.next=function(e){this.isStopped?y(l.nextNotification(e),this):this._next(e)},r.prototype.error=function(e){this.isStopped?y(l.errorNotification(e),this):(this.isStopped=!0,this._error(e))},r.prototype.complete=function(){this.isStopped?y(l.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(e){this.destination.next(e)},r.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(s.Subscription);t.Subscriber=h;var p=Function.prototype.bind;function b(e,t){return p.call(e,t)}var m=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){v(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){v(e)}else v(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){v(e)}},e}(),g=function(e){function t(t,r,n){var i,s,c=e.call(this)||this;o.isFunction(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:c&&a.config.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return c.unsubscribe()},i={next:t.next&&b(t.next,s),error:t.error&&b(t.error,s),complete:t.complete&&b(t.complete,s)}):i=t;return c.destination=new m(i),c}return i(t,e),t}(h);function v(e){a.config.useDeprecatedSynchronousErrorHandling?d.captureError(e):c.reportUnhandledError(e)}function y(e,t){var r=a.config.onStoppedNotification;r&&f.timeoutProvider.setTimeout((function(){return r(e,t)}))}t.SafeSubscriber=g,t.EMPTY_OBSERVER={closed:!0,next:u.noop,error:function(e){throw e},complete:u.noop}},4666:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.isSubscription=t.EMPTY_SUBSCRIPTION=t.Subscription=void 0;var s=r(2935),a=r(4043),c=r(1291),u=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,c,u;if(!this.closed){this.closed=!0;var f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var d=n(f),h=d.next();!h.done;h=d.next()){h.value.remove(this)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}else f.remove(this);var p=this.initialTeardown;if(s.isFunction(p))try{p()}catch(e){u=e instanceof a.UnsubscriptionError?e.errors:[e]}var b=this._finalizers;if(b){this._finalizers=null;try{for(var m=n(b),g=m.next();!g.done;g=m.next()){var v=g.value;try{l(v)}catch(e){u=null!=u?u:[],e instanceof a.UnsubscriptionError?u=o(o([],i(u)),i(e.errors)):u.push(e)}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(c=m.return)&&c.call(m)}finally{if(r)throw r.error}}}if(u)throw new a.UnsubscriptionError(u)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&c.arrRemove(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&c.arrRemove(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function l(e){s.isFunction(e)?e():e.unsubscribe()}t.Subscription=u,t.EMPTY_SUBSCRIPTION=u.EMPTY,t.isSubscription=function(e){return e instanceof u||e&&"closed"in e&&s.isFunction(e.remove)&&s.isFunction(e.add)&&s.isFunction(e.unsubscribe)}},9179:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=void 0,t.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},7327:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.firstValueFrom=void 0;var n=r(9088),i=r(7747);t.firstValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(o,s){var a=new i.SafeSubscriber({next:function(e){o(e),a.unsubscribe()},error:s,complete:function(){r?o(t.defaultValue):s(new n.EmptyError)}});e.subscribe(a)}))}},4798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastValueFrom=void 0;var n=r(9088);t.lastValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(i,o){var s,a=!1;e.subscribe({next:function(e){s=e,a=!0},error:o,complete:function(){a?i(s):r?i(t.defaultValue):o(new n.EmptyError)}})}))}},7165:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectableObservable=void 0;var o=r(4174),s=r(4666),a=r(4508),c=r(7326),u=r(6097),l=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,u.hasLift(t)&&(n.lift=t.lift),n}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new s.Subscription;var r=this.getSubject();t.add(this.source.subscribe(c.createOperatorSubscriber(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=s.Subscription.EMPTY)}return t},t.prototype.refCount=function(){return a.refCount()(this)},t}(o.Observable);t.ConnectableObservable=l},6238:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallback=void 0;var n=r(9706);t.bindCallback=function(e,t,r){return n.bindCallbackInternals(!1,e,t,r)}},9706:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallbackInternals=void 0;var o=r(9668),s=r(4174),a=r(9130),c=r(9364),u=r(9314),l=r(9960);t.bindCallbackInternals=function e(t,r,f,d){if(f){if(!o.isScheduler(f))return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r,d).apply(this,n).pipe(c.mapOneOrManyArgs(f))};d=f}return d?function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r).apply(this,n).pipe(a.subscribeOn(d),u.observeOn(d))}:function(){for(var e=this,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var c=new l.AsyncSubject,u=!0;return new s.Observable((function(s){var a=c.subscribe(s);if(u){u=!1;var l=!1,f=!1;r.apply(e,i(i([],n(o)),[function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(t){var n=e.shift();if(null!=n)return void c.error(n)}c.next(1<e.length?e:e[0]),f=!0,l&&c.complete()}])),f&&c.complete(),l=!0}return a}))}}},2375:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindNodeCallback=void 0;var n=r(9706);t.bindNodeCallback=function(e,t,r){return n.bindCallbackInternals(!0,e,t,r)}},508:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestInit=t.combineLatest=void 0;var n=r(4174),i=r(2398),o=r(4417),s=r(8987),a=r(9364),c=r(4544),u=r(4800),l=r(7326),f=r(5267);function d(e,t,r){return void 0===r&&(r=s.identity),function(n){h(t,(function(){for(var i=e.length,s=new Array(i),a=i,c=i,u=function(i){h(t,(function(){var u=o.from(e[i],t),f=!1;u.subscribe(l.createOperatorSubscriber(n,(function(e){s[i]=e,f||(f=!0,c--),c||n.next(r(s.slice()))}),(function(){--a||n.complete()})))}),n)},f=0;f<i;f++)u(f)}),n)}}function h(e,t,r){e?f.executeSchedule(r,e,t):t()}t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=c.popScheduler(e),l=c.popResultSelector(e),f=i.argsArgArrayOrObject(e),h=f.args,p=f.keys;if(0===h.length)return o.from([],r);var b=new n.Observable(d(h,r,p?function(e){return u.createObject(p,e)}:s.identity));return l?b.pipe(a.mapOneOrManyArgs(l)):b},t.combineLatestInit=d},3364:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var n=r(482),i=r(4544),o=r(4417);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.concatAll()(o.from(e,i.popScheduler(e)))}},5360:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connectable=void 0;var n=r(5294),i=r(4174),o=r(9623),s={connector:function(){return new n.Subject},resetOnDisconnect:!0};t.connectable=function(e,t){void 0===t&&(t=s);var r=null,n=t.connector,a=t.resetOnDisconnect,c=void 0===a||a,u=n(),l=new i.Observable((function(e){return u.subscribe(e)}));return l.connect=function(){return r&&!r.closed||(r=o.defer((function(){return e})).subscribe(u),c&&r.add((function(){return u=n()}))),r},l}},9623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defer=void 0;var n=r(4174),i=r(6958);t.defer=function(e){return new n.Observable((function(t){i.innerFrom(e()).subscribe(t)}))}},2447:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrames=void 0;var n=r(4174),i=r(2261),o=r(9015);function s(e){return new n.Observable((function(t){var r=e||i.performanceTimestampProvider,n=r.now(),s=0,a=function(){t.closed||(s=o.animationFrameProvider.requestAnimationFrame((function(i){s=0;var o=r.now();t.next({timestamp:e?o:i,elapsed:o-n}),a()})))};return a(),function(){s&&o.animationFrameProvider.cancelAnimationFrame(s)}}))}t.animationFrames=function(e){return e?s(e):a};var a=s()},6929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.empty=t.EMPTY=void 0;var n=r(4174);t.EMPTY=new n.Observable((function(e){return e.complete()})),t.empty=function(e){return e?function(e){return new n.Observable((function(t){return e.schedule((function(){return t.complete()}))}))}(e):t.EMPTY}},9220:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forkJoin=void 0;var n=r(4174),i=r(2398),o=r(6958),s=r(4544),a=r(7326),c=r(9364),u=r(4800);t.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popResultSelector(e),l=i.argsArgArrayOrObject(e),f=l.args,d=l.keys,h=new n.Observable((function(e){var t=f.length;if(t)for(var r=new Array(t),n=t,i=t,s=function(t){var s=!1;o.innerFrom(f[t]).subscribe(a.createOperatorSubscriber(e,(function(e){s||(s=!0,i--),r[t]=e}),(function(){return n--}),void 0,(function(){n&&s||(i||e.next(d?u.createObject(d,r):r),e.complete())})))},c=0;c<t;c++)s(c);else e.complete()}));return r?h.pipe(c.mapOneOrManyArgs(r)):h}},4417:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.from=void 0;var n=r(2862),i=r(6958);t.from=function(e,t){return t?n.scheduled(e,t):i.innerFrom(e)}},9671:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0}),t.fromEvent=void 0;var i=r(6958),o=r(4174),s=r(6086),a=r(5445),c=r(2935),u=r(9364),l=["addListener","removeListener"],f=["addEventListener","removeEventListener"],d=["on","off"];function h(e,t){return function(r){return function(n){return e[r](t,n)}}}t.fromEvent=function e(t,r,p,b){if(c.isFunction(p)&&(b=p,p=void 0),b)return e(t,r,p).pipe(u.mapOneOrManyArgs(b));var m=n(function(e){return c.isFunction(e.addEventListener)&&c.isFunction(e.removeEventListener)}(t)?f.map((function(e){return function(n){return t[e](r,n,p)}})):function(e){return c.isFunction(e.addListener)&&c.isFunction(e.removeListener)}(t)?l.map(h(t,r)):function(e){return c.isFunction(e.on)&&c.isFunction(e.off)}(t)?d.map(h(t,r)):[],2),g=m[0],v=m[1];if(!g&&a.isArrayLike(t))return s.mergeMap((function(t){return e(t,r,p)}))(i.innerFrom(t));if(!g)throw new TypeError("Invalid event target");return new o.Observable((function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return g(t),function(){return v(t)}}))}},7357:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromEventPattern=void 0;var n=r(4174),i=r(2935),o=r(9364);t.fromEventPattern=function e(t,r,s){return s?e(t,r).pipe(o.mapOneOrManyArgs(s)):new n.Observable((function(e){var n=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1===t.length?t[0]:t)},o=t(n);return i.isFunction(r)?function(){return r(n,o)}:void 0}))}},6884:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromSubscribable=void 0;var n=r(4174);t.fromSubscribable=function(e){return new n.Observable((function(t){return e.subscribe(t)}))}},3482:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generate=void 0;var i=r(8987),o=r(9668),s=r(9623),a=r(2485);t.generate=function(e,t,r,c,u){var l,f,d,h;function p(){var e;return n(this,(function(n){switch(n.label){case 0:e=h,n.label=1;case 1:return t&&!t(e)?[3,4]:[4,d(e)];case 2:n.sent(),n.label=3;case 3:return e=r(e),[3,1];case 4:return[2]}}))}return 1===arguments.length?(h=(l=e).initialState,t=l.condition,r=l.iterate,f=l.resultSelector,d=void 0===f?i.identity:f,u=l.scheduler):(h=e,!c||o.isScheduler(c)?(d=i.identity,u=c):d=c),s.defer(u?function(){return a.scheduleIterable(p(),u)}:p)}},550:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iif=void 0;var n=r(9623);t.iif=function(e,t,r){return n.defer((function(){return e()?t:r}))}},6958:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof s?s(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.fromReadableStreamLike=t.fromAsyncIterable=t.fromIterable=t.fromPromise=t.fromArrayLike=t.fromInteropObservable=t.innerFrom=void 0;var a=r(5445),c=r(4283),u=r(4174),l=r(3124),f=r(3260),d=r(7756),h=r(8131),p=r(2221),b=r(2935),m=r(1600),g=r(4595);function v(e){return new u.Observable((function(t){var r=e[g.observable]();if(b.isFunction(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function y(e){return new u.Observable((function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()}))}function _(e){return new u.Observable((function(t){e.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,m.reportUnhandledError)}))}function w(e){return new u.Observable((function(t){var r,n;try{for(var i=s(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()}))}function E(e){return new u.Observable((function(t){(function(e,t){var r,s,a,c;return n(this,void 0,void 0,(function(){var n,u;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,11]),r=o(e),i.label=1;case 1:return[4,r.next()];case 2:if((s=i.sent()).done)return[3,4];if(n=s.value,t.next(n),t.closed)return[2];i.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=i.sent(),a={error:u},[3,11];case 6:return i.trys.push([6,,9,10]),s&&!s.done&&(c=r.return)?[4,c.call(r)]:[3,8];case 7:i.sent(),i.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function O(e){return E(p.readableStreamLikeToAsyncGenerator(e))}t.innerFrom=function(e){if(e instanceof u.Observable)return e;if(null!=e){if(l.isInteropObservable(e))return v(e);if(a.isArrayLike(e))return y(e);if(c.isPromise(e))return _(e);if(f.isAsyncIterable(e))return E(e);if(h.isIterable(e))return w(e);if(p.isReadableStreamLike(e))return O(e)}throw d.createInvalidObservableTypeError(e)},t.fromInteropObservable=v,t.fromArrayLike=y,t.fromPromise=_,t.fromIterable=w,t.fromAsyncIterable=E,t.fromReadableStreamLike=O},3154:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.interval=void 0;var n=r(7152),i=r(8069);t.interval=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=n.asyncScheduler),e<0&&(e=0),i.timer(e,e,t)}},2039:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var n=r(400),i=r(6958),o=r(6929),s=r(4544),a=r(4417);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popScheduler(e),c=s.popNumber(e,1/0),u=e;return u.length?1===u.length?i.innerFrom(u[0]):n.mergeAll(c)(a.from(u,r)):o.EMPTY}},2980:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.never=t.NEVER=void 0;var n=r(4174),i=r(7116);t.NEVER=new n.Observable(i.noop),t.never=function(){return t.NEVER}},1377:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.of=void 0;var n=r(4544),i=r(4417);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n.popScheduler(e);return i.from(e,r)}},8362:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=void 0;var n=r(4174),i=r(5034),o=r(7326),s=r(7116),a=r(6958);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.argsOrArgArray(e);return new n.Observable((function(e){var t=0,n=function(){if(t<r.length){var i=void 0;try{i=a.innerFrom(r[t++])}catch(e){return void n()}var c=new o.OperatorSubscriber(e,void 0,s.noop,s.noop);i.subscribe(c),c.add(n)}else e.complete()};n()}))}},968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairs=void 0;var n=r(4417);t.pairs=function(e,t){return n.from(Object.entries(e),t)}},6394:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(8781),i=r(7261),o=r(6958);t.partition=function(e,t,r){return[i.filter(t,r)(o.innerFrom(e)),i.filter(n.not(t,r))(o.innerFrom(e))]}},6849:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.raceInit=t.race=void 0;var n=r(4174),i=r(6958),o=r(5034),s=r(7326);function a(e){return function(t){for(var r=[],n=function(n){r.push(i.innerFrom(e[n]).subscribe(s.createOperatorSubscriber(t,(function(e){if(r){for(var i=0;i<r.length;i++)i!==n&&r[i].unsubscribe();r=null}t.next(e)}))))},o=0;r&&!t.closed&&o<e.length;o++)n(o)}}t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=o.argsOrArgArray(e)).length?i.innerFrom(e[0]):new n.Observable(a(e))},t.raceInit=a},7284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.range=void 0;var n=r(4174),i=r(6929);t.range=function(e,t,r){if(null==t&&(t=e,e=0),t<=0)return i.EMPTY;var o=t+e;return new n.Observable(r?function(t){var n=e;return r.schedule((function(){n<o?(t.next(n++),this.schedule()):t.complete()}))}:function(t){for(var r=e;r<o&&!t.closed;)t.next(r++);t.complete()})}},40:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwError=void 0;var n=r(4174),i=r(2935);t.throwError=function(e,t){var r=i.isFunction(e)?e:function(){return e},o=function(e){return e.error(r())};return new n.Observable(t?function(e){return t.schedule(o,0,e)}:o)}},8069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timer=void 0;var n=r(4174),i=r(7152),o=r(9668),s=r(4426);t.timer=function(e,t,r){void 0===e&&(e=0),void 0===r&&(r=i.async);var a=-1;return null!=t&&(o.isScheduler(t)?r=t:a=t),new n.Observable((function(t){var n=s.isValidDate(e)?+e-r.now():e;n<0&&(n=0);var i=0;return r.schedule((function(){t.closed||(t.next(i++),0<=a?this.schedule(void 0,a):t.complete())}),n)}))}},3348:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.using=void 0;var n=r(4174),i=r(6958),o=r(6929);t.using=function(e,t){return new n.Observable((function(r){var n=e(),s=t(n);return(s?i.innerFrom(s):o.EMPTY).subscribe(r),function(){n&&n.unsubscribe()}}))}},4981:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(4174),s=r(6958),a=r(5034),c=r(6929),u=r(7326),l=r(4544);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e),f=a.argsOrArgArray(e);return f.length?new o.Observable((function(e){var t=f.map((function(){return[]})),o=f.map((function(){return!1}));e.add((function(){t=o=null}));for(var a=function(a){s.innerFrom(f[a]).subscribe(u.createOperatorSubscriber(e,(function(s){if(t[a].push(s),t.every((function(e){return e.length}))){var c=t.map((function(e){return e.shift()}));e.next(r?r.apply(void 0,i([],n(c))):c),t.some((function(e,t){return!e.length&&o[t]}))&&e.complete()}}),(function(){o[a]=!0,!t[a].length&&e.complete()})))},c=0;!e.closed&&c<f.length;c++)a(c);return function(){t=o=null}})):c.EMPTY}},7326:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorSubscriber=t.createOperatorSubscriber=void 0;var o=r(7747);t.createOperatorSubscriber=function(e,t,r,n,i){return new s(e,t,r,n,i)};var s=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return i(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(o.Subscriber);t.OperatorSubscriber=s},2605:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.audit=void 0;var n=r(6097),i=r(6958),o=r(7326);t.audit=function(e){return n.operate((function(t,r){var n=!1,s=null,a=null,c=!1,u=function(){if(null==a||a.unsubscribe(),a=null,n){n=!1;var e=s;s=null,r.next(e)}c&&r.complete()},l=function(){a=null,c&&r.complete()};t.subscribe(o.createOperatorSubscriber(r,(function(t){n=!0,s=t,a||i.innerFrom(e(t)).subscribe(a=o.createOperatorSubscriber(r,u,l))}),(function(){c=!0,(!n||!a||a.closed)&&r.complete()})))}))}},4152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.auditTime=void 0;var n=r(7152),i=r(2605),o=r(8069);t.auditTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.audit((function(){return o.timer(e,t)}))}},5149:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buffer=void 0;var n=r(6097),i=r(7116),o=r(7326),s=r(6958);t.buffer=function(e){return n.operate((function(t,r){var n=[];return t.subscribe(o.createOperatorSubscriber(r,(function(e){return n.push(e)}),(function(){r.next(n),r.complete()}))),s.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){var e=n;n=[],r.next(e)}),i.noop)),function(){n=null}}))}},3189:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferCount=void 0;var i=r(6097),o=r(7326),s=r(1291);t.bufferCount=function(e,t){return void 0===t&&(t=null),t=null!=t?t:e,i.operate((function(r,i){var a=[],c=0;r.subscribe(o.createOperatorSubscriber(i,(function(r){var o,u,l,f,d=null;c++%t==0&&a.push([]);try{for(var h=n(a),p=h.next();!p.done;p=h.next()){(g=p.value).push(r),e<=g.length&&(d=null!=d?d:[]).push(g)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(u=h.return)&&u.call(h)}finally{if(o)throw o.error}}if(d)try{for(var b=n(d),m=b.next();!m.done;m=b.next()){var g=m.value;s.arrRemove(a,g),i.next(g)}}catch(e){l={error:e}}finally{try{m&&!m.done&&(f=b.return)&&f.call(b)}finally{if(l)throw l.error}}}),(function(){var e,t;try{for(var r=n(a),o=r.next();!o.done;o=r.next()){var s=o.value;i.next(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.complete()}),void 0,(function(){a=null})))}))}},9459:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferTime=void 0;var i=r(4666),o=r(6097),s=r(7326),a=r(1291),c=r(7152),u=r(4544),l=r(5267);t.bufferTime=function(e){for(var t,r,f=[],d=1;d<arguments.length;d++)f[d-1]=arguments[d];var h=null!==(t=u.popScheduler(f))&&void 0!==t?t:c.asyncScheduler,p=null!==(r=f[0])&&void 0!==r?r:null,b=f[1]||1/0;return o.operate((function(t,r){var o=[],c=!1,u=function(e){var t=e.buffer;e.subs.unsubscribe(),a.arrRemove(o,e),r.next(t),c&&f()},f=function(){if(o){var t=new i.Subscription;r.add(t);var n={buffer:[],subs:t};o.push(n),l.executeSchedule(t,h,(function(){return u(n)}),e)}};null!==p&&p>=0?l.executeSchedule(r,h,f,p,!0):c=!0,f();var d=s.createOperatorSubscriber(r,(function(e){var t,r,i=o.slice();try{for(var s=n(i),a=s.next();!a.done;a=s.next()){var c=a.value,l=c.buffer;l.push(e),b<=l.length&&u(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}),(function(){for(;null==o?void 0:o.length;)r.next(o.shift().buffer);null==d||d.unsubscribe(),r.complete(),r.unsubscribe()}),void 0,(function(){return o=null}));t.subscribe(d)}))}},8145:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferToggle=void 0;var i=r(4666),o=r(6097),s=r(6958),a=r(7326),c=r(7116),u=r(1291);t.bufferToggle=function(e,t){return o.operate((function(r,o){var l=[];s.innerFrom(e).subscribe(a.createOperatorSubscriber(o,(function(e){var r=[];l.push(r);var n=new i.Subscription;n.add(s.innerFrom(t(e)).subscribe(a.createOperatorSubscriber(o,(function(){u.arrRemove(l,r),o.next(r),n.unsubscribe()}),c.noop)))}),c.noop)),r.subscribe(a.createOperatorSubscriber(o,(function(e){var t,r;try{for(var i=n(l),o=i.next();!o.done;o=i.next()){o.value.push(e)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}),(function(){for(;l.length>0;)o.next(l.shift());o.complete()})))}))}},7764:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bufferWhen=void 0;var n=r(6097),i=r(7116),o=r(7326),s=r(6958);t.bufferWhen=function(e){return n.operate((function(t,r){var n=null,a=null,c=function(){null==a||a.unsubscribe();var t=n;n=[],t&&r.next(t),s.innerFrom(e()).subscribe(a=o.createOperatorSubscriber(r,c,i.noop))};c(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==n?void 0:n.push(e)}),(function(){n&&r.next(n),r.complete()}),void 0,(function(){return n=a=null})))}))}},3056:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catchError=void 0;var n=r(6958),i=r(7326),o=r(6097);t.catchError=function e(t){return o.operate((function(r,o){var s,a=null,c=!1;a=r.subscribe(i.createOperatorSubscriber(o,void 0,void 0,(function(i){s=n.innerFrom(t(i,e(t)(r))),a?(a.unsubscribe(),a=null,s.subscribe(o)):c=!0}))),c&&(a.unsubscribe(),a=null,s.subscribe(o))}))}},498:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineAll=void 0;var n=r(7484);t.combineAll=n.combineLatestAll},6527:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatest=void 0;var o=r(508),s=r(6097),a=r(5034),c=r(9364),u=r(5250),l=r(4544);t.combineLatest=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var f=l.popResultSelector(t);return f?u.pipe(e.apply(void 0,i([],n(t))),c.mapOneOrManyArgs(f)):s.operate((function(e,r){o.combineLatestInit(i([e],n(a.argsOrArgArray(t))))(r)}))}},7484:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestAll=void 0;var n=r(508),i=r(2208);t.combineLatestAll=function(e){return i.joinAllInternals(n.combineLatest,e)}},4755:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestWith=void 0;var o=r(6527);t.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.combineLatest.apply(void 0,i([],n(e)))}},3792:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var o=r(6097),s=r(482),a=r(4544),c=r(4417);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=a.popScheduler(e);return o.operate((function(t,o){s.concatAll()(c.from(i([t],n(e)),r)).subscribe(o)}))}},482:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatAll=void 0;var n=r(400);t.concatAll=function(){return n.mergeAll(1)}},1774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMap=void 0;var n=r(6086),i=r(2935);t.concatMap=function(e,t){return i.isFunction(t)?n.mergeMap(e,t,1):n.mergeMap(e,1)}},3977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMapTo=void 0;var n=r(1774),i=r(2935);t.concatMapTo=function(e,t){return i.isFunction(t)?n.concatMap((function(){return e}),t):n.concatMap((function(){return e}))}},7672:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concatWith=void 0;var o=r(3792);t.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.concat.apply(void 0,i([],n(e)))}},5561:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;var n=r(5294),i=r(6958),o=r(6097),s=r(6884),a={connector:function(){return new n.Subject}};t.connect=function(e,t){void 0===t&&(t=a);var r=t.connector;return o.operate((function(t,n){var o=r();i.innerFrom(e(s.fromSubscribable(o))).subscribe(n),n.add(t.subscribe(o))}))}},8259:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.count=void 0;var n=r(8083);t.count=function(e){return n.reduce((function(t,r,n){return!e||e(r,n)?t+1:t}),0)}},3473:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0;var n=r(6097),i=r(7116),o=r(7326),s=r(6958);t.debounce=function(e){return n.operate((function(t,r){var n=!1,a=null,c=null,u=function(){if(null==c||c.unsubscribe(),c=null,n){n=!1;var e=a;a=null,r.next(e)}};t.subscribe(o.createOperatorSubscriber(r,(function(t){null==c||c.unsubscribe(),n=!0,a=t,c=o.createOperatorSubscriber(r,u,i.noop),s.innerFrom(e(t)).subscribe(c)}),(function(){u(),r.complete()}),void 0,(function(){a=c=null})))}))}},8390:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounceTime=void 0;var n=r(7152),i=r(6097),o=r(7326);t.debounceTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.operate((function(r,n){var i=null,s=null,a=null,c=function(){if(i){i.unsubscribe(),i=null;var e=s;s=null,n.next(e)}};function u(){var r=a+e,o=t.now();if(o<r)return i=this.schedule(void 0,r-o),void n.add(i);c()}r.subscribe(o.createOperatorSubscriber(n,(function(r){s=r,a=t.now(),i||(i=t.schedule(u,e),n.add(i))}),(function(){c(),n.complete()}),void 0,(function(){s=i=null})))}))}},4562:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultIfEmpty=void 0;var n=r(6097),i=r(7326);t.defaultIfEmpty=function(e){return n.operate((function(t,r){var n=!1;t.subscribe(i.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){n||r.next(e),r.complete()})))}))}},8151:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0;var n=r(7152),i=r(744),o=r(8069);t.delay=function(e,t){void 0===t&&(t=n.asyncScheduler);var r=o.timer(e,t);return i.delayWhen((function(){return r}))}},744:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delayWhen=void 0;var n=r(3364),i=r(9438),o=r(9186),s=r(5471),a=r(6086),c=r(6958);t.delayWhen=function e(t,r){return r?function(s){return n.concat(r.pipe(i.take(1),o.ignoreElements()),s.pipe(e(t)))}:a.mergeMap((function(e,r){return c.innerFrom(t(e,r)).pipe(i.take(1),s.mapTo(e))}))}},8590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dematerialize=void 0;var n=r(9828),i=r(6097),o=r(7326);t.dematerialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){return n.observeNotification(e,t)})))}))}},8406:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinct=void 0;var n=r(6097),i=r(7326),o=r(7116),s=r(6958);t.distinct=function(e,t){return n.operate((function(r,n){var a=new Set;r.subscribe(i.createOperatorSubscriber(n,(function(t){var r=e?e(t):t;a.has(r)||(a.add(r),n.next(t))}))),t&&s.innerFrom(t).subscribe(i.createOperatorSubscriber(n,(function(){return a.clear()}),o.noop))}))}},7300:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilChanged=void 0;var n=r(8987),i=r(6097),o=r(7326);function s(e,t){return e===t}t.distinctUntilChanged=function(e,t){return void 0===t&&(t=n.identity),e=null!=e?e:s,i.operate((function(r,n){var i,s=!0;r.subscribe(o.createOperatorSubscriber(n,(function(r){var o=t(r);!s&&e(i,o)||(s=!1,i=o,n.next(r))})))}))}},4405:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilKeyChanged=void 0;var n=r(7300);t.distinctUntilKeyChanged=function(e,t){return n.distinctUntilChanged((function(r,n){return t?t(r[e],n[e]):r[e]===n[e]}))}},2787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementAt=void 0;var n=r(9216),i=r(7261),o=r(1332),s=r(4562),a=r(9438);t.elementAt=function(e,t){if(e<0)throw new n.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(c){return c.pipe(i.filter((function(t,r){return r===e})),a.take(1),r?s.defaultIfEmpty(t):o.throwIfEmpty((function(){return new n.ArgumentOutOfRangeError})))}}},1665:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.endWith=void 0;var o=r(3364),s=r(1377);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return o.concat(t,s.of.apply(void 0,i([],n(e))))}}},1511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.every=void 0;var n=r(6097),i=r(7326);t.every=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(i){e.call(t,i,o++,r)||(n.next(!1),n.complete())}),(function(){n.next(!0),n.complete()})))}))}},5592:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaust=void 0;var n=r(2008);t.exhaust=n.exhaustAll},2008:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustAll=void 0;var n=r(4019),i=r(8987);t.exhaustAll=function(){return n.exhaustMap(i.identity)}},4019:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustMap=void 0;var n=r(6269),i=r(6958),o=r(6097),s=r(7326);t.exhaustMap=function e(t,r){return r?function(o){return o.pipe(e((function(e,o){return i.innerFrom(t(e,o)).pipe(n.map((function(t,n){return r(e,t,o,n)})))})))}:o.operate((function(e,r){var n=0,o=null,a=!1;e.subscribe(s.createOperatorSubscriber(r,(function(e){o||(o=s.createOperatorSubscriber(r,void 0,(function(){o=null,a&&r.complete()})),i.innerFrom(t(e,n++)).subscribe(o))}),(function(){a=!0,!o&&r.complete()})))}))}},9101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expand=void 0;var n=r(6097),i=r(5926);t.expand=function(e,t,r){return void 0===t&&(t=1/0),t=(t||0)<1?1/0:t,n.operate((function(n,o){return i.mergeInternals(n,o,e,t,void 0,!0,r)}))}},7261:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filter=void 0;var n=r(6097),i=r(7326);t.filter=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){return e.call(t,r,o++)&&n.next(r)})))}))}},5381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.finalize=void 0;var n=r(6097);t.finalize=function(e){return n.operate((function(t,r){try{t.subscribe(r)}finally{r.add(e)}}))}},4127:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFind=t.find=void 0;var n=r(6097),i=r(7326);function o(e,t,r){var n="index"===r;return function(r,o){var s=0;r.subscribe(i.createOperatorSubscriber(o,(function(i){var a=s++;e.call(t,i,a,r)&&(o.next(n?a:i),o.complete())}),(function(){o.next(n?-1:void 0),o.complete()})))}}t.find=function(e,t){return n.operate(o(e,t,"value"))},t.createFind=o},9727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findIndex=void 0;var n=r(6097),i=r(4127);t.findIndex=function(e,t){return n.operate(i.createFind(e,t,"index"))}},7418:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.first=void 0;var n=r(9088),i=r(7261),o=r(9438),s=r(4562),a=r(1332),c=r(8987);t.first=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter((function(t,r){return e(t,r,u)})):c.identity,o.take(1),r?s.defaultIfEmpty(t):a.throwIfEmpty((function(){return new n.EmptyError})))}}},9121:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flatMap=void 0;var n=r(6086);t.flatMap=n.mergeMap},7533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupBy=void 0;var n=r(4174),i=r(6958),o=r(5294),s=r(6097),a=r(7326);t.groupBy=function(e,t,r,c){return s.operate((function(s,u){var l;t&&"function"!=typeof t?(r=t.duration,l=t.element,c=t.connector):l=t;var f=new Map,d=function(e){f.forEach(e),e(u)},h=function(e){return d((function(t){return t.error(e)}))},p=0,b=!1,m=new a.OperatorSubscriber(u,(function(t){try{var s=e(t),d=f.get(s);if(!d){f.set(s,d=c?c():new o.Subject);var g=(y=s,_=d,(w=new n.Observable((function(e){p++;var t=_.subscribe(e);return function(){t.unsubscribe(),0==--p&&b&&m.unsubscribe()}}))).key=y,w);if(u.next(g),r){var v=a.createOperatorSubscriber(d,(function(){d.complete(),null==v||v.unsubscribe()}),void 0,void 0,(function(){return f.delete(s)}));m.add(i.innerFrom(r(g)).subscribe(v))}}d.next(l?l(t):t)}catch(e){h(e)}var y,_,w}),(function(){return d((function(e){return e.complete()}))}),h,(function(){return f.clear()}),(function(){return b=!0,0===p}));s.subscribe(m)}))}},9186:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ignoreElements=void 0;var n=r(6097),i=r(7326),o=r(7116);t.ignoreElements=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,o.noop))}))}},7757:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=void 0;var n=r(6097),i=r(7326);t.isEmpty=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,(function(){t.next(!1),t.complete()}),(function(){t.next(!0),t.complete()})))}))}},2208:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.joinAllInternals=void 0;var n=r(8987),i=r(9364),o=r(5250),s=r(6086),a=r(9867);t.joinAllInternals=function(e,t){return o.pipe(a.toArray(),s.mergeMap((function(t){return e(t)})),t?i.mapOneOrManyArgs(t):n.identity)}},3374:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.last=void 0;var n=r(9088),i=r(7261),o=r(4125),s=r(1332),a=r(4562),c=r(8987);t.last=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter((function(t,r){return e(t,r,u)})):c.identity,o.takeLast(1),r?a.defaultIfEmpty(t):s.throwIfEmpty((function(){return new n.EmptyError})))}}},6269:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.map=void 0;var n=r(6097),i=r(7326);t.map=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){n.next(e.call(t,r,o++))})))}))}},5471:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTo=void 0;var n=r(6269);t.mapTo=function(e){return n.map((function(){return e}))}},1160:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.materialize=void 0;var n=r(9828),i=r(6097),o=r(7326);t.materialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){t.next(n.Notification.createNext(e))}),(function(){t.next(n.Notification.createComplete()),t.complete()}),(function(e){t.next(n.Notification.createError(e)),t.complete()})))}))}},1890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.max=void 0;var n=r(8083),i=r(2935);t.max=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}},3982:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var o=r(6097),s=r(5034),a=r(400),c=r(4544),u=r(4417);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=c.popScheduler(e),l=c.popNumber(e,1/0);return e=s.argsOrArgArray(e),o.operate((function(t,o){a.mergeAll(l)(u.from(i([t],n(e)),r)).subscribe(o)}))}},400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=void 0;var n=r(6086),i=r(8987);t.mergeAll=function(e){return void 0===e&&(e=1/0),n.mergeMap(i.identity,e)}},5926:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeInternals=void 0;var n=r(6958),i=r(5267),o=r(7326);t.mergeInternals=function(e,t,r,s,a,c,u,l){var f=[],d=0,h=0,p=!1,b=function(){!p||f.length||d||t.complete()},m=function(e){return d<s?g(e):f.push(e)},g=function(e){c&&t.next(e),d++;var l=!1;n.innerFrom(r(e,h++)).subscribe(o.createOperatorSubscriber(t,(function(e){null==a||a(e),c?m(e):t.next(e)}),(function(){l=!0}),void 0,(function(){if(l)try{d--;for(var e=function(){var e=f.shift();u?i.executeSchedule(t,u,(function(){return g(e)})):g(e)};f.length&&d<s;)e();b()}catch(e){t.error(e)}})))};return e.subscribe(o.createOperatorSubscriber(t,m,(function(){p=!0,b()}))),function(){null==l||l()}}},6086:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMap=void 0;var n=r(6269),i=r(6958),o=r(6097),s=r(5926),a=r(2935);t.mergeMap=function e(t,r,c){return void 0===c&&(c=1/0),a.isFunction(r)?e((function(e,o){return n.map((function(t,n){return r(e,t,o,n)}))(i.innerFrom(t(e,o)))}),c):("number"==typeof r&&(c=r),o.operate((function(e,r){return s.mergeInternals(e,r,t,c)})))}},1244:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMapTo=void 0;var n=r(6086),i=r(2935);t.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),i.isFunction(t)?n.mergeMap((function(){return e}),t,r):("number"==typeof t&&(r=t),n.mergeMap((function(){return e}),r))}},3699:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeScan=void 0;var n=r(6097),i=r(5926);t.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),n.operate((function(n,o){var s=t;return i.mergeInternals(n,o,(function(t,r){return e(s,t,r)}),r,(function(e){s=e}),!1,void 0,(function(){return s=null}))}))}},8220:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mergeWith=void 0;var o=r(3982);t.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.merge.apply(void 0,i([],n(e)))}},770:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.min=void 0;var n=r(8083),i=r(2935);t.min=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)<0?t:r}:function(e,t){return e<t?e:t})}},8413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multicast=void 0;var n=r(7165),i=r(2935),o=r(5561);t.multicast=function(e,t){var r=i.isFunction(e)?e:function(){return e};return i.isFunction(t)?o.connect(t,{connector:r}):function(e){return new n.ConnectableObservable(e,r)}}},9314:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeOn=void 0;var n=r(5267),i=r(6097),o=r(7326);t.observeOn=function(e,t){return void 0===t&&(t=0),i.operate((function(r,i){r.subscribe(o.createOperatorSubscriber(i,(function(r){return n.executeSchedule(i,e,(function(){return i.next(r)}),t)}),(function(){return n.executeSchedule(i,e,(function(){return i.complete()}),t)}),(function(r){return n.executeSchedule(i,e,(function(){return i.error(r)}),t)})))}))}},1899:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=t.onErrorResumeNextWith=void 0;var o=r(5034),s=r(8362);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=o.argsOrArgArray(e);return function(e){return s.onErrorResumeNext.apply(void 0,i([e],n(r)))}}t.onErrorResumeNextWith=a,t.onErrorResumeNext=a},1186:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairwise=void 0;var n=r(6097),i=r(7326);t.pairwise=function(){return n.operate((function(e,t){var r,n=!1;e.subscribe(i.createOperatorSubscriber(t,(function(e){var i=r;r=e,n&&t.next([i,e]),n=!0})))}))}},9857:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(8781),i=r(7261);t.partition=function(e,t){return function(r){return[i.filter(e,t)(r),i.filter(n.not(e,t))(r)]}}},9532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pluck=void 0;var n=r(6269);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw new Error("list of properties cannot be empty.");return n.map((function(t){for(var n=t,i=0;i<r;i++){var o=null==n?void 0:n[e[i]];if(void 0===o)return;n=o}return n}))}},5745:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publish=void 0;var n=r(5294),i=r(8413),o=r(5561);t.publish=function(e){return e?function(t){return o.connect(e)(t)}:function(e){return i.multicast(new n.Subject)(e)}}},8103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishBehavior=void 0;var n=r(8114),i=r(7165);t.publishBehavior=function(e){return function(t){var r=new n.BehaviorSubject(e);return new i.ConnectableObservable(t,(function(){return r}))}}},2610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishLast=void 0;var n=r(9960),i=r(7165);t.publishLast=function(){return function(e){var t=new n.AsyncSubject;return new i.ConnectableObservable(e,(function(){return t}))}}},5299:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishReplay=void 0;var n=r(8806),i=r(8413),o=r(2935);t.publishReplay=function(e,t,r,s){r&&!o.isFunction(r)&&(s=r);var a=o.isFunction(r)?r:void 0;return function(r){return i.multicast(new n.ReplaySubject(e,t,s),a)(r)}}},6699:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.race=void 0;var o=r(5034),s=r(3820);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.raceWith.apply(void 0,i([],n(o.argsOrArgArray(e))))}},3820:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.raceWith=void 0;var o=r(6849),s=r(6097),a=r(8987);t.raceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length?s.operate((function(t,r){o.raceInit(i([t],n(e)))(r)})):a.identity}},8083:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduce=void 0;var n=r(7235),i=r(6097);t.reduce=function(e,t){return i.operate(n.scanInternals(e,t,arguments.length>=2,!1,!0))}},4508:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refCount=void 0;var n=r(6097),i=r(7326);t.refCount=function(){return n.operate((function(e,t){var r=null;e._refCount++;var n=i.createOperatorSubscriber(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))}},2588:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeat=void 0;var n=r(6929),i=r(6097),o=r(7326),s=r(6958),a=r(8069);t.repeat=function(e){var t,r,c=1/0;return null!=e&&("object"==typeof e?(t=e.count,c=void 0===t?1/0:t,r=e.delay):c=e),c<=0?function(){return n.EMPTY}:i.operate((function(e,t){var n,i=0,u=function(){if(null==n||n.unsubscribe(),n=null,null!=r){var e="number"==typeof r?a.timer(r):s.innerFrom(r(i)),c=o.createOperatorSubscriber(t,(function(){c.unsubscribe(),l()}));e.subscribe(c)}else l()},l=function(){var r=!1;n=e.subscribe(o.createOperatorSubscriber(t,void 0,(function(){++i<c?n?u():r=!0:t.complete()}))),r&&u()};l()}))}},9249:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeatWhen=void 0;var n=r(6958),i=r(5294),o=r(6097),s=r(7326);t.repeatWhen=function(e){return o.operate((function(t,r){var o,a,c=!1,u=!1,l=!1,f=function(){return l&&u&&(r.complete(),!0)},d=function(){l=!1,o=t.subscribe(s.createOperatorSubscriber(r,void 0,(function(){l=!0,!f()&&(a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){o?d():c=!0}),(function(){u=!0,f()})))),a).next()}))),c&&(o.unsubscribe(),o=null,c=!1,d())};d()}))}},4486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retry=void 0;var n=r(6097),i=r(7326),o=r(8987),s=r(8069),a=r(6958);t.retry=function(e){var t;void 0===e&&(e=1/0);var r=(t=e&&"object"==typeof e?e:{count:e}).count,c=void 0===r?1/0:r,u=t.delay,l=t.resetOnSuccess,f=void 0!==l&&l;return c<=0?o.identity:n.operate((function(e,t){var r,n=0,o=function(){var l=!1;r=e.subscribe(i.createOperatorSubscriber(t,(function(e){f&&(n=0),t.next(e)}),void 0,(function(e){if(n++<c){var f=function(){r?(r.unsubscribe(),r=null,o()):l=!0};if(null!=u){var d="number"==typeof u?s.timer(u):a.innerFrom(u(e,n)),h=i.createOperatorSubscriber(t,(function(){h.unsubscribe(),f()}),(function(){t.complete()}));d.subscribe(h)}else f()}else t.error(e)}))),l&&(r.unsubscribe(),r=null,o())};o()}))}},9112:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retryWhen=void 0;var n=r(6958),i=r(5294),o=r(6097),s=r(7326);t.retryWhen=function(e){return o.operate((function(t,r){var o,a,c=!1,u=function(){o=t.subscribe(s.createOperatorSubscriber(r,void 0,void 0,(function(t){a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){return o?u():c=!0})))),a&&a.next(t)}))),c&&(o.unsubscribe(),o=null,c=!1,u())};u()}))}},778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sample=void 0;var n=r(6958),i=r(6097),o=r(7116),s=r(7326);t.sample=function(e){return i.operate((function(t,r){var i=!1,a=null;t.subscribe(s.createOperatorSubscriber(r,(function(e){i=!0,a=e}))),n.innerFrom(e).subscribe(s.createOperatorSubscriber(r,(function(){if(i){i=!1;var e=a;a=null,r.next(e)}}),o.noop))}))}},7701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleTime=void 0;var n=r(7152),i=r(778),o=r(3154);t.sampleTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.sample(o.interval(e,t))}},8167:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scan=void 0;var n=r(6097),i=r(7235);t.scan=function(e,t){return n.operate(i.scanInternals(e,t,arguments.length>=2,!0))}},7235:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scanInternals=void 0;var n=r(7326);t.scanInternals=function(e,t,r,i,o){return function(s,a){var c=r,u=t,l=0;s.subscribe(n.createOperatorSubscriber(a,(function(t){var r=l++;u=c?e(u,t,r):(c=!0,t),i&&a.next(u)}),o&&function(){c&&a.next(u),a.complete()}))}}},7821:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sequenceEqual=void 0;var n=r(6097),i=r(7326),o=r(6958);t.sequenceEqual=function(e,t){return void 0===t&&(t=function(e,t){return e===t}),n.operate((function(r,n){var s={buffer:[],complete:!1},a={buffer:[],complete:!1},c=function(e){n.next(e),n.complete()},u=function(e,r){var o=i.createOperatorSubscriber(n,(function(n){var i=r.buffer,o=r.complete;0===i.length?o?c(!1):e.buffer.push(n):!t(n,i.shift())&&c(!1)}),(function(){e.complete=!0;var t=r.complete,n=r.buffer;t&&c(0===n.length),null==o||o.unsubscribe()}));return o};r.subscribe(u(s,a)),o.innerFrom(e).subscribe(u(a,s))}))}},2645:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.share=void 0;var o=r(6958),s=r(5294),a=r(7747),c=r(6097);function u(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(!0!==t){if(!1!==t){var c=new a.SafeSubscriber({next:function(){c.unsubscribe(),e()}});return o.innerFrom(t.apply(void 0,i([],n(r)))).subscribe(c)}}else e()}t.share=function(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new s.Subject}:t,n=e.resetOnError,i=void 0===n||n,l=e.resetOnComplete,f=void 0===l||l,d=e.resetOnRefCountZero,h=void 0===d||d;return function(e){var t,n,s,l=0,d=!1,p=!1,b=function(){null==n||n.unsubscribe(),n=void 0},m=function(){b(),t=s=void 0,d=p=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return c.operate((function(e,c){l++,p||d||b();var v=s=null!=s?s:r();c.add((function(){0!==--l||p||d||(n=u(g,h))})),v.subscribe(c),!t&&l>0&&(t=new a.SafeSubscriber({next:function(e){return v.next(e)},error:function(e){p=!0,b(),n=u(m,i,e),v.error(e)},complete:function(){d=!0,b(),n=u(m,f),v.complete()}}),o.innerFrom(e).subscribe(t))}))(e)}}},7566:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shareReplay=void 0;var n=r(8806),i=r(2645);t.shareReplay=function(e,t,r){var o,s,a,c,u=!1;return e&&"object"==typeof e?(o=e.bufferSize,c=void 0===o?1/0:o,s=e.windowTime,t=void 0===s?1/0:s,u=void 0!==(a=e.refCount)&&a,r=e.scheduler):c=null!=e?e:1/0,i.share({connector:function(){return new n.ReplaySubject(c,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},4610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.single=void 0;var n=r(9088),i=r(7298),o=r(5722),s=r(6097),a=r(7326);t.single=function(e){return s.operate((function(t,r){var s,c=!1,u=!1,l=0;t.subscribe(a.createOperatorSubscriber(r,(function(n){u=!0,e&&!e(n,l++,t)||(c&&r.error(new i.SequenceError("Too many matching values")),c=!0,s=n)}),(function(){c?(r.next(s),r.complete()):r.error(u?new o.NotFoundError("No matching values"):new n.EmptyError)})))}))}},5735:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skip=void 0;var n=r(7261);t.skip=function(e){return n.filter((function(t,r){return e<=r}))}},3252:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipLast=void 0;var n=r(8987),i=r(6097),o=r(7326);t.skipLast=function(e){return e<=0?n.identity:i.operate((function(t,r){var n=new Array(e),i=0;return t.subscribe(o.createOperatorSubscriber(r,(function(t){var o=i++;if(o<e)n[o]=t;else{var s=o%e,a=n[s];n[s]=t,r.next(a)}}))),function(){n=null}}))}},1779:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipUntil=void 0;var n=r(6097),i=r(7326),o=r(6958),s=r(7116);t.skipUntil=function(e){return n.operate((function(t,r){var n=!1,a=i.createOperatorSubscriber(r,(function(){null==a||a.unsubscribe(),n=!0}),s.noop);o.innerFrom(e).subscribe(a),t.subscribe(i.createOperatorSubscriber(r,(function(e){return n&&r.next(e)})))}))}},5454:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipWhile=void 0;var n=r(6097),i=r(7326);t.skipWhile=function(e){return n.operate((function(t,r){var n=!1,o=0;t.subscribe(i.createOperatorSubscriber(r,(function(t){return(n||(n=!e(t,o++)))&&r.next(t)})))}))}},1923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startWith=void 0;var n=r(3364),i=r(4544),o=r(6097);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.popScheduler(e);return o.operate((function(t,i){(r?n.concat(e,t,r):n.concat(e,t)).subscribe(i)}))}},9130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeOn=void 0;var n=r(6097);t.subscribeOn=function(e,t){return void 0===t&&(t=0),n.operate((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}},1695:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchAll=void 0;var n=r(6649),i=r(8987);t.switchAll=function(){return n.switchMap(i.identity)}},6649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMap=void 0;var n=r(6958),i=r(6097),o=r(7326);t.switchMap=function(e,t){return i.operate((function(r,i){var s=null,a=0,c=!1,u=function(){return c&&!s&&i.complete()};r.subscribe(o.createOperatorSubscriber(i,(function(r){null==s||s.unsubscribe();var c=0,l=a++;n.innerFrom(e(r,l)).subscribe(s=o.createOperatorSubscriber(i,(function(e){return i.next(t?t(r,e,l,c++):e)}),(function(){s=null,u()})))}),(function(){c=!0,u()})))}))}},3054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMapTo=void 0;var n=r(6649),i=r(2935);t.switchMapTo=function(e,t){return i.isFunction(t)?n.switchMap((function(){return e}),t):n.switchMap((function(){return e}))}},2890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchScan=void 0;var n=r(6649),i=r(6097);t.switchScan=function(e,t){return i.operate((function(r,i){var o=t;return n.switchMap((function(t,r){return e(o,t,r)}),(function(e,t){return o=t,t}))(r).subscribe(i),function(){o=null}}))}},9438:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.take=void 0;var n=r(6929),i=r(6097),o=r(7326);t.take=function(e){return e<=0?function(){return n.EMPTY}:i.operate((function(t,r){var n=0;t.subscribe(o.createOperatorSubscriber(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}},4125:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.takeLast=void 0;var i=r(6929),o=r(6097),s=r(7326);t.takeLast=function(e){return e<=0?function(){return i.EMPTY}:o.operate((function(t,r){var i=[];t.subscribe(s.createOperatorSubscriber(r,(function(t){i.push(t),e<i.length&&i.shift()}),(function(){var e,t;try{for(var o=n(i),s=o.next();!s.done;s=o.next()){var a=s.value;r.next(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}r.complete()}),void 0,(function(){i=null})))}))}},9008:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeUntil=void 0;var n=r(6097),i=r(7326),o=r(6958),s=r(7116);t.takeUntil=function(e){return n.operate((function(t,r){o.innerFrom(e).subscribe(i.createOperatorSubscriber(r,(function(){return r.complete()}),s.noop)),!r.closed&&t.subscribe(r)}))}},5884:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeWhile=void 0;var n=r(6097),i=r(7326);t.takeWhile=function(e,t){return void 0===t&&(t=!1),n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){var i=e(r,o++);(i||t)&&n.next(r),!i&&n.complete()})))}))}},5383:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tap=void 0;var n=r(2935),i=r(6097),o=r(7326),s=r(8987);t.tap=function(e,t,r){var a=n.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return a?i.operate((function(e,t){var r;null===(r=a.subscribe)||void 0===r||r.call(a);var n=!0;e.subscribe(o.createOperatorSubscriber(t,(function(e){var r;null===(r=a.next)||void 0===r||r.call(a,e),t.next(e)}),(function(){var e;n=!1,null===(e=a.complete)||void 0===e||e.call(a),t.complete()}),(function(e){var r;n=!1,null===(r=a.error)||void 0===r||r.call(a,e),t.error(e)}),(function(){var e,t;n&&(null===(e=a.unsubscribe)||void 0===e||e.call(a)),null===(t=a.finalize)||void 0===t||t.call(a)})))})):s.identity}},1016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=void 0;var n=r(6097),i=r(7326),o=r(6958);t.throttle=function(e,t){return n.operate((function(r,n){var s=null!=t?t:{},a=s.leading,c=void 0===a||a,u=s.trailing,l=void 0!==u&&u,f=!1,d=null,h=null,p=!1,b=function(){null==h||h.unsubscribe(),h=null,l&&(v(),p&&n.complete())},m=function(){h=null,p&&n.complete()},g=function(t){return h=o.innerFrom(e(t)).subscribe(i.createOperatorSubscriber(n,b,m))},v=function(){if(f){f=!1;var e=d;d=null,n.next(e),!p&&g(e)}};r.subscribe(i.createOperatorSubscriber(n,(function(e){f=!0,d=e,(!h||h.closed)&&(c?v():g(e))}),(function(){p=!0,(!(l&&f&&h)||h.closed)&&n.complete()})))}))}},567:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttleTime=void 0;var n=r(7152),i=r(1016),o=r(8069);t.throttleTime=function(e,t,r){void 0===t&&(t=n.asyncScheduler);var s=o.timer(e,t);return i.throttle((function(){return s}),r)}},1332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfEmpty=void 0;var n=r(9088),i=r(6097),o=r(7326);function s(){return new n.EmptyError}t.throwIfEmpty=function(e){return void 0===e&&(e=s),i.operate((function(t,r){var n=!1;t.subscribe(o.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){return n?r.complete():r.error(e())})))}))}},1149:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeInterval=t.timeInterval=void 0;var n=r(7152),i=r(6097),o=r(7326);t.timeInterval=function(e){return void 0===e&&(e=n.asyncScheduler),i.operate((function(t,r){var n=e.now();t.subscribe(o.createOperatorSubscriber(r,(function(t){var i=e.now(),o=i-n;n=i,r.next(new s(t,o))})))}))};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},1316:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeout=t.TimeoutError=void 0;var n=r(7152),i=r(4426),o=r(6097),s=r(6958),a=r(3126),c=r(7326),u=r(5267);function l(e){throw new t.TimeoutError(e)}t.TimeoutError=a.createErrorClass((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}})),t.timeout=function(e,t){var r=i.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e,a=r.first,f=r.each,d=r.with,h=void 0===d?l:d,p=r.scheduler,b=void 0===p?null!=t?t:n.asyncScheduler:p,m=r.meta,g=void 0===m?null:m;if(null==a&&null==f)throw new TypeError("No timeout provided.");return o.operate((function(e,t){var r,n,i=null,o=0,l=function(e){n=u.executeSchedule(t,b,(function(){try{r.unsubscribe(),s.innerFrom(h({meta:g,lastValue:i,seen:o})).subscribe(t)}catch(e){t.error(e)}}),e)};r=e.subscribe(c.createOperatorSubscriber(t,(function(e){null==n||n.unsubscribe(),o++,t.next(i=e),f>0&&l(f)}),void 0,void 0,(function(){(null==n?void 0:n.closed)||null==n||n.unsubscribe(),i=null}))),!o&&l(null!=a?"number"==typeof a?a:+a-b.now():f)}))}},4972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutWith=void 0;var n=r(7152),i=r(4426),o=r(1316);t.timeoutWith=function(e,t,r){var s,a,c;if(r=null!=r?r:n.async,i.isValidDate(e)?s=e:"number"==typeof e&&(a=e),!t)throw new TypeError("No observable provided to switch to");if(c=function(){return t},null==s&&null==a)throw new TypeError("No timeout provided.");return o.timeout({first:s,each:a,scheduler:r,with:c})}},1275:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timestamp=void 0;var n=r(9168),i=r(6269);t.timestamp=function(e){return void 0===e&&(e=n.dateTimestampProvider),i.map((function(t){return{value:t,timestamp:e.now()}}))}},9867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0;var n=r(8083),i=r(6097),o=function(e,t){return e.push(t),e};t.toArray=function(){return i.operate((function(e,t){n.reduce(o,[])(e).subscribe(t)}))}},7649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.window=void 0;var n=r(5294),i=r(6097),o=r(7326),s=r(7116),a=r(6958);t.window=function(e){return i.operate((function(t,r){var i=new n.Subject;r.next(i.asObservable());var c=function(e){i.error(e),r.error(e)};return t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==i?void 0:i.next(e)}),(function(){i.complete(),r.complete()}),c)),a.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){i.complete(),r.next(i=new n.Subject)}),s.noop,c)),function(){null==i||i.unsubscribe(),i=null}}))}},5612:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowCount=void 0;var i=r(5294),o=r(6097),s=r(7326);t.windowCount=function(e,t){void 0===t&&(t=0);var r=t>0?t:e;return o.operate((function(t,o){var a=[new i.Subject],c=0;o.next(a[0].asObservable()),t.subscribe(s.createOperatorSubscriber(o,(function(t){var s,u;try{for(var l=n(a),f=l.next();!f.done;f=l.next()){f.value.next(t)}}catch(e){s={error:e}}finally{try{f&&!f.done&&(u=l.return)&&u.call(l)}finally{if(s)throw s.error}}var d=c-e+1;if(d>=0&&d%r==0&&a.shift().complete(),++c%r==0){var h=new i.Subject;a.push(h),o.next(h.asObservable())}}),(function(){for(;a.length>0;)a.shift().complete();o.complete()}),(function(e){for(;a.length>0;)a.shift().error(e);o.error(e)}),(function(){null,a=null})))}))}},9972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowTime=void 0;var n=r(5294),i=r(7152),o=r(4666),s=r(6097),a=r(7326),c=r(1291),u=r(4544),l=r(5267);t.windowTime=function(e){for(var t,r,f=[],d=1;d<arguments.length;d++)f[d-1]=arguments[d];var h=null!==(t=u.popScheduler(f))&&void 0!==t?t:i.asyncScheduler,p=null!==(r=f[0])&&void 0!==r?r:null,b=f[1]||1/0;return s.operate((function(t,r){var i=[],s=!1,u=function(e){var t=e.window,r=e.subs;t.complete(),r.unsubscribe(),c.arrRemove(i,e),s&&f()},f=function(){if(i){var t=new o.Subscription;r.add(t);var s=new n.Subject,a={window:s,subs:t,seen:0};i.push(a),r.next(s.asObservable()),l.executeSchedule(t,h,(function(){return u(a)}),e)}};null!==p&&p>=0?l.executeSchedule(r,h,f,p,!0):s=!0,f();var d=function(e){return i.slice().forEach(e)},m=function(e){d((function(t){var r=t.window;return e(r)})),e(r),r.unsubscribe()};return t.subscribe(a.createOperatorSubscriber(r,(function(e){d((function(t){t.window.next(e),b<=++t.seen&&u(t)}))}),(function(){return m((function(e){return e.complete()}))}),(function(e){return m((function(t){return t.error(e)}))}))),function(){i=null}}))}},9593:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowToggle=void 0;var i=r(5294),o=r(4666),s=r(6097),a=r(6958),c=r(7326),u=r(7116),l=r(1291);t.windowToggle=function(e,t){return s.operate((function(r,s){var f=[],d=function(e){for(;0<f.length;)f.shift().error(e);s.error(e)};a.innerFrom(e).subscribe(c.createOperatorSubscriber(s,(function(e){var r=new i.Subject;f.push(r);var n,h=new o.Subscription;try{n=a.innerFrom(t(e))}catch(e){return void d(e)}s.next(r.asObservable()),h.add(n.subscribe(c.createOperatorSubscriber(s,(function(){l.arrRemove(f,r),r.complete(),h.unsubscribe()}),u.noop,d)))}),u.noop)),r.subscribe(c.createOperatorSubscriber(s,(function(e){var t,r,i=f.slice();try{for(var o=n(i),s=o.next();!s.done;s=o.next()){s.value.next(e)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}),(function(){for(;0<f.length;)f.shift().complete();s.complete()}),d,(function(){for(;0<f.length;)f.shift().unsubscribe()})))}))}},6307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowWhen=void 0;var n=r(5294),i=r(6097),o=r(7326),s=r(6958);t.windowWhen=function(e){return i.operate((function(t,r){var i,a,c=function(e){i.error(e),r.error(e)},u=function(){var t;null==a||a.unsubscribe(),null==i||i.complete(),i=new n.Subject,r.next(i.asObservable());try{t=s.innerFrom(e())}catch(e){return void c(e)}t.subscribe(a=o.createOperatorSubscriber(r,u,u,c))};u(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return i.next(e)}),(function(){i.complete(),r.complete()}),c,(function(){null==a||a.unsubscribe(),i=null})))}))}},5512:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.withLatestFrom=void 0;var o=r(6097),s=r(7326),a=r(6958),c=r(8987),u=r(7116),l=r(4544);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e);return o.operate((function(t,o){for(var l=e.length,f=new Array(l),d=e.map((function(){return!1})),h=!1,p=function(t){a.innerFrom(e[t]).subscribe(s.createOperatorSubscriber(o,(function(e){f[t]=e,h||d[t]||(d[t]=!0,(h=d.every(c.identity))&&(d=null))}),u.noop))},b=0;b<l;b++)p(b);t.subscribe(s.createOperatorSubscriber(o,(function(e){if(h){var t=i([e],n(f));o.next(r?r.apply(void 0,i([],n(t))):t)}})))}))}},586:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(4981),s=r(6097);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.operate((function(t,r){o.zip.apply(void 0,i([t],n(e))).subscribe(r)}))}},1221:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zipAll=void 0;var n=r(4981),i=r(2208);t.zipAll=function(e){return i.joinAllInternals(n.zip,e)}},7594:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zipWith=void 0;var o=r(586);t.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.zip.apply(void 0,i([],n(e)))}},7456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleArray=void 0;var n=r(4174);t.scheduleArray=function(e,t){return new n.Observable((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}},4271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleAsyncIterable=void 0;var n=r(4174),i=r(5267);t.scheduleAsyncIterable=function(e,t){if(!e)throw new Error("Iterable cannot be null");return new n.Observable((function(r){i.executeSchedule(r,t,(function(){var n=e[Symbol.asyncIterator]();i.executeSchedule(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}},2485:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleIterable=void 0;var n=r(4174),i=r(7630),o=r(2935),s=r(5267);t.scheduleIterable=function(e,t){return new n.Observable((function(r){var n;return s.executeSchedule(r,t,(function(){n=e[i.iterator](),s.executeSchedule(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){return void r.error(e)}i?r.complete():r.next(t)}),0,!0)})),function(){return o.isFunction(null==n?void 0:n.return)&&n.return()}}))}},5892:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleObservable=void 0;var n=r(6958),i=r(9314),o=r(9130);t.scheduleObservable=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},6976:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schedulePromise=void 0;var n=r(6958),i=r(9314),o=r(9130);t.schedulePromise=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},4260:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleReadableStreamLike=void 0;var n=r(4271),i=r(2221);t.scheduleReadableStreamLike=function(e,t){return n.scheduleAsyncIterable(i.readableStreamLikeToAsyncGenerator(e),t)}},2862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduled=void 0;var n=r(5892),i=r(6976),o=r(7456),s=r(2485),a=r(4271),c=r(3124),u=r(4283),l=r(5445),f=r(8131),d=r(3260),h=r(7756),p=r(2221),b=r(4260);t.scheduled=function(e,t){if(null!=e){if(c.isInteropObservable(e))return n.scheduleObservable(e,t);if(l.isArrayLike(e))return o.scheduleArray(e,t);if(u.isPromise(e))return i.schedulePromise(e,t);if(d.isAsyncIterable(e))return a.scheduleAsyncIterable(e,t);if(f.isIterable(e))return s.scheduleIterable(e,t);if(p.isReadableStreamLike(e))return b.scheduleReadableStreamLike(e,t)}throw h.createInvalidObservableTypeError(e)}},2502:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=void 0;var o=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(4666).Subscription);t.Action=o},2142:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameAction=void 0;var o=r(9462),s=r(9015),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.animationFrameProvider.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.animationFrameProvider.cancelAnimationFrame(r),t._scheduled=void 0)},t}(o.AsyncAction);t.AnimationFrameAction=a},7104:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(9812).AsyncScheduler);t.AnimationFrameScheduler=o},4151:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapAction=void 0;var o=r(9462),s=r(4409),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.immediateProvider.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.immediateProvider.clearImmediate(r),t._scheduled===r&&(t._scheduled=void 0))},t}(o.AsyncAction);t.AsapAction=a},4726:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(9812).AsyncScheduler);t.AsapScheduler=o},9462:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=void 0;var o=r(2502),s=r(7549),a=r(1291),c=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return i(t,e),t.prototype.schedule=function(e,t){var r;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),s.intervalProvider.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&s.intervalProvider.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,a.arrRemove(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(o.Action);t.AsyncAction=c},9812:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncScheduler=void 0;var o=r(6949),s=function(e){function t(t,r){void 0===r&&(r=o.Scheduler.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return i(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(o.Scheduler);t.AsyncScheduler=s},5336:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=void 0;var o=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.flush(this),0)},t}(r(9462).AsyncAction);t.QueueAction=o},3667:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(9812).AsyncScheduler);t.QueueScheduler=o},2929:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualAction=t.VirtualTimeScheduler=void 0;var o=r(9462),s=r(4666),a=function(e){function t(t,r){void 0===t&&(t=c),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return i(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(r(9812).AsyncScheduler);t.VirtualTimeScheduler=a;var c=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return i(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return s.Subscription.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(o.AsyncAction);t.VirtualAction=c},8989:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrame=t.animationFrameScheduler=void 0;var n=r(2142),i=r(7104);t.animationFrameScheduler=new i.AnimationFrameScheduler(n.AnimationFrameAction),t.animationFrame=t.animationFrameScheduler},9015:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrameProvider=void 0;var o=r(4666);t.animationFrameProvider={schedule:function(e){var r=requestAnimationFrame,n=cancelAnimationFrame,i=t.animationFrameProvider.delegate;i&&(r=i.requestAnimationFrame,n=i.cancelAnimationFrame);var s=r((function(t){n=void 0,e(t)}));return new o.Subscription((function(){return null==n?void 0:n(s)}))},requestAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.requestAnimationFrame)||requestAnimationFrame).apply(void 0,i([],n(e)))},cancelAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,i([],n(e)))},delegate:void 0}},3769:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asap=t.asapScheduler=void 0;var n=r(4151),i=r(4726);t.asapScheduler=new i.AsapScheduler(n.AsapAction),t.asap=t.asapScheduler},7152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.async=t.asyncScheduler=void 0;var n=r(9462),i=r(9812);t.asyncScheduler=new i.AsyncScheduler(n.AsyncAction),t.async=t.asyncScheduler},9168:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateTimestampProvider=void 0,t.dateTimestampProvider={now:function(){return(t.dateTimestampProvider.delegate||Date).now()},delegate:void 0}},4409:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.immediateProvider=void 0;var o=r(998),s=o.Immediate.setImmediate,a=o.Immediate.clearImmediate;t.immediateProvider={setImmediate:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.immediateProvider.delegate;return((null==o?void 0:o.setImmediate)||s).apply(void 0,i([],n(e)))},clearImmediate:function(e){var r=t.immediateProvider.delegate;return((null==r?void 0:r.clearImmediate)||a)(e)},delegate:void 0}},7549:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.intervalProvider=void 0,t.intervalProvider={setInterval:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.intervalProvider.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,n([e,i],r(o))):setInterval.apply(void 0,n([e,i],r(o)))},clearInterval:function(e){var r=t.intervalProvider.delegate;return((null==r?void 0:r.clearInterval)||clearInterval)(e)},delegate:void 0}},2261:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.performanceTimestampProvider=void 0,t.performanceTimestampProvider={now:function(){return(t.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}},4093:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queue=t.queueScheduler=void 0;var n=r(5336),i=r(3667);t.queueScheduler=new i.QueueScheduler(n.QueueAction),t.queue=t.queueScheduler},1577:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutProvider=void 0,t.timeoutProvider={setTimeout:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.timeoutProvider.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,n([e,i],r(o))):setTimeout.apply(void 0,n([e,i],r(o)))},clearTimeout:function(e){var r=t.timeoutProvider.delegate;return((null==r?void 0:r.clearTimeout)||clearTimeout)(e)},delegate:void 0}},7630:(e,t)=>{"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.iterator=t.getSymbolIterator=void 0,t.getSymbolIterator=r,t.iterator=r()},4595:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable=void 0,t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},2793:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9216:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=void 0;var n=r(3126);t.ArgumentOutOfRangeError=n.createErrorClass((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}))},9088:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=void 0;var n=r(3126);t.EmptyError=n.createErrorClass((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}))},998:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTools=t.Immediate=void 0;var r,n=1,i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=n++;return i[t]=!0,r||(r=Promise.resolve()),r.then((function(){return o(t)&&e()})),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},5722:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotFoundError=void 0;var n=r(3126);t.NotFoundError=n.createErrorClass((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}}))},8499:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=void 0;var n=r(3126);t.ObjectUnsubscribedError=n.createErrorClass((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}))},7298:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceError=void 0;var n=r(3126);t.SequenceError=n.createErrorClass((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}))},4043:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=void 0;var n=r(3126);t.UnsubscriptionError=n.createErrorClass((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}))},4544:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.popNumber=t.popScheduler=t.popResultSelector=void 0;var n=r(2935),i=r(9668);function o(e){return e[e.length-1]}t.popResultSelector=function(e){return n.isFunction(o(e))?e.pop():void 0},t.popScheduler=function(e){return i.isScheduler(o(e))?e.pop():void 0},t.popNumber=function(e,t){return"number"==typeof o(e)?e.pop():t}},2398:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsArgArrayOrObject=void 0;var r=Array.isArray,n=Object.getPrototypeOf,i=Object.prototype,o=Object.keys;t.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(r(t))return{args:t,keys:null};if((a=t)&&"object"==typeof a&&n(a)===i){var s=o(t);return{args:s.map((function(e){return t[e]})),keys:s}}}var a;return{args:e,keys:null}}},5034:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsOrArgArray=void 0;var r=Array.isArray;t.argsOrArgArray=function(e){return 1===e.length&&r(e[0])?e[0]:e}},1291:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrRemove=void 0,t.arrRemove=function(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}},3126:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErrorClass=void 0,t.createErrorClass=function(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},4800:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObject=void 0,t.createObject=function(e,t){return e.reduce((function(e,r,n){return e[r]=t[n],e}),{})}},5444:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.captureError=t.errorContext=void 0;var n=r(9179),i=null;t.errorContext=function(e){if(n.config.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,o=r.errorThrown,s=r.error;if(i=null,o)throw s}}else e()},t.captureError=function(e){n.config.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},5267:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeSchedule=void 0,t.executeSchedule=function(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}},8987:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=void 0,t.identity=function(e){return e}},5445:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=void 0,t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},3260:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=void 0;var n=r(2935);t.isAsyncIterable=function(e){return Symbol.asyncIterator&&n.isFunction(null==e?void 0:e[Symbol.asyncIterator])}},4426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidDate=void 0,t.isValidDate=function(e){return e instanceof Date&&!isNaN(e)}},2935:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e}},3124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInteropObservable=void 0;var n=r(4595),i=r(2935);t.isInteropObservable=function(e){return i.isFunction(e[n.observable])}},8131:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIterable=void 0;var n=r(7630),i=r(2935);t.isIterable=function(e){return i.isFunction(null==e?void 0:e[n.iterator])}},3659:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObservable=void 0;var n=r(4174),i=r(2935);t.isObservable=function(e){return!!e&&(e instanceof n.Observable||i.isFunction(e.lift)&&i.isFunction(e.subscribe))}},4283:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=void 0;var n=r(2935);t.isPromise=function(e){return n.isFunction(null==e?void 0:e.then)}},2221:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},i=this&&this.__await||function(e){return this instanceof i?(this.v=e,this):new i(e)},o=this&&this.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){s.push([e,t,r,n])>1||c(e,t)}))})}function c(e,t){try{(r=o[e](t)).value instanceof i?Promise.resolve(r.value.v).then(u,l):f(s[0][2],r)}catch(e){f(s[0][3],e)}var r}function u(e){c("next",e)}function l(e){c("throw",e)}function f(e,t){e(t),s.shift(),s.length&&c(s[0][0],s[0][1])}};Object.defineProperty(t,"__esModule",{value:!0}),t.isReadableStreamLike=t.readableStreamLikeToAsyncGenerator=void 0;var s=r(2935);t.readableStreamLikeToAsyncGenerator=function(e){return o(this,arguments,(function(){var t,r,o;return n(this,(function(n){switch(n.label){case 0:t=e.getReader(),n.label=1;case 1:n.trys.push([1,,9,10]),n.label=2;case 2:return[4,i(t.read())];case 3:return r=n.sent(),o=r.value,r.done?[4,i(void 0)]:[3,5];case 4:return[2,n.sent()];case 5:return[4,i(o)];case 6:return[4,n.sent()];case 7:return n.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))},t.isReadableStreamLike=function(e){return s.isFunction(null==e?void 0:e.getReader)}},9668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=void 0;var n=r(2935);t.isScheduler=function(e){return e&&n.isFunction(e.schedule)}},6097:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.operate=t.hasLift=void 0;var n=r(2935);function i(e){return n.isFunction(null==e?void 0:e.lift)}t.hasLift=i,t.operate=function(e){return function(t){if(i(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},9364:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mapOneOrManyArgs=void 0;var o=r(6269),s=Array.isArray;t.mapOneOrManyArgs=function(e){return o.map((function(t){return function(e,t){return s(t)?e.apply(void 0,i([],n(t))):e(t)}(e,t)}))}},7116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=void 0,t.noop=function(){}},8781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=void 0,t.not=function(e,t){return function(r,n){return!e.call(t,r,n)}}},5250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pipeFromArray=t.pipe=void 0;var n=r(8987);function i(e){return 0===e.length?n.identity:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},1600:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportUnhandledError=void 0;var n=r(9179),i=r(1577);t.reportUnhandledError=function(e){i.timeoutProvider.setTimeout((function(){var t=n.config.onUnhandledError;if(!t)throw e;t(e)}))}},7756:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInvalidObservableTypeError=void 0,t.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},9002:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=t.merge=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.concat=t.combineLatestWith=t.combineLatest=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=void 0,t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.race=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.partition=t.pairwise=t.onErrorResumeNext=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=void 0,t.zipWith=t.zipAll=t.zip=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=void 0;var n=r(2605);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return n.audit}});var i=r(4152);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return i.auditTime}});var o=r(5149);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return o.buffer}});var s=r(3189);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return s.bufferCount}});var a=r(9459);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return a.bufferTime}});var c=r(8145);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return c.bufferToggle}});var u=r(7764);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return u.bufferWhen}});var l=r(3056);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return l.catchError}});var f=r(498);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return f.combineAll}});var d=r(7484);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return d.combineLatestAll}});var h=r(6527);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return h.combineLatest}});var p=r(4755);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return p.combineLatestWith}});var b=r(3792);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return b.concat}});var m=r(482);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return m.concatAll}});var g=r(1774);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return g.concatMap}});var v=r(3977);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return v.concatMapTo}});var y=r(7672);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return y.concatWith}});var _=r(5561);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return _.connect}});var w=r(8259);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return w.count}});var E=r(3473);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return E.debounce}});var O=r(8390);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return O.debounceTime}});var S=r(4562);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return S.defaultIfEmpty}});var A=r(8151);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return A.delay}});var P=r(744);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return P.delayWhen}});var T=r(8590);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return T.dematerialize}});var R=r(8406);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return R.distinct}});var x=r(7300);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return x.distinctUntilChanged}});var I=r(4405);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return I.distinctUntilKeyChanged}});var M=r(2787);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return M.elementAt}});var L=r(1665);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return L.endWith}});var k=r(1511);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return k.every}});var N=r(5592);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return N.exhaust}});var C=r(2008);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return C.exhaustAll}});var j=r(4019);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return j.exhaustMap}});var D=r(9101);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return D.expand}});var U=r(7261);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return U.filter}});var B=r(5381);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return B.finalize}});var F=r(4127);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return F.find}});var K=r(9727);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return K.findIndex}});var H=r(7418);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return H.first}});var G=r(7533);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return G.groupBy}});var $=r(9186);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return $.ignoreElements}});var V=r(7757);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return V.isEmpty}});var z=r(3374);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return z.last}});var q=r(6269);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return q.map}});var W=r(5471);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return W.mapTo}});var Z=r(1160);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return Z.materialize}});var J=r(1890);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return J.max}});var Y=r(3982);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return Y.merge}});var X=r(400);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return X.mergeAll}});var Q=r(9121);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return Q.flatMap}});var ee=r(6086);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ee.mergeMap}});var te=r(1244);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return te.mergeMapTo}});var re=r(3699);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return re.mergeScan}});var ne=r(8220);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ne.mergeWith}});var ie=r(770);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ie.min}});var oe=r(8413);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return oe.multicast}});var se=r(9314);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return se.observeOn}});var ae=r(1899);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return ae.onErrorResumeNext}});var ce=r(1186);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ce.pairwise}});var ue=r(9857);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ue.partition}});var le=r(9532);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return le.pluck}});var fe=r(5745);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return fe.publish}});var de=r(8103);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return de.publishBehavior}});var he=r(2610);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return he.publishLast}});var pe=r(5299);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return pe.publishReplay}});var be=r(6699);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return be.race}});var me=r(3820);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return me.raceWith}});var ge=r(8083);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return ge.reduce}});var ve=r(2588);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return ve.repeat}});var ye=r(9249);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return ye.repeatWhen}});var _e=r(4486);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return _e.retry}});var we=r(9112);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return we.retryWhen}});var Ee=r(4508);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return Ee.refCount}});var Oe=r(778);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Oe.sample}});var Se=r(7701);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Se.sampleTime}});var Ae=r(8167);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Ae.scan}});var Pe=r(7821);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Pe.sequenceEqual}});var Te=r(2645);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return Te.share}});var Re=r(7566);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Re.shareReplay}});var xe=r(4610);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return xe.single}});var Ie=r(5735);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return Ie.skip}});var Me=r(3252);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Me.skipLast}});var Le=r(1779);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return Le.skipUntil}});var ke=r(5454);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return ke.skipWhile}});var Ne=r(1923);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Ne.startWith}});var Ce=r(9130);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Ce.subscribeOn}});var je=r(1695);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return je.switchAll}});var De=r(6649);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return De.switchMap}});var Ue=r(3054);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Ue.switchMapTo}});var Be=r(2890);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Be.switchScan}});var Fe=r(9438);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Fe.take}});var Ke=r(4125);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return Ke.takeLast}});var He=r(9008);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return He.takeUntil}});var Ge=r(5884);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return Ge.takeWhile}});var $e=r(5383);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return $e.tap}});var Ve=r(1016);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return Ve.throttle}});var ze=r(567);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return ze.throttleTime}});var qe=r(1332);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return qe.throwIfEmpty}});var We=r(1149);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return We.timeInterval}});var Ze=r(1316);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Ze.timeout}});var Je=r(4972);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Je.timeoutWith}});var Ye=r(1275);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return Ye.timestamp}});var Xe=r(9867);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return Xe.toArray}});var Qe=r(7649);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return Qe.window}});var et=r(5612);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return et.windowCount}});var tt=r(9972);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return tt.windowTime}});var rt=r(9593);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return rt.windowToggle}});var nt=r(6307);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return nt.windowWhen}});var it=r(5512);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return it.withLatestFrom}});var ot=r(586);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return ot.zip}});var st=r(1221);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return st.zipAll}});var at=r(7594);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return at.zipWith}})},7834:(e,t,r)=>{var n=r(8834),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},3327:(e,t,r)=>{var n=r(7834).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,s=this._len,a=0;a<o;){for(var c=s%i,u=Math.min(o-a,i-c),l=0;l<u;l++)r[c+l]=e[a+l];a+=u,(s+=u)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},9065:(e,t,r)=>{var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(8820),n.sha1=r(7885),n.sha224=r(8321),n.sha256=r(4424),n.sha384=r(213),n.sha512=r(5596)},8820:(e,t,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,i.call(this,64,56)}function u(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,c=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=n)<<5|t>>>27)+l(h,i,o,a)+c+r[d]+s[h];c=a,a=o,o=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},7885:(e,t,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,i.call(this,64,56)}function u(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,c=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),b=u(n)+f(p,i,o,a)+c+r[h]+s[p]|0;c=a,a=o,o=l(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},8321:(e,t,r)=>{var n=r(1285),i=r(4424),o=r(3327),s=r(7834).Buffer,a=new Array(64);function c(){this.init(),this._w=a,o.call(this,64,56)}n(c,i),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=c},4424:(e,t,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,s=[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 Array(64);function c(){this.init(),this._w=a,i.call(this,64,56)}function u(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(c,i),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,c=0|this._e,p=0|this._f,b=0|this._g,m=0|this._h,g=0;g<16;++g)r[g]=e.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((t=r[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[g-7]+h(r[g-15])+r[g-16];for(var v=0;v<64;++v){var y=m+d(c)+u(c,p,b)+s[v]+r[v]|0,_=f(n)+l(n,i,o)|0;m=b,b=p,p=c,c=a+y|0,a=o,o=i,i=n,n=y+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=m+this._h|0},c.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},213:(e,t,r)=>{var n=r(1285),i=r(5596),o=r(3327),s=r(7834).Buffer,a=new Array(160);function c(){this.init(),this._w=a,o.call(this,128,112)}n(c,i),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=s.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=c},5596:(e,t,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function c(){this.init(),this._w=a,i.call(this,128,112)}function u(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>0?1:0}n(c,i),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,c=0|this._fh,v=0|this._gh,y=0|this._hh,_=0|this._al,w=0|this._bl,E=0|this._cl,O=0|this._dl,S=0|this._el,A=0|this._fl,P=0|this._gl,T=0|this._hl,R=0;R<32;R+=2)t[R]=e.readInt32BE(4*R),t[R+1]=e.readInt32BE(4*R+4);for(;R<160;R+=2){var x=t[R-30],I=t[R-30+1],M=h(x,I),L=p(I,x),k=b(x=t[R-4],I=t[R-4+1]),N=m(I,x),C=t[R-14],j=t[R-14+1],D=t[R-32],U=t[R-32+1],B=L+j|0,F=M+C+g(B,L)|0;F=(F=F+k+g(B=B+N|0,N)|0)+D+g(B=B+U|0,U)|0,t[R]=F,t[R+1]=B}for(var K=0;K<160;K+=2){F=t[K],B=t[K+1];var H=l(r,n,i),G=l(_,w,E),$=f(r,_),V=f(_,r),z=d(a,S),q=d(S,a),W=s[K],Z=s[K+1],J=u(a,c,v),Y=u(S,A,P),X=T+q|0,Q=y+z+g(X,T)|0;Q=(Q=(Q=Q+J+g(X=X+Y|0,Y)|0)+W+g(X=X+Z|0,Z)|0)+F+g(X=X+B|0,B)|0;var ee=V+G|0,te=$+H+g(ee,V)|0;y=v,T=P,v=c,P=A,c=a,A=S,a=o+Q+g(S=O+X|0,O)|0,o=i,O=E,i=n,E=w,n=r,w=_,r=Q+te+g(_=X+ee|0,X)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+E|0,this._dl=this._dl+O|0,this._el=this._el+S|0,this._fl=this._fl+A|0,this._gl=this._gl+P|0,this._hl=this._hl+T|0,this._ah=this._ah+r+g(this._al,_)|0,this._bh=this._bh+n+g(this._bl,w)|0,this._ch=this._ch+i+g(this._cl,E)|0,this._dh=this._dh+o+g(this._dl,O)|0,this._eh=this._eh+a+g(this._el,S)|0,this._fh=this._fh+c+g(this._fl,A)|0,this._gh=this._gh+v+g(this._gl,P)|0,this._hh=this._hh+y+g(this._hl,T)|0},c.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},4851:(e,t,r)=>{e.exports=i;var n=r(2699).EventEmitter;function i(){n.call(this)}r(1285)(i,n),i.Readable=r(8051),i.Writable=r(2557),i.Duplex=r(7073),i.Transform=r(7640),i.PassThrough=r(5163),i.finished=r(9885),i.pipeline=r(3495),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",c));var s=!1;function a(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",u),e.on("error",u),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},214:(e,t,r)=>{"use strict";var n=r(7834).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(i=s(t[n]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(i=s(t[n]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},8743:e=>{e.exports=function(e){return ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e)}},5803:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},227:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DeprecationError:()=>A,InvalidAddressError:()=>l,InvalidAmountError:()=>d,InvalidBlockHashError:()=>f,InvalidChainIdError:()=>w,InvalidContractAddressError:()=>_,InvalidDerivationPathError:()=>h,InvalidHexStringError:()=>p,InvalidKeyError:()=>g,InvalidKeyHashError:()=>E,InvalidMessageError:()=>b,InvalidOperationHashError:()=>O,InvalidOperationKindError:()=>S,InvalidPublicKeyError:()=>v,InvalidSignatureError:()=>y,InvalidViewParameterError:()=>m,NetworkError:()=>c,ParameterValidationError:()=>i,PermissionDeniedError:()=>u,ProhibitedActionError:()=>P,PublicKeyNotFoundError:()=>T,RpcError:()=>o,TaquitoError:()=>n,TezosToolkitConfigError:()=>s,UnsupportedActionError:()=>a});class n extends Error{}class i extends n{}class o extends n{}class s extends n{}class a extends n{}class c extends n{}class u extends n{}class l extends i{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidAddressError",this.message=`Invalid address "${e}"`,this.message+=t?` ${t}.`:"."}}class f extends i{constructor(e,t){super(),this.blockHash=e,this.errorDetail=t,this.name="InvalidBlockHashError",this.message=`Invalid block hash "${e}"`,this.message+=t?` ${t}.`:"."}}class d extends i{constructor(e){super(),this.amount=e,this.name="InvalidAmountError",this.message=`Invalid amount "${e}"`}}class h extends i{constructor(e,t){super(),this.derivationPath=e,this.errorDetail=t,this.name="InvalidDerivationPathError",this.message=`Invalid derivation path "${e}"`,this.message+=t?` ${t}.`:"."}}class p extends i{constructor(e,t){super(),this.hexString=e,this.errorDetail=t,this.name="InvalidHexStringError",this.message=`Invalid hex string "${e}"`,this.message+=t?` ${t}.`:"."}}class b extends i{constructor(e,t){super(),this.msg=e,this.errorDetail=t,this.name="InvalidMessageError",this.message=`Invalid message "${e}"`,this.message+=t?` ${t}.`:"."}}class m extends i{constructor(e,t,r,n){super(),this.viewName=e,this.sigs=t,this.args=r,this.cause=n,this.name="InvalidViewParameterError",this.message=`Invalid view arguments ${JSON.stringify(r)} received for name "${e}" expecting one of the following signatures ${JSON.stringify(t)}.`}}class g extends i{constructor(e){super(),this.errorDetail=e,this.name="InvalidKeyError",this.message="Invalid private key",this.message+=e?` ${e}.`:"."}}class v extends i{constructor(e,t){super(),this.publicKey=e,this.errorDetail=t,this.name="InvalidPublicKeyError",this.message=`Invalid public key "${e}"`,this.message+=t?` ${t}.`:"."}}class y extends i{constructor(e,t){super(),this.signature=e,this.errorDetail=t,this.name="InvalidSignatureError",this.message=`Invalid signature "${e}"`,this.message+=t?` ${t}.`:"."}}class _ extends i{constructor(e,t){super(),this.contractAddress=e,this.errorDetail=t,this.name="InvalidContractAddressError",this.message=`Invalid contract address "${e}"`,this.message+=t?` ${t}.`:"."}}class w extends i{constructor(e,t){super(),this.chainId=e,this.errorDetail=t,this.name="InvalidChainIdError",this.message=`Invalid chain id "${e}"`,this.message+=t?` ${t}.`:"."}}class E extends i{constructor(e,t){super(),this.keyHash=e,this.errorDetail=t,this.name="InvalidKeyHashError",this.message=`Invalid public key hash "${e}"`,this.message+=t?` ${t}.`:"."}}class O extends i{constructor(e,t){super(),this.operationHash=e,this.errorDetail=t,this.name="InvalidOperationHashError",this.message=`Invalid operation hash "${e}"`,this.message+=t?` ${t}.`:"."}}class S extends i{constructor(e,t){super(),this.operationKind=e,this.errorDetail=t,this.name="InvalidOperationKindError",this.message=`Invalid operation kind "${e}"`,this.message+=t?` ${t}.`:"."}}class A extends a{constructor(e){super(),this.message=e,this.name="DeprecationError"}}class P extends a{constructor(e){super(),this.message=e,this.name="ProhibitedActionError"}}class T extends n{constructor(e,t){super(),this.pkh=e,this.cause=t,this.name="PublicKeyNotFoundError",this.message=`Public key not found of this address "${e}" in either wallet or contract API.`}}},5543:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HttpBackend:()=>O,HttpRequestFailed:()=>b,HttpResponseError:()=>m,STATUS_CODE:()=>g,VERSION:()=>v});var n=r(9644),i=r.n(n),o=r(227);function s(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const a=r(6955),c=r(8030),u=r(7948),{isUndefined:l,isStandardBrowserEnv:f,isFormData:d}=r(3044);function h(e,t){return s(this,void 0,void 0,(function*(){try{const r=yield fetch(e);let n={ok:r.ok,status:r.status,statusText:r.statusText,headers:new Headers(r.headers),config:t,request:e};if(r.status>=400)return p("Response Error",t,"ERR_NETWORK",e,n);if(n={ok:r.ok,status:r.status,statusText:r.statusText,headers:new Headers(r.headers),config:t,request:e},r.status>=200&&204!==r.status)switch(t.responseType){case"arraybuffer":n.data=yield r.arrayBuffer();break;case"blob":n.data=yield r.blob();break;case"json":n.data=yield r.json();break;default:n.data=yield r.text()}return n}catch(r){return p("Network Error",t,"ERR_NETWORK",e)}}))}function p(e,t,r,n,i){return function(e,t,r,n,i){e.config=t,r&&(e.code=r);return e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:"description"in this?this.description:void 0,number:"number"in this?this.number:void 0,fileName:"fileName"in this?this.fileName:void 0,lineNumber:"lineNumber"in this?this.lineNumber:void 0,columnNumber:"columnNumber"in this?this.columnNumber:void 0,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}(new Error(e),t,r,n,i)}class b extends o.NetworkError{constructor(e,t,r){super(),this.method=e,this.url=t,this.cause=r,this.name="HttpRequestFailed",this.message=`${e} ${t} ${String(r)}`}}class m extends o.NetworkError{constructor(e,t,r,n,i){super(),this.message=e,this.status=t,this.statusText=r,this.body=n,this.url=i,this.name="HttpResponse"}}var g;!function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(g||(g={}));const v={commitHash:"a97e506efd61b86e39ae30db588401b8fda46553",version:"17.3.2"};var y;const _="undefined"!=typeof process&&!!(null===(y=null===process||void 0===process?void 0:process.versions)||void 0===y?void 0:y.node),w=_?void 0:function(e){return s(this,void 0,void 0,(function*(){const t=function(e){var t;const r=new Headers(e.headers);if(e.auth){const t=e.auth.username||"",n=e.auth.password?decodeURI(encodeURIComponent(e.auth.password)):"";r.set("Authorization",`Basic ${btoa(t+":"+n)}`)}const n=null===(t=e.method)||void 0===t?void 0:t.toUpperCase(),i={headers:r,method:n};"GET"!==n&&"HEAD"!==n&&(i.body=e.data,d(i.body)&&f()&&r.delete("Content-Type"));const o=e;"mode"in o&&(i.mode=o.mode);"cache"in o&&(i.cache=o.cache);"integrity"in o&&(i.integrity=o.integrity);"redirect"in o&&(i.redirect=o.redirect);"referrer"in o&&(i.referrer=o.referrer);l(o.withCredentials)||(i.credentials=o.withCredentials?"include":"omit");const s=u(o.baseURL,o.url),a=c(s,o.params,o.paramsSerializer);return new Request(a,i)}(e),r=[h(t,e)];e.timeout&&e.timeout>0&&r.push(new Promise((r=>{setTimeout((()=>{const n=e.timeoutErrorMessage?e.timeoutErrorMessage:"timeout of "+e.timeout+"ms exceeded";r(p(n,e,"ECONNABORTED",t))}),e.timeout)})));const n=yield Promise.race(r);return new Promise(((t,r)=>{if(n instanceof Error)r(n);else{const i=e;"settle"in i&&"[object Function]"===Object.prototype.toString.call(i.settle)?i.settle(t,r,n):a(t,r,n)}}))}))};var E;!function(e){e.TEXT="text",e.JSON="json"}(E||(E={}));class O{constructor(e=3e4){this.timeout=e}serialize(e){if(!e)return"";const t=[];for(const r in e)if(e.hasOwnProperty(r)&&void 0!==e[r]){const n="function"==typeof e[r].toJSON?e[r].toJSON():e[r];if(null===n){t.push(encodeURIComponent(r));continue}if(Array.isArray(n)){n.forEach((e=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(e))}));continue}t.push(encodeURIComponent(r)+"="+encodeURIComponent(n))}const r=t.join("&");return r?`?${r}`:""}createRequest({url:e,method:t,timeout:r=this.timeout,query:n,headers:o={},json:a=!0},c){return s(this,void 0,void 0,(function*(){const s=e+this.serialize(n);let u,l;o["Content-Type"]||(o["Content-Type"]="application/json"),a?u=E.JSON:(u=E.TEXT,l=[e=>e]);try{return(yield i().request({url:s,method:null!=t?t:"GET",headers:o,responseType:u,transformResponse:l,timeout:r,data:c,adapter:w})).data}catch(e){if(i().isAxiosError(e)&&e.response||!_&&e.response){let t;throw t="object"==typeof e.response.data?JSON.stringify(e.response.data):e.response.data,new m(`Http error response: (${e.response.status}) ${t}`,e.response.status,e.response.statusText,t,s)}throw new b(String(t),s,e)}}))}}},5078:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CODEC:()=>c,LocalForger:()=>Ue,ProtocolsHash:()=>Ne,Uint8ArrayConsumer:()=>T,VERSION:()=>Ce,decoders:()=>Ie,encoders:()=>Me,getCodec:()=>De,localForger:()=>Be,opMapping:()=>u,opMappingReverse:()=>l});var n=r(4632),i=r(227),o=r(2558);const s=e=>e.reduce(((e,t)=>e+t.toString(16).padStart(2,"0")),""),a=(e,t=8)=>e.toString(16).padStart(t,"0");var c;!function(e){e.SECRET="secret",e.RAW="raw",e.TZ1="tz1",e.BRANCH="branch",e.ZARITH="zarith",e.PUBLIC_KEY="public_key",e.PKH="pkh",e.DELEGATE="delegate",e.SCRIPT="script",e.BALLOT_STATEMENT="ballotStmt",e.PROPOSAL="proposal",e.PROPOSAL_ARR="proposalArr",e.INT32="int32",e.INT16="int16",e.PARAMETERS="parameters",e.ADDRESS="address",e.SMART_CONTRACT_ADDRESS="smart_contract_address",e.SMART_ROLLUP_ADDRESS="smart_rollup_address",e.SMART_ROLLUP_COMMITMENT_HASH="smart_rollup_commitment_hash",e.VALUE="value",e.PADDED_BYTES="padded_bytes",e.SMART_ROLLUP_MESSAGE="smart_rollup_message",e.MANAGER="manager",e.BLOCK_PAYLOAD_HASH="blockPayloadHash",e.ENTRYPOINT="entrypoint",e.OPERATION="operation",e.OP_ACTIVATE_ACCOUNT="activate_account",e.OP_DELEGATION="delegation",e.OP_TRANSACTION="transaction",e.OP_ORIGINATION="origination",e.OP_BALLOT="ballot",e.OP_FAILING_NOOP="failing_noop",e.OP_ENDORSEMENT="endorsement",e.OP_SEED_NONCE_REVELATION="seed_nonce_revelation",e.OP_REVEAL="reveal",e.OP_PROPOSALS="proposals",e.OP_REGISTER_GLOBAL_CONSTANT="register_global_constant",e.OP_TRANSFER_TICKET="transfer_ticket",e.OP_TX_ROLLUP_ORIGINATION="tx_rollup_origination",e.OP_TX_ROLLUP_SUBMIT_BATCH="tx_rollup_submit_batch",e.BURN_LIMIT="burn_limit",e.TX_ROLLUP_ORIGINATION_PARAM="tx_rollup_origination_param",e.TX_ROLLUP_ID="tx_rollup_id",e.TX_ROLLUP_BATCH_CONTENT="tx_rollup_batch_content",e.OP_INCREASE_PAID_STORAGE="increase_paid_storage",e.OP_UPDATE_CONSENSUS_KEY="update_consensus_key",e.OP_DRAIN_DELEGATE="drain_delegate",e.DEPOSITS_LIMIT="deposits_limit",e.OP_SET_DEPOSITS_LIMIT="set_deposits_limit",e.OP_SMART_ROLLUP_ORIGINATE="smart_rollup_originate",e.PVM_KIND="pvm_kind",e.OP_SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",e.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message"}(c||(c={}));const u={"00":"parameter","01":"storage","02":"code","03":"False","04":"Elt","05":"Left","06":"None","07":"Pair","08":"Right","09":"Some","0a":"True","0b":"Unit","0c":"PACK","0d":"UNPACK","0e":"BLAKE2B","0f":"SHA256",10:"SHA512",11:"ABS",12:"ADD",13:"AMOUNT",14:"AND",15:"BALANCE",16:"CAR",17:"CDR",18:"CHECK_SIGNATURE",19:"COMPARE","1a":"CONCAT","1b":"CONS","1c":"CREATE_ACCOUNT","1d":"CREATE_CONTRACT","1e":"IMPLICIT_ACCOUNT","1f":"DIP",20:"DROP",21:"DUP",22:"EDIV",23:"EMPTY_MAP",24:"EMPTY_SET",25:"EQ",26:"EXEC",27:"FAILWITH",28:"GE",29:"GET","2a":"GT","2b":"HASH_KEY","2c":"IF","2d":"IF_CONS","2e":"IF_LEFT","2f":"IF_NONE",30:"INT",31:"LAMBDA",32:"LE",33:"LEFT",34:"LOOP",35:"LSL",36:"LSR",37:"LT",38:"MAP",39:"MEM","3a":"MUL","3b":"NEG","3c":"NEQ","3d":"NIL","3e":"NONE","3f":"NOT",40:"NOW",41:"OR",42:"PAIR",43:"PUSH",44:"RIGHT",45:"SIZE",46:"SOME",47:"SOURCE",48:"SENDER",49:"SELF","4a":"STEPS_TO_QUOTA","4b":"SUB","4c":"SWAP","4d":"TRANSFER_TOKENS","4e":"SET_DELEGATE","4f":"UNIT",50:"UPDATE",51:"XOR",52:"ITER",53:"LOOP_LEFT",54:"ADDRESS",55:"CONTRACT",56:"ISNAT",57:"CAST",58:"RENAME",59:"bool","5a":"contract","5b":"int","5c":"key","5d":"key_hash","5e":"lambda","5f":"list",60:"map",61:"big_map",62:"nat",63:"option",64:"or",65:"pair",66:"set",67:"signature",68:"string",69:"bytes","6a":"mutez","6b":"timestamp","6c":"unit","6d":"operation","6e":"address","6f":"SLICE",70:"DIG",71:"DUG",72:"EMPTY_BIG_MAP",73:"APPLY",74:"chain_id",75:"CHAIN_ID",76:"LEVEL",77:"SELF_ADDRESS",78:"never",79:"NEVER","7a":"UNPAIR","7b":"VOTING_POWER","7c":"TOTAL_VOTING_POWER","7d":"KECCAK","7e":"SHA3","7f":"PAIRING_CHECK",80:"bls12_381_g1",81:"bls12_381_g2",82:"bls12_381_fr",83:"sapling_state",84:"sapling_transaction_deprecated",85:"SAPLING_EMPTY_STATE",86:"SAPLING_VERIFY_UPDATE",87:"ticket",88:"TICKET_DEPRECATED",89:"READ_TICKET","8a":"SPLIT_TICKET","8b":"JOIN_TICKETS","8c":"GET_AND_UPDATE","8d":"chest","8e":"chest_key","8f":"OPEN_CHEST",90:"VIEW",91:"view",92:"constant",93:"SUB_MUTEZ",94:"tx_rollup_l2_address",95:"MIN_BLOCK_TIME",96:"sapling_transaction",97:"EMIT",98:"Lambda_rec",99:"LAMBDA_REC","9a":"TICKET","9b":"BYTES","9c":"NAT"},l=(()=>{const e={};return Object.keys(u).forEach((t=>{e[u[t]]=t})),e})(),f={4:"activate_account",107:"reveal",110:"delegation",108:"transaction",109:"origination",6:"ballot",21:"endorsement",1:"seed_nonce_revelation",5:"proposals",111:"register_global_constant",150:"tx_rollup_origination",151:"tx_rollup_submit_batch",158:"transfer_ticket",112:"set_deposits_limit",113:"increase_paid_storage",114:"update_consensus_key",9:"drain_delegate",200:"smart_rollup_originate",201:"smart_rollup_add_messages",206:"smart_rollup_execute_outbox_message",17:"failing_noop"},d=(()=>{const e={};return Object.keys(f).forEach((t=>{const r="string"==typeof t?parseInt(t,10):t;e[f[r]]=a(r,2)})),e})(),h={"00":"default","01":"root","02":"do","03":"set_delegate","04":"remove_delegate","05":"deposit"},p=(()=>{const e={};return Object.keys(h).forEach((t=>{e[h[t]]=t})),e})();class b extends i.ParameterValidationError{constructor(e,t){super(),this.operation=e,this.errorDetail=t,this.name="InvalidOperationSchemaError",this.message="Invalid operation content recevied",t&&(this.message+=` ${t}.`)}}class m extends i.ParameterValidationError{constructor(e){super(),this.entrypoint=e,this.name="OversizedEntryPointError",this.message=`Invalid entrypoint length "${e.length}", maximum length is "31".`}}class g extends i.ParameterValidationError{constructor(e){super(),this.ballotValue=e,this.name="InvalidBallotValueError",this.message=`Invalid ballot value "${e}" expecting one of the following: "yay", "nay", "pass".`}}class v extends i.ParameterValidationError{constructor(e){super(),this.ballotValue=e,this.name="DecodeBallotValueError",this.message=`Invalid ballot value "${e}", cannot be decoded.`}}class y extends i.ParameterValidationError{constructor(e){super(),this.value=e,this.name="UnexpectedMichelsonValueError",this.message=`Invalid Michelson value "${e}", unalbe to encode.`}}class _ extends i.ParameterValidationError{constructor(e){super(),this.message=e,this.name="OperationDecodingError"}}class w extends i.ParameterValidationError{constructor(e){super(),this.message=e,this.name="OperationEncodingError"}}class E extends i.ParameterValidationError{constructor(e){super(),this.op=e,this.name="UnsupportedOperationError",this.message=`Unsupported operation "${e}", can submit an issue on our github for feature request.`}}class O extends i.ParameterValidationError{constructor(e){super(),this.pvm=e,this.name="UnsupportedPvmKindError",this.message=`Invalid Pvm kind "${e}" expecting either "arith" or "wasm_2_0_0".`}}class S extends i.ParameterValidationError{constructor(e){super(),this.pvm=e,this.name="DecodePvmKindError",this.message=`Invalid Pvm kind "${e}", cannot be decoded.`}}class A extends i.ParameterValidationError{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidSmartRollupAddress",this.message=`Invalid smart rollup address "${e}"`,t&&(this.message+=` ${t}.`)}}class P extends i.ParameterValidationError{constructor(e,t){super(),this.hash=e,this.errorDetail=t,this.name="InvalidSmartRollupCommitmentHashError",this.message=`Invalid smart rollup commitment hash "${e}"`,t&&(this.message+=` ${t}.`)}}class T{constructor(e,t=0){this.arr=e,this.offset=t}static fromHexString(e){const t=e.toLowerCase();if(/^(([a-f]|\d){2})*$/.test(t)){const e=new Uint8Array((t.match(/([a-z]|\d){2}/g)||[]).map((e=>parseInt(e,16))));return new T(e)}throw new i.InvalidHexStringError(t)}consume(e){const t=this.arr.subarray(this.offset,this.offset+e);return this.offset+=e,t}get(e){return this.arr[this.offset+e]}length(){return this.arr.length-this.offset}slice(e,t){return new T(this.arr.slice(e,t))}}const R=e=>{if(Array.isArray(e)){const t=e.map((e=>R(e))).join(""),r=t.length/2;return`02${a(r)}${t}`}if((e=>"prim"in e)(e))return D(e);if((e=>"bytes"in e&&"string"==typeof e.bytes)(e))return M(e);if((e=>"string"in e&&"string"==typeof e.string)(e))return k(e);if((e=>"int"in e&&"string"==typeof e.int)(e))return C(e);throw new y(JSON.stringify(e))},x=e=>{const t=e.consume(1);switch(t[0]){case 10:return L(e);case 1:return N(e);case 0:return j(e);case 2:{const t=new T(I(e)),r=[];for(;t.length()>0;)r.push(x(t));return r}default:return U(e,t)}},I=(e,t=4)=>{const r=e.consume(t),n=parseInt(Buffer.from(r).toString("hex"),16);return e.consume(n)},M=e=>{if(!/^([A-Fa-f0-9]{2})*$/.test(e.bytes))throw new i.InvalidHexStringError(e.bytes);const t=e.bytes.length/2;return`0a${a(t)}${e.bytes}`},L=e=>{const t=I(e);return{bytes:Buffer.from(t).toString("hex")}},k=e=>{const t=Buffer.from(e.string,"utf8").toString("hex"),r=t.length/2;return`01${a(r)}${t}`},N=e=>{const t=I(e);return{string:Buffer.from(t).toString("utf8")}},C=({int:e})=>{const t=new o.O(e,10),r="-"===t.toString(2)[0]?"1":"0",n=t.toString(2).replace(/-/g,""),i=n.length<=6?6:(n.length-6)%7?n.length+7-(n.length-6)%7:n.length,s=n.padStart(i,"0").match(/\d{6,7}/g).reverse();s[0]=r+s[0];return`00${s.map(((e,t)=>parseInt((t===s.length-1?"0":"1")+e,2).toString(16).padStart(2,"0"))).join("")}`},j=e=>{let t=e.consume(1)[0];const r=[];for(;128&t;)r.push(t),t=e.consume(1)[0];r.push(t);const n=!!(64&r[0]);r[0]=127&r[0];const i=r.map(((e,t)=>e.toString(2).slice(0===t?-6:-7).padStart(0===t?6:7,"0"))).reverse();let s=new o.O(i.join(""),2);return n&&(s=s.times(-1)),{int:s.toFixed()}},D=e=>{const t=+Array.isArray(e.annots),r=Array.isArray(e.args)?e.args.length:0,n=a(Math.min(2*r+t+3,9),2),i=l[e.prim];let o=(e.args||[]).map((e=>R(e))).join("");const s=Array.isArray(e.annots)?K(e.annots):"";return"LAMBDA"!==e.prim&&"LAMBDA_REC"!==e.prim||!r||(o=a(o.length/2)+o+a(0)),("pair"===e.prim||"Pair"===e.prim)&&r>2&&(o=""===s?a(o.length/2)+o+a(0):a(o.length/2)+o),"view"===e.prim&&e.args&&(o=a(o.length/2)+o+a(0)),`${n}${i}${o}${s}`},U=(e,t)=>{const r=(t[0]-3)%2==1;let n=Math.floor((t[0]-3)/2);const i=e.consume(1)[0].toString(16).padStart(2,"0"),o={prim:u[i]};if("LAMBDA"!==u[i]&&"LAMBDA_REC"!==u[i]||e.consume(4),"view"===u[i])return 0!=n?B(e,o):o;let s,a;("pair"===u[i]||"Pair"===u[i])&&n>2&&(s=F(e),n=0,a=H(e));const c=new Array(n).fill(0).map((()=>x(e)));return"LAMBDA"!==u[i]&&"LAMBDA_REC"!==u[i]||e.consume(4),s?o.args=s:c.length&&(o.args=c),a&&""!==a[0]?o.annots=a:r&&(o.annots=H(e)),o},B=(e,t)=>(e.consume(4),t.args=new Array(4).fill(0).map((()=>x(e))),e.consume(4),t),F=e=>{const t=new T(I(e)),r=[];for(;t.length()>0;)r.push(x(t));return r},K=e=>{const t=e.map((e=>Buffer.from(e,"utf8").toString("hex"))).join("20"),r=t.length/2;return`${a(r)}${t}`},H=e=>{const t=e.consume(4),r=parseInt(Buffer.from(t).toString("hex"),16),n=e.consume(r);return Buffer.from(n).toString("hex").split("20").map((e=>Buffer.from(e,"hex").toString("utf8")))},G=e=>t=>(0,n.buf2hex)(Buffer.from((0,n.b58cdecode)(t,n.prefix[e]))),$=e=>t=>{const r=t.consume(n.prefixLength[e]);return(0,n.b58cencode)(r,n.prefix[e])},V=$(n.Prefix.TZ1),z=$(n.Prefix.B),q=e=>{const t=e.consume(1);return 0===t[0]?$(n.Prefix.TZ1)(e):1===t[0]?$(n.Prefix.TZ2)(e):2===t[0]?$(n.Prefix.TZ3)(e):void 0},W=G(n.Prefix.B),Z=G(n.Prefix.TZ1),J=e=>e?"ff":"00",Y=e=>G(n.Prefix.P)(e),X=e=>$(n.Prefix.P)(e),Q=e=>{switch(e.substring(0,3)){case n.Prefix.TZ1:return"00"+G(n.Prefix.TZ1)(e);case n.Prefix.TZ2:return"01"+G(n.Prefix.TZ2)(e);case n.Prefix.TZ3:return"02"+G(n.Prefix.TZ3)(e);case n.Prefix.TZ4:return"03"+G(n.Prefix.TZ4)(e);default:throw new n.InvalidKeyHashError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting one for the following "${n.Prefix.TZ1}", "${n.Prefix.TZ2}", "${n.Prefix.TZ3}" or "${n.Prefix.TZ4}".`)}},ee=e=>{const t=[];let r=new o.Z(e,10);if(r.isNaN())throw new TypeError(`Invalid zarith number ${e}`);for(;;){if(r.lt(128)){r.lt(16)&&t.push("0"),t.push(r.toString(16));break}{let e=r.mod(128);r=r.minus(e),r=r.dividedBy(128),e=e.plus(128),t.push(e.toString(16))}}return t.join("")},te=e=>{let t=0;for(;t<e.length()&&0!=(128&e.get(t));)t+=1;let r=new o.Z(0);for(let n=t;n>=0;n-=1){const t=127&e.get(n);r=r.multipliedBy(128),r=r.plus(t)}return e.consume(t+1),new o.Z(r).toString()},re=G(n.Prefix.VH),ne=$(n.Prefix.VH),ie=G(n.Prefix.TXR1),oe=$(n.Prefix.TXR1),se={branch:c.BRANCH,contents:[c.OPERATION]},ae={pkh:c.TZ1,secret:c.SECRET},ce={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,public_key:c.PUBLIC_KEY},ue={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,delegate:c.DELEGATE},le={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,amount:c.ZARITH,destination:c.ADDRESS,parameters:c.PARAMETERS},fe={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,balance:c.ZARITH,delegate:c.DELEGATE,script:c.SCRIPT},de={source:c.PKH,period:c.INT32,proposal:c.PROPOSAL,ballot:c.BALLOT_STATEMENT},he={slot:c.INT16,level:c.INT32,round:c.INT32,block_payload_hash:c.BLOCK_PAYLOAD_HASH},pe={level:c.INT32,nonce:c.RAW},be={source:c.PKH,period:c.INT32,proposals:c.PROPOSAL_ARR},me={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,value:c.VALUE},ge={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,ticket_contents:c.VALUE,ticket_ty:c.VALUE,ticket_ticketer:c.ADDRESS,ticket_amount:c.ZARITH,destination:c.ADDRESS,entrypoint:c.ENTRYPOINT},ve={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,tx_rollup_origination:c.TX_ROLLUP_ORIGINATION_PARAM},ye={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,rollup:c.TX_ROLLUP_ID,content:c.TX_ROLLUP_BATCH_CONTENT,burn_limit:c.BURN_LIMIT},_e={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,amount:c.ZARITH,destination:c.SMART_CONTRACT_ADDRESS},we={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,pk:c.PUBLIC_KEY},Ee={consensus_key:c.PKH,delegate:c.PKH,destination:c.PKH},Oe={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,limit:c.DEPOSITS_LIMIT},Se={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,pvm_kind:c.PVM_KIND,kernel:c.PADDED_BYTES,origination_proof:c.PADDED_BYTES,parameters_ty:c.VALUE},Ae={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,message:c.SMART_ROLLUP_MESSAGE},Pe={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,rollup:c.SMART_ROLLUP_ADDRESS,cemented_commitment:c.SMART_ROLLUP_COMMITMENT_HASH,output_proof:c.PADDED_BYTES},Te={arbitrary:c.PADDED_BYTES},Re=e=>t=>r=>Object.keys(t).reduce(((n,i)=>{const o=t[i];if(r&&Array.isArray(o)){const t=e[o[0]],s=r[i];if(!Array.isArray(s))throw new w(`Invalid operation value "${JSON.stringify(s)}" of key "${i}, expected value to be Array.`);return n+s.reduce(((e,r)=>e+t(r)),"")}return n+(0,e[o])(r[i])}),""),xe=e=>t=>r=>Object.keys(t).reduce(((n,i)=>{const o=t[i];if(Array.isArray(o)){const t=e[o[0]],s=[],a=r.length();for(;r.length()>0;)if(s.push(t(r)),a===r.length())throw new _("Unable to decode value");return Object.assign(Object.assign({},n),{[i]:s})}{const t=(0,e[o])(r);return void 0!==t?Object.assign(Object.assign({},n),{[i]:t}):Object.assign({},n)}}),{}),Ie={[c.SECRET]:e=>s(e.consume(20)),[c.RAW]:e=>s(e.consume(32)),[c.TZ1]:V,[c.BRANCH]:z,[c.ZARITH]:te,[c.PUBLIC_KEY]:e=>{switch(e.consume(1)[0]){case 0:return $(n.Prefix.EDPK)(e);case 1:return $(n.Prefix.SPPK)(e);case 2:return $(n.Prefix.P2PK)(e);default:throw new n.InvalidPublicKeyError(e.toString(),(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED))}},[c.PKH]:q,[c.DELEGATE]:e=>{const t=(e=>255===e.consume(1)[0])(e);if(t)return q(e)},[c.INT32]:e=>{const t=e.consume(4);let r=0;for(let e=0;e<t.length;e++)r|=t[e]<<8*(t.length-(e+1));return r},[c.SCRIPT]:e=>{const t=I(e),r=I(e);return{code:x(new T(t)),storage:x(new T(r))}},[c.BALLOT_STATEMENT]:e=>{const t=e.consume(1);switch(t[0]){case 0:return"yay";case 1:return"nay";case 2:return"pass";default:throw new v(t[0].toString())}},[c.PROPOSAL]:X,[c.PROPOSAL_ARR]:e=>{const t=[];for(e.consume(4);e.length()>0;)t.push(X(e));return t},[c.PARAMETERS]:e=>{if(0!==e.consume(1)[0]){const t=(e=>{const t=a(e.consume(1)[0],2);if(t in h)return h[t];{const t=I(e,1),r=Buffer.from(t).toString("utf8");if(r.length>31)throw new m(r);return r}})(e),r=I(e);return{entrypoint:t,value:x(new T(r))}}},[c.ADDRESS]:e=>{switch(e.consume(1)[0]){case 0:return q(e);case 1:{const t=$(n.Prefix.KT1)(e);return e.consume(1),t}default:throw new i.InvalidAddressError(e.toString(),": Unable to decode.")}},[c.SMART_ROLLUP_ADDRESS]:e=>{const t=$(n.Prefix.SR1)(e);if(t.substring(0,3)!==n.Prefix.SR1)throw new A(t,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SR1}'.`);return t},[c.SMART_CONTRACT_ADDRESS]:e=>{if(1===e.consume(1)[0]){const t=$(n.Prefix.KT1)(e);return e.consume(1),t}throw new i.InvalidContractAddressError(e.toString(),(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED))},[c.SMART_ROLLUP_COMMITMENT_HASH]:e=>{const t=$(n.Prefix.SRC1)(e);if(t.substring(0,4)!==n.Prefix.SRC1)throw new P(t,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SRC1}'`);return t},[c.VALUE]:e=>{const t=I(e);return x(new T(t))},[c.INT16]:e=>{const t=e.consume(2);let r=0;for(let e=0;e<t.length;e++)r|=t[e]<<8*(t.length-(e+1));return r},[c.BLOCK_PAYLOAD_HASH]:ne,[c.ENTRYPOINT]:e=>{const t=I(e);return Buffer.from(t).toString("utf8")},[c.TX_ROLLUP_ORIGINATION_PARAM]:e=>({}),[c.TX_ROLLUP_ID]:oe,[c.TX_ROLLUP_BATCH_CONTENT]:e=>{const t=I(e);return Buffer.from(t).toString("hex")},[c.BURN_LIMIT]:e=>{const t=e.consume(1);if("00"!==Buffer.from(t).toString("hex"))return te(e)},[c.DEPOSITS_LIMIT]:e=>{const t=e.consume(1);if("00"!==Buffer.from(t).toString("hex"))return te(e)},[c.PVM_KIND]:e=>{const t=e.consume(1);switch(t[0]){case 0:return"arith";case 1:return"wasm_2_0_0";default:throw new S(t[0].toString())}},[c.PADDED_BYTES]:e=>{const t=I(e);return Buffer.from(t).toString("hex")},[c.SMART_ROLLUP_MESSAGE]:e=>{const t=I(e);return((e,t=4)=>{const r=[];let n=e;for(;n.length();){const e=n.consume(t),i=parseInt(Buffer.from(e).toString("hex"),16);r.push(n.consume(i)),n=n.slice(i+t)}return r})(new T(t)).map((e=>Buffer.from(e).toString("hex")))}};Ie[c.OPERATION]=(e=>t=>{const r=t.consume(1),n=f[r[0]];if(void 0===n)throw new E(r[0].toString());const i=e[n](t);if("object"!=typeof i)throw new _("Invalid operation, cannot be decoded.");return Object.assign({kind:n},i)})(Ie),Ie[c.OP_ACTIVATE_ACCOUNT]=e=>xe(Ie)(ae)(e),Ie[c.OP_FAILING_NOOP]=e=>xe(Ie)(Te)(e),Ie[c.OP_DELEGATION]=e=>xe(Ie)(ue)(e),Ie[c.OP_TRANSACTION]=e=>xe(Ie)(le)(e),Ie[c.OP_ORIGINATION]=e=>xe(Ie)(fe)(e),Ie[c.OP_BALLOT]=e=>xe(Ie)(de)(e),Ie[c.OP_ENDORSEMENT]=e=>xe(Ie)(he)(e),Ie[c.OP_SEED_NONCE_REVELATION]=e=>xe(Ie)(pe)(e),Ie[c.OP_PROPOSALS]=e=>xe(Ie)(be)(e),Ie[c.OP_REVEAL]=e=>xe(Ie)(ce)(e),Ie[c.OP_REGISTER_GLOBAL_CONSTANT]=e=>xe(Ie)(me)(e),Ie[c.OP_TRANSFER_TICKET]=e=>xe(Ie)(ge)(e),Ie[c.OP_TX_ROLLUP_ORIGINATION]=e=>xe(Ie)(ve)(e),Ie[c.OP_TX_ROLLUP_SUBMIT_BATCH]=e=>xe(Ie)(ye)(e),Ie[c.OP_INCREASE_PAID_STORAGE]=e=>xe(Ie)(_e)(e),Ie[c.OP_UPDATE_CONSENSUS_KEY]=e=>xe(Ie)(we)(e),Ie[c.OP_DRAIN_DELEGATE]=e=>xe(Ie)(Ee)(e),Ie[c.OP_SMART_ROLLUP_ORIGINATE]=e=>xe(Ie)(Se)(e),Ie[c.OP_SMART_ROLLUP_ADD_MESSAGES]=e=>xe(Ie)(Ae)(e),Ie[c.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=e=>xe(Ie)(Pe)(e),Ie[c.MANAGER]=xe(Ie)(se),Ie[c.OP_SET_DEPOSITS_LIMIT]=e=>xe(Ie)(Oe)(e);const Me={[c.SECRET]:e=>e,[c.RAW]:e=>e,[c.TZ1]:Z,[c.BRANCH]:W,[c.ZARITH]:ee,[c.PUBLIC_KEY]:e=>{switch(e.substring(0,4)){case n.Prefix.EDPK:return"00"+G(n.Prefix.EDPK)(e);case n.Prefix.SPPK:return"01"+G(n.Prefix.SPPK)(e);case n.Prefix.P2PK:return"02"+G(n.Prefix.P2PK)(e);default:throw new n.InvalidPublicKeyError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting one of the following '${n.Prefix.EDPK}', '${n.Prefix.SPPK}', '${n.Prefix.P2PK}' or '${n.Prefix.BLPK}'.`)}},[c.PKH]:Q,[c.DELEGATE]:e=>e?J(!0)+Q(e):J(!1),[c.SCRIPT]:e=>{const t=R(e.code),r=R(e.storage);return`${a(t.length/2,8)}${t}${a(r.length/2,8)}${r}`},[c.BALLOT_STATEMENT]:e=>{switch(e){case"yay":return"00";case"nay":return"01";case"pass":return"02";default:throw new g(e)}},[c.PROPOSAL]:Y,[c.PROPOSAL_ARR]:e=>a(32*e.length)+e.map((e=>Y(e))).join(""),[c.INT32]:e=>{const t=parseInt(String(e),10),r=[];for(let e=0;e<4;e++){const n=8*(4-(e+1));r.push((t&255<<n)>>n)}return Buffer.from(r).toString("hex")},[c.PARAMETERS]:e=>{if(!e||"default"===e.entrypoint&&"prim"in e.value&&"Unit"===e.value.prim)return"00";const t=(e=>{if(e in p)return`${p[e]}`;if(e.length>31)throw new m(e);return`ff${R({string:e}).slice(8)}`})(e.entrypoint),r=R(e.value);return`ff${t}${(r.length/2).toString(16).padStart(8,"0")}${r}`},[c.ADDRESS]:e=>{switch(e.substring(0,3)){case n.Prefix.TZ1:case n.Prefix.TZ2:case n.Prefix.TZ3:case n.Prefix.TZ4:return"00"+Q(e);case n.Prefix.KT1:return"01"+G(n.Prefix.KT1)(e)+"00";default:throw new i.InvalidAddressError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting one of the following prefix '${n.Prefix.TZ1}', ${n.Prefix.TZ2}', '${n.Prefix.TZ3}', '${n.Prefix.TZ4}' or '${n.Prefix.KT1}'.`)}},[c.SMART_ROLLUP_ADDRESS]:e=>{if(e.substring(0,3)!==n.Prefix.SR1)throw new A(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SR1}'.`);return G(n.Prefix.SR1)(e)},[c.SMART_CONTRACT_ADDRESS]:e=>{if(e.substring(0,3)===n.Prefix.KT1)return"01"+G(n.Prefix.KT1)(e)+"00";throw new i.InvalidContractAddressError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.KT1}'.`)},[c.SMART_ROLLUP_COMMITMENT_HASH]:e=>{if(e.substring(0,4)===n.Prefix.SRC1)return G(n.Prefix.SRC1)(e);throw new P(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SRC1}'`)},[c.VALUE]:e=>{const t=R(e);return`${a(t.length/2)}${t}`},[c.INT16]:e=>{const t=parseInt(String(e),10),r=[];for(let e=0;e<2;e++){const n=8*(2-(e+1));r.push((t&255<<n)>>n)}return Buffer.from(r).toString("hex")},[c.BLOCK_PAYLOAD_HASH]:re,[c.ENTRYPOINT]:e=>`${R({string:e}).slice(2)}`,[c.TX_ROLLUP_ORIGINATION_PARAM]:e=>"",[c.TX_ROLLUP_ID]:ie,[c.TX_ROLLUP_BATCH_CONTENT]:e=>`${a(e.length/2)}${e}`,[c.BURN_LIMIT]:e=>e?`ff${ee(e)}`:"00",[c.DEPOSITS_LIMIT]:e=>e?`ff${ee(e)}`:"00",[c.PVM_KIND]:e=>{switch(e){case"arith":return"00";case"wasm_2_0_0":return"01";default:throw new O(e)}},[c.PADDED_BYTES]:(e,t=8)=>`${a(e.length/2,t)}${e}`,[c.SMART_ROLLUP_MESSAGE]:e=>{const t=e.reduce(((e,t)=>e+`${a(t.length/2)}${t}`),"");return`${a(t.length/2)}${t}`}};Me[c.OPERATION]=(e=>t=>{if(!(t.kind in e)||!(t.kind in d))throw new i.InvalidOperationKindError(t.kind);return d[t.kind]+e[t.kind](t)})(Me),Me[c.OP_ACTIVATE_ACCOUNT]=e=>Re(Me)(ae)(e),Me[c.OP_DELEGATION]=e=>Re(Me)(ue)(e),Me[c.OP_TRANSACTION]=e=>Re(Me)(le)(e),Me[c.OP_ORIGINATION]=e=>Re(Me)(fe)(e),Me[c.OP_BALLOT]=e=>Re(Me)(de)(e),Me[c.OP_ENDORSEMENT]=e=>Re(Me)(he)(e),Me[c.OP_SEED_NONCE_REVELATION]=e=>Re(Me)(pe)(e),Me[c.OP_PROPOSALS]=e=>Re(Me)(be)(e),Me[c.OP_REVEAL]=e=>Re(Me)(ce)(e),Me[c.OP_REGISTER_GLOBAL_CONSTANT]=e=>Re(Me)(me)(e),Me[c.OP_TRANSFER_TICKET]=e=>Re(Me)(ge)(e),Me[c.OP_TX_ROLLUP_ORIGINATION]=e=>Re(Me)(ve)(e),Me[c.OP_TX_ROLLUP_SUBMIT_BATCH]=e=>Re(Me)(ye)(e),Me[c.OP_INCREASE_PAID_STORAGE]=e=>Re(Me)(_e)(e),Me[c.OP_UPDATE_CONSENSUS_KEY]=e=>Re(Me)(we)(e),Me[c.OP_DRAIN_DELEGATE]=e=>Re(Me)(Ee)(e),Me[c.OP_SMART_ROLLUP_ORIGINATE]=e=>Re(Me)(Se)(e),Me[c.OP_SMART_ROLLUP_ADD_MESSAGES]=e=>Re(Me)(Ae)(e),Me[c.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=e=>Re(Me)(Pe)(e),Me[c.MANAGER]=Re(Me)(se),Me[c.OP_SET_DEPOSITS_LIMIT]=e=>Re(Me)(Oe)(e),Me[c.OP_FAILING_NOOP]=e=>Re(Me)(Te)(e);const Le={activate_account:ae,reveal:ce,delegation:ue,transaction:le,origination:fe,ballot:de,endorsement:he,seed_nonce_revelation:pe,proposals:be,register_global_constant:me,transfer_ticket:ge,tx_rollup_origination:ve,tx_rollup_submit_batch:ye,increase_paid_storage:_e,update_consensus_key:we,drain_delegate:Ee,set_deposits_limit:Oe,smart_rollup_originate:Se,smart_rollup_add_messages:Ae,smart_rollup_execute_outbox_message:Pe,failing_noop:Te},ke=e=>{const t=e.kind,r=Object.keys(e),n=(i="kind",r.filter((e=>e!==i)));var i;const o=Object.keys(Le[t]);return s=n,o.filter((e=>!s.includes(e)));var s};var Ne;!function(e){e.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",e.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",e.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",e.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",e.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",e.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",e.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",e.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",e.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",e.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",e.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",e.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",e.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",e.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",e.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(Ne||(Ne={}));const Ce={commitHash:"a97e506efd61b86e39ae30db588401b8fda46553",version:"17.3.2"},je=Ne.PtMumbai2;function De(e,t){return{encoder:Me[e],decoder:t=>{const r=T.fromHexString(t);return Ie[e](r)}}}class Ue{constructor(e=je){this.protocolHash=e,this.codec=De(c.MANAGER,this.protocolHash)}forge(e){const t=(0,n.validateBlock)(e.branch);if(t!==n.ValidationResult.VALID)throw new i.InvalidBlockHashError(e.branch,(0,n.invalidDetail)(t));for(const t of e.contents){if(r=t.kind,!Object.keys(Le).includes(r))throw new i.InvalidOperationKindError(t.kind);const e=ke(t);if(1===e.length){if("delegation"===t.kind&&"delegate"===e[0])continue;if("origination"===t.kind&&"delegate"===e[0])continue;if("transaction"===t.kind&&"parameters"===e[0])continue;if("set_deposits_limit"===t.kind&&"limit"===e[0])continue;if("tx_rollup_submit_batch"===t.kind&&"burn_limit"===e[0])continue;throw new b(t,`missing properties "${e.join(", ")}"`)}if(e.length>1)throw new b(t,`missing properties "${e.join(", ")}"`)}var r;const o=this.codec.encoder(e).toLowerCase();return Promise.resolve(o)}parse(e){return Promise.resolve(this.codec.decoder(e))}}const Be=new Ue},9985:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Contract:()=>nr,DefaultProtocol:()=>b,JSONParseError:()=>j,MacroError:()=>y,MichelineParseError:()=>C,MichelsonError:()=>ue,MichelsonInstructionError:()=>Ct,MichelsonTypeError:()=>fe,MichelsonValidationError:()=>Le,Parser:()=>K,ProtoGreaterOrEqual:()=>g,ProtoInferiorTo:()=>v,Protocol:()=>p,VERSION:()=>cr,assertContractValid:()=>Zt,assertDataListIfAny:()=>ot,assertDataValid:()=>Jt,assertMichelsonBigMapStorableType:()=>qe,assertMichelsonComparableType:()=>He,assertMichelsonContract:()=>Qe,assertMichelsonData:()=>Xe,assertMichelsonInstruction:()=>Ke,assertMichelsonPackableType:()=>Ge,assertMichelsonPassableType:()=>ze,assertMichelsonPushableType:()=>$e,assertMichelsonStorableType:()=>Ve,assertMichelsonType:()=>Je,assertTypeAnnotationsValid:()=>Ft,assertTypesEqual:()=>Xt,assertViewNameValid:()=>Ze,contractEntryPoint:()=>qt,contractEntryPoints:()=>Wt,contractSection:()=>$t,contractViews:()=>Vt,decodeAddressBytes:()=>Lt,decodePublicKeyBytes:()=>Nt,decodePublicKeyHashBytes:()=>kt,dummyContract:()=>ir,emitMicheline:()=>z,formatError:()=>ar,formatStack:()=>or,functionType:()=>Yt,instructionIDs:()=>xe,isContractValid:()=>er,isDataValid:()=>tr,isInstruction:()=>it,isMichelsonCode:()=>rt,isMichelsonData:()=>tt,isMichelsonError:()=>le,isMichelsonScript:()=>et,isMichelsonType:()=>nt,isTypeAnnotationsValid:()=>Qt,isTypeEqual:()=>rr,packData:()=>Pt,packDataBytes:()=>Tt,refContract:()=>h,sourceReference:()=>i,traceDumpFunc:()=>sr,unpackData:()=>It,unpackDataBytes:()=>Mt});var n=r(227);const i=Symbol("source_reference");class o extends n.TaquitoError{constructor(e,t,r){super(),this.src=e,this.idx=t,this.message=r,this.name="ScanError"}}var s;!function(e){e[e.Comment=0]="Comment",e[e.Number=1]="Number",e[e.String=2]="String",e[e.Bytes=3]="Bytes",e[e.Ident=4]="Ident"}(s||(s={}));const a=new RegExp("\\s"),c=new RegExp("[:@%_A-Za-z]"),u=new RegExp("[@%_\\.A-Za-z0-9]"),l=new RegExp("[0-9]"),f=new RegExp("[0-9a-fA-F]");function*d(e,t=!1){let r=0;for(;r<e.length;){for(;r<e.length&&a.test(e[r]);)r++;if(r===e.length)return;const n=e[r],i=r;if(c.test(n)){for(r++;r<e.length&&u.test(e[r]);)r++;yield{t:s.Ident,v:e.slice(i,r),first:i,last:r}}else if(e.length-r>1&&"0x"===e.substring(r,r+2)){for(r+=2;r<e.length&&f.test(e[r]);)r++;if(0!=(r-i&1))throw new o(e,r,"Bytes literal length is expected to be power of two");yield{t:s.Bytes,v:e.slice(i,r),first:i,last:r}}else if(l.test(n)||"-"===n){"-"===n&&r++;const t=r;for(;r<e.length&&l.test(e[r]);)r++;if(t===r)throw new o(e,r,"Number literal is too short");yield{t:s.Number,v:e.slice(i,r),first:i,last:r}}else if('"'===n){r++;let t=!1;for(;r<e.length&&(t||'"'!==e[r]);r++)t=!t&&"\\"===e[r];if(r===e.length)throw new o(e,r,"Unterminated string literal");r++,yield{t:s.String,v:e.slice(i,r),first:i,last:r}}else if("#"===n){for(r++;r<e.length&&"\n"!==e[r];)r++;t&&(yield{t:s.Comment,v:e.slice(i,r),first:i,last:r})}else if(e.length-r>1&&"/*"===e.substring(r,r+2)){for(r+=2;r<e.length&&!(e.length-r>1&&"*/"===e.substring(r,r+2));)r++;if(r===e.length)throw new o(e,r,"Unterminated C style comment");r+=2,t&&(yield{t:s.Comment,v:e.slice(i,r),first:i,last:r})}else{if("("!==n&&")"!==n&&"{"!==n&&"}"!==n&&";"!==n)throw new o(e,r,`Invalid character at offset ${r}: \`${n}'`);r++,yield{t:n,v:n,first:i,last:r}}}}const h=Symbol("ref_contract");var p;!function(e){e.Ps9mPmXa="Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P",e.PtCJ7pwo="PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY",e.PsYLVpVv="PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",e.PsddFKi3="PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",e.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",e.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",e.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",e.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",e.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",e.PtEdoTez="PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq",e.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",e.PsFLoren="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PtGRANAD="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtHangzH="PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r",e.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",e.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",e.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",e.PtJakarta="PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw",e.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",e.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",e.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",e.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",e.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",e.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",e.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(p||(p={}));const b=p.Psithaca2,m={Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P:0,PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY:1,PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt:2,PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP:3,Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd:4,PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU:5,PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS:5,PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb:6,PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo:7,PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq:8,PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA:8,PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i:9,PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV:10,PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r:11,PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx:11,PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP:12,Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A:12,PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw:13,PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY:13,PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg:14,PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW:15,PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc:16,PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1:16,PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf:17,ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK:18};function g(e,t){return m[e]>=m[t]}function v(e,t){return m[e]<m[t]}class y extends n.TaquitoError{constructor(e,t){super(),this.prim=e,this.message=t,this.name="MacroError"}}function _(e,t){var r,n;if(0===t&&void 0===e.args||(null===(r=e.args)||void 0===r?void 0:r.length)===t)return!0;throw new y(e,`macro ${e.prim} expects ${t} arguments, was given ${null===(n=e.args)||void 0===n?void 0:n.length}`)}function w(e){if(void 0===e.annots)return!0;throw new y(e,`unexpected annotation on macro ${e.prim}: ${e.annots}`)}function E(e,t){if("int"in t)return!0;throw new y(e,`macro ${e.prim} expects int argument`)}function O(e,t,r,n){let i=0,o=0;const s=[null,null];let a;if(i===t.length)throw new y(e,`unexpected end: ${e.prim}`);let c,u=t[i++];switch(u){case"P":{const{r:s,n:c,an:u}=O(e,t.slice(i),r.slice(o),n);a=s,i+=c,o+=u;break}case"A":o!==r.length&&(s[0]=r[o++]);break;default:throw new y(e,`${e.prim}: unexpected character: ${u}`)}if(i===t.length)throw new y(e,`unexpected end: ${e.prim}`);switch(u=t[i++],u){case"P":{const{r:s,n:a,an:u}=O(e,t.slice(i),r.slice(o),n);c=s.map((([e,t])=>[e+1,t])),i+=a,o+=u;break}case"I":o!==r.length&&(s[1]=r[o++]);break;default:throw new y(e,`${e.prim}: unexpected character: ${u}`)}return{r:n(a,c,[0,s]),n:i,an:o}}function S(e,t,r,n){const i=t[0];switch(i){case"A":return t.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CAR",annots:["@%%"]},S(e,t.slice(1),[],n)]]},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%@","%@",...r]}]:n.a;case"D":return t.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CDR",annots:["@%%"]},S(e,t.slice(1),[],n)]]},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%@",...r]}]:n.d;default:throw new y(e,`${e.prim}: unexpected character: ${i}`)}}function A(e,t){let r=e.length;for(;r>0&&e[r-1]===t;)r--;return e.slice(0,r)}function P(e){const t=[],r=[];if(void 0!==e)for(const n of e)(0!==n.length&&"%"===n[0]?t:r).push(n);return{fields:t,rest:r}}function T({prim:e,annots:t,args:r}){return Object.assign(Object.assign({prim:e},t&&{annots:t}),r&&{args:r})}const R=/^P[PAI]{3,}R$/,x=/^UNP[PAI]{2,}R$/,I=/^C[AD]{2,}R$/,M=/^SET_C[AD]+R$/,L=/^MAP_C[AD]+R$/,k=/^DI{2,}P$/,N=/^DU+P$/;class C extends n.TaquitoError{constructor(e,t){super(),this.token=e,this.message=t,this.name="MichelineParseError"}}class j extends n.TaquitoError{constructor(e,t){super(),this.node=e,this.message=t,this.name="JSONParseError"}}const D=new C(null,"Unexpected EOF");function U(e){return e.t===s.Ident&&("@"===e.v[0]||"%"===e.v[0]||":"===e.v[0])}const B=new RegExp("^-?[0-9]+$"),F=new RegExp("^([0-9a-fA-F]{2})*$");class K{constructor(e){this.opt=e}expand(e){var t,r,n;if(void 0!==(null===(t=this.opt)||void 0===t?void 0:t.expandGlobalConstant)&&"constant"===e.prim){const t=function(e,t){return void 0!==e.args&&1===e.args.length&&"string"in e.args[0]&&e.args[0].string in t?t[e.args[0].string]:e}(e,this.opt.expandGlobalConstant);return t!==e&&(t[i]=Object.assign(Object.assign({},e[i]||{first:0,last:0}),{globalConstant:e})),t}if(void 0===(null===(r=this.opt)||void 0===r?void 0:r.expandMacros)||(null===(n=this.opt)||void 0===n?void 0:n.expandMacros)){const t=function(e,t){const r=(null==t?void 0:t.protocol)||b;function n(e){return void 0!==e?[{prim:"RENAME",annots:e}]:[]}switch(e.prim){case"CMPEQ":case"CMPNEQ":case"CMPLT":case"CMPGT":case"CMPLE":case"CMPGE":if(_(e,0))return[{prim:"COMPARE"},T({prim:e.prim.slice(3),annots:e.annots})];break;case"IFEQ":case"IFNEQ":case"IFLT":case"IFGT":case"IFLE":case"IFGE":if(_(e,2))return[{prim:e.prim.slice(2)},T({prim:"IF",annots:e.annots,args:e.args})];break;case"IFCMPEQ":case"IFCMPNEQ":case"IFCMPLT":case"IFCMPGT":case"IFCMPLE":case"IFCMPGE":if(_(e,2))return[{prim:"COMPARE"},{prim:e.prim.slice(5)},T({prim:"IF",annots:e.annots,args:e.args})];break;case"FAIL":if(_(e,0)&&w(e))return[{prim:"UNIT"},{prim:"FAILWITH"}];break;case"ASSERT":if(_(e,0)&&w(e))return[{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_EQ":case"ASSERT_NEQ":case"ASSERT_LT":case"ASSERT_GT":case"ASSERT_LE":case"ASSERT_GE":if(_(e,0)&&w(e))return[{prim:e.prim.slice(7)},{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_CMPEQ":case"ASSERT_CMPNEQ":case"ASSERT_CMPLT":case"ASSERT_CMPGT":case"ASSERT_CMPLE":case"ASSERT_CMPGE":if(_(e,0)&&w(e))return[[{prim:"COMPARE"},{prim:e.prim.slice(10)}],{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_NONE":if(_(e,0)&&w(e))return[{prim:"IF_NONE",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_SOME":if(_(e,0))return[{prim:"IF_NONE",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],n(e.annots)]}];break;case"ASSERT_LEFT":if(_(e,0))return[{prim:"IF_LEFT",args:[n(e.annots),[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_RIGHT":if(_(e,0))return[{prim:"IF_LEFT",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],n(e.annots)]}];break;case"IF_SOME":if(_(e,2))return[T({prim:"IF_NONE",annots:e.annots,args:[e.args[1],e.args[0]]})];break;case"IF_RIGHT":if(_(e,2))return[T({prim:"IF_LEFT",annots:e.annots,args:[e.args[1],e.args[0]]})];break;case"CAR":case"CDR":if(void 0===e.args)return e;if(_(e,1)&&E(e,e.args[0])){const t=parseInt(e.args[0].int,10);return T({prim:"GET",args:[{int:"CAR"===e.prim?String(2*t+1):String(2*t)}],annots:e.annots})}}if(R.test(e.prim)&&_(e,0)){const{fields:t,rest:r}=P(e.annots),{r:n}=O(e,e.prim.slice(1),t,((e,t,r)=>[...e||[],...t||[],r]));return n.map((([e,t],i)=>{const o=[...A(t,null).map((e=>null===e?"%":e)),...0===e&&i===n.length-1?r:[]],s=T({prim:"PAIR",annots:0!==o.length?o:void 0});return 0===e?s:{prim:"DIP",args:1===e?[[s]]:[{int:String(e)},[s]]}}))}if(x.test(e.prim)){if(v(r,p.PtEdo2Zk)&&_(e,0)){const{r:t}=O(e,e.prim.slice(3),e.annots||[],((e,t,r)=>[r,...t||[],...e||[]]));return t.map((([e,t])=>{const r=[{prim:"DUP"},T({prim:"CAR",annots:null!==t[0]?[t[0]]:void 0}),{prim:"DIP",args:[[T({prim:"CDR",annots:null!==t[1]?[t[1]]:void 0})]]}];return 0===e?r:{prim:"DIP",args:1===e?[[r]]:[{int:String(e)},[r]]}}))}if("UNPAIR"===e.prim)return e;if(_(e,0)){const{r:t}=O(e,e.prim.slice(3),[],((e,t,r)=>[r,...t||[],...e||[]]));return t.map((([e])=>{const t=T({prim:"UNPAIR"});return 0===e?t:{prim:"DIP",args:1===e?[[t]]:[{int:String(e)},[t]]}}))}}if(I.test(e.prim)&&_(e,0)){const t=[...e.prim.slice(1,e.prim.length-1)];return t.map(((r,n)=>{const i=n===t.length-1?e.annots:void 0;switch(r){case"A":return T({prim:"CAR",annots:i});case"D":return T({prim:"CDR",annots:i});default:throw new y(e,`unexpected character: ${r}`)}}))}if(M.test(e.prim)&&_(e,0)){const{fields:t,rest:r}=P(e.annots);if(t.length>1)throw new y(e,`unexpected annotation on macro ${e.prim}: ${t}`);const n=0!==t.length?{a:[{prim:"DUP"},{prim:"CAR",annots:t},{prim:"DROP"},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:[t[0],"%@"]}],d:[{prim:"DUP"},{prim:"CDR",annots:t},{prim:"DROP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",t[0]]}]}:{a:[{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%","%@"]}],d:[{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%"]}]};return S(e,e.prim.slice(5,e.prim.length-1),r,n)}if(L.test(e.prim)&&_(e,1)){const{fields:t}=P(e.annots);if(t.length>1)throw new y(e,`unexpected annotation on macro ${e.prim}: ${t}`);const r={a:[{prim:"DUP"},{prim:"CDR",annots:["@%%"]},{prim:"DIP",args:[[T({prim:"CAR",annots:0!==t.length?["@"+t[0].slice(1)]:void 0}),e.args[0]]]},{prim:"SWAP"},{prim:"PAIR",annots:[0!==t.length?t[0]:"%","%@"]}],d:[{prim:"DUP"},T({prim:"CDR",annots:0!==t.length?["@"+t[0].slice(1)]:void 0}),e.args[0],{prim:"SWAP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",0!==t.length?t[0]:"%"]}]};return S(e,e.prim.slice(5,e.prim.length-1),[],r)}if(k.test(e.prim)&&_(e,1)){let t=0;for(;"I"===e.prim[1+t];)t++;return T({prim:"DIP",args:[{int:String(t)},e.args[0]]})}if(N.test(e.prim)){let t=0;for(;"U"===e.prim[1+t];)t++;if(v(r,p.PtEdo2Zk)){if(1===t){if(void 0===e.args)return e;_(e,1)&&E(e,e.args[0])&&(t=parseInt(e.args[0].int,10))}else _(e,0);return 1===t?[T({prim:"DUP",annots:e.annots})]:2===t?[{prim:"DIP",args:[[T({prim:"DUP",annots:e.annots})]]},{prim:"SWAP"}]:[{prim:"DIP",args:[{int:String(t-1)},[T({prim:"DUP",annots:e.annots})]]},{prim:"DIG",args:[{int:String(t)}]}]}if(1===t)return e;if(_(e,0))return T({prim:"DUP",args:[{int:String(t)}],annots:e.annots})}return e}(e,this.opt);return t!==e&&(t[i]=Object.assign(Object.assign({},e[i]||{first:0,last:0}),{macro:e})),t}return e}parseListExpr(e,t){var r;const n={first:t.first,last:t.last},o="("===t.t;let a;if(o){if(a=e.next(),a.done)throw D;n.last=a.value.last}else a={value:t};if(a.value.t!==s.Ident)throw new C(a.value,`not an identifier: ${a.value.v}`);const c={prim:a.value.v,[i]:n};for(;;){const t=e.next();if(t.done){if(o)throw D;break}if(")"===t.value.t){if(!o)throw new C(t.value,"unexpected closing bracket");n.last=t.value.last;break}if(U(t.value))c.annots=c.annots||[],c.annots.push(t.value.v),n.last=t.value.last;else{c.args=c.args||[];const o=this.parseExpr(e,t.value);n.last=(null===(r=o[i])||void 0===r?void 0:r.last)||n.last,c.args.push(o)}}return this.expand(c)}parseArgs(e,t){var r;const n={first:t.first,last:t.last},o={prim:t.v,[i]:n};for(;;){const t=e.next();if(t.done||"}"===t.value.t||";"===t.value.t)return[o,t];if(U(t.value))n.last=t.value.last,o.annots=o.annots||[],o.annots.push(t.value.v);else{const s=this.parseExpr(e,t.value);n.last=(null===(r=s[i])||void 0===r?void 0:r.last)||n.last,o.args=o.args||[],o.args.push(s)}}}parseSequenceExpr(e,t){var r,n;const o={first:t.first,last:t.last},a=[];a[i]=o;const c="{"===t.t;let u="{"===t.t?null:{value:t};for(;;){if(null===u&&(u=e.next(),u.done||(o.last=u.value.last)),u.done){if(c)throw D;return a}if("}"===u.value.t){if(c)return a;throw new C(u.value,"unexpected closing bracket")}if(u.value.t===s.Ident){const[t,n]=this.parseArgs(e,u.value);o.last=(null===(r=t[i])||void 0===r?void 0:r.last)||o.last,a.push(this.expand(t)),u=n}else{const t=this.parseExpr(e,u.value);o.last=(null===(n=t[i])||void 0===n?void 0:n.last)||o.last,a.push(t),u=null}null===u&&(u=e.next(),u.done||(o.last=u.value.last)),u.done||";"!==u.value.t||(u=null)}}parseExpr(e,t){switch(t.t){case s.Ident:return this.expand({prim:t.v,[i]:{first:t.first,last:t.last}});case s.Number:return{int:t.v,[i]:{first:t.first,last:t.last}};case s.String:return{string:JSON.parse(t.v),[i]:{first:t.first,last:t.last}};case s.Bytes:return{bytes:t.v.slice(2),[i]:{first:t.first,last:t.last}};case"{":return this.parseSequenceExpr(e,t);default:return this.parseListExpr(e,t)}}parseSequence(e){if("string"!=typeof e)throw new TypeError(`string type was expected, got ${typeof e} instead`);const t=d(e),r=t.next();return r.done?null:this.parseSequenceExpr(t,r.value)}parseList(e){if("string"!=typeof e)throw new TypeError(`string type was expected, got ${typeof e} instead`);const t=d(e),r=t.next();return r.done?null:this.parseListExpr(t,r.value)}parseMichelineExpression(e){if("string"!=typeof e)throw new TypeError(`string type was expected, got ${typeof e} instead`);const t=d(e),r=t.next();return r.done?null:this.parseExpr(t,r.value)}parseScript(e){return this.parseSequence(e)}parseData(e){return this.parseList(e)}parseJSON(e){if("object"!=typeof e)throw new TypeError(`object type was expected, got ${typeof e} instead`);if(Array.isArray(e)){const t=[];for(const r of e){if(null===r||"object"!=typeof r)throw new j(r,`unexpected sequence element: ${r}`);t.push(this.parseJSON(r))}return t}if("prim"in e){const t=e;if("string"==typeof t.prim&&(void 0===t.annots||Array.isArray(t.annots))&&(void 0===t.args||Array.isArray(t.args))){const e={prim:t.prim};if(void 0!==t.annots){for(const e of t.annots)if("string"!=typeof e)throw new j(e,`string expected: ${e}`);e.annots=t.annots}if(void 0!==t.args){e.args=[];for(const r of t.args){if(null===r||"object"!=typeof r)throw new j(r,`unexpected argument: ${r}`);e.args.push(this.parseJSON(r))}}return this.expand(e)}throw new j(e,`malformed prim expression: ${e}`)}if("string"in e){if("string"==typeof e.string)return{string:e.string};throw new j(e,`malformed string literal: ${e}`)}if("int"in e){if("string"==typeof e.int&&B.test(e.int))return{int:e.int};throw new j(e,`malformed int literal: ${e}`)}if("bytes"in e){if("string"==typeof e.bytes&&F.test(e.bytes))return{bytes:e.bytes};throw new j(e,`malformed bytes literal: ${e}`)}throw new j(e,`unexpected object: ${e}`)}}class H{constructor(e,t=0){this.opt=e,this.lev=t}indent(e=0){var t;let r="";if(void 0!==(null===(t=this.opt)||void 0===t?void 0:t.indent))for(let t=this.lev+e;t>0;t--)r+=this.opt.indent;return r}get lf(){var e;return(null===(e=this.opt)||void 0===e?void 0:e.newline)||""}get lfsp(){var e;return(null===(e=this.opt)||void 0===e?void 0:e.newline)||" "}down(e){return new H(this.opt,this.lev+e)}}function G(e){return"prim"in e&&(void 0!==e.annots&&0!==e.annots.length||void 0!==e.args&&0!==e.args.length)}function $(e){if(void 0!==e.args)for(const t of e.args)if(Array.isArray(t)||G(t))return!0;return!1}function V(e,t,r){var n;const o=null===(n=e[i])||void 0===n?void 0:n.macro;if(r&&o)return V(o,t,r);if(Array.isArray(e))return function(e,t,r){let n="{"+t.lf,i=e.length;for(const o of e){if(n+=t.indent(1),"prim"in o){if(n+=o.prim,void 0!==o.annots)for(const e of o.annots)n+=" "+e;if(void 0!==o.args){const e=$(o);for(const i of o.args)n+=e?t.lfsp+t.indent(2)+V(i,t.down(2),r):" "+V(i,t,r)}}else n+=V(o,t.down(1),r);n+=i>1?";"+t.lfsp:t.lf,i--}return n+t.indent()+"}"}(e,t,r);if("string"in e)return JSON.stringify(e.string);if("int"in e)return e.int;if("bytes"in e)return"0x"+e.bytes;{if(!(void 0!==e.annots&&0!==e.annots.length||void 0!==e.args&&0!==e.args.length))return e.prim;let n="("+e.prim;if(void 0!==e.annots)for(const t of e.annots)n+=" "+t;if(void 0!==e.args){const i=$(e);for(const o of e.args)n+=i?t.lfsp+t.indent(1)+V(o,t.down(1),r):" "+V(o,t,r)}return n+")"}}function z(e,t,r=!1){if("object"!=typeof e)throw new TypeError(`object type was expected, got ${typeof e} instead`);return V(e,new H(t),r)}const q=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],W=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998];class Z extends n.TaquitoError{constructor(e){super(),this.message=e,this.name="Base58DecodingError"}}function J(e){const t=(e.length+9)%64,r=0===t?0:64-t;if(e.length>268435455)throw new n.InvalidMessageError("",`: Invalid length ${e.length} is too big -- SHA-256.`);const i=e.length<<3,o=[...e,128,...new Array(r).fill(0),0,0,0,0,i>>24&255,i>>16&255,i>>8&255,255&i];function s(e,t){return e>>>t|e<<32-t}const a=[...q],c=new Array(64),u=new Array(8);for(let e=0;e<o.length;e+=64){let t=e,r=0;for(;r<16;)c[r]=o[t]<<24|o[t+1]<<16|o[t+2]<<8|o[t+3],t+=4,r++;for(;r<64;){const e=s(c[r-15],7)^s(c[r-15],18)^c[r-15]>>>3,t=s(c[r-2],17)^s(c[r-2],19)^c[r-2]>>>10;c[r]=(0|t)+c[r-7]+e+c[r-16]|0,r++}for(let e=0;e<8;e++)u[e]=a[e];for(let e=0;e<64;e++){const t=s(u[0],2)^s(u[0],13)^s(u[0],22),r=s(u[4],6)^s(u[4],11)^s(u[4],25),n=u[7]+r+(u[4]&u[5]^~u[4]&u[6])+W[e]+c[e]|0,i=t+(u[0]&u[1]^u[0]&u[2]^u[1]&u[2])|0;u[7]=u[6],u[6]=u[5],u[5]=u[4],u[4]=u[3]+n|0,u[3]=u[2],u[2]=u[1],u[1]=u[0],u[0]=n+i|0}for(let e=0;e<8;e++)a[e]=a[e]+u[e]|0}const l=[];for(const e of a)l.push(e>>24&255),l.push(e>>16&255),l.push(e>>8&255),l.push(255&e);return l}const Y=[0,1,2,3,4,5,6,7,8,-1,-1,-1,-1,-1,-1,-1,9,10,11,12,13,14,15,16,-1,17,18,19,20,21,-1,22,23,24,25,26,27,28,29,30,31,32,-1,-1,-1,-1,-1,-1,33,34,35,36,37,38,39,40,41,42,43,-1,44,45,46,47,48,49,50,51,52,53,54,55,56,57],X=[0,1,2,3,4,5,6,7,8,16,17,18,19,20,21,22,23,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,48,49,50,51,52,53,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73];function Q(e,t){const r=e.charCodeAt(t)-49;if(r>=Y.length||-1===Y[r])throw new Z(`Unexpected character at position ${t}: ${e[t]}`);return Y[r]}function ee(e){const t=function(e){const t=[];let r=0;for(;r<e.length&&0===Q(e,r);)r++;let n=r;for(;r<e.length;){let n=Q(e,r++),i=0;for(;0!==n||i<t.length;){const e=58*(t[i]||0)+n;t[i++]=e%256,n=Math.floor(e/256)}}for(;n-- >0;)t.push(0);return t.reverse()}(e);if(t.length<4)throw new Z(`Data is too short ${t.length}`);const r=t.slice(0,t.length-4),n=t.slice(t.length-4),i=J(J(r));if(n[0]!==i[0]||n[1]!==i[1]||n[2]!==i[2]||n[3]!==i[3])throw new Z("Invalid checksum");return r}function te(e){const t=J(J(e));return function(e){const t=[];let r=0;for(;r<e.length&&0===e[r];)r++;let n=r;for(;r<e.length;){let n=e[r++],i=0;for(;0!==n||i<t.length;){const e=256*(t[i]||0)+n;t[i++]=e%58,n=Math.floor(e/58)}}for(;n-- >0;)t.push(0);return t.reverse(),String.fromCharCode(...t.map((e=>X[e]+49)))}([...e,...t.slice(0,4)])}class re extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidMichelsonError"}}class ne extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidTypeExpressionError"}}class ie extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidDataExpressionError"}}class oe extends n.ParameterValidationError{constructor(e){super(),this.entrypoint=e,this.name="InvalidEntrypointError",this.message=`Contract has no entrypoint named: "${e}"`}}class se extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="TezosIdEncodeError"}}class ae extends n.TaquitoError{constructor(e){super(),this.message=e,this.name="LongIntegerError"}}class ce extends n.TaquitoError{constructor(e){super(),this.hexByte=e,this.name="HexParseError",this.message=`Unable to parse hex byte "${e}"`}}class ue extends n.TaquitoError{constructor(e,t){super(),this.val=e,this.message=t,this.name="MichelsonError"}}function le(e){return e instanceof ue}class fe extends ue{constructor(e,t,r){super(e,t),this.val=e,this.message=t,this.name="MichelsonTypeError",void 0!==r&&(this.data=r)}}class de{constructor(e){if(this.neg=!1,this.buf=[],void 0!==e)if("string"==typeof e)for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(0===t&&45===r)this.neg=!0;else{if(r<48||r>57)throw new ae(`unexpected character in integer constant "${e[t]}"`);this.append(r-48)}}else e<0?(this.neg=!0,this.append(-e)):this.append(e)}append(e){let t=0;for(;0!==e||t<this.buf.length;){const r=10*(this.buf[t]||0)+e;this.buf[t++]=r%256,e=Math.floor(r/256)}}cmp(e){if(this.neg!==e.neg)return(e.neg?1:0)-(this.neg?1:0);{let t=0;if(this.buf.length!==e.buf.length)t=this.buf.length<e.buf.length?-1:1;else if(0!==this.buf.length){let r=e.buf.length-1;for(;r>=0&&this.buf[r]===e.buf[r];)r--;t=r<0?0:this.buf[r]<e.buf[r]?-1:1}return this.neg?0===t?0:-t:t}}get sign(){return 0===this.buf.length?0:this.neg?-1:1}}function he(e){const t=[];for(let r=0;r<e.length;r+=2){const n=parseInt(e.slice(r,r+2),16);if(Number.isNaN(n))return null;t.push(n)}return t}function pe(e){try{return new de(e),!0}catch(e){return!1}}function be(e){try{return new de(e).sign>=0}catch(e){return!1}}const me=/^(@%|@%%|%@|[@:%]([_0-9a-zA-Z][_0-9a-zA-Z.%@]*)?)$/;function ge(e,t){if(Array.isArray(e))return{};let r,n,i;if(void 0!==e.annots)for(const o of e.annots)if(0!==o.length){if(!me.test(o)||!(null==t?void 0:t.specialVar)&&("@%"===o||"@%%"===o)||!(null==t?void 0:t.specialFields)&&"%@"===o)throw new ue(e,`${e.prim}: unexpected annotation: ${o}`);switch(o[0]){case"%":((null==t?void 0:t.emptyFields)||o.length>1)&&(r=r||[],r.push(o));break;case":":o.length>1&&(n=n||[],n.push(o));break;case"@":((null==t?void 0:t.emptyVar)||o.length>1)&&(i=i||[],i.push(o))}}return{f:r,t:n,v:i}}const ve={BlockHash:[32,[1,52]],OperationHash:[32,[5,116]],OperationListHash:[32,[133,233]],OperationListListHash:[32,[29,159,109]],ProtocolHash:[32,[2,170]],ContextHash:[32,[79,199]],ED25519PublicKeyHash:[20,[6,161,159]],SECP256K1PublicKeyHash:[20,[6,161,161]],P256PublicKeyHash:[20,[6,161,164]],ContractHash:[20,[2,90,121]],CryptoboxPublicKeyHash:[16,[153,103]],ED25519Seed:[32,[13,15,58,7]],ED25519PublicKey:[32,[13,15,37,217]],SECP256K1SecretKey:[32,[17,162,224,201]],P256SecretKey:[32,[16,81,238,189]],ED25519EncryptedSeed:[56,[7,90,60,179,41]],SECP256K1EncryptedSecretKey:[56,[9,237,241,174,150]],P256EncryptedSecretKey:[56,[9,48,57,115,171]],SECP256K1PublicKey:[33,[3,254,226,86]],P256PublicKey:[33,[3,178,139,127]],SECP256K1Scalar:[33,[38,248,136]],SECP256K1Element:[33,[5,92,0]],ED25519SecretKey:[64,[43,246,78,7]],ED25519Signature:[64,[9,245,205,134,18]],SECP256K1Signature:[64,[13,115,101,19,63]],P256Signature:[64,[54,240,44,52]],GenericSignature:[64,[4,130,43]],ChainID:[4,[87,82,0]],RollupAddress:[20,[1,128,120,31]],TxRollupL2Address:[20,[6,161,166]]};function ye(e,...t){const r=ee(e);for(const e of t){const[t,n]=ve[e];if(r.length===t+n.length){let t=0;for(;t<n.length&&r[t]===n[t];)t++;if(t===n.length)return[e,r.slice(n.length)]}}return null}function _e(e,t){const[r,n]=ve[e];if(t.length!==r)throw new se(`Incorrect data length for ${e}: ${t.length}`);return te([...n,...t])}function we(e,t){const r=t,n=Array.isArray(r)?r:r.args;if(2===n.length){return"pair"===e?{prim:"pair",args:n}:{prim:"Pair",args:n}}return Object.assign(Object.assign({},Array.isArray(r)?{prim:e}:r),{args:[n[0],{prim:e,args:n.slice(1)}]})}function Ee(e){return Array.isArray(e)||"pair"===e.prim}function Oe(e){return Array.isArray(e)||"prim"in e&&"Pair"===e.prim}const Se=/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])[T ]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):([0-5][0-9]))$/;function Ae(e){if("string"in e){if(be(e.string))return new Date(parseInt(e.string,10));if(Se.test(e.string)){const t=new Date(e.string);if(!Number.isNaN(t.valueOf))return t}}else if(pe(e.int))return new Date(parseInt(e.int,10));return null}function Pe(e){return e.map((e=>(e>>4&15).toString(16)+(15&e).toString(16))).join("")}const Te=31,Re={ABS:!0,ADD:!0,ADDRESS:!0,AMOUNT:!0,AND:!0,APPLY:!0,BALANCE:!0,BLAKE2B:!0,CAR:!0,CDR:!0,CHAIN_ID:!0,CHECK_SIGNATURE:!0,COMPARE:!0,CONCAT:!0,CONS:!0,EDIV:!0,EQ:!0,EXEC:!0,FAILWITH:!0,GE:!0,GET_AND_UPDATE:!0,GT:!0,HASH_KEY:!0,IMPLICIT_ACCOUNT:!0,INT:!0,ISNAT:!0,JOIN_TICKETS:!0,KECCAK:!0,LE:!0,LEVEL:!0,LSL:!0,LSR:!0,LT:!0,MEM:!0,MUL:!0,NEG:!0,NEQ:!0,NEVER:!0,NOT:!0,NOW:!0,OR:!0,PACK:!0,PAIRING_CHECK:!0,READ_TICKET:!0,SAPLING_VERIFY_UPDATE:!0,SELF:!0,SELF_ADDRESS:!0,SENDER:!0,SET_DELEGATE:!0,SHA256:!0,SHA3:!0,SHA512:!0,SIZE:!0,SLICE:!0,SOME:!0,SOURCE:!0,SPLIT_TICKET:!0,SUB:!0,SWAP:!0,TICKET:!0,TICKET_DEPRECATED:!0,TOTAL_VOTING_POWER:!0,TRANSFER_TOKENS:!0,UNIT:!0,VOTING_POWER:!0,XOR:!0,RENAME:!0,OPEN_CHEST:!0,SUB_MUTEZ:!0,MIN_BLOCK_TIME:!0,BYTES:!0,NAT:!0},xe=Object.assign({},Re,{CONTRACT:!0,CREATE_CONTRACT:!0,DIG:!0,DIP:!0,DROP:!0,DUG:!0,DUP:!0,EMIT:!0,EMPTY_BIG_MAP:!0,EMPTY_MAP:!0,EMPTY_SET:!0,GET:!0,IF:!0,IF_CONS:!0,IF_LEFT:!0,IF_NONE:!0,ITER:!0,LAMBDA:!0,LAMBDA_REC:!0,LEFT:!0,LOOP:!0,LOOP_LEFT:!0,MAP:!0,NIL:!0,NONE:!0,PAIR:!0,PUSH:!0,RIGHT:!0,SAPLING_EMPTY_STATE:!0,UNPACK:!0,UNPAIR:!0,UPDATE:!0,CAST:!0,VIEW:!0}),Ie={unit:!0,never:!0,bool:!0,int:!0,nat:!0,string:!0,chain_id:!0,bytes:!0,mutez:!0,key_hash:!0,key:!0,signature:!0,timestamp:!0,address:!0,tx_rollup_l2_address:!0},Me=Object.assign({},Ie,{or:!0,pair:!0,set:!0,big_map:!0,contract:!0,lambda:!0,list:!0,map:!0,operation:!0,option:!0,bls12_381_g1:!0,bls12_381_g2:!0,bls12_381_fr:!0,sapling_transaction:!0,sapling_transaction_deprecated:!0,sapling_state:!0,ticket:!0,chest_key:!0,chest:!0});class Le extends ue{constructor(e,t){super(e,t),this.val=e,this.message=t,this.name="MichelsonValidationError"}}function ke(e){return"prim"in e}function Ne(e){if(ke(e))return!0;throw new Le(e,"prim expression expected")}function Ce(e){if(Array.isArray(e))return!0;throw new Le(e,"sequence expression expected")}function je(e){if(function(e){return Array.isArray(e)||"prim"in e}(e))return!0;throw new Le(e,"prim or sequence expression expected")}function De(e){if("-"===e.int[0])throw new Le(e,"natural number expected")}function Ue(e){if("int"in e)return!0;throw new Le(e,"int literal expected")}function Be(e){if("string"in e)return!0;throw new Le(e,"string literal expected")}function Fe(e,t){var r;if(0===t&&void 0===e.args||(null===(r=e.args)||void 0===r?void 0:r.length)===t)return!0;throw new Le(e,`${t} arguments expected`)}function Ke(e){var t,r;if(Array.isArray(e)){for(const t of e){if(!Array.isArray(t)&&!ke(t))throw new Le(e,"sequence or prim expected");Ke(t)}return!0}if(Ne(e)){if(Object.prototype.hasOwnProperty.call(Re,e.prim))return Fe(e,0),!0;switch(e.prim){case"DROP":case"PAIR":case"UNPAIR":case"DUP":case"UPDATE":case"GET":void 0!==e.args&&Fe(e,1)&&Ue(e.args[0])&&De(e.args[0]);break;case"DIG":case"DUG":case"SAPLING_EMPTY_STATE":Fe(e,1)&&Ue(e.args[0])&&De(e.args[0]);break;case"NONE":case"LEFT":case"RIGHT":case"NIL":case"CAST":Fe(e,1)&&Je(e.args[0]);break;case"UNPACK":Fe(e,1)&&Ge(e.args[0]);break;case"CONTRACT":Fe(e,1)&&ze(e.args[0]);break;case"IF_NONE":case"IF_LEFT":case"IF_CONS":case"IF":Fe(e,2)&&(Ce(e.args[0])&&Ke(e.args[0]),Ce(e.args[1])&&Ke(e.args[1]));break;case"MAP":case"ITER":case"LOOP":case"LOOP_LEFT":Fe(e,1)&&Ke(e.args[0]);break;case"CREATE_CONTRACT":Fe(e,1)&&Qe(e.args[0]);break;case"DIP":if(2===(null===(t=e.args)||void 0===t?void 0:t.length))Ue(e.args[0])&&De(e.args[0]),Ce(e.args[1])&&Ke(e.args[1]);else{if(1!==(null===(r=e.args)||void 0===r?void 0:r.length))throw new Le(e,"1 or 2 arguments expected");Ce(e.args[0])&&Ke(e.args[0])}break;case"PUSH":Fe(e,2)&&($e(e.args[0]),Xe(e.args[1]));break;case"EMPTY_SET":Fe(e,1)&&He(e.args[0]);break;case"EMPTY_MAP":Fe(e,2)&&(He(e.args[0]),Je(e.args[1]));break;case"EMPTY_BIG_MAP":Fe(e,2)&&(He(e.args[0]),qe(e.args[1]));break;case"LAMBDA_REC":case"LAMBDA":Fe(e,3)&&(Je(e.args[0]),Je(e.args[1]),Ce(e.args[2])&&Ke(e.args[2]));break;case"VIEW":Fe(e,2)&&(Be(e.args[0])&&Ze(e.args[0]),Je(e.args[1])&&$e(e.args[1]));break;case"EMIT":e.args&&e.args.length>0?Fe(e,1):Fe(e,0);break;default:throw new Le(e,"instruction expected")}}return!0}function He(e){if(je(e))if(Array.isArray(e)||"pair"===e.prim||"or"===e.prim||"option"===e.prim)Ye(e,(e=>He(e)));else if(!Object.prototype.hasOwnProperty.call(Ie,e.prim))throw new Le(e,`${e.prim}: type is not comparable`);return!0}function Ge(e){if(je(e)&&ke(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"big_map"===e.prim||"operation"===e.prim||"sapling_state"===e.prim||"ticket"===e.prim)throw new Le(e,`${e.prim}: type can't be used inside PACK/UNPACK instructions`);Ye(e,(e=>Ge(e)))}return!0}function $e(e){if(je(e)&&ke(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"big_map"===e.prim||"operation"===e.prim||"sapling_state"===e.prim||"ticket"===e.prim||"contract"===e.prim)throw new Le(e,`${e.prim}: type can't be pushed`);Ye(e,(e=>$e(e)))}return!0}function Ve(e){if(je(e)&&ke(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"operation"===e.prim||"contract"===e.prim)throw new Le(e,`${e.prim}: type can't be used as part of a storage`);Ye(e,(e=>Ve(e)))}return!0}function ze(e){if(je(e)&&ke(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"operation"===e.prim)throw new Le(e,`${e.prim}: type can't be used as part of a parameter`);Ye(e,(e=>ze(e)))}return!0}function qe(e){if(je(e)&&ke(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"big_map"===e.prim||"operation"===e.prim||"sapling_state"===e.prim)throw new Le(e,`${e.prim}: type can't be used inside a big_map`);Ye(e,(e=>qe(e)))}return!0}const We=new RegExp("^[a-zA-Z0-9_.%@]*$");function Ze(e){if(e.string.length>Te)throw new Le(e,`view name too long: ${e.string}`);if(!We.test(e.string))throw new Le(e,`invalid character(s) in view name: ${e.string}`)}function Je(e){if(je(e)&&ke(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim))throw new Le(e,"type expected");Ye(e,(e=>Je(e)))}return!0}function Ye(e,t){if(Array.isArray(e)||"pair"===e.prim){const r=Array.isArray(e)?e:e.args;if(void 0===r||r.length<2)throw new Le(e,"at least 2 arguments expected");return r.forEach((e=>{je(e)&&t(e)})),!0}switch(e.prim){case"option":case"list":Fe(e,1)&&je(e.args[0])&&t(e.args[0]);break;case"contract":Fe(e,1)&&ze(e.args[0]);break;case"or":Fe(e,2)&&je(e.args[0])&&je(e.args[1])&&(t(e.args[0]),t(e.args[1]));break;case"lambda":Fe(e,2)&&(Je(e.args[0]),Je(e.args[1]));break;case"set":Fe(e,1)&&He(e.args[0]);break;case"map":Fe(e,2)&&je(e.args[0])&&je(e.args[1])&&(He(e.args[0]),t(e.args[1]));break;case"big_map":Fe(e,2)&&je(e.args[0])&&je(e.args[1])&&(He(e.args[0]),qe(e.args[1]),t(e.args[1]));break;case"ticket":Fe(e,1)&&je(e.args[0])&&He(e.args[0]);break;case"sapling_state":case"sapling_transaction":Fe(e,1)&&Ue(e.args[0]);break;default:Fe(e,0)}return!0}function Xe(e){if("int"in e||"string"in e||"bytes"in e)return!0;if(Array.isArray(e)){let t=0;for(const r of e)ke(r)&&"Elt"===r.prim?(Fe(r,2)&&(Xe(r.args[0]),Xe(r.args[1])),t++):Xe(r);if(0!==t&&t!==e.length)throw new Le(e,"data entries and map elements can't be intermixed");return!0}if(!ke(e))throw new Le(e,"data entry expected");switch(e.prim){case"Unit":case"True":case"False":case"None":Fe(e,0);break;case"Pair":if(void 0===e.args||e.args.length<2)throw new Le(e,"at least 2 arguments expected");for(const t of e.args)Xe(t);break;case"Left":case"Right":case"Some":Fe(e,1)&&Xe(e.args[0]);break;case"Lambda_rec":e.args&&Ke(e.args);break;default:if(!Object.prototype.hasOwnProperty.call(xe,e.prim))throw new Le(e,"data entry or instruction expected");Ke(e)}return!0}function Qe(e){if(Ce(e)){const t={},r={};for(const n of e)if(Ne(n)){if("view"!==n.prim){if(n.prim in t)throw new Le(e,`duplicate contract section: ${n.prim}`);t[n.prim]=!0}switch(n.prim){case"code":Fe(n,1)&&Ce(n.args[0])&&Ke(n.args[0]);break;case"parameter":if(Fe(n,1)&&ze(n.args[0]),n.annots)throw new Le(n,"Annotation must be part of the parameter type");break;case"storage":Fe(n,1)&&Ve(n.args[0]);break;case"view":if(Fe(n,4)){if(Be(n.args[0])){const t=n.args[0];if(t.string in r)throw new Le(e,`duplicate view name: ${t.string}`);r[t.string]=!0,Ze(t)}$e(n.args[1]),$e(n.args[2]),Ce(n.args[3])&&Ke(n.args[3])}break;default:throw new Le(e,`unexpected contract section: ${n.prim}`)}}}return!0}function et(e){try{return Qe(e),!0}catch(e){return!1}}function tt(e){try{return Xe(e),!0}catch(e){return!1}}function rt(e){try{return Ke(e),!0}catch(e){return!1}}function nt(e){try{return Je(e),!0}catch(e){return!1}}function it(e){return Object.prototype.hasOwnProperty.call(xe,e.prim)}function ot(e){if(!Array.isArray(e))return!1;for(const t of e)if("prim"in t){if(it(t))throw new ue(e,`Instruction outside of a lambda: ${JSON.stringify(e)}`);if("Elt"===t.prim)throw new ue(e,`Elt item outside of a map literal: ${JSON.stringify(e)}`)}return!0}"function"==typeof SuppressedError&&SuppressedError;const st=["parameter","storage","code","False","Elt","Left","None","Pair","Right","Some","True","Unit","PACK","UNPACK","BLAKE2B","SHA256","SHA512","ABS","ADD","AMOUNT","AND","BALANCE","CAR","CDR","CHECK_SIGNATURE","COMPARE","CONCAT","CONS","CREATE_ACCOUNT","CREATE_CONTRACT","IMPLICIT_ACCOUNT","DIP","DROP","DUP","EDIV","EMPTY_MAP","EMPTY_SET","EQ","EXEC","FAILWITH","GE","GET","GT","HASH_KEY","IF","IF_CONS","IF_LEFT","IF_NONE","INT","LAMBDA","LE","LEFT","LOOP","LSL","LSR","LT","MAP","MEM","MUL","NEG","NEQ","NIL","NONE","NOT","NOW","OR","PAIR","PUSH","RIGHT","SIZE","SOME","SOURCE","SENDER","SELF","STEPS_TO_QUOTA","SUB","SWAP","TRANSFER_TOKENS","SET_DELEGATE","UNIT","UPDATE","XOR","ITER","LOOP_LEFT","ADDRESS","CONTRACT","ISNAT","CAST","RENAME","bool","contract","int","key","key_hash","lambda","list","map","big_map","nat","option","or","pair","set","signature","string","bytes","mutez","timestamp","unit","operation","address","SLICE","DIG","DUG","EMPTY_BIG_MAP","APPLY","chain_id","CHAIN_ID","LEVEL","SELF_ADDRESS","never","NEVER","UNPAIR","VOTING_POWER","TOTAL_VOTING_POWER","KECCAK","SHA3","PAIRING_CHECK","bls12_381_g1","bls12_381_g2","bls12_381_fr","sapling_state","sapling_transaction_deprecated","SAPLING_EMPTY_STATE","SAPLING_VERIFY_UPDATE","ticket","TICKET_DEPRECATED","READ_TICKET","SPLIT_TICKET","JOIN_TICKETS","GET_AND_UPDATE","chest","chest_key","OPEN_CHEST","VIEW","view","constant","SUB_MUTEZ","tx_rollup_l2_address","MIN_BLOCK_TIME","sapling_transaction","EMIT","Lambda_rec","LAMBDA_REC","TICKET","BYTES","NAT"],at=Object.assign({},...st.map(((e,t)=>({[e]:t}))));var ct;!function(e){e[e.Int=0]="Int",e[e.String=1]="String",e[e.Sequence=2]="Sequence",e[e.Prim0=3]="Prim0",e[e.Prim0Annot=4]="Prim0Annot",e[e.Prim1=5]="Prim1",e[e.Prim1Annot=6]="Prim1Annot",e[e.Prim2=7]="Prim2",e[e.Prim2Annot=8]="Prim2Annot",e[e.Prim=9]="Prim",e[e.Bytes=10]="Bytes"}(ct||(ct={}));class ut{constructor(){this.buffer=[]}get length(){return this.buffer.length}writeBytes(e){this.buffer.push(...e.map((e=>255&e)))}writeUint8(e){const t=0|e;this.buffer.push(255&t)}writeUint16(e){const t=0|e;this.buffer.push(t>>8&255),this.buffer.push(255&t)}writeUint32(e){const t=0|e;this.buffer.push(t>>24&255),this.buffer.push(t>>16&255),this.buffer.push(t>>8&255),this.buffer.push(255&t)}writeInt8(e){this.writeUint8(e)}writeInt16(e){this.writeUint16(e)}writeInt32(e){this.writeUint32(e)}}const lt=new Error("bounds out of range");class ft{constructor(e,t=0,r=e.length){this.buffer=e,this.idx=t,this.cap=r}get length(){return this.cap-this.idx}readBytes(e){if(this.cap-this.idx<e)throw lt;const t=this.buffer.slice(this.idx,this.idx+e);return this.idx+=e,t}reader(e){if(this.cap-this.idx<e)throw lt;const t=new ft(this.buffer,this.idx,this.idx+e);return this.idx+=e,t}copy(){return new ft(this.buffer,this.idx,this.cap)}readUint8(){if(this.cap-this.idx<1)throw lt;return this.buffer[this.idx++]>>>0}readUint16(){if(this.cap-this.idx<2)throw lt;return(this.buffer[this.idx++]<<8|this.buffer[this.idx++])>>>0}readUint32(){if(this.cap-this.idx<4)throw lt;return(this.buffer[this.idx++]<<24|this.buffer[this.idx++]<<16|this.buffer[this.idx++]<<8|this.buffer[this.idx++])>>>0}readInt8(){if(this.cap-this.idx<1)throw lt;return this.buffer[this.idx++]<<24>>24}readInt16(){if(this.cap-this.idx<2)throw lt;return(this.buffer[this.idx++]<<8|this.buffer[this.idx++])<<16>>16}readInt32(){if(this.cap-this.idx<4)throw lt;return this.buffer[this.idx++]<<24|this.buffer[this.idx++]<<16|this.buffer[this.idx++]<<8|this.buffer[this.idx++]}}var dt,ht,pt;function bt(e){let t;const r=e.readUint8();switch(r){case ht.ED25519:t="ED25519PublicKeyHash";break;case ht.SECP256K1:t="SECP256K1PublicKeyHash";break;case ht.P256:t="P256PublicKeyHash";break;default:throw new Error(`unknown public key hash tag: ${r}`)}return{type:t,hash:e.readBytes(20)}}function mt(e){let t;const r=e.readUint8();switch(r){case dt.Implicit:t=bt(e);break;case dt.Originated:t={type:"ContractHash",hash:e.readBytes(20)},e.readBytes(1);break;default:throw new Error(`unknown address tag: ${r}`)}if(0!==e.length){const r=new TextDecoder;t.entryPoint=r.decode(new Uint8Array(e.readBytes(e.length)))}return t}function gt(e,t){let r;switch(e.type){case"ED25519PublicKeyHash":r=ht.ED25519;break;case"SECP256K1PublicKeyHash":r=ht.SECP256K1;break;case"P256PublicKeyHash":r=ht.P256;break;default:throw new Error(`unexpected address type: ${e.type}`)}t.writeUint8(r),t.writeBytes(Array.from(e.hash))}function vt(e){let t,r;const n=e.readUint8();switch(n){case pt.ED25519:r="ED25519PublicKey",t=32;break;case pt.SECP256K1:r="SECP256K1PublicKey",t=33;break;case pt.P256:r="P256PublicKey",t=33;break;default:throw new Error(`unknown public key tag: ${n}`)}return{type:r,publicKey:e.readBytes(t)}}function yt(e,t,r){var n,i;const[o,s]=r(e);if(Array.isArray(o)){const e=new ut;for(const t of o){const r=s.next();if(r.done)throw new Error("REPORT ME: iterator is done");yt(t,e,r.value)}return t.writeUint8(ct.Sequence),t.writeUint32(e.length),void t.writeBytes(e.buffer)}if("string"in o){const e=(new TextEncoder).encode(o.string);return t.writeUint8(ct.String),t.writeUint32(e.length),void t.writeBytes(Array.from(e))}if("int"in o){t.writeUint8(ct.Int);let e=BigInt(o.int);const r=e<0;r&&(e=-e);let n=0;do{const i=0===n?BigInt(6):BigInt(7);let o=e&(BigInt(1)<<i)-BigInt(1);e>>=i,e&&(o|=BigInt(128)),0===n&&r&&(o|=BigInt(64)),t.writeUint8(Number(o)),n++}while(e);return}if("bytes"in o){const e=function(e){const t=[];for(let r=0;r<e.length;r+=2){const n=e.slice(r,r+2),i=parseInt(n,16);if(Number.isNaN(i))throw new ce(n);t.push(i)}return t}(o.bytes);return t.writeUint8(ct.Bytes),t.writeUint32(e.length),void t.writeBytes(e)}const a=at[o.prim];if(void 0===a)throw new TypeError(`Can't encode primary: ${o.prim}`);const c=((null===(n=o.args)||void 0===n?void 0:n.length)||0)<3?ct.Prim0+2*((null===(i=o.args)||void 0===i?void 0:i.length)||0)+(void 0===o.annots||0===o.annots.length?0:1):ct.Prim;if(t.writeUint8(c),t.writeUint8(a),void 0!==o.args)if(o.args.length<3)for(const e of o.args){const r=s.next();if(r.done)throw new Error("REPORT ME: iterator is done");yt(e,t,r.value)}else{const e=new ut;for(const t of o.args){const r=s.next();if(r.done)throw new Error("REPORT ME: iterator is done");yt(t,e,r.value)}t.writeUint32(e.length),t.writeBytes(e.buffer)}if(void 0!==o.annots&&0!==o.annots.length){const e=(new TextEncoder).encode(o.annots.join(" "));t.writeUint32(e.length),t.writeBytes(Array.from(e))}else void 0!==o.args&&o.args.length>=3&&t.writeUint32(0)}function _t(e,t){function*r(){for(;;)yield xt}const[n,i]=t,o=e.readUint8();switch(o){case ct.Int:{const t=[];let r;do{r=e.readInt8(),t.push(r)}while(0!=(128&r));let n=BigInt(0),o=!1;for(let e=t.length-1;e>=0;e--){const r=0===e?BigInt(6):BigInt(7),i=BigInt(t[e]);n<<=r,n|=i&(BigInt(1)<<r)-BigInt(1),0===e&&(o=!!(i&BigInt(64)))}return o&&(n=-n),i({int:String(n)})}case ct.String:{const t=e.readUint32(),r=e.readBytes(t);return i({string:(new TextDecoder).decode(new Uint8Array(r))})}case ct.Bytes:{const t=e.readUint32(),r=e.readBytes(t);return i({bytes:Pe(Array.from(r))})}case ct.Sequence:{const t=e.readUint32();let o=[],s=e.copy(),a=r();for(let r=0;r<2;r++){const r=s.reader(t);for(o=[];r.length>0;){const e=a.next();if(e.done)throw new Error("REPORT ME: iterator is done");o.push(_t(r,e.value))}a=n(o),s=e}return i(o)}default:{if(o>9)throw new Error(`Unknown tag: ${o}`);const t=e.readUint8();if(t>=st.length)throw new Error(`Unknown primitive tag: ${t}`);const s=st[t],a=o-3>>1;let c={prim:s},u=r(),l=e.copy();for(let t=0;t<2;t++){if(c={prim:s},a<3)for(let e=0;e<a;e++){const e=u.next();if(e.done)throw new Error("REPORT ME: iterator is done");c.args=c.args||[],c.args.push(_t(l,e.value))}else{c.args=c.args||[];const e=l.readUint32(),t=l.reader(e);for(;t.length>0;){const e=u.next();if(e.done)throw new Error("REPORT ME: iterator is done");c.args.push(_t(t,e.value))}}u=n(c),l=e}if(1==(o-3&1)||3===a){const t=e.readUint32();if(0!==t){const r=e.readBytes(t),n=new TextDecoder;c.annots=n.decode(new Uint8Array(r)).split(" ")}}return i(c)}}}!function(e){e[e.Implicit=0]="Implicit",e[e.Originated=1]="Originated"}(dt||(dt={})),function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e[e.P256=2]="P256"}(ht||(ht={})),function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e[e.P256=2]="P256"}(pt||(pt={}));const wt=e=>"prim"in e&&("Left"===e.prim||"Right"===e.prim),Et=e=>"prim"in e&&("Some"===e.prim||"None"===e.prim),Ot=e=>{if(Ee(e))return t=>{if(!Oe(t))throw new fe(e,`pair expected: ${JSON.stringify(t)}`,t);ot(t);const r=we("pair",e);return[we("Pair",t),function*(){for(const e of r.args)yield Ot(e)}()]};switch(e.prim){case"or":return t=>{if(!wt(t))throw new fe(e,`or expected: ${JSON.stringify(t)}`,t);return[t,function*(){yield Ot(e.args["Left"===t.prim?0:1])}()]};case"option":return t=>{if(!Et(t))throw new fe(e,`option expected: ${JSON.stringify(t)}`,t);return[t,function*(){"Some"===t.prim&&(yield Ot(e.args[0]))}()]};case"list":case"set":return t=>{if(!Array.isArray(t))throw new fe(e,`${e.prim} expected: ${JSON.stringify(t)}`,t);return[t,function*(){for(const r of t)yield Ot(e.args[0])}()]};case"map":return t=>{if(!Array.isArray(t))throw new fe(e,`map expected: ${JSON.stringify(t)}`,t);return[t,function*(){for(const r of t)yield t=>{if(!("prim"in t)||"Elt"!==t.prim)throw new fe(e,`map element expected: ${JSON.stringify(t)}`,t);return[t,function*(){for(const t of e.args)yield Ot(t)}()]}}()]};case"chain_id":return t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`chain id expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ChainID");if(null===n)throw new fe(e,`chain id base58 expected: ${t.string}`,t);r={bytes:Pe(n[1])}}else r=t;return[r,[][Symbol.iterator]()]};case"signature":return t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`signature expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature");if(null===n)throw new fe(e,`signature base58 expected: ${t.string}`,t);r={bytes:Pe(n[1])}}else r=t;return[r,[][Symbol.iterator]()]};case"key_hash":return t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`key hash expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash");if(null===n)throw new fe(e,`key hash base58 expected: ${t.string}`,t);const i=new ut;gt({type:n[0],hash:n[1]},i),r={bytes:Pe(i.buffer)}}else r=t;return[r,[][Symbol.iterator]()]};case"key":return t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`public key expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey");if(null===n)throw new fe(e,`public key base58 expected: ${t.string}`,t);const i=new ut;!function(e,t){let r;switch(e.type){case"ED25519PublicKey":r=pt.ED25519;break;case"SECP256K1PublicKey":r=pt.SECP256K1;break;case"P256PublicKey":r=pt.P256;break;default:throw new Error(`unexpected public key type: ${e.type}`)}t.writeUint8(r),t.writeBytes(Array.from(e.publicKey))}({type:n[0],publicKey:n[1]},i),r={bytes:Pe(i.buffer)}}else r=t;return[r,[][Symbol.iterator]()]};case"address":return t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`address expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=t.string.split("%"),i=ye(n[0],"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash");if(null===i)throw new fe(e,`address base58 expected: ${t.string}`,t);const o=new ut;!function(e,t){if("ContractHash"===e.type?(t.writeUint8(dt.Originated),t.writeBytes(Array.from(e.hash)),t.writeUint8(0)):(t.writeUint8(dt.Implicit),gt(e,t)),void 0!==e.entryPoint&&""!==e.entryPoint&&"default"!==e.entryPoint){const r=(new TextEncoder).encode(e.entryPoint);t.writeBytes(Array.from(r))}}({type:i[0],hash:i[1],entryPoint:n.length>1?n[1]:void 0},o),r={bytes:Pe(o.buffer)}}else r=t;return[r,[][Symbol.iterator]()]};case"timestamp":return t=>{if(!("string"in t)&&!("int"in t))throw new fe(e,`timestamp expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=Ae(t);if(null===n)throw new fe(e,`can't parse date: ${t.string}`,t);r={int:String(Math.floor(n.getTime()/1e3))}}else r=t;return[r,[][Symbol.iterator]()]};default:return At}},St=e=>"prim"in e&&"PUSH"===e.prim,At=e=>St(e)?(Ke(e),[e,function*(){yield At,yield Ot(e.args[0])}()]):[e,function*(){for(;;)yield At}()];function Pt(e,t){const r=new ut;return r.writeUint8(5),yt(e,r,void 0!==t?Ot(t):At),r.buffer}function Tt(e,t){return{bytes:Pe(Pt(e,t))}}const Rt=e=>{if(Ee(e))return[t=>{if(!Oe(t))throw new fe(e,`pair expected: ${JSON.stringify(t)}`,t);const r=we("pair",e);return function*(){for(const e of r.args)yield Rt(e)}()},e=>e];switch(e.prim){case"or":return[t=>{if(!wt(t))throw new fe(e,`or expected: ${JSON.stringify(t)}`,t);return function*(){yield Rt(e.args["Left"===t.prim?0:1])}()},e=>e];case"option":return[t=>{if(!Et(t))throw new fe(e,`option expected: ${JSON.stringify(t)}`,t);return function*(){"Some"===t.prim&&(yield Rt(e.args[0]))}()},e=>e];case"list":case"set":return[t=>{if(!Array.isArray(t))throw new fe(e,`${e.prim} expected: ${JSON.stringify(t)}`,t);return function*(){for(;;)yield Rt(e.args[0])}()},e=>e];case"map":return[t=>{if(!Array.isArray(t))throw new fe(e,`map expected: ${JSON.stringify(t)}`,t);return function*(){for(;;)yield[t=>{if(!("prim"in t)||"Elt"!==t.prim)throw new fe(e,`map element expected: ${JSON.stringify(t)}`,t);return function*(){for(const t of e.args)yield Rt(t)}()},e=>e]}()},e=>e];case"chain_id":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`chain id expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new fe(e,`can't parse bytes: ${t.bytes}`,t);return{string:_e("ChainID",r)}}];case"signature":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`signature expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new fe(e,`can't parse bytes: ${t.bytes}`,t);return{string:_e("GenericSignature",r)}}];case"key_hash":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`key hash expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new fe(e,`can't parse bytes: ${t.bytes}`,t);const n=bt(new ft(new Uint8Array(r)));return{string:_e(n.type,n.hash)+(n.entryPoint?"%"+n.entryPoint:"")}}];case"key":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`public key expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new fe(e,`can't parse bytes: ${t.bytes}`,t);const n=vt(new ft(new Uint8Array(r)));return{string:_e(n.type,n.publicKey)}}];case"address":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new fe(e,`address expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new fe(e,`can't parse bytes: ${t.bytes}`,t);const n=mt(new ft(new Uint8Array(r)));return{string:_e(n.type,n.hash)+(n.entryPoint?"%"+n.entryPoint:"")}}];case"timestamp":return[()=>[][Symbol.iterator](),t=>{if(!("int"in t)&&!("string"in t))throw new fe(e,`address expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;return{string:new Date(1e3*parseInt(t.int,10)).toISOString().slice(0,19)+"Z"}}];default:return xt}},xt=[e=>St(e)?(Ke(e),function*(){yield xt,yield Rt(e.args[0])}()):function*(){for(;;)yield xt}(),e=>e];function It(e,t){const r=new ft(e);if(5!==r.readUint8())throw new Error("incorrect packed data magic number");const n=_t(r,void 0!==t?Rt(t):xt);if(Xe(n))return n;throw new Error}function Mt(e,t){const r=he(e.bytes);if(null===r)throw new Error(`can't parse bytes: "${e.bytes}"`);return It(r,t)}function Lt(e){const t=he(e.bytes);if(null===t)throw new Error(`can't parse bytes: "${e.bytes}"`);return mt(new ft(new Uint8Array(t)))}function kt(e){const t=he(e.bytes);if(null===t)throw new Error(`can't parse bytes: "${e.bytes}"`);return bt(new ft(new Uint8Array(t)))}function Nt(e){const t=he(e.bytes);if(null===t)throw new Error(`can't parse bytes: "${e.bytes}"`);return vt(new ft(new Uint8Array(t)))}class Ct extends ue{constructor(e,t,r){super(e,r),this.val=e,this.stackState=t,this.message=r,this.name="MichelsonInstructionError"}}function jt(e){return Array.isArray(e)?"pair":e.prim}function Dt(e){return"prim"in e?e.args:e}function Ut(e,t,r=!1){if(jt(e)!==jt(t))throw new fe(e,`types mismatch: ${jt(e)} != ${jt(t)}`,void 0);const n=[ge(e),ge(t)];if(n[0].t&&n[1].t&&n[0].t[0]!==n[1].t[0])throw new fe(e,`${jt(e)}: type names mismatch: ${n[0].t[0]} != ${n[1].t[0]}`,void 0);if(r&&n[0].f&&n[1].f&&n[0].f[0]!==n[1].f[0])throw new fe(e,`${jt(e)}: field names mismatch: ${n[0].f[0]} != ${n[1].f}`,void 0);if(Ee(e)){const r=we("pair",e),n=we("pair",t);return Ut(r.args[0],n.args[0],!0),void Ut(r.args[1],n.args[1],!0)}switch(e.prim){case"option":case"list":case"contract":case"set":case"ticket":Ut(e.args[0],t.args[0]);break;case"or":Ut(e.args[0],t.args[0],!0),Ut(e.args[1],t.args[1],!0);break;case"lambda":case"map":case"big_map":Ut(e.args[0],t.args[0]),Ut(e.args[1],t.args[1]);break;case"sapling_state":case"sapling_transaction":if(parseInt(e.args[0].int,10)!==parseInt(t.args[0].int,10))throw new fe(e,`${jt(e)}: type argument mismatch: ${e.args[0].int} != ${t.args[0].int}`,void 0)}}function Bt(e,t){if(e.length!==t.length)throw new fe(e,`stack length mismatch: ${e.length} != ${t.length}`,void 0);for(let r=0;r<e.length;r++)Ut(e[r],t[r])}function Ft(e,t=!1){var r,n,i;if(!Array.isArray(e)){const o=ge(e);if(((null===(r=o.t)||void 0===r?void 0:r.length)||0)>1)throw new fe(e,`${e.prim}: at most one type annotation allowed: ${e.annots}`,void 0);if(t){if(((null===(n=o.f)||void 0===n?void 0:n.length)||0)>1)throw new fe(e,`${e.prim}: at most one field annotation allowed: ${e.annots}`,void 0)}else if(((null===(i=o.f)||void 0===i?void 0:i.length)||0)>0)throw new fe(e,`${e.prim}: field annotations aren't allowed: ${e.annots}`,void 0)}if(Ee(e)){const t=Dt(e);for(const e of t)Ft(e,!0)}else switch(e.prim){case"option":case"list":case"contract":case"set":Ft(e.args[0]);break;case"or":for(const t of e.args)Ft(t,!0);break;case"lambda":case"map":case"big_map":Ft(e.args[0]),Ft(e.args[1])}}function Kt(e){if(!Array.isArray(e))return!1;for(const t of e)if(!(Array.isArray(t)&&Kt(t)||"prim"in t&&it(t)))return!1;return!0}function Ht(e,t,r){if(Ee(t)){if(Oe(e)){ot(e);const n=we("Pair",e),i=we("pair",t);return Ht(n.args[0],i.args[0],r),void Ht(n.args[1],i.args[1],r)}throw new fe(t,`pair expected: ${JSON.stringify(e)}`,e)}switch(t.prim){case"int":if("int"in e&&pe(e.int))return;throw new fe(t,`integer value expected: ${JSON.stringify(e)}`,e);case"nat":case"mutez":if("int"in e&&be(e.int))return;throw new fe(t,`natural value expected: ${JSON.stringify(e)}`,e);case"string":if("string"in e)return;throw new fe(t,`string value expected: ${JSON.stringify(e)}`,e);case"bytes":case"bls12_381_g1":case"bls12_381_g2":if("bytes"in e&&null!==he(e.bytes))return;throw new fe(t,`bytes value expected: ${JSON.stringify(e)}`,e);case"bool":if("prim"in e&&("True"===e.prim||"False"===e.prim))return;throw new fe(t,`boolean value expected: ${JSON.stringify(e)}`,e);case"key_hash":if("string"in e&&null!==ye(e.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash"))return;if("bytes"in e)try{return void kt(e)}catch(e){}throw new fe(t,`key hash expected: ${JSON.stringify(e)}`,e);case"timestamp":if(("string"in e||"int"in e)&&null!==Ae(e))return;throw new fe(t,`timestamp expected: ${JSON.stringify(e)}`,e);case"address":if("string"in e){let t=e.string;const r=e.string.indexOf("%");if(r>=0&&(t=e.string.slice(0,r)),null!==ye(t,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash","TxRollupL2Address","RollupAddress"))return}else if("bytes"in e)try{return void Lt(e)}catch(e){}throw new fe(t,`address expected: ${JSON.stringify(e)}`,e);case"key":if("string"in e&&null!==ye(e.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey"))return;if("bytes"in e)try{return void Nt(e)}catch(e){}throw new fe(t,`public key expected: ${JSON.stringify(e)}`,e);case"unit":if("prim"in e&&"Unit"===e.prim)return;throw new fe(t,`unit value expected: ${JSON.stringify(e)}`,e);case"signature":if("bytes"in e||"string"in e&&null!==ye(e.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature"))return;throw new fe(t,`signature expected: ${JSON.stringify(e)}`,e);case"chain_id":if("bytes"in e||"string"in e){if(null!==("string"in e?ee(e.string):he(e.bytes)))return}throw new fe(t,`chain id expected: ${JSON.stringify(e)}`,e);case"option":if("prim"in e){if("None"===e.prim)return;if("Some"===e.prim)return void Ht(e.args[0],t.args[0],r)}throw new fe(t,`option expected: ${JSON.stringify(e)}`,e);case"list":case"set":if(ot(e)){for(const n of e)Ht(n,t.args[0],r);return}throw new fe(t,`${t.prim} expected: ${JSON.stringify(e)}`,e);case"or":if("prim"in e){if("Left"===e.prim)return void Ht(e.args[0],t.args[0],r);if("Right"===e.prim)return void Ht(e.args[0],t.args[1],r)}throw new fe(t,`union (or) expected: ${JSON.stringify(e)}`,e);case"lambda":if(Kt(e)){const n=Gt(e,[t.args[0]],r);if("failed"in n)throw new fe(t,`function is failed with error type: ${n.failed}`,e);if(1!==n.length)throw new fe(t,"function must return a value",e);return void Ut(t.args[1],n[0])}throw new fe(t,`function expected: ${JSON.stringify(e)}`,e);case"map":case"big_map":if(Array.isArray(e)){for(const n of e){if(!("prim"in n)||"Elt"!==n.prim)throw new fe(t,`map elements expected: ${JSON.stringify(e)}`,e);Ht(n.args[0],t.args[0],r),Ht(n.args[1],t.args[1],r)}return}throw new fe(t,`${t.prim} expected: ${JSON.stringify(e)}`,e);case"bls12_381_fr":if("int"in e&&pe(e.int)||"bytes"in e&&null!==he(e.bytes))return;throw new fe(t,`BLS12-381 element expected: ${JSON.stringify(e)}`,e);case"sapling_state":if(Array.isArray(e))return;throw new fe(t,`sapling state expected: ${JSON.stringify(e)}`,e);case"ticket":return void Ht(e,{prim:"pair",args:[{prim:"address"},t.args[0],{prim:"nat"}]},r);default:throw new fe(t,`type ${jt(t)} don't have Michelson literal representation`,e)}}function Gt(e,t,r){const n=(null==r?void 0:r.protocol)||b;if(Array.isArray(e))return function(e,t,r){let n=t,i=t,o=0;for(const t of e){const e=Gt(t,i,r);if(n=e,"failed"in e)break;i=e,o++}if("failed"in n&&0==n.level&&(!("prim"in n.failed)||"never"!==n.failed.prim)&&o!==e.length-1)throw new Ct(e,n,"FAIL must appear in a tail position");if(void 0!==(null==r?void 0:r.traceCallback)){const i={op:e,in:t,out:n};r.traceCallback(i)}return"failed"in n?{failed:n.failed,level:n.level+1}:n}(e,t,r);const i=e;function o(e,...r){if(t.length<r.length+e)throw new Ct(i,t,`${i.prim}: stack must have at least ${r.length} element(s)`);let n=e;for(const e of r){if(null!==e&&0!==e.length){let r=0;for(;r<e.length&&e[r]!==jt(t[n]);)r++;if(r===e.length)throw new Ct(i,t,`${i.prim}: stack type mismatch: [${n}] expected to be ${e}, got ${jt(t[n])} instead`)}n++}return t.slice(e,r.length+e)}function s(e){return(...r)=>{try{return e(...r)}catch(e){throw e instanceof ue?new Ct(i,t,e.message):e}}}function a(e){return r=>{try{return e(r)}catch(e){throw e instanceof ue?new Ct(i,t,e.message):e}}}const c=s(ge),u=s(Bt),l=s(Ut),f=a(He),d=a(Ge),m=a(Ve),g=a($e),y=a(qe);function _(e,r){const n=c(i,Object.assign(Object.assign({},r),{emptyFields:void 0!==e.f&&e.f>1,emptyVar:void 0!==e.v&&e.v>1})),o=(e,r,n)=>{if(e&&e.length>(r||0))throw new Ct(i,t,`${i.prim}: at most ${r||0} ${n} annotations allowed`)};return o(n.f,e.f,"field"),o(n.t,e.t,"type"),o(n.v,e.v,"variable"),n}function w(e,t){const r=e,n=Array.isArray(r)?{prim:"pair",args:r}:r,i=c(n),o=void 0!==t.v||void 0!==t.t||void 0!==t.f?[...(null===t.v?i.v:t.v)||[],...(null===t.t?i.t:t.t)||[],...(null===t.f?i.f:t.f)||[]]:void 0,s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(n,["annots"]);return Object.assign(Object.assign({},s),o&&0!==o.length&&{annots:o})}function E(e,t){const r=_({v:1});return w(e,{v:void 0!==r.v?r.v:void 0!==t?[t]:null,t:null})}function O(e,r,n,o,s){var a,u,l,f;const d=null===(a=c(r).f)||void 0===a?void 0:a[0],h=null===(u=n.f)||void 0===u?void 0:u[o];if(void 0!==h&&"%"!==h&&void 0!==d&&h!==d)throw new Ct(i,t,`${i.prim}: field names doesn't match: ${h} !== ${d}`);const p=null===(l=n.v)||void 0===l?void 0:l[o],b=null===(f=c(e).v)||void 0===f?void 0:f[0];return w(r,{t:null,v:p?"@%"===p?d?["@"+d.slice(1)]:void 0:"@%%"===p?b?["@"+b.slice(1)+"."+(d?d.slice(1):s)]:d?["@"+d.slice(1)]:void 0:[p]:null})}function S(e,r,n=r){const o=we("pair",e);if(1===n)return[o.args[0]];if(2===n)return o.args;const s=o.args[1];if(Ee(s))return[o.args[0],...S(s,r,n-1)];throw new Ct(i,t,`${i.prim}: at least ${r} fields are expected`)}function A(e,r,n=r){if(0===n)return e;const o=we("pair",e);if(1===n)return o.args[0];const s=o.args[1];if(Ee(s))return A(s,r,n-2);if(2===n)return s;throw new Ct(i,t,`${i.prim}: at least ${r+1} fields are expected`)}function P(e,r,n,o=n){if(0===o)return r;const s=we("pair",e);if(1===o)return Object.assign(Object.assign({},s),{args:[r,s.args[1]]});const a=s.args[1];if(Ee(a))return Object.assign(Object.assign({},s),{args:[s.args[0],P(a,r,n,o-2)]});if(2===o)return Object.assign(Object.assign({},s),{args:[s.args[0],r]});throw new Ct(i,t,`${i.prim}: at least ${n+1} fields are expected`)}const T=(e,t)=>["@"+(e.v?e.v[0].slice(1)+".":"")+t];function R(e,t){return"failed"in e||"failed"in t?"failed"in e?t:e:(u(e,t),e)}const x=(e=>{var i,s,a,b,x;switch(e.prim){case"DUP":{const r=e.args?parseInt(e.args[0].int,10):1;if(0===r)throw new Ct(e,t,"DUP 0 is forbidden");const n=o(r-1,null)[0];if("ticket"===jt(n))throw new Ct(e,t,"ticket can't be DUPed");return[n,...t]}case"SWAP":{const e=o(0,null,null);return _({}),[e[1],e[0],...t.slice(2)]}case"SOME":return[w({prim:"option",args:[o(0,null)[0]]},_({t:1,v:1})),...t.slice(1)];case"UNIT":return[w({prim:"unit"},_({v:1,t:1})),...t];case"PAIR":{const r=e.args?parseInt(e.args[0].int,10):2;if(r<2)throw new Ct(e,t,`PAIR ${r} is forbidden`);const n=o(0,...new Array(r).fill(null)),i=_({f:r,t:1,v:1},{specialFields:!0}),s=e=>{const t=e.lastIndexOf(".");return e.slice(t>0?t+1:1)},a=n.map(((e,t)=>{var r;const n=c(e);return w(e,{v:null,t:null,f:i.f&&i.f.length>t&&"%"!==i.f[t]?"%@"===i.f[t]?n.v?["%"+s((null===(r=n.v)||void 0===r?void 0:r[0])||"")]:void 0:[i.f[t]]:void 0})}));return[w({prim:"pair",args:a},{t:i.t,v:i.v}),...t.slice(r)]}case"UNPAIR":{const r=e.args?parseInt(e.args[0].int,10):2;if(r<2)throw new Ct(e,t,`UNPAIR ${r} is forbidden`);const n=o(0,["pair"])[0],i=_({f:2,v:2},{specialVar:!0});return[...S(n,r).map(((e,t)=>O(n,e,i,t,0===t?"car":"cdr"))),...t.slice(1)]}case"CAR":case"CDR":{const r=we("pair",o(0,["pair"])[0]);return[O(r,r.args["CAR"===e.prim?0:1],_({f:1,v:1},{specialVar:!0}),0,e.prim.toLocaleLowerCase()),...t.slice(1)]}case"CONS":{const e=o(0,null,["list"]);return l(e[0],e[1].args[0]),[E({prim:"list",args:[e[1].args[0]]}),...t.slice(2)]}case"SIZE":return o(0,["string","list","set","map","bytes"]),[E({prim:"nat"}),...t.slice(1)];case"MEM":{const e=o(0,null,["set","map","big_map"]);return f(e[0]),l(e[0],e[1].args[0]),[E({prim:"bool"}),...t.slice(2)]}case"GET":if(e.args){const r=parseInt(e.args[0].int,10);return[E(A(o(0,["pair"])[0],r)),...t.slice(1)]}{const e=o(0,null,["map","big_map"]);return f(e[0]),l(e[0],e[1].args[0]),[E({prim:"option",args:[e[1].args[1]]}),...t.slice(2)]}case"UPDATE":if(e.args){const r=parseInt(e.args[0].int,10),n=o(0,null,["pair"]);return[E(P(n[1],n[0],r)),...t.slice(2)]}{const e=o(0,null,["bool","option"]);if(f(e[0]),"bool"===e[1].prim){const r=o(2,["set"]);return l(e[0],r[0].args[0]),[E({prim:"set",args:[w(e[0],{t:null})]}),...t.slice(3)]}const r=o(2,["map","big_map"]);return l(e[0],r[0].args[0]),"map"===r[0].prim?[E({prim:"map",args:[w(e[0],{t:null}),w(e[1].args[0],{t:null})]}),...t.slice(3)]:(y(e[1].args[0]),[E({prim:"big_map",args:[w(e[0],{t:null}),w(e[1].args[0],{t:null})]}),...t.slice(3)])}case"GET_AND_UPDATE":{const e=_({v:2}),r=o(0,null,["option"],["map","big_map"]);f(r[0]),l(r[0],r[2].args[0]),l(r[1].args[0],r[2].args[1]);const n=null===(i=e.v)||void 0===i?void 0:i.map((e=>"@"!==e?[e]:void 0));return"map"===r[2].prim?[w({prim:"option",args:[r[2].args[1]]},{v:null==n?void 0:n[0]}),w({prim:"map",args:[w(r[0],{t:null}),w(r[1].args[0],{t:null})]},{v:null==n?void 0:n[1]}),...t.slice(3)]:(y(r[1].args[0]),[w({prim:"option",args:[r[2].args[1]]},{v:null==n?void 0:n[0]}),w({prim:"big_map",args:[w(r[0],{t:null}),w(r[1].args[0],{t:null})]},{v:null==n?void 0:n[1]}),...t.slice(3)])}case"EXEC":{const e=o(0,null,["lambda"]);return l(e[0],e[1].args[0]),[E(e[1].args[1]),...t.slice(2)]}case"APPLY":{const r=o(0,null,["lambda"]);if(m(r[0]),g(r[0]),!Ee(r[1].args[0]))throw new Ct(e,t,`${e.prim}: function's argument must be a pair: ${jt(r[1].args[0])}`);const n=r[1].args[0];return l(r[0],Dt(n)[0]),[E({prim:"lambda",args:[Dt(n)[1],r[1].args[1]]}),...t.slice(2)]}case"FAILWITH":{const e=o(0,null)[0];return v(n,p.PtEdo2Zk)||d(e),{failed:e,level:0}}case"NEVER":return o(0,["never"]),{failed:{prim:"never"},level:0};case"RENAME":return[E(o(0,null)[0]),...t.slice(1)];case"CONCAT":{const r=o(0,["string","list","bytes"]);if("list"===r[0].prim){if("string"!==jt(r[0].args[0])&&"bytes"!==jt(r[0].args[0]))throw new Ct(e,t,`${e.prim}: can't concatenate list of ${jt(r[0].args[0])}'s`);return[E(r[0].args[0]),...t.slice(1)]}const n=o(1,["string","bytes"]);if(r[0].prim!==n[0].prim)throw new Ct(e,t,`${e.prim}: can't concatenate ${r[0].prim} with ${n[0].prim}`);return[E(n[0]),...t.slice(2)]}case"SLICE":return[E({prim:"option",args:[o(0,["nat"],["nat"],["string","bytes"])[2]]},"@slice"),...t.slice(3)];case"PACK":{const e=o(0,null)[0];return d(e),[E({prim:"bytes"},"@packed"),...t.slice(1)]}case"ADD":{const r=o(0,["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if("nat"===r[0].prim&&"int"===r[1].prim||"int"===r[0].prim&&"nat"===r[1].prim)return[E({prim:"int"}),...t.slice(2)];if("int"===r[0].prim&&"timestamp"===r[1].prim||"timestamp"===r[0].prim&&"int"===r[1].prim)return[E({prim:"timestamp"}),...t.slice(2)];if(("int"===r[0].prim||"nat"===r[0].prim||"mutez"===r[0].prim||"bls12_381_g1"===r[0].prim||"bls12_381_g2"===r[0].prim||"bls12_381_fr"===r[0].prim)&&r[0].prim===r[1].prim)return[E(r[0]),...t.slice(2)];throw new Ct(e,t,`${e.prim}: can't add ${r[0].prim} to ${r[1].prim}`)}case"SUB":{const r=v(n,p.PsiThaCa)?o(0,["nat","int","timestamp","mutez"],["nat","int","timestamp","mutez"]):o(0,["nat","int","timestamp"],["nat","int","timestamp"]);if(("nat"===r[0].prim||"int"===r[0].prim)&&("nat"===r[1].prim||"int"===r[1].prim)||"timestamp"===r[0].prim&&"timestamp"===r[1].prim)return[E({prim:"int"}),...t.slice(2)];if("timestamp"===r[0].prim&&"int"===r[1].prim)return[E({prim:"timestamp"}),...t.slice(2)];if("mutez"===r[0].prim&&"mutez"===r[1].prim)return[E({prim:"mutez"}),...t.slice(2)];throw new Ct(e,t,`${e.prim}: can't subtract ${r[0].prim} from ${r[1].prim}`)}case"SUB_MUTEZ":return o(0,["mutez"],["mutez"]),[E({prim:"option",args:[{prim:"mutez"}]}),...t.slice(2)];case"MUL":{const r=o(0,["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if("nat"===r[0].prim&&"int"===r[1].prim||"int"===r[0].prim&&"nat"===r[1].prim)return[E({prim:"int"}),...t.slice(2)];if("nat"===r[0].prim&&"mutez"===r[1].prim||"mutez"===r[0].prim&&"nat"===r[1].prim)return[E({prim:"mutez"}),...t.slice(2)];if(("bls12_381_g1"===r[0].prim||"bls12_381_g2"===r[0].prim||"bls12_381_fr"===r[0].prim)&&"bls12_381_fr"===r[1].prim||("nat"===r[0].prim||"int"===r[0].prim)&&r[0].prim===r[1].prim)return[E(r[0]),...t.slice(2)];if(("nat"===r[0].prim||"int"===r[0].prim)&&"bls12_381_fr"===r[1].prim||("nat"===r[1].prim||"int"===r[1].prim)&&"bls12_381_fr"===r[0].prim)return[E({prim:"bls12_381_fr"}),...t.slice(2)];throw new Ct(e,t,`${e.prim}: can't multiply ${r[0].prim} by ${r[1].prim}`)}case"EDIV":{const r=(e,t)=>({prim:"option",args:[{prim:"pair",args:[{prim:e},{prim:t}]}]}),n=o(0,["nat","int","mutez"],["nat","int","mutez"]);if("nat"===n[0].prim&&"nat"===n[1].prim)return[E(r("nat","nat")),...t.slice(2)];if(!("nat"!==n[0].prim&&"int"!==n[0].prim||"nat"!==n[1].prim&&"int"!==n[1].prim))return[E(r("int","nat")),...t.slice(2)];if("mutez"===n[0].prim&&"nat"===n[1].prim)return[E(r("mutez","mutez")),...t.slice(2)];if("mutez"===n[0].prim&&"mutez"===n[1].prim)return[E(r("nat","mutez")),...t.slice(2)];throw new Ct(e,t,`${e.prim}: can't euclideally divide ${n[0].prim} by ${n[1].prim}`)}case"ABS":return o(0,["int"]),[E({prim:"nat"}),...t.slice(1)];case"ISNAT":return o(0,["int"]),[E({prim:"option",args:[{prim:"nat"}]}),...t.slice(1)];case"INT":return o(0,["nat","bls12_381_fr","bytes"]),[E({prim:"int"}),...t.slice(1)];case"BYTES":return o(0,["nat","int"]),[E({prim:"bytes"}),...t.slice(1)];case"NAT":return o(0,["bytes"]),[E({prim:"nat"}),...t.slice(1)];case"NEG":{const e=o(0,["nat","int","bls12_381_g1","bls12_381_g2","bls12_381_fr"])[0];return"nat"===e.prim||"int"===e.prim?[E({prim:"int"}),...t.slice(1)]:[E(e),...t.slice(1)]}case"LSL":case"LSR":return o(0,["nat","bytes"],["nat","bytes"]),[E({prim:"nat"}),...t.slice(2)];case"OR":case"XOR":{const r=o(0,["nat","bytes","bool"],["nat","bytes","bool"]);if(r[0].prim!==r[1].prim)throw new Ct(e,t,`${e.prim}: both arguments must be of the same type: ${r[0].prim}, ${r[1].prim}`);return[E(r[1]),...t.slice(2)]}case"AND":{const r=o(0,["nat","bytes","bool","int"],["nat","bytes","bool"]);if(("int"!==r[0].prim||"nat"!==r[1].prim)&&r[0].prim!==r[1].prim)throw new Ct(e,t,`${e.prim}: both arguments must be of the same type: ${r[0].prim}, ${r[1].prim}`);return[E(r[1]),...t.slice(2)]}case"NOT":return"bool"===o(0,["nat","bytes","bool","int"])[0].prim?[E({prim:"bool"}),...t.slice(1)]:[E({prim:"int"}),...t.slice(1)];case"COMPARE":{const e=o(0,null,null);return f(e[0]),f(e[1]),[E({prim:"int"}),...t.slice(2)]}case"EQ":case"NEQ":case"LT":case"GT":case"LE":case"GE":return o(0,["int"]),[E({prim:"bool"}),...t.slice(1)];case"SELF":{if(void 0===(null==r?void 0:r.contract))throw new Ct(e,t,`${e.prim}: contract required`);const n=_({f:1,v:1}),i=qt(r.contract,null===(s=n.f)||void 0===s?void 0:s[0]);if(null===i)throw new Ct(e,t,`${e.prim}: contract has no entrypoint ${i}`);return[w({prim:"contract",args:[i]},{v:n.v?n.v:["@self"]}),...t]}case"TRANSFER_TOKENS":{const e=o(0,null,["mutez"],["contract"]);return l(e[0],e[2].args[0]),[E({prim:"operation"}),...t.slice(3)]}case"SET_DELEGATE":{const r=o(0,["option"])[0];if("key_hash"!==jt(r.args[0]))throw new Ct(e,t,`${e.prim}: key hash expected: ${jt(r.args[0])}`);return[E({prim:"operation"}),...t.slice(1)]}case"IMPLICIT_ACCOUNT":return o(0,["key_hash"]),[E({prim:"contract",args:[{prim:"unit"}]}),...t.slice(1)];case"NOW":return[E({prim:"timestamp"},"@now"),...t];case"AMOUNT":return[E({prim:"mutez"},"@amount"),...t];case"BALANCE":return[E({prim:"mutez"},"@balance"),...t];case"CHECK_SIGNATURE":return o(0,["key"],["signature"],["bytes"]),[E({prim:"bool"}),...t.slice(3)];case"BLAKE2B":case"SHA256":case"SHA512":case"KECCAK":case"SHA3":return o(0,["bytes"]),[E({prim:"bytes"}),...t.slice(1)];case"HASH_KEY":return o(0,["key"]),[E({prim:"key_hash"}),...t.slice(1)];case"SOURCE":return[E({prim:"address"},"@source"),...t];case"SENDER":return[E({prim:"address"},"@sender"),...t];case"ADDRESS":{const e=o(0,["contract"])[0],r=_({v:1});return[w({prim:"address",[h]:e},{v:r.v?r.v:T(c(e),"address")}),...t.slice(1)]}case"SELF_ADDRESS":{const e={prim:"address"};return void 0!==(null==r?void 0:r.contract)&&(e[h]={prim:"contract",args:[$t(r.contract,"parameter").args[0]]}),[E(e,"@address"),...t]}case"CHAIN_ID":return[E({prim:"chain_id"}),...t];case"DROP":{_({});const r=void 0!==e.args?parseInt(e.args[0].int,10):1;return o(r-1,null),t.slice(r)}case"DIG":{_({});const r=parseInt(e.args[0].int,10);return[o(r,null)[0],...t.slice(0,r),...t.slice(r+1)]}case"DUG":{_({});const r=parseInt(e.args[0].int,10);return[...t.slice(1,r+1),o(0,null)[0],...t.slice(r+1)]}case"NONE":return Ft(e.args[0]),[w({prim:"option",args:[e.args[0]]},_({t:1,v:1})),...t];case"LEFT":case"RIGHT":{const r=o(0,null)[0],n=_({f:2,t:1,v:1},{specialFields:!0}),i=c(r),s=[w(r,{t:null,v:null,f:n.f&&n.f.length>0&&"%"!==n.f[0]?"%@"===n.f[0]?i.v?["%"+i.v[0].slice(1)]:void 0:n.f:void 0}),w(e.args[0],{t:null,f:n.f&&n.f.length>1&&"%"!==n.f[1]?n.f:void 0})];return[w({prim:"or",args:"LEFT"===e.prim?s:[s[1],s[0]]},{t:n.t,v:n.v}),...t.slice(1)]}case"NIL":return Ft(e.args[0]),[w({prim:"list",args:[e.args[0]]},_({t:1,v:1})),...t];case"UNPACK":return o(0,["bytes"]),Ft(e.args[0]),[E({prim:"option",args:[e.args[0]]},"@unpacked"),...t.slice(1)];case"CONTRACT":{const r=o(0,["address"])[0];Ft(e.args[0]);const n=_({v:1,f:1}),i=r[h];if(void 0!==i){const r=qt(i,null===(a=n.f)||void 0===a?void 0:a[0]);if(null===r)throw new Ct(e,t,`${e.prim}: contract has no entrypoint ${r}`);l(r,e.args[0])}return[w({prim:"option",args:[{prim:"contract",args:[e.args[0]]}]},{v:n.v?n.v:T(c(r),"contract")}),...t.slice(1)]}case"CAST":{_({});const r=o(0,null)[0];return Ft(e.args[0]),l(e.args[0],r),[e.args[0],...t.slice(1)]}case"IF_NONE":{_({});const n=o(0,["option"])[0],i=t.slice(1);return R(Gt(e.args[0],i,r),Gt(e.args[1],[w(n.args[0],{t:null,v:T(c(n),"some")}),...i],r))}case"IF_LEFT":{_({});const n=o(0,["or"])[0],i=c(n),s=c(n.args[0]),a=c(n.args[1]),u=t.slice(1);return R(Gt(e.args[0],[w(n.args[0],{t:null,v:T(i,s.f?s.f[0].slice(1):"left")}),...u],r),Gt(e.args[1],[w(n.args[1],{t:null,v:T(i,a.f?a.f[0].slice(1):"right")}),...u],r))}case"IF_CONS":{_({});const n=o(0,["list"])[0],i=c(n),s=t.slice(1);return R(Gt(e.args[0],[w(n.args[0],{t:null,v:T(i,"hd")}),w(n,{t:null,v:T(i,"tl")}),...s],r),Gt(e.args[1],s,r))}case"IF":{_({}),o(0,["bool"]);const n=t.slice(1);return R(Gt(e.args[0],n,r),Gt(e.args[1],n,r))}case"MAP":{const n=o(0,["list","map","option"])[0],i=t.slice(1),s="map"===n.prim?{prim:"pair",args:n.args}:n.args[0],a=Gt(e.args[0],[w(s,{t:null,v:T(c(n),"elt")}),...i],r);if("failed"in a){if(!("prim"in a.failed)||"never"!==a.failed.prim)throw new Ct(e,t,`${e.prim}: FAIL is not allowed in MAP`);return{failed:a.failed,level:a.level+1}}if(a.length<1)throw new Ct(e,t,`${e.prim}: function must return a value`);return u(a.slice(1),i),"list"===n.prim?[E({prim:"list",args:[a[0]]}),...i]:"map"===n.prim?[E({prim:"map",args:[n.args[0],a[0]]}),...i]:[E({prim:"option",args:[a[0]]}),...i]}case"ITER":{_({});const n=o(0,["set","list","map"])[0],i=t.slice(1),s="map"===n.prim?{prim:"pair",args:n.args}:n.args[0],a=Gt(e.args[0],[w(s,{t:null,v:T(c(n),"elt")}),...i],r);return"failed"in a?{failed:a.failed,level:a.level+1}:(u(a,i),i)}case"LOOP":{_({}),o(0,["bool"]);const n=t.slice(1),i=Gt(e.args[0],n,r);return"failed"in i?{failed:i.failed,level:i.level+1}:(u(i,[{prim:"bool"},...n]),n)}case"LOOP_LEFT":{_({});const n=o(0,["or"])[0],i=t.slice(1),s=Gt(e.args[0],[w(n.args[0],{t:null,v:T(c(n),"left")}),...i],r);return"failed"in s?{failed:s.failed,level:s.level+1}:(u(s,[n,...i]),[w(n.args[1],{t:null,v:_({v:1}).v}),...i])}case"DIP":{_({});const n=2===e.args.length?parseInt(e.args[0].int,10):1;o(n-1,null);const i=t.slice(0,n),s=t.slice(n),a=2===e.args.length?Gt(e.args[1],s,r):Gt(e.args[0],s,r);return"failed"in a?{failed:a.failed,level:a.level+1}:[...i,...a]}case"CREATE_CONTRACT":{const r=_({v:2}),n=o(0,["option"],["mutez"],null);if("key_hash"!==jt(n[0].args[0]))throw new Ct(e,t,`${e.prim}: key hash expected: ${jt(n[0].args[0])}`);m(n[2])&&(Zt(e.args[0]),Ut($t(e.args[0],"storage").args[0],n[2]));const i=null===(b=r.v)||void 0===b?void 0:b.map((e=>"@"!==e?[e]:void 0));return[w({prim:"operation"},{v:null==i?void 0:i[0]}),w({prim:"address",[h]:{prim:"contract",args:[$t(e.args[0],"parameter").args[0]]}},{v:null==i?void 0:i[1]}),...t.slice(3)]}case"PUSH":return Ft(e.args[0]),Ht(e.args[1],e.args[0],Object.assign(Object.assign({},r),{contract:void 0})),[E(e.args[0]),...t];case"EMPTY_SET":return Ft(e.args[0]),f(e.args[0]),[w({prim:"set",args:e.args},_({t:1,v:1})),...t];case"EMPTY_MAP":return Ft(e.args[0]),f(e.args[0]),Ft(e.args[1]),[w({prim:"map",args:e.args},_({t:1,v:1})),...t];case"EMPTY_BIG_MAP":return Ft(e.args[0]),f(e.args[0]),Ft(e.args[1]),y(e.args[0]),[w({prim:"big_map",args:e.args},_({t:1,v:1})),...t];case"LAMBDA_REC":case"LAMBDA":{Ft(e.args[0]),Ft(e.args[1]);const n=[e.args[0]];"LAMBDA_REC"===e.prim&&n.push({prim:"lambda",args:[e.args[0],e.args[1]]});const i=Gt(e.args[2],n,Object.assign(Object.assign({},r),{contract:void 0}));if("failed"in i)return{failed:i.failed,level:i.level+1};if(1!==i.length)throw new Ct(e,t,`${e.prim}: function must return a value`);return l(e.args[1],i[0]),[E({prim:"lambda",args:[e.args[0],e.args[1]]}),...t]}case"LEVEL":return[E({prim:"nat"},"@level"),...t];case"TOTAL_VOTING_POWER":case"MIN_BLOCK_TIME":return[E({prim:"nat"}),...t];case"VOTING_POWER":return o(0,["key_hash"]),[E({prim:"nat"}),...t.slice(1)];case"TICKET":{const e=o(0,null,["nat"])[0];return f(e),v(n,p.PtLimaPtL)?[w({prim:"ticket",args:[e]},_({t:1,v:1})),...t.slice(2)]:[E({prim:"option",args:[w({prim:"ticket",args:[e]},_({t:1,v:1}))]}),...t.slice(2)]}case"JOIN_TICKETS":{const r=we("pair",o(0,["pair"])[0]);if("ticket"!==jt(r.args[0]))throw new Ct(e,t,`${e.prim}: ticket expected: ${jt(r.args[0])}`);return l(r.args[0],r.args[1]),[E({prim:"option",args:[w(r.args[0],{t:null})]}),...t.slice(1)]}case"SPLIT_TICKET":{const r=o(0,["ticket"],["pair"]),n=we("pair",r[1]);if("nat"!==jt(n.args[0]))throw new Ct(e,t,`${e.prim}: nat expected: ${jt(n.args[0])}`);return l(n.args[0],n.args[1]),[E({prim:"option",args:[{prim:"pair",args:[w(r[0],{t:null}),w(r[0],{t:null})]}]}),...t.slice(2)]}case"READ_TICKET":{const e=_({v:2}),r=o(0,["ticket"])[0],n=null===(x=e.v)||void 0===x?void 0:x.map((e=>"@"!==e?[e]:void 0));return[w({prim:"pair",args:[{prim:"address"},w(r.args[0],{t:null}),{prim:"nat"}]},{v:null==n?void 0:n[0]}),w(r,{v:null==n?void 0:n[1],t:null}),...t.slice(1)]}case"PAIRING_CHECK":{const r=o(0,["list"])[0].args[0];if(!Ee(r))throw new Ct(e,t,`${e.prim}: pair expected: ${jt(r)}`);const n=we("pair",r);if("bls12_381_g1"!==jt(n.args[0]))throw new Ct(e,t,`${e.prim}: bls12_381_g1 expected: ${jt(n.args[0])}`);if("bls12_381_g2"!==jt(n.args[1]))throw new Ct(e,t,`${e.prim}: bls12_381_g2 expected: ${jt(n.args[1])}`);return[E({prim:"bool"}),...t.slice(1)]}case"SAPLING_EMPTY_STATE":return[w({prim:"sapling_state",args:[e.args[0]]},_({v:1,t:1})),...t];case"SAPLING_VERIFY_UPDATE":{const r=o(0,["sapling_transaction"],["sapling_state"]);if(parseInt(r[0].args[0].int,10)!==parseInt(r[1].args[0].int,10))throw new Ct(e,t,`${e.prim}: sapling memo size mismatch: ${r[0].args[0].int} != ${r[1].args[0].int}`);return v(n,p.PtJakarta)?[E({prim:"option",args:[{prim:"pair",args:[{prim:"int"},w(r[1],{t:null})]}]}),...t.slice(2)]:[E({prim:"option",args:[{prim:"pair",args:[{prim:"bytes"},{prim:"pair",args:[{prim:"int"},w(r[1],{t:null})]}]}]}),...t.slice(2)]}case"OPEN_CHEST":return o(0,["chest_key"],["chest"],["nat"]),[E({prim:"or",args:[{prim:"bytes"},{prim:"bool"}]}),...t.slice(3)];case"VIEW":{const r=o(0,null,["address"]);return g(r[0]),[E({prim:"option",args:[e.args[1]]}),...t.slice(2)]}case"EMIT":{const r=_({f:1,t:1});if(e.args){const n=o(0,null);return l(n[0],e.args[0]),[w({prim:"operation"},r),...t.slice(1)]}return[w({prim:"operation"},r),...t.slice(1)]}default:throw new ue(e,`unexpected instruction: ${e.prim}`)}})(i);if(void 0!==(null==r?void 0:r.traceCallback)){const e={op:i,in:t,out:x};r.traceCallback(e)}return x}function $t(e,t){for(const r of e)if(r.prim===t)return r;throw new ue(e,`missing contract section: ${t}`)}function Vt(e){const t={};for(const r of e)"view"===r.prim&&(t[r.args[0].string]=r);return t}function zt(e){if(Array.isArray(e))for(const t of e)if("prim"in t&&("parameter"===t.prim||"storage"===t.prim||"code"===t.prim))return!0;return!1}function qt(e,t){t=t||"%default";const r=Wt(e).find((e=>e[0]===t));return void 0!==r?r[1]:"%default"===t?zt(e)?$t(e,"parameter").args[0]:e:null}function Wt(e){if(zt(e)){const t=$t(e,"parameter"),r=Wt(t.args[0]),n=ge(t);return n.f?[[n.f[0],t.args[0]],...r]:r}if(t=e,Array.isArray(t)||"or"===t.prim){const t=Dt(e),r=e=>{const r=ge(t[e]);if("or"===jt(t[e])){const n=Wt(t[e]);return r.f?[[r.f[0],t[e]],...n]:n}return r.f?[[r.f[0],t[e]]]:[]};return[...r(0),...r(1)]}var t;return[]}function Zt(e,t){const r=(r,n,i,o)=>{Ft(r,!0),Ft(n);const s=Gt(o,[{prim:"pair",args:[Object.assign(Object.assign({},r),{annots:["@parameter"]}),Object.assign(Object.assign({},n),{annots:["@storage"]})]}],Object.assign(Object.assign({},t),{contract:e}));if("failed"in s)return s;try{Bt(s,[i])}catch(e){throw e instanceof ue?new Ct(o,s,e.message):e}return s},n=$t(e,"parameter").args[0],i=$t(e,"storage").args[0],o=r(n,i,{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},i]},$t(e,"code").args[0]);for(const t of Object.values(Vt(e)))r(t.args[1],i,t.args[2],t.args[3]);return o}function Jt(e,t,r){Ft(t),Ht(e,t,r||null)}function Yt(e,t,r){for(const e of t)Ft(e);if(void 0!==(null==r?void 0:r.contract))for(const e of["parameter","storage"]){Ft($t(r.contract,e).args[0])}return Gt(e,t,r||null)}function Xt(e,t,r=!1){if(Array.isArray(e)){for(const t of e)Ft(t);for(const e of t)Ft(e)}else Ft(e),Ft(t);Ut(e,t,r)}function Qt(e,t=!1){try{return Ft(e,t),!0}catch(e){return!1}}function er(e,t){try{return Zt(e,t)}catch(e){return null}}function tr(e,t,r){try{return Jt(e,t,r),!0}catch(e){return!1}}function rr(e,t,r=!1){try{return Xt(e,t,r),!0}catch(e){return!1}}class nr{constructor(e,t){this.contract=e,this.ctx=Object.assign({contract:e},t),this.output=Zt(e,this.ctx)}static parse(e,t){const r=new K(t),n="string"==typeof e?r.parseScript(e):r.parseJSON(e);if(null===n)throw new re("empty Michelson");if(Qe(n))return new nr(n,t)}static parseTypeExpression(e,t){const r=new K(t),n="string"==typeof e?r.parseScript(e):r.parseJSON(e);if(null===n)throw new ne("empty type expression");if(Je(n))return Ft(n),n}static parseDataExpression(e,t){const r=new K(t),n="string"==typeof e?r.parseScript(e):r.parseJSON(e);if(null===n)throw new ie("empty data expression");if(Xe(n))return n;throw void 0}section(e){return $t(this.contract,e)}entryPoints(){return Wt(this.contract)}entryPoint(e){return qt(this.contract,e)}assertDataValid(e,t){Jt(e,t,this.ctx)}isDataValid(e,t){return tr(e,t,this.ctx)}assertParameterValid(e,t){const r=this.entryPoint(e||void 0);if(null===r)throw new oe(null==e?void 0:e.toString());this.assertDataValid(t,r)}isParameterValid(e,t){try{return this.assertParameterValid(e,t),!0}catch(e){return!1}}functionType(e,t){return Yt(e,t,this.ctx)}}const ir=new nr([{prim:"parameter",args:[{prim:"unit"}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PAIR"}]]}]);function or(e){return"failed"in e?`[FAILED: ${z(e.failed)}]`:e.map(((e,t)=>{const r=ge(e);return`[${t}${r.v?"/"+r.v[0]:""}]: ${z(e)}`})).join("\n")}function sr(e,t){return r=>{var n;if(Array.isArray(r)&&!e)return;const o=null===(n=r.op[i])||void 0===n?void 0:n.macro,s=`${o?"Macro":"Op"}: ${o?z(o,void 0,!0)+" / ":""}${z(r.op)}\nInput:\n${or(r.in)}\nOutput:\n${or(r.out)}\n`;t(s)}}function ar(e){var t;if(e instanceof Ct){const r=null===(t=e.val[i])||void 0===t?void 0:t.macro;return`${r?"Macro":"Op"}: ${r?z(r,void 0,!0)+" / ":""}${z(e.val)}\nStack:\n${or(e.stackState)}\n`}if(e instanceof fe){return`Type: ${Array.isArray(e.val)?"["+e.val.map(((e,t)=>`[${t}]: ${z(e)}`)).join("; ")+"]":z(e.val)}\n${e.data?`Data: ${z(e.data)}\n`:""}\n`}return`Value: ${z(e.val)}`}const cr={commitHash:"a97e506efd61b86e39ae30db588401b8fda46553",version:"17.3.2"}},8899:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressValidationError:()=>T,BigMapEncodingError:()=>He,BigMapValidationError:()=>m,BytesValidationError:()=>F,ChainIDValidationError:()=>ne,ContractValidationError:()=>N,EncodeTicketError:()=>oe,EventSchema:()=>Xe,IntValidationError:()=>$,InvalidBigMapDiffError:()=>Ke,InvalidBigMapSchemaError:()=>Fe,InvalidMapTypeError:()=>u,InvalidRpcResponseError:()=>Be,InvalidScriptError:()=>Ue,KeyHashValidationError:()=>Z,KeyValidationError:()=>q,ListValidationError:()=>j,MapTypecheckError:()=>f,MapValidationError:()=>x,MichelsonMap:()=>d,MissingArgumentError:()=>$e,MutezValidationError:()=>U,NatValidationError:()=>S,OrValidationError:()=>v,ParameterEncodingError:()=>De,ParameterSchema:()=>Je,SaplingStateValue:()=>tt,Schema:()=>Ze,SetValidationError:()=>te,SignatureValidationError:()=>Y,StorageEncodingError:()=>Ge,Token:()=>p,TokenArgumentValidationError:()=>_,TokenComparisonError:()=>w,UnitValue:()=>et,VERSION:()=>Qe,ViewSchema:()=>Ye,deepEqual:()=>We});var n,i=r(5695),o=r.n(i),s=r(227),a=r(2558),c=r(4632);class u extends s.TaquitoError{constructor(e,t){super(),this.mapType=e,this.reason=t,this.message=`The map type '${JSON.stringify(e)}' is invalid. Reason: ${t}.`,this.name="InvalidMapTypeError"}}const l=Symbol.for("taquito-michelson-map-type-symbol");class f extends s.TaquitoError{constructor(e,t,r,n){super(),this.value=e,this.type=t,this.reason=n,this.name="MapTypecheckError",this.message=`The ${r} provided: ${JSON.stringify(e)} is not compatible with the expected michelson type: ${JSON.stringify(t)}. Reason: ${JSON.stringify(n)}.`,this.name="MapTypecheckError"}}class d{constructor(e){this.valueMap=new Map,this.keyMap=new Map,this[n]=!0,e&&this.setType(e)}static isMichelsonMap(e){return e&&!0===e[l]}setType(e){!function(e){if(!("prim"in e))throw new u(e,"Missing 'prim' field");if(!["map","big_map"].includes(e.prim))throw new u(e,"The prim field should be 'map' or 'big_map'");if(!("args"in e))throw new u(e,"Missing 'args' field");if(!Array.isArray(e.args))throw new u(e,"The 'args' field should be an array");if(2!==e.args.length)throw new u(e,"The 'args' field should have 2 elements")}(e),this.keySchema=new Ze(e.args[0]),this.valueSchema=new Ze(e.args[1])}removeType(){this.keySchema=void 0,this.valueSchema=void 0}static fromLiteral(e,t){const r=new d(t);return Object.keys(e).forEach((t=>{r.set(t,e[t])})),r}typecheckKey(e){this.keySchema&&this.keySchema.Typecheck(e)}typecheckValue(e){this.valueSchema&&this.valueSchema.Typecheck(e)}assertTypecheckValue(e){try{this.typecheckValue(e)}catch(t){throw new f(e,this.valueSchema,"value",t)}}assertTypecheckKey(e){try{this.typecheckKey(e)}catch(t){throw new f(e,this.keySchema,"key",t)}}serializeDeterministically(e){return o()(e)}*keys(){for(const[e]of this.entries())yield e}*values(){for(const[,e]of this.entries())yield e}*entries(){for(const e of this.valueMap.keys())yield[this.keyMap.get(e),this.valueMap.get(e)]}get(e){this.assertTypecheckKey(e);const t=this.serializeDeterministically(e);return this.valueMap.get(t)}set(e,t){this.assertTypecheckKey(e),this.assertTypecheckValue(t);const r=this.serializeDeterministically(e);this.keyMap.set(r,e),this.valueMap.set(r,t)}delete(e){this.assertTypecheckKey(e),this.keyMap.delete(this.serializeDeterministically(e)),this.valueMap.delete(this.serializeDeterministically(e))}has(e){this.assertTypecheckKey(e);const t=this.serializeDeterministically(e);return this.keyMap.has(t)&&this.valueMap.has(t)}clear(){this.keyMap.clear(),this.valueMap.clear()}get size(){return this.keyMap.size}forEach(e){for(const[t,r]of this.entries())e(r,t,this)}}n=l;class h extends s.TaquitoError{constructor(e,t,r){super(),this.value=e,this.token=t,this.name="TokenValidationError";const n=this.token.annot(),i=n?`[${n}] `:"";this.message=`${i}${r}`}}class p{constructor(e,t,r){this.val=e,this.idx=t,this.fac=r,this.createToken=this.fac}typeWithoutAnnotations(){const e=t=>{if("object"==typeof t){if(Array.isArray(t)){return t.map((t=>e(t)))}const r=t;return r.args?{prim:r.prim,args:r.args.map((t=>e(t)))}:{prim:r.prim}}return t};return(t=this.val).args?{prim:t.prim,args:t.args.map((t=>e(t)))}:{prim:t.prim};var t}annot(){return(Array.isArray(this.val.annots)&&this.val.annots.length>0?this.val.annots[0]:String(this.idx)).replace(/(%|:)(_Liq_entry_)?/,"")}hasAnnotations(){return Array.isArray(this.val.annots)&&this.val.annots.length}get tokenVal(){return this.val}ExtractSignature(){return[[this.ExtractSchema()]]}}class b extends p{compare(e,t){return e===t?0:e<t?-1:1}}class m extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="BigMapValidationError"}}class g extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}ExtractSchema(){return{big_map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:g.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}validate(e){if(!d.isMichelsonMap(e))throw new m(e,this,`Value ${JSON.stringify(e)} is not a MichelsonMap`)}objLitToMichelsonMap(e){return e instanceof d?e:"object"==typeof e?0===Object.keys(e).length?new d:d.fromLiteral(e):e}Encode(e){const t=this.objLitToMichelsonMap(e.pop());return this.validate(t),Array.from(t.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(t.get(e))]})))}EncodeObject(e,t){const r=this.objLitToMichelsonMap(e);return this.validate(r),t&&t[g.prim]?t[g.prim](r,this.val):Array.from(r.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(r.get(e))]})))}Execute(e,t){if(t&&t[g.prim])return t[g.prim](e,this.val);if(Array.isArray(e)){const t=new d(this.val);return e.forEach((e=>{t.set(this.KeySchema.ToKey(e.args[0]),this.ValueSchema.Execute(e.args[1]))})),t}if("int"in e)return e.int;throw new m(e,this,`Big map is expecting either an array (Athens) or an object with an int property (Babylon). Got ${JSON.stringify(e)}`)}findAndReturnTokens(e,t){return g.prim===e&&t.push(this),this.KeySchema.findAndReturnTokens(e,t),this.ValueSchema.findAndReturnTokens(e,t),t}}g.prim="big_map";class v extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="OrValidationError"}}class y extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Encode(e){const t=e[e.length-1],r=this.createToken(this.val.args[0],this.idx);let n=1;r instanceof y&&(n=Object.keys(r.ExtractSchema()).length);const i=this.createToken(this.val.args[1],this.idx+n);if(String(r.annot())!==String(t)||r instanceof y){if(String(i.annot())!==String(t)||i instanceof y){if(r instanceof y){const t=r.Encode(e);if(t)return{prim:"Left",args:[t]}}if(i instanceof y){const t=i.Encode(e);if(t)return{prim:"Right",args:[t]}}return null}return e.pop(),{prim:"Right",args:[i.Encode(e)]}}return e.pop(),{prim:"Left",args:[r.Encode(e)]}}ExtractSignature(){const e=this.createToken(this.val.args[0],this.idx);let t=1;e instanceof y&&(t=Object.keys(e.ExtractSchema()).length);const r=this.createToken(this.val.args[1],this.idx+t),n=[];if(e instanceof y)n.push(...e.ExtractSignature());else for(const t of e.ExtractSignature())n.push([e.annot(),...t]);if(r instanceof y)n.push(...r.ExtractSignature());else for(const e of r.ExtractSignature())n.push([r.annot(),...e]);return n}EncodeObject(e,t){this.validateJavascriptObject(e);const r=Object.keys(e)[0],n=this.createToken(this.val.args[0],this.idx);let i=1;n instanceof y&&(i=Object.keys(n.ExtractSchema()).length);const o=this.createToken(this.val.args[1],this.idx+i);if(String(n.annot())!==String(r)||n instanceof y){if(String(o.annot())!==String(r)||o instanceof y){if(n instanceof y){const r=n.EncodeObject(e,t);if(r)return{prim:"Left",args:[r]}}if(o instanceof y){const r=o.EncodeObject(e,t);if(r)return{prim:"Right",args:[r]}}return null}return{prim:"Right",args:[o.EncodeObject(e[r],t)]}}return{prim:"Left",args:[n.EncodeObject(e[r],t)]}}validateJavascriptObject(e){if("object"!=typeof e||Array.isArray(e)||null===e||1!==Object.keys(e).length)throw new v(e,this,`EncodeObject expects an object with a single key but got: ${JSON.stringify(e)}`)}Execute(e,t){const r=this.createToken(this.val.args[0],this.idx);let n=1;r instanceof y&&(n=Object.keys(r.ExtractSchema()).length);const i=this.createToken(this.val.args[1],this.idx+n);if("Right"===e.prim)return i instanceof y?i.Execute(e.args[0],t):{[i.annot()]:i.Execute(e.args[0],t)};if("Left"===e.prim)return r instanceof y?r.Execute(e.args[0],t):{[r.annot()]:r.Execute(e.args[0],t)};throw new v(e,this,`Was expecting Left or Right prim but got: ${JSON.stringify(e.prim)}`)}traversal(e,t,r){const n=this.createToken(this.val.args[0],this.idx);let i,o=1;n instanceof y?(i=e(n),o=Object.keys(n.ExtractSchema()).length):i={[n.annot()]:e(n)};const s=this.createToken(this.val.args[1],this.idx+o);let a;a=s instanceof y?t(s):{[s.annot()]:t(s)};return r(i,a)}ExtractSchema(){return this.traversal((e=>e.ExtractSchema()),(e=>e.ExtractSchema()),((e,t)=>Object.assign(Object.assign({},e),t)))}generateSchema(){return{__michelsonType:y.prim,schema:this.traversal((e=>e instanceof y?e.generateSchema().schema:e.generateSchema()),(e=>e instanceof y?e.generateSchema().schema:e.generateSchema()),((e,t)=>Object.assign(Object.assign({},e),t)))}}findToken(e){const t=this.createToken(this.val.args[0],this.idx);let r=1;t instanceof y&&(r=Object.keys(t.ExtractSchema()).length);const n=this.createToken(this.val.args[1],this.idx+r);if(String(t.annot())===String(e)&&!(t instanceof y)&&t instanceof b)return t;if(String(n.annot())===String(e)&&!(n instanceof y)&&n instanceof b)return n;if(t instanceof y){const r=t.findToken(e);if(r)return r}if(n instanceof y){const t=n.findToken(e);if(t)return t}return null}compare(e,t){const r=Object.keys(e)[0];if(r!==Object.keys(t)[0]){return JSON.stringify(this.EncodeObject(e))<JSON.stringify(this.EncodeObject(t))?-1:1}{const n=this.findToken(r);if(n instanceof b)return n.compare(e[r],t[r])}}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:this.EncodeObject(e),type:this.typeWithoutAnnotations()}}findAndReturnTokens(e,t){return y.prim===e&&t.push(this),this.traversal((r=>r.findAndReturnTokens(e,t)),(r=>r.findAndReturnTokens(e,t)),((e,t)=>Object.assign(Object.assign({},e),t))),t}}y.prim="or";class _ extends s.TaquitoError{constructor(e){super(e),this.message=e,this.name="TokenArgumentValidationError"}}class w extends s.TaquitoError{constructor(e,t){super(),this.val1=e,this.val2=t,this.name="TokenComparisonError",this.message=`Tokens ${JSON.stringify(e)} and ${JSON.stringify(t)} are not comparable`}}function E(e,t=O.prim){if(Array.isArray(e))return E({prim:t,args:e},t);if(void 0===e.args)throw new _(`The value ${JSON.stringify(e)} is an invalid PairToken with no arguments, a pair must have two or more arguments.`);return e.args.length>2?[e.args[0],{prim:t,args:e.args.slice(1)}]:[e.args[0],e.args[1]]}class O extends b{constructor(e,t,r){super(Array.isArray(e)?{prim:O.prim,args:e}:e.prim?e:{prim:O.prim,args:e},t,r)}args(){return E(this.val)}tokens(){let e=0;return this.args().map((t=>{const r=this.createToken(t,this.idx+e);return r instanceof O?e+=Object.keys(r.ExtractSchema()).length:e++,r}))}Encode(e){return{prim:"Pair",args:this.tokens().map((t=>t.Encode(e)))}}ExtractSignature(){const e=this.args(),t=this.createToken(e[0],this.idx);let r=1;t instanceof y&&(r=Object.keys(t.ExtractSchema()).length);const n=this.createToken(e[1],this.idx+r),i=[];for(const e of t.ExtractSignature())for(const t of n.ExtractSignature())i.push([...e,...t]);return i}ToBigMapKey(e){return{key:this.EncodeObject(e),type:this.typeWithoutAnnotations()}}ToKey(e){return this.Execute(e)}EncodeObject(e,t){const[r,n]=this.tokens();let i,o;return i=r instanceof O&&!r.hasAnnotations()?e:e[r.annot()],o=n instanceof O&&!n.hasAnnotations()?e:e[n.annot()],{prim:"Pair",args:[r.EncodeObject(i,t),n.EncodeObject(o,t)]}}traversal(e,t){const r=this.args(),n=this.createToken(r[0],this.idx);let i,o=1;n instanceof O&&!n.hasAnnotations()?(i=e(n),n instanceof O&&(o=Object.keys(n.ExtractSchema()).length)):i={[n.annot()]:e(n)};const s=this.createToken(r[1],this.idx+o);let a;a=s instanceof O&&!s.hasAnnotations()?t(s):{[s.annot()]:t(s)};return Object.assign(Object.assign({},i),a)}Execute(e,t){const r=E(e,"Pair");return this.traversal((e=>e.Execute(r[0],t)),(e=>e.Execute(r[1],t)))}ExtractSchema(){return this.traversal((e=>e.ExtractSchema()),(e=>e.ExtractSchema()))}generateSchema(){return{__michelsonType:O.prim,schema:this.traversal((e=>e instanceof O&&!e.hasAnnotations()?e.generateSchema().schema:e.generateSchema()),(e=>e instanceof O&&!e.hasAnnotations()?e.generateSchema().schema:e.generateSchema()))}}compare(e,t){const[r,n]=this.tokens(),i=(e,t)=>e instanceof O&&!e.hasAnnotations()?t:t[e.annot()];if(r instanceof b&&n instanceof b){const o=r.compare(i(r,e),i(r,t));return 0===o?n.compare(i(n,e),i(n,t)):o}throw new w(e,t)}findAndReturnTokens(e,t){return O.prim===e&&t.push(this),this.tokens().map((r=>r.findAndReturnTokens(e,t))),t}}O.prim="pair";class S extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="NatValidationError"}}class A extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return new a.Z(e[Object.keys(e)[0]])}Encode(e){const t=e.pop();return this.validate(t),{int:new a.Z(t).toFixed()}}validate(e){const t=new a.Z(e);if(t.isNaN())throw new S(e,this,`Value is not a number: ${JSON.stringify(e)}`);if(t.isNegative())throw new S(e,this,`Value cannot be negative: ${JSON.stringify(e)}`)}EncodeObject(e,t){return this.validate(e),t&&t[A.prim]?t[A.prim](e):{int:new a.Z(e).toFixed()}}ExtractSchema(){return A.prim}generateSchema(){return{__michelsonType:A.prim,schema:A.prim}}ToBigMapKey(e){return{key:{int:String(e)},type:{prim:A.prim}}}ToKey({int:e}){return new a.Z(e)}compare(e,t){const r=Number(e),n=Number(t);return r===n?0:r<n?-1:1}findAndReturnTokens(e,t){return A.prim===e&&t.push(this),t}}A.prim="nat";class P extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e[Object.keys(e)[0]]}ExtractSchema(){return P.prim}generateSchema(){return{__michelsonType:P.prim,schema:P.prim}}Encode(e){return{string:e.pop()}}EncodeObject(e,t){return t&&t[P.prim]?t[P.prim](e):{string:e}}ToKey({string:e}){return e}ToBigMapKey(e){return{key:{string:e},type:{prim:P.prim}}}findAndReturnTokens(e,t){return P.prim===e&&t.push(this),t}}P.prim="string";class T extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="AddressValidationError"}}class R extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}ToBigMapKey(e){return{key:{bytes:(0,c.b58decode)(e)},type:{prim:"bytes"}}}validate(e){if((0,c.validateAddress)(e)!==c.ValidationResult.VALID)throw new T(e,this,`Address is not valid: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[R.prim]?t[R.prim](e):{string:e}}Execute(e){if(e.string)return e.string;if(!e.bytes)throw new T(e,this,`cannot be missing both string and bytes: ${JSON.stringify(e)}`);return(0,c.encodePubKey)(e.bytes)}ExtractSchema(){return R.prim}generateSchema(){return{__michelsonType:R.prim,schema:R.prim}}ToKey({bytes:e,string:t}){if(t)return t;if(!e)throw new T({bytes:e,string:t},this,`cannot be missing both string and bytes ${JSON.stringify({string:t,bytes:e})}`);return(0,c.encodePubKey)(e)}compare(e,t){const r=e=>e.startsWith("tz"),n=r(e),i=r(t);return n&&!i?-1:i&&!n?1:super.compare(e,t)}findAndReturnTokens(e,t){return R.prim===e&&t.push(this),t}}R.prim="address";class x extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="MapValidationError"}}class I extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}validate(e){if(!d.isMichelsonMap(e))throw new x(e,this,`Value ${JSON.stringify(e)} is not a valid MichelsonMap`)}Execute(e,t){const r=new d(this.val);return e.forEach((e=>{r.set(this.KeySchema.ToKey(e.args[0]),this.ValueSchema.Execute(e.args[1],t))})),r}objLitToMichelsonMap(e){return e instanceof d?e:"object"==typeof e?0===Object.keys(e).length?new d:d.fromLiteral(e):e}Encode(e){const t=this.objLitToMichelsonMap(e.pop());return this.validate(t),Array.from(t.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(t.get(e))]})))}EncodeObject(e,t){const r=this.objLitToMichelsonMap(e);return this.validate(r),t&&t[I.prim]?t[I.prim](r):Array.from(r.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(r.get(e))]})))}ExtractSchema(){return{map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:I.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}findAndReturnTokens(e,t){return I.prim===e&&t.push(this),this.KeySchema.findAndReturnTokens(e,t),this.ValueSchema.findAndReturnTokens(e,t),t}}I.prim="map";class M extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return"true"===String(e.prim).toLowerCase()}Encode(e){return{prim:e.pop()?"True":"False"}}EncodeObject(e,t){return t&&t[M.prim]?t[M.prim](e):{prim:e?"True":"False"}}ExtractSchema(){return M.prim}generateSchema(){return{__michelsonType:M.prim,schema:M.prim}}ToBigMapKey(e){return{key:this.EncodeObject(e),type:{prim:M.prim}}}ToKey(e){return this.EncodeObject(e)}compare(e,t){return e&&t||!e&&!t?0:e?1:-1}findAndReturnTokens(e,t){return M.prim===e&&t.push(this),t}}M.prim="bool";class L extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="TxRollupL2AddressValidationError"}}class k extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}ToBigMapKey(e){return{key:{bytes:(0,c.b58decodeL2Address)(e)},type:{prim:"bytes"}}}validate(e){if((0,c.validateAddress)(e)!==c.ValidationResult.VALID)throw new L(e,this,`tx_rollup_l2_address is not valid: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();if(!t)throw new L(t,this,`arg missing to encode: this -> "${JSON.stringify(t)}"`);return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[k.prim]?t[k.prim](e):{string:e}}Execute(e){if(e.string)return e.string;if(!e.bytes)throw new L(e,this,`value cannot be missing string and byte value. must have one ${JSON.stringify(e)}`);return(0,c.encodeL2Address)(e.bytes)}ExtractSchema(){return k.prim}generateSchema(){return{__michelsonType:k.prim,schema:k.prim}}ToKey({bytes:e,string:t}){if(t)return t;if(!e)throw new L(e,this,`value cannot be missing string and byte value. must have one: bytes = ${JSON.stringify(e)}`);return(0,c.encodeL2Address)(e)}findAndReturnTokens(e,t){return k.prim===e&&t.push(this),t}}k.prim="tx_rollup_l2_address";class N extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ContractValidationError"}}class C extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if((0,c.validateAddress)(e)!==c.ValidationResult.VALID)throw new N(e,this,`Value ${JSON.stringify(e)} is not a valid contract address.`);return null}Execute(e){if(e.string)return e.string;if(!e.bytes)throw new N(e,this,`Value ${JSON.stringify(e)} is not a valid contract address. must contain bytes or string.`);return(0,c.encodePubKey)(e.bytes)}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[C.prim]?t[C.prim](e):{string:e}}ExtractSchema(){return C.prim}generateSchema(){const e=this.createToken(this.val.args[0],0);return{__michelsonType:C.prim,schema:{parameter:this.val.args[0]?e.generateSchema():{}}}}findAndReturnTokens(e,t){return C.prim===e&&t.push(this),t}}C.prim="contract";class j extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ListValidationError"}}class D extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get valueSchema(){return this.createToken(this.val.args[0],this.idx)}validate(e){if(!Array.isArray(e))throw new j(e,this,`Value ${JSON.stringify(e)} is not a valid array`)}Encode(e){const t=e.pop();this.validate(t);const r=this.createToken(this.val.args[0],0);return t.reduce(((e,t)=>[...e,r.EncodeObject(t)]),[])}Execute(e,t){const r=this.createToken(this.val.args[0],0);return this.validate(e),e.reduce(((e,n)=>[...e,r.Execute(n,t)]),[])}EncodeObject(e,t){const r=this.createToken(this.val.args[0],0);return this.validate(e),t&&t[D.prim]?t[D.prim](e):e.reduce(((e,t)=>[...e,r.EncodeObject(t)]),[])}ExtractSchema(){return{[D.prim]:this.valueSchema.ExtractSchema()}}generateSchema(){return{__michelsonType:D.prim,schema:this.valueSchema.generateSchema()}}findAndReturnTokens(e,t){return D.prim===e&&t.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(e,t),t}}D.prim="list";class U extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="MutezValidationError"}}class B extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return new a.Z(e[Object.keys(e)[0]])}ExtractSchema(){return B.prim}generateSchema(){return{__michelsonType:B.prim,schema:B.prim}}validate(e){if(new a.Z(e).isNaN())throw new U(e,this,`Value is not a number: ${e}`)}Encode(e){const t=e.pop();return this.validate(t),{int:String(t).toString()}}EncodeObject(e,t){return this.validate(e),t&&t[B.prim]?t[B.prim](e):{int:String(e).toString()}}ToBigMapKey(e){return{key:{int:String(e)},type:{prim:B.prim}}}ToKey({int:e}){return e}compare(e,t){const r=Number(e),n=Number(t);return r===n?0:r<n?-1:1}findAndReturnTokens(e,t){return B.prim===e&&t.push(this),t}}B.prim="mutez";class F extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="BytesValidationError"}}class K extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}ToBigMapKey(e){return{key:{bytes:e},type:{prim:K.prim}}}validate(e){if("string"!=typeof e||!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new F(e,this,`Invalid bytes: ${e}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=(0,c.stripHexPrefix)(this.convertUint8ArrayToHexString(t)),this.validate(t),{bytes:String(t).toString()}}EncodeObject(e,t){return"string"==typeof(e=this.convertUint8ArrayToHexString(e))&&(e=(0,c.stripHexPrefix)(e)),this.validate(e),t&&t[K.prim]?t[K.prim](e):{bytes:String(e).toString()}}Execute(e){return e.bytes}ExtractSchema(){return K.prim}generateSchema(){return{__michelsonType:K.prim,schema:K.prim}}ToKey({bytes:e,string:t}){return t||e}findAndReturnTokens(e,t){return K.prim===e&&t.push(this),t}}K.prim="bytes";class H extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}subToken(){return this.createToken(this.val.args[0],this.idx)}schema(){return this.createToken(this.val.args[0],0)}annot(){return Array.isArray(this.val.annots)?super.annot():this.createToken(this.val.args[0],this.idx).annot()}Encode(e){const t=e;return null==t?{prim:"None"}:!Array.isArray(t)||void 0!==t[t.length-1]&&null!==t[t.length-1]?{prim:"Some",args:[this.schema().Encode(e)]}:(t.pop(),{prim:"None"})}EncodeObject(e,t){let r=e;return null==r?{prim:"None"}:(r="object"==typeof r&&"Some"in r?r.Some:r,{prim:"Some",args:[this.schema().EncodeObject(r,t)]})}Execute(e,t){return"None"===e.prim?null:{Some:this.schema().Execute(e.args[0],t)}}ExtractSchema(){return{Some:this.schema().ExtractSchema()}}generateSchema(){return{__michelsonType:H.prim,schema:this.schema().generateSchema()}}ExtractSignature(){return[...this.schema().ExtractSignature()]}get KeySchema(){return this.schema()}compare(e,t){return e?t?this.KeySchema.compare(e,t):1:-1}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:this.EncodeObject(e),type:this.typeWithoutAnnotations()}}findAndReturnTokens(e,t){return H.prim===e&&t.push(this),this.subToken().findAndReturnTokens(e,t),t}}H.prim="option";class G extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string&&/^\d+$/.test(e.string)?new Date(1e3*Number(e.string)).toISOString():e.string?new Date(e.string).toISOString():e.int?new Date(1e3*Number(e.int)).toISOString():void 0}Encode(e){const t=e.pop();return"number"==typeof t?{int:String(t)}:{string:t}}EncodeObject(e,t){return t&&t[G.prim]?t[G.prim](e):"number"==typeof e?{int:String(e)}:{string:e}}ExtractSchema(){return G.prim}generateSchema(){return{__michelsonType:G.prim,schema:G.prim}}ToKey({string:e}){return e}ToBigMapKey(e){return{key:{string:e},type:{prim:G.prim}}}findAndReturnTokens(e,t){return G.prim===e&&t.push(this),t}}G.prim="timestamp";class $ extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="IntValidationError"}}class V extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return new a.Z(e[Object.keys(e)[0]])}ExtractSchema(){return V.prim}generateSchema(){return{__michelsonType:V.prim,schema:V.prim}}validate(e){if(new a.Z(e).isNaN())throw new $(e,this,`Value is not a number: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();return this.validate(t),{int:new a.Z(t).toFixed()}}EncodeObject(e,t){return this.validate(e),t&&t[V.prim]?t[V.prim](e):{int:new a.Z(e).toFixed()}}ToBigMapKey(e){return{key:{int:String(e)},type:{prim:V.prim}}}ToKey({int:e}){return e}compare(e,t){const r=Number(e),n=Number(t);return r===n?0:r<n?-1:1}findAndReturnTokens(e,t){return V.prim===e&&t.push(this),t}}V.prim="int";class z extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Encode(e){return e.pop(),{prim:"Unit"}}EncodeObject(e,t){return t&&t[z.prim]?t[z.prim](e):{prim:"Unit"}}Execute(e){return et}ExtractSchema(){return z.prim}generateSchema(){return{__michelsonType:z.prim,schema:z.prim}}compare(e,t){return 0}ToKey(e){return et}ToBigMapKey(e){return{key:{prim:"Unit"},type:{prim:z.prim}}}findAndReturnTokens(e,t){return z.prim===e&&t.push(this),t}}z.prim="unit";class q extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="KeyValidationError"}}class W extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string?e.string:(0,c.encodeKey)(e.bytes)}validate(e){if((0,c.validatePublicKey)(e)!==c.ValidationResult.VALID)throw new q(e,this,"Key is not valid")}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[W.prim]?t[W.prim](e):{string:e}}ExtractSchema(){return W.prim}generateSchema(){return{__michelsonType:W.prim,schema:W.prim}}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:{string:e},type:{prim:W.prim}}}compare(e,t){const r=this.getPrefix(e),n=this.getPrefix(t);if(r===c.Prefix.EDPK&&n!==c.Prefix.EDPK)return-1;if(r===c.Prefix.SPPK&&n!==c.Prefix.SPPK)return n===c.Prefix.EDPK?1:-1;if(r===c.Prefix.P2PK){if(n!==c.Prefix.P2PK)return 1;const r=this.getP256PublicKeyComparableBytes(e),i=this.getP256PublicKeyComparableBytes(t);return Buffer.compare(r,i)}return super.compare(e,t)}getPrefix(e){return e.substring(0,4)}getP256PublicKeyComparableBytes(e){return(0,c.b58cdecode)(e,c.prefix[c.Prefix.P2PK]).slice(1)}findAndReturnTokens(e,t){return W.prim===e&&t.push(this),t}}W.prim="key";class Z extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="KeyHashValidationError"}}class J extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string?e.string:(0,c.encodeKeyHash)(e.bytes)}validate(e){if((0,c.validateKeyHash)(e)!==c.ValidationResult.VALID)throw new Z(e,this,`KeyHash is not valid: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[J.prim]?t[J.prim](e):{string:e}}ExtractSchema(){return J.prim}generateSchema(){return{__michelsonType:J.prim,schema:J.prim}}ToKey({string:e,bytes:t}){return e||(0,c.encodeKeyHash)(t)}ToBigMapKey(e){return{key:{string:e},type:{prim:J.prim}}}findAndReturnTokens(e,t){return J.prim===e&&t.push(this),t}}J.prim="key_hash";class Y extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SignatureValidationError"}}class X extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string?e.string:e.bytes}validate(e){if((0,c.validateSignature)(e)!==c.ValidationResult.VALID)throw new Y(e,this,"Signature is not valid")}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[X.prim]?t[X.prim](e):{string:e}}ExtractSchema(){return X.prim}generateSchema(){return{__michelsonType:X.prim,schema:X.prim}}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:{string:e},type:{prim:X.prim}}}findAndReturnTokens(e,t){return X.prim===e&&t.push(this),t}}X.prim="signature";class Q extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get paramSchema(){return this.createToken(this.val.args[0],this.idx)}get returnSchema(){return this.createToken(this.val.args[1],this.idx+1)}Execute(e){return e.string?e.string:e}Encode(e){return e.pop()}EncodeObject(e,t){return t&&t[Q.prim]?t[Q.prim](e):e}ExtractSchema(){return{[Q.prim]:{parameters:this.paramSchema.ExtractSchema(),returns:this.returnSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:Q.prim,schema:{parameters:this.paramSchema.generateSchema(),returns:this.returnSchema.generateSchema()}}}findAndReturnTokens(e,t){return Q.prim===e&&t.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(e,t),this.createToken(this.val.args[1],this.idx).findAndReturnTokens(e,t),t}}Q.prim="lambda";class ee extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string}Encode(...e){return{string:e.pop()}}EncodeObject(e,t){return t&&t[ee.prim]?t[ee.prim](e):{string:e}}ExtractSchema(){return ee.prim}generateSchema(){return{__michelsonType:ee.prim,schema:ee.prim}}findAndReturnTokens(e,t){return ee.prim===e&&t.push(this),t}}ee.prim="operation";class te extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SetValidationError"}}class re extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get KeySchema(){return this.createToken(this.val.args[0],0)}validate(e){if(!Array.isArray(e))throw new te(e,this,`Value ${JSON.stringify(e)} is not an array`)}Encode(e){const t=e.pop();return this.validate(t),t.sort(((e,t)=>this.KeySchema.compare(e,t))).reduce(((e,t)=>[...e,this.KeySchema.EncodeObject(t)]),[])}Execute(e,t){return e.reduce(((e,r)=>[...e,this.KeySchema.Execute(r,t)]),[])}EncodeObject(e,t){return this.validate(e),t&&t[re.prim]?t[re.prim](e):e.sort(((e,t)=>this.KeySchema.compare(e,t))).reduce(((e,t)=>[...e,this.KeySchema.EncodeObject(t)]),[])}ExtractSchema(){return re.prim}generateSchema(){return{__michelsonType:re.prim,schema:this.KeySchema.generateSchema()}}findAndReturnTokens(e,t){return re.prim===e&&t.push(this),this.KeySchema.findAndReturnTokens(e,t),t}}re.prim="set";class ne extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ChainIDValidationError"}}class ie extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if((0,c.validateChain)(e)!==c.ValidationResult.VALID)throw new ne(e,this,`Value ${JSON.stringify(e)} is not a valid ChainID`)}Execute(e){return e[Object.keys(e)[0]]}ExtractSchema(){return ie.prim}generateSchema(){return{__michelsonType:ie.prim,schema:ie.prim}}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[ie.prim]?t[ie.prim](e):{string:e}}ToKey({string:e}){return e}ToBigMapKey(e){return{key:{string:e},type:{prim:ie.prim}}}findAndReturnTokens(e,t){return ie.prim===e&&t.push(this),t}}ie.prim="chain_id";class oe extends s.TaquitoError{constructor(){super(),this.name="TicketEncodeError",this.message="Tickets cannot be sent to the blockchain; they are created on-chain"}}const se={prim:"contract"},ae={prim:"int"};class ce extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get valueToken(){return this.createToken(this.val.args[0],this.idx)}Encode(e){throw new oe}EncodeObject(e,t){if(t&&t[ce.prim])return t[ce.prim](e,this.val);throw new oe}Execute(e,t){if(t&&t[ce.prim])return t[ce.prim](e,this.val);const r=this.createToken(se,this.idx),n=this.valueToken,i=this.createToken(ae,this.idx);return void 0===e.args[2]&&void 0!==e.args[1].args?{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1].args[0],t),amount:i.Execute(e.args[1].args[1],t)}:{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1],t),amount:i.Execute(e.args[2],t)}}ExtractSchema(){return{ticketer:C.prim,value:this.valueToken.ExtractSchema(),amount:V.prim}}generateSchema(){return{__michelsonType:ce.prim,schema:{value:this.valueToken.generateSchema(),ticketer:{__michelsonType:C.prim,schema:C.prim},amount:{__michelsonType:V.prim,schema:V.prim}}}}findAndReturnTokens(e,t){return ce.prim===e&&t.push(this),this.valueToken.findAndReturnTokens(e,t),t}}ce.prim="ticket";class ue extends s.TaquitoError{constructor(){super(),this.name="TicketDeprecatedEncodeError",this.message="Ticket_deprecated cannot be sent to the blockchain; they are created on-chain"}}const le={prim:"contract"},fe={prim:"int"};class de extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get valueToken(){return this.createToken(this.val.args[0],this.idx)}Encode(e){throw new ue}EncodeObject(e,t){if(t&&t[de.prim])return t[de.prim](e,this.val);throw new ue}Execute(e,t){if(t&&t[de.prim])return t[de.prim](e,this.val);const r=this.createToken(le,this.idx),n=this.valueToken,i=this.createToken(fe,this.idx);return void 0===e.args[2]&&void 0!==e.args[1].args?{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1].args[0],t),amount:i.Execute(e.args[1].args[1],t)}:{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1],t),amount:i.Execute(e.args[2],t)}}ExtractSchema(){return{ticketer:C.prim,value:this.valueToken.ExtractSchema(),amount:V.prim}}generateSchema(){return{__michelsonType:de.prim,schema:{value:this.valueToken.generateSchema(),ticketer:{__michelsonType:C.prim,schema:C.prim},amount:{__michelsonType:V.prim,schema:V.prim}}}}findAndReturnTokens(e,t){return de.prim===e&&t.push(this),this.valueToken.findAndReturnTokens(e,t),t}}de.prim="ticket_deprecated";class he extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="NeverTokenError"}}class pe extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Encode(e){const t=e.pop();throw new he(t,this,`Assigning a value to the type never is forbidden. Trying to assign ${JSON.stringify(t)}.`)}EncodeObject(e,t){if(t&&t[pe.prim])return t[pe.prim](e);throw new he(e,this,`Assigning a value to the type never is forbidden. Trying to assign ${JSON.stringify(e)}.`)}Execute(e){throw new he(e,this,`There is no literal value for the type never. Trying to execute ${JSON.stringify(e)}.`)}ExtractSchema(){return pe.prim}generateSchema(){return{__michelsonType:pe.prim,schema:pe.prim}}findAndReturnTokens(e,t){return pe.prim===e&&t.push(this),t}}pe.prim="never";class be extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SaplingStateValidationError"}}class me extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}isValid(e){return"object"==typeof e&&0===Object.keys(e).length}Execute(e,t){if(t&&t[me.prim])return t[me.prim](e,this.val);if("int"in e)return e.int;throw new be(e,this,`Sapling state is expecting an object with an int property. Got ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();if(this.isValid(t))return[];throw new be(t,this,`Invalid sapling_state. Received: ${JSON.stringify(t)} while expecting: {}`)}EncodeObject(e,t){if(t&&t[me.prim])return t[me.prim](e);if(this.isValid(e))return[];throw new be(e,this,`Invalid sapling_state. Received: ${JSON.stringify(e)} while expecting: {}`)}ExtractSchema(){return{[me.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:me.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(e,t){return me.prim===e&&t.push(this),t}}me.prim="sapling_state";class ge extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SaplingTransactionValidationError"}}class ve extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){throw new ge(e,this,`There is no literal value for the sapling_transaction type. Got: ${JSON.stringify(e)}.`)}validateBytes(e){const t=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(e);if(t&&t[2].length%2==0)return t[2];throw new ge(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.validateBytes(this.convertUint8ArrayToHexString(t)),{bytes:String(t).toString()}}EncodeObject(e,t){return e=this.validateBytes(this.convertUint8ArrayToHexString(e)),t&&t[ve.prim]?t[ve.prim](e):{bytes:String(e).toString()}}ExtractSchema(){return{[ve.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:ve.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(e,t){return ve.prim===e&&t.push(this),t}}ve.prim="sapling_transaction";class ye extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SaplingTransactionDeprecatedValidationError"}}class _e extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){throw new ye(e,this,`There is no literal value for the sapling_transaction_deprecated type. Got: ${JSON.stringify(e)}.`)}validateBytes(e){const t=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(e);if(t&&t[2].length%2==0)return t[2];throw new ye(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.validateBytes(this.convertUint8ArrayToHexString(t)),{bytes:String(t).toString()}}EncodeObject(e,t){return e=this.validateBytes(this.convertUint8ArrayToHexString(e)),t&&t[_e.prim]?t[_e.prim](e):{bytes:String(e).toString()}}ExtractSchema(){return{[_e.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:_e.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(e,t){return _e.prim===e&&t.push(this),t}}_e.prim="sapling_transaction_deprecated";class we extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="Bls12381frValidationError"}}class Ee extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new we(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return"number"==typeof t?{int:t.toString()}:(t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t})}EncodeObject(e,t){return t&&t[Ee.prim]?t[Ee.prim](e):"number"==typeof e?{int:e.toString()}:(e=this.convertUint8ArrayToHexString(e),this.validate(e),{bytes:e})}Execute(e){return e.bytes}ExtractSchema(){return Ee.prim}generateSchema(){return{__michelsonType:Ee.prim,schema:Ee.prim}}findAndReturnTokens(e,t){return Ee.prim===e&&t.push(this),t}}Ee.prim="bls12_381_fr";class Oe extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="Bls12381g1ValidationError"}}class Se extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Oe(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Se.prim]?t[Se.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Se.prim}generateSchema(){return{__michelsonType:Se.prim,schema:Se.prim}}findAndReturnTokens(e,t){return Se.prim===e&&t.push(this),t}}Se.prim="bls12_381_g1";class Ae extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="Bls12381g2ValidationError"}}class Pe extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Ae(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Pe.prim]?t[Pe.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Pe.prim}generateSchema(){return{__michelsonType:Pe.prim,schema:Pe.prim}}findAndReturnTokens(e,t){return Pe.prim===e&&t.push(this),t}}Pe.prim="bls12_381_g2";class Te extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ChestValidationError"}}class Re extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Te(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Re.prim]?t[Re.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Re.prim}generateSchema(){return{__michelsonType:Re.prim,schema:Re.prim}}findAndReturnTokens(e,t){return Re.prim===e&&t.push(this),t}}Re.prim="chest";class xe extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ChestKeyValidationError"}}class Ie extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new xe(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Ie.prim]?t[Ie.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Ie.prim}generateSchema(){return{__michelsonType:Ie.prim,schema:Ie.prim}}findAndReturnTokens(e,t){return Ie.prim===e&&t.push(this),t}}Ie.prim="chest_key";class Me extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="GlobalConstantEncodingError"}}class Le extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="GlobalConstantDecodingError"}}class ke extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e,t){if(t&&t[ke.prim])return t[ke.prim](e,this.val);throw new Le(e,this,`Unable to decode a value represented by a global constants. Please provide an expanded script to the Michelson-Encoder or semantics for the decoding. The following global constant hash was encountered: ${this.val.args[0].string}.`)}Encode(e){throw new Me(e,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}EncodeObject(e,t){if(t&&t[ke.prim])return t[ke.prim](e);throw new Me(e,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}ExtractSchema(){return ke.prim}generateSchema(){return{__michelsonType:ke.prim,schema:{hash:this.val.args[0].string}}}findAndReturnTokens(e,t){return ke.prim===e&&t.push(this),t}}ke.prim="constant";const Ne=[O,A,P,g,R,k,I,M,y,C,D,B,K,H,G,V,z,W,J,X,Q,ee,re,ie,ce,de,pe,me,ve,_e,Ee,Se,Pe,Re,Ie,ke];class Ce extends s.TaquitoError{constructor(e,t){super(e),this.message=e,this.data=t,this.name="Invalid token error"}}function je(e,t){if(Array.isArray(e))return new O(e,t,je);const r=Ne.find((t=>t.prim===e.prim));if(!r)throw new Ce(`Malformed data: ${JSON.stringify(e)}. Expected a value with a valid prim property`,e);return new r(e,t,je)}class De extends s.InvalidViewParameterError{constructor(e,t,r,n){super(e,t,r,n),this.viewName=e,this.sigs=t,this.args=r,this.cause=n,this.name="ParameterEncodingError",this.message=`Could not encode parameter ${JSON.stringify(r)} received for name "${e}" expecting one of the following signatures ${JSON.stringify(t)}`}}class Ue extends s.TaquitoError{constructor(e,t){super(),this.script=e,this.reason=t,this.name="InvalidScriptError";let r="Invalid on-chain view found in the following script.";t&&(r+=` Reason: ${t}.`),r+=`Script: ${JSON.stringify(e)}`,this.message=r}}class Be extends s.TaquitoError{constructor(e,t){super(),this.script=e,this.reason=t,this.name="InvalidRpcResponseError";let r="Invalid RPC response passed as argument(s).";t&&(r+=` Reason: ${t}.`),r+=` Received: ${JSON.stringify(e)}`,this.message=r}}class Fe extends s.TaquitoError{constructor(e){super(e),this.message=e,this.name="InvalidBigMapSchemaError"}}class Ke extends s.TaquitoError{constructor(e,t){super(e),this.message=e,this.value=t,this.name="InvalidBigMapDiffError"}}class He extends s.TaquitoError{constructor(e,t,r,n){super(),this.details=t,this.schema=r,this.value=n,this.name="BigMapEncodingError",this.message=`Unable to encode the big map ${e}. Schema is: ${JSON.stringify(r)}. The ${e} is: ${JSON.stringify(n)}. Error details: ${t}`}}class Ge extends s.TaquitoError{constructor(e,t,r,n,i){super(),this.details=t,this.schema=r,this.value=n,this.semantics=i,this.name="StorageEncodingError",this.message=`Unable to encode ${e}. The schema is: ${JSON.stringify(r)}, the value is: ${JSON.stringify(n)}.${i?`And the semantic is: ${JSON.stringify(i)}`:""}. Error details: ${t}`}}class $e extends s.TaquitoError{constructor(e){super(e),this.message=e,this.name="MissingArgumentError"}}var Ve;const ze=Symbol.for("taquito-schema-type-symbol");function qe(e,t=O.prim){var r,n;if(Array.isArray(e))return qe({prim:t,args:e},t);const i=e;return i.prim===t&&i.args&&i.args.length>2?Object.assign(Object.assign({},i),{args:[null===(r=i.args)||void 0===r?void 0:r[0],{prim:t,args:null===(n=i.args)||void 0===n?void 0:n.slice(1)}]}):i}function We(e,t){if(void 0===e||void 0===t)return e===t;const r=qe(e),n=qe(t);return r.prim===n.prim&&(void 0===r.args&&void 0===n.args||void 0!==r.args&&void 0!==n.args&&r.args.length===n.args.length&&r.args.every(((e,t)=>{var r,i;return We(e,null!==(i=null===(r=n.args)||void 0===r?void 0:r[t])&&void 0!==i?i:{})})))&&(void 0===r.annots&&void 0===n.annots||void 0!==r.annots&&void 0!==n.annots&&r.annots.length===n.annots.length&&r.annots.every(((e,t)=>{var r;return e===(null===(r=n.annots)||void 0===r?void 0:r[t])})))}class Ze{constructor(e){if(this.val=e,this[Ve]=!0,this.root=je(e,0),this.root instanceof g)this.bigMap=this.root;else if(this.isExpressionExtended(e)&&"pair"===e.prim){const t=e.args[0];this.isExpressionExtended(t)&&"big_map"===t.prim&&(this.bigMap=new g(t,0,je))}}static isSchema(e){return e&&!0===e[ze]}static fromRPCResponse(e){if(!e)throw new Be(e,"the RPC response is empty");if(!e.script)throw new Be(e,"the RPC response has no script");if(!Array.isArray(e.script.code))throw new Be(e,"The response.script.code should be an array");let t=e.script.code;for(;1===t.length&&Array.isArray(t[0]);)t=t[0];const r=t.find((e=>"prim"in e&&"storage"===e.prim));if(!r||!Array.isArray(r.args))throw new Be(e,'The response.script.code has an element of type {prim: "storage"}, but its args is not an array');return new Ze(r.args[0])}isExpressionExtended(e){return"prim"in e&&Array.isArray(e.args)}removeTopLevelAnnotation(e){return(this.root instanceof O||this.root instanceof y)&&this.root.hasAnnotations()&&"object"==typeof e&&1===Object.keys(e).length?e[Object.keys(e)[0]]:e}Execute(e,t){const r=this.root.Execute(e,t);return this.removeTopLevelAnnotation(r)}Typecheck(e){this.root instanceof g&&Number.isInteger(Number(e))||this.root instanceof ce&&e.ticketer&&e.value&&e.amount||this.root instanceof de&&e.ticketer&&e.value&&e.amount||this.root instanceof I&&this.root.ValueSchema instanceof g||this.root.EncodeObject(e)}ExecuteOnBigMapDiff(e,t){if(!this.bigMap)throw new Fe("Big map schema is undefined");if(!Array.isArray(e))throw new Ke(`Big map diff must be an array, got: ${JSON.stringify(e)}`,e);const r=e.map((({key:e,value:t})=>({args:[e,t]})));return this.bigMap.Execute(r,t)}ExecuteOnBigMapValue(e,t){if(!this.bigMap)throw new Fe("Big map schema is undefined");return this.bigMap.ValueSchema.Execute(e,t)}EncodeBigMapKey(e){if(!this.bigMap)throw new Fe("Big map schema is undefined");try{return this.bigMap.KeySchema.ToBigMapKey(e)}catch(t){throw new He("key",t,this.bigMap.KeySchema,e)}}Encode(e,t){try{return this.root.EncodeObject(e,t)}catch(r){if(r instanceof h)throw r;throw new Ge("storage object",r,this.root,e,t)}}ExtractSchema(){return this.removeTopLevelAnnotation(this.root.ExtractSchema())}generateSchema(){return this.removeTopLevelAnnotation(this.root.generateSchema())}ComputeState(e,t){if(!this.bigMap)throw new Fe("Big map schema is undefined");const r=e.reduce(((e,t)=>Object.assign(Object.assign({},e),this.ExecuteOnBigMapDiff(t.contents[0].metadata.operation_result.big_map_diff))),{});return Object.assign(Object.assign({},this.Execute(t)),{[this.bigMap.annot()]:r})}FindFirstInTopLevelPair(e,t){return this.findValue(this.root.val,e,t)}findValue(e,t,r){if(We(r,e))return t;if(Array.isArray(e)||"pair"===e.prim){const n=qe(e),i=qe(t,"Pair");if(void 0===n.args||void 0===i.args)throw new $e("Tokens have no arguments");if(n.args[0])return this.findValue(n.args[0],i.args[0],r)||this.findValue(n.args[1],i.args[1],r)}}findToken(e){return this.root.findAndReturnTokens(e,[])}}Ve=ze;class Je{constructor(e){this.root=je(e,0)}static fromRPCResponse(e){if(!e)throw new Be(e,"the RPC response is empty");if(!e.script)throw new Be(e,"the RPC response has no script");if(!Array.isArray(e.script.code))throw new Be(e,"The response.script.code should be an array");const t=e.script.code.find((e=>"prim"in e&&"parameter"===e.prim));if(!t)throw new Be(e,'The response.script.code should have an element of type {prim: "parameter"}');if(!Array.isArray(t.args))throw new Be(e,'The response.script.code has an element of type {prim: "parameter"}, but its args is not an array');return new Je(t.args[0])}get isMultipleEntryPoint(){return this.root instanceof y||this.root instanceof H&&this.root.subToken()instanceof y}get hasAnnotation(){return!this.isMultipleEntryPoint||"0"!==Object.keys(this.ExtractSchema())[0]}Execute(e,t){return this.root.Execute(e,t)}Encode(...e){try{return this.root.Encode(e.reverse())}catch(t){if(t instanceof h)throw t;throw new De("Unable to encode parameter",this.root,e,t)}}EncodeObject(e,t){try{return this.root.EncodeObject(e,t)}catch(t){if(t instanceof h)throw t;throw new De("Unable to encode parameter object",this.root,e,t)}}ExtractSchema(){return this.root.ExtractSchema()}generateSchema(){return this.root.generateSchema()}ExtractSignatures(){return this.root.ExtractSignature()}}class Ye{constructor(e){if(!e)throw new Ue(e,"the args are not defined");if(4!==e.length)throw new Ue(e,"there should be exactly 4 arguments");if(!("string"in e[0])||!e[0].string)throw new Ue(e,"The first argument should be a string, representing the view name. It should be in the form: { string: 'viewName' }");this.viewName=e[0].string,this.viewArgsType=e[1],this.viewReturnType=e[2],this.instructions=e[3],this.rootArgsType=je(this.viewArgsType,0),this.rootReturnType=je(this.viewReturnType,0)}static fromRPCResponse(e){const t=[],r=e&&e.script&&Array.isArray(e.script.code)&&e.script.code.filter((e=>"view"===e.prim));return r&&r.forEach((e=>{t.push(new Ye(e.args))})),t}encodeViewArgs(e){try{return this.rootArgsType.EncodeObject(e)}catch(t){throw new De(this.viewName,void 0,e,t)}}decodeViewResult(e,t){return this.rootReturnType.Execute(e,t)}extractArgsSchema(){return this.rootArgsType.ExtractSchema()}extractResultSchema(){return this.rootReturnType.ExtractSchema()}}class Xe{constructor(e,t){this.tag=e,this.type=t}static fromMichelineValue(e){var t,r;return new Xe(null===(t=e.annots)||void 0===t?void 0:t[0],null===(r=e.args)||void 0===r?void 0:r[0])}static fromRPCResponse(e){const t=[];return e.script.code.forEach((e=>{"prim"in e&&"code"===e.prim&&"args"in e&&e.args&&t.push(...Xe.extractEventsRecursively(e.args))})),Xe.removeDuplicates(t)}static removeDuplicates(e){const t=[];return e.forEach((e=>{-1===t.findIndex((t=>t.tag===e.tag&&We(t.type,e.type)))&&t.push(e)})),t}static extractEventsRecursively(e){return Array.isArray(e)?e.flatMap((e=>Xe.extractEventsRecursively(e))):"prim"in e?"EMIT"===e.prim?[Xe.fromMichelineValue(e)]:"args"in e&&e.args?e.args.flatMap((e=>Xe.extractEventsRecursively(e))):[]:[]}}const Qe={commitHash:"a97e506efd61b86e39ae30db588401b8fda46553",version:"17.3.2"},et=Symbol(),tt={}},6368:(e,t,r)=>{"use strict";r.r(t),r.d(t,{METADATA_BALANCE_UPDATES_CATEGORY:()=>b,OPERATION_METADATA:()=>p,OpKind:()=>O,PvmKind:()=>m,RpcClient:()=>A,RpcClientCache:()=>h,SmartRollupInputProofKind:()=>v,SmartRollupRefutationOptions:()=>g,SmartRollupRefuteGameEndedPlayerOutcomes:()=>w,SmartRollupRefuteGameEndedReason:()=>E,SmartRollupRefuteGameStatusOptions:()=>_,SmartRollupRefuteRevealProofKind:()=>y,VERSION:()=>S,castToBigNumber:()=>d,defaultChain:()=>u,defaultRPCOptions:()=>l});var n=r(5543),i=r(2558),o=r(4632),s=r(227);function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function c(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const u="main",l={block:"head"};var f;function d(e,t){const r=Array.isArray(e);void 0===t&&(t=Object.keys(e));const n=r?[]:{};return t.forEach((t=>{const r=e[t];let o;if(void 0!==r){if(Array.isArray(r))return o=d(r),void(n[t]=o);o=new i.Z(r),n[t]=o}})),n}!function(e){e.GET_BAKING_RIGHTS="getBakingRights",e.GET_BALLOTS="getBallots",e.GET_BALLOT_LIST="getBallotList",e.GET_BIG_MAP_KEY="getBigMapKey",e.GET_BIG_MAP_EXPR="getBigMapExpr",e.GET_BLOCK_HASH="getBlockHash",e.GET_BLOCK="getBlock",e.GET_BLOCK_HEADER="getBlockHeader",e.GET_BLOCK_METADATA="getBlockMetadata",e.GET_BALANCE="getBalance",e.GET_CHAIN_ID="getChainId",e.GET_CONSTANTS="getConstants",e.GET_CONTRACT="getContract",e.GET_CURRENT_PERIOD="getCurrentPeriod",e.GET_CURRENT_PROPOSAL="getCurrentProposal",e.GET_CURRENT_QUORUM="getCurrentQuorum",e.GET_DELEGATE="getDelegate",e.GET_DELEGATES="getDelegates",e.GET_VOTING_INFO="getVotingInfo",e.GET_ENDORSING_RIGHTS="getEndorsingRights",e.GET_ENTRYPOINTS="getEntrypoints",e.GET_LIVE_BLOCKS="getLiveBlocks",e.GET_MANAGER_KEY="getManagerKey",e.GET_NORMALIZED_SCRIPT="getNormalizedScript",e.GET_PROPOSALS="getProposals",e.GET_PROTOCOLS="getProtocols",e.GET_SAPLING_DIFF_BY_CONTRACT="getSaplingDiffByContract",e.GET_SAPLING_DIFF_BY_ID="getSaplingDiffById",e.GET_SCRIPT="getScript",e.GET_STORAGE="getStorage",e.GET_SUCCESSOR_PERIOD="getSuccessorPeriod",e.GET_TX_ROLLUP_INBOX="getTxRollupInbox",e.GET_TX_ROLLUP_STATE="getTxRollupState",e.GET_VOTES_LISTINGS="getVotesListings",e.PACK_DATA="packData",e.GET_STORAGE_USED_SPACE="getStorageUsedSpace",e.GET_STORAGE_PAID_SPACE="getStoragePaidSpace",e.GET_TICKET_BALANCE="getTicketBalance",e.GET_ALL_TICKET_BALANCES="getAllTicketBalances",e.GET_PENDING_OPERATIONS="getPendingOperations",e.GET_ORIGINATION_PROOF="getOriginationProof"}(f||(f={}));class h{constructor(e,t=1e3){this.rpcClient=e,this.ttl=t,this._cache={}}getAllCachedData(){return this._cache}deleteAllCachedData(){for(const e in this._cache)delete this._cache[e]}formatCacheKey(e,t,r,n){let i="";return r.forEach((e=>{i="object"==typeof e?i+JSON.stringify(e)+"/":i+e+"/"})),n?`${e}/${t}/${i}${JSON.stringify(n)}/`:`${e}/${t}/${i}`}has(e){return e in this._cache}get(e){return this._cache[e].response}put(e,t){const r=setTimeout((()=>this.remove(e)),this.ttl);Object.assign(this._cache,{[e]:{handle:r,response:t}})}remove(e){e in this._cache&&delete this._cache[e]}validateAddress(e){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t))}validateContract(e){const t=(0,o.validateContractAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidContractAddressError(e,(0,o.invalidDetail)(t))}getBlockHash({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BLOCK_HASH,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlockHash({block:e});return this.put(t,r),r}}))}getLiveBlocks({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_LIVE_BLOCKS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getLiveBlocks({block:e});return this.put(t,r),r}}))}getBalance(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BALANCE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getBalance(e,{block:t});return this.put(r,n),n}}))}getStorage(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateContract(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_STORAGE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStorage(e,{block:t});return this.put(r,n),n}}))}getScript(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateContract(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_SCRIPT,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getScript(e,{block:t});return this.put(r,n),n}}))}getNormalizedScript(e,t={unparsing_mode:"Readable"},{block:r}=l){return c(this,void 0,void 0,(function*(){this.validateContract(e);const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_NORMALIZED_SCRIPT,[r,e],t);if(this.has(n))return this.get(n);{const i=this.rpcClient.getNormalizedScript(e,t,{block:r});return this.put(n,i),i}}))}getContract(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_CONTRACT,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getContract(e,{block:t});return this.put(r,n),n}}))}getManagerKey(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_MANAGER_KEY,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getManagerKey(e,{block:t});return this.put(r,n),n}}))}getDelegate(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_DELEGATE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getDelegate(e,{block:t});return this.put(r,n),n}}))}getBigMapKey(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BIG_MAP_KEY,[r,e],t);if(this.has(n))return this.get(n);{const i=this.rpcClient.getBigMapKey(e,t,{block:r});return this.put(n,i),i}}))}getBigMapExpr(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BIG_MAP_EXPR,[r,e,t]);if(this.has(n))return this.get(n);{const i=this.rpcClient.getBigMapExpr(e,t,{block:r});return this.put(n,i),i}}))}getDelegates(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_DELEGATES,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getDelegates(e,{block:t});return this.put(r,n),n}}))}getVotingInfo(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_VOTING_INFO,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getVotingInfo(e,{block:t});return this.put(r,n),n}}))}getConstants({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_CONSTANTS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getConstants({block:e});return this.put(t,r),r}}))}getBlock({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BLOCK,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlock({block:e});return this.put(t,r),r}}))}getBlockHeader({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BLOCK_HEADER,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlockHeader({block:e});return this.put(t,r),r}}))}getBlockMetadata({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BLOCK_METADATA,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlockMetadata({block:e});return this.put(t,r),r}}))}getBakingRights(e={},{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BAKING_RIGHTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getBakingRights(e,{block:t});return this.put(r,n),n}}))}getEndorsingRights(e={},{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_ENDORSING_RIGHTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getEndorsingRights(e,{block:t});return this.put(r,n),n}}))}getBallotList({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BALLOT_LIST,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBallotList({block:e});return this.put(t,r),r}}))}getBallots({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_BALLOTS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBallots({block:e});return this.put(t,r),r}}))}getCurrentProposal({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_CURRENT_PROPOSAL,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getCurrentProposal({block:e});return this.put(t,r),r}}))}getCurrentQuorum({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_CURRENT_QUORUM,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getCurrentQuorum({block:e});return this.put(t,r),r}}))}getVotesListings({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_VOTES_LISTINGS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getVotesListings({block:e});return this.put(t,r),r}}))}getProposals({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_PROPOSALS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getProposals({block:e});return this.put(t,r),r}}))}forgeOperations(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.rpcClient.forgeOperations(e,{block:t})}))}injectOperation(e){return c(this,void 0,void 0,(function*(){return this.rpcClient.injectOperation(e)}))}preapplyOperations(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.rpcClient.preapplyOperations(e,{block:t})}))}getEntrypoints(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateContract(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_ENTRYPOINTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getEntrypoints(e,{block:t});return this.put(r,n),n}}))}runOperation(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.rpcClient.runOperation(e,{block:t})}))}simulateOperation(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.rpcClient.simulateOperation(e,{block:t})}))}runCode(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.rpcClient.runCode(e,{block:t})}))}runScriptView(e,{block:t}=l){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]);return c(this,void 0,void 0,(function*(){return this.rpcClient.runScriptView(Object.assign({unparsing_mode:r},n),{block:t})}))}runView(e,{block:t}=l){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]);return c(this,void 0,void 0,(function*(){return this.rpcClient.runView(Object.assign({unparsing_mode:r},n),{block:t})}))}getChainId(){return c(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_CHAIN_ID,[]);if(this.has(e))return this.get(e);{const t=this.rpcClient.getChainId();return this.put(e,t),t}}))}packData(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.PACK_DATA,[t],e);if(this.has(r))return this.get(r);{const n=this.rpcClient.packData(e,{block:t});return this.put(r,n),n}}))}getRpcUrl(){return this.rpcClient.getRpcUrl()}getCurrentPeriod({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_CURRENT_PERIOD,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getCurrentPeriod({block:e});return this.put(t,r),r}}))}getSuccessorPeriod({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_SUCCESSOR_PERIOD,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getSuccessorPeriod({block:e});return this.put(t,r),r}}))}getSaplingDiffById(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_SAPLING_DIFF_BY_ID,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getSaplingDiffById(e,{block:t});return this.put(r,n),n}}))}getSaplingDiffByContract(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_SAPLING_DIFF_BY_CONTRACT,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getSaplingDiffByContract(e,{block:t});return this.put(r,n),n}}))}getProtocols({block:e}=l){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_PROTOCOLS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getProtocols({block:e});return this.put(t,r),r}}))}getTxRollupState(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_TX_ROLLUP_STATE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getTxRollupState(e,{block:t});return this.put(r,n),n}}))}getTxRollupInbox(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_TX_ROLLUP_INBOX,[r,e,t]);if(this.has(n))return this.get(n);{const i=this.rpcClient.getTxRollupInbox(e,t,{block:r});return this.put(n,i),i}}))}getStorageUsedSpace(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_STORAGE_USED_SPACE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStorageUsedSpace(e,{block:t});return this.put(r,n),n}}))}getStoragePaidSpace(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_STORAGE_PAID_SPACE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStoragePaidSpace(e,{block:t});return this.put(r,n),n}}))}getTicketBalance(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_TICKET_BALANCE,[r,e],t);if(this.has(n))return this.get(n);{const i=this.rpcClient.getTicketBalance(e,t,{block:r});return this.put(n,i),i}}))}getAllTicketBalances(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_ALL_TICKET_BALANCES,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getAllTicketBalances(e,{block:t});return this.put(r,n),n}}))}getPendingOperations(e={}){return c(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_PENDING_OPERATIONS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getPendingOperations(e);return this.put(t,r),r}}))}getOriginationProof(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),f.GET_ORIGINATION_PROOF,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getOriginationProof(e,{block:t});return this.put(r,n),n}}))}}var p,b,m,g,v,y,_,w,E,O;!function(e){e.TOO_LARGE="too large"}(p||(p={})),function(e){e.BAKING_REWARDS="baking rewards",e.REWARDS="rewards",e.FEES="fees",e.DEPOSITS="deposits",e.LEGACY_REWARDS="legacy_rewards",e.LEGACY_FEES="legacy_fees",e.LEGACY_DEPOSITS="legacy_deposits",e.BLOCK_FEES="block fees",e.NONCE_REVELATION_REWARDS="nonce revelation rewards",e.DOUBLE_SIGNING_EVIDENCE_REWARDS="double signing evidence rewards",e.ENDORSING_REWARDS="endorsing rewards",e.BAKING_BONUSES="baking bonuses",e.STORAGE_FEES="storage fees",e.PUNISHMENTS="punishments",e.LOST_ENDORSING_REWARDS="lost endorsing rewards",e.SUBSIDY="subsidy",e.BURNED="burned",e.COMMITMENT="commitment",e.BOOTSTRAP="bootstrap",e.INVOICE="invoice",e.MINTED="minted",e.TX_ROLLUP_REJECTION_REWARDS="tx_rollup_rejection_rewards",e.TX_ROLLUP_REJECTION_PUNISHMENTS="tx_rollup_rejection_punishments",e.BONDS="bonds"}(b||(b={})),function(e){e.WASM2="wasm_2_0_0",e.ARITH="arith"}(m||(m={})),function(e){e.START="start",e.MOVE="move"}(g||(g={})),function(e){e.INBOX_PROOF="inbox_proof",e.REVEAL_PROOF="reveal_proof",e.FIRST_INPUT="first_input"}(v||(v={})),function(e){e.RAW_DATA_PROOF="raw_data_proof",e.METADATA_PROOF="metadata_proof",e.DAL_PAGE_PROOF="dal_page_proof"}(y||(y={})),function(e){e.ONGOING="ongoing",e.ENDED="ended"}(_||(_={})),function(e){e.LOSER="loser",e.DRAW="draw"}(w||(w={})),function(e){e.CONFLICT_RESOLVED="conflict_resolved",e.TIMEOUT="timeout"}(E||(E={})),function(e){e.ORIGINATION="origination",e.DELEGATION="delegation",e.REVEAL="reveal",e.TRANSACTION="transaction",e.ACTIVATION="activate_account",e.ENDORSEMENT="endorsement",e.PREENDORSEMENT="preendorsement",e.SET_DEPOSITS_LIMIT="set_deposits_limit",e.DOUBLE_PREENDORSEMENT_EVIDENCE="double_preendorsement_evidence",e.ENDORSEMENT_WITH_SLOT="endorsement_with_slot",e.SEED_NONCE_REVELATION="seed_nonce_revelation",e.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",e.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",e.PROPOSALS="proposals",e.BALLOT="ballot",e.FAILING_NOOP="failing_noop",e.REGISTER_GLOBAL_CONSTANT="register_global_constant",e.TX_ROLLUP_ORIGINATION="tx_rollup_origination",e.TX_ROLLUP_SUBMIT_BATCH="tx_rollup_submit_batch",e.TX_ROLLUP_COMMIT="tx_rollup_commit",e.TX_ROLLUP_RETURN_BOND="tx_rollup_return_bond",e.TX_ROLLUP_FINALIZE_COMMITMENT="tx_rollup_finalize_commitment",e.TX_ROLLUP_REMOVE_COMMITMENT="tx_rollup_remove_commitment",e.TX_ROLLUP_REJECTION="tx_rollup_rejection",e.TX_ROLLUP_DISPATCH_TICKETS="tx_rollup_dispatch_tickets",e.TRANSFER_TICKET="transfer_ticket",e.INCREASE_PAID_STORAGE="increase_paid_storage",e.UPDATE_CONSENSUS_KEY="update_consensus_key",e.DRAIN_DELEGATE="drain_delegate",e.VDF_REVELATION="vdf_revelation",e.EVENT="event",e.TICKET_UPDATES="ticket_updates",e.SMART_ROLLUP_ORIGINATE="smart_rollup_originate",e.SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",e.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message",e.SMART_ROLLUP_PUBLISH="smart_rollup_publish",e.SMART_ROLLUP_CEMENT="smart_rollup_cement",e.SMART_ROLLUP_RECOVER_BOND="smart_rollup_recover_bond",e.SMART_ROLLUP_REFUTE="smart_rollup_refute",e.SMART_ROLLUP_TIMEOUT="smart_rollup_timeout"}(O||(O={}));const S={commitHash:"a97e506efd61b86e39ae30db588401b8fda46553",version:"17.3.2"};class A{constructor(e,t=u,r=new n.HttpBackend){this.url=e,this.chain=t,this.httpBackend=r}createURL(e){return`${this.url.replace(/\/+$/g,"")}${e}`}validateAddress(e){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t))}validateContract(e){const t=(0,o.validateContractAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidContractAddressError(e,(0,o.invalidDetail)(t))}getBlockHash({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/hash`),method:"GET"})}))}getLiveBlocks({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/live_blocks`),method:"GET"})}))}getBalance(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/balance`),method:"GET"});return new i.Z(r)}))}getStorage(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.validateContract(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/storage`),method:"GET"})}))}getScript(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.validateContract(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/script`),method:"GET"})}))}getNormalizedScript(e,t={unparsing_mode:"Readable"},{block:r}=l){return c(this,void 0,void 0,(function*(){return this.validateContract(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${e}/script/normalized`),method:"POST"},t)}))}getContract(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}`),method:"GET"});return Object.assign(Object.assign({},r),{balance:new i.Z(r.balance)})}))}getManagerKey(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.validateAddress(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/manager_key`),method:"GET"})}))}getDelegate(e,{block:t}=l){return c(this,void 0,void 0,(function*(){let r;this.validateAddress(e);try{r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/delegate`),method:"GET"})}catch(e){if(!(e instanceof n.HttpResponseError&&e.status===n.STATUS_CODE.NOT_FOUND))throw e;r=null}return r}))}getBigMapKey(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){return this.validateAddress(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${e}/big_map_get`),method:"POST"},t)}))}getBigMapExpr(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/big_maps/${e}/${t}`),method:"GET"})}))}getDelegates(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/delegates/${e}`),method:"GET"}),n=d(r,["balance","full_balance","current_frozen_deposits","frozen_deposits","frozen_balance","frozen_deposits_limit","staking_balance","delegated_balance","voting_power"]);return Object.assign(Object.assign(Object.assign({},r),n),{frozen_balance_by_cycle:r.frozen_balance_by_cycle?r.frozen_balance_by_cycle.map((e=>{var{deposit:t,deposits:r,fees:n,rewards:i}=e,o=a(e,["deposit","deposits","fees","rewards"]);const s=d({deposit:t,deposits:r,fees:n,rewards:i},["deposit","deposits","fees","rewards"]);return Object.assign(Object.assign({},o),{deposit:s.deposit,deposits:s.deposits,fees:s.fees,rewards:s.rewards})})):void 0})}))}getVotingInfo(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.validateAddress(e),yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/delegates/${e}/voting_info`),method:"GET"})}))}getConstants({block:e}=l){return c(this,void 0,void 0,(function*(){const t=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/constants`),method:"GET"}),r=d(t,["time_between_blocks","hard_gas_limit_per_operation","hard_gas_limit_per_block","proof_of_work_threshold","tokens_per_roll","seed_nonce_revelation_tip","block_security_deposit","endorsement_security_deposit","block_reward","endorsement_reward","cost_per_byte","hard_storage_limit_per_operation","test_chain_duration","baking_reward_per_endorsement","delay_per_missing_endorsement","minimal_block_delay","liquidity_baking_subsidy","cache_layout","baking_reward_fixed_portion","baking_reward_bonus_per_slot","endorsing_reward_per_slot","double_baking_punishment","delay_increment_per_round","tx_rollup_commitment_bond","vdf_difficulty","sc_rollup_stake_amount","minimal_stake"]);return Object.assign(Object.assign({},t),r)}))}getBlock({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}`),method:"GET"})}))}getBlockHeader({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/header`),method:"GET"})}))}getBlockMetadata({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/metadata`),method:"GET"})}))}getBakingRights(e={},{block:t}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/baking_rights`),method:"GET",query:e})}))}getEndorsingRights(e={},{block:t}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/endorsing_rights`),method:"GET",query:e})}))}getBallotList({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/ballot_list`),method:"GET"})}))}getBallots({block:e}=l){return c(this,void 0,void 0,(function*(){return d(yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/ballots`),method:"GET"}),["yay","nay","pass"])}))}getCurrentProposal({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/current_proposal`),method:"GET"})}))}getCurrentQuorum({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/current_quorum`),method:"GET"})}))}getVotesListings({block:e}=l){return c(this,void 0,void 0,(function*(){const t=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/listings`),method:"GET"});return t.map((e=>(e.voting_power&&(e.voting_power=new i.Z(e.voting_power)),e))),t}))}getProposals({block:e}=l){return c(this,void 0,void 0,(function*(){const t=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/proposals`),method:"GET"});return t.map((e=>e[1]=new i.Z(e[1]))),t}))}forgeOperations(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/forge/operations`),method:"POST"},e)}))}injectOperation(e){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL("/injection/operation"),method:"POST"},e)}))}preapplyOperations(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/preapply/operations`),method:"POST"},e)}))}getEntrypoints(e,{block:t}=l){return c(this,void 0,void 0,(function*(){this.validateContract(e);return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/entrypoints`),method:"GET"})}))}runOperation(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/run_operation`),method:"POST"},e)}))}simulateOperation(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/simulate_operation`),method:"POST"},e)}))}runCode(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/run_code`),method:"POST"},e)}))}runScriptView(e,{block:t}=l){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]);return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/run_script_view`),method:"POST"},Object.assign({unparsing_mode:r},n))}))}runView(e,{block:t}=l){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]);return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/run_view`),method:"POST"},Object.assign({unparsing_mode:r},n))}))}getChainId(){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/chain_id`),method:"GET"})}))}packData(e,{block:t}=l){return c(this,void 0,void 0,(function*(){const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/pack_data`),method:"POST"},e),{gas:n}=r,o=a(r,["gas"]);let s=n;const c=new i.Z(n||"");return c.isNaN()||(s=c),Object.assign({gas:s},o)}))}getRpcUrl(){return this.url}getCurrentPeriod({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/current_period`),method:"GET"})}))}getSuccessorPeriod({block:e}=l){return c(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/successor_period`),method:"GET"})}))}getSaplingDiffById(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/sapling/${e}/get_diff`),method:"GET"})}))}getSaplingDiffByContract(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/single_sapling_get_diff`),method:"GET"})}))}getProtocols({block:e}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/protocols`),method:"GET"})}))}getTxRollupState(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/tx_rollup/${e}/state`),method:"GET"})}))}getTxRollupInbox(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/tx_rollup/${e}/inbox/${t}`),method:"GET"})}))}getStorageUsedSpace(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/storage/used_space`),method:"GET"})}))}getStoragePaidSpace(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/storage/paid_space`),method:"GET"})}))}getTicketBalance(e,t,{block:r}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${e}/ticket_balance`),method:"POST"},t)}))}getAllTicketBalances(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/all_ticket_balances`),method:"GET"})}))}getPendingOperations(e={}){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/mempool/pending_operations`),method:"GET",query:e})}))}getOriginationProof(e,{block:t}=l){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/smart_rollups/all/origination_proof`),method:"POST"},e)}))}}},4632:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DeprecationError:()=>f.DeprecationError,InvalidAddressError:()=>f.InvalidAddressError,InvalidBlockHashError:()=>f.InvalidBlockHashError,InvalidChainIdError:()=>f.InvalidChainIdError,InvalidContractAddressError:()=>f.InvalidContractAddressError,InvalidHexStringError:()=>f.InvalidHexStringError,InvalidKeyError:()=>f.InvalidKeyError,InvalidKeyHashError:()=>f.InvalidKeyHashError,InvalidMessageError:()=>f.InvalidMessageError,InvalidOperationHashError:()=>f.InvalidOperationHashError,InvalidOperationKindError:()=>f.InvalidOperationKindError,InvalidProtocolHashError:()=>E,InvalidPublicKeyError:()=>f.InvalidPublicKeyError,InvalidSignatureError:()=>f.InvalidSignatureError,Prefix:()=>n,ProhibitedActionError:()=>f.ProhibitedActionError,VERSION:()=>q,ValidationResult:()=>S,ValueConversionError:()=>O,b58cdecode:()=>te,b58cencode:()=>ee,b58decode:()=>re,b58decodeL2Address:()=>ne,buf2hex:()=>fe,bytes2Char:()=>pe,char2Bytes:()=>he,encodeExpr:()=>X,encodeKey:()=>se,encodeKeyHash:()=>ae,encodeL2Address:()=>oe,encodeOpHash:()=>Q,encodePubKey:()=>ie,format:()=>Y,getPkhfromPk:()=>de,hex2Bytes:()=>be,hex2buf:()=>ce,invalidDetail:()=>V,isValidPrefix:()=>A,mergebuf:()=>ue,mic2arr:()=>le,num2PaddedHex:()=>ge,prefix:()=>g,prefixLength:()=>v,stripHexPrefix:()=>ve,toHexBuf:()=>me,validateAddress:()=>C,validateBlock:()=>G,validateChain:()=>j,validateContractAddress:()=>D,validateKeyHash:()=>U,validateOperation:()=>K,validatePkAndExtractPrefix:()=>_,validateProtocol:()=>H,validatePublicKey:()=>F,validateSignature:()=>B,validateSmartRollupAddress:()=>z,validateSpendingKey:()=>$,verifySignature:()=>y});var n,i=r(8834),o=r(7728),s=r(6851),a=r(1395),c=r.n(a),u=r(4075),l=r.n(u),f=r(227),d=r(2558),h=r(7554),p=r.n(h),b=r(8743),m=r.n(b);!function(e){e.TZ1="tz1",e.TZ2="tz2",e.TZ3="tz3",e.TZ4="tz4",e.KT="KT",e.KT1="KT1",e.EDSK2="edsk2",e.SPSK="spsk",e.P2SK="p2sk",e.EDPK="edpk",e.SPPK="sppk",e.P2PK="p2pk",e.BLPK="BLpk",e.EDESK="edesk",e.SPESK="spesk",e.P2ESK="p2esk",e.EDSK="edsk",e.EDSIG="edsig",e.SPSIG="spsig",e.P2SIG="p2sig",e.SIG="sig",e.NET="Net",e.NCE="nce",e.B="B",e.O="o",e.LO="Lo",e.LLO="LLo",e.P="P",e.CO="Co",e.ID="id",e.EXPR="expr",e.TZ="TZ",e.VH="vh",e.SASK="sask",e.ZET1="zet1",e.TXR1="txr1",e.TXI="txi",e.TXM="txm",e.TXC="txc",e.TXMR="txmr",e.TXRL="txM",e.TXW="txw",e.SR1="sr1",e.SRC1="src1"}(n||(n={}));const g={[n.TZ1]:new Uint8Array([6,161,159]),[n.TZ2]:new Uint8Array([6,161,161]),[n.TZ3]:new Uint8Array([6,161,164]),[n.TZ4]:new Uint8Array([6,161,166]),[n.KT]:new Uint8Array([2,90,121]),[n.KT1]:new Uint8Array([2,90,121]),[n.EDSK]:new Uint8Array([43,246,78,7]),[n.EDSK2]:new Uint8Array([13,15,58,7]),[n.SPSK]:new Uint8Array([17,162,224,201]),[n.P2SK]:new Uint8Array([16,81,238,189]),[n.EDPK]:new Uint8Array([13,15,37,217]),[n.SPPK]:new Uint8Array([3,254,226,86]),[n.P2PK]:new Uint8Array([3,178,139,127]),[n.BLPK]:new Uint8Array([6,149,135,204]),[n.EDESK]:new Uint8Array([7,90,60,179,41]),[n.SPESK]:new Uint8Array([9,237,241,174,150]),[n.P2ESK]:new Uint8Array([9,48,57,115,171]),[n.EDSIG]:new Uint8Array([9,245,205,134,18]),[n.SPSIG]:new Uint8Array([13,115,101,19,63]),[n.P2SIG]:new Uint8Array([54,240,44,52]),[n.SIG]:new Uint8Array([4,130,43]),[n.NET]:new Uint8Array([87,82,0]),[n.NCE]:new Uint8Array([69,220,169]),[n.B]:new Uint8Array([1,52]),[n.O]:new Uint8Array([5,116]),[n.LO]:new Uint8Array([133,233]),[n.LLO]:new Uint8Array([29,159,109]),[n.P]:new Uint8Array([2,170]),[n.CO]:new Uint8Array([79,179]),[n.ID]:new Uint8Array([153,103]),[n.EXPR]:new Uint8Array([13,44,64,27]),[n.TZ]:new Uint8Array([2,90,121]),[n.VH]:new Uint8Array([1,106,242]),[n.SASK]:new Uint8Array([11,237,20,92]),[n.ZET1]:new Uint8Array([18,71,40,223]),[n.TXR1]:new Uint8Array([1,128,120,31]),[n.TXI]:new Uint8Array([79,148,196]),[n.TXM]:new Uint8Array([79,149,30]),[n.TXC]:new Uint8Array([79,148,17]),[n.TXMR]:new Uint8Array([18,7,206,87]),[n.TXRL]:new Uint8Array([79,146,82]),[n.TXW]:new Uint8Array([79,150,72]),[n.SR1]:new Uint8Array([6,124,117]),[n.SRC1]:new Uint8Array([17,165,134,138])},v={[n.TZ1]:20,[n.TZ2]:20,[n.TZ3]:20,[n.TZ4]:20,[n.KT]:20,[n.KT1]:20,[n.EDPK]:32,[n.SPPK]:33,[n.P2PK]:33,[n.BLPK]:48,[n.EDSIG]:64,[n.SPSIG]:64,[n.P2SIG]:64,[n.SIG]:64,[n.NET]:4,[n.B]:32,[n.P]:32,[n.O]:32,[n.VH]:32,[n.SASK]:169,[n.ZET1]:43,[n.TXR1]:20,[n.TXI]:32,[n.TXM]:32,[n.TXC]:32,[n.TXMR]:32,[n.TXRL]:32,[n.TXW]:32,[n.SR1]:20,[n.SRC1]:32};function y(e,t,r,i){const a=_(t),c=function(e){const t=e.startsWith("sig")?e.substring(0,3):e.substring(0,5),r=B(e);if(r!==S.VALID)throw new f.InvalidSignatureError(e,V(r));return t}(r),u=te(t,g[a]),l=te(r,g[c]);let d=ce(function(e){if(""===e)throw new f.InvalidMessageError(e,"can't be empty");return e}(e));void 0!==i&&(d=ue(i,d));const h=(0,s.vp)(d,32);return a===n.EDPK?function(e,t,r){try{return(0,o.T)(r,t,e)}catch(e){return!1}}(l,h,u):a===n.SPPK?function(e,t,r){const n=new(p().ec)("secp256k1").keyFromPublic(r);return w(e,t,n)}(l,h,u):a===n.P2PK&&function(e,t,r){const n=new(p().ec)("p256").keyFromPublic(r);return w(e,t,n)}(l,h,u)}function _(e){if(""===e)throw new f.InvalidPublicKeyError(e,"can't be empty");const t=e.substring(0,4),r=F(e);if(r!==S.VALID)throw new f.InvalidPublicKeyError(e,V(r));return t}function w(e,t,r){const n=fe(m()(e)).match(/([a-f\d]{64})/gi);if(n)try{const[e,i]=n;return r.verify(t,{r:e,s:i})}catch(e){return!1}return!1}class E extends f.ParameterValidationError{constructor(e,t){super(),this.protocolHash=e,this.errorDetails=t,this.name="InvalidProtocolHashError",this.name="InvalidProtocolHashError",this.message=`The protocol hash '${e}' is invalid`,t&&(this.message+=`: ${t}`)}}class O extends f.UnsupportedActionError{constructor(e,t){super(),this.value=e,this.desiredType=t,this.name="ValueConversionError",this.message=`Unable to convert ${e} to a ${t}`}}var S;function A(e){return"string"==typeof e&&e in g}function P(e,t){const r=new RegExp(`^(${t.join("|")})`).exec(e);if(!r||0===r.length)return S.NO_PREFIX_MATCHED;const n=r[0];if(!A(n))return S.NO_PREFIX_MATCHED;e.includes("%")&&(e=e.split("%")[0]);if(!/^(KT1\w{33})$/.test(e)&&"KT1"===n)return S.INVALID_CHECKSUM;let i=l().decodeUnsafe(e);return i?(i=i.slice(g[n].length),i.length!==v[n]?S.INVALID_LENGTH:S.VALID):S.INVALID_CHECKSUM}!function(e){e[e.NO_PREFIX_MATCHED=0]="NO_PREFIX_MATCHED",e[e.INVALID_CHECKSUM=1]="INVALID_CHECKSUM",e[e.INVALID_LENGTH=2]="INVALID_LENGTH",e[e.VALID=3]="VALID"}(S||(S={}));const T=[n.TZ1,n.TZ2,n.TZ3,n.TZ4],R=[n.KT1,n.TXR1],x=[n.EDSIG,n.P2SIG,n.SPSIG,n.SIG],I=[n.EDPK,n.SPPK,n.P2PK,n.BLPK],M=[n.O],L=[n.P],k=[n.B],N=[n.SR1];function C(e){return P(e,[...T,...R,...N])}function j(e){return P(e,[n.NET])}function D(e){return P(e,R)}function U(e){return P(e,T)}function B(e){return P(e,x)}function F(e){return P(e,I)}function K(e){return P(e,M)}function H(e){return P(e,L)}function G(e){return P(e,k)}function $(e){return P(e,[n.SASK])}function V(e){switch(e){case S.NO_PREFIX_MATCHED:return"with unsupported prefix";case S.INVALID_CHECKSUM:return"failed checksum";case S.INVALID_LENGTH:return"with incorrect length";default:return""}}function z(e){return P(e,[...N])}const q={commitHash:"a97e506efd61b86e39ae30db588401b8fda46553",version:"17.3.2"},W=6,Z=3;function J(e){switch(e){case"tz":return W;case"mtz":return Z;default:return 0}}function Y(e="mutez",t="mutez",r){const n=new d.Z(r);return n.isNaN()?r:n.multipliedBy(Math.pow(10,J(e))).dividedBy(Math.pow(10,J(t)))}function X(e){return ee(c().blake2b(ce(e),void 0,32),g.expr)}function Q(e){return ee(c().blake2b(ce(e),void 0,32),g.o)}function ee(e,t){const r="string"==typeof e?Uint8Array.from(i.Buffer.from(e,"hex")):e,n=new Uint8Array(t.length+r.length);return n.set(t),n.set(r,t.length),l().encode(i.Buffer.from(n.buffer))}const te=(e,t)=>l().decode(e).slice(t.length);function re(e){const t=l().decode(e),r={[g.tz1.toString()]:"0000",[g.tz2.toString()]:"0001",[g.tz3.toString()]:"0002"},n={[g.txr1.toString()]:"02"},i=r[new Uint8Array(t.slice(0,3)).toString()],o=n[new Uint8Array(t.slice(0,4)).toString()];if(i){return i+fe(t.slice(3))}if(o){return o+fe(t.slice(4))+"00"}return"01"+fe(t.slice(3,42))+"00"}function ne(e){const t=l().decode(e);return fe(t.slice(3,42))}function ie(e){if("00"===e.substring(0,2)){const t={"0000":g.tz1,"0001":g.tz2,"0002":g.tz3};return ee(e.substring(4),t[e.substring(0,4)])}return"02"===e.substring(0,2)?ee(e.substring(2,e.length-2),g.txr1):ee(e.substring(2,42),g.KT)}function oe(e){return ee(e,g.tz4)}function se(e){if("0"===e[0]){const t={"00":new Uint8Array([13,15,37,217]),"01":new Uint8Array([3,254,226,86]),"02":new Uint8Array([3,178,139,127])};return ee(e.substring(2),t[e.substring(0,2)])}}function ae(e){if("0"===e[0]){const t={"00":new Uint8Array([6,161,159]),"01":new Uint8Array([6,161,161]),"02":new Uint8Array([6,161,164])};return ee(e.substring(2),t[e.substring(0,2)])}}const ce=e=>{if(e.length%2!=0)throw new f.InvalidHexStringError(e,": Expecting even number of characters");const t=ve(e);if(!t.match(/^([\da-f]{2})*$/gi))throw new f.InvalidHexStringError(e,": Only characters 0-9, a-f and A-F are expected. Optionally, it can be prefixed with '0x'");const r=new Uint8Array(t.length/2);let n=0;for(let i=0;i<t.length;i+=2){const o=parseInt(t.slice(i,i+2),16);if(Number.isNaN(o))throw new O(e,"Uint8Array");r[n++]=o}return r},ue=(e,t)=>{const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r},le=function e(t){let r=[];if(Object.prototype.hasOwnProperty.call(t,"prim"))"Pair"===t.prim?(r.push(e(t.args[0])),r=r.concat(e(t.args[1]))):"Elt"===t.prim?r={key:e(t.args[0]),val:e(t.args[1])}:"True"===t.prim?r=!0:"False"===t.prim&&(r=!1);else if(Array.isArray(t)){const n=t.length;for(let i=0;i<n;i++){const n=e(t[i]);void 0!==n.key?(Array.isArray(r)&&(r={keys:[],vals:[]}),r.keys.push(n.key),r.vals.push(n.val)):r.push(n)}}else r=Object.prototype.hasOwnProperty.call(t,"string")?t.string:Object.prototype.hasOwnProperty.call(t,"int")?parseInt(t.int,10):t;return r},fe=e=>{const t=new Uint8Array(e),r=[];return t.forEach((e=>{const t=`00${e.toString(16)}`.slice(-2);r.push(t)})),r.join("")},de=e=>{let t,r;const i=_(e),o=te(e,g[i]);switch(i){case n.EDPK:t=g[n.TZ1],r=v[n.TZ1];break;case n.SPPK:t=g[n.TZ2],r=v[n.TZ2];break;case n.P2PK:t=g[n.TZ3],r=v[n.TZ3];break;case n.BLPK:t=g[n.TZ4],r=v[n.TZ4]}return ee((0,s.vp)(o,r),t)};function he(e){return i.Buffer.from(e,"utf8").toString("hex")}function pe(e){return i.Buffer.from(ce(e)).toString("utf8")}function be(e){const t=ve(e);if(!t.match(/^(0x)?([\da-f]{2})*$/gi))throw new f.InvalidHexStringError(e,": Expecting even number of characters: 0-9, a-z, A-Z, optionally prefixed with 0x");return i.Buffer.from(t,"hex")}function me(e,t=8){return i.Buffer.from(ge(e,t),"hex")}function ge(e,t=8){if(new d.Z(e).isPositive()){const r=Math.ceil(t/4),n=e.toString(16);let i=n.length>=r?n.length:r;return i=i%2==0?i:i+1,function(e,t){const r="0";if(e.length>=t)return e;{const n=t-e.length;return r.repeat(n)+e}}(n,i)}return new d.Z(2).pow(t).minus(new d.Z(e).abs()).toString(16)}function ve(e){return e.startsWith("0x")?e.slice(2):e}},150:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RPCBatchProvider=t.OperationBatch=t.BATCH_KINDS=void 0;const i=r(9480),o=r(3650),s=r(6368),a=r(4632),c=r(227),u=r(6003),l=r(3793);t.BATCH_KINDS=[s.OpKind.ACTIVATION,s.OpKind.ORIGINATION,s.OpKind.TRANSACTION,s.OpKind.DELEGATION];class f extends u.Provider{constructor(e,t){super(e),this.estimator=t,this.operations=[],this.prepare=new l.PrepareProvider(this.context)}withTransfer(e){const t=a.validateAddress(e.to);if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());if(t!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.to,a.invalidDetail(t));return this.operations.push(Object.assign({kind:s.OpKind.TRANSACTION},e)),this}withTransferTicket(e){const t=a.validateAddress(e.destination);if(t!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.destination,a.invalidDetail(t));return this.operations.push(Object.assign({kind:s.OpKind.TRANSFER_TICKET},e)),this}withContractCall(e,t={}){return this.withTransfer(e.toTransferParams(t))}withDelegation(e){var t;const r=a.validateAddress(e.source);if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,a.invalidDetail(r));const n=a.validateAddress(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.delegate,a.invalidDetail(n));return this.operations.push(Object.assign({kind:s.OpKind.DELEGATION},e)),this}withActivation({pkh:e,secret:t}){const r=a.validateKeyHash(e);if(r!==a.ValidationResult.VALID)throw new c.InvalidKeyHashError(e,a.invalidDetail(r));return this.operations.push({kind:s.OpKind.ACTIVATION,pkh:e,secret:t}),this}withOrigination(e){return this.operations.push(Object.assign({kind:s.OpKind.ORIGINATION},e)),this}withRegisterGlobalConstant(e){return this.operations.push(Object.assign({kind:s.OpKind.REGISTER_GLOBAL_CONSTANT},e)),this}withIncreasePaidStorage(e){return this.operations.push(Object.assign({kind:s.OpKind.INCREASE_PAID_STORAGE},e)),this}withSmartRollupAddMessages(e){return this.operations.push(Object.assign({kind:s.OpKind.SMART_ROLLUP_ADD_MESSAGES},e)),this}withSmartRollupOriginate(e){return this.operations.push(Object.assign({kind:s.OpKind.SMART_ROLLUP_ORIGINATE},e)),this}getRPCOp(e){return n(this,void 0,void 0,(function*(){switch(e.kind){case s.OpKind.TRANSACTION:return i.createTransferOperation(Object.assign({},e));case s.OpKind.ORIGINATION:return i.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign({},e)));case s.OpKind.DELEGATION:return i.createSetDelegateOperation(Object.assign({},e));case s.OpKind.REGISTER_GLOBAL_CONSTANT:return i.createRegisterGlobalConstantOperation(Object.assign({},e));case s.OpKind.INCREASE_PAID_STORAGE:return i.createIncreasePaidStorageOperation(Object.assign({},e));case s.OpKind.TRANSFER_TICKET:return i.createTransferTicketOperation(Object.assign({},e));case s.OpKind.SMART_ROLLUP_ADD_MESSAGES:return i.createSmartRollupAddMessagesOperation(Object.assign({},e));case s.OpKind.SMART_ROLLUP_ORIGINATE:return i.createSmartRollupOriginateOperation(Object.assign({},e));default:throw new c.InvalidOperationKindError(JSON.stringify(e.kind))}}))}with(e){for(const t of e)switch(t.kind){case s.OpKind.TRANSACTION:this.withTransfer(t);break;case s.OpKind.ORIGINATION:this.withOrigination(t);break;case s.OpKind.DELEGATION:this.withDelegation(t);break;case s.OpKind.ACTIVATION:this.withActivation(t);break;case s.OpKind.REGISTER_GLOBAL_CONSTANT:this.withRegisterGlobalConstant(t);break;case s.OpKind.INCREASE_PAID_STORAGE:this.withIncreasePaidStorage(t);break;case s.OpKind.TRANSFER_TICKET:this.withTransferTicket(t);break;case s.OpKind.SMART_ROLLUP_ADD_MESSAGES:this.withSmartRollupAddMessages(t);break;case s.OpKind.SMART_ROLLUP_ORIGINATE:this.withSmartRollupOriginate(t);break;default:throw new c.InvalidOperationKindError(JSON.stringify(t.kind))}return this}send(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=e&&e.source||t,n=yield this.estimator.batch(this.operations);n.length!==this.operations.length&&n.shift();const i=yield this.prepare.batch(this.operations,n),s=yield this.forge(i),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(s);return new o.BatchOperation(a,i.opOb.contents,r,u,l,c)}))}}t.OperationBatch=f;t.RPCBatchProvider=class{constructor(e,t){this.context=e,this.estimator=t}batch(e){const t=new f(this.context,this.estimator);return Array.isArray(e)&&t.with(e),t}}},4593:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.getRevealGasLimit=t.ChainIds=t.protocols=t.Protocols=t.COST_PER_BYTE=t.DEFAULT_STORAGE_LIMIT=t.DEFAULT_FEE=t.DEFAULT_GAS_LIMIT=void 0,function(e){e[e.DELEGATION=10600]="DELEGATION",e[e.ORIGINATION=10600]="ORIGINATION",e[e.TRANSFER=10600]="TRANSFER",e[e.REVEAL_TZ1=1e3]="REVEAL_TZ1",e[e.REVEAL_TZ2=1e3]="REVEAL_TZ2",e[e.REVEAL_TZ3=2e3]="REVEAL_TZ3",e[e.REVEAL_TZ4=2e3]="REVEAL_TZ4"}(r=t.DEFAULT_GAS_LIMIT||(t.DEFAULT_GAS_LIMIT={})),function(e){e[e.DELEGATION=1257]="DELEGATION",e[e.ORIGINATION=1e4]="ORIGINATION",e[e.TRANSFER=1e4]="TRANSFER",e[e.REVEAL=374]="REVEAL"}(t.DEFAULT_FEE||(t.DEFAULT_FEE={})),function(e){e[e.DELEGATION=0]="DELEGATION",e[e.ORIGINATION=257]="ORIGINATION",e[e.TRANSFER=257]="TRANSFER",e[e.REVEAL=0]="REVEAL"}(t.DEFAULT_STORAGE_LIMIT||(t.DEFAULT_STORAGE_LIMIT={})),t.COST_PER_BYTE=250,function(e){e.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",e.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",e.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",e.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",e.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",e.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",e.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",e.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",e.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",e.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",e.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",e.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",e.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",e.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",e.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",e.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(n=t.Protocols||(t.Protocols={})),t.protocols={"004":[n.Pt24m4xi],"005":[n.PsBABY5H,n.PsBabyM1],"006":[n.PsCARTHA],"007":[n.PsDELPH1],"008":[n.PtEdo2Zk],"009":[n.PsFLorena],"010":[n.PtGRANADs],"011":[n.PtHangz2],"012":[n.PsiThaCa,n.Psithaca2],"013":[n.PtJakart2],"014":[n.PtKathman],"015":[n.PtLimaPtL],"016":[n.PtMumbai2],"017":[n.PtNairobi],"018":[n.ProtoALpha]},function(e){e.MAINNET="NetXdQprcVkpaWU",e.CARTHAGENET="NetXjD3HPJJjmcd",e.DELPHINET="NetXm8tYqnMWky1",e.EDONET="NetXSgo1ZT2DRUG",e.FLORENCENET="NetXxkAx4woPLyu",e.GRANADANET="NetXz969SFaFn8k",e.HANGZHOUNET="NetXZSsxBpMQeAT",e.ITHACANET="NetXbhmtAbMukLc",e.ITHACANET2="NetXnHfVqm9iesp",e.JAKARTANET2="NetXLH1uAxK7CCh",e.KATHMANDUNET="NetXazhm4yetmff",e.LIMANET="NetXizpkH94bocH",e.MUMBAINET="NetXQw6nWSnrJ5t",e.MUMBAINET2="NetXgbcrNtXD2yA",e.NAIROBINET="NetXyuzvDo2Ugzb"}(t.ChainIds||(t.ChainIds={}));t.getRevealGasLimit=e=>Math.round(11*i(e)/10);const i=e=>{switch(e.substring(0,3)){case"tz1":return r.REVEAL_TZ1;case"tz2":return r.REVEAL_TZ2;case"tz3":return r.REVEAL_TZ3;case"tz4":return r.REVEAL_TZ4;default:throw new Error(`Cannot estimate reveal gas limit for ${e}`)}}},4984:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.defaultConfigConfirmation=void 0;const i=r(6368),o=r(5744),s=r(1067),a=r(8286),c=r(992),u=r(4782),l=r(1151),f=r(150),d=r(635),h=r(5286),p=r(6395),b=r(977),m=r(9494),g=r(259),v=r(5032),y=r(6713),_=r(2021);t.defaultConfigConfirmation={defaultConfirmationCount:1,confirmationPollingTimeoutSecond:180};class w{constructor(e,r=new s.NoopSigner,n,w=new b.BehaviorSubject(Object.assign({},t.defaultConfigConfirmation)),E,O,S,A,P,T,R,x){this._rpc=e,this._signer=r,this._proto=n,this._config=w,this.providerDecorator=[],this.tz=new c.RpcTzProvider(this),this.estimate=new u.RPCEstimateProvider(this),this.contract=new l.RpcContractProvider(this,this.estimate),this.prepare=new _.PrepareProvider(this),this.batch=new f.RPCBatchProvider(this,this.estimate),this.wallet=new d.Wallet(this),this.withExtensions=()=>{let e=this.clone();return this.providerDecorator.forEach((t=>{e=t(e)})),e},"string"==typeof this._rpc?this._rpcClient=new i.RpcClient(this._rpc):this._rpcClient=this._rpc,this._forger=E||new y.TaquitoLocalForger(this),this._injector=O||new o.RpcInjector(this),this.operationFactory=new a.OperationFactory(this),this._walletProvider=A||new d.LegacyWalletProvider(this),this._parser=P||new h.MichelCodecParser(this),this._packer=S||new p.RpcPacker(this),this._globalConstantsProvider=T||new m.NoopGlobalConstantsProvider,this._readProvider=R||new g.RpcReadAdapter(this._rpcClient),this._stream=x||new v.PollingSubscribeProvider(this)}get config(){return this._config.getValue()}set config(e){this._config.next(Object.assign({},e))}setPartialConfig(e){this._config.next(Object.assign(Object.assign({},this._config.getValue()),e))}get rpc(){return this._rpcClient}set rpc(e){this._rpcClient=e}get injector(){return this._injector}set injector(e){this._injector=e}get forger(){return this._forger}set forger(e){this._forger=e}get signer(){return this._signer}set signer(e){this._signer=e}get walletProvider(){return this._walletProvider}set walletProvider(e){this._walletProvider=e}set proto(e){this._proto=e}get proto(){return this._proto}get parser(){return this._parser}set parser(e){this._parser=e}get packer(){return this._packer}set packer(e){this._packer=e}get globalConstantsProvider(){return this._globalConstantsProvider}set globalConstantsProvider(e){this._globalConstantsProvider=e}get readProvider(){return this._readProvider}set readProvider(e){this._readProvider=e}get stream(){return this._stream}set stream(e){this._stream=e}isAnyProtocolActive(e=[]){return n(this,void 0,void 0,(function*(){if(this._proto)return e.includes(this._proto);{const t=yield this.readProvider.getNextProtocol("head");return e.includes(t)}}))}isAnySignerConfigured(){return!(this.signer instanceof s.NoopSigner)}clone(){return new w(this.rpc,this.signer,this.proto,this._config,this.forger,this._injector,this.packer,this._walletProvider,this._parser,this._globalConstantsProvider,this._readProvider,this._stream)}registerProviderDecorator(e){this.providerDecorator.push(e)}}t.Context=w},5225:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BigMapAbstraction=void 0;const i=r(5543);t.BigMapAbstraction=class{constructor(e,t,r){this.id=e,this.schema=t,this.provider=r}get(e,t){return n(this,void 0,void 0,(function*(){try{return yield this.provider.getBigMapKeyByID(this.id.toString(),e,this.schema,t)}catch(e){if(e instanceof i.HttpResponseError&&e.status===i.STATUS_CODE.NOT_FOUND)return;throw e}}))}getMultipleValues(e,t,r=5){return n(this,void 0,void 0,(function*(){return this.provider.getBigMapKeysByID(this.id.toString(),e,this.schema,t,r)}))}toJSON(){return this.id.toString()}toString(){return this.id.toString()}}},191:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compose=void 0,t.compose=function(e,t){return(r,n)=>t(e(r,n),n)}},2298:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractMethodFactory=void 0;const n=r(3687),i=r(4397),o=r(3849);t.ContractMethodFactory=class{constructor(e,t){this.provider=e,this.contractAddress=t}createContractMethodFlatParams(e,t,r,n=!0,o=!1){return new i.ContractMethod(this.provider,this.contractAddress,e,t,r,n,o)}createContractMethodObjectParam(e,t,r,i=!0,o=!1){return new n.ContractMethodObject(this.provider,this.contractAddress,e,t,r,i,o)}createContractViewObjectParam(e,t,r,n,i){return new o.OnChainView(e,t,this.contractAddress,r,n,i)}}},4397:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractMethod=void 0;const n=r(635),i=r(1863),o=r(6700);t.ContractMethod=class{constructor(e,t,r,n,i,o=!0,s=!1){this.provider=e,this.address=t,this.parameterSchema=r,this.name=n,this.args=i,this.isMultipleEntrypoint=o,this.isAnonymous=s}validateArgs(e,t,r){const n=t.ExtractSignatures();if(!n.find((t=>t.length===e.length)))throw new o.InvalidParameterError(r,n,e)}get schema(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}getSignature(){if(!this.isAnonymous){const e=this.parameterSchema.ExtractSignatures();return 1==e.length?e[0]:e}{const e=this.parameterSchema.ExtractSignatures().find((e=>e[0]===this.name));if(e)return e.shift(),e}}send(e={}){return this.provider instanceof n.Wallet?this.provider.transfer(this.toTransferParams(e)).send():this.provider.transfer(this.toTransferParams(e))}toTransferParams({fee:e,gasLimit:t,storageLimit:r,source:n,amount:o=0,mutez:s=!1}={}){return{to:this.address,amount:o,fee:e,mutez:s,source:n,gasLimit:t,storageLimit:r,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:i.DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.Encode(this.name,...this.args):this.parameterSchema.Encode(...this.args)}}}}},4662:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractMethodObject=void 0;const n=r(635),i=r(1863);t.ContractMethodObject=class{constructor(e,t,r,n,i="unit",o=!0,s=!1){this.provider=e,this.address=t,this.parameterSchema=r,this.name=n,this.args=i,this.isMultipleEntrypoint=o,this.isAnonymous=s}getSignature(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}send(e={}){return this.provider instanceof n.Wallet?this.provider.transfer(this.toTransferParams(e)).send():this.provider.transfer(this.toTransferParams(e))}toTransferParams({fee:e,gasLimit:t,storageLimit:r,source:n,amount:o=0,mutez:s=!1}={}){return{to:this.address,amount:o,fee:e,mutez:s,source:n,gasLimit:t,storageLimit:r,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:i.DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.EncodeObject({[this.name]:this.args}):this.parameterSchema.EncodeObject(this.args)}}}}},3849:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OnChainView=void 0;const i=r(4632),o=r(6700),s=r(227);t.OnChainView=class{constructor(e,t,r,n,i,o="Unit"){this._rpc=e,this._readProvider=t,this._contractAddress=r,this._smartContractViewSchema=n,this._contractStorageType=i,this._args=o}getSignature(){return{parameter:this._smartContractViewSchema.extractArgsSchema(),result:this._smartContractViewSchema.extractResultSchema()}}executeView(e){return n(this,void 0,void 0,(function*(){this.verifyContextExecution(e);const t=yield this._readProvider.getChainId(),r=this.transformArgsToMichelson(),n={contract:this._contractAddress,view:this._smartContractViewSchema.viewName,input:r,chain_id:t,source:e.viewCaller};return e.source&&(n.payer=e.source),this.executeViewAndDecodeResult(n)}))}verifyContextExecution(e){if(e.source&&i.validateAddress(e.source)!==i.ValidationResult.VALID)throw new o.InvalidViewSimulationContext(`The source account who initialized the view execution is invalid: ${e.source}.`);if(!e.viewCaller||i.validateAddress(e.viewCaller)!==i.ValidationResult.VALID)throw new o.InvalidViewSimulationContext(`The contract which is the caller of view is invalid: ${e.viewCaller}.`)}transformArgsToMichelson(){try{return this._smartContractViewSchema.encodeViewArgs(this._args)}catch(e){throw new s.InvalidViewParameterError(this._smartContractViewSchema.viewName,this.getSignature(),this._args,e)}}adaptViewCodeToContext(e,t,r){const n={BALANCE:[{prim:"PUSH",args:[{prim:"mutez"},{int:r}]}],SENDER:[{prim:"PUSH",args:[{prim:"address"},{string:t}]}],SELF_ADDRESS:[{prim:"PUSH",args:[{prim:"address"},{string:this._contractAddress}]}],AMOUNT:[{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]}]};return e.forEach(((i,o)=>{i.prim in n&&(e[o]=Object(n)[i.prim]),i.args&&0!==i.args.length?this.adaptViewCodeToContext(i.args,t,r):Array.isArray(i)&&this.adaptViewCodeToContext(i,t,r)})),e}executeViewAndDecodeResult(e){return n(this,void 0,void 0,(function*(){let t;try{t=(yield this._rpc.runScriptView(e)).data}catch(e){const t=o.validateAndExtractFailwith(e);throw t?new o.ViewSimulationError(`The simulation of the on-chain view named ${this._smartContractViewSchema.viewName} failed with: ${JSON.stringify(t)}`,this._smartContractViewSchema.viewName,t,e):e}return this._smartContractViewSchema.decodeViewResult(t)}))}}},1863:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractAbstraction=t.ContractView=t.DEFAULT_SMART_CONTRACT_METHOD_NAME=void 0;const i=r(8899),o=r(4632),s=r(2298),a=r(6700),c=r(227);t.DEFAULT_SMART_CONTRACT_METHOD_NAME="default";class u{constructor(e,t,r,n,i,o,s){this.currentContract=e,this.name=t,this.callbackParametersSchema=r,this.parameterSchema=n,this.args=i,this.rpc=o,this.readProvider=s}read(e){return n(this,void 0,void 0,(function*(){const t=o.validateChain(null!=e?e:"");if(o.validateContractAddress(null!=e?e:"")==o.ValidationResult.VALID)throw new c.DeprecationError("Since version 12, the lambda view no longer depends on a lambda contract. The read method no longer accepts a contract address as a parameter.");if(e&&t!==o.ValidationResult.VALID)throw new c.InvalidChainIdError(e,o.invalidDetail(t));const r=this.parameterSchema.Encode(...this.args),n=yield this.rpc.runView({contract:this.currentContract.address,entrypoint:this.name,input:r,chain_id:e||(yield this.readProvider.getChainId())});return this.callbackParametersSchema.Execute(n.data)}))}}t.ContractView=u;t.ContractAbstraction=class{constructor(e,t,r,n,o,a,c){this.address=e,this.script=t,this.storageProvider=n,this.entrypoints=o,this.rpc=a,this.readProvider=c,this.methods={},this.methodsObject={},this.views={},this.contractViews={},this.contractMethodFactory=new s.ContractMethodFactory(r,e),this.schema=i.Schema.fromRPCResponse({script:this.script}),this.parameterSchema=i.ParameterSchema.fromRPCResponse({script:this.script}),this.viewSchema=i.ViewSchema.fromRPCResponse({script:this.script}),0!==this.viewSchema.length&&this._initializeOnChainViews(this,a,this.readProvider,this.viewSchema),this.eventSchema=i.EventSchema.fromRPCResponse({script:this.script}),this._initializeMethods(this,this.entrypoints.entrypoints,this.rpc,this.readProvider)}_initializeMethods(e,r,n,o){const s=this.parameterSchema,c=Object.keys(r);if(s.isMultipleEntryPoint){c.forEach((t=>{const s=new i.ParameterSchema(r[t]);if(this.methods[t]=function(...r){return e.contractMethodFactory.createContractMethodFlatParams(s,t,r)},this.methodsObject[t]=function(r){return e.contractMethodFactory.createContractMethodObjectParam(s,t,r)},(e=>{let t=!1;if("prim"in e&&"pair"===e.prim&&e.args){const r=e.args[e.args.length-1];"prim"in r&&"contract"===r.prim&&(t=!0)}return t})(r[t])){const s=function(...s){const c=r[t].args[0],l=new i.ParameterSchema(c),f=r[t].args[1].args[0],d=new i.ParameterSchema(f);return((e,t,r)=>{const n=t.ExtractSignatures();if(!n.find((t=>t.length===e.length)))throw new a.InvalidParameterError(r,n,e)})(s,l,t),new u(e,t,d,l,s,n,o)};this.views[t]=s}}));Object.keys(s.ExtractSchema()).filter((e=>-1===Object.keys(r).indexOf(e))).forEach((t=>{this.methods[t]=function(...r){return e.contractMethodFactory.createContractMethodFlatParams(s,t,r,!1,!0)},this.methodsObject[t]=function(r){return e.contractMethodFactory.createContractMethodObjectParam(s,t,r,!1,!0)}}))}else{const r=this.parameterSchema;this.methods[t.DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(...n){return e.contractMethodFactory.createContractMethodFlatParams(r,t.DEFAULT_SMART_CONTRACT_METHOD_NAME,n,!1)},this.methodsObject[t.DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(n){return e.contractMethodFactory.createContractMethodObjectParam(r,t.DEFAULT_SMART_CONTRACT_METHOD_NAME,n,!1)}}}_initializeOnChainViews(e,t,r,n){const i=this.schema.val;n.forEach((n=>{this.contractViews[n.viewName]=function(o){return e.contractMethodFactory.createContractViewObjectParam(t,r,n,i,o)}}))}storage(){return this.storageProvider.getStorage(this.address,this.schema)}bigMap(e){return this.storageProvider.getBigMapKey(this.address,e,this.schema)}}},6700:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidBalanceError=t.OriginationParameterError=t.RevealOperationError=t.InvalidViewSimulationContext=t.validateAndExtractFailwith=t.ViewSimulationError=t.InvalidInitParameter=t.InvalidCodeParameter=t.InvalidDelegationSource=t.InvalidParameterError=void 0;const n=r(227);class i extends n.ParameterValidationError{constructor(e,t,r){super(),this.smartContractMethodName=e,this.sigs=t,this.invalidParams=r,this.name="InvalidParameterError",this.message=`${e} Received ${r.length} arguments while expecting one of the following signatures (${JSON.stringify(t)})`}}t.InvalidParameterError=i;class o extends n.ParameterValidationError{constructor(e){super(),this.source=e,this.name="InvalidDelegationSource",this.message=`Since Babylon delegation source can no longer be a contract address ${e}. Please use the smart contract abstraction to set your delegate.`}}t.InvalidDelegationSource=o;class s extends n.ParameterValidationError{constructor(e,t){super(),this.message=e,this.data=t,this.name="InvalidCodeParameter"}}t.InvalidCodeParameter=s;class a extends n.ParameterValidationError{constructor(e,t){super(),this.message=e,this.data=t,this.name="InvalidInitParameter"}}t.InvalidInitParameter=a;class c extends n.RpcError{constructor(e,t,r,n){super(),this.message=e,this.viewName=t,this.failWith=r,this.cause=n,this.name="ViewSimulationError"}}t.ViewSimulationError=c;t.validateAndExtractFailwith=e=>{if(u(e.body)){const t=JSON.parse(e.body);if(Array.isArray(t)&&"with"in t[t.length-1])return t[t.length-1].with}};const u=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};class l extends n.ParameterValidationError{constructor(e){super(),this.info=e,this.name="InvalidViewSimulationContext",this.message=`${e} Please configure the context of the view execution in the executeView method.`}}t.InvalidViewSimulationContext=l;class f extends n.RpcError{constructor(e){super(),this.message=e,this.name="RevealOperationError"}}t.RevealOperationError=f;class d extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name}}t.OriginationParameterError=d;class h extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidBalanceError"}}t.InvalidBalanceError=h},238: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.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.compose=void 0,i(r(1863),t),i(r(6700),t),i(r(2619),t),i(r(4007),t),i(r(9480),t),i(r(120),t);var o=r(191);Object.defineProperty(t,"compose",{enumerable:!0,get:function(){return o.compose}}),i(r(4662),t),i(r(4397),t),i(r(3687),t),i(r(5491),t)},2619:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MANAGER_LAMBDA=void 0;t.MANAGER_LAMBDA={setDelegate:e=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:e}]},{prim:"SOME"},{prim:"SET_DELEGATE"},{prim:"CONS"}],removeDelegate:()=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"NONE",args:[{prim:"key_hash"}]},{prim:"SET_DELEGATE"},{prim:"CONS"}],transferImplicit:(e,t)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:e}]},{prim:"IMPLICIT_ACCOUNT"},{prim:"PUSH",args:[{prim:"mutez"},{int:`${t}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}],transferToContract:(e,t)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"address"},{string:e}]},{prim:"CONTRACT",args:[{prim:"unit"}]},{prim:"IF_NONE",args:[[{prim:"UNIT"},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"mutez"},{int:`${t}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}]}},9480:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.createSmartRollupOriginateOperation=t.createSmartRollupAddMessagesOperation=t.createUpdateConsensusKeyOperation=t.createProposalsOperation=t.createBallotOperation=t.createDrainDelegateOperation=t.createIncreasePaidStorageOperation=t.createTransferTicketOperation=t.createRegisterGlobalConstantOperation=t.createRevealOperation=t.createRegisterDelegateOperation=t.createSetDelegateOperation=t.createTransferOperation=t.createOriginationOperation=t.createActivationOperation=void 0;const i=r(8899),o=r(6368),s=r(4593),a=r(4632),c=r(6700);t.createActivationOperation=({pkh:e,secret:t})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.ACTIVATION,pkh:e,secret:t}}));t.createOriginationOperation=({code:e,init:t,balance:r="0",delegate:u,storage:l,fee:f=s.DEFAULT_FEE.ORIGINATION,gasLimit:d=s.DEFAULT_GAS_LIMIT.ORIGINATION,storageLimit:h=s.DEFAULT_STORAGE_LIMIT.ORIGINATION,mutez:p=!1})=>n(void 0,void 0,void 0,(function*(){if(void 0!==l&&void 0!==t)throw new c.OriginationParameterError("Storage and Init cannot be set a the same time. Please either use storage or init but not both.");if(!Array.isArray(e))throw new c.InvalidCodeParameter("Wrong code parameter type, expected an array",e);let n;if(void 0!==l){const t=e.find((e=>"prim"in e&&"storage"===e.prim));if(void 0===(null==t?void 0:t.args))throw new c.InvalidCodeParameter("The storage section is missing from the script",e);n=new i.Schema(t.args[0]).Encode(l)}else{if(void 0===t||"object"!=typeof t)throw new c.InvalidInitParameter("Wrong init parameter type, expected JSON Michelson",t);n=t}const s={code:e,storage:n};if(isNaN(Number(r)))throw new c.InvalidBalanceError(`Invalid Balance "${r}", cannot be converted to a number`);const b={kind:o.OpKind.ORIGINATION,fee:f,gas_limit:d,storage_limit:h,balance:p?r.toString():a.format("tz","mutez",r).toString(),script:s};return u&&(b.delegate=u),b}));t.createTransferOperation=({to:e,amount:t,parameter:r,fee:i=s.DEFAULT_FEE.TRANSFER,gasLimit:c=s.DEFAULT_GAS_LIMIT.TRANSFER,storageLimit:u=s.DEFAULT_STORAGE_LIMIT.TRANSFER,mutez:l=!1})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.TRANSACTION,fee:i,gas_limit:c,storage_limit:u,amount:l?t.toString():a.format("tz","mutez",t).toString(),destination:e,parameters:r}}));t.createSetDelegateOperation=({delegate:e,source:t,fee:r=s.DEFAULT_FEE.DELEGATION,gasLimit:i=s.DEFAULT_GAS_LIMIT.DELEGATION,storageLimit:a=s.DEFAULT_STORAGE_LIMIT.DELEGATION})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.DELEGATION,source:t,fee:r,gas_limit:i,storage_limit:a,delegate:e}}));t.createRegisterDelegateOperation=({fee:e=s.DEFAULT_FEE.DELEGATION,gasLimit:t=s.DEFAULT_GAS_LIMIT.DELEGATION,storageLimit:r=s.DEFAULT_STORAGE_LIMIT.DELEGATION},i)=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.DELEGATION,fee:e,gas_limit:t,storage_limit:r,delegate:i}}));t.createRevealOperation=({fee:e=s.DEFAULT_FEE.REVEAL,gasLimit:t,storageLimit:r=s.DEFAULT_STORAGE_LIMIT.REVEAL},i,a)=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.REVEAL,fee:e,public_key:a,source:i,gas_limit:null!=t?t:s.getRevealGasLimit(i),storage_limit:r}}));t.createRegisterGlobalConstantOperation=({value:e,source:t,fee:r,gasLimit:i,storageLimit:s})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.REGISTER_GLOBAL_CONSTANT,value:e,fee:r,gas_limit:i,storage_limit:s,source:t}}));t.createTransferTicketOperation=({ticketContents:e,ticketTy:t,ticketTicketer:r,ticketAmount:i,destination:s,entrypoint:a,source:c,fee:u,gasLimit:l,storageLimit:f})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.TRANSFER_TICKET,fee:u,gas_limit:l,storage_limit:f,source:c,ticket_contents:e,ticket_ty:t,ticket_ticketer:r,ticket_amount:i,destination:s,entrypoint:a}}));t.createIncreasePaidStorageOperation=({source:e,fee:t,gasLimit:r,storageLimit:i,amount:s,destination:a})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.INCREASE_PAID_STORAGE,source:e,fee:t,gas_limit:r,storage_limit:i,amount:s,destination:a}}));t.createDrainDelegateOperation=({consensus_key:e,delegate:t,destination:r})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.DRAIN_DELEGATE,consensus_key:e,delegate:t,destination:r}}));t.createBallotOperation=({source:e,proposal:t,ballot:r})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.BALLOT,source:e,proposal:t,ballot:r}}));t.createProposalsOperation=({source:e,proposals:t})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.PROPOSALS,source:e,proposals:t}}));t.createUpdateConsensusKeyOperation=({source:e,fee:t,gasLimit:r,storageLimit:i,pk:s})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.UPDATE_CONSENSUS_KEY,source:e,fee:t,gas_limit:r,storage_limit:i,pk:s}}));t.createSmartRollupAddMessagesOperation=({source:e,fee:t,gasLimit:r,storageLimit:i,message:s})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.SMART_ROLLUP_ADD_MESSAGES,source:e,fee:t,gas_limit:r,storage_limit:i,message:s}}));t.createSmartRollupOriginateOperation=({source:e,fee:t,gasLimit:r,storageLimit:i,pvmKind:s,kernel:a,originationProof:c,parametersType:u})=>n(void 0,void 0,void 0,(function*(){return{kind:o.OpKind.SMART_ROLLUP_ORIGINATE,source:e,fee:t,gas_limit:r,storage_limit:i,pvm_kind:s,kernel:a,origination_proof:c,parameters_ty:u}}))},1151:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcContractProvider=void 0;const i=r(5543),o=r(8899),s=r(6368),a=r(4632),c=r(227),u=r(150),l=r(9785),f=r(6646),d=r(5544),h=r(2342),p=r(1846),b=r(1863),m=r(6700),g=r(22),v=r(8983),y=r(106),_=r(3729),w=r(738),E=r(7279),O=r(4384),S=r(2864),A=r(5847),P=r(6003),T=r(3793);class R extends P.Provider{constructor(e,t){super(e),this.estimator=t,this.contractProviderTypeSymbol=Symbol.for("taquito-contract-provider-type-symbol"),this.prepare=new T.PrepareProvider(this.context)}getStorage(e,t){return n(this,void 0,void 0,(function*(){const r=a.validateContractAddress(e);if(r!==a.ValidationResult.VALID)throw new c.InvalidContractAddressError(e,a.invalidDetail(r));const n=yield this.context.readProvider.getScript(e,"head");let i;return t||(t=n),i=o.Schema.isSchema(t)?t:o.Schema.fromRPCResponse({script:t}),i.Execute(n.storage,g.smartContractAbstractionSemantic(this))}))}getBigMapKey(e,t,r){return n(this,void 0,void 0,(function*(){const n=a.validateContractAddress(e);if(n!==a.ValidationResult.VALID)throw new c.InvalidContractAddressError(e,a.invalidDetail(n));let i;r||(r=(yield this.rpc.getContract(e)).script),i=o.Schema.isSchema(r)?r:o.Schema.fromRPCResponse({script:r});const s=i.EncodeBigMapKey(t),u=yield this.rpc.getBigMapKey(e,s);return i.ExecuteOnBigMapValue(u)}))}getBigMapKeyByID(e,t,r,i){return n(this,void 0,void 0,(function*(){const{key:n,type:o}=r.EncodeBigMapKey(t),{packed:s}=yield this.context.packer.packData({data:n,type:o}),c=a.encodeExpr(s),u=i?yield this.context.readProvider.getBigMapValue({id:e.toString(),expr:c},i):yield this.context.readProvider.getBigMapValue({id:e.toString(),expr:c},"head");return r.ExecuteOnBigMapValue(u,g.smartContractAbstractionSemantic(this))}))}getBigMapKeysByID(e,t,r,i,s=5){return n(this,void 0,void 0,(function*(){const n=yield this.getBlockForRequest(t,i),a=new o.MichelsonMap;let c=0,u=[];for(;c<t.length;){const i=t.slice(c,c+s).map((t=>this.getBigMapValueOrUndefined(t,e,r,n)));u=[...u,...yield Promise.all(i)],c+=s}for(let e=0;e<u.length;e++)a.set(t[e],u[e]);return a}))}getBlockForRequest(e,t){return n(this,void 0,void 0,(function*(){return 1===e.length||void 0!==t?t:yield this.context.readProvider.getBlockLevel("head")}))}getBigMapValueOrUndefined(e,t,r,o){return n(this,void 0,void 0,(function*(){try{return yield this.getBigMapKeyByID(t,e,r,o)}catch(e){if(e instanceof i.HttpResponseError&&e.status===i.STATUS_CODE.NOT_FOUND)return;throw e}}))}getSaplingDiffByID(e,t){return n(this,void 0,void 0,(function*(){return t?yield this.context.readProvider.getSaplingDiffById({id:e.toString()},t):yield this.context.readProvider.getSaplingDiffById({id:e.toString()},"head")}))}originate(e){return n(this,void 0,void 0,(function*(){const t=yield this.estimate(e,this.estimator.originate.bind(this.estimator)),r=yield this.prepare.originate(Object.assign(Object.assign({},e),t)),n=r.opOb.contents.find((e=>e.kind===s.OpKind.ORIGINATION)),i=yield this.forge(r),{hash:o,context:a,forgedBytes:c,opResponse:u}=yield this.signAndInject(i);return new f.OriginationOperation(o,n,c,u,a,this)}))}setDelegate(e){var t;return n(this,void 0,void 0,(function*(){const r=a.validateAddress(e.source);if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,a.invalidDetail(r));const n=a.validateAddress(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.delegate,a.invalidDetail(n));if(/kt1/i.test(e.source))throw new m.InvalidDelegationSource(e.source);const i=yield this.signer.publicKeyHash(),o=e.source||i,u=yield this.estimate(e,this.estimator.setDelegate.bind(this.estimator)),f=yield this.prepare.delegation(Object.assign(Object.assign({},e),u)),d=f.opOb.contents.find((e=>e.kind===s.OpKind.DELEGATION)),h=yield this.forge(f),{hash:p,context:b,forgedBytes:g,opResponse:v}=yield this.signAndInject(h);return new l.DelegateOperation(p,d,o,g,v,b)}))}registerDelegate(e){return n(this,void 0,void 0,(function*(){const t=yield this.estimate(e,this.estimator.registerDelegate.bind(this.estimator)),r=yield this.signer.publicKeyHash(),n=yield this.prepare.registerDelegate(Object.assign(Object.assign({},e),t)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.DELEGATION)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:f}=yield this.signAndInject(o);return new l.DelegateOperation(a,i,r,u,f,c)}))}transfer(e){var t;return n(this,void 0,void 0,(function*(){const r=a.validateAddress(e.to);if(r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.to,a.invalidDetail(r));const n=a.validateAddress(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,a.invalidDetail(n));if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());const i=yield this.signer.publicKeyHash(),o=yield this.estimate(e,this.estimator.transfer.bind(this.estimator)),u=e.source||i,l=yield this.prepare.transaction(Object.assign(Object.assign({},e),o)),f=l.opOb.contents.find((e=>e.kind===s.OpKind.TRANSACTION)),d=yield this.forge(l),{hash:h,context:b,forgedBytes:m,opResponse:g}=yield this.signAndInject(d);return new p.TransactionOperation(h,f,u,m,g,b)}))}transferTicket(e){var t,r;return n(this,void 0,void 0,(function*(){const n=a.validateAddress(e.destination);if(n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.destination,a.invalidDetail(n));const i=a.validateAddress(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&i!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,a.invalidDetail(i));const o=yield this.signer.publicKeyHash(),u=null!==(r=e.source)&&void 0!==r?r:o,l=yield this.estimate(e,this.estimator.transferTicket.bind(this.estimator)),f=yield this.prepare.transferTicket(Object.assign(Object.assign({},e),l)),d=f.opOb.contents.find((e=>e.kind===s.OpKind.TRANSFER_TICKET)),h=yield this.forge(f),{hash:p,context:b,forgedBytes:m,opResponse:g}=yield this.signAndInject(h);return new v.TransferTicketOperation(p,d,u,m,g,b)}))}reveal(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimator.reveal(e);if(r){const i=yield this.estimate(e,(()=>n(this,void 0,void 0,(function*(){return r})))),o=yield this.prepare.reveal(Object.assign(Object.assign({},e),i)),a=o.opOb.contents.find((e=>e.kind===s.OpKind.REVEAL)),c=yield this.forge(o),{hash:u,context:l,forgedBytes:f,opResponse:d}=yield this.signAndInject(c);return new h.RevealOperation(u,a,t,f,d,l)}throw new m.RevealOperationError(`The publicKeyHash '${t}' has already been revealed.`)}))}registerGlobalConstant(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.registerGlobalConstant.bind(this.estimator)),n=yield this.prepare.registerGlobalConstant(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.REGISTER_GLOBAL_CONSTANT)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new d.RegisterGlobalConstantOperation(a,i,t,u,l,c)}))}increasePaidStorage(e){return n(this,void 0,void 0,(function*(){if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.increasePaidStorage.bind(this.estimator)),n=yield this.prepare.increasePaidStorage(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.INCREASE_PAID_STORAGE)),o=yield this.forge(n),{hash:a,context:u,forgedBytes:l,opResponse:f}=yield this.signAndInject(o);return new y.IncreasePaidStorageOperation(a,i,t,l,f,u)}))}drainDelegate(e){return n(this,void 0,void 0,(function*(){const t=yield this.prepare.drainDelegate(e),r=t.opOb.contents.find((e=>e.kind===s.OpKind.DRAIN_DELEGATE)),n=yield this.forge(t),{hash:i,context:o,forgedBytes:a,opResponse:c}=yield this.signAndInject(n);return new w.DrainDelegateOperation(i,r,a,c,o)}))}ballot(e){var t,r;return n(this,void 0,void 0,(function*(){const n=yield this.signer.publicKeyHash(),i=a.validateAddress(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&i!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,a.invalidDetail(i));const o=null!==(r=e.source)&&void 0!==r?r:n,u=yield this.prepare.ballot(Object.assign(Object.assign({},e),{source:o})),l=u.opOb.contents.find((e=>e.kind===s.OpKind.BALLOT)),f=yield this.forge(u),{hash:d,context:h,forgedBytes:p,opResponse:b}=yield this.signAndInject(f);return new _.BallotOperation(d,l,n,p,b,h)}))}proposals(e){var t,r;return n(this,void 0,void 0,(function*(){const n=yield this.signer.publicKeyHash(),i=a.validateAddress(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&i!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,a.invalidDetail(i));const o=null!==(r=e.source)&&void 0!==r?r:n,u=yield this.prepare.proposals(Object.assign(Object.assign({},e),{source:o})),l=u.opOb.contents.find((e=>e.kind===s.OpKind.PROPOSALS)),f=yield this.forge(u),{hash:d,context:h,forgedBytes:p,opResponse:b}=yield this.signAndInject(f);return new E.ProposalsOperation(d,l,n,p,b,h)}))}updateConsensusKey(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.updateConsensusKey.bind(this.estimator)),n=yield this.prepare.updateConsensusKey(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.UPDATE_CONSENSUS_KEY)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new O.UpdateConsensusKeyOperation(a,i,t,u,l,c)}))}smartRollupAddMessages(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.smartRollupAddMessages.bind(this.estimator)),n=yield this.prepare.smartRollupAddMessages(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.SMART_ROLLUP_ADD_MESSAGES)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new S.SmartRollupAddMessagesOperation(a,i,t,u,l,c)}))}smartRollupOriginate(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.smartRollupOriginate.bind(this.estimator)),n=yield this.rpc.getOriginationProof({kind:e.pvmKind,kernel:e.kernel}),i=Object.assign(Object.assign({},e),{originationProof:n}),o=yield this.prepare.smartRollupOriginate(Object.assign(Object.assign({},i),r)),a=o.opOb.contents.find((e=>e.kind===s.OpKind.SMART_ROLLUP_ORIGINATE)),c=yield this.forge(o),{hash:u,context:l,forgedBytes:f,opResponse:d}=yield this.signAndInject(c);return new A.SmartRollupOriginateOperation(u,a,t,f,d,l)}))}failingNoop(e){return n(this,void 0,void 0,(function*(){const t={kind:s.OpKind.FAILING_NOOP,arbitrary:e.arbitrary},r=yield this.context.readProvider.getBlockHash(e.basedOnBlock),n=yield this.context.forger.forge({branch:r,contents:[t]}),{prefixSig:i}=yield this.signer.sign(n,new Uint8Array([3]));return{signature:i,bytes:n,signedContent:{branch:r,contents:[{kind:s.OpKind.FAILING_NOOP,arbitrary:e.arbitrary}]}}}))}at(e,t=(e=>e)){return n(this,void 0,void 0,(function*(){const r=a.validateContractAddress(e);if(r!==a.ValidationResult.VALID)throw new c.InvalidContractAddressError(e,a.invalidDetail(r));const n=this.context.withExtensions().rpc,i=this.context.withExtensions().readProvider,o=yield i.getScript(e,"head"),s=yield i.getEntrypoints(e),u=new b.ContractAbstraction(e,o,this,this,s,n,i);return t(u,this.context)}))}batch(e){const t=new u.OperationBatch(this.context,this.estimator);return Array.isArray(e)&&t.with(e),t}}t.RpcContractProvider=R},5491:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SaplingStateAbstraction=void 0;t.SaplingStateAbstraction=class{constructor(e,t){this.id=e,this.provider=t}getSaplingDiff(e){return r(this,void 0,void 0,(function*(){return this.provider.getSaplingDiffByID(this.id.toString(),e)}))}getId(){return this.id.toString()}}},22:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smartContractAbstractionSemantic=void 0;const n=r(8899),i=r(5225),o=r(6391),s=r(5491);t.smartContractAbstractionSemantic=e=>({big_map:(t,r)=>{if(t&&"int"in t&&void 0!==t.int){const s=new n.Schema(r);return new i.BigMapAbstraction(new o.default(t.int),s,e)}return{}},sapling_state:t=>t&&"int"in t&&void 0!==t.int?new s.SaplingStateAbstraction(new o.default(t.int),e):{}})},120:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_LAMBDA=void 0;t.VIEW_LAMBDA={code:[{prim:"parameter",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},{prim:"unit"}]}]}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"UNIT"},{prim:"EXEC"}]]}],storage:"Unit"}},7642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RPCResponseError=t.ConfirmationTimeoutError=t.InvalidConfirmationCountError=void 0;const n=r(227);class i extends n.ParameterValidationError{constructor(e){super(),this.invalidConfirmations=e,this.name="InvalidConfirmationCountError",this.message=`Invalid confirmation count ${e} expecting at least 1`}}t.InvalidConfirmationCountError=i;class o extends n.NetworkError{constructor(e){super(),this.message=e,this.name="ConfirmationTimeoutError"}}t.ConfirmationTimeoutError=o;class s extends n.RpcError{constructor(e,t){super(),this.message=e,this.cause=t,this.name="RPCResponseError"}}t.RPCResponseError=s},1826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RevealEstimateError=void 0;const n=r(227);class i extends n.TaquitoError{constructor(){super(),this.name="RevealEstimateError",this.message="Public key is unknown, unable to estimate the reveal operation in Wallet API."}}t.RevealEstimateError=i},1243:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4705:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Estimate=void 0;const r=100;class n{constructor(e,t,r,n,i=100){this._milligasLimit=e,this._storageLimit=t,this.opSize=r,this.minimalFeePerStorageByteMutez=n,this.baseFeeMutez=i}get burnFeeMutez(){return this.roundUp(Number(this.storageLimit)*Number(this.minimalFeePerStorageByteMutez))}get storageLimit(){const e=Math.max(Number(this._storageLimit),0);return e>0?e:0}get gasLimit(){return this.roundUp(Number(this._milligasLimit)/1e3+100)}get operationFeeMutez(){return.1*(Number(this._milligasLimit)/1e3+100)+1*Number(this.opSize)}roundUp(e){return Math.ceil(Number(e))}get minimalFeeMutez(){return this.roundUp(r+this.operationFeeMutez)}get suggestedFeeMutez(){return this.roundUp(this.operationFeeMutez+200)}get usingBaseFeeMutez(){return Math.max(Number(this.baseFeeMutez),r)+this.roundUp(this.operationFeeMutez)}get totalCost(){return this.minimalFeeMutez+this.burnFeeMutez}get consumedMilligas(){return Number(this._milligasLimit)}static createEstimateInstanceFromProperties(e){let t,r=0,i=0,o=0,s=0;return e.forEach((e=>{r+=e.milligasLimit,i+=e.storageLimit,o+=e.opSize,s=Math.max(e.minimalFeePerStorageByteMutez,s),e.baseFeeMutez&&(t=t?t+e.baseFeeMutez:e.baseFeeMutez)})),new n(r,i,o,s,t)}static createArrayEstimateInstancesFromProperties(e){return e.map((e=>new n(e.milligasLimit,e.storageLimit,e.opSize,e.minimalFeePerStorageByteMutez,e.baseFeeMutez)))}}t.Estimate=n},8794: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.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4705),t),i(r(1243),t),i(r(4782),t),i(r(1826),t)},4782:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.RPCEstimateProvider=void 0;const o=r(835),s=r(807),a=r(4705),c=r(4632),u=r(1826),l=r(6003),f=r(2021),d=r(227);class h extends l.Provider{constructor(){super(...arguments),this.ALLOCATION_STORAGE=257,this.ORIGINATION_STORAGE=257,this.OP_SIZE_REVEAL=128,this.prepare=new f.PrepareProvider(this.context)}getKeys(){return n(this,void 0,void 0,(function*(){const e=this.context.isAnySignerConfigured();return{publicKeyHash:e?yield this.signer.publicKeyHash():yield this.context.walletProvider.getPKH(),publicKey:e?yield this.signer.publicKey():void 0}}))}getEstimationPropertiesFromOperationContent(e,t,r){const n=o.flattenOperationResult({contents:[e]});let i=0,a=0;return n.forEach((e=>{a+="originated_contracts"in e&&void 0!==e.originated_contracts?e.originated_contracts.length*this.ORIGINATION_STORAGE:0,a+="allocated_destination_contract"in e?this.ALLOCATION_STORAGE:0,i+=Number(e.consumed_milligas)||0,a+="paid_storage_size_diff"in e&&Number(e.paid_storage_size_diff)||0,a+="storage_size"in e&&"global_address"in e&&Number(e.storage_size)||0,a+="genesis_commitment_hash"in e?Number(e.size):0})),s.isOpWithFee(e)?{milligasLimit:i||0,storageLimit:Number(a||0),opSize:t,minimalFeePerStorageByteMutez:r.toNumber()}:{milligasLimit:0,storageLimit:0,opSize:t,minimalFeePerStorageByteMutez:r.toNumber(),baseFeeMutez:0}}calculateEstimates(e,t){return n(this,void 0,void 0,(function*(){const{opbytes:r,opOb:{branch:n,contents:i}}=yield this.forge(e),s={operation:{branch:n,contents:i},chain_id:yield this.context.readProvider.getChainId()},{opResponse:a}=yield this.simulate(s),{cost_per_byte:c}=t,u=[...o.flattenErrors(a,"backtracked"),...o.flattenErrors(a)];if(u.length)throw new o.TezosOperationError(u,"Error occurred during estimation");let l=1;return Array.isArray(e.opOb.contents)&&e.opOb.contents.length>1&&(l="reveal"===a.contents[0].kind?e.opOb.contents.length-1:e.opOb.contents.length),a.contents.map((e=>this.getEstimationPropertiesFromOperationContent(e,"reveal"===e.kind?this.OP_SIZE_REVEAL/2:r.length/2/l,c)))}))}originate(e){return n(this,void 0,void 0,(function*(){const t=yield this.prepare.originate(e),r=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.calculateEstimates(t,r);return"reveal"===t.opOb.contents[0].kind&&n.shift(),a.Estimate.createEstimateInstanceFromProperties(n)}))}transfer(e){var t,{fee:r,storageLimit:o,gasLimit:s}=e,u=i(e,["fee","storageLimit","gasLimit"]);return n(this,void 0,void 0,(function*(){const e=c.validateAddress(u.to);if(e!==c.ValidationResult.VALID)throw new d.InvalidAddressError(u.to,c.invalidDetail(e));const n=c.validateAddress(null!==(t=u.source)&&void 0!==t?t:"");if(u.source&&n!==c.ValidationResult.VALID)throw new d.InvalidAddressError(u.source,c.invalidDetail(n));if(u.amount<0)throw new d.InvalidAmountError(u.amount.toString());const i=yield this.prepare.transaction(Object.assign({fee:r,storageLimit:o,gasLimit:s},u)),l=yield this.context.readProvider.getProtocolConstants("head"),f=yield this.calculateEstimates(i,l);return"reveal"===i.opOb.contents[0].kind&&f.shift(),a.Estimate.createEstimateInstanceFromProperties(f)}))}transferTicket(e){var t,{fee:r,storageLimit:o,gasLimit:s}=e,u=i(e,["fee","storageLimit","gasLimit"]);return n(this,void 0,void 0,(function*(){const e=c.validateAddress(u.destination);if(e!==c.ValidationResult.VALID)throw new d.InvalidAddressError(u.destination,c.invalidDetail(e));const n=c.validateAddress(null!==(t=u.source)&&void 0!==t?t:"");if(u.source&&n!==c.ValidationResult.VALID)throw new d.InvalidAddressError(u.source,c.invalidDetail(n));const i=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.prepare.transferTicket(Object.assign({fee:r,storageLimit:o,gasLimit:s},u)),f=yield this.calculateEstimates(l,i);return"reveal"===l.opOb.contents[0].kind&&f.shift(),a.Estimate.createEstimateInstanceFromProperties(f)}))}setDelegate(e){var t,{fee:r,gasLimit:o,storageLimit:s}=e,u=i(e,["fee","gasLimit","storageLimit"]);return n(this,void 0,void 0,(function*(){const e=c.validateAddress(u.source);if(u.source&&e!==c.ValidationResult.VALID)throw new d.InvalidAddressError(u.source,c.invalidDetail(e));const n=c.validateAddress(null!==(t=u.delegate)&&void 0!==t?t:"");if(u.delegate&&n!==c.ValidationResult.VALID)throw new d.InvalidAddressError(u.delegate,c.invalidDetail(n));const i=yield this.prepare.delegation(Object.assign({fee:r,storageLimit:s,gasLimit:o},u)),l=yield this.context.readProvider.getProtocolConstants("head"),f=yield this.calculateEstimates(i,l);return"reveal"===i.opOb.contents[0].kind&&f.shift(),a.Estimate.createEstimateInstanceFromProperties(f)}))}batch(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.batch(e),n=yield this.calculateEstimates(r,t);return a.Estimate.createArrayEstimateInstancesFromProperties(n)}))}registerDelegate(e,t){var{fee:r,storageLimit:o,gasLimit:s}=e,c=i(e,["fee","storageLimit","gasLimit"]);return n(this,void 0,void 0,(function*(){const e=(yield this.getKeys()).publicKeyHash,n=yield this.context.readProvider.getProtocolConstants("head"),i=t||e,u=yield this.prepare.registerDelegate(Object.assign({fee:r,storageLimit:o,gasLimit:s},c),i),l=yield this.calculateEstimates(u,n);return"reveal"===u.opOb.contents[0].kind&&l.shift(),a.Estimate.createEstimateInstanceFromProperties(l)}))}reveal(e){return n(this,void 0,void 0,(function*(){const{publicKeyHash:t,publicKey:r}=yield this.getKeys();if(!r)throw new u.RevealEstimateError;if(yield this.isAccountRevealRequired(t)){const t=yield this.context.readProvider.getProtocolConstants("head"),r=e?yield this.prepare.reveal(e):yield this.prepare.reveal({}),n=yield this.calculateEstimates(r,t);return a.Estimate.createEstimateInstanceFromProperties(n)}}))}registerGlobalConstant(e){var{fee:t,storageLimit:r,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);return n(this,void 0,void 0,(function*(){const e=yield this.prepare.registerGlobalConstant(Object.assign({fee:t,storageLimit:r,gasLimit:o},s)),n=yield this.context.readProvider.getProtocolConstants("head"),i=yield this.calculateEstimates(e,n);return"reveal"===e.opOb.contents[0].kind&&i.shift(),a.Estimate.createEstimateInstanceFromProperties(i)}))}increasePaidStorage(e){var{fee:t,storageLimit:r,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);return n(this,void 0,void 0,(function*(){if(s.amount<0)throw new d.InvalidAmountError(s.amount.toString());const e=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.prepare.increasePaidStorage(Object.assign({fee:t,storageLimit:r,gasLimit:o},s)),i=yield this.calculateEstimates(n,e);return"reveal"===n.opOb.contents[0].kind&&i.shift(),a.Estimate.createEstimateInstanceFromProperties(i)}))}updateConsensusKey(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.updateConsensusKey(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&n.shift(),a.Estimate.createEstimateInstanceFromProperties(n)}))}smartRollupAddMessages(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.smartRollupAddMessages(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&n.shift(),a.Estimate.createEstimateInstanceFromProperties(n)}))}smartRollupOriginate(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.smartRollupOriginate(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&n.shift(),a.Estimate.createEstimateInstanceFromProperties(n)}))}contractCall(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.contractCall(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&n.shift(),a.Estimate.createEstimateInstanceFromProperties(n)}))}}t.RPCEstimateProvider=h},7336:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeForger=void 0;const i=r(3557);t.CompositeForger=class{constructor(e){if(this.forgers=e,0===e.length)throw new i.UnspecifiedForgerError}forge({branch:e,contents:t}){return n(this,void 0,void 0,(function*(){const r=yield Promise.all(this.forgers.map((r=>r.forge({branch:e,contents:t}))));if(0===r.length)throw new i.UnspecifiedForgerError;let n=r.pop();for(;r.length;){const e=r.pop();if(e!==n)throw new i.ForgingMismatchError([n,e]);n=e}return n}))}}},3557:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnspecifiedForgerError=t.ForgingMismatchError=void 0;const n=r(227);class i extends n.TaquitoError{constructor(e){super(),this.results=e,this.name="ForgingMismatchError",this.message="Forging mismatch error"}}t.ForgingMismatchError=i;class o extends n.TezosToolkitConfigError{constructor(){super(),this.name="UnspecifiedForgerError",this.message="No forger has been configured. Please configure new CompositeForger([rpcForger, localForger]) with your TezosToolkit instance."}}t.UnspecifiedForgerError=o},794:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RpcForger=void 0;t.RpcForger=class{constructor(e){this.context=e}forge({branch:e,contents:t}){return this.context.rpc.forgeOperations({branch:e,contents:t})}}},6713:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TaquitoLocalForger=void 0;const i=r(5078);t.TaquitoLocalForger=class{constructor(e){this.context=e}getNextProto(){return n(this,void 0,void 0,(function*(){if(!this.context.proto){const e=yield this.context.readProvider.getNextProtocol("head");this.context.proto=e}return this.context.proto}))}forge({branch:e,contents:t}){return n(this,void 0,void 0,(function*(){return new i.LocalForger(yield this.getNextProto()).forge({branch:e,contents:t})}))}}},5505:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGlobalConstantsProvider=void 0;const i=r(3739);t.DefaultGlobalConstantsProvider=class{constructor(){this._globalConstantsLibrary={}}loadGlobalConstant(e){for(const t in e)Object.assign(this._globalConstantsLibrary,{[t]:e[t]})}getGlobalConstantByHash(e){return n(this,void 0,void 0,(function*(){const t=this._globalConstantsLibrary[e];if(!t)throw new i.GlobalConstantNotFound(e);return t}))}}},3739:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnconfiguredGlobalConstantsProviderError=t.GlobalConstantNotFound=void 0;const n=r(227);class i extends n.TaquitoError{constructor(e){super(),this.hash=e,this.name="GlobalConstantNotFound",this.message=`Please load the value associated with the constant ${e} using the loadGlobalConstant method of the DefaultGlobalConstantsProvider.`}}t.GlobalConstantNotFound=i;class o extends n.TezosToolkitConfigError{constructor(){super(),this.name="UnconfiguredGlobalConstantsProviderError",this.message="No global constants provider has been configured. Please configure one by calling setGlobalConstantsProvider({globalConstantsProvider}) on your TezosToolkit instance."}}t.UnconfiguredGlobalConstantsProviderError=o},3171:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9494:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopGlobalConstantsProvider=void 0;const i=r(3739);t.NoopGlobalConstantsProvider=class{getGlobalConstantByHash(e){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredGlobalConstantsProviderError}))}}},5180:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatErrorMessage=void 0;const n=r(5543);t.formatErrorMessage=function(e,t){const r=JSON.parse(e.body);if(r[0]&&r[0].kind&&r[0].msg){const i=JSON.stringify({kind:r[0].kind,id:r[0].id,msg:r[0].msg.replace(t,"")});return new n.HttpResponseError(`Http error response: (${e.status}) ${i}`,e.status,e.statusText,i,e.url)}return e}},134:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5744:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcInjector=void 0;const i=r(5180),o=r(5543);t.RpcInjector=class{constructor(e){this.context=e}inject(e){return n(this,void 0,void 0,(function*(){let t;try{t=yield this.context.rpc.injectOperation(e)}catch(e){const t=". You may want to use --replace to provide adequate fee and replace it";throw e instanceof o.HttpResponseError&&e.message.includes(t)?i.formatErrorMessage(e,t):e}return t}))}}},3729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BallotOperation=void 0;const n=r(8361);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"ballot"===e.kind));return e||void 0}get period(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.period}get proposal(){return this.params.proposal}get ballot(){return this.params.ballot}}t.BallotOperation=i},3650:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BatchOperation=void 0;const n=r(6391),i=r(150),o=r(835),s=r(8361),a=r(807);class c extends s.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}sumProp(e,t){return e.reduce(((e,r)=>t in r?Number(r[t])+e:e),0)}getOriginatedContractAddresses(){const e=this.results.filter((e=>"origination"===e.kind));let t=[];for(const r of e)r.metadata.operation_result.originated_contracts&&(t=[...t,...r.metadata.operation_result.originated_contracts]);return t}get status(){return this.results.filter((e=>-1!==i.BATCH_KINDS.indexOf(e.kind))).map((e=>{if(a.hasMetadataWithResult(e)){return e.metadata.operation_result.status}return"unknown"}))[0]||"unknown"}get fee(){return this.sumProp(this.params,"fee")}get gasLimit(){return this.sumProp(this.params,"gas_limit")}get storageLimit(){return this.sumProp(this.params,"storage_limit")}get consumedGas(){return n.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.default.ROUND_UP}),new n.default(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(o.flattenOperationResult({contents:this.results}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(o.flattenOperationResult({contents:this.results}),"paid_storage_size_diff"))}get errors(){return o.flattenErrors({contents:this.results})}}t.BatchOperation=c},9785:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelegateOperation=void 0;const n=r(6391),i=r(8361);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"delegation"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get delegate(){return this.params.delegate}get isRegisterOperation(){return this.delegate===this.source}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),this.consumedMilliGas?new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.DelegateOperation=o},738:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DrainDelegateOperation=void 0;const n=r(8361);class i extends n.Operation{constructor(e,t,r,n,i){super(e,r,n,i),this.params=t}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"drain_delegate"===e.kind)),t=e&&e.metadata&&e.metadata.balance_updates;return t||void 0}get consensusKey(){return this.params.consensus_key}get delegate(){return this.params.delegate}get destination(){return this.params.destination}}t.DrainDelegateOperation=i},835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidEstimateValueError=t.OriginationOperationError=t.flattenErrors=t.flattenOperationResult=t.TezosPreapplyFailureError=t.TezosOperationError=void 0;const n=r(227),i=r(807);class o extends n.RpcError{constructor(e,t){super(),this.errors=e,this.errorDetails=t,this.name="TezosOperationError";const r=e[e.length-1];this.id=r.id,this.kind=r.kind,this.message=`(${this.kind}) ${this.id}`,"with"in r&&(r.with.string?this.message=r.with.string:r.with.int?this.message=r.with.int:this.message=JSON.stringify(r.with))}}t.TezosOperationError=o;class s extends Error{constructor(e){super(),this.result=e,this.name="TezosPreapplyFailureError",this.message="Preapply returned an unexpected result"}}t.TezosPreapplyFailureError=s;t.flattenOperationResult=e=>{const t=Array.isArray(e)?e:[e],r=[];for(let e=0;e<t.length;e++)for(let n=0;n<t[e].contents.length;n++){const o=t[e].contents[n];i.hasMetadataWithResult(o)&&"fee"in o&&(r.push(Object.assign({fee:o.fee},o.metadata.operation_result)),Array.isArray(o.metadata.internal_operation_results)&&o.metadata.internal_operation_results.forEach((e=>r.push(e.result))))}return r};t.flattenErrors=(e,t="failed")=>{const r=Array.isArray(e)?e:[e];let n=[];for(let e=0;e<r.length;e++)for(let o=0;o<r[e].contents.length;o++){const s=r[e].contents[o];if(i.hasMetadata(s)&&(i.hasMetadataWithResult(s)&&s.metadata.operation_result.status===t&&(n=n.concat(s.metadata.operation_result.errors||[])),i.hasMetadataWithInternalOperationResult(s)&&Array.isArray(s.metadata.internal_operation_results)))for(const e of s.metadata.internal_operation_results)"result"in e&&e.result.status===t&&(n=n.concat(e.result.errors||[]))}return n};class a extends n.TaquitoError{constructor(e){super(),this.message=e,this.name="OriginationOperationError"}}t.OriginationOperationError=a;class c extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidEstimateValueError"}}t.InvalidEstimateValueError=c},106:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IncreasePaidStorageOperation=void 0;const n=r(8361);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"increase_paid_storage"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get amount(){return this.params.amount}get destination(){return this.params.destination}}t.IncreasePaidStorageOperation=i},3323:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Operation=t.DrainDelegateOperation=t.BallotOperation=t.TransactionOperation=t.OriginationOperation=t.DelegateOperation=t.BatchOperation=t.InvalidEstimateValueError=t.TezosPreapplyFailureError=t.TezosOperationError=t.OpKind=void 0;var n=r(807);Object.defineProperty(t,"OpKind",{enumerable:!0,get:function(){return n.OpKind}});var i=r(835);Object.defineProperty(t,"TezosOperationError",{enumerable:!0,get:function(){return i.TezosOperationError}}),Object.defineProperty(t,"TezosPreapplyFailureError",{enumerable:!0,get:function(){return i.TezosPreapplyFailureError}}),Object.defineProperty(t,"InvalidEstimateValueError",{enumerable:!0,get:function(){return i.InvalidEstimateValueError}});var o=r(3650);Object.defineProperty(t,"BatchOperation",{enumerable:!0,get:function(){return o.BatchOperation}});var s=r(9785);Object.defineProperty(t,"DelegateOperation",{enumerable:!0,get:function(){return s.DelegateOperation}});var a=r(6646);Object.defineProperty(t,"OriginationOperation",{enumerable:!0,get:function(){return a.OriginationOperation}});var c=r(1846);Object.defineProperty(t,"TransactionOperation",{enumerable:!0,get:function(){return c.TransactionOperation}});var u=r(3729);Object.defineProperty(t,"BallotOperation",{enumerable:!0,get:function(){return u.BallotOperation}});var l=r(738);Object.defineProperty(t,"DrainDelegateOperation",{enumerable:!0,get:function(){return l.DrainDelegateOperation}});var f=r(8361);Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return f.Operation}})},8361:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Operation=void 0;const i=r(977),o=r(9002),s=r(807),a=r(4632),c=r(552),u=r(7642),l=r(227);t.Operation=class{constructor(e,t,r,n){if(this.hash=e,this.raw=t,this.results=r,this.context=n,this._pollingConfig$=new i.ReplaySubject(1),this.currentHead$=this._pollingConfig$.pipe(o.switchMap((e=>new i.BehaviorSubject(e).pipe(o.timeout({each:1e3*e.timeout,with:()=>i.throwError((()=>new u.ConfirmationTimeoutError("Confirmation polling timed out")))})))),o.switchMap((()=>i.defer((()=>c.createObservableFromSubscription(this.context.stream.subscribeBlock("head")))).pipe(o.switchMap((e=>{var t,r;const n=null!==(r=null===(t=this.lastHead)||void 0===t?void 0:t.header.level)&&void 0!==r?r:e.header.level-1;return i.range(n+1,e.header.level-n-1).pipe(o.concatMap((e=>this.context.readProvider.getBlock(e))),o.endWith(e))})),o.tap((e=>this.lastHead=e))))),o.shareReplay({refCount:!0})),this.confirmed$=this.currentHead$.pipe(o.map((e=>{for(let t=3;t>=0;t--)e.operations[t].forEach((t=>{t.hash===this.hash&&(this._foundAt=e.header.level)}));if(e.header.level-this._foundAt>=0)return this._foundAt})),o.filter((e=>void 0!==e)),o.first(),o.shareReplay()),this._foundAt=Number.POSITIVE_INFINITY,a.validateOperation(this.hash)!==a.ValidationResult.VALID)throw new l.InvalidOperationHashError(this.hash);this.confirmed$.pipe(o.first(),o.catchError((()=>i.of(i.EMPTY)))).subscribe()}get includedInBlock(){return this._foundAt}get revealOperation(){return Array.isArray(this.results)&&this.results.find((e=>"reveal"===e.kind))}get revealStatus(){return this.revealOperation?this.revealOperation.metadata.operation_result.status:"unknown"}get status(){return this.results.map((e=>s.hasMetadataWithResult(e)?e.metadata.operation_result.status:"unknown"))[0]||"unknown"}confirmation(e,t){return n(this,void 0,void 0,(function*(){if(void 0!==e&&e<1)throw new u.InvalidConfirmationCountError(e);const{defaultConfirmationCount:r,confirmationPollingTimeoutSecond:n}=this.context.config;this._pollingConfig$.next({timeout:t||n});const i=void 0!==e?e:r;return new Promise(((e,t)=>{this.confirmed$.pipe(o.switchMap((()=>this.currentHead$)),o.filter((e=>e.header.level-this._foundAt>=i-1)),o.first()).subscribe((t=>{e(this._foundAt+(i-1))}),t)}))}))}}},6646:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OriginationOperation=void 0;const i=r(6391),o=r(835),s=r(8361),a=r(807);class c extends s.Operation{constructor(e,t,r,n,i,o){super(e,r,n,i),this.params=t,this.contractProvider=o;const s=this.operationResults&&this.operationResults.originated_contracts;Array.isArray(s)&&(this.contractAddress=s[0])}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"origination"===e.kind)),t=e&&a.hasMetadataWithResult(e)&&e.metadata.operation_result;return t||void 0}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get storageDiff(){const e=this.operationResults&&this.operationResults.paid_storage_size_diff;return e||void 0}get storageSize(){const e=this.operationResults&&this.operationResults.storage_size;return e||void 0}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}contract(e,t){return n(this,void 0,void 0,(function*(){if(!this.contractAddress)throw new o.OriginationOperationError("No contract was originated in this operation");return yield this.confirmation(e,t),this.contractProvider.at(this.contractAddress)}))}}t.OriginationOperation=c},7279:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProposalsOperation=void 0;const n=r(8361);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"proposals"===e.kind));return e||void 0}get proposals(){return this.params.proposals}get period(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.period}}t.ProposalsOperation=i},5544:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RegisterGlobalConstantOperation=void 0;const n=r(6391),i=r(8361);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r,this.globalConstantHash=this.operationResults&&this.operationResults.global_address}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"register_global_constant"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get registeredExpression(){return this.params.value}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),this.consumedMilliGas?new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}}t.RegisterGlobalConstantOperation=o},2342:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RevealOperation=void 0;const n=r(6391),i=r(835),o=r(8361);class s extends o.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"reveal"===e.kind));return e?[e]:[]}get status(){const e=this.operationResults[0];return e?e.metadata.operation_result.status:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get publicKey(){return this.params.public_key}sumProp(e,t){return e.reduce(((e,r)=>t in r?Number(r[t])+e:e),0)}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(i.flattenOperationResult({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(i.flattenOperationResult({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp(i.flattenOperationResult({contents:this.operationResults}),"storage_size"))}get errors(){return i.flattenErrors({contents:this.operationResults})}}t.RevealOperation=s},2864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartRollupAddMessagesOperation=void 0;const n=r(8361);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"smart_rollup_add_messages"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get message(){return this.params.message}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.SmartRollupAddMessagesOperation=i},5847:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartRollupOriginateOperation=void 0;const n=r(6368),i=r(8361);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>e.kind===n.OpKind.SMART_ROLLUP_ORIGINATE)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get pvmKind(){return this.params.pvm_kind}get kernel(){return this.params.kernel}get originationProof(){return this.params.origination_proof}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.SmartRollupOriginateOperation=o},1846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionOperation=void 0;const n=r(6391),i=r(835),o=r(8361);class s extends o.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"transaction"===e.kind));return e?[e]:[]}get status(){const e=this.operationResults[0];return e?e.metadata.operation_result.status:"unknown"}get amount(){return new n.default(this.params.amount)}get destination(){return this.params.destination}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}sumProp(e,t){return e.reduce(((e,r)=>t in r?Number(r[t])+e:e),0)}get consumedGas(){return n.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.default.ROUND_UP}),new n.default(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(i.flattenOperationResult({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(i.flattenOperationResult({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp(i.flattenOperationResult({contents:this.operationResults}),"storage_size"))}get errors(){return i.flattenErrors({contents:this.operationResults})}}t.TransactionOperation=s},8983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransferTicketOperation=void 0;const n=r(6368),i=r(6391),o=r(3323);class s extends o.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>e.kind===n.OpKind.TRANSFER_TICKET)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}}t.TransferTicketOperation=s},807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasMetadataWithInternalOperationResult=t.hasMetadataWithResult=t.hasMetadata=t.isSourceOp=t.isOpRequireReveal=t.isOpWithFee=t.isKind=t.findWithKind=t.attachKind=t.OpKind=void 0;var n=r(6368);Object.defineProperty(t,"OpKind",{enumerable:!0,get:function(){return n.OpKind}});t.attachKind=(e,t)=>Object.assign(Object.assign({},e),{kind:t});t.findWithKind=(e,r)=>{if(Array.isArray(e)){const n=e.find((e=>e.kind===r));if(n&&t.isKind(n,r))return n}};t.isKind=(e,t)=>e.kind===t;t.isOpWithFee=e=>-1!==["transaction","delegation","origination","reveal","register_global_constant","increase_paid_storage","tx_rollup_origination","tx_rollup_submit_batch","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate"].indexOf(e.kind);t.isOpRequireReveal=e=>-1!==["transaction","delegation","origination","register_global_constant","increase_paid_storage","tx_rollup_origination","tx_rollup_submit_batch","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate"].indexOf(e.kind);t.isSourceOp=e=>-1!==["transaction","delegation","origination","reveal","ballot"].indexOf(e.kind);t.hasMetadata=e=>"metadata"in e;t.hasMetadataWithResult=e=>t.hasMetadata(e)&&"operation_result"in e.metadata;t.hasMetadataWithInternalOperationResult=e=>t.hasMetadata(e)&&"internal_operation_results"in e.metadata},4384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UpdateConsensusKeyOperation=void 0;const n=r(8361);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"update_consensus_key"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get pk(){return this.params.pk}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.UpdateConsensusKeyOperation=i},4762:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9406:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.MichelCodecPacker=void 0;const i=r(9985);t.MichelCodecPacker=class{packData(e){return n(this,void 0,void 0,(function*(){const{bytes:t}=i.packDataBytes(e.data,e.type);return{packed:t}}))}}},6395:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcPacker=void 0;t.RpcPacker=class{constructor(e){this.context=e}packData(e){return r(this,void 0,void 0,(function*(){return this.context.rpc.packData(e)}))}}},9813:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5286:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.MichelCodecParser=void 0;const i=r(9985),o=r(6700),s=r(8899);t.MichelCodecParser=class{constructor(e){this.context=e}getNextProto(){return n(this,void 0,void 0,(function*(){if(!this.context.proto){const e=yield this.context.readProvider.getNextProtocol("head");this.context.proto=e}return this.context.proto}))}parseScript(e){return n(this,void 0,void 0,(function*(){return new i.Parser({protocol:yield this.getNextProto()}).parseScript(e)}))}parseMichelineExpression(e){return n(this,void 0,void 0,(function*(){return new i.Parser({protocol:yield this.getNextProto()}).parseMichelineExpression(e)}))}parseJSON(e){return n(this,void 0,void 0,(function*(){return new i.Parser({protocol:yield this.getNextProto()}).parseJSON(e)}))}prepareCodeOrigination(e){return n(this,void 0,void 0,(function*(){const t=e;if(t.code=yield this.formatCodeParam(e.code),e.init)t.init=yield this.formatInitParam(e.init);else if(e.storage){const r=t.code.find((e=>"prim"in e&&"storage"===e.prim));if(!(null==r?void 0:r.args))throw new o.InvalidCodeParameter("The storage section is missing from the script",e.code);const n=new s.Schema(r.args[0]),a=yield this.findGlobalConstantsHashAndValue(n);if(0!==Object.keys(a).length){const n=new i.Parser({expandGlobalConstant:a}).parseJSON(r.args[0]),o=new s.Schema(n);t.init=o.Encode(e.storage)}else t.init=n.Encode(e.storage);delete t.storage}return t}))}formatCodeParam(e){return n(this,void 0,void 0,(function*(){let t;if("string"==typeof e){const r=yield this.parseScript(e);if(null===r)throw new o.InvalidCodeParameter("Unable to parse",e);t=r}else{const r=yield this.parseJSON(e),n=["parameter","storage","code"];t=r.sort(((e,t)=>n.indexOf(e.prim)-n.indexOf(t.prim)))}return t}))}formatInitParam(e){return n(this,void 0,void 0,(function*(){let t;if("string"==typeof e){const r=yield this.parseMichelineExpression(e);if(null===r)throw new o.InvalidInitParameter("Invalid init parameter",e);t=r}else t=yield this.parseJSON(e);return t}))}findGlobalConstantsHashAndValue(e){return n(this,void 0,void 0,(function*(){const t=e.findToken("constant"),r={};if(0!==t.length)for(const e of t){const t=e.tokenVal.args;if(t){const e=t[0];if(e.string){const t=e.string,n=yield this.context.globalConstantsProvider.getGlobalConstantByHash(t);Object.assign(r,{[t]:n})}}}return r}))}}},3259:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopParser=void 0;t.NoopParser=class{prepareCodeOrigination(e){return r(this,void 0,void 0,(function*(){return e}))}}},3793: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.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8078),t),i(r(2021),t)},8078:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2021:function(e,t,r){"use strict";var n,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__classPrivateFieldSet||function(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r},s=this&&this.__classPrivateFieldGet||function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},a=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.PrepareProvider=void 0;const c=r(6368),u=r(807),l=r(4593),f=r(7642),d=r(227),h=r(238),p=r(6003),b=r(6391),m=(e,t)=>{var r,n,i;return{fee:null!==(r=e.fee)&&void 0!==r?r:t.fee,gasLimit:null!==(n=e.gasLimit)&&void 0!==n?n:t.gasLimit,storageLimit:null!==(i=e.storageLimit)&&void 0!==i?i:t.storageLimit}};class g extends p.Provider{constructor(e){super(e),this.context=e,n.set(this,void 0),o(this,n,{})}getBlockHash(e){return i(this,void 0,void 0,(function*(){return this.context.readProvider.getBlockHash(null!=e?e:"head~2")}))}getProtocolHash(){return i(this,void 0,void 0,(function*(){return this.context.readProvider.getNextProtocol("head")}))}getHeadCounter(e){var t;return i(this,void 0,void 0,(function*(){return null!==(t=this.context.readProvider.getCounter(e,"head"))&&void 0!==t?t:"0"}))}adjustGasForBatchOperation(e,t,r){return b.default.min(t,e.div(r+1))}getAccountLimits(e,t,r){return i(this,void 0,void 0,(function*(){const n=yield this.context.readProvider.getBalance(e,"head"),{hard_gas_limit_per_operation:i,hard_gas_limit_per_block:o,hard_storage_limit_per_operation:s,cost_per_byte:a}=t;return{fee:0,gasLimit:r?Math.floor(this.adjustGasForBatchOperation(o,i,r).toNumber()):i.toNumber(),storageLimit:Math.floor(b.default.min(n.dividedBy(a),s).toNumber())}}))}getFee(e,t,r){(!s(this,n)[t]||s(this,n)[t]<r)&&(s(this,n)[t]=r);return{counter:`${++s(this,n)[t]}`,fee:void 0===e.fee?"0":`${e.fee}`,gas_limit:void 0===e.gas_limit?"0":`${e.gas_limit}`,storage_limit:void 0===e.storage_limit?"0":`${e.storage_limit}`}}getSource(e,t,r){return{source:void 0===e.source?r||t:e.source}}addRevealOperationIfNeeded(e,t){return i(this,void 0,void 0,(function*(){if(u.isOpRequireReveal(e)){const r=[e],{publicKey:n,pkh:i}=yield this.getKeys();if(yield this.isAccountRevealRequired(t)){if(!n)throw new d.PublicKeyNotFoundError(i);return r.unshift(yield h.createRevealOperation({fee:l.DEFAULT_FEE.REVEAL,storageLimit:l.DEFAULT_STORAGE_LIMIT.REVEAL,gasLimit:l.getRevealGasLimit(i)},t,n)),r}}return e}))}getKeys(){return i(this,void 0,void 0,(function*(){const e=this.context.isAnySignerConfigured();return{pkh:e?yield this.signer.publicKeyHash():yield this.context.walletProvider.getPKH(),publicKey:e?yield this.signer.publicKey():void 0}}))}convertIntoArray(e){return Array.isArray(e)?[...e]:[e]}constructOpContents(e,t,r,n,i){return e.map((e=>{switch(e.kind){case c.OpKind.ACTIVATION:case c.OpKind.DRAIN_DELEGATE:return Object.assign({},e);case c.OpKind.ORIGINATION:return Object.assign(Object.assign(Object.assign(Object.assign({},e),{balance:void 0!==e.balance?`${e.balance}`:"0"}),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.TRANSACTION:{const i=Object.assign(Object.assign(Object.assign(Object.assign({},e),{amount:void 0!==e.amount?`${e.amount}`:"0"}),this.getSource(e,r,n)),this.getFee(e,r,t));if(i.source.toLowerCase().startsWith("kt1"))throw new d.DeprecationError(`KT1 addresses are not supported as source since ${l.Protocols.PsBabyM1}`);return i}case c.OpKind.REVEAL:case c.OpKind.DELEGATION:case c.OpKind.REGISTER_GLOBAL_CONSTANT:case c.OpKind.UPDATE_CONSENSUS_KEY:case c.OpKind.SMART_ROLLUP_ADD_MESSAGES:case c.OpKind.SMART_ROLLUP_ORIGINATE:return Object.assign(Object.assign(Object.assign({},e),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.TRANSFER_TICKET:return Object.assign(Object.assign(Object.assign(Object.assign({},e),{ticket_amount:`${e.ticket_amount}`}),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.INCREASE_PAID_STORAGE:return Object.assign(Object.assign(Object.assign(Object.assign({},e),{amount:`${e.amount}`}),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.BALLOT:case c.OpKind.PROPOSALS:if(void 0===i)throw new f.RPCResponseError("Failed to get the current voting period index");return Object.assign(Object.assign({},e),{period:null==i?void 0:i.voting_period.index});default:throw new d.InvalidOperationKindError(e.kind)}}))}activate({pkh:e,secret:t}){return i(this,void 0,void 0,(function*(){const r=yield h.createActivationOperation({pkh:e,secret:t}),i=this.convertIntoArray(r),s=yield this.getBlockHash(),a=yield this.getProtocolHash();o(this,n,{});const c=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:s,contents:this.constructOpContents(i,c,e),protocol:a},counter:c}}))}reveal({fee:e,gasLimit:t,storageLimit:r}){return i(this,void 0,void 0,(function*(){const{pkh:i,publicKey:s}=yield this.getKeys();if(!s)throw new d.PublicKeyNotFoundError(i);const a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getAccountLimits(i,a),u=m({fee:e,storageLimit:r,gasLimit:t},c),l=yield h.createRevealOperation({fee:u.fee,gasLimit:u.gasLimit,storageLimit:u.storageLimit},i,s),f=this.convertIntoArray(l),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{});const g=parseInt(yield this.getHeadCounter(i),10);return{opOb:{branch:p,contents:this.constructOpContents(f,g,i),protocol:b},counter:g}}))}originate(e,t){var{fee:r,storageLimit:s,gasLimit:c}=e,u=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),l=yield h.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign(Object.assign({},u),m({fee:r,storageLimit:s,gasLimit:c},a)))),f=yield this.addRevealOperationIfNeeded(l,e),d=this.convertIntoArray(f),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{});const g=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:p,contents:this.constructOpContents(d,g,e,t),protocol:b},counter:g}}))}transaction(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),u=yield h.createTransferOperation(Object.assign(Object.assign({},c),m({fee:t,storageLimit:r,gasLimit:s},a))),l=yield this.addRevealOperationIfNeeded(u,e),f=this.convertIntoArray(l),d=yield this.getBlockHash(),p=yield this.getProtocolHash();o(this,n,{});const b=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:d,contents:this.constructOpContents(f,b,e,c.source),protocol:p},counter:b}}))}delegation(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),u=yield h.createSetDelegateOperation(Object.assign(Object.assign({},c),m({fee:t,storageLimit:r,gasLimit:s},a))),l=yield this.addRevealOperationIfNeeded(u,e),f=this.convertIntoArray(l),d=yield this.getBlockHash(),p=yield this.getProtocolHash();o(this,n,{});const b=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:d,contents:this.constructOpContents(f,b,e,c.source),protocol:p},counter:b}}))}registerDelegate({fee:e,storageLimit:t,gasLimit:r},s){return i(this,void 0,void 0,(function*(){const{pkh:i}=yield this.getKeys(),a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getAccountLimits(i,a),u=m({fee:e,storageLimit:t,gasLimit:r},c),l=yield h.createRegisterDelegateOperation({fee:u.fee,storageLimit:u.storageLimit,gasLimit:u.gasLimit},i),f=yield this.addRevealOperationIfNeeded(l,i),d=this.convertIntoArray(f),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{});const g=parseInt(yield this.getHeadCounter(i),10);return{opOb:{branch:p,contents:this.constructOpContents(d,g,i,s),protocol:b},counter:g}}))}registerGlobalConstant(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),u=yield h.createRegisterGlobalConstantOperation(Object.assign(Object.assign({},c),m({fee:t,storageLimit:r,gasLimit:s},a))),l=yield this.addRevealOperationIfNeeded(u,e),f=this.convertIntoArray(l),d=yield this.getBlockHash(),p=yield this.getProtocolHash();o(this,n,{});const b=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:d,contents:this.constructOpContents(f,b,e,c.source),protocol:p},counter:b}}))}updateConsensusKey(e,t){var{fee:r,storageLimit:s,gasLimit:c}=e,u=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),l=yield h.createUpdateConsensusKeyOperation(Object.assign(Object.assign({},u),m({fee:r,storageLimit:s,gasLimit:c},a))),f=yield this.addRevealOperationIfNeeded(l,e),d=this.convertIntoArray(f),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{});const g=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:p,contents:this.constructOpContents(d,g,e,t),protocol:b},counter:g}}))}increasePaidStorage(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),u=yield h.createIncreasePaidStorageOperation(Object.assign(Object.assign({},c),m({fee:t,storageLimit:r,gasLimit:s},a))),l=yield this.addRevealOperationIfNeeded(u,e),f=this.convertIntoArray(l),d=yield this.getBlockHash(),p=yield this.getProtocolHash();o(this,n,{});const b=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:d,contents:this.constructOpContents(f,b,e,c.source),protocol:p},counter:b}}))}ballot(e){return i(this,void 0,void 0,(function*(){const{pkh:t}=yield this.getKeys(),r=yield h.createBallotOperation(Object.assign({},e)),i=this.convertIntoArray(r),s=yield this.getBlockHash(),a=yield this.getProtocolHash();o(this,n,{});const c=parseInt(yield this.getHeadCounter(t),10);let u;try{u=yield this.rpc.getCurrentPeriod()}catch(e){throw new f.RPCResponseError("Failed to get the current voting period index")}return{opOb:{branch:s,contents:this.constructOpContents(i,c,t,void 0,u),protocol:a},counter:c}}))}proposals(e){return i(this,void 0,void 0,(function*(){const{pkh:t}=yield this.getKeys(),r=yield h.createProposalsOperation(Object.assign({},e)),i=this.convertIntoArray(r),s=yield this.getBlockHash(),a=yield this.getProtocolHash();o(this,n,{});const c=parseInt(yield this.getHeadCounter(t),10);let u;try{u=yield this.rpc.getCurrentPeriod()}catch(e){throw new f.RPCResponseError("Failed to get the current voting period index")}return{opOb:{branch:s,contents:this.constructOpContents(i,c,t,void 0,u),protocol:a},counter:c}}))}drainDelegate(e,t){return i(this,void 0,void 0,(function*(){const{pkh:r}=yield this.getKeys(),i=yield h.createDrainDelegateOperation(Object.assign({},e)),s=this.convertIntoArray(i),a=yield this.getBlockHash(),c=yield this.getProtocolHash();o(this,n,{});const u=parseInt(yield this.getHeadCounter(r),10);return{opOb:{branch:a,contents:this.constructOpContents(s,u,r,t),protocol:c},counter:u}}))}transferTicket(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),u=yield h.createTransferTicketOperation(Object.assign(Object.assign({},c),m({fee:t,storageLimit:r,gasLimit:s},a))),l=yield this.addRevealOperationIfNeeded(u,e),f=this.convertIntoArray(l),d=yield this.getBlockHash(),p=yield this.getProtocolHash();o(this,n,{});const b=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:d,contents:this.constructOpContents(f,b,e,c.source),protocol:p},counter:b}}))}smartRollupAddMessages(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(e,i),u=yield h.createSmartRollupAddMessagesOperation(Object.assign(Object.assign({},c),m({fee:t,storageLimit:r,gasLimit:s},a))),l=yield this.addRevealOperationIfNeeded(u,e),f=this.convertIntoArray(l),d=yield this.getBlockHash(),p=yield this.getProtocolHash();o(this,n,{});const b=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:d,contents:this.constructOpContents(f,b,e,c.source),protocol:p},counter:b}}))}smartRollupOriginate(e){var{fee:t,storageLimit:r,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{pkh:e}=yield this.getKeys(),i=yield this.rpc.getOriginationProof({kind:c.pvmKind,kernel:c.kernel}),a=yield this.context.readProvider.getProtocolConstants("head"),u=yield this.getAccountLimits(e,a),l=yield h.createSmartRollupOriginateOperation(Object.assign(Object.assign(Object.assign({},m({fee:t,storageLimit:r,gasLimit:s},u)),c),{originationProof:i})),f=yield this.addRevealOperationIfNeeded(l,e),d=this.convertIntoArray(f),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{});const g=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:p,contents:this.constructOpContents(d,g,e,c.source),protocol:b},counter:g}}))}batch(e,t){return i(this,void 0,void 0,(function*(){const{pkh:r,publicKey:i}=yield this.getKeys(),s=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(r,s,e.length),c=yield this.isRevealOpNeeded(e,r),f=[];if(t)for(const r of e)if(u.isOpWithFee(r)){const e=t.shift(),n=m(r,{fee:e.suggestedFeeMutez,storageLimit:e.storageLimit,gasLimit:e.gasLimit});f.push(yield this.getRPCOp(Object.assign(Object.assign({},r),n)))}else f.push(Object.assign({},r));else for(const t of e)if(u.isOpWithFee(t)){const e=m(t,a);f.push(yield this.getRPCOp(Object.assign(Object.assign({},t),e)))}else f.push(Object.assign({},t));if(c){if(!i)throw new d.PublicKeyNotFoundError(r);f.unshift(yield h.createRevealOperation({fee:l.DEFAULT_FEE.REVEAL,storageLimit:l.DEFAULT_STORAGE_LIMIT.REVEAL,gasLimit:l.getRevealGasLimit(r)},r,i))}const p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{});const g=parseInt(yield this.getHeadCounter(r),10);return{opOb:{branch:p,contents:this.constructOpContents(f,g,r),protocol:b},counter:g}}))}contractCall(e){var t,r,s;return i(this,void 0,void 0,(function*(){const i=yield this.getBlockHash(),a=yield this.getProtocolHash(),{pkh:u}=yield this.getKeys();o(this,n,{});const l=parseInt(yield this.getHeadCounter(u),10),f=e.toTransferParams(),d=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.getAccountLimits(u,d),p=m({fee:f.fee,storageLimit:f.storageLimit,gasLimit:f.gasLimit},h),b={kind:c.OpKind.TRANSACTION,fee:null!==(t=f.fee)&&void 0!==t?t:p.fee,gas_limit:null!==(r=f.gasLimit)&&void 0!==r?r:p.gasLimit,storage_limit:null!==(s=f.storageLimit)&&void 0!==s?s:p.storageLimit,amount:String(f.amount),destination:f.to,parameters:f.parameter},g=yield this.addRevealOperationIfNeeded(b,u),v=this.convertIntoArray(g);return{opOb:{branch:i,contents:this.constructOpContents(v,l,u),protocol:a},counter:l}}))}toPreapply(e){return i(this,void 0,void 0,(function*(){const{opOb:{contents:t,branch:r,protocol:n}}=e,i=this.toForge(e),o=yield this.context.forger.forge(i);return[{contents:t,branch:r,protocol:n,signature:(yield this.context.signer.sign(o,new Uint8Array([3]))).prefixSig}]}))}toForge({opOb:{contents:e,branch:t}}){return{branch:t,contents:e}}}t.PrepareProvider=g,n=new WeakMap},6003:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;const o=r(807),s=r(835),a=r(9480),c=r(6368),u=r(4632);t.Provider=class{constructor(e){this.context=e}get rpc(){return this.context.rpc}get signer(){return this.context.signer}forge({opOb:{branch:e,contents:t,protocol:r},counter:i}){return n(this,void 0,void 0,(function*(){return{opbytes:yield this.context.forger.forge({branch:e,contents:t}),opOb:{branch:e,contents:t,protocol:r},counter:i}}))}estimate(e,t){var{fee:r,gasLimit:o,storageLimit:a}=e,c=i(e,["fee","gasLimit","storageLimit"]);return n(this,void 0,void 0,(function*(){let e=r,n=o,i=a;if(e&&e%1!=0)throw new s.InvalidEstimateValueError(`Fee value must not be a decimal: ${e}`);if(n&&n%1!=0)throw new s.InvalidEstimateValueError(`Gas Limit value must not be a decimal: ${n}`);if(i&&i%1!=0)throw new s.InvalidEstimateValueError(`Storage Limit value must not be a decimal: ${i}`);if(void 0===r||void 0===o||void 0===a){const s=yield t(Object.assign({fee:r,gasLimit:o,storageLimit:a},c));null!=e||(e=s.suggestedFeeMutez),null!=n||(n=s.gasLimit),null!=i||(i=s.storageLimit)}return{fee:e,gasLimit:n,storageLimit:i}}))}getRPCOp(e){return n(this,void 0,void 0,(function*(){switch(e.kind){case c.OpKind.TRANSACTION:return a.createTransferOperation(Object.assign({},e));case c.OpKind.ORIGINATION:return a.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign({},e)));case c.OpKind.DELEGATION:return a.createSetDelegateOperation(Object.assign({},e));case c.OpKind.REGISTER_GLOBAL_CONSTANT:return a.createRegisterGlobalConstantOperation(Object.assign({},e));case c.OpKind.INCREASE_PAID_STORAGE:return a.createIncreasePaidStorageOperation(Object.assign({},e));case c.OpKind.TRANSFER_TICKET:return a.createTransferTicketOperation(Object.assign({},e));case c.OpKind.SMART_ROLLUP_ADD_MESSAGES:return a.createSmartRollupAddMessagesOperation(Object.assign({},e));case c.OpKind.SMART_ROLLUP_ORIGINATE:return a.createSmartRollupOriginateOperation(Object.assign({},e));default:throw new u.InvalidOperationKindError(e.kind)}}))}runOperation(e){return n(this,void 0,void 0,(function*(){return{opResponse:yield this.rpc.runOperation(e),op:e,context:this.context.clone()}}))}simulate(e){return n(this,void 0,void 0,(function*(){return{opResponse:yield this.rpc.simulateOperation(e),op:e,context:this.context.clone()}}))}isRevealOpNeeded(e,t){return n(this,void 0,void 0,(function*(){return!(!(yield this.isAccountRevealRequired(t))||!this.isRevealRequiredForOpType(e))}))}isAccountRevealRequired(e){return n(this,void 0,void 0,(function*(){return!(yield this.context.readProvider.isAccountRevealed(e,"head"))}))}isRevealRequiredForOpType(e){let t=!1;for(const r of e)o.isOpRequireReveal(r)&&(t=!0);return t}signAndInject(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.sign(e.opbytes,new Uint8Array([3]));e.opbytes=t.sbytes,e.opOb.signature=t.prefixSig;const r=[],n=yield this.rpc.preapplyOperations([e.opOb]);if(!Array.isArray(n))throw new s.TezosPreapplyFailureError(n);for(let e=0;e<n.length;e++)for(let t=0;t<n[e].contents.length;t++)r.push(n[e].contents[t]);const i=s.flattenErrors(n);if(i.length)throw new s.TezosOperationError(i,"Error occurred during validation simulation of operation");return{hash:yield this.context.injector.inject(e.opbytes),forgedBytes:e,opResponse:r,context:this.context.clone()}}))}}},259:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcReadAdapter=void 0;t.RpcReadAdapter=class{constructor(e){this.rpc=e}getBalance(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getBalance(e,{block:String(t)})}))}getDelegate(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getDelegate(e,{block:String(t)})}))}getNextProtocol(e){return r(this,void 0,void 0,(function*(){return(yield this.rpc.getProtocols({block:String(e)})).next_protocol}))}getProtocolConstants(e){return r(this,void 0,void 0,(function*(){const{time_between_blocks:t,minimal_block_delay:r,hard_gas_limit_per_operation:n,hard_gas_limit_per_block:i,hard_storage_limit_per_operation:o,cost_per_byte:s,tx_rollup_origination_size:a,smart_rollup_origination_size:c}=yield this.rpc.getConstants({block:String(e)});return{time_between_blocks:t,minimal_block_delay:r,hard_gas_limit_per_operation:n,hard_gas_limit_per_block:i,hard_storage_limit_per_operation:o,cost_per_byte:s,tx_rollup_origination_size:a,smart_rollup_origination_size:c}}))}getScript(e,t){return r(this,void 0,void 0,(function*(){const{script:r}=yield this.rpc.getContract(e,{block:String(t)});return r}))}getStorage(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getStorage(e,{block:String(t)})}))}getBlockHash(e){return r(this,void 0,void 0,(function*(){const{hash:t}=yield this.rpc.getBlockHeader({block:String(e)});return t}))}getBlockLevel(e){return r(this,void 0,void 0,(function*(){const{level:t}=yield this.rpc.getBlockHeader({block:String(e)});return t}))}getCounter(e,t){return r(this,void 0,void 0,(function*(){const{counter:r}=yield this.rpc.getContract(e,{block:String(t)});return r||"0"}))}getBlockTimestamp(e){return r(this,void 0,void 0,(function*(){const{timestamp:t}=yield this.rpc.getBlockHeader({block:String(e)});return t}))}getBigMapValue(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getBigMapExpr(e.id,e.expr,{block:String(t)})}))}getSaplingDiffById(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getSaplingDiffById(e.id,{block:String(t)})}))}getSaplingDiffByContract(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getSaplingDiffByContract(e,{block:String(t)})}))}getEntrypoints(e){return r(this,void 0,void 0,(function*(){return this.rpc.getEntrypoints(e)}))}getChainId(){return r(this,void 0,void 0,(function*(){return this.rpc.getChainId()}))}isAccountRevealed(e,t){return r(this,void 0,void 0,(function*(){const r=yield this.rpc.getManagerKey(e,{block:String(t)});return r&&"object"==typeof r?!!r.key:!!r}))}getBlock(e){return r(this,void 0,void 0,(function*(){return this.rpc.getBlock({block:String(e)})}))}getLiveBlocks(e){return this.rpc.getLiveBlocks({block:String(e)})}}},7591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnconfiguredSignerError=void 0;const n=r(227);class i extends n.TezosToolkitConfigError{constructor(){super(),this.name="UnconfiguredSignerError",this.message="No signer has been configured. Please configure one by calling setProvider({signer}) on your TezosToolkit instance."}}t.UnconfiguredSignerError=i},1527:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1067:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopSigner=void 0;const i=r(7591);t.NoopSigner=class{publicKey(){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}publicKeyHash(){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}secretKey(){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}sign(e,t){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}}},552:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObservableFromSubscription=void 0;const n=r(977);t.createObservableFromSubscription=function(e){return new n.Observable((t=>(e.on("data",(e=>{t.next(e)})),e.on("error",(e=>{t.error(e)})),e.on("close",(()=>{t.complete()})),()=>{e.close()})))}},3320:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidFilterExpressionError=t.UnsupportedEventError=void 0;const n=r(227);class i extends n.ParameterValidationError{constructor(e){super(),this.type=e,this.name="UnsupportedEventError",this.message=`Unsupported event type "${e}" expecting one of the "data", "error", or "close".`}}t.UnsupportedEventError=i;class o extends n.ParameterValidationError{constructor(e){super(),this.invalidExpression=e,this.name="InvalidFilterExpressionError",this.message="Invalid filter expression expecting the object to contain either and/or property"}}t.InvalidFilterExpressionError=o},8176:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateFilter=t.evaluateExpression=t.evaluateOpFilter=t.eventFilter=void 0;const n=r(3320);t.eventFilter=(e,t,r,n)=>"event"===e.kind&&((!r||e.tag===r)&&((!t||e.source===t)&&(!n||"applied"===e.result.status)));t.evaluateOpFilter=(e,t)=>"opHash"in t?((e,t)=>e.hash===t.opHash)(e,t):"source"in t?((e,t)=>{switch(e.kind){case"endorsement":return"metadata"in e&&e.metadata.delegate===t.source;case"activate_account":return"metadata"in e&&e.pkh===t.source;default:return"source"in e&&e.source===t.source}})(e,t):"kind"in t?((e,t)=>"kind"in e&&e.kind===t.kind)(e,t):"destination"in t&&((e,t)=>{switch(e.kind){case"delegation":return e.delegate===t.destination;case"origination":if("metadata"in e&&"operation_result"in e.metadata&&"originated_contracts"in e.metadata.operation_result&&Array.isArray(e.metadata.operation_result.originated_contracts))return e.metadata.operation_result.originated_contracts.some((e=>e===t.destination));break;case"transaction":return e.destination===t.destination;default:return!1}})(e,t);t.evaluateExpression=(e,r)=>{if(Array.isArray(r.and))return r.and.every((r=>t.evaluateFilter(e,r)));if(Array.isArray(r.or))return r.or.some((r=>t.evaluateFilter(e,r)));throw new n.InvalidFilterExpressionError(r)};t.evaluateFilter=(e,r)=>{const n=[];return Array.isArray(r)?n.push(...r):n.push(r),n.every((r=>"and"in r||"or"in r?t.evaluateExpression(e,r):t.evaluateOpFilter(e,r)))}},440:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableSubscription=t.UnsupportedEventError=void 0;const n=r(977),i=r(9002),o=r(3320);var s=r(3320);Object.defineProperty(t,"UnsupportedEventError",{enumerable:!0,get:function(){return s.UnsupportedEventError}});t.ObservableSubscription=class{constructor(e,t=!1,r=i.retry()){this.shouldRetry=t,this.operatorFunction=r,this.errorListeners=[],this.messageListeners=[],this.closeListeners=[],this.completed$=new n.Subject,e.pipe(i.takeUntil(this.completed$),i.tap((e=>{this.call(this.messageListeners,e)}),(e=>{this.call(this.errorListeners,e)}),(()=>{this.call(this.closeListeners)})),this.shouldRetry?r:i.tap(),i.catchError((()=>n.NEVER))).subscribe()}call(e,t){for(const r of e)try{r(t)}catch(e){console.error(e)}}remove(e,t){const r=e.indexOf(t);-1!==r&&e.splice(r,1)}on(e,t){switch(e){case"data":this.messageListeners.push(t);break;case"error":this.errorListeners.push(t);break;case"close":this.closeListeners.push(t);break;default:throw new o.UnsupportedEventError(e)}}off(e,t){switch(e){case"data":this.remove(this.messageListeners,t);break;case"error":this.remove(this.errorListeners,t);break;case"close":this.remove(this.closeListeners,t);break;default:throw new o.UnsupportedEventError(e)}}close(){this.completed$.next()}}},5032:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PollingSubscribeProvider=t.defaultConfigStreamer=void 0;const i=r(977),o=r(9002),s=r(8176),a=r(4435),c=r(6391);t.defaultConfigStreamer={shouldObservableSubscriptionRetry:!1,observableSubscriptionRetryFunction:o.retry()};t.PollingSubscribeProvider=class{constructor(e,r={}){this.context=e,this._config$=new i.BehaviorSubject(Object.assign(Object.assign({},t.defaultConfigStreamer),r)),this.timer$=this._config$.pipe(o.pluck("pollingIntervalMilliseconds"),o.switchMap((e=>e?i.timer(0,e):i.from(this.getConfirmationPollingInterval()).pipe(o.switchMap((e=>i.timer(0,e))))))),this.newBlock$=this.timer$.pipe(o.switchMap((()=>(e=>i.from(e.rpc.getBlock()).pipe(o.first()))(this.context))),o.distinctUntilKeyChanged("hash"),o.publish(),o.refCount())}get config(){return this._config$.getValue()}getConfirmationPollingInterval(){return n(this,void 0,void 0,(function*(){if(!this.config.pollingIntervalMilliseconds){const e=5e3,t=1e3;try{const r=yield this.context.readProvider.getProtocolConstants("head"),n=(r.minimal_block_delay?r.minimal_block_delay.multipliedBy(1e3):r.time_between_blocks?r.time_between_blocks[0].multipliedBy(1e3):new c.default(e)).dividedBy(3);this.config.pollingIntervalMilliseconds=0===n.toNumber()?t:n.toNumber()}catch(t){return e}}return this.config.pollingIntervalMilliseconds}))}subscribeBlock(e){return new a.ObservableSubscription(this.newBlock$,this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribe(e){return new a.ObservableSubscription(this.newBlock$.pipe(o.pluck("hash")),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeOperation(e){return new a.ObservableSubscription(this.newBlock$.pipe((e=>o.concatMap((t=>new i.Observable((r=>{for(const n of t.operations)for(const t of n)for(const n of t.contents)s.evaluateFilter(Object.assign({hash:t.hash},n),e)&&r.next(Object.assign({hash:t.hash},n));r.complete()})))))(e)),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeEvent(e){return new a.ObservableSubscription(this.newBlock$.pipe((t=e,o.concatMap((e=>new i.Observable((r=>{for(const n of e.operations)for(const i of n)for(const n of i.contents){const o=n.metadata.internal_operation_results;if(o)for(const n of o)s.eventFilter(n,null==t?void 0:t.address,null==t?void 0:t.tag,null==t?void 0:t.excludeFailedOperations)&&r.next(Object.assign({opHash:i.hash,blockHash:e.hash,level:e.header.level},n))}r.complete()})))))),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction);var t}}},2353: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.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.TezosToolkit=t.TaquitoLocalForger=t.RpcReadAdapter=t.ObservableSubscription=t.PollingSubscribeProvider=t.OperationBatch=t.RpcForger=t.CompositeForger=t.UnitValue=t.MichelsonMap=void 0;const o=r(6368),s=r(4984),a=r(4632),c=r(9494),u=r(6395),l=r(259),f=r(1067),d=r(5032),h=r(8023),p=r(635),b=r(6713),m=r(5286),g=r(5744);var v=r(8899);Object.defineProperty(t,"MichelsonMap",{enumerable:!0,get:function(){return v.MichelsonMap}}),Object.defineProperty(t,"UnitValue",{enumerable:!0,get:function(){return v.UnitValue}}),i(r(4593),t),i(r(4984),t),i(r(238),t),i(r(5225),t);var y=r(7336);Object.defineProperty(t,"CompositeForger",{enumerable:!0,get:function(){return y.CompositeForger}});var _=r(794);Object.defineProperty(t,"RpcForger",{enumerable:!0,get:function(){return _.RpcForger}}),i(r(3323),t);var w=r(150);Object.defineProperty(t,"OperationBatch",{enumerable:!0,get:function(){return w.OperationBatch}}),i(r(1527),t),i(r(440),t);var E=r(5032);Object.defineProperty(t,"PollingSubscribeProvider",{enumerable:!0,get:function(){return E.PollingSubscribeProvider}});var O=r(4435);Object.defineProperty(t,"ObservableSubscription",{enumerable:!0,get:function(){return O.ObservableSubscription}}),i(r(4946),t),i(r(635),t),i(r(134),t),i(r(5744),t),i(r(9813),t),i(r(5286),t),i(r(3259),t),i(r(4762),t),i(r(9406),t),i(r(6395),t),i(r(5505),t),i(r(3739),t),i(r(3171),t);var S=r(259);Object.defineProperty(t,"RpcReadAdapter",{enumerable:!0,get:function(){return S.RpcReadAdapter}}),i(r(8794),t);var A=r(6713);Object.defineProperty(t,"TaquitoLocalForger",{enumerable:!0,get:function(){return A.TaquitoLocalForger}}),i(r(3793),t);t.TezosToolkit=class{constructor(e){this._rpc=e,this._options={},this.format=a.format,"string"==typeof this._rpc?this._rpcClient=new o.RpcClient(this._rpc):this._rpcClient=this._rpc,this._context=new s.Context(e),this._wallet=new p.Wallet(this._context),this.setProvider({rpc:this._rpcClient}),this.batch=this._context.batch.batch.bind(this._context.batch)}setProvider({rpc:e,stream:t,signer:r,protocol:n,config:i,forger:o,wallet:s,packer:a,globalConstantsProvider:c,readProvider:u,parserProvider:l,injectorProvider:f}){this.setRpcProvider(e),this.setStreamProvider(t),this.setSignerProvider(r),this.setForgerProvider(o),this.setWalletProvider(s),this.setPackerProvider(a),this.setGlobalConstantsProvider(c),this.setReadProvider(u),this.setParserProvider(l),this.setInjectorProvider(f),this._context.proto=n,i&&this._context.setPartialConfig(i)}setSignerProvider(e){this._options.signer||void 0!==e?void 0!==e&&(this._context.signer=e,this._options.signer=e):(this._context.signer=new f.NoopSigner,this._options.signer=e)}setRpcProvider(e){"string"==typeof e?this._rpcClient=new o.RpcClient(e):void 0===e||(this._rpcClient=e),this._options.rpc=this._rpcClient,this._context.rpc=this._rpcClient}setForgerProvider(e){if(void 0!==e)this._options.forger=e,this._context.forger=e;else if(void 0===this._options.forger){const e=this.getFactory(b.TaquitoLocalForger)();this._options.forger=e,this._context.forger=e}}setStreamProvider(e){if("string"==typeof e){const t=new d.PollingSubscribeProvider(new s.Context(new o.RpcClient(e)));this._options.stream=t,this._context.stream=t}else if(void 0!==e)this._options.stream=e,this._context.stream=e;else if(void 0===this._options.stream){const e=this.getFactory(d.PollingSubscribeProvider)();this._options.stream=e,this._context.stream=e}}setWalletProvider(e){if(this._options.wallet||void 0!==e)void 0!==e&&(this._options.wallet=e,this._context.walletProvider=e);else{const e=this.getFactory(p.LegacyWalletProvider)();this._options.wallet=e,this._context.walletProvider=e}}setPackerProvider(e){if(this._options.packer||void 0!==e)void 0!==e&&(this._context.packer=e,this._options.packer=e);else{const e=this.getFactory(u.RpcPacker)();this._context.packer=e,this._options.packer=e}}setGlobalConstantsProvider(e){if(this._options.globalConstantsProvider||void 0!==e)void 0!==e&&(this._context.globalConstantsProvider=e,this._options.globalConstantsProvider=e);else{const e=new c.NoopGlobalConstantsProvider;this._context.globalConstantsProvider=e,this._options.globalConstantsProvider=e}}setReadProvider(e){const t=e||new l.RpcReadAdapter(this._context.rpc);this._options.readProvider=t,this._context.readProvider=t}setParserProvider(e){if(this._options.parserProvider||void 0!==e)void 0!==e&&(this._context.parser=e,this._options.parserProvider=e);else{const e=new m.MichelCodecParser(this._context);this._context.parser=e,this._options.parserProvider=e}}setInjectorProvider(e){if(this._options.injectorProvider||void 0!==e)void 0!==e&&(this._context.injector=e,this._options.injectorProvider=e);else{const e=new g.RpcInjector(this._context);this._context.injector=e,this._options.injectorProvider=e}}get tz(){return this._context.tz}get contract(){return this._context.contract}get prepare(){return this._context.prepare}get wallet(){return this._wallet}get operation(){return this._context.operationFactory}get estimate(){return this._context.estimate}get stream(){return this._context.stream}get rpc(){return this._context.rpc}get signer(){return this._context.signer}get globalConstants(){return this._context.globalConstantsProvider}addExtension(e){Array.isArray(e)?e.forEach((e=>e.configureContext(this._context))):e.configureContext(this._context)}getFactory(e){return(...t)=>new e(this._context,...t)}getVersionInfo(){return h.VERSION}}},4946:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},992:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcTzProvider=void 0;const i=r(8361),o=r(4632),s=r(227),a=r(6003),c=r(3793);class u extends a.Provider{constructor(e){super(e),this.prepare=new c.PrepareProvider(this.context)}getBalance(e){return n(this,void 0,void 0,(function*(){const t=o.validateAddress(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,o.invalidDetail(t));return this.context.readProvider.getBalance(e,"head")}))}getDelegate(e){return n(this,void 0,void 0,(function*(){const t=o.validateAddress(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,o.invalidDetail(t));return this.context.readProvider.getDelegate(e,"head")}))}activate(e,t){return n(this,void 0,void 0,(function*(){const r=o.validateKeyHash(e);if(r!==o.ValidationResult.VALID)throw new o.InvalidKeyHashError(e,o.invalidDetail(r));const n=yield this.prepare.activate({pkh:e,secret:t}),s=yield this.forge(n),a=`${s.opbytes}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`;return new i.Operation(yield this.rpc.injectOperation(a),Object.assign(Object.assign({},s),{opbytes:a}),[],this.context.clone())}))}}t.RpcTzProvider=u},8023:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION={commitHash:"a97e506efd61b86e39ae30db588401b8fda46553",version:"17.3.2"}},1626:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BatchWalletOperation=void 0;const i=r(6368),o=r(150),s=r(807),a=r(2809),c=r(2323);class u extends a.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t,this.getOriginatedContractAddresses=()=>n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e){const t=e.filter((e=>"origination"===e.kind));let r=[];for(const e of t)e.metadata.operation_result.originated_contracts&&(r=[...r,...e.metadata.operation_result.originated_contracts]);return r}throw new c.ObservableError("Unable to fetch operation results")}))}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===i.OpKind.REVEAL));throw new c.ObservableError("Unable to fetch operation results")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.operationResults();if(e)return e.filter((e=>-1!==o.BATCH_KINDS.indexOf(e.kind))).map((e=>{if(s.hasMetadataWithResult(e)){return e.metadata.operation_result.status}return"unknown"}))[0]||"unknown";throw new c.ObservableError("Unable to fetch operation results")}))}}t.BatchWalletOperation=u},4364:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DelegationWalletOperation=void 0;const i=r(6368),o=r(2809),s=r(2323);class a extends o.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===i.OpKind.REVEAL));throw new s.ObservableError("Unable to fetch operation result")}))}delegationOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===i.OpKind.DELEGATION));throw new s.ObservableError("Unable to fetch operation result")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.delegationOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.DelegationWalletOperation=a},2323:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableError=t.ConfirmationUndefinedError=void 0;const n=r(227);class i extends n.TezosToolkitConfigError{constructor(){super(),this.name="ConfirmationUndefinedError",this.message="Default confirmation count can not be undefined"}}t.ConfirmationUndefinedError=i;class o extends n.NetworkError{constructor(e){super(),this.message=e,this.name="ObservableError"}}t.ObservableError=o},7832:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.IncreasePaidStorageWalletOperation=void 0;const i=r(2809),o=r(6368),s=r(2323);class a extends i.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===o.OpKind.REVEAL));throw new s.ObservableError("Unable to fetch operation result")}))}increasePaidStorageOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===o.OpKind.INCREASE_PAID_STORAGE));throw new s.ObservableError("Unable to fetch operation result")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.increasePaidStorageOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.IncreasePaidStorageWalletOperation=a},635: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.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5277),t),i(r(2809),t),i(r(4685),t),i(r(7654),t),i(r(4364),t),i(r(7432),t),i(r(8562),t)},7432:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8562:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.LegacyWalletProvider=void 0;const i=r(807);t.LegacyWalletProvider=class{constructor(e){this.context=e}getPKH(){return n(this,void 0,void 0,(function*(){return this.context.signer.publicKeyHash()}))}mapTransferParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return i.attachKind(yield e(),i.OpKind.TRANSACTION)}))}mapOriginateParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return i.attachKind(yield e(),i.OpKind.ORIGINATION)}))}mapDelegateParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return i.attachKind(yield e(),i.OpKind.DELEGATION)}))}mapIncreasePaidStorageWalletParams(e){return n(this,void 0,void 0,(function*(){return i.attachKind(yield e(),i.OpKind.INCREASE_PAID_STORAGE)}))}sendOperations(e){return n(this,void 0,void 0,(function*(){return(yield this.context.batch.batch(e).send()).hash}))}sign(e,t){return n(this,void 0,void 0,(function*(){const{prefixSig:r}=yield this.context.signer.sign(e,t);return r}))}getPK(){return this.context.signer.publicKey()}}},8286:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OperationFactory=t.createNewPollingBasedHeadObservable=t.timeoutAfter=void 0;const i=r(977),o=r(9002),s=r(552),a=r(1626),c=r(4364),u=r(7832),l=r(2809),f=r(7654),d=r(4685),h=r(7642);function p(e){return function(t){return new i.BehaviorSubject(null).pipe(o.timeout({each:e,with:()=>i.throwError((()=>new h.ConfirmationTimeoutError("Confirmation polling timed out")))}),o.mergeMap((()=>t)))}}t.timeoutAfter=p;t.createNewPollingBasedHeadObservable=(e,t,r)=>e.pipe(p(1e3*t.config.confirmationPollingTimeoutSecond),o.share({connector:()=>new i.ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1}));t.OperationFactory=class{constructor(e){this.context=e,this.sharedHeadObs=i.defer((()=>s.createObservableFromSubscription(this.context.stream.subscribeBlock("head"))))}createNewHeadObservable(){return n(this,void 0,void 0,(function*(){return t.createNewPollingBasedHeadObservable(this.sharedHeadObs,this.context)}))}createPastBlockWalker(e,t=1){return i.from(this.context.readProvider.getBlock(e)).pipe(o.switchMap((e=>1===t?i.of(e):i.range(e.header.level,t-1).pipe(o.startWith(e),o.concatMap((e=>n(this,void 0,void 0,(function*(){return this.context.readProvider.getBlock("number"==typeof e?e:e.header.level)}))))))))}createHeadObservableFromConfig({blockIdentifier:e}){return n(this,void 0,void 0,(function*(){const t=[];return e&&t.push(this.createPastBlockWalker(e)),t.push(yield this.createNewHeadObservable()),i.concat(...t)}))}createOperation(e,t={}){return n(this,void 0,void 0,(function*(){return new l.WalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createBatchOperation(e,t={}){return n(this,void 0,void 0,(function*(){return new a.BatchWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createTransactionOperation(e,t={}){return n(this,void 0,void 0,(function*(){return new d.TransactionWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createDelegationOperation(e,t={}){return n(this,void 0,void 0,(function*(){return new c.DelegationWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createOriginationOperation(e,t={}){return n(this,void 0,void 0,(function*(){return new f.OriginationWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createIncreasePaidStorageOperation(e,t={}){return n(this,void 0,void 0,(function*(){return new u.IncreasePaidStorageWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}}},2809:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletOperation=void 0;const i=r(977),o=r(9002),s=r(6298),a=r(4632),c=r(7642),u=r(2323),l=r(227);t.WalletOperation=class{constructor(e,t,r){if(this.opHash=e,this.context=t,this._newHead$=r,this._operationResult=new i.ReplaySubject(1),this._includedInBlock=new i.ReplaySubject(1),this._included=!1,this.newHead$=this._newHead$.pipe(o.switchMap((e=>{var t,r;const n=null!==(r=null===(t=this.lastHead)||void 0===t?void 0:t.header.level)&&void 0!==r?r:e.header.level-1;return i.range(n+1,e.header.level-n-1).pipe(o.concatMap((e=>this.context.readProvider.getBlock(e))),o.endWith(e))})),o.tap((e=>this.lastHead=e)),o.share({connector:()=>new i.ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1})),this.confirmed$=this.newHead$.pipe(o.map((e=>{for(const t of e.operations)for(const r of t)if(r.hash===this.opHash)return this._included=!0,this._includedInBlock.next(e),this._operationResult.next(r.contents),e})),o.filter((e=>void 0!==e)),o.first(),o.share({connector:()=>new i.ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1})),a.validateOperation(this.opHash)!==a.ValidationResult.VALID)throw new l.InvalidOperationHashError(this.opHash);this.confirmed$.pipe(o.first(),o.catchError((()=>i.of(void 0)))).subscribe()}operationResults(){return n(this,void 0,void 0,(function*(){return this._operationResult.pipe(o.first()).toPromise()}))}receipt(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new u.ObservableError("Unable to get operation results");return s.receiptFromOperation(e)}))}getCurrentConfirmation(){return n(this,void 0,void 0,(function*(){return this._included?i.combineLatest([this._includedInBlock,i.from(this.context.readProvider.getBlock("head"))]).pipe(o.map((([e,t])=>t.header.level-e.header.level+1)),o.first()).toPromise():0}))}isInCurrentBranch(e="head"){return n(this,void 0,void 0,(function*(){if(!this._included)return!0;const t=yield this.context.readProvider.getBlockLevel(e),r=yield this._includedInBlock.pipe(o.first()).toPromise();if(!r)throw new u.ObservableError("Inclusion block is undefined");const n=t-r.header.level;if(n<=0)return!0;const i=Math.min(r.header.level+n,r.header.level+60);return new Set(yield this.context.readProvider.getLiveBlocks(i)).has(r.hash)}))}confirmationObservable(e){if(void 0!==e&&e<1)throw new c.InvalidConfirmationCountError(e);const{defaultConfirmationCount:t}=this.context.config,r=void 0!==e?e:t;if(void 0===r)throw new u.ConfirmationUndefinedError;return i.combineLatest([this._includedInBlock,this.newHead$]).pipe(o.distinctUntilChanged((([,e],[,t])=>e.hash===t.hash)),o.map((([e,t])=>({block:t,expectedConfirmation:r,currentConfirmation:t.header.level-e.header.level+1,completed:t.header.level-e.header.level>=r-1,isInCurrentBranch:()=>this.isInCurrentBranch(t.hash)}))),o.takeWhile((({completed:e})=>!e),!0))}confirmation(e){return this.confirmationObservable(e).toPromise()}}},7654:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OriginationWalletOperation=void 0;const i=r(6368),o=r(807),s=r(2809),a=r(2323);class c extends s.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}originationOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return o.findWithKind(e,i.OpKind.ORIGINATION);throw new a.ObservableError("Unable to fetch operation result")}))}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return o.findWithKind(e,i.OpKind.REVEAL);throw new a.ObservableError("Unable to fetch operation result")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.originationOperation();return e?e.metadata.operation_result.status:"unknown"}))}contract(){return n(this,void 0,void 0,(function*(){const e=yield this.originationOperation(),t=((null==e?void 0:e.metadata.operation_result.originated_contracts)||[])[0];return this.context.wallet.at(t)}))}}t.OriginationWalletOperation=c},6298:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.receiptFromOperation=void 0;const n=r(6391),i=r(4593),o=r(835);t.receiptFromOperation=(e,{ALLOCATION_BURN:t,ORIGINATION_BURN:r}={ALLOCATION_BURN:257,ORIGINATION_BURN:257})=>{n.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.default.ROUND_UP});const s=o.flattenOperationResult({contents:e});let a=new n.default(0),c=new n.default(0),u=new n.default(0),l=new n.default(0),f=new n.default(0),d=new n.default(0);return s.forEach((e=>{u=u.plus(e.fee||0),l=l.plus(Array.isArray(e.originated_contracts)?e.originated_contracts.length*r:0),f=f.plus("allocated_destination_contract"in e?t:0),a=a.plus(e.consumed_milligas||0),d=d.plus("paid_storage_size_diff"in e&&Number(e.paid_storage_size_diff)||0)})),c=c.plus(f).plus(l).plus(d),{totalFee:u,totalMilliGas:a,totalGas:a.dividedBy(1e3),totalStorage:c,totalAllocationBurn:f,totalOriginationBurn:l,totalPaidStorageDiff:d,totalStorageBurn:new n.default(c.multipliedBy(i.COST_PER_BYTE))}}},4685:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionWalletOperation=void 0;const i=r(2809),o=r(6368),s=r(2323);class a extends i.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new s.ObservableError("operationResult returned undefined");return e.find((e=>e.kind===o.OpKind.REVEAL))}))}transactionOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new s.ObservableError("operationResult returned undefined");return e.find((e=>e.kind===o.OpKind.TRANSACTION))}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.transactionOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.TransactionWalletOperation=a},5277:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=t.WalletOperationBatch=void 0;const i=r(238),o=r(807),s=r(227),a=r(4632);class c{constructor(e,t){this.walletProvider=e,this.context=t,this.operations=[]}withTransfer(e){const t=a.validateAddress(e.to);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.to,a.invalidDetail(t));return this.operations.push(Object.assign({kind:o.OpKind.TRANSACTION},e)),this}withContractCall(e,t={}){return this.withTransfer(e.toTransferParams(t))}withDelegation(e){var t;const r=a.validateAddress(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&r!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.delegate,a.invalidDetail(r));return this.operations.push(Object.assign({kind:o.OpKind.DELEGATION},e)),this}withOrigination(e){return this.operations.push(Object.assign({kind:o.OpKind.ORIGINATION},e)),this}withIncreasePaidStorage(e){const t=a.validateAddress(e.destination);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.destination,a.invalidDetail(t));return this.operations.push(Object.assign({kind:o.OpKind.INCREASE_PAID_STORAGE},e)),this}mapOperation(e){return n(this,void 0,void 0,(function*(){switch(e.kind){case o.OpKind.TRANSACTION:return this.walletProvider.mapTransferParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e}))));case o.OpKind.ORIGINATION:return this.walletProvider.mapOriginateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return this.context.parser.prepareCodeOrigination(Object.assign({},e))}))));case o.OpKind.DELEGATION:return this.walletProvider.mapDelegateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e}))));case o.OpKind.INCREASE_PAID_STORAGE:return this.walletProvider.mapIncreasePaidStorageWalletParams((()=>n(this,void 0,void 0,(function*(){return e}))));default:throw new s.InvalidOperationKindError(JSON.stringify(e.kind))}}))}with(e){for(const t of e)switch(t.kind){case o.OpKind.TRANSACTION:this.withTransfer(t);break;case o.OpKind.ORIGINATION:this.withOrigination(t);break;case o.OpKind.DELEGATION:this.withDelegation(t);break;case o.OpKind.INCREASE_PAID_STORAGE:this.withIncreasePaidStorage(t);break;default:throw new s.InvalidOperationKindError(JSON.stringify(t.kind))}return this}send(){return n(this,void 0,void 0,(function*(){const e=[];for(const t of this.operations)e.push(yield this.mapOperation(t));const t=yield this.walletProvider.sendOperations(e);return this.context.operationFactory.createBatchOperation(t)}))}}t.WalletOperationBatch=c;t.Wallet=class{constructor(e){this.context=e,this.walletCommand=e=>({send:e})}get walletProvider(){return this.context.walletProvider}pkh({forceRefetch:e}={}){return n(this,void 0,void 0,(function*(){return this._pkh&&!e||(this._pkh=yield this.walletProvider.getPKH()),this._pkh}))}originate(e){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapOriginateParamsToWalletParams((()=>this.context.parser.prepareCodeOrigination(Object.assign({},e)))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createOriginationOperation(r)}))))}setDelegate(e){var t;const r=a.validateAddress(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&r!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.delegate,a.invalidDetail(r));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapDelegateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createDelegationOperation(r)}))))}signFailingNoop(e){return n(this,void 0,void 0,(function*(){const t={kind:o.OpKind.FAILING_NOOP,arbitrary:e.arbitrary},r=yield this.context.readProvider.getBlockHash(e.basedOnBlock),n=yield this.context.forger.forge({branch:r,contents:[t]});return{signature:yield this.walletProvider.sign(n,Uint8Array.from([3])),bytes:n,signedContent:{branch:r,contents:[{kind:o.OpKind.FAILING_NOOP,arbitrary:e.arbitrary}]}}}))}registerDelegate(){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const e=yield this.walletProvider.mapDelegateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return{delegate:yield this.pkh()}})))),t=yield this.walletProvider.sendOperations([e]);return this.context.operationFactory.createDelegationOperation(t)}))))}transfer(e){const t=a.validateAddress(e.to);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.to,a.invalidDetail(t));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapTransferParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createTransactionOperation(r)}))))}increasePaidStorage(e){const t=a.validateAddress(e.destination);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.destination,a.invalidDetail(t));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapIncreasePaidStorageWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createIncreasePaidStorageOperation(r)}))))}batch(e){const t=new c(this.walletProvider,this.context);return Array.isArray(e)&&t.with(e),t}at(e,t=(e=>e)){return n(this,void 0,void 0,(function*(){const r=a.validateContractAddress(e);if(r!==a.ValidationResult.VALID)throw new s.InvalidContractAddressError(e,a.invalidDetail(r));const n=this.context.withExtensions().rpc,o=this.context.withExtensions().readProvider,c=yield o.getScript(e,"head"),u=yield o.getEntrypoints(e),l=new i.ContractAbstraction(e,c,this,this.context.contract,u,n,o);return t(l,this.context)}))}getPK(){return this.walletProvider.getPK()}}},5477:()=>{},3196:()=>{},8087:()=>{},4854:()=>{},6602:()=>{},2558:(e,t,r)=>{"use strict";r.d(t,{O:()=>w,Z:()=>E});var n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,s="[BigNumber Error] ",a=s+"Number primitive has more than 15 significant digits: ",c=1e14,u=14,l=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,h=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function b(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=u-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function m(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,c=e.e,u=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=c==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(a=(c=i.length)<(u=o.length)?c:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return c==u?0:c>u^r?1:-1}function g(e,t,r,n){if(e<t||e>r||e!==o(e))throw Error(s+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function v(e){var t=e.c.length-1;return p(e.e/u)==t&&e.c[t]%2!=0}function y(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function _(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var w=function e(t){var r,w,E,O,S,A,P,T,R,x,I=$.prototype={constructor:$,toString:null,valueOf:null},M=new $(1),L=20,k=4,N=-7,C=21,j=-1e7,D=1e7,U=!1,B=1,F=0,K={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",G=!0;function $(e,t){var r,i,s,c,f,d,h,p,b=this;if(!(b instanceof $))return new $(e,t);if(null==t){if(e&&!0===e._isBigNumber)return b.s=e.s,void(!e.c||e.e>D?b.c=b.e=null:e.e<j?b.c=[b.e=0]:(b.e=e.e,b.c=e.c.slice()));if((d="number"==typeof e)&&0*e==0){if(b.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,f=e;f>=10;f/=10,c++);return void(c>D?b.c=b.e=null:(b.e=c,b.c=[e]))}p=String(e)}else{if(!n.test(p=String(e)))return E(b,p,d);b.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(c=p.indexOf("."))>-1&&(p=p.replace(".","")),(f=p.search(/e/i))>0?(c<0&&(c=f),c+=+p.slice(f+1),p=p.substring(0,f)):c<0&&(c=p.length)}else{if(g(t,2,H.length,"Base"),10==t&&G)return W(b=new $(e),L+b.e+1,k);if(p=String(e),d="number"==typeof e){if(0*e!=0)return E(b,p,d,t);if(b.s=1/e<0?(p=p.slice(1),-1):1,$.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(a+e)}else b.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=H.slice(0,t),c=f=0,h=p.length;f<h;f++)if(r.indexOf(i=p.charAt(f))<0){if("."==i){if(f>c){c=h;continue}}else if(!s&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){s=!0,f=-1,c=0;continue}return E(b,String(e),d,t)}d=!1,(c=(p=w(p,t,10,b.s)).indexOf("."))>-1?p=p.replace(".",""):c=p.length}for(f=0;48===p.charCodeAt(f);f++);for(h=p.length;48===p.charCodeAt(--h););if(p=p.slice(f,++h)){if(h-=f,d&&$.DEBUG&&h>15&&(e>l||e!==o(e)))throw Error(a+b.s*e);if((c=c-f-1)>D)b.c=b.e=null;else if(c<j)b.c=[b.e=0];else{if(b.e=c,b.c=[],f=(c+1)%u,c<0&&(f+=u),f<h){for(f&&b.c.push(+p.slice(0,f)),h-=u;f<h;)b.c.push(+p.slice(f,f+=u));f=u-(p=p.slice(f)).length}else f-=h;for(;f--;p+="0");b.c.push(+p)}}else b.c=[b.e=0]}function V(e,t,r,n){var i,o,s,a,c;if(null==r?r=k:g(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)c=b(e.c),c=1==n||2==n&&(s<=N||s>=C)?y(c,s):_(c,s,"0");else if(o=(e=W(new $(e),t,r)).e,a=(c=b(e.c)).length,1==n||2==n&&(t<=o||o<=N)){for(;a<t;c+="0",a++);c=y(c,o)}else if(t-=s,c=_(c,o,"0"),o+1>a){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-a)>0)for(o+1==a&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function z(e,t){for(var r,n,i=1,o=new $(e[0]);i<e.length;i++)(!(n=new $(e[i])).s||(r=m(o,n))===t||0===r&&o.s===t)&&(o=n);return o}function q(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*u-1)>D?e.c=e.e=null:r<j?e.c=[e.e=0]:(e.e=r,e.c=t),e}function W(e,t,r,n){var s,a,l,d,h,p,b,m=e.c,g=f;if(m){e:{for(s=1,d=m[0];d>=10;d/=10,s++);if((a=t-s)<0)a+=u,l=t,h=m[p=0],b=o(h/g[s-l-1]%10);else if((p=i((a+1)/u))>=m.length){if(!n)break e;for(;m.length<=p;m.push(0));h=b=0,s=1,l=(a%=u)-u+1}else{for(h=d=m[p],s=1;d>=10;d/=10,s++);b=(l=(a%=u)-u+s)<0?0:o(h/g[s-l-1]%10)}if(n=n||t<0||null!=m[p+1]||(l<0?h:h%g[s-l-1]),n=r<4?(b||n)&&(0==r||r==(e.s<0?3:2)):b>5||5==b&&(4==r||n||6==r&&(a>0?l>0?h/g[s-l]:0:m[p-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=g[(u-t%u)%u],e.e=-t||0):m[0]=e.e=0,e;if(0==a?(m.length=p,d=1,p--):(m.length=p+1,d=g[u-a],m[p]=l>0?o(h/g[s-l]%g[l])*d:0),n)for(;;){if(0==p){for(a=1,l=m[0];l>=10;l/=10,a++);for(l=m[0]+=d,d=1;l>=10;l/=10,d++);a!=d&&(e.e++,m[0]==c&&(m[0]=1));break}if(m[p]+=d,m[p]!=c)break;m[p--]=0,d=1}for(a=m.length;0===m[--a];m.pop());}e.e>D?e.c=e.e=null:e.e<j&&(e.c=[e.e=0])}return e}function Z(e){var t,r=e.e;return null===r?e.toString():(t=b(e.c),t=r<=N||r>=C?y(t,r):_(t,r,"0"),e.s<0?"-"+t:t)}return $.clone=e,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(s+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(g(r=e[t],0,h,t),L=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(g(r=e[t],0,8,t),k=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(g(r[0],-h,0,t),g(r[1],0,h,t),N=r[0],C=r[1]):(g(r,-h,h,t),N=-(C=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)g(r[0],-h,-1,t),g(r[1],1,h,t),j=r[0],D=r[1];else{if(g(r,-h,h,t),!r)throw Error(s+t+" cannot be zero: "+r);j=-(D=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(s+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(s+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(g(r=e[t],0,9,t),B=r),e.hasOwnProperty(t="POW_PRECISION")&&(g(r=e[t],0,h,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(s+t+" not an object: "+r);K=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(s+t+" invalid: "+r);G="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:L,ROUNDING_MODE:k,EXPONENTIAL_AT:[N,C],RANGE:[j,D],CRYPTO:U,MODULO_MODE:B,POW_PRECISION:F,FORMAT:K,ALPHABET:H}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-h&&i<=h&&i===o(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%u)<1&&(t+=u),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=c||r!==o(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(s+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return z(arguments,-1)},$.minimum=$.min=function(){return z(arguments,1)},$.random=(O=9007199254740992,S=Math.random()*O&2097151?function(){return o(Math.random()*O)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,a,c,l=0,d=[],p=new $(M);if(null==e?e=L:g(e,0,h),a=i(e/u),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));l<a;)(c=131072*t[l]+(t[l+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(d.push(c%1e14),l+=2);l=a/2}else{if(!crypto.randomBytes)throw U=!1,Error(s+"crypto unavailable");for(t=crypto.randomBytes(a*=7);l<a;)(c=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])>=9e15?crypto.randomBytes(7).copy(t,l):(d.push(c%1e14),l+=7);l=a/7}if(!U)for(;l<a;)(c=S())<9e15&&(d[l++]=c%1e14);for(a=d[--l],e%=u,a&&e&&(c=f[u-e],d[l]=o(a/c)*c);0===d[l];d.pop(),l--);if(l<0)d=[n=0];else{for(n=-1;0===d[0];d.splice(0,1),n-=u);for(l=1,c=d[0];c>=10;c/=10,l++);l<u&&(n-=u-l)}return p.e=n,p.c=d,p}),$.sum=function(){for(var e=1,t=arguments,r=new $(t[0]);e<t.length;)r=r.plus(t[e++]);return r},w=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,c=e.length;a<c;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var c,u,l,f,d,h,p,m,g=n.indexOf("."),v=L,y=k;for(g>=0&&(f=F,F=0,n=n.replace(".",""),h=(m=new $(i)).pow(n.length-g),F=f,m.c=t(_(b(h.c),h.e,"0"),10,o,e),m.e=m.c.length),l=f=(p=t(n,i,o,a?(c=H,e):(c=e,H))).length;0==p[--f];p.pop());if(!p[0])return c.charAt(0);if(g<0?--l:(h.c=p,h.e=l,h.s=s,p=(h=r(h,m,v,y,o)).c,d=h.r,l=h.e),g=p[u=l+v+1],f=o/2,d=d||u<0||null!=p[u+1],d=y<4?(null!=g||d)&&(0==y||y==(h.s<0?3:2)):g>f||g==f&&(4==y||d||6==y&&1&p[u-1]||y==(h.s<0?8:7)),u<1||!p[0])n=d?_(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(p.length=u,d)for(--o;++p[--u]>o;)p[u]=0,u||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(g=0,n="";g<=f;n+=c.charAt(p[g++]));n=_(n,l,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,c=e.length,u=t%d,l=t/d|0;for(e=e.slice();c--;)a=((i=u*(o=e[c]%d)+(n=l*o+(s=e[c]/d|0)*u)%d*d+a)/r|0)+(n/d|0)+l*s,e[c]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,s,a,l){var f,d,h,b,m,g,v,y,_,w,E,O,S,A,P,T,R,x=n.s==i.s?1:-1,I=n.c,M=i.c;if(!(I&&I[0]&&M&&M[0]))return new $(n.s&&i.s&&(I?!M||I[0]!=M[0]:M)?I&&0==I[0]||!M?0*x:x/0:NaN);for(_=(y=new $(x)).c=[],x=s+(d=n.e-i.e)+1,l||(l=c,d=p(n.e/u)-p(i.e/u),x=x/u|0),h=0;M[h]==(I[h]||0);h++);if(M[h]>(I[h]||0)&&d--,x<0)_.push(1),b=!0;else{for(A=I.length,T=M.length,h=0,x+=2,(m=o(l/(M[0]+1)))>1&&(M=e(M,m,l),I=e(I,m,l),T=M.length,A=I.length),S=T,E=(w=I.slice(0,T)).length;E<T;w[E++]=0);R=M.slice(),R=[0].concat(R),P=M[0],M[1]>=l/2&&P++;do{if(m=0,(f=t(M,w,T,E))<0){if(O=w[0],T!=E&&(O=O*l+(w[1]||0)),(m=o(O/P))>1)for(m>=l&&(m=l-1),v=(g=e(M,m,l)).length,E=w.length;1==t(g,w,v,E);)m--,r(g,T<v?R:M,v,l),v=g.length,f=1;else 0==m&&(f=m=1),v=(g=M.slice()).length;if(v<E&&(g=[0].concat(g)),r(w,g,E,l),E=w.length,-1==f)for(;t(M,w,T,E)<1;)m++,r(w,T<E?R:M,E,l),E=w.length}else 0===f&&(m++,w=[0]);_[h++]=m,w[0]?w[E++]=I[S]||0:(w=[I[S]],E=1)}while((S++<A||null!=w[0])&&x--);b=null!=w[0],_[0]||_.splice(0,1)}if(l==c){for(h=1,x=_[0];x>=10;x/=10,h++);W(y,s+(y.e=h+d*u-1)+1,a,b)}else y.e=d,y.r=+b;return y}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,P=/^([^.]+)\.$/,T=/^\.([^.]+)$/,R=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,E=function(e,t,r,n){var i,o=r?t:t.replace(x,"");if(R.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(A,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(P,"$1").replace(T,"0.$1")),t!=o))return new $(o,i);if($.DEBUG)throw Error(s+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},I.absoluteValue=I.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},I.comparedTo=function(e,t){return m(this,new $(e,t))},I.decimalPlaces=I.dp=function(e,t){var r,n,i,o=this;if(null!=e)return g(e,0,h),null==t?t=k:g(t,0,8),W(new $(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-p(this.e/u))*u,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},I.dividedBy=I.div=function(e,t){return r(this,new $(e,t),L,k)},I.dividedToIntegerBy=I.idiv=function(e,t){return r(this,new $(e,t),0,1)},I.exponentiatedBy=I.pow=function(e,t){var r,n,a,c,l,f,d,h,p=this;if((e=new $(e)).c&&!e.isInteger())throw Error(s+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new $(t)),l=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new $(Math.pow(+Z(p),l?e.s*(2-v(e)):+Z(e))),t?h.mod(t):h;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new $(NaN);(n=!f&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||l&&p.c[1]>=24e7:p.c[0]<8e13||l&&p.c[0]<=9999975e7)))return c=p.s<0&&v(e)?-0:0,p.e>-1&&(c=1/c),new $(f?1/c:c);F&&(c=i(F/u+2))}for(l?(r=new $(.5),f&&(e.s=1),d=v(e)):d=(a=Math.abs(+Z(e)))%2,h=new $(M);;){if(d){if(!(h=h.times(p)).c)break;c?h.c.length>c&&(h.c.length=c):n&&(h=h.mod(t))}if(a){if(0===(a=o(a/2)))break;d=a%2}else if(W(e=e.times(r),e.e+1,1),e.e>14)d=v(e);else{if(0===(a=+Z(e)))break;d=a%2}p=p.times(p),c?p.c&&p.c.length>c&&(p.c.length=c):n&&(p=p.mod(t))}return n?h:(f&&(h=M.div(h)),t?h.mod(t):c?W(h,F,k,undefined):h)},I.integerValue=function(e){var t=new $(this);return null==e?e=k:g(e,0,8),W(t,t.e+1,e)},I.isEqualTo=I.eq=function(e,t){return 0===m(this,new $(e,t))},I.isFinite=function(){return!!this.c},I.isGreaterThan=I.gt=function(e,t){return m(this,new $(e,t))>0},I.isGreaterThanOrEqualTo=I.gte=function(e,t){return 1===(t=m(this,new $(e,t)))||0===t},I.isInteger=function(){return!!this.c&&p(this.e/u)>this.c.length-2},I.isLessThan=I.lt=function(e,t){return m(this,new $(e,t))<0},I.isLessThanOrEqualTo=I.lte=function(e,t){return-1===(t=m(this,new $(e,t)))||0===t},I.isNaN=function(){return!this.s},I.isNegative=function(){return this.s<0},I.isPositive=function(){return this.s>0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new $(e,t)).s,!a||!t)return new $(NaN);if(a!=t)return e.s=-t,s.plus(e);var l=s.e/u,f=e.e/u,d=s.c,h=e.c;if(!l||!f){if(!d||!h)return d?(e.s=-t,e):new $(h?s:NaN);if(!d[0]||!h[0])return h[0]?(e.s=-t,e):new $(d[0]?s:3==k?-0:0)}if(l=p(l),f=p(f),d=d.slice(),a=l-f){for((o=a<0)?(a=-a,i=d):(f=l,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=d.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(d[t]!=h[t]){o=d[t]<h[t];break}if(o&&(i=d,d=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=d.length))>0)for(;t--;d[r++]=0);for(t=c-1;n>a;){if(d[--n]<h[n]){for(r=n;r&&!d[--r];d[r]=t);--d[r],d[n]+=c}d[n]-=h[n]}for(;0==d[0];d.splice(0,1),--f);return d[0]?q(e,d,f):(e.s=3==k?-1:1,e.c=[e.e=0],e)},I.modulo=I.mod=function(e,t){var n,i,o=this;return e=new $(e,t),!o.c||!e.s||e.c&&!e.c[0]?new $(NaN):!e.c||o.c&&!o.c[0]?new $(o):(9==B?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,B),(e=o.minus(n.times(e))).c[0]||1!=B||(e.s=o.s),e)},I.multipliedBy=I.times=function(e,t){var r,n,i,o,s,a,l,f,h,b,m,g,v,y,_,w=this,E=w.c,O=(e=new $(e,t)).c;if(!(E&&O&&E[0]&&O[0]))return!w.s||!e.s||E&&!E[0]&&!O||O&&!O[0]&&!E?e.c=e.e=e.s=null:(e.s*=w.s,E&&O?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=p(w.e/u)+p(e.e/u),e.s*=w.s,(l=E.length)<(b=O.length)&&(v=E,E=O,O=v,i=l,l=b,b=i),i=l+b,v=[];i--;v.push(0));for(y=c,_=d,i=b;--i>=0;){for(r=0,m=O[i]%_,g=O[i]/_|0,o=i+(s=l);o>i;)r=((f=m*(f=E[--s]%_)+(a=g*f+(h=E[s]/_|0)*m)%_*_+v[o]+r)/y|0)+(a/_|0)+g*h,v[o--]=f%y;v[o]=r}return r?++n:v.splice(0,1),q(e,v,n)},I.negated=function(){var e=new $(this);return e.s=-e.s||null,e},I.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new $(e,t)).s,!i||!t)return new $(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/u,s=e.e/u,a=n.c,l=e.c;if(!o||!s){if(!a||!l)return new $(i/0);if(!a[0]||!l[0])return l[0]?e:new $(a[0]?n:0*i)}if(o=p(o),s=p(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=l):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=l.length)<0&&(r=l,l=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+l[t]+i)/c|0,a[t]=c===a[t]?0:a[t]%c;return i&&(a=[i].concat(a),++s),q(e,a,s)},I.precision=I.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return g(e,1,h),null==t?t=k:g(t,0,8),W(new $(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*u+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},I.shiftedBy=function(e){return g(e,-9007199254740991,l),this.times("1e"+e)},I.squareRoot=I.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,c=s.s,u=s.e,l=L+4,f=new $("0.5");if(1!==c||!a||!a[0])return new $(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(c=Math.sqrt(+Z(s)))||c==1/0?(((t=b(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=p((u+1)/2)-(u<0||u%2),n=new $(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new $(c+""),n.c[0])for((c=(u=n.e)+l)<3&&(c=0);;)if(o=n,n=f.times(o.plus(r(s,o,l,1))),b(o.c).slice(0,c)===(t=b(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(W(n,n.e+L+2,1),e=!n.times(n).eq(s));break}if(!i&&(W(o,o.e+L+2,0),o.times(o).eq(s))){n=o;break}l+=4,c+=4,i=1}return W(n,n.e+L+1,k,e)},I.toExponential=function(e,t){return null!=e&&(g(e,0,h),e++),V(this,e,t,1)},I.toFixed=function(e,t){return null!=e&&(g(e,0,h),e=e+this.e+1),V(this,e,t)},I.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=K;else if("object"!=typeof r)throw Error(s+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),c=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",f=a[0],d=a[1],h=i.s<0,p=h?f.slice(1):f,b=p.length;if(u&&(o=c,c=u,u=o,b-=o),c>0&&b>0){for(o=b%c||c,f=p.substr(0,o);o<b;o+=c)f+=l+p.substr(o,c);u>0&&(f+=l+p.slice(o)),h&&(f="-"+f)}n=d?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):f}return(r.prefix||"")+n+(r.suffix||"")},I.toFraction=function(e){var t,n,i,o,a,c,l,d,h,p,m,g,v=this,y=v.c;if(null!=e&&(!(l=new $(e)).isInteger()&&(l.c||1!==l.s)||l.lt(M)))throw Error(s+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+Z(l));if(!y)return new $(v);for(t=new $(M),h=n=new $(M),i=d=new $(M),g=b(y),a=t.e=g.length-v.e-1,t.c[0]=f[(c=a%u)<0?u+c:c],e=!e||l.comparedTo(t)>0?a>0?t:h:l,c=D,D=1/0,l=new $(g),d.c[0]=0;p=r(l,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,h=d.plus(p.times(o=h)),d=o,t=l.minus(p.times(o=t)),l=o;return o=r(e.minus(n),i,0,1),d=d.plus(o.times(h)),n=n.plus(o.times(i)),d.s=h.s=v.s,m=r(h,i,a*=2,k).minus(v).abs().comparedTo(r(d,n,a,k).minus(v).abs())<1?[h,i]:[d,n],D=c,m},I.toNumber=function(){return+Z(this)},I.toPrecision=function(e,t){return null!=e&&g(e,1,h),V(this,e,t,2)},I.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=i<=N||i>=C?y(b(r.c),i):_(b(r.c),i,"0"):10===e&&G?t=_(b((r=W(new $(r),L+i+1,k)).c),r.e,"0"):(g(e,2,H.length,"Base"),t=w(_(b(r.c),i,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},I.valueOf=I.toJSON=function(){return Z(this)},I._isBigNumber=!0,I[Symbol.toStringTag]="BigNumber",I[Symbol.for("nodejs.util.inspect.custom")]=I.valueOf,null!=t&&$.set(t),$}();const E=w},763:e=>{"use strict";e.exports={i8:"6.5.4"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(2353)})()));
|