UNPKG

@dfinity/nns

Version:

A library for interfacing with the Internet Computer's Network Nervous System.

2 lines • 131 kB
import{a as Ie,b as li,c as Fo}from"./chunk-IIFH2XLR.js";var Go=Ie(ot=>{"use strict";ot.byteLength=fi;ot.toByteArray=gi;ot.fromByteArray=Ri;var K=[],B=[],mi=typeof Uint8Array<"u"?Uint8Array:Array,uo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ye=0,qo=uo.length;ye<qo;++ye)K[ye]=uo[ye],B[uo.charCodeAt(ye)]=ye;var ye,qo;B[45]=62;B[95]=63;function Uo(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var o=n===t?0:4-n%4;return[n,o]}function fi(e){var t=Uo(e),n=t[0],o=t[1];return(n+o)*3/4-o}function Ni(e,t,n){return(t+n)*3/4-n}function gi(e){var t,n=Uo(e),o=n[0],r=n[1],i=new mi(Ni(e,o,r)),s=0,u=r>0?o-4:o,d;for(d=0;d<u;d+=4)t=B[e.charCodeAt(d)]<<18|B[e.charCodeAt(d+1)]<<12|B[e.charCodeAt(d+2)]<<6|B[e.charCodeAt(d+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return r===2&&(t=B[e.charCodeAt(d)]<<2|B[e.charCodeAt(d+1)]>>4,i[s++]=t&255),r===1&&(t=B[e.charCodeAt(d)]<<10|B[e.charCodeAt(d+1)]<<4|B[e.charCodeAt(d+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function wi(e){return K[e>>18&63]+K[e>>12&63]+K[e>>6&63]+K[e&63]}function Oi(e,t,n){for(var o,r=[],i=t;i<n;i+=3)o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),r.push(wi(o));return r.join("")}function Ri(e){for(var t,n=e.length,o=n%3,r=[],i=16383,s=0,u=n-o;s<u;s+=i)r.push(Oi(e,s,s+i>u?u:s+i));return o===1?(t=e[n-1],r.push(K[t>>2]+K[t<<4&63]+"==")):o===2&&(t=(e[n-2]<<8)+e[n-1],r.push(K[t>>10]+K[t>>4&63]+K[t<<2&63]+"=")),r.join("")}});var Ko=Ie(_o=>{_o.read=function(e,t,n,o,r){var i,s,u=r*8-o-1,d=(1<<u)-1,m=d>>1,l=-7,p=n?r-1:0,g=n?-1:1,N=e[t+p];for(p+=g,i=N&(1<<-l)-1,N>>=-l,l+=u;l>0;i=i*256+e[t+p],p+=g,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=o;l>0;s=s*256+e[t+p],p+=g,l-=8);if(i===0)i=1-m;else{if(i===d)return s?NaN:(N?-1:1)*(1/0);s=s+Math.pow(2,o),i=i-m}return(N?-1:1)*s*Math.pow(2,i-o)};_o.write=function(e,t,n,o,r,i){var s,u,d,m=i*8-r-1,l=(1<<m)-1,p=l>>1,g=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,N=o?0:i-1,A=o?1:-1,J=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-s))<1&&(s--,d*=2),s+p>=1?t+=g/d:t+=g*Math.pow(2,1-p),t*d>=2&&(s++,d/=2),s+p>=l?(u=0,s=l):s+p>=1?(u=(t*d-1)*Math.pow(2,r),s=s+p):(u=t*Math.pow(2,p-1)*Math.pow(2,r),s=0));r>=8;e[n+N]=u&255,N+=A,u/=256,r-=8);for(s=s<<r|u,m+=r;m>0;e[n+N]=s&255,N+=A,s/=256,m-=8);e[n+N-A]|=J*128}});var or=Ie(ke=>{"use strict";var po=Go(),xe=Ko(),Ho=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ke.Buffer=a;ke.SlowBuffer=Si;ke.INSPECT_MAX_BYTES=50;var rt=2147483647;ke.kMaxLength=rt;a.TYPED_ARRAY_SUPPORT=yi();!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&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 yi(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function oe(e){if(e>rt)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,n){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return No(e)}return zo(e,t,n)}a.poolSize=8192;function zo(e,t,n){if(typeof e=="string")return vi(e,t);if(ArrayBuffer.isView(e))return bi(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(H(e,SharedArrayBuffer)||e&&H(e.buffer,SharedArrayBuffer)))return mo(e,t,n);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let o=e.valueOf&&e.valueOf();if(o!=null&&o!==e)return a.from(o,t,n);let r=xi(e);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}a.from=function(e,t,n){return zo(e,t,n)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function Xo(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function hi(e,t,n){return Xo(e),e<=0?oe(e):t!==void 0?typeof n=="string"?oe(e).fill(t,n):oe(e).fill(t):oe(e)}a.alloc=function(e,t,n){return hi(e,t,n)};function No(e){return Xo(e),oe(e<0?0:go(e)|0)}a.allocUnsafe=function(e){return No(e)};a.allocUnsafeSlow=function(e){return No(e)};function vi(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let n=Jo(e,t)|0,o=oe(n),r=o.write(e,t);return r!==n&&(o=o.slice(0,r)),o}function lo(e){let t=e.length<0?0:go(e.length)|0,n=oe(t);for(let o=0;o<t;o+=1)n[o]=e[o]&255;return n}function bi(e){if(H(e,Uint8Array)){let t=new Uint8Array(e);return mo(t.buffer,t.byteOffset,t.byteLength)}return lo(e)}function mo(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let o;return t===void 0&&n===void 0?o=new Uint8Array(e):n===void 0?o=new Uint8Array(e,t):o=new Uint8Array(e,t,n),Object.setPrototypeOf(o,a.prototype),o}function xi(e){if(a.isBuffer(e)){let t=go(e.length)|0,n=oe(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!="number"||Oo(e.length)?oe(0):lo(e);if(e.type==="Buffer"&&Array.isArray(e.data))return lo(e.data)}function go(e){if(e>=rt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+rt.toString(16)+" bytes");return e|0}function Si(e){return+e!=e&&(e=0),a.alloc(+e)}a.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==a.prototype};a.compare=function(t,n){if(H(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),H(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),!a.isBuffer(t)||!a.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===n)return 0;let o=t.length,r=n.length;for(let i=0,s=Math.min(o,r);i<s;++i)if(t[i]!==n[i]){o=t[i],r=n[i];break}return o<r?-1:r<o?1:0};a.isEncoding=function(t){switch(String(t).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}};a.concat=function(t,n){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);let o;if(n===void 0)for(n=0,o=0;o<t.length;++o)n+=t[o].length;let r=a.allocUnsafe(n),i=0;for(o=0;o<t.length;++o){let s=t[o];if(H(s,Uint8Array))i+s.length>r.length?(a.isBuffer(s)||(s=a.from(s)),s.copy(r,i)):Uint8Array.prototype.set.call(r,s,i);else if(a.isBuffer(s))s.copy(r,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=s.length}return r};function Jo(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let n=e.length,o=arguments.length>2&&arguments[2]===!0;if(!o&&n===0)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return fo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return nr(e).length;default:if(r)return o?-1:fo(e).length;t=(""+t).toLowerCase(),r=!0}}a.byteLength=Jo;function ki(e,t,n){let o=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return qi(this,t,n);case"utf8":case"utf-8":return Qo(this,t,n);case"ascii":return Ei(this,t,n);case"latin1":case"binary":return Fi(this,t,n);case"base64":return Ai(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ui(this,t,n);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}a.prototype._isBuffer=!0;function he(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}a.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let n=0;n<t;n+=2)he(this,n,n+1);return this};a.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let n=0;n<t;n+=4)he(this,n,n+3),he(this,n+1,n+2);return this};a.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let n=0;n<t;n+=8)he(this,n,n+7),he(this,n+1,n+6),he(this,n+2,n+5),he(this,n+3,n+4);return this};a.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?Qo(this,0,t):ki.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.inspect=function(){let t="",n=ke.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"};Ho&&(a.prototype[Ho]=a.prototype.inspect);a.prototype.compare=function(t,n,o,r,i){if(H(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(n===void 0&&(n=0),o===void 0&&(o=t?t.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),n<0||o>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&n>=o)return 0;if(r>=i)return-1;if(n>=o)return 1;if(n>>>=0,o>>>=0,r>>>=0,i>>>=0,this===t)return 0;let s=i-r,u=o-n,d=Math.min(s,u),m=this.slice(r,i),l=t.slice(n,o);for(let p=0;p<d;++p)if(m[p]!==l[p]){s=m[p],u=l[p];break}return s<u?-1:u<s?1:0};function Yo(e,t,n,o,r){if(e.length===0)return-1;if(typeof n=="string"?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Oo(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0)if(r)n=0;else return-1;if(typeof t=="string"&&(t=a.from(t,o)),a.isBuffer(t))return t.length===0?-1:jo(e,t,n,o,r);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):jo(e,[t],n,o,r);throw new TypeError("val must be string, number or Buffer")}function jo(e,t,n,o,r){let i=1,s=e.length,u=t.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(e.length<2||t.length<2)return-1;i=2,s/=2,u/=2,n/=2}function d(l,p){return i===1?l[p]:l.readUInt16BE(p*i)}let m;if(r){let l=-1;for(m=n;m<s;m++)if(d(e,m)===d(t,l===-1?0:m-l)){if(l===-1&&(l=m),m-l+1===u)return l*i}else l!==-1&&(m-=m-l),l=-1}else for(n+u>s&&(n=s-u),m=n;m>=0;m--){let l=!0;for(let p=0;p<u;p++)if(d(e,m+p)!==d(t,p)){l=!1;break}if(l)return m}return-1}a.prototype.includes=function(t,n,o){return this.indexOf(t,n,o)!==-1};a.prototype.indexOf=function(t,n,o){return Yo(this,t,n,o,!0)};a.prototype.lastIndexOf=function(t,n,o){return Yo(this,t,n,o,!1)};function Pi(e,t,n,o){n=Number(n)||0;let r=e.length-n;o?(o=Number(o),o>r&&(o=r)):o=r;let i=t.length;o>i/2&&(o=i/2);let s;for(s=0;s<o;++s){let u=parseInt(t.substr(s*2,2),16);if(Oo(u))return s;e[n+s]=u}return s}function Ti(e,t,n,o){return it(fo(t,e.length-n),e,n,o)}function Ci(e,t,n,o){return it(ji(t),e,n,o)}function Vi(e,t,n,o){return it(nr(t),e,n,o)}function Mi(e,t,n,o){return it(Wi(t,e.length-n),e,n,o)}a.prototype.write=function(t,n,o,r){if(n===void 0)r="utf8",o=this.length,n=0;else if(o===void 0&&typeof n=="string")r=n,o=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(o)?(o=o>>>0,r===void 0&&(r="utf8")):(r=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-n;if((o===void 0||o>i)&&(o=i),t.length>0&&(o<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return Pi(this,t,n,o);case"utf8":case"utf-8":return Ti(this,t,n,o);case"ascii":case"latin1":case"binary":return Ci(this,t,n,o);case"base64":return Vi(this,t,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mi(this,t,n,o);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ai(e,t,n){return t===0&&n===e.length?po.fromByteArray(e):po.fromByteArray(e.slice(t,n))}function Qo(e,t,n){n=Math.min(e.length,n);let o=[],r=t;for(;r<n;){let i=e[r],s=null,u=i>239?4:i>223?3:i>191?2:1;if(r+u<=n){let d,m,l,p;switch(u){case 1:i<128&&(s=i);break;case 2:d=e[r+1],(d&192)===128&&(p=(i&31)<<6|d&63,p>127&&(s=p));break;case 3:d=e[r+1],m=e[r+2],(d&192)===128&&(m&192)===128&&(p=(i&15)<<12|(d&63)<<6|m&63,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:d=e[r+1],m=e[r+2],l=e[r+3],(d&192)===128&&(m&192)===128&&(l&192)===128&&(p=(i&15)<<18|(d&63)<<12|(m&63)<<6|l&63,p>65535&&p<1114112&&(s=p))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,o.push(s>>>10&1023|55296),s=56320|s&1023),o.push(s),r+=u}return Bi(o)}var Wo=4096;function Bi(e){let t=e.length;if(t<=Wo)return String.fromCharCode.apply(String,e);let n="",o=0;for(;o<t;)n+=String.fromCharCode.apply(String,e.slice(o,o+=Wo));return n}function Ei(e,t,n){let o="";n=Math.min(e.length,n);for(let r=t;r<n;++r)o+=String.fromCharCode(e[r]&127);return o}function Fi(e,t,n){let o="";n=Math.min(e.length,n);for(let r=t;r<n;++r)o+=String.fromCharCode(e[r]);return o}function qi(e,t,n){let o=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>o)&&(n=o);let r="";for(let i=t;i<n;++i)r+=$i[e[i]];return r}function Ui(e,t,n){let o=e.slice(t,n),r="";for(let i=0;i<o.length-1;i+=2)r+=String.fromCharCode(o[i]+o[i+1]*256);return r}a.prototype.slice=function(t,n){let o=this.length;t=~~t,n=n===void 0?o:~~n,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),n<0?(n+=o,n<0&&(n=0)):n>o&&(n=o),n<t&&(n=t);let r=this.subarray(t,n);return Object.setPrototypeOf(r,a.prototype),r};function b(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(t,n,o){t=t>>>0,n=n>>>0,o||b(t,n,this.length);let r=this[t],i=1,s=0;for(;++s<n&&(i*=256);)r+=this[t+s]*i;return r};a.prototype.readUintBE=a.prototype.readUIntBE=function(t,n,o){t=t>>>0,n=n>>>0,o||b(t,n,this.length);let r=this[t+--n],i=1;for(;n>0&&(i*=256);)r+=this[t+--n]*i;return r};a.prototype.readUint8=a.prototype.readUInt8=function(t,n){return t=t>>>0,n||b(t,1,this.length),this[t]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,n){return t=t>>>0,n||b(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,n){return t=t>>>0,n||b(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,n){return t=t>>>0,n||b(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,n){return t=t>>>0,n||b(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readBigUInt64LE=ie(function(t){t=t>>>0,Se(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&De(t,this.length-8);let r=n+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,i=this[++t]+this[++t]*2**8+this[++t]*2**16+o*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))});a.prototype.readBigUInt64BE=ie(function(t){t=t>>>0,Se(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&De(t,this.length-8);let r=n*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],i=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+o;return(BigInt(r)<<BigInt(32))+BigInt(i)});a.prototype.readIntLE=function(t,n,o){t=t>>>0,n=n>>>0,o||b(t,n,this.length);let r=this[t],i=1,s=0;for(;++s<n&&(i*=256);)r+=this[t+s]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*n)),r};a.prototype.readIntBE=function(t,n,o){t=t>>>0,n=n>>>0,o||b(t,n,this.length);let r=n,i=1,s=this[t+--r];for(;r>0&&(i*=256);)s+=this[t+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*n)),s};a.prototype.readInt8=function(t,n){return t=t>>>0,n||b(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,n){t=t>>>0,n||b(t,2,this.length);let o=this[t]|this[t+1]<<8;return o&32768?o|4294901760:o};a.prototype.readInt16BE=function(t,n){t=t>>>0,n||b(t,2,this.length);let o=this[t+1]|this[t]<<8;return o&32768?o|4294901760:o};a.prototype.readInt32LE=function(t,n){return t=t>>>0,n||b(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,n){return t=t>>>0,n||b(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readBigInt64LE=ie(function(t){t=t>>>0,Se(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&De(t,this.length-8);let r=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(o<<24);return(BigInt(r)<<BigInt(32))+BigInt(n+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});a.prototype.readBigInt64BE=ie(function(t){t=t>>>0,Se(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&De(t,this.length-8);let r=(n<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+o)});a.prototype.readFloatLE=function(t,n){return t=t>>>0,n||b(t,4,this.length),xe.read(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,n){return t=t>>>0,n||b(t,4,this.length),xe.read(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,n){return t=t>>>0,n||b(t,8,this.length),xe.read(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,n){return t=t>>>0,n||b(t,8,this.length),xe.read(this,t,!1,52,8)};function C(e,t,n,o,r,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<i)throw new RangeError('"value" argument is out of bounds');if(n+o>e.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,n,o,r){if(t=+t,n=n>>>0,o=o>>>0,!r){let u=Math.pow(2,8*o)-1;C(this,t,n,o,u,0)}let i=1,s=0;for(this[n]=t&255;++s<o&&(i*=256);)this[n+s]=t/i&255;return n+o};a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,n,o,r){if(t=+t,n=n>>>0,o=o>>>0,!r){let u=Math.pow(2,8*o)-1;C(this,t,n,o,u,0)}let i=o-1,s=1;for(this[n+i]=t&255;--i>=0&&(s*=256);)this[n+i]=t/s&255;return n+o};a.prototype.writeUint8=a.prototype.writeUInt8=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,1,255,0),this[n]=t&255,n+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,2,65535,0),this[n]=t&255,this[n+1]=t>>>8,n+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,2,65535,0),this[n]=t>>>8,this[n+1]=t&255,n+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,4,4294967295,0),this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255,n+4};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,4,4294967295,0),this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255,n+4};function Zo(e,t,n,o,r){tr(t,o,r,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i=i>>8,e[n++]=i,i=i>>8,e[n++]=i,i=i>>8,e[n++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s=s>>8,e[n++]=s,s=s>>8,e[n++]=s,s=s>>8,e[n++]=s,n}function Io(e,t,n,o,r){tr(t,o,r,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i=i>>8,e[n+6]=i,i=i>>8,e[n+5]=i,i=i>>8,e[n+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s=s>>8,e[n+2]=s,s=s>>8,e[n+1]=s,s=s>>8,e[n]=s,n+8}a.prototype.writeBigUInt64LE=ie(function(t,n=0){return Zo(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeBigUInt64BE=ie(function(t,n=0){return Io(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeIntLE=function(t,n,o,r){if(t=+t,n=n>>>0,!r){let d=Math.pow(2,8*o-1);C(this,t,n,o,d-1,-d)}let i=0,s=1,u=0;for(this[n]=t&255;++i<o&&(s*=256);)t<0&&u===0&&this[n+i-1]!==0&&(u=1),this[n+i]=(t/s>>0)-u&255;return n+o};a.prototype.writeIntBE=function(t,n,o,r){if(t=+t,n=n>>>0,!r){let d=Math.pow(2,8*o-1);C(this,t,n,o,d-1,-d)}let i=o-1,s=1,u=0;for(this[n+i]=t&255;--i>=0&&(s*=256);)t<0&&u===0&&this[n+i+1]!==0&&(u=1),this[n+i]=(t/s>>0)-u&255;return n+o};a.prototype.writeInt8=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,1,127,-128),t<0&&(t=255+t+1),this[n]=t&255,n+1};a.prototype.writeInt16LE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,2,32767,-32768),this[n]=t&255,this[n+1]=t>>>8,n+2};a.prototype.writeInt16BE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,2,32767,-32768),this[n]=t>>>8,this[n+1]=t&255,n+2};a.prototype.writeInt32LE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,4,2147483647,-2147483648),this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24,n+4};a.prototype.writeInt32BE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255,n+4};a.prototype.writeBigInt64LE=ie(function(t,n=0){return Zo(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});a.prototype.writeBigInt64BE=ie(function(t,n=0){return Io(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Do(e,t,n,o,r,i){if(n+o>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Lo(e,t,n,o,r){return t=+t,n=n>>>0,r||Do(e,t,n,4,34028234663852886e22,-34028234663852886e22),xe.write(e,t,n,o,23,4),n+4}a.prototype.writeFloatLE=function(t,n,o){return Lo(this,t,n,!0,o)};a.prototype.writeFloatBE=function(t,n,o){return Lo(this,t,n,!1,o)};function er(e,t,n,o,r){return t=+t,n=n>>>0,r||Do(e,t,n,8,17976931348623157e292,-17976931348623157e292),xe.write(e,t,n,o,52,8),n+8}a.prototype.writeDoubleLE=function(t,n,o){return er(this,t,n,!0,o)};a.prototype.writeDoubleBE=function(t,n,o){return er(this,t,n,!1,o)};a.prototype.copy=function(t,n,o,r){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(o||(o=0),!r&&r!==0&&(r=this.length),n>=t.length&&(n=t.length),n||(n=0),r>0&&r<o&&(r=o),r===o||t.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-n<r-o&&(r=t.length-n+o);let i=r-o;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,o,r):Uint8Array.prototype.set.call(t,this.subarray(o,r),n),i};a.prototype.fill=function(t,n,o,r){if(typeof t=="string"){if(typeof n=="string"?(r=n,n=0,o=this.length):typeof o=="string"&&(r=o,o=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(t.length===1){let s=t.charCodeAt(0);(r==="utf8"&&s<128||r==="latin1")&&(t=s)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(n<0||this.length<n||this.length<o)throw new RangeError("Out of range index");if(o<=n)return this;n=n>>>0,o=o===void 0?this.length:o>>>0,t||(t=0);let i;if(typeof t=="number")for(i=n;i<o;++i)this[i]=t;else{let s=a.isBuffer(t)?t:a.from(t,r),u=s.length;if(u===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<o-n;++i)this[i+n]=s[i%u]}return this};var be={};function wo(e,t,n){be[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}wo("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);wo("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);wo("ERR_OUT_OF_RANGE",function(e,t,n){let o=`The value of "${e}" is out of range.`,r=n;return Number.isInteger(n)&&Math.abs(n)>2**32?r=$o(String(n)):typeof n=="bigint"&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=$o(r)),r+="n"),o+=` It must be ${t}. Received ${r}`,o},RangeError);function $o(e){let t="",n=e.length,o=e[0]==="-"?1:0;for(;n>=o+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function Gi(e,t,n){Se(t,"offset"),(e[t]===void 0||e[t+n]===void 0)&&De(t,e.length-(n+1))}function tr(e,t,n,o,r,i){if(e>n||e<t){let s=typeof t=="bigint"?"n":"",u;throw i>3?t===0||t===BigInt(0)?u=`>= 0${s} and < 2${s} ** ${(i+1)*8}${s}`:u=`>= -(2${s} ** ${(i+1)*8-1}${s}) and < 2 ** ${(i+1)*8-1}${s}`:u=`>= ${t}${s} and <= ${n}${s}`,new be.ERR_OUT_OF_RANGE("value",u,e)}Gi(o,r,i)}function Se(e,t){if(typeof e!="number")throw new be.ERR_INVALID_ARG_TYPE(t,"number",e)}function De(e,t,n){throw Math.floor(e)!==e?(Se(e,n),new be.ERR_OUT_OF_RANGE(n||"offset","an integer",e)):t<0?new be.ERR_BUFFER_OUT_OF_BOUNDS:new be.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}var Ki=/[^+/0-9A-Za-z-_]/g;function Hi(e){if(e=e.split("=")[0],e=e.trim().replace(Ki,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function fo(e,t){t=t||1/0;let n,o=e.length,r=null,i=[];for(let s=0;s<o;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}else if(s+1===o){(t-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),r=n;continue}n=(r-55296<<10|n-56320)+65536}else r&&(t-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return i}function ji(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function Wi(e,t){let n,o,r,i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),o=n>>8,r=n%256,i.push(r),i.push(o);return i}function nr(e){return po.toByteArray(Hi(e))}function it(e,t,n,o){let r;for(r=0;r<o&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function H(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Oo(e){return e!==e}var $i=function(){let e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){let o=n*16;for(let r=0;r<16;++r)t[o+r]=e[n]+e[r]}return t}();function ie(e){return typeof BigInt>"u"?zi:e}function zi(){throw new Error("BigInt not supported")}});var sr=Ie((Ro,ir)=>{var st=or(),re=st.Buffer;function rr(e,t){for(var n in e)t[n]=e[n]}re.from&&re.alloc&&re.allocUnsafe&&re.allocUnsafeSlow?ir.exports=st:(rr(st,Ro),Ro.Buffer=Pe);function Pe(e,t,n){return re(e,t,n)}rr(re,Pe);Pe.from=function(e,t,n){if(typeof e=="number")throw new TypeError("Argument must not be a number");return re(e,t,n)};Pe.alloc=function(e,t,n){if(typeof e!="number")throw new TypeError("Argument must be a number");var o=re(e);return t!==void 0?typeof n=="string"?o.fill(t,n):o.fill(t):o.fill(0),o};Pe.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return re(e)};Pe.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return st.SlowBuffer(e)}});var ar=Ie((xa,ho)=>{"use strict";var yo=65536,Xi=4294967295;function Ji(){throw new Error(`Secure random number generation is not supported by this browser. Use Chrome, Firefox or Internet Explorer 11`)}var Yi=sr().Buffer,at=window.crypto||window.msCrypto;at&&at.getRandomValues?ho.exports=Qi:ho.exports=Ji;function Qi(e,t){if(e>Xi)throw new RangeError("requested too many random bytes");var n=Yi.allocUnsafe(e);if(e>0)if(e>yo)for(var o=0;o<e;o+=yo)at.getRandomValues(n.slice(o,o+yo));else at.getRandomValues(n);return typeof t=="function"?process.nextTick(function(){t(null,n)}):n}});var di=li(ar());import{Actor as wa}from"@dfinity/agent";import{AccountIdentifier as ci,checkAccountId as ui}from"@dfinity/ledger-icp";import{assertPercentageNumber as Eo,createServices as Oa,fromNullable as T,isNullish as Ot,nonNullish as X,uint8ArrayToBigInt as Ra}from"@dfinity/utils";var cr=({IDL:e})=>{let t=e.Rec(),n=e.Rec(),o=e.Record({id:e.Nat64}),r=e.Record({followees:e.Vec(o)}),i=e.Record({name:e.Text,description:e.Opt(e.Text)}),s=e.Record({id:e.Opt(o),known_neuron_data:e.Opt(i)}),u=e.Record({percentage_to_spawn:e.Opt(e.Nat32),new_controller:e.Opt(e.Principal),nonce:e.Opt(e.Nat64)}),d=e.Record({amount_e8s:e.Nat64}),m=e.Record({topic:e.Int32,followees:e.Vec(o)}),l=e.Record({hash:e.Vec(e.Nat8)}),p=e.Record({owner:e.Opt(e.Principal),subaccount:e.Opt(e.Vec(e.Nat8))}),g=e.Record({to_account_identifier:e.Opt(l),to_account:e.Opt(p),percentage_to_disburse:e.Nat32}),N=e.Record({}),A=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),J=e.Variant({NeuronIdOrSubaccount:e.Record({}),MemoAndController:A,Memo:e.Nat64}),de=e.Record({by:e.Opt(J)}),Rt=e.Record({hot_key_to_remove:e.Opt(e.Principal)}),yt=e.Record({new_hot_key:e.Opt(e.Principal)}),f=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),ht=e.Record({additional_dissolve_delay_seconds:e.Nat32}),vt=e.Record({visibility:e.Opt(e.Int32)}),bt=e.Record({dissolve_timestamp_seconds:e.Nat64}),xt=e.Variant({RemoveHotKey:Rt,AddHotKey:yt,ChangeAutoStakeMaturity:f,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:ht,SetVisibility:vt,JoinCommunityFund:e.Record({}),LeaveCommunityFund:e.Record({}),SetDissolveTimestamp:bt}),pe=e.Record({operation:e.Opt(xt)}),S=e.Record({id:e.Nat64}),Te=e.Record({vote:e.Int32,proposal:e.Opt(S)}),le=e.Record({source_neuron_id:e.Opt(o)}),me=e.Record({dissolve_delay_seconds:e.Nat64,kyc_verified:e.Bool,amount_e8s:e.Nat64,new_controller:e.Opt(e.Principal),nonce:e.Nat64}),Ce=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),fe=e.Record({percentage_to_merge:e.Nat32}),St=e.Record({e8s:e.Nat64}),Ne=e.Record({to_account:e.Opt(l),amount:e.Opt(St)}),kt=e.Variant({Spawn:u,Split:d,Follow:m,DisburseMaturity:g,RefreshVotingPower:N,ClaimOrRefresh:de,Configure:pe,RegisterVote:Te,Merge:le,DisburseToNeuron:me,MakeProposal:n,StakeMaturity:Ce,MergeMaturity:fe,Disburse:Ne}),Y=e.Variant({Subaccount:e.Vec(e.Nat8),NeuronId:o}),Pt=e.Record({id:e.Opt(o),command:e.Opt(kt),neuron_id_or_subaccount:e.Opt(Y)}),Tt=e.Record({controllers:e.Vec(e.Principal)}),Ct=e.Record({freezing_threshold:e.Opt(e.Nat64),wasm_memory_threshold:e.Opt(e.Nat64),controllers:e.Opt(Tt),log_visibility:e.Opt(e.Int32),wasm_memory_limit:e.Opt(e.Nat64),memory_allocation:e.Opt(e.Nat64),compute_allocation:e.Opt(e.Nat64)}),Ve=e.Record({canister_id:e.Opt(e.Principal),settings:e.Opt(Ct)}),Vt=e.Record({skip_stopping_before_installing:e.Opt(e.Bool),wasm_module_hash:e.Opt(e.Vec(e.Nat8)),canister_id:e.Opt(e.Principal),arg_hash:e.Opt(e.Vec(e.Nat8)),install_mode:e.Opt(e.Int32)}),Me=e.Record({action:e.Opt(e.Int32),canister_id:e.Opt(e.Principal)}),V=e.Record({basis_points:e.Opt(e.Nat64)}),y=e.Record({seconds:e.Opt(e.Nat64)}),O=e.Record({e8s:e.Opt(e.Nat64)}),Mt=e.Record({reward_rate_transition_duration:e.Opt(y),initial_reward_rate:e.Opt(V),final_reward_rate:e.Opt(V)}),At=e.Record({neuron_maximum_dissolve_delay_bonus:e.Opt(V),neuron_maximum_age_for_age_bonus:e.Opt(y),neuron_maximum_dissolve_delay:e.Opt(y),neuron_minimum_dissolve_delay_to_vote:e.Opt(y),neuron_maximum_age_bonus:e.Opt(V),neuron_minimum_stake:e.Opt(O),proposal_wait_for_quiet_deadline_increase:e.Opt(y),proposal_initial_voting_period:e.Opt(y),proposal_rejection_fee:e.Opt(O),voting_reward_parameters:e.Opt(Mt)}),Ae=e.Record({base64_encoding:e.Opt(e.Text)}),Bt=e.Record({transaction_fee:e.Opt(O),token_symbol:e.Opt(e.Text),token_logo:e.Opt(Ae),token_name:e.Opt(e.Text)}),Et=e.Record({id:e.Opt(e.Principal)}),Ft=e.Record({dissolve_delay_interval:e.Opt(y),count:e.Opt(e.Nat64)}),qt=e.Record({seconds_after_utc_midnight:e.Opt(e.Nat64)}),Ut=e.Record({iso_codes:e.Vec(e.Text)}),Gt=e.Record({minimum_participants:e.Opt(e.Nat64),neurons_fund_participation:e.Opt(e.Bool),duration:e.Opt(y),neuron_basket_construction_parameters:e.Opt(Ft),confirmation_text:e.Opt(e.Text),maximum_participant_icp:e.Opt(O),minimum_icp:e.Opt(O),minimum_direct_participation_icp:e.Opt(O),minimum_participant_icp:e.Opt(O),start_time:e.Opt(qt),maximum_direct_participation_icp:e.Opt(O),maximum_icp:e.Opt(O),neurons_fund_investment_icp:e.Opt(O),restricted_countries:e.Opt(Ut)}),c=e.Record({total:e.Opt(O)}),Kt=e.Record({controller:e.Opt(e.Principal),dissolve_delay:e.Opt(y),memo:e.Opt(e.Nat64),vesting_period:e.Opt(y),stake:e.Opt(O)}),Ht=e.Record({developer_neurons:e.Vec(Kt)}),jt=e.Record({treasury_distribution:e.Opt(c),developer_distribution:e.Opt(Ht),swap_distribution:e.Opt(c)}),Be=e.Record({url:e.Opt(e.Text),governance_parameters:e.Opt(At),fallback_controller_principal_ids:e.Vec(e.Principal),logo:e.Opt(Ae),name:e.Opt(e.Text),ledger_parameters:e.Opt(Bt),description:e.Opt(e.Text),dapp_canisters:e.Vec(Et),swap_parameters:e.Opt(Gt),initial_token_distribution:e.Opt(jt)}),Ee=e.Record({nns_function:e.Int32,payload:e.Vec(e.Nat8)}),k=e.Record({id:e.Opt(e.Principal),reward_account:e.Opt(l)}),Wt=e.Record({dissolve_delay_seconds:e.Nat64}),$t=e.Record({to_account:e.Opt(l)}),zt=e.Variant({RewardToNeuron:Wt,RewardToAccount:$t}),Q=e.Record({node_provider:e.Opt(k),reward_mode:e.Opt(zt),amount_e8s:e.Nat64}),Xt=e.Record({dissolve_delay_interval_seconds:e.Nat64,count:e.Nat64}),Jt=e.Record({min_participant_icp_e8s:e.Nat64,neuron_basket_construction_parameters:e.Opt(Xt),max_icp_e8s:e.Nat64,swap_due_timestamp_seconds:e.Nat64,min_participants:e.Nat32,sns_token_e8s:e.Nat64,sale_delay_seconds:e.Opt(e.Nat64),max_participant_icp_e8s:e.Nat64,min_direct_participation_icp_e8s:e.Opt(e.Nat64),min_icp_e8s:e.Nat64,max_direct_participation_icp_e8s:e.Opt(e.Nat64)}),Yt=e.Record({community_fund_investment_e8s:e.Opt(e.Nat64),target_swap_canister_id:e.Opt(e.Principal),params:e.Opt(Jt)}),Qt=e.Record({start_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Nat64}),Zt=e.Record({open_time_window:e.Opt(Qt)}),It=e.Record({request:e.Opt(Zt),swap_canister_id:e.Opt(e.Principal)}),Dt=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,r))}),Fe=e.Record({use_registry_derived_rewards:e.Opt(e.Bool),rewards:e.Vec(Q)}),Lt=e.Record({start_reducing_voting_power_after_seconds:e.Opt(e.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:e.Opt(e.Nat64),clear_following_after_seconds:e.Opt(e.Nat64)}),Z=e.Record({human_readable:e.Opt(e.Text)}),en=e.Record({contribution_threshold_xdr:e.Opt(Z),one_third_participation_milestone_xdr:e.Opt(Z),full_participation_milestone_xdr:e.Opt(Z)}),tn=e.Record({maximum_icp_xdr_rate:e.Opt(V),neurons_fund_matched_funding_curve_coefficients:e.Opt(en),max_theoretical_neurons_fund_participation_amount_xdr:e.Opt(Z),minimum_icp_xdr_rate:e.Opt(V)}),I=e.Record({neuron_minimum_stake_e8s:e.Nat64,voting_power_economics:e.Opt(Lt),max_proposals_to_keep_per_topic:e.Nat32,neuron_management_fee_per_proposal_e8s:e.Nat64,reject_cost_e8s:e.Nat64,transaction_fee_e8s:e.Nat64,neuron_spawn_dissolve_delay_seconds:e.Nat64,minimum_icp_xdr_rate:e.Nat64,maximum_node_provider_rewards_e8s:e.Nat64,neurons_fund_economics:e.Opt(tn)}),ge=e.Record({principals:e.Vec(e.Principal)}),nn=e.Variant({ToRemove:k,ToAdd:k}),qe=e.Record({change:e.Opt(nn)}),Ue=e.Record({motion_text:e.Text}),on=e.Variant({RegisterKnownNeuron:s,ManageNeuron:Pt,UpdateCanisterSettings:Ve,InstallCode:Vt,StopOrStartCanister:Me,CreateServiceNervousSystem:Be,ExecuteNnsFunction:Ee,RewardNodeProvider:Q,OpenSnsTokenSwap:Yt,SetSnsTokenSwapOpenTimeWindow:It,SetDefaultFollowees:Dt,RewardNodeProviders:Fe,ManageNetworkEconomics:I,ApproveGenesisKyc:ge,AddOrRemoveNodeProvider:qe,Motion:Ue});n.fill(e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(on),summary:e.Text}));let rn=e.Record({proposal:e.Opt(n),caller:e.Opt(e.Principal),proposer_id:e.Opt(o)}),Ge=e.Record({xdr_permyriad_per_icp:e.Opt(e.Nat64),timestamp_seconds:e.Opt(e.Nat64)}),D=e.Record({minimum_xdr_permyriad_per_icp:e.Opt(e.Nat64),registry_version:e.Opt(e.Nat64),node_providers:e.Vec(k),timestamp:e.Nat64,rewards:e.Vec(Q),xdr_conversion_rate:e.Opt(Ge),maximum_node_provider_rewards_e8s:e.Opt(e.Nat64)}),L=e.Record({total_maturity_e8s_equivalent:e.Opt(e.Nat64),maturity_e8s_equivalent_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),voting_power_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),total_staked_e8s:e.Opt(e.Nat64),count:e.Opt(e.Nat64),deciding_voting_power_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),total_staked_maturity_e8s_equivalent:e.Opt(e.Nat64),total_potential_voting_power:e.Opt(e.Nat64),total_deciding_voting_power:e.Opt(e.Nat64),staked_maturity_e8s_equivalent_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),staked_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),total_voting_power:e.Opt(e.Nat64),potential_voting_power_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64))}),Ke=e.Record({total_maturity_e8s_equivalent:e.Nat64,not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),dissolving_neurons_staked_maturity_e8s_equivalent_sum:e.Nat64,garbage_collectable_neurons_count:e.Nat64,dissolving_neurons_staked_maturity_e8s_equivalent_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),ect_neuron_count:e.Nat64,total_supply_icp:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_count:e.Nat64,dissolved_neurons_count:e.Nat64,community_fund_total_maturity_e8s_equivalent:e.Nat64,total_staked_e8s_seed:e.Nat64,total_staked_maturity_e8s_equivalent_ect:e.Nat64,total_staked_e8s:e.Nat64,fully_lost_voting_power_neuron_subset_metrics:e.Opt(L),not_dissolving_neurons_count:e.Nat64,total_locked_e8s:e.Nat64,neurons_fund_total_active_neurons:e.Nat64,total_voting_power_non_self_authenticating_controller:e.Opt(e.Nat64),total_staked_maturity_e8s_equivalent:e.Nat64,not_dissolving_neurons_e8s_buckets_ect:e.Vec(e.Tuple(e.Nat64,e.Float64)),declining_voting_power_neuron_subset_metrics:e.Opt(L),total_staked_e8s_ect:e.Nat64,not_dissolving_neurons_staked_maturity_e8s_equivalent_sum:e.Nat64,dissolved_neurons_e8s:e.Nat64,total_staked_e8s_non_self_authenticating_controller:e.Opt(e.Nat64),dissolving_neurons_e8s_buckets_seed:e.Vec(e.Tuple(e.Nat64,e.Float64)),neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_e8s_buckets_ect:e.Vec(e.Tuple(e.Nat64,e.Float64)),non_self_authenticating_controller_neuron_subset_metrics:e.Opt(L),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),total_staked_maturity_e8s_equivalent_seed:e.Nat64,community_fund_total_staked_e8s:e.Nat64,not_dissolving_neurons_e8s_buckets_seed:e.Vec(e.Tuple(e.Nat64,e.Float64)),public_neuron_subset_metrics:e.Opt(L),timestamp_seconds:e.Nat64,seed_neuron_count:e.Nat64}),sn=e.Record({count:e.Opt(e.Nat64),previous_total_stake_e8s:e.Opt(e.Nat64),current_total_stake_e8s:e.Opt(e.Nat64),group_type:e.Int32}),He=e.Record({groups:e.Vec(sn),timestamp_seconds:e.Opt(e.Nat64)}),je=e.Record({rounds_since_last_distribution:e.Opt(e.Nat64),day_after_genesis:e.Nat64,actual_timestamp_seconds:e.Nat64,total_available_e8s_equivalent:e.Nat64,latest_round_available_e8s_equivalent:e.Opt(e.Nat64),distributed_e8s_equivalent:e.Nat64,settled_proposals:e.Vec(S)}),We=e.Record({to_subaccount:e.Vec(e.Nat8),neuron_stake_e8s:e.Nat64,from:e.Opt(e.Principal),memo:e.Nat64,from_subaccount:e.Vec(e.Nat8),transfer_timestamp:e.Nat64,block_height:e.Nat64}),R=e.Record({error_message:e.Text,error_type:e.Int32}),$e=e.Record({vote:e.Int32,voting_power:e.Nat64}),an=e.Record({min_participant_icp_e8s:e.Opt(e.Nat64),max_participant_icp_e8s:e.Opt(e.Nat64),min_direct_participation_icp_e8s:e.Opt(e.Nat64),max_direct_participation_icp_e8s:e.Opt(e.Nat64)}),cn=e.Record({controller:e.Opt(e.Principal),hotkeys:e.Vec(e.Principal),is_capped:e.Opt(e.Bool),maturity_equivalent_icp_e8s:e.Opt(e.Nat64),nns_neuron_id:e.Opt(o),amount_icp_e8s:e.Opt(e.Nat64)}),we=e.Record({neurons_fund_neuron_portions:e.Vec(cn)}),un=e.Record({serialized_representation:e.Opt(e.Text)}),ee=e.Record({total_maturity_equivalent_icp_e8s:e.Opt(e.Nat64),intended_neurons_fund_participation_icp_e8s:e.Opt(e.Nat64),direct_participation_icp_e8s:e.Opt(e.Nat64),swap_participation_limits:e.Opt(an),max_neurons_fund_swap_participation_icp_e8s:e.Opt(e.Nat64),neurons_fund_reserves:e.Opt(we),ideal_matched_participation_function:e.Opt(un),allocated_neurons_fund_participation_icp_e8s:e.Opt(e.Nat64)}),_n=e.Record({final_neurons_fund_participation:e.Opt(ee),initial_neurons_fund_participation:e.Opt(ee),neurons_fund_refunds:e.Opt(we)}),dn=e.Record({status:e.Opt(e.Int32),freezing_threshold:e.Opt(e.Nat64),controllers:e.Vec(e.Principal),memory_size:e.Opt(e.Nat64),cycles:e.Opt(e.Nat64),idle_cycles_burned_per_day:e.Opt(e.Nat64),module_hash:e.Vec(e.Nat8)}),P=e.Record({status:e.Opt(dn),canister_id:e.Opt(e.Principal)}),pn=e.Record({ledger_index_canister_summary:e.Opt(P),fallback_controller_principal_ids:e.Vec(e.Principal),ledger_archive_canister_summaries:e.Vec(P),ledger_canister_summary:e.Opt(P),swap_canister_summary:e.Opt(P),governance_canister_summary:e.Opt(P),root_canister_summary:e.Opt(P),dapp_canister_summaries:e.Vec(P)}),ze=e.Record({swap_background_information:e.Opt(pn)}),Xe=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),ln=e.Record({current_deadline_timestamp_seconds:e.Nat64}),mn=e.Record({id:e.Opt(S),topic:e.Opt(e.Int32),failure_reason:e.Opt(R),ballots:e.Vec(e.Tuple(e.Nat64,$e)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,neurons_fund_data:e.Opt(_n),reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(ze),latest_tally:e.Opt(Xe),total_potential_voting_power:e.Opt(e.Nat64),sns_token_swap_lifecycle:e.Opt(e.Int32),decided_timestamp_seconds:e.Nat64,proposal:e.Opt(n),proposer:e.Opt(o),wait_for_quiet_state:e.Opt(ln),executed_timestamp_seconds:e.Nat64,original_total_community_fund_maturity_e8s_equivalent:e.Opt(e.Nat64)}),fn=e.Variant({Spawn:o,Split:d,Configure:pe,Merge:le,DisburseToNeuron:me,SyncCommand:e.Record({}),ClaimOrRefreshNeuron:de,MergeMaturity:fe,Disburse:Ne}),Nn=e.Record({command:e.Opt(fn),timestamp:e.Nat64}),Je=e.Record({vote:e.Int32,proposal_id:e.Opt(S)}),gn=e.Record({account_identifier_to_disburse_to:e.Opt(l),timestamp_of_disbursement_seconds:e.Opt(e.Nat64),amount_e8s:e.Opt(e.Nat64),account_to_disburse_to:e.Opt(p),finalize_disbursement_timestamp_seconds:e.Opt(e.Nat64)}),wn=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),q=e.Record({id:e.Opt(o),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(Je),voting_power_refreshed_timestamp_seconds:e.Opt(e.Nat64),kyc_verified:e.Bool,potential_voting_power:e.Opt(e.Nat64),neuron_type:e.Opt(e.Int32),not_for_profit:e.Bool,maturity_e8s_equivalent:e.Nat64,deciding_voting_power:e.Opt(e.Nat64),cached_neuron_stake_e8s:e.Nat64,created_timestamp_seconds:e.Nat64,auto_stake_maturity:e.Opt(e.Bool),aging_since_timestamp_seconds:e.Nat64,hot_keys:e.Vec(e.Principal),account:e.Vec(e.Nat8),joined_community_fund_timestamp_seconds:e.Opt(e.Nat64),maturity_disbursements_in_progress:e.Opt(e.Vec(gn)),dissolve_state:e.Opt(wn),followees:e.Vec(e.Tuple(e.Int32,r)),neuron_fees_e8s:e.Nat64,visibility:e.Opt(e.Int32),transfer:e.Opt(We),known_neuron_data:e.Opt(i),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),pi=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,r)),making_sns_proposal:e.Opt(rn),most_recent_monthly_node_provider_rewards:e.Opt(D),maturity_modulation_last_updated_at_timestamp_seconds:e.Opt(e.Nat64),wait_for_quiet_threshold_seconds:e.Nat64,metrics:e.Opt(Ke),neuron_management_voting_period_seconds:e.Opt(e.Nat64),node_providers:e.Vec(k),cached_daily_maturity_modulation_basis_points:e.Opt(e.Int32),economics:e.Opt(I),restore_aging_summary:e.Opt(He),spawning_neurons:e.Opt(e.Bool),latest_reward_event:e.Opt(je),to_claim_transfers:e.Vec(We),short_voting_period_seconds:e.Nat64,proposals:e.Vec(e.Tuple(e.Nat64,mn)),xdr_conversion_rate:e.Opt(Ge),in_flight_commands:e.Vec(e.Tuple(e.Nat64,Nn)),neurons:e.Vec(e.Tuple(e.Nat64,q)),genesis_timestamp_seconds:e.Nat64}),te=e.Variant({Ok:e.Null,Err:R}),On=e.Variant({Error:R,NeuronId:o}),Rn=e.Record({result:e.Opt(On)}),Ye=e.Variant({Ok:q,Err:R}),yn=e.Variant({Ok:Ke,Err:R}),hn=e.Variant({Ok:D,Err:R}),ne=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(Je),voting_power_refreshed_timestamp_seconds:e.Opt(e.Nat64),potential_voting_power:e.Opt(e.Nat64),neuron_type:e.Opt(e.Int32),deciding_voting_power:e.Opt(e.Nat64),created_timestamp_seconds:e.Nat64,state:e.Int32,stake_e8s:e.Nat64,joined_community_fund_timestamp_seconds:e.Opt(e.Nat64),retrieved_at_timestamp_seconds:e.Nat64,visibility:e.Opt(e.Int32),known_neuron_data:e.Opt(i),voting_power:e.Nat64,age_seconds:e.Nat64}),Qe=e.Variant({Ok:ne,Err:R}),vn=e.Record({nns_proposal_id:e.Opt(S)}),bn=e.Record({final_neurons_fund_participation:e.Opt(ee),initial_neurons_fund_participation:e.Opt(ee),neurons_fund_refunds:e.Opt(we)}),xn=e.Record({neurons_fund_audit_info:e.Opt(bn)}),Sn=e.Variant({Ok:xn,Err:R}),kn=e.Record({result:e.Opt(Sn)}),Pn=e.Variant({Ok:k,Err:R}),Oe=e.Record({id:e.Opt(S),status:e.Int32,topic:e.Int32,failure_reason:e.Opt(R),ballots:e.Vec(e.Tuple(e.Nat64,$e)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,deadline_timestamp_seconds:e.Opt(e.Nat64),failed_timestamp_seconds:e.Nat64,reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(ze),latest_tally:e.Opt(Xe),total_potential_voting_power:e.Opt(e.Nat64),reward_status:e.Int32,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(n),proposer:e.Opt(o),executed_timestamp_seconds:e.Nat64}),Tn=e.Record({known_neurons:e.Vec(s)}),Cn=e.Record({subaccount:e.Vec(e.Nat8)}),Vn=e.Record({page_size:e.Opt(e.Nat64),include_public_neurons_in_full_neurons:e.Opt(e.Bool),neuron_ids:e.Vec(e.Nat64),page_number:e.Opt(e.Nat64),include_empty_neurons_readable_by_caller:e.Opt(e.Bool),neuron_subaccounts:e.Opt(e.Vec(Cn)),include_neurons_readable_by_caller:e.Bool}),Mn=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,ne)),full_neurons:e.Vec(q),total_pages_available:e.Opt(e.Nat64)}),An=e.Record({start_timestamp_seconds:e.Opt(e.Nat64),end_timestamp_seconds:e.Opt(e.Nat64)}),Bn=e.Record({date_filter:e.Opt(An)}),En=e.Record({rewards:e.Vec(D)}),Fn=e.Record({node_providers:e.Vec(k)}),qn=e.Record({include_reward_status:e.Vec(e.Int32),omit_large_fields:e.Opt(e.Bool),before_proposal:e.Opt(S),limit:e.Nat32,exclude_topic:e.Vec(e.Int32),include_all_manage_neuron_proposals:e.Opt(e.Bool),include_status:e.Vec(e.Int32)}),Un=e.Record({proposal_info:e.Vec(Oe)}),Gn=e.Record({arg:e.Opt(e.Vec(e.Nat8)),wasm_module:e.Opt(e.Vec(e.Nat8)),skip_stopping_before_installing:e.Opt(e.Bool),canister_id:e.Opt(e.Principal),install_mode:e.Opt(e.Int32)}),Kn=e.Variant({RegisterKnownNeuron:s,ManageNeuron:t,UpdateCanisterSettings:Ve,InstallCode:Gn,StopOrStartCanister:Me,CreateServiceNervousSystem:Be,ExecuteNnsFunction:Ee,RewardNodeProvider:Q,RewardNodeProviders:Fe,ManageNetworkEconomics:I,ApproveGenesisKyc:ge,AddOrRemoveNodeProvider:qe,Motion:Ue}),Hn=e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(Kn),summary:e.Text}),jn=e.Variant({Spawn:u,Split:d,Follow:m,DisburseMaturity:g,RefreshVotingPower:N,ClaimOrRefresh:de,Configure:pe,RegisterVote:Te,Merge:le,DisburseToNeuron:me,MakeProposal:Hn,StakeMaturity:Ce,MergeMaturity:fe,Disburse:Ne});t.fill(e.Record({id:e.Opt(o),command:e.Opt(jn),neuron_id_or_subaccount:e.Opt(Y)}));let Re=e.Record({created_neuron_id:e.Opt(o)}),Wn=e.Record({amount_disbursed_e8s:e.Opt(e.Nat64)}),$n=e.Record({}),zn=e.Record({refreshed_neuron_id:e.Opt(o)}),Xn=e.Record({target_neuron:e.Opt(q),source_neuron:e.Opt(q),target_neuron_info:e.Opt(ne),source_neuron_info:e.Opt(ne)}),Jn=e.Record({message:e.Opt(e.Text),proposal_id:e.Opt(S)}),Yn=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),Qn=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),Zn=e.Record({transfer_block_height:e.Nat64}),In=e.Variant({Error:R,Spawn:Re,Split:Re,Follow:e.Record({}),DisburseMaturity:Wn,RefreshVotingPower:$n,ClaimOrRefresh:zn,Configure:e.Record({}),RegisterVote:e.Record({}),Merge:Xn,DisburseToNeuron:Re,MakeProposal:Jn,StakeMaturity:Yn,MergeMaturity:Qn,Disburse:Zn}),Ze=e.Record({command:e.Opt(In)}),Dn=e.Record({total_direct_contribution_icp_e8s:e.Opt(e.Nat64),total_neurons_fund_contribution_icp_e8s:e.Opt(e.Nat64),sns_governance_canister_id:e.Opt(e.Principal)}),Ln=e.Variant({Committed:Dn,Aborted:e.Record({})}),eo=e.Record({result:e.Opt(Ln),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),to=e.Record({total_direct_participation_icp_e8s:e.Opt(e.Nat64),total_neurons_fund_participation_icp_e8s:e.Opt(e.Nat64),sns_governance_canister_id:e.Opt(e.Principal)}),no=e.Variant({Committed:to,Aborted:e.Record({})}),oo=e.R