@junobuild/core 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/canisterStatus-PLJHSEG5.js +2 -0
- package/dist/browser/{chunk-A53P2AD6.js → chunk-U4E5MZWA.js} +2 -2
- package/dist/browser/{chunk-A53P2AD6.js.map → chunk-U4E5MZWA.js.map} +1 -1
- package/dist/browser/index.js +2 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.mjs +2 -2
- package/dist/node/index.mjs.map +1 -1
- package/dist/workers/auth.worker.js +1 -1
- package/dist/workers/auth.worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/browser/canisterStatus-CMO3J52U.js +0 -2
- /package/dist/browser/{canisterStatus-CMO3J52U.js.map → canisterStatus-PLJHSEG5.js.map} +0 -0
package/dist/browser/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{a as Bn,b as uo,c as or,d as Nn,e as we,f as lo,g as ar,h as ho,i as ot,j as Ke,k as Pn,l as Me,m as po,n as Cn,o as Gt,p as Fn,q as ae,r as kn,s as sr,t as fr,u as jn}from"./chunk-A53P2AD6.js";var zn=or(lr=>{"use strict";lr.byteLength=yo;lr.toByteArray=wo;lr.fromByteArray=bo;var Yt=[],St=[],xo=typeof Uint8Array<"u"?Uint8Array:Array,qr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(se=0,$n=qr.length;se<$n;++se)Yt[se]=qr[se],St[qr.charCodeAt(se)]=se;var se,$n;St["-".charCodeAt(0)]=62;St["_".charCodeAt(0)]=63;function Wn(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var i=r===t?0:4-r%4;return[r,i]}function yo(e){var t=Wn(e),r=t[0],i=t[1];return(r+i)*3/4-i}function mo(e,t,r){return(t+r)*3/4-r}function wo(e){var t,r=Wn(e),i=r[0],a=r[1],u=new xo(mo(e,i,a)),d=0,m=a>0?i-4:i,w;for(w=0;w<m;w+=4)t=St[e.charCodeAt(w)]<<18|St[e.charCodeAt(w+1)]<<12|St[e.charCodeAt(w+2)]<<6|St[e.charCodeAt(w+3)],u[d++]=t>>16&255,u[d++]=t>>8&255,u[d++]=t&255;return a===2&&(t=St[e.charCodeAt(w)]<<2|St[e.charCodeAt(w+1)]>>4,u[d++]=t&255),a===1&&(t=St[e.charCodeAt(w)]<<10|St[e.charCodeAt(w+1)]<<4|St[e.charCodeAt(w+2)]>>2,u[d++]=t>>8&255,u[d++]=t&255),u}function go(e){return Yt[e>>18&63]+Yt[e>>12&63]+Yt[e>>6&63]+Yt[e&63]}function _o(e,t,r){for(var i,a=[],u=t;u<r;u+=3)i=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(e[u+2]&255),a.push(go(i));return a.join("")}function bo(e){for(var t,r=e.length,i=r%3,a=[],u=16383,d=0,m=r-i;d<m;d+=u)a.push(_o(e,d,d+u>m?m:d+u));return i===1?(t=e[r-1],a.push(Yt[t>>2]+Yt[t<<4&63]+"==")):i===2&&(t=(e[r-2]<<8)+e[r-1],a.push(Yt[t>>10]+Yt[t>>4&63]+Yt[t<<2&63]+"=")),a.join("")}});var ii=or(Ee=>{"use strict";var Hr=zn(),ve=ho(),Gn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ee.Buffer=g;Ee.SlowBuffer=Oo;Ee.INSPECT_MAX_BYTES=50;var dr=2147483647;Ee.kMaxLength=dr;g.TYPED_ARRAY_SUPPORT=vo();!g.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 vo(){try{var 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(g.prototype,"parent",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.buffer}});Object.defineProperty(g.prototype,"offset",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.byteOffset}});function Jt(e){if(e>dr)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,g.prototype),t}function g(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Gr(e)}return Xn(e,t,r)}g.poolSize=8192;function Xn(e,t,r){if(typeof e=="string")return Ao(e,t);if(ArrayBuffer.isView(e))return To(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(Vt(e,ArrayBuffer)||e&&Vt(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Vt(e,SharedArrayBuffer)||e&&Vt(e.buffer,SharedArrayBuffer)))return Wr(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return g.from(i,t,r);var a=So(e);if(a)return a;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return g.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}g.from=function(e,t,r){return Xn(e,t,r)};Object.setPrototypeOf(g.prototype,Uint8Array.prototype);Object.setPrototypeOf(g,Uint8Array);function Zn(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 Eo(e,t,r){return Zn(e),e<=0?Jt(e):t!==void 0?typeof r=="string"?Jt(e).fill(t,r):Jt(e).fill(t):Jt(e)}g.alloc=function(e,t,r){return Eo(e,t,r)};function Gr(e){return Zn(e),Jt(e<0?0:Jr(e)|0)}g.allocUnsafe=function(e){return Gr(e)};g.allocUnsafeSlow=function(e){return Gr(e)};function Ao(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!g.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=Qn(e,t)|0,i=Jt(r),a=i.write(e,t);return a!==r&&(i=i.slice(0,a)),i}function $r(e){for(var t=e.length<0?0:Jr(e.length)|0,r=Jt(t),i=0;i<t;i+=1)r[i]=e[i]&255;return r}function To(e){if(Vt(e,Uint8Array)){var t=new Uint8Array(e);return Wr(t.buffer,t.byteOffset,t.byteLength)}return $r(e)}function Wr(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var i;return t===void 0&&r===void 0?i=new Uint8Array(e):r===void 0?i=new Uint8Array(e,t):i=new Uint8Array(e,t,r),Object.setPrototypeOf(i,g.prototype),i}function So(e){if(g.isBuffer(e)){var t=Jr(e.length)|0,r=Jt(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||Ir(e.length)?Jt(0):$r(e);if(e.type==="Buffer"&&Array.isArray(e.data))return $r(e.data)}function Jr(e){if(e>=dr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+dr.toString(16)+" bytes");return e|0}function Oo(e){return+e!=e&&(e=0),g.alloc(+e)}g.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==g.prototype};g.compare=function(t,r){if(Vt(t,Uint8Array)&&(t=g.from(t,t.offset,t.byteLength)),Vt(r,Uint8Array)&&(r=g.from(r,r.offset,r.byteLength)),!g.isBuffer(t)||!g.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var i=t.length,a=r.length,u=0,d=Math.min(i,a);u<d;++u)if(t[u]!==r[u]){i=t[u],a=r[u];break}return i<a?-1:a<i?1:0};g.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}};g.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return g.alloc(0);var i;if(r===void 0)for(r=0,i=0;i<t.length;++i)r+=t[i].length;var a=g.allocUnsafe(r),u=0;for(i=0;i<t.length;++i){var d=t[i];if(Vt(d,Uint8Array))u+d.length>a.length?g.from(d).copy(a,u):Uint8Array.prototype.set.call(a,d,u);else if(g.isBuffer(d))d.copy(a,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=d.length}return a};function Qn(e,t){if(g.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Vt(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);var r=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return zr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ni(e).length;default:if(a)return i?-1:zr(e).length;t=(""+t).toLowerCase(),a=!0}}g.byteLength=Qn;function Uo(e,t,r){var i=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Mo(this,t,r);case"utf8":case"utf-8":return Ln(this,t,r);case"ascii":return jo(this,t,r);case"latin1":case"binary":return Ko(this,t,r);case"base64":return Fo(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yo(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}g.prototype._isBuffer=!0;function fe(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}g.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)fe(this,r,r+1);return this};g.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)fe(this,r,r+3),fe(this,r+1,r+2);return this};g.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)fe(this,r,r+7),fe(this,r+1,r+6),fe(this,r+2,r+5),fe(this,r+3,r+4);return this};g.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Ln(this,0,t):Uo.apply(this,arguments)};g.prototype.toLocaleString=g.prototype.toString;g.prototype.equals=function(t){if(!g.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:g.compare(this,t)===0};g.prototype.inspect=function(){var t="",r=Ee.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Gn&&(g.prototype[Gn]=g.prototype.inspect);g.prototype.compare=function(t,r,i,a,u){if(Vt(t,Uint8Array)&&(t=g.from(t,t.offset,t.byteLength)),!g.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),i===void 0&&(i=t?t.length:0),a===void 0&&(a=0),u===void 0&&(u=this.length),r<0||i>t.length||a<0||u>this.length)throw new RangeError("out of range index");if(a>=u&&r>=i)return 0;if(a>=u)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,a>>>=0,u>>>=0,this===t)return 0;for(var d=u-a,m=i-r,w=Math.min(d,m),A=this.slice(a,u),P=t.slice(r,i),O=0;O<w;++O)if(A[O]!==P[O]){d=A[O],m=P[O];break}return d<m?-1:m<d?1:0};function Dn(e,t,r,i,a){if(e.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Ir(r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0)if(a)r=0;else return-1;if(typeof t=="string"&&(t=g.from(t,i)),g.isBuffer(t))return t.length===0?-1:Jn(e,t,r,i,a);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Jn(e,[t],r,i,a);throw new TypeError("val must be string, number or Buffer")}function Jn(e,t,r,i,a){var u=1,d=e.length,m=t.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||t.length<2)return-1;u=2,d/=2,m/=2,r/=2}function w(it,st){return u===1?it[st]:it.readUInt16BE(st*u)}var A;if(a){var P=-1;for(A=r;A<d;A++)if(w(e,A)===w(t,P===-1?0:A-P)){if(P===-1&&(P=A),A-P+1===m)return P*u}else P!==-1&&(A-=A-P),P=-1}else for(r+m>d&&(r=d-m),A=r;A>=0;A--){for(var O=!0,Z=0;Z<m;Z++)if(w(e,A+Z)!==w(t,Z)){O=!1;break}if(O)return A}return-1}g.prototype.includes=function(t,r,i){return this.indexOf(t,r,i)!==-1};g.prototype.indexOf=function(t,r,i){return Dn(this,t,r,i,!0)};g.prototype.lastIndexOf=function(t,r,i){return Dn(this,t,r,i,!1)};function Ro(e,t,r,i){r=Number(r)||0;var a=e.length-r;i?(i=Number(i),i>a&&(i=a)):i=a;var u=t.length;i>u/2&&(i=u/2);for(var d=0;d<i;++d){var m=parseInt(t.substr(d*2,2),16);if(Ir(m))return d;e[r+d]=m}return d}function Bo(e,t,r,i){return hr(zr(t,e.length-r),e,r,i)}function No(e,t,r,i){return hr(Ho(t),e,r,i)}function Po(e,t,r,i){return hr(ni(t),e,r,i)}function Co(e,t,r,i){return hr($o(t,e.length-r),e,r,i)}g.prototype.write=function(t,r,i,a){if(r===void 0)a="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")a=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,a===void 0&&(a="utf8")):(a=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var u=this.length-r;if((i===void 0||i>u)&&(i=u),t.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var d=!1;;)switch(a){case"hex":return Ro(this,t,r,i);case"utf8":case"utf-8":return Bo(this,t,r,i);case"ascii":case"latin1":case"binary":return No(this,t,r,i);case"base64":return Po(this,t,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Co(this,t,r,i);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),d=!0}};g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Fo(e,t,r){return t===0&&r===e.length?Hr.fromByteArray(e):Hr.fromByteArray(e.slice(t,r))}function Ln(e,t,r){r=Math.min(e.length,r);for(var i=[],a=t;a<r;){var u=e[a],d=null,m=u>239?4:u>223?3:u>191?2:1;if(a+m<=r){var w,A,P,O;switch(m){case 1:u<128&&(d=u);break;case 2:w=e[a+1],(w&192)===128&&(O=(u&31)<<6|w&63,O>127&&(d=O));break;case 3:w=e[a+1],A=e[a+2],(w&192)===128&&(A&192)===128&&(O=(u&15)<<12|(w&63)<<6|A&63,O>2047&&(O<55296||O>57343)&&(d=O));break;case 4:w=e[a+1],A=e[a+2],P=e[a+3],(w&192)===128&&(A&192)===128&&(P&192)===128&&(O=(u&15)<<18|(w&63)<<12|(A&63)<<6|P&63,O>65535&&O<1114112&&(d=O))}}d===null?(d=65533,m=1):d>65535&&(d-=65536,i.push(d>>>10&1023|55296),d=56320|d&1023),i.push(d),a+=m}return ko(i)}var In=4096;function ko(e){var t=e.length;if(t<=In)return String.fromCharCode.apply(String,e);for(var r="",i=0;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=In));return r}function jo(e,t,r){var i="";r=Math.min(e.length,r);for(var a=t;a<r;++a)i+=String.fromCharCode(e[a]&127);return i}function Ko(e,t,r){var i="";r=Math.min(e.length,r);for(var a=t;a<r;++a)i+=String.fromCharCode(e[a]);return i}function Mo(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var a="",u=t;u<r;++u)a+=Wo[e[u]];return a}function Yo(e,t,r){for(var i=e.slice(t,r),a="",u=0;u<i.length-1;u+=2)a+=String.fromCharCode(i[u]+i[u+1]*256);return a}g.prototype.slice=function(t,r){var i=this.length;t=~~t,r=r===void 0?i:~~r,t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<t&&(r=t);var a=this.subarray(t,r);return Object.setPrototypeOf(a,g.prototype),a};function pt(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUintLE=g.prototype.readUIntLE=function(t,r,i){t=t>>>0,r=r>>>0,i||pt(t,r,this.length);for(var a=this[t],u=1,d=0;++d<r&&(u*=256);)a+=this[t+d]*u;return a};g.prototype.readUintBE=g.prototype.readUIntBE=function(t,r,i){t=t>>>0,r=r>>>0,i||pt(t,r,this.length);for(var a=this[t+--r],u=1;r>0&&(u*=256);)a+=this[t+--r]*u;return a};g.prototype.readUint8=g.prototype.readUInt8=function(t,r){return t=t>>>0,r||pt(t,1,this.length),this[t]};g.prototype.readUint16LE=g.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||pt(t,2,this.length),this[t]|this[t+1]<<8};g.prototype.readUint16BE=g.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||pt(t,2,this.length),this[t]<<8|this[t+1]};g.prototype.readUint32LE=g.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||pt(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};g.prototype.readUint32BE=g.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||pt(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};g.prototype.readIntLE=function(t,r,i){t=t>>>0,r=r>>>0,i||pt(t,r,this.length);for(var a=this[t],u=1,d=0;++d<r&&(u*=256);)a+=this[t+d]*u;return u*=128,a>=u&&(a-=Math.pow(2,8*r)),a};g.prototype.readIntBE=function(t,r,i){t=t>>>0,r=r>>>0,i||pt(t,r,this.length);for(var a=r,u=1,d=this[t+--a];a>0&&(u*=256);)d+=this[t+--a]*u;return u*=128,d>=u&&(d-=Math.pow(2,8*r)),d};g.prototype.readInt8=function(t,r){return t=t>>>0,r||pt(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};g.prototype.readInt16LE=function(t,r){t=t>>>0,r||pt(t,2,this.length);var i=this[t]|this[t+1]<<8;return i&32768?i|4294901760:i};g.prototype.readInt16BE=function(t,r){t=t>>>0,r||pt(t,2,this.length);var i=this[t+1]|this[t]<<8;return i&32768?i|4294901760:i};g.prototype.readInt32LE=function(t,r){return t=t>>>0,r||pt(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};g.prototype.readInt32BE=function(t,r){return t=t>>>0,r||pt(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};g.prototype.readFloatLE=function(t,r){return t=t>>>0,r||pt(t,4,this.length),ve.read(this,t,!0,23,4)};g.prototype.readFloatBE=function(t,r){return t=t>>>0,r||pt(t,4,this.length),ve.read(this,t,!1,23,4)};g.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||pt(t,8,this.length),ve.read(this,t,!0,52,8)};g.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||pt(t,8,this.length),ve.read(this,t,!1,52,8)};function bt(e,t,r,i,a,u){if(!g.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<u)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}g.prototype.writeUintLE=g.prototype.writeUIntLE=function(t,r,i,a){if(t=+t,r=r>>>0,i=i>>>0,!a){var u=Math.pow(2,8*i)-1;bt(this,t,r,i,u,0)}var d=1,m=0;for(this[r]=t&255;++m<i&&(d*=256);)this[r+m]=t/d&255;return r+i};g.prototype.writeUintBE=g.prototype.writeUIntBE=function(t,r,i,a){if(t=+t,r=r>>>0,i=i>>>0,!a){var u=Math.pow(2,8*i)-1;bt(this,t,r,i,u,0)}var d=i-1,m=1;for(this[r+d]=t&255;--d>=0&&(m*=256);)this[r+d]=t/m&255;return r+i};g.prototype.writeUint8=g.prototype.writeUInt8=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,1,255,0),this[r]=t&255,r+1};g.prototype.writeUint16LE=g.prototype.writeUInt16LE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};g.prototype.writeUint16BE=g.prototype.writeUInt16BE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};g.prototype.writeUint32LE=g.prototype.writeUInt32LE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};g.prototype.writeUint32BE=g.prototype.writeUInt32BE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};g.prototype.writeIntLE=function(t,r,i,a){if(t=+t,r=r>>>0,!a){var u=Math.pow(2,8*i-1);bt(this,t,r,i,u-1,-u)}var d=0,m=1,w=0;for(this[r]=t&255;++d<i&&(m*=256);)t<0&&w===0&&this[r+d-1]!==0&&(w=1),this[r+d]=(t/m>>0)-w&255;return r+i};g.prototype.writeIntBE=function(t,r,i,a){if(t=+t,r=r>>>0,!a){var u=Math.pow(2,8*i-1);bt(this,t,r,i,u-1,-u)}var d=i-1,m=1,w=0;for(this[r+d]=t&255;--d>=0&&(m*=256);)t<0&&w===0&&this[r+d+1]!==0&&(w=1),this[r+d]=(t/m>>0)-w&255;return r+i};g.prototype.writeInt8=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};g.prototype.writeInt16LE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};g.prototype.writeInt16BE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};g.prototype.writeInt32LE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};g.prototype.writeInt32BE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function ti(e,t,r,i,a,u){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ei(e,t,r,i,a){return t=+t,r=r>>>0,a||ti(e,t,r,4,34028234663852886e22,-34028234663852886e22),ve.write(e,t,r,i,23,4),r+4}g.prototype.writeFloatLE=function(t,r,i){return ei(this,t,r,!0,i)};g.prototype.writeFloatBE=function(t,r,i){return ei(this,t,r,!1,i)};function ri(e,t,r,i,a){return t=+t,r=r>>>0,a||ti(e,t,r,8,17976931348623157e292,-17976931348623157e292),ve.write(e,t,r,i,52,8),r+8}g.prototype.writeDoubleLE=function(t,r,i){return ri(this,t,r,!0,i)};g.prototype.writeDoubleBE=function(t,r,i){return ri(this,t,r,!1,i)};g.prototype.copy=function(t,r,i,a){if(!g.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i||(i=0),!a&&a!==0&&(a=this.length),r>=t.length&&(r=t.length),r||(r=0),a>0&&a<i&&(a=i),a===i||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),t.length-r<a-i&&(a=t.length-r+i);var u=a-i;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,a):Uint8Array.prototype.set.call(t,this.subarray(i,a),r),u};g.prototype.fill=function(t,r,i,a){if(typeof t=="string"){if(typeof r=="string"?(a=r,r=0,i=this.length):typeof i=="string"&&(a=i,i=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!g.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(t.length===1){var u=t.charCodeAt(0);(a==="utf8"&&u<128||a==="latin1")&&(t=u)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,t||(t=0);var d;if(typeof t=="number")for(d=r;d<i;++d)this[d]=t;else{var m=g.isBuffer(t)?t:g.from(t,a),w=m.length;if(w===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(d=0;d<i-r;++d)this[d+r]=m[d%w]}return this};var Vo=/[^+/0-9A-Za-z-_]/g;function qo(e){if(e=e.split("=")[0],e=e.trim().replace(Vo,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function zr(e,t){t=t||1/0;for(var r,i=e.length,a=null,u=[],d=0;d<i;++d){if(r=e.charCodeAt(d),r>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&u.push(239,191,189);continue}else if(d+1===i){(t-=3)>-1&&u.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&u.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&u.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;u.push(r)}else if(r<2048){if((t-=2)<0)break;u.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;u.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;u.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return u}function Ho(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function $o(e,t){for(var r,i,a,u=[],d=0;d<e.length&&!((t-=2)<0);++d)r=e.charCodeAt(d),i=r>>8,a=r%256,u.push(a),u.push(i);return u}function ni(e){return Hr.toByteArray(qo(e))}function hr(e,t,r,i){for(var a=0;a<i&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function Vt(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Ir(e){return e!==e}var Wo=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=r*16,a=0;a<16;++a)t[i+a]=e[r]+e[a];return t}()});var gi={};Nn(gi,{default:()=>ua});var ua,_i=uo(()=>{ua={}});var bi=or((xf,gr)=>{var le=(_i(),lo(gi));if(le&&le.default){gr.exports=le.default;for(let e in le)gr.exports[e]=le[e]}else le&&(gr.exports=le)});var tn=or((yf,_r)=>{(function(e){"use strict";var t=function(o){var f,s=new Float64Array(16);if(o)for(f=0;f<o.length;f++)s[f]=o[f];return s},r=function(){throw new Error("no PRNG")},i=new Uint8Array(16),a=new Uint8Array(32);a[0]=9;var u=t(),d=t([1]),m=t([56129,1]),w=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),A=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),P=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),O=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Z=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function it(o,f,s,n){o[f]=s>>24&255,o[f+1]=s>>16&255,o[f+2]=s>>8&255,o[f+3]=s&255,o[f+4]=n>>24&255,o[f+5]=n>>16&255,o[f+6]=n>>8&255,o[f+7]=n&255}function st(o,f,s,n,c){var h,p=0;for(h=0;h<c;h++)p|=o[f+h]^s[n+h];return(1&p-1>>>8)-1}function ft(o,f,s,n){return st(o,f,s,n,16)}function At(o,f,s,n){return st(o,f,s,n,32)}function Lt(o,f,s,n){for(var c=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,h=s[0]&255|(s[1]&255)<<8|(s[2]&255)<<16|(s[3]&255)<<24,p=s[4]&255|(s[5]&255)<<8|(s[6]&255)<<16|(s[7]&255)<<24,b=s[8]&255|(s[9]&255)<<8|(s[10]&255)<<16|(s[11]&255)<<24,S=s[12]&255|(s[13]&255)<<8|(s[14]&255)<<16|(s[15]&255)<<24,j=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,R=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,et=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,N=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,Y=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,V=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,z=s[16]&255|(s[17]&255)<<8|(s[18]&255)<<16|(s[19]&255)<<24,W=s[20]&255|(s[21]&255)<<8|(s[22]&255)<<16|(s[23]&255)<<24,q=s[24]&255|(s[25]&255)<<8|(s[26]&255)<<16|(s[27]&255)<<24,$=s[28]&255|(s[29]&255)<<8|(s[30]&255)<<16|(s[31]&255)<<24,H=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,C=c,K=h,B=p,F=b,k=S,U=j,x=R,y=et,E=N,_=Y,v=V,T=z,M=W,G=q,I=$,J=H,l,Q=0;Q<20;Q+=2)l=C+M|0,k^=l<<7|l>>>32-7,l=k+C|0,E^=l<<9|l>>>32-9,l=E+k|0,M^=l<<13|l>>>32-13,l=M+E|0,C^=l<<18|l>>>32-18,l=U+K|0,_^=l<<7|l>>>32-7,l=_+U|0,G^=l<<9|l>>>32-9,l=G+_|0,K^=l<<13|l>>>32-13,l=K+G|0,U^=l<<18|l>>>32-18,l=v+x|0,I^=l<<7|l>>>32-7,l=I+v|0,B^=l<<9|l>>>32-9,l=B+I|0,x^=l<<13|l>>>32-13,l=x+B|0,v^=l<<18|l>>>32-18,l=J+T|0,F^=l<<7|l>>>32-7,l=F+J|0,y^=l<<9|l>>>32-9,l=y+F|0,T^=l<<13|l>>>32-13,l=T+y|0,J^=l<<18|l>>>32-18,l=C+F|0,K^=l<<7|l>>>32-7,l=K+C|0,B^=l<<9|l>>>32-9,l=B+K|0,F^=l<<13|l>>>32-13,l=F+B|0,C^=l<<18|l>>>32-18,l=U+k|0,x^=l<<7|l>>>32-7,l=x+U|0,y^=l<<9|l>>>32-9,l=y+x|0,k^=l<<13|l>>>32-13,l=k+y|0,U^=l<<18|l>>>32-18,l=v+_|0,T^=l<<7|l>>>32-7,l=T+v|0,E^=l<<9|l>>>32-9,l=E+T|0,_^=l<<13|l>>>32-13,l=_+E|0,v^=l<<18|l>>>32-18,l=J+I|0,M^=l<<7|l>>>32-7,l=M+J|0,G^=l<<9|l>>>32-9,l=G+M|0,I^=l<<13|l>>>32-13,l=I+G|0,J^=l<<18|l>>>32-18;C=C+c|0,K=K+h|0,B=B+p|0,F=F+b|0,k=k+S|0,U=U+j|0,x=x+R|0,y=y+et|0,E=E+N|0,_=_+Y|0,v=v+V|0,T=T+z|0,M=M+W|0,G=G+q|0,I=I+$|0,J=J+H|0,o[0]=C>>>0&255,o[1]=C>>>8&255,o[2]=C>>>16&255,o[3]=C>>>24&255,o[4]=K>>>0&255,o[5]=K>>>8&255,o[6]=K>>>16&255,o[7]=K>>>24&255,o[8]=B>>>0&255,o[9]=B>>>8&255,o[10]=B>>>16&255,o[11]=B>>>24&255,o[12]=F>>>0&255,o[13]=F>>>8&255,o[14]=F>>>16&255,o[15]=F>>>24&255,o[16]=k>>>0&255,o[17]=k>>>8&255,o[18]=k>>>16&255,o[19]=k>>>24&255,o[20]=U>>>0&255,o[21]=U>>>8&255,o[22]=U>>>16&255,o[23]=U>>>24&255,o[24]=x>>>0&255,o[25]=x>>>8&255,o[26]=x>>>16&255,o[27]=x>>>24&255,o[28]=y>>>0&255,o[29]=y>>>8&255,o[30]=y>>>16&255,o[31]=y>>>24&255,o[32]=E>>>0&255,o[33]=E>>>8&255,o[34]=E>>>16&255,o[35]=E>>>24&255,o[36]=_>>>0&255,o[37]=_>>>8&255,o[38]=_>>>16&255,o[39]=_>>>24&255,o[40]=v>>>0&255,o[41]=v>>>8&255,o[42]=v>>>16&255,o[43]=v>>>24&255,o[44]=T>>>0&255,o[45]=T>>>8&255,o[46]=T>>>16&255,o[47]=T>>>24&255,o[48]=M>>>0&255,o[49]=M>>>8&255,o[50]=M>>>16&255,o[51]=M>>>24&255,o[52]=G>>>0&255,o[53]=G>>>8&255,o[54]=G>>>16&255,o[55]=G>>>24&255,o[56]=I>>>0&255,o[57]=I>>>8&255,o[58]=I>>>16&255,o[59]=I>>>24&255,o[60]=J>>>0&255,o[61]=J>>>8&255,o[62]=J>>>16&255,o[63]=J>>>24&255}function te(o,f,s,n){for(var c=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,h=s[0]&255|(s[1]&255)<<8|(s[2]&255)<<16|(s[3]&255)<<24,p=s[4]&255|(s[5]&255)<<8|(s[6]&255)<<16|(s[7]&255)<<24,b=s[8]&255|(s[9]&255)<<8|(s[10]&255)<<16|(s[11]&255)<<24,S=s[12]&255|(s[13]&255)<<8|(s[14]&255)<<16|(s[15]&255)<<24,j=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,R=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,et=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,N=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,Y=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,V=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,z=s[16]&255|(s[17]&255)<<8|(s[18]&255)<<16|(s[19]&255)<<24,W=s[20]&255|(s[21]&255)<<8|(s[22]&255)<<16|(s[23]&255)<<24,q=s[24]&255|(s[25]&255)<<8|(s[26]&255)<<16|(s[27]&255)<<24,$=s[28]&255|(s[29]&255)<<8|(s[30]&255)<<16|(s[31]&255)<<24,H=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,C=c,K=h,B=p,F=b,k=S,U=j,x=R,y=et,E=N,_=Y,v=V,T=z,M=W,G=q,I=$,J=H,l,Q=0;Q<20;Q+=2)l=C+M|0,k^=l<<7|l>>>32-7,l=k+C|0,E^=l<<9|l>>>32-9,l=E+k|0,M^=l<<13|l>>>32-13,l=M+E|0,C^=l<<18|l>>>32-18,l=U+K|0,_^=l<<7|l>>>32-7,l=_+U|0,G^=l<<9|l>>>32-9,l=G+_|0,K^=l<<13|l>>>32-13,l=K+G|0,U^=l<<18|l>>>32-18,l=v+x|0,I^=l<<7|l>>>32-7,l=I+v|0,B^=l<<9|l>>>32-9,l=B+I|0,x^=l<<13|l>>>32-13,l=x+B|0,v^=l<<18|l>>>32-18,l=J+T|0,F^=l<<7|l>>>32-7,l=F+J|0,y^=l<<9|l>>>32-9,l=y+F|0,T^=l<<13|l>>>32-13,l=T+y|0,J^=l<<18|l>>>32-18,l=C+F|0,K^=l<<7|l>>>32-7,l=K+C|0,B^=l<<9|l>>>32-9,l=B+K|0,F^=l<<13|l>>>32-13,l=F+B|0,C^=l<<18|l>>>32-18,l=U+k|0,x^=l<<7|l>>>32-7,l=x+U|0,y^=l<<9|l>>>32-9,l=y+x|0,k^=l<<13|l>>>32-13,l=k+y|0,U^=l<<18|l>>>32-18,l=v+_|0,T^=l<<7|l>>>32-7,l=T+v|0,E^=l<<9|l>>>32-9,l=E+T|0,_^=l<<13|l>>>32-13,l=_+E|0,v^=l<<18|l>>>32-18,l=J+I|0,M^=l<<7|l>>>32-7,l=M+J|0,G^=l<<9|l>>>32-9,l=G+M|0,I^=l<<13|l>>>32-13,l=I+G|0,J^=l<<18|l>>>32-18;o[0]=C>>>0&255,o[1]=C>>>8&255,o[2]=C>>>16&255,o[3]=C>>>24&255,o[4]=U>>>0&255,o[5]=U>>>8&255,o[6]=U>>>16&255,o[7]=U>>>24&255,o[8]=v>>>0&255,o[9]=v>>>8&255,o[10]=v>>>16&255,o[11]=v>>>24&255,o[12]=J>>>0&255,o[13]=J>>>8&255,o[14]=J>>>16&255,o[15]=J>>>24&255,o[16]=x>>>0&255,o[17]=x>>>8&255,o[18]=x>>>16&255,o[19]=x>>>24&255,o[20]=y>>>0&255,o[21]=y>>>8&255,o[22]=y>>>16&255,o[23]=y>>>24&255,o[24]=E>>>0&255,o[25]=E>>>8&255,o[26]=E>>>16&255,o[27]=E>>>24&255,o[28]=_>>>0&255,o[29]=_>>>8&255,o[30]=_>>>16&255,o[31]=_>>>24&255}function jt(o,f,s,n){Lt(o,f,s,n)}function Rt(o,f,s,n){te(o,f,s,n)}var Kt=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Je(o,f,s,n,c,h,p){var b=new Uint8Array(16),S=new Uint8Array(64),j,R;for(R=0;R<16;R++)b[R]=0;for(R=0;R<8;R++)b[R]=h[R];for(;c>=64;){for(jt(S,b,p,Kt),R=0;R<64;R++)o[f+R]=s[n+R]^S[R];for(j=1,R=8;R<16;R++)j=j+(b[R]&255)|0,b[R]=j&255,j>>>=8;c-=64,f+=64,n+=64}if(c>0)for(jt(S,b,p,Kt),R=0;R<c;R++)o[f+R]=s[n+R]^S[R];return 0}function Ie(o,f,s,n,c){var h=new Uint8Array(16),p=new Uint8Array(64),b,S;for(S=0;S<16;S++)h[S]=0;for(S=0;S<8;S++)h[S]=n[S];for(;s>=64;){for(jt(p,h,c,Kt),S=0;S<64;S++)o[f+S]=p[S];for(b=1,S=8;S<16;S++)b=b+(h[S]&255)|0,h[S]=b&255,b>>>=8;s-=64,f+=64}if(s>0)for(jt(p,h,c,Kt),S=0;S<s;S++)o[f+S]=p[S];return 0}function Xe(o,f,s,n,c){var h=new Uint8Array(32);Rt(h,n,c,Kt);for(var p=new Uint8Array(8),b=0;b<8;b++)p[b]=n[b+16];return Ie(o,f,s,p,h)}function Ue(o,f,s,n,c,h,p){var b=new Uint8Array(32);Rt(b,h,p,Kt);for(var S=new Uint8Array(8),j=0;j<8;j++)S[j]=h[j+16];return Je(o,f,s,n,c,S,b)}var xe=function(o){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var f,s,n,c,h,p,b,S;f=o[0]&255|(o[1]&255)<<8,this.r[0]=f&8191,s=o[2]&255|(o[3]&255)<<8,this.r[1]=(f>>>13|s<<3)&8191,n=o[4]&255|(o[5]&255)<<8,this.r[2]=(s>>>10|n<<6)&7939,c=o[6]&255|(o[7]&255)<<8,this.r[3]=(n>>>7|c<<9)&8191,h=o[8]&255|(o[9]&255)<<8,this.r[4]=(c>>>4|h<<12)&255,this.r[5]=h>>>1&8190,p=o[10]&255|(o[11]&255)<<8,this.r[6]=(h>>>14|p<<2)&8191,b=o[12]&255|(o[13]&255)<<8,this.r[7]=(p>>>11|b<<5)&8065,S=o[14]&255|(o[15]&255)<<8,this.r[8]=(b>>>8|S<<8)&8191,this.r[9]=S>>>5&127,this.pad[0]=o[16]&255|(o[17]&255)<<8,this.pad[1]=o[18]&255|(o[19]&255)<<8,this.pad[2]=o[20]&255|(o[21]&255)<<8,this.pad[3]=o[22]&255|(o[23]&255)<<8,this.pad[4]=o[24]&255|(o[25]&255)<<8,this.pad[5]=o[26]&255|(o[27]&255)<<8,this.pad[6]=o[28]&255|(o[29]&255)<<8,this.pad[7]=o[30]&255|(o[31]&255)<<8};xe.prototype.blocks=function(o,f,s){for(var n=this.fin?0:2048,c,h,p,b,S,j,R,et,N,Y,V,z,W,q,$,H,C,K,B,F=this.h[0],k=this.h[1],U=this.h[2],x=this.h[3],y=this.h[4],E=this.h[5],_=this.h[6],v=this.h[7],T=this.h[8],M=this.h[9],G=this.r[0],I=this.r[1],J=this.r[2],l=this.r[3],Q=this.r[4],rt=this.r[5],nt=this.r[6],X=this.r[7],L=this.r[8],tt=this.r[9];s>=16;)c=o[f+0]&255|(o[f+1]&255)<<8,F+=c&8191,h=o[f+2]&255|(o[f+3]&255)<<8,k+=(c>>>13|h<<3)&8191,p=o[f+4]&255|(o[f+5]&255)<<8,U+=(h>>>10|p<<6)&8191,b=o[f+6]&255|(o[f+7]&255)<<8,x+=(p>>>7|b<<9)&8191,S=o[f+8]&255|(o[f+9]&255)<<8,y+=(b>>>4|S<<12)&8191,E+=S>>>1&8191,j=o[f+10]&255|(o[f+11]&255)<<8,_+=(S>>>14|j<<2)&8191,R=o[f+12]&255|(o[f+13]&255)<<8,v+=(j>>>11|R<<5)&8191,et=o[f+14]&255|(o[f+15]&255)<<8,T+=(R>>>8|et<<8)&8191,M+=et>>>5|n,N=0,Y=N,Y+=F*G,Y+=k*(5*tt),Y+=U*(5*L),Y+=x*(5*X),Y+=y*(5*nt),N=Y>>>13,Y&=8191,Y+=E*(5*rt),Y+=_*(5*Q),Y+=v*(5*l),Y+=T*(5*J),Y+=M*(5*I),N+=Y>>>13,Y&=8191,V=N,V+=F*I,V+=k*G,V+=U*(5*tt),V+=x*(5*L),V+=y*(5*X),N=V>>>13,V&=8191,V+=E*(5*nt),V+=_*(5*rt),V+=v*(5*Q),V+=T*(5*l),V+=M*(5*J),N+=V>>>13,V&=8191,z=N,z+=F*J,z+=k*I,z+=U*G,z+=x*(5*tt),z+=y*(5*L),N=z>>>13,z&=8191,z+=E*(5*X),z+=_*(5*nt),z+=v*(5*rt),z+=T*(5*Q),z+=M*(5*l),N+=z>>>13,z&=8191,W=N,W+=F*l,W+=k*J,W+=U*I,W+=x*G,W+=y*(5*tt),N=W>>>13,W&=8191,W+=E*(5*L),W+=_*(5*X),W+=v*(5*nt),W+=T*(5*rt),W+=M*(5*Q),N+=W>>>13,W&=8191,q=N,q+=F*Q,q+=k*l,q+=U*J,q+=x*I,q+=y*G,N=q>>>13,q&=8191,q+=E*(5*tt),q+=_*(5*L),q+=v*(5*X),q+=T*(5*nt),q+=M*(5*rt),N+=q>>>13,q&=8191,$=N,$+=F*rt,$+=k*Q,$+=U*l,$+=x*J,$+=y*I,N=$>>>13,$&=8191,$+=E*G,$+=_*(5*tt),$+=v*(5*L),$+=T*(5*X),$+=M*(5*nt),N+=$>>>13,$&=8191,H=N,H+=F*nt,H+=k*rt,H+=U*Q,H+=x*l,H+=y*J,N=H>>>13,H&=8191,H+=E*I,H+=_*G,H+=v*(5*tt),H+=T*(5*L),H+=M*(5*X),N+=H>>>13,H&=8191,C=N,C+=F*X,C+=k*nt,C+=U*rt,C+=x*Q,C+=y*l,N=C>>>13,C&=8191,C+=E*J,C+=_*I,C+=v*G,C+=T*(5*tt),C+=M*(5*L),N+=C>>>13,C&=8191,K=N,K+=F*L,K+=k*X,K+=U*nt,K+=x*rt,K+=y*Q,N=K>>>13,K&=8191,K+=E*l,K+=_*J,K+=v*I,K+=T*G,K+=M*(5*tt),N+=K>>>13,K&=8191,B=N,B+=F*tt,B+=k*L,B+=U*X,B+=x*nt,B+=y*rt,N=B>>>13,B&=8191,B+=E*Q,B+=_*l,B+=v*J,B+=T*I,B+=M*G,N+=B>>>13,B&=8191,N=(N<<2)+N|0,N=N+Y|0,Y=N&8191,N=N>>>13,V+=N,F=Y,k=V,U=z,x=W,y=q,E=$,_=H,v=C,T=K,M=B,f+=16,s-=16;this.h[0]=F,this.h[1]=k,this.h[2]=U,this.h[3]=x,this.h[4]=y,this.h[5]=E,this.h[6]=_,this.h[7]=v,this.h[8]=T,this.h[9]=M},xe.prototype.finish=function(o,f){var s=new Uint16Array(10),n,c,h,p;if(this.leftover){for(p=this.leftover,this.buffer[p++]=1;p<16;p++)this.buffer[p]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,p=2;p<10;p++)this.h[p]+=n,n=this.h[p]>>>13,this.h[p]&=8191;for(this.h[0]+=n*5,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,s[0]=this.h[0]+5,n=s[0]>>>13,s[0]&=8191,p=1;p<10;p++)s[p]=this.h[p]+n,n=s[p]>>>13,s[p]&=8191;for(s[9]-=1<<13,c=(n^1)-1,p=0;p<10;p++)s[p]&=c;for(c=~c,p=0;p<10;p++)this.h[p]=this.h[p]&c|s[p];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,h=this.h[0]+this.pad[0],this.h[0]=h&65535,p=1;p<8;p++)h=(this.h[p]+this.pad[p]|0)+(h>>>16)|0,this.h[p]=h&65535;o[f+0]=this.h[0]>>>0&255,o[f+1]=this.h[0]>>>8&255,o[f+2]=this.h[1]>>>0&255,o[f+3]=this.h[1]>>>8&255,o[f+4]=this.h[2]>>>0&255,o[f+5]=this.h[2]>>>8&255,o[f+6]=this.h[3]>>>0&255,o[f+7]=this.h[3]>>>8&255,o[f+8]=this.h[4]>>>0&255,o[f+9]=this.h[4]>>>8&255,o[f+10]=this.h[5]>>>0&255,o[f+11]=this.h[5]>>>8&255,o[f+12]=this.h[6]>>>0&255,o[f+13]=this.h[6]>>>8&255,o[f+14]=this.h[7]>>>0&255,o[f+15]=this.h[7]>>>8&255},xe.prototype.update=function(o,f,s){var n,c;if(this.leftover){for(c=16-this.leftover,c>s&&(c=s),n=0;n<c;n++)this.buffer[this.leftover+n]=o[f+n];if(s-=c,f+=c,this.leftover+=c,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(s>=16&&(c=s-s%16,this.blocks(o,f,c),f+=c,s-=c),s){for(n=0;n<s;n++)this.buffer[this.leftover+n]=o[f+n];this.leftover+=s}};function Re(o,f,s,n,c,h){var p=new xe(h);return p.update(s,n,c),p.finish(o,f),0}function ne(o,f,s,n,c,h){var p=new Uint8Array(16);return Re(p,0,s,n,c,h),ft(o,f,p,0)}function Be(o,f,s,n,c){var h;if(s<32)return-1;for(Ue(o,0,f,0,s,n,c),Re(o,16,o,32,s-32,o),h=0;h<16;h++)o[h]=0;return 0}function Ne(o,f,s,n,c){var h,p=new Uint8Array(32);if(s<32||(Xe(p,0,32,n,c),ne(f,16,f,32,s-32,p)!==0))return-1;for(Ue(o,0,f,0,s,n,c),h=0;h<32;h++)o[h]=0;return 0}function Bt(o,f){var s;for(s=0;s<16;s++)o[s]=f[s]|0}function Pe(o){var f,s,n=1;for(f=0;f<16;f++)s=o[f]+n+65535,n=Math.floor(s/65536),o[f]=s-n*65536;o[0]+=n-1+37*(n-1)}function ee(o,f,s){for(var n,c=~(s-1),h=0;h<16;h++)n=c&(o[h]^f[h]),o[h]^=n,f[h]^=n}function re(o,f){var s,n,c,h=t(),p=t();for(s=0;s<16;s++)p[s]=f[s];for(Pe(p),Pe(p),Pe(p),n=0;n<2;n++){for(h[0]=p[0]-65517,s=1;s<15;s++)h[s]=p[s]-65535-(h[s-1]>>16&1),h[s-1]&=65535;h[15]=p[15]-32767-(h[14]>>16&1),c=h[15]>>16&1,h[14]&=65535,ee(p,h,1-c)}for(s=0;s<16;s++)o[2*s]=p[s]&255,o[2*s+1]=p[s]>>8}function Ze(o,f){var s=new Uint8Array(32),n=new Uint8Array(32);return re(s,o),re(n,f),At(s,0,n,0)}function wn(o){var f=new Uint8Array(32);return re(f,o),f[0]&1}function Ur(o,f){var s;for(s=0;s<16;s++)o[s]=f[2*s]+(f[2*s+1]<<8);o[15]&=32767}function Nt(o,f,s){for(var n=0;n<16;n++)o[n]=f[n]+s[n]}function Pt(o,f,s){for(var n=0;n<16;n++)o[n]=f[n]-s[n]}function D(o,f,s){var n,c,h=0,p=0,b=0,S=0,j=0,R=0,et=0,N=0,Y=0,V=0,z=0,W=0,q=0,$=0,H=0,C=0,K=0,B=0,F=0,k=0,U=0,x=0,y=0,E=0,_=0,v=0,T=0,M=0,G=0,I=0,J=0,l=s[0],Q=s[1],rt=s[2],nt=s[3],X=s[4],L=s[5],tt=s[6],dt=s[7],at=s[8],ct=s[9],ut=s[10],lt=s[11],ht=s[12],yt=s[13],mt=s[14],wt=s[15];n=f[0],h+=n*l,p+=n*Q,b+=n*rt,S+=n*nt,j+=n*X,R+=n*L,et+=n*tt,N+=n*dt,Y+=n*at,V+=n*ct,z+=n*ut,W+=n*lt,q+=n*ht,$+=n*yt,H+=n*mt,C+=n*wt,n=f[1],p+=n*l,b+=n*Q,S+=n*rt,j+=n*nt,R+=n*X,et+=n*L,N+=n*tt,Y+=n*dt,V+=n*at,z+=n*ct,W+=n*ut,q+=n*lt,$+=n*ht,H+=n*yt,C+=n*mt,K+=n*wt,n=f[2],b+=n*l,S+=n*Q,j+=n*rt,R+=n*nt,et+=n*X,N+=n*L,Y+=n*tt,V+=n*dt,z+=n*at,W+=n*ct,q+=n*ut,$+=n*lt,H+=n*ht,C+=n*yt,K+=n*mt,B+=n*wt,n=f[3],S+=n*l,j+=n*Q,R+=n*rt,et+=n*nt,N+=n*X,Y+=n*L,V+=n*tt,z+=n*dt,W+=n*at,q+=n*ct,$+=n*ut,H+=n*lt,C+=n*ht,K+=n*yt,B+=n*mt,F+=n*wt,n=f[4],j+=n*l,R+=n*Q,et+=n*rt,N+=n*nt,Y+=n*X,V+=n*L,z+=n*tt,W+=n*dt,q+=n*at,$+=n*ct,H+=n*ut,C+=n*lt,K+=n*ht,B+=n*yt,F+=n*mt,k+=n*wt,n=f[5],R+=n*l,et+=n*Q,N+=n*rt,Y+=n*nt,V+=n*X,z+=n*L,W+=n*tt,q+=n*dt,$+=n*at,H+=n*ct,C+=n*ut,K+=n*lt,B+=n*ht,F+=n*yt,k+=n*mt,U+=n*wt,n=f[6],et+=n*l,N+=n*Q,Y+=n*rt,V+=n*nt,z+=n*X,W+=n*L,q+=n*tt,$+=n*dt,H+=n*at,C+=n*ct,K+=n*ut,B+=n*lt,F+=n*ht,k+=n*yt,U+=n*mt,x+=n*wt,n=f[7],N+=n*l,Y+=n*Q,V+=n*rt,z+=n*nt,W+=n*X,q+=n*L,$+=n*tt,H+=n*dt,C+=n*at,K+=n*ct,B+=n*ut,F+=n*lt,k+=n*ht,U+=n*yt,x+=n*mt,y+=n*wt,n=f[8],Y+=n*l,V+=n*Q,z+=n*rt,W+=n*nt,q+=n*X,$+=n*L,H+=n*tt,C+=n*dt,K+=n*at,B+=n*ct,F+=n*ut,k+=n*lt,U+=n*ht,x+=n*yt,y+=n*mt,E+=n*wt,n=f[9],V+=n*l,z+=n*Q,W+=n*rt,q+=n*nt,$+=n*X,H+=n*L,C+=n*tt,K+=n*dt,B+=n*at,F+=n*ct,k+=n*ut,U+=n*lt,x+=n*ht,y+=n*yt,E+=n*mt,_+=n*wt,n=f[10],z+=n*l,W+=n*Q,q+=n*rt,$+=n*nt,H+=n*X,C+=n*L,K+=n*tt,B+=n*dt,F+=n*at,k+=n*ct,U+=n*ut,x+=n*lt,y+=n*ht,E+=n*yt,_+=n*mt,v+=n*wt,n=f[11],W+=n*l,q+=n*Q,$+=n*rt,H+=n*nt,C+=n*X,K+=n*L,B+=n*tt,F+=n*dt,k+=n*at,U+=n*ct,x+=n*ut,y+=n*lt,E+=n*ht,_+=n*yt,v+=n*mt,T+=n*wt,n=f[12],q+=n*l,$+=n*Q,H+=n*rt,C+=n*nt,K+=n*X,B+=n*L,F+=n*tt,k+=n*dt,U+=n*at,x+=n*ct,y+=n*ut,E+=n*lt,_+=n*ht,v+=n*yt,T+=n*mt,M+=n*wt,n=f[13],$+=n*l,H+=n*Q,C+=n*rt,K+=n*nt,B+=n*X,F+=n*L,k+=n*tt,U+=n*dt,x+=n*at,y+=n*ct,E+=n*ut,_+=n*lt,v+=n*ht,T+=n*yt,M+=n*mt,G+=n*wt,n=f[14],H+=n*l,C+=n*Q,K+=n*rt,B+=n*nt,F+=n*X,k+=n*L,U+=n*tt,x+=n*dt,y+=n*at,E+=n*ct,_+=n*ut,v+=n*lt,T+=n*ht,M+=n*yt,G+=n*mt,I+=n*wt,n=f[15],C+=n*l,K+=n*Q,B+=n*rt,F+=n*nt,k+=n*X,U+=n*L,x+=n*tt,y+=n*dt,E+=n*at,_+=n*ct,v+=n*ut,T+=n*lt,M+=n*ht,G+=n*yt,I+=n*mt,J+=n*wt,h+=38*K,p+=38*B,b+=38*F,S+=38*k,j+=38*U,R+=38*x,et+=38*y,N+=38*E,Y+=38*_,V+=38*v,z+=38*T,W+=38*M,q+=38*G,$+=38*I,H+=38*J,c=1,n=h+c+65535,c=Math.floor(n/65536),h=n-c*65536,n=p+c+65535,c=Math.floor(n/65536),p=n-c*65536,n=b+c+65535,c=Math.floor(n/65536),b=n-c*65536,n=S+c+65535,c=Math.floor(n/65536),S=n-c*65536,n=j+c+65535,c=Math.floor(n/65536),j=n-c*65536,n=R+c+65535,c=Math.floor(n/65536),R=n-c*65536,n=et+c+65535,c=Math.floor(n/65536),et=n-c*65536,n=N+c+65535,c=Math.floor(n/65536),N=n-c*65536,n=Y+c+65535,c=Math.floor(n/65536),Y=n-c*65536,n=V+c+65535,c=Math.floor(n/65536),V=n-c*65536,n=z+c+65535,c=Math.floor(n/65536),z=n-c*65536,n=W+c+65535,c=Math.floor(n/65536),W=n-c*65536,n=q+c+65535,c=Math.floor(n/65536),q=n-c*65536,n=$+c+65535,c=Math.floor(n/65536),$=n-c*65536,n=H+c+65535,c=Math.floor(n/65536),H=n-c*65536,n=C+c+65535,c=Math.floor(n/65536),C=n-c*65536,h+=c-1+37*(c-1),c=1,n=h+c+65535,c=Math.floor(n/65536),h=n-c*65536,n=p+c+65535,c=Math.floor(n/65536),p=n-c*65536,n=b+c+65535,c=Math.floor(n/65536),b=n-c*65536,n=S+c+65535,c=Math.floor(n/65536),S=n-c*65536,n=j+c+65535,c=Math.floor(n/65536),j=n-c*65536,n=R+c+65535,c=Math.floor(n/65536),R=n-c*65536,n=et+c+65535,c=Math.floor(n/65536),et=n-c*65536,n=N+c+65535,c=Math.floor(n/65536),N=n-c*65536,n=Y+c+65535,c=Math.floor(n/65536),Y=n-c*65536,n=V+c+65535,c=Math.floor(n/65536),V=n-c*65536,n=z+c+65535,c=Math.floor(n/65536),z=n-c*65536,n=W+c+65535,c=Math.floor(n/65536),W=n-c*65536,n=q+c+65535,c=Math.floor(n/65536),q=n-c*65536,n=$+c+65535,c=Math.floor(n/65536),$=n-c*65536,n=H+c+65535,c=Math.floor(n/65536),H=n-c*65536,n=C+c+65535,c=Math.floor(n/65536),C=n-c*65536,h+=c-1+37*(c-1),o[0]=h,o[1]=p,o[2]=b,o[3]=S,o[4]=j,o[5]=R,o[6]=et,o[7]=N,o[8]=Y,o[9]=V,o[10]=z,o[11]=W,o[12]=q,o[13]=$,o[14]=H,o[15]=C}function Tt(o,f){D(o,f,f)}function gn(o,f){var s=t(),n;for(n=0;n<16;n++)s[n]=f[n];for(n=253;n>=0;n--)Tt(s,s),n!==2&&n!==4&&D(s,s,f);for(n=0;n<16;n++)o[n]=s[n]}function _n(o,f){var s=t(),n;for(n=0;n<16;n++)s[n]=f[n];for(n=250;n>=0;n--)Tt(s,s),n!==1&&D(s,s,f);for(n=0;n<16;n++)o[n]=s[n]}function Qe(o,f,s){var n=new Uint8Array(32),c=new Float64Array(80),h,p,b=t(),S=t(),j=t(),R=t(),et=t(),N=t();for(p=0;p<31;p++)n[p]=f[p];for(n[31]=f[31]&127|64,n[0]&=248,Ur(c,s),p=0;p<16;p++)S[p]=c[p],R[p]=b[p]=j[p]=0;for(b[0]=R[0]=1,p=254;p>=0;--p)h=n[p>>>3]>>>(p&7)&1,ee(b,S,h),ee(j,R,h),Nt(et,b,j),Pt(b,b,j),Nt(j,S,R),Pt(S,S,R),Tt(R,et),Tt(N,b),D(b,j,b),D(j,S,et),Nt(et,b,j),Pt(b,b,j),Tt(S,b),Pt(j,R,N),D(b,j,m),Nt(b,b,R),D(j,j,b),D(b,R,N),D(R,S,c),Tt(S,et),ee(b,S,h),ee(j,R,h);for(p=0;p<16;p++)c[p+16]=b[p],c[p+32]=j[p],c[p+48]=S[p],c[p+64]=R[p];var Y=c.subarray(32),V=c.subarray(16);return gn(Y,Y),D(V,V,Y),re(o,V),0}function De(o,f){return Qe(o,f,a)}function bn(o,f){return r(f,32),De(o,f)}function Le(o,f,s){var n=new Uint8Array(32);return Qe(n,s,f),Rt(o,i,n,Kt)}var vn=Be,no=Ne;function io(o,f,s,n,c,h){var p=new Uint8Array(32);return Le(p,c,h),vn(o,f,s,n,p)}function oo(o,f,s,n,c,h){var p=new Uint8Array(32);return Le(p,c,h),no(o,f,s,n,p)}var En=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function An(o,f,s,n){for(var c=new Int32Array(16),h=new Int32Array(16),p,b,S,j,R,et,N,Y,V,z,W,q,$,H,C,K,B,F,k,U,x,y,E,_,v,T,M=o[0],G=o[1],I=o[2],J=o[3],l=o[4],Q=o[5],rt=o[6],nt=o[7],X=f[0],L=f[1],tt=f[2],dt=f[3],at=f[4],ct=f[5],ut=f[6],lt=f[7],ht=0;n>=128;){for(k=0;k<16;k++)U=8*k+ht,c[k]=s[U+0]<<24|s[U+1]<<16|s[U+2]<<8|s[U+3],h[k]=s[U+4]<<24|s[U+5]<<16|s[U+6]<<8|s[U+7];for(k=0;k<80;k++)if(p=M,b=G,S=I,j=J,R=l,et=Q,N=rt,Y=nt,V=X,z=L,W=tt,q=dt,$=at,H=ct,C=ut,K=lt,x=nt,y=lt,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=(l>>>14|at<<32-14)^(l>>>18|at<<32-18)^(at>>>41-32|l<<32-(41-32)),y=(at>>>14|l<<32-14)^(at>>>18|l<<32-18)^(l>>>41-32|at<<32-(41-32)),E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,x=l&Q^~l&rt,y=at&ct^~at&ut,E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,x=En[k*2],y=En[k*2+1],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,x=c[k%16],y=h[k%16],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,B=v&65535|T<<16,F=E&65535|_<<16,x=B,y=F,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=(M>>>28|X<<32-28)^(X>>>34-32|M<<32-(34-32))^(X>>>39-32|M<<32-(39-32)),y=(X>>>28|M<<32-28)^(M>>>34-32|X<<32-(34-32))^(M>>>39-32|X<<32-(39-32)),E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,x=M&G^M&I^G&I,y=X&L^X&tt^L&tt,E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,Y=v&65535|T<<16,K=E&65535|_<<16,x=j,y=q,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=B,y=F,E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,j=v&65535|T<<16,q=E&65535|_<<16,G=p,I=b,J=S,l=j,Q=R,rt=et,nt=N,M=Y,L=V,tt=z,dt=W,at=q,ct=$,ut=H,lt=C,X=K,k%16===15)for(U=0;U<16;U++)x=c[U],y=h[U],E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=c[(U+9)%16],y=h[(U+9)%16],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,B=c[(U+1)%16],F=h[(U+1)%16],x=(B>>>1|F<<32-1)^(B>>>8|F<<32-8)^B>>>7,y=(F>>>1|B<<32-1)^(F>>>8|B<<32-8)^(F>>>7|B<<32-7),E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,B=c[(U+14)%16],F=h[(U+14)%16],x=(B>>>19|F<<32-19)^(F>>>61-32|B<<32-(61-32))^B>>>6,y=(F>>>19|B<<32-19)^(B>>>61-32|F<<32-(61-32))^(F>>>6|B<<32-6),E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,c[U]=v&65535|T<<16,h[U]=E&65535|_<<16;x=M,y=X,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[0],y=f[0],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[0]=M=v&65535|T<<16,f[0]=X=E&65535|_<<16,x=G,y=L,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[1],y=f[1],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[1]=G=v&65535|T<<16,f[1]=L=E&65535|_<<16,x=I,y=tt,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[2],y=f[2],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[2]=I=v&65535|T<<16,f[2]=tt=E&65535|_<<16,x=J,y=dt,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[3],y=f[3],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[3]=J=v&65535|T<<16,f[3]=dt=E&65535|_<<16,x=l,y=at,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[4],y=f[4],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[4]=l=v&65535|T<<16,f[4]=at=E&65535|_<<16,x=Q,y=ct,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[5],y=f[5],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[5]=Q=v&65535|T<<16,f[5]=ct=E&65535|_<<16,x=rt,y=ut,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[6],y=f[6],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[6]=rt=v&65535|T<<16,f[6]=ut=E&65535|_<<16,x=nt,y=lt,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[7],y=f[7],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[7]=nt=v&65535|T<<16,f[7]=lt=E&65535|_<<16,ht+=128,n-=128}return n}function ie(o,f,s){var n=new Int32Array(8),c=new Int32Array(8),h=new Uint8Array(256),p,b=s;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,c[0]=4089235720,c[1]=2227873595,c[2]=4271175723,c[3]=1595750129,c[4]=2917565137,c[5]=725511199,c[6]=4215389547,c[7]=327033209,An(n,c,f,s),s%=128,p=0;p<s;p++)h[p]=f[b-s+p];for(h[s]=128,s=256-128*(s<112?1:0),h[s-9]=0,it(h,s-8,b/536870912|0,b<<3),An(n,c,h,s),p=0;p<8;p++)it(o,8*p,n[p],c[p]);return 0}function tr(o,f){var s=t(),n=t(),c=t(),h=t(),p=t(),b=t(),S=t(),j=t(),R=t();Pt(s,o[1],o[0]),Pt(R,f[1],f[0]),D(s,s,R),Nt(n,o[0],o[1]),Nt(R,f[0],f[1]),D(n,n,R),D(c,o[3],f[3]),D(c,c,A),D(h,o[2],f[2]),Nt(h,h,h),Pt(p,n,s),Pt(b,h,c),Nt(S,h,c),Nt(j,n,s),D(o[0],p,b),D(o[1],j,S),D(o[2],S,b),D(o[3],p,j)}function Tn(o,f,s){var n;for(n=0;n<4;n++)ee(o[n],f[n],s)}function Rr(o,f){var s=t(),n=t(),c=t();gn(c,f[2]),D(s,f[0],c),D(n,f[1],c),re(o,n),o[31]^=wn(s)<<7}function Br(o,f,s){var n,c;for(Bt(o[0],u),Bt(o[1],d),Bt(o[2],d),Bt(o[3],u),c=255;c>=0;--c)n=s[c/8|0]>>(c&7)&1,Tn(o,f,n),tr(f,o),tr(o,o),Tn(o,f,n)}function er(o,f){var s=[t(),t(),t(),t()];Bt(s[0],P),Bt(s[1],O),Bt(s[2],d),D(s[3],P,O),Br(o,s,f)}function Nr(o,f,s){var n=new Uint8Array(64),c=[t(),t(),t(),t()],h;for(s||r(f,32),ie(n,f,32),n[0]&=248,n[31]&=127,n[31]|=64,er(c,n),Rr(o,c),h=0;h<32;h++)f[h+32]=o[h];return 0}var rr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Pr(o,f){var s,n,c,h;for(n=63;n>=32;--n){for(s=0,c=n-32,h=n-12;c<h;++c)f[c]+=s-16*f[n]*rr[c-(n-32)],s=Math.floor((f[c]+128)/256),f[c]-=s*256;f[c]+=s,f[n]=0}for(s=0,c=0;c<32;c++)f[c]+=s-(f[31]>>4)*rr[c],s=f[c]>>8,f[c]&=255;for(c=0;c<32;c++)f[c]-=s*rr[c];for(n=0;n<32;n++)f[n+1]+=f[n]>>8,o[n]=f[n]&255}function Cr(o){var f=new Float64Array(64),s;for(s=0;s<64;s++)f[s]=o[s];for(s=0;s<64;s++)o[s]=0;Pr(o,f)}function Sn(o,f,s,n){var c=new Uint8Array(64),h=new Uint8Array(64),p=new Uint8Array(64),b,S,j=new Float64Array(64),R=[t(),t(),t(),t()];ie(c,n,32),c[0]&=248,c[31]&=127,c[31]|=64;var et=s+64;for(b=0;b<s;b++)o[64+b]=f[b];for(b=0;b<32;b++)o[32+b]=c[32+b];for(ie(p,o.subarray(32),s+32),Cr(p),er(R,p),Rr(o,R),b=32;b<64;b++)o[b]=n[b];for(ie(h,o,s+64),Cr(h),b=0;b<64;b++)j[b]=0;for(b=0;b<32;b++)j[b]=p[b];for(b=0;b<32;b++)for(S=0;S<32;S++)j[b+S]+=h[b]*c[S];return Pr(o.subarray(32),j),et}function ao(o,f){var s=t(),n=t(),c=t(),h=t(),p=t(),b=t(),S=t();return Bt(o[2],d),Ur(o[1],f),Tt(c,o[1]),D(h,c,w),Pt(c,c,o[2]),Nt(h,o[2],h),Tt(p,h),Tt(b,p),D(S,b,p),D(s,S,c),D(s,s,h),_n(s,s),D(s,s,c),D(s,s,h),D(s,s,h),D(o[0],s,h),Tt(n,o[0]),D(n,n,h),Ze(n,c)&&D(o[0],o[0],Z),Tt(n,o[0]),D(n,n,h),Ze(n,c)?-1:(wn(o[0])===f[31]>>7&&Pt(o[0],u,o[0]),D(o[3],o[0],o[1]),0)}function Fr(o,f,s,n){var c,h=new Uint8Array(32),p=new Uint8Array(64),b=[t(),t(),t(),t()],S=[t(),t(),t(),t()];if(s<64||ao(S,n))return-1;for(c=0;c<s;c++)o[c]=f[c];for(c=0;c<32;c++)o[c+32]=n[c];if(ie(p,o,s),Cr(p),Br(b,S,p),er(S,f.subarray(32)),tr(b,S),Rr(h,b),s-=64,At(f,0,h,0)){for(c=0;c<s;c++)o[c]=0;return-1}for(c=0;c<s;c++)o[c]=f[c+64];return s}var kr=32,nr=24,Ce=32,ye=16,Fe=32,ir=32,ke=32,je=32,jr=32,On=nr,so=Ce,fo=ye,zt=64,oe=32,me=64,Kr=32,Mr=64;e.lowlevel={crypto_core_hsalsa20:Rt,crypto_stream_xor:Ue,crypto_stream:Xe,crypto_stream_salsa20_xor:Je,crypto_stream_salsa20:Ie,crypto_onetimeauth:Re,crypto_onetimeauth_verify:ne,crypto_verify_16:ft,crypto_verify_32:At,crypto_secretbox:Be,crypto_secretbox_open:Ne,crypto_scalarmult:Qe,crypto_scalarmult_base:De,crypto_box_beforenm:Le,crypto_box_afternm:vn,crypto_box:io,crypto_box_open:oo,crypto_box_keypair:bn,crypto_hash:ie,crypto_sign:Sn,crypto_sign_keypair:Nr,crypto_sign_open:Fr,crypto_secretbox_KEYBYTES:kr,crypto_secretbox_NONCEBYTES:nr,crypto_secretbox_ZEROBYTES:Ce,crypto_secretbox_BOXZEROBYTES:ye,crypto_scalarmult_BYTES:Fe,crypto_scalarmult_SCALARBYTES:ir,crypto_box_PUBLICKEYBYTES:ke,crypto_box_SECRETKEYBYTES:je,crypto_box_BEFORENMBYTES:jr,crypto_box_NONCEBYTES:On,crypto_box_ZEROBYTES:so,crypto_box_BOXZEROBYTES:fo,crypto_sign_BYTES:zt,crypto_sign_PUBLICKEYBYTES:oe,crypto_sign_SECRETKEYBYTES:me,crypto_sign_SEEDBYTES:Kr,crypto_hash_BYTES:Mr,gf:t,D:w,L:rr,pack25519:re,unpack25519:Ur,M:D,A:Nt,S:Tt,Z:Pt,pow2523:_n,add:tr,set25519:Bt,modL:Pr,scalarmult:Br,scalarbase:er};function Un(o,f){if(o.length!==kr)throw new Error("bad key size");if(f.length!==nr)throw new Error("bad nonce size")}function co(o,f){if(o.length!==ke)throw new Error("bad public key size");if(f.length!==je)throw new Error("bad secret key size")}function vt(){for(var o=0;o<arguments.length;o++)if(!(arguments[o]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Rn(o){for(var f=0;f<o.length;f++)o[f]=0}e.randomBytes=function(o){var f=new Uint8Array(o);return r(f,o),f},e.secretbox=function(o,f,s){vt(o,f,s),Un(s,f);for(var n=new Uint8Array(Ce+o.length),c=new Uint8Array(n.length),h=0;h<o.length;h++)n[h+Ce]=o[h];return Be(c,n,n.length,f,s),c.subarray(ye)},e.secretbox.open=function(o,f,s){vt(o,f,s),Un(s,f);for(var n=new Uint8Array(ye+o.length),c=new Uint8Array(n.length),h=0;h<o.length;h++)n[h+ye]=o[h];return n.length<32||Ne(c,n,n.length,f,s)!==0?null:c.subarray(Ce)},e.secretbox.keyLength=kr,e.secretbox.nonceLength=nr,e.secretbox.overheadLength=ye,e.scalarMult=function(o,f){if(vt(o,f),o.length!==ir)throw new Error("bad n size");if(f.length!==Fe)throw new Error("bad p size");var s=new Uint8Array(Fe);return Qe(s,o,f),s},e.scalarMult.base=function(o){if(vt(o),o.length!==ir)throw new Error("bad n size");var f=new Uint8Array(Fe);return De(f,o),f},e.scalarMult.scalarLength=ir,e.scalarMult.groupElementLength=Fe,e.box=function(o,f,s,n){var c=e.box.before(s,n);return e.secretbox(o,f,c)},e.box.before=function(o,f){vt(o,f),co(o,f);var s=new Uint8Array(jr);return Le(s,o,f),s},e.box.after=e.secretbox,e.box.open=function(o,f,s,n){var c=e.box.before(s,n);return e.secretbox.open(o,f,c)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var o=new Uint8Array(ke),f=new Uint8Array(je);return bn(o,f),{publicKey:o,secretKey:f}},e.box.keyPair.fromSecretKey=function(o){if(vt(o),o.length!==je)throw new Error("bad secret key size");var f=new Uint8Array(ke);return De(f,o),{publicKey:f,secretKey:new Uint8Array(o)}},e.box.publicKeyLength=ke,e.box.secretKeyLength=je,e.box.sharedKeyLength=jr,e.box.nonceLength=On,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(o,f){if(vt(o,f),f.length!==me)throw new Error("bad secret key size");var s=new Uint8Array(zt+o.length);return Sn(s,o,o.length,f),s},e.sign.open=function(o,f){if(vt(o,f),f.length!==oe)throw new Error("bad public key size");var s=new Uint8Array(o.length),n=Fr(s,o,o.length,f);if(n<0)return null;for(var c=new Uint8Array(n),h=0;h<c.length;h++)c[h]=s[h];return c},e.sign.detached=function(o,f){for(var s=e.sign(o,f),n=new Uint8Array(zt),c=0;c<n.length;c++)n[c]=s[c];return n},e.sign.detached.verify=function(o,f,s){if(vt(o,f,s),f.length!==zt)throw new Error("bad signature size");if(s.length!==oe)throw new Error("bad public key size");var n=new Uint8Array(zt+o.length),c=new Uint8Array(zt+o.length),h;for(h=0;h<zt;h++)n[h]=f[h];for(h=0;h<o.length;h++)n[h+zt]=o[h];return Fr(c,n,n.length,s)>=0},e.sign.keyPair=function(){var o=new Uint8Array(oe),f=new Uint8Array(me);return Nr(o,f),{publicKey:o,secretKey:f}},e.sign.keyPair.fromSecretKey=function(o){if(vt(o),o.length!==me)throw new Error("bad secret key size");for(var f=new Uint8Array(oe),s=0;s<f.length;s++)f[s]=o[32+s];return{publicKey:f,secretKey:new Uint8Array(o)}},e.sign.keyPair.fromSeed=function(o){if(vt(o),o.length!==Kr)throw new Error("bad seed size");for(var f=new Uint8Array(oe),s=new Uint8Array(me),n=0;n<32;n++)s[n]=o[n];return Nr(f,s,!0),{publicKey:f,secretKey:s}},e.sign.publicKeyLength=oe,e.sign.secretKeyLength=me,e.sign.seedLength=Kr,e.sign.signatureLength=zt,e.hash=function(o){vt(o);var f=new Uint8Array(Mr);return ie(f,o,o.length),f},e.hash.hashLength=Mr,e.verify=function(o,f){return vt(o,f),o.length===0||f.length===0||o.length!==f.length?!1:st(o,0,f,0,o.length)===0},e.setPRNG=function(o){r=o},function(){var o=typeof self<"u"?self.crypto||self.msCrypto:null;if(o&&o.getRandomValues){var f=65536;e.setPRNG(function(s,n){var c,h=new Uint8Array(n);for(c=0;c<n;c+=f)o.getRandomValues(h.subarray(c,c+Math.min(n-c,f)));for(c=0;c<n;c++)s[c]=h[c];Rn(h)})}else typeof Bn<"u"&&(o=bi(),o&&o.randomBytes&&e.setPRNG(function(s,n){var c,h=o.randomBytes(n);for(c=0;c<n;c++)s[c]=h[c];Rn(h)}))}()})(typeof _r<"u"&&_r.exports?_r.exports:self.nacl=self.nacl||{})});var ge=class{callbacks=[];populate(t){this.callbacks.forEach(({callback:r})=>r(t))}subscribe(t){let r=Symbol();return this.callbacks.push({id:r,callback:t}),()=>this.callbacks=this.callbacks.filter(({id:i})=>i!==r)}};var _e=class extends ge{authUser=null;constructor(){super()}static getInstance(){return _e.instance||(_e.instance=new _e),_e.instance}set(t){this.authUser=t,this.populate(t)}get(){return this.authUser}subscribe(t){let r=super.subscribe(t);return t(this.authUser),r}reset(){this.authUser=null,this.populate(this.authUser)}},Mt=_e;ar(Mt,"instance");var Kn=({message:e,detail:t})=>{let r=new CustomEvent(e,{detail:t,bubbles:!0});document.dispatchEvent(r)};var gt=e=>e==null;var Mn=BigInt(144e11),Yn={width:576,height:576},Vn={width:505,height:705},qn="internetcomputer.org";var be=class extends ge{env;constructor(){super()}static getInstance(){return be.instance||(be.instance=new be),be.instance}set(t){this.env=t,this.populate(t)}get(){return this.env}localIdentity(){return this.get()?.localIdentityCanisterId!==void 0}subscribe(t){let r=super.subscribe(t);return t(this.env),r}},_t=be;ar(_t,"instance");var cr=()=>typeof window<"u",Yr=()=>{let e=_t.getInstance().get()?.satelliteId??"unknown";return _t.getInstance().localIdentity()?`http://${e}.localhost:8000`:`https://${e}.icp0.io`};var Vr=({width:e,height:t})=>{if(!cr()||gt(window)||gt(window.top))return;let{top:{innerWidth:r,innerHeight:i}}=window,a=i/2+screenY-t/2,u=r/2+screenX-e/2;return`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=${e}, height=${t}, top=${a}, left=${u}`};var ur=class{#t;constructor({domain:t}){this.#t=t}get id(){return"internet_identity"}signInOptions({windowed:t}){let r=_t.getInstance().localIdentity()?`http://${_t.getInstance().get()?.localIdentityCanisterId}.localhost:8000`:`https://identity.${this.#t??qn}`;return{...t!==!1&&{windowOpenerFeatures:Vr(Yn)},identityProvider:r}}},Hn=class{#t;#e;constructor({appName:t,logoUrl:r}){this.#t=t,this.#e=r}get id(){return"nfid"}signInOptions({windowed:t}){return{...t!==!1&&{windowOpenerFeatures:Vr(Vn)},identityProvider:`https://nfid.one/authenticate/?applicationName=${encodeURI(this.#t)}&applicationLogo=${encodeURI(this.#e)}`}}};var mi=we(ii());var pr;(function(e){e[e.SysFatal=1]="SysFatal",e[e.SysTransient=2]="SysTransient",e[e.DestinationInvalid=3]="DestinationInvalid",e[e.CanisterReject=4]="CanisterReject",e[e.CanisterError=5]="CanisterError"})(pr||(pr={}));var zo=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(r[i[a]]=e[i[a]]);return r},Go=new TextEncoder().encode(`
|
|
1
|
+
import{a as Bn,b as uo,c as or,d as Nn,e as we,f as lo,g as ar,h as ho,i as ot,j as Ke,k as Pn,l as Me,m as po,n as Cn,o as Gt,p as Fn,q as ae,r as kn,s as sr,t as fr,u as jn}from"./chunk-U4E5MZWA.js";var zn=or(lr=>{"use strict";lr.byteLength=yo;lr.toByteArray=wo;lr.fromByteArray=bo;var Yt=[],St=[],xo=typeof Uint8Array<"u"?Uint8Array:Array,qr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(se=0,$n=qr.length;se<$n;++se)Yt[se]=qr[se],St[qr.charCodeAt(se)]=se;var se,$n;St["-".charCodeAt(0)]=62;St["_".charCodeAt(0)]=63;function Wn(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var i=r===t?0:4-r%4;return[r,i]}function yo(e){var t=Wn(e),r=t[0],i=t[1];return(r+i)*3/4-i}function mo(e,t,r){return(t+r)*3/4-r}function wo(e){var t,r=Wn(e),i=r[0],a=r[1],u=new xo(mo(e,i,a)),d=0,m=a>0?i-4:i,w;for(w=0;w<m;w+=4)t=St[e.charCodeAt(w)]<<18|St[e.charCodeAt(w+1)]<<12|St[e.charCodeAt(w+2)]<<6|St[e.charCodeAt(w+3)],u[d++]=t>>16&255,u[d++]=t>>8&255,u[d++]=t&255;return a===2&&(t=St[e.charCodeAt(w)]<<2|St[e.charCodeAt(w+1)]>>4,u[d++]=t&255),a===1&&(t=St[e.charCodeAt(w)]<<10|St[e.charCodeAt(w+1)]<<4|St[e.charCodeAt(w+2)]>>2,u[d++]=t>>8&255,u[d++]=t&255),u}function go(e){return Yt[e>>18&63]+Yt[e>>12&63]+Yt[e>>6&63]+Yt[e&63]}function _o(e,t,r){for(var i,a=[],u=t;u<r;u+=3)i=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(e[u+2]&255),a.push(go(i));return a.join("")}function bo(e){for(var t,r=e.length,i=r%3,a=[],u=16383,d=0,m=r-i;d<m;d+=u)a.push(_o(e,d,d+u>m?m:d+u));return i===1?(t=e[r-1],a.push(Yt[t>>2]+Yt[t<<4&63]+"==")):i===2&&(t=(e[r-2]<<8)+e[r-1],a.push(Yt[t>>10]+Yt[t>>4&63]+Yt[t<<2&63]+"=")),a.join("")}});var ii=or(Ee=>{"use strict";var Hr=zn(),ve=ho(),Gn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ee.Buffer=g;Ee.SlowBuffer=Oo;Ee.INSPECT_MAX_BYTES=50;var dr=2147483647;Ee.kMaxLength=dr;g.TYPED_ARRAY_SUPPORT=vo();!g.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 vo(){try{var 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(g.prototype,"parent",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.buffer}});Object.defineProperty(g.prototype,"offset",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.byteOffset}});function Jt(e){if(e>dr)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,g.prototype),t}function g(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Gr(e)}return Xn(e,t,r)}g.poolSize=8192;function Xn(e,t,r){if(typeof e=="string")return Ao(e,t);if(ArrayBuffer.isView(e))return To(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(Vt(e,ArrayBuffer)||e&&Vt(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Vt(e,SharedArrayBuffer)||e&&Vt(e.buffer,SharedArrayBuffer)))return Wr(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return g.from(i,t,r);var a=So(e);if(a)return a;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return g.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}g.from=function(e,t,r){return Xn(e,t,r)};Object.setPrototypeOf(g.prototype,Uint8Array.prototype);Object.setPrototypeOf(g,Uint8Array);function Zn(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 Eo(e,t,r){return Zn(e),e<=0?Jt(e):t!==void 0?typeof r=="string"?Jt(e).fill(t,r):Jt(e).fill(t):Jt(e)}g.alloc=function(e,t,r){return Eo(e,t,r)};function Gr(e){return Zn(e),Jt(e<0?0:Jr(e)|0)}g.allocUnsafe=function(e){return Gr(e)};g.allocUnsafeSlow=function(e){return Gr(e)};function Ao(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!g.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=Qn(e,t)|0,i=Jt(r),a=i.write(e,t);return a!==r&&(i=i.slice(0,a)),i}function $r(e){for(var t=e.length<0?0:Jr(e.length)|0,r=Jt(t),i=0;i<t;i+=1)r[i]=e[i]&255;return r}function To(e){if(Vt(e,Uint8Array)){var t=new Uint8Array(e);return Wr(t.buffer,t.byteOffset,t.byteLength)}return $r(e)}function Wr(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var i;return t===void 0&&r===void 0?i=new Uint8Array(e):r===void 0?i=new Uint8Array(e,t):i=new Uint8Array(e,t,r),Object.setPrototypeOf(i,g.prototype),i}function So(e){if(g.isBuffer(e)){var t=Jr(e.length)|0,r=Jt(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||Ir(e.length)?Jt(0):$r(e);if(e.type==="Buffer"&&Array.isArray(e.data))return $r(e.data)}function Jr(e){if(e>=dr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+dr.toString(16)+" bytes");return e|0}function Oo(e){return+e!=e&&(e=0),g.alloc(+e)}g.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==g.prototype};g.compare=function(t,r){if(Vt(t,Uint8Array)&&(t=g.from(t,t.offset,t.byteLength)),Vt(r,Uint8Array)&&(r=g.from(r,r.offset,r.byteLength)),!g.isBuffer(t)||!g.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var i=t.length,a=r.length,u=0,d=Math.min(i,a);u<d;++u)if(t[u]!==r[u]){i=t[u],a=r[u];break}return i<a?-1:a<i?1:0};g.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}};g.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return g.alloc(0);var i;if(r===void 0)for(r=0,i=0;i<t.length;++i)r+=t[i].length;var a=g.allocUnsafe(r),u=0;for(i=0;i<t.length;++i){var d=t[i];if(Vt(d,Uint8Array))u+d.length>a.length?g.from(d).copy(a,u):Uint8Array.prototype.set.call(a,d,u);else if(g.isBuffer(d))d.copy(a,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=d.length}return a};function Qn(e,t){if(g.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Vt(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);var r=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return zr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ni(e).length;default:if(a)return i?-1:zr(e).length;t=(""+t).toLowerCase(),a=!0}}g.byteLength=Qn;function Uo(e,t,r){var i=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Mo(this,t,r);case"utf8":case"utf-8":return Ln(this,t,r);case"ascii":return jo(this,t,r);case"latin1":case"binary":return Ko(this,t,r);case"base64":return Fo(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yo(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}g.prototype._isBuffer=!0;function fe(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}g.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)fe(this,r,r+1);return this};g.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)fe(this,r,r+3),fe(this,r+1,r+2);return this};g.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)fe(this,r,r+7),fe(this,r+1,r+6),fe(this,r+2,r+5),fe(this,r+3,r+4);return this};g.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Ln(this,0,t):Uo.apply(this,arguments)};g.prototype.toLocaleString=g.prototype.toString;g.prototype.equals=function(t){if(!g.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:g.compare(this,t)===0};g.prototype.inspect=function(){var t="",r=Ee.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Gn&&(g.prototype[Gn]=g.prototype.inspect);g.prototype.compare=function(t,r,i,a,u){if(Vt(t,Uint8Array)&&(t=g.from(t,t.offset,t.byteLength)),!g.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),i===void 0&&(i=t?t.length:0),a===void 0&&(a=0),u===void 0&&(u=this.length),r<0||i>t.length||a<0||u>this.length)throw new RangeError("out of range index");if(a>=u&&r>=i)return 0;if(a>=u)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,a>>>=0,u>>>=0,this===t)return 0;for(var d=u-a,m=i-r,w=Math.min(d,m),A=this.slice(a,u),P=t.slice(r,i),O=0;O<w;++O)if(A[O]!==P[O]){d=A[O],m=P[O];break}return d<m?-1:m<d?1:0};function Dn(e,t,r,i,a){if(e.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Ir(r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0)if(a)r=0;else return-1;if(typeof t=="string"&&(t=g.from(t,i)),g.isBuffer(t))return t.length===0?-1:Jn(e,t,r,i,a);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Jn(e,[t],r,i,a);throw new TypeError("val must be string, number or Buffer")}function Jn(e,t,r,i,a){var u=1,d=e.length,m=t.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||t.length<2)return-1;u=2,d/=2,m/=2,r/=2}function w(it,st){return u===1?it[st]:it.readUInt16BE(st*u)}var A;if(a){var P=-1;for(A=r;A<d;A++)if(w(e,A)===w(t,P===-1?0:A-P)){if(P===-1&&(P=A),A-P+1===m)return P*u}else P!==-1&&(A-=A-P),P=-1}else for(r+m>d&&(r=d-m),A=r;A>=0;A--){for(var O=!0,Z=0;Z<m;Z++)if(w(e,A+Z)!==w(t,Z)){O=!1;break}if(O)return A}return-1}g.prototype.includes=function(t,r,i){return this.indexOf(t,r,i)!==-1};g.prototype.indexOf=function(t,r,i){return Dn(this,t,r,i,!0)};g.prototype.lastIndexOf=function(t,r,i){return Dn(this,t,r,i,!1)};function Ro(e,t,r,i){r=Number(r)||0;var a=e.length-r;i?(i=Number(i),i>a&&(i=a)):i=a;var u=t.length;i>u/2&&(i=u/2);for(var d=0;d<i;++d){var m=parseInt(t.substr(d*2,2),16);if(Ir(m))return d;e[r+d]=m}return d}function Bo(e,t,r,i){return hr(zr(t,e.length-r),e,r,i)}function No(e,t,r,i){return hr(Ho(t),e,r,i)}function Po(e,t,r,i){return hr(ni(t),e,r,i)}function Co(e,t,r,i){return hr($o(t,e.length-r),e,r,i)}g.prototype.write=function(t,r,i,a){if(r===void 0)a="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")a=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,a===void 0&&(a="utf8")):(a=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var u=this.length-r;if((i===void 0||i>u)&&(i=u),t.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var d=!1;;)switch(a){case"hex":return Ro(this,t,r,i);case"utf8":case"utf-8":return Bo(this,t,r,i);case"ascii":case"latin1":case"binary":return No(this,t,r,i);case"base64":return Po(this,t,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Co(this,t,r,i);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),d=!0}};g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Fo(e,t,r){return t===0&&r===e.length?Hr.fromByteArray(e):Hr.fromByteArray(e.slice(t,r))}function Ln(e,t,r){r=Math.min(e.length,r);for(var i=[],a=t;a<r;){var u=e[a],d=null,m=u>239?4:u>223?3:u>191?2:1;if(a+m<=r){var w,A,P,O;switch(m){case 1:u<128&&(d=u);break;case 2:w=e[a+1],(w&192)===128&&(O=(u&31)<<6|w&63,O>127&&(d=O));break;case 3:w=e[a+1],A=e[a+2],(w&192)===128&&(A&192)===128&&(O=(u&15)<<12|(w&63)<<6|A&63,O>2047&&(O<55296||O>57343)&&(d=O));break;case 4:w=e[a+1],A=e[a+2],P=e[a+3],(w&192)===128&&(A&192)===128&&(P&192)===128&&(O=(u&15)<<18|(w&63)<<12|(A&63)<<6|P&63,O>65535&&O<1114112&&(d=O))}}d===null?(d=65533,m=1):d>65535&&(d-=65536,i.push(d>>>10&1023|55296),d=56320|d&1023),i.push(d),a+=m}return ko(i)}var In=4096;function ko(e){var t=e.length;if(t<=In)return String.fromCharCode.apply(String,e);for(var r="",i=0;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=In));return r}function jo(e,t,r){var i="";r=Math.min(e.length,r);for(var a=t;a<r;++a)i+=String.fromCharCode(e[a]&127);return i}function Ko(e,t,r){var i="";r=Math.min(e.length,r);for(var a=t;a<r;++a)i+=String.fromCharCode(e[a]);return i}function Mo(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var a="",u=t;u<r;++u)a+=Wo[e[u]];return a}function Yo(e,t,r){for(var i=e.slice(t,r),a="",u=0;u<i.length-1;u+=2)a+=String.fromCharCode(i[u]+i[u+1]*256);return a}g.prototype.slice=function(t,r){var i=this.length;t=~~t,r=r===void 0?i:~~r,t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<t&&(r=t);var a=this.subarray(t,r);return Object.setPrototypeOf(a,g.prototype),a};function pt(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUintLE=g.prototype.readUIntLE=function(t,r,i){t=t>>>0,r=r>>>0,i||pt(t,r,this.length);for(var a=this[t],u=1,d=0;++d<r&&(u*=256);)a+=this[t+d]*u;return a};g.prototype.readUintBE=g.prototype.readUIntBE=function(t,r,i){t=t>>>0,r=r>>>0,i||pt(t,r,this.length);for(var a=this[t+--r],u=1;r>0&&(u*=256);)a+=this[t+--r]*u;return a};g.prototype.readUint8=g.prototype.readUInt8=function(t,r){return t=t>>>0,r||pt(t,1,this.length),this[t]};g.prototype.readUint16LE=g.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||pt(t,2,this.length),this[t]|this[t+1]<<8};g.prototype.readUint16BE=g.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||pt(t,2,this.length),this[t]<<8|this[t+1]};g.prototype.readUint32LE=g.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||pt(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};g.prototype.readUint32BE=g.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||pt(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};g.prototype.readIntLE=function(t,r,i){t=t>>>0,r=r>>>0,i||pt(t,r,this.length);for(var a=this[t],u=1,d=0;++d<r&&(u*=256);)a+=this[t+d]*u;return u*=128,a>=u&&(a-=Math.pow(2,8*r)),a};g.prototype.readIntBE=function(t,r,i){t=t>>>0,r=r>>>0,i||pt(t,r,this.length);for(var a=r,u=1,d=this[t+--a];a>0&&(u*=256);)d+=this[t+--a]*u;return u*=128,d>=u&&(d-=Math.pow(2,8*r)),d};g.prototype.readInt8=function(t,r){return t=t>>>0,r||pt(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};g.prototype.readInt16LE=function(t,r){t=t>>>0,r||pt(t,2,this.length);var i=this[t]|this[t+1]<<8;return i&32768?i|4294901760:i};g.prototype.readInt16BE=function(t,r){t=t>>>0,r||pt(t,2,this.length);var i=this[t+1]|this[t]<<8;return i&32768?i|4294901760:i};g.prototype.readInt32LE=function(t,r){return t=t>>>0,r||pt(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};g.prototype.readInt32BE=function(t,r){return t=t>>>0,r||pt(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};g.prototype.readFloatLE=function(t,r){return t=t>>>0,r||pt(t,4,this.length),ve.read(this,t,!0,23,4)};g.prototype.readFloatBE=function(t,r){return t=t>>>0,r||pt(t,4,this.length),ve.read(this,t,!1,23,4)};g.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||pt(t,8,this.length),ve.read(this,t,!0,52,8)};g.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||pt(t,8,this.length),ve.read(this,t,!1,52,8)};function bt(e,t,r,i,a,u){if(!g.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<u)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}g.prototype.writeUintLE=g.prototype.writeUIntLE=function(t,r,i,a){if(t=+t,r=r>>>0,i=i>>>0,!a){var u=Math.pow(2,8*i)-1;bt(this,t,r,i,u,0)}var d=1,m=0;for(this[r]=t&255;++m<i&&(d*=256);)this[r+m]=t/d&255;return r+i};g.prototype.writeUintBE=g.prototype.writeUIntBE=function(t,r,i,a){if(t=+t,r=r>>>0,i=i>>>0,!a){var u=Math.pow(2,8*i)-1;bt(this,t,r,i,u,0)}var d=i-1,m=1;for(this[r+d]=t&255;--d>=0&&(m*=256);)this[r+d]=t/m&255;return r+i};g.prototype.writeUint8=g.prototype.writeUInt8=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,1,255,0),this[r]=t&255,r+1};g.prototype.writeUint16LE=g.prototype.writeUInt16LE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};g.prototype.writeUint16BE=g.prototype.writeUInt16BE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};g.prototype.writeUint32LE=g.prototype.writeUInt32LE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};g.prototype.writeUint32BE=g.prototype.writeUInt32BE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};g.prototype.writeIntLE=function(t,r,i,a){if(t=+t,r=r>>>0,!a){var u=Math.pow(2,8*i-1);bt(this,t,r,i,u-1,-u)}var d=0,m=1,w=0;for(this[r]=t&255;++d<i&&(m*=256);)t<0&&w===0&&this[r+d-1]!==0&&(w=1),this[r+d]=(t/m>>0)-w&255;return r+i};g.prototype.writeIntBE=function(t,r,i,a){if(t=+t,r=r>>>0,!a){var u=Math.pow(2,8*i-1);bt(this,t,r,i,u-1,-u)}var d=i-1,m=1,w=0;for(this[r+d]=t&255;--d>=0&&(m*=256);)t<0&&w===0&&this[r+d+1]!==0&&(w=1),this[r+d]=(t/m>>0)-w&255;return r+i};g.prototype.writeInt8=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};g.prototype.writeInt16LE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};g.prototype.writeInt16BE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};g.prototype.writeInt32LE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};g.prototype.writeInt32BE=function(t,r,i){return t=+t,r=r>>>0,i||bt(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function ti(e,t,r,i,a,u){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ei(e,t,r,i,a){return t=+t,r=r>>>0,a||ti(e,t,r,4,34028234663852886e22,-34028234663852886e22),ve.write(e,t,r,i,23,4),r+4}g.prototype.writeFloatLE=function(t,r,i){return ei(this,t,r,!0,i)};g.prototype.writeFloatBE=function(t,r,i){return ei(this,t,r,!1,i)};function ri(e,t,r,i,a){return t=+t,r=r>>>0,a||ti(e,t,r,8,17976931348623157e292,-17976931348623157e292),ve.write(e,t,r,i,52,8),r+8}g.prototype.writeDoubleLE=function(t,r,i){return ri(this,t,r,!0,i)};g.prototype.writeDoubleBE=function(t,r,i){return ri(this,t,r,!1,i)};g.prototype.copy=function(t,r,i,a){if(!g.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i||(i=0),!a&&a!==0&&(a=this.length),r>=t.length&&(r=t.length),r||(r=0),a>0&&a<i&&(a=i),a===i||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),t.length-r<a-i&&(a=t.length-r+i);var u=a-i;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,a):Uint8Array.prototype.set.call(t,this.subarray(i,a),r),u};g.prototype.fill=function(t,r,i,a){if(typeof t=="string"){if(typeof r=="string"?(a=r,r=0,i=this.length):typeof i=="string"&&(a=i,i=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!g.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(t.length===1){var u=t.charCodeAt(0);(a==="utf8"&&u<128||a==="latin1")&&(t=u)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,t||(t=0);var d;if(typeof t=="number")for(d=r;d<i;++d)this[d]=t;else{var m=g.isBuffer(t)?t:g.from(t,a),w=m.length;if(w===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(d=0;d<i-r;++d)this[d+r]=m[d%w]}return this};var Vo=/[^+/0-9A-Za-z-_]/g;function qo(e){if(e=e.split("=")[0],e=e.trim().replace(Vo,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function zr(e,t){t=t||1/0;for(var r,i=e.length,a=null,u=[],d=0;d<i;++d){if(r=e.charCodeAt(d),r>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&u.push(239,191,189);continue}else if(d+1===i){(t-=3)>-1&&u.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&u.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&u.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;u.push(r)}else if(r<2048){if((t-=2)<0)break;u.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;u.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;u.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return u}function Ho(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function $o(e,t){for(var r,i,a,u=[],d=0;d<e.length&&!((t-=2)<0);++d)r=e.charCodeAt(d),i=r>>8,a=r%256,u.push(a),u.push(i);return u}function ni(e){return Hr.toByteArray(qo(e))}function hr(e,t,r,i){for(var a=0;a<i&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function Vt(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Ir(e){return e!==e}var Wo=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=r*16,a=0;a<16;++a)t[i+a]=e[r]+e[a];return t}()});var gi={};Nn(gi,{default:()=>ua});var ua,_i=uo(()=>{ua={}});var bi=or((xf,gr)=>{var le=(_i(),lo(gi));if(le&&le.default){gr.exports=le.default;for(let e in le)gr.exports[e]=le[e]}else le&&(gr.exports=le)});var tn=or((yf,_r)=>{(function(e){"use strict";var t=function(o){var f,s=new Float64Array(16);if(o)for(f=0;f<o.length;f++)s[f]=o[f];return s},r=function(){throw new Error("no PRNG")},i=new Uint8Array(16),a=new Uint8Array(32);a[0]=9;var u=t(),d=t([1]),m=t([56129,1]),w=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),A=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),P=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),O=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Z=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function it(o,f,s,n){o[f]=s>>24&255,o[f+1]=s>>16&255,o[f+2]=s>>8&255,o[f+3]=s&255,o[f+4]=n>>24&255,o[f+5]=n>>16&255,o[f+6]=n>>8&255,o[f+7]=n&255}function st(o,f,s,n,c){var h,p=0;for(h=0;h<c;h++)p|=o[f+h]^s[n+h];return(1&p-1>>>8)-1}function ft(o,f,s,n){return st(o,f,s,n,16)}function At(o,f,s,n){return st(o,f,s,n,32)}function Lt(o,f,s,n){for(var c=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,h=s[0]&255|(s[1]&255)<<8|(s[2]&255)<<16|(s[3]&255)<<24,p=s[4]&255|(s[5]&255)<<8|(s[6]&255)<<16|(s[7]&255)<<24,b=s[8]&255|(s[9]&255)<<8|(s[10]&255)<<16|(s[11]&255)<<24,S=s[12]&255|(s[13]&255)<<8|(s[14]&255)<<16|(s[15]&255)<<24,j=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,R=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,et=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,N=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,Y=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,V=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,z=s[16]&255|(s[17]&255)<<8|(s[18]&255)<<16|(s[19]&255)<<24,W=s[20]&255|(s[21]&255)<<8|(s[22]&255)<<16|(s[23]&255)<<24,q=s[24]&255|(s[25]&255)<<8|(s[26]&255)<<16|(s[27]&255)<<24,$=s[28]&255|(s[29]&255)<<8|(s[30]&255)<<16|(s[31]&255)<<24,H=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,C=c,K=h,B=p,F=b,k=S,U=j,x=R,y=et,E=N,_=Y,v=V,T=z,M=W,G=q,I=$,J=H,l,Q=0;Q<20;Q+=2)l=C+M|0,k^=l<<7|l>>>32-7,l=k+C|0,E^=l<<9|l>>>32-9,l=E+k|0,M^=l<<13|l>>>32-13,l=M+E|0,C^=l<<18|l>>>32-18,l=U+K|0,_^=l<<7|l>>>32-7,l=_+U|0,G^=l<<9|l>>>32-9,l=G+_|0,K^=l<<13|l>>>32-13,l=K+G|0,U^=l<<18|l>>>32-18,l=v+x|0,I^=l<<7|l>>>32-7,l=I+v|0,B^=l<<9|l>>>32-9,l=B+I|0,x^=l<<13|l>>>32-13,l=x+B|0,v^=l<<18|l>>>32-18,l=J+T|0,F^=l<<7|l>>>32-7,l=F+J|0,y^=l<<9|l>>>32-9,l=y+F|0,T^=l<<13|l>>>32-13,l=T+y|0,J^=l<<18|l>>>32-18,l=C+F|0,K^=l<<7|l>>>32-7,l=K+C|0,B^=l<<9|l>>>32-9,l=B+K|0,F^=l<<13|l>>>32-13,l=F+B|0,C^=l<<18|l>>>32-18,l=U+k|0,x^=l<<7|l>>>32-7,l=x+U|0,y^=l<<9|l>>>32-9,l=y+x|0,k^=l<<13|l>>>32-13,l=k+y|0,U^=l<<18|l>>>32-18,l=v+_|0,T^=l<<7|l>>>32-7,l=T+v|0,E^=l<<9|l>>>32-9,l=E+T|0,_^=l<<13|l>>>32-13,l=_+E|0,v^=l<<18|l>>>32-18,l=J+I|0,M^=l<<7|l>>>32-7,l=M+J|0,G^=l<<9|l>>>32-9,l=G+M|0,I^=l<<13|l>>>32-13,l=I+G|0,J^=l<<18|l>>>32-18;C=C+c|0,K=K+h|0,B=B+p|0,F=F+b|0,k=k+S|0,U=U+j|0,x=x+R|0,y=y+et|0,E=E+N|0,_=_+Y|0,v=v+V|0,T=T+z|0,M=M+W|0,G=G+q|0,I=I+$|0,J=J+H|0,o[0]=C>>>0&255,o[1]=C>>>8&255,o[2]=C>>>16&255,o[3]=C>>>24&255,o[4]=K>>>0&255,o[5]=K>>>8&255,o[6]=K>>>16&255,o[7]=K>>>24&255,o[8]=B>>>0&255,o[9]=B>>>8&255,o[10]=B>>>16&255,o[11]=B>>>24&255,o[12]=F>>>0&255,o[13]=F>>>8&255,o[14]=F>>>16&255,o[15]=F>>>24&255,o[16]=k>>>0&255,o[17]=k>>>8&255,o[18]=k>>>16&255,o[19]=k>>>24&255,o[20]=U>>>0&255,o[21]=U>>>8&255,o[22]=U>>>16&255,o[23]=U>>>24&255,o[24]=x>>>0&255,o[25]=x>>>8&255,o[26]=x>>>16&255,o[27]=x>>>24&255,o[28]=y>>>0&255,o[29]=y>>>8&255,o[30]=y>>>16&255,o[31]=y>>>24&255,o[32]=E>>>0&255,o[33]=E>>>8&255,o[34]=E>>>16&255,o[35]=E>>>24&255,o[36]=_>>>0&255,o[37]=_>>>8&255,o[38]=_>>>16&255,o[39]=_>>>24&255,o[40]=v>>>0&255,o[41]=v>>>8&255,o[42]=v>>>16&255,o[43]=v>>>24&255,o[44]=T>>>0&255,o[45]=T>>>8&255,o[46]=T>>>16&255,o[47]=T>>>24&255,o[48]=M>>>0&255,o[49]=M>>>8&255,o[50]=M>>>16&255,o[51]=M>>>24&255,o[52]=G>>>0&255,o[53]=G>>>8&255,o[54]=G>>>16&255,o[55]=G>>>24&255,o[56]=I>>>0&255,o[57]=I>>>8&255,o[58]=I>>>16&255,o[59]=I>>>24&255,o[60]=J>>>0&255,o[61]=J>>>8&255,o[62]=J>>>16&255,o[63]=J>>>24&255}function te(o,f,s,n){for(var c=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,h=s[0]&255|(s[1]&255)<<8|(s[2]&255)<<16|(s[3]&255)<<24,p=s[4]&255|(s[5]&255)<<8|(s[6]&255)<<16|(s[7]&255)<<24,b=s[8]&255|(s[9]&255)<<8|(s[10]&255)<<16|(s[11]&255)<<24,S=s[12]&255|(s[13]&255)<<8|(s[14]&255)<<16|(s[15]&255)<<24,j=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,R=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,et=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,N=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,Y=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,V=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,z=s[16]&255|(s[17]&255)<<8|(s[18]&255)<<16|(s[19]&255)<<24,W=s[20]&255|(s[21]&255)<<8|(s[22]&255)<<16|(s[23]&255)<<24,q=s[24]&255|(s[25]&255)<<8|(s[26]&255)<<16|(s[27]&255)<<24,$=s[28]&255|(s[29]&255)<<8|(s[30]&255)<<16|(s[31]&255)<<24,H=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,C=c,K=h,B=p,F=b,k=S,U=j,x=R,y=et,E=N,_=Y,v=V,T=z,M=W,G=q,I=$,J=H,l,Q=0;Q<20;Q+=2)l=C+M|0,k^=l<<7|l>>>32-7,l=k+C|0,E^=l<<9|l>>>32-9,l=E+k|0,M^=l<<13|l>>>32-13,l=M+E|0,C^=l<<18|l>>>32-18,l=U+K|0,_^=l<<7|l>>>32-7,l=_+U|0,G^=l<<9|l>>>32-9,l=G+_|0,K^=l<<13|l>>>32-13,l=K+G|0,U^=l<<18|l>>>32-18,l=v+x|0,I^=l<<7|l>>>32-7,l=I+v|0,B^=l<<9|l>>>32-9,l=B+I|0,x^=l<<13|l>>>32-13,l=x+B|0,v^=l<<18|l>>>32-18,l=J+T|0,F^=l<<7|l>>>32-7,l=F+J|0,y^=l<<9|l>>>32-9,l=y+F|0,T^=l<<13|l>>>32-13,l=T+y|0,J^=l<<18|l>>>32-18,l=C+F|0,K^=l<<7|l>>>32-7,l=K+C|0,B^=l<<9|l>>>32-9,l=B+K|0,F^=l<<13|l>>>32-13,l=F+B|0,C^=l<<18|l>>>32-18,l=U+k|0,x^=l<<7|l>>>32-7,l=x+U|0,y^=l<<9|l>>>32-9,l=y+x|0,k^=l<<13|l>>>32-13,l=k+y|0,U^=l<<18|l>>>32-18,l=v+_|0,T^=l<<7|l>>>32-7,l=T+v|0,E^=l<<9|l>>>32-9,l=E+T|0,_^=l<<13|l>>>32-13,l=_+E|0,v^=l<<18|l>>>32-18,l=J+I|0,M^=l<<7|l>>>32-7,l=M+J|0,G^=l<<9|l>>>32-9,l=G+M|0,I^=l<<13|l>>>32-13,l=I+G|0,J^=l<<18|l>>>32-18;o[0]=C>>>0&255,o[1]=C>>>8&255,o[2]=C>>>16&255,o[3]=C>>>24&255,o[4]=U>>>0&255,o[5]=U>>>8&255,o[6]=U>>>16&255,o[7]=U>>>24&255,o[8]=v>>>0&255,o[9]=v>>>8&255,o[10]=v>>>16&255,o[11]=v>>>24&255,o[12]=J>>>0&255,o[13]=J>>>8&255,o[14]=J>>>16&255,o[15]=J>>>24&255,o[16]=x>>>0&255,o[17]=x>>>8&255,o[18]=x>>>16&255,o[19]=x>>>24&255,o[20]=y>>>0&255,o[21]=y>>>8&255,o[22]=y>>>16&255,o[23]=y>>>24&255,o[24]=E>>>0&255,o[25]=E>>>8&255,o[26]=E>>>16&255,o[27]=E>>>24&255,o[28]=_>>>0&255,o[29]=_>>>8&255,o[30]=_>>>16&255,o[31]=_>>>24&255}function jt(o,f,s,n){Lt(o,f,s,n)}function Rt(o,f,s,n){te(o,f,s,n)}var Kt=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Je(o,f,s,n,c,h,p){var b=new Uint8Array(16),S=new Uint8Array(64),j,R;for(R=0;R<16;R++)b[R]=0;for(R=0;R<8;R++)b[R]=h[R];for(;c>=64;){for(jt(S,b,p,Kt),R=0;R<64;R++)o[f+R]=s[n+R]^S[R];for(j=1,R=8;R<16;R++)j=j+(b[R]&255)|0,b[R]=j&255,j>>>=8;c-=64,f+=64,n+=64}if(c>0)for(jt(S,b,p,Kt),R=0;R<c;R++)o[f+R]=s[n+R]^S[R];return 0}function Ie(o,f,s,n,c){var h=new Uint8Array(16),p=new Uint8Array(64),b,S;for(S=0;S<16;S++)h[S]=0;for(S=0;S<8;S++)h[S]=n[S];for(;s>=64;){for(jt(p,h,c,Kt),S=0;S<64;S++)o[f+S]=p[S];for(b=1,S=8;S<16;S++)b=b+(h[S]&255)|0,h[S]=b&255,b>>>=8;s-=64,f+=64}if(s>0)for(jt(p,h,c,Kt),S=0;S<s;S++)o[f+S]=p[S];return 0}function Xe(o,f,s,n,c){var h=new Uint8Array(32);Rt(h,n,c,Kt);for(var p=new Uint8Array(8),b=0;b<8;b++)p[b]=n[b+16];return Ie(o,f,s,p,h)}function Ue(o,f,s,n,c,h,p){var b=new Uint8Array(32);Rt(b,h,p,Kt);for(var S=new Uint8Array(8),j=0;j<8;j++)S[j]=h[j+16];return Je(o,f,s,n,c,S,b)}var xe=function(o){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var f,s,n,c,h,p,b,S;f=o[0]&255|(o[1]&255)<<8,this.r[0]=f&8191,s=o[2]&255|(o[3]&255)<<8,this.r[1]=(f>>>13|s<<3)&8191,n=o[4]&255|(o[5]&255)<<8,this.r[2]=(s>>>10|n<<6)&7939,c=o[6]&255|(o[7]&255)<<8,this.r[3]=(n>>>7|c<<9)&8191,h=o[8]&255|(o[9]&255)<<8,this.r[4]=(c>>>4|h<<12)&255,this.r[5]=h>>>1&8190,p=o[10]&255|(o[11]&255)<<8,this.r[6]=(h>>>14|p<<2)&8191,b=o[12]&255|(o[13]&255)<<8,this.r[7]=(p>>>11|b<<5)&8065,S=o[14]&255|(o[15]&255)<<8,this.r[8]=(b>>>8|S<<8)&8191,this.r[9]=S>>>5&127,this.pad[0]=o[16]&255|(o[17]&255)<<8,this.pad[1]=o[18]&255|(o[19]&255)<<8,this.pad[2]=o[20]&255|(o[21]&255)<<8,this.pad[3]=o[22]&255|(o[23]&255)<<8,this.pad[4]=o[24]&255|(o[25]&255)<<8,this.pad[5]=o[26]&255|(o[27]&255)<<8,this.pad[6]=o[28]&255|(o[29]&255)<<8,this.pad[7]=o[30]&255|(o[31]&255)<<8};xe.prototype.blocks=function(o,f,s){for(var n=this.fin?0:2048,c,h,p,b,S,j,R,et,N,Y,V,z,W,q,$,H,C,K,B,F=this.h[0],k=this.h[1],U=this.h[2],x=this.h[3],y=this.h[4],E=this.h[5],_=this.h[6],v=this.h[7],T=this.h[8],M=this.h[9],G=this.r[0],I=this.r[1],J=this.r[2],l=this.r[3],Q=this.r[4],rt=this.r[5],nt=this.r[6],X=this.r[7],L=this.r[8],tt=this.r[9];s>=16;)c=o[f+0]&255|(o[f+1]&255)<<8,F+=c&8191,h=o[f+2]&255|(o[f+3]&255)<<8,k+=(c>>>13|h<<3)&8191,p=o[f+4]&255|(o[f+5]&255)<<8,U+=(h>>>10|p<<6)&8191,b=o[f+6]&255|(o[f+7]&255)<<8,x+=(p>>>7|b<<9)&8191,S=o[f+8]&255|(o[f+9]&255)<<8,y+=(b>>>4|S<<12)&8191,E+=S>>>1&8191,j=o[f+10]&255|(o[f+11]&255)<<8,_+=(S>>>14|j<<2)&8191,R=o[f+12]&255|(o[f+13]&255)<<8,v+=(j>>>11|R<<5)&8191,et=o[f+14]&255|(o[f+15]&255)<<8,T+=(R>>>8|et<<8)&8191,M+=et>>>5|n,N=0,Y=N,Y+=F*G,Y+=k*(5*tt),Y+=U*(5*L),Y+=x*(5*X),Y+=y*(5*nt),N=Y>>>13,Y&=8191,Y+=E*(5*rt),Y+=_*(5*Q),Y+=v*(5*l),Y+=T*(5*J),Y+=M*(5*I),N+=Y>>>13,Y&=8191,V=N,V+=F*I,V+=k*G,V+=U*(5*tt),V+=x*(5*L),V+=y*(5*X),N=V>>>13,V&=8191,V+=E*(5*nt),V+=_*(5*rt),V+=v*(5*Q),V+=T*(5*l),V+=M*(5*J),N+=V>>>13,V&=8191,z=N,z+=F*J,z+=k*I,z+=U*G,z+=x*(5*tt),z+=y*(5*L),N=z>>>13,z&=8191,z+=E*(5*X),z+=_*(5*nt),z+=v*(5*rt),z+=T*(5*Q),z+=M*(5*l),N+=z>>>13,z&=8191,W=N,W+=F*l,W+=k*J,W+=U*I,W+=x*G,W+=y*(5*tt),N=W>>>13,W&=8191,W+=E*(5*L),W+=_*(5*X),W+=v*(5*nt),W+=T*(5*rt),W+=M*(5*Q),N+=W>>>13,W&=8191,q=N,q+=F*Q,q+=k*l,q+=U*J,q+=x*I,q+=y*G,N=q>>>13,q&=8191,q+=E*(5*tt),q+=_*(5*L),q+=v*(5*X),q+=T*(5*nt),q+=M*(5*rt),N+=q>>>13,q&=8191,$=N,$+=F*rt,$+=k*Q,$+=U*l,$+=x*J,$+=y*I,N=$>>>13,$&=8191,$+=E*G,$+=_*(5*tt),$+=v*(5*L),$+=T*(5*X),$+=M*(5*nt),N+=$>>>13,$&=8191,H=N,H+=F*nt,H+=k*rt,H+=U*Q,H+=x*l,H+=y*J,N=H>>>13,H&=8191,H+=E*I,H+=_*G,H+=v*(5*tt),H+=T*(5*L),H+=M*(5*X),N+=H>>>13,H&=8191,C=N,C+=F*X,C+=k*nt,C+=U*rt,C+=x*Q,C+=y*l,N=C>>>13,C&=8191,C+=E*J,C+=_*I,C+=v*G,C+=T*(5*tt),C+=M*(5*L),N+=C>>>13,C&=8191,K=N,K+=F*L,K+=k*X,K+=U*nt,K+=x*rt,K+=y*Q,N=K>>>13,K&=8191,K+=E*l,K+=_*J,K+=v*I,K+=T*G,K+=M*(5*tt),N+=K>>>13,K&=8191,B=N,B+=F*tt,B+=k*L,B+=U*X,B+=x*nt,B+=y*rt,N=B>>>13,B&=8191,B+=E*Q,B+=_*l,B+=v*J,B+=T*I,B+=M*G,N+=B>>>13,B&=8191,N=(N<<2)+N|0,N=N+Y|0,Y=N&8191,N=N>>>13,V+=N,F=Y,k=V,U=z,x=W,y=q,E=$,_=H,v=C,T=K,M=B,f+=16,s-=16;this.h[0]=F,this.h[1]=k,this.h[2]=U,this.h[3]=x,this.h[4]=y,this.h[5]=E,this.h[6]=_,this.h[7]=v,this.h[8]=T,this.h[9]=M},xe.prototype.finish=function(o,f){var s=new Uint16Array(10),n,c,h,p;if(this.leftover){for(p=this.leftover,this.buffer[p++]=1;p<16;p++)this.buffer[p]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,p=2;p<10;p++)this.h[p]+=n,n=this.h[p]>>>13,this.h[p]&=8191;for(this.h[0]+=n*5,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,s[0]=this.h[0]+5,n=s[0]>>>13,s[0]&=8191,p=1;p<10;p++)s[p]=this.h[p]+n,n=s[p]>>>13,s[p]&=8191;for(s[9]-=8192,c=(n^1)-1,p=0;p<10;p++)s[p]&=c;for(c=~c,p=0;p<10;p++)this.h[p]=this.h[p]&c|s[p];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,h=this.h[0]+this.pad[0],this.h[0]=h&65535,p=1;p<8;p++)h=(this.h[p]+this.pad[p]|0)+(h>>>16)|0,this.h[p]=h&65535;o[f+0]=this.h[0]>>>0&255,o[f+1]=this.h[0]>>>8&255,o[f+2]=this.h[1]>>>0&255,o[f+3]=this.h[1]>>>8&255,o[f+4]=this.h[2]>>>0&255,o[f+5]=this.h[2]>>>8&255,o[f+6]=this.h[3]>>>0&255,o[f+7]=this.h[3]>>>8&255,o[f+8]=this.h[4]>>>0&255,o[f+9]=this.h[4]>>>8&255,o[f+10]=this.h[5]>>>0&255,o[f+11]=this.h[5]>>>8&255,o[f+12]=this.h[6]>>>0&255,o[f+13]=this.h[6]>>>8&255,o[f+14]=this.h[7]>>>0&255,o[f+15]=this.h[7]>>>8&255},xe.prototype.update=function(o,f,s){var n,c;if(this.leftover){for(c=16-this.leftover,c>s&&(c=s),n=0;n<c;n++)this.buffer[this.leftover+n]=o[f+n];if(s-=c,f+=c,this.leftover+=c,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(s>=16&&(c=s-s%16,this.blocks(o,f,c),f+=c,s-=c),s){for(n=0;n<s;n++)this.buffer[this.leftover+n]=o[f+n];this.leftover+=s}};function Re(o,f,s,n,c,h){var p=new xe(h);return p.update(s,n,c),p.finish(o,f),0}function ne(o,f,s,n,c,h){var p=new Uint8Array(16);return Re(p,0,s,n,c,h),ft(o,f,p,0)}function Be(o,f,s,n,c){var h;if(s<32)return-1;for(Ue(o,0,f,0,s,n,c),Re(o,16,o,32,s-32,o),h=0;h<16;h++)o[h]=0;return 0}function Ne(o,f,s,n,c){var h,p=new Uint8Array(32);if(s<32||(Xe(p,0,32,n,c),ne(f,16,f,32,s-32,p)!==0))return-1;for(Ue(o,0,f,0,s,n,c),h=0;h<32;h++)o[h]=0;return 0}function Bt(o,f){var s;for(s=0;s<16;s++)o[s]=f[s]|0}function Pe(o){var f,s,n=1;for(f=0;f<16;f++)s=o[f]+n+65535,n=Math.floor(s/65536),o[f]=s-n*65536;o[0]+=n-1+37*(n-1)}function ee(o,f,s){for(var n,c=~(s-1),h=0;h<16;h++)n=c&(o[h]^f[h]),o[h]^=n,f[h]^=n}function re(o,f){var s,n,c,h=t(),p=t();for(s=0;s<16;s++)p[s]=f[s];for(Pe(p),Pe(p),Pe(p),n=0;n<2;n++){for(h[0]=p[0]-65517,s=1;s<15;s++)h[s]=p[s]-65535-(h[s-1]>>16&1),h[s-1]&=65535;h[15]=p[15]-32767-(h[14]>>16&1),c=h[15]>>16&1,h[14]&=65535,ee(p,h,1-c)}for(s=0;s<16;s++)o[2*s]=p[s]&255,o[2*s+1]=p[s]>>8}function Ze(o,f){var s=new Uint8Array(32),n=new Uint8Array(32);return re(s,o),re(n,f),At(s,0,n,0)}function wn(o){var f=new Uint8Array(32);return re(f,o),f[0]&1}function Ur(o,f){var s;for(s=0;s<16;s++)o[s]=f[2*s]+(f[2*s+1]<<8);o[15]&=32767}function Nt(o,f,s){for(var n=0;n<16;n++)o[n]=f[n]+s[n]}function Pt(o,f,s){for(var n=0;n<16;n++)o[n]=f[n]-s[n]}function D(o,f,s){var n,c,h=0,p=0,b=0,S=0,j=0,R=0,et=0,N=0,Y=0,V=0,z=0,W=0,q=0,$=0,H=0,C=0,K=0,B=0,F=0,k=0,U=0,x=0,y=0,E=0,_=0,v=0,T=0,M=0,G=0,I=0,J=0,l=s[0],Q=s[1],rt=s[2],nt=s[3],X=s[4],L=s[5],tt=s[6],dt=s[7],at=s[8],ct=s[9],ut=s[10],lt=s[11],ht=s[12],yt=s[13],mt=s[14],wt=s[15];n=f[0],h+=n*l,p+=n*Q,b+=n*rt,S+=n*nt,j+=n*X,R+=n*L,et+=n*tt,N+=n*dt,Y+=n*at,V+=n*ct,z+=n*ut,W+=n*lt,q+=n*ht,$+=n*yt,H+=n*mt,C+=n*wt,n=f[1],p+=n*l,b+=n*Q,S+=n*rt,j+=n*nt,R+=n*X,et+=n*L,N+=n*tt,Y+=n*dt,V+=n*at,z+=n*ct,W+=n*ut,q+=n*lt,$+=n*ht,H+=n*yt,C+=n*mt,K+=n*wt,n=f[2],b+=n*l,S+=n*Q,j+=n*rt,R+=n*nt,et+=n*X,N+=n*L,Y+=n*tt,V+=n*dt,z+=n*at,W+=n*ct,q+=n*ut,$+=n*lt,H+=n*ht,C+=n*yt,K+=n*mt,B+=n*wt,n=f[3],S+=n*l,j+=n*Q,R+=n*rt,et+=n*nt,N+=n*X,Y+=n*L,V+=n*tt,z+=n*dt,W+=n*at,q+=n*ct,$+=n*ut,H+=n*lt,C+=n*ht,K+=n*yt,B+=n*mt,F+=n*wt,n=f[4],j+=n*l,R+=n*Q,et+=n*rt,N+=n*nt,Y+=n*X,V+=n*L,z+=n*tt,W+=n*dt,q+=n*at,$+=n*ct,H+=n*ut,C+=n*lt,K+=n*ht,B+=n*yt,F+=n*mt,k+=n*wt,n=f[5],R+=n*l,et+=n*Q,N+=n*rt,Y+=n*nt,V+=n*X,z+=n*L,W+=n*tt,q+=n*dt,$+=n*at,H+=n*ct,C+=n*ut,K+=n*lt,B+=n*ht,F+=n*yt,k+=n*mt,U+=n*wt,n=f[6],et+=n*l,N+=n*Q,Y+=n*rt,V+=n*nt,z+=n*X,W+=n*L,q+=n*tt,$+=n*dt,H+=n*at,C+=n*ct,K+=n*ut,B+=n*lt,F+=n*ht,k+=n*yt,U+=n*mt,x+=n*wt,n=f[7],N+=n*l,Y+=n*Q,V+=n*rt,z+=n*nt,W+=n*X,q+=n*L,$+=n*tt,H+=n*dt,C+=n*at,K+=n*ct,B+=n*ut,F+=n*lt,k+=n*ht,U+=n*yt,x+=n*mt,y+=n*wt,n=f[8],Y+=n*l,V+=n*Q,z+=n*rt,W+=n*nt,q+=n*X,$+=n*L,H+=n*tt,C+=n*dt,K+=n*at,B+=n*ct,F+=n*ut,k+=n*lt,U+=n*ht,x+=n*yt,y+=n*mt,E+=n*wt,n=f[9],V+=n*l,z+=n*Q,W+=n*rt,q+=n*nt,$+=n*X,H+=n*L,C+=n*tt,K+=n*dt,B+=n*at,F+=n*ct,k+=n*ut,U+=n*lt,x+=n*ht,y+=n*yt,E+=n*mt,_+=n*wt,n=f[10],z+=n*l,W+=n*Q,q+=n*rt,$+=n*nt,H+=n*X,C+=n*L,K+=n*tt,B+=n*dt,F+=n*at,k+=n*ct,U+=n*ut,x+=n*lt,y+=n*ht,E+=n*yt,_+=n*mt,v+=n*wt,n=f[11],W+=n*l,q+=n*Q,$+=n*rt,H+=n*nt,C+=n*X,K+=n*L,B+=n*tt,F+=n*dt,k+=n*at,U+=n*ct,x+=n*ut,y+=n*lt,E+=n*ht,_+=n*yt,v+=n*mt,T+=n*wt,n=f[12],q+=n*l,$+=n*Q,H+=n*rt,C+=n*nt,K+=n*X,B+=n*L,F+=n*tt,k+=n*dt,U+=n*at,x+=n*ct,y+=n*ut,E+=n*lt,_+=n*ht,v+=n*yt,T+=n*mt,M+=n*wt,n=f[13],$+=n*l,H+=n*Q,C+=n*rt,K+=n*nt,B+=n*X,F+=n*L,k+=n*tt,U+=n*dt,x+=n*at,y+=n*ct,E+=n*ut,_+=n*lt,v+=n*ht,T+=n*yt,M+=n*mt,G+=n*wt,n=f[14],H+=n*l,C+=n*Q,K+=n*rt,B+=n*nt,F+=n*X,k+=n*L,U+=n*tt,x+=n*dt,y+=n*at,E+=n*ct,_+=n*ut,v+=n*lt,T+=n*ht,M+=n*yt,G+=n*mt,I+=n*wt,n=f[15],C+=n*l,K+=n*Q,B+=n*rt,F+=n*nt,k+=n*X,U+=n*L,x+=n*tt,y+=n*dt,E+=n*at,_+=n*ct,v+=n*ut,T+=n*lt,M+=n*ht,G+=n*yt,I+=n*mt,J+=n*wt,h+=38*K,p+=38*B,b+=38*F,S+=38*k,j+=38*U,R+=38*x,et+=38*y,N+=38*E,Y+=38*_,V+=38*v,z+=38*T,W+=38*M,q+=38*G,$+=38*I,H+=38*J,c=1,n=h+c+65535,c=Math.floor(n/65536),h=n-c*65536,n=p+c+65535,c=Math.floor(n/65536),p=n-c*65536,n=b+c+65535,c=Math.floor(n/65536),b=n-c*65536,n=S+c+65535,c=Math.floor(n/65536),S=n-c*65536,n=j+c+65535,c=Math.floor(n/65536),j=n-c*65536,n=R+c+65535,c=Math.floor(n/65536),R=n-c*65536,n=et+c+65535,c=Math.floor(n/65536),et=n-c*65536,n=N+c+65535,c=Math.floor(n/65536),N=n-c*65536,n=Y+c+65535,c=Math.floor(n/65536),Y=n-c*65536,n=V+c+65535,c=Math.floor(n/65536),V=n-c*65536,n=z+c+65535,c=Math.floor(n/65536),z=n-c*65536,n=W+c+65535,c=Math.floor(n/65536),W=n-c*65536,n=q+c+65535,c=Math.floor(n/65536),q=n-c*65536,n=$+c+65535,c=Math.floor(n/65536),$=n-c*65536,n=H+c+65535,c=Math.floor(n/65536),H=n-c*65536,n=C+c+65535,c=Math.floor(n/65536),C=n-c*65536,h+=c-1+37*(c-1),c=1,n=h+c+65535,c=Math.floor(n/65536),h=n-c*65536,n=p+c+65535,c=Math.floor(n/65536),p=n-c*65536,n=b+c+65535,c=Math.floor(n/65536),b=n-c*65536,n=S+c+65535,c=Math.floor(n/65536),S=n-c*65536,n=j+c+65535,c=Math.floor(n/65536),j=n-c*65536,n=R+c+65535,c=Math.floor(n/65536),R=n-c*65536,n=et+c+65535,c=Math.floor(n/65536),et=n-c*65536,n=N+c+65535,c=Math.floor(n/65536),N=n-c*65536,n=Y+c+65535,c=Math.floor(n/65536),Y=n-c*65536,n=V+c+65535,c=Math.floor(n/65536),V=n-c*65536,n=z+c+65535,c=Math.floor(n/65536),z=n-c*65536,n=W+c+65535,c=Math.floor(n/65536),W=n-c*65536,n=q+c+65535,c=Math.floor(n/65536),q=n-c*65536,n=$+c+65535,c=Math.floor(n/65536),$=n-c*65536,n=H+c+65535,c=Math.floor(n/65536),H=n-c*65536,n=C+c+65535,c=Math.floor(n/65536),C=n-c*65536,h+=c-1+37*(c-1),o[0]=h,o[1]=p,o[2]=b,o[3]=S,o[4]=j,o[5]=R,o[6]=et,o[7]=N,o[8]=Y,o[9]=V,o[10]=z,o[11]=W,o[12]=q,o[13]=$,o[14]=H,o[15]=C}function Tt(o,f){D(o,f,f)}function gn(o,f){var s=t(),n;for(n=0;n<16;n++)s[n]=f[n];for(n=253;n>=0;n--)Tt(s,s),n!==2&&n!==4&&D(s,s,f);for(n=0;n<16;n++)o[n]=s[n]}function _n(o,f){var s=t(),n;for(n=0;n<16;n++)s[n]=f[n];for(n=250;n>=0;n--)Tt(s,s),n!==1&&D(s,s,f);for(n=0;n<16;n++)o[n]=s[n]}function Qe(o,f,s){var n=new Uint8Array(32),c=new Float64Array(80),h,p,b=t(),S=t(),j=t(),R=t(),et=t(),N=t();for(p=0;p<31;p++)n[p]=f[p];for(n[31]=f[31]&127|64,n[0]&=248,Ur(c,s),p=0;p<16;p++)S[p]=c[p],R[p]=b[p]=j[p]=0;for(b[0]=R[0]=1,p=254;p>=0;--p)h=n[p>>>3]>>>(p&7)&1,ee(b,S,h),ee(j,R,h),Nt(et,b,j),Pt(b,b,j),Nt(j,S,R),Pt(S,S,R),Tt(R,et),Tt(N,b),D(b,j,b),D(j,S,et),Nt(et,b,j),Pt(b,b,j),Tt(S,b),Pt(j,R,N),D(b,j,m),Nt(b,b,R),D(j,j,b),D(b,R,N),D(R,S,c),Tt(S,et),ee(b,S,h),ee(j,R,h);for(p=0;p<16;p++)c[p+16]=b[p],c[p+32]=j[p],c[p+48]=S[p],c[p+64]=R[p];var Y=c.subarray(32),V=c.subarray(16);return gn(Y,Y),D(V,V,Y),re(o,V),0}function De(o,f){return Qe(o,f,a)}function bn(o,f){return r(f,32),De(o,f)}function Le(o,f,s){var n=new Uint8Array(32);return Qe(n,s,f),Rt(o,i,n,Kt)}var vn=Be,no=Ne;function io(o,f,s,n,c,h){var p=new Uint8Array(32);return Le(p,c,h),vn(o,f,s,n,p)}function oo(o,f,s,n,c,h){var p=new Uint8Array(32);return Le(p,c,h),no(o,f,s,n,p)}var En=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function An(o,f,s,n){for(var c=new Int32Array(16),h=new Int32Array(16),p,b,S,j,R,et,N,Y,V,z,W,q,$,H,C,K,B,F,k,U,x,y,E,_,v,T,M=o[0],G=o[1],I=o[2],J=o[3],l=o[4],Q=o[5],rt=o[6],nt=o[7],X=f[0],L=f[1],tt=f[2],dt=f[3],at=f[4],ct=f[5],ut=f[6],lt=f[7],ht=0;n>=128;){for(k=0;k<16;k++)U=8*k+ht,c[k]=s[U+0]<<24|s[U+1]<<16|s[U+2]<<8|s[U+3],h[k]=s[U+4]<<24|s[U+5]<<16|s[U+6]<<8|s[U+7];for(k=0;k<80;k++)if(p=M,b=G,S=I,j=J,R=l,et=Q,N=rt,Y=nt,V=X,z=L,W=tt,q=dt,$=at,H=ct,C=ut,K=lt,x=nt,y=lt,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=(l>>>14|at<<32-14)^(l>>>18|at<<32-18)^(at>>>41-32|l<<32-(41-32)),y=(at>>>14|l<<32-14)^(at>>>18|l<<32-18)^(l>>>41-32|at<<32-(41-32)),E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,x=l&Q^~l&rt,y=at&ct^~at&ut,E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,x=En[k*2],y=En[k*2+1],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,x=c[k%16],y=h[k%16],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,B=v&65535|T<<16,F=E&65535|_<<16,x=B,y=F,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=(M>>>28|X<<32-28)^(X>>>34-32|M<<32-(34-32))^(X>>>39-32|M<<32-(39-32)),y=(X>>>28|M<<32-28)^(M>>>34-32|X<<32-(34-32))^(M>>>39-32|X<<32-(39-32)),E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,x=M&G^M&I^G&I,y=X&L^X&tt^L&tt,E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,Y=v&65535|T<<16,K=E&65535|_<<16,x=j,y=q,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=B,y=F,E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,j=v&65535|T<<16,q=E&65535|_<<16,G=p,I=b,J=S,l=j,Q=R,rt=et,nt=N,M=Y,L=V,tt=z,dt=W,at=q,ct=$,ut=H,lt=C,X=K,k%16===15)for(U=0;U<16;U++)x=c[U],y=h[U],E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=c[(U+9)%16],y=h[(U+9)%16],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,B=c[(U+1)%16],F=h[(U+1)%16],x=(B>>>1|F<<32-1)^(B>>>8|F<<32-8)^B>>>7,y=(F>>>1|B<<32-1)^(F>>>8|B<<32-8)^(F>>>7|B<<32-7),E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,B=c[(U+14)%16],F=h[(U+14)%16],x=(B>>>19|F<<32-19)^(F>>>61-32|B<<32-(61-32))^B>>>6,y=(F>>>19|B<<32-19)^(B>>>61-32|F<<32-(61-32))^(F>>>6|B<<32-6),E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,c[U]=v&65535|T<<16,h[U]=E&65535|_<<16;x=M,y=X,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[0],y=f[0],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[0]=M=v&65535|T<<16,f[0]=X=E&65535|_<<16,x=G,y=L,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[1],y=f[1],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[1]=G=v&65535|T<<16,f[1]=L=E&65535|_<<16,x=I,y=tt,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[2],y=f[2],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[2]=I=v&65535|T<<16,f[2]=tt=E&65535|_<<16,x=J,y=dt,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[3],y=f[3],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[3]=J=v&65535|T<<16,f[3]=dt=E&65535|_<<16,x=l,y=at,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[4],y=f[4],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[4]=l=v&65535|T<<16,f[4]=at=E&65535|_<<16,x=Q,y=ct,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[5],y=f[5],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[5]=Q=v&65535|T<<16,f[5]=ct=E&65535|_<<16,x=rt,y=ut,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[6],y=f[6],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[6]=rt=v&65535|T<<16,f[6]=ut=E&65535|_<<16,x=nt,y=lt,E=y&65535,_=y>>>16,v=x&65535,T=x>>>16,x=o[7],y=f[7],E+=y&65535,_+=y>>>16,v+=x&65535,T+=x>>>16,_+=E>>>16,v+=_>>>16,T+=v>>>16,o[7]=nt=v&65535|T<<16,f[7]=lt=E&65535|_<<16,ht+=128,n-=128}return n}function ie(o,f,s){var n=new Int32Array(8),c=new Int32Array(8),h=new Uint8Array(256),p,b=s;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,c[0]=4089235720,c[1]=2227873595,c[2]=4271175723,c[3]=1595750129,c[4]=2917565137,c[5]=725511199,c[6]=4215389547,c[7]=327033209,An(n,c,f,s),s%=128,p=0;p<s;p++)h[p]=f[b-s+p];for(h[s]=128,s=256-128*(s<112?1:0),h[s-9]=0,it(h,s-8,b/536870912|0,b<<3),An(n,c,h,s),p=0;p<8;p++)it(o,8*p,n[p],c[p]);return 0}function tr(o,f){var s=t(),n=t(),c=t(),h=t(),p=t(),b=t(),S=t(),j=t(),R=t();Pt(s,o[1],o[0]),Pt(R,f[1],f[0]),D(s,s,R),Nt(n,o[0],o[1]),Nt(R,f[0],f[1]),D(n,n,R),D(c,o[3],f[3]),D(c,c,A),D(h,o[2],f[2]),Nt(h,h,h),Pt(p,n,s),Pt(b,h,c),Nt(S,h,c),Nt(j,n,s),D(o[0],p,b),D(o[1],j,S),D(o[2],S,b),D(o[3],p,j)}function Tn(o,f,s){var n;for(n=0;n<4;n++)ee(o[n],f[n],s)}function Rr(o,f){var s=t(),n=t(),c=t();gn(c,f[2]),D(s,f[0],c),D(n,f[1],c),re(o,n),o[31]^=wn(s)<<7}function Br(o,f,s){var n,c;for(Bt(o[0],u),Bt(o[1],d),Bt(o[2],d),Bt(o[3],u),c=255;c>=0;--c)n=s[c/8|0]>>(c&7)&1,Tn(o,f,n),tr(f,o),tr(o,o),Tn(o,f,n)}function er(o,f){var s=[t(),t(),t(),t()];Bt(s[0],P),Bt(s[1],O),Bt(s[2],d),D(s[3],P,O),Br(o,s,f)}function Nr(o,f,s){var n=new Uint8Array(64),c=[t(),t(),t(),t()],h;for(s||r(f,32),ie(n,f,32),n[0]&=248,n[31]&=127,n[31]|=64,er(c,n),Rr(o,c),h=0;h<32;h++)f[h+32]=o[h];return 0}var rr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Pr(o,f){var s,n,c,h;for(n=63;n>=32;--n){for(s=0,c=n-32,h=n-12;c<h;++c)f[c]+=s-16*f[n]*rr[c-(n-32)],s=Math.floor((f[c]+128)/256),f[c]-=s*256;f[c]+=s,f[n]=0}for(s=0,c=0;c<32;c++)f[c]+=s-(f[31]>>4)*rr[c],s=f[c]>>8,f[c]&=255;for(c=0;c<32;c++)f[c]-=s*rr[c];for(n=0;n<32;n++)f[n+1]+=f[n]>>8,o[n]=f[n]&255}function Cr(o){var f=new Float64Array(64),s;for(s=0;s<64;s++)f[s]=o[s];for(s=0;s<64;s++)o[s]=0;Pr(o,f)}function Sn(o,f,s,n){var c=new Uint8Array(64),h=new Uint8Array(64),p=new Uint8Array(64),b,S,j=new Float64Array(64),R=[t(),t(),t(),t()];ie(c,n,32),c[0]&=248,c[31]&=127,c[31]|=64;var et=s+64;for(b=0;b<s;b++)o[64+b]=f[b];for(b=0;b<32;b++)o[32+b]=c[32+b];for(ie(p,o.subarray(32),s+32),Cr(p),er(R,p),Rr(o,R),b=32;b<64;b++)o[b]=n[b];for(ie(h,o,s+64),Cr(h),b=0;b<64;b++)j[b]=0;for(b=0;b<32;b++)j[b]=p[b];for(b=0;b<32;b++)for(S=0;S<32;S++)j[b+S]+=h[b]*c[S];return Pr(o.subarray(32),j),et}function ao(o,f){var s=t(),n=t(),c=t(),h=t(),p=t(),b=t(),S=t();return Bt(o[2],d),Ur(o[1],f),Tt(c,o[1]),D(h,c,w),Pt(c,c,o[2]),Nt(h,o[2],h),Tt(p,h),Tt(b,p),D(S,b,p),D(s,S,c),D(s,s,h),_n(s,s),D(s,s,c),D(s,s,h),D(s,s,h),D(o[0],s,h),Tt(n,o[0]),D(n,n,h),Ze(n,c)&&D(o[0],o[0],Z),Tt(n,o[0]),D(n,n,h),Ze(n,c)?-1:(wn(o[0])===f[31]>>7&&Pt(o[0],u,o[0]),D(o[3],o[0],o[1]),0)}function Fr(o,f,s,n){var c,h=new Uint8Array(32),p=new Uint8Array(64),b=[t(),t(),t(),t()],S=[t(),t(),t(),t()];if(s<64||ao(S,n))return-1;for(c=0;c<s;c++)o[c]=f[c];for(c=0;c<32;c++)o[c+32]=n[c];if(ie(p,o,s),Cr(p),Br(b,S,p),er(S,f.subarray(32)),tr(b,S),Rr(h,b),s-=64,At(f,0,h,0)){for(c=0;c<s;c++)o[c]=0;return-1}for(c=0;c<s;c++)o[c]=f[c+64];return s}var kr=32,nr=24,Ce=32,ye=16,Fe=32,ir=32,ke=32,je=32,jr=32,On=nr,so=Ce,fo=ye,zt=64,oe=32,me=64,Kr=32,Mr=64;e.lowlevel={crypto_core_hsalsa20:Rt,crypto_stream_xor:Ue,crypto_stream:Xe,crypto_stream_salsa20_xor:Je,crypto_stream_salsa20:Ie,crypto_onetimeauth:Re,crypto_onetimeauth_verify:ne,crypto_verify_16:ft,crypto_verify_32:At,crypto_secretbox:Be,crypto_secretbox_open:Ne,crypto_scalarmult:Qe,crypto_scalarmult_base:De,crypto_box_beforenm:Le,crypto_box_afternm:vn,crypto_box:io,crypto_box_open:oo,crypto_box_keypair:bn,crypto_hash:ie,crypto_sign:Sn,crypto_sign_keypair:Nr,crypto_sign_open:Fr,crypto_secretbox_KEYBYTES:kr,crypto_secretbox_NONCEBYTES:nr,crypto_secretbox_ZEROBYTES:Ce,crypto_secretbox_BOXZEROBYTES:ye,crypto_scalarmult_BYTES:Fe,crypto_scalarmult_SCALARBYTES:ir,crypto_box_PUBLICKEYBYTES:ke,crypto_box_SECRETKEYBYTES:je,crypto_box_BEFORENMBYTES:jr,crypto_box_NONCEBYTES:On,crypto_box_ZEROBYTES:so,crypto_box_BOXZEROBYTES:fo,crypto_sign_BYTES:zt,crypto_sign_PUBLICKEYBYTES:oe,crypto_sign_SECRETKEYBYTES:me,crypto_sign_SEEDBYTES:Kr,crypto_hash_BYTES:Mr,gf:t,D:w,L:rr,pack25519:re,unpack25519:Ur,M:D,A:Nt,S:Tt,Z:Pt,pow2523:_n,add:tr,set25519:Bt,modL:Pr,scalarmult:Br,scalarbase:er};function Un(o,f){if(o.length!==kr)throw new Error("bad key size");if(f.length!==nr)throw new Error("bad nonce size")}function co(o,f){if(o.length!==ke)throw new Error("bad public key size");if(f.length!==je)throw new Error("bad secret key size")}function vt(){for(var o=0;o<arguments.length;o++)if(!(arguments[o]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Rn(o){for(var f=0;f<o.length;f++)o[f]=0}e.randomBytes=function(o){var f=new Uint8Array(o);return r(f,o),f},e.secretbox=function(o,f,s){vt(o,f,s),Un(s,f);for(var n=new Uint8Array(Ce+o.length),c=new Uint8Array(n.length),h=0;h<o.length;h++)n[h+Ce]=o[h];return Be(c,n,n.length,f,s),c.subarray(ye)},e.secretbox.open=function(o,f,s){vt(o,f,s),Un(s,f);for(var n=new Uint8Array(ye+o.length),c=new Uint8Array(n.length),h=0;h<o.length;h++)n[h+ye]=o[h];return n.length<32||Ne(c,n,n.length,f,s)!==0?null:c.subarray(Ce)},e.secretbox.keyLength=kr,e.secretbox.nonceLength=nr,e.secretbox.overheadLength=ye,e.scalarMult=function(o,f){if(vt(o,f),o.length!==ir)throw new Error("bad n size");if(f.length!==Fe)throw new Error("bad p size");var s=new Uint8Array(Fe);return Qe(s,o,f),s},e.scalarMult.base=function(o){if(vt(o),o.length!==ir)throw new Error("bad n size");var f=new Uint8Array(Fe);return De(f,o),f},e.scalarMult.scalarLength=ir,e.scalarMult.groupElementLength=Fe,e.box=function(o,f,s,n){var c=e.box.before(s,n);return e.secretbox(o,f,c)},e.box.before=function(o,f){vt(o,f),co(o,f);var s=new Uint8Array(jr);return Le(s,o,f),s},e.box.after=e.secretbox,e.box.open=function(o,f,s,n){var c=e.box.before(s,n);return e.secretbox.open(o,f,c)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var o=new Uint8Array(ke),f=new Uint8Array(je);return bn(o,f),{publicKey:o,secretKey:f}},e.box.keyPair.fromSecretKey=function(o){if(vt(o),o.length!==je)throw new Error("bad secret key size");var f=new Uint8Array(ke);return De(f,o),{publicKey:f,secretKey:new Uint8Array(o)}},e.box.publicKeyLength=ke,e.box.secretKeyLength=je,e.box.sharedKeyLength=jr,e.box.nonceLength=On,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(o,f){if(vt(o,f),f.length!==me)throw new Error("bad secret key size");var s=new Uint8Array(zt+o.length);return Sn(s,o,o.length,f),s},e.sign.open=function(o,f){if(vt(o,f),f.length!==oe)throw new Error("bad public key size");var s=new Uint8Array(o.length),n=Fr(s,o,o.length,f);if(n<0)return null;for(var c=new Uint8Array(n),h=0;h<c.length;h++)c[h]=s[h];return c},e.sign.detached=function(o,f){for(var s=e.sign(o,f),n=new Uint8Array(zt),c=0;c<n.length;c++)n[c]=s[c];return n},e.sign.detached.verify=function(o,f,s){if(vt(o,f,s),f.length!==zt)throw new Error("bad signature size");if(s.length!==oe)throw new Error("bad public key size");var n=new Uint8Array(zt+o.length),c=new Uint8Array(zt+o.length),h;for(h=0;h<zt;h++)n[h]=f[h];for(h=0;h<o.length;h++)n[h+zt]=o[h];return Fr(c,n,n.length,s)>=0},e.sign.keyPair=function(){var o=new Uint8Array(oe),f=new Uint8Array(me);return Nr(o,f),{publicKey:o,secretKey:f}},e.sign.keyPair.fromSecretKey=function(o){if(vt(o),o.length!==me)throw new Error("bad secret key size");for(var f=new Uint8Array(oe),s=0;s<f.length;s++)f[s]=o[32+s];return{publicKey:f,secretKey:new Uint8Array(o)}},e.sign.keyPair.fromSeed=function(o){if(vt(o),o.length!==Kr)throw new Error("bad seed size");for(var f=new Uint8Array(oe),s=new Uint8Array(me),n=0;n<32;n++)s[n]=o[n];return Nr(f,s,!0),{publicKey:f,secretKey:s}},e.sign.publicKeyLength=oe,e.sign.secretKeyLength=me,e.sign.seedLength=Kr,e.sign.signatureLength=zt,e.hash=function(o){vt(o);var f=new Uint8Array(Mr);return ie(f,o,o.length),f},e.hash.hashLength=Mr,e.verify=function(o,f){return vt(o,f),o.length===0||f.length===0||o.length!==f.length?!1:st(o,0,f,0,o.length)===0},e.setPRNG=function(o){r=o},function(){var o=typeof self<"u"?self.crypto||self.msCrypto:null;if(o&&o.getRandomValues){var f=65536;e.setPRNG(function(s,n){var c,h=new Uint8Array(n);for(c=0;c<n;c+=f)o.getRandomValues(h.subarray(c,c+Math.min(n-c,f)));for(c=0;c<n;c++)s[c]=h[c];Rn(h)})}else typeof Bn<"u"&&(o=bi(),o&&o.randomBytes&&e.setPRNG(function(s,n){var c,h=o.randomBytes(n);for(c=0;c<n;c++)s[c]=h[c];Rn(h)}))}()})(typeof _r<"u"&&_r.exports?_r.exports:self.nacl=self.nacl||{})});var ge=class{callbacks=[];populate(t){this.callbacks.forEach(({callback:r})=>r(t))}subscribe(t){let r=Symbol();return this.callbacks.push({id:r,callback:t}),()=>this.callbacks=this.callbacks.filter(({id:i})=>i!==r)}};var _e=class extends ge{authUser=null;constructor(){super()}static getInstance(){return _e.instance||(_e.instance=new _e),_e.instance}set(t){this.authUser=t,this.populate(t)}get(){return this.authUser}subscribe(t){let r=super.subscribe(t);return t(this.authUser),r}reset(){this.authUser=null,this.populate(this.authUser)}},Mt=_e;ar(Mt,"instance");var Kn=({message:e,detail:t})=>{let r=new CustomEvent(e,{detail:t,bubbles:!0});document.dispatchEvent(r)};var gt=e=>e==null;var Mn=BigInt(144e11),Yn={width:576,height:576},Vn={width:505,height:705},qn="internetcomputer.org";var be=class extends ge{env;constructor(){super()}static getInstance(){return be.instance||(be.instance=new be),be.instance}set(t){this.env=t,this.populate(t)}get(){return this.env}localIdentity(){return this.get()?.localIdentityCanisterId!==void 0}subscribe(t){let r=super.subscribe(t);return t(this.env),r}},_t=be;ar(_t,"instance");var cr=()=>typeof window<"u",Yr=()=>{let e=_t.getInstance().get()?.satelliteId??"unknown";return _t.getInstance().localIdentity()?`http://${e}.localhost:8000`:`https://${e}.icp0.io`};var Vr=({width:e,height:t})=>{if(!cr()||gt(window)||gt(window.top))return;let{top:{innerWidth:r,innerHeight:i}}=window,a=i/2+screenY-t/2,u=r/2+screenX-e/2;return`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=${e}, height=${t}, top=${a}, left=${u}`};var ur=class{#t;constructor({domain:t}){this.#t=t}get id(){return"internet_identity"}signInOptions({windowed:t}){let r=_t.getInstance().localIdentity()?`http://${_t.getInstance().get()?.localIdentityCanisterId}.localhost:8000`:`https://identity.${this.#t??qn}`;return{...t!==!1&&{windowOpenerFeatures:Vr(Yn)},identityProvider:r}}},Hn=class{#t;#e;constructor({appName:t,logoUrl:r}){this.#t=t,this.#e=r}get id(){return"nfid"}signInOptions({windowed:t}){return{...t!==!1&&{windowOpenerFeatures:Vr(Vn)},identityProvider:`https://nfid.one/authenticate/?applicationName=${encodeURI(this.#t)}&applicationLogo=${encodeURI(this.#e)}`}}};var mi=we(ii());var pr;(function(e){e[e.SysFatal=1]="SysFatal",e[e.SysTransient=2]="SysTransient",e[e.DestinationInvalid=3]="DestinationInvalid",e[e.CanisterReject=4]="CanisterReject",e[e.CanisterError=5]="CanisterError"})(pr||(pr={}));var zo=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(r[i[a]]=e[i[a]]);return r},Go=new TextEncoder().encode(`
|
|
2
2
|
ic-request`),It=class{getPrincipal(){return this._principal||(this._principal=ot.selfAuthenticating(new Uint8Array(this.getPublicKey().toDer()))),this._principal}async transformRequest(t){let{body:r}=t,i=zo(t,["body"]),a=await ae(r);return Object.assign(Object.assign({},i),{body:{content:r,sender_pubkey:this.getPublicKey().toDer(),sender_sig:await this.sign(Cn(Go,a))}})}},Xt=class{getPrincipal(){return ot.anonymous()}async transformRequest(t){return Object.assign(Object.assign({},t),{body:{content:t.body}})}};var oi=we(kn());var xr;(function(e){e.Call="call"})(xr||(xr={}));function Ye(){let e=new ArrayBuffer(16),t=new DataView(e),r=BigInt(+Date.now()),i=Math.floor(Math.random()*4294967295),a=Math.floor(Math.random()*4294967295);if(typeof t.setBigUint64=="function")t.setBigUint64(0,r);else{let u=BigInt(1)<<BigInt(32);t.setUint32(0,Number(r>>BigInt(32))),t.setUint32(4,Number(r%u))}return t.setUint32(8,i),t.setUint32(12,a),e}var Jo=BigInt(1e6),Io=BigInt(60*1e3),ce=class{constructor(t){this._value=(BigInt(Date.now())+BigInt(t)-Io)*Jo}toCBOR(){return oi.value.u64(this._value.toString(16),16)}toHash(){return Pn(this._value)}};function ai(e=Ye){return async t=>{let r=e(),i=t.request.headers?new Headers(t.request.headers):new Headers;t.request.headers=i,t.endpoint==="call"&&(t.body.nonce=e())}}var qt;(function(e){e.Received="received",e.Processing="processing",e.Replied="replied",e.Rejected="rejected",e.Unknown="unknown",e.Done="done"})(qt||(qt={}));var yr=5*60*1e3,Zo="308182301d060d2b0601040182dc7c0503010201060c2b0601040182dc7c05030201036100814c0e6ec71fab583b08bd81373c255c3c371b2e84863c98a4f1e08b74235d14fb5d9c0cd546d9685f913a0c0b2cc5341583bf4b4392e467db96d65b9bb4cb717112f8472e0d5a4d14505ffd7484b01291091c5f87b98883463f98091a0baaae",Qo="ic0.app",Do=".ic0.app",Lo="icp0.io",ta=".icp0.io",ea="icp-api.io",ra=".icp-api.io",Ve=class extends Ke{constructor(t){super(t),this.message=t}},Ae=class extends Ke{constructor(t){super(t),this.message=t}};function na(){let e;if(typeof window<"u")if(window.fetch)e=window.fetch.bind(window);else throw new Ve("Fetch implementation was not available. You appear to be in a browser context, but window.fetch was not present.");else if(typeof window<"u")if(window.fetch)e=window.fetch.bind(window);else throw new Ve("Fetch implementation was not available. You appear to be in a Node.js context, but global.fetch was not available.");else typeof self<"u"&&self.fetch&&(e=self.fetch.bind(self));if(e)return e;throw new Ve("Fetch implementation was not available. Please provide fetch to the HttpAgent constructor, or ensure it is available in the window or global context.")}var ue=class{constructor(t={}){if(this.rootKey=Fn(Zo),this._pipeline=[],this._timeDiffMsecs=0,this._rootKeyFetched=!1,this._retryTimes=3,this._isAgent=!0,t.source){if(!(t.source instanceof ue))throw new Error("An Agent's source can only be another HttpAgent");this._pipeline=[...t.source._pipeline],this._identity=t.source._identity,this._fetch=t.source._fetch,this._host=t.source._host,this._credentials=t.source._credentials}else this._fetch=t.fetch||na()||fetch.bind(window),this._fetchOptions=t.fetchOptions,this._callOptions=t.callOptions;if(t.host!==void 0)!t.host.match(/^[a-z]+:/)&&typeof window<"u"?this._host=new URL(window.location.protocol+"//"+t.host):this._host=new URL(t.host);else if(t.source!==void 0)this._host=t.source._host;else{let r=typeof window<"u"?window.location:void 0;if(!r)throw new Error("Must specify a host to connect to.");this._host=new URL(r+"")}if(t.retryTimes!==void 0&&(this._retryTimes=t.retryTimes),this._host.hostname.endsWith(Do)?this._host.hostname=Qo:this._host.hostname.endsWith(ta)?this._host.hostname=Lo:this._host.hostname.endsWith(ra)&&(this._host.hostname=ea),t.credentials){let{name:r,password:i}=t.credentials;this._credentials=`${r}${i?":"+i:""}`}this._identity=Promise.resolve(t.identity||new Xt),t.disableNonce||this.addTransform(ai(Ye))}isLocal(){let t=this._host.hostname;return t==="127.0.0.1"||t.endsWith("localhost")}addTransform(t,r=t.priority||0){let i=this._pipeline.findIndex(a=>(a.priority||0)<r);this._pipeline.splice(i>=0?i:this._pipeline.length,0,Object.assign(t,{priority:r}))}async getPrincipal(){if(!this._identity)throw new Ae("This identity has expired due this application's security policy. Please refresh your authentication.");return(await this._identity).getPrincipal()}async call(t,r,i){let a=await(i!==void 0?await i:await this._identity);if(!a)throw new Ae("This identity has expired due this application's security policy. Please refresh your authentication.");let u=ot.from(t),d=r.effectiveCanisterId?ot.from(r.effectiveCanisterId):u,m=a.getPrincipal()||ot.anonymous(),w=new ce(yr);Math.abs(this._timeDiffMsecs)>1e3*30&&(w=new ce(yr+this._timeDiffMsecs));let A={request_type:xr.Call,canister_id:u,method_name:r.methodName,arg:r.arg,sender:m,ingress_expiry:w},P=await this._transform({request:{body:null,method:"POST",headers:new Headers(Object.assign({"Content-Type":"application/cbor"},this._credentials?{Authorization:"Basic "+btoa(this._credentials)}:{}))},endpoint:"call",body:A});P=await a.transformRequest(P);let O=sr(P.body),Z=this._requestAndRetry(()=>this._fetch(""+new URL(`/api/v2/canister/${d.toText()}/call`,this._host),Object.assign(Object.assign(Object.assign({},this._callOptions),P.request),{body:O}))),[it,st]=await Promise.all([Z,ae(A)]);return{requestId:st,response:{ok:it.ok,status:it.status,statusText:it.statusText}}}async _requestAndRetry(t,r=0){if(r>this._retryTimes&&this._retryTimes!==0)throw new Error(`AgentError: Exceeded configured limit of ${this._retryTimes} retry attempts. Please check your network connection or try again in a few moments`);let i=await t();if(!i.ok){let a=await i.clone().text(),u=`Server returned an error:
|
|
3
3
|
Code: ${i.status} (${i.statusText})
|
|
4
4
|
Body: ${a}
|
|
5
5
|
`;if(this._retryTimes>r)return console.warn(u+" Retrying request."),await this._requestAndRetry(t,r+1);throw new Error(u)}return i}async query(t,r,i){let a=await(i!==void 0?await i:await this._identity);if(!a)throw new Ae("This identity has expired due this application's security policy. Please refresh your authentication.");let u=typeof t=="string"?ot.fromText(t):t,d=a?.getPrincipal()||ot.anonymous(),m={request_type:"query",canister_id:u,method_name:r.methodName,arg:r.arg,sender:d,ingress_expiry:new ce(yr)},w=await this._transform({request:{method:"POST",headers:new Headers(Object.assign({"Content-Type":"application/cbor"},this._credentials?{Authorization:"Basic "+btoa(this._credentials)}:{}))},endpoint:"read",body:m});w=await a?.transformRequest(w);let A=sr(w.body),P=await this._requestAndRetry(()=>this._fetch(""+new URL(`/api/v2/canister/${u.toText()}/query`,this._host),Object.assign(Object.assign(Object.assign({},this._fetchOptions),w.request),{body:A})));return fr(await P.arrayBuffer())}async createReadStateRequest(t,r){let i=await(r!==void 0?await r:await this._identity);if(!i)throw new Ae("This identity has expired due this application's security policy. Please refresh your authentication.");let a=i?.getPrincipal()||ot.anonymous(),u=await this._transform({request:{method:"POST",headers:new Headers(Object.assign({"Content-Type":"application/cbor"},this._credentials?{Authorization:"Basic "+btoa(this._credentials)}:{}))},endpoint:"read_state",body:{request_type:"read_state",paths:t.paths,sender:a,ingress_expiry:new ce(yr)}});return i?.transformRequest(u)}async readState(t,r,i,a){let u=typeof t=="string"?ot.fromText(t):t,d=a??await this.createReadStateRequest(r,i),m=sr(d.body),w=await this._requestAndRetry(()=>this._fetch(""+new URL(`/api/v2/canister/${u}/read_state`,this._host),Object.assign(Object.assign(Object.assign({},this._fetchOptions),d.request),{body:m})));if(!w.ok)throw new Error(`Server returned an error:
|
|
6
6
|
Code: ${w.status} (${w.statusText})
|
|
7
7
|
Body: ${await w.text()}
|
|
8
|
-
`);return fr(await w.arrayBuffer())}async syncTime(t){let r=await import("./canisterStatus-
|
|
8
|
+
`);return fr(await w.arrayBuffer())}async syncTime(t){let r=await import("./canisterStatus-PLJHSEG5.js"),i=Date.now();try{t||console.log("Syncing time with the IC. No canisterId provided, so falling back to ryjl3-tyaaa-aaaaa-aaaba-cai");let u=(await r.request({canisterId:t??ot.from("ryjl3-tyaaa-aaaaa-aaaba-cai"),agent:this,paths:["time"]})).get("time");u&&(this._timeDiffMsecs=Number(u)-Number(i))}catch(a){console.error("Caught exception while attempting to sync time:",a)}}async status(){let t=this._credentials?{Authorization:"Basic "+btoa(this._credentials)}:{},r=await this._requestAndRetry(()=>this._fetch(""+new URL("/api/v2/status",this._host),Object.assign({headers:t},this._fetchOptions)));return fr(await r.arrayBuffer())}async fetchRootKey(){return this._rootKeyFetched||(this.rootKey=(await this.status()).root_key,this._rootKeyFetched=!0),this.rootKey}invalidateIdentity(){this._identity=null}replaceIdentity(t){this._identity=Promise.resolve(t)}_transform(t){let r=Promise.resolve(t);for(let i of this._pipeline)r=r.then(a=>i(a).then(u=>u||a));return r}};var si;(function(e){e.Error="err",e.GetPrincipal="gp",e.GetPrincipalResponse="gpr",e.Query="q",e.QueryResponse="qr",e.Call="c",e.CallResponse="cr",e.ReadState="rs",e.ReadStateResponse="rsr",e.Status="s",e.StatusResponse="sr"})(si||(si={}));function Xr(){let e=typeof window>"u"&&typeof window>"u"?typeof self>"u"?void 0:self.ic.agent:window.ic.agent;if(!e)throw new Error("No Agent could be found.");return e}var mr={};Nn(mr,{backoff:()=>di,chain:()=>hi,conditionalDelay:()=>ui,defaultStrategy:()=>fi,maxAttempts:()=>oa,once:()=>ci,throttle:()=>aa,timeout:()=>li});var ia=5*60*1e3;function fi(){return hi(ui(ci(),1e3),di(1e3,1.2),li(ia))}function ci(){let e=!0;return async()=>e?(e=!1,!0):!1}function ui(e,t){return async(r,i,a)=>{if(await e(r,i,a))return new Promise(u=>setTimeout(u,t))}}function oa(e){let t=e;return async(r,i,a)=>{if(--t<=0)throw new Error(`Failed to retrieve a reply for request after ${e} attempts:
|
|
9
9
|
Request ID: ${Gt(i)}
|
|
10
10
|
Request status: ${a}
|
|
11
11
|
`)}}function aa(e){return()=>new Promise(t=>setTimeout(t,e))}function li(e){let t=Date.now()+e;return async(r,i,a)=>{if(Date.now()>t)throw new Error(`Request timed out after ${e} msec:
|