@dfinity/nns 0.2.1 → 0.2.2-nightly-2022-03-03

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.
Files changed (54) hide show
  1. package/dist/candid/governance.certified.idl.d.ts +2 -0
  2. package/dist/candid/governance.certified.idl.js +704 -0
  3. package/dist/candid/governance.did +338 -0
  4. package/dist/candid/governance.idl.d.ts +5 -0
  5. package/dist/candid/governance.idl.js +712 -0
  6. package/dist/candid/governanceTypes.d.ts +413 -0
  7. package/dist/candid/payloads.did +168 -0
  8. package/dist/candid/payloads.idl.d.ts +20 -0
  9. package/dist/candid/payloads.idl.js +163 -0
  10. package/dist/cjs/index.cjs.js +24 -24
  11. package/dist/cjs/index.cjs.js.map +3 -3
  12. package/dist/esm/account_identifier.js +1 -1
  13. package/dist/esm/chunk-23KBPF6P.js +4 -0
  14. package/dist/esm/chunk-23KBPF6P.js.map +7 -0
  15. package/dist/esm/chunk-6OQVGWT6.js +2 -0
  16. package/dist/esm/{chunk-X2SHUWG3.js.map → chunk-6OQVGWT6.js.map} +1 -1
  17. package/dist/esm/{chunk-NYI672WX.js → chunk-7EVRADY2.js} +3 -3
  18. package/dist/esm/{chunk-NYI672WX.js.map → chunk-7EVRADY2.js.map} +3 -3
  19. package/dist/esm/chunk-G4YDAU7G.js +3 -0
  20. package/dist/esm/chunk-G4YDAU7G.js.map +7 -0
  21. package/dist/esm/{chunk-HMU24NWJ.js → chunk-I56YMTHW.js} +3 -3
  22. package/dist/esm/{chunk-HMU24NWJ.js.map → chunk-I56YMTHW.js.map} +0 -0
  23. package/dist/esm/{chunk-FVDRR6PO.js → chunk-L3JQ3U5O.js} +2 -2
  24. package/dist/esm/{chunk-FVDRR6PO.js.map → chunk-L3JQ3U5O.js.map} +0 -0
  25. package/dist/esm/{chunk-YL3F3CIN.js → chunk-PFJHLT6T.js} +2 -2
  26. package/dist/esm/{chunk-YL3F3CIN.js.map → chunk-PFJHLT6T.js.map} +2 -2
  27. package/dist/esm/governance.js +1 -1
  28. package/dist/esm/icp.js +1 -1
  29. package/dist/esm/index.js +1 -1
  30. package/dist/esm/index.js.map +3 -3
  31. package/dist/esm/ledger.js +1 -1
  32. package/dist/proto/base_types.proto +60 -0
  33. package/dist/proto/base_types_pb.d.ts +144 -0
  34. package/dist/proto/base_types_pb.js +1071 -0
  35. package/dist/proto/ledger.proto +277 -0
  36. package/dist/proto/ledger_pb.d.ts +911 -0
  37. package/dist/proto/ledger_pb.js +6555 -0
  38. package/dist/types/canisters/governance/request.converters.d.ts +8 -25
  39. package/dist/types/canisters/governance/response.converters.d.ts +8 -30
  40. package/dist/types/governance.d.ts +29 -6
  41. package/dist/types/index.d.ts +2 -0
  42. package/dist/types/types/governance.d.ts +14 -0
  43. package/dist/types/types/ledger.d.ts +1 -1
  44. package/dist/types/utils/neurons.utils.d.ts +13 -0
  45. package/package.json +6 -4
  46. package/dist/esm/chunk-4FZAJTYF.js +0 -2
  47. package/dist/esm/chunk-4FZAJTYF.js.map +0 -7
  48. package/dist/esm/chunk-LNMGZ6W7.js +0 -3
  49. package/dist/esm/chunk-LNMGZ6W7.js.map +0 -7
  50. package/dist/esm/chunk-RPOIUQZO.js +0 -2
  51. package/dist/esm/chunk-RPOIUQZO.js.map +0 -7
  52. package/dist/esm/chunk-SO23SIWX.js +0 -3
  53. package/dist/esm/chunk-SO23SIWX.js.map +0 -7
  54. package/dist/esm/chunk-X2SHUWG3.js +0 -2
