memoscan
← all memos

Memo 0xf5dd8c5f…ed4bd7 on Ethereum

0x42dcd51e…043f·#25,775,362·view on Etherscan
8,15-g-1+1,I,!0):r.set(8,15-g-1,I,!0);r.set(n-8,8,1,!0)}function Ur(r,A){const t=r.size;let n=-1,o=t-1,g=7,I=0;for(let a=t-1;a>0;a-=2)for(a===6&&a--;;){for(let c=0;c<2;c++)if(!r.isReserved(o,a-c)){let u=!1;I<A.length&&(u=(A[I]>>>g&1)===1),r.set(o,a-c,u),g--,g===-1&&(I++,g=7)}if(o+=n,o<0||t<=o){o-=n,n=-n;break}}}function Jr(r,A,t){const n=new wr;t.forEach(function(c){n.put(c.mode.bit,4),n.put(c.getLength(),Nr.getCharCountIndicator(c.mode,r)),c.write(n)});const o=wt.getSymbolTotalCodewords(r),g=Kt.getTotalCodewordsCount(r,A),I=(o-g)*8;for(n.getLengthInBits()+4<=I&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const a=(I-n.getLengthInBits())/8;for(let c=0;c<a;c++)n.put(c%2?17:236,8);return Yr(n,r,A)}function Yr(r,A,t){const n=wt.getSymbolTotalCodewords(A),o=Kt.getTotalCodewordsCount(A,t),g=n-o,I=Kt.getBlocksCount(A,t),a=n%I,c=I-a,u=Math.floor(n/I),E=Math.floor(g/I),l=E+1,f=u-E,w=new yr(f);let d=0;const y=new Array(I),J=new Array(I);let D=0;const F=new Uint8Array(r.buffer);for(let x=0;x<I;x++){const W=x<c?E:l;y[x]=F.slice(d,d+W),J[x]=w.encode(y[x]),d+=W,D=Math.max(D,W)}const N=new Uint8Array(n);let m=0,G,Y;for(G=0;G<D;G++)for(Y=0;Y<I;Y++)G<y[Y].length&&(N[m++]=y[Y][G]);for(G=0;G<f;G++)for(Y=0;Y<I;Y++)N[m++]=J[Y][G];return N}function Mr(r,A,t,n){let o;if(Array.isArray(r))o=Ut.fromArray(r);else if(typeof r=="string"){let u=A;if(!u){const E=Ut.rawSplit(r);u=rt.getBestVersionForData(E,t)}o=Ut.fromString(r,u||40)}else throw new Error("Invalid data");const g=rt.getBestVersionForData(o,t);if(!g)throw new Error("The amount of data is too big to be stored in a QR Code");if(!A)A=g;else if(A<g)throw new Error(` The chosen QR Code version cannot contain this amount of data. Minimum version required to store current data is: `+g+`. `);const I=Jr(A,t,o),a=wt.getSymbolSize(A),c=new fr(a);return mr(c,A),Fr(c),kr(c,A),Jt(c,t,0),A>=7&&Gr(c,A),Ur(c,I),isNaN(n)&&(n=xt.getBestMask(c,Jt.bind(null,c,t))),xt.applyMask(n,c),Jt(c,t,n),{modules:c,version:A,errorCorrectionLevel:t,maskPattern:n,segments:o}}He.create=function(A,t){if(typeof A>"u"||A==="")throw new Error("No input text");let n=Gt.M,o,g;return typeof t<"u"&&(n=Gt.from(t.errorCorrectionLevel,Gt.M),o=rt.from(t.version),g=xt.from(t.maskPattern),t.toSJISFunc&&wt.setToSJISFunction(t.toSJISFunc)),Mr(A,o,n,g)};var An={},ie={};(function(r){function A(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let n=t.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+t);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(g){return[g,g]}))),n.length===6&&n.push("F","F");const o=parseInt(n.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+n.slice(0,6).join("")}}r.getOptions=function(n){n||(n={}),n.color||(n.color={});const o=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,g=n.width&&n.width>=21?n.width:void 0,I=n.scale||4;return{width:g,scale:g?4:I,margin:o,color:{dark:A(n.color.dark||"#000000ff"),light:A(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},r.getScale=function(n,o){return o.width&&o.width>=n+o.margin*2?o.width/(n+o.margin*2):o.scale},r.getImageWidth=function(n,o){const g=r.getScale(n,o);return Math.floor((n+o.margin*2)*g)},r.qrToImageData=function(n,o,g){const I=o.modules.size,a=o.modules.data,c=r.getScale(I,g),u=Math.floor((I+g.margin*2)*c),E=g.margin*c,l=[g.color.light,g.color.dark];for(let f=0;f<u;f++)for(let w=0;w<u;w++){let d=(f*u+w)*4,y=g.color.light;if(f>=E&&w>=E&&f<u-E&&w<u-E){const J=Math.floor((f-E)/c),D=Math.floor((w-E)/c);y=l[a[J*I+D]?1:0]}n[d++]=y.r,n[d++]=y.g,n[d++]=y.b,n[d]=y.a}}})(ie);(function(r){const A=ie;function t(o,g,I){o.clearRect(0,0,g.width,g.height),g.style||(g.style={}),g.height=I,g.width=I,g.style.height=I+"px",g.style.width=I+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(g,I,a){let c=a,u=I;typeof c>"u"&&(!I||!I.getContext)&&(c=I,I=void 0),I||(u=n()),c=A.getOptions(c);const E=A.getImageWidth(g.modules.size,c),l=u.getContext("2d"),f=l.createImageData(E,E);return A.qrToImageData(f.data,g,c),t(l,u,E),l.putImageData(f,0,0),u},r.renderToDataURL=function(g,I,a){let c=a;typeof c>"u"&&(!I||!I.getContext)&&(c=I,I=void 0),c||(c={});const u=r.render(g,I,c),E=c.type||"image/png",l=c.rendererOpts||{};return u.toDataURL(E,l.quality)}})(An);var tn={};const Sr=ie;function Ye(r,A){const t=r.a/255,n=A+'="'+r.hex+'"';return t<1?n+" "+A+'-opacity="'+t.toFixed(2).slice(1)+'"':n}function Yt(r,A,t){let n=r+A;return typeof t<"u"&&(n+=" "+t),n}function br(r,A,t){let n="",o=0,g=!1,I=0;for(let a=0;a<r.length;a++){const c=Math.floor(a%A),u=Math.floor(a/A);!c&&!g&&(g=!0),r[a]?(I++,a>0&&c>0&&r[a-1]||(n+=g?Yt("M",c+t,.5+u+t):Yt("m",o,0),o=0,g=!1),c+1<A&&r[a+1]||(n+=Yt("h",I),I=0)):o++}return n}tn.render=function(A,t,n){const o=Sr.getOptions(t),g=A.modules.size,I=A.modules.data,a=g+o.margin*2,c=o.color.light.a?"<path "+Ye(o.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",u="<path "+Ye(o.color.dark,"stroke")+' d="'+br(I,g,o.margin)+'"/>',E='viewBox="0 0 '+a+" "+a+'"',f='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+E+' shape-rendering="crispEdges">'+c+u+`</svg> `;return typeof n=="function"&&n(null,f),f};const Rr=Zn,Ht=He,en=An,Lr=tn;function oe(r,A,t,n,o){const g=[].slice.call(arguments,1),I=g.length,a=typeof g[I-1]=="function";if(!a&&!Rr())throw new Error("Callback required as last argument");if(a){if(I<2)throw new Error("Too few arguments provided");I===2?(o=t,t=A,A=n=void 0):I===3&&(A.getContext&&typeof o>"u"?(o=n,n=void 0):(o=n,n=t,t=A,A=void 0))}else{if(I<1)throw new Error("Too few arguments provided");return I===1?(t=A,A=n=void 0):I===2&&!A.getContext&&(n=t,t=A,A=void 0),new Promise(function(c,u){try{const E=Ht.create(t,n);c(r(E,A,n))}catch(E){u(E)}})}try{const c=Ht.create(t,n);o(null,r(c,A,n))}catch(c){o(c)}}vA.create=Ht.create;vA.toCanvas=oe.bind(null,en.render);vA.toDataURL=oe.bind(null,en.renderToDataURL);vA.toString=oe.bind(null,function(r,A,t){return Lr.render(r,t)});var it;(function(r){const A=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g;function t(o){function g(I,a){return typeof a!="bigint"?a:`${a.toString()}n`}return JSON.stringify(o,g)}r.stringify=t;function n(o){const g=o.replace(A,'$1"$2n"$3');function I(a,c){return typeof c!="string"||!c.match(/^\d+n$/)?c:BigInt(c.slice(0,-1))}return JSON.parse(g,I)}r.parse=n})(it||(it={}));var cA;(function(r){function A(n){return typeof n=="string"?n:it.stringify(n)}r.stringify=A;function t(n){try{return it.parse(n)}catch{return n}}r.parse=t})(cA||(cA={}));var Tt;(function(r){function A(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}r.fromView=A})(Tt||(Tt={}));var _t,Ot;class nn extends Error{cursorOffset;cursorLength;bytesLength;#A=_t;name=this.#A.name;constructor(A,t,n){super(`Overflow reading ${n} bytes at offset ${A}/${t}`),this.cursorOffset=A,this.cursorLength=t,this.bytesLength=n}static from(A,t){return new _t(A.offset,A.length,t)}}_t=nn;class rn extends Error{cursorOffset;cursorLength;bytesLength;#A=Ot;name=this.#A.name;constructor(A,t,n){super(`Overflow writing ${n} bytes at offset ${A}/${t}`),this.cursorOffset=A,this.cursorLength=t,this.bytesLength=n}static from(A,t){return new Ot(A.offset,A.length,t)}}Ot=rn;class HA{bytes;data;offset=0;constructor(A){this.bytes=A,this.data=Tt.fromView(A)}get length(){return this.bytes.length}get remaining(){return this.length-this.offset}get before(){return this.bytes.subarray(0,this.offset)}get after(){return this.bytes.subarray(this.offset)}get(A){if(this.remaining<A)throw nn.from(this,A);return this.bytes.subarray(this.offset,this.offset+A)}read(A){const t=this.get(A);return this.offset+=A,t}set(A){if(this.remaining<A.length)throw rn.from(this,A.length);this.bytes.set(A,this.offset)}write(A){this.set(A),this.offset+=A.length}getUint8(){return this.data.getUint8(this.offset)}readUint8(){const A=this.getUint8();return this.offset++,A}setUint8(A){this.data.setUint8(this.offset,A)}writeUint8(A){this.setUint8(A),this.offset++}getInt8(){return this.data.getInt8(this.offset)}readInt8(){const A=this.getInt8();return this.offset++,A}setInt8(A){this.data.setInt8(this.offset,A)}writeInt8(A){this.setInt8(A),this.offset++}getUint16(A){return this.data.getUint16(this.offset,A)}readUint16(A){const t=this.getUint16(A);return this.offset+=2,t}setUint16(A,t){this.data.setUint16(this.offset,A,t)}writeUint16(A,t){this.setUint16(A,t),this.offset+=2}getInt16(A){return this.data.getInt16(this.offset,A)}readInt16(A){const t=this.getInt16(A);return this.offset+=2,t}setInt16(A,t){this.data.setInt16(this.offset,A,t)}writeInt16(A,t){this.setInt16(A,t),this.offset+=2}getUint24(A){return A?this.bytes[this.offset]|this.bytes[this.offset+1]<<8|this.bytes[this.offset+2]<<16:this.bytes[this.offset]<<16|this.bytes[this.offset+1]<<8|this.bytes[this.offset+2]}readUint24(A){const t=this.getUint24(A);return this.offset+=3,t}setUint24(A,t){t?(this.bytes[this.offset]=A&255,this.bytes[this.offset+1]=A>>8&255,this.bytes[this.offset+2]=A>>16&255):(this.bytes[this.offset]=A>>16&255,this.bytes[this.offset+1]=A>>8&255,this.bytes[this.offset+2]=A&255)}writeUint24(A,t){this.setUint24(A,t),this.offset+=3}getUint32(A){return this.data.getUint32(this.offset,A)}readUint32(A){const t=this.getUint32(A);return this.offset+=4,t}setUint32(A,t){this.data.setUint32(this.offset,A,t)}writeUint32(A,t){this.setUint32(A,t),this.offset+=4}getInt32(A){return this.data.getInt32(this.offset,A)}readInt32(A){const t=this.getInt32(A);return this.offset+=4,t}setInt32(A,t){this.data.setInt32(this.offset,A,t)}writeInt32(A,t){this.setInt32(A,t),this.offset+=4}getBigUint64(A){return this.data.getBigUint64(this.offset,A)}readBigUint64(A){const t=this.getBigUint64(A);return this.offset+=8,t}setBigUint64(A,t){this.data.setBigUint64(this.offset,A,t)}writeBigUint64(A,t){this.setBigUint64(A,t),this.offset+=8}getBigInt64(A){return this.data.getBigInt64(this.offset,A)}readBigInt64(A){const t=this.getBigInt64(A);return this.offset+=8,t}setBigInt64(A,t){this.data.setBigInt64(this.offset,A,t)}writeBigInt64(A,t){this.setBigInt64(A,t),this.offset+=8}getFloat16(A){return this.data.getFloat16(this.offset,A)}readFloat16(A){const t=this.getFloat16(A);return this.offset+=2,t}setFloat16(A,t){this.data.setFloat16(this.offset,A,t)}writeFloat16(A,t){this.setFloat16(A,t),this.offset+=2}getFloat32(A){return this.data.getFloat32(this.offset,A)}readFloat32(A){const t=this.getFloat32(A);return this.offset+=4,t}setFloat32(A,t){this.data.setFloat32(this.offset,A,t)}writeFloat32(A,t){this.setFloat32(A,t),this.offset+=4}getFloat64(A){return this.data.getFloat64(this.offset,A)}readFloat64(A){const t=this.getFloat64(A);return this.offset+=8,t}setFloat64(A,t){this.data.setFloat64(this.offset,A,t)}writeFloat64(A,t){this.setFloat64(A,t),this.offset+=8}}var ot;(function(r){async function A(n){const o=new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32]),g=new HA(new Uint8Array(o.length+n.length));return g.write(o),g.write(n),await crypto.subtle.importKey("pkcs8",g.bytes,"Ed25519",!0,["sign"])}r.importKey=A;async function t(n){const o=await crypto.subtle.exportKey("jwk",n);return delete o.d,delete o.key_ops,await crypto.subtle.importKey("jwk",o,"Ed25519",!0,["verify"])}r.publishKey=t})(ot||(ot={}));var gt;(function(r){function A(n){return n.toHex()}r.encode=A;function t(n){return Uint8Array.fromHex("0".repeat(n.length%2)+n)}r.decode=t})(gt||(gt={}));var vt;(function(r){r.alphabet="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function A(n){if(n.length===0)return"";let o=0;for(;o<n.length&&n[o]===0;)o++;if(o===n.length)return"1".repeat(o);let g="";for(let I=BigInt(`0x${gt.encode(n)}`);I>0n;I=I/58n)g=r.alphabet[Number(I%58n)]+g;return"1".repeat(o)+g}r.encode=A;function t(n){if(n.length===0)return new Uint8Array(0);let o=0;for(;o<n.length&&n[o]==="1";)o++;if(o===n.length)return new Uint8Array(o);let g=BigInt(0);for(let I=o;I<n.length;I++)g=g*58n+BigInt(r.alphabet.indexOf(n[I]));return gt.decode("00".repeat(o)+g.toString(16))}r.decode=t})(vt||(vt={}));var Pt;(function(r){async function A(t,n){const I={alg:"EdDSA",typ:"JWT"},a=new Uint8Array([237,1]),c=await ot.importKey(t),u=await ot.publishKey(c),E=new Uint8Array(await crypto.subtle.exportKey("raw",u)),l=new HA(new Uint8Array(a.length+E.length));l.write(a),l.write(E);const f=`did:key:z${vt.encode(l.bytes)}`,w=crypto.getRandomValues(new Uint8Array(32)).toHex(),d=Math.floor(Date.now()/1e3),y=24*60*60,J=d+y,D={iss:f,sub:w,aud:n,iat:d,exp:J},F=new TextEncoder().encode(cA.stringify(I)).toBase64({alphabet:"base64url",omitPadding:!0}),N=new TextEncoder().encode(cA.stringify(D)).toBase64({alphabet:"base64url",omitPadding:!0}),m=new TextEncoder().encode(`${F}.${N}`),Y=new Uint8Array(await crypto.subtle.sign("Ed25519",c,m)).toBase64({alphabet:"base64url",omitPadding:!0});return`${F}.${N}.${Y}`}r.sign=A})(Pt||(Pt={}));class ge{id;method;params;jsonrpc="2.0";constructor(A,t,n){this.id=A,this.method=t,this.params=n}static from(A){const{id:t,method:n,params:o}=A;return new ge(t,n,o)}toJSON(){const{jsonrpc:A,id:t,method:n,params:o}=this;return{jsonrpc:A,id:t,method:n,params:o}}}var jt;(function(r){function A(n){return Array.isArray(n)?n.map(A):n instanceof Error?{name:n.name,message:n.message,cause:A(n.cause)}:n}r.toJSON=A;function t(n){return JSON.stringify(A(n))}r.toString=t})(jt||(jt={}));var on;class yA extends Error{#A=on;name=this.#A.name;constructor(A){super(void 0,{cause:A})}}on=yA;(function(r){function A(t){return t instanceof Error?t:new r(t)}r.wrapAsError=A})(yA||(yA={}));class R{inner;constructor(A){this.inner=A}static new(A){return new R(A)}static void(){return new R(void 0)}static error(A,t){return new R(new Error(A,t))}[Symbol.dispose](){this.inner[Symbol.dispose]()}async[Symbol.asyncDispose](){await this.inner[Symbol.asyncDispose]()}isOk(){return!1}isOkAnd(A){return!1}isOkAndSync(A){return!1}isErr(){return!0}async isErrAnd(A){return await A(this.inner)}isErrAndSync(A){return A(this.inner)}get(){throw new Error}getErr(){return this.inner}getAny(){return this.inner}ok(){return new uA}err(){return new IA(this.inner)}*[Symbol.iterator](){}split(){return[void 0,this.inner]}contains(A){return!1}containsErr(A){return this.inner===A}getOrThrow(){throw this.inner}getErrOrThrow(){return this.inner}getOrNull(){return null}getErrOrNull(){return this.inner}getOr(A){return A}async getOrElse(A){return await A(this.inner)}getOrElseSync(A){return A(this.inner)}checkOrThrow(){throw this.inner}checkErrOrThrow(){return this}checkOrNull(){return null}checkErrOrNull(){return this}await(){return this}async awaitErr(){return new R(await this.inner)}async awaitAll(){return await this.awaitErr()}clear(){return this}clearErr(){return R.void()}inspect(A){return this}inspectSync(A){return this}async inspectErr(A){return await A(this.inner),this}inspectErrSync(A){return A(this.inner),this}set(A){return this}setErr(A){return new R(A)}map(A){return this}mapSync(A){return this}async mapErr(A){return new R(await A(this.inner))}mapErrSync(A){return new R(A(this.inner))}mapOr(A,t){return A}mapOrSync(A,t){return A}async mapOrElse(A,t){return await A(this.inner)}mapOrElseSync(A,t){return A(this.inner)}and(A){return this}andThen(A){return this}andThenSync(A){return this}or(A){return A}async orElse(A){return await A(this.inner)}orElseSync(A){return A(this.inner)}flatten(){return this}}class _{inner;constructor(A){this.inner=A}static new(A){return new _(A)}static void(){return new _(void 0)}[Symbol.dispose](){this.inner[Symbol.dispose]()}async[Symbol.asyncDispose](){await this.inner[Symbol.asyncDispose]()}isOk(){return!0}async isOkAnd(A){return await A(this.inner)}isOkAndSync(A){return A(this.inner)}isErr(){return!1}isErrAnd(A){return!1}isErrAndSync(A){return!1}get(){return this.inner}getErr(){throw new Error}getAny(){return this.inner}ok(){return new IA(this.inner)}err(){return new uA}*[Symbol.iterator](){yield this.inner}split(){return[this.inner,void 0]}contains(A){return this.inner===A}containsErr(A){return!1}getOrThrow(){return this.inner}getErrOrThrow(){throw this.inner}getOrNull(){return this.inner}getErrOrNull(){return null}getOr(A){return this.inner}getOrElse(A){return this.inner}getOrElseSync(A){return this.inner}checkOrThrow(){return this}checkErrOrThrow(){throw this.inner}checkOrNull(){return this}checkErrOrNull(){return null}async await(){return new _(await this.inner)}awaitErr(){return this}async awaitAll(){return await this.await()}clear(){return _.void()}clearErr(){return this}async inspect(A){return await A(this.inner),this}inspectSync(A){return A(this.inner),this}inspectErr(A){return this}inspectErrSync(A){return this}set(A){return new _(A)}setErr(A){return this}async map(A){return new _(await A(this.inner))}mapSync(A){return new _(A(this.inner))}mapErr(A){return this}mapErrSync(A){return this}async mapOr(A,t){return await t(this.inner)}mapOrSync(A,t){return t(this.inner)}async mapOrElse(A,t){return await t(this.inner)}mapOrElseSync(A,t){return t(this.inner)}and(A){return A}async andThen(A){return await A(this.inner)}andThenSync(A){return A(this.inner)}or(A){return this}orElse(A){return this}orElseSync(A){return this}flatten(){return this.inner}}var st;(function(r){function A(E){return E?_.void():R.void()}r.assert=A;async function t(E){try{return new _(await E())}catch(l){return new R(l)}}r.runAndWrap=t;function n(E){try{return new _(E())}catch(l){return new R(l)}}r.runAndWrapSync=n;async function o(E){try{return new _(await E())}catch(l){return new R(yA.wrapAsError(l))}}r.runAndWrapAsError=o;function g(E){try{return new _(E())}catch(l){return new R(yA.wrapAsError(l))}}r.runAndWrapAsErrorSync=g;async function I(E){try{return await E()}catch(l){return new R(l)}}r.runOrWrap=I;function a(E){try{return E()}catch(l){return new R(l)}}r.runOrWrapSync=a;async function c(E){try{return await E()}catch(l){return new R(yA.wrapAsError(l))}}r.runOrWrapAsError=c;function u(E){try{return E()}catch(l){return new R(yA.wrapAsError(l))}}r.runOrWrapAsErrorSync=u})(st||(st={}));class Mt extends Error{constructor(){super("Option is a None")}}class uA{inner;constructor(A=void 0){this.inner=A}static new(){return new uA}*[Symbol.iterator](){}isSome(){return!1}isSomeAnd(A){return!1}isSomeAndSync(A){return!1}isNone(){return!0}get(){throw new Mt}getOrThrow(){throw new Mt}getOrNull(){}getOr(A){return A}async getOrElse(A){return await A()}getOrElseSync(A){return A()}ok(){return new R(new Mt)}okOr(A){return new R(A)}async okOrElse(A){return new R(await A())}okOrElseSync(A){return new R(A())}filter(A){return this}filterSync(A){return this}await(){return this}contains(A){return!1}inspect(A){return this}inspectSync(A){return this}map(A){return this}mapSync(A){return this}mapOr(A,t){return A}mapOrSync(A,t){return A}async mapOrElse(A,t){return await A()}mapOrElseSync(A,t){return A()}and(A){return this}andThen(A){return this}andThenSync(A){return this}or(A){return A}async orElse(A){return await A()}orElseSync(A){return A()}xor(A){return A}zip(A){return this}}class IA{inner;constructor(A){this.inner=A}static new(A){return new IA(A)}*[Symbol.iterator](){yield this.inner}isSome(){return!0}async isSomeAnd(A){return await A(this.inner)}isSomeAndSync(A){return A(this.inner)}isNone(){return!1}get(){return this.inner}getOrThrow(){return this.inner}getOrNull(){return this.inner}getOr(A){return this.inner}getOrElse(A){return this.inner}getOrElseSync(A){return this.inner}ok(){return new _(this.inner)}okOr(A){return new _(this.inner)}okOrElse(A){return new _(this.inner)}okOrElseSync(A){return new _(this.inner)}async filter(A){return await A(this.inner)?this:new uA}filterSync(A){return A(this.inner)?this:new uA}async await(){return new IA(await this.inner)}contains(A){return this.inner===A}async inspect(A){return await A(this.inner),this}inspectSync(A){return A(this.inner),this}async map(A){return new IA(await A(this.inner))}mapSync(A){return new IA(A(this.inner))}async mapOr(A,t){return await t(this.inner)}mapOrSync(A,t){return t(this.inner)}async mapOrElse(A,t){return await t(this.inner)}mapOrElseSync(A,t){return t(this.inner)}and(A){return A}async andThen(A){return await A(this.inner)}andThenSync(A){return A(this.inner)}or(A){return this}orElse(A){return this}orElseSync(A){return this}xor(A){return A.isSome()?new uA:this}zip(A){return A.isSome()?new IA([this.inner,A.inner]):A}}var at;(function(r){function A(t){return t==null?new uA:new IA(t)}r.wrap=A})(at||(at={}));var zA,gn,sn,an,In,Bn;class U extends Error{code;message;data;#A=zA;name=this.#A.name;static codes={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603};static messages={ParseError:"Parse error",InvalidRequest:"Invalid Request",MethodNotFound:"Method not found",InvalidParams:"Invalid params",InternalError:"Internal error",ServerError:"Server error"};constructor(A,t,n=void 0){super(t),this.code=A,this.message=t,this.data=n}static from(A){const{code:t,message:n,data:o}=A;return new zA(t,n,o)}static rewrap(A){return A instanceof zA?A:new cn(jt.toString(A))}toJSON(){const{code:A,message:t,data:n}=this;return{code:A,message:t,data:n}}}zA=U;class qr extends U{#A=gn;name=this.#A.name;static code=U.codes.ParseError;static message=U.messages.ParseError;constructor(A=U.messages.ParseError){super(U.codes.ParseError,A)}}gn=qr;class se extends U{#A=sn;name=this.#A.name;static code=U.codes.InvalidRequest;static message=U.messages.InvalidRequest;constructor(A=U.messages.InvalidRequest){super(U.codes.InvalidRequest,A)}}sn=se;class xr extends U{#A=an;name=this.#A.name;static code=U.codes.MethodNotFound;static message=U.messages.MethodNotFound;constructor(A=U.messages.MethodNotFound){super(U.codes.MethodNotFound,A)}}an=xr;class Kr extends U{#A=In;name=this.#A.name;static code=U.codes.InvalidParams;static message=U.messages.InvalidParams;constructor(A=U.messages.InvalidParams){super(U.codes.InvalidParams,A)}}In=Kr;class cn extends U{#A=Bn;name=this.#A.name;static code=U.codes.InternalError;static message=U.messages.InternalError;constructor(A=U.messages.InternalError){super(U.codes.InternalError,A)}}Bn=cn;class TA extends R{id;error;jsonrpc="2.0";constructor(A,t){super(t),this.id=A,this.error=t}static from(A){return new TA(A.id,U.from(A.error))}static rewrap(A,t){return new TA(A,U.rewrap(t.inner))}toJSON(){const{jsonrpc:A,id:t}=this,n=this.error.toJSON();return{jsonrpc:A,id:t,error:n}}}class _A extends _{id;result;jsonrpc="2.0";constructor(A,t){super(t),this.id=A,this.result=t}static from(A){return new _A(A.id,A.result)}static rewrap(A,t){return new _A(A,t.inner)}toJSON(){const{jsonrpc:A,id:t,result:n}=this;return{jsonrpc:A,id:t,result:n}}}var SA;(function(r){function A(n){if("error"in n)return TA.from(n);if("result"in n)return _A.from(n);throw new Error}r.from=A;function t(n,o){return o.isOk()?_A.rewrap(n,o):TA.rewrap(n,o)}r.rewrap=t})(SA||(SA={}));var Hr=function(r,A,t){if(A!=null){if(typeof A!="object"&&typeof A!="function")throw new TypeError("Object expected.");var n,o;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=A[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=A[Symbol.dispose],t&&(o=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(g){return Promise.reject(g)}}),r.stack.push({value:A,dispose:n,async:t})}else t&&r.stack.push({async:!0});return A},Tr=function(r){return function(A){function t(I){A.error=A.hasError?new r(I,A.error,"An error was suppressed during disposal."):I,A.hasError=!0}var n,o=0;function g(){for(;n=A.stack.pop();)try{if(!n.async&&o===1)return o=0,A.st