UNPKG

@dwn-protocol/id-sdk

Version:

SDK for accessing the features and capabilities

1 lines 5.8 MB
var z7t=Object.create;var CF=Object.defineProperty;var W7t=Object.getOwnPropertyDescriptor;var Z7t=Object.getOwnPropertyNames;var $7t=Object.getPrototypeOf,X7t=Object.prototype.hasOwnProperty;var eRt=(t,e,r)=>e in t?CF(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Kh=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var xo=(t,e)=>()=>(t&&(e=t(t=0)),e);var ae=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hi=(t,e)=>{for(var r in e)CF(t,r,{get:e[r],enumerable:!0})},tke=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Z7t(e))!X7t.call(t,n)&&n!==r&&CF(t,n,{get:()=>e[n],enumerable:!(i=W7t(e,n))||i.enumerable});return t};var v=(t,e,r)=>(r=t!=null?z7t($7t(t)):{},tke(e||!t||!t.__esModule?CF(r,"default",{value:t,enumerable:!0}):r,t)),DH=t=>tke(CF({},"__esModule",{value:!0}),t);var $o=(t,e,r)=>(eRt(t,typeof e!="symbol"?e+"":e,r),r),wAe=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var Ux=(t,e,r)=>(wAe(t,e,"read from private field"),r?r.call(t):e.get(t)),dm=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},wF=(t,e,r,i)=>(wAe(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r);var Ru=(t,e,r)=>(wAe(t,e,"access private method"),r);var S=ae(()=>{(()=>{let t=globalThis.Buffer;Object.defineProperty(globalThis,"Buffer",{get(){return t},set(e){return e&&!e.prototype.writeBigUInt64BE&&(e.prototype.writeBigUInt64BE=function(r,i=0){return new DataView(this.buffer,this.byteOffset,this.byteLength).setBigUint64(i,BigInt(r),!1),i+8}),Reflect.set(globalThis,"Buffer",e)},configurable:!0})})()});var QAe=ae(SH=>{"use strict";var uri=v(S());x();SH.byteLength=rRt;SH.toByteArray=nRt;SH.fromByteArray=aRt;var gm=[],u0=[],tRt=typeof Uint8Array<"u"?Uint8Array:Array,bAe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(V3=0,rke=bAe.length;V3<rke;++V3)gm[V3]=bAe[V3],u0[bAe.charCodeAt(V3)]=V3;var V3,rke;u0["-".charCodeAt(0)]=62;u0["_".charCodeAt(0)]=63;function ike(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function rRt(t){var e=ike(t),r=e[0],i=e[1];return(r+i)*3/4-i}function iRt(t,e,r){return(e+r)*3/4-r}function nRt(t){var e,r=ike(t),i=r[0],n=r[1],o=new tRt(iRt(t,i,n)),s=0,a=n>0?i-4:i,A;for(A=0;A<a;A+=4)e=u0[t.charCodeAt(A)]<<18|u0[t.charCodeAt(A+1)]<<12|u0[t.charCodeAt(A+2)]<<6|u0[t.charCodeAt(A+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return n===2&&(e=u0[t.charCodeAt(A)]<<2|u0[t.charCodeAt(A+1)]>>4,o[s++]=e&255),n===1&&(e=u0[t.charCodeAt(A)]<<10|u0[t.charCodeAt(A+1)]<<4|u0[t.charCodeAt(A+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function oRt(t){return gm[t>>18&63]+gm[t>>12&63]+gm[t>>6&63]+gm[t&63]}function sRt(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(oRt(i));return n.join("")}function aRt(t){for(var e,r=t.length,i=r%3,n=[],o=16383,s=0,a=r-i;s<a;s+=o)n.push(sRt(t,s,s+o>a?a:s+o));return i===1?(e=t[r-1],n.push(gm[e>>2]+gm[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(gm[e>>10]+gm[e>>4&63]+gm[e<<2&63]+"=")),n.join("")}});var DAe=ae(vAe=>{var hri=v(S());x();vAe.read=function(t,e,r,i,n){var o,s,a=n*8-i-1,A=(1<<a)-1,c=A>>1,u=-7,f=r?n-1:0,p=r?-1:1,B=t[e+f];for(f+=p,o=B&(1<<-u)-1,B>>=-u,u+=a;u>0;o=o*256+t[e+f],f+=p,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=s*256+t[e+f],f+=p,u-=8);if(o===0)o=1-c;else{if(o===A)return s?NaN:(B?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-c}return(B?-1:1)*s*Math.pow(2,o-i)};vAe.write=function(t,e,r,i,n,o){var s,a,A,c=o*8-n-1,u=(1<<c)-1,f=u>>1,p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=i?0:o-1,C=i?1:-1,Q=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(A=Math.pow(2,-s))<1&&(s--,A*=2),s+f>=1?e+=p/A:e+=p*Math.pow(2,1-f),e*A>=2&&(s++,A/=2),s+f>=u?(a=0,s=u):s+f>=1?(a=(e*A-1)*Math.pow(2,n),s=s+f):(a=e*Math.pow(2,f-1)*Math.pow(2,n),s=0));n>=8;t[r+B]=a&255,B+=C,a/=256,n-=8);for(s=s<<n|a,c+=n;c>0;t[r+B]=s&255,B+=C,s/=256,c-=8);t[r+B-C]|=Q*128}});var yi=ae(Gx=>{"use strict";var pri=v(S());x();var SAe=QAe(),Tx=DAe(),nke=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Gx.Buffer=Mt;Gx.SlowBuffer=hRt;Gx.INSPECT_MAX_BYTES=50;var xH=2147483647;Gx.kMaxLength=xH;Mt.TYPED_ARRAY_SUPPORT=ARt();!Mt.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 ARt(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(Mt.prototype,"parent",{enumerable:!0,get:function(){if(Mt.isBuffer(this))return this.buffer}});Object.defineProperty(Mt.prototype,"offset",{enumerable:!0,get:function(){if(Mt.isBuffer(this))return this.byteOffset}});function xB(t){if(t>xH)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,Mt.prototype),e}function Mt(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return MAe(t)}return ake(t,e,r)}Mt.poolSize=8192;function ake(t,e,r){if(typeof t=="string")return uRt(t,e);if(ArrayBuffer.isView(t))return lRt(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(pm(t,ArrayBuffer)||t&&pm(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(pm(t,SharedArrayBuffer)||t&&pm(t.buffer,SharedArrayBuffer)))return _Ae(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return Mt.from(i,e,r);var n=fRt(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return Mt.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}Mt.from=function(t,e,r){return ake(t,e,r)};Object.setPrototypeOf(Mt.prototype,Uint8Array.prototype);Object.setPrototypeOf(Mt,Uint8Array);function Ake(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function cRt(t,e,r){return Ake(t),t<=0?xB(t):e!==void 0?typeof r=="string"?xB(t).fill(e,r):xB(t).fill(e):xB(t)}Mt.alloc=function(t,e,r){return cRt(t,e,r)};function MAe(t){return Ake(t),xB(t<0?0:RAe(t)|0)}Mt.allocUnsafe=function(t){return MAe(t)};Mt.allocUnsafeSlow=function(t){return MAe(t)};function uRt(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Mt.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=cke(t,e)|0,i=xB(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function xAe(t){for(var e=t.length<0?0:RAe(t.length)|0,r=xB(e),i=0;i<e;i+=1)r[i]=t[i]&255;return r}function lRt(t){if(pm(t,Uint8Array)){var e=new Uint8Array(t);return _Ae(e.buffer,e.byteOffset,e.byteLength)}return xAe(t)}function _Ae(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,Mt.prototype),i}function fRt(t){if(Mt.isBuffer(t)){var e=RAe(t.length)|0,r=xB(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||FAe(t.length)?xB(0):xAe(t);if(t.type==="Buffer"&&Array.isArray(t.data))return xAe(t.data)}function RAe(t){if(t>=xH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+xH.toString(16)+" bytes");return t|0}function hRt(t){return+t!=t&&(t=0),Mt.alloc(+t)}Mt.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==Mt.prototype};Mt.compare=function(e,r){if(pm(e,Uint8Array)&&(e=Mt.from(e,e.offset,e.byteLength)),pm(r,Uint8Array)&&(r=Mt.from(r,r.offset,r.byteLength)),!Mt.isBuffer(e)||!Mt.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var i=e.length,n=r.length,o=0,s=Math.min(i,n);o<s;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:n<i?1:0};Mt.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};Mt.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Mt.alloc(0);var i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;var n=Mt.allocUnsafe(r),o=0;for(i=0;i<e.length;++i){var s=e[i];if(pm(s,Uint8Array))o+s.length>n.length?Mt.from(s).copy(n,o):Uint8Array.prototype.set.call(n,s,o);else if(Mt.isBuffer(s))s.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return n};function cke(t,e){if(Mt.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||pm(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return kAe(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return gke(t).length;default:if(n)return i?-1:kAe(t).length;e=(""+e).toLowerCase(),n=!0}}Mt.byteLength=cke;function dRt(t,e,r){var i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return bRt(this,e,r);case"utf8":case"utf-8":return lke(this,e,r);case"ascii":return CRt(this,e,r);case"latin1":case"binary":return wRt(this,e,r);case"base64":return ERt(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return QRt(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}Mt.prototype._isBuffer=!0;function j3(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}Mt.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)j3(this,r,r+1);return this};Mt.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)j3(this,r,r+3),j3(this,r+1,r+2);return this};Mt.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)j3(this,r,r+7),j3(this,r+1,r+6),j3(this,r+2,r+5),j3(this,r+3,r+4);return this};Mt.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?lke(this,0,e):dRt.apply(this,arguments)};Mt.prototype.toLocaleString=Mt.prototype.toString;Mt.prototype.equals=function(e){if(!Mt.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:Mt.compare(this,e)===0};Mt.prototype.inspect=function(){var e="",r=Gx.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};nke&&(Mt.prototype[nke]=Mt.prototype.inspect);Mt.prototype.compare=function(e,r,i,n,o){if(pm(e,Uint8Array)&&(e=Mt.from(e,e.offset,e.byteLength)),!Mt.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;for(var s=o-n,a=i-r,A=Math.min(s,a),c=this.slice(n,o),u=e.slice(r,i),f=0;f<A;++f)if(c[f]!==u[f]){s=c[f],a=u[f];break}return s<a?-1:a<s?1:0};function uke(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,FAe(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=Mt.from(e,i)),Mt.isBuffer(e))return e.length===0?-1:oke(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):oke(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function oke(t,e,r,i,n){var o=1,s=t.length,a=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,a/=2,r/=2}function A(B,C){return o===1?B[C]:B.readUInt16BE(C*o)}var c;if(n){var u=-1;for(c=r;c<s;c++)if(A(t,c)===A(e,u===-1?0:c-u)){if(u===-1&&(u=c),c-u+1===a)return u*o}else u!==-1&&(c-=c-u),u=-1}else for(r+a>s&&(r=s-a),c=r;c>=0;c--){for(var f=!0,p=0;p<a;p++)if(A(t,c+p)!==A(e,p)){f=!1;break}if(f)return c}return-1}Mt.prototype.includes=function(e,r,i){return this.indexOf(e,r,i)!==-1};Mt.prototype.indexOf=function(e,r,i){return uke(this,e,r,i,!0)};Mt.prototype.lastIndexOf=function(e,r,i){return uke(this,e,r,i,!1)};function gRt(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;var o=e.length;i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(e.substr(s*2,2),16);if(FAe(a))return s;t[r+s]=a}return s}function pRt(t,e,r,i){return _H(kAe(e,t.length-r),t,r,i)}function IRt(t,e,r,i){return _H(SRt(e),t,r,i)}function yRt(t,e,r,i){return _H(gke(e),t,r,i)}function mRt(t,e,r,i){return _H(xRt(e,t.length-r),t,r,i)}Mt.prototype.write=function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-r;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return gRt(this,e,r,i);case"utf8":case"utf-8":return pRt(this,e,r,i);case"ascii":case"latin1":case"binary":return IRt(this,e,r,i);case"base64":return yRt(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return mRt(this,e,r,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}};Mt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ERt(t,e,r){return e===0&&r===t.length?SAe.fromByteArray(t):SAe.fromByteArray(t.slice(e,r))}function lke(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var o=t[n],s=null,a=o>239?4:o>223?3:o>191?2:1;if(n+a<=r){var A,c,u,f;switch(a){case 1:o<128&&(s=o);break;case 2:A=t[n+1],(A&192)===128&&(f=(o&31)<<6|A&63,f>127&&(s=f));break;case 3:A=t[n+1],c=t[n+2],(A&192)===128&&(c&192)===128&&(f=(o&15)<<12|(A&63)<<6|c&63,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:A=t[n+1],c=t[n+2],u=t[n+3],(A&192)===128&&(c&192)===128&&(u&192)===128&&(f=(o&15)<<18|(A&63)<<12|(c&63)<<6|u&63,f>65535&&f<1114112&&(s=f))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),n+=a}return BRt(i)}var ske=4096;function BRt(t){var e=t.length;if(e<=ske)return String.fromCharCode.apply(String,t);for(var r="",i=0;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=ske));return r}function CRt(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}function wRt(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function bRt(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",o=e;o<r;++o)n+=_Rt[t[o]];return n}function QRt(t,e,r){for(var i=t.slice(e,r),n="",o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}Mt.prototype.slice=function(e,r){var i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);var n=this.subarray(e,r);return Object.setPrototypeOf(n,Mt.prototype),n};function Xc(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}Mt.prototype.readUintLE=Mt.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Xc(e,r,this.length);for(var n=this[e],o=1,s=0;++s<r&&(o*=256);)n+=this[e+s]*o;return n};Mt.prototype.readUintBE=Mt.prototype.readUIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Xc(e,r,this.length);for(var n=this[e+--r],o=1;r>0&&(o*=256);)n+=this[e+--r]*o;return n};Mt.prototype.readUint8=Mt.prototype.readUInt8=function(e,r){return e=e>>>0,r||Xc(e,1,this.length),this[e]};Mt.prototype.readUint16LE=Mt.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Xc(e,2,this.length),this[e]|this[e+1]<<8};Mt.prototype.readUint16BE=Mt.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Xc(e,2,this.length),this[e]<<8|this[e+1]};Mt.prototype.readUint32LE=Mt.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Xc(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};Mt.prototype.readUint32BE=Mt.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Xc(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};Mt.prototype.readIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Xc(e,r,this.length);for(var n=this[e],o=1,s=0;++s<r&&(o*=256);)n+=this[e+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n};Mt.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Xc(e,r,this.length);for(var n=r,o=1,s=this[e+--n];n>0&&(o*=256);)s+=this[e+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};Mt.prototype.readInt8=function(e,r){return e=e>>>0,r||Xc(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};Mt.prototype.readInt16LE=function(e,r){e=e>>>0,r||Xc(e,2,this.length);var i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};Mt.prototype.readInt16BE=function(e,r){e=e>>>0,r||Xc(e,2,this.length);var i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};Mt.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Xc(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};Mt.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Xc(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};Mt.prototype.readFloatLE=function(e,r){return e=e>>>0,r||Xc(e,4,this.length),Tx.read(this,e,!0,23,4)};Mt.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Xc(e,4,this.length),Tx.read(this,e,!1,23,4)};Mt.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Xc(e,8,this.length),Tx.read(this,e,!0,52,8)};Mt.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Xc(e,8,this.length),Tx.read(this,e,!1,52,8)};function qh(t,e,r,i,n,o){if(!Mt.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}Mt.prototype.writeUintLE=Mt.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;qh(this,e,r,i,o,0)}var s=1,a=0;for(this[r]=e&255;++a<i&&(s*=256);)this[r+a]=e/s&255;return r+i};Mt.prototype.writeUintBE=Mt.prototype.writeUIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;qh(this,e,r,i,o,0)}var s=i-1,a=1;for(this[r+s]=e&255;--s>=0&&(a*=256);)this[r+s]=e/a&255;return r+i};Mt.prototype.writeUint8=Mt.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||qh(this,e,r,1,255,0),this[r]=e&255,r+1};Mt.prototype.writeUint16LE=Mt.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||qh(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};Mt.prototype.writeUint16BE=Mt.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||qh(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};Mt.prototype.writeUint32LE=Mt.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||qh(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};Mt.prototype.writeUint32BE=Mt.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||qh(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};Mt.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){var o=Math.pow(2,8*i-1);qh(this,e,r,i,o-1,-o)}var s=0,a=1,A=0;for(this[r]=e&255;++s<i&&(a*=256);)e<0&&A===0&&this[r+s-1]!==0&&(A=1),this[r+s]=(e/a>>0)-A&255;return r+i};Mt.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){var o=Math.pow(2,8*i-1);qh(this,e,r,i,o-1,-o)}var s=i-1,a=1,A=0;for(this[r+s]=e&255;--s>=0&&(a*=256);)e<0&&A===0&&this[r+s+1]!==0&&(A=1),this[r+s]=(e/a>>0)-A&255;return r+i};Mt.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||qh(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};Mt.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||qh(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};Mt.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||qh(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};Mt.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||qh(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};Mt.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||qh(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function fke(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function hke(t,e,r,i,n){return e=+e,r=r>>>0,n||fke(t,e,r,4,34028234663852886e22,-34028234663852886e22),Tx.write(t,e,r,i,23,4),r+4}Mt.prototype.writeFloatLE=function(e,r,i){return hke(this,e,r,!0,i)};Mt.prototype.writeFloatBE=function(e,r,i){return hke(this,e,r,!1,i)};function dke(t,e,r,i,n){return e=+e,r=r>>>0,n||fke(t,e,r,8,17976931348623157e292,-17976931348623157e292),Tx.write(t,e,r,i,52,8),r+8}Mt.prototype.writeDoubleLE=function(e,r,i){return dke(this,e,r,!0,i)};Mt.prototype.writeDoubleBE=function(e,r,i){return dke(this,e,r,!1,i)};Mt.prototype.copy=function(e,r,i,n){if(!Mt.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.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(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);var o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),o};Mt.prototype.fill=function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!Mt.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){var o=e.charCodeAt(0);(n==="utf8"&&o<128||n==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));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,e||(e=0);var s;if(typeof e=="number")for(s=r;s<i;++s)this[s]=e;else{var a=Mt.isBuffer(e)?e:Mt.from(e,n),A=a.length;if(A===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<i-r;++s)this[s+r]=a[s%A]}return this};var vRt=/[^+/0-9A-Za-z-_]/g;function DRt(t){if(t=t.split("=")[0],t=t.trim().replace(vRt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function kAe(t,e){e=e||1/0;for(var r,i=t.length,n=null,o=[],s=0;s<i;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function SRt(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function xRt(t,e){for(var r,i,n,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}function gke(t){return SAe.toByteArray(DRt(t))}function _H(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function pm(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function FAe(t){return t!==t}var _Rt=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var i=r*16,n=0;n<16;++n)e[i+n]=t[r]+t[n];return e}()});var MB=ae((yri,mke)=>{var mri=v(S());x();var FA=mke.exports={},Im,ym;function NAe(){throw new Error("setTimeout has not been defined")}function PAe(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Im=setTimeout:Im=NAe}catch{Im=NAe}try{typeof clearTimeout=="function"?ym=clearTimeout:ym=PAe}catch{ym=PAe}})();function pke(t){if(Im===setTimeout)return setTimeout(t,0);if((Im===NAe||!Im)&&setTimeout)return Im=setTimeout,setTimeout(t,0);try{return Im(t,0)}catch{try{return Im.call(null,t,0)}catch{return Im.call(this,t,0)}}}function kRt(t){if(ym===clearTimeout)return clearTimeout(t);if((ym===PAe||!ym)&&clearTimeout)return ym=clearTimeout,clearTimeout(t);try{return ym(t)}catch{try{return ym.call(null,t)}catch{return ym.call(this,t)}}}var _B=[],Lx=!1,z3,kH=-1;function MRt(){!Lx||!z3||(Lx=!1,z3.length?_B=z3.concat(_B):kH=-1,_B.length&&Ike())}function Ike(){if(!Lx){var t=pke(MRt);Lx=!0;for(var e=_B.length;e;){for(z3=_B,_B=[];++kH<e;)z3&&z3[kH].run();kH=-1,e=_B.length}z3=null,Lx=!1,kRt(t)}}FA.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];_B.push(new yke(t,e)),_B.length===1&&!Lx&&pke(Ike)};function yke(t,e){this.fun=t,this.array=e}yke.prototype.run=function(){this.fun.apply(null,this.array)};FA.title="browser";FA.browser=!0;FA.env={};FA.argv=[];FA.version="";FA.versions={};function kB(){}FA.on=kB;FA.addListener=kB;FA.once=kB;FA.off=kB;FA.removeListener=kB;FA.removeAllListeners=kB;FA.emit=kB;FA.prependListener=kB;FA.prependOnceListener=kB;FA.listeners=function(t){return[]};FA.binding=function(t){throw new Error("process.binding is not supported")};FA.cwd=function(){return"/"};FA.chdir=function(t){throw new Error("process.chdir is not supported")};FA.umask=function(){return 0}});var q,K,Bri,x=xo(()=>{q=v(yi()),K=v(MB()),Bri=function(t){function e(){var i=this||self;return delete t.prototype.__magic__,i}if(typeof globalThis=="object")return globalThis;if(this)return e();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:e});var r=__magic__;return r}(Object)});var Uke=ae(Pke=>{"use strict";var Hii=v(S());x();Pke.supports=function(...e){let r=e.reduce((i,n)=>Object.assign(i,n),{});return Object.assign(r,{snapshots:r.snapshots||!1,permanence:r.permanence||!1,seek:r.seek||!1,clear:r.clear||!1,getMany:r.getMany||!1,keyIterator:r.keyIterator||!1,valueIterator:r.valueIterator||!1,iteratorNextv:r.iteratorNextv||!1,iteratorAll:r.iteratorAll||!1,status:r.status||!1,createIfMissing:r.createIfMissing||!1,errorIfExists:r.errorIfExists||!1,deferredOpen:r.deferredOpen||!1,promises:r.promises||!1,streams:r.streams||!1,encodings:Object.assign({},r.encodings),events:Object.assign({},r.events),additionalMethods:Object.assign({},r.additionalMethods)})}});var AI=ae((Vii,Tke)=>{"use strict";var jii=v(S());x();Tke.exports=class extends Error{constructor(e,r){super(e||""),typeof r=="object"&&r!==null&&(r.code&&(this.code=String(r.code)),r.expected&&(this.expected=!0),r.transient&&(this.transient=!0),r.cause&&(this.cause=r.cause)),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}});var WAe=ae((Wii,Gke)=>{"use strict";var Zii=v(S());x();var zAe=null;Gke.exports=function(){return zAe===null&&(zAe={textEncoder:new TextEncoder,textDecoder:new TextDecoder}),zAe}});var XAe=ae(Lke=>{"use strict";var eni=v(S());x();var ZAe=AI(),mFt=new Set(["buffer","view","utf8"]),$Ae=class{constructor(e){if(this.encode=e.encode||this.encode,this.decode=e.decode||this.decode,this.name=e.name||this.name,this.format=e.format||this.format,typeof this.encode!="function")throw new TypeError("The 'encode' property must be a function");if(typeof this.decode!="function")throw new TypeError("The 'decode' property must be a function");if(this.encode=this.encode.bind(this),this.decode=this.decode.bind(this),typeof this.name!="string"||this.name==="")throw new TypeError("The 'name' property must be a string");if(typeof this.format!="string"||!mFt.has(this.format))throw new TypeError("The 'format' property must be one of 'buffer', 'view', 'utf8'");e.createViewTranscoder&&(this.createViewTranscoder=e.createViewTranscoder),e.createBufferTranscoder&&(this.createBufferTranscoder=e.createBufferTranscoder),e.createUTF8Transcoder&&(this.createUTF8Transcoder=e.createUTF8Transcoder)}get commonName(){return this.name.split("+")[0]}createBufferTranscoder(){throw new ZAe(`Encoding '${this.name}' cannot be transcoded to 'buffer'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createViewTranscoder(){throw new ZAe(`Encoding '${this.name}' cannot be transcoded to 'view'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createUTF8Transcoder(){throw new ZAe(`Encoding '${this.name}' cannot be transcoded to 'utf8'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}};Lke.Encoding=$Ae});var ice=ae(NH=>{"use strict";var ini=v(S());x();var{Buffer:tce}=yi()||{},{Encoding:rce}=XAe(),EFt=WAe(),SF=class extends rce{constructor(e){super({...e,format:"buffer"})}createViewTranscoder(){return new xF({encode:this.encode,decode:e=>this.decode(tce.from(e.buffer,e.byteOffset,e.byteLength)),name:`${this.name}+view`})}createBufferTranscoder(){return this}},xF=class extends rce{constructor(e){super({...e,format:"view"})}createBufferTranscoder(){return new SF({encode:e=>{let r=this.encode(e);return tce.from(r.buffer,r.byteOffset,r.byteLength)},decode:this.decode,name:`${this.name}+buffer`})}createViewTranscoder(){return this}},ece=class extends rce{constructor(e){super({...e,format:"utf8"})}createBufferTranscoder(){return new SF({encode:e=>tce.from(this.encode(e),"utf8"),decode:e=>this.decode(e.toString("utf8")),name:`${this.name}+buffer`})}createViewTranscoder(){let{textEncoder:e,textDecoder:r}=EFt();return new xF({encode:i=>e.encode(this.encode(i)),decode:i=>this.decode(r.decode(i)),name:`${this.name}+view`})}createUTF8Transcoder(){return this}};NH.BufferFormat=SF;NH.ViewFormat=xF;NH.UTF8Format=ece});var Hke=ae(t8=>{"use strict";var sni=v(S());x();var{Buffer:Tl}=yi()||{Buffer:{isBuffer:()=>!1}},{textEncoder:Kke,textDecoder:Oke}=WAe()(),{BufferFormat:_F,ViewFormat:nce,UTF8Format:qke}=ice(),PH=t=>t;t8.utf8=new qke({encode:function(t){return Tl.isBuffer(t)?t.toString("utf8"):ArrayBuffer.isView(t)?Oke.decode(t):String(t)},decode:PH,name:"utf8",createViewTranscoder(){return new nce({encode:function(t){return ArrayBuffer.isView(t)?t:Kke.encode(t)},decode:function(t){return Oke.decode(t)},name:`${this.name}+view`})},createBufferTranscoder(){return new _F({encode:function(t){return Tl.isBuffer(t)?t:ArrayBuffer.isView(t)?Tl.from(t.buffer,t.byteOffset,t.byteLength):Tl.from(String(t),"utf8")},decode:function(t){return t.toString("utf8")},name:`${this.name}+buffer`})}});t8.json=new qke({encode:JSON.stringify,decode:JSON.parse,name:"json"});t8.buffer=new _F({encode:function(t){return Tl.isBuffer(t)?t:ArrayBuffer.isView(t)?Tl.from(t.buffer,t.byteOffset,t.byteLength):Tl.from(String(t),"utf8")},decode:PH,name:"buffer",createViewTranscoder(){return new nce({encode:function(t){return ArrayBuffer.isView(t)?t:Tl.from(String(t),"utf8")},decode:function(t){return Tl.from(t.buffer,t.byteOffset,t.byteLength)},name:`${this.name}+view`})}});t8.view=new nce({encode:function(t){return ArrayBuffer.isView(t)?t:Kke.encode(t)},decode:PH,name:"view",createBufferTranscoder(){return new _F({encode:function(t){return Tl.isBuffer(t)?t:ArrayBuffer.isView(t)?Tl.from(t.buffer,t.byteOffset,t.byteLength):Tl.from(String(t),"utf8")},decode:PH,name:`${this.name}+buffer`})}});t8.hex=new _F({encode:function(t){return Tl.isBuffer(t)?t:Tl.from(String(t),"hex")},decode:function(t){return t.toString("hex")},name:"hex"});t8.base64=new _F({encode:function(t){return Tl.isBuffer(t)?t:Tl.from(String(t),"base64")},decode:function(t){return t.toString("base64")},name:"base64"})});var Vke=ae(Yke=>{"use strict";var cni=v(S());x();var Jke=AI(),TH=Hke(),{Encoding:BFt}=XAe(),{BufferFormat:CFt,ViewFormat:wFt,UTF8Format:bFt}=ice(),kF=Symbol("formats"),UH=Symbol("encodings"),QFt=new Set(["buffer","view","utf8"]),oce=class{constructor(e){if(Array.isArray(e)){if(!e.every(r=>QFt.has(r)))throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}else throw new TypeError("The first argument 'formats' must be an array");this[UH]=new Map,this[kF]=new Set(e);for(let r in TH)try{this.encoding(r)}catch(i){if(i.code!=="LEVEL_ENCODING_NOT_SUPPORTED")throw i}}encodings(){return Array.from(new Set(this[UH].values()))}encoding(e){let r=this[UH].get(e);if(r===void 0){if(typeof e=="string"&&e!==""){if(r=xFt[e],!r)throw new Jke(`Encoding '${e}' is not found`,{code:"LEVEL_ENCODING_NOT_FOUND"})}else{if(typeof e!="object"||e===null)throw new TypeError("First argument 'encoding' must be a string or object");r=vFt(e)}let{name:i,format:n}=r;if(!this[kF].has(n))if(this[kF].has("view"))r=r.createViewTranscoder();else if(this[kF].has("buffer"))r=r.createBufferTranscoder();else if(this[kF].has("utf8"))r=r.createUTF8Transcoder();else throw new Jke(`Encoding '${i}' cannot be transcoded`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"});for(let o of[e,i,r.name,r.commonName])this[UH].set(o,r)}return r}};Yke.Transcoder=oce;function vFt(t){if(t instanceof BFt)return t;let e="type"in t&&typeof t.type=="string"?t.type:void 0,r=t.name||e||`anonymous-${_Ft++}`;switch(DFt(t)){case"view":return new wFt({...t,name:r});case"utf8":return new bFt({...t,name:r});case"buffer":return new CFt({...t,name:r});default:throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}}function DFt(t){return"format"in t&&t.format!==void 0?t.format:"buffer"in t&&typeof t.buffer=="boolean"?t.buffer?"buffer":"utf8":"code"in t&&Number.isInteger(t.code)?"view":"buffer"}var SFt={binary:TH.buffer,"utf-8":TH.utf8},xFt={...TH,...SFt},_Ft=0});var fA=ae((lni,sce)=>{"use strict";var fni=v(S());x();var Yx=typeof Reflect=="object"?Reflect:null,jke=Yx&&typeof Yx.apply=="function"?Yx.apply:function(e,r,i){return Function.prototype.apply.call(e,r,i)},GH;Yx&&typeof Yx.ownKeys=="function"?GH=Yx.ownKeys:Object.getOwnPropertySymbols?GH=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:GH=function(e){return Object.getOwnPropertyNames(e)};function kFt(t){console&&console.warn&&console.warn(t)}var Wke=Number.isNaN||function(e){return e!==e};function vs(){vs.init.call(this)}sce.exports=vs;sce.exports.once=NFt;vs.EventEmitter=vs;vs.prototype._events=void 0;vs.prototype._eventsCount=0;vs.prototype._maxListeners=void 0;var zke=10;function LH(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(vs,"defaultMaxListeners",{enumerable:!0,get:function(){return zke},set:function(t){if(typeof t!="number"||t<0||Wke(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");zke=t}});vs.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};vs.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Wke(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Zke(t){return t._maxListeners===void 0?vs.defaultMaxListeners:t._maxListeners}vs.prototype.getMaxListeners=function(){return Zke(this)};vs.prototype.emit=function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var s;if(r.length>0&&(s=r[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var A=o[e];if(A===void 0)return!1;if(typeof A=="function")jke(A,this,r);else for(var c=A.length,u=rMe(A,c),i=0;i<c;++i)jke(u[i],this,r);return!0};function $ke(t,e,r,i){var n,o,s;if(LH(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),n=Zke(t),n>0&&s.length>n&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,kFt(a)}return t}vs.prototype.addListener=function(e,r){return $ke(this,e,r,!1)};vs.prototype.on=vs.prototype.addListener;vs.prototype.prependListener=function(e,r){return $ke(this,e,r,!0)};function MFt(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Xke(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=MFt.bind(i);return n.listener=r,i.wrapFn=n,n}vs.prototype.once=function(e,r){return LH(r),this.on(e,Xke(this,e,r)),this};vs.prototype.prependOnceListener=function(e,r){return LH(r),this.prependListener(e,Xke(this,e,r)),this};vs.prototype.removeListener=function(e,r){var i,n,o,s,a;if(LH(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(o=-1,s=i.length-1;s>=0;s--)if(i[s]===r||i[s].listener===r){a=i[s].listener,o=s;break}if(o<0)return this;o===0?i.shift():RFt(i,o),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};vs.prototype.off=vs.prototype.removeListener;vs.prototype.removeAllListeners=function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var o=Object.keys(i),s;for(n=0;n<o.length;++n)s=o[n],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this};function eMe(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?FFt(n):rMe(n,n.length)}vs.prototype.listeners=function(e){return eMe(this,e,!0)};vs.prototype.rawListeners=function(e){return eMe(this,e,!1)};vs.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):tMe.call(t,e)};vs.prototype.listenerCount=tMe;function tMe(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}vs.prototype.eventNames=function(){return this._eventsCount>0?GH(this._events):[]};function rMe(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function RFt(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function FFt(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function NFt(t,e){return new Promise(function(r,i){function n(s){t.removeListener(e,o),i(s)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}iMe(t,e,o,{once:!0}),e!=="error"&&PFt(t,n,{once:!0})})}function PFt(t,e,r){typeof t.on=="function"&&iMe(t,"error",e,r)}function iMe(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function n(o){i.once&&t.removeEventListener(e,n),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var oMe=ae((dni,nMe)=>{var gni=v(S());x();nMe.exports=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(t)});var MF=ae(ace=>{"use strict";var yni=v(S());x();var sMe=oMe();ace.fromCallback=function(t,e){if(t===void 0){var r=new Promise(function(i,n){t=function(o,s){o?n(o):i(s)}});t[e!==void 0?e:"promise"]=r}else if(typeof t!="function")throw new TypeError("Callback must be a function");return t};ace.fromPromise=function(t,e){if(e===void 0)return t;t.then(function(r){sMe(()=>e(null,r))}).catch(function(r){sMe(()=>e(r))})}});var OH=ae(Ace=>{"use strict";var Bni=v(S());x();Ace.getCallback=function(t,e){return typeof t=="function"?t:e};Ace.getOptions=function(t,e){return typeof t=="object"&&t!==null?t:e!==void 0?e:{}}});var rb=ae(JH=>{"use strict";var bni=v(S());x();var{fromCallback:cce}=MF(),Wd=AI(),{getOptions:uce,getCallback:aMe}=OH(),r8=Symbol("promise"),Vx=Symbol("callback"),mm=Symbol("working"),i8=Symbol("handleOne"),PB=Symbol("handleMany"),lce=Symbol("autoClose"),eb=Symbol("finishWork"),Em=Symbol("returnMany"),Z2=Symbol("closing"),RF=Symbol("handleClose"),KH=Symbol("closed"),FF=Symbol("closeCallbacks"),X2=Symbol("keyEncoding"),n8=Symbol("valueEncoding"),fce=Symbol("abortOnClose"),qH=Symbol("legacy"),hce=Symbol("keys"),dce=Symbol("values"),$2=Symbol("limit"),h0=Symbol("count"),HH=Object.freeze({}),UFt=()=>{},AMe=!1,NF=class{constructor(e,r,i){if(typeof e!="object"||e===null){let n=e===null?"null":typeof e;throw new TypeError(`The first argument must be an abstract-level database, received ${n}`)}if(typeof r!="object"||r===null)throw new TypeError("The second argument must be an options object");this[KH]=!1,this[FF]=[],this[mm]=!1,this[Z2]=!1,this[lce]=!1,this[Vx]=null,this[i8]=this[i8].bind(this),this[PB]=this[PB].bind(this),this[RF]=this[RF].bind(this),this[X2]=r[X2],this[n8]=r[n8],this[qH]=i,this[$2]=Number.isInteger(r.limit)&&r.limit>=0?r.limit:1/0,this[h0]=0,this[fce]=!!r.abortOnClose,this.db=e,this.db.attachResource(this),this.nextTick=e.nextTick}get count(){return this[h0]}get limit(){return this[$2]}next(e){let r;if(e===void 0)r=new Promise((i,n)=>{e=(o,s,a)=>{o?n(o):this[qH]?s===void 0&&a===void 0?i():i([s,a]):i(s)}});else if(typeof e!="function")throw new TypeError("Callback must be a function");return this[Z2]?this.nextTick(e,new Wd("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[mm]?this.nextTick(e,new Wd("Iterator is busy: cannot call next() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[mm]=!0,this[Vx]=e,this[h0]>=this[$2]?this.nextTick(this[i8],null):this._next(this[i8])),r}_next(e){this.nextTick(e)}nextv(e,r,i){return i=aMe(r,i),i=cce(i,r8),r=uce(r,HH),Number.isInteger(e)?(this[Z2]?this.nextTick(i,new Wd("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[mm]?this.nextTick(i,new Wd("Iterator is busy: cannot call nextv() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(e<1&&(e=1),this[$2]<1/0&&(e=Math.min(e,this[$2]-this[h0])),this[mm]=!0,this[Vx]=i,e<=0?this.nextTick(this[PB],null,[]):this._nextv(e,r,this[PB])),i[r8]):(this.nextTick(i,new TypeError("The first argument 'size' must be an integer")),i[r8])}_nextv(e,r,i){let n=[],o=(s,a,A)=>{if(s)return i(s);if(this[qH]?a===void 0&&A===void 0:a===void 0)return i(null,n);n.push(this[qH]?[a,A]:a),n.length===e?i(null,n):this._next(o)};this._next(o)}all(e,r){return r=aMe(e,r),r=cce(r,r8),e=uce(e,HH),this[Z2]?this.nextTick(r,new Wd("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[mm]?this.nextTick(r,new Wd("Iterator is busy: cannot call all() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[mm]=!0,this[Vx]=r,this[lce]=!0,this[h0]>=this[$2]?this.nextTick(this[PB],null,[]):this._all(e,this[PB])),r[r8]}_all(e,r){let i=this[h0],n=[],o=()=>{let a=this[$2]<1/0?Math.min(1e3,this[$2]-i):1e3;a<=0?this.nextTick(r,null,n):this._nextv(a,HH,s)},s=(a,A)=>{a?r(a):A.length===0?r(null,n):(n.push.apply(n,A),i+=A.length,o())};o()}[eb](){let e=this[Vx];return this[fce]&&e===null?UFt:(this[mm]=!1,this[Vx]=null,this[Z2]&&this._close(this[RF]),e)}[Em](e,r,i){this[lce]?this.close(e.bind(null,r,i)):e(r,i)}seek(e,r){if(r=uce(r,HH),!this[Z2]){if(this[mm])throw new Wd("Iterator is busy: cannot call seek() until next() has completed",{code:"LEVEL_ITERATOR_BUSY"});{let i=this.db.keyEncoding(r.keyEncoding||this[X2]),n=i.format;r.keyEncoding!==n&&(r={...r,keyEncoding:n});let o=this.db.prefixKey(i.encode(e),n);this._seek(o,r)}}}_seek(e,r){throw new Wd("Iterator does not support seek()",{code:"LEVEL_NOT_SUPPORTED"})}close(e){return e=cce(e,r8),this[KH]?this.nextTick(e):this[Z2]?this[FF].push(e):(this[Z2]=!0,this[FF].push(e),this[mm]?this[fce]&&this[eb]()(new Wd("Aborted on iterator close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this._close(this[RF])),e[r8]}_close(e){this.nextTick(e)}[RF](){this[KH]=!0,this.db.detachResource(this);let e=this[FF];this[FF]=[];for(let r of e)r()}async*[Symbol.asyncIterator](){try{let e;for(;(e=await this.next())!==void 0;)yield e}finally{this[KH]||await this.close()}}},jx=class extends NF{constructor(e,r){super(e,r,!0),this[hce]=r.keys!==!1,this[dce]=r.values!==!1}[i8](e,r,i){let n=this[eb]();if(e)return n(e);try{r=this[hce]&&r!==void 0?this[X2].decode(r):void 0,i=this[dce]&&i!==void 0?this[n8].decode(i):void 0}catch(o){return n(new tb("entry",o))}r===void 0&&i===void 0||this[h0]++,n(null,r,i)}[PB](e,r){let i=this[eb]();if(e)return this[Em](i,e);try{for(let n of r){let o=n[0],s=n[1];n[0]=this[hce]&&o!==void 0?this[X2].decode(o):void 0,n[1]=this[dce]&&s!==void 0?this[n8].decode(s):void 0}}catch(n){return this[Em](i,new tb("entries",n))}this[h0]+=r.length,this[Em](i,null,r)}end(e){return!AMe&&typeof console<"u"&&(AMe=!0,console.warn(new Wd("The iterator.end() method was renamed to close() and end() is an alias that will be removed in a future version",{code:"LEVEL_LEGACY"}))),this.close(e)}},gce=class extends NF{constructor(e,r){super(e,r,!1)}[i8](e,r){let i=this[eb]();if(e)return i(e);try{r=r!==void 0?this[X2].decode(r):void 0}catch(n){return i(new tb("key",n))}r!==void 0&&this[h0]++,i(null,r)}[PB](e,r){let i=this[eb]();if(e)return this[Em](i,e);try{for(let n=0;n<r.length;n++){let o=r[n];r[n]=o!==void 0?this[X2].decode(o):void 0}}catch(n){return this[Em](i,new tb("keys",n))}this[h0]+=r.length,this[Em](i,null,r)}},pce=class extends NF{constructor(e,r){super(e,r,!1)}[i8](e,r){let i=this[eb]();if(e)return i(e);try{r=r!==void 0?this[n8].decode(r):void 0}catch(n){return i(new tb("value",n))}r!==void 0&&this[h0]++,i(null,r)}[PB](e,r){let i=this[eb]();if(e)return this[Em](i,e);try{for(let n=0;n<r.length;n++){let o=r[n];r[n]=o!==void 0?this[n8].decode(o):void 0}}catch(n){return this[Em](i,new tb("values",n))}this[h0]+=r.length,this[Em](i,null,r)}},tb=class extends Wd{constructor(e,r){super(`Iterator could not decode ${e}`,{code:"LEVEL_DECODE_ERROR",cause:r})}};for(let t of["_ended property","_nexting property","_end method"])Object.defineProperty(jx.prototype,t.split(" ")[0],{get(){throw new Wd(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})},set(){throw new Wd(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})}});jx.keyEncoding=X2;jx.valueEncoding=n8;JH.AbstractIterator=jx;JH.AbstractKeyIterator=gce;JH.AbstractValueIterator=pce});var cMe=ae(Ice=>{"use strict";var Dni=v(S());x();var{AbstractKeyIterator:TFt,AbstractValueIterator:GFt}=rb(),o8=Symbol("iterator"),PF=Symbol("callback"),zx=Symbol("handleOne"),s8=Symbol("handleMany"),UF=class extends TFt{constructor(e,r){super(e,r),this[o8]=e.iterator({...r,keys:!0,values:!1}),this[zx]=this[zx].bind(this),this[s8]=this[s8].bind(this)}},YH=class extends GFt{constructor(e,r){super(e,r),this[o8]=e.iterator({...r,keys:!1,values:!0}),this[zx]=this[zx].bind(this),this[s8]=this[s8].bind(this)}};for(let t of[UF,YH]){let e=t===UF,r=e?i=>i[0]:i=>i[1];t.prototype._next=function(i){this[PF]=i,this[o8].next(this[zx])},t.prototype[zx]=function(i,n,o){let s=this[PF];i?s(i):s(null,e?n:o)},t.prototype._nextv=function(i,n,o){this[PF]=o,this[o8].nextv(i,n,this[s8])},t.prototype._all=function(i,n){this[PF]=n,this[o8].all(i,this[s8])},t.prototype[s8]=function(i,n){let o=this[PF];i?o(i):o(null,n.map(r))},t.prot