@@ -1,4 +1,4 @@
1
- import{a as U}from"./chunk-4FZAJTYF.js";var ar=U((exports,module)=>{(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=window:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(i){return Object.prototype.toString.call(i)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(i){return typeof i=="object"&&i.buffer&&i.buffer.constructor===ArrayBuffer});var createOutputMethod=function(i,r){return function(t){return new Sha256(r,!0).update(t)[i]()}},createMethod=function(i){var r=createOutputMethod("hex",i);NODE_JS&&(r=nodeWrap(r,i)),r.create=function(){return new Sha256(i)},r.update=function(n){return r.create().update(n)};for(var t=0;t<OUTPUT_TYPES.length;++t){var e=OUTPUT_TYPES[t];r[e]=createOutputMethod(e,i)}return r},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(i){if(typeof i=="string")return crypto.createHash(algorithm).update(i,"utf8").digest("hex");if(i==null)throw new Error(ERROR);return i.constructor===ArrayBuffer&&(i=new Uint8Array(i)),Array.isArray(i)||ArrayBuffer.isView(i)||i.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(i)).digest("hex"):method(i)};return nodeMethod},createHmacOutputMethod=function(i,r){return function(t,e){return new HmacSha256(t,r,!0).update(e)[i]()}},createHmacMethod=function(i){var r=createHmacOutputMethod("hex",i);r.create=function(n){return new HmacSha256(n,i)},r.update=function(n,h){return r.create(n).update(h)};for(var t=0;t<OUTPUT_TYPES.length;++t){var e=OUTPUT_TYPES[t];r[e]=createHmacOutputMethod(e,i)}return r};function Sha256(i,r){r?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=i}Sha256.prototype.update=function(i){if(!this.finalized){var r,t=typeof i;if(t!=="string"){if(t==="object"){if(i===null)throw new Error(ERROR);if(ARRAY_BUFFER&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!Array.isArray(i)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(i)))throw new Error(ERROR)}else throw new Error(ERROR);r=!0}for(var e,n=0,h,o=i.length,a=this.blocks;n<o;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),r)for(h=this.start;n<o&&h<64;++n)a[h>>2]|=i[n]<<SHIFT[h++&3];else for(h=this.start;n<o&&h<64;++n)e=i.charCodeAt(n),e<128?a[h>>2]|=e<<SHIFT[h++&3]:e<2048?(a[h>>2]|=(192|e>>6)<<SHIFT[h++&3],a[h>>2]|=(128|e&63)<<SHIFT[h++&3]):e<55296||e>=57344?(a[h>>2]|=(224|e>>12)<<SHIFT[h++&3],a[h>>2]|=(128|e>>6&63)<<SHIFT[h++&3],a[h>>2]|=(128|e&63)<<SHIFT[h++&3]):(e=65536+((e&1023)<<10|i.charCodeAt(++n)&1023),a[h>>2]|=(240|e>>18)<<SHIFT[h++&3],a[h>>2]|=(128|e>>12&63)<<SHIFT[h++&3],a[h>>2]|=(128|e>>6&63)<<SHIFT[h++&3],a[h>>2]|=(128|e&63)<<SHIFT[h++&3]);this.lastByteIndex=h,this.bytes+=h-this.start,h>=64?(this.block=a[16],this.start=h-64,this.hash(),this.hashed=!0):this.start=h}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var i=this.blocks,r=this.lastByteIndex;i[16]=this.block,i[r>>2]|=EXTRA[r&3],this.block=i[16],r>=56&&(this.hashed||this.hash(),i[0]=this.block,i[16]=i[1]=i[2]=i[3]=i[4]=i[5]=i[6]=i[7]=i[8]=i[9]=i[10]=i[11]=i[12]=i[13]=i[14]=i[15]=0),i[14]=this.hBytes<<3|this.bytes>>>29,i[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var i=this.h0,r=this.h1,t=this.h2,e=this.h3,n=this.h4,h=this.h5,o=this.h6,a=this.h7,f=this.blocks,s,x,c,l,p,y,A,C,T,X,m;for(s=16;s<64;++s)p=f[s-15],x=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,p=f[s-2],c=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,f[s]=f[s-16]+x+f[s-7]+c<<0;for(m=r&t,s=0;s<64;s+=4)this.first?(this.is224?(C=300032,p=f[0]-1413257819,a=p-150054599<<0,e=p+24177077<<0):(C=704751109,p=f[0]-210244248,a=p-1521486534<<0,e=p+143694565<<0),this.first=!1):(x=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),c=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),C=i&r,l=C^i&t^m,A=n&h^~n&o,p=a+c+A+K[s]+f[s],y=x+l,a=e+p<<0,e=p+y<<0),x=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),T=e&i,l=T^e&r^C,A=a&n^~a&h,p=o+c+A+K[s+1]+f[s+1],y=x+l,o=t+p<<0,t=p+y<<0,x=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),X=t&e,l=X^t&i^T,A=o&a^~o&n,p=h+c+A+K[s+2]+f[s+2],y=x+l,h=r+p<<0,r=p+y<<0,x=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),c=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),m=r&t,l=m^r&e^X,A=h&o^~h&a,p=n+c+A+K[s+3]+f[s+3],y=x+l,n=i+p<<0,i=p+y<<0;this.h0=this.h0+i<<0,this.h1=this.h1+r<<0,this.h2=this.h2+t<<0,this.h3=this.h3+e<<0,this.h4=this.h4+n<<0,this.h5=this.h5+h<<0,this.h6=this.h6+o<<0,this.h7=this.h7+a<<0},Sha256.prototype.hex=function(){this.finalize();var i=this.h0,r=this.h1,t=this.h2,e=this.h3,n=this.h4,h=this.h5,o=this.h6,a=this.h7,f=HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[h&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15];return this.is224||(f+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]),f},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var i=this.h0,r=this.h1,t=this.h2,e=this.h3,n=this.h4,h=this.h5,o=this.h6,a=this.h7,f=[i>>24&255,i>>16&255,i>>8&255,i&255,r>>24&255,r>>16&255,r>>8&255,r&255,t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24&255,n>>16&255,n>>8&255,n&255,h>>24&255,h>>16&255,h>>8&255,h&255,o>>24&255,o>>16&255,o>>8&255,o&255];return this.is224||f.push(a>>24&255,a>>16&255,a>>8&255,a&255),f},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var i=new ArrayBuffer(this.is224?28:32),r=new DataView(i);return r.setUint32(0,this.h0),r.setUint32(4,this.h1),r.setUint32(8,this.h2),r.setUint32(12,this.h3),r.setUint32(16,this.h4),r.setUint32(20,this.h5),r.setUint32(24,this.h6),this.is224||r.setUint32(28,this.h7),i};function HmacSha256(i,r,t){var e,n=typeof i;if(n==="string"){var h=[],o=i.length,a=0,f;for(e=0;e<o;++e)f=i.charCodeAt(e),f<128?h[a++]=f:f<2048?(h[a++]=192|f>>6,h[a++]=128|f&63):f<55296||f>=57344?(h[a++]=224|f>>12,h[a++]=128|f>>6&63,h[a++]=128|f&63):(f=65536+((f&1023)<<10|i.charCodeAt(++e)&1023),h[a++]=240|f>>18,h[a++]=128|f>>12&63,h[a++]=128|f>>6&63,h[a++]=128|f&63);i=h}else if(n==="object"){if(i===null)throw new Error(ERROR);if(ARRAY_BUFFER&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!Array.isArray(i)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(i)))throw new Error(ERROR)}else throw new Error(ERROR);i.length>64&&(i=new Sha256(r,!0).update(i).array());var s=[],x=[];for(e=0;e<64;++e){var c=i[e]||0;s[e]=92^c,x[e]=54^c}Sha256.call(this,r,t),this.update(x),this.oKeyPad=s,this.inner=!0,this.sharedMemory=t}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var i=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(i),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var P=U(b=>{"use strict";b.byteLength=fr;b.toByteArray=cr;b.fromByteArray=lr;var S=[],E=[],ur=typeof Uint8Array!="undefined"?Uint8Array:Array,M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(B=0,z=M.length;B<z;++B)S[B]=M[B],E[M.charCodeAt(B)]=B;var B,z;E["-".charCodeAt(0)]=62;E["_".charCodeAt(0)]=63;function V(i){var r=i.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=i.indexOf("=");t===-1&&(t=r);var e=t===r?0:4-t%4;return[t,e]}function fr(i){var r=V(i),t=r[0],e=r[1];return(t+e)*3/4-e}function sr(i,r,t){return(r+t)*3/4-t}function cr(i){var r,t=V(i),e=t[0],n=t[1],h=new ur(sr(i,e,n)),o=0,a=n>0?e-4:e,f;for(f=0;f<a;f+=4)r=E[i.charCodeAt(f)]<<18|E[i.charCodeAt(f+1)]<<12|E[i.charCodeAt(f+2)]<<6|E[i.charCodeAt(f+3)],h[o++]=r>>16&255,h[o++]=r>>8&255,h[o++]=r&255;return n===2&&(r=E[i.charCodeAt(f)]<<2|E[i.charCodeAt(f+1)]>>4,h[o++]=r&255),n===1&&(r=E[i.charCodeAt(f)]<<10|E[i.charCodeAt(f+1)]<<4|E[i.charCodeAt(f+2)]>>2,h[o++]=r>>8&255,h[o++]=r&255),h}function xr(i){return S[i>>18&63]+S[i>>12&63]+S[i>>6&63]+S[i&63]}function pr(i,r,t){for(var e,n=[],h=r;h<t;h+=3)e=(i[h]<<16&16711680)+(i[h+1]<<8&65280)+(i[h+2]&255),n.push(xr(e));return n.join("")}function lr(i){for(var r,t=i.length,e=t%3,n=[],h=16383,o=0,a=t-e;o<a;o+=h)n.push(pr(i,o,o+h>a?a:o+h));return e===1?(r=i[t-1],n.push(S[r>>2]+S[r<<4&63]+"==")):e===2&&(r=(i[t-2]<<8)+i[t-1],n.push(S[r>>10]+S[r>>4&63]+S[r<<2&63]+"=")),n.join("")}});var q=U(k=>{k.read=function(i,r,t,e,n){var h,o,a=n*8-e-1,f=(1<<a)-1,s=f>>1,x=-7,c=t?n-1:0,l=t?-1:1,p=i[r+c];for(c+=l,h=p&(1<<-x)-1,p>>=-x,x+=a;x>0;h=h*256+i[r+c],c+=l,x-=8);for(o=h&(1<<-x)-1,h>>=-x,x+=e;x>0;o=o*256+i[r+c],c+=l,x-=8);if(h===0)h=1-s;else{if(h===f)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,e),h=h-s}return(p?-1:1)*o*Math.pow(2,h-e)};k.write=function(i,r,t,e,n,h){var o,a,f,s=h*8-n-1,x=(1<<s)-1,c=x>>1,l=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=e?0:h-1,y=e?1:-1,A=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,o=x):(o=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+c>=1?r+=l/f:r+=l*Math.pow(2,1-c),r*f>=2&&(o++,f/=2),o+c>=x?(a=0,o=x):o+c>=1?(a=(r*f-1)*Math.pow(2,n),o=o+c):(a=r*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;i[t+p]=a&255,p+=y,a/=256,n-=8);for(o=o<<n|a,s+=n;s>0;i[t+p]=o&255,p+=y,o/=256,s-=8);i[t+p-y]|=A*128}});var Dr=U(v=>{"use strict";var O=P(),d=q(),j=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;v.Buffer=u;v.SlowBuffer=Sr;v.INSPECT_MAX_BYTES=50;var I=2147483647;v.kMaxLength=I;u.TYPED_ARRAY_SUPPORT=Fr();!u.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&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.");function Fr(){try{var i=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(i,r),i.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function R(i){if(i>I)throw new RangeError('The value "'+i+'" is invalid for option "size"');var r=new Uint8Array(i);return Object.setPrototypeOf(r,u.prototype),r}function u(i,r,t){if(typeof i=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return D(i)}return G(i,r,t)}u.poolSize=8192;function G(i,r,t){if(typeof i=="string")return wr(i,r);if(ArrayBuffer.isView(i))return Er(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(H(i,ArrayBuffer)||i&&H(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(H(i,SharedArrayBuffer)||i&&H(i.buffer,SharedArrayBuffer)))return L(i,r,t);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var e=i.valueOf&&i.valueOf();if(e!=null&&e!==i)return u.from(e,r,t);var n=Ar(i);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return u.from(i[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}u.from=function(i,r,t){return G(i,r,t)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function Z(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function yr(i,r,t){return Z(i),i<=0?R(i):r!==void 0?typeof t=="string"?R(i).fill(r,t):R(i).fill(r):R(i)}u.alloc=function(i,r,t){return yr(i,r,t)};function D(i){return Z(i),R(i<0?0:W(i)|0)}u.allocUnsafe=function(i){return D(i)};u.allocUnsafeSlow=function(i){return D(i)};function wr(i,r){if((typeof r!="string"||r==="")&&(r="utf8"),!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=Q(i,r)|0,e=R(t),n=e.write(i,r);return n!==t&&(e=e.slice(0,n)),e}function N(i){for(var r=i.length<0?0:W(i.length)|0,t=R(r),e=0;e<r;e+=1)t[e]=i[e]&255;return t}function Er(i){if(H(i,Uint8Array)){var r=new Uint8Array(i);return L(r.buffer,r.byteOffset,r.byteLength)}return N(i)}function L(i,r,t){if(r<0||i.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');var e;return r===void 0&&t===void 0?e=new Uint8Array(i):t===void 0?e=new Uint8Array(i,r):e=new Uint8Array(i,r,t),Object.setPrototypeOf(e,u.prototype),e}function Ar(i){if(u.isBuffer(i)){var r=W(i.length)|0,t=R(r);return t.length===0||i.copy(t,0,0,r),t}if(i.length!==void 0)return typeof i.length!="number"||J(i.length)?R(0):N(i);if(i.type==="Buffer"&&Array.isArray(i.data))return N(i.data)}function W(i){if(i>=I)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I.toString(16)+" bytes");return i|0}function Sr(i){return+i!=i&&(i=0),u.alloc(+i)}u.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==u.prototype};u.compare=function(r,t){if(H(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(r)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;for(var e=r.length,n=t.length,h=0,o=Math.min(e,n);h<o;++h)if(r[h]!==t[h]){e=r[h],n=t[h];break}return e<n?-1:n<e?1:0};u.isEncoding=function(r){switch(String(r).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}};u.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var e;if(t===void 0)for(t=0,e=0;e<r.length;++e)t+=r[e].length;var n=u.allocUnsafe(t),h=0;for(e=0;e<r.length;++e){var o=r[e];if(H(o,Uint8Array))h+o.length>n.length?u.from(o).copy(n,h):Uint8Array.prototype.set.call(n,o,h);else if(u.isBuffer(o))o.copy(n,h);else throw new TypeError('"list" argument must be an Array of Buffers');h+=o.length}return n};function Q(i,r){if(u.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||H(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);var t=i.length,e=arguments.length>2&&arguments[2]===!0;if(!e&&t===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Y(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return or(i).length;default:if(n)return e?-1:Y(i).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=Q;function Hr(i,r,t){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return Ir(this,r,t);case"utf8":case"utf-8":return tr(this,r,t);case"ascii":return Ur(this,r,t);case"latin1":case"binary":return br(this,r,t);case"base64":return Cr(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gr(this,r,t);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}u.prototype._isBuffer=!0;function _(i,r,t){var e=i[r];i[r]=i[t],i[t]=e}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)_(this,t,t+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this};u.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?tr(this,0,r):Hr.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(r){if(!u.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",t=v.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};j&&(u.prototype[j]=u.prototype.inspect);u.prototype.compare=function(r,t,e,n,h){if(H(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),e===void 0&&(e=r?r.length:0),n===void 0&&(n=0),h===void 0&&(h=this.length),t<0||e>r.length||n<0||h>this.length)throw new RangeError("out of range index");if(n>=h&&t>=e)return 0;if(n>=h)return-1;if(t>=e)return 1;if(t>>>=0,e>>>=0,n>>>=0,h>>>=0,this===r)return 0;for(var o=h-n,a=e-t,f=Math.min(o,a),s=this.slice(n,h),x=r.slice(t,e),c=0;c<f;++c)if(s[c]!==x[c]){o=s[c],a=x[c];break}return o<a?-1:a<o?1:0};function $(i,r,t,e,n){if(i.length===0)return-1;if(typeof t=="string"?(e=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,J(t)&&(t=n?0:i.length-1),t<0&&(t=i.length+t),t>=i.length){if(n)return-1;t=i.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=u.from(r,e)),u.isBuffer(r))return r.length===0?-1:rr(i,r,t,e,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(i,r,t):Uint8Array.prototype.lastIndexOf.call(i,r,t):rr(i,[r],t,e,n);throw new TypeError("val must be string, number or Buffer")}function rr(i,r,t,e,n){var h=1,o=i.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;h=2,o/=2,a/=2,t/=2}function f(p,y){return h===1?p[y]:p.readUInt16BE(y*h)}var s;if(n){var x=-1;for(s=t;s<o;s++)if(f(i,s)===f(r,x===-1?0:s-x)){if(x===-1&&(x=s),s-x+1===a)return x*h}else x!==-1&&(s-=s-x),x=-1}else for(t+a>o&&(t=o-a),s=t;s>=0;s--){for(var c=!0,l=0;l<a;l++)if(f(i,s+l)!==f(r,l)){c=!1;break}if(c)return s}return-1}u.prototype.includes=function(r,t,e){return this.indexOf(r,t,e)!==-1};u.prototype.indexOf=function(r,t,e){return $(this,r,t,e,!0)};u.prototype.lastIndexOf=function(r,t,e){return $(this,r,t,e,!1)};function Rr(i,r,t,e){t=Number(t)||0;var n=i.length-t;e?(e=Number(e),e>n&&(e=n)):e=n;var h=r.length;e>h/2&&(e=h/2);for(var o=0;o<e;++o){var a=parseInt(r.substr(o*2,2),16);if(J(a))return o;i[t+o]=a}return o}function Br(i,r,t,e){return g(Y(r,i.length-t),i,t,e)}function _r(i,r,t,e){return g(Mr(r),i,t,e)}function dr(i,r,t,e){return g(or(r),i,t,e)}function vr(i,r,t,e){return g(kr(r,i.length-t),i,t,e)}u.prototype.write=function(r,t,e,n){if(t===void 0)n="utf8",e=this.length,t=0;else if(e===void 0&&typeof t=="string")n=t,e=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(e)?(e=e>>>0,n===void 0&&(n="utf8")):(n=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var h=this.length-t;if((e===void 0||e>h)&&(e=h),r.length>0&&(e<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return Rr(this,r,t,e);case"utf8":case"utf-8":return Br(this,r,t,e);case"ascii":case"latin1":case"binary":return _r(this,r,t,e);case"base64":return dr(this,r,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vr(this,r,t,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Cr(i,r,t){return r===0&&t===i.length?O.fromByteArray(i):O.fromByteArray(i.slice(r,t))}function tr(i,r,t){t=Math.min(i.length,t);for(var e=[],n=r;n<t;){var h=i[n],o=null,a=h>239?4:h>223?3:h>191?2:1;if(n+a<=t){var f,s,x,c;switch(a){case 1:h<128&&(o=h);break;case 2:f=i[n+1],(f&192)===128&&(c=(h&31)<<6|f&63,c>127&&(o=c));break;case 3:f=i[n+1],s=i[n+2],(f&192)===128&&(s&192)===128&&(c=(h&15)<<12|(f&63)<<6|s&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:f=i[n+1],s=i[n+2],x=i[n+3],(f&192)===128&&(s&192)===128&&(x&192)===128&&(c=(h&15)<<18|(f&63)<<12|(s&63)<<6|x&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,e.push(o>>>10&1023|55296),o=56320|o&1023),e.push(o),n+=a}return mr(e)}var ir=4096;function mr(i){var r=i.length;if(r<=ir)return String.fromCharCode.apply(String,i);for(var t="",e=0;e<r;)t+=String.fromCharCode.apply(String,i.slice(e,e+=ir));return t}function Ur(i,r,t){var e="";t=Math.min(i.length,t);for(var n=r;n<t;++n)e+=String.fromCharCode(i[n]&127);return e}function br(i,r,t){var e="";t=Math.min(i.length,t);for(var n=r;n<t;++n)e+=String.fromCharCode(i[n]);return e}function Ir(i,r,t){var e=i.length;(!r||r<0)&&(r=0),(!t||t<0||t>e)&&(t=e);for(var n="",h=r;h<t;++h)n+=Or[i[h]];return n}function gr(i,r,t){for(var e=i.slice(r,t),n="",h=0;h<e.length-1;h+=2)n+=String.fromCharCode(e[h]+e[h+1]*256);return n}u.prototype.slice=function(r,t){var e=this.length;r=~~r,t=t===void 0?e:~~t,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),t<0?(t+=e,t<0&&(t=0)):t>e&&(t=e),t<r&&(t=r);var n=this.subarray(r,t);return Object.setPrototypeOf(n,u.prototype),n};function F(i,r,t){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>t)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(r,t,e){r=r>>>0,t=t>>>0,e||F(r,t,this.length);for(var n=this[r],h=1,o=0;++o<t&&(h*=256);)n+=this[r+o]*h;return n};u.prototype.readUintBE=u.prototype.readUIntBE=function(r,t,e){r=r>>>0,t=t>>>0,e||F(r,t,this.length);for(var n=this[r+--t],h=1;t>0&&(h*=256);)n+=this[r+--t]*h;return n};u.prototype.readUint8=u.prototype.readUInt8=function(r,t){return r=r>>>0,t||F(r,1,this.length),this[r]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||F(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||F(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||F(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||F(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,t,e){r=r>>>0,t=t>>>0,e||F(r,t,this.length);for(var n=this[r],h=1,o=0;++o<t&&(h*=256);)n+=this[r+o]*h;return h*=128,n>=h&&(n-=Math.pow(2,8*t)),n};u.prototype.readIntBE=function(r,t,e){r=r>>>0,t=t>>>0,e||F(r,t,this.length);for(var n=t,h=1,o=this[r+--n];n>0&&(h*=256);)o+=this[r+--n]*h;return h*=128,o>=h&&(o-=Math.pow(2,8*t)),o};u.prototype.readInt8=function(r,t){return r=r>>>0,t||F(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,t){r=r>>>0,t||F(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};u.prototype.readInt16BE=function(r,t){r=r>>>0,t||F(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};u.prototype.readInt32LE=function(r,t){return r=r>>>0,t||F(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,t){return r=r>>>0,t||F(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,t){return r=r>>>0,t||F(r,4,this.length),d.read(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,t){return r=r>>>0,t||F(r,4,this.length),d.read(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||F(r,8,this.length),d.read(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||F(r,8,this.length),d.read(this,r,!1,52,8)};function w(i,r,t,e,n,h){if(!u.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<h)throw new RangeError('"value" argument is out of bounds');if(t+e>i.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(r,t,e,n){if(r=+r,t=t>>>0,e=e>>>0,!n){var h=Math.pow(2,8*e)-1;w(this,r,t,e,h,0)}var o=1,a=0;for(this[t]=r&255;++a<e&&(o*=256);)this[t+a]=r/o&255;return t+e};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(r,t,e,n){if(r=+r,t=t>>>0,e=e>>>0,!n){var h=Math.pow(2,8*e)-1;w(this,r,t,e,h,0)}var o=e-1,a=1;for(this[t+o]=r&255;--o>=0&&(a*=256);)this[t+o]=r/a&255;return t+e};u.prototype.writeUint8=u.prototype.writeUInt8=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,1,255,0),this[t]=r&255,t+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};u.prototype.writeIntLE=function(r,t,e,n){if(r=+r,t=t>>>0,!n){var h=Math.pow(2,8*e-1);w(this,r,t,e,h-1,-h)}var o=0,a=1,f=0;for(this[t]=r&255;++o<e&&(a*=256);)r<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(r/a>>0)-f&255;return t+e};u.prototype.writeIntBE=function(r,t,e,n){if(r=+r,t=t>>>0,!n){var h=Math.pow(2,8*e-1);w(this,r,t,e,h-1,-h)}var o=e-1,a=1,f=0;for(this[t+o]=r&255;--o>=0&&(a*=256);)r<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(r/a>>0)-f&255;return t+e};u.prototype.writeInt8=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};u.prototype.writeInt16LE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};u.prototype.writeInt16BE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};u.prototype.writeInt32LE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};u.prototype.writeInt32BE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function er(i,r,t,e,n,h){if(t+e>i.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function nr(i,r,t,e,n){return r=+r,t=t>>>0,n||er(i,r,t,4,34028234663852886e22,-34028234663852886e22),d.write(i,r,t,e,23,4),t+4}u.prototype.writeFloatLE=function(r,t,e){return nr(this,r,t,!0,e)};u.prototype.writeFloatBE=function(r,t,e){return nr(this,r,t,!1,e)};function hr(i,r,t,e,n){return r=+r,t=t>>>0,n||er(i,r,t,8,17976931348623157e292,-17976931348623157e292),d.write(i,r,t,e,52,8),t+8}u.prototype.writeDoubleLE=function(r,t,e){return hr(this,r,t,!0,e)};u.prototype.writeDoubleBE=function(r,t,e){return hr(this,r,t,!1,e)};u.prototype.copy=function(r,t,e,n){if(!u.isBuffer(r))throw new TypeError("argument should be a Buffer");if(e||(e=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<e&&(n=e),n===e||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=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),r.length-t<n-e&&(n=r.length-t+e);var h=n-e;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,e,n):Uint8Array.prototype.set.call(r,this.subarray(e,n),t),h};u.prototype.fill=function(r,t,e,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,e=this.length):typeof e=="string"&&(n=e,e=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(r.length===1){var h=r.charCodeAt(0);(n==="utf8"&&h<128||n==="latin1")&&(r=h)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<e)throw new RangeError("Out of range index");if(e<=t)return this;t=t>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var o;if(typeof r=="number")for(o=t;o<e;++o)this[o]=r;else{var a=u.isBuffer(r)?r:u.from(r,n),f=a.length;if(f===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<e-t;++o)this[o+t]=a[o%f]}return this};var Tr=/[^+/0-9A-Za-z-_]/g;function Xr(i){if(i=i.split("=")[0],i=i.trim().replace(Tr,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function Y(i,r){r=r||1/0;for(var t,e=i.length,n=null,h=[],o=0;o<e;++o){if(t=i.charCodeAt(o),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&h.push(239,191,189);continue}else if(o+1===e){(r-=3)>-1&&h.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&h.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&h.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;h.push(t)}else if(t<2048){if((r-=2)<0)break;h.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;h.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;h.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return h}function Mr(i){for(var r=[],t=0;t<i.length;++t)r.push(i.charCodeAt(t)&255);return r}function kr(i,r){for(var t,e,n,h=[],o=0;o<i.length&&!((r-=2)<0);++o)t=i.charCodeAt(o),e=t>>8,n=t%256,h.push(n),h.push(e);return h}function or(i){return O.toByteArray(Xr(i))}function g(i,r,t,e){for(var n=0;n<e&&!(n+t>=r.length||n>=i.length);++n)r[n+t]=i[n];return n}function H(i,r){return i instanceof r||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===r.name}function J(i){return i!==i}var Or=function(){for(var i="0123456789abcdef",r=new Array(256),t=0;t<16;++t)for(var e=t*16,n=0;n<16;++n)r[e+n]=i[t]+i[n];return r}()});export{ar as a,q as b,Dr as c};
1
+ import{a as U}from"./chunk-7EVRADY2.js";var ar=U((exports,module)=>{(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=window:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(i){return Object.prototype.toString.call(i)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(i){return typeof i=="object"&&i.buffer&&i.buffer.constructor===ArrayBuffer});var createOutputMethod=function(i,r){return function(t){return new Sha256(r,!0).update(t)[i]()}},createMethod=function(i){var r=createOutputMethod("hex",i);NODE_JS&&(r=nodeWrap(r,i)),r.create=function(){return new Sha256(i)},r.update=function(n){return r.create().update(n)};for(var t=0;t<OUTPUT_TYPES.length;++t){var e=OUTPUT_TYPES[t];r[e]=createOutputMethod(e,i)}return r},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(i){if(typeof i=="string")return crypto.createHash(algorithm).update(i,"utf8").digest("hex");if(i==null)throw new Error(ERROR);return i.constructor===ArrayBuffer&&(i=new Uint8Array(i)),Array.isArray(i)||ArrayBuffer.isView(i)||i.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(i)).digest("hex"):method(i)};return nodeMethod},createHmacOutputMethod=function(i,r){return function(t,e){return new HmacSha256(t,r,!0).update(e)[i]()}},createHmacMethod=function(i){var r=createHmacOutputMethod("hex",i);r.create=function(n){return new HmacSha256(n,i)},r.update=function(n,h){return r.create(n).update(h)};for(var t=0;t<OUTPUT_TYPES.length;++t){var e=OUTPUT_TYPES[t];r[e]=createHmacOutputMethod(e,i)}return r};function Sha256(i,r){r?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=i}Sha256.prototype.update=function(i){if(!this.finalized){var r,t=typeof i;if(t!=="string"){if(t==="object"){if(i===null)throw new Error(ERROR);if(ARRAY_BUFFER&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!Array.isArray(i)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(i)))throw new Error(ERROR)}else throw new Error(ERROR);r=!0}for(var e,n=0,h,o=i.length,a=this.blocks;n<o;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),r)for(h=this.start;n<o&&h<64;++n)a[h>>2]|=i[n]<<SHIFT[h++&3];else for(h=this.start;n<o&&h<64;++n)e=i.charCodeAt(n),e<128?a[h>>2]|=e<<SHIFT[h++&3]:e<2048?(a[h>>2]|=(192|e>>6)<<SHIFT[h++&3],a[h>>2]|=(128|e&63)<<SHIFT[h++&3]):e<55296||e>=57344?(a[h>>2]|=(224|e>>12)<<SHIFT[h++&3],a[h>>2]|=(128|e>>6&63)<<SHIFT[h++&3],a[h>>2]|=(128|e&63)<<SHIFT[h++&3]):(e=65536+((e&1023)<<10|i.charCodeAt(++n)&1023),a[h>>2]|=(240|e>>18)<<SHIFT[h++&3],a[h>>2]|=(128|e>>12&63)<<SHIFT[h++&3],a[h>>2]|=(128|e>>6&63)<<SHIFT[h++&3],a[h>>2]|=(128|e&63)<<SHIFT[h++&3]);this.lastByteIndex=h,this.bytes+=h-this.start,h>=64?(this.block=a[16],this.start=h-64,this.hash(),this.hashed=!0):this.start=h}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var i=this.blocks,r=this.lastByteIndex;i[16]=this.block,i[r>>2]|=EXTRA[r&3],this.block=i[16],r>=56&&(this.hashed||this.hash(),i[0]=this.block,i[16]=i[1]=i[2]=i[3]=i[4]=i[5]=i[6]=i[7]=i[8]=i[9]=i[10]=i[11]=i[12]=i[13]=i[14]=i[15]=0),i[14]=this.hBytes<<3|this.bytes>>>29,i[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var i=this.h0,r=this.h1,t=this.h2,e=this.h3,n=this.h4,h=this.h5,o=this.h6,a=this.h7,f=this.blocks,s,x,c,l,p,y,A,C,T,X,m;for(s=16;s<64;++s)p=f[s-15],x=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,p=f[s-2],c=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,f[s]=f[s-16]+x+f[s-7]+c<<0;for(m=r&t,s=0;s<64;s+=4)this.first?(this.is224?(C=300032,p=f[0]-1413257819,a=p-150054599<<0,e=p+24177077<<0):(C=704751109,p=f[0]-210244248,a=p-1521486534<<0,e=p+143694565<<0),this.first=!1):(x=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),c=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),C=i&r,l=C^i&t^m,A=n&h^~n&o,p=a+c+A+K[s]+f[s],y=x+l,a=e+p<<0,e=p+y<<0),x=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),T=e&i,l=T^e&r^C,A=a&n^~a&h,p=o+c+A+K[s+1]+f[s+1],y=x+l,o=t+p<<0,t=p+y<<0,x=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),X=t&e,l=X^t&i^T,A=o&a^~o&n,p=h+c+A+K[s+2]+f[s+2],y=x+l,h=r+p<<0,r=p+y<<0,x=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),c=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),m=r&t,l=m^r&e^X,A=h&o^~h&a,p=n+c+A+K[s+3]+f[s+3],y=x+l,n=i+p<<0,i=p+y<<0;this.h0=this.h0+i<<0,this.h1=this.h1+r<<0,this.h2=this.h2+t<<0,this.h3=this.h3+e<<0,this.h4=this.h4+n<<0,this.h5=this.h5+h<<0,this.h6=this.h6+o<<0,this.h7=this.h7+a<<0},Sha256.prototype.hex=function(){this.finalize();var i=this.h0,r=this.h1,t=this.h2,e=this.h3,n=this.h4,h=this.h5,o=this.h6,a=this.h7,f=HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[h&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15];return this.is224||(f+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]),f},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var i=this.h0,r=this.h1,t=this.h2,e=this.h3,n=this.h4,h=this.h5,o=this.h6,a=this.h7,f=[i>>24&255,i>>16&255,i>>8&255,i&255,r>>24&255,r>>16&255,r>>8&255,r&255,t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24&255,n>>16&255,n>>8&255,n&255,h>>24&255,h>>16&255,h>>8&255,h&255,o>>24&255,o>>16&255,o>>8&255,o&255];return this.is224||f.push(a>>24&255,a>>16&255,a>>8&255,a&255),f},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var i=new ArrayBuffer(this.is224?28:32),r=new DataView(i);return r.setUint32(0,this.h0),r.setUint32(4,this.h1),r.setUint32(8,this.h2),r.setUint32(12,this.h3),r.setUint32(16,this.h4),r.setUint32(20,this.h5),r.setUint32(24,this.h6),this.is224||r.setUint32(28,this.h7),i};function HmacSha256(i,r,t){var e,n=typeof i;if(n==="string"){var h=[],o=i.length,a=0,f;for(e=0;e<o;++e)f=i.charCodeAt(e),f<128?h[a++]=f:f<2048?(h[a++]=192|f>>6,h[a++]=128|f&63):f<55296||f>=57344?(h[a++]=224|f>>12,h[a++]=128|f>>6&63,h[a++]=128|f&63):(f=65536+((f&1023)<<10|i.charCodeAt(++e)&1023),h[a++]=240|f>>18,h[a++]=128|f>>12&63,h[a++]=128|f>>6&63,h[a++]=128|f&63);i=h}else if(n==="object"){if(i===null)throw new Error(ERROR);if(ARRAY_BUFFER&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!Array.isArray(i)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(i)))throw new Error(ERROR)}else throw new Error(ERROR);i.length>64&&(i=new Sha256(r,!0).update(i).array());var s=[],x=[];for(e=0;e<64;++e){var c=i[e]||0;s[e]=92^c,x[e]=54^c}Sha256.call(this,r,t),this.update(x),this.oKeyPad=s,this.inner=!0,this.sharedMemory=t}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var i=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(i),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var P=U(b=>{"use strict";b.byteLength=fr;b.toByteArray=cr;b.fromByteArray=lr;var S=[],E=[],ur=typeof Uint8Array!="undefined"?Uint8Array:Array,M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(B=0,z=M.length;B<z;++B)S[B]=M[B],E[M.charCodeAt(B)]=B;var B,z;E["-".charCodeAt(0)]=62;E["_".charCodeAt(0)]=63;function V(i){var r=i.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=i.indexOf("=");t===-1&&(t=r);var e=t===r?0:4-t%4;return[t,e]}function fr(i){var r=V(i),t=r[0],e=r[1];return(t+e)*3/4-e}function sr(i,r,t){return(r+t)*3/4-t}function cr(i){var r,t=V(i),e=t[0],n=t[1],h=new ur(sr(i,e,n)),o=0,a=n>0?e-4:e,f;for(f=0;f<a;f+=4)r=E[i.charCodeAt(f)]<<18|E[i.charCodeAt(f+1)]<<12|E[i.charCodeAt(f+2)]<<6|E[i.charCodeAt(f+3)],h[o++]=r>>16&255,h[o++]=r>>8&255,h[o++]=r&255;return n===2&&(r=E[i.charCodeAt(f)]<<2|E[i.charCodeAt(f+1)]>>4,h[o++]=r&255),n===1&&(r=E[i.charCodeAt(f)]<<10|E[i.charCodeAt(f+1)]<<4|E[i.charCodeAt(f+2)]>>2,h[o++]=r>>8&255,h[o++]=r&255),h}function xr(i){return S[i>>18&63]+S[i>>12&63]+S[i>>6&63]+S[i&63]}function pr(i,r,t){for(var e,n=[],h=r;h<t;h+=3)e=(i[h]<<16&16711680)+(i[h+1]<<8&65280)+(i[h+2]&255),n.push(xr(e));return n.join("")}function lr(i){for(var r,t=i.length,e=t%3,n=[],h=16383,o=0,a=t-e;o<a;o+=h)n.push(pr(i,o,o+h>a?a:o+h));return e===1?(r=i[t-1],n.push(S[r>>2]+S[r<<4&63]+"==")):e===2&&(r=(i[t-2]<<8)+i[t-1],n.push(S[r>>10]+S[r>>4&63]+S[r<<2&63]+"=")),n.join("")}});var q=U(k=>{k.read=function(i,r,t,e,n){var h,o,a=n*8-e-1,f=(1<<a)-1,s=f>>1,x=-7,c=t?n-1:0,l=t?-1:1,p=i[r+c];for(c+=l,h=p&(1<<-x)-1,p>>=-x,x+=a;x>0;h=h*256+i[r+c],c+=l,x-=8);for(o=h&(1<<-x)-1,h>>=-x,x+=e;x>0;o=o*256+i[r+c],c+=l,x-=8);if(h===0)h=1-s;else{if(h===f)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,e),h=h-s}return(p?-1:1)*o*Math.pow(2,h-e)};k.write=function(i,r,t,e,n,h){var o,a,f,s=h*8-n-1,x=(1<<s)-1,c=x>>1,l=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=e?0:h-1,y=e?1:-1,A=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,o=x):(o=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+c>=1?r+=l/f:r+=l*Math.pow(2,1-c),r*f>=2&&(o++,f/=2),o+c>=x?(a=0,o=x):o+c>=1?(a=(r*f-1)*Math.pow(2,n),o=o+c):(a=r*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;i[t+p]=a&255,p+=y,a/=256,n-=8);for(o=o<<n|a,s+=n;s>0;i[t+p]=o&255,p+=y,o/=256,s-=8);i[t+p-y]|=A*128}});var Dr=U(v=>{"use strict";var O=P(),d=q(),j=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;v.Buffer=u;v.SlowBuffer=Sr;v.INSPECT_MAX_BYTES=50;var I=2147483647;v.kMaxLength=I;u.TYPED_ARRAY_SUPPORT=Fr();!u.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&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.");function Fr(){try{var i=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(i,r),i.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function R(i){if(i>I)throw new RangeError('The value "'+i+'" is invalid for option "size"');var r=new Uint8Array(i);return Object.setPrototypeOf(r,u.prototype),r}function u(i,r,t){if(typeof i=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return D(i)}return G(i,r,t)}u.poolSize=8192;function G(i,r,t){if(typeof i=="string")return wr(i,r);if(ArrayBuffer.isView(i))return Er(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(H(i,ArrayBuffer)||i&&H(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(H(i,SharedArrayBuffer)||i&&H(i.buffer,SharedArrayBuffer)))return L(i,r,t);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var e=i.valueOf&&i.valueOf();if(e!=null&&e!==i)return u.from(e,r,t);var n=Ar(i);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return u.from(i[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}u.from=function(i,r,t){return G(i,r,t)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function Z(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function yr(i,r,t){return Z(i),i<=0?R(i):r!==void 0?typeof t=="string"?R(i).fill(r,t):R(i).fill(r):R(i)}u.alloc=function(i,r,t){return yr(i,r,t)};function D(i){return Z(i),R(i<0?0:W(i)|0)}u.allocUnsafe=function(i){return D(i)};u.allocUnsafeSlow=function(i){return D(i)};function wr(i,r){if((typeof r!="string"||r==="")&&(r="utf8"),!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=Q(i,r)|0,e=R(t),n=e.write(i,r);return n!==t&&(e=e.slice(0,n)),e}function N(i){for(var r=i.length<0?0:W(i.length)|0,t=R(r),e=0;e<r;e+=1)t[e]=i[e]&255;return t}function Er(i){if(H(i,Uint8Array)){var r=new Uint8Array(i);return L(r.buffer,r.byteOffset,r.byteLength)}return N(i)}function L(i,r,t){if(r<0||i.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');var e;return r===void 0&&t===void 0?e=new Uint8Array(i):t===void 0?e=new Uint8Array(i,r):e=new Uint8Array(i,r,t),Object.setPrototypeOf(e,u.prototype),e}function Ar(i){if(u.isBuffer(i)){var r=W(i.length)|0,t=R(r);return t.length===0||i.copy(t,0,0,r),t}if(i.length!==void 0)return typeof i.length!="number"||J(i.length)?R(0):N(i);if(i.type==="Buffer"&&Array.isArray(i.data))return N(i.data)}function W(i){if(i>=I)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I.toString(16)+" bytes");return i|0}function Sr(i){return+i!=i&&(i=0),u.alloc(+i)}u.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==u.prototype};u.compare=function(r,t){if(H(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(r)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;for(var e=r.length,n=t.length,h=0,o=Math.min(e,n);h<o;++h)if(r[h]!==t[h]){e=r[h],n=t[h];break}return e<n?-1:n<e?1:0};u.isEncoding=function(r){switch(String(r).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}};u.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var e;if(t===void 0)for(t=0,e=0;e<r.length;++e)t+=r[e].length;var n=u.allocUnsafe(t),h=0;for(e=0;e<r.length;++e){var o=r[e];if(H(o,Uint8Array))h+o.length>n.length?u.from(o).copy(n,h):Uint8Array.prototype.set.call(n,o,h);else if(u.isBuffer(o))o.copy(n,h);else throw new TypeError('"list" argument must be an Array of Buffers');h+=o.length}return n};function Q(i,r){if(u.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||H(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);var t=i.length,e=arguments.length>2&&arguments[2]===!0;if(!e&&t===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Y(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return or(i).length;default:if(n)return e?-1:Y(i).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=Q;function Hr(i,r,t){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return Ir(this,r,t);case"utf8":case"utf-8":return tr(this,r,t);case"ascii":return Ur(this,r,t);case"latin1":case"binary":return br(this,r,t);case"base64":return Cr(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gr(this,r,t);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}u.prototype._isBuffer=!0;function _(i,r,t){var e=i[r];i[r]=i[t],i[t]=e}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)_(this,t,t+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this};u.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?tr(this,0,r):Hr.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(r){if(!u.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",t=v.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};j&&(u.prototype[j]=u.prototype.inspect);u.prototype.compare=function(r,t,e,n,h){if(H(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),e===void 0&&(e=r?r.length:0),n===void 0&&(n=0),h===void 0&&(h=this.length),t<0||e>r.length||n<0||h>this.length)throw new RangeError("out of range index");if(n>=h&&t>=e)return 0;if(n>=h)return-1;if(t>=e)return 1;if(t>>>=0,e>>>=0,n>>>=0,h>>>=0,this===r)return 0;for(var o=h-n,a=e-t,f=Math.min(o,a),s=this.slice(n,h),x=r.slice(t,e),c=0;c<f;++c)if(s[c]!==x[c]){o=s[c],a=x[c];break}return o<a?-1:a<o?1:0};function $(i,r,t,e,n){if(i.length===0)return-1;if(typeof t=="string"?(e=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,J(t)&&(t=n?0:i.length-1),t<0&&(t=i.length+t),t>=i.length){if(n)return-1;t=i.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=u.from(r,e)),u.isBuffer(r))return r.length===0?-1:rr(i,r,t,e,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(i,r,t):Uint8Array.prototype.lastIndexOf.call(i,r,t):rr(i,[r],t,e,n);throw new TypeError("val must be string, number or Buffer")}function rr(i,r,t,e,n){var h=1,o=i.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;h=2,o/=2,a/=2,t/=2}function f(p,y){return h===1?p[y]:p.readUInt16BE(y*h)}var s;if(n){var x=-1;for(s=t;s<o;s++)if(f(i,s)===f(r,x===-1?0:s-x)){if(x===-1&&(x=s),s-x+1===a)return x*h}else x!==-1&&(s-=s-x),x=-1}else for(t+a>o&&(t=o-a),s=t;s>=0;s--){for(var c=!0,l=0;l<a;l++)if(f(i,s+l)!==f(r,l)){c=!1;break}if(c)return s}return-1}u.prototype.includes=function(r,t,e){return this.indexOf(r,t,e)!==-1};u.prototype.indexOf=function(r,t,e){return $(this,r,t,e,!0)};u.prototype.lastIndexOf=function(r,t,e){return $(this,r,t,e,!1)};function Rr(i,r,t,e){t=Number(t)||0;var n=i.length-t;e?(e=Number(e),e>n&&(e=n)):e=n;var h=r.length;e>h/2&&(e=h/2);for(var o=0;o<e;++o){var a=parseInt(r.substr(o*2,2),16);if(J(a))return o;i[t+o]=a}return o}function Br(i,r,t,e){return g(Y(r,i.length-t),i,t,e)}function _r(i,r,t,e){return g(Mr(r),i,t,e)}function dr(i,r,t,e){return g(or(r),i,t,e)}function vr(i,r,t,e){return g(kr(r,i.length-t),i,t,e)}u.prototype.write=function(r,t,e,n){if(t===void 0)n="utf8",e=this.length,t=0;else if(e===void 0&&typeof t=="string")n=t,e=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(e)?(e=e>>>0,n===void 0&&(n="utf8")):(n=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var h=this.length-t;if((e===void 0||e>h)&&(e=h),r.length>0&&(e<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return Rr(this,r,t,e);case"utf8":case"utf-8":return Br(this,r,t,e);case"ascii":case"latin1":case"binary":return _r(this,r,t,e);case"base64":return dr(this,r,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vr(this,r,t,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Cr(i,r,t){return r===0&&t===i.length?O.fromByteArray(i):O.fromByteArray(i.slice(r,t))}function tr(i,r,t){t=Math.min(i.length,t);for(var e=[],n=r;n<t;){var h=i[n],o=null,a=h>239?4:h>223?3:h>191?2:1;if(n+a<=t){var f,s,x,c;switch(a){case 1:h<128&&(o=h);break;case 2:f=i[n+1],(f&192)===128&&(c=(h&31)<<6|f&63,c>127&&(o=c));break;case 3:f=i[n+1],s=i[n+2],(f&192)===128&&(s&192)===128&&(c=(h&15)<<12|(f&63)<<6|s&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:f=i[n+1],s=i[n+2],x=i[n+3],(f&192)===128&&(s&192)===128&&(x&192)===128&&(c=(h&15)<<18|(f&63)<<12|(s&63)<<6|x&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,e.push(o>>>10&1023|55296),o=56320|o&1023),e.push(o),n+=a}return mr(e)}var ir=4096;function mr(i){var r=i.length;if(r<=ir)return String.fromCharCode.apply(String,i);for(var t="",e=0;e<r;)t+=String.fromCharCode.apply(String,i.slice(e,e+=ir));return t}function Ur(i,r,t){var e="";t=Math.min(i.length,t);for(var n=r;n<t;++n)e+=String.fromCharCode(i[n]&127);return e}function br(i,r,t){var e="";t=Math.min(i.length,t);for(var n=r;n<t;++n)e+=String.fromCharCode(i[n]);return e}function Ir(i,r,t){var e=i.length;(!r||r<0)&&(r=0),(!t||t<0||t>e)&&(t=e);for(var n="",h=r;h<t;++h)n+=Or[i[h]];return n}function gr(i,r,t){for(var e=i.slice(r,t),n="",h=0;h<e.length-1;h+=2)n+=String.fromCharCode(e[h]+e[h+1]*256);return n}u.prototype.slice=function(r,t){var e=this.length;r=~~r,t=t===void 0?e:~~t,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),t<0?(t+=e,t<0&&(t=0)):t>e&&(t=e),t<r&&(t=r);var n=this.subarray(r,t);return Object.setPrototypeOf(n,u.prototype),n};function F(i,r,t){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>t)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(r,t,e){r=r>>>0,t=t>>>0,e||F(r,t,this.length);for(var n=this[r],h=1,o=0;++o<t&&(h*=256);)n+=this[r+o]*h;return n};u.prototype.readUintBE=u.prototype.readUIntBE=function(r,t,e){r=r>>>0,t=t>>>0,e||F(r,t,this.length);for(var n=this[r+--t],h=1;t>0&&(h*=256);)n+=this[r+--t]*h;return n};u.prototype.readUint8=u.prototype.readUInt8=function(r,t){return r=r>>>0,t||F(r,1,this.length),this[r]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||F(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||F(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||F(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||F(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,t,e){r=r>>>0,t=t>>>0,e||F(r,t,this.length);for(var n=this[r],h=1,o=0;++o<t&&(h*=256);)n+=this[r+o]*h;return h*=128,n>=h&&(n-=Math.pow(2,8*t)),n};u.prototype.readIntBE=function(r,t,e){r=r>>>0,t=t>>>0,e||F(r,t,this.length);for(var n=t,h=1,o=this[r+--n];n>0&&(h*=256);)o+=this[r+--n]*h;return h*=128,o>=h&&(o-=Math.pow(2,8*t)),o};u.prototype.readInt8=function(r,t){return r=r>>>0,t||F(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,t){r=r>>>0,t||F(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};u.prototype.readInt16BE=function(r,t){r=r>>>0,t||F(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};u.prototype.readInt32LE=function(r,t){return r=r>>>0,t||F(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,t){return r=r>>>0,t||F(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,t){return r=r>>>0,t||F(r,4,this.length),d.read(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,t){return r=r>>>0,t||F(r,4,this.length),d.read(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||F(r,8,this.length),d.read(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||F(r,8,this.length),d.read(this,r,!1,52,8)};function w(i,r,t,e,n,h){if(!u.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<h)throw new RangeError('"value" argument is out of bounds');if(t+e>i.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(r,t,e,n){if(r=+r,t=t>>>0,e=e>>>0,!n){var h=Math.pow(2,8*e)-1;w(this,r,t,e,h,0)}var o=1,a=0;for(this[t]=r&255;++a<e&&(o*=256);)this[t+a]=r/o&255;return t+e};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(r,t,e,n){if(r=+r,t=t>>>0,e=e>>>0,!n){var h=Math.pow(2,8*e)-1;w(this,r,t,e,h,0)}var o=e-1,a=1;for(this[t+o]=r&255;--o>=0&&(a*=256);)this[t+o]=r/a&255;return t+e};u.prototype.writeUint8=u.prototype.writeUInt8=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,1,255,0),this[t]=r&255,t+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};u.prototype.writeIntLE=function(r,t,e,n){if(r=+r,t=t>>>0,!n){var h=Math.pow(2,8*e-1);w(this,r,t,e,h-1,-h)}var o=0,a=1,f=0;for(this[t]=r&255;++o<e&&(a*=256);)r<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(r/a>>0)-f&255;return t+e};u.prototype.writeIntBE=function(r,t,e,n){if(r=+r,t=t>>>0,!n){var h=Math.pow(2,8*e-1);w(this,r,t,e,h-1,-h)}var o=e-1,a=1,f=0;for(this[t+o]=r&255;--o>=0&&(a*=256);)r<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(r/a>>0)-f&255;return t+e};u.prototype.writeInt8=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};u.prototype.writeInt16LE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};u.prototype.writeInt16BE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};u.prototype.writeInt32LE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};u.prototype.writeInt32BE=function(r,t,e){return r=+r,t=t>>>0,e||w(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function er(i,r,t,e,n,h){if(t+e>i.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function nr(i,r,t,e,n){return r=+r,t=t>>>0,n||er(i,r,t,4,34028234663852886e22,-34028234663852886e22),d.write(i,r,t,e,23,4),t+4}u.prototype.writeFloatLE=function(r,t,e){return nr(this,r,t,!0,e)};u.prototype.writeFloatBE=function(r,t,e){return nr(this,r,t,!1,e)};function hr(i,r,t,e,n){return r=+r,t=t>>>0,n||er(i,r,t,8,17976931348623157e292,-17976931348623157e292),d.write(i,r,t,e,52,8),t+8}u.prototype.writeDoubleLE=function(r,t,e){return hr(this,r,t,!0,e)};u.prototype.writeDoubleBE=function(r,t,e){return hr(this,r,t,!1,e)};u.prototype.copy=function(r,t,e,n){if(!u.isBuffer(r))throw new TypeError("argument should be a Buffer");if(e||(e=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<e&&(n=e),n===e||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=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),r.length-t<n-e&&(n=r.length-t+e);var h=n-e;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,e,n):Uint8Array.prototype.set.call(r,this.subarray(e,n),t),h};u.prototype.fill=function(r,t,e,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,e=this.length):typeof e=="string"&&(n=e,e=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(r.length===1){var h=r.charCodeAt(0);(n==="utf8"&&h<128||n==="latin1")&&(r=h)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<e)throw new RangeError("Out of range index");if(e<=t)return this;t=t>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var o;if(typeof r=="number")for(o=t;o<e;++o)this[o]=r;else{var a=u.isBuffer(r)?r:u.from(r,n),f=a.length;if(f===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<e-t;++o)this[o+t]=a[o%f]}return this};var Tr=/[^+/0-9A-Za-z-_]/g;function Xr(i){if(i=i.split("=")[0],i=i.trim().replace(Tr,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function Y(i,r){r=r||1/0;for(var t,e=i.length,n=null,h=[],o=0;o<e;++o){if(t=i.charCodeAt(o),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&h.push(239,191,189);continue}else if(o+1===e){(r-=3)>-1&&h.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&h.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&h.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;h.push(t)}else if(t<2048){if((r-=2)<0)break;h.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;h.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;h.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return h}function Mr(i){for(var r=[],t=0;t<i.length;++t)r.push(i.charCodeAt(t)&255);return r}function kr(i,r){for(var t,e,n,h=[],o=0;o<i.length&&!((r-=2)<0);++o)t=i.charCodeAt(o),e=t>>8,n=t%256,h.push(n),h.push(e);return h}function or(i){return O.toByteArray(Xr(i))}function g(i,r,t,e){for(var n=0;n<e&&!(n+t>=r.length||n>=i.length);++n)r[n+t]=i[n];return n}function H(i,r){return i instanceof r||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===r.name}function J(i){return i!==i}var Or=function(){for(var i="0123456789abcdef",r=new Array(256),t=0;t<16;++t)for(var e=t*16,n=0;n<16;++n)r[e+n]=i[t]+i[n];return r}()});export{ar as a,q as b,Dr as c};
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *
@@ -14,4 +14,4 @@ import{a as U}from"./chunk-4FZAJTYF.js";var ar=U((exports,module)=>{(function(){
14
14
  * @copyright Chen, Yi-Cyuan 2014-2017
15
15
  * @license MIT
16
16
  */
17
- //# sourceMappingURL=chunk-FVDRR6PO.js.map
17
+ //# sourceMappingURL=chunk-L3JQ3U5O.js.map
@@ -1,4 +1,4 @@
1
- import{c as u,g as I,h as P}from"./chunk-HMU24NWJ.js";import{b as l}from"./chunk-X2SHUWG3.js";import{a as T}from"./chunk-NYI672WX.js";import{c as C}from"./chunk-4FZAJTYF.js";var n=C(T());var p=class{},b=class{},d=class{constructor(e){this.balance=e}},m=class{constructor(e){this.allowed_window_secs=e}},f=class{},g=class{constructor(e){this.duplicateOf=e}};var w=async(i,e,a,c)=>{let r=await i.call(e,{methodName:a,arg:c,effectiveCanisterId:e});if(!r.response.ok)return Error(["Call failed:",` Method: ${a}`,` Canister ID: ${e}`,` Request ID: ${r.requestId}`,` HTTP status code: ${r.response.status}`,` HTTP status text: ${r.response.statusText}`].join(`
1
+ import{b as u,f as I,g as P}from"./chunk-I56YMTHW.js";import{b as l}from"./chunk-6OQVGWT6.js";import{c as C,e as T}from"./chunk-7EVRADY2.js";var n=C(T());var p=class{},b=class{},d=class{constructor(e){this.balance=e}},m=class{constructor(e){this.allowed_window_secs=e}},f=class{},g=class{constructor(e){this.duplicateOf=e}};var w=async(i,e,a,c)=>{let r=await i.call(e,{methodName:a,arg:c,effectiveCanisterId:e});if(!r.response.ok)return Error(["Call failed:",` Method: ${a}`,` Canister ID: ${e}`,` Request ID: ${r.requestId}`,` HTTP status code: ${r.response.status}`,` HTTP status text: ${r.response.statusText}`].join(`
2
2
  `));try{let o=await u.pollForResponse(i,e,r.requestId,u.defaultStrategy());return new Uint8Array(o)}catch(o){if(o instanceof Error)return o;throw o}},A=async(i,e,a,c)=>{let r=await i.query(e,{methodName:a,arg:c});return r.status=="rejected"?new Error(["Call failed:",` Method: ${a}`,` Canister ID: ${e}`,` HTTP status code: ${r.reject_code}`,` HTTP status text: ${r.reject_message}`].join(`
3
3
  `)):new Uint8Array(r.reply.arg)};var y=class{constructor(e,a,c,r){this.agent=e;this.canisterId=a;this.updateFetcher=c;this.queryFetcher=r}static create(e={}){return new y(e.agent??P(),e.canisterId??I,e.updateCallOverride??w,e.queryCallOverride??A)}accountBalance=async({accountIdentifier:e,certified:a=!0})=>{let c=a?this.updateFetcher:this.queryFetcher,r=new n.AccountBalanceRequest;r.setAccount(e.toProto());let o=await c(this.agent,this.canisterId,"account_balance_pb",r.serializeBinary());if(o instanceof Error)throw Error;return l.fromE8s(BigInt(n.ICPTs.deserializeBinary(new Uint8Array(o)).getE8s()))};transfer=async({to:e,amount:a,memo:c})=>{let r=new n.SendRequest;r.setTo(e.toProto());let o=new n.Payment;if(o.setReceiverGets(a.toProto()),r.setPayment(o),c){let t=new n.Memo;t.setMemo(t.toString()),r.setMemo(t)}let s=await this.updateFetcher(this.agent,this.canisterId,"send_pb",r.serializeBinary());if(s instanceof Error){if(s.message.includes("Reject code: 5")){if(s.message.match(/Sending from (.*) is not allowed/))return new p;{let t=s.message.match(/transaction.*duplicate.* in block (\d+)/);if(t&&t.length>1)return new g(BigInt(t[1]))}{let t=s.message.match(/debit account.*, current balance: (\d*(\.\d*)?)/);if(t&&t.length>1){let h=l.fromString(t[1]);if(h instanceof l)return new d(h)}}if(s.message.includes("is in future"))return new f;{let t=s.message.match(/older than (\d+)/);if(t&&t.length>1)return new m(Number.parseInt(t[1]))}}throw s}return BigInt(n.BlockHeight.deserializeBinary(s).getHeight())}};export{p as a,b,d as c,m as d,f as e,g as f,y as g};
4
- //# sourceMappingURL=chunk-YL3F3CIN.js.map
4
+ //# sourceMappingURL=chunk-PFJHLT6T.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ledger.ts", "../../src/types/ledger.ts", "../../src/utils/proto.utils.ts"],
4
- "sourcesContent": ["import { Agent } from \"@dfinity/agent\";\nimport { Principal } from \"@dfinity/principal\";\nimport {\n AccountBalanceRequest,\n BlockHeight as PbBlockHeight,\n ICPTs,\n Memo,\n Payment,\n SendRequest,\n} from \"../proto/ledger_pb\";\nimport { AccountIdentifier } from \"./account_identifier\";\nimport { MAINNET_LEDGER_CANISTER_ID } from \"./constants/canister_ids\";\nimport { ICP } from \"./icp\";\nimport { BlockHeight } from \"./types/common\";\nimport {\n Fetcher,\n InsufficientFunds,\n InvalidSender,\n LedgerCanisterOptions,\n TransferError,\n TxCreatedInFuture,\n TxDuplicate,\n TxTooOld,\n} from \"./types/ledger\";\nimport { defaultAgent } from \"./utils/agent.utils\";\nimport { queryCall, updateCall } from \"./utils/proto.utils\";\n\nexport class LedgerCanister {\n private constructor(\n private readonly agent: Agent,\n private readonly canisterId: Principal,\n private readonly updateFetcher: Fetcher,\n private readonly queryFetcher: Fetcher\n ) {}\n\n public static create(options: LedgerCanisterOptions = {}) {\n return new LedgerCanister(\n options.agent ?? defaultAgent(),\n options.canisterId ?? MAINNET_LEDGER_CANISTER_ID,\n options.updateCallOverride ?? updateCall,\n options.queryCallOverride ?? queryCall\n );\n }\n\n /**\n * Returns the balance of the specified account identifier.\n *\n * If `certified` is true, the request is fetched as an update call, otherwise\n * it is fetched using a query call.\n */\n public accountBalance = async ({\n accountIdentifier,\n certified = true,\n }: {\n accountIdentifier: AccountIdentifier;\n certified?: boolean;\n }): Promise<ICP> => {\n const callMethod = certified ? this.updateFetcher : this.queryFetcher;\n\n const request = new AccountBalanceRequest();\n request.setAccount(accountIdentifier.toProto());\n const responseBytes = await callMethod(\n this.agent,\n this.canisterId,\n \"account_balance_pb\",\n request.serializeBinary()\n );\n\n if (responseBytes instanceof Error) {\n // An error is never expected from this endpoint.\n throw Error;\n }\n\n return ICP.fromE8s(\n BigInt(ICPTs.deserializeBinary(new Uint8Array(responseBytes)).getE8s())\n );\n };\n\n /**\n * Transfer ICP from the caller to the destination `accountIdentifier`.\n * Returns the index of the block containing the tx if it was successful.\n *\n * TODO: support remaining options (subaccounts, memos, etc.)\n */\n public transfer = async ({\n to,\n amount,\n memo,\n }: {\n to: AccountIdentifier;\n amount: ICP;\n memo?: bigint;\n }): Promise<BlockHeight | TransferError> => {\n const request = new SendRequest();\n request.setTo(to.toProto());\n\n const payment = new Payment();\n payment.setReceiverGets(amount.toProto());\n request.setPayment(payment);\n\n if (memo) {\n const memo = new Memo();\n memo.setMemo(memo.toString());\n request.setMemo(memo);\n }\n\n const responseBytes = await this.updateFetcher(\n this.agent,\n this.canisterId,\n \"send_pb\",\n request.serializeBinary()\n );\n\n if (responseBytes instanceof Error) {\n if (responseBytes.message.includes(\"Reject code: 5\")) {\n // Match against the different error types.\n // This string matching is fragile. It's a stop-gap solution until\n // we migrate to the candid interface.\n\n if (responseBytes.message.match(/Sending from (.*) is not allowed/)) {\n return new InvalidSender();\n }\n\n {\n const m = responseBytes.message.match(\n /transaction.*duplicate.* in block (\\d+)/\n );\n if (m && m.length > 1) {\n return new TxDuplicate(BigInt(m[1]));\n }\n }\n\n {\n const m = responseBytes.message.match(\n /debit account.*, current balance: (\\d*(\\.\\d*)?)/\n );\n if (m && m.length > 1) {\n const balance = ICP.fromString(m[1]);\n if (balance instanceof ICP) {\n return new InsufficientFunds(balance);\n }\n }\n }\n\n if (responseBytes.message.includes(\"is in future\")) {\n return new TxCreatedInFuture();\n }\n\n {\n const m = responseBytes.message.match(/older than (\\d+)/);\n if (m && m.length > 1) {\n return new TxTooOld(Number.parseInt(m[1]));\n }\n }\n }\n\n // Unknown error. Throw as-is.\n throw responseBytes;\n }\n\n // Successful tx. Return the block height.\n return BigInt(PbBlockHeight.deserializeBinary(responseBytes).getHeight());\n };\n}\n", "import { Agent } from \"@dfinity/agent\";\nimport { Principal } from \"@dfinity/principal\";\nimport { ICP } from \"../icp\";\n\nexport type BlockHeight = bigint;\n\nexport type TransferError =\n | InvalidSender\n | InsufficientFunds\n | TxTooOld\n | TxCreatedInFuture\n | TxDuplicate\n | BadFee;\n\nexport class InvalidSender {}\nexport class BadFee {}\nexport class InsufficientFunds {\n constructor(public readonly balance: ICP) {}\n}\nexport class TxTooOld {\n constructor(public readonly allowed_window_secs: number) {}\n}\nexport class TxCreatedInFuture {}\nexport class TxDuplicate {\n constructor(public readonly duplicateOf: BlockHeight) {}\n}\n\nexport type Fetcher = (\n agent: Agent,\n canisterId: Principal,\n methodName: string,\n arg: ArrayBuffer\n) => Promise<Uint8Array | Error>;\n\n// HttpAgent options that can be used at construction.\nexport interface LedgerCanisterOptions {\n // The agent to use when communicating with the ledger canister.\n agent?: Agent;\n // The ledger canister's ID.\n canisterId?: Principal;\n // The method to use for performing an update call. Primarily overridden\n // in test for mocking.\n updateCallOverride?: Fetcher;\n // The method to use for performing a query call. Primarily overridden\n // in test for mocking.\n queryCallOverride?: Fetcher;\n}\n", "import { Agent, polling } from \"@dfinity/agent\";\nimport { Principal } from \"@dfinity/principal\";\n\n/**\n * Submits an update call to the IC.\n * @returns The (binary) response if the request succeeded, an error otherwise.\n */\nexport const updateCall = async (\n agent: Agent,\n canisterId: Principal,\n methodName: string,\n arg: ArrayBuffer\n): Promise<Uint8Array | Error> => {\n const submitResponse = await agent.call(canisterId, {\n methodName,\n arg,\n effectiveCanisterId: canisterId,\n });\n\n if (!submitResponse.response.ok) {\n return Error(\n [\n \"Call failed:\",\n ` Method: ${methodName}`,\n ` Canister ID: ${canisterId}`,\n ` Request ID: ${submitResponse.requestId}`,\n ` HTTP status code: ${submitResponse.response.status}`,\n ` HTTP status text: ${submitResponse.response.statusText}`,\n ].join(\"\\n\")\n );\n }\n\n try {\n const blob = await polling.pollForResponse(\n agent,\n canisterId,\n submitResponse.requestId,\n polling.defaultStrategy()\n );\n return new Uint8Array(blob);\n } catch (err) {\n if (err instanceof Error) {\n // Return errors rather than throw them so that callers are forced to handle them.\n return err;\n }\n\n // Something very wrong happened, and we don't know how to deal with it. Throw as-is.\n throw err;\n }\n};\n\n/**\n * Submits a query call to the IC.\n * @returns The (binary) response if the request succeeded, an error otherwise.\n */\nexport const queryCall = async (\n agent: Agent,\n canisterId: Principal,\n methodName: string,\n arg: ArrayBuffer\n): Promise<Uint8Array | Error> => {\n const queryResponse = await agent.query(canisterId, {\n methodName,\n arg,\n });\n\n if (queryResponse.status == \"rejected\") {\n return new Error(\n [\n \"Call failed:\",\n ` Method: ${methodName}`,\n ` Canister ID: ${canisterId}`,\n ` HTTP status code: ${queryResponse.reject_code}`,\n ` HTTP status text: ${queryResponse.reject_message}`,\n ].join(\"\\n\")\n );\n }\n\n return new Uint8Array(queryResponse.reply.arg);\n};\n"],
5
- "mappings": "8KAEA,MAOO,OCKA,WAAoB,GACpB,OAAa,GACb,OAAwB,CAC7B,YAA4B,EAAc,CAAd,iBAEvB,OAAe,CACpB,YAA4B,EAA6B,CAA7B,6BAEvB,OAAwB,GACxB,OAAkB,CACvB,YAA4B,EAA0B,CAA1B,qBCjBvB,GAAM,GAAa,MACxB,EACA,EACA,EACA,IACgC,CAChC,GAAM,GAAiB,KAAM,GAAM,KAAK,EAAY,CAClD,aACA,MACA,oBAAqB,IAGvB,GAAI,CAAC,EAAe,SAAS,GAC3B,MAAO,OACL,CACE,eACA,aAAa,IACb,kBAAkB,IAClB,iBAAiB,EAAe,YAChC,uBAAuB,EAAe,SAAS,SAC/C,uBAAuB,EAAe,SAAS,cAC/C,KAAK;AAAA,IAIX,GAAI,CACF,GAAM,GAAO,KAAM,GAAQ,gBACzB,EACA,EACA,EAAe,UACf,EAAQ,mBAEV,MAAO,IAAI,YAAW,SACf,EAAP,CACA,GAAI,YAAe,OAEjB,MAAO,GAIT,KAAM,KAQG,EAAY,MACvB,EACA,EACA,EACA,IACgC,CAChC,GAAM,GAAgB,KAAM,GAAM,MAAM,EAAY,CAClD,aACA,QAGF,MAAI,GAAc,QAAU,WACnB,GAAI,OACT,CACE,eACA,aAAa,IACb,kBAAkB,IAClB,uBAAuB,EAAc,cACrC,uBAAuB,EAAc,kBACrC,KAAK;AAAA,IAIJ,GAAI,YAAW,EAAc,MAAM,MFnDrC,WAAqB,CAClB,YACW,EACA,EACA,EACA,EACjB,CAJiB,aACA,kBACA,qBACA,0BAGL,QAAO,EAAiC,GAAI,CACxD,MAAO,IAAI,GACT,EAAQ,OAAS,IACjB,EAAQ,YAAc,EACtB,EAAQ,oBAAsB,EAC9B,EAAQ,mBAAqB,GAU1B,eAAiB,MAAO,CAC7B,oBACA,YAAY,MAIM,CAClB,GAAM,GAAa,EAAY,KAAK,cAAgB,KAAK,aAEnD,EAAU,GAAI,yBACpB,EAAQ,WAAW,EAAkB,WACrC,GAAM,GAAgB,KAAM,GAC1B,KAAK,MACL,KAAK,WACL,qBACA,EAAQ,mBAGV,GAAI,YAAyB,OAE3B,KAAM,OAGR,MAAO,GAAI,QACT,OAAO,QAAM,kBAAkB,GAAI,YAAW,IAAgB,YAU3D,SAAW,MAAO,CACvB,KACA,SACA,UAK0C,CAC1C,GAAM,GAAU,GAAI,eACpB,EAAQ,MAAM,EAAG,WAEjB,GAAM,GAAU,GAAI,WAIpB,GAHA,EAAQ,gBAAgB,EAAO,WAC/B,EAAQ,WAAW,GAEf,EAAM,CACR,GAAM,GAAO,GAAI,QACjB,EAAK,QAAQ,EAAK,YAClB,EAAQ,QAAQ,GAGlB,GAAM,GAAgB,KAAM,MAAK,cAC/B,KAAK,MACL,KAAK,WACL,UACA,EAAQ,mBAGV,GAAI,YAAyB,OAAO,CAClC,GAAI,EAAc,QAAQ,SAAS,kBAAmB,CAKpD,GAAI,EAAc,QAAQ,MAAM,oCAC9B,MAAO,IAAI,GAGb,CACE,GAAM,GAAI,EAAc,QAAQ,MAC9B,2CAEF,GAAI,GAAK,EAAE,OAAS,EAClB,MAAO,IAAI,GAAY,OAAO,EAAE,KAIpC,CACE,GAAM,GAAI,EAAc,QAAQ,MAC9B,mDAEF,GAAI,GAAK,EAAE,OAAS,EAAG,CACrB,GAAM,GAAU,EAAI,WAAW,EAAE,IACjC,GAAI,YAAmB,GACrB,MAAO,IAAI,GAAkB,IAKnC,GAAI,EAAc,QAAQ,SAAS,gBACjC,MAAO,IAAI,GAGb,CACE,GAAM,GAAI,EAAc,QAAQ,MAAM,oBACtC,GAAI,GAAK,EAAE,OAAS,EAClB,MAAO,IAAI,GAAS,OAAO,SAAS,EAAE,MAM5C,KAAM,GAIR,MAAO,QAAO,cAAc,kBAAkB,GAAe",
4
+ "sourcesContent": ["import { Agent } from \"@dfinity/agent\";\nimport { Principal } from \"@dfinity/principal\";\nimport {\n AccountBalanceRequest,\n BlockHeight as PbBlockHeight,\n ICPTs,\n Memo,\n Payment,\n SendRequest,\n} from \"../proto/ledger_pb\";\nimport { AccountIdentifier } from \"./account_identifier\";\nimport { MAINNET_LEDGER_CANISTER_ID } from \"./constants/canister_ids\";\nimport { ICP } from \"./icp\";\nimport { BlockHeight } from \"./types/common\";\nimport {\n Fetcher,\n InsufficientFunds,\n InvalidSender,\n LedgerCanisterOptions,\n TransferError,\n TxCreatedInFuture,\n TxDuplicate,\n TxTooOld,\n} from \"./types/ledger\";\nimport { defaultAgent } from \"./utils/agent.utils\";\nimport { queryCall, updateCall } from \"./utils/proto.utils\";\n\nexport class LedgerCanister {\n private constructor(\n private readonly agent: Agent,\n private readonly canisterId: Principal,\n private readonly updateFetcher: Fetcher,\n private readonly queryFetcher: Fetcher\n ) {}\n\n public static create(options: LedgerCanisterOptions = {}) {\n return new LedgerCanister(\n options.agent ?? defaultAgent(),\n options.canisterId ?? MAINNET_LEDGER_CANISTER_ID,\n options.updateCallOverride ?? updateCall,\n options.queryCallOverride ?? queryCall\n );\n }\n\n /**\n * Returns the balance of the specified account identifier.\n *\n * If `certified` is true, the request is fetched as an update call, otherwise\n * it is fetched using a query call.\n */\n public accountBalance = async ({\n accountIdentifier,\n certified = true,\n }: {\n accountIdentifier: AccountIdentifier;\n certified?: boolean;\n }): Promise<ICP> => {\n const callMethod = certified ? this.updateFetcher : this.queryFetcher;\n\n const request = new AccountBalanceRequest();\n request.setAccount(accountIdentifier.toProto());\n const responseBytes = await callMethod(\n this.agent,\n this.canisterId,\n \"account_balance_pb\",\n request.serializeBinary()\n );\n\n if (responseBytes instanceof Error) {\n // An error is never expected from this endpoint.\n throw Error;\n }\n\n return ICP.fromE8s(\n BigInt(ICPTs.deserializeBinary(new Uint8Array(responseBytes)).getE8s())\n );\n };\n\n /**\n * Transfer ICP from the caller to the destination `accountIdentifier`.\n * Returns the index of the block containing the tx if it was successful.\n *\n * TODO: support remaining options (subaccounts, memos, etc.)\n */\n public transfer = async ({\n to,\n amount,\n memo,\n }: {\n to: AccountIdentifier;\n amount: ICP;\n memo?: bigint;\n }): Promise<BlockHeight | TransferError> => {\n const request = new SendRequest();\n request.setTo(to.toProto());\n\n const payment = new Payment();\n payment.setReceiverGets(amount.toProto());\n request.setPayment(payment);\n\n if (memo) {\n const memo = new Memo();\n memo.setMemo(memo.toString());\n request.setMemo(memo);\n }\n\n const responseBytes = await this.updateFetcher(\n this.agent,\n this.canisterId,\n \"send_pb\",\n request.serializeBinary()\n );\n\n if (responseBytes instanceof Error) {\n if (responseBytes.message.includes(\"Reject code: 5\")) {\n // Match against the different error types.\n // This string matching is fragile. It's a stop-gap solution until\n // we migrate to the candid interface.\n\n if (responseBytes.message.match(/Sending from (.*) is not allowed/)) {\n return new InvalidSender();\n }\n\n {\n const m = responseBytes.message.match(\n /transaction.*duplicate.* in block (\\d+)/\n );\n if (m && m.length > 1) {\n return new TxDuplicate(BigInt(m[1]));\n }\n }\n\n {\n const m = responseBytes.message.match(\n /debit account.*, current balance: (\\d*(\\.\\d*)?)/\n );\n if (m && m.length > 1) {\n const balance = ICP.fromString(m[1]);\n if (balance instanceof ICP) {\n return new InsufficientFunds(balance);\n }\n }\n }\n\n if (responseBytes.message.includes(\"is in future\")) {\n return new TxCreatedInFuture();\n }\n\n {\n const m = responseBytes.message.match(/older than (\\d+)/);\n if (m && m.length > 1) {\n return new TxTooOld(Number.parseInt(m[1]));\n }\n }\n }\n\n // Unknown error. Throw as-is.\n throw responseBytes;\n }\n\n // Successful tx. Return the block height.\n return BigInt(PbBlockHeight.deserializeBinary(responseBytes).getHeight());\n };\n}\n", "import { Agent } from \"@dfinity/agent\";\nimport { Principal } from \"@dfinity/principal\";\nimport { ICP } from \"../icp\";\nimport { BlockHeight } from \"./common\";\n\nexport type TransferError =\n | InvalidSender\n | InsufficientFunds\n | TxTooOld\n | TxCreatedInFuture\n | TxDuplicate\n | BadFee;\n\nexport class InvalidSender {}\nexport class BadFee {}\nexport class InsufficientFunds {\n constructor(public readonly balance: ICP) {}\n}\nexport class TxTooOld {\n constructor(public readonly allowed_window_secs: number) {}\n}\nexport class TxCreatedInFuture {}\nexport class TxDuplicate {\n constructor(public readonly duplicateOf: BlockHeight) {}\n}\n\nexport type Fetcher = (\n agent: Agent,\n canisterId: Principal,\n methodName: string,\n arg: ArrayBuffer\n) => Promise<Uint8Array | Error>;\n\n// HttpAgent options that can be used at construction.\nexport interface LedgerCanisterOptions {\n // The agent to use when communicating with the ledger canister.\n agent?: Agent;\n // The ledger canister's ID.\n canisterId?: Principal;\n // The method to use for performing an update call. Primarily overridden\n // in test for mocking.\n updateCallOverride?: Fetcher;\n // The method to use for performing a query call. Primarily overridden\n // in test for mocking.\n queryCallOverride?: Fetcher;\n}\n", "import { Agent, polling } from \"@dfinity/agent\";\nimport { Principal } from \"@dfinity/principal\";\n\n/**\n * Submits an update call to the IC.\n * @returns The (binary) response if the request succeeded, an error otherwise.\n */\nexport const updateCall = async (\n agent: Agent,\n canisterId: Principal,\n methodName: string,\n arg: ArrayBuffer\n): Promise<Uint8Array | Error> => {\n const submitResponse = await agent.call(canisterId, {\n methodName,\n arg,\n effectiveCanisterId: canisterId,\n });\n\n if (!submitResponse.response.ok) {\n return Error(\n [\n \"Call failed:\",\n ` Method: ${methodName}`,\n ` Canister ID: ${canisterId}`,\n ` Request ID: ${submitResponse.requestId}`,\n ` HTTP status code: ${submitResponse.response.status}`,\n ` HTTP status text: ${submitResponse.response.statusText}`,\n ].join(\"\\n\")\n );\n }\n\n try {\n const blob = await polling.pollForResponse(\n agent,\n canisterId,\n submitResponse.requestId,\n polling.defaultStrategy()\n );\n return new Uint8Array(blob);\n } catch (err) {\n if (err instanceof Error) {\n // Return errors rather than throw them so that callers are forced to handle them.\n return err;\n }\n\n // Something very wrong happened, and we don't know how to deal with it. Throw as-is.\n throw err;\n }\n};\n\n/**\n * Submits a query call to the IC.\n * @returns The (binary) response if the request succeeded, an error otherwise.\n */\nexport const queryCall = async (\n agent: Agent,\n canisterId: Principal,\n methodName: string,\n arg: ArrayBuffer\n): Promise<Uint8Array | Error> => {\n const queryResponse = await agent.query(canisterId, {\n methodName,\n arg,\n });\n\n if (queryResponse.status == \"rejected\") {\n return new Error(\n [\n \"Call failed:\",\n ` Method: ${methodName}`,\n ` Canister ID: ${canisterId}`,\n ` HTTP status code: ${queryResponse.reject_code}`,\n ` HTTP status text: ${queryResponse.reject_message}`,\n ].join(\"\\n\")\n );\n }\n\n return new Uint8Array(queryResponse.reply.arg);\n};\n"],
5
+ "mappings": "6IAEA,MAOO,OCIA,WAAoB,GACpB,OAAa,GACb,OAAwB,CAC7B,YAA4B,EAAc,CAAd,iBAEvB,OAAe,CACpB,YAA4B,EAA6B,CAA7B,6BAEvB,OAAwB,GACxB,OAAkB,CACvB,YAA4B,EAA0B,CAA1B,qBChBvB,GAAM,GAAa,MACxB,EACA,EACA,EACA,IACgC,CAChC,GAAM,GAAiB,KAAM,GAAM,KAAK,EAAY,CAClD,aACA,MACA,oBAAqB,IAGvB,GAAI,CAAC,EAAe,SAAS,GAC3B,MAAO,OACL,CACE,eACA,aAAa,IACb,kBAAkB,IAClB,iBAAiB,EAAe,YAChC,uBAAuB,EAAe,SAAS,SAC/C,uBAAuB,EAAe,SAAS,cAC/C,KAAK;AAAA,IAIX,GAAI,CACF,GAAM,GAAO,KAAM,GAAQ,gBACzB,EACA,EACA,EAAe,UACf,EAAQ,mBAEV,MAAO,IAAI,YAAW,SACf,EAAP,CACA,GAAI,YAAe,OAEjB,MAAO,GAIT,KAAM,KAQG,EAAY,MACvB,EACA,EACA,EACA,IACgC,CAChC,GAAM,GAAgB,KAAM,GAAM,MAAM,EAAY,CAClD,aACA,QAGF,MAAI,GAAc,QAAU,WACnB,GAAI,OACT,CACE,eACA,aAAa,IACb,kBAAkB,IAClB,uBAAuB,EAAc,cACrC,uBAAuB,EAAc,kBACrC,KAAK;AAAA,IAIJ,GAAI,YAAW,EAAc,MAAM,MFnDrC,WAAqB,CAClB,YACW,EACA,EACA,EACA,EACjB,CAJiB,aACA,kBACA,qBACA,0BAGL,QAAO,EAAiC,GAAI,CACxD,MAAO,IAAI,GACT,EAAQ,OAAS,IACjB,EAAQ,YAAc,EACtB,EAAQ,oBAAsB,EAC9B,EAAQ,mBAAqB,GAU1B,eAAiB,MAAO,CAC7B,oBACA,YAAY,MAIM,CAClB,GAAM,GAAa,EAAY,KAAK,cAAgB,KAAK,aAEnD,EAAU,GAAI,yBACpB,EAAQ,WAAW,EAAkB,WACrC,GAAM,GAAgB,KAAM,GAC1B,KAAK,MACL,KAAK,WACL,qBACA,EAAQ,mBAGV,GAAI,YAAyB,OAE3B,KAAM,OAGR,MAAO,GAAI,QACT,OAAO,QAAM,kBAAkB,GAAI,YAAW,IAAgB,YAU3D,SAAW,MAAO,CACvB,KACA,SACA,UAK0C,CAC1C,GAAM,GAAU,GAAI,eACpB,EAAQ,MAAM,EAAG,WAEjB,GAAM,GAAU,GAAI,WAIpB,GAHA,EAAQ,gBAAgB,EAAO,WAC/B,EAAQ,WAAW,GAEf,EAAM,CACR,GAAM,GAAO,GAAI,QACjB,EAAK,QAAQ,EAAK,YAClB,EAAQ,QAAQ,GAGlB,GAAM,GAAgB,KAAM,MAAK,cAC/B,KAAK,MACL,KAAK,WACL,UACA,EAAQ,mBAGV,GAAI,YAAyB,OAAO,CAClC,GAAI,EAAc,QAAQ,SAAS,kBAAmB,CAKpD,GAAI,EAAc,QAAQ,MAAM,oCAC9B,MAAO,IAAI,GAGb,CACE,GAAM,GAAI,EAAc,QAAQ,MAC9B,2CAEF,GAAI,GAAK,EAAE,OAAS,EAClB,MAAO,IAAI,GAAY,OAAO,EAAE,KAIpC,CACE,GAAM,GAAI,EAAc,QAAQ,MAC9B,mDAEF,GAAI,GAAK,EAAE,OAAS,EAAG,CACrB,GAAM,GAAU,EAAI,WAAW,EAAE,IACjC,GAAI,YAAmB,GACrB,MAAO,IAAI,GAAkB,IAKnC,GAAI,EAAc,QAAQ,SAAS,gBACjC,MAAO,IAAI,GAGb,CACE,GAAM,GAAI,EAAc,QAAQ,MAAM,oBACtC,GAAI,GAAK,EAAE,OAAS,EAClB,MAAO,IAAI,GAAS,OAAO,SAAS,EAAE,MAM5C,KAAM,GAIR,MAAO,QAAO,cAAc,kBAAkB,GAAe",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- import{g as a}from"./chunk-RPOIUQZO.js";import"./chunk-LNMGZ6W7.js";import"./chunk-HMU24NWJ.js";import"./chunk-FVDRR6PO.js";import"./chunk-4FZAJTYF.js";export{a as GovernanceCanister};
1
+ import{k as a}from"./chunk-G4YDAU7G.js";import"./chunk-23KBPF6P.js";import"./chunk-I56YMTHW.js";import"./chunk-L3JQ3U5O.js";import"./chunk-6OQVGWT6.js";import"./chunk-7EVRADY2.js";export{a as GovernanceCanister};
2
2
  //# sourceMappingURL=governance.js.map
package/dist/esm/icp.js CHANGED
@@ -1,2 +1,2 @@
1
- import{b as a}from"./chunk-X2SHUWG3.js";import"./chunk-NYI672WX.js";import"./chunk-4FZAJTYF.js";export{a as ICP};
1
+ import{b as a}from"./chunk-6OQVGWT6.js";import"./chunk-7EVRADY2.js";export{a as ICP};
2
2
  //# sourceMappingURL=icp.js.map
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as r,b as o}from"./chunk-SO23SIWX.js";import{a as m,b as p,c as x,d as n,e as c,f as i,g as e}from"./chunk-RPOIUQZO.js";import"./chunk-LNMGZ6W7.js";import{a as u,b as C,c as d,d as s,e as A,f as I,g as f}from"./chunk-YL3F3CIN.js";import"./chunk-HMU24NWJ.js";import"./chunk-FVDRR6PO.js";import{a,b as t}from"./chunk-X2SHUWG3.js";import"./chunk-NYI672WX.js";import"./chunk-4FZAJTYF.js";export{r as AccountIdentifier,C as BadFee,a as FromICPStringError,e as GovernanceCanister,t as ICP,d as InsufficientFunds,u as InvalidSender,f as LedgerCanister,m as NeuronState,p as ProposalRewardStatus,x as ProposalStatus,o as SubAccount,c as Topic,A as TxCreatedInFuture,I as TxDuplicate,s as TxTooOld,i as UnsupportedValueError,n as Vote};
1
+ import{a as N,b as x,c as P,d as b,e as v,f as B,g,h as C,i as V,j as y,k as I}from"./chunk-G4YDAU7G.js";import{g as u,h as a}from"./chunk-23KBPF6P.js";import{a as A,b as T,c as h,d as F,e as G,f as L,g as c}from"./chunk-PFJHLT6T.js";import"./chunk-I56YMTHW.js";import"./chunk-L3JQ3U5O.js";import{a as S,b as i}from"./chunk-6OQVGWT6.js";import"./chunk-7EVRADY2.js";var l=({recentBallots:n,proposalId:o})=>o?n.find(({proposalId:e})=>e===o)?.vote:void 0,m=({neurons:n,proposal:o})=>{let{ballots:r,proposalTimestampSeconds:e}=o;return n.filter(({createdTimestampSeconds:t,neuronId:f})=>{let s=t>e,p=r.find(({neuronId:d})=>d===f)===void 0;return s||p})},_=({neurons:n,proposal:o})=>{let{id:r}=o;return n.filter(({recentBallots:e,neuronId:t})=>l({recentBallots:e,proposalId:r})===void 0&&m({neurons:n,proposal:o}).find(({neuronId:f})=>f===t)===void 0)},j=({neurons:n,proposal:o})=>{let{id:r}=o;return n.filter(({recentBallots:e})=>l({recentBallots:e,proposalId:r})!==void 0)};export{u as AccountIdentifier,T as BadFee,V as CouldNotClaimNeuronError,S as FromICPStringError,I as GovernanceCanister,i as ICP,y as InsufficientAmount,h as InsufficientFunds,A as InvalidSender,c as LedgerCanister,N as NeuronState,x as ProposalRewardStatus,P as ProposalStatus,g as StakeNeuronError,C as StakeNeuronTransferError,a as SubAccount,v as Topic,G as TxCreatedInFuture,L as TxDuplicate,F as TxTooOld,B as UnsupportedValueError,b as Vote,m as ineligibleNeurons,_ as notVotedNeurons,j as votedNeurons};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
3
+ "sources": ["../../src/utils/neurons.utils.ts"],
4
+ "sourcesContent": ["import type {\n Ballot,\n BallotInfo,\n NeuronInfo,\n ProposalId,\n ProposalInfo,\n Vote,\n} from \"../types/governance_converters\";\n\nconst voteForProposal = ({\n recentBallots,\n proposalId,\n}: {\n recentBallots: BallotInfo[];\n proposalId: ProposalId | undefined;\n}): Vote | undefined => {\n if (!proposalId) {\n return undefined;\n }\n\n const ballot: BallotInfo | undefined = recentBallots.find(\n ({ proposalId: id }: BallotInfo) => id === proposalId\n );\n return ballot?.vote;\n};\n\nexport const ineligibleNeurons = ({\n neurons,\n proposal,\n}: {\n neurons: NeuronInfo[];\n proposal: ProposalInfo;\n}): NeuronInfo[] => {\n const { ballots, proposalTimestampSeconds } = proposal;\n\n return neurons.filter(({ createdTimestampSeconds, neuronId }: NeuronInfo) => {\n const createdSinceProposal: boolean =\n createdTimestampSeconds > proposalTimestampSeconds;\n\n const dissolveTooShort: boolean =\n ballots.find(\n ({ neuronId: ballotNeuronId }: Ballot) => ballotNeuronId === neuronId\n ) === undefined;\n\n return createdSinceProposal || dissolveTooShort;\n });\n};\n\nexport const notVotedNeurons = ({\n neurons,\n proposal,\n}: {\n neurons: NeuronInfo[];\n proposal: ProposalInfo;\n}): NeuronInfo[] => {\n const { id: proposalId } = proposal;\n\n return neurons.filter(\n ({ recentBallots, neuronId }: NeuronInfo) =>\n voteForProposal({ recentBallots, proposalId }) === undefined &&\n ineligibleNeurons({ neurons, proposal }).find(\n ({ neuronId: ineligibleNeuronId }: NeuronInfo) =>\n ineligibleNeuronId === neuronId\n ) === undefined\n );\n};\n\nexport const votedNeurons = ({\n neurons,\n proposal,\n}: {\n neurons: NeuronInfo[];\n proposal: ProposalInfo;\n}): NeuronInfo[] => {\n const { id: proposalId } = proposal;\n\n return neurons.filter(\n ({ recentBallots }: NeuronInfo) =>\n voteForProposal({ recentBallots, proposalId }) !== undefined\n );\n};\n"],
5
+ "mappings": "6WASA,GAAM,GAAkB,CAAC,CACvB,gBACA,gBAKK,EAOE,AAHgC,EAAc,KACnD,CAAC,CAAE,WAAY,KAAqB,IAAO,IAE9B,KANb,OASS,EAAoB,CAAC,CAChC,UACA,cAIkB,CAClB,GAAM,CAAE,UAAS,4BAA6B,EAE9C,MAAO,GAAQ,OAAO,CAAC,CAAE,0BAAyB,cAA2B,CAC3E,GAAM,GACJ,EAA0B,EAEtB,EACJ,EAAQ,KACN,CAAC,CAAE,SAAU,KAA6B,IAAmB,KACzD,OAER,MAAO,IAAwB,KAItB,EAAkB,CAAC,CAC9B,UACA,cAIkB,CAClB,GAAM,CAAE,GAAI,GAAe,EAE3B,MAAO,GAAQ,OACb,CAAC,CAAE,gBAAe,cAChB,EAAgB,CAAE,gBAAe,iBAAkB,QACnD,EAAkB,CAAE,UAAS,aAAY,KACvC,CAAC,CAAE,SAAU,KACX,IAAuB,KACrB,SAIC,EAAe,CAAC,CAC3B,UACA,cAIkB,CAClB,GAAM,CAAE,GAAI,GAAe,EAE3B,MAAO,GAAQ,OACb,CAAC,CAAE,mBACD,EAAgB,CAAE,gBAAe,iBAAkB",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- import{g as a}from"./chunk-YL3F3CIN.js";import"./chunk-HMU24NWJ.js";import"./chunk-FVDRR6PO.js";import"./chunk-X2SHUWG3.js";import"./chunk-NYI672WX.js";import"./chunk-4FZAJTYF.js";export{a as LedgerCanister};
1
+ import{g as a}from"./chunk-PFJHLT6T.js";import"./chunk-I56YMTHW.js";import"./chunk-L3JQ3U5O.js";import"./chunk-6OQVGWT6.js";import"./chunk-7EVRADY2.js";export{a as LedgerCanister};
2
2
  //# sourceMappingURL=ledger.js.map
@@ -0,0 +1,60 @@
1
+ syntax = "proto3";
2
+
3
+ package ic_base_types.pb.v1;
4
+
5
+ import "google/protobuf/descriptor.proto";
6
+
7
+ // The annotated message is supported by hardware wallet signing.
8
+ // The numbering was chosen as the range 19000-19999 is anyway reserved in protobuf.
9
+ extend google.protobuf.MessageOptions {
10
+ bool tui_signed_message = 20000;
11
+ }
12
+
13
+ // The annotated field is displayed on the hardware wallet in the specification
14
+ // used by launch of the Internet Computer.
15
+ extend google.protobuf.FieldOptions {
16
+ bool tui_signed_display_q2_2021 = 20001;
17
+ }
18
+
19
+ // A PB container for a PrincipalId, which uniquely identifies
20
+ // a principal.
21
+ message PrincipalId {
22
+ option (tui_signed_message) = true;
23
+ bytes serialized_id = 1 [(tui_signed_display_q2_2021) = true];
24
+ }
25
+
26
+ // A PB container for a CanisterId, which uniquely identifies
27
+ // a principal.
28
+ message CanisterId {
29
+ bytes serialized_id = 1;
30
+ }
31
+
32
+ // A container for a NeuronId blob, which uniquely identifies
33
+ // a Neuron.
34
+ message NeuronId {
35
+ option (ic_base_types.pb.v1.tui_signed_message) = true;
36
+ // bytes serialized_id = 1;
37
+ reserved 1;
38
+ reserved 'serialized_id';
39
+ uint64 id = 2 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true, jstype = JS_STRING];;
40
+ }
41
+
42
+ // The id of a specific proposal.
43
+ message ProposalId {
44
+ uint64 id = 1 [jstype = JS_STRING];
45
+ }
46
+
47
+ // A descriptor of the authorization of a single method.
48
+ // Any of the principals in the list are authorized to execute
49
+ // the method.
50
+ message MethodAuthzInfo {
51
+ string method_name = 1;
52
+ repeated bytes principal_ids = 2;
53
+ }
54
+
55
+ // A descriptor of the authorization of all the update methods in a
56
+ // canister that require authorization.
57
+ // Methods that should be accessible to anyone should not appear in this list
58
+ message CanisterAuthzInfo {
59
+ repeated MethodAuthzInfo methods_authz = 1;
60
+ }
@@ -0,0 +1,144 @@
1
+ // package: ic_base_types.pb.v1
2
+ // file: proto/base_types.proto
3
+
4
+ import * as jspb from "google-protobuf";
5
+ import * as google_protobuf_descriptor_pb from "google-protobuf/google/protobuf/descriptor_pb";
6
+
7
+ export class PrincipalId extends jspb.Message {
8
+ getSerializedId(): Uint8Array | string;
9
+ getSerializedId_asU8(): Uint8Array;
10
+ getSerializedId_asB64(): string;
11
+ setSerializedId(value: Uint8Array | string): void;
12
+
13
+ serializeBinary(): Uint8Array;
14
+ toObject(includeInstance?: boolean): PrincipalId.AsObject;
15
+ static toObject(includeInstance: boolean, msg: PrincipalId): PrincipalId.AsObject;
16
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
17
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
18
+ static serializeBinaryToWriter(message: PrincipalId, writer: jspb.BinaryWriter): void;
19
+ static deserializeBinary(bytes: Uint8Array): PrincipalId;
20
+ static deserializeBinaryFromReader(message: PrincipalId, reader: jspb.BinaryReader): PrincipalId;
21
+ }
22
+
23
+ export namespace PrincipalId {
24
+ export type AsObject = {
25
+ serializedId: Uint8Array | string,
26
+ }
27
+ }
28
+
29
+ export class CanisterId extends jspb.Message {
30
+ getSerializedId(): Uint8Array | string;
31
+ getSerializedId_asU8(): Uint8Array;
32
+ getSerializedId_asB64(): string;
33
+ setSerializedId(value: Uint8Array | string): void;
34
+
35
+ serializeBinary(): Uint8Array;
36
+ toObject(includeInstance?: boolean): CanisterId.AsObject;
37
+ static toObject(includeInstance: boolean, msg: CanisterId): CanisterId.AsObject;
38
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
39
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
40
+ static serializeBinaryToWriter(message: CanisterId, writer: jspb.BinaryWriter): void;
41
+ static deserializeBinary(bytes: Uint8Array): CanisterId;
42
+ static deserializeBinaryFromReader(message: CanisterId, reader: jspb.BinaryReader): CanisterId;
43
+ }
44
+
45
+ export namespace CanisterId {
46
+ export type AsObject = {
47
+ serializedId: Uint8Array | string,
48
+ }
49
+ }
50
+
51
+ export class NeuronId extends jspb.Message {
52
+ getId(): string;
53
+ setId(value: string): void;
54
+
55
+ serializeBinary(): Uint8Array;
56
+ toObject(includeInstance?: boolean): NeuronId.AsObject;
57
+ static toObject(includeInstance: boolean, msg: NeuronId): NeuronId.AsObject;
58
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
59
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
60
+ static serializeBinaryToWriter(message: NeuronId, writer: jspb.BinaryWriter): void;
61
+ static deserializeBinary(bytes: Uint8Array): NeuronId;
62
+ static deserializeBinaryFromReader(message: NeuronId, reader: jspb.BinaryReader): NeuronId;
63
+ }
64
+
65
+ export namespace NeuronId {
66
+ export type AsObject = {
67
+ id: string,
68
+ }
69
+ }
70
+
71
+ export class ProposalId extends jspb.Message {
72
+ getId(): string;
73
+ setId(value: string): void;
74
+
75
+ serializeBinary(): Uint8Array;
76
+ toObject(includeInstance?: boolean): ProposalId.AsObject;
77
+ static toObject(includeInstance: boolean, msg: ProposalId): ProposalId.AsObject;
78
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
79
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
80
+ static serializeBinaryToWriter(message: ProposalId, writer: jspb.BinaryWriter): void;
81
+ static deserializeBinary(bytes: Uint8Array): ProposalId;
82
+ static deserializeBinaryFromReader(message: ProposalId, reader: jspb.BinaryReader): ProposalId;
83
+ }
84
+
85
+ export namespace ProposalId {
86
+ export type AsObject = {
87
+ id: string,
88
+ }
89
+ }
90
+
91
+ export class MethodAuthzInfo extends jspb.Message {
92
+ getMethodName(): string;
93
+ setMethodName(value: string): void;
94
+
95
+ clearPrincipalIdsList(): void;
96
+ getPrincipalIdsList(): Array<Uint8Array | string>;
97
+ getPrincipalIdsList_asU8(): Array<Uint8Array>;
98
+ getPrincipalIdsList_asB64(): Array<string>;
99
+ setPrincipalIdsList(value: Array<Uint8Array | string>): void;
100
+ addPrincipalIds(value: Uint8Array | string, index?: number): Uint8Array | string;
101
+
102
+ serializeBinary(): Uint8Array;
103
+ toObject(includeInstance?: boolean): MethodAuthzInfo.AsObject;
104
+ static toObject(includeInstance: boolean, msg: MethodAuthzInfo): MethodAuthzInfo.AsObject;
105
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
106
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
107
+ static serializeBinaryToWriter(message: MethodAuthzInfo, writer: jspb.BinaryWriter): void;
108
+ static deserializeBinary(bytes: Uint8Array): MethodAuthzInfo;
109
+ static deserializeBinaryFromReader(message: MethodAuthzInfo, reader: jspb.BinaryReader): MethodAuthzInfo;
110
+ }
111
+
112
+ export namespace MethodAuthzInfo {
113
+ export type AsObject = {
114
+ methodName: string,
115
+ principalIdsList: Array<Uint8Array | string>,
116
+ }
117
+ }
118
+
119
+ export class CanisterAuthzInfo extends jspb.Message {
120
+ clearMethodsAuthzList(): void;
121
+ getMethodsAuthzList(): Array<MethodAuthzInfo>;
122
+ setMethodsAuthzList(value: Array<MethodAuthzInfo>): void;
123
+ addMethodsAuthz(value?: MethodAuthzInfo, index?: number): MethodAuthzInfo;
124
+
125
+ serializeBinary(): Uint8Array;
126
+ toObject(includeInstance?: boolean): CanisterAuthzInfo.AsObject;
127
+ static toObject(includeInstance: boolean, msg: CanisterAuthzInfo): CanisterAuthzInfo.AsObject;
128
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
129
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
130
+ static serializeBinaryToWriter(message: CanisterAuthzInfo, writer: jspb.BinaryWriter): void;
131
+ static deserializeBinary(bytes: Uint8Array): CanisterAuthzInfo;
132
+ static deserializeBinaryFromReader(message: CanisterAuthzInfo, reader: jspb.BinaryReader): CanisterAuthzInfo;
133
+ }
134
+
135
+ export namespace CanisterAuthzInfo {
136
+ export type AsObject = {
137
+ methodsAuthzList: Array<MethodAuthzInfo.AsObject>,
138
+ }
139
+ }
140
+
141
+ export const tuiSignedMessage: jspb.ExtensionFieldInfo<boolean>;
142
+
143
+ export const tuiSignedDisplayQ22021: jspb.ExtensionFieldInfo<boolean>;
144
+