@ethersphere/bee-dashboard 0.35.0 → 0.35.2
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/build/assets/{__vite-browser-external-GBBpQyY6.js → __vite-browser-external-9jrN1CIx.js} +2 -2
- package/build/assets/download.browser-DkW-1Tu7.js +1 -0
- package/build/assets/{download.node-Cu2agz7Z.js → download.node-DYTXAdrY.js} +1 -1
- package/build/assets/{fs.node-C4JkI_R4.js → fs.node-DwBlG7zh.js} +2 -2
- package/build/assets/index-BWr_7okq.js +126 -0
- package/build/assets/vendor-ethers-Dmh4iz5c.js +87 -0
- package/build/index.html +2 -2
- package/lib/{App-D-bZmnQu.mjs → App-BaED7J22.mjs} +19638 -12557
- package/lib/{App-DREUIlty.js → App-C_kvJWIL.js} +19636 -12555
- package/lib/App.cjs.js +1 -1
- package/lib/App.js +1 -1
- package/lib/{download.browser-Dusbw9zM.js → download.browser-Brcsou-R.js} +1 -1
- package/lib/{download.browser-KkaXyYZj.mjs → download.browser-CuzNogtF.mjs} +1 -1
- package/lib/{download.node-CGjezvzr.js → download.node-Bnd9C4co.js} +1 -1
- package/lib/{download.node-ORcJCpF4.mjs → download.node-C_QRIakM.mjs} +1 -1
- package/lib/{fs.node-CtpSvQZh.js → fs.node-BOfQnDum.js} +1 -1
- package/lib/{fs.node-MZdoW1KI.mjs → fs.node-p28LxQ49.mjs} +1 -1
- package/lib/modules/filemanager/components/ExpiringNotificationModal/ExpiringNotificationModal.d.ts +4 -2
- package/lib/{upload.node-6Fo1eWIJ.js → upload.node-BOc26jHW.js} +3 -3
- package/lib/{upload.node-vs2hmNcN.mjs → upload.node-BsycYU0Z.mjs} +3 -3
- package/package.json +3 -3
- package/build/assets/download.browser-BISIRUf5.js +0 -1
- package/build/assets/index-wYIvDrId.js +0 -116
- package/build/assets/vendor-ethers-BjcsqZe1.js +0 -25
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import{g as Us,p as Ve,c as Nr,a as wd}from"./vendor-react-mui-Dv6xxk4a.js";var Kc={},Ad;function z8(){return Ad||(Ad=1,(function(r){var e;Object.defineProperty(r,"__esModule",{value:!0}),r.Vector=r.Cache=r.Assertions=r.Strings=r.Types=r.Objects=r.Dates=r.Promises=r.Numbers=r.System=r.Arrays=r.Random=r.Elliptic=r.Binary=r.Lock=r.Solver=r.RollingValueProvider=r.TrieRouter=r.AsyncQueue=r.PubSubChannel=r.FixedPointNumber=r.MerkleTree=r.Chunk=r.Uint8ArrayWriter=r.Uint8ArrayReader=r.AsyncLazy=r.Lazy=r.Optional=void 0;async function t(s){return new Promise((o,f)=>s.then(f,o))}async function n(s){return t(Promise.all(s.map(t)))}async function i(s,o=1){const f=qh(s,o),p=[],A=f.map(async I=>{for(const J of I)p.push(await J())});return await Promise.all(A),p}async function a(s){return new Promise(o=>setTimeout(()=>{o(!0)},s))}function c(s,o=Math.random){for(let f=s.length-1;f>0;f--){const p=Math.floor(o()*(f+1)),A=s[f];s[f]=s[p],s[p]=A}return s}function u(s){if(s.length===1)return s[0];throw Error(`Expected exactly one element, actual: ${s.length}`)}function l(s){return s.length===1?s[0]:null}function d(s){return s.length>0?s[0]:null}function h(s){if(!s.length)throw Error("Received empty array");return s[0]}function m(s,o){const f=[];for(let p=0;p<s;p++)f.push(o(p));return f}function y(s){const o=[];for(let f=0;f<s[0].length;f++){o.push([]);for(let p=0;p<s.length;p++)o[f].push(s[p][f])}return o}function E(s,o,f){const p=[];for(let A=0;A<s;A++){p.push([]);for(let I=0;I<o;I++)p[A].push(f)}return p}function O(s,o,f,p){if(f<0||p<0||p+o[0].length>s[0].length||f+o.length>s.length)return!1;for(let A=0;A<o.length;A++)for(let I=0;I<o[A].length;I++)if(o[A][I]!==void 0&&s[f+A][p+I]!==o[A][I])return!1;return!0}function R(s,o,f=Math.random){return c(hh(0,s.length-1),f).slice(0,o)}function P(s,o){return s.map(f=>f[o])}function v(s){let o=s,f=3405648695,p=3735928559;return function(){return o+=f,f^=o<<7,o*=p,p^=o<<13,o^=f^p,(o>>>0)/4294967296}}function C(s,o,f=Math.random){return Math.floor(f()*(o-s+1))+s}function N(s,o,f=Math.random){return f()*(o-s)+s}function F(){return Math.random()*2-1}function U(s,o,f){return o>=s.x&&o<s.x+s.width&&f>=s.y&&f<s.y+s.height}function V(s,o,f,p=Math.random){let A,I;do A=C(0,s-1,p),I=C(0,o-1,p);while(f&&U(f,A,I));return[A,I]}function L(s,o=Math.random){const f=Math.floor(s),p=s-f;return G(p,o)?f+1:f}function G(s,o=Math.random){return o()<s}function Q(s,o=Math.random){return s[Math.floor(s.length*o())]}function re(s,o,f=Math.random){if(o>s.length)throw new Error(`Count (${o}) is greater than array length (${s.length})`);return R(s,o,f).map(p=>s[p])}function de(s,o,f,p=Math.random){if(o>s.length)throw new Error(`Count (${o}) is greater than array length (${s.length})`);const A=[];for(;A.length<o;){const I=Q(s,p);A.some(J=>f(J,I))||A.push(I)}return A}function z(s,o,f,p,A,I=Math.random){const J=s.filter(se=>se!==o&&se!==f),le=[];for(o!==null&&le.push(o);J.length&&le.length<p;){const se=r.Random.intBetween(0,J.length-1,I);A(J[se],le)&&le.push(J[se]),J.splice(se,1)}return c(le,I),{values:le,indexOfGuaranteed:o!==null?le.indexOf(o):-1}}function we(s){if(!s.length)throw Error("Received empty array");return s[s.length-1]}function Te(s,o,f){return f(o.reduce((p,A)=>A(p),s))}function ae(s,o){return f=>Te(f,s,o)}function be(s,o,f){if(f===void 0&&(f=Math.random()),s.length!==o.length)throw new Error("Array length mismatch");let p=o.reduce((I,J)=>I+J,0);const A=f*p;for(let I=0;I<s.length-1;I++)if(p-=o[I],A>=p)return s[I];return we(s)}function Ee(s,o,f=Math.random){const p=o.map(I=>f()*I),A=[];for(let I=0;I<s.length;I++)A.push([s[I],p[I]]);return A.sort((I,J)=>J[1]-I[1]).map(I=>I[0])}function Re(s,o){if(s==null)return null;const f=o.split(".");let p=s;for(const A of f){if(p[A]===null||p[A]===void 0)return null;p=p[A]}return p}function Oe(s,o,f){const p=o.split(/\.|\[/);let A=s;for(let I=0;I<p.length;I++){const J=p[I],le=I<p.length-1&&p[I+1].includes("]"),se=J.includes("]")?J.replace(/\[|\]/g,""):J;if(I===p.length-1)return A[se]=f,f;dt(A[se])||(le?A[se]=[]:A[se]={}),A=A[se]}return f}function Ne(s,o,f=1){const p=Re(s,o)||0;return Oe(s,o,p+f),p}function X(s,o,f){return Re(s,o)||Oe(s,o,f)}function ge(s,o){const f=No(o,"."),p=dh(o,".");if(!f||!p)return;const A=Re(s,f);A&&delete A[p]}function q(s,o,f){const p=Re(s,o);if(!p)throw new Error("Key '"+o+"' does not exist.");return Oe(s,o,f),p}function Y(s,o,f){for(const p of o){const A=Re(s,p);if(A)return A}if(f){const p=Object.values(s);if(p.length)return p[0]}return null}async function ee(s,o,f){for(;;){try{await s()}catch(p){f&&f("Error in forever",p)}await a(o)}}function H(s,o){s();const f=setInterval(()=>{s()},o);return()=>clearInterval(f)}function $(){const s=globalThis.process;return s?s.browser===!0?"browser":"node":"browser"}async function ie(s,o,f,p,A,I){let J=null;for(let le=0;le<=o;le++)try{return await s()}catch(se){if(J=se,le===o)break;const Ce=f+(p-f)*(le/(o-1));A&&A("Error in withRetries, retrying",{attempt:le+1,allowedFailures:o,delayMillis:Ce,error:se}),I&&I(),await a(Ce)}throw J}function he(s){return s/1024/1024}function pe(s,o=1024){return s>=o*o*o*o?(s/o/o/o/o).toFixed(3)+" TB":s>=o*o*o?(s/o/o/o).toFixed(3)+" GB":s>=o*o?(s/o/o).toFixed(3)+" MB":s>=o?(s/o).toFixed(3)+" KB":s+" B"}function k(s){const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(s.toLowerCase());if(!o)throw new Error("Invalid hex color: "+s);return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}function D(s){return"#"+s.map(o=>o.toString(16).padStart(2,"0")).join("")}function ne(s,o,f,p){const A=s*Math.PI/180,I=f*Math.PI/180,J=(f-s)*Math.PI/180,le=(p-o)*Math.PI/180,se=Math.sin(J/2)*Math.sin(J/2)+Math.cos(A)*Math.cos(I)*Math.sin(le/2)*Math.sin(le/2);return 6371e3*(2*Math.atan2(Math.sqrt(se),Math.sqrt(1-se)))}function ye(s,o){return Math.round(s/o)*o}function Fe(s){return s>1e3?(s/1e3).toFixed(0)+" km":s>=500?ye(s,100)+" m":s>=100?ye(s,50)+" m":ye(s,10)+" m"}function Be(s){return s*(s+1)/2}function De(s){const o=s.match(/-?\d+(\.\d+)?/);if(!o)throw Error("No float found in "+s);return parseFloat(o[0])}function Ft(s,o,f=Math.random){const p=s*o,A=Math.sqrt(s*o*(1-o)),I=(f()+f()+f()+f()+f()+f()-3)*Math.SQRT2,J=Math.round(p+A*I);return Math.max(0,Math.min(s,J))}function oe(s,o){if(!s.includes("."))return s;if(parseFloat(s)===0)return"0";const[f,p]=s.split("."),A=f.replace("-",""),I=A.length;if(I>=o)return f;if(A!=="0"){const se=o-I,Ce=p.slice(0,se);return/[1-9]/.test(Ce)?`${f}.${Ce.replace(/0+$/,"")}`:f}const J=p.match(/^0*/)?.[0].length??0,le=o+J;return`${f}.${p.slice(0,le)}`}function dt(s,o=!0){return!s||o&&!It(s._readableState)||o&&s.constructor&&(s.constructor.isBuffer||s.constructor.name=="AbortController"||s.constructor.name=="AbortSignal"||s.constructor.name=="Uint8Array"||s.constructor.name==="ArrayBuffer"||s.constructor.name==="ReadableStream")?!1:typeof s=="object"}function xt(s){return dt(s)&&!Array.isArray(s)}function Xe(s){return Array.isArray(s)&&s.length===0}function nt(s){return xt(s)&&Object.keys(s).length===0}function It(s){return s===void 0}function Et(s){return Object.prototype.toString.call(s)==="[object Function]"||Object.prototype.toString.call(s)==="[object AsyncFunction]"}function it(s){return Object.prototype.toString.call(s)==="[object String]"}function Ct(s){return typeof s=="number"&&isFinite(s)}function Bt(s){return s===!0||s===!1}function Yt(s){return Object.prototype.toString.call(s)==="[object Date]"}function T(s){return!it(s)||s.trim().length===0}function b(s){return Ct(s)&&Number.isInteger(s)&&s>=1}function g(s){return it(s)&&s.match(/^-?\d+$/)!==null}function M(s){return it(s)&&s.match(/^(0x)?[0-9a-f]+$/i)!==null}const K="!@#$%^&*()_+-=[]{}|;:<>?,./",Z="!@#$%^&*()_+-=[]{}|;:<>?,./".split(""),ce="abcdefghijklmnopqrstuvwxyz",Ue="ABCDEFGHIJKLMNOPQRSTUVWXYZ",st="1234567890",Ze=ce+Ue+st,ct=Ze+K,Ke=["—","\\","東","京","都","𝖆","𝖇","𝖈","👾","🙇","💁","🙅","ᚠ","ᛇ","ᚻ","ᛦ"],Sn="0123456789abcdef";function dr(s,o=Math.random){let f="";for(let p=0;p<s;p++)f+=ce[Math.floor(o()*ce.length)];return f}function Hi(s,o=Math.random){let f="";for(let p=0;p<s;p++)f+=Ze[Math.floor(o()*Ze.length)];return f}function Oo(s,o=Math.random){let f="";for(let p=0;p<s;p++)f+=ct[Math.floor(o()*ct.length)];return f}function Fr(s,o=Math.random){let f="";for(let p=0;p<s;p++)f+=Ke[Math.floor(o()*Ke.length)];return f}function Io(s,o){const f=new RegExp(`[0-9a-f]{${o}}`,"i"),p=s.match(f);return p?p[0]:null}function S(s,o,f=Z){const p=ph(s,f);for(const A of p)if(o(A))return A;return null}function x(s,o=Math.random){let f="";for(let p=0;p<s;p++)f+=Sn[Math.floor(o()*Sn.length)];return f}function w(s,o){if(!g(s))throw new TypeError(`Expected integer string${o?.name?` for ${o.name}`:""}, got: `+s);const f=BigInt(s);if(o&&(o.min&&f<o.min||o.max&&f>o.max))throw RangeError(`Expected integer string${o?.name?` for ${o.name}`:""} in range: ${o.min??"-inf"}..${o.max??"inf"}; got: `+f);return s}function _(s,o){if(T(s))throw new TypeError(`Expected string${o?.name?` for ${o.name}`:""}, got: `+s);if(o&&(o.min!==void 0&&s.length<o.min||o.max!==void 0&&s.length>o.max))throw RangeError(`Expected string${o?.name?` for ${o.name}`:""} length in range: ${o.min??"-inf"}..${o.max??"inf"}; got: ${s.length}`);return s}function W(s,o){if(!M(s))throw new TypeError(`Expected hex string${o?.name?` for ${o.name}`:""}, got: `+s);if(o?.strictPrefix&&!s.startsWith("0x")&&!s.startsWith("0X"))throw new TypeError(`Expected hex string with 0x prefix${o?.name?` for ${o.name}`:""}, got: `+s);const f=s.replace(/^0x/i,"");if(f.length%2!==0&&!o?.uneven)throw RangeError(`Expected even number of hex digits${o?.name?` for ${o.name}`:""}; got: `+s);if(o&&o.byteLength&&f.length!==o.byteLength*2)throw RangeError(`Expected hex string${o?.name?` for ${o.name}`:""} of byte length ${o.byteLength}; got: `+f);return`0x${f}`}function te(s,o){if(!_(s,o).split("").every(f=>f==="_"||Ki(f)))throw new TypeError(`Expected safe string${o?.name?` for ${o.name}`:""}, got: `+s);return s}function ue(s,o){if(o.min!==void 0&&s<o.min||o.max!==void 0&&s>o.max)throw RangeError(`Expected value${o?.name?` for ${o.name}`:""} in range: ${o.min??"-inf"}..${o.max??"inf"}; got: ${s}`)}function je(s,o){if(!Et(s))throw new TypeError(`Expected function${o?.name?` for ${o.name}`:""}, got: `+s);return s}function at(s,o){if(Ct(s))return o&&ue(s,o),s;if(!it(s)||!s.match(/^-?\d+(\.\d+)?$/))throw new TypeError(`Expected number${o?.name?` for ${o.name}`:""}, got: `+s);const f=parseFloat(s);return o&&ue(f,o),f}function et(s,o){return Math.trunc(at(s,o))}function mt(s,o){if(s==="true")return!0;if(s==="false")return!1;if(!Bt(s))throw new TypeError(`Expected boolean${o?.name?` for ${o.name}`:""}, got: `+s);return s}function tt(s,o){if(!Yt(s))throw new TypeError(`Expected date${o?.name?` for ${o.name}`:""}, got: `+s);return s}function uw(s){return T(s)?null:s}function lw(s,o){if(!it(s))throw new TypeError(`Expected string${o?.name?` for ${o.name}`:""}, got: `+s);return s}function fw(s,o){if(b(s))return s;const f=parseInt(s,10);if(!b(f))throw new TypeError(`Expected id${o?.name?` for ${o.name}`:""}, got: `+s);return f}function hw(s,o){if(!it(s))throw new TypeError(`Expected time${o?.name?` for ${o.name}`:""}, got: `+s);const f=s.split(":");if(f.length!==2)throw new TypeError(`Expected time${o?.name?` for ${o.name}`:""}, got: `+s);const p=parseInt(f[0],10),A=parseInt(f[1],10);if(!Ct(p)||!Ct(A)||p<0||p>23||A<0||A>59)throw new TypeError(`Expected time, got${o?.name?` for ${o.name}`:""}: `+s);return`${String(p).padStart(2,"0")}:${String(A).padStart(2,"0")}`}function dw(s,o){if(!Array.isArray(s))throw new TypeError(`Expected array${o?.name?` for ${o.name}`:""}, got: `+s);return s}function Xs(s,o){if(!xt(s))throw new TypeError(`Expected object${o?.name?` for ${o.name}`:""}, got: `+s);return s}function pw(s,o){return s===null?null:Xs(s,o)}function mw(s,o){const f=Xs(s,o);for(const p of Object.keys(f))if(!it(f[p]))throw new TypeError(`Expected string map${o?.name?` for ${o.name}`:""}, got: `+s);return f}function bw(s,o){const f=Xs(s),p=Object.keys(f),A=Object.values(f);if(!p.every(it)||!A.every(Ct))throw new TypeError(`Expected numeric dictionary${o?.name?` for ${o.name}`:""}, got: `+s);return f}function oh(s){return it(s)&&s.match(/^https?:\/\/.+/)!==null}function xw(s,o){if(!oh(s))throw new TypeError(`Expected url${o?.name?` for ${o.name}`:""}, got: `+s);return s}function ch(s){return typeof s=="bigint"}function uh(s,o){if(!ch(s))throw new TypeError(`Expected bigint${o?.name?` for ${o.name}`:""}, got: `+s);if(o?.min!==void 0&&s<o?.min||o?.max!==void 0&&s>o?.max)throw RangeError(`Expected value${o?.name?` for ${o.name}`:""} in range: ${o.min??"-inf"}..${o.max??"inf"}; got: ${s}`);return s}function yw(s,o){return o==null?!0:s(o)}function gw(s,o){return o==null?null:s(o)}function ww(s,o){return o===""?void 0:s(o)}function Aw(s,o){return o==null?void 0:s(o)}function lh(s,o){for(const[f,p]of Object.entries(o))if(!p(s[f]))throw TypeError(`${f} in value does not exist or match shape`);for(const f of Object.keys(s))if(!o[f])throw TypeError(`${f} exists in value but not in shape`);return!0}function Ew(s,o){return s.every(f=>lh(f,o))}function qi(s,o="json",f=0){if(s&&Et(s.represent)){const p=s.represent();if(it(p))return o==="json"&&f===0?JSON.stringify(p):p}if(dt(s,!1)){if(f>1)return"[object Object]";if(o==="json"){if(Array.isArray(s)){const A=s.map(I=>qi(I,"json",f+1));return f===0?JSON.stringify(A):A}const p={};s.message&&(p.message=qi(s.message,"json",f+1));for(const[A,I]of Object.entries(s))p[A]=qi(I,"json",f+1);return f===0?JSON.stringify(p):p}else if(o==="key-value"){const p=Object.keys(s);return s.message&&!p.includes("message")&&p.unshift("message"),p.map(A=>`${A}=${JSON.stringify(qi(s[A],"json",f+1))}`).join(" ")}}return It(s)&&(s="undefined"),f===0?JSON.stringify(s):s}function vw(s,o){if(it(s))return s;const f=Object.keys(s);s.message&&!f.includes("message")&&f.push("message");const p=f.map(A=>`${A}: ${s[A]}`).join("; ");return o&&s.stack?p+`
|
|
2
|
-
`+s.stack:p}function On(s,o){if(xt(s)&&xt(o))for(const f in o)xt(o[f])?(s[f]||(s[f]={}),On(s[f],o[f])):Array.isArray(o[f])?s[f]=[...o[f]]:(o[f]!==null&&o[f]!==void 0||s[f]===null||s[f]===void 0)&&(s[f]=o[f]);return s}function Rw(s,o){const f={};return On(f,s),On(f,o),f}function Bw(s,o,f){const p={};return On(p,s),On(p,o),On(p,f),p}function fh(s,o){const f={};for(const p of s)for(const A of Object.keys(p))f[A]?f[A]=o(f[A],p[A]):f[A]=p[A];return f}function Tw(s){return fh(s,(o,f)=>o+f)}function Sw(s,o,f){s[o]||(s[o]=[]),s[o].push(f)}function Ow(s,o,f){for(s.unshift(o);s.length>f;)s.pop()}function Iw(s,o){let f=o%s.length;return f<0&&(f+=s.length),s[f]}function Zs(s,o){Array.prototype.push.apply(s,o)}function Cw(s,o){Array.prototype.unshift.apply(s,o)}async function Pw(s,o){const f=[];for(const p of s)f.push(await o(p));return f}function Nw(s,o){const f=[];for(let p=0;p<s.length;p++)f.push(s[p]),p<s.length-1&&(Et(o)?f.push(o()):f.push(o));return f}function kw(s,o){if(s!==o)throw Error(`Expected [${s}] to equal [${o}]`);return[s,o]}function Fw(s){if(s!==!0)throw Error(`Expected [true], got: [${s}]`);return s}function Dw(s){if(!s)throw Error(`Expected truthy value, got: [${s}]`);return s}function Uw(s){if(s!==!1)throw Error(`Expected [false], got: [${s}]`);return s}function Lw(s){if(s)throw Error(`Expected falsy value, got: [${s}]`);return s}function Mw(s,o){if(!o.includes(s))throw Error(`Expected any of [${o.join(", ")}], got: [${s}]`);return s}function _w(s,o){for(let f=0;f<s.length;f++){const p=s[f],A=o[f],I=Math.max(0,A.getTime()-Date.now());setTimeout(p,I)}}function Vw(s,o,f){return s+(o-s)*f}function Gw(s){return s.reduce((o,f)=>o+f,0)}function jw(s){return s.reduce((o,f)=>o+f,0)/s.length}function zw(s){const o=[...s].sort((p,A)=>p-A),f=Math.floor(o.length/2);return o.length%2===0?(o[f]+o[f-1])/2:o[f]}function Hw(s,o){return s-(o-1)/2}function hh(s,o){const f=[];for(let p=s;p<=o;p++)f.push(p);return f}function qw(s,o){return o.some(f=>s.includes(f))}function $w(s){return/^[\u4E00-\u9FA5]+$/.test(s)}function Co(s,o=()=>!1){return s.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").split("").map(f=>/[a-z0-9]/.test(f)||o(f)?f:"-").join("").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Kw(s){return Co(s).replaceAll("-","")}function Ww(s){return ra(s.replace(/([A-Z])/g," $1"))}function Qw(s){return s.split("-").map(ra).join(" ")}function Jw(s){return bh(s.split("-").map(ra).join(""))}function Yw(s,o=", ",f=" and "){return!s||!s.length?"":s.length===1?s[0]:s.length===2?`${s[0]}${f}${s[1]}`:`${s.slice(0,s.length-1).join(o)}${f}${s[s.length-1]}`}function Xw(s,o){return o+s.split("").join(o)+o}function Zw(s){return Co(s).replace(/-/g,"_").toUpperCase()}function ea(s,o){if(o.length===0)return 0;const f=s.toLowerCase(),p=o.toLowerCase();return s===o?1e4:f.startsWith(p)?1e4-s.length:f.includes(p)?5e3-s.length:new RegExp(".*"+p.split("").join(".*")+".*").test(f)?1e3-s.length:0}function e2(s,o){return s.filter(f=>ea(f,o)).sort((f,p)=>ea(p,o)-ea(f,o))}function t2(s){return s.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const r2={"&":"&",""":'"',"'":"'",">":">","<":"<"};function n2(s){let o=s.replace(/&#(\d+);/g,(f,p)=>String.fromCharCode(p)).replace(/&#x(\d+);/g,(f,p)=>String.fromCharCode(parseInt(p,16)));for(const[f,p]of Object.entries(r2))o=o.replaceAll(f,p);return o}function Po(s,o){const f=s.indexOf(o);return f===-1?null:s.slice(0,f)}function ta(s,o){const f=s.indexOf(o);return f===-1?null:s.slice(f+o.length)}function No(s,o){const f=s.lastIndexOf(o);return f===-1?null:s.slice(0,f)}function dh(s,o){const f=s.lastIndexOf(o);return f===-1?null:s.slice(f+o.length)}function i2(s,o,f){const p=No(s,f);return p?ta(p,o):null}function s2(s,o,f){const p=ta(s,o);return p?Po(p,f):null}function ko(s,o,f=!1){const p=f?s.lastIndexOf(o):s.indexOf(o);return p===-1?f?[null,s]:[s,null]:[s.slice(0,p),s.slice(p+o.length)]}function ph(s,o){let f=[s];for(const p of o)f=f.flatMap(A=>A.split(p));return f.filter(p=>p)}function Fo(s){const o=we(s.split(/\\|\//g)),f=o.lastIndexOf(".",o.length-1);return f<=0?"":o.slice(f+1)}function Do(s){const o=we(s.split(/\\|\//g)),f=o.lastIndexOf(".",o.length-1);return f<=0?o:o.slice(0,f)}function a2(s){let[o,f]=s.split("@");o=$i(o.replaceAll(".","").toLowerCase()).replaceAll(" ","");const[p]=o.split("+");if(!p||!f||f.indexOf(".")===-1||f.indexOf(".")===f.length-1)throw new Error("Invalid email");return f=$i(f.toLowerCase()).replaceAll(" ",""),`${p}@${f}`}function o2(s){const o=Do(s),f=Fo(s);return f?`${o}.${f}`:o}function c2(s){const o=Do(s),f=Fo(s);return{basename:o,extension:f,filename:f?`${o}.${f}`:o}}function u2(s,o=Math.random){return s.replace(/\{(.+?)\}/g,(f,p)=>Q(p.split("|"),o))}function mh(s){const o=/\{(.+?)\}/,f=s.match(o);if(!f||!f.index)return[s];const p=f[1].split(","),A=s.slice(0,f.index),I=s.slice(f.index+f[0].length);let J=[];for(const le of p){const se=mh(A+le+I);J=J.concat(se)}return J}function $i(s){return s.split(`
|
|
3
|
-
`).map(o=>o.trim().replace(/\s+/g," ")).filter(o=>o.length>0).join(`
|
|
4
|
-
`)}function ra(s){return s.charAt(0).toUpperCase()+s.slice(1)}function bh(s){return s.charAt(0).toLowerCase()+s.slice(1)}function xh(s){if(!s)return!1;const o=s.charCodeAt(0);return o>=65&&o<=90||o>=97&&o<=122}function yh(s){if(!s)return!1;const o=s.charCodeAt(0);return o>=48&&o<=57}function Ki(s){return xh(s)||yh(s)}const l2=`
|
|
5
|
-
\r.,?!:;"'\`(){}[]~@#$%^&*-+=|<>/\\`.split("");function f2(s){return l2.includes(s)}function h2(s){return Ki(s)||s==="."||s==="["||s==="]"||s==="_"}function d2(s,o,f,p,A){return s.slice(0,o)+p+s.slice(o,o+f)+A+s.slice(o+f)}function gh(s,o,f=0){const p=o.exec(s.slice(f));return p?{index:p.index,match:p[0]}:null}function wh(s,o,f=!0){if(!f)return o.every(A=>A instanceof RegExp?A.test(s):s.indexOf(A,0)!==-1);let p=0;for(const A of o)if(A instanceof RegExp){const I=gh(s,A,p);if(!I)return!1;p=I.index+I.match.length}else{const I=s.indexOf(A,p);if(I===-1)return!1;p=I+A.length}return!0}function p2(s,o,f=!0){let p=0;for(const A of o){let I=!1;for(;!I&&p<s.length;)wh(s[p],A,f)&&(I=!0),p++;if(!I)return!1}return!0}function m2(s){return s.match(/"|,/)?`"${s.replace(/"/g,'""')}"`:s}function Ah(s,o,f=0){const p=[];let A=s.indexOf(o,f);for(;A!==-1;)p.push(A),A=s.indexOf(o,A+o.length);return p}function ti(s,o,f=0){let p=-1;for(const A of o){const I=s.indexOf(A,f);I!==-1&&(p===-1||I<p)&&(p=I)}return p}function b2(s,o=0){for(let f=o;f<s.length;f++)if(f2(s[f]))return f;return-1}function x2(s,o=0){for(let f=o;f<s.length;f++)if(s[f]==="#"&&Ki(s[f+1]))return f;return-1}function Eh(s,o,f=0){return s.slice(0,f).lastIndexOf(o)}function vh(s,o=0,f="{",p="}"){let A=1;for(let I=o;I<s.length;I++)if(s.slice(I,I+p.length)===p){if(--A===0)return I}else s.slice(I,I+f.length)===f&&A++;return-1}function Rh(s,o){const f=o.wordBoundary?ti(s,[`${o.opening} `,`${o.opening}
|
|
6
|
-
`],o.start||0):s.indexOf(o.opening,o.start||0);if(f===-1)return null;const p=vh(s,f+o.opening.length,o.opening,o.closing);return p===-1?null:o.exclusive?s.slice(f+o.opening.length,p):s.slice(f,p+o.closing.length)}function y2(s,o){const f=[];let p=o.wordBoundary?ti(s,[`${o.opening} `,`${o.opening}
|
|
7
|
-
`],o.start||0):s.indexOf(o.opening,o.start||0);for(;;){if(p===-1)return f;const A=Rh(s,{...o,start:p});if(!A)return f;f.push(A),p=o.wordBoundary?ti(s,[`${o.opening} `,`${o.opening}
|
|
8
|
-
`],p+A.length):s.indexOf(o.opening,p+A.length)}}function g2(s,o,f){let p=0;for(;;){const A=r.Strings.extractBlock(s,{...f,start:p});if(!A)return s;const I=o(A);p=s.indexOf(A,p)+I.length,s=s.replace(A,I)}}function w2(s,o){const f=[];let p=0;for(;p<s.length;){const A=s.indexOf(o,p);if(A===-1){f.push({string:s.slice(p),symbol:null});break}const I=s.indexOf(o,A+o.length);if(A>p&&I!==-1&&f.push({string:s.slice(p,A),symbol:null}),I===-1){f.push({string:s.slice(p),symbol:null});break}f.push({string:s.slice(A+o.length,I),symbol:o}),p=I+o.length}return f}function A2(s){const o=[];let f=0;for(;f<s.length;){const p=x2(s,f);if(p===-1){o.push({string:s.slice(f),symbol:null});break}const A=b2(s,p+1);if(A===-1){o.push({string:s.slice(f,p),symbol:null}),o.push({string:s.slice(p+1),symbol:"#"});break}p>f&&o.push({string:s.slice(f,p),symbol:null}),o.push({string:s.slice(p+1,A),symbol:"#"}),f=A}return o}function E2(s){const o=[];let f=0;for(;f<s.length;){const p=ti(s,["http://","https://"],f);if(p===-1){o.push({string:s.slice(f),symbol:null});break}const A=ti(s,[" ",`
|
|
9
|
-
`],p);if(A===-1){p>f&&o.push({string:s.slice(f,p),symbol:null}),o.push({string:s.slice(p),symbol:"http"});break}p>f&&o.push({string:s.slice(f,p),symbol:null}),o.push({string:s.slice(p,A),symbol:"http"}),f=A}return o}const Bh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Th="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function v2(s){return Sh(s,Bh)}function R2(s){return Oh(s,Bh)}function B2(s){return Sh(s,Th)}function T2(s){return Oh(s,Th)}function Sh(s,o){const p=o.length;let A=0,I=0;const J=[];for(let le=0;le<s.length;le++){const se=s[le];if(se==="=")break;const Ce=o.indexOf(se);if(Ce===-1)throw new Error(`Invalid character: ${se}`);I=I<<Math.log2(p)|Ce,A+=Math.log2(p),A>=8&&(A-=8,J.push(I>>A&255))}return new Uint8Array(J)}function Oh(s,o){const f=o.length;let p=0,A=0,I="";for(let J=0;J<s.length;J++)for(A=A<<8|s[J],p+=8;p>=Math.log2(f);)p-=Math.log2(f),I+=o[A>>p&f-1];return p>0&&(I+=o[A<<Math.log2(f)-p&f-1]),I.length%4!==0&&(I+="=".repeat(4-I.length%4)),I}function S2(s){(s.startsWith("0x")||s.startsWith("0X"))&&(s=s.slice(2));const o=s.length/2,f=new Uint8Array(o);for(let p=0;p<o;p++){const A=parseInt(s.slice(p*2,p*2+2),16);f[p]=A}return f}function O2(s){return Array.from(s).map(o=>o.toString(16).padStart(2,"0")).join("")}function I2(s){return Array.from(s).map(o=>o.toString(2).padStart(8,"0")).join("")}function C2(s){const o=Math.ceil(s.length/8),f=new Uint8Array(o);for(let p=0;p<o;p++){const A=parseInt(s.slice(p*8,p*8+8),2);f[p]=A}return f}function P2(s,o){const f=s.split("/").filter(I=>I),p=o.split("/").filter(I=>I);if(f.length!==p.length)return null;const A={};for(let I=0;I<f.length;I++){const J=f[I];if(J.startsWith(":"))A[J.slice(1)]=p[I];else if(J!==p[I])return null}return A}function Uo(s,o,f){const p=[];for(const A of f)A!==o&&p.push(s.replace(o,A));return p}function N2(s,o,f,p=Math.random){const A=r.Arrays.shuffle(o.map(J=>({variants:r.Arrays.shuffle(J.variants.map(le=>le),p),avoid:J.avoid})),p),I=[];for(const J of A){const le=J.variants.filter(Ce=>Ce!==J.avoid),se=le.find(Ce=>s.includes(Ce));if(se&&(Zs(I,Uo(s,se,le)),I.length>=f))break}if(I.length<f)for(const J of A){const le=J.variants.find(se=>s.includes(se));if(le&&(Zs(I,Uo(s,le,J.variants)),I.length>=f))break}return I.slice(0,f)}function k2(s,o,f,p=!1){const A=new RegExp(p?`(?<=\\s|^)${o}(?=\\s|$)`:`\\b${o}\\b`,"g");return s.replace(A,f)}function F2(s,o){const f=/\b[A-Z][a-zA-Z0-9]*\b/g;return s.replace(f,p=>p.toUpperCase()===p?p:o(p))}function D2(s){return s.replace(/<[^>]*>/g,"")}function Ih(s){const o=s.lastIndexOf(" ");if(o===-1)return{line:s,rest:""};const f=s.slice(0,o),p=s.slice(o+1);return{line:f,rest:p}}function U2(s,o={}){return[...s].reduce((f,p)=>f+(o[p]||1),0)}function L2(s,o,f={}){const p=[];let A="",I=0;for(let J=0;J<s.length;J++){const le=s[J],se=f[le]||1;if(A+=le,I+=se,I>o){const{line:Ce,rest:Pt}=Ih(A);p.push(Ce),A=Pt,I=Pt.split("").map(Xt=>f[Xt]||1).reduce((Xt,ai)=>Xt+ai,0)}}return A&&p.push(A),p}function M2(s,o){const f=[];for(let p=0;p<=s.length;p++)f[p]=[p];for(let p=0;p<=o.length;p++)f[0][p]=p;for(let p=1;p<=s.length;p++)for(let A=1;A<=o.length;A++){const I=s[p-1]===o[A-1]?0:1;f[p][A]=Math.min(f[p-1][A]+1,f[p][A-1]+1,f[p-1][A-1]+I)}return f[s.length][o.length]}function Ch(s){const o=s.reduce((p,A)=>p.length<A.length?p:A);let f="";for(let p=0;p<o.length;p++){const A=o[p];if(s.every(I=>I[p]===A))f+=A;else break}return f}function _2(s){const o=Ch(s),f=o.lastIndexOf("/");return f===-1?"":o.slice(0,f+1)}function Lo(s,o){return new RegExp(`\\b${o}\\b`).test(s)}function V2(s,o,f){return f==="any"?o.some(p=>Lo(s,p)):o.every(p=>Lo(s,p))}function G2(s){const o={},f=s.match(/([a-z\-]+)="([^"]+)"/g);if(f)for(const p of f){const[A,I]=ko(p,"=");o[A]=I.slice(1,I.length-1)}return o}function Wi(s,o,f=[]){let p="";for(;o<s.length&&(Ki(s[o])||f.includes(s[o]));)p+=s[o++];return p}function j2(s,o,f=[]){const p=Ah(s,o),A=[];for(const I of p)A.push(Wi(s,I+o.length,f));return A}function z2(s,o,f="$",p=":"){for(const A in o)s=Ph(s,A,o[A],f,p);return s=Nh(s),s}function Ph(s,o,f,p="$",A=":"){if(f==="")return s;let I=s.indexOf(`${p}${o}`);for(;I!==-1;){if(s[I+o.length+1]===A)if(s[I+o.length+2]===A)s=s.replace(`${p}${o}${A}${A}`,f);else{const J=Wi(s,I+o.length+2,["_"]);s=s.replace(`${p}${o}${A}${J}`,f)}else s=s.replace(`${p}${o}`,f);I=s.indexOf(`${p}${o}`,I+f.length)}return s}function Nh(s,o="$",f=":"){let p=s.indexOf(o);for(;p!==-1;){const A=Wi(s,p+1);if(s[p+A.length+1]===f)if(s[p+A.length+2]===f)s=s.replace(`${o}${A}${f}${f}`,"");else{const I=Wi(s,p+A.length+2);s=s.replace(`${o}${A}${f}${I}`,I)}p=s.indexOf(o,p+1)}return s}function H2(s,o){let f=s.indexOf("](");for(;f!==-1;){const p=Eh(s,"[",f),A=s.indexOf(")",f);if(p!==-1&&A!==-1){const[I,J]=s.slice(p+1,A).split("]("),le=o(I,J);s=s.slice(0,p)+le+s.slice(A+1)}f=s.indexOf("](",f+1)}return s}function kh(s,o=!0){const f=Object.entries(s).filter(([p,A])=>A!=null).map(([p,A])=>`${p}=${encodeURIComponent(A)}`).join("&");return f?(o?"?":"")+f:""}function q2(s){const o={},f=s.split("&");for(const p of f){const[A,I]=p.split("=");A&&I&&(o[A]=decodeURIComponent(I))}return o}function $2(s,o){return Object.prototype.hasOwnProperty.call(s,o)}function K2(s,o){let f=null,p=-1/0;for(const[A,I]of Object.entries(s)){const J=o(I);J>p&&(p=J,f=A)}return f?[f,s[f]]:null}function W2(s,o,f,p){const A=s.find(J=>J[o]===f),I=s.find(J=>J[o]===f+p);A&&I?(A[o]=f+p,I[o]=f):A&&(A[o]=f+p),s.sort((J,le)=>at(J[o])-at(le[o])),s.forEach((J,le)=>J[o]=le+1)}function Q2(s){const o=Object.keys(s);if(o.length===1)return s[o[0]];throw new Error("Expected object to have a single key")}function J2(s,o=":"){return Object.fromEntries(s.map(f=>ko(f,o)).map(f=>f[0]&&f[1]?[$i(f[0]),$i(f[1])]:null).filter(f=>f))}function Y2(s,o){if(!s)return!1;const f=s.message;return typeof f=="string"&&f.includes(o)}function X2(s,o,f){return Lh([s,o])+kh(f||{})}function Z2(s,o=",",f='"'){const p=[];let A="",I=!1;const J=s.split("");for(const le of J)le===o&&!I?(p.push(A),A=""):le===f&&(!A&&!I||I)?I=!I:A+=le;return p.push(A),p}function eA(s){return`[${Math.floor(s.progress*100)}%] ${na(s.deltaMs)} out of ${na(s.totalTimeMs)} (${na(s.remainingTimeMs)} left) [${Math.round(s.baseTimeMs)} ms each]`}async function tA(s,o){let f=o.requiredConsecutivePasses||1,p=0;for(let A=0;A<o.attempts;A++){try{if(await s()){if(p++,p>=f)return}else p=0}catch{p=0}A<o.attempts-1&&await a(o.waitMillis)}throw Error("Timed out waiting for predicate")}function rA(s,o){const f=[];for(let p=s.length-1;p>=0;p--)o(s[p])&&f.push(s.splice(p,1)[0]);return f}function nA(s){return JSON.parse(JSON.stringify(s))}function iA(s){return Math.ceil((s||Date.now())/1e3)}function sA(s){return(s||new Date).toISOString().slice(0,10)}function aA(s){return(s||new Date).toISOString().slice(0,19).replace(/T|:/g,"-")}function oA(s){const o=new Date(s);return new Date(o.getTime()-o.getTimezoneOffset()*6e4)}function cA(s){return new Date(s)}function Dr(s){return String(Math.floor(s)).padStart(2,"0")}function uA(s){let[o,f]=s.split(":");Ct(parseInt(o,10))||(o="0"),Ct(parseInt(f,10))||(f="0");let p=Go(et(o),0,23),A=Go(et(f),0,59);return`${Dr(p)}:${Dr(A)}`}function na(s){const o=Math.floor(s/36e5);s=s%36e5;const f=Math.floor(s/6e4);s=s%6e4;const p=Math.floor(s/1e3);return o?`${Dr(o)}:${Dr(f)}:${Dr(p)}`:`${Dr(f)}:${Dr(p)}`}function In(s){return Math.floor((Yt(s)?s.getTime():s)/864e5)}const lA={today:(s,o)=>Dr(s)+":"+Dr(o),yesterday:()=>"Yesterday",monday:()=>"Mon",tuesday:()=>"Tue",wednesday:()=>"Wed",thursday:()=>"Thu",friday:()=>"Fri",saturday:()=>"Sat",sunday:()=>"Sun",weeks:s=>`${s}w`};function fA(s,o){const f=new Date(o?.now||Date.now()),p=o?.labels||lA,A=Yt(s)?s:new Date(s);if(In(f)===In(A))return p.today(A.getUTCHours(),A.getUTCMinutes(),A.getUTCHours()>12);if(In(f)-In(A)===1)return p.yesterday();const I=_o(A);return In(f)-In(A)<7?p[I.day]():p.weeks(Math.round((f.getTime()-A.getTime())/6048e5))}const Fh={now:()=>"A few seconds",seconds:s=>`${s} seconds`,minutes:s=>`${s} minutes`,hours:s=>`${s} hours`,days:s=>`${s} days`,weeks:s=>`${s} weeks`};function Dh(s,o){const f=o?.now??Date.now(),p=o?.labels||Fh,A=r.Types.isDate(s)?s.getTime():s;let I=(f-A)/1e3;return I<10?p.now():I<120?p.seconds(Math.floor(I)):(I/=60,I<120?p.minutes(Math.floor(I)):(I/=60,I<48?p.hours(Math.floor(I)):(I/=24,I<14?p.days(Math.floor(I)):(I/=7,p.weeks(Math.floor(I))))))}function hA(s,o=Fh){return Dh(0,{now:s*1e3,labels:o})}function dA(s,o,f){const p=(f?.now??Date.now())-s,A=Math.floor(p/o),I=o/(f?.precision??1)-Math.ceil(p%o/(f?.precision??1));return{cycles:A,remaining:I}}const Mo={};function pA(s,o){return!Mo[s]||Date.now()>Mo[s]?(Mo[s]=Date.now()+o,!0):!1}const mA={s:1e3,m:6e4,h:36e5,d:864e5};function bA(s,o,f){return o=Yt(o)?o.getTime():o,f=f?Yt(f)?f.getTime():f:Date.now(),(f-o)/mA[s]}function xA(s,o,f,p){p||(p=Date.now());const A=o/f,I=p-s,J=I/o,le=J*f,se=le-I;return{deltaMs:I,progress:A,baseTimeMs:J,totalTimeMs:le,remainingTimeMs:se}}const yA={0:"sunday",1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday"};function Uh(s){return{zeroBasedIndex:s,day:yA[s]}}function _o(s){return Uh(s.getDay())}function gA(s){return _o(new Date(s))}function wA(s){return s*1e3}function AA(s){return s*6e4}function EA(s){return s*36e5}function vA(s){return s*864e5}const RA={ms:1,milli:1,millis:1,millisecond:1,milliseconds:1,s:1e3,sec:1e3,second:1e3,seconds:1e3,m:6e4,min:6e4,minute:6e4,minutes:6e4,h:36e5,hour:36e5,hours:36e5,d:864e5,day:864e5,days:864e5,w:6048e5,week:6048e5,weeks:6048e5,month:2592e6,months:2592e6,y:31536e6,year:31536e6,years:31536e6};function BA(s){const o=parseFloat(s);if(isNaN(o))throw Error("makeDate got NaN for input");const f=s.replace(/^-?[0-9.]+/,"").trim().toLowerCase(),p=f===""?1:RA[f];if(!p)throw Error(`Unknown unit: "${f}"`);return Math.ceil(o*p)}const TA={b:0,byte:0,bytes:0,kb:1,kilobyte:1,kilobytes:1,mb:2,megabyte:2,megabytes:2,gb:3,gigabyte:3,gigabytes:3,tb:4,terabyte:4,terabytes:4};function SA(s,o=1024){const f=parseFloat(s);if(isNaN(f))throw Error("makeStorage got NaN for input");const p=s.replace(/^-?[0-9.]+/,"").trim().toLowerCase(),A=p===""?0:TA[p];if(A==null)throw Error(`Unknown unit: "${p}"`);return Math.ceil(f*o**A)}function OA(s){return s.replace(/ +/g," ").replace(/^ /gm,"")}const ri=new Map;async function IA(s,o,f){const p=Date.now(),A=ri.get(s);if(A&&A.validUntil>p)return A.value;const I=await f(),J=p+o;return ri.set(s,{value:I,validUntil:J}),I}function CA(s){ri.delete(s)}function PA(){const s=Date.now();for(const[o,f]of ri.entries())f.validUntil<=s&&ri.delete(o)}function NA(){return ri.size}function Lh(s,o=!1){s=s.filter(I=>I),o&&it(s[1])&&(s[1]="../"+s[1]);let f="";it(s[0])&&s[0].includes("://")&&(f=Po(s[0],"://")??"",s[0]=ta(s[0],"://")??"");const p=s.map(I=>String(I)).flatMap(I=>I.split("/")),A=[];for(let I=0;I<p.length;I++)p[I]!=="."&&(p[I]===".."?(!f||A.length>1)&&A.pop():A.push(p[I]));return(f?f+"://":"")+A.join("/").replaceAll(/\/{2,}/g,"/")}function kA(s,o,f,p,A=!0){const I=s.indexOf(o),J=s.indexOf(f,I+o.length);if(I===-1||J===-1)throw Error("Start or end not found");return A?s.substring(0,I+o.length)+p+s.substring(J):s.substring(0,I)+p+s.substring(J+f.length)}function FA(s){let o="p";s.startsWith("#")?(o="h1",s=s.slice(1).trim()):s.startsWith("-")&&(o="li",s=s.slice(1).trim());const f=s[0]===s[0].toUpperCase(),p=/[.?!]$/.test(s),A=/:$/.test(s);return{type:o,isCapitalized:f,hasPunctuation:p,endsWithColon:A}}function DA(s,o="(",f=")"){let p=0,A=0;for(;A<s.length;)if(s.startsWith(o,A)?(p++,A+=o.length):s.startsWith(f,A)?(p--,A+=f.length):A++,p<0)return!1;return o===f?p%2===0:p===0}function UA(s){s=s.normalize("NFD").replace(/[\u0300-\u036f]/g,"");let o=s.length;for(;s=s.replace(/(\w+)[\s,']+\w+/g,"$1"),s.length!==o;)o=s.length;return s=s.replaceAll(/[A-Z][a-zA-Z0-9]*/g,"A"),s=s.replaceAll(/[a-z][a-zA-Z0-9]*/g,"a"),s=s.replaceAll(/[\u4E00-\u9FA5]+/g,"Z"),s}function Mh(s){const o=Object.keys(s).sort((p,A)=>p.localeCompare(A)),f={};for(const p of o)f[p]=Cn(s[p]);return f}function _h(s){const o=[];return s.sort((f,p)=>JSON.stringify(Cn(f)).localeCompare(JSON.stringify(Cn(p)))).forEach(f=>o.push(Cn(f))),o}function Cn(s){return Array.isArray(s)?_h(s):dt(s)?Mh(s):s}function Vh(s,o){return JSON.stringify(Cn(s))===JSON.stringify(Cn(o))}function LA(...s){for(let o=1;o<s.length;o++)if(!Vh(s[o-1],s[o]))return!1;return!0}function MA(s){try{return JSON.parse(s)}catch{return null}}function _A(){let s=0;return{next:()=>s++}}function VA(s){let o=0;return{next:()=>s[o++%s.length]}}function GA(s){let o;return f=>{const p=f===s&&o!==s;return o=f,p}}function jA(s,o,f,p,A){const I={};for(const J of Object.keys(o))I[J]=[];I[p]=[],A&&(s=s.sort(A));for(const J of s){const le=J[f],se=o[le]?le:p;I[se].length>=o[se]?I[p].push(J):I[se].push(J)}return I}function zA(s,o){const f=Object.keys(s),p=Object.keys(o);return{uniqueToA:f.filter(A=>!p.includes(A)),uniqueToB:p.filter(A=>!f.includes(A))}}function Gh(s){const o=Object.keys(s);return o[Math.floor(Math.random()*o.length)]}function HA(s,o){const f=Gh(s);return s[f]=o(s[f]),f}function qA(s){return s=s.replace(/\r\n/g,`
|
|
10
|
-
`),s=s.replace(/(\w+)\((.+)\)/g,(o,f,p)=>`${f}(${p.replaceAll(",",",")})`),s=s.replace(/(,)(\s+})/g,"$2"),s=s.replace(/\.\.\..+?,/g,""),s=s.replace(/({\s+)([a-zA-Z]\w+),/g,"$1$2: '$2',"),s=s.replace(/(,\s+)([a-zA-Z]\w+),/g,"$1$2: '$2',"),s=s.replace(/:(.+)\?(.+):/g,(o,f,p)=>`: (${f.trim()} && ${p.trim()}) ||`),s=s.replace(/([a-zA-Z0-9]+)( ?: ?{)/g,'"$1"$2'),s=s.replace(/([a-zA-Z0-9]+) ?: ?(.+?)(,|\n|})/g,(o,f,p,A)=>`"${f}":"${p.trim()}"${A}`),s=s.replace(/("'|'")/g,'"'),s=s.replaceAll(",",","),JSON.parse(s)}const un=[1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24,1e27,1e30,1e9,1e16,1e18,1e18,1e18,1e33],$A=["thousand","million","billion","trillion","quadrillion","quintillion","sextillion","septillion","octillion","nonillion","gwei","bzz","btc","eth","dai","decillion"],jh=["K","M","B","T","Qa","Qi","Sx","Sp","O","N","gwei","bzz","eth","btc","dai","D"];function KA(s,o,f){let p=s.length-o;if(p<=0)return"0."+"0".repeat(-p)+s+(f?" "+f:"");let A=s.substring(0,p),I=s.substring(p);return A===""&&(A="0"),A+"."+I+(f?" "+f:"")}function WA(s,o){const f=o?.longForm??!1,p=o?.unit?` ${o.unit}`:"",A=f?$A:jh,I=o?.precision??1;if(s<un[0])return`${s}${p}`;for(let J=0;J<un.length-1;J++)if(s<un[J+1])return`${(s/un[J]).toFixed(I)}${f?" ":""}${A[J]}${p}`;return`${(s/un[un.length-1]).toFixed(I)}${f?" ":""}${A[un.length-1]}${p}`}function Vo(s){const o=parseFloat(s);if(isNaN(o))throw Error("makeNumber got NaN for input");const f=s.replace(/^-?[0-9.]+/,"").trim(),p=jh.findIndex(A=>A.toLowerCase()===f.toLowerCase());return p===-1?o:o*un[p]}function Go(s,o,f){return s<o?o:s>f?f:s}function QA(s,o,f){const p=s+o;return p>f?f:p}function JA(s,o,f){const p=s-o;return p<f?f:p}function YA(s,o){return o(s),s}function XA(s,o){s&&o(s)}function ZA(s,o){const f=Object.keys(o);for(const p of f)Array.isArray(o[p])&&Array.isArray(s[p])&&Zs(s[p],o[p])}function e3(s){return s.splice(0,s.length),s}function t3(s){for(const o of Object.keys(s))(Xe(s[o])||Array.isArray(s[o])&&s[o].every(f=>f==null))&&delete s[o];return s}function r3(s){for(const o of Object.entries(s))(o[1]===null||o[1]===void 0||it(o[1])&&T(o[1]))&&delete s[o[0]];return s}function n3(s,o){const f={};for(const[p,A]of Object.entries(s))o(p)&&(f[p]=A);return f}function i3(s,o){const f={};for(const[p,A]of Object.entries(s))o(A)&&(f[p]=A);return f}function s3(s,o){const f={};for(const p of Object.entries(s))f[p[0]]=o(p[1]);return f}function a3(s,o){const f=[];let p=0;for(const A of s)f.push(o(A,p++));return f}async function o3(s,o){try{return await s()}catch{throw o}}function c3(s,o,f){f!=null&&(s[o]=f)}function u3(s,o,f,p){const A=Re(f,p);A!=null&&Oe(s,o,A)}function l3(s){const o={};for(const[f,p]of Object.entries(s))o[p]=f;return o}function f3(s){const o=Object.keys(s),f=o.map(le=>s[le].length),p=f.reduce((le,se)=>le*=se);let A=1;const I=[1];for(let le=0;le<f.length-1;le++)A*=f[le],I.push(A);const J=[];for(let le=0;le<p;le++){const se={};for(let Ce=0;Ce<o.length;Ce++){const Pt=s[o[Ce]],Xt=Math.floor(le/I[Ce])%Pt.length;se[o[Ce]]=Pt[Xt]}J.push(se)}return J}function h3(s){return Object.values(s).filter(o=>o).length}function d3(s,o,f){return s+(f?"["+o+"]":(s.length?".":"")+o)}function ia(s,o,f,p,A){if(!dt(o))return o;for(const[I,J]of Object.entries(o)){const le=d3(f,I,p);Array.isArray(J)?A?ia(s,J,le,!0,A):s[le]=J.map(se=>ia(Array.isArray(se)?[]:{},se,"",!1,A)):dt(J)?ia(s,J,le,!1,A):s[le]=J}return s}function p3(s,o=!1,f){return ia({},s,f||"",!1,o)}function zh(s){if(!dt(s))return s;const o=Array.isArray(s)?[]:{};for(const[f,p]of Object.entries(s))Array.isArray(p)?Oe(o,f,p.map(A=>zh(A))):Oe(o,f,p);return o}function m3(s,o,f){return o[s]?o[s]:f}function Hh(s,o){const f={};for(const p of s){const A=o(p);f[A]=p}return f}function b3(s,o){const f={};for(const p of s){const A=o(p);f[A]||(f[A]=[]),f[A].push(p)}return f}function x3(s,o){const f=[];for(let p=0;p<s.length;p+=o)f.push(s.slice(p,p+o));return f}function qh(s,o){const f=Math.ceil(s.length/o),p=[];for(let A=0;A<s.length;A+=f)p.push(s.slice(A,A+f));return p}function $h(s,o){const f=[],p=Math.ceil(s.length/o);for(let A=0;A<p;A++)f.push(s.slice(A*o,A*o+o));return f}function y3(s,o){const f=Math.ceil(s.length/o);return $h(s,f)}function g3(s,o){return Object.values(Hh(s,o))}function w3(s,o,f,p,A){const I=o?s.map(o):s,J={};for(const se of I)J[se]=(J[se]||0)+1;const le=p?Kh(J,A?(se,Ce)=>se[1]-Ce[1]:(se,Ce)=>Ce[1]-se[1]):J;return f?Object.keys(le):le}function Kh(s,o){return Object.fromEntries(Object.entries(s).sort(o))}function A3(s){const o=[],f=Object.keys(s),p=s[f[0]].length;for(let A=0;A<p;A++){const I={};for(const J of f)I[J]=s[J][A];o.push(I)}return o}function E3(s,o,f=1){for(const p of s)p[o]+=f}function v3(s,o,f){for(const p of s)p[o]=f}function jo(s,o){const f=[];let p=[];return s.forEach((A,I)=>{(I===0||!o(A,s[I-1]))&&(p=[],f.push(p)),p.push(A)}),f}function R3(){return{map:new Map,keys:[]}}function B3(){return{map:new Map,keys:[]}}function Wh(s,o,f,p=100){if(s.map.has(o)){const A=s.keys.indexOf(o);s.keys.splice(A,1)}if(s.map.set(o,f),s.keys.push(o),s.keys.length>p){const A=s.keys.shift();A&&s.map.delete(A)}}function T3(s,o,f,p=100){if(s.map.has(o)){const A=s.keys.indexOf(o);s.keys.splice(A,1)}if(s.map.set(o,f),s.keys.unshift(o),s.keys.length>p){const A=s.keys.shift();A&&s.map.delete(A)}}function S3(s,o,f,p,A=100){Wh(s,o,{validUntil:Date.now()+p,data:f},A)}function O3(s,o){const f=s.map.get(o);return f&&f.validUntil>Date.now()?f.data:null}class ln{constructor(o){this.value=o}static of(o){return new ln(o)}static empty(){return new ln(null)}map(o){return new ln(this.value!==null&&this.value!==void 0?o(this.value):null)}mapAsync(o){return this.value!==null&&this.value!==void 0?o(this.value).then(f=>ln.of(f)):Promise.resolve(ln.empty())}ifPresent(o){return this.value!==null&&this.value!==void 0&&o(this.value),this}ifPresentAsync(o){return this.value!==null&&this.value!==void 0?o(this.value).then(()=>this):Promise.resolve(this)}ifAbsent(o){return(this.value===null||this.value===void 0)&&o(),this}ifAbsentAsync(o){return this.value===null||this.value===void 0?o().then(()=>this):Promise.resolve(this)}getOrFallback(o){return this.value??o()}getOrFallbackAsync(o){return this.value!==null&&this.value!==void 0?Promise.resolve(this.value):o()}getOrThrow(){if(this.value===null||this.value===void 0)throw Error("Optional.value is empty");return this.value}}r.Optional=ln;class I3{constructor(o){this.supplier=o,this.value=null}get(){return this.value||(this.value=this.supplier()),this.value}}r.Lazy=I3;class C3{constructor(o){this.supplier=o,this.value=null}async get(){return this.value||(this.value=await this.supplier()),this.value}}r.AsyncLazy=C3;function P3(s){return()=>s.forEach(o=>o())}function N3(s,o){return s.reduce((f,p)=>o(f)>o(p)?f:p)}function k3(s,o){const f=s.find(p=>p instanceof o);return ln.of(f)}function F3(s,o){return s.filter(f=>f instanceof o)}function D3(s,o){const f=[],p=Math.max(s.length,o.length);for(let A=0;A<p;A++)s[A]&&f.push(s[A]),o[A]&&f.push(o[A]);return f}function U3(s,o){return s.includes(o)?s.filter(f=>f!==o):[...s,o]}class L3{constructor(o){this.value=o,this.children=[]}}function M3(s,o,f,p,A=!1){const I=new Map,J=[];s.forEach(se=>{const Ce=new L3(se);I.set(se[o],Ce)}),s.forEach(se=>{const Ce=I.get(se[o]);if(!Ce)return;const Pt=se[f];if(Pt){const Xt=I.get(Pt);Xt&&Xt.children.push(Ce)}else J.push(Ce)});const le=se=>{se.children.sort((Ce,Pt)=>{const Xt=Ce.value[p],ai=Pt.value[p];return A?ai-Xt:Xt-ai}),se.children.forEach(le)};return J.forEach(le),J}function Qh(s,o){if(Math.log2(s.length)%1!==0)throw new Error("Array length must be a power of 2");let f=[...s];for(;f.length>1;){const p=[];for(let A=0;A<f.length;A+=2){const I=f[A+1];p.push(o(f[A],I))}f=p}return f[0]}function ni(...s){const o=s.reduce((A,I)=>A+I.length,0),f=new Uint8Array(o);let p=0;return s.forEach(A=>{f.set(A,p),p+=A.length}),f}function Jh(s){return s[0]===137&&s[1]===80&&s[2]===78&&s[3]===71}function Yh(s){return s[0]===255&&s[1]===216}function Xh(s){return s[8]===87&&s[9]===69&&s[10]===66&&s[11]===80}function _3(s){return Jh(s)||Yh(s)||Xh(s)}function V3(s){return new Uint8Array([s])}function G3(s){return s[0]}function j3(s,o){const f=new ArrayBuffer(2);return new DataView(f).setUint16(0,s,o==="LE"),new Uint8Array(f)}function z3(s,o){return new DataView(s.buffer).getUint16(s.byteOffset,o==="LE")}function H3(s,o){const f=new ArrayBuffer(4);return new DataView(f).setUint32(0,s,o==="LE"),new Uint8Array(f)}function q3(s,o){return new DataView(s.buffer).getUint32(s.byteOffset,o==="LE")}function zo(s,o){const f=new ArrayBuffer(8);return new DataView(f).setBigUint64(0,BigInt(s),o==="LE"),new Uint8Array(f)}function $3(s,o){return new DataView(s.buffer).getBigUint64(s.byteOffset,o==="LE")}function ii(s,o){const f=new Uint8Array(32);let p=s;if(o==="LE"){for(let A=0;A<32;A++)f[A]=Number(p&0xffn),p>>=8n;return f}for(let A=31;A>=0;A--)f[A]=Number(p&0xffn),p>>=8n;return f}function si(s,o){let f=0n;if(o==="LE"){for(let p=31;p>=0;p--)f=f<<8n|BigInt(s[p]);return f}for(let p=0;p<32;p++)f=f<<8n|BigInt(s[p]);return f}function K3(s,o){const f=[];let p=0;for(const A of o)f.push(s.subarray(p,p+A)),p+=A;return f}function Ho(s,o){const f=[];for(let p=0;p<s.length;p+=o)f.push(s.subarray(p,p+o));return f}const Zh=[0,1,0,32898,2147483648,32906,2147483648,2147516416,0,32907,0,2147483649,2147483648,2147516545,2147483648,32777,0,138,0,136,0,2147516425,0,2147483658,0,2147516555,2147483648,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,0,32778,2147483648,2147483658,2147483648,2147516545,2147483648,32896,0,2147483649,2147483648,2147516424];function W3(s){for(let o=0;o<24;o++){const f=s[0]^s[10]^s[20]^s[30]^s[40],p=s[1]^s[11]^s[21]^s[31]^s[41],A=s[2]^s[12]^s[22]^s[32]^s[42],I=s[3]^s[13]^s[23]^s[33]^s[43],J=s[4]^s[14]^s[24]^s[34]^s[44],le=s[5]^s[15]^s[25]^s[35]^s[45],se=s[6]^s[16]^s[26]^s[36]^s[46],Ce=s[7]^s[17]^s[27]^s[37]^s[47],Pt=s[8]^s[18]^s[28]^s[38]^s[48],Xt=s[9]^s[19]^s[29]^s[39]^s[49],ai=A<<1|I>>>31,F8=I<<1|A>>>31,Yi=Pt^ai,Xi=Xt^F8,D8=J<<1|le>>>31,U8=le<<1|J>>>31,Zi=f^D8,es=p^U8,L8=se<<1|Ce>>>31,M8=Ce<<1|se>>>31,ts=A^L8,rs=I^M8,_8=Pt<<1|Xt>>>31,V8=Xt<<1|Pt>>>31,ns=J^_8,is=le^V8,G8=f<<1|p>>>31,j8=p<<1|f>>>31,ss=se^G8,as=Ce^j8;s[0]^=Yi,s[1]^=Xi,s[2]^=Zi,s[3]^=es,s[4]^=ts,s[5]^=rs,s[6]^=ns,s[7]^=is,s[8]^=ss,s[9]^=as,s[10]^=Yi,s[11]^=Xi,s[12]^=Zi,s[13]^=es,s[14]^=ts,s[15]^=rs,s[16]^=ns,s[17]^=is,s[18]^=ss,s[19]^=as,s[20]^=Yi,s[21]^=Xi,s[22]^=Zi,s[23]^=es,s[24]^=ts,s[25]^=rs,s[26]^=ns,s[27]^=is,s[28]^=ss,s[29]^=as,s[30]^=Yi,s[31]^=Xi,s[32]^=Zi,s[33]^=es,s[34]^=ts,s[35]^=rs,s[36]^=ns,s[37]^=is,s[38]^=ss,s[39]^=as,s[40]^=Yi,s[41]^=Xi,s[42]^=Zi,s[43]^=es,s[44]^=ts,s[45]^=rs,s[46]^=ns,s[47]^=is,s[48]^=ss,s[49]^=as;const Yo=s[0],Xo=s[1],Zo=s[2]<<1|s[3]>>>31,ec=s[3]<<1|s[2]>>>31,tc=s[5]<<30|s[4]>>>2,rc=s[4]<<30|s[5]>>>2,nc=s[6]<<28|s[7]>>>4,ic=s[7]<<28|s[6]>>>4,sc=s[8]<<27|s[9]>>>5,ac=s[9]<<27|s[8]>>>5,oc=s[11]<<4|s[10]>>>28,cc=s[10]<<4|s[11]>>>28,uc=s[13]<<12|s[12]>>>20,lc=s[12]<<12|s[13]>>>20,fc=s[14]<<6|s[15]>>>26,hc=s[15]<<6|s[14]>>>26,dc=s[17]<<23|s[16]>>>9,pc=s[16]<<23|s[17]>>>9,mc=s[18]<<20|s[19]>>>12,bc=s[19]<<20|s[18]>>>12,xc=s[20]<<3|s[21]>>>29,yc=s[21]<<3|s[20]>>>29,gc=s[22]<<10|s[23]>>>22,wc=s[23]<<10|s[22]>>>22,Ac=s[25]<<11|s[24]>>>21,Ec=s[24]<<11|s[25]>>>21,vc=s[26]<<25|s[27]>>>7,Rc=s[27]<<25|s[26]>>>7,Bc=s[29]<<7|s[28]>>>25,Tc=s[28]<<7|s[29]>>>25,Sc=s[31]<<9|s[30]>>>23,Oc=s[30]<<9|s[31]>>>23,Ic=s[33]<<13|s[32]>>>19,Cc=s[32]<<13|s[33]>>>19,Pc=s[34]<<15|s[35]>>>17,Nc=s[35]<<15|s[34]>>>17,kc=s[36]<<21|s[37]>>>11,Fc=s[37]<<21|s[36]>>>11,Dc=s[38]<<8|s[39]>>>24,Uc=s[39]<<8|s[38]>>>24,Lc=s[40]<<18|s[41]>>>14,Mc=s[41]<<18|s[40]>>>14,_c=s[42]<<2|s[43]>>>30,Vc=s[43]<<2|s[42]>>>30,Gc=s[45]<<29|s[44]>>>3,jc=s[44]<<29|s[45]>>>3,zc=s[47]<<24|s[46]>>>8,Hc=s[46]<<24|s[47]>>>8,qc=s[48]<<14|s[49]>>>18,$c=s[49]<<14|s[48]>>>18;s[0]=Yo^~uc&Ac,s[1]=Xo^~lc&Ec,s[2]=uc^~Ac&kc,s[3]=lc^~Ec&Fc,s[4]=Ac^~kc&qc,s[5]=Ec^~Fc&$c,s[6]=kc^~qc&Yo,s[7]=Fc^~$c&Xo,s[8]=qc^~Yo&uc,s[9]=$c^~Xo&lc,s[10]=nc^~mc&xc,s[11]=ic^~bc&yc,s[12]=mc^~xc&Ic,s[13]=bc^~yc&Cc,s[14]=xc^~Ic&Gc,s[15]=yc^~Cc&jc,s[16]=Ic^~Gc&nc,s[17]=Cc^~jc&ic,s[18]=Gc^~nc&mc,s[19]=jc^~ic&bc,s[20]=Zo^~fc&vc,s[21]=ec^~hc&Rc,s[22]=fc^~vc&Dc,s[23]=hc^~Rc&Uc,s[24]=vc^~Dc&Lc,s[25]=Rc^~Uc&Mc,s[26]=Dc^~Lc&Zo,s[27]=Uc^~Mc&ec,s[28]=Lc^~Zo&fc,s[29]=Mc^~ec&hc,s[30]=sc^~oc&gc,s[31]=ac^~cc&wc,s[32]=oc^~gc&Pc,s[33]=cc^~wc&Nc,s[34]=gc^~Pc&zc,s[35]=wc^~Nc&Hc,s[36]=Pc^~zc&sc,s[37]=Nc^~Hc&ac,s[38]=zc^~sc&oc,s[39]=Hc^~ac&cc,s[40]=tc^~dc&Bc,s[41]=rc^~pc&Tc,s[42]=dc^~Bc&Sc,s[43]=pc^~Tc&Oc,s[44]=Bc^~Sc&_c,s[45]=Tc^~Oc&Vc,s[46]=Sc^~_c&tc,s[47]=Oc^~Vc&rc,s[48]=_c^~tc&dc,s[49]=Vc^~rc&pc,s[0]^=Zh[o*2],s[1]^=Zh[o*2+1]}}function ed(s){const o=[];for(let f=0;f<s.length;f+=4)o.push(s[f]|s[f+1]<<8|s[f+2]<<16|s[f+3]<<24);return o}function td(s,o){if(!s.length){const A=new Uint8Array(136);return A[0]=o,A[135]=128,[ed(A)]}const f=Ho(s,136),p=f[f.length-1];if(p.length<136){const A=new Uint8Array(136);A.set(p),A[p.length]=o,A[135]|=128,f[f.length-1]=A}if(p.length===136){const A=new Uint8Array(136);A[0]=o,A[135]=128,f.push(A)}return f.map(ed)}function rd(s,o){for(const f of o){for(let p=0;p<34;p+=2)s[p]^=f[p+1],s[p+1]^=f[p];W3(s)}return s}function nd(s){return new Uint8Array([s[1],s[1]>>-24,s[1]>>-16,s[1]>>-8,s[0],s[0]>>8,s[0]>>16,s[0]>>24,s[3],s[3]>>-24,s[3]>>-16,s[3]>>-8,s[2],s[2]>>8,s[2]>>16,s[2]>>24,s[5],s[5]>>-24,s[5]>>-16,s[5]>>-8,s[4],s[4]>>8,s[4]>>16,s[4]>>24,s[7],s[7]>>-24,s[7]>>-16,s[7]>>-8,s[6],s[6]>>8,s[6]>>16,s[6]>>24])}function fn(s){return nd(rd(new Array(50).fill(0),td(s,1)))}function Q3(s){return nd(rd(new Array(50).fill(0),td(s,6)))}function J3(s,o){const f=Math.min(s.length,o.length);for(let p=0;p<f;p++){const A=s[p]^o[p];for(let I=0;I<8;I++)if(A>>7-I&1)return p*8+I}return Math.min(s.length,o.length)*8}function Y3(s,o){const f=Math.min(s.length,o.length);for(let p=0;p<f;p++)if(s[p]!==o[p])return s.subarray(0,p);return s.subarray(0,f)}function X3(s,o,f,p){const A=Math.floor(o/8),I=o%8;f===1?s[A]|=1<<(p==="BE"?7-I:I):s[A]&=~(1<<(p==="BE"?7-I:I))}function Z3(s,o,f){const p=Math.floor(o/8),A=o%8;return s[p]>>(f==="BE"?7-A:A)&1}function e8(s,o,f=0){for(let p=f;p<s.length;p++)for(let A=0;A<o.length&&s[p+A]===o[A];A++)if(A===o.length-1)return p;return-1}function id(s,o,f=0){if(s.length>=o)return s;const p=new Uint8Array(o);return p.fill(f),p.set(s,o-s.length),p}function t8(s,o,f=0){const p=s.length%o;return p===0?s:id(s,s.length+o-p,f)}function sd(s,o,f=0){if(s.length>=o)return s;const p=new Uint8Array(o);return p.fill(f),p.set(s,0),p}function r8(s,o,f=0){const p=s.length%o;return p===0?s:sd(s,s.length+o-p,f)}function n8(s,o){const f=new Uint8Array(s.length);for(let p=0;p<s.length;p++)f[p]=s[p]^o[p%o.length];return f}function i8(s){for(let o=0;o<s.length;o++){const f=s[o];if(!(f<128))if((f&224)===192){if(o+1>=s.length||(s[o+1]&192)!==128)return!1;o+=1}else if((f&240)===224){if(o+2>=s.length||(s[o+1]&192)!==128||(s[o+2]&192)!==128)return!1;o+=2}else if((f&248)===240){if(o+3>=s.length||(s[o+1]&192)!==128||(s[o+2]&192)!==128||(s[o+3]&192)!==128)return!1;o+=3}else return!1}return!0}function s8(s,o){if(s.length!==o.length)return!1;for(let f=0;f<s.length;f++)if(s[f]!==o[f])return!1;return!0}function lt(s,o){return(s%o+o)%o}function Qi(s,o){s=lt(s,o);let[f,p]=[0n,1n],[A,I]=[o,s];for(;I!==0n;){const J=A/I;[f,p]=[p,f-J*p],[A,I]=[I,A-J*I]}if(A>1n)throw new Error("a is not invertible");return f<0n&&(f+=o),f}function a8(s,o,f){let p=1n;for(s=lt(s,f);o>0;)o%2n===1n&&(p=lt(p*s,f)),s=lt(s*s,f),o=o/2n;return p}function ad(s,o){return lt(s,o)===0n?0n:o%4n===3n?a8(s,(o+1n)/4n,o):null}const qt=0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,Dt=0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,sa=0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,aa=0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n;function qo(s,o,f){if(o===0n)return[0n,0n];const p=lt(3n*s*s*Qi(2n*o,f),f),A=lt(p*p-2n*s,f),I=lt(p*(s-A)-o,f);return[A,I]}function oa(s,o,f,p,A){if(s===0n&&o===0n)return[f,p];if(f===0n&&p===0n)return[s,o];if(s===f&&o===lt(-p,A))return[0n,0n];if(s===f&&o===p)return qo(s,o,A);const I=lt((p-o)*Qi(f-s,A),A),J=lt(I*I-s-f,A),le=lt(I*(s-J)-o,A);return[J,le]}function o8(s){if(s<=0n||s>=Dt)throw new Error("Invalid private key");return Pn(sa,aa,s,qt)}function c8(s){const o=s[1]%2n===0n?2:3;return new Uint8Array([o,...ii(s[0],"BE")])}function u8(s){if(s.length!==33||s[0]!==2&&s[0]!==3)throw new Error("Invalid compressed public key");const o=si(s.slice(1),"BE"),f=ad(lt(o**3n+7n,qt),qt);if(!f)throw Error("Invalid x: does not correspond to a valid curve point");const p=lt(-f,qt),A=f%2n===0n;return[o,s[0]===2?A?f:p:A?p:f]}function l8(s){const o=new Uint8Array(20),f=fn(ni(ii(s[0],"BE"),ii(s[1],"BE")));return o.set(f.subarray(12)),o}function f8(s){const o=r.Binary.uint8ArrayToHex(s),f=r.Binary.uint8ArrayToHex(r.Binary.keccak256(new Uint8Array([...o].map(A=>A.charCodeAt(0)))));let p="0x";for(let A=0;A<o.length;A++)parseInt(f[A],16)>7?p+=o[A].toUpperCase():p+=o[A];return p}function Pn(s,o,f,p){let A=[0n,0n],I=[s,o];const J=f.toString(2);for(const le of J)le==="0"?(I=oa(A[0],A[1],I[0],I[1],p),A=qo(A[0],A[1],p)):(A=oa(A[0],A[1],I[0],I[1],p),I=qo(I[0],I[1],p));return A}function h8(s,o,f){return od(si(fn(s),"BE"),o,f)}function od(s,o,f){if(o<=0n||o>=Dt)throw new Error("Invalid private key");if(f||(f=lt(si(fn(ni(fn(ii(o,"BE")),ii(s,"BE"))),"BE"),Dt)),f<=0n||f>=Dt)throw new Error("Invalid nonce");const p=lt(s,Dt),A=Pn(sa,aa,f,qt),I=lt(A[0],Dt);let J=lt((p+lt(I,Dt)*o)*Qi(f,Dt),Dt);if(I===0n||J===0n)throw new Error("Invalid r or s value");let le=A[1]%2n===0n?27n:28n;return J>Dt/2n&&(J=Dt-J,le=le===27n?28n:27n),[I,J,le]}function d8(s,o,f,p){const A=ad(lt(o**3n+7n,qt),qt);if(!A)throw new Error("Invalid r: does not correspond to a valid curve point");const I=p===27n?0n:1n,J=A%2n===I?A:qt-A,le=lt(si(fn(s),"BE"),Dt),se=Pn(o,J,f,qt),Ce=Pn(sa,aa,le,qt),Pt=oa(se[0],se[1],Ce[0],lt(-Ce[1],qt),qt);return Pn(Pt[0],Pt[1],Qi(o,Dt),qt)}function p8(s,o,f,p){const A=lt(si(fn(s),"BE"),Dt),I=Qi(p,Dt),J=lt(A*I,Dt),le=lt(f*I,Dt),se=Pn(sa,aa,J,qt),Ce=Pn(o[0],o[1],le,qt),Pt=oa(se[0],se[1],Ce[0],Ce[1],qt);return f===lt(Pt[0],Dt)}class cd{constructor(o){this.cursor=0,this.buffer=o}read(o){const f=this.buffer.subarray(this.cursor,this.cursor+o);return this.cursor+=o,f}max(){return this.buffer.length-this.cursor}}r.Uint8ArrayReader=cd;class ud{constructor(o){this.buffer=o,this.cursor=0}write(o){const f=Math.min(this.max(),o.max());return this.buffer.set(o.read(f),this.cursor),this.cursor+=f,f}max(){return this.buffer.length-this.cursor}}r.Uint8ArrayWriter=ud;class hn{constructor(o,f=0n){this.span=f,this.writer=new ud(new Uint8Array(o))}build(){return ni(zo(this.span,"LE"),this.writer.buffer)}hash(){const o=Qh(Ho(this.writer.buffer,32),(f,p)=>hn.hashFunction(ni(f,p)));return hn.hashFunction(ni(zo(this.span,"LE"),o))}}r.Chunk=hn,hn.hashFunction=fn;class $o{constructor(o,f=4096){this.counters=[1],this.capacity=f,this.chunks=[new hn(f)],this.onChunk=o}static async root(o,f=4096){const p=new e(e.NOOP,f);return await p.append(o),p.finalize()}async append(o,f=0,p=0n){const A=new cd(o);for(;A.max()>0;){this.chunks[f].writer.max()===0&&await this.elevate(f);const I=this.chunks[f].writer.write(A);p?this.chunks[f].span+=p:this.chunks[0].span+=BigInt(I)}}async elevate(o){this.counters[o]=++this.counters[o]%(this.capacity/32),this.chunks[o+1]||(this.chunks.push(new hn(this.capacity)),this.counters.push(1)),await this.append(this.chunks[o].hash(),o+1,this.chunks[o].span),await this.onChunk(this.chunks[o]),this.chunks[o]=new hn(this.capacity)}async finalize(o=0){return this.chunks[o+1]?this.counters[o]===1?(await this.elevate(o+1),this.chunks[o+1]=this.chunks[o],this.finalize(o+1)):(await this.elevate(o),this.finalize(o+1)):(await this.onChunk(this.chunks[o]),this.chunks[o])}}r.MerkleTree=$o,e=$o,$o.NOOP=async s=>{};class cr{constructor(o,f){if(f<0)throw Error("Scale must be non-negative");this.value=BigInt(o),this.scale=f}static cast(o){if(!o)throw Error("Cannot cast falsy value to FixedPointNumber");if(o instanceof cr)return o;const f=uh(o.value),p=at(o.scale);return new cr(f,p)}static fromDecimalString(o,f){/e\-\d+$/i.test(o)&&(o=parseFloat(o).toFixed(f));let[p,A]=o.split(".");return A=(A||"").padEnd(f,"0").slice(0,f),new cr(BigInt(p+A),f)}static fromFloat(o,f){return cr.fromDecimalString(o.toString(),f)}add(o){return this.assertSameScale(o),new cr(this.value+o.value,this.scale)}subtract(o){return this.assertSameScale(o),new cr(this.value-o.value,this.scale)}multiply(o){return new cr(this.value*o,this.scale)}divmod(o){if(o===0n)throw new Error("Division by zero is not allowed");const f=this.value/o,p=this.value%o;return[new cr(f,this.scale),new cr(p,this.scale)]}exchange(o,f,p){if(o==="*"){const I=this.value*f.value/10n**BigInt(this.scale);return new cr(I,p)}this.assertSameScale(f);const A=this.value*10n**BigInt(p)/f.value;return new cr(A,p)}compare(o){return this.assertSameScale(o),this.value>o.value?1:this.value<o.value?-1:0}toDecimalString(){if(this.scale===0)return this.value.toString();const o=this.value.toString(),f=o.slice(0,-this.scale)||"0",p=o.slice(-this.scale).padStart(this.scale,"0");return`${f}.${p}`}toString(){return this.value.toString()}toJSON(){return this.toString()}toFloat(){return parseFloat(this.toDecimalString())}assertSameScale(o){if(this.scale!==o.scale)throw new Error(`Scale mismatch: expected ${this.scale}, but got ${o.scale}`)}}r.FixedPointNumber=cr;function m8(s){if(s.length===0)return null;const o=s[0];return o.ttlMax?--o.ttl<=0&&s.shift():o.ttlMax=o.ttl,{progress:(o.ttlMax-o.ttl)/o.ttlMax,data:o.data}}function ca(s,o,f,p){const A=s.findIndex(le=>le===`--${o}`||le.startsWith(`--${o}=`)),I=s[A];if(!I)return(f||{})[p||o||""]||null;if(I.includes("="))return I.split("=")[1];const J=s[A+1];return J&&!J.startsWith("-")?J:(f||{})[p||o||""]||null}function b8(s,o,f,p){const A=ca(s,o,f,p);if(!A)return null;try{return Vo(A)}catch{throw new Error(`Invalid number argument ${o}: ${A}`)}}function x8(s,o,f,p){const A=s.some(se=>se.endsWith("-"+o)),I=ca(s,o,f,p);if(!I&&A)return!0;if(!I&&!A)return null;const J=["true","1","yes","y","on"],le=["false","0","no","n","off"];if(J.includes(I.toLowerCase()))return!0;if(le.includes(I.toLowerCase()))return!1;throw Error(`Invalid boolean argument ${o}: ${I}`)}function ld(s,o,f,p){const A=ca(s,o,f,p);if(!A)throw new Error(`Missing argument ${o}`);return A}function y8(s,o,f,p){const A=ld(s,o,f,p);try{return Vo(A)}catch{throw new Error(`Invalid argument ${o}: ${A}`)}}function fd(s,o){const f=s[o];s.splice(o,1),s.unshift(f)}function g8(s,o){const f=[...s];return fd(f,o),f}function hd(s,o){return{x:s.x+o.x,y:s.y+o.y}}function w8(s,o){return{x:s.x-o.x,y:s.y-o.y}}function Ko(s,o){return{x:s.x*o,y:s.y*o}}function A8(s){const o=Math.sqrt(s.x*s.x+s.y*s.y);return{x:s.x/o,y:s.y/o}}function dd(s,o,f){return{x:s.x+Math.cos(o)*f,y:s.y+Math.sin(o)*f}}function pd(s,o){return Math.sqrt((s.x-o.x)**2+(s.y-o.y)**2)}function Ji(s,o,f="row-first"){const p=[];if(f==="column-first")for(let A=0;A<s.length;A++)for(let I=0;I<s[0].length;I++)o(A,I)&&p.push({x:A,y:I});else for(let A=0;A<s[0].length;A++)for(let I=0;I<s.length;I++)o(I,A)&&p.push({x:I,y:A});return p}function E8(s,o,f){return s[o+1]?.[f]&&s[o-1]?.[f]&&!s[o][f-1]&&!s[o][f+1]}function v8(s,o,f){return s[o][f+1]&&s[o][f-1]&&!s[o-1]?.[f]&&!s[o+1]?.[f]}function md(s,o,f){return!s[o-1]?.[f]}function bd(s,o,f){return!s[o+1]?.[f]}function xd(s,o,f){return!s[o][f-1]}function yd(s,o,f){return!s[o][f+1]}function R8(s,o,f){const p=[];return s[o][f]?E8(s,o,f)||v8(s,o,f)?[]:(!s[o-1]?.[f-1]&&md(s,o,f)&&xd(s,o,f)&&p.push({x:o,y:f}),!s[o+1]?.[f-1]&&bd(s,o,f)&&xd(s,o,f)&&p.push({x:o+1,y:f}),!s[o-1]?.[f+1]&&md(s,o,f)&&yd(s,o,f)&&p.push({x:o,y:f+1}),!s[o+1]?.[f+1]&&bd(s,o,f)&&yd(s,o,f)&&p.push({x:o+1,y:f+1}),p):(s[o-1]?.[f]&&s[o][f-1]&&p.push({x:o,y:f}),s[o+1]?.[f]&&s[o][f-1]&&p.push({x:o+1,y:f}),s[o-1]?.[f]&&s[o][f+1]&&p.push({x:o,y:f+1}),s[o+1]?.[f]&&s[o][f+1]&&p.push({x:o+1,y:f+1}),p)}function B8(s,o,f,p){const A=[{x:0,y:0},{x:f,y:0},{x:0,y:p},{x:f,y:p}];for(let I=0;I<s.length;I++)for(let J=0;J<s[0].length;J++){const le=R8(s,I,J);for(const se of le)A.some(Ce=>Ce.x===se.x&&Ce.y===se.y)||A.push(se)}return A.map(I=>({x:I.x*o,y:I.y*o}))}function T8(s,o){const f=Ji(s,(se,Ce)=>s[se][Ce]===0&&s[se][Ce+1]!==0,"row-first").map(se=>({...se,dx:1,dy:0})),p=Ji(s,(se,Ce)=>s[se][Ce]===0&&s[se][Ce-1]!==0,"row-first").map(se=>({...se,dx:1,dy:0})),A=Ji(s,(se,Ce)=>s[se][Ce]===0&&s[se-1]?.[Ce]!==0,"column-first").map(se=>({...se,dx:0,dy:1})),I=Ji(s,(se,Ce)=>s[se][Ce]===0&&s[se+1]?.[Ce]!==0,"column-first").map(se=>({...se,dx:0,dy:1}));f.forEach(se=>se.y++),I.forEach(se=>se.x++);const J=jo([...A,...I],(se,Ce)=>se.x===Ce.x&&se.y-1===Ce.y),le=jo([...p,...f],(se,Ce)=>se.y===Ce.y&&se.x-1===Ce.x);return[...J,...le].map(se=>({start:se[0],end:we(se)})).map(se=>({start:Ko(se.start,o),end:Ko(hd(se.end,{x:se.start.dx,y:se.start.dy}),o)}))}function S8(s,o){return Math.atan2(o.y-s.y,o.x-s.x)}function O8(s,o){return o.map(f=>S8(s,f)).sort((f,p)=>f-p)}function gd(s,o,f,p){const A=(p.y-f.y)*(o.x-s.x)-(p.x-f.x)*(o.y-s.y);if(A===0)return null;let I=s.y-f.y,J=s.x-f.x;const le=(p.x-f.x)*I-(p.y-f.y)*J,se=(o.x-s.x)*I-(o.y-s.y)*J;return I=le/A,J=se/A,I>0&&I<1&&J>0&&J<1?{x:s.x+I*(o.x-s.x),y:s.y+I*(o.y-s.y)}:null}function Wo(s,o,f){const p=[],A=dd(s,f,1e4);for(const I of o){const J=gd(s,A,I.start,I.end);J&&p.push(J)}return p.length?p.reduce((I,J)=>{const le=pd(s,J),se=pd(s,I);return le<se?J:I}):null}function I8(s,o,f){const p=O8(s,f),A=[];for(const I of p){const J=Wo(s,o,I-.001),le=Wo(s,o,I+.001);J&&A.push(J),le&&A.push(le)}return A}class Qo{constructor(){this.subscribers=[]}subscribe(o){return this.subscribers.push(o),()=>{this.subscribers=this.subscribers.filter(f=>f!==o)}}publish(o){this.subscribers.forEach(f=>f(o))}clear(){this.subscribers=[]}getSubscriberCount(){return this.subscribers.length}}r.PubSubChannel=Qo;class C8{constructor(o,f){this.queue=[],this.running=0,this.onProcessed=new Qo,this.onDrained=new Qo,this.concurrency=o,this.capacity=f}process(){if(this.running>=this.concurrency)return;const o=this.queue.shift();o&&(this.running++,o().finally(()=>{this.running--,this.process(),this.onProcessed.publish(),this.running===0&&this.onDrained.publish()}))}enqueue(o){if(this.queue.length<this.capacity)return this.queue.push(o),this.process(),Promise.resolve();if(this.onProcessed.getSubscriberCount())throw Error("Queue capacity is full");return new Promise(f=>{this.onProcessed.subscribe(()=>{this.queue.length<this.capacity&&(this.queue.push(o),this.process(),this.onProcessed.clear(),f())})})}drain(){if(this.running===0)return Promise.resolve();if(this.onDrained.getSubscriberCount())throw Error("Already draining");return new Promise(o=>{this.onDrained.subscribe(()=>{this.onDrained.clear(),o()})})}}r.AsyncQueue=C8;class Jo{constructor(){this.forks=new Map}insert(o,f){if(o.length===0){this.handler=f;return}const p=o[0];let A=p,I;if(p.startsWith(":")&&(A=":",I=p.slice(1)),!this.forks.has(A)){const J=new Jo;I&&(J.variableName=I),this.forks.set(A,J)}this.forks.get(A).insert(o.slice(1),f)}async handle(o,f,p,A){if(o.length===0)return this.handler?(await this.handler(f,p,A),!0):!1;const I=o[0],J=this.forks.get(I);if(J)return J.handle(o.slice(1),f,p,A);const le=this.forks.get(":");if(le)return le.variableName&&A.set(le.variableName,decodeURIComponent(I)),le.handle(o.slice(1),f,p,A);const se=this.forks.get("*");return se?(A.set("wildcard",o.join("/")),se.handler?(await se.handler(f,p,A),!0):!1):!1}}r.TrieRouter=Jo;class P8{constructor(o){this.index=0,this.values=o}current(){return this.values[this.index]}next(){return this.index=(this.index+1)%this.values.length,this.values[this.index]}}r.RollingValueProvider=P8;class N8{constructor(){this.status="pending",this.steps=[],this.onStatusChange=async()=>{},this.onStepChange=async()=>{},this.onFinish=async()=>{},this.onError=async()=>{},this.context=new Map}getStatus(){return this.status}createInitialState(){return Object.fromEntries(this.steps.map(o=>[o.name,"pending"]))}setHooks(o){o.onStatusChange&&(this.onStatusChange=o.onStatusChange),o.onStepChange&&(this.onStepChange=o.onStepChange),o.onFinish&&(this.onFinish=o.onFinish),o.onError&&(this.onError=o.onError)}addStep(o){if(this.steps.find(f=>f.name===o.name))throw Error(`Step with name ${o.name} already exists`);this.steps.push(o)}async execute(){if(this.status!=="pending")throw Error(`Cannot execute solver in status ${this.status}`);this.status="in-progress",await this.onStatusChange(this.status);let o=this.createInitialState();for(const f of this.steps)try{if(f.transientSkipStepName){const p=o[f.transientSkipStepName];if(p==="skipped"||p==="failed"){o={...o,[f.name]:"skipped"},await this.onStepChange(o);continue}}if(!(!f.precondition||await f.precondition(this.context))){o={...o,[f.name]:"skipped"},await this.onStepChange(o);continue}o={...o,[f.name]:"in-progress"},await this.onStepChange(o);for(let p=0;await f.action(this.context,p)==="retry";p++);o={...o,[f.name]:"completed"},await this.onStepChange(o)}catch(p){throw o={...o,[f.name]:"failed"},this.status="failed",await this.onStatusChange(this.status),await this.onStepChange(o),await this.onError(p),p}return this.status="completed",await this.onStatusChange(this.status),await this.onFinish(),this.context}}r.Solver=N8;class k8{constructor(o){this.queryFunction=o.queryFunction,this.lockFunction=o.lockFunction,this.unlockFunction=o.unlockFunction,this.timeoutMillis=o.timeoutMillis}async couldLock(){const o=await this.queryFunction();try{const f=et(o);if(Date.now()<f+this.timeoutMillis)return new Date(f+this.timeoutMillis)}catch{}return await this.lockFunction(Date.now().toString()),!0}async unlock(){await this.unlockFunction()}}r.Lock=k8,r.Binary={hexToUint8Array:S2,uint8ArrayToHex:O2,binaryToUint8Array:C2,uint8ArrayToBinary:I2,base64ToUint8Array:v2,uint8ArrayToBase64:R2,base32ToUint8Array:B2,uint8ArrayToBase32:T2,log2Reduce:Qh,partition:Ho,concatBytes:ni,numberToUint8:V3,uint8ToNumber:G3,numberToUint16:j3,uint16ToNumber:z3,numberToUint32:H3,uint32ToNumber:q3,numberToUint64:zo,uint64ToNumber:$3,numberToUint256:ii,uint256ToNumber:si,sliceBytes:K3,keccak256:fn,sha3_256:Q3,proximity:J3,commonPrefix:Y3,setBit:X3,getBit:Z3,indexOf:e8,equals:s8,padStart:id,padStartToMultiple:t8,padEnd:sd,padEndToMultiple:r8,xorCypher:n8,isUtf8:i8},r.Elliptic={privateKeyToPublicKey:o8,compressPublicKey:c8,publicKeyFromCompressed:u8,publicKeyToAddress:l8,signMessage:h8,signHash:od,verifySignature:p8,recoverPublicKey:d8,checksumEncode:f8},r.Random={intBetween:C,floatBetween:N,chance:G,signed:F,makeSeededRng:v,point:V,procs:L},r.Arrays={countUnique:w3,makeUnique:g3,splitBySize:x3,splitByCount:qh,index:Hh,indexCollection:b3,onlyOrThrow:u,onlyOrNull:l,firstOrThrow:h,firstOrNull:d,shuffle:c,initialize:m,initialize2D:E,rotate2D:y,containsShape:O,glue:Nw,pluck:P,pick:Q,pickMany:re,pickManyUnique:de,pickWeighted:be,pickRandomIndices:R,pickGuaranteed:z,last:we,pipe:Te,makePipe:ae,sortWeighted:Ee,pushAll:Zs,unshiftAll:Cw,filterAndRemove:rA,merge:ZA,empty:e3,pushToBucket:Sw,unshiftAndLimit:Ow,atRolling:Iw,group:jo,createOscillator:VA,organiseWithLimits:jA,tickPlaybook:m8,getArgument:ca,getBooleanArgument:x8,getNumberArgument:b8,requireStringArgument:ld,requireNumberArgument:y8,bringToFront:g8,bringToFrontInPlace:fd,findInstance:k3,filterInstances:F3,interleave:D3,toggle:U3,createHierarchy:M3,multicall:P3,maxBy:N3},r.System={sleepMillis:a,forever:ee,scheduleMany:_w,waitFor:tA,expandError:vw,runAndSetInterval:H,whereAmI:$,withRetries:ie},r.Numbers={make:Vo,sum:Gw,average:jw,median:zw,getDistanceFromMidpoint:Hw,clamp:Go,range:hh,interpolate:Vw,createSequence:_A,increment:QA,decrement:JA,format:WA,fromDecimals:KA,makeStorage:SA,asMegabytes:he,convertBytes:pe,hexToRgb:k,rgbToHex:D,haversineDistanceToMeters:ne,roundToNearest:ye,formatDistance:Fe,triangularNumber:Be,searchFloat:De,binomialSample:Ft,toSignificantDigits:oe},r.Promises={raceFulfilled:n,invert:t,runInParallelBatches:i},r.Dates={getTimestamp:fA,getTimeDelta:Dh,secondsToHumanTime:hA,countCycles:dA,isoDate:sA,throttle:pA,timeSince:bA,dateTimeSlug:aA,unixTimestamp:iA,fromUtcString:oA,fromMillis:cA,getProgress:xA,humanizeTime:na,humanizeProgress:eA,createTimeDigits:Dr,mapDayNumber:Uh,getDayInfoFromDate:_o,getDayInfoFromDateTimeString:gA,seconds:wA,minutes:AA,hours:EA,days:vA,make:BA,normalizeTime:uA,absoluteDays:In},r.Objects={safeParse:MA,deleteDeep:ge,getDeep:Re,setDeep:Oe,incrementDeep:Ne,ensureDeep:X,replaceDeep:q,getFirstDeep:Y,deepMergeInPlace:On,deepMerge2:Rw,deepMerge3:Bw,mapAllAsync:Pw,cloneWithJson:nA,sortObject:Mh,sortArray:_h,sortAny:Cn,deepEquals:Vh,deepEqualsEvery:LA,runOn:YA,ifPresent:XA,zip:fh,zipSum:Tw,removeEmptyArrays:t3,removeEmptyValues:r3,flatten:p3,unflatten:zh,match:m3,sort:Kh,map:s3,mapIterable:a3,filterKeys:n3,filterValues:i3,rethrow:o3,setSomeOnObject:c3,setSomeDeep:u3,flip:l3,getAllPermutations:f3,countTruthyValues:h3,transformToArray:A3,setMulti:v3,incrementMulti:E3,createBidirectionalMap:R3,createTemporalBidirectionalMap:B3,pushToBidirectionalMap:Wh,unshiftToBidirectionalMap:T3,addToTemporalBidirectionalMap:S3,getFromTemporalBidirectionalMap:O3,createStatefulToggle:GA,diffKeys:zA,pickRandomKey:Gh,mapRandomKey:HA,fromObjectString:qA,toQueryString:kh,parseQueryString:q2,hasKey:$2,selectMax:K2,reposition:W2,unwrapSingleKey:Q2,parseKeyValues:J2,errorMatches:Y2},r.Types={isFunction:Et,isObject:dt,isStrictlyObject:xt,isEmptyArray:Xe,isEmptyObject:nt,isUndefined:It,isString:it,isNumber:Ct,isBoolean:Bt,isDate:Yt,isBlank:T,isId:b,isIntegerString:g,isHexString:M,isUrl:oh,isBigint:ch,isNullable:yw,asString:_,asHexString:W,asSafeString:te,asIntegerString:w,asNumber:at,asFunction:je,asInteger:et,asBoolean:mt,asDate:tt,asNullableString:uw,asEmptiableString:lw,asId:fw,asTime:hw,asArray:dw,asObject:Xs,asNullableObject:pw,asStringMap:mw,asNumericDictionary:bw,asUrl:xw,asBigint:uh,asEmptiable:ww,asNullable:gw,asOptional:Aw,enforceObjectShape:lh,enforceArrayShape:Ew,isPng:Jh,isJpg:Yh,isWebp:Xh,isImage:_3},r.Strings={tokenizeByCount:y3,tokenizeByLength:$h,searchHex:Io,searchSubstring:S,randomHex:x,randomLetter:dr,randomAlphanumeric:Hi,randomRichAscii:Oo,randomUnicode:Fr,includesAny:qw,slugify:Co,normalForm:Kw,enumify:Zw,escapeHtml:t2,decodeHtmlEntities:n2,after:ta,afterLast:dh,before:Po,beforeLast:No,betweenWide:i2,betweenNarrow:s2,getPreLine:OA,containsWord:Lo,containsWords:V2,joinUrl:Lh,getFuzzyMatchScore:ea,sortByFuzzyScore:e2,splitOnce:ko,splitAll:ph,randomize:u2,expand:mh,shrinkTrim:$i,capitalize:ra,decapitalize:bh,csvEscape:m2,parseCsv:Z2,surroundInOut:Xw,getExtension:Fo,getBasename:Do,normalizeEmail:a2,normalizeFilename:o2,parseFilename:c2,camelToTitle:Ww,slugToTitle:Qw,slugToCamel:Jw,joinHumanly:Yw,findWeightedPair:vh,extractBlock:Rh,extractAllBlocks:y2,replaceBlocks:g2,indexOfEarliest:ti,lastIndexOfBefore:Eh,parseHtmlAttributes:G2,readNextWord:Wi,readWordsAfterAll:j2,resolveVariables:z2,resolveVariableWithDefaultSyntax:Ph,resolveRemainingVariablesWithDefaults:Nh,isLetter:xh,isDigit:yh,isLetterOrDigit:Ki,isValidObjectPathCharacter:h2,insert:d2,indexOfRegex:gh,allIndexOf:Ah,lineMatches:wh,linesMatchInOrder:p2,represent:qi,resolveMarkdownLinks:H2,buildUrl:X2,isChinese:$w,replaceBetweenStrings:kA,describeMarkdown:FA,isBalanced:DA,textToFormat:UA,splitFormatting:w2,splitHashtags:A2,splitUrls:E2,route:P2,explodeReplace:Uo,generateVariants:N2,replaceWord:k2,replacePascalCaseWords:F2,stripHtml:D2,breakLine:Ih,measureTextWidth:U2,toLines:L2,levenshteinDistance:M2,findCommonPrefix:Ch,findCommonDirectory:_2},r.Assertions={asEqual:kw,asTrue:Fw,asTruthy:Dw,asFalse:Uw,asFalsy:Lw,asEither:Mw},r.Cache={get:IA,delete:CA,deleteExpired:PA,size:NA},r.Vector={addPoint:hd,subtractPoint:w8,multiplyPoint:Ko,normalizePoint:A8,pushPoint:dd,filterCoordinates:Ji,findCorners:B8,findLines:T8,raycast:Wo,raycastCircle:I8,getLineIntersectionPoint:gd}})(Kc)),Kc}var H8=z8();const rt=Us(H8);rt.Arrays;rt.Assertions;const me=rt.Binary;rt.Cache;const Mf=rt.Dates,jn=rt.Elliptic,Ed=rt.Numbers,As=rt.Objects;rt.Pagination;rt.Promises;rt.Random;const d0=rt.Strings,Za=rt.System,B=rt.Types,jt=rt.Optional;rt.Vector;rt.PubSubChannel;rt.Chunk;const Sx=rt.MerkleTree,Gr=rt.FixedPointNumber;rt.Lazy;rt.AsyncLazy;const q8=rt.AsyncQueue,$8=rt.Uint8ArrayReader;rt.Uint8ArrayWriter;rt.TrieRouter;rt.RollingValueProvider;rt.Solver;rt.Lock;var ua={exports:{}},Wc,vd;function K8(){if(vd)return Wc;vd=1;var r=1e3,e=r*60,t=e*60,n=t*24,i=n*7,a=n*365.25;Wc=function(h,m){m=m||{};var y=typeof h;if(y==="string"&&h.length>0)return c(h);if(y==="number"&&isFinite(h))return m.long?l(h):u(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function c(h){if(h=String(h),!(h.length>100)){var m=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(m){var y=parseFloat(m[1]),E=(m[2]||"ms").toLowerCase();switch(E){case"years":case"year":case"yrs":case"yr":case"y":return y*a;case"weeks":case"week":case"w":return y*i;case"days":case"day":case"d":return y*n;case"hours":case"hour":case"hrs":case"hr":case"h":return y*t;case"minutes":case"minute":case"mins":case"min":case"m":return y*e;case"seconds":case"second":case"secs":case"sec":case"s":return y*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function u(h){var m=Math.abs(h);return m>=n?Math.round(h/n)+"d":m>=t?Math.round(h/t)+"h":m>=e?Math.round(h/e)+"m":m>=r?Math.round(h/r)+"s":h+"ms"}function l(h){var m=Math.abs(h);return m>=n?d(h,m,n,"day"):m>=t?d(h,m,t,"hour"):m>=e?d(h,m,e,"minute"):m>=r?d(h,m,r,"second"):h+" ms"}function d(h,m,y,E){var O=m>=y*1.5;return Math.round(h/y)+" "+E+(O?"s":"")}return Wc}var Qc,Rd;function W8(){if(Rd)return Qc;Rd=1;function r(e){n.debug=n,n.default=n,n.coerce=d,n.disable=u,n.enable=a,n.enabled=l,n.humanize=K8(),n.destroy=h,Object.keys(e).forEach(m=>{n[m]=e[m]}),n.names=[],n.skips=[],n.formatters={};function t(m){let y=0;for(let E=0;E<m.length;E++)y=(y<<5)-y+m.charCodeAt(E),y|=0;return n.colors[Math.abs(y)%n.colors.length]}n.selectColor=t;function n(m){let y,E=null,O,R;function P(...v){if(!P.enabled)return;const C=P,N=Number(new Date),F=N-(y||N);C.diff=F,C.prev=y,C.curr=N,y=N,v[0]=n.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");let U=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,(L,G)=>{if(L==="%%")return"%";U++;const Q=n.formatters[G];if(typeof Q=="function"){const re=v[U];L=Q.call(C,re),v.splice(U,1),U--}return L}),n.formatArgs.call(C,v),(C.log||n.log).apply(C,v)}return P.namespace=m,P.useColors=n.useColors(),P.color=n.selectColor(m),P.extend=i,P.destroy=n.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>E!==null?E:(O!==n.namespaces&&(O=n.namespaces,R=n.enabled(m)),R),set:v=>{E=v}}),typeof n.init=="function"&&n.init(P),P}function i(m,y){const E=n(this.namespace+(typeof y>"u"?":":y)+m);return E.log=this.log,E}function a(m){n.save(m),n.namespaces=m,n.names=[],n.skips=[];const y=(typeof m=="string"?m:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const E of y)E[0]==="-"?n.skips.push(E.slice(1)):n.names.push(E)}function c(m,y){let E=0,O=0,R=-1,P=0;for(;E<m.length;)if(O<y.length&&(y[O]===m[E]||y[O]==="*"))y[O]==="*"?(R=O,P=E,O++):(E++,O++);else if(R!==-1)O=R+1,P++,E=P;else return!1;for(;O<y.length&&y[O]==="*";)O++;return O===y.length}function u(){const m=[...n.names,...n.skips.map(y=>"-"+y)].join(",");return n.enable(""),m}function l(m){for(const y of n.skips)if(c(m,y))return!1;for(const y of n.names)if(c(m,y))return!0;return!1}function d(m){return m instanceof Error?m.stack||m.message:m}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}return Qc=r,Qc}var Bd;function Q8(){return Bd||(Bd=1,(function(r,e){var t={};e.formatArgs=i,e.save=a,e.load=c,e.useColors=n,e.storage=u(),e.destroy=(()=>{let d=!1;return()=>{d||(d=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let d;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(d=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(d[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(d){if(d[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+d[0]+(this.useColors?"%c ":" ")+"+"+r.exports.humanize(this.diff),!this.useColors)return;const h="color: "+this.color;d.splice(1,0,h,"color: inherit");let m=0,y=0;d[0].replace(/%[a-zA-Z%]/g,E=>{E!=="%%"&&(m++,E==="%c"&&(y=m))}),d.splice(y,0,h)}e.log=console.debug||console.log||(()=>{});function a(d){try{d?e.storage.setItem("debug",d):e.storage.removeItem("debug")}catch{}}function c(){let d;try{d=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!d&&typeof Ve<"u"&&"env"in Ve&&(d=t.DEBUG),d}function u(){try{return localStorage}catch{}}r.exports=W8()(e);const{formatters:l}=r.exports;l.j=function(d){try{return JSON.stringify(d)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}})(ua,ua.exports)),ua.exports}var J8=Q8();const p0=Us(J8),Y8=p0("bee-js:bytes"),X8=new TextDecoder,Z8=new TextEncoder;class ze{constructor(e,t){if(!e)throw Error(`Bytes#constructor: constructor parameter is falsy: ${e}`);if(e instanceof ze)this.bytes=e.bytes;else if(typeof e=="string")this.bytes=me.hexToUint8Array(B.asHexString(e,{name:"Bytes#constructor(bytes)"}));else if(e instanceof ArrayBuffer)this.bytes=new Uint8Array(e);else if(e instanceof Uint8Array)this.bytes=e;else{const n=e,i=As.getDeep(n,"toHex");if(B.isFunction(i)){const a=i.call(n);this.bytes=me.hexToUint8Array(B.asHexString(a,{name:"Bytes#constructor(bytes)"}))}else throw Y8("bytes",e),new Error(`Bytes#constructor: unsupported type: ${typeof e}`)}if(this.length=this.bytes.length,t){if(Array.isArray(t)){if(!t.includes(this.length))throw new Error(`Bytes#checkByteLength: bytes length is ${this.length} but expected ${t.join(" or ")}`)}else if(this.length!==t)throw new Error(`Bytes#checkByteLength: bytes length is ${this.length} but expected ${t}`)}}static keccak256(e){return new ze(me.keccak256(new ze(e).toUint8Array()))}static fromUtf8(e){return new ze(Z8.encode(e))}static fromSlice(e,t,n){return n===void 0?new ze(e.slice(t)):new ze(e.slice(t,t+n))}offset(e){return new Uint8Array(this.bytes.slice(e))}toUint8Array(){return new Uint8Array(this.bytes)}toHex(){return me.uint8ArrayToHex(this.bytes)}toBase64(){return me.uint8ArrayToBase64(this.bytes)}toBase32(){return me.uint8ArrayToBase32(this.bytes)}toString(){return this.toHex()}toUtf8(){return X8.decode(this.bytes)}toJSON(){return JSON.parse(this.toUtf8())}equals(e){return this.toHex()===new ze(e).toHex()}represent(){return this.toHex()}}function Ox(r){const e={B:1,kB:1e3,MB:1e6,GB:1e9,TB:1e12,PB:1e15},t=r.match(/^([\d.]+)\s*(B|kB|MB|GB|TB|PB)$/);if(!t)throw new Error(`Invalid size format: ${r}`);const n=parseFloat(t[1]),i=t[2];return Math.ceil(n*e[i])}const Ix=250,Cx=251,Td={[Ix]:"manifest",[Cx]:"feed"};function eE(r,e){r=new ke(r);const t="b",n=new Uint8Array([1]),i=new Uint8Array([e==="feed"?Cx:Ix]),a=new Uint8Array([1]),c=new Uint8Array([27]),u=new Uint8Array([32]),l=me.uint8ArrayToBase32(me.concatBytes(n,i,a,c,u)).replace(/\=+$/,""),d=r.toBase32().replace(/\=+$/,"");return`${t}${l}${d}`.toLowerCase()}function tE(r){const e=me.base32ToUint8Array(r.toUpperCase().slice(1)),t=e[1];if(!Td[t])throw new Error("Unknown codec");const n=new ke(e.slice(-32));return{type:Td[t],reference:n}}const vi=new TextEncoder;class Jr extends ze{constructor(e){super(e,32)}publicKey(){const[e,t]=jn.privateKeyToPublicKey(me.uint256ToNumber(this.bytes,"BE"));return new vr(me.concatBytes(me.numberToUint256(e,"BE"),me.numberToUint256(t,"BE")))}sign(e){const t=me.concatBytes(vi.encode(`Ethereum Signed Message:
|
|
11
|
-
32`),me.keccak256(e instanceof Uint8Array?e:vi.encode(e))),[n,i,a]=jn.signMessage(t,me.uint256ToNumber(this.bytes,"BE"));return new vn(me.concatBytes(me.numberToUint256(n,"BE"),me.numberToUint256(i,"BE"),new Uint8Array([Number(a)])))}}Jr.LENGTH=32;class vr extends ze{constructor(e){const t=new ze(e);if(t.length===33){const[n,i]=jn.publicKeyFromCompressed(t.toUint8Array());super(me.concatBytes(me.numberToUint256(n,"BE"),me.numberToUint256(i,"BE")),64)}else super(e,64)}address(){const e=me.uint256ToNumber(this.bytes.slice(0,32),"BE"),t=me.uint256ToNumber(this.bytes.slice(32,64),"BE");return new Wt(jn.publicKeyToAddress([e,t]))}toCompressedUint8Array(){const e=me.uint256ToNumber(this.bytes.slice(0,32),"BE"),t=me.uint256ToNumber(this.bytes.slice(32,64),"BE");return jn.compressPublicKey([e,t])}toCompressedHex(){return me.uint8ArrayToHex(this.toCompressedUint8Array())}}vr.LENGTH=64;class Wt extends ze{constructor(e){super(e,20)}toChecksum(){return jn.checksumEncode(this.bytes)}}Wt.LENGTH=20;class Lt extends ze{constructor(e){super(e,32)}static fromString(e){return new Lt(me.keccak256(vi.encode(e)))}}Lt.LENGTH=32;class ke extends ze{constructor(e){if(typeof e=="string"&&e.startsWith("bah5")){const t=tE(e);super(t.reference.bytes,32)}else super(e,[32,64])}toCid(e){return eE(this.bytes,e)}static isValid(e){try{return new ke(e),!0}catch{return!1}}}ke.LENGTH=32;class rr extends ze{constructor(e){super(e,32)}}rr.LENGTH=32;class Nt extends ze{constructor(e){super(e,8)}static fromBigInt(e){return new Nt(me.numberToUint64(e,"LE"))}toBigInt(){return me.uint64ToNumber(this.bytes,"LE")}static fromSlice(e,t){return new Nt(e.slice(t,t+Nt.LENGTH))}}Nt.LENGTH=8;class Tr extends ze{constructor(e){super(e,32)}}Tr.LENGTH=32;class ut extends ze{constructor(e){super(e,32)}}ut.LENGTH=32;let vn=class _f extends ze{constructor(e){super(e,65)}static fromSlice(e,t){return new _f(e.slice(t,t+_f.LENGTH))}recoverPublicKey(e){const t=me.uint256ToNumber(this.bytes.slice(0,32),"BE"),n=me.uint256ToNumber(this.bytes.slice(32,64),"BE"),i=BigInt(this.bytes[64]),[a,c]=jn.recoverPublicKey(me.concatBytes(vi.encode(`Ethereum Signed Message:
|
|
12
|
-
32`),me.keccak256(e instanceof Uint8Array?e:vi.encode(e))),t,n,i);return new vr(me.concatBytes(me.numberToUint256(a,"BE"),me.numberToUint256(c,"BE")))}isValid(e,t){return this.recoverPublicKey(e).address().equals(t)}};vn.LENGTH=65;class Yr extends ze{constructor(e){super(e,32)}static fromString(e){return new Yr(me.keccak256(vi.encode(e)))}}Yr.LENGTH=32;const Px=new Uint8Array(8).fill(255,0,8);class Qt extends ze{constructor(e){super(e,8)}static fromBigInt(e){return new Qt(me.numberToUint64(e,"BE"))}toBigInt(){return me.uint64ToNumber(this.bytes,"BE")}next(){return me.equals(this.bytes,Px)?Qt.fromBigInt(0n):Qt.fromBigInt(this.toBigInt()+1n)}}Qt.LENGTH=8;Qt.MINUS_ONE=new Qt(Px);class Pr extends Error{constructor(e){super(e)}}class _r extends Pr{constructor(e,t){super(e),this.value=t}}class m0 extends Pr{constructor(e,t,n,i,a,c){super(n),this.method=e,this.url=t,this.responseBody=i,this.status=a,this.statusText=c}}const Jc=4096,rE=32;function Nx(r){const e=r.slice(0,Nt.LENGTH),t=r.slice(Nt.LENGTH),n=nE(t),i=me.keccak256(me.concatBytes(e,n));return new ke(i)}function nE(r){if(r.length>Jc)throw new _r(`payload size ${r.length} exceeds maximum chunk payload size ${Jc}`,r);const e=new Uint8Array(Jc);return e.set(r),me.log2Reduce(me.partition(e,rE),(t,n)=>me.keccak256(me.concatBytes(t,n)))}var mi;(function(r){r.FULL="full",r.LIGHT="light",r.ULTRA_LIGHT="ultra-light",r.DEV="dev"})(mi||(mi={}));function kx(r){switch(r){case"full":return mi.FULL;case"light":return mi.LIGHT;case"ultra-light":return mi.ULTRA_LIGHT;case"dev":return mi.DEV;default:throw new Error(`Unknown Bee mode: ${r}`)}}const iE=32,sE=128,la=iE*sE,Sd=17,Od=255,aE=1,oE=1e3;var $t;(function(r){r[r.OFF=0]="OFF",r[r.MEDIUM=1]="MEDIUM",r[r.STRONG=2]="STRONG",r[r.INSANE=3]="INSANE",r[r.PARANOID=4]="PARANOID"})($t||($t={}));var Id;(function(r){r[r.NONE=0]="NONE",r[r.DATA=1]="DATA",r[r.PROX=2]="PROX",r[r.RACE=3]="RACE"})(Id||(Id={}));const Fx={ENCRYPTION_OFF:{[$t.OFF]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"44.70 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"6.66 MB",batchDepth:18,utilizationRate:"0.61%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"112.06 MB",batchDepth:19,utilizationRate:"5.09%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"687.62 MB",batchDepth:20,utilizationRate:"15.65%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.60 GB",batchDepth:21,utilizationRate:"30.27%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"7.73 GB",batchDepth:22,utilizationRate:"44.99%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"19.94 GB",batchDepth:23,utilizationRate:"58.03%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"47.06 GB",batchDepth:24,utilizationRate:"68.48%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"105.51 GB",batchDepth:25,utilizationRate:"76.77%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"227.98 GB",batchDepth:26,utilizationRate:"82.94%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"476.68 GB",batchDepth:27,utilizationRate:"86.71%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"993.65 GB",batchDepth:28,utilizationRate:"88.37%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"2.04 TB",batchDepth:29,utilizationRate:"92.88%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"4.17 TB",batchDepth:30,utilizationRate:"94.81%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"8.45 TB",batchDepth:31,utilizationRate:"96.06%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"17.07 TB",batchDepth:32,utilizationRate:"97.01%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"34.36 TB",batchDepth:33,utilizationRate:"97.65%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"69.04 TB",batchDepth:34,utilizationRate:"98.11%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"138.54 TB",batchDepth:35,utilizationRate:"98.44%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"277.72 TB",batchDepth:36,utilizationRate:"98.67%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"556.35 TB",batchDepth:37,utilizationRate:"98.83%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"1.11 PB",batchDepth:38,utilizationRate:"98.91%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"2.23 PB",batchDepth:39,utilizationRate:"98.96%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"4.46 PB",batchDepth:40,utilizationRate:"98.98%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"8.93 PB",batchDepth:41,utilizationRate:"99.11%"}],[$t.MEDIUM]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"41.56 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"6.19 MB",batchDepth:18,utilizationRate:"0.57%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"104.18 MB",batchDepth:19,utilizationRate:"4.73%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"639.27 MB",batchDepth:20,utilizationRate:"14.54%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.41 GB",batchDepth:21,utilizationRate:"28.11%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"7.18 GB",batchDepth:22,utilizationRate:"41.79%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"18.54 GB",batchDepth:23,utilizationRate:"53.95%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"43.75 GB",batchDepth:24,utilizationRate:"63.66%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"98.09 GB",batchDepth:25,utilizationRate:"71.37%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"211.95 GB",batchDepth:26,utilizationRate:"77.11%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"443.16 GB",batchDepth:27,utilizationRate:"80.61%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"923.78 GB",batchDepth:28,utilizationRate:"82.16%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.90 TB",batchDepth:29,utilizationRate:"86.30%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.88 TB",batchDepth:30,utilizationRate:"88.14%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"7.86 TB",batchDepth:31,utilizationRate:"89.26%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"15.87 TB",batchDepth:32,utilizationRate:"90.21%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"31.94 TB",batchDepth:33,utilizationRate:"90.77%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"64.19 TB",batchDepth:34,utilizationRate:"91.22%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"128.80 TB",batchDepth:35,utilizationRate:"91.52%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"258.19 TB",batchDepth:36,utilizationRate:"91.73%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"517.23 TB",batchDepth:37,utilizationRate:"91.88%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"1.04 PB",batchDepth:38,utilizationRate:"91.95%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"2.07 PB",batchDepth:39,utilizationRate:"92.00%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"4.15 PB",batchDepth:40,utilizationRate:"92.15%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"8.30 PB",batchDepth:41,utilizationRate:"92.14%"}],[$t.STRONG]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"37.37 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"5.57 MB",batchDepth:18,utilizationRate:"0.51%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"93.68 MB",batchDepth:19,utilizationRate:"4.25%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"574.81 MB",batchDepth:20,utilizationRate:"13.07%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.17 GB",batchDepth:21,utilizationRate:"25.26%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"6.46 GB",batchDepth:22,utilizationRate:"37.58%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"16.67 GB",batchDepth:23,utilizationRate:"48.50%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"39.34 GB",batchDepth:24,utilizationRate:"57.24%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"88.20 GB",batchDepth:25,utilizationRate:"64.17%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"190.58 GB",batchDepth:26,utilizationRate:"69.33%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"398.47 GB",batchDepth:27,utilizationRate:"72.48%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"830.63 GB",batchDepth:28,utilizationRate:"73.85%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.71 TB",batchDepth:29,utilizationRate:"77.59%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.49 TB",batchDepth:30,utilizationRate:"79.27%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"7.07 TB",batchDepth:31,utilizationRate:"80.34%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"14.27 TB",batchDepth:32,utilizationRate:"81.12%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"28.72 TB",batchDepth:33,utilizationRate:"81.63%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"57.71 TB",batchDepth:34,utilizationRate:"82.01%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"115.81 TB",batchDepth:35,utilizationRate:"82.29%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"232.16 TB",batchDepth:36,utilizationRate:"82.48%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"465.07 TB",batchDepth:37,utilizationRate:"82.61%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"931.23 TB",batchDepth:38,utilizationRate:"82.67%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"1.86 PB",batchDepth:39,utilizationRate:"82.71%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"3.73 PB",batchDepth:40,utilizationRate:"82.78%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"7.46 PB",batchDepth:41,utilizationRate:"82.79%"}],[$t.INSANE]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"33.88 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"5.05 MB",batchDepth:18,utilizationRate:"0.46%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"84.92 MB",batchDepth:19,utilizationRate:"3.86%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"521.09 MB",batchDepth:20,utilizationRate:"11.85%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"1.97 GB",batchDepth:21,utilizationRate:"22.90%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"5.86 GB",batchDepth:22,utilizationRate:"34.09%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"15.11 GB",batchDepth:23,utilizationRate:"43.97%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"35.66 GB",batchDepth:24,utilizationRate:"51.90%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"79.96 GB",batchDepth:25,utilizationRate:"58.18%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"172.77 GB",batchDepth:26,utilizationRate:"62.85%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"361.23 GB",batchDepth:27,utilizationRate:"65.70%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"753.00 GB",batchDepth:28,utilizationRate:"66.95%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.55 TB",batchDepth:29,utilizationRate:"70.38%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.16 TB",batchDepth:30,utilizationRate:"71.92%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"6.41 TB",batchDepth:31,utilizationRate:"72.85%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"12.93 TB",batchDepth:32,utilizationRate:"73.53%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"26.04 TB",batchDepth:33,utilizationRate:"74.01%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"52.32 TB",batchDepth:34,utilizationRate:"74.35%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"104.99 TB",batchDepth:35,utilizationRate:"74.60%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"210.46 TB",batchDepth:36,utilizationRate:"74.77%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"421.61 TB",batchDepth:37,utilizationRate:"74.89%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"844.20 TB",batchDepth:38,utilizationRate:"74.94%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"1.69 PB",batchDepth:39,utilizationRate:"74.98%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"3.38 PB",batchDepth:40,utilizationRate:"75.03%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"6.77 PB",batchDepth:41,utilizationRate:"75.10%"}],[$t.PARANOID]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"13.27 kB",batchDepth:17,utilizationRate:"0.00%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"1.98 MB",batchDepth:18,utilizationRate:"0.18%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"33.27 MB",batchDepth:19,utilizationRate:"1.51%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"204.14 MB",batchDepth:20,utilizationRate:"4.64%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"771.13 MB",batchDepth:21,utilizationRate:"8.75%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"2.29 GB",batchDepth:22,utilizationRate:"13.34%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"5.92 GB",batchDepth:23,utilizationRate:"17.22%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"13.97 GB",batchDepth:24,utilizationRate:"20.33%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"31.32 GB",batchDepth:25,utilizationRate:"22.79%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"67.68 GB",batchDepth:26,utilizationRate:"24.62%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"141.51 GB",batchDepth:27,utilizationRate:"25.74%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"294.99 GB",batchDepth:28,utilizationRate:"26.23%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"606.90 GB",batchDepth:29,utilizationRate:"27.56%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"1.24 TB",batchDepth:30,utilizationRate:"28.15%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"2.51 TB",batchDepth:31,utilizationRate:"28.54%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"5.07 TB",batchDepth:32,utilizationRate:"28.82%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"10.20 TB",batchDepth:33,utilizationRate:"28.99%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"20.50 TB",batchDepth:34,utilizationRate:"29.13%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"41.13 TB",batchDepth:35,utilizationRate:"29.22%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"82.45 TB",batchDepth:36,utilizationRate:"29.29%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"165.17 TB",batchDepth:37,utilizationRate:"29.34%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"330.72 TB",batchDepth:38,utilizationRate:"29.37%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"661.97 TB",batchDepth:39,utilizationRate:"29.39%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"1.32 PB",batchDepth:40,utilizationRate:"29.41%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"2.65 PB",batchDepth:41,utilizationRate:"29.43%"}]},ENCRYPTION_ON:{[$t.OFF]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"44.35 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"6.61 MB",batchDepth:18,utilizationRate:"0.60%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"111.18 MB",batchDepth:19,utilizationRate:"5.05%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"682.21 MB",batchDepth:20,utilizationRate:"15.52%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.58 GB",batchDepth:21,utilizationRate:"30.04%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"7.67 GB",batchDepth:22,utilizationRate:"44.62%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"19.78 GB",batchDepth:23,utilizationRate:"57.56%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"46.69 GB",batchDepth:24,utilizationRate:"67.93%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"104.68 GB",batchDepth:25,utilizationRate:"76.16%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"226.19 GB",batchDepth:26,utilizationRate:"82.29%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"472.93 GB",batchDepth:27,utilizationRate:"86.02%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"985.83 GB",batchDepth:28,utilizationRate:"87.66%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"2.03 TB",batchDepth:29,utilizationRate:"92.25%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"4.14 TB",batchDepth:30,utilizationRate:"94.21%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"8.39 TB",batchDepth:31,utilizationRate:"95.37%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"16.93 TB",batchDepth:32,utilizationRate:"96.22%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"34.09 TB",batchDepth:33,utilizationRate:"96.88%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"68.50 TB",batchDepth:34,utilizationRate:"97.34%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"137.45 TB",batchDepth:35,utilizationRate:"97.67%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"275.53 TB",batchDepth:36,utilizationRate:"97.89%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"551.97 TB",batchDepth:37,utilizationRate:"98.05%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"1.11 PB",batchDepth:38,utilizationRate:"98.13%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"2.21 PB",batchDepth:39,utilizationRate:"98.18%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"4.43 PB",batchDepth:40,utilizationRate:"98.36%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"8.86 PB",batchDepth:41,utilizationRate:"98.37%"}],[$t.MEDIUM]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"40.89 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"6.09 MB",batchDepth:18,utilizationRate:"0.56%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"102.49 MB",batchDepth:19,utilizationRate:"4.65%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"628.91 MB",batchDepth:20,utilizationRate:"14.30%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.38 GB",batchDepth:21,utilizationRate:"27.68%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"7.07 GB",batchDepth:22,utilizationRate:"41.15%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"18.24 GB",batchDepth:23,utilizationRate:"53.09%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"43.04 GB",batchDepth:24,utilizationRate:"62.63%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"96.50 GB",batchDepth:25,utilizationRate:"70.21%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"208.52 GB",batchDepth:26,utilizationRate:"75.86%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"435.98 GB",batchDepth:27,utilizationRate:"79.30%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"908.81 GB",batchDepth:28,utilizationRate:"80.82%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.87 TB",batchDepth:29,utilizationRate:"84.98%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.81 TB",batchDepth:30,utilizationRate:"86.67%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"7.73 TB",batchDepth:31,utilizationRate:"87.84%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"15.61 TB",batchDepth:32,utilizationRate:"88.74%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"31.43 TB",batchDepth:33,utilizationRate:"89.34%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"63.15 TB",batchDepth:34,utilizationRate:"89.74%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"126.71 TB",batchDepth:35,utilizationRate:"90.03%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"254.01 TB",batchDepth:36,utilizationRate:"90.24%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"508.85 TB",batchDepth:37,utilizationRate:"90.39%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"1.02 PB",batchDepth:38,utilizationRate:"90.47%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"2.04 PB",batchDepth:39,utilizationRate:"90.51%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"4.08 PB",batchDepth:40,utilizationRate:"90.64%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"8.17 PB",batchDepth:41,utilizationRate:"90.65%"}],[$t.STRONG]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"36.73 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"5.47 MB",batchDepth:18,utilizationRate:"0.50%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"92.07 MB",batchDepth:19,utilizationRate:"4.18%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"564.95 MB",batchDepth:20,utilizationRate:"12.85%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.13 GB",batchDepth:21,utilizationRate:"24.86%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"6.35 GB",batchDepth:22,utilizationRate:"36.97%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"16.38 GB",batchDepth:23,utilizationRate:"47.67%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"38.66 GB",batchDepth:24,utilizationRate:"56.26%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"86.69 GB",batchDepth:25,utilizationRate:"63.07%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"187.31 GB",batchDepth:26,utilizationRate:"68.14%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"391.64 GB",batchDepth:27,utilizationRate:"71.24%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"816.39 GB",batchDepth:28,utilizationRate:"72.59%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.68 TB",batchDepth:29,utilizationRate:"76.34%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.43 TB",batchDepth:30,utilizationRate:"77.89%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"6.94 TB",batchDepth:31,utilizationRate:"78.86%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"14.02 TB",batchDepth:32,utilizationRate:"79.71%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"28.23 TB",batchDepth:33,utilizationRate:"80.23%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"56.72 TB",batchDepth:34,utilizationRate:"80.60%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"113.82 TB",batchDepth:35,utilizationRate:"80.88%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"228.18 TB",batchDepth:36,utilizationRate:"81.06%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"457.10 TB",batchDepth:37,utilizationRate:"81.20%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"915.26 TB",batchDepth:38,utilizationRate:"81.26%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"1.83 PB",batchDepth:39,utilizationRate:"81.30%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"3.67 PB",batchDepth:40,utilizationRate:"81.43%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"7.34 PB",batchDepth:41,utilizationRate:"81.45%"}],[$t.INSANE]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"33.26 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"4.96 MB",batchDepth:18,utilizationRate:"0.45%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"83.38 MB",batchDepth:19,utilizationRate:"3.79%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"511.65 MB",batchDepth:20,utilizationRate:"11.64%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"1.93 GB",batchDepth:21,utilizationRate:"22.52%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"5.75 GB",batchDepth:22,utilizationRate:"33.50%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"14.84 GB",batchDepth:23,utilizationRate:"43.19%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"35.02 GB",batchDepth:24,utilizationRate:"50.96%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"78.51 GB",batchDepth:25,utilizationRate:"57.12%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"169.64 GB",batchDepth:26,utilizationRate:"61.71%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"354.69 GB",batchDepth:27,utilizationRate:"64.52%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"739.37 GB",batchDepth:28,utilizationRate:"65.74%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.52 TB",batchDepth:29,utilizationRate:"69.15%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.10 TB",batchDepth:30,utilizationRate:"70.56%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"6.29 TB",batchDepth:31,utilizationRate:"71.48%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"12.70 TB",batchDepth:32,utilizationRate:"72.18%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"25.57 TB",batchDepth:33,utilizationRate:"72.67%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"51.37 TB",batchDepth:34,utilizationRate:"73.00%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"103.08 TB",batchDepth:35,utilizationRate:"73.24%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"206.65 TB",batchDepth:36,utilizationRate:"73.42%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"413.98 TB",batchDepth:37,utilizationRate:"73.54%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"828.91 TB",batchDepth:38,utilizationRate:"73.59%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"1.66 PB",batchDepth:39,utilizationRate:"73.62%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"3.32 PB",batchDepth:40,utilizationRate:"73.72%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"6.64 PB",batchDepth:41,utilizationRate:"73.74%"}],[$t.PARANOID]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"13.17 kB",batchDepth:17,utilizationRate:"0.00%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"1.96 MB",batchDepth:18,utilizationRate:"0.18%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"33.01 MB",batchDepth:19,utilizationRate:"1.50%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"202.53 MB",batchDepth:20,utilizationRate:"4.61%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"765.05 MB",batchDepth:21,utilizationRate:"8.68%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"2.28 GB",batchDepth:22,utilizationRate:"13.27%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"5.87 GB",batchDepth:23,utilizationRate:"17.08%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"13.86 GB",batchDepth:24,utilizationRate:"20.17%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"31.08 GB",batchDepth:25,utilizationRate:"22.61%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"67.15 GB",batchDepth:26,utilizationRate:"24.43%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"140.40 GB",batchDepth:27,utilizationRate:"25.54%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"292.67 GB",batchDepth:28,utilizationRate:"26.03%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"602.12 GB",batchDepth:29,utilizationRate:"27.35%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"1.23 TB",batchDepth:30,utilizationRate:"27.94%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"2.49 TB",batchDepth:31,utilizationRate:"28.32%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"5.03 TB",batchDepth:32,utilizationRate:"28.60%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"10.12 TB",batchDepth:33,utilizationRate:"28.77%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"20.34 TB",batchDepth:34,utilizationRate:"28.91%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"40.80 TB",batchDepth:35,utilizationRate:"29.00%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"81.80 TB",batchDepth:36,utilizationRate:"29.06%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"163.87 TB",batchDepth:37,utilizationRate:"29.11%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"328.11 TB",batchDepth:38,utilizationRate:"29.14%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"656.76 TB",batchDepth:39,utilizationRate:"29.16%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"1.31 PB",batchDepth:40,utilizationRate:"29.18%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"2.63 PB",batchDepth:41,utilizationRate:"29.19%"}]}};class lr{constructor(e){this.seconds=Math.ceil(e),e<0&&(this.seconds=0)}static fromMilliseconds(e){return new lr(e/1e3)}static fromSeconds(e){return new lr(e)}static fromHours(e){return new lr(e*60*60)}static fromDays(e){return new lr(e*24*60*60)}static fromWeeks(e){return new lr(e*7*24*60*60)}static fromYears(e){return new lr(e*365*24*60*60)}static fromEndDate(e,t){return new lr((e.getTime()-(t??new Date).getTime())/1e3)}static parseFromString(e){return lr.fromSeconds(Mf.make(e)/1e3)}toSeconds(){return this.seconds}toHours(){return this.seconds/60/60}toDays(){return this.seconds/24/60/60}toWeeks(){return this.seconds/7/24/60/60}toYears(){return this.seconds/365/24/60/60}toEndDate(e){return new Date((e??new Date).getTime()+this.seconds*1e3)}represent(){return Mf.secondsToHumanTime(this.seconds)}isZero(){return this.seconds===0}}lr.ZERO=new lr(0);class Ir{constructor(e){if(this.bytes=Math.ceil(e),e<0)throw Error("Size must be at least 0")}static fromBytes(e){return new Ir(e)}static fromKilobytes(e){return new Ir(e*1e3)}static fromMegabytes(e){return new Ir(e*1e3*1e3)}static fromGigabytes(e){return new Ir(e*1e3*1e3*1e3)}static parseFromString(e){return Ir.fromBytes(Ed.makeStorage(e,1e3))}toBytes(){return this.bytes}toGigabytes(){return this.bytes/1e3/1e3/1e3}toFormattedString(){return Ed.convertBytes(this.bytes,1e3)}represent(){return this.toFormattedString()}}class _e{constructor(e){this.state=e}static fromDecimalString(e){return new _e(Gr.fromDecimalString(e,_e.DIGITS))}static fromPLUR(e){return new _e(new Gr(e,_e.DIGITS))}toPLURString(){return this.state.toString()}toPLURBigInt(){return this.state.value}toDecimalString(){return this.state.toDecimalString()}toSignificantDigits(e){return this.toDecimalString().slice(0,this.toDecimalString().indexOf(".")+e+1)}plus(e){return new _e(this.state.add(e instanceof _e?e.state:new Gr(e,_e.DIGITS)))}minus(e){return new _e(this.state.subtract(e instanceof _e?e.state:new Gr(e,_e.DIGITS)))}divide(e){return new _e(this.state.divmod(e)[0])}gt(e){return this.state.compare(e.state)===1}gte(e){return this.state.compare(e.state)!==-1}lt(e){return this.state.compare(e.state)===-1}lte(e){return this.state.compare(e.state)!==1}eq(e){return this.state.compare(e.state)===0}exchangeToDAI(e){return vt.fromWei(this.state.exchange("*",new Gr(e.toWeiBigInt(),vt.DIGITS),vt.DIGITS).value)}}_e.DIGITS=16;class vt{constructor(e){this.state=e}static fromDecimalString(e){return new vt(Gr.fromDecimalString(e,vt.DIGITS))}static fromWei(e){return new vt(new Gr(e,vt.DIGITS))}toWeiString(){return this.state.toString()}toWeiBigInt(){return this.state.value}toDecimalString(){return this.state.toDecimalString()}toSignificantDigits(e){return this.toDecimalString().slice(0,this.toDecimalString().indexOf(".")+e+1)}plus(e){return new vt(this.state.add(e instanceof vt?e.state:new Gr(e,vt.DIGITS)))}minus(e){return new vt(this.state.subtract(e instanceof vt?e.state:new Gr(e,vt.DIGITS)))}divide(e){return new vt(this.state.divmod(e)[0])}gt(e){return this.state.compare(e.state)===1}gte(e){return this.state.compare(e.state)!==-1}lt(e){return this.state.compare(e.state)===-1}lte(e){return this.state.compare(e.state)!==1}eq(e){return this.state.compare(e.state)===0}exchangeToBZZ(e){return _e.fromPLUR(this.state.exchange("/",new Gr(e.toWeiBigInt(),vt.DIGITS),_e.DIGITS).value)}}vt.DIGITS=18;var fa={exports:{}},Cd;function b0(){if(Cd)return fa.exports;Cd=1;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(U,V,L){return Function.prototype.apply.call(U,V,L)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(U){return Object.getOwnPropertyNames(U).concat(Object.getOwnPropertySymbols(U))}:t=function(U){return Object.getOwnPropertyNames(U)};function n(F){console&&console.warn&&console.warn(F)}var i=Number.isNaN||function(U){return U!==U};function a(){a.init.call(this)}fa.exports=a,fa.exports.once=v,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function u(F){if(typeof F!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof F)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(F){if(typeof F!="number"||F<0||i(F))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+F+".");c=F}}),a.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},a.prototype.setMaxListeners=function(U){if(typeof U!="number"||U<0||i(U))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+U+".");return this._maxListeners=U,this};function l(F){return F._maxListeners===void 0?a.defaultMaxListeners:F._maxListeners}a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(U){for(var V=[],L=1;L<arguments.length;L++)V.push(arguments[L]);var G=U==="error",Q=this._events;if(Q!==void 0)G=G&&Q.error===void 0;else if(!G)return!1;if(G){var re;if(V.length>0&&(re=V[0]),re instanceof Error)throw re;var de=new Error("Unhandled error."+(re?" ("+re.message+")":""));throw de.context=re,de}var z=Q[U];if(z===void 0)return!1;if(typeof z=="function")e(z,this,V);else for(var we=z.length,Te=O(z,we),L=0;L<we;++L)e(Te[L],this,V);return!0};function d(F,U,V,L){var G,Q,re;if(u(V),Q=F._events,Q===void 0?(Q=F._events=Object.create(null),F._eventsCount=0):(Q.newListener!==void 0&&(F.emit("newListener",U,V.listener?V.listener:V),Q=F._events),re=Q[U]),re===void 0)re=Q[U]=V,++F._eventsCount;else if(typeof re=="function"?re=Q[U]=L?[V,re]:[re,V]:L?re.unshift(V):re.push(V),G=l(F),G>0&&re.length>G&&!re.warned){re.warned=!0;var de=new Error("Possible EventEmitter memory leak detected. "+re.length+" "+String(U)+" listeners added. Use emitter.setMaxListeners() to increase limit");de.name="MaxListenersExceededWarning",de.emitter=F,de.type=U,de.count=re.length,n(de)}return F}a.prototype.addListener=function(U,V){return d(this,U,V,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(U,V){return d(this,U,V,!0)};function h(){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 m(F,U,V){var L={fired:!1,wrapFn:void 0,target:F,type:U,listener:V},G=h.bind(L);return G.listener=V,L.wrapFn=G,G}a.prototype.once=function(U,V){return u(V),this.on(U,m(this,U,V)),this},a.prototype.prependOnceListener=function(U,V){return u(V),this.prependListener(U,m(this,U,V)),this},a.prototype.removeListener=function(U,V){var L,G,Q,re,de;if(u(V),G=this._events,G===void 0)return this;if(L=G[U],L===void 0)return this;if(L===V||L.listener===V)--this._eventsCount===0?this._events=Object.create(null):(delete G[U],G.removeListener&&this.emit("removeListener",U,L.listener||V));else if(typeof L!="function"){for(Q=-1,re=L.length-1;re>=0;re--)if(L[re]===V||L[re].listener===V){de=L[re].listener,Q=re;break}if(Q<0)return this;Q===0?L.shift():R(L,Q),L.length===1&&(G[U]=L[0]),G.removeListener!==void 0&&this.emit("removeListener",U,de||V)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(U){var V,L,G;if(L=this._events,L===void 0)return this;if(L.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):L[U]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete L[U]),this;if(arguments.length===0){var Q=Object.keys(L),re;for(G=0;G<Q.length;++G)re=Q[G],re!=="removeListener"&&this.removeAllListeners(re);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(V=L[U],typeof V=="function")this.removeListener(U,V);else if(V!==void 0)for(G=V.length-1;G>=0;G--)this.removeListener(U,V[G]);return this};function y(F,U,V){var L=F._events;if(L===void 0)return[];var G=L[U];return G===void 0?[]:typeof G=="function"?V?[G.listener||G]:[G]:V?P(G):O(G,G.length)}a.prototype.listeners=function(U){return y(this,U,!0)},a.prototype.rawListeners=function(U){return y(this,U,!1)},a.listenerCount=function(F,U){return typeof F.listenerCount=="function"?F.listenerCount(U):E.call(F,U)},a.prototype.listenerCount=E;function E(F){var U=this._events;if(U!==void 0){var V=U[F];if(typeof V=="function")return 1;if(V!==void 0)return V.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function O(F,U){for(var V=new Array(U),L=0;L<U;++L)V[L]=F[L];return V}function R(F,U){for(;U+1<F.length;U++)F[U]=F[U+1];F.pop()}function P(F){for(var U=new Array(F.length),V=0;V<U.length;++V)U[V]=F[V].listener||F[V];return U}function v(F,U){return new Promise(function(V,L){function G(re){F.removeListener(U,Q),L(re)}function Q(){typeof F.removeListener=="function"&&F.removeListener("error",G),V([].slice.call(arguments))}N(F,U,Q,{once:!0}),U!=="error"&&C(F,G,{once:!0})})}function C(F,U,V){typeof F.on=="function"&&N(F,"error",U,V)}function N(F,U,V,L){if(typeof F.on=="function")L.once?F.once(U,V):F.on(U,V);else if(typeof F.addEventListener=="function")F.addEventListener(U,function G(Q){L.once&&F.removeEventListener(U,G),V(Q)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof F)}return fa.exports}var ha={exports:{}},Pd;function Jn(){return Pd||(Pd=1,typeof Object.create=="function"?ha.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ha.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),ha.exports}var Yc,Nd;function Dx(){return Nd||(Nd=1,Yc=b0().EventEmitter),Yc}var Xc={},kd;function eo(){return kd||(kd=1,(function(r){Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e={},t={};t.byteLength=h,t.toByteArray=y,t.fromByteArray=R;for(var n=[],i=[],a=typeof Uint8Array<"u"?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,l=c.length;u<l;++u)n[u]=c[u],i[c.charCodeAt(u)]=u;i[45]=62,i[95]=63;function d(C){var N=C.length;if(N%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var F=C.indexOf("=");F===-1&&(F=N);var U=F===N?0:4-F%4;return[F,U]}function h(C){var N=d(C),F=N[0],U=N[1];return(F+U)*3/4-U}function m(C,N,F){return(N+F)*3/4-F}function y(C){var N,F=d(C),U=F[0],V=F[1],L=new a(m(C,U,V)),G=0,Q=V>0?U-4:U,re;for(re=0;re<Q;re+=4)N=i[C.charCodeAt(re)]<<18|i[C.charCodeAt(re+1)]<<12|i[C.charCodeAt(re+2)]<<6|i[C.charCodeAt(re+3)],L[G++]=N>>16&255,L[G++]=N>>8&255,L[G++]=N&255;return V===2&&(N=i[C.charCodeAt(re)]<<2|i[C.charCodeAt(re+1)]>>4,L[G++]=N&255),V===1&&(N=i[C.charCodeAt(re)]<<10|i[C.charCodeAt(re+1)]<<4|i[C.charCodeAt(re+2)]>>2,L[G++]=N>>8&255,L[G++]=N&255),L}function E(C){return n[C>>18&63]+n[C>>12&63]+n[C>>6&63]+n[C&63]}function O(C,N,F){for(var U,V=[],L=N;L<F;L+=3)U=(C[L]<<16&16711680)+(C[L+1]<<8&65280)+(C[L+2]&255),V.push(E(U));return V.join("")}function R(C){for(var N,F=C.length,U=F%3,V=[],L=16383,G=0,Q=F-U;G<Q;G+=L)V.push(O(C,G,G+L>Q?Q:G+L));return U===1?(N=C[F-1],V.push(n[N>>2]+n[N<<4&63]+"==")):U===2&&(N=(C[F-2]<<8)+C[F-1],V.push(n[N>>10]+n[N>>4&63]+n[N<<2&63]+"=")),V.join("")}var P={};P.read=function(C,N,F,U,V){var L,G,Q=V*8-U-1,re=(1<<Q)-1,de=re>>1,z=-7,we=F?V-1:0,Te=F?-1:1,ae=C[N+we];for(we+=Te,L=ae&(1<<-z)-1,ae>>=-z,z+=Q;z>0;L=L*256+C[N+we],we+=Te,z-=8);for(G=L&(1<<-z)-1,L>>=-z,z+=U;z>0;G=G*256+C[N+we],we+=Te,z-=8);if(L===0)L=1-de;else{if(L===re)return G?NaN:(ae?-1:1)*(1/0);G=G+Math.pow(2,U),L=L-de}return(ae?-1:1)*G*Math.pow(2,L-U)},P.write=function(C,N,F,U,V,L){var G,Q,re,de=L*8-V-1,z=(1<<de)-1,we=z>>1,Te=V===23?Math.pow(2,-24)-Math.pow(2,-77):0,ae=U?0:L-1,be=U?1:-1,Ee=N<0||N===0&&1/N<0?1:0;for(N=Math.abs(N),isNaN(N)||N===1/0?(Q=isNaN(N)?1:0,G=z):(G=Math.floor(Math.log(N)/Math.LN2),N*(re=Math.pow(2,-G))<1&&(G--,re*=2),G+we>=1?N+=Te/re:N+=Te*Math.pow(2,1-we),N*re>=2&&(G++,re/=2),G+we>=z?(Q=0,G=z):G+we>=1?(Q=(N*re-1)*Math.pow(2,V),G=G+we):(Q=N*Math.pow(2,we-1)*Math.pow(2,V),G=0));V>=8;C[F+ae]=Q&255,ae+=be,Q/=256,V-=8);for(G=G<<V|Q,de+=V;de>0;C[F+ae]=G&255,ae+=be,G/=256,de-=8);C[F+ae-be]|=Ee*128};(function(C){const N=t,F=P,U=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;C.Buffer=z,C.SlowBuffer=q,C.INSPECT_MAX_BYTES=50;const V=2147483647;C.kMaxLength=V;const{Uint8Array:L,ArrayBuffer:G,SharedArrayBuffer:Q}=globalThis;z.TYPED_ARRAY_SUPPORT=re(),!z.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 re(){try{const S=new L(1),x={foo:function(){return 42}};return Object.setPrototypeOf(x,L.prototype),Object.setPrototypeOf(S,x),S.foo()===42}catch{return!1}}Object.defineProperty(z.prototype,"parent",{enumerable:!0,get:function(){if(z.isBuffer(this))return this.buffer}}),Object.defineProperty(z.prototype,"offset",{enumerable:!0,get:function(){if(z.isBuffer(this))return this.byteOffset}});function de(S){if(S>V)throw new RangeError('The value "'+S+'" is invalid for option "size"');const x=new L(S);return Object.setPrototypeOf(x,z.prototype),x}function z(S,x,w){if(typeof S=="number"){if(typeof x=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return be(S)}return we(S,x,w)}z.poolSize=8192;function we(S,x,w){if(typeof S=="string")return Ee(S,x);if(G.isView(S))return Oe(S);if(S==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S);if(dr(S,G)||S&&dr(S.buffer,G)||typeof Q<"u"&&(dr(S,Q)||S&&dr(S.buffer,Q)))return Ne(S,x,w);if(typeof S=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const _=S.valueOf&&S.valueOf();if(_!=null&&_!==S)return z.from(_,x,w);const W=X(S);if(W)return W;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof S[Symbol.toPrimitive]=="function")return z.from(S[Symbol.toPrimitive]("string"),x,w);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S)}z.from=function(S,x,w){return we(S,x,w)},Object.setPrototypeOf(z.prototype,L.prototype),Object.setPrototypeOf(z,L);function Te(S){if(typeof S!="number")throw new TypeError('"size" argument must be of type number');if(S<0)throw new RangeError('The value "'+S+'" is invalid for option "size"')}function ae(S,x,w){return Te(S),S<=0?de(S):x!==void 0?typeof w=="string"?de(S).fill(x,w):de(S).fill(x):de(S)}z.alloc=function(S,x,w){return ae(S,x,w)};function be(S){return Te(S),de(S<0?0:ge(S)|0)}z.allocUnsafe=function(S){return be(S)},z.allocUnsafeSlow=function(S){return be(S)};function Ee(S,x){if((typeof x!="string"||x==="")&&(x="utf8"),!z.isEncoding(x))throw new TypeError("Unknown encoding: "+x);const w=Y(S,x)|0;let _=de(w);const W=_.write(S,x);return W!==w&&(_=_.slice(0,W)),_}function Re(S){const x=S.length<0?0:ge(S.length)|0,w=de(x);for(let _=0;_<x;_+=1)w[_]=S[_]&255;return w}function Oe(S){if(dr(S,L)){const x=new L(S);return Ne(x.buffer,x.byteOffset,x.byteLength)}return Re(S)}function Ne(S,x,w){if(x<0||S.byteLength<x)throw new RangeError('"offset" is outside of buffer bounds');if(S.byteLength<x+(w||0))throw new RangeError('"length" is outside of buffer bounds');let _;return x===void 0&&w===void 0?_=new L(S):w===void 0?_=new L(S,x):_=new L(S,x,w),Object.setPrototypeOf(_,z.prototype),_}function X(S){if(z.isBuffer(S)){const x=ge(S.length)|0,w=de(x);return w.length===0||S.copy(w,0,0,x),w}if(S.length!==void 0)return typeof S.length!="number"||Hi(S.length)?de(0):Re(S);if(S.type==="Buffer"&&Array.isArray(S.data))return Re(S.data)}function ge(S){if(S>=V)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V.toString(16)+" bytes");return S|0}function q(S){return+S!=S&&(S=0),z.alloc(+S)}z.isBuffer=function(x){return x!=null&&x._isBuffer===!0&&x!==z.prototype},z.compare=function(x,w){if(dr(x,L)&&(x=z.from(x,x.offset,x.byteLength)),dr(w,L)&&(w=z.from(w,w.offset,w.byteLength)),!z.isBuffer(x)||!z.isBuffer(w))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(x===w)return 0;let _=x.length,W=w.length;for(let te=0,ue=Math.min(_,W);te<ue;++te)if(x[te]!==w[te]){_=x[te],W=w[te];break}return _<W?-1:W<_?1:0},z.isEncoding=function(x){switch(String(x).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}},z.concat=function(x,w){if(!Array.isArray(x))throw new TypeError('"list" argument must be an Array of Buffers');if(x.length===0)return z.alloc(0);let _;if(w===void 0)for(w=0,_=0;_<x.length;++_)w+=x[_].length;const W=z.allocUnsafe(w);let te=0;for(_=0;_<x.length;++_){let ue=x[_];if(dr(ue,L))te+ue.length>W.length?(z.isBuffer(ue)||(ue=z.from(ue)),ue.copy(W,te)):L.prototype.set.call(W,ue,te);else if(z.isBuffer(ue))ue.copy(W,te);else throw new TypeError('"list" argument must be an Array of Buffers');te+=ue.length}return W};function Y(S,x){if(z.isBuffer(S))return S.length;if(G.isView(S)||dr(S,G))return S.byteLength;if(typeof S!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof S);const w=S.length,_=arguments.length>2&&arguments[2]===!0;if(!_&&w===0)return 0;let W=!1;for(;;)switch(x){case"ascii":case"latin1":case"binary":return w;case"utf8":case"utf-8":return st(S).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w*2;case"hex":return w>>>1;case"base64":return Ke(S).length;default:if(W)return _?-1:st(S).length;x=(""+x).toLowerCase(),W=!0}}z.byteLength=Y;function ee(S,x,w){let _=!1;if((x===void 0||x<0)&&(x=0),x>this.length||((w===void 0||w>this.length)&&(w=this.length),w<=0)||(w>>>=0,x>>>=0,w<=x))return"";for(S||(S="utf8");;)switch(S){case"hex":return dt(this,x,w);case"utf8":case"utf-8":return Fe(this,x,w);case"ascii":return Ft(this,x,w);case"latin1":case"binary":return oe(this,x,w);case"base64":return ye(this,x,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xt(this,x,w);default:if(_)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),_=!0}}z.prototype._isBuffer=!0;function H(S,x,w){const _=S[x];S[x]=S[w],S[w]=_}z.prototype.swap16=function(){const x=this.length;if(x%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let w=0;w<x;w+=2)H(this,w,w+1);return this},z.prototype.swap32=function(){const x=this.length;if(x%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let w=0;w<x;w+=4)H(this,w,w+3),H(this,w+1,w+2);return this},z.prototype.swap64=function(){const x=this.length;if(x%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let w=0;w<x;w+=8)H(this,w,w+7),H(this,w+1,w+6),H(this,w+2,w+5),H(this,w+3,w+4);return this},z.prototype.toString=function(){const x=this.length;return x===0?"":arguments.length===0?Fe(this,0,x):ee.apply(this,arguments)},z.prototype.toLocaleString=z.prototype.toString,z.prototype.equals=function(x){if(!z.isBuffer(x))throw new TypeError("Argument must be a Buffer");return this===x?!0:z.compare(this,x)===0},z.prototype.inspect=function(){let x="";const w=C.INSPECT_MAX_BYTES;return x=this.toString("hex",0,w).replace(/(.{2})/g,"$1 ").trim(),this.length>w&&(x+=" ... "),"<Buffer "+x+">"},U&&(z.prototype[U]=z.prototype.inspect),z.prototype.compare=function(x,w,_,W,te){if(dr(x,L)&&(x=z.from(x,x.offset,x.byteLength)),!z.isBuffer(x))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof x);if(w===void 0&&(w=0),_===void 0&&(_=x?x.length:0),W===void 0&&(W=0),te===void 0&&(te=this.length),w<0||_>x.length||W<0||te>this.length)throw new RangeError("out of range index");if(W>=te&&w>=_)return 0;if(W>=te)return-1;if(w>=_)return 1;if(w>>>=0,_>>>=0,W>>>=0,te>>>=0,this===x)return 0;let ue=te-W,je=_-w;const at=Math.min(ue,je),et=this.slice(W,te),mt=x.slice(w,_);for(let tt=0;tt<at;++tt)if(et[tt]!==mt[tt]){ue=et[tt],je=mt[tt];break}return ue<je?-1:je<ue?1:0};function $(S,x,w,_,W){if(S.length===0)return-1;if(typeof w=="string"?(_=w,w=0):w>2147483647?w=2147483647:w<-2147483648&&(w=-2147483648),w=+w,Hi(w)&&(w=W?0:S.length-1),w<0&&(w=S.length+w),w>=S.length){if(W)return-1;w=S.length-1}else if(w<0)if(W)w=0;else return-1;if(typeof x=="string"&&(x=z.from(x,_)),z.isBuffer(x))return x.length===0?-1:ie(S,x,w,_,W);if(typeof x=="number")return x=x&255,typeof L.prototype.indexOf=="function"?W?L.prototype.indexOf.call(S,x,w):L.prototype.lastIndexOf.call(S,x,w):ie(S,[x],w,_,W);throw new TypeError("val must be string, number or Buffer")}function ie(S,x,w,_,W){let te=1,ue=S.length,je=x.length;if(_!==void 0&&(_=String(_).toLowerCase(),_==="ucs2"||_==="ucs-2"||_==="utf16le"||_==="utf-16le")){if(S.length<2||x.length<2)return-1;te=2,ue/=2,je/=2,w/=2}function at(mt,tt){return te===1?mt[tt]:mt.readUInt16BE(tt*te)}let et;if(W){let mt=-1;for(et=w;et<ue;et++)if(at(S,et)===at(x,mt===-1?0:et-mt)){if(mt===-1&&(mt=et),et-mt+1===je)return mt*te}else mt!==-1&&(et-=et-mt),mt=-1}else for(w+je>ue&&(w=ue-je),et=w;et>=0;et--){let mt=!0;for(let tt=0;tt<je;tt++)if(at(S,et+tt)!==at(x,tt)){mt=!1;break}if(mt)return et}return-1}z.prototype.includes=function(x,w,_){return this.indexOf(x,w,_)!==-1},z.prototype.indexOf=function(x,w,_){return $(this,x,w,_,!0)},z.prototype.lastIndexOf=function(x,w,_){return $(this,x,w,_,!1)};function he(S,x,w,_){w=Number(w)||0;const W=S.length-w;_?(_=Number(_),_>W&&(_=W)):_=W;const te=x.length;_>te/2&&(_=te/2);let ue;for(ue=0;ue<_;++ue){const je=parseInt(x.substr(ue*2,2),16);if(Hi(je))return ue;S[w+ue]=je}return ue}function pe(S,x,w,_){return Sn(st(x,S.length-w),S,w,_)}function k(S,x,w,_){return Sn(Ze(x),S,w,_)}function D(S,x,w,_){return Sn(Ke(x),S,w,_)}function ne(S,x,w,_){return Sn(ct(x,S.length-w),S,w,_)}z.prototype.write=function(x,w,_,W){if(w===void 0)W="utf8",_=this.length,w=0;else if(_===void 0&&typeof w=="string")W=w,_=this.length,w=0;else if(isFinite(w))w=w>>>0,isFinite(_)?(_=_>>>0,W===void 0&&(W="utf8")):(W=_,_=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const te=this.length-w;if((_===void 0||_>te)&&(_=te),x.length>0&&(_<0||w<0)||w>this.length)throw new RangeError("Attempt to write outside buffer bounds");W||(W="utf8");let ue=!1;for(;;)switch(W){case"hex":return he(this,x,w,_);case"utf8":case"utf-8":return pe(this,x,w,_);case"ascii":case"latin1":case"binary":return k(this,x,w,_);case"base64":return D(this,x,w,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,x,w,_);default:if(ue)throw new TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),ue=!0}},z.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ye(S,x,w){return x===0&&w===S.length?N.fromByteArray(S):N.fromByteArray(S.slice(x,w))}function Fe(S,x,w){w=Math.min(S.length,w);const _=[];let W=x;for(;W<w;){const te=S[W];let ue=null,je=te>239?4:te>223?3:te>191?2:1;if(W+je<=w){let at,et,mt,tt;switch(je){case 1:te<128&&(ue=te);break;case 2:at=S[W+1],(at&192)===128&&(tt=(te&31)<<6|at&63,tt>127&&(ue=tt));break;case 3:at=S[W+1],et=S[W+2],(at&192)===128&&(et&192)===128&&(tt=(te&15)<<12|(at&63)<<6|et&63,tt>2047&&(tt<55296||tt>57343)&&(ue=tt));break;case 4:at=S[W+1],et=S[W+2],mt=S[W+3],(at&192)===128&&(et&192)===128&&(mt&192)===128&&(tt=(te&15)<<18|(at&63)<<12|(et&63)<<6|mt&63,tt>65535&&tt<1114112&&(ue=tt))}}ue===null?(ue=65533,je=1):ue>65535&&(ue-=65536,_.push(ue>>>10&1023|55296),ue=56320|ue&1023),_.push(ue),W+=je}return De(_)}const Be=4096;function De(S){const x=S.length;if(x<=Be)return String.fromCharCode.apply(String,S);let w="",_=0;for(;_<x;)w+=String.fromCharCode.apply(String,S.slice(_,_+=Be));return w}function Ft(S,x,w){let _="";w=Math.min(S.length,w);for(let W=x;W<w;++W)_+=String.fromCharCode(S[W]&127);return _}function oe(S,x,w){let _="";w=Math.min(S.length,w);for(let W=x;W<w;++W)_+=String.fromCharCode(S[W]);return _}function dt(S,x,w){const _=S.length;(!x||x<0)&&(x=0),(!w||w<0||w>_)&&(w=_);let W="";for(let te=x;te<w;++te)W+=Oo[S[te]];return W}function xt(S,x,w){const _=S.slice(x,w);let W="";for(let te=0;te<_.length-1;te+=2)W+=String.fromCharCode(_[te]+_[te+1]*256);return W}z.prototype.slice=function(x,w){const _=this.length;x=~~x,w=w===void 0?_:~~w,x<0?(x+=_,x<0&&(x=0)):x>_&&(x=_),w<0?(w+=_,w<0&&(w=0)):w>_&&(w=_),w<x&&(w=x);const W=this.subarray(x,w);return Object.setPrototypeOf(W,z.prototype),W};function Xe(S,x,w){if(S%1!==0||S<0)throw new RangeError("offset is not uint");if(S+x>w)throw new RangeError("Trying to access beyond buffer length")}z.prototype.readUintLE=z.prototype.readUIntLE=function(x,w,_){x=x>>>0,w=w>>>0,_||Xe(x,w,this.length);let W=this[x],te=1,ue=0;for(;++ue<w&&(te*=256);)W+=this[x+ue]*te;return W},z.prototype.readUintBE=z.prototype.readUIntBE=function(x,w,_){x=x>>>0,w=w>>>0,_||Xe(x,w,this.length);let W=this[x+--w],te=1;for(;w>0&&(te*=256);)W+=this[x+--w]*te;return W},z.prototype.readUint8=z.prototype.readUInt8=function(x,w){return x=x>>>0,w||Xe(x,1,this.length),this[x]},z.prototype.readUint16LE=z.prototype.readUInt16LE=function(x,w){return x=x>>>0,w||Xe(x,2,this.length),this[x]|this[x+1]<<8},z.prototype.readUint16BE=z.prototype.readUInt16BE=function(x,w){return x=x>>>0,w||Xe(x,2,this.length),this[x]<<8|this[x+1]},z.prototype.readUint32LE=z.prototype.readUInt32LE=function(x,w){return x=x>>>0,w||Xe(x,4,this.length),(this[x]|this[x+1]<<8|this[x+2]<<16)+this[x+3]*16777216},z.prototype.readUint32BE=z.prototype.readUInt32BE=function(x,w){return x=x>>>0,w||Xe(x,4,this.length),this[x]*16777216+(this[x+1]<<16|this[x+2]<<8|this[x+3])},z.prototype.readBigUInt64LE=Fr(function(x){x=x>>>0,K(x,"offset");const w=this[x],_=this[x+7];(w===void 0||_===void 0)&&Z(x,this.length-8);const W=w+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24,te=this[++x]+this[++x]*2**8+this[++x]*2**16+_*2**24;return BigInt(W)+(BigInt(te)<<BigInt(32))}),z.prototype.readBigUInt64BE=Fr(function(x){x=x>>>0,K(x,"offset");const w=this[x],_=this[x+7];(w===void 0||_===void 0)&&Z(x,this.length-8);const W=w*2**24+this[++x]*2**16+this[++x]*2**8+this[++x],te=this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+_;return(BigInt(W)<<BigInt(32))+BigInt(te)}),z.prototype.readIntLE=function(x,w,_){x=x>>>0,w=w>>>0,_||Xe(x,w,this.length);let W=this[x],te=1,ue=0;for(;++ue<w&&(te*=256);)W+=this[x+ue]*te;return te*=128,W>=te&&(W-=Math.pow(2,8*w)),W},z.prototype.readIntBE=function(x,w,_){x=x>>>0,w=w>>>0,_||Xe(x,w,this.length);let W=w,te=1,ue=this[x+--W];for(;W>0&&(te*=256);)ue+=this[x+--W]*te;return te*=128,ue>=te&&(ue-=Math.pow(2,8*w)),ue},z.prototype.readInt8=function(x,w){return x=x>>>0,w||Xe(x,1,this.length),this[x]&128?(255-this[x]+1)*-1:this[x]},z.prototype.readInt16LE=function(x,w){x=x>>>0,w||Xe(x,2,this.length);const _=this[x]|this[x+1]<<8;return _&32768?_|4294901760:_},z.prototype.readInt16BE=function(x,w){x=x>>>0,w||Xe(x,2,this.length);const _=this[x+1]|this[x]<<8;return _&32768?_|4294901760:_},z.prototype.readInt32LE=function(x,w){return x=x>>>0,w||Xe(x,4,this.length),this[x]|this[x+1]<<8|this[x+2]<<16|this[x+3]<<24},z.prototype.readInt32BE=function(x,w){return x=x>>>0,w||Xe(x,4,this.length),this[x]<<24|this[x+1]<<16|this[x+2]<<8|this[x+3]},z.prototype.readBigInt64LE=Fr(function(x){x=x>>>0,K(x,"offset");const w=this[x],_=this[x+7];(w===void 0||_===void 0)&&Z(x,this.length-8);const W=this[x+4]+this[x+5]*2**8+this[x+6]*2**16+(_<<24);return(BigInt(W)<<BigInt(32))+BigInt(w+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24)}),z.prototype.readBigInt64BE=Fr(function(x){x=x>>>0,K(x,"offset");const w=this[x],_=this[x+7];(w===void 0||_===void 0)&&Z(x,this.length-8);const W=(w<<24)+this[++x]*2**16+this[++x]*2**8+this[++x];return(BigInt(W)<<BigInt(32))+BigInt(this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+_)}),z.prototype.readFloatLE=function(x,w){return x=x>>>0,w||Xe(x,4,this.length),F.read(this,x,!0,23,4)},z.prototype.readFloatBE=function(x,w){return x=x>>>0,w||Xe(x,4,this.length),F.read(this,x,!1,23,4)},z.prototype.readDoubleLE=function(x,w){return x=x>>>0,w||Xe(x,8,this.length),F.read(this,x,!0,52,8)},z.prototype.readDoubleBE=function(x,w){return x=x>>>0,w||Xe(x,8,this.length),F.read(this,x,!1,52,8)};function nt(S,x,w,_,W,te){if(!z.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(x>W||x<te)throw new RangeError('"value" argument is out of bounds');if(w+_>S.length)throw new RangeError("Index out of range")}z.prototype.writeUintLE=z.prototype.writeUIntLE=function(x,w,_,W){if(x=+x,w=w>>>0,_=_>>>0,!W){const je=Math.pow(2,8*_)-1;nt(this,x,w,_,je,0)}let te=1,ue=0;for(this[w]=x&255;++ue<_&&(te*=256);)this[w+ue]=x/te&255;return w+_},z.prototype.writeUintBE=z.prototype.writeUIntBE=function(x,w,_,W){if(x=+x,w=w>>>0,_=_>>>0,!W){const je=Math.pow(2,8*_)-1;nt(this,x,w,_,je,0)}let te=_-1,ue=1;for(this[w+te]=x&255;--te>=0&&(ue*=256);)this[w+te]=x/ue&255;return w+_},z.prototype.writeUint8=z.prototype.writeUInt8=function(x,w,_){return x=+x,w=w>>>0,_||nt(this,x,w,1,255,0),this[w]=x&255,w+1},z.prototype.writeUint16LE=z.prototype.writeUInt16LE=function(x,w,_){return x=+x,w=w>>>0,_||nt(this,x,w,2,65535,0),this[w]=x&255,this[w+1]=x>>>8,w+2},z.prototype.writeUint16BE=z.prototype.writeUInt16BE=function(x,w,_){return x=+x,w=w>>>0,_||nt(this,x,w,2,65535,0),this[w]=x>>>8,this[w+1]=x&255,w+2},z.prototype.writeUint32LE=z.prototype.writeUInt32LE=function(x,w,_){return x=+x,w=w>>>0,_||nt(this,x,w,4,4294967295,0),this[w+3]=x>>>24,this[w+2]=x>>>16,this[w+1]=x>>>8,this[w]=x&255,w+4},z.prototype.writeUint32BE=z.prototype.writeUInt32BE=function(x,w,_){return x=+x,w=w>>>0,_||nt(this,x,w,4,4294967295,0),this[w]=x>>>24,this[w+1]=x>>>16,this[w+2]=x>>>8,this[w+3]=x&255,w+4};function It(S,x,w,_,W){M(x,_,W,S,w,7);let te=Number(x&BigInt(4294967295));S[w++]=te,te=te>>8,S[w++]=te,te=te>>8,S[w++]=te,te=te>>8,S[w++]=te;let ue=Number(x>>BigInt(32)&BigInt(4294967295));return S[w++]=ue,ue=ue>>8,S[w++]=ue,ue=ue>>8,S[w++]=ue,ue=ue>>8,S[w++]=ue,w}function Et(S,x,w,_,W){M(x,_,W,S,w,7);let te=Number(x&BigInt(4294967295));S[w+7]=te,te=te>>8,S[w+6]=te,te=te>>8,S[w+5]=te,te=te>>8,S[w+4]=te;let ue=Number(x>>BigInt(32)&BigInt(4294967295));return S[w+3]=ue,ue=ue>>8,S[w+2]=ue,ue=ue>>8,S[w+1]=ue,ue=ue>>8,S[w]=ue,w+8}z.prototype.writeBigUInt64LE=Fr(function(x,w=0){return It(this,x,w,BigInt(0),BigInt("0xffffffffffffffff"))}),z.prototype.writeBigUInt64BE=Fr(function(x,w=0){return Et(this,x,w,BigInt(0),BigInt("0xffffffffffffffff"))}),z.prototype.writeIntLE=function(x,w,_,W){if(x=+x,w=w>>>0,!W){const at=Math.pow(2,8*_-1);nt(this,x,w,_,at-1,-at)}let te=0,ue=1,je=0;for(this[w]=x&255;++te<_&&(ue*=256);)x<0&&je===0&&this[w+te-1]!==0&&(je=1),this[w+te]=(x/ue>>0)-je&255;return w+_},z.prototype.writeIntBE=function(x,w,_,W){if(x=+x,w=w>>>0,!W){const at=Math.pow(2,8*_-1);nt(this,x,w,_,at-1,-at)}let te=_-1,ue=1,je=0;for(this[w+te]=x&255;--te>=0&&(ue*=256);)x<0&&je===0&&this[w+te+1]!==0&&(je=1),this[w+te]=(x/ue>>0)-je&255;return w+_},z.prototype.writeInt8=function(x,w,_){return x=+x,w=w>>>0,_||nt(this,x,w,1,127,-128),x<0&&(x=255+x+1),this[w]=x&255,w+1},z.prototype.writeInt16LE=function(x,w,_){return x=+x,w=w>>>0,_||nt(this,x,w,2,32767,-32768),this[w]=x&255,this[w+1]=x>>>8,w+2},z.prototype.writeInt16BE=function(x,w,_){return x=+x,w=w>>>0,_||nt(this,x,w,2,32767,-32768),this[w]=x>>>8,this[w+1]=x&255,w+2},z.prototype.writeInt32LE=function(x,w,_){return x=+x,w=w>>>0,_||nt(this,x,w,4,2147483647,-2147483648),this[w]=x&255,this[w+1]=x>>>8,this[w+2]=x>>>16,this[w+3]=x>>>24,w+4},z.prototype.writeInt32BE=function(x,w,_){return x=+x,w=w>>>0,_||nt(this,x,w,4,2147483647,-2147483648),x<0&&(x=4294967295+x+1),this[w]=x>>>24,this[w+1]=x>>>16,this[w+2]=x>>>8,this[w+3]=x&255,w+4},z.prototype.writeBigInt64LE=Fr(function(x,w=0){return It(this,x,w,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),z.prototype.writeBigInt64BE=Fr(function(x,w=0){return Et(this,x,w,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function it(S,x,w,_,W,te){if(w+_>S.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("Index out of range")}function Ct(S,x,w,_,W){return x=+x,w=w>>>0,W||it(S,x,w,4),F.write(S,x,w,_,23,4),w+4}z.prototype.writeFloatLE=function(x,w,_){return Ct(this,x,w,!0,_)},z.prototype.writeFloatBE=function(x,w,_){return Ct(this,x,w,!1,_)};function Bt(S,x,w,_,W){return x=+x,w=w>>>0,W||it(S,x,w,8),F.write(S,x,w,_,52,8),w+8}z.prototype.writeDoubleLE=function(x,w,_){return Bt(this,x,w,!0,_)},z.prototype.writeDoubleBE=function(x,w,_){return Bt(this,x,w,!1,_)},z.prototype.copy=function(x,w,_,W){if(!z.isBuffer(x))throw new TypeError("argument should be a Buffer");if(_||(_=0),!W&&W!==0&&(W=this.length),w>=x.length&&(w=x.length),w||(w=0),W>0&&W<_&&(W=_),W===_||x.length===0||this.length===0)return 0;if(w<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=this.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("sourceEnd out of bounds");W>this.length&&(W=this.length),x.length-w<W-_&&(W=x.length-w+_);const te=W-_;return this===x&&typeof L.prototype.copyWithin=="function"?this.copyWithin(w,_,W):L.prototype.set.call(x,this.subarray(_,W),w),te},z.prototype.fill=function(x,w,_,W){if(typeof x=="string"){if(typeof w=="string"?(W=w,w=0,_=this.length):typeof _=="string"&&(W=_,_=this.length),W!==void 0&&typeof W!="string")throw new TypeError("encoding must be a string");if(typeof W=="string"&&!z.isEncoding(W))throw new TypeError("Unknown encoding: "+W);if(x.length===1){const ue=x.charCodeAt(0);(W==="utf8"&&ue<128||W==="latin1")&&(x=ue)}}else typeof x=="number"?x=x&255:typeof x=="boolean"&&(x=Number(x));if(w<0||this.length<w||this.length<_)throw new RangeError("Out of range index");if(_<=w)return this;w=w>>>0,_=_===void 0?this.length:_>>>0,x||(x=0);let te;if(typeof x=="number")for(te=w;te<_;++te)this[te]=x;else{const ue=z.isBuffer(x)?x:z.from(x,W),je=ue.length;if(je===0)throw new TypeError('The value "'+x+'" is invalid for argument "value"');for(te=0;te<_-w;++te)this[te+w]=ue[te%je]}return this};const Yt={};function T(S,x,w){Yt[S]=class extends w{constructor(){super(),Object.defineProperty(this,"message",{value:x.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${S}]`,this.stack,delete this.name}get code(){return S}set code(W){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:W,writable:!0})}toString(){return`${this.name} [${S}]: ${this.message}`}}}T("ERR_BUFFER_OUT_OF_BOUNDS",function(S){return S?`${S} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),T("ERR_INVALID_ARG_TYPE",function(S,x){return`The "${S}" argument must be of type number. Received type ${typeof x}`},TypeError),T("ERR_OUT_OF_RANGE",function(S,x,w){let _=`The value of "${S}" is out of range.`,W=w;return Number.isInteger(w)&&Math.abs(w)>2**32?W=b(String(w)):typeof w=="bigint"&&(W=String(w),(w>BigInt(2)**BigInt(32)||w<-(BigInt(2)**BigInt(32)))&&(W=b(W)),W+="n"),_+=` It must be ${x}. Received ${W}`,_},RangeError);function b(S){let x="",w=S.length;const _=S[0]==="-"?1:0;for(;w>=_+4;w-=3)x=`_${S.slice(w-3,w)}${x}`;return`${S.slice(0,w)}${x}`}function g(S,x,w){K(x,"offset"),(S[x]===void 0||S[x+w]===void 0)&&Z(x,S.length-(w+1))}function M(S,x,w,_,W,te){if(S>w||S<x){const ue=typeof x=="bigint"?"n":"";let je;throw x===0||x===BigInt(0)?je=`>= 0${ue} and < 2${ue} ** ${(te+1)*8}${ue}`:je=`>= -(2${ue} ** ${(te+1)*8-1}${ue}) and < 2 ** ${(te+1)*8-1}${ue}`,new Yt.ERR_OUT_OF_RANGE("value",je,S)}g(_,W,te)}function K(S,x){if(typeof S!="number")throw new Yt.ERR_INVALID_ARG_TYPE(x,"number",S)}function Z(S,x,w){throw Math.floor(S)!==S?(K(S,w),new Yt.ERR_OUT_OF_RANGE("offset","an integer",S)):x<0?new Yt.ERR_BUFFER_OUT_OF_BOUNDS:new Yt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${x}`,S)}const ce=/[^+/0-9A-Za-z-_]/g;function Ue(S){if(S=S.split("=")[0],S=S.trim().replace(ce,""),S.length<2)return"";for(;S.length%4!==0;)S=S+"=";return S}function st(S,x){x=x||1/0;let w;const _=S.length;let W=null;const te=[];for(let ue=0;ue<_;++ue){if(w=S.charCodeAt(ue),w>55295&&w<57344){if(!W){if(w>56319){(x-=3)>-1&&te.push(239,191,189);continue}else if(ue+1===_){(x-=3)>-1&&te.push(239,191,189);continue}W=w;continue}if(w<56320){(x-=3)>-1&&te.push(239,191,189),W=w;continue}w=(W-55296<<10|w-56320)+65536}else W&&(x-=3)>-1&&te.push(239,191,189);if(W=null,w<128){if((x-=1)<0)break;te.push(w)}else if(w<2048){if((x-=2)<0)break;te.push(w>>6|192,w&63|128)}else if(w<65536){if((x-=3)<0)break;te.push(w>>12|224,w>>6&63|128,w&63|128)}else if(w<1114112){if((x-=4)<0)break;te.push(w>>18|240,w>>12&63|128,w>>6&63|128,w&63|128)}else throw new Error("Invalid code point")}return te}function Ze(S){const x=[];for(let w=0;w<S.length;++w)x.push(S.charCodeAt(w)&255);return x}function ct(S,x){let w,_,W;const te=[];for(let ue=0;ue<S.length&&!((x-=2)<0);++ue)w=S.charCodeAt(ue),_=w>>8,W=w%256,te.push(W),te.push(_);return te}function Ke(S){return N.toByteArray(Ue(S))}function Sn(S,x,w,_){let W;for(W=0;W<_&&!(W+w>=x.length||W>=S.length);++W)x[W+w]=S[W];return W}function dr(S,x){return S instanceof x||S!=null&&S.constructor!=null&&S.constructor.name!=null&&S.constructor.name===x.name}function Hi(S){return S!==S}const Oo=(function(){const S="0123456789abcdef",x=new Array(256);for(let w=0;w<16;++w){const _=w*16;for(let W=0;W<16;++W)x[_+W]=S[w]+S[W]}return x})();function Fr(S){return typeof BigInt>"u"?Io:S}function Io(){throw new Error("BigInt not supported")}})(e);const v=e.Buffer;r.Blob=e.Blob,r.BlobOptions=e.BlobOptions,r.Buffer=e.Buffer,r.File=e.File,r.FileOptions=e.FileOptions,r.INSPECT_MAX_BYTES=e.INSPECT_MAX_BYTES,r.SlowBuffer=e.SlowBuffer,r.TranscodeEncoding=e.TranscodeEncoding,r.atob=e.atob,r.btoa=e.btoa,r.constants=e.constants,r.default=v,r.isAscii=e.isAscii,r.isUtf8=e.isUtf8,r.kMaxLength=e.kMaxLength,r.kStringMaxLength=e.kStringMaxLength,r.resolveObjectURL=e.resolveObjectURL,r.transcode=e.transcode})(Xc)),Xc}var Zc={},eu={},tu,Fd;function Ux(){return Fd||(Fd=1,tu=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var c=Object.getOwnPropertySymbols(e);if(c.length!==1||c[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(e,t);if(u.value!==i||u.enumerable!==!0)return!1}return!0}),tu}var ru,Dd;function to(){if(Dd)return ru;Dd=1;var r=Ux();return ru=function(){return r()&&!!Symbol.toStringTag},ru}var nu,Ud;function Lx(){return Ud||(Ud=1,nu=Object),nu}var iu,Ld;function cE(){return Ld||(Ld=1,iu=Error),iu}var su,Md;function uE(){return Md||(Md=1,su=EvalError),su}var au,_d;function lE(){return _d||(_d=1,au=RangeError),au}var ou,Vd;function fE(){return Vd||(Vd=1,ou=ReferenceError),ou}var cu,Gd;function Mx(){return Gd||(Gd=1,cu=SyntaxError),cu}var uu,jd;function Ls(){return jd||(jd=1,uu=TypeError),uu}var lu,zd;function hE(){return zd||(zd=1,lu=URIError),lu}var fu,Hd;function dE(){return Hd||(Hd=1,fu=Math.abs),fu}var hu,qd;function pE(){return qd||(qd=1,hu=Math.floor),hu}var du,$d;function mE(){return $d||($d=1,du=Math.max),du}var pu,Kd;function bE(){return Kd||(Kd=1,pu=Math.min),pu}var mu,Wd;function xE(){return Wd||(Wd=1,mu=Math.pow),mu}var bu,Qd;function yE(){return Qd||(Qd=1,bu=Math.round),bu}var xu,Jd;function gE(){return Jd||(Jd=1,xu=Number.isNaN||function(e){return e!==e}),xu}var yu,Yd;function wE(){if(Yd)return yu;Yd=1;var r=gE();return yu=function(t){return r(t)||t===0?t:t<0?-1:1},yu}var gu,Xd;function AE(){return Xd||(Xd=1,gu=Object.getOwnPropertyDescriptor),gu}var wu,Zd;function Di(){if(Zd)return wu;Zd=1;var r=AE();if(r)try{r([],"length")}catch{r=null}return wu=r,wu}var Au,ep;function ro(){if(ep)return Au;ep=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return Au=r,Au}var Eu,tp;function EE(){if(tp)return Eu;tp=1;var r=typeof Symbol<"u"&&Symbol,e=Ux();return Eu=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Eu}var vu,rp;function _x(){return rp||(rp=1,vu=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),vu}var Ru,np;function Vx(){if(np)return Ru;np=1;var r=Lx();return Ru=r.getPrototypeOf||null,Ru}var Bu,ip;function vE(){if(ip)return Bu;ip=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(l,d){for(var h=[],m=0;m<l.length;m+=1)h[m]=l[m];for(var y=0;y<d.length;y+=1)h[y+l.length]=d[y];return h},a=function(l,d){for(var h=[],m=d,y=0;m<l.length;m+=1,y+=1)h[y]=l[m];return h},c=function(u,l){for(var d="",h=0;h<u.length;h+=1)d+=u[h],h+1<u.length&&(d+=l);return d};return Bu=function(l){var d=this;if(typeof d!="function"||e.apply(d)!==n)throw new TypeError(r+d);for(var h=a(arguments,1),m,y=function(){if(this instanceof m){var v=d.apply(this,i(h,arguments));return Object(v)===v?v:this}return d.apply(l,i(h,arguments))},E=t(0,d.length-h.length),O=[],R=0;R<E;R++)O[R]="$"+R;if(m=Function("binder","return function ("+c(O,",")+"){ return binder.apply(this,arguments); }")(y),d.prototype){var P=function(){};P.prototype=d.prototype,m.prototype=new P,P.prototype=null}return m},Bu}var Tu,sp;function Ms(){if(sp)return Tu;sp=1;var r=vE();return Tu=Function.prototype.bind||r,Tu}var Su,ap;function x0(){return ap||(ap=1,Su=Function.prototype.call),Su}var Ou,op;function y0(){return op||(op=1,Ou=Function.prototype.apply),Ou}var Iu,cp;function RE(){return cp||(cp=1,Iu=typeof Reflect<"u"&&Reflect&&Reflect.apply),Iu}var Cu,up;function Gx(){if(up)return Cu;up=1;var r=Ms(),e=y0(),t=x0(),n=RE();return Cu=n||r.call(t,e),Cu}var Pu,lp;function g0(){if(lp)return Pu;lp=1;var r=Ms(),e=Ls(),t=x0(),n=Gx();return Pu=function(a){if(a.length<1||typeof a[0]!="function")throw new e("a function is required");return n(r,t,a)},Pu}var Nu,fp;function BE(){if(fp)return Nu;fp=1;var r=g0(),e=Di(),t;try{t=[].__proto__===Array.prototype}catch(c){if(!c||typeof c!="object"||!("code"in c)||c.code!=="ERR_PROTO_ACCESS")throw c}var n=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return Nu=n&&typeof n.get=="function"?r([n.get]):typeof a=="function"?function(u){return a(u==null?u:i(u))}:!1,Nu}var ku,hp;function w0(){if(hp)return ku;hp=1;var r=_x(),e=Vx(),t=BE();return ku=r?function(i){return r(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,ku}var Fu,dp;function jx(){if(dp)return Fu;dp=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=Ms();return Fu=t.call(r,e),Fu}var Du,pp;function zx(){if(pp)return Du;pp=1;var r,e=Lx(),t=cE(),n=uE(),i=lE(),a=fE(),c=Mx(),u=Ls(),l=hE(),d=dE(),h=pE(),m=mE(),y=bE(),E=xE(),O=yE(),R=wE(),P=Function,v=function(he){try{return P('"use strict"; return ('+he+").constructor;")()}catch{}},C=Di(),N=ro(),F=function(){throw new u},U=C?(function(){try{return arguments.callee,F}catch{try{return C(arguments,"callee").get}catch{return F}}})():F,V=EE()(),L=w0(),G=Vx(),Q=_x(),re=y0(),de=x0(),z={},we=typeof Uint8Array>"u"||!L?r:L(Uint8Array),Te={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":V&&L?L([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":z,"%AsyncGenerator%":z,"%AsyncGeneratorFunction%":z,"%AsyncIteratorPrototype%":z,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":P,"%GeneratorFunction%":z,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":V&&L?L(L([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!V||!L?r:L(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":C,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!V||!L?r:L(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":V&&L?L(""[Symbol.iterator]()):r,"%Symbol%":V?Symbol:r,"%SyntaxError%":c,"%ThrowTypeError%":U,"%TypedArray%":we,"%TypeError%":u,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":de,"%Function.prototype.apply%":re,"%Object.defineProperty%":N,"%Object.getPrototypeOf%":G,"%Math.abs%":d,"%Math.floor%":h,"%Math.max%":m,"%Math.min%":y,"%Math.pow%":E,"%Math.round%":O,"%Math.sign%":R,"%Reflect.getPrototypeOf%":Q};if(L)try{null.error}catch(he){var ae=L(L(he));Te["%Error.prototype%"]=ae}var be=function he(pe){var k;if(pe==="%AsyncFunction%")k=v("async function () {}");else if(pe==="%GeneratorFunction%")k=v("function* () {}");else if(pe==="%AsyncGeneratorFunction%")k=v("async function* () {}");else if(pe==="%AsyncGenerator%"){var D=he("%AsyncGeneratorFunction%");D&&(k=D.prototype)}else if(pe==="%AsyncIteratorPrototype%"){var ne=he("%AsyncGenerator%");ne&&L&&(k=L(ne.prototype))}return Te[pe]=k,k},Ee={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Re=Ms(),Oe=jx(),Ne=Re.call(de,Array.prototype.concat),X=Re.call(re,Array.prototype.splice),ge=Re.call(de,String.prototype.replace),q=Re.call(de,String.prototype.slice),Y=Re.call(de,RegExp.prototype.exec),ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,$=function(pe){var k=q(pe,0,1),D=q(pe,-1);if(k==="%"&&D!=="%")throw new c("invalid intrinsic syntax, expected closing `%`");if(D==="%"&&k!=="%")throw new c("invalid intrinsic syntax, expected opening `%`");var ne=[];return ge(pe,ee,function(ye,Fe,Be,De){ne[ne.length]=Be?ge(De,H,"$1"):Fe||ye}),ne},ie=function(pe,k){var D=pe,ne;if(Oe(Ee,D)&&(ne=Ee[D],D="%"+ne[0]+"%"),Oe(Te,D)){var ye=Te[D];if(ye===z&&(ye=be(D)),typeof ye>"u"&&!k)throw new u("intrinsic "+pe+" exists, but is not available. Please file an issue!");return{alias:ne,name:D,value:ye}}throw new c("intrinsic "+pe+" does not exist!")};return Du=function(pe,k){if(typeof pe!="string"||pe.length===0)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof k!="boolean")throw new u('"allowMissing" argument must be a boolean');if(Y(/^%?[^%]*%?$/,pe)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var D=$(pe),ne=D.length>0?D[0]:"",ye=ie("%"+ne+"%",k),Fe=ye.name,Be=ye.value,De=!1,Ft=ye.alias;Ft&&(ne=Ft[0],X(D,Ne([0,1],Ft)));for(var oe=1,dt=!0;oe<D.length;oe+=1){var xt=D[oe],Xe=q(xt,0,1),nt=q(xt,-1);if((Xe==='"'||Xe==="'"||Xe==="`"||nt==='"'||nt==="'"||nt==="`")&&Xe!==nt)throw new c("property names with quotes must have matching quotes");if((xt==="constructor"||!dt)&&(De=!0),ne+="."+xt,Fe="%"+ne+"%",Oe(Te,Fe))Be=Te[Fe];else if(Be!=null){if(!(xt in Be)){if(!k)throw new u("base intrinsic for "+pe+" exists, but the property is not available.");return}if(C&&oe+1>=D.length){var It=C(Be,xt);dt=!!It,dt&&"get"in It&&!("originalValue"in It.get)?Be=It.get:Be=Be[xt]}else dt=Oe(Be,xt),Be=Be[xt];dt&&!De&&(Te[Fe]=Be)}}return Be},Du}var Uu,mp;function _s(){if(mp)return Uu;mp=1;var r=zx(),e=g0(),t=e([r("%String.prototype.indexOf%")]);return Uu=function(i,a){var c=r(i,!!a);return typeof c=="function"&&t(i,".prototype.")>-1?e([c]):c},Uu}var Lu,bp;function TE(){if(bp)return Lu;bp=1;var r=to()(),e=_s(),t=e("Object.prototype.toString"),n=function(u){return r&&u&&typeof u=="object"&&Symbol.toStringTag in u?!1:t(u)==="[object Arguments]"},i=function(u){return n(u)?!0:u!==null&&typeof u=="object"&&"length"in u&&typeof u.length=="number"&&u.length>=0&&t(u)!=="[object Array]"&&"callee"in u&&t(u.callee)==="[object Function]"},a=(function(){return n(arguments)})();return n.isLegacyArguments=i,Lu=a?n:i,Lu}var Mu,xp;function SE(){if(xp)return Mu;xp=1;var r=_s(),e=to()(),t=jx(),n=Di(),i;if(e){var a=r("RegExp.prototype.exec"),c={},u=function(){throw c},l={toString:u,valueOf:u};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=u),i=function(y){if(!y||typeof y!="object")return!1;var E=n(y,"lastIndex"),O=E&&t(E,"value");if(!O)return!1;try{a(y,l)}catch(R){return R===c}}}else{var d=r("Object.prototype.toString"),h="[object RegExp]";i=function(y){return!y||typeof y!="object"&&typeof y!="function"?!1:d(y)===h}}return Mu=i,Mu}var _u,yp;function OE(){if(yp)return _u;yp=1;var r=_s(),e=SE(),t=r("RegExp.prototype.exec"),n=Ls();return _u=function(a){if(!e(a))throw new n("`regex` must be a RegExp");return function(u){return t(a,u)!==null}},_u}var Vu,gp;function IE(){if(gp)return Vu;gp=1;const r=(function*(){}).constructor;return Vu=()=>r,Vu}var Gu,wp;function CE(){if(wp)return Gu;wp=1;var r=_s(),e=OE(),t=e(/^\s*(?:function)?\*/),n=to()(),i=w0(),a=r("Object.prototype.toString"),c=r("Function.prototype.toString"),u=IE();return Gu=function(d){if(typeof d!="function")return!1;if(t(c(d)))return!0;if(!n){var h=a(d);return h==="[object GeneratorFunction]"}if(!i)return!1;var m=u();return m&&i(d)===m.prototype},Gu}var ju,Ap;function PE(){if(Ap)return ju;Ap=1;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,t,n;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},e(function(){throw 42},null,t)}catch(C){C!==n&&(e=null)}else e=null;var i=/^\s*class\b/,a=function(N){try{var F=r.call(N);return i.test(F)}catch{return!1}},c=function(N){try{return a(N)?!1:(r.call(N),!0)}catch{return!1}},u=Object.prototype.toString,l="[object Object]",d="[object Function]",h="[object GeneratorFunction]",m="[object HTMLAllCollection]",y="[object HTML document.all class]",E="[object HTMLCollection]",O=typeof Symbol=="function"&&!!Symbol.toStringTag,R=!(0 in[,]),P=function(){return!1};if(typeof document=="object"){var v=document.all;u.call(v)===u.call(document.all)&&(P=function(N){if((R||!N)&&(typeof N>"u"||typeof N=="object"))try{var F=u.call(N);return(F===m||F===y||F===E||F===l)&&N("")==null}catch{}return!1})}return ju=e?function(N){if(P(N))return!0;if(!N||typeof N!="function"&&typeof N!="object")return!1;try{e(N,null,t)}catch(F){if(F!==n)return!1}return!a(N)&&c(N)}:function(N){if(P(N))return!0;if(!N||typeof N!="function"&&typeof N!="object")return!1;if(O)return c(N);if(a(N))return!1;var F=u.call(N);return F!==d&&F!==h&&!/^\[object HTML/.test(F)?!1:c(N)},ju}var zu,Ep;function NE(){if(Ep)return zu;Ep=1;var r=PE(),e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,n=function(l,d,h){for(var m=0,y=l.length;m<y;m++)t.call(l,m)&&(h==null?d(l[m],m,l):d.call(h,l[m],m,l))},i=function(l,d,h){for(var m=0,y=l.length;m<y;m++)h==null?d(l.charAt(m),m,l):d.call(h,l.charAt(m),m,l)},a=function(l,d,h){for(var m in l)t.call(l,m)&&(h==null?d(l[m],m,l):d.call(h,l[m],m,l))};function c(u){return e.call(u)==="[object Array]"}return zu=function(l,d,h){if(!r(d))throw new TypeError("iterator must be a function");var m;arguments.length>=3&&(m=h),c(l)?n(l,d,m):typeof l=="string"?i(l,d,m):a(l,d,m)},zu}var Hu,vp;function kE(){return vp||(vp=1,Hu=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Hu}var qu,Rp;function FE(){if(Rp)return qu;Rp=1;var r=kE(),e=typeof globalThis>"u"?Nr:globalThis;return qu=function(){for(var n=[],i=0;i<r.length;i++)typeof e[r[i]]=="function"&&(n[n.length]=r[i]);return n},qu}var $u={exports:{}},Ku,Bp;function DE(){if(Bp)return Ku;Bp=1;var r=ro(),e=Mx(),t=Ls(),n=Di();return Ku=function(a,c,u){if(!a||typeof a!="object"&&typeof a!="function")throw new t("`obj` must be an object or a function`");if(typeof c!="string"&&typeof c!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,d=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,m=arguments.length>6?arguments[6]:!1,y=!!n&&n(a,c);if(r)r(a,c,{configurable:h===null&&y?y.configurable:!h,enumerable:l===null&&y?y.enumerable:!l,value:u,writable:d===null&&y?y.writable:!d});else if(m||!l&&!d&&!h)a[c]=u;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Ku}var Wu,Tp;function UE(){if(Tp)return Wu;Tp=1;var r=ro(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},Wu=e,Wu}var Qu,Sp;function LE(){if(Sp)return Qu;Sp=1;var r=zx(),e=DE(),t=UE()(),n=Di(),i=Ls(),a=r("%Math.floor%");return Qu=function(u,l){if(typeof u!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||a(l)!==l)throw new i("`length` must be a positive 32-bit integer");var d=arguments.length>2&&!!arguments[2],h=!0,m=!0;if("length"in u&&n){var y=n(u,"length");y&&!y.configurable&&(h=!1),y&&!y.writable&&(m=!1)}return(h||m||!d)&&(t?e(u,"length",l,!0,!0):e(u,"length",l)),u},Qu}var Ju,Op;function ME(){if(Op)return Ju;Op=1;var r=Ms(),e=y0(),t=Gx();return Ju=function(){return t(r,e,arguments)},Ju}var Ip;function _E(){return Ip||(Ip=1,(function(r){var e=LE(),t=ro(),n=g0(),i=ME();r.exports=function(c){var u=n(arguments),l=c.length-(arguments.length-1);return e(u,1+(l>0?l:0),!0)},t?t(r.exports,"apply",{value:i}):r.exports.apply=i})($u)),$u.exports}var Yu,Cp;function Hx(){if(Cp)return Yu;Cp=1;var r=NE(),e=FE(),t=_E(),n=_s(),i=Di(),a=w0(),c=n("Object.prototype.toString"),u=to()(),l=typeof globalThis>"u"?Nr:globalThis,d=e(),h=n("String.prototype.slice"),m=n("Array.prototype.indexOf",!0)||function(P,v){for(var C=0;C<P.length;C+=1)if(P[C]===v)return C;return-1},y={__proto__:null};u&&i&&a?r(d,function(R){var P=new l[R];if(Symbol.toStringTag in P&&a){var v=a(P),C=i(v,Symbol.toStringTag);if(!C&&v){var N=a(v);C=i(N,Symbol.toStringTag)}if(C&&C.get){var F=t(C.get);y["$"+R]=F}}}):r(d,function(R){var P=new l[R],v=P.slice||P.set;if(v){var C=t(v);y["$"+R]=C}});var E=function(P){var v=!1;return r(y,function(C,N){if(!v)try{"$"+C(P)===N&&(v=h(N,1))}catch{}}),v},O=function(P){var v=!1;return r(y,function(C,N){if(!v)try{C(P),v=h(N,1)}catch{}}),v};return Yu=function(P){if(!P||typeof P!="object")return!1;if(!u){var v=h(c(P),8,-1);return m(d,v)>-1?v:v!=="Object"?!1:O(P)}return i?E(P):null},Yu}var Xu,Pp;function VE(){if(Pp)return Xu;Pp=1;var r=Hx();return Xu=function(t){return!!r(t)},Xu}var Np;function GE(){return Np||(Np=1,(function(r){var e=TE(),t=CE(),n=Hx(),i=VE();function a(oe){return oe.call.bind(oe)}var c=typeof BigInt<"u",u=typeof Symbol<"u",l=a(Object.prototype.toString),d=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),m=a(Boolean.prototype.valueOf);if(c)var y=a(BigInt.prototype.valueOf);if(u)var E=a(Symbol.prototype.valueOf);function O(oe,dt){if(typeof oe!="object")return!1;try{return dt(oe),!0}catch{return!1}}r.isArgumentsObject=e,r.isGeneratorFunction=t,r.isTypedArray=i;function R(oe){return typeof Promise<"u"&&oe instanceof Promise||oe!==null&&typeof oe=="object"&&typeof oe.then=="function"&&typeof oe.catch=="function"}r.isPromise=R;function P(oe){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(oe):i(oe)||q(oe)}r.isArrayBufferView=P;function v(oe){return n(oe)==="Uint8Array"}r.isUint8Array=v;function C(oe){return n(oe)==="Uint8ClampedArray"}r.isUint8ClampedArray=C;function N(oe){return n(oe)==="Uint16Array"}r.isUint16Array=N;function F(oe){return n(oe)==="Uint32Array"}r.isUint32Array=F;function U(oe){return n(oe)==="Int8Array"}r.isInt8Array=U;function V(oe){return n(oe)==="Int16Array"}r.isInt16Array=V;function L(oe){return n(oe)==="Int32Array"}r.isInt32Array=L;function G(oe){return n(oe)==="Float32Array"}r.isFloat32Array=G;function Q(oe){return n(oe)==="Float64Array"}r.isFloat64Array=Q;function re(oe){return n(oe)==="BigInt64Array"}r.isBigInt64Array=re;function de(oe){return n(oe)==="BigUint64Array"}r.isBigUint64Array=de;function z(oe){return l(oe)==="[object Map]"}z.working=typeof Map<"u"&&z(new Map);function we(oe){return typeof Map>"u"?!1:z.working?z(oe):oe instanceof Map}r.isMap=we;function Te(oe){return l(oe)==="[object Set]"}Te.working=typeof Set<"u"&&Te(new Set);function ae(oe){return typeof Set>"u"?!1:Te.working?Te(oe):oe instanceof Set}r.isSet=ae;function be(oe){return l(oe)==="[object WeakMap]"}be.working=typeof WeakMap<"u"&&be(new WeakMap);function Ee(oe){return typeof WeakMap>"u"?!1:be.working?be(oe):oe instanceof WeakMap}r.isWeakMap=Ee;function Re(oe){return l(oe)==="[object WeakSet]"}Re.working=typeof WeakSet<"u"&&Re(new WeakSet);function Oe(oe){return Re(oe)}r.isWeakSet=Oe;function Ne(oe){return l(oe)==="[object ArrayBuffer]"}Ne.working=typeof ArrayBuffer<"u"&&Ne(new ArrayBuffer);function X(oe){return typeof ArrayBuffer>"u"?!1:Ne.working?Ne(oe):oe instanceof ArrayBuffer}r.isArrayBuffer=X;function ge(oe){return l(oe)==="[object DataView]"}ge.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&ge(new DataView(new ArrayBuffer(1),0,1));function q(oe){return typeof DataView>"u"?!1:ge.working?ge(oe):oe instanceof DataView}r.isDataView=q;var Y=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ee(oe){return l(oe)==="[object SharedArrayBuffer]"}function H(oe){return typeof Y>"u"?!1:(typeof ee.working>"u"&&(ee.working=ee(new Y)),ee.working?ee(oe):oe instanceof Y)}r.isSharedArrayBuffer=H;function $(oe){return l(oe)==="[object AsyncFunction]"}r.isAsyncFunction=$;function ie(oe){return l(oe)==="[object Map Iterator]"}r.isMapIterator=ie;function he(oe){return l(oe)==="[object Set Iterator]"}r.isSetIterator=he;function pe(oe){return l(oe)==="[object Generator]"}r.isGeneratorObject=pe;function k(oe){return l(oe)==="[object WebAssembly.Module]"}r.isWebAssemblyCompiledModule=k;function D(oe){return O(oe,d)}r.isNumberObject=D;function ne(oe){return O(oe,h)}r.isStringObject=ne;function ye(oe){return O(oe,m)}r.isBooleanObject=ye;function Fe(oe){return c&&O(oe,y)}r.isBigIntObject=Fe;function Be(oe){return u&&O(oe,E)}r.isSymbolObject=Be;function De(oe){return D(oe)||ne(oe)||ye(oe)||Fe(oe)||Be(oe)}r.isBoxedPrimitive=De;function Ft(oe){return typeof Uint8Array<"u"&&(X(oe)||H(oe))}r.isAnyArrayBuffer=Ft,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(oe){Object.defineProperty(r,oe,{enumerable:!1,value:function(){throw new Error(oe+" is not supported in userland")}})})})(eu)),eu}var Zu,kp;function jE(){return kp||(kp=1,Zu=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Zu}var Fp;function qx(){return Fp||(Fp=1,(function(r){var e={},t=Object.getOwnPropertyDescriptors||function(Y){for(var ee=Object.keys(Y),H={},$=0;$<ee.length;$++)H[ee[$]]=Object.getOwnPropertyDescriptor(Y,ee[$]);return H},n=/%[sdj%]/g;r.format=function(q){if(!V(q)){for(var Y=[],ee=0;ee<arguments.length;ee++)Y.push(u(arguments[ee]));return Y.join(" ")}for(var ee=1,H=arguments,$=H.length,ie=String(q).replace(n,function(pe){if(pe==="%%")return"%";if(ee>=$)return pe;switch(pe){case"%s":return String(H[ee++]);case"%d":return Number(H[ee++]);case"%j":try{return JSON.stringify(H[ee++])}catch{return"[Circular]"}default:return pe}}),he=H[ee];ee<$;he=H[++ee])N(he)||!re(he)?ie+=" "+he:ie+=" "+u(he);return ie},r.deprecate=function(q,Y){if(typeof Ve<"u"&&Ve.noDeprecation===!0)return q;if(typeof Ve>"u")return function(){return r.deprecate(q,Y).apply(this,arguments)};var ee=!1;function H(){if(!ee){if(Ve.throwDeprecation)throw new Error(Y);Ve.traceDeprecation?console.trace(Y):console.error(Y),ee=!0}return q.apply(this,arguments)}return H};var i={},a=/^$/;if(e.NODE_DEBUG){var c=e.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+c+"$","i")}r.debuglog=function(q){if(q=q.toUpperCase(),!i[q])if(a.test(q)){var Y=Ve.pid;i[q]=function(){var ee=r.format.apply(r,arguments);console.error("%s %d: %s",q,Y,ee)}}else i[q]=function(){};return i[q]};function u(q,Y){var ee={seen:[],stylize:d};return arguments.length>=3&&(ee.depth=arguments[2]),arguments.length>=4&&(ee.colors=arguments[3]),C(Y)?ee.showHidden=Y:Y&&r._extend(ee,Y),G(ee.showHidden)&&(ee.showHidden=!1),G(ee.depth)&&(ee.depth=2),G(ee.colors)&&(ee.colors=!1),G(ee.customInspect)&&(ee.customInspect=!0),ee.colors&&(ee.stylize=l),m(ee,q,ee.depth)}r.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function l(q,Y){var ee=u.styles[Y];return ee?"\x1B["+u.colors[ee][0]+"m"+q+"\x1B["+u.colors[ee][1]+"m":q}function d(q,Y){return q}function h(q){var Y={};return q.forEach(function(ee,H){Y[ee]=!0}),Y}function m(q,Y,ee){if(q.customInspect&&Y&&we(Y.inspect)&&Y.inspect!==r.inspect&&!(Y.constructor&&Y.constructor.prototype===Y)){var H=Y.inspect(ee,q);return V(H)||(H=m(q,H,ee)),H}var $=y(q,Y);if($)return $;var ie=Object.keys(Y),he=h(ie);if(q.showHidden&&(ie=Object.getOwnPropertyNames(Y)),z(Y)&&(ie.indexOf("message")>=0||ie.indexOf("description")>=0))return E(Y);if(ie.length===0){if(we(Y)){var pe=Y.name?": "+Y.name:"";return q.stylize("[Function"+pe+"]","special")}if(Q(Y))return q.stylize(RegExp.prototype.toString.call(Y),"regexp");if(de(Y))return q.stylize(Date.prototype.toString.call(Y),"date");if(z(Y))return E(Y)}var k="",D=!1,ne=["{","}"];if(v(Y)&&(D=!0,ne=["[","]"]),we(Y)){var ye=Y.name?": "+Y.name:"";k=" [Function"+ye+"]"}if(Q(Y)&&(k=" "+RegExp.prototype.toString.call(Y)),de(Y)&&(k=" "+Date.prototype.toUTCString.call(Y)),z(Y)&&(k=" "+E(Y)),ie.length===0&&(!D||Y.length==0))return ne[0]+k+ne[1];if(ee<0)return Q(Y)?q.stylize(RegExp.prototype.toString.call(Y),"regexp"):q.stylize("[Object]","special");q.seen.push(Y);var Fe;return D?Fe=O(q,Y,ee,he,ie):Fe=ie.map(function(Be){return R(q,Y,ee,he,Be,D)}),q.seen.pop(),P(Fe,k,ne)}function y(q,Y){if(G(Y))return q.stylize("undefined","undefined");if(V(Y)){var ee="'"+JSON.stringify(Y).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return q.stylize(ee,"string")}if(U(Y))return q.stylize(""+Y,"number");if(C(Y))return q.stylize(""+Y,"boolean");if(N(Y))return q.stylize("null","null")}function E(q){return"["+Error.prototype.toString.call(q)+"]"}function O(q,Y,ee,H,$){for(var ie=[],he=0,pe=Y.length;he<pe;++he)Oe(Y,String(he))?ie.push(R(q,Y,ee,H,String(he),!0)):ie.push("");return $.forEach(function(k){k.match(/^\d+$/)||ie.push(R(q,Y,ee,H,k,!0))}),ie}function R(q,Y,ee,H,$,ie){var he,pe,k;if(k=Object.getOwnPropertyDescriptor(Y,$)||{value:Y[$]},k.get?k.set?pe=q.stylize("[Getter/Setter]","special"):pe=q.stylize("[Getter]","special"):k.set&&(pe=q.stylize("[Setter]","special")),Oe(H,$)||(he="["+$+"]"),pe||(q.seen.indexOf(k.value)<0?(N(ee)?pe=m(q,k.value,null):pe=m(q,k.value,ee-1),pe.indexOf(`
|
|
13
|
-
`)>-1&&(ie?pe=pe.split(`
|
|
14
|
-
`).map(function(D){return" "+D}).join(`
|
|
15
|
-
`).slice(2):pe=`
|
|
16
|
-
`+pe.split(`
|
|
17
|
-
`).map(function(D){return" "+D}).join(`
|
|
18
|
-
`))):pe=q.stylize("[Circular]","special")),G(he)){if(ie&&$.match(/^\d+$/))return pe;he=JSON.stringify(""+$),he.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(he=he.slice(1,-1),he=q.stylize(he,"name")):(he=he.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),he=q.stylize(he,"string"))}return he+": "+pe}function P(q,Y,ee){var H=q.reduce(function($,ie){return ie.indexOf(`
|
|
19
|
-
`)>=0,$+ie.replace(/\u001b\[\d\d?m/g,"").length+1},0);return H>60?ee[0]+(Y===""?"":Y+`
|
|
20
|
-
`)+" "+q.join(`,
|
|
21
|
-
`)+" "+ee[1]:ee[0]+Y+" "+q.join(", ")+" "+ee[1]}r.types=GE();function v(q){return Array.isArray(q)}r.isArray=v;function C(q){return typeof q=="boolean"}r.isBoolean=C;function N(q){return q===null}r.isNull=N;function F(q){return q==null}r.isNullOrUndefined=F;function U(q){return typeof q=="number"}r.isNumber=U;function V(q){return typeof q=="string"}r.isString=V;function L(q){return typeof q=="symbol"}r.isSymbol=L;function G(q){return q===void 0}r.isUndefined=G;function Q(q){return re(q)&&ae(q)==="[object RegExp]"}r.isRegExp=Q,r.types.isRegExp=Q;function re(q){return typeof q=="object"&&q!==null}r.isObject=re;function de(q){return re(q)&&ae(q)==="[object Date]"}r.isDate=de,r.types.isDate=de;function z(q){return re(q)&&(ae(q)==="[object Error]"||q instanceof Error)}r.isError=z,r.types.isNativeError=z;function we(q){return typeof q=="function"}r.isFunction=we;function Te(q){return q===null||typeof q=="boolean"||typeof q=="number"||typeof q=="string"||typeof q=="symbol"||typeof q>"u"}r.isPrimitive=Te,r.isBuffer=jE();function ae(q){return Object.prototype.toString.call(q)}function be(q){return q<10?"0"+q.toString(10):q.toString(10)}var Ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Re(){var q=new Date,Y=[be(q.getHours()),be(q.getMinutes()),be(q.getSeconds())].join(":");return[q.getDate(),Ee[q.getMonth()],Y].join(" ")}r.log=function(){console.log("%s - %s",Re(),r.format.apply(r,arguments))},r.inherits=Jn(),r._extend=function(q,Y){if(!Y||!re(Y))return q;for(var ee=Object.keys(Y),H=ee.length;H--;)q[ee[H]]=Y[ee[H]];return q};function Oe(q,Y){return Object.prototype.hasOwnProperty.call(q,Y)}var Ne=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;r.promisify=function(Y){if(typeof Y!="function")throw new TypeError('The "original" argument must be of type Function');if(Ne&&Y[Ne]){var ee=Y[Ne];if(typeof ee!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ee,Ne,{value:ee,enumerable:!1,writable:!1,configurable:!0}),ee}function ee(){for(var H,$,ie=new Promise(function(k,D){H=k,$=D}),he=[],pe=0;pe<arguments.length;pe++)he.push(arguments[pe]);he.push(function(k,D){k?$(k):H(D)});try{Y.apply(this,he)}catch(k){$(k)}return ie}return Object.setPrototypeOf(ee,Object.getPrototypeOf(Y)),Ne&&Object.defineProperty(ee,Ne,{value:ee,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ee,t(Y))},r.promisify.custom=Ne;function X(q,Y){if(!q){var ee=new Error("Promise was rejected with a falsy value");ee.reason=q,q=ee}return Y(q)}function ge(q){if(typeof q!="function")throw new TypeError('The "original" argument must be of type Function');function Y(){for(var ee=[],H=0;H<arguments.length;H++)ee.push(arguments[H]);var $=ee.pop();if(typeof $!="function")throw new TypeError("The last argument must be of type Function");var ie=this,he=function(){return $.apply(ie,arguments)};q.apply(this,ee).then(function(pe){Ve.nextTick(he.bind(null,null,pe))},function(pe){Ve.nextTick(X.bind(null,pe,he))})}return Object.setPrototypeOf(Y,Object.getPrototypeOf(q)),Object.defineProperties(Y,t(q)),Y}r.callbackify=ge})(Zc)),Zc}var el,Dp;function zE(){if(Dp)return el;Dp=1;function r(O,R){var P=Object.keys(O);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(O);R&&(v=v.filter(function(C){return Object.getOwnPropertyDescriptor(O,C).enumerable})),P.push.apply(P,v)}return P}function e(O){for(var R=1;R<arguments.length;R++){var P=arguments[R]!=null?arguments[R]:{};R%2?r(Object(P),!0).forEach(function(v){t(O,v,P[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(P)):r(Object(P)).forEach(function(v){Object.defineProperty(O,v,Object.getOwnPropertyDescriptor(P,v))})}return O}function t(O,R,P){return R=c(R),R in O?Object.defineProperty(O,R,{value:P,enumerable:!0,configurable:!0,writable:!0}):O[R]=P,O}function n(O,R){if(!(O instanceof R))throw new TypeError("Cannot call a class as a function")}function i(O,R){for(var P=0;P<R.length;P++){var v=R[P];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(O,c(v.key),v)}}function a(O,R,P){return R&&i(O.prototype,R),Object.defineProperty(O,"prototype",{writable:!1}),O}function c(O){var R=u(O,"string");return typeof R=="symbol"?R:String(R)}function u(O,R){if(typeof O!="object"||O===null)return O;var P=O[Symbol.toPrimitive];if(P!==void 0){var v=P.call(O,R);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)}var l=eo(),d=l.Buffer,h=qx(),m=h.inspect,y=m&&m.custom||"inspect";function E(O,R,P){d.prototype.copy.call(O,R,P)}return el=(function(){function O(){n(this,O),this.head=null,this.tail=null,this.length=0}return a(O,[{key:"push",value:function(P){var v={data:P,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(P){var v={data:P,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var P=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,P}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(P){if(this.length===0)return"";for(var v=this.head,C=""+v.data;v=v.next;)C+=P+v.data;return C}},{key:"concat",value:function(P){if(this.length===0)return d.alloc(0);for(var v=d.allocUnsafe(P>>>0),C=this.head,N=0;C;)E(C.data,v,N),N+=C.data.length,C=C.next;return v}},{key:"consume",value:function(P,v){var C;return P<this.head.data.length?(C=this.head.data.slice(0,P),this.head.data=this.head.data.slice(P)):P===this.head.data.length?C=this.shift():C=v?this._getString(P):this._getBuffer(P),C}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(P){var v=this.head,C=1,N=v.data;for(P-=N.length;v=v.next;){var F=v.data,U=P>F.length?F.length:P;if(U===F.length?N+=F:N+=F.slice(0,P),P-=U,P===0){U===F.length?(++C,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=F.slice(U));break}++C}return this.length-=C,N}},{key:"_getBuffer",value:function(P){var v=d.allocUnsafe(P),C=this.head,N=1;for(C.data.copy(v),P-=C.data.length;C=C.next;){var F=C.data,U=P>F.length?F.length:P;if(F.copy(v,v.length-P,0,U),P-=U,P===0){U===F.length?(++N,C.next?this.head=C.next:this.head=this.tail=null):(this.head=C,C.data=F.slice(U));break}++N}return this.length-=N,v}},{key:y,value:function(P,v){return m(this,e(e({},v),{},{depth:0,customInspect:!1}))}}]),O})(),el}var tl,Up;function $x(){if(Up)return tl;Up=1;function r(c,u){var l=this,d=this._readableState&&this._readableState.destroyed,h=this._writableState&&this._writableState.destroyed;return d||h?(u?u(c):c&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Ve.nextTick(i,this,c)):Ve.nextTick(i,this,c)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(c||null,function(m){!u&&m?l._writableState?l._writableState.errorEmitted?Ve.nextTick(t,l):(l._writableState.errorEmitted=!0,Ve.nextTick(e,l,m)):Ve.nextTick(e,l,m):u?(Ve.nextTick(t,l),u(m)):Ve.nextTick(t,l)}),this)}function e(c,u){i(c,u),t(c)}function t(c){c._writableState&&!c._writableState.emitClose||c._readableState&&!c._readableState.emitClose||c.emit("close")}function n(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(c,u){c.emit("error",u)}function a(c,u){var l=c._readableState,d=c._writableState;l&&l.autoDestroy||d&&d.autoDestroy?c.destroy(u):c.emit("error",u)}return tl={destroy:r,undestroy:n,errorOrDestroy:a},tl}var rl={},Lp;function Ui(){if(Lp)return rl;Lp=1;function r(u,l){u.prototype=Object.create(l.prototype),u.prototype.constructor=u,u.__proto__=l}var e={};function t(u,l,d){d||(d=Error);function h(y,E,O){return typeof l=="string"?l:l(y,E,O)}var m=(function(y){r(E,y);function E(O,R,P){return y.call(this,h(O,R,P))||this}return E})(d);m.prototype.name=d.name,m.prototype.code=u,e[u]=m}function n(u,l){if(Array.isArray(u)){var d=u.length;return u=u.map(function(h){return String(h)}),d>2?"one of ".concat(l," ").concat(u.slice(0,d-1).join(", "),", or ")+u[d-1]:d===2?"one of ".concat(l," ").concat(u[0]," or ").concat(u[1]):"of ".concat(l," ").concat(u[0])}else return"of ".concat(l," ").concat(String(u))}function i(u,l,d){return u.substr(0,l.length)===l}function a(u,l,d){return(d===void 0||d>u.length)&&(d=u.length),u.substring(d-l.length,d)===l}function c(u,l,d){return typeof d!="number"&&(d=0),d+l.length>u.length?!1:u.indexOf(l,d)!==-1}return t("ERR_INVALID_OPT_VALUE",function(u,l){return'The value "'+l+'" is invalid for option "'+u+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(u,l,d){var h;typeof l=="string"&&i(l,"not ")?(h="must not be",l=l.replace(/^not /,"")):h="must be";var m;if(a(u," argument"))m="The ".concat(u," ").concat(h," ").concat(n(l,"type"));else{var y=c(u,".")?"property":"argument";m='The "'.concat(u,'" ').concat(y," ").concat(h," ").concat(n(l,"type"))}return m+=". Received type ".concat(typeof d),m},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(u){return"The "+u+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(u){return"Cannot call "+u+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(u){return"Unknown encoding: "+u},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),rl.codes=e,rl}var nl,Mp;function Kx(){if(Mp)return nl;Mp=1;var r=Ui().codes.ERR_INVALID_OPT_VALUE;function e(n,i,a){return n.highWaterMark!=null?n.highWaterMark:i?n[a]:null}function t(n,i,a,c){var u=e(i,c,a);if(u!=null){if(!(isFinite(u)&&Math.floor(u)===u)||u<0){var l=c?a:"highWaterMark";throw new r(l,u)}return Math.floor(u)}return n.objectMode?16:16*1024}return nl={getHighWaterMark:t},nl}var il,_p;function HE(){if(_p)return il;_p=1,il=r;function r(t,n){if(e("noDeprecation"))return t;var i=!1;function a(){if(!i){if(e("throwDeprecation"))throw new Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),i=!0}return t.apply(this,arguments)}return a}function e(t){try{if(!Nr.localStorage)return!1}catch{return!1}var n=Nr.localStorage[t];return n==null?!1:String(n).toLowerCase()==="true"}return il}var sl,Vp;function Wx(){if(Vp)return sl;Vp=1,sl=G;function r(H){var $=this;this.next=null,this.entry=null,this.finish=function(){ee($,H)}}var e;G.WritableState=V;var t={deprecate:HE()},n=Dx(),i=eo().Buffer,a=(typeof Nr<"u"?Nr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(H){return i.from(H)}function u(H){return i.isBuffer(H)||H instanceof a}var l=$x(),d=Kx(),h=d.getHighWaterMark,m=Ui().codes,y=m.ERR_INVALID_ARG_TYPE,E=m.ERR_METHOD_NOT_IMPLEMENTED,O=m.ERR_MULTIPLE_CALLBACK,R=m.ERR_STREAM_CANNOT_PIPE,P=m.ERR_STREAM_DESTROYED,v=m.ERR_STREAM_NULL_VALUES,C=m.ERR_STREAM_WRITE_AFTER_END,N=m.ERR_UNKNOWN_ENCODING,F=l.errorOrDestroy;Jn()(G,n);function U(){}function V(H,$,ie){e=e||Ri(),H=H||{},typeof ie!="boolean"&&(ie=$ instanceof e),this.objectMode=!!H.objectMode,ie&&(this.objectMode=this.objectMode||!!H.writableObjectMode),this.highWaterMark=h(this,H,"writableHighWaterMark",ie),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var he=H.decodeStrings===!1;this.decodeStrings=!he,this.defaultEncoding=H.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(pe){be($,pe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=H.emitClose!==!1,this.autoDestroy=!!H.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}V.prototype.getBuffer=function(){for(var $=this.bufferedRequest,ie=[];$;)ie.push($),$=$.next;return ie},(function(){try{Object.defineProperty(V.prototype,"buffer",{get:t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var L;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(L=Function.prototype[Symbol.hasInstance],Object.defineProperty(G,Symbol.hasInstance,{value:function($){return L.call(this,$)?!0:this!==G?!1:$&&$._writableState instanceof V}})):L=function($){return $ instanceof this};function G(H){e=e||Ri();var $=this instanceof e;if(!$&&!L.call(G,this))return new G(H);this._writableState=new V(H,this,$),this.writable=!0,H&&(typeof H.write=="function"&&(this._write=H.write),typeof H.writev=="function"&&(this._writev=H.writev),typeof H.destroy=="function"&&(this._destroy=H.destroy),typeof H.final=="function"&&(this._final=H.final)),n.call(this)}G.prototype.pipe=function(){F(this,new R)};function Q(H,$){var ie=new C;F(H,ie),Ve.nextTick($,ie)}function re(H,$,ie,he){var pe;return ie===null?pe=new v:typeof ie!="string"&&!$.objectMode&&(pe=new y("chunk",["string","Buffer"],ie)),pe?(F(H,pe),Ve.nextTick(he,pe),!1):!0}G.prototype.write=function(H,$,ie){var he=this._writableState,pe=!1,k=!he.objectMode&&u(H);return k&&!i.isBuffer(H)&&(H=c(H)),typeof $=="function"&&(ie=$,$=null),k?$="buffer":$||($=he.defaultEncoding),typeof ie!="function"&&(ie=U),he.ending?Q(this,ie):(k||re(this,he,H,ie))&&(he.pendingcb++,pe=z(this,he,k,H,$,ie)),pe},G.prototype.cork=function(){this._writableState.corked++},G.prototype.uncork=function(){var H=this._writableState;H.corked&&(H.corked--,!H.writing&&!H.corked&&!H.bufferProcessing&&H.bufferedRequest&&Oe(this,H))},G.prototype.setDefaultEncoding=function($){if(typeof $=="string"&&($=$.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf(($+"").toLowerCase())>-1))throw new N($);return this._writableState.defaultEncoding=$,this},Object.defineProperty(G.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function de(H,$,ie){return!H.objectMode&&H.decodeStrings!==!1&&typeof $=="string"&&($=i.from($,ie)),$}Object.defineProperty(G.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function z(H,$,ie,he,pe,k){if(!ie){var D=de($,he,pe);he!==D&&(ie=!0,pe="buffer",he=D)}var ne=$.objectMode?1:he.length;$.length+=ne;var ye=$.length<$.highWaterMark;if(ye||($.needDrain=!0),$.writing||$.corked){var Fe=$.lastBufferedRequest;$.lastBufferedRequest={chunk:he,encoding:pe,isBuf:ie,callback:k,next:null},Fe?Fe.next=$.lastBufferedRequest:$.bufferedRequest=$.lastBufferedRequest,$.bufferedRequestCount+=1}else we(H,$,!1,ne,he,pe,k);return ye}function we(H,$,ie,he,pe,k,D){$.writelen=he,$.writecb=D,$.writing=!0,$.sync=!0,$.destroyed?$.onwrite(new P("write")):ie?H._writev(pe,$.onwrite):H._write(pe,k,$.onwrite),$.sync=!1}function Te(H,$,ie,he,pe){--$.pendingcb,ie?(Ve.nextTick(pe,he),Ve.nextTick(q,H,$),H._writableState.errorEmitted=!0,F(H,he)):(pe(he),H._writableState.errorEmitted=!0,F(H,he),q(H,$))}function ae(H){H.writing=!1,H.writecb=null,H.length-=H.writelen,H.writelen=0}function be(H,$){var ie=H._writableState,he=ie.sync,pe=ie.writecb;if(typeof pe!="function")throw new O;if(ae(ie),$)Te(H,ie,he,$,pe);else{var k=Ne(ie)||H.destroyed;!k&&!ie.corked&&!ie.bufferProcessing&&ie.bufferedRequest&&Oe(H,ie),he?Ve.nextTick(Ee,H,ie,k,pe):Ee(H,ie,k,pe)}}function Ee(H,$,ie,he){ie||Re(H,$),$.pendingcb--,he(),q(H,$)}function Re(H,$){$.length===0&&$.needDrain&&($.needDrain=!1,H.emit("drain"))}function Oe(H,$){$.bufferProcessing=!0;var ie=$.bufferedRequest;if(H._writev&&ie&&ie.next){var he=$.bufferedRequestCount,pe=new Array(he),k=$.corkedRequestsFree;k.entry=ie;for(var D=0,ne=!0;ie;)pe[D]=ie,ie.isBuf||(ne=!1),ie=ie.next,D+=1;pe.allBuffers=ne,we(H,$,!0,$.length,pe,"",k.finish),$.pendingcb++,$.lastBufferedRequest=null,k.next?($.corkedRequestsFree=k.next,k.next=null):$.corkedRequestsFree=new r($),$.bufferedRequestCount=0}else{for(;ie;){var ye=ie.chunk,Fe=ie.encoding,Be=ie.callback,De=$.objectMode?1:ye.length;if(we(H,$,!1,De,ye,Fe,Be),ie=ie.next,$.bufferedRequestCount--,$.writing)break}ie===null&&($.lastBufferedRequest=null)}$.bufferedRequest=ie,$.bufferProcessing=!1}G.prototype._write=function(H,$,ie){ie(new E("_write()"))},G.prototype._writev=null,G.prototype.end=function(H,$,ie){var he=this._writableState;return typeof H=="function"?(ie=H,H=null,$=null):typeof $=="function"&&(ie=$,$=null),H!=null&&this.write(H,$),he.corked&&(he.corked=1,this.uncork()),he.ending||Y(this,he,ie),this},Object.defineProperty(G.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Ne(H){return H.ending&&H.length===0&&H.bufferedRequest===null&&!H.finished&&!H.writing}function X(H,$){H._final(function(ie){$.pendingcb--,ie&&F(H,ie),$.prefinished=!0,H.emit("prefinish"),q(H,$)})}function ge(H,$){!$.prefinished&&!$.finalCalled&&(typeof H._final=="function"&&!$.destroyed?($.pendingcb++,$.finalCalled=!0,Ve.nextTick(X,H,$)):($.prefinished=!0,H.emit("prefinish")))}function q(H,$){var ie=Ne($);if(ie&&(ge(H,$),$.pendingcb===0&&($.finished=!0,H.emit("finish"),$.autoDestroy))){var he=H._readableState;(!he||he.autoDestroy&&he.endEmitted)&&H.destroy()}return ie}function Y(H,$,ie){$.ending=!0,q(H,$),ie&&($.finished?Ve.nextTick(ie):H.once("finish",ie)),$.ended=!0,H.writable=!1}function ee(H,$,ie){var he=H.entry;for(H.entry=null;he;){var pe=he.callback;$.pendingcb--,pe(ie),he=he.next}$.corkedRequestsFree.next=H}return Object.defineProperty(G.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function($){this._writableState&&(this._writableState.destroyed=$)}}),G.prototype.destroy=l.destroy,G.prototype._undestroy=l.undestroy,G.prototype._destroy=function(H,$){$(H)},sl}var al,Gp;function Ri(){if(Gp)return al;Gp=1;var r=Object.keys||function(d){var h=[];for(var m in d)h.push(m);return h};al=c;var e=Qx(),t=Wx();Jn()(c,e);for(var n=r(t.prototype),i=0;i<n.length;i++){var a=n[i];c.prototype[a]||(c.prototype[a]=t.prototype[a])}function c(d){if(!(this instanceof c))return new c(d);e.call(this,d),t.call(this,d),this.allowHalfOpen=!0,d&&(d.readable===!1&&(this.readable=!1),d.writable===!1&&(this.writable=!1),d.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",u)))}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function u(){this._writableState.ended||Ve.nextTick(l,this)}function l(d){d.end()}return Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(h){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=h,this._writableState.destroyed=h)}}),al}var ol={},da={exports:{}};var jp;function qE(){return jp||(jp=1,(function(r,e){var t=eo(),n=t.Buffer;function i(c,u){for(var l in c)u[l]=c[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?r.exports=t:(i(t,e),e.Buffer=a);function a(c,u,l){return n(c,u,l)}a.prototype=Object.create(n.prototype),i(n,a),a.from=function(c,u,l){if(typeof c=="number")throw new TypeError("Argument must not be a number");return n(c,u,l)},a.alloc=function(c,u,l){if(typeof c!="number")throw new TypeError("Argument must be a number");var d=n(c);return u!==void 0?typeof l=="string"?d.fill(u,l):d.fill(u):d.fill(0),d},a.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return n(c)},a.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(c)}})(da,da.exports)),da.exports}var zp;function Hp(){if(zp)return ol;zp=1;var r=qE().Buffer,e=r.isEncoding||function(v){switch(v=""+v,v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(v){if(!v)return"utf8";for(var C;;)switch(v){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return v;default:if(C)return;v=(""+v).toLowerCase(),C=!0}}function n(v){var C=t(v);if(typeof C!="string"&&(r.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return C||v}ol.StringDecoder=i;function i(v){this.encoding=n(v);var C;switch(this.encoding){case"utf16le":this.text=m,this.end=y,C=4;break;case"utf8":this.fillLast=l,C=4;break;case"base64":this.text=E,this.end=O,C=3;break;default:this.write=R,this.end=P;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(C)}i.prototype.write=function(v){if(v.length===0)return"";var C,N;if(this.lastNeed){if(C=this.fillLast(v),C===void 0)return"";N=this.lastNeed,this.lastNeed=0}else N=0;return N<v.length?C?C+this.text(v,N):this.text(v,N):C||""},i.prototype.end=h,i.prototype.text=d,i.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function a(v){return v<=127?0:v>>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function c(v,C,N){var F=C.length-1;if(F<N)return 0;var U=a(C[F]);return U>=0?(U>0&&(v.lastNeed=U-1),U):--F<N||U===-2?0:(U=a(C[F]),U>=0?(U>0&&(v.lastNeed=U-2),U):--F<N||U===-2?0:(U=a(C[F]),U>=0?(U>0&&(U===2?U=0:v.lastNeed=U-3),U):0))}function u(v,C,N){if((C[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&C.length>1){if((C[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&C.length>2&&(C[2]&192)!==128)return v.lastNeed=2,"�"}}function l(v){var C=this.lastTotal-this.lastNeed,N=u(this,v);if(N!==void 0)return N;if(this.lastNeed<=v.length)return v.copy(this.lastChar,C,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,C,0,v.length),this.lastNeed-=v.length}function d(v,C){var N=c(this,v,C);if(!this.lastNeed)return v.toString("utf8",C);this.lastTotal=N;var F=v.length-(N-this.lastNeed);return v.copy(this.lastChar,0,F),v.toString("utf8",C,F)}function h(v){var C=v&&v.length?this.write(v):"";return this.lastNeed?C+"�":C}function m(v,C){if((v.length-C)%2===0){var N=v.toString("utf16le",C);if(N){var F=N.charCodeAt(N.length-1);if(F>=55296&&F<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],N.slice(0,-1)}return N}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",C,v.length-1)}function y(v){var C=v&&v.length?this.write(v):"";if(this.lastNeed){var N=this.lastTotal-this.lastNeed;return C+this.lastChar.toString("utf16le",0,N)}return C}function E(v,C){var N=(v.length-C)%3;return N===0?v.toString("base64",C):(this.lastNeed=3-N,this.lastTotal=3,N===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",C,v.length-N))}function O(v){var C=v&&v.length?this.write(v):"";return this.lastNeed?C+this.lastChar.toString("base64",0,3-this.lastNeed):C}function R(v){return v.toString(this.encoding)}function P(v){return v&&v.length?this.write(v):""}return ol}var cl,qp;function A0(){if(qp)return cl;qp=1;var r=Ui().codes.ERR_STREAM_PREMATURE_CLOSE;function e(a){var c=!1;return function(){if(!c){c=!0;for(var u=arguments.length,l=new Array(u),d=0;d<u;d++)l[d]=arguments[d];a.apply(this,l)}}}function t(){}function n(a){return a.setHeader&&typeof a.abort=="function"}function i(a,c,u){if(typeof c=="function")return i(a,null,c);c||(c={}),u=e(u||t);var l=c.readable||c.readable!==!1&&a.readable,d=c.writable||c.writable!==!1&&a.writable,h=function(){a.writable||y()},m=a._writableState&&a._writableState.finished,y=function(){d=!1,m=!0,l||u.call(a)},E=a._readableState&&a._readableState.endEmitted,O=function(){l=!1,E=!0,d||u.call(a)},R=function(N){u.call(a,N)},P=function(){var N;if(l&&!E)return(!a._readableState||!a._readableState.ended)&&(N=new r),u.call(a,N);if(d&&!m)return(!a._writableState||!a._writableState.ended)&&(N=new r),u.call(a,N)},v=function(){a.req.on("finish",y)};return n(a)?(a.on("complete",y),a.on("abort",P),a.req?v():a.on("request",v)):d&&!a._writableState&&(a.on("end",h),a.on("close",h)),a.on("end",O),a.on("finish",y),c.error!==!1&&a.on("error",R),a.on("close",P),function(){a.removeListener("complete",y),a.removeListener("abort",P),a.removeListener("request",v),a.req&&a.req.removeListener("finish",y),a.removeListener("end",h),a.removeListener("close",h),a.removeListener("finish",y),a.removeListener("end",O),a.removeListener("error",R),a.removeListener("close",P)}}return cl=i,cl}var ul,$p;function $E(){if($p)return ul;$p=1;var r;function e(N,F,U){return F=t(F),F in N?Object.defineProperty(N,F,{value:U,enumerable:!0,configurable:!0,writable:!0}):N[F]=U,N}function t(N){var F=n(N,"string");return typeof F=="symbol"?F:String(F)}function n(N,F){if(typeof N!="object"||N===null)return N;var U=N[Symbol.toPrimitive];if(U!==void 0){var V=U.call(N,F);if(typeof V!="object")return V;throw new TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(N)}var i=A0(),a=Symbol("lastResolve"),c=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),d=Symbol("lastPromise"),h=Symbol("handlePromise"),m=Symbol("stream");function y(N,F){return{value:N,done:F}}function E(N){var F=N[a];if(F!==null){var U=N[m].read();U!==null&&(N[d]=null,N[a]=null,N[c]=null,F(y(U,!1)))}}function O(N){Ve.nextTick(E,N)}function R(N,F){return function(U,V){N.then(function(){if(F[l]){U(y(void 0,!0));return}F[h](U,V)},V)}}var P=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((r={get stream(){return this[m]},next:function(){var F=this,U=this[u];if(U!==null)return Promise.reject(U);if(this[l])return Promise.resolve(y(void 0,!0));if(this[m].destroyed)return new Promise(function(Q,re){Ve.nextTick(function(){F[u]?re(F[u]):Q(y(void 0,!0))})});var V=this[d],L;if(V)L=new Promise(R(V,this));else{var G=this[m].read();if(G!==null)return Promise.resolve(y(G,!1));L=new Promise(this[h])}return this[d]=L,L}},e(r,Symbol.asyncIterator,function(){return this}),e(r,"return",function(){var F=this;return new Promise(function(U,V){F[m].destroy(null,function(L){if(L){V(L);return}U(y(void 0,!0))})})}),r),P),C=function(F){var U,V=Object.create(v,(U={},e(U,m,{value:F,writable:!0}),e(U,a,{value:null,writable:!0}),e(U,c,{value:null,writable:!0}),e(U,u,{value:null,writable:!0}),e(U,l,{value:F._readableState.endEmitted,writable:!0}),e(U,h,{value:function(G,Q){var re=V[m].read();re?(V[d]=null,V[a]=null,V[c]=null,G(y(re,!1))):(V[a]=G,V[c]=Q)},writable:!0}),U));return V[d]=null,i(F,function(L){if(L&&L.code!=="ERR_STREAM_PREMATURE_CLOSE"){var G=V[c];G!==null&&(V[d]=null,V[a]=null,V[c]=null,G(L)),V[u]=L;return}var Q=V[a];Q!==null&&(V[d]=null,V[a]=null,V[c]=null,Q(y(void 0,!0))),V[l]=!0}),F.on("readable",O.bind(null,V)),V};return ul=C,ul}var ll,Kp;function KE(){return Kp||(Kp=1,ll=function(){throw new Error("Readable.from is not available in the browser")}),ll}var fl,Wp;function Qx(){if(Wp)return fl;Wp=1,fl=Q;var r;Q.ReadableState=G,b0().EventEmitter;var e=function(D,ne){return D.listeners(ne).length},t=Dx(),n=eo().Buffer,i=(typeof Nr<"u"?Nr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(k){return n.from(k)}function c(k){return n.isBuffer(k)||k instanceof i}var u=qx(),l;u&&u.debuglog?l=u.debuglog("stream"):l=function(){};var d=zE(),h=$x(),m=Kx(),y=m.getHighWaterMark,E=Ui().codes,O=E.ERR_INVALID_ARG_TYPE,R=E.ERR_STREAM_PUSH_AFTER_EOF,P=E.ERR_METHOD_NOT_IMPLEMENTED,v=E.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,C,N,F;Jn()(Q,t);var U=h.errorOrDestroy,V=["error","close","destroy","pause","resume"];function L(k,D,ne){if(typeof k.prependListener=="function")return k.prependListener(D,ne);!k._events||!k._events[D]?k.on(D,ne):Array.isArray(k._events[D])?k._events[D].unshift(ne):k._events[D]=[ne,k._events[D]]}function G(k,D,ne){r=r||Ri(),k=k||{},typeof ne!="boolean"&&(ne=D instanceof r),this.objectMode=!!k.objectMode,ne&&(this.objectMode=this.objectMode||!!k.readableObjectMode),this.highWaterMark=y(this,k,"readableHighWaterMark",ne),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=k.emitClose!==!1,this.autoDestroy=!!k.autoDestroy,this.destroyed=!1,this.defaultEncoding=k.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,k.encoding&&(C||(C=Hp().StringDecoder),this.decoder=new C(k.encoding),this.encoding=k.encoding)}function Q(k){if(r=r||Ri(),!(this instanceof Q))return new Q(k);var D=this instanceof r;this._readableState=new G(k,this,D),this.readable=!0,k&&(typeof k.read=="function"&&(this._read=k.read),typeof k.destroy=="function"&&(this._destroy=k.destroy)),t.call(this)}Object.defineProperty(Q.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(D){this._readableState&&(this._readableState.destroyed=D)}}),Q.prototype.destroy=h.destroy,Q.prototype._undestroy=h.undestroy,Q.prototype._destroy=function(k,D){D(k)},Q.prototype.push=function(k,D){var ne=this._readableState,ye;return ne.objectMode?ye=!0:typeof k=="string"&&(D=D||ne.defaultEncoding,D!==ne.encoding&&(k=n.from(k,D),D=""),ye=!0),re(this,k,D,!1,ye)},Q.prototype.unshift=function(k){return re(this,k,null,!0,!1)};function re(k,D,ne,ye,Fe){l("readableAddChunk",D);var Be=k._readableState;if(D===null)Be.reading=!1,be(k,Be);else{var De;if(Fe||(De=z(Be,D)),De)U(k,De);else if(Be.objectMode||D&&D.length>0)if(typeof D!="string"&&!Be.objectMode&&Object.getPrototypeOf(D)!==n.prototype&&(D=a(D)),ye)Be.endEmitted?U(k,new v):de(k,Be,D,!0);else if(Be.ended)U(k,new R);else{if(Be.destroyed)return!1;Be.reading=!1,Be.decoder&&!ne?(D=Be.decoder.write(D),Be.objectMode||D.length!==0?de(k,Be,D,!1):Oe(k,Be)):de(k,Be,D,!1)}else ye||(Be.reading=!1,Oe(k,Be))}return!Be.ended&&(Be.length<Be.highWaterMark||Be.length===0)}function de(k,D,ne,ye){D.flowing&&D.length===0&&!D.sync?(D.awaitDrain=0,k.emit("data",ne)):(D.length+=D.objectMode?1:ne.length,ye?D.buffer.unshift(ne):D.buffer.push(ne),D.needReadable&&Ee(k)),Oe(k,D)}function z(k,D){var ne;return!c(D)&&typeof D!="string"&&D!==void 0&&!k.objectMode&&(ne=new O("chunk",["string","Buffer","Uint8Array"],D)),ne}Q.prototype.isPaused=function(){return this._readableState.flowing===!1},Q.prototype.setEncoding=function(k){C||(C=Hp().StringDecoder);var D=new C(k);this._readableState.decoder=D,this._readableState.encoding=this._readableState.decoder.encoding;for(var ne=this._readableState.buffer.head,ye="";ne!==null;)ye+=D.write(ne.data),ne=ne.next;return this._readableState.buffer.clear(),ye!==""&&this._readableState.buffer.push(ye),this._readableState.length=ye.length,this};var we=1073741824;function Te(k){return k>=we?k=we:(k--,k|=k>>>1,k|=k>>>2,k|=k>>>4,k|=k>>>8,k|=k>>>16,k++),k}function ae(k,D){return k<=0||D.length===0&&D.ended?0:D.objectMode?1:k!==k?D.flowing&&D.length?D.buffer.head.data.length:D.length:(k>D.highWaterMark&&(D.highWaterMark=Te(k)),k<=D.length?k:D.ended?D.length:(D.needReadable=!0,0))}Q.prototype.read=function(k){l("read",k),k=parseInt(k,10);var D=this._readableState,ne=k;if(k!==0&&(D.emittedReadable=!1),k===0&&D.needReadable&&((D.highWaterMark!==0?D.length>=D.highWaterMark:D.length>0)||D.ended))return l("read: emitReadable",D.length,D.ended),D.length===0&&D.ended?ie(this):Ee(this),null;if(k=ae(k,D),k===0&&D.ended)return D.length===0&&ie(this),null;var ye=D.needReadable;l("need readable",ye),(D.length===0||D.length-k<D.highWaterMark)&&(ye=!0,l("length less than watermark",ye)),D.ended||D.reading?(ye=!1,l("reading or ended",ye)):ye&&(l("do read"),D.reading=!0,D.sync=!0,D.length===0&&(D.needReadable=!0),this._read(D.highWaterMark),D.sync=!1,D.reading||(k=ae(ne,D)));var Fe;return k>0?Fe=$(k,D):Fe=null,Fe===null?(D.needReadable=D.length<=D.highWaterMark,k=0):(D.length-=k,D.awaitDrain=0),D.length===0&&(D.ended||(D.needReadable=!0),ne!==k&&D.ended&&ie(this)),Fe!==null&&this.emit("data",Fe),Fe};function be(k,D){if(l("onEofChunk"),!D.ended){if(D.decoder){var ne=D.decoder.end();ne&&ne.length&&(D.buffer.push(ne),D.length+=D.objectMode?1:ne.length)}D.ended=!0,D.sync?Ee(k):(D.needReadable=!1,D.emittedReadable||(D.emittedReadable=!0,Re(k)))}}function Ee(k){var D=k._readableState;l("emitReadable",D.needReadable,D.emittedReadable),D.needReadable=!1,D.emittedReadable||(l("emitReadable",D.flowing),D.emittedReadable=!0,Ve.nextTick(Re,k))}function Re(k){var D=k._readableState;l("emitReadable_",D.destroyed,D.length,D.ended),!D.destroyed&&(D.length||D.ended)&&(k.emit("readable"),D.emittedReadable=!1),D.needReadable=!D.flowing&&!D.ended&&D.length<=D.highWaterMark,H(k)}function Oe(k,D){D.readingMore||(D.readingMore=!0,Ve.nextTick(Ne,k,D))}function Ne(k,D){for(;!D.reading&&!D.ended&&(D.length<D.highWaterMark||D.flowing&&D.length===0);){var ne=D.length;if(l("maybeReadMore read 0"),k.read(0),ne===D.length)break}D.readingMore=!1}Q.prototype._read=function(k){U(this,new P("_read()"))},Q.prototype.pipe=function(k,D){var ne=this,ye=this._readableState;switch(ye.pipesCount){case 0:ye.pipes=k;break;case 1:ye.pipes=[ye.pipes,k];break;default:ye.pipes.push(k);break}ye.pipesCount+=1,l("pipe count=%d opts=%j",ye.pipesCount,D);var Fe=(!D||D.end!==!1)&&k!==Ve.stdout&&k!==Ve.stderr,Be=Fe?Ft:it;ye.endEmitted?Ve.nextTick(Be):ne.once("end",Be),k.on("unpipe",De);function De(Ct,Bt){l("onunpipe"),Ct===ne&&Bt&&Bt.hasUnpiped===!1&&(Bt.hasUnpiped=!0,xt())}function Ft(){l("onend"),k.end()}var oe=X(ne);k.on("drain",oe);var dt=!1;function xt(){l("cleanup"),k.removeListener("close",It),k.removeListener("finish",Et),k.removeListener("drain",oe),k.removeListener("error",nt),k.removeListener("unpipe",De),ne.removeListener("end",Ft),ne.removeListener("end",it),ne.removeListener("data",Xe),dt=!0,ye.awaitDrain&&(!k._writableState||k._writableState.needDrain)&&oe()}ne.on("data",Xe);function Xe(Ct){l("ondata");var Bt=k.write(Ct);l("dest.write",Bt),Bt===!1&&((ye.pipesCount===1&&ye.pipes===k||ye.pipesCount>1&&pe(ye.pipes,k)!==-1)&&!dt&&(l("false write response, pause",ye.awaitDrain),ye.awaitDrain++),ne.pause())}function nt(Ct){l("onerror",Ct),it(),k.removeListener("error",nt),e(k,"error")===0&&U(k,Ct)}L(k,"error",nt);function It(){k.removeListener("finish",Et),it()}k.once("close",It);function Et(){l("onfinish"),k.removeListener("close",It),it()}k.once("finish",Et);function it(){l("unpipe"),ne.unpipe(k)}return k.emit("pipe",ne),ye.flowing||(l("pipe resume"),ne.resume()),k};function X(k){return function(){var ne=k._readableState;l("pipeOnDrain",ne.awaitDrain),ne.awaitDrain&&ne.awaitDrain--,ne.awaitDrain===0&&e(k,"data")&&(ne.flowing=!0,H(k))}}Q.prototype.unpipe=function(k){var D=this._readableState,ne={hasUnpiped:!1};if(D.pipesCount===0)return this;if(D.pipesCount===1)return k&&k!==D.pipes?this:(k||(k=D.pipes),D.pipes=null,D.pipesCount=0,D.flowing=!1,k&&k.emit("unpipe",this,ne),this);if(!k){var ye=D.pipes,Fe=D.pipesCount;D.pipes=null,D.pipesCount=0,D.flowing=!1;for(var Be=0;Be<Fe;Be++)ye[Be].emit("unpipe",this,{hasUnpiped:!1});return this}var De=pe(D.pipes,k);return De===-1?this:(D.pipes.splice(De,1),D.pipesCount-=1,D.pipesCount===1&&(D.pipes=D.pipes[0]),k.emit("unpipe",this,ne),this)},Q.prototype.on=function(k,D){var ne=t.prototype.on.call(this,k,D),ye=this._readableState;return k==="data"?(ye.readableListening=this.listenerCount("readable")>0,ye.flowing!==!1&&this.resume()):k==="readable"&&!ye.endEmitted&&!ye.readableListening&&(ye.readableListening=ye.needReadable=!0,ye.flowing=!1,ye.emittedReadable=!1,l("on readable",ye.length,ye.reading),ye.length?Ee(this):ye.reading||Ve.nextTick(q,this)),ne},Q.prototype.addListener=Q.prototype.on,Q.prototype.removeListener=function(k,D){var ne=t.prototype.removeListener.call(this,k,D);return k==="readable"&&Ve.nextTick(ge,this),ne},Q.prototype.removeAllListeners=function(k){var D=t.prototype.removeAllListeners.apply(this,arguments);return(k==="readable"||k===void 0)&&Ve.nextTick(ge,this),D};function ge(k){var D=k._readableState;D.readableListening=k.listenerCount("readable")>0,D.resumeScheduled&&!D.paused?D.flowing=!0:k.listenerCount("data")>0&&k.resume()}function q(k){l("readable nexttick read 0"),k.read(0)}Q.prototype.resume=function(){var k=this._readableState;return k.flowing||(l("resume"),k.flowing=!k.readableListening,Y(this,k)),k.paused=!1,this};function Y(k,D){D.resumeScheduled||(D.resumeScheduled=!0,Ve.nextTick(ee,k,D))}function ee(k,D){l("resume",D.reading),D.reading||k.read(0),D.resumeScheduled=!1,k.emit("resume"),H(k),D.flowing&&!D.reading&&k.read(0)}Q.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function H(k){var D=k._readableState;for(l("flow",D.flowing);D.flowing&&k.read()!==null;);}Q.prototype.wrap=function(k){var D=this,ne=this._readableState,ye=!1;k.on("end",function(){if(l("wrapped end"),ne.decoder&&!ne.ended){var De=ne.decoder.end();De&&De.length&&D.push(De)}D.push(null)}),k.on("data",function(De){if(l("wrapped data"),ne.decoder&&(De=ne.decoder.write(De)),!(ne.objectMode&&De==null)&&!(!ne.objectMode&&(!De||!De.length))){var Ft=D.push(De);Ft||(ye=!0,k.pause())}});for(var Fe in k)this[Fe]===void 0&&typeof k[Fe]=="function"&&(this[Fe]=(function(Ft){return function(){return k[Ft].apply(k,arguments)}})(Fe));for(var Be=0;Be<V.length;Be++)k.on(V[Be],this.emit.bind(this,V[Be]));return this._read=function(De){l("wrapped _read",De),ye&&(ye=!1,k.resume())},this},typeof Symbol=="function"&&(Q.prototype[Symbol.asyncIterator]=function(){return N===void 0&&(N=$E()),N(this)}),Object.defineProperty(Q.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Q.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Q.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(D){this._readableState&&(this._readableState.flowing=D)}}),Q._fromList=$,Object.defineProperty(Q.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function $(k,D){if(D.length===0)return null;var ne;return D.objectMode?ne=D.buffer.shift():!k||k>=D.length?(D.decoder?ne=D.buffer.join(""):D.buffer.length===1?ne=D.buffer.first():ne=D.buffer.concat(D.length),D.buffer.clear()):ne=D.buffer.consume(k,D.decoder),ne}function ie(k){var D=k._readableState;l("endReadable",D.endEmitted),D.endEmitted||(D.ended=!0,Ve.nextTick(he,D,k))}function he(k,D){if(l("endReadableNT",k.endEmitted,k.length),!k.endEmitted&&k.length===0&&(k.endEmitted=!0,D.readable=!1,D.emit("end"),k.autoDestroy)){var ne=D._writableState;(!ne||ne.autoDestroy&&ne.finished)&&D.destroy()}}typeof Symbol=="function"&&(Q.from=function(k,D){return F===void 0&&(F=KE()),F(Q,k,D)});function pe(k,D){for(var ne=0,ye=k.length;ne<ye;ne++)if(k[ne]===D)return ne;return-1}return fl}var hl,Qp;function Jx(){if(Qp)return hl;Qp=1,hl=u;var r=Ui().codes,e=r.ERR_METHOD_NOT_IMPLEMENTED,t=r.ERR_MULTIPLE_CALLBACK,n=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=r.ERR_TRANSFORM_WITH_LENGTH_0,a=Ri();Jn()(u,a);function c(h,m){var y=this._transformState;y.transforming=!1;var E=y.writecb;if(E===null)return this.emit("error",new t);y.writechunk=null,y.writecb=null,m!=null&&this.push(m),E(h);var O=this._readableState;O.reading=!1,(O.needReadable||O.length<O.highWaterMark)&&this._read(O.highWaterMark)}function u(h){if(!(this instanceof u))return new u(h);a.call(this,h),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",l)}function l(){var h=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(m,y){d(h,m,y)}):d(this,null,null)}u.prototype.push=function(h,m){return this._transformState.needTransform=!1,a.prototype.push.call(this,h,m)},u.prototype._transform=function(h,m,y){y(new e("_transform()"))},u.prototype._write=function(h,m,y){var E=this._transformState;if(E.writecb=y,E.writechunk=h,E.writeencoding=m,!E.transforming){var O=this._readableState;(E.needTransform||O.needReadable||O.length<O.highWaterMark)&&this._read(O.highWaterMark)}},u.prototype._read=function(h){var m=this._transformState;m.writechunk!==null&&!m.transforming?(m.transforming=!0,this._transform(m.writechunk,m.writeencoding,m.afterTransform)):m.needTransform=!0},u.prototype._destroy=function(h,m){a.prototype._destroy.call(this,h,function(y){m(y)})};function d(h,m,y){if(m)return h.emit("error",m);if(y!=null&&h.push(y),h._writableState.length)throw new i;if(h._transformState.transforming)throw new n;return h.push(null)}return hl}var dl,Jp;function WE(){if(Jp)return dl;Jp=1,dl=e;var r=Jx();Jn()(e,r);function e(t){if(!(this instanceof e))return new e(t);r.call(this,t)}return e.prototype._transform=function(t,n,i){i(null,t)},dl}var pl,Yp;function QE(){if(Yp)return pl;Yp=1;var r;function e(y){var E=!1;return function(){E||(E=!0,y.apply(void 0,arguments))}}var t=Ui().codes,n=t.ERR_MISSING_ARGS,i=t.ERR_STREAM_DESTROYED;function a(y){if(y)throw y}function c(y){return y.setHeader&&typeof y.abort=="function"}function u(y,E,O,R){R=e(R);var P=!1;y.on("close",function(){P=!0}),r===void 0&&(r=A0()),r(y,{readable:E,writable:O},function(C){if(C)return R(C);P=!0,R()});var v=!1;return function(C){if(!P&&!v){if(v=!0,c(y))return y.abort();if(typeof y.destroy=="function")return y.destroy();R(C||new i("pipe"))}}}function l(y){y()}function d(y,E){return y.pipe(E)}function h(y){return!y.length||typeof y[y.length-1]!="function"?a:y.pop()}function m(){for(var y=arguments.length,E=new Array(y),O=0;O<y;O++)E[O]=arguments[O];var R=h(E);if(Array.isArray(E[0])&&(E=E[0]),E.length<2)throw new n("streams");var P,v=E.map(function(C,N){var F=N<E.length-1,U=N>0;return u(C,F,U,function(V){P||(P=V),V&&v.forEach(l),!F&&(v.forEach(l),R(P))})});return E.reduce(d)}return pl=m,pl}var ml,Xp;function JE(){if(Xp)return ml;Xp=1,ml=t;var r=b0().EventEmitter,e=Jn();e(t,r),t.Readable=Qx(),t.Writable=Wx(),t.Duplex=Ri(),t.Transform=Jx(),t.PassThrough=WE(),t.finished=A0(),t.pipeline=QE(),t.Stream=t;function t(){r.call(this)}return t.prototype.pipe=function(n,i){var a=this;function c(E){n.writable&&n.write(E)===!1&&a.pause&&a.pause()}a.on("data",c);function u(){a.readable&&a.resume&&a.resume()}n.on("drain",u),!n._isStdio&&(!i||i.end!==!1)&&(a.on("end",d),a.on("close",h));var l=!1;function d(){l||(l=!0,n.end())}function h(){l||(l=!0,typeof n.destroy=="function"&&n.destroy())}function m(E){if(y(),r.listenerCount(this,"error")===0)throw E}a.on("error",m),n.on("error",m);function y(){a.removeListener("data",c),n.removeListener("drain",u),a.removeListener("end",d),a.removeListener("close",h),a.removeListener("error",m),n.removeListener("error",m),a.removeListener("end",y),a.removeListener("close",y),n.removeListener("close",y)}return a.on("end",y),a.on("close",y),n.on("close",y),n.emit("pipe",a),n},ml}var Zp=JE();function Yx(r){if(typeof File=="function"&&r instanceof File)return!0;const e=r;return typeof e=="object"&&typeof e.name=="string"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")}async function Xx(r){return r.arrayBuffer?r.arrayBuffer():new Promise(e=>{const t=new FileReader;t.onload=()=>e(t.result),t.readAsArrayBuffer(r)})}function Zx(r){return typeof Zp.Readable<"u"&&r instanceof Zp.Readable}function Ge(r,e){return typeof r=="bigint"&&(r=r.toString()),B.asIntegerString(r,e)}function YE(r){const e=B.asObject(r,{name:"BeeRequestOptions"});return{baseURL:B.asOptional(t=>B.asString(t,{name:"baseURL"}),e.baseURL),timeout:B.asOptional(t=>B.asInteger(t,{name:"timeout",min:0}),e.timeout),headers:B.asOptional(t=>B.asStringMap(t,{name:"headers"}),e.headers),onRequest:B.asOptional(t=>B.asFunction(t,{name:"onRequest"}),e.onRequest),httpAgent:e.httpAgent,httpsAgent:e.httpsAgent,endlesslyRetry:B.asOptional(t=>B.asBoolean(t,{name:"endlesslyRetry"}),e.endlesslyRetry),signal:e.signal}}function yn(r){const e=B.asObject(r,{name:"DownloadOptions"});return{redundancyStrategy:B.asOptional(t=>B.asInteger(t,{name:"redundancyStrategy"}),e.redundancyStrategy),fallback:B.asOptional(t=>B.asBoolean(t,{name:"fallback"}),e.fallback),timeoutMs:B.asOptional(t=>B.asInteger(t,{name:"timeoutMs",min:0}),e.timeoutMs),actPublisher:B.asOptional(t=>new vr(t),e.actPublisher),actHistoryAddress:B.asOptional(t=>new ke(t),e.actHistoryAddress),actTimestamp:B.asOptional(t=>B.asNumber(t,{name:"actTimestamp"}),e.actTimestamp)}}function Es(r,e="UploadOptions"){const t=B.asObject(r,{name:e});return{act:B.asOptional(n=>B.asBoolean(n,{name:"act"}),t.act),actHistoryAddress:B.asOptional(n=>new ke(n),t.actHistoryAddress),deferred:B.asOptional(n=>B.asBoolean(n,{name:"deferred"}),t.deferred),encrypt:B.asOptional(n=>B.asBoolean(n,{name:"encrypt"}),t.encrypt),pin:B.asOptional(n=>B.asBoolean(n,{name:"pin"}),t.pin),tag:B.asOptional(n=>B.asInteger(n,{name:"tag",min:0}),t.tag)}}function XE(r,e="UploadOptions"){const t=Es(r,e),n=B.asObject(r,{name:e});return{...t,redundancyLevel:B.asOptional(i=>B.asInteger(i,{name:"redundancyLevel",min:0}),n.redundancyLevel)}}function ZE(r){const e=Es(r,"FileUploadOptions"),t=B.asObject(r,{name:"FileUploadOptions"});return{...e,size:B.asOptional(n=>B.asInteger(n,{name:"size",min:0}),t.size),contentType:B.asOptional(n=>B.asString(n,{name:"contentType"}),t.contentType),redundancyLevel:B.asOptional(n=>B.asInteger(n,{name:"redundancyLevel",min:0}),t.redundancyLevel)}}function bl(r){const e=Es(r,"CollectionUploadOptions"),t=B.asObject(r,{name:"CollectionUploadOptions"});return{...e,errorDocument:B.asOptional(n=>B.asString(n,{name:"errorDocument"}),t.errorDocument),indexDocument:B.asOptional(n=>B.asString(n,{name:"indexDocument"}),t.indexDocument),redundancyLevel:B.asOptional(n=>B.asInteger(n,{name:"redundancyLevel",min:0}),t.redundancyLevel)}}function e4(r){try{const e=B.asObject(r,{name:"Tag"});return B.asInteger(e.uid,{name:"Tag.uid"}),!0}catch{return!1}}function t4(r){const e=B.asObject(r,{name:"PssMessageHandler"});return{onMessage:B.asFunction(e.onMessage,{name:"onMessage"}),onError:B.asFunction(e.onError,{name:"onError"}),onClose:B.asFunction(e.onClose,{name:"onClose"})}}function r4(r){const e=B.asObject(r,{name:"GsocMessageHandler"});return{onMessage:B.asFunction(e.onMessage,{name:"onMessage"}),onError:B.asFunction(e.onError,{name:"onError"}),onClose:B.asFunction(e.onClose,{name:"onClose"})}}function em(r){const e=B.asObject(r,{name:"PostageBatchOptions"});return{gasPrice:B.asOptional(t=>Ge(t,{name:"gasPrice"}),e.gasPrice),immutableFlag:B.asOptional(t=>B.asBoolean(t,{name:"immutableFlag"}),e.immutableFlag),label:B.asOptional(t=>B.asString(t,{name:"label"}),e.label),waitForUsable:B.asOptional(t=>B.asBoolean(t,{name:"waitForUsable"}),e.waitForUsable),waitForUsableTimeout:B.asOptional(t=>B.asInteger(t,{name:"waitForUsableTimeout",min:0}),e.waitForUsableTimeout)}}function tm(r,e="TransactionOptions"){const t=B.asObject(r,{name:e});return{gasLimit:B.asOptional(n=>Ge(n,{name:"gasLimit",min:0n}),t.gasLimit),gasPrice:B.asOptional(n=>Ge(n,{name:"gasPrice",min:0n}),t.gasPrice)}}function rm(r){if(typeof r!="string"&&!(r instanceof Uint8Array))throw new TypeError("Data must be either string or Uint8Array!")}function n4(r){if(typeof r!="string"&&!(r instanceof Uint8Array)&&!Yx(r)&&!Zx(r))throw new TypeError("Data must be either string, Readable, Uint8Array or File!")}function i4(r){const e=B.asObject(r,{name:"AllTagsOptions"});return{limit:B.asOptional(t=>B.asInteger(t,{name:"limit",min:aE,max:oE}),e.limit),offset:B.asOptional(t=>B.asInteger(t,{name:"offset",min:0}),e.offset)}}function wn(r){if(r==null)throw new TypeError(`Expected number | Tag | string from tagUid, got: ${r}`);if(e4(r))return r.uid;if(typeof r=="number"||typeof r=="string")return B.asNumber(r,{name:"tagUid",min:0});throw new TypeError(`Expected number | Tag | string from tagUid, got: ${r}`)}function s4(r){return!Number.isInteger(r)||r<1?1:r>3155695200?3155695200:r}function a4(r){return!Number.isInteger(r)||r<24e3?24e3:r}const o4=.9;function c4(r,e,t){return r/Math.pow(2,e-t)}function ey(r){return 4096*2**r}const ty=[[17,4089e-8],[18,.00609],[19,.10249],[20,.62891],[21,2.38],[22,7.07],[23,18.24],[24,43.04],[25,96.5],[26,208.52],[27,435.98],[28,908.81],[29,1870],[30,3810],[31,7730],[32,15610],[33,31430],[34,63150]];function Ca(r,e,t){if(r<17)return 0;if(e!==void 0&&t!==void 0){const a=Fx[e?"ENCRYPTION_ON":"ENCRYPTION_OFF"][t].find(c=>c.batchDepth===r);if(a?.effectiveVolume)return Ox(a.effectiveVolume)}else{const n=ty.find(([i,a])=>{if(r===i)return a});if(n)return n[1]*1e3*1e3*1e3}return Math.ceil(ey(r)*o4)}function JT(r,e){const t=new Map;for(let n=17;n<35;n++)t.set(n,Ca(n,r,e));return t}function oi(r,e){return _e.fromPLUR(2n**BigInt(r)*BigInt(e))}function YT(r,e,t){const n=BigInt(Ge(r));return lr.fromSeconds(Number(n*BigInt(t)/BigInt(e)))}function Ur(r,e,t){return BigInt(r.toSeconds())/BigInt(t)*BigInt(e)+1n}function ci(r,e,t){if(e!==void 0&&t!==void 0){const a=Fx[e?"ENCRYPTION_ON":"ENCRYPTION_OFF"][t].find(c=>r.toBytes()<=Ox(c.effectiveVolume));if(a?.effectiveVolume)return a.batchDepth}else for(const[n,i]of ty)if(r.toBytes()<=i*1e3*1e3*1e3)return n;return 35}function u4(r){return l4(r.signature,r.batchId.toUint8Array(),r.timestamp,r.index)}function l4(r,e,t,n){if(r.length!==65)throw Error("invalid signature length");if(e.length!==32)throw Error("invalid batch ID length");if(t.length!==8)throw Error("invalid timestamp length");if(n.length!==8)throw Error("invalid index length");return new ze(me.concatBytes(e,n,t,r))}function ry(r,e,t){const n=c4(r.utilization,r.depth,r.bucketDepth),i=s4(r.batchTTL),a=lr.fromSeconds(i),c=Ca(r.depth,e,t);return{batchID:new ut(r.batchID),utilization:r.utilization,usable:r.usable,label:r.label,depth:r.depth,amount:Ge(r.amount),bucketDepth:r.bucketDepth,blockNumber:r.blockNumber,immutableFlag:r.immutableFlag,usage:n,usageText:`${Math.round(n*100)}%`,size:Ir.fromBytes(c),remainingSize:Ir.fromBytes(Math.ceil(c*(1-n))),theoreticalSize:Ir.fromBytes(ey(r.depth)),duration:a,calculateSize(u,l){const d=Ca(r.depth,u,l);return Ir.fromBytes(d)},calculateRemainingSize(u,l){const d=Ca(r.depth,u,l);return Ir.fromBytes(Math.ceil(d*(1-this.usage)))}}}function ny(r){const e=f4(r["content-disposition"]),t=h4(r["swarm-tag-uid"]),n=r["content-type"]||void 0;return{name:e,tagUid:t,contentType:n}}function f4(r){if(!r)throw new Pr("missing content-disposition header");const e=r.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?;?/i);if(e&&e.length>0)return e[1];throw new Pr("invalid content-disposition header")}function h4(r){if(r)return parseInt(r,10)}function Jt(r,e){const t={};if(d4(r)?t["swarm-postage-stamp"]=u4(r).toHex():r&&(r=new ut(r),t["swarm-postage-batch-id"]=r.toHex()),!e)return t;const n=B.asObject(e);return n.size&&(t["content-length"]=String(n.size)),n.contentType&&(t["content-type"]=String(n.contentType)),n.redundancyLevel&&(t["swarm-redundancy-level"]=String(n.redundancyLevel)),B.isBoolean(n.act)&&(t["swarm-act"]=String(n.act)),B.isBoolean(n.pin)&&(t["swarm-pin"]=String(n.pin)),B.isBoolean(n.encrypt)&&(t["swarm-encrypt"]=n.encrypt.toString()),n.tag&&(t["swarm-tag"]=String(n.tag)),B.isBoolean(n.deferred)&&(t["swarm-deferred-upload"]=n.deferred.toString()),n.redundancyStrategy&&(t["swarm-redundancy-strategy"]=String(n.redundancyStrategy)),B.isBoolean(n.fallback)&&(t["swarm-redundancy-fallback-mode"]=n.fallback.toString()),n.timeoutMs&&(t["swarm-chunk-retrieval-timeout"]=String(n.timeoutMs)),n.indexDocument&&(t["swarm-index-document"]=String(n.indexDocument)),n.errorDocument&&(t["swarm-error-document"]=String(n.errorDocument)),n.actPublisher&&(t["swarm-act-publisher"]=new vr(n.actPublisher).toCompressedHex()),n.actHistoryAddress&&(t["swarm-act-history-address"]=new ke(n.actHistoryAddress).toHex()),n.actTimestamp&&(t["swarm-act-timestamp"]=String(n.actTimestamp)),(n.actPublisher||n.actHistoryAddress||n.actTimestamp)&&(t["swarm-act"]="true"),n.gasPrice&&(t["gas-price"]=String(n.gasPrice)),n.gasLimit&&(t["gas-limit"]=String(n.gasLimit)),t}function d4(r){if(!B.isObject(r))return!1;const e=r;return e.issuer!==void 0&&e.index!==void 0&&e.signature!==void 0&&e.timestamp!==void 0&&e.batchId!==void 0}var iy={},no={};no.byteLength=b4;no.toByteArray=y4;no.fromByteArray=A4;var jr=[],gr=[],p4=typeof Uint8Array<"u"?Uint8Array:Array,xl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var ui=0,m4=xl.length;ui<m4;++ui)jr[ui]=xl[ui],gr[xl.charCodeAt(ui)]=ui;gr[45]=62;gr[95]=63;function sy(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function b4(r){var e=sy(r),t=e[0],n=e[1];return(t+n)*3/4-n}function x4(r,e,t){return(e+t)*3/4-t}function y4(r){var e,t=sy(r),n=t[0],i=t[1],a=new p4(x4(r,n,i)),c=0,u=i>0?n-4:n,l;for(l=0;l<u;l+=4)e=gr[r.charCodeAt(l)]<<18|gr[r.charCodeAt(l+1)]<<12|gr[r.charCodeAt(l+2)]<<6|gr[r.charCodeAt(l+3)],a[c++]=e>>16&255,a[c++]=e>>8&255,a[c++]=e&255;return i===2&&(e=gr[r.charCodeAt(l)]<<2|gr[r.charCodeAt(l+1)]>>4,a[c++]=e&255),i===1&&(e=gr[r.charCodeAt(l)]<<10|gr[r.charCodeAt(l+1)]<<4|gr[r.charCodeAt(l+2)]>>2,a[c++]=e>>8&255,a[c++]=e&255),a}function g4(r){return jr[r>>18&63]+jr[r>>12&63]+jr[r>>6&63]+jr[r&63]}function w4(r,e,t){for(var n,i=[],a=e;a<t;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(r[a+2]&255),i.push(g4(n));return i.join("")}function A4(r){for(var e,t=r.length,n=t%3,i=[],a=16383,c=0,u=t-n;c<u;c+=a)i.push(w4(r,c,c+a>u?u:c+a));return n===1?(e=r[t-1],i.push(jr[e>>2]+jr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(jr[e>>10]+jr[e>>4&63]+jr[e<<2&63]+"=")),i.join("")}var E0={};E0.read=function(r,e,t,n,i){var a,c,u=i*8-n-1,l=(1<<u)-1,d=l>>1,h=-7,m=t?i-1:0,y=t?-1:1,E=r[e+m];for(m+=y,a=E&(1<<-h)-1,E>>=-h,h+=u;h>0;a=a*256+r[e+m],m+=y,h-=8);for(c=a&(1<<-h)-1,a>>=-h,h+=n;h>0;c=c*256+r[e+m],m+=y,h-=8);if(a===0)a=1-d;else{if(a===l)return c?NaN:(E?-1:1)*(1/0);c=c+Math.pow(2,n),a=a-d}return(E?-1:1)*c*Math.pow(2,a-n)};E0.write=function(r,e,t,n,i,a){var c,u,l,d=a*8-i-1,h=(1<<d)-1,m=h>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:a-1,O=n?1:-1,R=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,c=h):(c=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-c))<1&&(c--,l*=2),c+m>=1?e+=y/l:e+=y*Math.pow(2,1-m),e*l>=2&&(c++,l/=2),c+m>=h?(u=0,c=h):c+m>=1?(u=(e*l-1)*Math.pow(2,i),c=c+m):(u=e*Math.pow(2,m-1)*Math.pow(2,i),c=0));i>=8;r[t+E]=u&255,E+=O,u/=256,i-=8);for(c=c<<i|u,d+=i;d>0;r[t+E]=c&255,E+=O,c/=256,d-=8);r[t+E-O]|=R*128};(function(r){const e=no,t=E0,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=h,r.SlowBuffer=U,r.INSPECT_MAX_BYTES=50;const i=2147483647;r.kMaxLength=i;const{Uint8Array:a,ArrayBuffer:c,SharedArrayBuffer:u}=globalThis;h.TYPED_ARRAY_SUPPORT=l(),!h.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 l(){try{const T=new a(1),b={foo:function(){return 42}};return Object.setPrototypeOf(b,a.prototype),Object.setPrototypeOf(T,b),T.foo()===42}catch{return!1}}Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}});function d(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');const b=new a(T);return Object.setPrototypeOf(b,h.prototype),b}function h(T,b,g){if(typeof T=="number"){if(typeof b=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return O(T)}return m(T,b,g)}h.poolSize=8192;function m(T,b,g){if(typeof T=="string")return R(T,b);if(c.isView(T))return v(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(Et(T,c)||T&&Et(T.buffer,c)||typeof u<"u"&&(Et(T,u)||T&&Et(T.buffer,u)))return C(T,b,g);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const M=T.valueOf&&T.valueOf();if(M!=null&&M!==T)return h.from(M,b,g);const K=N(T);if(K)return K;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return h.from(T[Symbol.toPrimitive]("string"),b,g);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}h.from=function(T,b,g){return m(T,b,g)},Object.setPrototypeOf(h.prototype,a.prototype),Object.setPrototypeOf(h,a);function y(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 E(T,b,g){return y(T),T<=0?d(T):b!==void 0?typeof g=="string"?d(T).fill(b,g):d(T).fill(b):d(T)}h.alloc=function(T,b,g){return E(T,b,g)};function O(T){return y(T),d(T<0?0:F(T)|0)}h.allocUnsafe=function(T){return O(T)},h.allocUnsafeSlow=function(T){return O(T)};function R(T,b){if((typeof b!="string"||b==="")&&(b="utf8"),!h.isEncoding(b))throw new TypeError("Unknown encoding: "+b);const g=V(T,b)|0;let M=d(g);const K=M.write(T,b);return K!==g&&(M=M.slice(0,K)),M}function P(T){const b=T.length<0?0:F(T.length)|0,g=d(b);for(let M=0;M<b;M+=1)g[M]=T[M]&255;return g}function v(T){if(Et(T,a)){const b=new a(T);return C(b.buffer,b.byteOffset,b.byteLength)}return P(T)}function C(T,b,g){if(b<0||T.byteLength<b)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<b+(g||0))throw new RangeError('"length" is outside of buffer bounds');let M;return b===void 0&&g===void 0?M=new a(T):g===void 0?M=new a(T,b):M=new a(T,b,g),Object.setPrototypeOf(M,h.prototype),M}function N(T){if(h.isBuffer(T)){const b=F(T.length)|0,g=d(b);return g.length===0||T.copy(g,0,0,b),g}if(T.length!==void 0)return typeof T.length!="number"||it(T.length)?d(0):P(T);if(T.type==="Buffer"&&Array.isArray(T.data))return P(T.data)}function F(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function U(T){return+T!=T&&(T=0),h.alloc(+T)}h.isBuffer=function(b){return b!=null&&b._isBuffer===!0&&b!==h.prototype},h.compare=function(b,g){if(Et(b,a)&&(b=h.from(b,b.offset,b.byteLength)),Et(g,a)&&(g=h.from(g,g.offset,g.byteLength)),!h.isBuffer(b)||!h.isBuffer(g))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(b===g)return 0;let M=b.length,K=g.length;for(let Z=0,ce=Math.min(M,K);Z<ce;++Z)if(b[Z]!==g[Z]){M=b[Z],K=g[Z];break}return M<K?-1:K<M?1:0},h.isEncoding=function(b){switch(String(b).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}},h.concat=function(b,g){if(!Array.isArray(b))throw new TypeError('"list" argument must be an Array of Buffers');if(b.length===0)return h.alloc(0);let M;if(g===void 0)for(g=0,M=0;M<b.length;++M)g+=b[M].length;const K=h.allocUnsafe(g);let Z=0;for(M=0;M<b.length;++M){let ce=b[M];if(Et(ce,a))Z+ce.length>K.length?(h.isBuffer(ce)||(ce=h.from(ce)),ce.copy(K,Z)):a.prototype.set.call(K,ce,Z);else if(h.isBuffer(ce))ce.copy(K,Z);else throw new TypeError('"list" argument must be an Array of Buffers');Z+=ce.length}return K};function V(T,b){if(h.isBuffer(T))return T.length;if(c.isView(T)||Et(T,c))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);const g=T.length,M=arguments.length>2&&arguments[2]===!0;if(!M&&g===0)return 0;let K=!1;for(;;)switch(b){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":return dt(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return nt(T).length;default:if(K)return M?-1:dt(T).length;b=(""+b).toLowerCase(),K=!0}}h.byteLength=V;function L(T,b,g){let M=!1;if((b===void 0||b<0)&&(b=0),b>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,b>>>=0,g<=b))return"";for(T||(T="utf8");;)switch(T){case"hex":return ge(this,b,g);case"utf8":case"utf-8":return Ee(this,b,g);case"ascii":return Ne(this,b,g);case"latin1":case"binary":return X(this,b,g);case"base64":return be(this,b,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,b,g);default:if(M)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),M=!0}}h.prototype._isBuffer=!0;function G(T,b,g){const M=T[b];T[b]=T[g],T[g]=M}h.prototype.swap16=function(){const b=this.length;if(b%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let g=0;g<b;g+=2)G(this,g,g+1);return this},h.prototype.swap32=function(){const b=this.length;if(b%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let g=0;g<b;g+=4)G(this,g,g+3),G(this,g+1,g+2);return this},h.prototype.swap64=function(){const b=this.length;if(b%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let g=0;g<b;g+=8)G(this,g,g+7),G(this,g+1,g+6),G(this,g+2,g+5),G(this,g+3,g+4);return this},h.prototype.toString=function(){const b=this.length;return b===0?"":arguments.length===0?Ee(this,0,b):L.apply(this,arguments)},h.prototype.toLocaleString=h.prototype.toString,h.prototype.equals=function(b){if(!h.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b?!0:h.compare(this,b)===0},h.prototype.inspect=function(){let b="";const g=r.INSPECT_MAX_BYTES;return b=this.toString("hex",0,g).replace(/(.{2})/g,"$1 ").trim(),this.length>g&&(b+=" ... "),"<Buffer "+b+">"},n&&(h.prototype[n]=h.prototype.inspect),h.prototype.compare=function(b,g,M,K,Z){if(Et(b,a)&&(b=h.from(b,b.offset,b.byteLength)),!h.isBuffer(b))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof b);if(g===void 0&&(g=0),M===void 0&&(M=b?b.length:0),K===void 0&&(K=0),Z===void 0&&(Z=this.length),g<0||M>b.length||K<0||Z>this.length)throw new RangeError("out of range index");if(K>=Z&&g>=M)return 0;if(K>=Z)return-1;if(g>=M)return 1;if(g>>>=0,M>>>=0,K>>>=0,Z>>>=0,this===b)return 0;let ce=Z-K,Ue=M-g;const st=Math.min(ce,Ue),Ze=this.slice(K,Z),ct=b.slice(g,M);for(let Ke=0;Ke<st;++Ke)if(Ze[Ke]!==ct[Ke]){ce=Ze[Ke],Ue=ct[Ke];break}return ce<Ue?-1:Ue<ce?1:0};function Q(T,b,g,M,K){if(T.length===0)return-1;if(typeof g=="string"?(M=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,it(g)&&(g=K?0:T.length-1),g<0&&(g=T.length+g),g>=T.length){if(K)return-1;g=T.length-1}else if(g<0)if(K)g=0;else return-1;if(typeof b=="string"&&(b=h.from(b,M)),h.isBuffer(b))return b.length===0?-1:re(T,b,g,M,K);if(typeof b=="number")return b=b&255,typeof a.prototype.indexOf=="function"?K?a.prototype.indexOf.call(T,b,g):a.prototype.lastIndexOf.call(T,b,g):re(T,[b],g,M,K);throw new TypeError("val must be string, number or Buffer")}function re(T,b,g,M,K){let Z=1,ce=T.length,Ue=b.length;if(M!==void 0&&(M=String(M).toLowerCase(),M==="ucs2"||M==="ucs-2"||M==="utf16le"||M==="utf-16le")){if(T.length<2||b.length<2)return-1;Z=2,ce/=2,Ue/=2,g/=2}function st(ct,Ke){return Z===1?ct[Ke]:ct.readUInt16BE(Ke*Z)}let Ze;if(K){let ct=-1;for(Ze=g;Ze<ce;Ze++)if(st(T,Ze)===st(b,ct===-1?0:Ze-ct)){if(ct===-1&&(ct=Ze),Ze-ct+1===Ue)return ct*Z}else ct!==-1&&(Ze-=Ze-ct),ct=-1}else for(g+Ue>ce&&(g=ce-Ue),Ze=g;Ze>=0;Ze--){let ct=!0;for(let Ke=0;Ke<Ue;Ke++)if(st(T,Ze+Ke)!==st(b,Ke)){ct=!1;break}if(ct)return Ze}return-1}h.prototype.includes=function(b,g,M){return this.indexOf(b,g,M)!==-1},h.prototype.indexOf=function(b,g,M){return Q(this,b,g,M,!0)},h.prototype.lastIndexOf=function(b,g,M){return Q(this,b,g,M,!1)};function de(T,b,g,M){g=Number(g)||0;const K=T.length-g;M?(M=Number(M),M>K&&(M=K)):M=K;const Z=b.length;M>Z/2&&(M=Z/2);let ce;for(ce=0;ce<M;++ce){const Ue=parseInt(b.substr(ce*2,2),16);if(it(Ue))return ce;T[g+ce]=Ue}return ce}function z(T,b,g,M){return It(dt(b,T.length-g),T,g,M)}function we(T,b,g,M){return It(xt(b),T,g,M)}function Te(T,b,g,M){return It(nt(b),T,g,M)}function ae(T,b,g,M){return It(Xe(b,T.length-g),T,g,M)}h.prototype.write=function(b,g,M,K){if(g===void 0)K="utf8",M=this.length,g=0;else if(M===void 0&&typeof g=="string")K=g,M=this.length,g=0;else if(isFinite(g))g=g>>>0,isFinite(M)?(M=M>>>0,K===void 0&&(K="utf8")):(K=M,M=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Z=this.length-g;if((M===void 0||M>Z)&&(M=Z),b.length>0&&(M<0||g<0)||g>this.length)throw new RangeError("Attempt to write outside buffer bounds");K||(K="utf8");let ce=!1;for(;;)switch(K){case"hex":return de(this,b,g,M);case"utf8":case"utf-8":return z(this,b,g,M);case"ascii":case"latin1":case"binary":return we(this,b,g,M);case"base64":return Te(this,b,g,M);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,b,g,M);default:if(ce)throw new TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),ce=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function be(T,b,g){return b===0&&g===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(b,g))}function Ee(T,b,g){g=Math.min(T.length,g);const M=[];let K=b;for(;K<g;){const Z=T[K];let ce=null,Ue=Z>239?4:Z>223?3:Z>191?2:1;if(K+Ue<=g){let st,Ze,ct,Ke;switch(Ue){case 1:Z<128&&(ce=Z);break;case 2:st=T[K+1],(st&192)===128&&(Ke=(Z&31)<<6|st&63,Ke>127&&(ce=Ke));break;case 3:st=T[K+1],Ze=T[K+2],(st&192)===128&&(Ze&192)===128&&(Ke=(Z&15)<<12|(st&63)<<6|Ze&63,Ke>2047&&(Ke<55296||Ke>57343)&&(ce=Ke));break;case 4:st=T[K+1],Ze=T[K+2],ct=T[K+3],(st&192)===128&&(Ze&192)===128&&(ct&192)===128&&(Ke=(Z&15)<<18|(st&63)<<12|(Ze&63)<<6|ct&63,Ke>65535&&Ke<1114112&&(ce=Ke))}}ce===null?(ce=65533,Ue=1):ce>65535&&(ce-=65536,M.push(ce>>>10&1023|55296),ce=56320|ce&1023),M.push(ce),K+=Ue}return Oe(M)}const Re=4096;function Oe(T){const b=T.length;if(b<=Re)return String.fromCharCode.apply(String,T);let g="",M=0;for(;M<b;)g+=String.fromCharCode.apply(String,T.slice(M,M+=Re));return g}function Ne(T,b,g){let M="";g=Math.min(T.length,g);for(let K=b;K<g;++K)M+=String.fromCharCode(T[K]&127);return M}function X(T,b,g){let M="";g=Math.min(T.length,g);for(let K=b;K<g;++K)M+=String.fromCharCode(T[K]);return M}function ge(T,b,g){const M=T.length;(!b||b<0)&&(b=0),(!g||g<0||g>M)&&(g=M);let K="";for(let Z=b;Z<g;++Z)K+=Ct[T[Z]];return K}function q(T,b,g){const M=T.slice(b,g);let K="";for(let Z=0;Z<M.length-1;Z+=2)K+=String.fromCharCode(M[Z]+M[Z+1]*256);return K}h.prototype.slice=function(b,g){const M=this.length;b=~~b,g=g===void 0?M:~~g,b<0?(b+=M,b<0&&(b=0)):b>M&&(b=M),g<0?(g+=M,g<0&&(g=0)):g>M&&(g=M),g<b&&(g=b);const K=this.subarray(b,g);return Object.setPrototypeOf(K,h.prototype),K};function Y(T,b,g){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+b>g)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUintLE=h.prototype.readUIntLE=function(b,g,M){b=b>>>0,g=g>>>0,M||Y(b,g,this.length);let K=this[b],Z=1,ce=0;for(;++ce<g&&(Z*=256);)K+=this[b+ce]*Z;return K},h.prototype.readUintBE=h.prototype.readUIntBE=function(b,g,M){b=b>>>0,g=g>>>0,M||Y(b,g,this.length);let K=this[b+--g],Z=1;for(;g>0&&(Z*=256);)K+=this[b+--g]*Z;return K},h.prototype.readUint8=h.prototype.readUInt8=function(b,g){return b=b>>>0,g||Y(b,1,this.length),this[b]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(b,g){return b=b>>>0,g||Y(b,2,this.length),this[b]|this[b+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(b,g){return b=b>>>0,g||Y(b,2,this.length),this[b]<<8|this[b+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(b,g){return b=b>>>0,g||Y(b,4,this.length),(this[b]|this[b+1]<<8|this[b+2]<<16)+this[b+3]*16777216},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(b,g){return b=b>>>0,g||Y(b,4,this.length),this[b]*16777216+(this[b+1]<<16|this[b+2]<<8|this[b+3])},h.prototype.readBigUInt64LE=Bt(function(b){b=b>>>0,Be(b,"offset");const g=this[b],M=this[b+7];(g===void 0||M===void 0)&&De(b,this.length-8);const K=g+this[++b]*2**8+this[++b]*2**16+this[++b]*2**24,Z=this[++b]+this[++b]*2**8+this[++b]*2**16+M*2**24;return BigInt(K)+(BigInt(Z)<<BigInt(32))}),h.prototype.readBigUInt64BE=Bt(function(b){b=b>>>0,Be(b,"offset");const g=this[b],M=this[b+7];(g===void 0||M===void 0)&&De(b,this.length-8);const K=g*2**24+this[++b]*2**16+this[++b]*2**8+this[++b],Z=this[++b]*2**24+this[++b]*2**16+this[++b]*2**8+M;return(BigInt(K)<<BigInt(32))+BigInt(Z)}),h.prototype.readIntLE=function(b,g,M){b=b>>>0,g=g>>>0,M||Y(b,g,this.length);let K=this[b],Z=1,ce=0;for(;++ce<g&&(Z*=256);)K+=this[b+ce]*Z;return Z*=128,K>=Z&&(K-=Math.pow(2,8*g)),K},h.prototype.readIntBE=function(b,g,M){b=b>>>0,g=g>>>0,M||Y(b,g,this.length);let K=g,Z=1,ce=this[b+--K];for(;K>0&&(Z*=256);)ce+=this[b+--K]*Z;return Z*=128,ce>=Z&&(ce-=Math.pow(2,8*g)),ce},h.prototype.readInt8=function(b,g){return b=b>>>0,g||Y(b,1,this.length),this[b]&128?(255-this[b]+1)*-1:this[b]},h.prototype.readInt16LE=function(b,g){b=b>>>0,g||Y(b,2,this.length);const M=this[b]|this[b+1]<<8;return M&32768?M|4294901760:M},h.prototype.readInt16BE=function(b,g){b=b>>>0,g||Y(b,2,this.length);const M=this[b+1]|this[b]<<8;return M&32768?M|4294901760:M},h.prototype.readInt32LE=function(b,g){return b=b>>>0,g||Y(b,4,this.length),this[b]|this[b+1]<<8|this[b+2]<<16|this[b+3]<<24},h.prototype.readInt32BE=function(b,g){return b=b>>>0,g||Y(b,4,this.length),this[b]<<24|this[b+1]<<16|this[b+2]<<8|this[b+3]},h.prototype.readBigInt64LE=Bt(function(b){b=b>>>0,Be(b,"offset");const g=this[b],M=this[b+7];(g===void 0||M===void 0)&&De(b,this.length-8);const K=this[b+4]+this[b+5]*2**8+this[b+6]*2**16+(M<<24);return(BigInt(K)<<BigInt(32))+BigInt(g+this[++b]*2**8+this[++b]*2**16+this[++b]*2**24)}),h.prototype.readBigInt64BE=Bt(function(b){b=b>>>0,Be(b,"offset");const g=this[b],M=this[b+7];(g===void 0||M===void 0)&&De(b,this.length-8);const K=(g<<24)+this[++b]*2**16+this[++b]*2**8+this[++b];return(BigInt(K)<<BigInt(32))+BigInt(this[++b]*2**24+this[++b]*2**16+this[++b]*2**8+M)}),h.prototype.readFloatLE=function(b,g){return b=b>>>0,g||Y(b,4,this.length),t.read(this,b,!0,23,4)},h.prototype.readFloatBE=function(b,g){return b=b>>>0,g||Y(b,4,this.length),t.read(this,b,!1,23,4)},h.prototype.readDoubleLE=function(b,g){return b=b>>>0,g||Y(b,8,this.length),t.read(this,b,!0,52,8)},h.prototype.readDoubleBE=function(b,g){return b=b>>>0,g||Y(b,8,this.length),t.read(this,b,!1,52,8)};function ee(T,b,g,M,K,Z){if(!h.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>K||b<Z)throw new RangeError('"value" argument is out of bounds');if(g+M>T.length)throw new RangeError("Index out of range")}h.prototype.writeUintLE=h.prototype.writeUIntLE=function(b,g,M,K){if(b=+b,g=g>>>0,M=M>>>0,!K){const Ue=Math.pow(2,8*M)-1;ee(this,b,g,M,Ue,0)}let Z=1,ce=0;for(this[g]=b&255;++ce<M&&(Z*=256);)this[g+ce]=b/Z&255;return g+M},h.prototype.writeUintBE=h.prototype.writeUIntBE=function(b,g,M,K){if(b=+b,g=g>>>0,M=M>>>0,!K){const Ue=Math.pow(2,8*M)-1;ee(this,b,g,M,Ue,0)}let Z=M-1,ce=1;for(this[g+Z]=b&255;--Z>=0&&(ce*=256);)this[g+Z]=b/ce&255;return g+M},h.prototype.writeUint8=h.prototype.writeUInt8=function(b,g,M){return b=+b,g=g>>>0,M||ee(this,b,g,1,255,0),this[g]=b&255,g+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(b,g,M){return b=+b,g=g>>>0,M||ee(this,b,g,2,65535,0),this[g]=b&255,this[g+1]=b>>>8,g+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(b,g,M){return b=+b,g=g>>>0,M||ee(this,b,g,2,65535,0),this[g]=b>>>8,this[g+1]=b&255,g+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(b,g,M){return b=+b,g=g>>>0,M||ee(this,b,g,4,4294967295,0),this[g+3]=b>>>24,this[g+2]=b>>>16,this[g+1]=b>>>8,this[g]=b&255,g+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(b,g,M){return b=+b,g=g>>>0,M||ee(this,b,g,4,4294967295,0),this[g]=b>>>24,this[g+1]=b>>>16,this[g+2]=b>>>8,this[g+3]=b&255,g+4};function H(T,b,g,M,K){Fe(b,M,K,T,g,7);let Z=Number(b&BigInt(4294967295));T[g++]=Z,Z=Z>>8,T[g++]=Z,Z=Z>>8,T[g++]=Z,Z=Z>>8,T[g++]=Z;let ce=Number(b>>BigInt(32)&BigInt(4294967295));return T[g++]=ce,ce=ce>>8,T[g++]=ce,ce=ce>>8,T[g++]=ce,ce=ce>>8,T[g++]=ce,g}function $(T,b,g,M,K){Fe(b,M,K,T,g,7);let Z=Number(b&BigInt(4294967295));T[g+7]=Z,Z=Z>>8,T[g+6]=Z,Z=Z>>8,T[g+5]=Z,Z=Z>>8,T[g+4]=Z;let ce=Number(b>>BigInt(32)&BigInt(4294967295));return T[g+3]=ce,ce=ce>>8,T[g+2]=ce,ce=ce>>8,T[g+1]=ce,ce=ce>>8,T[g]=ce,g+8}h.prototype.writeBigUInt64LE=Bt(function(b,g=0){return H(this,b,g,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeBigUInt64BE=Bt(function(b,g=0){return $(this,b,g,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeIntLE=function(b,g,M,K){if(b=+b,g=g>>>0,!K){const st=Math.pow(2,8*M-1);ee(this,b,g,M,st-1,-st)}let Z=0,ce=1,Ue=0;for(this[g]=b&255;++Z<M&&(ce*=256);)b<0&&Ue===0&&this[g+Z-1]!==0&&(Ue=1),this[g+Z]=(b/ce>>0)-Ue&255;return g+M},h.prototype.writeIntBE=function(b,g,M,K){if(b=+b,g=g>>>0,!K){const st=Math.pow(2,8*M-1);ee(this,b,g,M,st-1,-st)}let Z=M-1,ce=1,Ue=0;for(this[g+Z]=b&255;--Z>=0&&(ce*=256);)b<0&&Ue===0&&this[g+Z+1]!==0&&(Ue=1),this[g+Z]=(b/ce>>0)-Ue&255;return g+M},h.prototype.writeInt8=function(b,g,M){return b=+b,g=g>>>0,M||ee(this,b,g,1,127,-128),b<0&&(b=255+b+1),this[g]=b&255,g+1},h.prototype.writeInt16LE=function(b,g,M){return b=+b,g=g>>>0,M||ee(this,b,g,2,32767,-32768),this[g]=b&255,this[g+1]=b>>>8,g+2},h.prototype.writeInt16BE=function(b,g,M){return b=+b,g=g>>>0,M||ee(this,b,g,2,32767,-32768),this[g]=b>>>8,this[g+1]=b&255,g+2},h.prototype.writeInt32LE=function(b,g,M){return b=+b,g=g>>>0,M||ee(this,b,g,4,2147483647,-2147483648),this[g]=b&255,this[g+1]=b>>>8,this[g+2]=b>>>16,this[g+3]=b>>>24,g+4},h.prototype.writeInt32BE=function(b,g,M){return b=+b,g=g>>>0,M||ee(this,b,g,4,2147483647,-2147483648),b<0&&(b=4294967295+b+1),this[g]=b>>>24,this[g+1]=b>>>16,this[g+2]=b>>>8,this[g+3]=b&255,g+4},h.prototype.writeBigInt64LE=Bt(function(b,g=0){return H(this,b,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),h.prototype.writeBigInt64BE=Bt(function(b,g=0){return $(this,b,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ie(T,b,g,M,K,Z){if(g+M>T.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function he(T,b,g,M,K){return b=+b,g=g>>>0,K||ie(T,b,g,4),t.write(T,b,g,M,23,4),g+4}h.prototype.writeFloatLE=function(b,g,M){return he(this,b,g,!0,M)},h.prototype.writeFloatBE=function(b,g,M){return he(this,b,g,!1,M)};function pe(T,b,g,M,K){return b=+b,g=g>>>0,K||ie(T,b,g,8),t.write(T,b,g,M,52,8),g+8}h.prototype.writeDoubleLE=function(b,g,M){return pe(this,b,g,!0,M)},h.prototype.writeDoubleBE=function(b,g,M){return pe(this,b,g,!1,M)},h.prototype.copy=function(b,g,M,K){if(!h.isBuffer(b))throw new TypeError("argument should be a Buffer");if(M||(M=0),!K&&K!==0&&(K=this.length),g>=b.length&&(g=b.length),g||(g=0),K>0&&K<M&&(K=M),K===M||b.length===0||this.length===0)return 0;if(g<0)throw new RangeError("targetStart out of bounds");if(M<0||M>=this.length)throw new RangeError("Index out of range");if(K<0)throw new RangeError("sourceEnd out of bounds");K>this.length&&(K=this.length),b.length-g<K-M&&(K=b.length-g+M);const Z=K-M;return this===b&&typeof a.prototype.copyWithin=="function"?this.copyWithin(g,M,K):a.prototype.set.call(b,this.subarray(M,K),g),Z},h.prototype.fill=function(b,g,M,K){if(typeof b=="string"){if(typeof g=="string"?(K=g,g=0,M=this.length):typeof M=="string"&&(K=M,M=this.length),K!==void 0&&typeof K!="string")throw new TypeError("encoding must be a string");if(typeof K=="string"&&!h.isEncoding(K))throw new TypeError("Unknown encoding: "+K);if(b.length===1){const ce=b.charCodeAt(0);(K==="utf8"&&ce<128||K==="latin1")&&(b=ce)}}else typeof b=="number"?b=b&255:typeof b=="boolean"&&(b=Number(b));if(g<0||this.length<g||this.length<M)throw new RangeError("Out of range index");if(M<=g)return this;g=g>>>0,M=M===void 0?this.length:M>>>0,b||(b=0);let Z;if(typeof b=="number")for(Z=g;Z<M;++Z)this[Z]=b;else{const ce=h.isBuffer(b)?b:h.from(b,K),Ue=ce.length;if(Ue===0)throw new TypeError('The value "'+b+'" is invalid for argument "value"');for(Z=0;Z<M-g;++Z)this[Z+g]=ce[Z%Ue]}return this};const k={};function D(T,b,g){k[T]=class extends g{constructor(){super(),Object.defineProperty(this,"message",{value:b.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(K){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:K,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}D("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),D("ERR_INVALID_ARG_TYPE",function(T,b){return`The "${T}" argument must be of type number. Received type ${typeof b}`},TypeError),D("ERR_OUT_OF_RANGE",function(T,b,g){let M=`The value of "${T}" is out of range.`,K=g;return Number.isInteger(g)&&Math.abs(g)>2**32?K=ne(String(g)):typeof g=="bigint"&&(K=String(g),(g>BigInt(2)**BigInt(32)||g<-(BigInt(2)**BigInt(32)))&&(K=ne(K)),K+="n"),M+=` It must be ${b}. Received ${K}`,M},RangeError);function ne(T){let b="",g=T.length;const M=T[0]==="-"?1:0;for(;g>=M+4;g-=3)b=`_${T.slice(g-3,g)}${b}`;return`${T.slice(0,g)}${b}`}function ye(T,b,g){Be(b,"offset"),(T[b]===void 0||T[b+g]===void 0)&&De(b,T.length-(g+1))}function Fe(T,b,g,M,K,Z){if(T>g||T<b){const ce=typeof b=="bigint"?"n":"";let Ue;throw b===0||b===BigInt(0)?Ue=`>= 0${ce} and < 2${ce} ** ${(Z+1)*8}${ce}`:Ue=`>= -(2${ce} ** ${(Z+1)*8-1}${ce}) and < 2 ** ${(Z+1)*8-1}${ce}`,new k.ERR_OUT_OF_RANGE("value",Ue,T)}ye(M,K,Z)}function Be(T,b){if(typeof T!="number")throw new k.ERR_INVALID_ARG_TYPE(b,"number",T)}function De(T,b,g){throw Math.floor(T)!==T?(Be(T,g),new k.ERR_OUT_OF_RANGE("offset","an integer",T)):b<0?new k.ERR_BUFFER_OUT_OF_BOUNDS:new k.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${b}`,T)}const Ft=/[^+/0-9A-Za-z-_]/g;function oe(T){if(T=T.split("=")[0],T=T.trim().replace(Ft,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function dt(T,b){b=b||1/0;let g;const M=T.length;let K=null;const Z=[];for(let ce=0;ce<M;++ce){if(g=T.charCodeAt(ce),g>55295&&g<57344){if(!K){if(g>56319){(b-=3)>-1&&Z.push(239,191,189);continue}else if(ce+1===M){(b-=3)>-1&&Z.push(239,191,189);continue}K=g;continue}if(g<56320){(b-=3)>-1&&Z.push(239,191,189),K=g;continue}g=(K-55296<<10|g-56320)+65536}else K&&(b-=3)>-1&&Z.push(239,191,189);if(K=null,g<128){if((b-=1)<0)break;Z.push(g)}else if(g<2048){if((b-=2)<0)break;Z.push(g>>6|192,g&63|128)}else if(g<65536){if((b-=3)<0)break;Z.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((b-=4)<0)break;Z.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return Z}function xt(T){const b=[];for(let g=0;g<T.length;++g)b.push(T.charCodeAt(g)&255);return b}function Xe(T,b){let g,M,K;const Z=[];for(let ce=0;ce<T.length&&!((b-=2)<0);++ce)g=T.charCodeAt(ce),M=g>>8,K=g%256,Z.push(K),Z.push(M);return Z}function nt(T){return e.toByteArray(oe(T))}function It(T,b,g,M){let K;for(K=0;K<M&&!(K+g>=b.length||K>=T.length);++K)b[K+g]=T[K];return K}function Et(T,b){return T instanceof b||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===b.name}function it(T){return T!==T}const Ct=(function(){const T="0123456789abcdef",b=new Array(256);for(let g=0;g<16;++g){const M=g*16;for(let K=0;K<16;++K)b[M+K]=T[g]+T[K]}return b})();function Bt(T){return typeof BigInt>"u"?Yt:T}function Yt(){throw new Error("BigInt not supported")}})(iy);const Vf=iy.Buffer;var pa={exports:{}},yl,nm;function ay(){return nm||(nm=1,yl=function(e,t){return function(){return e.apply(t,arguments)}}),yl}var gl,im;function kt(){if(im)return gl;im=1;var r=ay(),e=Object.prototype.toString,t=(function(X){return function(ge){var q=e.call(ge);return X[q]||(X[q]=q.slice(8,-1).toLowerCase())}})(Object.create(null));function n(X){return X=X.toLowerCase(),function(q){return t(q)===X}}function i(X){return Array.isArray(X)}function a(X){return typeof X>"u"}function c(X){return X!==null&&!a(X)&&X.constructor!==null&&!a(X.constructor)&&typeof X.constructor.isBuffer=="function"&&X.constructor.isBuffer(X)}var u=n("ArrayBuffer");function l(X){var ge;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ge=ArrayBuffer.isView(X):ge=X&&X.buffer&&u(X.buffer),ge}function d(X){return typeof X=="string"}function h(X){return typeof X=="number"}function m(X){return X!==null&&typeof X=="object"}function y(X){if(t(X)!=="object")return!1;var ge=Object.getPrototypeOf(X);return ge===null||ge===Object.prototype}function E(X){return X&&Object.keys(X).length===0&&Object.getPrototypeOf(X)===Object.prototype}var O=n("Date"),R=n("File"),P=n("Blob"),v=n("FileList");function C(X){return e.call(X)==="[object Function]"}function N(X){return m(X)&&C(X.pipe)}function F(X){var ge="[object FormData]";return X&&(typeof FormData=="function"&&X instanceof FormData||e.call(X)===ge||C(X.toString)&&X.toString()===ge)}var U=n("URLSearchParams");function V(X){return X.trim?X.trim():X.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function L(){var X;return typeof navigator<"u"&&((X=navigator.product)==="ReactNative"||X==="NativeScript"||X==="NS")?!1:typeof window<"u"&&typeof document<"u"}function G(X,ge){if(!(X===null||typeof X>"u"))if(typeof X!="object"&&(X=[X]),i(X))for(var q=0,Y=X.length;q<Y;q++)ge.call(null,X[q],q,X);else for(var ee in X)Object.prototype.hasOwnProperty.call(X,ee)&&ge.call(null,X[ee],ee,X)}function Q(){var X={};function ge(ee,H){y(X[H])&&y(ee)?X[H]=Q(X[H],ee):y(ee)?X[H]=Q({},ee):i(ee)?X[H]=ee.slice():X[H]=ee}for(var q=0,Y=arguments.length;q<Y;q++)G(arguments[q],ge);return X}function re(X,ge,q){return G(ge,function(ee,H){q&&typeof ee=="function"?X[H]=r(ee,q):X[H]=ee}),X}function de(X){return X.charCodeAt(0)===65279&&(X=X.slice(1)),X}function z(X,ge,q,Y){X.prototype=Object.create(ge.prototype,Y),X.prototype.constructor=X,q&&Object.assign(X.prototype,q)}function we(X,ge,q,Y){var ee,H,$,ie={};if(ge=ge||{},X==null)return ge;do{for(ee=Object.getOwnPropertyNames(X),H=ee.length;H-- >0;)$=ee[H],(!Y||Y($,X,ge))&&!ie[$]&&(ge[$]=X[$],ie[$]=!0);X=q!==!1&&Object.getPrototypeOf(X)}while(X&&(!q||q(X,ge))&&X!==Object.prototype);return ge}function Te(X,ge,q){X=String(X),(q===void 0||q>X.length)&&(q=X.length),q-=ge.length;var Y=X.indexOf(ge,q);return Y!==-1&&Y===q}function ae(X){if(!X)return null;if(i(X))return X;var ge=X.length;if(!h(ge))return null;for(var q=new Array(ge);ge-- >0;)q[ge]=X[ge];return q}var be=(function(X){return function(ge){return X&&ge instanceof X}})(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));function Ee(X,ge){for(var q=X&&X[Symbol.iterator],Y=q.call(X),ee;(ee=Y.next())&&!ee.done;){var H=ee.value;ge.call(X,H[0],H[1])}}function Re(X,ge){for(var q,Y=[];(q=X.exec(ge))!==null;)Y.push(q);return Y}var Oe=n("HTMLFormElement"),Ne=(function(ge){return function(q,Y){return ge.call(q,Y)}})(Object.prototype.hasOwnProperty);return gl={isArray:i,isArrayBuffer:u,isBuffer:c,isFormData:F,isArrayBufferView:l,isString:d,isNumber:h,isObject:m,isPlainObject:y,isEmptyObject:E,isUndefined:a,isDate:O,isFile:R,isBlob:P,isFunction:C,isStream:N,isURLSearchParams:U,isStandardBrowserEnv:L,forEach:G,merge:Q,extend:re,trim:V,stripBOM:de,inherits:z,toFlatObject:we,kindOf:t,kindOfTest:n,endsWith:Te,toArray:ae,isTypedArray:be,isFileList:v,forEachEntry:Ee,matchAll:Re,isHTMLForm:Oe,hasOwnProperty:Ne},gl}var wl,sm;function Yn(){if(sm)return wl;sm=1;var r=kt();function e(i,a,c,u,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",a&&(this.code=a),c&&(this.config=c),u&&(this.request=u),l&&(this.response=l)}r.inherits(e,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var t=e.prototype,n={};return["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(function(i){n[i]={value:i}}),Object.defineProperties(e,n),Object.defineProperty(t,"isAxiosError",{value:!0}),e.from=function(i,a,c,u,l,d){var h=Object.create(t);return r.toFlatObject(i,h,function(y){return y!==Error.prototype}),e.call(h,i.message,a,c,u,l),h.cause=i,h.name=i.name,d&&Object.assign(h,d),h},wl=e,wl}var Al,am;function E4(){return am||(am=1,Al=typeof self=="object"?self.FormData:window.FormData),Al}var El,om;function v4(){return om||(om=1,El=E4()),El}var vl,cm;function io(){if(cm)return vl;cm=1;var r=kt(),e=Yn(),t=v4();function n(h){return r.isPlainObject(h)||r.isArray(h)}function i(h){return r.endsWith(h,"[]")?h.slice(0,-2):h}function a(h,m,y){return h?h.concat(m).map(function(O,R){return O=i(O),!y&&R?"["+O+"]":O}).join(y?".":""):m}function c(h){return r.isArray(h)&&!h.some(n)}var u=r.toFlatObject(r,{},null,function(m){return/^is[A-Z]/.test(m)});function l(h){return h&&r.isFunction(h.append)&&h[Symbol.toStringTag]==="FormData"&&h[Symbol.iterator]}function d(h,m,y){if(!r.isObject(h))throw new TypeError("target must be an object");m=m||new(t||FormData),y=r.toFlatObject(y,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Q,re){return!r.isUndefined(re[Q])});var E=y.metaTokens,O=y.visitor||F,R=y.dots,P=y.indexes,v=y.Blob||typeof Blob<"u"&&Blob,C=v&&l(m);if(!r.isFunction(O))throw new TypeError("visitor must be a function");function N(G){if(G===null)return"";if(r.isDate(G))return G.toISOString();if(!C&&r.isBlob(G))throw new e("Blob is not supported. Use a Buffer instead.");return r.isArrayBuffer(G)||r.isTypedArray(G)?C&&typeof Blob=="function"?new Blob([G]):Vf.from(G):G}function F(G,Q,re){var de=G;if(G&&!re&&typeof G=="object"){if(r.endsWith(Q,"{}"))Q=E?Q:Q.slice(0,-2),G=JSON.stringify(G);else if(r.isArray(G)&&c(G)||r.isFileList(G)||r.endsWith(Q,"[]")&&(de=r.toArray(G)))return Q=i(Q),de.forEach(function(we,Te){!(r.isUndefined(we)||we===null)&&m.append(P===!0?a([Q],Te,R):P===null?Q:Q+"[]",N(we))}),!1}return n(G)?!0:(m.append(a(re,Q,R),N(G)),!1)}var U=[],V=Object.assign(u,{defaultVisitor:F,convertValue:N,isVisitable:n});function L(G,Q){if(!r.isUndefined(G)){if(U.indexOf(G)!==-1)throw Error("Circular reference detected in "+Q.join("."));U.push(G),r.forEach(G,function(de,z){var we=!(r.isUndefined(de)||de===null)&&O.call(m,de,r.isString(z)?z.trim():z,Q,V);we===!0&&L(de,Q?Q.concat(z):[z])}),U.pop()}}if(!r.isObject(h))throw new TypeError("data must be an object");return L(h),m}return vl=d,vl}var Rl,um;function oy(){if(um)return Rl;um=1;var r=io();function e(i){var a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'\(\)~]|%20|%00/g,function(u){return a[u]})}function t(i,a){this._pairs=[],i&&r(i,this,a)}var n=t.prototype;return n.append=function(a,c){this._pairs.push([a,c])},n.toString=function(a){var c=a?function(u){return a.call(this,u,e)}:e;return this._pairs.map(function(l){return c(l[0])+"="+c(l[1])},"").join("&")},Rl=t,Rl}var Bl,lm;function cy(){if(lm)return Bl;lm=1;var r=kt(),e=oy();function t(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}return Bl=function(i,a,c){if(!a)return i;var u=i.indexOf("#");u!==-1&&(i=i.slice(0,u));var l=c&&c.encode||t,d=c&&c.serialize,h;return d?h=d(a,c):h=r.isURLSearchParams(a)?a.toString():new e(a,c).toString(l),h&&(i+=(i.indexOf("?")===-1?"?":"&")+h),i},Bl}var Tl,fm;function R4(){if(fm)return Tl;fm=1;var r=kt();function e(){this.handlers=[]}return e.prototype.use=function(n,i,a){return this.handlers.push({fulfilled:n,rejected:i,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1},e.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)},e.prototype.clear=function(){this.handlers&&(this.handlers=[])},e.prototype.forEach=function(n){r.forEach(this.handlers,function(a){a!==null&&n(a)})},Tl=e,Tl}var Sl,hm;function uy(){if(hm)return Sl;hm=1;var r=kt();return Sl=function(t,n){r.forEach(t,function(a,c){c!==n&&c.toUpperCase()===n.toUpperCase()&&(t[n]=a,delete t[c])})},Sl}var Ol,dm;function ly(){return dm||(dm=1,Ol={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}),Ol}var Il,pm;function B4(){if(pm)return Il;pm=1;var r=oy();return Il=typeof URLSearchParams<"u"?URLSearchParams:r,Il}var Cl,mm;function T4(){return mm||(mm=1,Cl=FormData),Cl}var Pl,bm;function S4(){return bm||(bm=1,Pl={isBrowser:!0,classes:{URLSearchParams:B4(),FormData:T4(),Blob},protocols:["http","https","file","blob","url","data"]}),Pl}var Nl,xm;function v0(){return xm||(xm=1,Nl=S4()),Nl}var kl,ym;function O4(){if(ym)return kl;ym=1;var r=kt(),e=io(),t=v0();return kl=function(i,a){return e(i,new t.classes.URLSearchParams,Object.assign({visitor:function(c,u,l,d){return t.isNode&&r.isBuffer(c)?(this.append(u,c.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)}},a))},kl}var Fl,gm;function fy(){if(gm)return Fl;gm=1;var r=kt();function e(i){return r.matchAll(/\w+|\[(\w*)]/g,i).map(function(a){return a[0]==="[]"?"":a[1]||a[0]})}function t(i){var a={},c=Object.keys(i),u,l=c.length,d;for(u=0;u<l;u++)d=c[u],a[d]=i[d];return a}function n(i){function a(u,l,d,h){var m=u[h++];if(m==="__proto__")return!0;var y=Number.isFinite(+m),E=h>=u.length;if(m=!m&&r.isArray(d)?d.length:m,E)return r.hasOwnProperty(d,m)?d[m]=[d[m],l]:d[m]=l,!y;(!d[m]||!r.isObject(d[m]))&&(d[m]=[]);var O=a(u,l,d[m],h);return O&&r.isArray(d[m])&&(d[m]=t(d[m])),!y}if(r.isFormData(i)&&r.isFunction(i.entries)){var c={};return r.forEachEntry(i,function(u,l){a(e(u),l,c,0)}),c}return null}return Fl=n,Fl}var Dl,wm;function I4(){if(wm)return Dl;wm=1;var r=Yn();return Dl=function(t,n,i){var a=i.config.validateStatus;!i.status||!a||a(i.status)?t(i):n(new r("Request failed with status code "+i.status,[r.ERR_BAD_REQUEST,r.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))},Dl}var Ul,Am;function C4(){if(Am)return Ul;Am=1;var r=kt();return Ul=r.isStandardBrowserEnv()?(function(){return{write:function(n,i,a,c,u,l){var d=[];d.push(n+"="+encodeURIComponent(i)),r.isNumber(a)&&d.push("expires="+new Date(a).toGMTString()),r.isString(c)&&d.push("path="+c),r.isString(u)&&d.push("domain="+u),l===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(n){var i=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}})():(function(){return{write:function(){},read:function(){return null},remove:function(){}}})(),Ul}var Ll,Em;function P4(){return Em||(Em=1,Ll=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}),Ll}var Ml,vm;function N4(){return vm||(vm=1,Ml=function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}),Ml}var _l,Rm;function hy(){if(Rm)return _l;Rm=1;var r=P4(),e=N4();return _l=function(n,i,a){var c=!r(i);return n&&(c||a===!1)?e(n,i):i},_l}var Vl,Bm;function k4(){if(Bm)return Vl;Bm=1;var r=kt(),e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Vl=function(n){var i={},a,c,u;return n&&r.forEach(n.split(`
|
|
22
|
-
`),function(d){if(u=d.indexOf(":"),a=r.trim(d.slice(0,u)).toLowerCase(),c=r.trim(d.slice(u+1)),a){if(i[a]&&e.indexOf(a)>=0)return;a==="set-cookie"?i[a]=(i[a]?i[a]:[]).concat([c]):i[a]=i[a]?i[a]+", "+c:c}}),i},Vl}var Gl,Tm;function F4(){if(Tm)return Gl;Tm=1;var r=kt();return Gl=r.isStandardBrowserEnv()?(function(){var t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),i;function a(c){var u=c;return t&&(n.setAttribute("href",u),u=n.href),n.setAttribute("href",u),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=a(window.location.href),function(u){var l=r.isString(u)?a(u):u;return l.protocol===i.protocol&&l.host===i.host}})():(function(){return function(){return!0}})(),Gl}var jl,Sm;function so(){if(Sm)return jl;Sm=1;var r=Yn(),e=kt();function t(n,i,a){r.call(this,n??"canceled",r.ERR_CANCELED,i,a),this.name="CanceledError"}return e.inherits(t,r,{__CANCEL__:!0}),jl=t,jl}var zl,Om;function D4(){return Om||(Om=1,zl=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}),zl}var Hl,Im;function Cm(){if(Im)return Hl;Im=1;var r=kt(),e=I4(),t=C4(),n=cy(),i=hy(),a=k4(),c=F4(),u=ly(),l=Yn(),d=so(),h=D4(),m=v0();return Hl=function(E){return new Promise(function(R,P){var v=E.data,C=E.headers,N=E.responseType,F=E.withXSRFToken,U;function V(){E.cancelToken&&E.cancelToken.unsubscribe(U),E.signal&&E.signal.removeEventListener("abort",U)}r.isFormData(v)&&r.isStandardBrowserEnv()&&delete C["Content-Type"];var L=new XMLHttpRequest;if(E.auth){var G=E.auth.username||"",Q=E.auth.password?unescape(encodeURIComponent(E.auth.password)):"";C.Authorization="Basic "+btoa(G+":"+Q)}var re=i(E.baseURL,E.url,E.allowAbsoluteUrls);L.open(E.method.toUpperCase(),n(re,E.params,E.paramsSerializer),!0),L.timeout=E.timeout;function de(){if(L){var Te="getAllResponseHeaders"in L?a(L.getAllResponseHeaders()):null,ae=!N||N==="text"||N==="json"?L.responseText:L.response,be={data:ae,status:L.status,statusText:L.statusText,headers:Te,config:E,request:L};e(function(Re){R(Re),V()},function(Re){P(Re),V()},be),L=null}}if("onloadend"in L?L.onloadend=de:L.onreadystatechange=function(){!L||L.readyState!==4||L.status===0&&!(L.responseURL&&L.responseURL.indexOf("file:")===0)||setTimeout(de)},L.onabort=function(){L&&(P(new l("Request aborted",l.ECONNABORTED,E,L)),L=null)},L.onerror=function(){P(new l("Network Error",l.ERR_NETWORK,E,L)),L=null},L.ontimeout=function(){var ae=E.timeout?"timeout of "+E.timeout+"ms exceeded":"timeout exceeded",be=E.transitional||u;E.timeoutErrorMessage&&(ae=E.timeoutErrorMessage),P(new l(ae,be.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,E,L)),L=null},r.isStandardBrowserEnv()&&(F&&r.isFunction(F)&&(F=F(E)),F||F!==!1&&c(re))){var z=E.xsrfHeaderName&&E.xsrfCookieName&&t.read(E.xsrfCookieName);z&&(C[E.xsrfHeaderName]=z)}"setRequestHeader"in L&&r.forEach(C,function(ae,be){typeof v>"u"&&be.toLowerCase()==="content-type"?delete C[be]:L.setRequestHeader(be,ae)}),r.isUndefined(E.withCredentials)||(L.withCredentials=!!E.withCredentials),N&&N!=="json"&&(L.responseType=E.responseType),typeof E.onDownloadProgress=="function"&&L.addEventListener("progress",E.onDownloadProgress),typeof E.onUploadProgress=="function"&&L.upload&&L.upload.addEventListener("progress",E.onUploadProgress),(E.cancelToken||E.signal)&&(U=function(Te){L&&(P(!Te||Te.type?new d(null,E,L):Te),L.abort(),L=null)},E.cancelToken&&E.cancelToken.subscribe(U),E.signal&&(E.signal.aborted?U():E.signal.addEventListener("abort",U))),!v&&v!==!1&&v!==0&&v!==""&&(v=null);var we=h(re);if(we&&m.protocols.indexOf(we)===-1){P(new l("Unsupported protocol "+we+":",l.ERR_BAD_REQUEST,E));return}L.send(v)})},Hl}var ql,Pm;function R0(){if(Pm)return ql;Pm=1;var r=kt(),e=uy(),t=Yn(),n=ly(),i=io(),a=O4(),c=v0(),u=fy(),l={"Content-Type":"application/x-www-form-urlencoded"};function d(E,O){!r.isUndefined(E)&&r.isUndefined(E["Content-Type"])&&(E["Content-Type"]=O)}function h(){var E;return(typeof XMLHttpRequest<"u"||typeof Ve<"u"&&Object.prototype.toString.call(Ve)==="[object process]")&&(E=Cm()),E}function m(E,O,R){if(r.isString(E))try{return(O||JSON.parse)(E),r.trim(E)}catch(P){if(P.name!=="SyntaxError")throw P}return(R||JSON.stringify)(E)}var y={transitional:n,adapter:h(),transformRequest:[function(O,R){e(R,"Accept"),e(R,"Content-Type");var P=R&&R["Content-Type"]||"",v=P.indexOf("application/json")>-1,C=r.isObject(O);C&&r.isHTMLForm(O)&&(O=new FormData(O));var N=r.isFormData(O);if(N)return v?JSON.stringify(u(O)):O;if(r.isArrayBuffer(O)||r.isBuffer(O)||r.isStream(O)||r.isFile(O)||r.isBlob(O))return O;if(r.isArrayBufferView(O))return O.buffer;if(r.isURLSearchParams(O))return d(R,"application/x-www-form-urlencoded;charset=utf-8"),O.toString();var F;if(C){if(P.indexOf("application/x-www-form-urlencoded")!==-1)return a(O,this.formSerializer).toString();if((F=r.isFileList(O))||P.indexOf("multipart/form-data")>-1){var U=this.env&&this.env.FormData;return i(F?{"files[]":O}:O,U&&new U,this.formSerializer)}}return C||v?(d(R,"application/json"),m(O)):O}],transformResponse:[function(O){var R=this.transitional||y.transitional,P=R&&R.forcedJSONParsing,v=this.responseType==="json";if(O&&r.isString(O)&&(P&&!this.responseType||v)){var C=R&&R.silentJSONParsing,N=!C&&v;try{return JSON.parse(O)}catch(F){if(N)throw F.name==="SyntaxError"?t.from(F,t.ERR_BAD_RESPONSE,this,null,this.response):F}}return O}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:c.classes.FormData,Blob:c.classes.Blob},validateStatus:function(O){return O>=200&&O<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return r.forEach(["delete","get","head"],function(O){y.headers[O]={}}),r.forEach(["post","put","patch"],function(O){y.headers[O]=r.merge(l)}),ql=y,ql}var $l,Nm;function U4(){if(Nm)return $l;Nm=1;var r=kt(),e=R0();return $l=function(n,i,a,c){var u=this||e;return r.forEach(c,function(d){n=d.call(u,n,i,a)}),n},$l}var Kl,km;function dy(){return km||(km=1,Kl=function(e){return!!(e&&e.__CANCEL__)}),Kl}var Wl,Fm;function L4(){if(Fm)return Wl;Fm=1;var r=kt(),e=U4(),t=dy(),n=R0(),i=so(),a=uy();function c(u){if(u.cancelToken&&u.cancelToken.throwIfRequested(),u.signal&&u.signal.aborted)throw new i}return Wl=function(l){c(l),l.headers=l.headers||{},l.data=e.call(l,l.data,l.headers,null,l.transformRequest),a(l.headers,"Accept"),a(l.headers,"Content-Type"),l.headers=r.merge(l.headers.common||{},l.headers[l.method]||{},l.headers),r.forEach(["delete","get","head","post","put","patch","common"],function(m){delete l.headers[m]});var d=l.adapter||n.adapter;return d(l).then(function(m){return c(l),m.data=e.call(l,m.data,m.headers,m.status,l.transformResponse),m},function(m){return t(m)||(c(l),m&&m.response&&(m.response.data=e.call(l,m.response.data,m.response.headers,m.response.status,l.transformResponse))),Promise.reject(m)})},Wl}var Ql,Dm;function py(){if(Dm)return Ql;Dm=1;var r=kt();return Ql=function(t,n){n=n||{};var i={};function a(m,y){return r.isPlainObject(m)&&r.isPlainObject(y)?r.merge(m,y):r.isEmptyObject(y)?r.merge({},m):r.isPlainObject(y)?r.merge({},y):r.isArray(y)?y.slice():y}function c(m){if(r.isUndefined(n[m])){if(!r.isUndefined(t[m]))return a(void 0,t[m])}else return a(t[m],n[m])}function u(m){if(!r.isUndefined(n[m]))return a(void 0,n[m])}function l(m){if(r.isUndefined(n[m])){if(!r.isUndefined(t[m]))return a(void 0,t[m])}else return a(void 0,n[m])}function d(m){if(m in n)return a(t[m],n[m]);if(m in t)return a(void 0,t[m])}var h={url:u,method:u,data:u,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:d};return r.forEach(Object.keys(t).concat(Object.keys(n)),function(y){var E=h[y]||c,O=E(y);r.isUndefined(O)&&E!==d||(i[y]=O)}),i},Ql}var Jl,Um;function my(){return Um||(Um=1,Jl={version:"0.30.2"}),Jl}var Yl,Lm;function M4(){if(Lm)return Yl;Lm=1;var r=my().version,e=Yn(),t={};["object","boolean","number","function","string","symbol"].forEach(function(a,c){t[a]=function(l){return typeof l===a||"a"+(c<1?"n ":" ")+a}});var n={};t.transitional=function(c,u,l){function d(h,m){return"[Axios v"+r+"] Transitional option '"+h+"'"+m+(l?". "+l:"")}return function(h,m,y){if(c===!1)throw new e(d(m," has been removed"+(u?" in "+u:"")),e.ERR_DEPRECATED);return u&&!n[m]&&(n[m]=!0,console.warn(d(m," has been deprecated since v"+u+" and will be removed in the near future"))),c?c(h,m,y):!0}};function i(a,c,u){if(typeof a!="object")throw new e("options must be an object",e.ERR_BAD_OPTION_VALUE);for(var l=Object.keys(a),d=l.length;d-- >0;){var h=l[d],m=c[h];if(m){var y=a[h],E=y===void 0||m(y,h,a);if(E!==!0)throw new e("option "+h+" must be "+E,e.ERR_BAD_OPTION_VALUE);continue}if(u!==!0)throw new e("Unknown option "+h,e.ERR_BAD_OPTION)}}return Yl={assertOptions:i,validators:t},Yl}var Xl,Mm;function _4(){if(Mm)return Xl;Mm=1;var r=kt(),e=cy(),t=R4(),n=L4(),i=py(),a=hy(),c=M4(),u=c.validators;function l(d){this.defaults=d,this.interceptors={request:new t,response:new t}}return l.prototype.request=function(h,m){typeof h=="string"?(m=m||{},m.url=h):m=h||{},m=i(this.defaults,m),m.method?m.method=m.method.toLowerCase():this.defaults.method?m.method=this.defaults.method.toLowerCase():m.method="get";var y=m.transitional;y!==void 0&&c.assertOptions(y,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var E=m.paramsSerializer;E!=null&&(r.isFunction(E)?m.paramsSerializer={serialize:E}:c.assertOptions(E,{encode:u.function,serialize:u.function},!0));var O=[],R=!0;this.interceptors.request.forEach(function(L){typeof L.runWhen=="function"&&L.runWhen(m)===!1||(R=R&&L.synchronous,O.unshift(L.fulfilled,L.rejected))});var P=[];this.interceptors.response.forEach(function(L){P.push(L.fulfilled,L.rejected)});var v;if(!R){var C=[n,void 0];for(Array.prototype.unshift.apply(C,O),C=C.concat(P),v=Promise.resolve(m);C.length;)v=v.then(C.shift(),C.shift());return v}for(var N=m;O.length;){var F=O.shift(),U=O.shift();try{N=F(N)}catch(V){U(V);break}}try{v=n(N)}catch(V){return Promise.reject(V)}for(;P.length;)v=v.then(P.shift(),P.shift());return v},l.prototype.getUri=function(h){h=i(this.defaults,h);var m=a(h.baseURL,h.url,h.allowAbsoluteUrls);return e(m,h.params,h.paramsSerializer)},r.forEach(["delete","get","head","options"],function(h){l.prototype[h]=function(m,y){return this.request(i(y||{},{method:h,url:m,data:(y||{}).data}))}}),r.forEach(["post","put","patch"],function(h){function m(y){return function(O,R,P){return this.request(i(P||{},{method:h,headers:y?{"Content-Type":"multipart/form-data"}:{},url:O,data:R}))}}l.prototype[h]=m(),l.prototype[h+"Form"]=m(!0)}),Xl=l,Xl}var Zl,_m;function V4(){if(_m)return Zl;_m=1;var r=so();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var n;this.promise=new Promise(function(c){n=c});var i=this;this.promise.then(function(a){if(i._listeners){for(var c=i._listeners.length;c-- >0;)i._listeners[c](a);i._listeners=null}}),this.promise.then=function(a){var c,u=new Promise(function(l){i.subscribe(l),c=l}).then(a);return u.cancel=function(){i.unsubscribe(c)},u},t(function(c,u,l){i.reason||(i.reason=new r(c,u,l),n(i.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]},e.prototype.unsubscribe=function(n){if(this._listeners){var i=this._listeners.indexOf(n);i!==-1&&this._listeners.splice(i,1)}},e.source=function(){var n,i=new e(function(c){n=c});return{token:i,cancel:n}},Zl=e,Zl}var ef,Vm;function G4(){return Vm||(Vm=1,ef=function(e){return function(n){return e.apply(null,n)}}),ef}var tf,Gm;function j4(){if(Gm)return tf;Gm=1;var r=kt();return tf=function(t){return r.isObject(t)&&t.isAxiosError===!0},tf}var jm;function z4(){if(jm)return pa.exports;jm=1;var r=kt(),e=ay(),t=_4(),n=py(),i=R0(),a=fy();function c(l){var d=new t(l),h=e(t.prototype.request,d);return r.extend(h,t.prototype,d),r.extend(h,d),h.create=function(y){return c(n(l,y))},h}var u=c(i);return u.Axios=t,u.CanceledError=so(),u.CancelToken=V4(),u.isCancel=dy(),u.VERSION=my().version,u.toFormData=io(),u.AxiosError=Yn(),u.Cancel=u.CanceledError,u.all=function(d){return Promise.all(d)},u.spread=G4(),u.isAxiosError=j4(),u.formToJSON=function(l){return a(r.isHTMLForm(l)?new FormData(l):l)},pa.exports=u,pa.exports.default=u,pa.exports}var rf,zm;function H4(){return zm||(zm=1,rf=z4()),rf}var q4=H4();const by=Us(q4),$4=p0("bee-js:http"),{AxiosError:K4}=by,W4=1e5,xy=200,Q4=1e3,J4=Mf.minutes(1)/xy,Y4="Request aborted",X4={headers:{accept:"application/json, text/plain, */*"},maxBodyLength:1/0,maxContentLength:1/0};function nf(r,e,t,n){if(r?.aborted)throw new m0(e.method||"get",e.url||"<unknown>",Y4,t,n,"ERR_CANCELED")}async function Ae(r,e){const t=As.deepMerge3(X4,e,r);if(r.signal&&(t.signal=r.signal,nf(r.signal,e)),e6(t),t.params){const i=Object.keys(t.params);for(const a of i)t.params[a]===void 0&&delete t.params[a]}let n=0;for(;n<W4;){nf(r.signal,e);try{return $4(`${t.method||"get"} ${d0.joinUrl([t.baseURL,t.url])}`,{headers:{...t.headers},params:t.params}),Z4(r,t),await by(t)}catch(i){if(i instanceof K4)if(i.code==="ERR_CANCELED"&&nf({aborted:!0},e,i.response?.data,i.response?.status),i.code==="ECONNABORTED"&&r.endlesslyRetry)n++,await Za.sleepMillis(n<J4?xy:Q4);else throw new m0(e.method||"get",e.url||"<unknown>",i.message,i.response?.data,i.response?.status,i.response?.statusText);else throw i}}throw Error("Max number of failed attempts reached")}function Z4(r,e){r.onRequest&&r.onRequest({method:e.method||"GET",url:d0.joinUrl([e.baseURL,e.url]),headers:{...e.headers},params:e.params})}function e6(r){r.data&&r.data instanceof Uint8Array&&(r.data=r.data.buffer.slice(r.data.byteOffset,r.data.byteOffset+r.data.byteLength)),r.data&&typeof Vf<"u"&&Vf.isBuffer(r.data)&&(r.data=r.data.buffer.slice(r.data.byteOffset,r.data.byteOffset+r.data.byteLength))}const yy="chunks";async function t6(r,e,t,n){const i=await Ae(r,{method:"post",url:`${yy}`,data:e,headers:{"content-type":"application/octet-stream",...Jt(t,n)},responseType:"json"}),a=B.asObject(i.data,{name:"response.data"});return{reference:new ke(B.asString(a.reference,{name:"reference"})),tagUid:i.headers["swarm-tag"]?wn(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?jt.of(new ke(i.headers["swarm-act-history-address"])):jt.empty()}}async function Vs(r,e,t){e=new ke(e);const n=await Ae(r,{responseType:"arraybuffer",url:`${yy}/${e}`,headers:Jt(null,t)});return new Uint8Array(n.data)}const r6="soc";async function n6(r,e,t,n,i,a,c){const u=await Ae(r,{method:"post",url:`${r6}/${e}/${t}`,data:i,headers:{"content-type":"application/octet-stream",...Jt(a,c)},responseType:"json",params:{sig:n.toHex()}}),l=B.asObject(u.data,{name:"response.data"});return{reference:new ke(B.asHexString(l.reference)),tagUid:u.headers["swarm-tag"]?wn(u.headers["swarm-tag"]):void 0,historyAddress:u.headers["swarm-act-history-address"]?jt.of(new ke(u.headers["swarm-act-history-address"])):jt.empty()}}const gy=Lt.LENGTH,wy=Lt.LENGTH+vn.LENGTH,i6=Lt.LENGTH+vn.LENGTH+Nt.LENGTH;function s6(r){const e=r.slice(wy),t=Nx(e),n=vn.fromSlice(r,gy),i=ze.fromSlice(r,0,Lt.LENGTH),a=me.concatBytes(i.toUint8Array(),t.toUint8Array());return n.recoverPublicKey(a).address()}function ao(r,e){r=r instanceof ze?r.toUint8Array():r,e=new ke(e);const t=s6(r),n=ze.fromSlice(r,0,Lt.LENGTH),i=new ke(me.keccak256(me.concatBytes(n.toUint8Array(),t.toUint8Array())));if(!me.equals(e.toUint8Array(),i.toUint8Array()))throw new Pr("SOC data does not match given address!");const a=vn.fromSlice(r,gy),c=Nt.fromSlice(r,wy),u=ze.fromSlice(r,i6);return{data:r,identifier:n,signature:a,span:c,payload:u,address:i,owner:t}}function bs(r,e){return new ke(me.keccak256(me.concatBytes(r.toUint8Array(),e.toUint8Array())))}function Ay(r,e,t,n,i){n=new Lt(n),i=new Jr(i);const a=bs(n,i.publicKey().address()),c=i.sign(me.concatBytes(n.toUint8Array(),r.toUint8Array()));return{data:me.concatBytes(n.toUint8Array(),c.toUint8Array(),e.toUint8Array(),t.toUint8Array()),identifier:n,signature:c,span:e,payload:t,address:a,owner:i.publicKey().address()}}async function B0(r,e,t,n){const i=me.concatBytes(e.span.toUint8Array(),e.payload.toUint8Array());return n6(r,e.owner,e.identifier,e.signature,i,t,n)}async function T0(r,e,t,n,i,a){e=new Jr(e),n=new Lt(n);const u=vs(i).toSingleOwnerChunk(n,e);return B0(r,u,t,a)}async function a6(r,e,t,n,i,a){e=new Jr(e),n=new Lt(n);const c=i.toSingleOwnerChunk(n,e);return B0(r,c,t,a)}async function o6(r,e,t){t=new Lt(t),e=new Wt(e);const n=bs(t,e),i=await Vs(r,n.toHex());return ao(i,n)}const Hm=1,qm=4096;function Ey(r){return r=new ze(r),vs(r.toUint8Array().slice(Nt.LENGTH),Nt.fromSlice(r.toUint8Array(),0))}function vs(r,e){if(B.isString(r)&&(r=ze.fromUtf8(r)),r.length<Hm||r.length>qm)throw new RangeError(`payload size ${r.length} exceeds limits [${Hm}, ${qm}]`);const t=e?typeof e=="bigint"?Nt.fromBigInt(e):e:Nt.fromBigInt(BigInt(r.length)),n=new ze(r),i=me.concatBytes(t.toUint8Array(),n.toUint8Array()),a=Nx(i);return{data:i,span:t,payload:n,address:a,toSingleOwnerChunk:(c,u)=>Ay(a,t,n,c,u)}}const oo="bytes";async function vy(r,e,t,n){const i=await Ae(r,{url:oo,method:"post",responseType:"json",data:e,headers:{"content-type":"application/octet-stream",...Jt(t,n)}}),a=B.asObject(i.data,{name:"response.data"});return{reference:new ke(B.asHexString(a.reference)),tagUid:i.headers["swarm-tag"]?wn(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?jt.of(new ke(i.headers["swarm-act-history-address"])):jt.empty()}}async function c6(r,e){e=new ke(e);const t=await Ae(r,{url:`${oo}/${e}`,method:"head",responseType:"json"});return{contentLength:parseInt(t.headers["content-length"])}}async function Ry(r,e,t){t&&(t=yn(t));const n=await Ae(r,{responseType:"arraybuffer",url:`${oo}/${e}`,headers:Jt(null,t)});return new ze(n.data)}async function u6(r,e,t){return t&&(t=yn(t)),(await Ae(r,{responseType:"stream",url:`${oo}/${e}`,headers:Jt(null,t)})).data}const S0="feeds";async function l6(r,e,t,n,i){const a=await Ae(r,{method:"post",responseType:"json",url:`${S0}/${e}/${t}`,headers:Jt(n,i)}),c=B.asObject(a.data,{name:"response.data"});return new ke(B.asHexString(c.reference))}function By(r){const e=r["swarm-feed-index"],t=r["swarm-feed-index-next"];if(!e)throw new Pr("Response did not contain expected swarm-feed-index!");if(!t)throw new Pr("Response did not contain expected swarm-feed-index-next!");return{feedIndex:new Qt(e),feedIndexNext:new Qt(t)}}async function Va(r,e,t,n){const i=await Ae(r,{responseType:"arraybuffer",url:`${S0}/${e}/${t}`,params:n});return{payload:new ze(i.data),...By(i.headers)}}async function f6(r,e,t){const n=await Ae(r,{responseType:"arraybuffer",url:`${S0}/${e}/${t}`,params:{"Swarm-Only-Root-Chunk":!0}});return By(n.headers)}class Pa{constructor(e){this.raw=e}toString(){return B.isString(this.raw)&&this.raw.includes(".eth")?this.raw:new ke(this.raw).toHex()}}function O0(r,e){return e=typeof e=="number"?Qt.fromBigInt(BigInt(e)):e,new Lt(me.keccak256(me.concatBytes(r.toUint8Array(),e.toUint8Array())))}const h6=0,Ty=8,d6=Ty;async function Sy(r,e,t){try{const n=await Va(r,e,t);if(!n.feedIndexNext)throw Error("Feed index next is not defined. This should happen when fetching an exact index.");return n.feedIndexNext}catch(n){if(n instanceof m0)return Qt.fromBigInt(0n);throw n}}async function p6(r,e,t,n,i,a){n=new ke(n);const c=a?.index??await Sy(r,e.publicKey().address(),t),u=O0(t,c),l=a?.at??Date.now()/1e3,d=me.numberToUint64(BigInt(Math.floor(l)),"BE"),h=me.concatBytes(d,n.toUint8Array());return T0(r,e,i,u,h,a)}async function m6(r,e,t,n,i,a){const c=a?.index??await Sy(r,e.publicKey().address(),t),u=O0(t,c);if(n.length>4096){const l=await vy(r,n,i,a),d=Ey(await Vs(r,l.reference));return a6(r,e,i,u,d,a)}return T0(r,e,i,u,B.isString(n)?ze.fromUtf8(n).toUint8Array():n,a)}function I0(r,e,t){const n=O0(e,t);return new ke(me.keccak256(me.concatBytes(n.toUint8Array(),r.toUint8Array())))}async function b6(r,e,t,n,i=!1){n=typeof n=="number"?Qt.fromBigInt(BigInt(n)):n;const a=I0(e,t,n),c=await Vs(r,a.toHex()),u=ao(c,a);let l=jt.empty();if(i){const d=ze.fromSlice(u.payload.toUint8Array(),h6,Ty);l=jt.of(Number(me.uint64ToNumber(d.toUint8Array(),"BE")))}return{timestamp:l,payload:new ze(u.payload.offset(i?d6:0))}}async function x6(r,e,t,n){n=typeof n=="number"?Qt.fromBigInt(BigInt(n)):n;const i=I0(e,t,n),a=await Vs(r,i),c=ao(a,i);return vs(c.payload,c.span)}function Oy(r,e,t){const n=async c=>{if(c?.index===void 0)return Va(r,t,e);const u=await b6(r,t,e,c.index,c.hasTimestamp??!0),l=typeof c.index=="number"?Qt.fromBigInt(BigInt(c.index)):c.index;return{payload:u.payload,feedIndex:l,feedIndexNext:l.next()}};return{download:n,downloadPayload:async c=>{if(c?.index===void 0)return Va(r,t,e);const u=await x6(r,t,e,c.index),l=u.span.toBigInt()<=4096n?u.payload:await Ry(r,new Pa(u.address)),d=typeof c.index=="number"?Qt.fromBigInt(BigInt(c.index)):c.index;return{payload:l,feedIndex:d,feedIndexNext:d.next()}},downloadReference:async c=>{let u=c?.index;u===void 0&&(u=(await f6(r,t,e)).feedIndex);const l=await n({...c,index:u});return{reference:new ke(l.payload.toUint8Array()),feedIndex:l.feedIndex,feedIndexNext:l.feedIndexNext??l.feedIndex.next()}},owner:t,topic:e}}function y6(r,e,t){const n=async(a,c,u)=>p6(r,t,e,c,a,u),i=async(a,c,u)=>m6(r,t,e,c,a,u);return{...Oy(r,e,t.publicKey().address()),upload:n,uploadReference:n,uploadPayload:i}}async function g6(r,e,t,n){try{return await r.downloadChunk(e,t,n),!0}catch(i){const a=As.getDeep(i,"status");if(a===404||a===500)return!1;throw i}}function w6(r,e,t){const n=t.toBigInt(),i=[];for(let a=0n;a<=n;a++)i.push(I0(r,e,Qt.fromBigInt(a)));return i}async function A6(r,e,t,n,i,a){const c=w6(e,t,n).map(async u=>g6(r,u,i,a));return(await Promise.all(c)).every(u=>u)}function E6(r){return Array.isArray(r)?r.every(e=>typeof e=="object"&&e.path&&e.size!==void 0):!1}function Iy(r){if(!E6(r))throw new _r("invalid collection",r)}function Cy(r){if(r.webkitRelativePath&&r.webkitRelativePath!=="")return r.webkitRelativePath.replace(/.*?\//i,"");if(r.name)return r.name;throw new TypeError("file is not valid File object")}function v6(r){return Array.from(r).map(e=>({path:Cy(e),size:e.size,file:e}))}class R6{constructor(){this.pieces=[],this.currentFileSize=0}get output(){return this.pieces.reduce((e,t)=>{const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n})}beginFile(e,t){if(e.length>100)throw new Error(`File name too long: ${e}`);const n=B6(e,t);this.pieces.push(n),this.currentFileSize=0}async appendFile(e){this.pieces.push(e),this.currentFileSize+=e.length}async endFile(){const e=this.currentFileSize%512===0?0:512-this.currentFileSize%512;e>0&&this.pieces.push(new Uint8Array(e))}async end(){this.pieces.push(T6())}}function B6(r,e){const t=new TextEncoder;function n(u,l,d){const h=t.encode(u);i.set(h.slice(0,d),l)}const i=new Uint8Array(512);i.fill(0,0,512),n(r.slice(0,100).padEnd(100,"\0"),0,100),n("0000777\0",100,8),n("0001750\0",108,8),n("0001750\0",116,8),n(e.toString(8).padStart(11,"0")+"\0",124,12);const a=Math.floor(new Date().getTime()/1e3);n(a.toString(8).padStart(11,"0")+"\0",136,12),n(" ",148,8),n("0",156,1),n("ustar\0\0",257,8);let c=0;for(let u=0;u<512;u++)c+=i[u];return n(c.toString(8).padStart(6,"0")+"\0 ",148,8),i}function T6(){return new Uint8Array(1024)}async function S6(r,e){for(const t of r)if(t.file)e.beginFile(t.path,t.file.size),await e.appendFile(new Uint8Array(await Xx(t.file))),await e.endFile();else throw new Error("Invalid collection item")}const O6="bzz";async function I6(r,e,t,n){const i=new R6;return await S6(e,i),await i.end(),await Ae(r,{method:"post",url:O6,data:i.output,responseType:"json",headers:{"content-type":"application/x-tar","swarm-collection":"true",...Jt(t,n)}})}const C0="bzz";async function $m(r,e,t,n,i){Zx(e)&&!i?.contentType&&(i||(i={}),i.contentType="application/octet-stream");const a=await Ae(r,{method:"post",url:C0,data:e,headers:Jt(t,i),params:{name:n},responseType:"json"}),c=B.asObject(a.data,{name:"response.data"});return{reference:new ke(B.asHexString(c.reference)),tagUid:a.headers["swarm-tag"]?wn(a.headers["swarm-tag"]):void 0,historyAddress:a.headers["swarm-act-history-address"]?jt.of(new ke(a.headers["swarm-act-history-address"])):jt.empty()}}async function C6(r,e,t="",n){const i=await Ae(r,{method:"GET",responseType:"arraybuffer",url:`${C0}/${e}/${t}`,headers:Jt(null,n)});return{...ny(i.headers),data:new ze(i.data)}}async function P6(r,e,t="",n){e=new ke(e);const i=await Ae(r,{method:"GET",responseType:"stream",url:`${C0}/${e}/${t}`,headers:Jt(null,n)});return{...ny(i.headers),data:i.data}}async function sf(r,e,t,n){Iy(e);const i=await I6(r,e,t,n),a=B.asObject(i.data,{name:"response.data"});return{reference:new ke(B.asHexString(a.reference)),tagUid:i.headers["swarm-tag"]?wn(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?jt.of(new ke(i.headers["swarm-act-history-address"])):jt.empty()}}const Py="balances",Ny="consumed";async function N6(r){const e=await Ae(r,{url:Py,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{balances:B.asArray(t.balances,{name:"balances"}).map(i=>B.asObject(i,{name:"balance"})).map(i=>({peer:B.asString(i.peer,{name:"peer"}),balance:_e.fromPLUR(Ge(i.balance,{name:"balance"}))}))}}async function k6(r,e){const t=await Ae(r,{url:`${Py}/${e}`,responseType:"json"}),n=B.asObject(t.data,{name:"response.data"});return{peer:B.asString(n.peer,{name:"peer"}),balance:_e.fromPLUR(Ge(n.balance,{name:"balance"}))}}async function F6(r){const e=await Ae(r,{url:Ny,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{balances:B.asArray(t.balances,{name:"balances"}).map(i=>B.asObject(i,{name:"balance"})).map(i=>({peer:B.asString(i.peer,{name:"peer"}),balance:_e.fromPLUR(Ge(i.balance,{name:"balance"}))}))}}async function D6(r,e){const t=await Ae(r,{url:`${Ny}/${e}`,responseType:"json"}),n=B.asObject(t.data,{name:"response.data"});return{peer:B.asString(n.peer,{name:"peer"}),balance:_e.fromPLUR(Ge(n.balance,{name:"balance"}))}}const Rn="chequebook";async function U6(r){const e=await Ae(r,{url:Rn+"/address",responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{chequebookAddress:new Wt(B.asString(t.chequebookAddress,{name:"chequebookAddress"}))}}async function L6(r){const e=await Ae(r,{url:Rn+"/balance",responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{availableBalance:_e.fromPLUR(Ge(t.availableBalance,{name:"availableBalance"})),totalBalance:_e.fromPLUR(Ge(t.totalBalance,{name:"totalBalance"}))}}async function M6(r,e){const t=await Ae(r,{url:Rn+`/cashout/${e}`,responseType:"json"}),n=B.asObject(t.data,{name:"response.data"});return{peer:B.asString(n.peer,{name:"peer"}),uncashedAmount:_e.fromPLUR(Ge(n.uncashedAmount,{name:"uncashedAmount"})),transactionHash:B.asNullableString(n.transactionHash),lastCashedCheque:B.asNullable(i=>Rs(i),n.lastCashedCheque),result:B.asNullable(i=>j6(i),n.result)}}async function _6(r,e,t){const n=await Ae(r,{method:"post",url:Rn+`/cashout/${e}`,responseType:"json",headers:Jt(null,t)}),i=B.asObject(n.data,{name:"response.data"});return new rr(B.asString(i.transactionHash,{name:"transactionHash"}))}async function V6(r,e){const t=await Ae(r,{url:Rn+`/cheque/${e}`,responseType:"json"}),n=B.asObject(t.data,{name:"response.data"});return{peer:B.asString(n.peer,{name:"peer"}),lastreceived:B.asNullable(i=>Rs(i),n.lastreceived),lastsent:B.asNullable(i=>Rs(i),n.lastsent)}}async function G6(r){const e=await Ae(r,{url:Rn+"/cheque",responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{lastcheques:B.asArray(t.lastcheques,{name:"lastcheques"}).map(i=>B.asObject(i,{name:"lastcheque"})).map(i=>({peer:B.asString(i.peer,{name:"peer"}),lastreceived:B.asNullable(a=>Rs(a),i.lastreceived),lastsent:B.asNullable(a=>Rs(a),i.lastsent)}))}}function Rs(r){const e=B.asObject(r,{name:"cheque"});return{beneficiary:new Wt(B.asString(e.beneficiary,{name:"beneficiary"})),chequebook:new Wt(B.asString(e.chequebook,{name:"chequebook"})),payout:_e.fromPLUR(Ge(e.payout,{name:"payout"}))}}function j6(r){const e=B.asObject(r,{name:"cashout result"});return{recipient:B.asString(e.recipient,{name:"recipient"}),lastPayout:_e.fromPLUR(Ge(e.lastPayout,{name:"lastPayout"})),bounced:B.asBoolean(e.bounced,{name:"bounced"})}}async function z6(r,e,t){const n={};t&&(n["gas-price"]=t.toString());const i=await Ae(r,{method:"post",url:Rn+"/deposit",responseType:"json",params:{amount:e.toString(10)},headers:n}),a=B.asObject(i.data,{name:"response.data"});return new rr(B.asString(a.transactionHash,{name:"transactionHash"}))}async function H6(r,e,t){const n={};t&&(n["gas-price"]=t.toString());const i=await Ae(r,{method:"post",url:Rn+"/withdraw",responseType:"json",params:{amount:e.toString(10)},headers:n}),a=B.asObject(i.data,{name:"response.data"});return new rr(B.asString(a.transactionHash,{name:"transactionHash"}))}async function q6(r){const e=await Ae(r,{url:"addresses",responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{overlay:new Tr(B.asString(t.overlay,{name:"overlay"})),underlay:B.asArray(t.underlay,{name:"underlay"}).map(n=>B.asString(n,{name:"underlay"})),ethereum:new Wt(B.asString(t.ethereum,{name:"ethereum"})),publicKey:new vr(B.asString(t.publicKey,{name:"publicKey"})),pssPublicKey:new vr(B.asString(t.pssPublicKey,{name:"pssPublicKey"}))}}async function $6(r){const e=await Ae(r,{url:"peers",responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return B.asArray(t.peers,{name:"peers"}).map(n=>({address:B.asString(B.asObject(n,{name:"peer"}).address,{name:"address"}),fullNode:B.asBoolean(B.asObject(n,{name:"peer"}).fullNode,{name:"fullNode"})}))}async function K6(r){return(await Ae(r,{url:"blocklist",responseType:"json"})).data.peers}async function W6(r,e){return(await Ae(r,{url:`peers/${e}`,responseType:"json",method:"DELETE"})).data}async function Q6(r){const e=await Ae(r,{url:"topology",responseType:"json"}),t=B.asObject(e.data,{name:"response.data"}),n=B.asObject(t.bins,{name:"bins"});return{baseAddr:B.asString(t.baseAddr,{name:"baseAddr"}),population:B.asNumber(t.population,{name:"population"}),connected:B.asNumber(t.connected,{name:"connected"}),timestamp:B.asString(t.timestamp,{name:"timestamp"}),nnLowWatermark:B.asNumber(t.nnLowWatermark,{name:"nnLowWatermark"}),depth:B.asNumber(t.depth,{name:"depth"}),reachability:B.asString(t.reachability,{name:"reachability"}),networkAvailability:B.asString(t.networkAvailability,{name:"networkAvailability"}),bins:{bin_0:We(n.bin_0,"bin_0"),bin_1:We(n.bin_1,"bin_1"),bin_2:We(n.bin_2,"bin_2"),bin_3:We(n.bin_3,"bin_3"),bin_4:We(n.bin_4,"bin_4"),bin_5:We(n.bin_5,"bin_5"),bin_6:We(n.bin_6,"bin_6"),bin_7:We(n.bin_7,"bin_7"),bin_8:We(n.bin_8,"bin_8"),bin_9:We(n.bin_9,"bin_9"),bin_10:We(n.bin_10,"bin_10"),bin_11:We(n.bin_11,"bin_11"),bin_12:We(n.bin_12,"bin_12"),bin_13:We(n.bin_13,"bin_13"),bin_14:We(n.bin_14,"bin_14"),bin_15:We(n.bin_15,"bin_15"),bin_16:We(n.bin_16,"bin_16"),bin_17:We(n.bin_17,"bin_17"),bin_18:We(n.bin_18,"bin_18"),bin_19:We(n.bin_19,"bin_19"),bin_20:We(n.bin_20,"bin_20"),bin_21:We(n.bin_21,"bin_21"),bin_22:We(n.bin_22,"bin_22"),bin_23:We(n.bin_23,"bin_23"),bin_24:We(n.bin_24,"bin_24"),bin_25:We(n.bin_25,"bin_25"),bin_26:We(n.bin_26,"bin_26"),bin_27:We(n.bin_27,"bin_27"),bin_28:We(n.bin_28,"bin_28"),bin_29:We(n.bin_29,"bin_29"),bin_30:We(n.bin_30,"bin_30"),bin_31:We(n.bin_31,"bin_31")}}}async function J6(r,e){return(await Ae(r,{url:`pingpong/${e}`,responseType:"json",method:"POST"})).data}function We(r,e){const t=B.asObject(r,{name:e});return t.disconnectedPeers||(t.disconnectedPeers=[]),t.connectedPeers||(t.connectedPeers=[]),{population:B.asNumber(t.population,{name:"population"}),connected:B.asNumber(t.connected,{name:"connected"}),connectedPeers:B.asArray(t.connectedPeers,{name:"connectedPeers"}).map(n=>({address:B.asString(B.asObject(n,{name:"connectedPeer"}).address,{name:"address"})})),disconnectedPeers:B.asArray(t.disconnectedPeers,{name:"disconnectedPeers"}).map(n=>({address:B.asString(B.asObject(n,{name:"disconnectedPeer"}).address,{name:"address"})}))}}const ky="settlements";async function Y6(r,e){const t=await Ae(r,{url:`${ky}/${e}`,responseType:"json"}),n=B.asObject(t.data,{name:"response.data"});return{peer:B.asString(n.peer,{name:"peer"}),sent:_e.fromPLUR(Ge(n.sent,{name:"sent"})),received:_e.fromPLUR(Ge(n.received,{name:"received"}))}}async function X6(r){const e=await Ae(r,{url:ky,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"}),n=_e.fromPLUR(Ge(t.totalSent,{name:"totalSent"})),i=_e.fromPLUR(Ge(t.totalReceived,{name:"totalReceived"})),a=B.asArray(t.settlements,{name:"settlements"}).map(c=>B.asObject(c,{name:"settlement"}));return{totalSent:n,totalReceived:i,settlements:a.map(c=>({peer:B.asString(c.peer,{name:"peer"}),sent:_e.fromPLUR(Ge(c.sent,{name:"sent"})),received:_e.fromPLUR(Ge(c.received,{name:"received"}))}))}}const Gs="stake",Z6="redistributionstate";async function ev(r){const e=await Ae(r,{method:"get",responseType:"json",url:`${Gs}`}),t=B.asObject(e.data,{name:"response.data"});return _e.fromPLUR(Ge(t.stakedAmount,{name:"stakedAmount"}))}async function tv(r){const e=await Ae(r,{method:"get",responseType:"json",url:`${Gs}/withdrawable`}),t=B.asObject(e.data,{name:"response.data"});return _e.fromPLUR(Ge(t.withdrawableAmount,{name:"withdrawableAmount"}))}async function rv(r){const e=await Ae(r,{method:"delete",responseType:"json",url:`${Gs}/withdrawable`}),t=B.asObject(e.data,{name:"response.data"});return new rr(B.asHexString(t.txHash,{name:"txHash"}))}async function nv(r){const e=await Ae(r,{method:"delete",responseType:"json",url:Gs}),t=B.asObject(e.data,{name:"response.data"});return new rr(B.asHexString(t.txHash,{name:"txHash"}))}async function iv(r,e,t){const n=await Ae(r,{method:"post",responseType:"json",url:`${Gs}/${e}`,headers:Jt(null,t)}),i=B.asObject(n.data,{name:"response.data"});return new rr(B.asHexString(i.txHash,{name:"txHash"}))}async function sv(r){const e=await Ae(r,{method:"get",responseType:"json",url:Z6}),t=B.asObject(e.data,{name:"response.data"});return{minimumGasFunds:vt.fromWei(Ge(t.minimumGasFunds,{name:"minimumGasFunds"})),hasSufficientFunds:B.asBoolean(t.hasSufficientFunds,{name:"hasSufficientFunds"}),isFrozen:B.asBoolean(t.isFrozen,{name:"isFrozen"}),isFullySynced:B.asBoolean(t.isFullySynced,{name:"isFullySynced"}),phase:B.asString(t.phase,{name:"phase"}),round:B.asNumber(t.round,{name:"round"}),lastWonRound:B.asNumber(t.lastWonRound,{name:"lastWonRound"}),lastPlayedRound:B.asNumber(t.lastPlayedRound,{name:"lastPlayedRound"}),lastFrozenRound:B.asNumber(t.lastFrozenRound,{name:"lastFrozenRound"}),lastSelectedRound:B.asNumber(t.lastSelectedRound,{name:"lastSelectedRound"}),lastSampleDurationSeconds:B.asNumber(t.lastSampleDurationSeconds,{name:"lastSampleDurationSeconds"}),block:B.asNumber(t.block,{name:"block"}),reward:_e.fromPLUR(Ge(t.reward,{name:"reward"})),fees:vt.fromWei(Ge(t.fees,{name:"fees"})),isHealthy:B.asBoolean(t.isHealthy,{name:"isHealthy"})}}const Li="stamps",av="batches";async function Km(r){const e=await Ae(r,{method:"get",url:`${av}`,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return B.asArray(t.batches,{name:"batches"}).map(i=>B.asObject(i,{name:"batch"})).map(i=>({batchID:new ut(B.asString(i.batchID,{name:"batchID"})),batchTTL:B.asNumber(i.batchTTL,{name:"batchTTL"}),bucketDepth:B.asNumber(i.bucketDepth,{name:"bucketDepth"}),depth:B.asNumber(i.depth,{name:"depth"}),immutable:B.asBoolean(i.immutable,{name:"immutable"}),owner:new Wt(B.asString(i.owner,{name:"owner"})),start:B.asNumber(i.start,{name:"start"}),value:Ge(i.value,{name:"value"})}))}async function Wm(r){const e=await Ae(r,{method:"get",url:`${Li}`,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return B.asArray(t.stamps,{name:"stamps"}).map(i=>B.asObject(i,{name:"stamp"})).map(i=>ry(Fy(i)))}async function ov(r,e,t,n){const i=await Ae(r,{method:"get",url:`${Li}/${e}`,responseType:"json"}),a=B.asObject(i.data,{name:"response.data"});return ry(Fy(a),t,n)}async function cv(r,e){const t=await Ae(r,{method:"get",url:`${Li}/${e}/buckets`,responseType:"json"}),n=B.asObject(t.data,{name:"response.data"});return{depth:B.asNumber(n.depth,{name:"depth"}),bucketDepth:B.asNumber(n.bucketDepth,{name:"bucketDepth"}),bucketUpperBound:B.asNumber(n.bucketUpperBound,{name:"bucketUpperBound"}),buckets:B.asArray(n.buckets,{name:"buckets"}).map(i=>B.asObject(i,{name:"bucket"})).map(i=>({bucketID:B.asNumber(i.bucketID,{name:"bucketID"}),collisions:B.asNumber(i.collisions,{name:"collisions"})}))}}async function uv(r,e,t,n){const i={};n?.gasPrice&&(i["gas-price"]=n.gasPrice.toString()),n?.immutableFlag!==void 0&&(i.immutable=String(n.immutableFlag));const a=await Ae(r,{method:"post",url:`${Li}/${e}/${t}`,responseType:"json",params:{label:n?.label},headers:i}),c=B.asObject(a.data,{name:"response.data"});return new ut(B.asString(c.batchID,{name:"batchID"}))}async function lv(r,e,t){const n=await Ae(r,{method:"patch",url:`${Li}/topup/${e}/${t}`,responseType:"json"}),i=B.asObject(n.data,{name:"response.data"});return new ut(B.asString(i.batchID,{name:"batchID"}))}async function fv(r,e,t){const n=await Ae(r,{method:"patch",url:`${Li}/dilute/${e}/${t}`,responseType:"json"}),i=B.asObject(n.data,{name:"response.data"});return new ut(B.asString(i.batchID,{name:"batchID"}))}function Fy(r){return{amount:Ge(r.amount,{name:"amount"}),batchID:B.asString(r.batchID,{name:"batchID"}),batchTTL:B.asNumber(r.batchTTL,{name:"batchTTL"}),bucketDepth:B.asNumber(r.bucketDepth,{name:"bucketDepth"}),blockNumber:B.asNumber(r.blockNumber,{name:"blockNumber"}),depth:B.asNumber(r.depth,{name:"depth"}),immutableFlag:B.asBoolean(r.immutableFlag,{name:"immutableFlag"}),label:B.asEmptiableString(r.label,{name:"label"}),usable:B.asBoolean(r.usable,{name:"usable"}),utilization:B.asNumber(r.utilization,{name:"utilization"})}}const hv="reservestate",P0="wallet",dv="chainstate";async function pv(r){const e=await Ae(r,{method:"get",url:`${hv}`,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{commitment:B.asNumber(t.commitment,{name:"commitment"}),radius:B.asNumber(t.radius,{name:"radius"}),storageRadius:B.asNumber(t.storageRadius,{name:"storageRadius"}),reserveCapacityDoubling:B.asNumber(t.reserveCapacityDoubling,{name:"reserveCapacityDoubling"})}}async function mv(r){const e=await Ae(r,{method:"get",url:`${dv}`,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{block:B.asNumber(t.block,{name:"block"}),chainTip:B.asNumber(t.chainTip,{name:"chainTip"}),totalAmount:Ge(t.totalAmount,{name:"totalAmount"}),currentPrice:a4(B.asNumber(t.currentPrice,{name:"currentPrice"}))}}async function bv(r){const e=await Ae(r,{method:"get",url:`${P0}`,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{bzzBalance:_e.fromPLUR(Ge(t.bzzBalance,{name:"bzzBalance"})),nativeTokenBalance:vt.fromWei(Ge(t.nativeTokenBalance,{name:"nativeTokenBalance"})),chainID:B.asNumber(t.chainID,{name:"chainID"}),chequebookContractAddress:B.asString(t.chequebookContractAddress,{name:"chequebookContractAddress"}),walletAddress:B.asString(t.walletAddress,{name:"walletAddress"})}}async function xv(r,e,t){const n=await Ae(r,{method:"post",url:`${P0}/withdraw/bzz`,responseType:"json",params:{amount:e.toPLURString(),address:t.toHex()}}),i=B.asObject(n.data,{name:"response.data"});return new rr(B.asString(i.transactionHash,{name:"transactionHash"}))}async function yv(r,e,t){const n=await Ae(r,{method:"post",url:`${P0}/withdraw/nativetoken`,responseType:"json",params:{amount:e.toWeiString(),address:t.toHex()}}),i=B.asObject(n.data,{name:"response.data"});return new rr(B.asString(i.transactionHash,{name:"transactionHash"}))}var af,Qm;function Dy(){if(Qm)return af;Qm=1;var r={};return af=typeof Ve=="object"&&r&&r.NODE_DEBUG&&/\bsemver\b/i.test(r.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{},af}var of,Jm;function Uy(){if(Jm)return of;Jm=1;const r="2.0.0",e=256,t=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,i=e-6;return of={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:r,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},of}var ma={exports:{}},Ym;function gv(){return Ym||(Ym=1,(function(r,e){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Uy(),a=Dy();e=r.exports={};const c=e.re=[],u=e.safeRe=[],l=e.src=[],d=e.safeSrc=[],h=e.t={};let m=0;const y="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",i],[y,n]],O=P=>{for(const[v,C]of E)P=P.split(`${v}*`).join(`${v}{0,${C}}`).split(`${v}+`).join(`${v}{1,${C}}`);return P},R=(P,v,C)=>{const N=O(v),F=m++;a(P,F,v),h[P]=F,l[F]=v,d[F]=N,c[F]=new RegExp(v,C?"g":void 0),u[F]=new RegExp(N,C?"g":void 0)};R("NUMERICIDENTIFIER","0|[1-9]\\d*"),R("NUMERICIDENTIFIERLOOSE","\\d+"),R("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),R("MAINVERSION",`(${l[h.NUMERICIDENTIFIER]})\\.(${l[h.NUMERICIDENTIFIER]})\\.(${l[h.NUMERICIDENTIFIER]})`),R("MAINVERSIONLOOSE",`(${l[h.NUMERICIDENTIFIERLOOSE]})\\.(${l[h.NUMERICIDENTIFIERLOOSE]})\\.(${l[h.NUMERICIDENTIFIERLOOSE]})`),R("PRERELEASEIDENTIFIER",`(?:${l[h.NONNUMERICIDENTIFIER]}|${l[h.NUMERICIDENTIFIER]})`),R("PRERELEASEIDENTIFIERLOOSE",`(?:${l[h.NONNUMERICIDENTIFIER]}|${l[h.NUMERICIDENTIFIERLOOSE]})`),R("PRERELEASE",`(?:-(${l[h.PRERELEASEIDENTIFIER]}(?:\\.${l[h.PRERELEASEIDENTIFIER]})*))`),R("PRERELEASELOOSE",`(?:-?(${l[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[h.PRERELEASEIDENTIFIERLOOSE]})*))`),R("BUILDIDENTIFIER",`${y}+`),R("BUILD",`(?:\\+(${l[h.BUILDIDENTIFIER]}(?:\\.${l[h.BUILDIDENTIFIER]})*))`),R("FULLPLAIN",`v?${l[h.MAINVERSION]}${l[h.PRERELEASE]}?${l[h.BUILD]}?`),R("FULL",`^${l[h.FULLPLAIN]}$`),R("LOOSEPLAIN",`[v=\\s]*${l[h.MAINVERSIONLOOSE]}${l[h.PRERELEASELOOSE]}?${l[h.BUILD]}?`),R("LOOSE",`^${l[h.LOOSEPLAIN]}$`),R("GTLT","((?:<|>)?=?)"),R("XRANGEIDENTIFIERLOOSE",`${l[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),R("XRANGEIDENTIFIER",`${l[h.NUMERICIDENTIFIER]}|x|X|\\*`),R("XRANGEPLAIN",`[v=\\s]*(${l[h.XRANGEIDENTIFIER]})(?:\\.(${l[h.XRANGEIDENTIFIER]})(?:\\.(${l[h.XRANGEIDENTIFIER]})(?:${l[h.PRERELEASE]})?${l[h.BUILD]}?)?)?`),R("XRANGEPLAINLOOSE",`[v=\\s]*(${l[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[h.XRANGEIDENTIFIERLOOSE]})(?:${l[h.PRERELEASELOOSE]})?${l[h.BUILD]}?)?)?`),R("XRANGE",`^${l[h.GTLT]}\\s*${l[h.XRANGEPLAIN]}$`),R("XRANGELOOSE",`^${l[h.GTLT]}\\s*${l[h.XRANGEPLAINLOOSE]}$`),R("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),R("COERCE",`${l[h.COERCEPLAIN]}(?:$|[^\\d])`),R("COERCEFULL",l[h.COERCEPLAIN]+`(?:${l[h.PRERELEASE]})?(?:${l[h.BUILD]})?(?:$|[^\\d])`),R("COERCERTL",l[h.COERCE],!0),R("COERCERTLFULL",l[h.COERCEFULL],!0),R("LONETILDE","(?:~>?)"),R("TILDETRIM",`(\\s*)${l[h.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",R("TILDE",`^${l[h.LONETILDE]}${l[h.XRANGEPLAIN]}$`),R("TILDELOOSE",`^${l[h.LONETILDE]}${l[h.XRANGEPLAINLOOSE]}$`),R("LONECARET","(?:\\^)"),R("CARETTRIM",`(\\s*)${l[h.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",R("CARET",`^${l[h.LONECARET]}${l[h.XRANGEPLAIN]}$`),R("CARETLOOSE",`^${l[h.LONECARET]}${l[h.XRANGEPLAINLOOSE]}$`),R("COMPARATORLOOSE",`^${l[h.GTLT]}\\s*(${l[h.LOOSEPLAIN]})$|^$`),R("COMPARATOR",`^${l[h.GTLT]}\\s*(${l[h.FULLPLAIN]})$|^$`),R("COMPARATORTRIM",`(\\s*)${l[h.GTLT]}\\s*(${l[h.LOOSEPLAIN]}|${l[h.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",R("HYPHENRANGE",`^\\s*(${l[h.XRANGEPLAIN]})\\s+-\\s+(${l[h.XRANGEPLAIN]})\\s*$`),R("HYPHENRANGELOOSE",`^\\s*(${l[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[h.XRANGEPLAINLOOSE]})\\s*$`),R("STAR","(<|>)?=?\\s*\\*"),R("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),R("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ma,ma.exports)),ma.exports}var cf,Xm;function wv(){if(Xm)return cf;Xm=1;const r=Object.freeze({loose:!0}),e=Object.freeze({});return cf=n=>n?typeof n!="object"?r:n:e,cf}var uf,Zm;function Av(){if(Zm)return uf;Zm=1;const r=/^[0-9]+$/,e=(n,i)=>{if(typeof n=="number"&&typeof i=="number")return n===i?0:n<i?-1:1;const a=r.test(n),c=r.test(i);return a&&c&&(n=+n,i=+i),n===i?0:a&&!c?-1:c&&!a?1:n<i?-1:1};return uf={compareIdentifiers:e,rcompareIdentifiers:(n,i)=>e(i,n)},uf}var lf,eb;function Ev(){if(eb)return lf;eb=1;const r=Dy(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:t}=Uy(),{safeRe:n,t:i}=gv(),a=wv(),{compareIdentifiers:c}=Av();class u{constructor(d,h){if(h=a(h),d instanceof u){if(d.loose===!!h.loose&&d.includePrerelease===!!h.includePrerelease)return d;d=d.version}else if(typeof d!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof d}".`);if(d.length>e)throw new TypeError(`version is longer than ${e} characters`);r("SemVer",d,h),this.options=h,this.loose=!!h.loose,this.includePrerelease=!!h.includePrerelease;const m=d.trim().match(h.loose?n[i.LOOSE]:n[i.FULL]);if(!m)throw new TypeError(`Invalid Version: ${d}`);if(this.raw=d,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(y=>{if(/^[0-9]+$/.test(y)){const E=+y;if(E>=0&&E<t)return E}return y}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(d){if(r("SemVer.compare",this.version,this.options,d),!(d instanceof u)){if(typeof d=="string"&&d===this.version)return 0;d=new u(d,this.options)}return d.version===this.version?0:this.compareMain(d)||this.comparePre(d)}compareMain(d){return d instanceof u||(d=new u(d,this.options)),this.major<d.major?-1:this.major>d.major?1:this.minor<d.minor?-1:this.minor>d.minor?1:this.patch<d.patch?-1:this.patch>d.patch?1:0}comparePre(d){if(d instanceof u||(d=new u(d,this.options)),this.prerelease.length&&!d.prerelease.length)return-1;if(!this.prerelease.length&&d.prerelease.length)return 1;if(!this.prerelease.length&&!d.prerelease.length)return 0;let h=0;do{const m=this.prerelease[h],y=d.prerelease[h];if(r("prerelease compare",h,m,y),m===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(m===void 0)return-1;if(m===y)continue;return c(m,y)}while(++h)}compareBuild(d){d instanceof u||(d=new u(d,this.options));let h=0;do{const m=this.build[h],y=d.build[h];if(r("build compare",h,m,y),m===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(m===void 0)return-1;if(m===y)continue;return c(m,y)}while(++h)}inc(d,h,m){if(d.startsWith("pre")){if(!h&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(h){const y=`-${h}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!y||y[1]!==h)throw new Error(`invalid identifier: ${h}`)}}switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",h,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",h,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",h,m),this.inc("pre",h,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",h,m),this.inc("pre",h,m);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const y=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[y];else{let E=this.prerelease.length;for(;--E>=0;)typeof this.prerelease[E]=="number"&&(this.prerelease[E]++,E=-2);if(E===-1){if(h===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(y)}}if(h){let E=[h,y];m===!1&&(E=[h]),c(this.prerelease[0],h)===0?isNaN(this.prerelease[1])&&(this.prerelease=E):this.prerelease=E}break}default:throw new Error(`invalid increment argument: ${d}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return lf=u,lf}var ff,tb;function vv(){if(tb)return ff;tb=1;const r=Ev();return ff=(t,n)=>new r(t,n).major,ff}var Rv=vv();const rb=Us(Rv),N0="2.7.0-6ddf9b45";N0.split("-")[0];const Ly="7.3.0",Bv="node",Tv="status",Sv="health",Ov="readiness";async function Iv(r){const e=await Ae(r,{method:"get",url:Tv,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{overlay:B.asString(t.overlay,{name:"overlay"}),proximity:B.asNumber(t.proximity,{name:"proximity"}),beeMode:kx(B.asString(t.beeMode,{name:"beeMode"})),reserveSize:B.asNumber(t.reserveSize,{name:"reserveSize"}),reserveSizeWithinRadius:B.asNumber(t.reserveSizeWithinRadius,{name:"reserveSizeWithinRadius"}),pullsyncRate:B.asNumber(t.pullsyncRate,{name:"pullsyncRate"}),storageRadius:B.asNumber(t.storageRadius,{name:"storageRadius"}),connectedPeers:B.asNumber(t.connectedPeers,{name:"connectedPeers"}),neighborhoodSize:B.asNumber(t.neighborhoodSize,{name:"neighborhoodSize"}),batchCommitment:B.asNumber(t.batchCommitment,{name:"batchCommitment"}),isReachable:B.asBoolean(t.isReachable,{name:"isReachable"}),lastSyncedBlock:B.asNumber(t.lastSyncedBlock,{name:"lastSyncedBlock"}),committedDepth:B.asNumber(t.committedDepth,{name:"committedDepth"}),isWarmingUp:B.asBoolean(t.isWarmingUp,{name:"isWarmingUp"})}}async function co(r){const e=await Ae(r,{method:"get",url:Sv,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{apiVersion:B.asString(t.apiVersion,{name:"apiVersion"}),version:B.asString(t.version,{name:"version"}),status:B.asString(t.status,{name:"status"})}}async function Cv(r){const e=await Ae(r,{method:"get",url:Ov}),t=B.asObject(e.data,{name:"response.data"});return{apiVersion:B.asString(t.apiVersion,{name:"apiVersion"}),version:B.asString(t.version,{name:"version"}),status:B.asString(t.status,{name:"status"})}}async function Pv(r){const e=await Ae(r,{method:"get",url:Bv,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{beeMode:kx(B.asString(t.beeMode,{name:"beeMode"})),chequebookEnabled:B.asBoolean(t.chequebookEnabled,{name:"chequebookEnabled"}),swapEnabled:B.asBoolean(t.swapEnabled,{name:"swapEnabled"})}}async function Nv(r){const{version:e}=await co(r);return e===N0}async function kv(r){const{apiVersion:e}=await co(r);return rb(e)===rb(Ly)}async function Fv(r){const{version:e,apiVersion:t}=await co(r);return{supportedBeeVersion:N0,supportedBeeApiVersion:Ly,beeVersion:e,beeApiVersion:t}}const uo="transactions";async function Dv(r){const e=await Ae(r,{url:uo,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return B.asArray(t.pendingTransactions,{name:"pendingTransactions"}).map(My)}async function Uv(r,e){const t=await Ae(r,{url:`${uo}/${e}`,responseType:"json"}),n=B.asObject(t.data,{name:"response.data"});return My(n)}function My(r){const e=B.asObject(r,{name:"transaction"});return{transactionHash:new rr(B.asString(e.transactionHash,{name:"transactionHash"})),to:B.asString(e.to,{name:"to"}),nonce:B.asNumber(e.nonce,{name:"nonce"}),gasPrice:Ge(e.gasPrice,{name:"gasPrice"}),gasLimit:B.asNumber(e.gasLimit,{name:"gasLimit"}),data:B.asString(e.data,{name:"data"}),created:B.asString(e.created,{name:"created"}),description:B.asString(e.description,{name:"description"}),value:Ge(e.value,{name:"value"})}}async function Lv(r,e){const t=await Ae(r,{method:"post",url:`${uo}/${e}`,responseType:"json"}),n=B.asObject(t.data,{name:"response.data"});return new rr(B.asString(n.transactionHash,{name:"transactionHash"}))}async function Mv(r,e,t){const n={};t&&(n["gas-price"]=t.toString());const i=await Ae(r,{method:"delete",headers:n,url:`${uo}/${e}`,responseType:"json"}),a=B.asObject(i.data,{name:"response.data"});return new rr(B.asString(a.transactionHash,{name:"transactionHash"}))}const _v="envelope";async function Vv(r,e,t){const n=await Ae(r,{method:"post",responseType:"json",url:`${_v}/${t}`,headers:{"swarm-postage-batch-id":e.toHex()}}),i=B.asObject(n.data,{name:"response.data"});return{issuer:me.hexToUint8Array(B.asHexString(i.issuer,{name:"issuer",byteLength:20})),index:me.hexToUint8Array(B.asHexString(i.index,{name:"index",byteLength:8})),timestamp:me.hexToUint8Array(B.asHexString(i.timestamp,{name:"timestamp",byteLength:8})),signature:me.hexToUint8Array(B.asHexString(i.signature,{name:"signature",byteLength:65})),batchId:e}}const k0="grantee";async function Gv(r,e){const t=await Ae(e,{method:"get",url:`${k0}/${r}`,responseType:"json"}),n=B.asArray(t.data,{name:"response.data"}).map(i=>new vr(B.asString(i,{name:"grantee"})));return{status:t.status,statusText:t.statusText,grantees:n}}async function jv(r,e,t){const n=await Ae(r,{method:"post",url:k0,data:{grantees:t.map(a=>a.toCompressedHex())},headers:Jt(e),responseType:"json"}),i=B.asObject(n.data,{name:"response.data"});return{status:n.status,statusText:n.statusText,ref:new ke(B.asString(i.ref,{name:"ref"})),historyref:new ke(B.asString(i.historyref,{name:"historyref"}))}}async function zv(r,e,t,n,i){const a=await Ae(i,{method:"patch",url:`${k0}/${e}`,data:{add:n.add?.map(u=>u.toCompressedHex()),revoke:n.revoke?.map(u=>u.toCompressedHex())},headers:{...Jt(r),"swarm-act-history-address":t.toHex()},responseType:"json"}),c=B.asObject(a.data,{name:"response.data"});return{status:a.status,statusText:a.statusText,ref:new ke(B.asString(c.ref,{name:"ref"})),historyref:new ke(B.asString(c.historyref,{name:"historyref"}))}}var hf,nb;function Hv(){if(nb)return hf;nb=1;var r=null;return typeof WebSocket<"u"?r=WebSocket:typeof MozWebSocket<"u"?r=MozWebSocket:typeof Nr<"u"?r=Nr.WebSocket||Nr.MozWebSocket:typeof window<"u"?r=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(r=self.WebSocket||self.MozWebSocket),hf=r,hf}var qv=Hv();const Ga=Us(qv),ib="gsoc";async function $v(r,e,t,n){return B0(r,e,t,n)}function Kv(r,e,t){const n=r.replace(/^http/i,"ws");return Za.whereAmI()==="browser"?new Ga(`${n}/${ib}/subscribe/${e.toHex()}`):new Ga(`${n}/${ib}/subscribe/${e.toHex()}`,{headers:t})}const lo="pins";async function Wv(r,e){await Ae(r,{method:"post",responseType:"json",url:`${lo}/${e}`})}async function Qv(r,e){await Ae(r,{method:"delete",responseType:"json",url:`${lo}/${e}`})}async function Jv(r,e){const t=await Ae(r,{method:"get",responseType:"json",url:`${lo}/${e}`}),n=B.asObject(t.data,{name:"response.data"});return{reference:new ke(B.asString(n.reference,{name:"reference"}))}}async function Yv(r){const e=await Ae(r,{method:"get",responseType:"json",url:`${lo}`}),t=B.asObject(e.data,{name:"response.data"});return t.references===null?[]:B.asArray(t.references,{name:"references"}).map(i=>B.asString(i,{name:"reference"})).map(i=>new ke(i))}const Gf="pss";async function sb(r,e,t,n,i,a){await Ae(r,{method:"post",url:`${Gf}/send/${e}/${t}`,data:n,responseType:"json",params:{recipient:a},headers:Jt(i)})}function Xv(r,e,t){const n=r.replace(/^http/i,"ws");return Za.whereAmI()==="browser"?new Ga(`${n}/${Gf}/subscribe/${e.toHex()}`):new Ga(`${n}/${Gf}/subscribe/${e.toHex()}`,{headers:t})}const Zv="rchash";async function e5(r,e,t,n){const i=await Ae(r,{responseType:"json",url:`${Zv}/${e}/${t}/${n}`}),a=B.asObject(i.data,{name:"response.data"});return B.asNumber(a.durationSeconds,{name:"durationSeconds"})}async function ab(r){await Ae(r,{url:""})}async function t5(r){try{const e=await Ae(r,{url:"/gateway"}),t=B.asObject(e.data);return B.asBoolean(t.gateway)}catch{return!1}}const _y="stewardship";async function r5(r,e,t){await Ae(r,{method:"put",url:`${_y}/${t}`,headers:{"swarm-postage-batch-id":e.toHex()}})}async function n5(r,e){e=new ke(e);const t=await Ae(r,{method:"get",responseType:"json",url:`${_y}/${e}`}),n=B.asObject(t.data,{name:"response.data"});return B.asBoolean(n.isRetrievable,{name:"isRetrievable"})}const js="tags";async function i5(r){const e=await Ae(r,{method:"post",url:js,responseType:"json"}),t=B.asObject(e.data,{name:"response.data"});return{address:B.asEmptiableString(t.address,{name:"address"}),seen:B.asNumber(t.seen,{name:"seen"}),sent:B.asNumber(t.sent,{name:"sent"}),split:B.asNumber(t.split,{name:"split"}),startedAt:B.asString(t.startedAt,{name:"startedAt"}),stored:B.asNumber(t.stored,{name:"stored"}),synced:B.asNumber(t.synced,{name:"synced"}),uid:B.asNumber(t.uid,{name:"uid"})}}async function s5(r,e){const t=await Ae(r,{url:`${js}/${e}`,responseType:"json"}),n=B.asObject(t.data,{name:"response.data"});return{address:B.asEmptiableString(n.address,{name:"address"}),seen:B.asNumber(n.seen,{name:"seen"}),sent:B.asNumber(n.sent,{name:"sent"}),split:B.asNumber(n.split,{name:"split"}),startedAt:B.asString(n.startedAt,{name:"startedAt"}),stored:B.asNumber(n.stored,{name:"stored"}),synced:B.asNumber(n.synced,{name:"synced"}),uid:B.asNumber(n.uid,{name:"uid"})}}async function a5(r,e,t){const n=await Ae(r,{url:js,params:{offset:e,limit:t},responseType:"json"}),i=B.asObject(n.data,{name:"response.data"});return B.asArray(i.tags,{name:"tags"}).map(c=>B.asObject(c,{name:"tag"})).map(c=>({address:B.asEmptiableString(c.address,{name:"address"}),seen:B.asNumber(c.seen,{name:"seen"}),sent:B.asNumber(c.sent,{name:"sent"}),split:B.asNumber(c.split,{name:"split"}),startedAt:B.asString(c.startedAt,{name:"startedAt"}),stored:B.asNumber(c.stored,{name:"stored"}),synced:B.asNumber(c.synced,{name:"synced"}),uid:B.asNumber(c.uid,{name:"uid"})}))}async function o5(r,e){await Ae(r,{method:"delete",url:`${js}/${e}`})}async function c5(r,e,t){await Ae(r,{method:"patch",url:`${js}/${e}`,data:{reference:t}})}const jf=p0("bee-js:manifest"),Na=new TextEncoder,xs=new TextDecoder,u5=2,l5=4,f5=8,Vy=16,df=new Uint8Array([47]),h5="5768b3b6a7db56d21d1abff40d41cebfc83448fed8d7e9b06ec0d3b073f28f7b",ob=me.hexToUint8Array(h5);class gn{constructor(e,t){this.prefix=e,this.node=t}static split(e,t){const n=me.commonPrefix(e.prefix,t.prefix);if(n.length===e.prefix.length){const u=t.prefix.slice(n.length);return t.node.path=t.prefix.slice(n.length),t.prefix=t.prefix.slice(n.length),t.node.parent=e.node,e.node.forks.set(u[0],t),e}if(n.length===t.prefix.length){const u=e.prefix.slice(n.length);return e.node.path=e.prefix.slice(n.length),e.prefix=e.prefix.slice(n.length),e.node.parent=t.node,t.node.forks.set(u[0],e),t}const i=new zn({path:n}),a=new gn(e.prefix.slice(n.length),e.node),c=new gn(t.prefix.slice(n.length),t.node);return e.node.path=e.prefix.slice(n.length),t.node.path=t.prefix.slice(n.length),e.prefix=e.prefix.slice(n.length),t.prefix=t.prefix.slice(n.length),i.forks.set(a.prefix[0],a),i.forks.set(c.prefix[0],c),a.node.parent=i,c.node.parent=i,new gn(n,i)}marshal(){if(!this.node.selfAddress)throw Error("Fork#marshal node.selfAddress is not set");const e=[];if(e.push(new Uint8Array([this.node.determineType()])),e.push(me.numberToUint8(this.prefix.length)),e.push(this.prefix),this.prefix.length<30&&e.push(new Uint8Array(30-this.prefix.length)),e.push(this.node.selfAddress),jf("marshalling fork",{prefixLength:this.prefix.length,prefix:xs.decode(this.prefix),address:me.uint8ArrayToHex(this.node.selfAddress)}),this.node.metadata){const t=me.padEndToMultiple(new Uint8Array([0,0,...Na.encode(JSON.stringify(this.node.metadata))]),32,10),n=me.numberToUint16(t.length-2,"BE");t.set(n,0),e.push(t)}return me.concatBytes(...e)}static unmarshal(e,t){const n=me.uint8ToNumber(e.read(1)),i=me.uint8ToNumber(e.read(1)),a=e.read(i);i<30&&e.read(30-i);const c=e.read(t);jf("unmarshalling fork",{type:n,prefixLength:i,prefix:xs.decode(a),addressLength:t,address:me.uint8ArrayToHex(c)});let u;if(d5(n,Vy)){const l=me.uint16ToNumber(e.read(2),"BE");u=JSON.parse(xs.decode(e.read(l)))}return new gn(a,new zn({selfAddress:c,metadata:u,path:a}))}}class zn{constructor(e){this.obfuscationKey=new Uint8Array(32),this.selfAddress=null,this.targetAddress=new Uint8Array(32),this.metadata=null,this.path=new Uint8Array(0),this.forks=new Map,this.parent=null,e?.targetAddress&&(this.targetAddress=e.targetAddress),e?.selfAddress&&(this.selfAddress=e.selfAddress),e?.metadata&&(this.metadata=e.metadata),e?.obfuscationKey&&(this.obfuscationKey=e.obfuscationKey),e?.path&&(this.path=e.path),e?.parent&&(this.parent=e.parent)}get fullPath(){return me.concatBytes(this.parent?.fullPath??new Uint8Array(0),this.path)}get fullPathString(){return xs.decode(this.fullPath)}getRootMetadata(){const e=this.find("/");return e&&e.metadata?jt.of(e.metadata):jt.empty()}getDocsMetadata(){const e=this.find("/");return!e||!e.metadata?{indexDocument:null,errorDocument:null}:{indexDocument:e.metadata["website-index-document"]??null,errorDocument:e.metadata["website-error-document"]??null}}async resolveFeed(e,t){const n=this.find("/");if(!n||!n.metadata)return jt.empty();const i=n.metadata["swarm-feed-owner"],a=n.metadata["swarm-feed-topic"];return!i||!a?jt.empty():jt.of(await e.fetchLatestFeedUpdate(a,i,t))}async marshal(){for(const a of this.forks.values())a.node.selfAddress||(a.node.selfAddress=(await a.node.calculateSelfAddress()).toUint8Array());const e=new Uint8Array(32);e.set(ob,0),e.set(me.equals(this.targetAddress,di)&&me.equals(this.path,new Uint8Array([47]))?me.numberToUint8(0):me.numberToUint8(this.targetAddress.length),31);const t=new Uint8Array(32);for(const a of this.forks.keys())me.setBit(t,a,1,"LE");const n=[];for(let a=0;a<256;a++)me.getBit(t,a,"LE")&&n.push(this.forks.get(a).marshal());const i=me.xorCypher(me.concatBytes(e,me.equals(this.targetAddress,di)&&me.equals(this.path,new Uint8Array([47]))?new Uint8Array(0):this.targetAddress,t,...n),this.obfuscationKey);return me.concatBytes(this.obfuscationKey,i)}static async unmarshal(e,t,n,i){t=new ke(t);const a=(await e.downloadData(t,n,i)).toUint8Array();return this.unmarshalFromData(a,t.toUint8Array())}static unmarshalFromData(e,t){const n=e.subarray(0,32),i=me.xorCypher(e.subarray(32),n),a=new $8(i),c=a.read(31);if(!me.equals(c,ob.slice(0,31)))throw new Error("MantarayNode#unmarshal invalid version hash");const u=me.uint8ToNumber(a.read(1)),l=u?a.read(u):di,d=new zn({selfAddress:t,targetAddress:l,obfuscationKey:n}),h=a.read(32);for(let m=0;m<256;m++)if(me.getBit(h,m,"LE")){const y=gn.unmarshal(a,t.length);d.forks.set(m,y),y.node.parent=d}return d}addFork(e,t,n){this.selfAddress=null,e=e instanceof Uint8Array?e:Na.encode(e),jf("adding fork",{path:xs.decode(e),reference:new ke(t).represent()});let i=this;for(;e.length;){const a=e.slice(0,30);e=e.slice(30);const c=e.length===0,[u,l]=i.findClosest(a),d=a.slice(l.length);if(l.length&&(i=u),!d.length)continue;const h=new gn(d,new zn({targetAddress:c?new ke(t).toUint8Array():void 0,metadata:c?n:void 0,path:d})),m=u.forks.get(d[0]);if(m){const y=gn.split(h,m);i.forks.set(d[0],y),y.node.parent=i,i.selfAddress=null,i=h.node}else i.forks.set(d[0],h),h.node.parent=i,i.selfAddress=null,i=h.node}}removeFork(e){if(this.selfAddress=null,e=e instanceof Uint8Array?e:Na.encode(e),e.length===0)throw Error("MantarayNode#removeFork [path] parameter cannot be empty");const t=this.find(e);if(!t)throw Error("MantarayNode#removeFork fork not found");const[n,i]=this.findClosest(e.slice(0,e.length-1));n.forks.delete(e.slice(i.length)[0]);for(const a of t.forks.values())n.addFork(me.concatBytes(t.path,a.prefix),a.node.targetAddress,a.node.metadata)}async calculateSelfAddress(){return this.selfAddress?new ke(this.selfAddress):new ke((await Sx.root(await this.marshal())).hash())}async saveRecursively(e,t,n,i){for(const c of this.forks.values()){const u=await c.node.saveRecursively(e,t,n,i);if(n?.act){let l;u.historyAddress.ifPresent(d=>l=d),l&&(c.node.metadata||(c.node.metadata={}),c.node.metadata["swarm-act-history-address"]=l.toHex())}}const a=await e.uploadData(t,await this.marshal(),n,i);return this.selfAddress=a.reference.toUint8Array(),a}async loadRecursively(e,t,n){for(const i of this.forks.values()){if(!i.node.selfAddress)throw Error("MantarayNode#loadRecursively fork.node.selfAddress is not set");let a=t;i.node.metadata&&i.node.metadata["swarm-act-history-address"]&&(a={...t,actHistoryAddress:i.node.metadata["swarm-act-history-address"]});const c=await zn.unmarshal(e,i.node.selfAddress,a,n);i.node.targetAddress=c.targetAddress,i.node.forks=c.forks,i.node.path=i.prefix,i.node.parent=this,await i.node.loadRecursively(e,t,n)}}find(e){const[t,n]=this.findClosest(e);return n.length===e.length?t:null}findClosest(e,t=new Uint8Array){if(e=e instanceof Uint8Array?e:Na.encode(e),e.length===0)return[this,t];const n=this.forks.get(e[0]);return n&&me.commonPrefix(n.prefix,e).length===n.prefix.length?n.node.findClosest(e.slice(n.prefix.length),me.concatBytes(t,n.prefix)):[this,t]}collect(e=[]){for(const t of this.forks.values())me.equals(t.node.targetAddress,di)||e.push(t.node),t.node.collect(e);return e}collectAndMap(){const e=this.collect(),t={};for(const n of e)t[n.fullPathString]=new ke(n.targetAddress).toHex();return t}determineType(){let e=0;return(!me.equals(this.targetAddress,di)||me.equals(this.path,df))&&(e|=u5),this.forks.size>0&&(e|=l5),me.indexOf(this.path,df)!==-1&&!me.equals(this.path,df)&&(e|=f5),this.metadata&&(e|=Vy),e}}function d5(r,e){return(r&e)===e}function p5(r){function n(a){if(a<=1)return a;const c=Math.ceil(a/128);return a+n(c)}const i=Math.ceil(r/4096);return n(i)}const m5={aac:"audio/aac",abw:"application/x-abiword",ai:"application/postscript",arc:"application/octet-stream",avi:"video/x-msvideo",azw:"application/vnd.amazon.ebook",bin:"application/octet-stream",bz:"application/x-bzip",bz2:"application/x-bzip2",csh:"application/x-csh",css:"text/css",csv:"text/csv",doc:"application/msword",dll:"application/octet-stream",dmg:"application/x-apple-diskimage",eot:"application/vnd.ms-fontobject",epub:"application/epub+zip",gif:"image/gif",htm:"text/html",html:"text/html",ico:"image/x-icon",ics:"text/calendar",jar:"application/java-archive",jpeg:"image/jpeg",jpg:"image/jpeg",js:"application/javascript",json:"application/json",mid:"audio/midi",midi:"audio/midi",mp2:"audio/mpeg",mp3:"audio/mpeg",mp4:"video/mp4",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpkg:"application/vnd.apple.installer+xml",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",oga:"audio/ogg",ogv:"video/ogg",ogx:"application/ogg",otf:"font/otf",png:"image/png",pdf:"application/pdf",ppt:"application/vnd.ms-powerpoint",rar:"application/x-rar-compressed",rtf:"application/rtf",sh:"application/x-sh",svg:"image/svg+xml",swf:"application/x-shockwave-flash",tar:"application/x-tar",tif:"image/tiff",tiff:"image/tiff",ts:"application/typescript",ttf:"font/ttf",txt:"text/plain",vsd:"application/vnd.visio",wav:"audio/x-wav",weba:"audio/webm",webm:"video/webm",webp:"image/webp",woff:"font/woff",woff2:"font/woff2",xhtml:"application/xhtml+xml",xls:"application/vnd.ms-excel",xlsx:"application/vnd.ms-excel",xml:"application/xml",xul:"application/vnd.mozilla.xul+xml",zip:"application/zip","3gp":"video/3gpp","3gp2":"video/3gpp2","7z":"application/x-7z-compressed"};async function b5(r){throw new Error("Hashing directories is not supported in browsers!")}async function x5(r,e,t,n,i,a){throw new Error("Streaming directories is not supported in browsers!")}async function y5(r,e,t,n,i,a){const c=a?.signal;if(c?.aborted)throw new Error("Request aborted");const u=new q8(64,64);let l=0,d=0;for(const y of e)l+=p5(y.size);t=new ut(t);async function h(y){await u.enqueue(async()=>{if(!c?.aborted)try{await r.uploadChunk(t,y.build(),i,a),n?.({total:l,processed:++d})}catch(E){if(c?.aborted)return;throw E}})}const m=new zn;for(const y of e){if(c?.aborted)throw new Error("Request aborted");const E=await new Promise((P,v)=>{const C=new Sx(h);let N=0;const F=new FileReader;F.onerror=()=>{v(F.error)};const U=async()=>{if(c?.aborted){v(new Error("Request aborted"));return}if(N>=y.size){const L=await C.finalize();P(L);return}const V=y.slice(N,N+4096);F.readAsArrayBuffer(V)};F.onload=async V=>{if(!V.target){v("No event target");return}const L=V.target.result;L&&(await C.append(new Uint8Array(L)),N+=4096),U()},U()});await u.drain();const{filename:O,extension:R}=d0.parseFilename(y.name);m.addFork(Cy(y),E.hash(),{"Content-Type":g5(m5[R.toLowerCase()]||"application/octet-stream"),Filename:O}),y.name==="index.html"&&m.addFork("/",di,{"website-index-document":"index.html"})}if(c?.aborted)throw new Error("Request aborted");return m.saveRecursively(r,t,i,a)}function g5(r){return["text/html","text/css"].includes(r)?`${r}; charset=utf-8`:r}async function w5(r){throw new Error("Creating Collection from File System is not supported in browsers!")}async function cb(r){if(typeof r=="string")return new TextEncoder().encode(r);if(r instanceof ArrayBuffer)return new Uint8Array(r);if(r instanceof Blob)return new Uint8Array(await new Response(r).arrayBuffer());throw new TypeError("unknown websocket data type")}function A5(r){try{if(typeof r!="string")return!1;const e=new URL(r);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function E5(r){if(!A5(r))throw new _r("URL is not valid!",r)}function v5(r){return r.endsWith("/")?r.slice(0,-1):r}class ZT{constructor(e,t){E5(e),this.url=v5(e),t?.signer&&(this.signer=new Jr(t.signer)),this.network=t?.network??"gnosis",this.requestOptions={baseURL:this.url,timeout:t?.timeout??0,headers:t?.headers,onRequest:t?.onRequest,httpAgent:t?.httpAgent,httpsAgent:t?.httpsAgent}}async uploadData(e,t,n,i){return e=new ut(e),rm(t),n&&(n=XE(n)),vy(this.getRequestOptionsForCall(i),t,e,n)}async probeData(e,t){return e=new ke(e),c6(this.getRequestOptionsForCall(t),e)}async downloadData(e,t,n){return t&&(t=yn(t)),Ry(this.getRequestOptionsForCall(n),new Pa(e),t)}async downloadReadableData(e,t,n){return t&&(t=yn(t)),u6(this.getRequestOptionsForCall(n),new Pa(e),t)}async uploadChunk(e,t,n,i){const a="identifier"in t&&"signature"in t&&"owner"in t;if(t=t instanceof Uint8Array?t:t.data,n&&(n=Es(n)),t.length<Nt.LENGTH)throw new _r(`Chunk has to have size of at least ${Nt.LENGTH}.`,t);if(!a&&t.length>la+Nt.LENGTH)throw new _r(`Content Addressed Chunk must not exceed ${la+Nt.LENGTH} bytes.`,t);if(a&&t.length>la+Nt.LENGTH+vn.LENGTH+Lt.LENGTH)throw new _r(`Single Owner Chunk must not exceed ${la+Nt.LENGTH+vn.LENGTH+Lt.LENGTH} bytes.`,t);return t6(this.getRequestOptionsForCall(i),t,e,n)}async downloadChunk(e,t,n){return e=new ke(e),t&&(t=yn(t)),Vs(this.getRequestOptionsForCall(n),e,t)}async createGrantees(e,t,n){return e=new ut(e),t=t.map(i=>new vr(i)),jv(this.getRequestOptionsForCall(n),e,t)}async getGrantees(e,t){return e=new ke(e),Gv(e,this.getRequestOptionsForCall(t))}async patchGrantees(e,t,n,i,a){e=new ut(e),t=new ke(t),n=new ke(n);const c={add:i.add?.map(u=>new vr(u))??[],revoke:i.revoke?.map(u=>new vr(u))??[]};return zv(e,t,n,c,this.getRequestOptionsForCall(a))}async uploadFile(e,t,n,i,a){if(e=new ut(e),n4(t),i&&(i=ZE(i)),n&&typeof n!="string")throw new TypeError("name has to be string or undefined!");if(Yx(t)){const c=await Xx(t),u=n??t.name,d={contentType:t.type,...i};return $m(this.getRequestOptionsForCall(a),c,e,u,d)}else return $m(this.getRequestOptionsForCall(a),t,e,n,i)}async downloadFile(e,t="",n,i){return n&&(n=yn(n)),C6(this.getRequestOptionsForCall(i),new Pa(e),t,n)}async downloadReadableFile(e,t="",n,i){return e=new ke(e),n&&(n=yn(n)),P6(this.getRequestOptionsForCall(i),e,t,n)}async uploadFiles(e,t,n,i){e=new ut(e),n&&(n=bl(n));const a=v6(t);return sf(this.getRequestOptionsForCall(i),a,e,n)}async hashDirectory(e){return b5()}async streamDirectory(e,t,n,i,a){return e=new ut(e),x5(this,t,e,n,i,this.getRequestOptionsForCall(a))}async streamFiles(e,t,n,i,a){return e=new ut(e),y5(this,t,e,n,i,this.getRequestOptionsForCall(a))}async uploadCollection(e,t,n,i){return e=new ut(e),Iy(t),n&&(n=bl(n)),sf(this.getRequestOptionsForCall(i),t,e,n)}async uploadFilesFromDirectory(e,t,n,i){e=new ut(e),n&&(n=bl(n));const a=await w5();return sf(this.getRequestOptionsForCall(i),a,e,n)}async createTag(e){return i5(this.getRequestOptionsForCall(e))}async getAllTags(e,t){return e&&(e=i4(e)),a5(this.getRequestOptionsForCall(t),e?.offset,e?.limit)}async retrieveTag(e,t){return e=wn(e),s5(this.getRequestOptionsForCall(t),e)}async deleteTag(e,t){return e=wn(e),o5(this.getRequestOptionsForCall(t),e)}async updateTag(e,t,n){return t=new ke(t),e=wn(e),c5(this.getRequestOptionsForCall(n),e,t)}async pin(e,t){return e=new ke(e),Wv(this.getRequestOptionsForCall(t),e)}async unpin(e,t){return e=new ke(e),Qv(this.getRequestOptionsForCall(t),e)}async getAllPins(e){return Yv(this.getRequestOptionsForCall(e))}async getPin(e,t){return e=new ke(e),Jv(this.getRequestOptionsForCall(t),e)}async reuploadPinnedData(e,t,n){e=new ut(e),t=new ke(t),await r5(this.getRequestOptionsForCall(n),e,t)}async isReferenceRetrievable(e,t){return e=new ke(e),n5(this.getRequestOptionsForCall(t),e)}async isFeedRetrievable(e,t,n,i,a){if(e=new Wt(e),t=new Yr(t),i&&(i=yn(i)),!n)try{return await this.makeFeedReader(t,e,a).download(),!0}catch(c){const u=As.getDeep(c,"status");if(u===404||u===500)return!1;throw c}return A6(this,e,t,n,i,this.getRequestOptionsForCall(a))}async pssSend(e,t,n,i,a,c){return e=new ut(e),rm(i),a?(a=new vr(a),sb(this.getRequestOptionsForCall(c),t,n,i,e,a)):sb(this.getRequestOptionsForCall(c),t,n,i,e)}pssSubscribe(e,t){t=t4(t);const n=Xv(this.url,e,this.requestOptions.headers);let i=!1;const c={topic:e,cancel:()=>{i||(i=!0,n.terminate?n.terminate():n.close())}};return n.onmessage=async u=>{const l=await cb(u.data);l.length&&t.onMessage(new ze(l),c)},n.onerror=u=>{i||t.onError(new Pr(u.message),c)},n.onclose=()=>{t.onClose(c)},c}async pssReceive(e,t=0){if(typeof t!="number")throw new TypeError("timeoutMsc parameter has to be a number!");return new Promise((n,i)=>{let a;const c=this.pssSubscribe(e,{onError:u=>{clearTimeout(a),c.cancel(),i(u.message)},onMessage:u=>{clearTimeout(a),c.cancel(),n(u)},onClose:()=>{clearTimeout(a),c.cancel()}});t>0&&(a=setTimeout(()=>{c.cancel(),i(new Pr("pssReceive timeout"))},t))})}gsocMine(e,t,n=12){e=new Tr(e),t=new Lt(t);const i=0xb33n;for(let a=0n;a<0xffffn;a++){const c=new Jr(me.numberToUint256(i+a,"BE")),u=bs(t,c.publicKey().address());if(256-me.proximity(u.toUint8Array(),e.toUint8Array())<=256-n)return c}throw Error("Could not mine a valid signer")}async gsocSend(e,t,n,i,a,c){e=new ut(e),t=new Jr(t),n=new Lt(n);const l=vs(i).toSingleOwnerChunk(n,t);return $v(this.getRequestOptionsForCall(c),l,e,a)}gsocSubscribe(e,t,n){e=new Wt(e),t=new Lt(t),n=r4(n);const i=bs(t,e),a=Kv(this.url,i,this.requestOptions.headers);let c=!1;const l={address:e,cancel:()=>{c||(c=!0,a.terminate?a.terminate():a.close())}};return a.onmessage=async d=>{const h=await cb(d.data);h.length&&n.onMessage(new ze(h),l)},a.onerror=d=>{c||n.onError(new Pr(d.message),l)},a.onclose=()=>{n.onClose(l)},l}async createFeedManifest(e,t,n,i,a){return e=new ut(e),t=new Yr(t),n=new Wt(n),i&&(i=Es(i)),l6(this.getRequestOptionsForCall(a),n,t,e,i)}makeFeedReader(e,t,n){return e=new Yr(e),t=new Wt(t),Oy(this.getRequestOptionsForCall(n),e,t)}makeFeedWriter(e,t,n){if(e=new Yr(e),t=t?new Jr(t):this.signer,!t)throw Error("No signer provided");return y6(this.getRequestOptionsForCall(n),e,t)}async fetchLatestFeedUpdate(e,t,n){return e=new Yr(e),t=new Wt(t),Va(this.getRequestOptionsForCall(n),t,e)}makeContentAddressedChunk(e,t){return vs(e,t)}unmarshalContentAddressedChunk(e){return Ey(e)}makeSingleOwnerChunk(e,t,n,i,a){return Ay(e,t,n,i,a)}calculateSingleOwnerChunkAddress(e,t){return bs(e,t)}unmarshalSingleOwnerChunk(e,t){return ao(e,t)}makeSOCReader(e,t){return e=new Wt(e),{owner:e,download:o6.bind(null,this.getRequestOptionsForCall(t),e)}}makeSOCWriter(e,t){if(e=e?new Jr(e):this.signer,!e)throw Error("No signer provided");return{...this.makeSOCReader(e.publicKey().address(),t),upload:T0.bind(null,this.getRequestOptionsForCall(t),e)}}async createEnvelope(e,t,n){return e=new ut(e),t=new ke(t),Vv(this.getRequestOptionsForCall(n),e,t)}async rchash(e,t,n,i){return e5(this.getRequestOptionsForCall(i),e,t,n)}async checkConnection(e){return ab(this.getRequestOptionsForCall(e))}async isConnected(e){try{await ab(this.getRequestOptionsForCall(e))}catch{return!1}return!0}async isGateway(e){return t5(this.getRequestOptionsForCall(e))}async getNodeAddresses(e){return q6(this.getRequestOptionsForCall(e))}async getBlocklist(e){return K6(this.getRequestOptionsForCall(e))}async getPeers(e){return $6(this.getRequestOptionsForCall(e))}async removePeer(e,t){return e=new Tr(e),W6(this.getRequestOptionsForCall(t),e)}async getTopology(e){return Q6(this.getRequestOptionsForCall(e))}async pingPeer(e,t){return e=new Tr(e),J6(this.getRequestOptionsForCall(t),e)}async getAllBalances(e){return N6(this.getRequestOptionsForCall(e))}async getPeerBalance(e,t){return e=new Tr(e),k6(this.getRequestOptionsForCall(t),e)}async getPastDueConsumptionBalances(e){return F6(this.getRequestOptionsForCall(e))}async getPastDueConsumptionPeerBalance(e,t){return e=new Tr(e),D6(this.getRequestOptionsForCall(t),e)}async getChequebookAddress(e){return U6(this.getRequestOptionsForCall(e))}async getChequebookBalance(e){return L6(this.getRequestOptionsForCall(e))}async getLastCheques(e){return G6(this.getRequestOptionsForCall(e))}async getLastChequesForPeer(e,t){return e=new Tr(e),V6(this.getRequestOptionsForCall(t),e)}async getLastCashoutAction(e,t){return e=new Tr(e),M6(this.getRequestOptionsForCall(t),e)}async cashoutLastCheque(e,t,n){return e=new Tr(e),t&&tm(t),_6(this.getRequestOptionsForCall(n),e,t)}async depositTokens(e,t,n){return this.depositBZZToChequebook(e,t,n)}async depositBZZToChequebook(e,t,n){const i=e instanceof _e?e.toPLURString():Ge(e,{min:1n,name:"amount"});let a;return t&&(a=Ge(e,{min:0n,name:"gasPrice"})),z6(this.getRequestOptionsForCall(n),i,a)}async withdrawTokens(e,t,n){return this.withdrawBZZFromChequebook(e,t,n)}async withdrawBZZFromChequebook(e,t,n){const i=e instanceof _e?e.toPLURString():Ge(e,{min:1n,name:"amount"});let a;return t&&(a=Ge(e,{min:0n,name:"gasPrice"})),H6(this.getRequestOptionsForCall(n),i,a)}async withdrawBZZToExternalWallet(e,t,n){return e=e instanceof _e?e:_e.fromPLUR(e),t=new Wt(t),xv(this.getRequestOptionsForCall(n),e,t)}async withdrawDAIToExternalWallet(e,t,n){return e=e instanceof vt?e:vt.fromWei(e),t=new Wt(t),yv(this.getRequestOptionsForCall(n),e,t)}async getSettlements(e,t){return e=new Tr(e),Y6(this.getRequestOptionsForCall(t),e)}async getAllSettlements(e){return X6(this.getRequestOptionsForCall(e))}async getStatus(e){return Iv(this.getRequestOptionsForCall(e))}async getHealth(e){return co(this.getRequestOptionsForCall(e))}async getReadiness(e){return Cv(this.getRequestOptionsForCall(e))}async getNodeInfo(e){return Pv(this.getRequestOptionsForCall(e))}async isSupportedExactVersion(e){return Nv(this.getRequestOptionsForCall(e))}async isSupportedApiVersion(e){return kv(this.getRequestOptionsForCall(e))}async getVersions(e){return Fv(this.getRequestOptionsForCall(e))}async getReserveState(e){return pv(this.getRequestOptionsForCall(e))}async getChainState(e){return mv(this.getRequestOptionsForCall(e))}async getWalletBalance(e){return bv(this.getRequestOptionsForCall(e))}async createPostageBatch(e,t,n,i){const a=Ge(e,{min:0n,name:"amount"});if(n&&(n=em(n)),t<Sd||t>Od)throw new _r(`Depth has to be between ${Sd}..${Od}`,t);const c=await this.getChainState(),u=BigInt(c.currentPrice)*17280n+1n;if(BigInt(a)<u)throw new _r(`Amount has to be at least ${u} (1 day at current price ${c.currentPrice})`,a);const l=await uv(this.getRequestOptionsForCall(i),a,t,n);return n?.waitForUsable!==!1&&await this.waitForUsablePostageStamp(l,n?.waitForUsableTimeout),l}async buyStorage(e,t,n,i,a,c){const u=await this.getChainState(i),l=Ur(t,u.currentPrice,this.network==="gnosis"?5:15),d=ci(e,a,c);return n&&(n=em(n)),this.createPostageBatch(l,d,n,i)}async getStorageCost(e,t,n,i,a){const c=await this.getChainState(n),u=Ur(t,c.currentPrice,this.network==="gnosis"?5:15),l=ci(e,i,a);return oi(l,u)}async extendStorage(e,t,n,i,a,c){const u=await this.getPostageBatch(e,i),l=ci(t,a,c),d=await this.getChainState(i),h=l-u.depth,m=h<=0?1n:2n**BigInt(h),y=this.network==="gnosis"?5:15,E=Ur(n,d.currentPrice,y),O=Ur(u.duration,d.currentPrice,y),P=(n.isZero()?O*m:(O+E)*m)-O,v=await this.topUpBatch(u.batchID,P,i);return h>0?this.diluteBatch(u.batchID,l,i):v}async extendStorageSize(e,t,n,i,a){const c=await this.getChainState(n),u=await this.getPostageBatch(e,n),l=ci(t,i,a),d=l-u.depth;if(d<=0)throw new _r("New depth has to be greater than the original depth",l);const h=Ur(u.duration,c.currentPrice,this.network==="gnosis"?5:15);return await this.topUpBatch(u.batchID,h*(2n**BigInt(d)-1n)+1n,n),this.diluteBatch(u.batchID,l,n)}async extendStorageDuration(e,t,n){const i=await this.getPostageBatch(e,n),a=await this.getChainState(n),c=Ur(t,a.currentPrice,this.network==="gnosis"?5:15);return this.topUpBatch(i.batchID,c,n)}async getExtensionCost(e,t,n,i,a,c){const u=await this.getPostageBatch(e,i),l=await this.getChainState(i),d=this.network==="gnosis"?5:15,h=n.isZero()?0n:Ur(n,l.currentPrice,d),m=ci(t,a,c),y=Ur(u.duration,l.currentPrice,d),E=oi(u.depth,y);return oi(Math.max(u.depth,m),y+h).minus(E)}async getSizeExtensionCost(e,t,n,i,a){const c=await this.getPostageBatch(e,n),u=await this.getChainState(n),l=ci(t,i,a);if(l-c.depth<=0)throw new _r("New depth has to be greater than the original depth",l);const h=Ur(c.duration,u.currentPrice,this.network==="gnosis"?5:15),m=oi(c.depth,h);return oi(l,h).minus(m)}async getDurationExtensionCost(e,t,n){const i=await this.getPostageBatch(e,n),a=await this.getChainState(n),c=Ur(t,a.currentPrice,this.network==="gnosis"?5:15);return oi(i.depth,c)}async topUpBatch(e,t,n){e=new ut(e);const i=Ge(t,{min:1n,name:"amount"});return lv(this.getRequestOptionsForCall(n),e,i)}async diluteBatch(e,t,n){return e=new ut(e),t=B.asNumber(t,{name:"depth",min:18,max:255}),fv(this.getRequestOptionsForCall(n),e,t)}async getPostageBatch(e,t,n,i){return e=new ut(e),ov(this.getRequestOptionsForCall(t),e,n,i)}async getPostageBatchBuckets(e,t){return e=new ut(e),cv(this.getRequestOptionsForCall(t),e)}async getAllPostageBatch(e){return Wm(this.getRequestOptionsForCall(e))}async getAllGlobalPostageBatch(e){return Km(this.getRequestOptionsForCall(e))}async getPostageBatches(e){return Wm(this.getRequestOptionsForCall(e))}async getGlobalPostageBatches(e){return Km(this.getRequestOptionsForCall(e))}async getAllPendingTransactions(e){return Dv(this.getRequestOptionsForCall(e))}async getPendingTransaction(e,t){return e=new rr(e),Uv(this.getRequestOptionsForCall(t),e)}async rebroadcastPendingTransaction(e,t){return e=new rr(e),Lv(this.getRequestOptionsForCall(t),e)}async cancelPendingTransaction(e,t,n){e=new rr(e);let i;return t&&(i=Ge(t,{min:0n,name:"gasPrice"})),Mv(this.getRequestOptionsForCall(n),e,i)}async getStake(e){return ev(this.getRequestOptionsForCall(e))}async getWithdrawableStake(e){return tv(this.getRequestOptionsForCall(e))}async withdrawSurplusStake(e){return rv(this.getRequestOptionsForCall(e))}async migrateStake(e){return nv(this.getRequestOptionsForCall(e))}async depositStake(e,t,n){const i=e instanceof _e?e.toPLURString():Ge(e,{min:1n,name:"amount"});return t&&(t=tm(t)),iv(this.getRequestOptionsForCall(n),i,t)}async getRedistributionState(e){return sv(this.getRequestOptionsForCall(e))}async waitForUsablePostageStamp(e,t=24e4){for(let i=0;i<t;i+=3e3){try{if((await this.getPostageBatch(e)).usable)return}catch{}await Za.sleepMillis(3e3)}throw new Pr("Timeout on waiting for postage stamp to become usable")}getRequestOptionsForCall(e){return e&&(e=YE(e)),e?As.deepMerge2(this.requestOptions,e):this.requestOptions}}new ut("0000000000000000000000000000000000000000000000000000000000000000");const eS=new Yr("0000000000000000000000000000000000000000000000000000000000000000"),di=new Uint8Array(32);$t.MEDIUM;$t.STRONG;$t.INSANE;$t.PARANOID;const Gy="6.16.0";function R5(r,e,t){const n=e.split("|").map(a=>a.trim());for(let a=0;a<n.length;a++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof r===e)return}const i=new Error(`invalid value for type ${e}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${t}`,i.value=r,i}async function Kt(r){const e=Object.keys(r);return(await Promise.all(e.map(n=>Promise.resolve(r[n])))).reduce((n,i,a)=>(n[e[a]]=i,n),{})}function Pe(r,e,t){for(let n in e){let i=e[n];const a=t?t[n]:null;a&&R5(i,a,n),Object.defineProperty(r,n,{enumerable:!0,value:i,writable:!1})}}function bi(r,e){if(r==null)return"null";if(e==null&&(e=new Set),typeof r=="object"){if(e.has(r))return"[Circular]";e.add(r)}if(Array.isArray(r))return"[ "+r.map(t=>bi(t,e)).join(", ")+" ]";if(r instanceof Uint8Array){const t="0123456789abcdef";let n="0x";for(let i=0;i<r.length;i++)n+=t[r[i]>>4],n+=t[r[i]&15];return n}if(typeof r=="object"&&typeof r.toJSON=="function")return bi(r.toJSON(),e);switch(typeof r){case"boolean":case"number":case"symbol":return r.toString();case"bigint":return BigInt(r).toString();case"string":return JSON.stringify(r);case"object":{const t=Object.keys(r);return t.sort(),"{ "+t.map(n=>`${bi(n,e)}: ${bi(r[n],e)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function zt(r,e){return r&&r.code===e}function F0(r){return zt(r,"CALL_EXCEPTION")}function yt(r,e,t){let n=r;{const a=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${bi(t)}`);for(const c in t){if(c==="shortMessage")continue;const u=t[c];a.push(c+"="+bi(u))}}a.push(`code=${e}`),a.push(`version=${Gy}`),a.length&&(r+=" ("+a.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(r);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(r);break;default:i=new Error(r)}return Pe(i,{code:e}),t&&Object.assign(i,t),i.shortMessage==null&&Pe(i,{shortMessage:n}),i}function fe(r,e,t,n){if(!r)throw yt(e,t,n)}function j(r,e,t,n){fe(r,e,"INVALID_ARGUMENT",{argument:t,value:n})}function jy(r,e,t){t==null&&(t=""),t&&(t=": "+t),fe(r>=e,"missing argument"+t,"MISSING_ARGUMENT",{count:r,expectedCount:e}),fe(r<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:r,expectedCount:e})}const B5=["NFD","NFC","NFKD","NFKC"].reduce((r,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");r.push(e)}catch{}return r},[]);function zy(r){fe(B5.indexOf(r)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:r}})}function Xn(r,e,t){if(t==null&&(t=""),r!==e){let n=t,i="new";t&&(n+=".",i+=" "+t),fe(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function Hy(r,e,t){if(r instanceof Uint8Array)return t?new Uint8Array(r):r;if(typeof r=="string"&&r.length%2===0&&r.match(/^0x[0-9a-f]*$/i)){const n=new Uint8Array((r.length-2)/2);let i=2;for(let a=0;a<n.length;a++)n[a]=parseInt(r.substring(i,i+2),16),i+=2;return n}j(!1,"invalid BytesLike value",e||"value",r)}function ve(r,e){return Hy(r,e,!1)}function Ht(r,e){return Hy(r,e,!0)}function ht(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&r.length!==2+2*e||e===!0&&r.length%2!==0)}function fo(r){return ht(r,!0)||r instanceof Uint8Array}const ub="0123456789abcdef";function xe(r){const e=ve(r);let t="0x";for(let n=0;n<e.length;n++){const i=e[n];t+=ub[(i&240)>>4]+ub[i&15]}return t}function Ye(r){return"0x"+r.map(e=>xe(e).substring(2)).join("")}function yi(r){return ht(r,!0)?(r.length-2)/2:ve(r).length}function pt(r,e,t){const n=ve(r);return t!=null&&t>n.length&&fe(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:t}),xe(n.slice(e??0,t??n.length))}function qy(r,e,t){const n=ve(r);fe(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),t?i.set(n,e-n.length):i.set(n,0),xe(i)}function nn(r,e){return qy(r,e,!0)}function T5(r,e){return qy(r,e,!1)}const zs=BigInt(0),Cr=BigInt(1),xi=9007199254740991;function S5(r,e){const t=ho(r,"value"),n=BigInt(Le(e,"width"));if(fe(t>>n===zs,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:r}),t>>n-Cr){const i=(Cr<<n)-Cr;return-((~t&i)+Cr)}return t}function $y(r,e){let t=Se(r,"value");const n=BigInt(Le(e,"width")),i=Cr<<n-Cr;if(t<zs){t=-t,fe(t<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});const a=(Cr<<n)-Cr;return(~t&a)+Cr}else fe(t<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});return t}function ls(r,e){const t=ho(r,"value"),n=BigInt(Le(e,"bits"));return t&(Cr<<n)-Cr}function Se(r,e){switch(typeof r){case"bigint":return r;case"number":return j(Number.isInteger(r),"underflow",e||"value",r),j(r>=-xi&&r<=xi,"overflow",e||"value",r),BigInt(r);case"string":try{if(r==="")throw new Error("empty string");return r[0]==="-"&&r[1]!=="-"?-BigInt(r.substring(1)):BigInt(r)}catch(t){j(!1,`invalid BigNumberish string: ${t.message}`,e||"value",r)}}j(!1,"invalid BigNumberish value",e||"value",r)}function ho(r,e){const t=Se(r,e);return fe(t>=zs,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:r}),t}const lb="0123456789abcdef";function po(r){if(r instanceof Uint8Array){let e="0x0";for(const t of r)e+=lb[t>>4],e+=lb[t&15];return BigInt(e)}return Se(r)}function Le(r,e){switch(typeof r){case"bigint":return j(r>=-xi&&r<=xi,"overflow",e||"value",r),Number(r);case"number":return j(Number.isInteger(r),"underflow",e||"value",r),j(r>=-xi&&r<=xi,"overflow",e||"value",r),r;case"string":try{if(r==="")throw new Error("empty string");return Le(BigInt(r),e)}catch(t){j(!1,`invalid numeric string: ${t.message}`,e||"value",r)}}j(!1,"invalid numeric value",e||"value",r)}function O5(r){return Le(po(r))}function sn(r,e){const t=ho(r,"value");let n=t.toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=Le(e,"width");if(i===0&&t===zs)return"0x";for(fe(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:r});n.length<i*2;)n="0"+n}return"0x"+n}function At(r,e){const t=ho(r,"value");if(t===zs)return new Uint8Array(0);let n=t.toString(16);n.length%2&&(n="0"+n);const i=new Uint8Array(n.length/2);for(let a=0;a<i.length;a++){const c=a*2;i[a]=parseInt(n.substring(c,c+2),16)}return i}function Or(r){let e=xe(fo(r)?r:At(r)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const ja="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let ba=null;function I5(r){if(ba==null){ba={};for(let t=0;t<ja.length;t++)ba[ja[t]]=BigInt(t)}const e=ba[r];return j(e!=null,"invalid base58 value","letter",r),e}const C5=BigInt(0),zf=BigInt(58);function Ky(r){const e=ve(r);let t=po(e),n="";for(;t;)n=ja[Number(t%zf)]+n,t/=zf;for(let i=0;i<e.length&&!e[i];i++)n=ja[0]+n;return n}function P5(r){let e=C5;for(let t=0;t<r.length;t++)e*=zf,e+=I5(r[t]);return e}function N5(r){r=atob(r);const e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return ve(e)}function k5(r){const e=ve(r);let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}class Wy{filter;emitter;#e;constructor(e,t,n){this.#e=t,Pe(this,{emitter:e,filter:n})}async removeListener(){this.#e!=null&&await this.emitter.off(this.filter,this.#e)}}function F5(r,e,t,n,i){j(!1,`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}function Qy(r,e,t,n,i){if(r==="BAD_PREFIX"||r==="UNEXPECTED_CONTINUE"){let a=0;for(let c=e+1;c<t.length&&t[c]>>6===2;c++)a++;return a}return r==="OVERRUN"?t.length-e-1:0}function D5(r,e,t,n,i){return r==="OVERLONG"?(j(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),Qy(r,e,t))}const U5=Object.freeze({error:F5,ignore:Qy,replace:D5});function L5(r,e){e==null&&(e=U5.error);const t=ve(r,"bytes"),n=[];let i=0;for(;i<t.length;){const a=t[i++];if(a>>7===0){n.push(a);continue}let c=null,u=null;if((a&224)===192)c=1,u=127;else if((a&240)===224)c=2,u=2047;else if((a&248)===240)c=3,u=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,t,n):i+=e("BAD_PREFIX",i-1,t,n);continue}if(i-1+c>=t.length){i+=e("OVERRUN",i-1,t,n);continue}let l=a&(1<<8-c-1)-1;for(let d=0;d<c;d++){let h=t[i];if((h&192)!=128){i+=e("MISSING_CONTINUE",i,t,n),l=null;break}l=l<<6|h&63,i++}if(l!==null){if(l>1114111){i+=e("OUT_OF_RANGE",i-1-c,t,n,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-c,t,n,l);continue}if(l<=u){i+=e("OVERLONG",i-1-c,t,n,l);continue}n.push(l)}}return n}function nr(r,e){j(typeof r=="string","invalid string value","str",r),e!=null&&(zy(e),r=r.normalize(e));let t=[];for(let n=0;n<r.length;n++){const i=r.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192),t.push(i&63|128);else if((i&64512)==55296){n++;const a=r.charCodeAt(n);j(n<r.length&&(a&64512)===56320,"invalid surrogate pair","str",r);const c=65536+((i&1023)<<10)+(a&1023);t.push(c>>18|240),t.push(c>>12&63|128),t.push(c>>6&63|128),t.push(c&63|128)}else t.push(i>>12|224),t.push(i>>6&63|128),t.push(i&63|128)}return new Uint8Array(t)}function M5(r){return r.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function za(r,e){return M5(L5(r,e))}function Jy(r){async function e(t,n){fe(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");const i=t.url.split(":")[0].toLowerCase();fe(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),fe(i==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a=null;const c=new AbortController,u=setTimeout(()=>{a=yt("request timeout","TIMEOUT"),c.abort()},t.timeout);n&&n.addListener(()=>{a=yt("request cancelled","CANCELLED"),c.abort()});const l=Object.assign({},r,{method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:c.signal});let d;try{d=await fetch(t.url,l)}catch(E){throw clearTimeout(u),a||E}clearTimeout(u);const h={};d.headers.forEach((E,O)=>{h[O.toLowerCase()]=E});const m=await d.arrayBuffer(),y=m==null?null:new Uint8Array(m);return{statusCode:d.status,statusMessage:d.statusText,headers:h,body:y}}return e}const _5=12,V5=250;let fb=Jy();const G5=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),j5=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let pf=!1;async function Yy(r,e){try{const t=r.match(G5);if(!t)throw new Error("invalid data");return new An(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?N5(t[3]):H5(t[3]))}catch{return new An(599,"BAD REQUEST (invalid data: URI)",{},null,new $r(r))}}function Xy(r){async function e(t,n){try{const i=t.match(j5);if(!i)throw new Error("invalid link");return new $r(`${r}${i[2]}`)}catch{return new An(599,"BAD REQUEST (invalid IPFS URI)",{},null,new $r(t))}}return e}const xa={data:Yy,ipfs:Xy("https://gateway.ipfs.io/ipfs/")},Zy=new WeakMap;class z5{#e;#t;constructor(e){this.#e=[],this.#t=!1,Zy.set(e,()=>{if(!this.#t){this.#t=!0;for(const t of this.#e)setTimeout(()=>{t()},0);this.#e=[]}})}addListener(e){fe(!this.#t,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#e.push(e)}get cancelled(){return this.#t}checkSignal(){fe(!this.cancelled,"cancelled","CANCELLED",{})}}function ya(r){if(r==null)throw new Error("missing signal; should not happen");return r.checkSignal(),r}class $r{#e;#t;#r;#n;#i;#a;#s;#o;#d;#u;#p;#m;#c;#l;#f;get url(){return this.#a}set url(e){this.#a=String(e)}get body(){return this.#s==null?null:new Uint8Array(this.#s)}set body(e){if(e==null)this.#s=void 0,this.#o=void 0;else if(typeof e=="string")this.#s=nr(e),this.#o="text/plain";else if(e instanceof Uint8Array)this.#s=e,this.#o="application/octet-stream";else if(typeof e=="object")this.#s=nr(JSON.stringify(e)),this.#o="application/json";else throw new Error("invalid body")}hasBody(){return this.#s!=null}get method(){return this.#n?this.#n:this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),this.#n=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#r);return this.#d&&(e.authorization=`Basic ${k5(nr(this.#d))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&this.#o&&(e["content-type"]=this.#o),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#r[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#r={}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n<t.length){const i=t[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#d||null}setCredentials(e,t){j(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#d=`${e}:${t}`}get allowGzip(){return this.#t}set allowGzip(e){this.#t=!!e}get allowInsecureAuthentication(){return!!this.#e}set allowInsecureAuthentication(e){this.#e=!!e}get timeout(){return this.#i}set timeout(e){j(e>=0,"timeout must be non-zero","timeout",e),this.#i=e}get preflightFunc(){return this.#u||null}set preflightFunc(e){this.#u=e}get processFunc(){return this.#p||null}set processFunc(e){this.#p=e}get retryFunc(){return this.#m||null}set retryFunc(e){this.#m=e}get getUrlFunc(){return this.#f||fb}set getUrlFunc(e){this.#f=e}constructor(e){this.#a=String(e),this.#e=!1,this.#t=!0,this.#r={},this.#n="",this.#i=3e5,this.#l={slotInterval:V5,maxAttempts:_5},this.#f=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#s?xe(this.#s):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(this.#l.slotInterval=e.slotInterval),e.maxAttempts!=null&&(this.#l.maxAttempts=e.maxAttempts)}async#h(e,t,n,i,a){if(e>=this.#l.maxAttempts)return a.makeServerError("exceeded maximum retry limit");fe(hb()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await q5(n);let c=this.clone();const u=(c.url.split(":")[0]||"").toLowerCase();if(u in xa){const h=await xa[u](c.url,ya(i.#c));if(h instanceof An){let m=h;if(this.processFunc){ya(i.#c);try{m=await this.processFunc(c,m)}catch(y){(y.throttle==null||typeof y.stall!="number")&&m.makeServerError("error in post-processing function",y).assertOk()}}return m}c=h}this.preflightFunc&&(c=await this.preflightFunc(c));const l=await this.getUrlFunc(c,ya(i.#c));let d=new An(l.statusCode,l.statusMessage,l.headers,l.body,i);if(d.statusCode===301||d.statusCode===302){try{const h=d.headers.location||"";return c.redirect(h).#h(e+1,t,0,i,d)}catch{}return d}else if(d.statusCode===429&&(this.retryFunc==null||await this.retryFunc(c,d,e))){const h=d.headers["retry-after"];let m=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof h=="string"&&h.match(/^[1-9][0-9]*$/)&&(m=parseInt(h)),c.clone().#h(e+1,t,m,i,d)}if(this.processFunc){ya(i.#c);try{d=await this.processFunc(c,d)}catch(h){(h.throttle==null||typeof h.stall!="number")&&d.makeServerError("error in post-processing function",h).assertOk();let m=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return h.stall>=0&&(m=h.stall),c.clone().#h(e+1,t,m,i,d)}}return d}send(){return fe(this.#c==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#c=new z5(this),this.#h(0,hb()+this.timeout,0,this,new An(0,"",{},null,this))}cancel(){fe(this.#c!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=Zy.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();fe(this.method==="GET"&&(t!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new $r(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,i.#r=Object.assign({},this.#r),this.#s&&(i.#s=new Uint8Array(this.#s)),i.#o=this.#o,i}clone(){const e=new $r(this.url);return e.#n=this.#n,this.#s&&(e.#s=this.#s),e.#o=this.#o,e.#r=Object.assign({},this.#r),e.#d=this.#d,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#u=this.#u,e.#p=this.#p,e.#m=this.#m,e.#l=Object.assign({},this.#l),e.#f=this.#f,e}static lockConfig(){pf=!0}static getGateway(e){return xa[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(pf)throw new Error("gateways locked");xa[e]=t}static registerGetUrl(e){if(pf)throw new Error("gateways locked");fb=e}static createGetUrlFunc(e){return Jy(e)}static createDataGateway(){return Yy}static createIpfsGatewayFunc(e){return Xy(e)}}class An{#e;#t;#r;#n;#i;#a;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#n?xe(this.#n):"null"}>`}get statusCode(){return this.#e}get statusMessage(){return this.#t}get headers(){return Object.assign({},this.#r)}get body(){return this.#n==null?null:new Uint8Array(this.#n)}get bodyText(){try{return this.#n==null?"":za(this.#n)}catch{fe(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{fe(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n<t.length){const i=t[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,n,i,a){this.#e=e,this.#t=t,this.#r=Object.keys(n).reduce((c,u)=>(c[u.toLowerCase()]=String(n[u]),c),{}),this.#n=i==null?null:new Uint8Array(i),this.#i=a||null,this.#a={message:""}}makeServerError(e,t){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);const i=new An(599,n,this.headers,this.body,this.#i||void 0);return i.#a={message:e,error:t},i}throwThrottleError(e,t){t==null?t=-1:j(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);const n=new Error(e||"throttling requests");throw Pe(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return this.#n!=null}get request(){return this.#i}ok(){return this.#a.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#a;e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let i=null;try{this.#n&&(i=za(this.#n))}catch{}fe(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:n,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function hb(){return new Date().getTime()}function H5(r){return nr(r.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function q5(r){return new Promise(e=>setTimeout(e,r))}function $5(r){let e=r.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function db(r,e,t){let n=0;for(let i=0;i<t;i++)n=n*256+r[e+i];return n}function pb(r,e,t,n){const i=[];for(;t<e+1+n;){const a=eg(r,t);i.push(a.result),t+=a.consumed,fe(t<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:r,length:n,offset:e})}return{consumed:1+n,result:i}}function eg(r,e){fe(r.length!==0,"data too short","BUFFER_OVERRUN",{buffer:r,length:0,offset:1});const t=n=>{fe(n<=r.length,"data short segment too short","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n})};if(r[e]>=248){const n=r[e]-247;t(e+1+n);const i=db(r,e+1,n);return t(e+1+n+i),pb(r,e,e+1+n,n+i)}else if(r[e]>=192){const n=r[e]-192;return t(e+1+n),pb(r,e,e+1,n)}else if(r[e]>=184){const n=r[e]-183;t(e+1+n);const i=db(r,e+1,n);t(e+1+n+i);const a=xe(r.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:a}}else if(r[e]>=128){const n=r[e]-128;t(e+1+n);const i=xe(r.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:$5(r[e])}}function Hs(r){const e=ve(r,"data"),t=eg(e,0);return j(t.consumed===e.length,"unexpected junk after rlp payload","data",r),t.result}function mb(r){const e=[];for(;r;)e.unshift(r&255),r>>=8;return e}function tg(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(a){n=n.concat(tg(a))}),n.length<=55)return n.unshift(192+n.length),n;const i=mb(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(ve(r,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const t=mb(e.length);return t.unshift(183+t.length),t.concat(e)}const bb="0123456789abcdef";function qr(r){let e="0x";for(const t of tg(r))e+=bb[t>>4],e+=bb[t&15];return e}function K5(r){const e=ve(r,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=xe(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")}const er=32,Hf=new Uint8Array(er),W5=["then"],ga={},rg=new WeakMap;function Un(r){return rg.get(r)}function xb(r,e){rg.set(r,e)}function os(r,e){const t=new Error(`deferred error during ABI decoding triggered accessing ${r}`);throw t.error=e,t}function qf(r,e,t){return r.indexOf(null)>=0?e.map((n,i)=>n instanceof Zr?qf(Un(n),n,t):n):r.reduce((n,i,a)=>{let c=e.getValue(i);return i in n||(t&&c instanceof Zr&&(c=qf(Un(c),c,t)),n[i]=c),n},{})}class Zr extends Array{#e;constructor(...e){const t=e[0];let n=e[1],i=(e[2]||[]).slice(),a=!0;t!==ga&&(n=e,i=[],a=!1),super(n.length),n.forEach((l,d)=>{this[d]=l});const c=i.reduce((l,d)=>(typeof d=="string"&&l.set(d,(l.get(d)||0)+1),l),new Map);if(xb(this,Object.freeze(n.map((l,d)=>{const h=i[d];return h!=null&&c.get(h)===1?h:null}))),this.#e=[],this.#e==null&&this.#e,!a)return;Object.freeze(this);const u=new Proxy(this,{get:(l,d,h)=>{if(typeof d=="string"){if(d.match(/^[0-9]+$/)){const y=Le(d,"%index");if(y<0||y>=this.length)throw new RangeError("out of result range");const E=l[y];return E instanceof Error&&os(`index ${y}`,E),E}if(W5.indexOf(d)>=0)return Reflect.get(l,d,h);const m=l[d];if(m instanceof Function)return function(...y){return m.apply(this===h?l:this,y)};if(!(d in l))return l.getValue.apply(this===h?l:this,[d])}return Reflect.get(l,d,h)}});return xb(u,Un(this)),u}toArray(e){const t=[];return this.forEach((n,i)=>{n instanceof Error&&os(`index ${i}`,n),e&&n instanceof Zr&&(n=n.toArray(e)),t.push(n)}),t}toObject(e){const t=Un(this);return t.reduce((n,i,a)=>(fe(i!=null,`value at index ${a} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),qf(t,this,e)),{})}slice(e,t){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),t==null&&(t=this.length),t<0&&(t+=this.length,t<0&&(t=0)),t>this.length&&(t=this.length);const n=Un(this),i=[],a=[];for(let c=e;c<t;c++)i.push(this[c]),a.push(n[c]);return new Zr(ga,i,a)}filter(e,t){const n=Un(this),i=[],a=[];for(let c=0;c<this.length;c++){const u=this[c];u instanceof Error&&os(`index ${c}`,u),e.call(t,u,c,this)&&(i.push(u),a.push(n[c]))}return new Zr(ga,i,a)}map(e,t){const n=[];for(let i=0;i<this.length;i++){const a=this[i];a instanceof Error&&os(`index ${i}`,a),n.push(e.call(t,a,i,this))}return n}getValue(e){const t=Un(this).indexOf(e);if(t===-1)return;const n=this[t];return n instanceof Error&&os(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(e,t){return new Zr(ga,e,t)}}function yb(r){let e=At(r);return fe(e.length<=er,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:er,offset:e.length}),e.length!==er&&(e=Ht(Ye([Hf.slice(e.length%er),e]))),e}class cn{name;type;localName;dynamic;constructor(e,t,n,i){Pe(this,{name:e,type:t,localName:n,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){j(!1,e,this.localName,t)}}class $f{#e;#t;constructor(){this.#e=[],this.#t=0}get data(){return Ye(this.#e)}get length(){return this.#t}#r(e){return this.#e.push(e),this.#t+=e.length,e.length}appendWriter(e){return this.#r(Ht(e.data))}writeBytes(e){let t=Ht(e);const n=t.length%er;return n&&(t=Ht(Ye([t,Hf.slice(n)]))),this.#r(t)}writeValue(e){return this.#r(yb(e))}writeUpdatableValue(){const e=this.#e.length;return this.#e.push(Hf),this.#t+=er,t=>{this.#e[e]=yb(t)}}}class D0{allowLoose;#e;#t;#r;#n;#i;constructor(e,t,n){Pe(this,{allowLoose:!!t}),this.#e=Ht(e),this.#r=0,this.#n=null,this.#i=n??1024,this.#t=0}get data(){return xe(this.#e)}get dataLength(){return this.#e.length}get consumed(){return this.#t}get bytes(){return new Uint8Array(this.#e)}#a(e){if(this.#n)return this.#n.#a(e);this.#r+=e,fe(this.#i<1||this.#r<=this.#i*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#i} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Ht(this.#e),offset:this.#t,length:e,info:{bytesRead:this.#r,dataLength:this.dataLength}})}#s(e,t,n){let i=Math.ceil(t/er)*er;return this.#t+i>this.#e.length&&(this.allowLoose&&n&&this.#t+t<=this.#e.length?i=t:fe(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Ht(this.#e),length:this.#e.length,offset:this.#t+i})),this.#e.slice(this.#t,this.#t+i)}subReader(e){const t=new D0(this.#e.slice(this.#t+e),this.allowLoose,this.#i);return t.#n=this,t}readBytes(e,t){let n=this.#s(0,e,!!t);return this.#a(e),this.#t+=n.length,n.slice(0,e)}readValue(){return po(this.readBytes(er))}readIndex(){return O5(this.readBytes(er))}}function fr(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function U0(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}function ng(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");fr(r.outputLen),fr(r.blockLen)}function Bi(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function ig(r,e){U0(r);const t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}const mf=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;const sg=r=>r instanceof Uint8Array,ka=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),Fa=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),Lr=(r,e)=>r<<32-e|r>>>e,Q5=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Q5)throw new Error("Non little-endian hardware is not supported");const J5=async()=>{};async function gb(r,e,t){let n=Date.now();for(let i=0;i<r;i++){t(i);const a=Date.now()-n;a>=0&&a<e||(await J5(),n+=a)}}function Y5(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function Ti(r){if(typeof r=="string"&&(r=Y5(r)),!sg(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function X5(...r){const e=new Uint8Array(r.reduce((n,i)=>n+i.length,0));let t=0;return r.forEach(n=>{if(!sg(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}class L0{clone(){return this._cloneInto()}}const Z5={}.toString;function ag(r,e){if(e!==void 0&&Z5.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}function mo(r){const e=n=>r().update(Ti(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function e7(r=32){if(mf&&typeof mf.getRandomValues=="function")return mf.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}class og extends L0{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ng(e);const n=Ti(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(n.length>i?e.create().update(n).digest():n);for(let c=0;c<a.length;c++)a[c]^=54;this.iHash.update(a),this.oHash=e.create();for(let c=0;c<a.length;c++)a[c]^=106;this.oHash.update(a),a.fill(0)}update(e){return Bi(this),this.iHash.update(e),this}digestInto(e){Bi(this),U0(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:i,destroyed:a,blockLen:c,outputLen:u}=this;return e=e,e.finished=i,e.destroyed=a,e.blockLen=c,e.outputLen=u,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const bo=(r,e,t)=>new og(r,e).update(t).digest();bo.create=(r,e)=>new og(r,e);function t7(r,e,t,n){ng(r);const i=ag({dkLen:32,asyncTick:10},n),{c:a,dkLen:c,asyncTick:u}=i;if(fr(a),fr(c),fr(u),a<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const l=Ti(e),d=Ti(t),h=new Uint8Array(c),m=bo.create(r,l),y=m._cloneInto().update(d);return{c:a,dkLen:c,asyncTick:u,DK:h,PRF:m,PRFSalt:y}}function r7(r,e,t,n,i){return r.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),t}function M0(r,e,t,n){const{c:i,dkLen:a,DK:c,PRF:u,PRFSalt:l}=t7(r,e,t,n);let d;const h=new Uint8Array(4),m=Fa(h),y=new Uint8Array(u.outputLen);for(let E=1,O=0;O<a;E++,O+=u.outputLen){const R=c.subarray(O,O+u.outputLen);m.setInt32(0,E,!1),(d=l._cloneInto(d)).update(h).digestInto(y),R.set(y.subarray(0,R.length));for(let P=1;P<i;P++){u._cloneInto(d).update(y).digestInto(y);for(let v=0;v<R.length;v++)R[v]^=y[v]}}return r7(u,l,c,d,y)}function n7(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);const i=BigInt(32),a=BigInt(4294967295),c=Number(t>>i&a),u=Number(t&a),l=n?4:0,d=n?0:4;r.setUint32(e+l,c,n),r.setUint32(e+d,u,n)}class _0 extends L0{constructor(e,t,n,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Fa(this.buffer)}update(e){Bi(this);const{view:t,buffer:n,blockLen:i}=this;e=Ti(e);const a=e.length;for(let c=0;c<a;){const u=Math.min(i-this.pos,a-c);if(u===i){const l=Fa(e);for(;i<=a-c;c+=i)this.process(l,c);continue}n.set(e.subarray(c,c+u),this.pos),this.pos+=u,c+=u,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Bi(this),ig(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:i,isLE:a}=this;let{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>i-c&&(this.process(n,0),c=0);for(let m=c;m<i;m++)t[m]=0;n7(n,i-8,BigInt(this.length*8),a),this.process(n,0);const u=Fa(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=l/4,h=this.get();if(d>h.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<d;m++)u.setUint32(4*m,h[m],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:i,finished:a,destroyed:c,pos:u}=this;return e.length=i,e.pos=u,e.finished=a,e.destroyed=c,i%t&&e.buffer.set(n),e}}const i7=(r,e,t)=>r&e^~r&t,s7=(r,e,t)=>r&e^r&t^e&t,a7=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),dn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),pn=new Uint32Array(64);class o7 extends _0{constructor(){super(64,32,8,!1),this.A=dn[0]|0,this.B=dn[1]|0,this.C=dn[2]|0,this.D=dn[3]|0,this.E=dn[4]|0,this.F=dn[5]|0,this.G=dn[6]|0,this.H=dn[7]|0}get(){const{A:e,B:t,C:n,D:i,E:a,F:c,G:u,H:l}=this;return[e,t,n,i,a,c,u,l]}set(e,t,n,i,a,c,u,l){this.A=e|0,this.B=t|0,this.C=n|0,this.D=i|0,this.E=a|0,this.F=c|0,this.G=u|0,this.H=l|0}process(e,t){for(let m=0;m<16;m++,t+=4)pn[m]=e.getUint32(t,!1);for(let m=16;m<64;m++){const y=pn[m-15],E=pn[m-2],O=Lr(y,7)^Lr(y,18)^y>>>3,R=Lr(E,17)^Lr(E,19)^E>>>10;pn[m]=R+pn[m-7]+O+pn[m-16]|0}let{A:n,B:i,C:a,D:c,E:u,F:l,G:d,H:h}=this;for(let m=0;m<64;m++){const y=Lr(u,6)^Lr(u,11)^Lr(u,25),E=h+y+i7(u,l,d)+a7[m]+pn[m]|0,R=(Lr(n,2)^Lr(n,13)^Lr(n,22))+s7(n,i,a)|0;h=d,d=l,l=u,u=c+E|0,c=a,a=i,i=n,n=E+R|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,c=c+this.D|0,u=u+this.E|0,l=l+this.F|0,d=d+this.G|0,h=h+this.H|0,this.set(n,i,a,c,u,l,d,h)}roundClean(){pn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Mi=mo(()=>new o7),wa=BigInt(2**32-1),Kf=BigInt(32);function cg(r,e=!1){return e?{h:Number(r&wa),l:Number(r>>Kf&wa)}:{h:Number(r>>Kf&wa)|0,l:Number(r&wa)|0}}function ug(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let i=0;i<r.length;i++){const{h:a,l:c}=cg(r[i],e);[t[i],n[i]]=[a,c]}return[t,n]}const c7=(r,e)=>BigInt(r>>>0)<<Kf|BigInt(e>>>0),u7=(r,e,t)=>r>>>t,l7=(r,e,t)=>r<<32-t|e>>>t,f7=(r,e,t)=>r>>>t|e<<32-t,h7=(r,e,t)=>r<<32-t|e>>>t,d7=(r,e,t)=>r<<64-t|e>>>t-32,p7=(r,e,t)=>r>>>t-32|e<<64-t,m7=(r,e)=>e,b7=(r,e)=>r,lg=(r,e,t)=>r<<t|e>>>32-t,fg=(r,e,t)=>e<<t|r>>>32-t,hg=(r,e,t)=>e<<t-32|r>>>64-t,dg=(r,e,t)=>r<<t-32|e>>>64-t;function x7(r,e,t,n){const i=(e>>>0)+(n>>>0);return{h:r+t+(i/2**32|0)|0,l:i|0}}const y7=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0),g7=(r,e,t,n)=>e+t+n+(r/2**32|0)|0,w7=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0),A7=(r,e,t,n,i)=>e+t+n+i+(r/2**32|0)|0,E7=(r,e,t,n,i)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0),v7=(r,e,t,n,i,a)=>e+t+n+i+a+(r/2**32|0)|0,Me={fromBig:cg,split:ug,toBig:c7,shrSH:u7,shrSL:l7,rotrSH:f7,rotrSL:h7,rotrBH:d7,rotrBL:p7,rotr32H:m7,rotr32L:b7,rotlSH:lg,rotlSL:fg,rotlBH:hg,rotlBL:dg,add:x7,add3L:y7,add3H:g7,add4L:w7,add4H:A7,add5H:v7,add5L:E7},[R7,B7]=Me.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),mn=new Uint32Array(80),bn=new Uint32Array(80);class T7 extends _0{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:i,Ch:a,Cl:c,Dh:u,Dl:l,Eh:d,El:h,Fh:m,Fl:y,Gh:E,Gl:O,Hh:R,Hl:P}=this;return[e,t,n,i,a,c,u,l,d,h,m,y,E,O,R,P]}set(e,t,n,i,a,c,u,l,d,h,m,y,E,O,R,P){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=i|0,this.Ch=a|0,this.Cl=c|0,this.Dh=u|0,this.Dl=l|0,this.Eh=d|0,this.El=h|0,this.Fh=m|0,this.Fl=y|0,this.Gh=E|0,this.Gl=O|0,this.Hh=R|0,this.Hl=P|0}process(e,t){for(let N=0;N<16;N++,t+=4)mn[N]=e.getUint32(t),bn[N]=e.getUint32(t+=4);for(let N=16;N<80;N++){const F=mn[N-15]|0,U=bn[N-15]|0,V=Me.rotrSH(F,U,1)^Me.rotrSH(F,U,8)^Me.shrSH(F,U,7),L=Me.rotrSL(F,U,1)^Me.rotrSL(F,U,8)^Me.shrSL(F,U,7),G=mn[N-2]|0,Q=bn[N-2]|0,re=Me.rotrSH(G,Q,19)^Me.rotrBH(G,Q,61)^Me.shrSH(G,Q,6),de=Me.rotrSL(G,Q,19)^Me.rotrBL(G,Q,61)^Me.shrSL(G,Q,6),z=Me.add4L(L,de,bn[N-7],bn[N-16]),we=Me.add4H(z,V,re,mn[N-7],mn[N-16]);mn[N]=we|0,bn[N]=z|0}let{Ah:n,Al:i,Bh:a,Bl:c,Ch:u,Cl:l,Dh:d,Dl:h,Eh:m,El:y,Fh:E,Fl:O,Gh:R,Gl:P,Hh:v,Hl:C}=this;for(let N=0;N<80;N++){const F=Me.rotrSH(m,y,14)^Me.rotrSH(m,y,18)^Me.rotrBH(m,y,41),U=Me.rotrSL(m,y,14)^Me.rotrSL(m,y,18)^Me.rotrBL(m,y,41),V=m&E^~m&R,L=y&O^~y&P,G=Me.add5L(C,U,L,B7[N],bn[N]),Q=Me.add5H(G,v,F,V,R7[N],mn[N]),re=G|0,de=Me.rotrSH(n,i,28)^Me.rotrBH(n,i,34)^Me.rotrBH(n,i,39),z=Me.rotrSL(n,i,28)^Me.rotrBL(n,i,34)^Me.rotrBL(n,i,39),we=n&a^n&u^a&u,Te=i&c^i&l^c&l;v=R|0,C=P|0,R=E|0,P=O|0,E=m|0,O=y|0,{h:m,l:y}=Me.add(d|0,h|0,Q|0,re|0),d=u|0,h=l|0,u=a|0,l=c|0,a=n|0,c=i|0;const ae=Me.add3L(re,z,Te);n=Me.add3H(ae,Q,de,we),i=ae|0}({h:n,l:i}=Me.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:a,l:c}=Me.add(this.Bh|0,this.Bl|0,a|0,c|0),{h:u,l}=Me.add(this.Ch|0,this.Cl|0,u|0,l|0),{h:d,l:h}=Me.add(this.Dh|0,this.Dl|0,d|0,h|0),{h:m,l:y}=Me.add(this.Eh|0,this.El|0,m|0,y|0),{h:E,l:O}=Me.add(this.Fh|0,this.Fl|0,E|0,O|0),{h:R,l:P}=Me.add(this.Gh|0,this.Gl|0,R|0,P|0),{h:v,l:C}=Me.add(this.Hh|0,this.Hl|0,v|0,C|0),this.set(n,i,a,c,u,l,d,h,m,y,E,O,R,P,v,C)}roundClean(){mn.fill(0),bn.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const V0=mo(()=>new T7);function S7(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof wd<"u")return wd;throw new Error("unable to locate global object")}const wb=S7(),Ab=wb.crypto||wb.msCrypto;function O7(r){switch(r){case"sha256":return Mi.create();case"sha512":return V0.create()}j(!1,"invalid hashing algorithm name","algorithm",r)}function I7(r,e){const t={sha256:Mi,sha512:V0}[r];return j(t!=null,"invalid hmac algorithm","algorithm",r),bo.create(t,e)}function C7(r,e,t,n,i){const a={sha256:Mi,sha512:V0}[i];return j(a!=null,"invalid pbkdf2 algorithm","algorithm",i),M0(a,r,e,{c:t,dkLen:n})}function P7(r){fe(Ab!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),j(Number.isInteger(r)&&r>0&&r<=1024,"invalid length","length",r);const e=new Uint8Array(r);return Ab.getRandomValues(e),e}let pg=!1;const mg=function(r,e,t){return I7(r,e).update(t).digest()};let bg=mg;function _i(r,e,t){const n=ve(e,"key"),i=ve(t,"data");return xe(bg(r,n,i))}_i._=mg;_i.lock=function(){pg=!0};_i.register=function(r){if(pg)throw new Error("computeHmac is locked");bg=r};Object.freeze(_i);const[xg,yg,gg]=[[],[],[]],N7=BigInt(0),cs=BigInt(1),k7=BigInt(2),F7=BigInt(7),D7=BigInt(256),U7=BigInt(113);for(let r=0,e=cs,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],xg.push(2*(5*n+t)),yg.push((r+1)*(r+2)/2%64);let i=N7;for(let a=0;a<7;a++)e=(e<<cs^(e>>F7)*U7)%D7,e&k7&&(i^=cs<<(cs<<BigInt(a))-cs);gg.push(i)}const[L7,M7]=ug(gg,!0),Eb=(r,e,t)=>t>32?hg(r,e,t):lg(r,e,t),vb=(r,e,t)=>t>32?dg(r,e,t):fg(r,e,t);function _7(r,e=24){const t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let c=0;c<10;c++)t[c]=r[c]^r[c+10]^r[c+20]^r[c+30]^r[c+40];for(let c=0;c<10;c+=2){const u=(c+8)%10,l=(c+2)%10,d=t[l],h=t[l+1],m=Eb(d,h,1)^t[u],y=vb(d,h,1)^t[u+1];for(let E=0;E<50;E+=10)r[c+E]^=m,r[c+E+1]^=y}let i=r[2],a=r[3];for(let c=0;c<24;c++){const u=yg[c],l=Eb(i,a,u),d=vb(i,a,u),h=xg[c];i=r[h],a=r[h+1],r[h]=l,r[h+1]=d}for(let c=0;c<50;c+=10){for(let u=0;u<10;u++)t[u]=r[c+u];for(let u=0;u<10;u++)r[c+u]^=~t[(u+2)%10]&t[(u+4)%10]}r[0]^=L7[n],r[1]^=M7[n]}t.fill(0)}class G0 extends L0{constructor(e,t,n,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,fr(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=ka(this.state)}keccak(){_7(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Bi(this);const{blockLen:t,state:n}=this;e=Ti(e);const i=e.length;for(let a=0;a<i;){const c=Math.min(t-this.pos,i-a);for(let u=0;u<c;u++)n[this.pos++]^=e[a++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:i}=this;e[n]^=t,(t&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Bi(this,!1),U0(e),this.finish();const t=this.state,{blockLen:n}=this;for(let i=0,a=e.length;i<a;){this.posOut>=n&&this.keccak();const c=Math.min(n-this.posOut,a-i);e.set(t.subarray(this.posOut,this.posOut+c),i),this.posOut+=c,i+=c}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return fr(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ig(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:i,rounds:a,enableXOF:c}=this;return e||(e=new G0(t,n,i,c,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=n,e.outputLen=i,e.enableXOF=c,e.destroyed=this.destroyed,e}}const V7=(r,e,t)=>mo(()=>new G0(e,r,t)),G7=V7(1,136,256/8);let wg=!1;const Ag=function(r){return G7(r)};let Eg=Ag;function bt(r){const e=ve(r,"data");return xe(Eg(e))}bt._=Ag;bt.lock=function(){wg=!0};bt.register=function(r){if(wg)throw new TypeError("keccak256 is locked");Eg=r};Object.freeze(bt);const j7=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),vg=Uint8Array.from({length:16},(r,e)=>e),z7=vg.map(r=>(9*r+5)%16);let j0=[vg],z0=[z7];for(let r=0;r<4;r++)for(let e of[j0,z0])e.push(e[r].map(t=>j7[t]));const Rg=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>new Uint8Array(r)),H7=j0.map((r,e)=>r.map(t=>Rg[e][t])),q7=z0.map((r,e)=>r.map(t=>Rg[e][t])),$7=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),K7=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Aa=(r,e)=>r<<e|r>>>32-e;function Rb(r,e,t,n){return r===0?e^t^n:r===1?e&t|~e&n:r===2?(e|~t)^n:r===3?e&n|t&~n:e^(t|~n)}const Ea=new Uint32Array(16);class W7 extends _0{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:n,h3:i,h4:a}=this;return[e,t,n,i,a]}set(e,t,n,i,a){this.h0=e|0,this.h1=t|0,this.h2=n|0,this.h3=i|0,this.h4=a|0}process(e,t){for(let E=0;E<16;E++,t+=4)Ea[E]=e.getUint32(t,!0);let n=this.h0|0,i=n,a=this.h1|0,c=a,u=this.h2|0,l=u,d=this.h3|0,h=d,m=this.h4|0,y=m;for(let E=0;E<5;E++){const O=4-E,R=$7[E],P=K7[E],v=j0[E],C=z0[E],N=H7[E],F=q7[E];for(let U=0;U<16;U++){const V=Aa(n+Rb(E,a,u,d)+Ea[v[U]]+R,N[U])+m|0;n=m,m=d,d=Aa(u,10)|0,u=a,a=V}for(let U=0;U<16;U++){const V=Aa(i+Rb(O,c,l,h)+Ea[C[U]]+P,F[U])+y|0;i=y,y=h,h=Aa(l,10)|0,l=c,c=V}}this.set(this.h1+u+h|0,this.h2+d+y|0,this.h3+m+i|0,this.h4+n+c|0,this.h0+a+l|0)}roundClean(){Ea.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const Q7=mo(()=>new W7);let Bg=!1;const Tg=function(r){return Q7(r)};let Sg=Tg;function Vi(r){const e=ve(r,"data");return xe(Sg(e))}Vi._=Tg;Vi.lock=function(){Bg=!0};Vi.register=function(r){if(Bg)throw new TypeError("ripemd160 is locked");Sg=r};Object.freeze(Vi);let Og=!1;const Ig=function(r,e,t,n,i){return C7(r,e,t,n,i)};let Cg=Ig;function Bn(r,e,t,n,i){const a=ve(r,"password"),c=ve(e,"salt");return xe(Cg(a,c,t,n,i))}Bn._=Ig;Bn.lock=function(){Og=!0};Bn.register=function(r){if(Og)throw new Error("pbkdf2 is locked");Cg=r};Object.freeze(Bn);let Pg=!1;const Ng=function(r){return new Uint8Array(P7(r))};let kg=Ng;function tn(r){return kg(r)}tn._=Ng;tn.lock=function(){Pg=!0};tn.register=function(r){if(Pg)throw new Error("randomBytes is locked");kg=r};Object.freeze(tn);const Qe=(r,e)=>r<<e|r>>>32-e;function Bb(r,e,t,n,i,a){let c=r[e++]^t[n++],u=r[e++]^t[n++],l=r[e++]^t[n++],d=r[e++]^t[n++],h=r[e++]^t[n++],m=r[e++]^t[n++],y=r[e++]^t[n++],E=r[e++]^t[n++],O=r[e++]^t[n++],R=r[e++]^t[n++],P=r[e++]^t[n++],v=r[e++]^t[n++],C=r[e++]^t[n++],N=r[e++]^t[n++],F=r[e++]^t[n++],U=r[e++]^t[n++],V=c,L=u,G=l,Q=d,re=h,de=m,z=y,we=E,Te=O,ae=R,be=P,Ee=v,Re=C,Oe=N,Ne=F,X=U;for(let ge=0;ge<8;ge+=2)re^=Qe(V+Re|0,7),Te^=Qe(re+V|0,9),Re^=Qe(Te+re|0,13),V^=Qe(Re+Te|0,18),ae^=Qe(de+L|0,7),Oe^=Qe(ae+de|0,9),L^=Qe(Oe+ae|0,13),de^=Qe(L+Oe|0,18),Ne^=Qe(be+z|0,7),G^=Qe(Ne+be|0,9),z^=Qe(G+Ne|0,13),be^=Qe(z+G|0,18),Q^=Qe(X+Ee|0,7),we^=Qe(Q+X|0,9),Ee^=Qe(we+Q|0,13),X^=Qe(Ee+we|0,18),L^=Qe(V+Q|0,7),G^=Qe(L+V|0,9),Q^=Qe(G+L|0,13),V^=Qe(Q+G|0,18),z^=Qe(de+re|0,7),we^=Qe(z+de|0,9),re^=Qe(we+z|0,13),de^=Qe(re+we|0,18),Ee^=Qe(be+ae|0,7),Te^=Qe(Ee+be|0,9),ae^=Qe(Te+Ee|0,13),be^=Qe(ae+Te|0,18),Re^=Qe(X+Ne|0,7),Oe^=Qe(Re+X|0,9),Ne^=Qe(Oe+Re|0,13),X^=Qe(Ne+Oe|0,18);i[a++]=c+V|0,i[a++]=u+L|0,i[a++]=l+G|0,i[a++]=d+Q|0,i[a++]=h+re|0,i[a++]=m+de|0,i[a++]=y+z|0,i[a++]=E+we|0,i[a++]=O+Te|0,i[a++]=R+ae|0,i[a++]=P+be|0,i[a++]=v+Ee|0,i[a++]=C+Re|0,i[a++]=N+Oe|0,i[a++]=F+Ne|0,i[a++]=U+X|0}function gi(r,e,t,n,i){let a=n+0,c=n+16*i;for(let u=0;u<16;u++)t[c+u]=r[e+(2*i-1)*16+u];for(let u=0;u<i;u++,a+=16,e+=16)Bb(t,c,r,e,t,a),u>0&&(c+=16),Bb(t,a,r,e+=16,t,c)}function Fg(r,e,t){const n=ag({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:i,r:a,p:c,dkLen:u,asyncTick:l,maxmem:d,onProgress:h}=n;if(fr(i),fr(a),fr(c),fr(u),fr(l),fr(d),h!==void 0&&typeof h!="function")throw new Error("progressCb should be function");const m=128*a,y=m/4;if(i<=1||(i&i-1)!==0||i>=2**(m/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(c<0||c>(2**32-1)*32/m)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(u<0||u>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const E=m*(i+c);if(E>d)throw new Error(`Scrypt: parameters too large, ${E} (128 * r * (N + p)) > ${d} (maxmem)`);const O=M0(Mi,r,e,{c:1,dkLen:m*c}),R=ka(O),P=ka(new Uint8Array(m*i)),v=ka(new Uint8Array(m));let C=()=>{};if(h){const N=2*i*c,F=Math.max(Math.floor(N/1e4),1);let U=0;C=()=>{U++,h&&(!(U%F)||U===N)&&h(U/N)}}return{N:i,r:a,p:c,dkLen:u,blockSize32:y,V:P,B32:R,B:O,tmp:v,blockMixCb:C,asyncTick:l}}function Dg(r,e,t,n,i){const a=M0(Mi,r,t,{c:1,dkLen:e});return t.fill(0),n.fill(0),i.fill(0),a}function J7(r,e,t){const{N:n,r:i,p:a,dkLen:c,blockSize32:u,V:l,B32:d,B:h,tmp:m,blockMixCb:y}=Fg(r,e,t);for(let E=0;E<a;E++){const O=u*E;for(let R=0;R<u;R++)l[R]=d[O+R];for(let R=0,P=0;R<n-1;R++)gi(l,P,l,P+=u,i),y();gi(l,(n-1)*u,d,O,i),y();for(let R=0;R<n;R++){const P=d[O+u-16]%n;for(let v=0;v<u;v++)m[v]=d[O+v]^l[P*u+v];gi(m,0,d,O,i),y()}}return Dg(r,c,h,l,m)}async function Y7(r,e,t){const{N:n,r:i,p:a,dkLen:c,blockSize32:u,V:l,B32:d,B:h,tmp:m,blockMixCb:y,asyncTick:E}=Fg(r,e,t);for(let O=0;O<a;O++){const R=u*O;for(let v=0;v<u;v++)l[v]=d[R+v];let P=0;await gb(n-1,E,()=>{gi(l,P,l,P+=u,i),y()}),gi(l,(n-1)*u,d,R,i),y(),await gb(n,E,()=>{const v=d[R+u-16]%n;for(let C=0;C<u;C++)m[C]=d[R+C]^l[v*u+C];gi(m,0,d,R,i),y()})}return Dg(r,c,h,l,m)}let Ug=!1,Lg=!1;const Mg=async function(r,e,t,n,i,a,c){return await Y7(r,e,{N:t,r:n,p:i,dkLen:a,onProgress:c})},_g=function(r,e,t,n,i,a){return J7(r,e,{N:t,r:n,p:i,dkLen:a})};let Vg=Mg,Gg=_g;async function Gi(r,e,t,n,i,a,c){const u=ve(r,"passwd"),l=ve(e,"salt");return xe(await Vg(u,l,t,n,i,a,c))}Gi._=Mg;Gi.lock=function(){Lg=!0};Gi.register=function(r){if(Lg)throw new Error("scrypt is locked");Vg=r};Object.freeze(Gi);function ji(r,e,t,n,i,a){const c=ve(r,"passwd"),u=ve(e,"salt");return xe(Gg(c,u,t,n,i,a))}ji._=_g;ji.lock=function(){Ug=!0};ji.register=function(r){if(Ug)throw new Error("scryptSync is locked");Gg=r};Object.freeze(ji);const jg=function(r){return O7("sha256").update(r).digest()};let zg=jg,Hg=!1;function Rr(r){const e=ve(r,"data");return xe(zg(e))}Rr._=jg;Rr.lock=function(){Hg=!0};Rr.register=function(r){if(Hg)throw new Error("sha256 is locked");zg=r};Object.freeze(Rr);Object.freeze(Rr);BigInt(0);const X7=BigInt(1),Z7=BigInt(2),xo=r=>r instanceof Uint8Array,eR=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function Si(r){if(!xo(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=eR[r[t]];return e}function H0(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}function Bs(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);const e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){const i=n*2,a=r.slice(i,i+2),c=Number.parseInt(a,16);if(Number.isNaN(c)||c<0)throw new Error("Invalid byte sequence");t[n]=c}return t}function Hn(r){return H0(Si(r))}function q0(r){if(!xo(r))throw new Error("Uint8Array expected");return H0(Si(Uint8Array.from(r).reverse()))}function Oi(r,e){return Bs(r.toString(16).padStart(e*2,"0"))}function $0(r,e){return Oi(r,e).reverse()}function Sr(r,e,t){let n;if(typeof e=="string")try{n=Bs(e)}catch(a){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${a}`)}else if(xo(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);const i=n.length;if(typeof t=="number"&&i!==t)throw new Error(`${r} expected ${t} bytes, got ${i}`);return n}function Ts(...r){const e=new Uint8Array(r.reduce((n,i)=>n+i.length,0));let t=0;return r.forEach(n=>{if(!xo(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}const K0=r=>(Z7<<BigInt(r-1))-X7,bf=r=>new Uint8Array(r),Tb=r=>Uint8Array.from(r);function qg(r,e,t){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=bf(r),i=bf(r),a=0;const c=()=>{n.fill(1),i.fill(0),a=0},u=(...m)=>t(i,n,...m),l=(m=bf())=>{i=u(Tb([0]),m),n=u(),m.length!==0&&(i=u(Tb([1]),m),n=u())},d=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let m=0;const y=[];for(;m<e;){n=u();const E=n.slice();y.push(E),m+=n.length}return Ts(...y)};return(m,y)=>{c(),l(m);let E;for(;!(E=y(d()));)l();return c(),E}}const tR={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function qs(r,e,t={}){const n=(i,a,c)=>{const u=tR[a];if(typeof u!="function")throw new Error(`Invalid validator "${a}", expected function`);const l=r[i];if(!(c&&l===void 0)&&!u(l,r))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${a}`)};for(const[i,a]of Object.entries(e))n(i,a,!1);for(const[i,a]of Object.entries(t))n(i,a,!0);return r}const rR=Object.freeze(Object.defineProperty({__proto__:null,bitMask:K0,bytesToHex:Si,bytesToNumberBE:Hn,bytesToNumberLE:q0,concatBytes:Ts,createHmacDrbg:qg,ensureBytes:Sr,hexToBytes:Bs,hexToNumber:H0,numberToBytesBE:Oi,numberToBytesLE:$0,validateObject:qs},Symbol.toStringTag,{value:"Module"}));const Mt=BigInt(0),Ot=BigInt(1),Ln=BigInt(2),nR=BigInt(3),Wf=BigInt(4),Sb=BigInt(5),Ob=BigInt(8);BigInt(9);BigInt(16);function ir(r,e){const t=r%e;return t>=Mt?t:e+t}function iR(r,e,t){if(t<=Mt||e<Mt)throw new Error("Expected power/modulo > 0");if(t===Ot)return Mt;let n=Ot;for(;e>Mt;)e&Ot&&(n=n*r%t),r=r*r%t,e>>=Ot;return n}function pr(r,e,t){let n=r;for(;e-- >Mt;)n*=n,n%=t;return n}function Qf(r,e){if(r===Mt||e<=Mt)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=ir(r,e),n=e,i=Mt,a=Ot;for(;t!==Mt;){const u=n/t,l=n%t,d=i-a*u;n=t,t=l,i=a,a=d}if(n!==Ot)throw new Error("invert: does not exist");return ir(i,e)}function sR(r){const e=(r-Ot)/Ln;let t,n,i;for(t=r-Ot,n=0;t%Ln===Mt;t/=Ln,n++);for(i=Ln;i<r&&iR(i,e,r)!==r-Ot;i++);if(n===1){const c=(r+Ot)/Wf;return function(l,d){const h=l.pow(d,c);if(!l.eql(l.sqr(h),d))throw new Error("Cannot find square root");return h}}const a=(t+Ot)/Ln;return function(u,l){if(u.pow(l,e)===u.neg(u.ONE))throw new Error("Cannot find square root");let d=n,h=u.pow(u.mul(u.ONE,i),t),m=u.pow(l,a),y=u.pow(l,t);for(;!u.eql(y,u.ONE);){if(u.eql(y,u.ZERO))return u.ZERO;let E=1;for(let R=u.sqr(y);E<d&&!u.eql(R,u.ONE);E++)R=u.sqr(R);const O=u.pow(h,Ot<<BigInt(d-E-1));h=u.sqr(O),m=u.mul(m,O),y=u.mul(y,h),d=E}return m}}function aR(r){if(r%Wf===nR){const e=(r+Ot)/Wf;return function(n,i){const a=n.pow(i,e);if(!n.eql(n.sqr(a),i))throw new Error("Cannot find square root");return a}}if(r%Ob===Sb){const e=(r-Sb)/Ob;return function(n,i){const a=n.mul(i,Ln),c=n.pow(a,e),u=n.mul(i,c),l=n.mul(n.mul(u,Ln),c),d=n.mul(u,n.sub(l,n.ONE));if(!n.eql(n.sqr(d),i))throw new Error("Cannot find square root");return d}}return sR(r)}const oR=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function cR(r){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=oR.reduce((n,i)=>(n[i]="function",n),e);return qs(r,t)}function uR(r,e,t){if(t<Mt)throw new Error("Expected power > 0");if(t===Mt)return r.ONE;if(t===Ot)return e;let n=r.ONE,i=e;for(;t>Mt;)t&Ot&&(n=r.mul(n,i)),i=r.sqr(i),t>>=Ot;return n}function lR(r,e){const t=new Array(e.length),n=e.reduce((a,c,u)=>r.is0(c)?a:(t[u]=a,r.mul(a,c)),r.ONE),i=r.inv(n);return e.reduceRight((a,c,u)=>r.is0(c)?a:(t[u]=r.mul(a,t[u]),r.mul(a,c)),i),t}function $g(r,e){const t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function fR(r,e,t=!1,n={}){if(r<=Mt)throw new Error(`Expected Field ORDER > 0, got ${r}`);const{nBitLength:i,nByteLength:a}=$g(r,e);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const c=aR(r),u=Object.freeze({ORDER:r,BITS:i,BYTES:a,MASK:K0(i),ZERO:Mt,ONE:Ot,create:l=>ir(l,r),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return Mt<=l&&l<r},is0:l=>l===Mt,isOdd:l=>(l&Ot)===Ot,neg:l=>ir(-l,r),eql:(l,d)=>l===d,sqr:l=>ir(l*l,r),add:(l,d)=>ir(l+d,r),sub:(l,d)=>ir(l-d,r),mul:(l,d)=>ir(l*d,r),pow:(l,d)=>uR(u,l,d),div:(l,d)=>ir(l*Qf(d,r),r),sqrN:l=>l*l,addN:(l,d)=>l+d,subN:(l,d)=>l-d,mulN:(l,d)=>l*d,inv:l=>Qf(l,r),sqrt:n.sqrt||(l=>c(u,l)),invertBatch:l=>lR(u,l),cmov:(l,d,h)=>h?d:l,toBytes:l=>t?$0(l,a):Oi(l,a),fromBytes:l=>{if(l.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${l.length}`);return t?q0(l):Hn(l)}});return Object.freeze(u)}function Kg(r){if(typeof r!="bigint")throw new Error("field order must be bigint");const e=r.toString(2).length;return Math.ceil(e/8)}function Wg(r){const e=Kg(r);return e+Math.ceil(e/2)}function hR(r,e,t=!1){const n=r.length,i=Kg(e),a=Wg(e);if(n<16||n<a||n>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${n}`);const c=t?Hn(r):q0(r),u=ir(c,e-Ot)+Ot;return t?$0(u,i):Oi(u,i)}const dR=BigInt(0),xf=BigInt(1);function pR(r,e){const t=(i,a)=>{const c=a.negate();return i?c:a},n=i=>{const a=Math.ceil(e/i)+1,c=2**(i-1);return{windows:a,windowSize:c}};return{constTimeNegate:t,unsafeLadder(i,a){let c=r.ZERO,u=i;for(;a>dR;)a&xf&&(c=c.add(u)),u=u.double(),a>>=xf;return c},precomputeWindow(i,a){const{windows:c,windowSize:u}=n(a),l=[];let d=i,h=d;for(let m=0;m<c;m++){h=d,l.push(h);for(let y=1;y<u;y++)h=h.add(d),l.push(h);d=h.double()}return l},wNAF(i,a,c){const{windows:u,windowSize:l}=n(i);let d=r.ZERO,h=r.BASE;const m=BigInt(2**i-1),y=2**i,E=BigInt(i);for(let O=0;O<u;O++){const R=O*l;let P=Number(c&m);c>>=E,P>l&&(P-=y,c+=xf);const v=R,C=R+Math.abs(P)-1,N=O%2!==0,F=P<0;P===0?h=h.add(t(N,a[v])):d=d.add(t(F,a[C]))}return{p:d,f:h}},wNAFCached(i,a,c,u){const l=i._WINDOW_SIZE||1;let d=a.get(i);return d||(d=this.precomputeWindow(i,l),l!==1&&a.set(i,u(d))),this.wNAF(l,d,c)}}}function Qg(r){return cR(r.Fp),qs(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...$g(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}function mR(r){const e=Qg(r);qs(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:n,a:i}=e;if(t){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:bR,hexToBytes:xR}=rR,_n={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){const{Err:e}=_n;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");const t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:bR(n),l:r.subarray(t+2)}},toSig(r){const{Err:e}=_n,t=typeof r=="string"?xR(r):r;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:a}=_n._parseInt(t.subarray(2)),{d:c,l:u}=_n._parseInt(a);if(u.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:c}},hexFromSig(r){const e=d=>Number.parseInt(d[0],16)&8?"00"+d:d,t=d=>{const h=d.toString(16);return h.length&1?`0${h}`:h},n=e(t(r.s)),i=e(t(r.r)),a=n.length/2,c=i.length/2,u=t(a),l=t(c);return`30${t(c+a+4)}02${l}${i}02${u}${n}`}},Xr=BigInt(0),wr=BigInt(1);BigInt(2);const Ib=BigInt(3);BigInt(4);function yR(r){const e=mR(r),{Fp:t}=e,n=e.toBytes||((O,R,P)=>{const v=R.toAffine();return Ts(Uint8Array.from([4]),t.toBytes(v.x),t.toBytes(v.y))}),i=e.fromBytes||(O=>{const R=O.subarray(1),P=t.fromBytes(R.subarray(0,t.BYTES)),v=t.fromBytes(R.subarray(t.BYTES,2*t.BYTES));return{x:P,y:v}});function a(O){const{a:R,b:P}=e,v=t.sqr(O),C=t.mul(v,O);return t.add(t.add(C,t.mul(O,R)),P)}if(!t.eql(t.sqr(e.Gy),a(e.Gx)))throw new Error("bad generator point: equation left != right");function c(O){return typeof O=="bigint"&&Xr<O&&O<e.n}function u(O){if(!c(O))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(O){const{allowedPrivateKeyLengths:R,nByteLength:P,wrapPrivateKey:v,n:C}=e;if(R&&typeof O!="bigint"){if(O instanceof Uint8Array&&(O=Si(O)),typeof O!="string"||!R.includes(O.length))throw new Error("Invalid key");O=O.padStart(P*2,"0")}let N;try{N=typeof O=="bigint"?O:Hn(Sr("private key",O,P))}catch{throw new Error(`private key must be ${P} bytes, hex or bigint, not ${typeof O}`)}return v&&(N=ir(N,C)),u(N),N}const d=new Map;function h(O){if(!(O instanceof m))throw new Error("ProjectivePoint expected")}class m{constructor(R,P,v){if(this.px=R,this.py=P,this.pz=v,R==null||!t.isValid(R))throw new Error("x required");if(P==null||!t.isValid(P))throw new Error("y required");if(v==null||!t.isValid(v))throw new Error("z required")}static fromAffine(R){const{x:P,y:v}=R||{};if(!R||!t.isValid(P)||!t.isValid(v))throw new Error("invalid affine point");if(R instanceof m)throw new Error("projective point not allowed");const C=N=>t.eql(N,t.ZERO);return C(P)&&C(v)?m.ZERO:new m(P,v,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(R){const P=t.invertBatch(R.map(v=>v.pz));return R.map((v,C)=>v.toAffine(P[C])).map(m.fromAffine)}static fromHex(R){const P=m.fromAffine(i(Sr("pointHex",R)));return P.assertValidity(),P}static fromPrivateKey(R){return m.BASE.multiply(l(R))}_setWindowSize(R){this._WINDOW_SIZE=R,d.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:R,y:P}=this.toAffine();if(!t.isValid(R)||!t.isValid(P))throw new Error("bad point: x or y not FE");const v=t.sqr(P),C=a(R);if(!t.eql(v,C))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:R}=this.toAffine();if(t.isOdd)return!t.isOdd(R);throw new Error("Field doesn't support isOdd")}equals(R){h(R);const{px:P,py:v,pz:C}=this,{px:N,py:F,pz:U}=R,V=t.eql(t.mul(P,U),t.mul(N,C)),L=t.eql(t.mul(v,U),t.mul(F,C));return V&&L}negate(){return new m(this.px,t.neg(this.py),this.pz)}double(){const{a:R,b:P}=e,v=t.mul(P,Ib),{px:C,py:N,pz:F}=this;let U=t.ZERO,V=t.ZERO,L=t.ZERO,G=t.mul(C,C),Q=t.mul(N,N),re=t.mul(F,F),de=t.mul(C,N);return de=t.add(de,de),L=t.mul(C,F),L=t.add(L,L),U=t.mul(R,L),V=t.mul(v,re),V=t.add(U,V),U=t.sub(Q,V),V=t.add(Q,V),V=t.mul(U,V),U=t.mul(de,U),L=t.mul(v,L),re=t.mul(R,re),de=t.sub(G,re),de=t.mul(R,de),de=t.add(de,L),L=t.add(G,G),G=t.add(L,G),G=t.add(G,re),G=t.mul(G,de),V=t.add(V,G),re=t.mul(N,F),re=t.add(re,re),G=t.mul(re,de),U=t.sub(U,G),L=t.mul(re,Q),L=t.add(L,L),L=t.add(L,L),new m(U,V,L)}add(R){h(R);const{px:P,py:v,pz:C}=this,{px:N,py:F,pz:U}=R;let V=t.ZERO,L=t.ZERO,G=t.ZERO;const Q=e.a,re=t.mul(e.b,Ib);let de=t.mul(P,N),z=t.mul(v,F),we=t.mul(C,U),Te=t.add(P,v),ae=t.add(N,F);Te=t.mul(Te,ae),ae=t.add(de,z),Te=t.sub(Te,ae),ae=t.add(P,C);let be=t.add(N,U);return ae=t.mul(ae,be),be=t.add(de,we),ae=t.sub(ae,be),be=t.add(v,C),V=t.add(F,U),be=t.mul(be,V),V=t.add(z,we),be=t.sub(be,V),G=t.mul(Q,ae),V=t.mul(re,we),G=t.add(V,G),V=t.sub(z,G),G=t.add(z,G),L=t.mul(V,G),z=t.add(de,de),z=t.add(z,de),we=t.mul(Q,we),ae=t.mul(re,ae),z=t.add(z,we),we=t.sub(de,we),we=t.mul(Q,we),ae=t.add(ae,we),de=t.mul(z,ae),L=t.add(L,de),de=t.mul(be,ae),V=t.mul(Te,V),V=t.sub(V,de),de=t.mul(Te,z),G=t.mul(be,G),G=t.add(G,de),new m(V,L,G)}subtract(R){return this.add(R.negate())}is0(){return this.equals(m.ZERO)}wNAF(R){return E.wNAFCached(this,d,R,P=>{const v=t.invertBatch(P.map(C=>C.pz));return P.map((C,N)=>C.toAffine(v[N])).map(m.fromAffine)})}multiplyUnsafe(R){const P=m.ZERO;if(R===Xr)return P;if(u(R),R===wr)return this;const{endo:v}=e;if(!v)return E.unsafeLadder(this,R);let{k1neg:C,k1:N,k2neg:F,k2:U}=v.splitScalar(R),V=P,L=P,G=this;for(;N>Xr||U>Xr;)N&wr&&(V=V.add(G)),U&wr&&(L=L.add(G)),G=G.double(),N>>=wr,U>>=wr;return C&&(V=V.negate()),F&&(L=L.negate()),L=new m(t.mul(L.px,v.beta),L.py,L.pz),V.add(L)}multiply(R){u(R);let P=R,v,C;const{endo:N}=e;if(N){const{k1neg:F,k1:U,k2neg:V,k2:L}=N.splitScalar(P);let{p:G,f:Q}=this.wNAF(U),{p:re,f:de}=this.wNAF(L);G=E.constTimeNegate(F,G),re=E.constTimeNegate(V,re),re=new m(t.mul(re.px,N.beta),re.py,re.pz),v=G.add(re),C=Q.add(de)}else{const{p:F,f:U}=this.wNAF(P);v=F,C=U}return m.normalizeZ([v,C])[0]}multiplyAndAddUnsafe(R,P,v){const C=m.BASE,N=(U,V)=>V===Xr||V===wr||!U.equals(C)?U.multiplyUnsafe(V):U.multiply(V),F=N(this,P).add(N(R,v));return F.is0()?void 0:F}toAffine(R){const{px:P,py:v,pz:C}=this,N=this.is0();R==null&&(R=N?t.ONE:t.inv(C));const F=t.mul(P,R),U=t.mul(v,R),V=t.mul(C,R);if(N)return{x:t.ZERO,y:t.ZERO};if(!t.eql(V,t.ONE))throw new Error("invZ was invalid");return{x:F,y:U}}isTorsionFree(){const{h:R,isTorsionFree:P}=e;if(R===wr)return!0;if(P)return P(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:R,clearCofactor:P}=e;return R===wr?this:P?P(m,this):this.multiplyUnsafe(e.h)}toRawBytes(R=!0){return this.assertValidity(),n(m,this,R)}toHex(R=!0){return Si(this.toRawBytes(R))}}m.BASE=new m(e.Gx,e.Gy,t.ONE),m.ZERO=new m(t.ZERO,t.ONE,t.ZERO);const y=e.nBitLength,E=pR(m,e.endo?Math.ceil(y/2):y);return{CURVE:e,ProjectivePoint:m,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:c}}function gR(r){const e=Qg(r);return qs(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function wR(r){const e=gR(r),{Fp:t,n}=e,i=t.BYTES+1,a=2*t.BYTES+1;function c(ae){return Xr<ae&&ae<t.ORDER}function u(ae){return ir(ae,n)}function l(ae){return Qf(ae,n)}const{ProjectivePoint:d,normPrivateKeyToScalar:h,weierstrassEquation:m,isWithinCurveOrder:y}=yR({...e,toBytes(ae,be,Ee){const Re=be.toAffine(),Oe=t.toBytes(Re.x),Ne=Ts;return Ee?Ne(Uint8Array.from([be.hasEvenY()?2:3]),Oe):Ne(Uint8Array.from([4]),Oe,t.toBytes(Re.y))},fromBytes(ae){const be=ae.length,Ee=ae[0],Re=ae.subarray(1);if(be===i&&(Ee===2||Ee===3)){const Oe=Hn(Re);if(!c(Oe))throw new Error("Point is not on curve");const Ne=m(Oe);let X=t.sqrt(Ne);const ge=(X&wr)===wr;return(Ee&1)===1!==ge&&(X=t.neg(X)),{x:Oe,y:X}}else if(be===a&&Ee===4){const Oe=t.fromBytes(Re.subarray(0,t.BYTES)),Ne=t.fromBytes(Re.subarray(t.BYTES,2*t.BYTES));return{x:Oe,y:Ne}}else throw new Error(`Point of length ${be} was invalid. Expected ${i} compressed bytes or ${a} uncompressed bytes`)}}),E=ae=>Si(Oi(ae,e.nByteLength));function O(ae){const be=n>>wr;return ae>be}function R(ae){return O(ae)?u(-ae):ae}const P=(ae,be,Ee)=>Hn(ae.slice(be,Ee));class v{constructor(be,Ee,Re){this.r=be,this.s=Ee,this.recovery=Re,this.assertValidity()}static fromCompact(be){const Ee=e.nByteLength;return be=Sr("compactSignature",be,Ee*2),new v(P(be,0,Ee),P(be,Ee,2*Ee))}static fromDER(be){const{r:Ee,s:Re}=_n.toSig(Sr("DER",be));return new v(Ee,Re)}assertValidity(){if(!y(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!y(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(be){return new v(this.r,this.s,be)}recoverPublicKey(be){const{r:Ee,s:Re,recovery:Oe}=this,Ne=L(Sr("msgHash",be));if(Oe==null||![0,1,2,3].includes(Oe))throw new Error("recovery id invalid");const X=Oe===2||Oe===3?Ee+e.n:Ee;if(X>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const ge=(Oe&1)===0?"02":"03",q=d.fromHex(ge+E(X)),Y=l(X),ee=u(-Ne*Y),H=u(Re*Y),$=d.BASE.multiplyAndAddUnsafe(q,ee,H);if(!$)throw new Error("point at infinify");return $.assertValidity(),$}hasHighS(){return O(this.s)}normalizeS(){return this.hasHighS()?new v(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return Bs(this.toDERHex())}toDERHex(){return _n.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Bs(this.toCompactHex())}toCompactHex(){return E(this.r)+E(this.s)}}const C={isValidPrivateKey(ae){try{return h(ae),!0}catch{return!1}},normPrivateKeyToScalar:h,randomPrivateKey:()=>{const ae=Wg(e.n);return hR(e.randomBytes(ae),e.n)},precompute(ae=8,be=d.BASE){return be._setWindowSize(ae),be.multiply(BigInt(3)),be}};function N(ae,be=!0){return d.fromPrivateKey(ae).toRawBytes(be)}function F(ae){const be=ae instanceof Uint8Array,Ee=typeof ae=="string",Re=(be||Ee)&&ae.length;return be?Re===i||Re===a:Ee?Re===2*i||Re===2*a:ae instanceof d}function U(ae,be,Ee=!0){if(F(ae))throw new Error("first arg must be private key");if(!F(be))throw new Error("second arg must be public key");return d.fromHex(be).multiply(h(ae)).toRawBytes(Ee)}const V=e.bits2int||function(ae){const be=Hn(ae),Ee=ae.length*8-e.nBitLength;return Ee>0?be>>BigInt(Ee):be},L=e.bits2int_modN||function(ae){return u(V(ae))},G=K0(e.nBitLength);function Q(ae){if(typeof ae!="bigint")throw new Error("bigint expected");if(!(Xr<=ae&&ae<G))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Oi(ae,e.nByteLength)}function re(ae,be,Ee=de){if(["recovered","canonical"].some(he=>he in Ee))throw new Error("sign() legacy options not supported");const{hash:Re,randomBytes:Oe}=e;let{lowS:Ne,prehash:X,extraEntropy:ge}=Ee;Ne==null&&(Ne=!0),ae=Sr("msgHash",ae),X&&(ae=Sr("prehashed msgHash",Re(ae)));const q=L(ae),Y=h(be),ee=[Q(Y),Q(q)];if(ge!=null){const he=ge===!0?Oe(t.BYTES):ge;ee.push(Sr("extraEntropy",he))}const H=Ts(...ee),$=q;function ie(he){const pe=V(he);if(!y(pe))return;const k=l(pe),D=d.BASE.multiply(pe).toAffine(),ne=u(D.x);if(ne===Xr)return;const ye=u(k*u($+ne*Y));if(ye===Xr)return;let Fe=(D.x===ne?0:2)|Number(D.y&wr),Be=ye;return Ne&&O(ye)&&(Be=R(ye),Fe^=1),new v(ne,Be,Fe)}return{seed:H,k2sig:ie}}const de={lowS:e.lowS,prehash:!1},z={lowS:e.lowS,prehash:!1};function we(ae,be,Ee=de){const{seed:Re,k2sig:Oe}=re(ae,be,Ee),Ne=e;return qg(Ne.hash.outputLen,Ne.nByteLength,Ne.hmac)(Re,Oe)}d.BASE._setWindowSize(8);function Te(ae,be,Ee,Re=z){const Oe=ae;if(be=Sr("msgHash",be),Ee=Sr("publicKey",Ee),"strict"in Re)throw new Error("options.strict was renamed to lowS");const{lowS:Ne,prehash:X}=Re;let ge,q;try{if(typeof Oe=="string"||Oe instanceof Uint8Array)try{ge=v.fromDER(Oe)}catch(D){if(!(D instanceof _n.Err))throw D;ge=v.fromCompact(Oe)}else if(typeof Oe=="object"&&typeof Oe.r=="bigint"&&typeof Oe.s=="bigint"){const{r:D,s:ne}=Oe;ge=new v(D,ne)}else throw new Error("PARSE");q=d.fromHex(Ee)}catch(D){if(D.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Ne&&ge.hasHighS())return!1;X&&(be=e.hash(be));const{r:Y,s:ee}=ge,H=L(be),$=l(ee),ie=u(H*$),he=u(Y*$),pe=d.BASE.multiplyAndAddUnsafe(q,ie,he)?.toAffine();return pe?u(pe.x)===Y:!1}return{CURVE:e,getPublicKey:N,getSharedSecret:U,sign:we,verify:Te,ProjectivePoint:d,Signature:v,utils:C}}function AR(r){return{hash:r,hmac:(e,...t)=>bo(r,e,X5(...t)),randomBytes:e7}}function ER(r,e){const t=n=>wR({...r,...AR(n)});return Object.freeze({...t(e),create:t})}const Jg=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Cb=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),vR=BigInt(1),Jf=BigInt(2),Pb=(r,e)=>(r+e/Jf)/e;function RR(r){const e=Jg,t=BigInt(3),n=BigInt(6),i=BigInt(11),a=BigInt(22),c=BigInt(23),u=BigInt(44),l=BigInt(88),d=r*r*r%e,h=d*d*r%e,m=pr(h,t,e)*h%e,y=pr(m,t,e)*h%e,E=pr(y,Jf,e)*d%e,O=pr(E,i,e)*E%e,R=pr(O,a,e)*O%e,P=pr(R,u,e)*R%e,v=pr(P,l,e)*P%e,C=pr(v,u,e)*R%e,N=pr(C,t,e)*h%e,F=pr(N,c,e)*O%e,U=pr(F,n,e)*d%e,V=pr(U,Jf,e);if(!Yf.eql(Yf.sqr(V),r))throw new Error("Cannot find square root");return V}const Yf=fR(Jg,void 0,void 0,{sqrt:RR}),xn=ER({a:BigInt(0),b:BigInt(7),Fp:Yf,n:Cb,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{const e=Cb,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-vR*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=t,c=BigInt("0x100000000000000000000000000000000"),u=Pb(a*r,e),l=Pb(-n*r,e);let d=ir(r-u*t-l*i,e),h=ir(-u*n-l*a,e);const m=d>c,y=h>c;if(m&&(d=e-d),y&&(h=e-h),d>c||h>c)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:m,k1:d,k2neg:y,k2:h}}}},Mi);BigInt(0);xn.ProjectivePoint;const Ss="0x0000000000000000000000000000000000000000",Nb="0x0000000000000000000000000000000000000000000000000000000000000000",BR=`Ethereum Signed Message:
|
|
23
|
-
`,kb=BigInt(0),Fb=BigInt(1),Xf=BigInt(2),Db=BigInt(27),Ub=BigInt(28),va=BigInt(35),Yg=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),TR=Yg/Xf,SR=Symbol.for("nodejs.util.inspect.custom"),Nn={};function yf(r){return nn(At(r),32)}class gt{#e;#t;#r;#n;get r(){return this.#e}set r(e){j(yi(e)===32,"invalid r","value",e),this.#e=xe(e)}get s(){return j(parseInt(this.#t.substring(0,3))<8,"non-canonical s; use ._s","s",this.#t),this.#t}set s(e){j(yi(e)===32,"invalid s","value",e),this.#t=xe(e)}get _s(){return this.#t}isValid(){return BigInt(this.#t)<=TR}get v(){return this.#r}set v(e){const t=Le(e,"value");j(t===27||t===28,"invalid v","v",e),this.#r=t}get networkV(){return this.#n}get legacyChainId(){const e=this.networkV;return e==null?null:gt.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=ve(this.s);return this.yParity&&(e[0]|=128),xe(e)}get compactSerialized(){return Ye([this.r,this.yParityAndS])}get serialized(){return Ye([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,n,i){Xn(e,Nn,"Signature"),this.#e=t,this.#t=n,this.#r=i,this.#n=null}getCanonical(){if(this.isValid())return this;const e=Yg-BigInt(this._s),t=55-this.v,n=new gt(Nn,this.r,yf(e),t);return this.networkV&&(n.#n=this.networkV),n}clone(){const e=new gt(Nn,this.r,this._s,this.v);return this.networkV&&(e.#n=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this._s,v:this.v}}[SR](){return this.toString()}toString(){return this.isValid()?`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`:`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(e){const t=Se(e,"v");return t==Db||t==Ub?kb:(j(t>=va,"invalid EIP-155 v","v",e),(t-va)/Xf)}static getChainIdV(e,t){return Se(e)*Xf+BigInt(35+t-27)}static getNormalizedV(e){const t=Se(e);return t===kb||t===Db?27:t===Fb||t===Ub?28:(j(t>=va,"invalid v","v",e),t&Fb?27:28)}static from(e){function t(d,h){j(d,h,"signature",e)}if(e==null)return new gt(Nn,Nb,Nb,27);if(typeof e=="string"){const d=ve(e,"signature");if(d.length===64){const h=xe(d.slice(0,32)),m=d.slice(32,64),y=m[0]&128?28:27;return m[0]&=127,new gt(Nn,h,xe(m),y)}if(d.length===65){const h=xe(d.slice(0,32)),m=xe(d.slice(32,64)),y=gt.getNormalizedV(d[64]);return new gt(Nn,h,m,y)}t(!1,"invalid raw signature length")}if(e instanceof gt)return e.clone();const n=e.r;t(n!=null,"missing r");const i=yf(n),a=(function(d,h){if(d!=null)return yf(d);if(h!=null){t(ht(h,32),"invalid yParityAndS");const m=ve(h);return m[0]&=127,xe(m)}t(!1,"missing s")})(e.s,e.yParityAndS),{networkV:c,v:u}=(function(d,h,m){if(d!=null){const y=Se(d);return{networkV:y>=va?y:void 0,v:gt.getNormalizedV(y)}}if(h!=null)return t(ht(h,32),"invalid yParityAndS"),{v:ve(h)[0]&128?28:27};if(m!=null){switch(Le(m,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")})(e.v,e.yParityAndS,e.yParity),l=new gt(Nn,i,a,u);return c&&(l.#n=c),t(e.yParity==null||Le(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}}class ar{#e;constructor(e){j(yi(e)===32,"invalid private key","privateKey","[REDACTED]"),this.#e=xe(e)}get privateKey(){return this.#e}get publicKey(){return ar.computePublicKey(this.#e)}get compressedPublicKey(){return ar.computePublicKey(this.#e,!0)}sign(e){j(yi(e)===32,"invalid digest length","digest",e);const t=xn.sign(Ht(e),Ht(this.#e),{lowS:!0});return gt.from({r:sn(t.r,32),s:sn(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=ar.computePublicKey(e);return xe(xn.getSharedSecret(Ht(this.#e),ve(t),!1))}static computePublicKey(e,t){let n=ve(e,"key");if(n.length===32){const a=xn.getPublicKey(n,!!t);return xe(a)}if(n.length===64){const a=new Uint8Array(65);a[0]=4,a.set(n,1),n=a}const i=xn.ProjectivePoint.fromHex(n);return xe(i.toRawBytes(t))}static recoverPublicKey(e,t){j(yi(e)===32,"invalid digest length","digest",e);const n=gt.from(t);let i=xn.Signature.fromCompact(Ht(Ye([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const a=i.recoverPublicKey(Ht(e));return j(a!=null,"invalid signature for digest","signature",t),"0x"+a.toHex(!1)}static addPoints(e,t,n){const i=xn.ProjectivePoint.fromHex(ar.computePublicKey(e).substring(2)),a=xn.ProjectivePoint.fromHex(ar.computePublicKey(t).substring(2));return"0x"+i.add(a).toHex(!!n)}}const OR=BigInt(0),IR=BigInt(36);function Lb(r){r=r.toLowerCase();const e=r.substring(2).split(""),t=new Uint8Array(40);for(let i=0;i<40;i++)t[i]=e[i].charCodeAt(0);const n=ve(bt(t));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const W0={};for(let r=0;r<10;r++)W0[String(r)]=String(r);for(let r=0;r<26;r++)W0[String.fromCharCode(65+r)]=String(10+r);const Mb=15;function CR(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>W0[n]).join("");for(;e.length>=Mb;){let n=e.substring(0,Mb);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}const PR=(function(){const r={};for(let e=0;e<36;e++){const t="0123456789abcdefghijklmnopqrstuvwxyz"[e];r[t]=BigInt(e)}return r})();function NR(r){r=r.toLowerCase();let e=OR;for(let t=0;t<r.length;t++)e=e*IR+PR[r[t]];return e}function $e(r){if(j(typeof r=="string","invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/)){r.startsWith("0x")||(r="0x"+r);const e=Lb(r);return j(!r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===r,"bad address checksum","address",r),e}if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){j(r.substring(2,4)===CR(r),"bad icap checksum","address",r);let e=NR(r.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return Lb("0x"+e)}j(!1,"invalid address","address",r)}function kR(r){const e=$e(r.from);let n=Se(r.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,$e(pt(bt(qr([e,n])),12))}function Xg(r){return r&&typeof r.getAddress=="function"}async function gf(r,e){const t=await e;return(t==null||t==="0x0000000000000000000000000000000000000000")&&(fe(typeof r!="string","unconfigured name","UNCONFIGURED_NAME",{value:r}),j(!1,"invalid AddressLike value; did not resolve to a value address","target",r)),$e(t)}function _t(r,e){if(typeof r=="string")return r.match(/^0x[0-9a-f]{40}$/i)?$e(r):(fe(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),gf(r,e.resolveName(r)));if(Xg(r))return gf(r,r.getAddress());if(r&&typeof r.then=="function")return gf(r,r);j(!1,"unsupported addressable value","target",r)}const Wr={};function Ie(r,e){let t=!1;return e<0&&(t=!0,e*=-1),new Rt(Wr,`${t?"":"u"}int${e}`,r,{signed:t,width:e})}function Je(r,e){return new Rt(Wr,`bytes${e||""}`,r,{size:e})}const _b=Symbol.for("_ethers_typed");class Rt{type;value;#e;_typedSymbol;constructor(e,t,n,i){i==null&&(i=null),Xn(Wr,e,"Typed"),Pe(this,{_typedSymbol:_b,type:t,value:n}),this.#e=i,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#e}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#e===!0?-1:this.#e===!1?this.value.length:null}static from(e,t){return new Rt(Wr,e,t)}static uint8(e){return Ie(e,8)}static uint16(e){return Ie(e,16)}static uint24(e){return Ie(e,24)}static uint32(e){return Ie(e,32)}static uint40(e){return Ie(e,40)}static uint48(e){return Ie(e,48)}static uint56(e){return Ie(e,56)}static uint64(e){return Ie(e,64)}static uint72(e){return Ie(e,72)}static uint80(e){return Ie(e,80)}static uint88(e){return Ie(e,88)}static uint96(e){return Ie(e,96)}static uint104(e){return Ie(e,104)}static uint112(e){return Ie(e,112)}static uint120(e){return Ie(e,120)}static uint128(e){return Ie(e,128)}static uint136(e){return Ie(e,136)}static uint144(e){return Ie(e,144)}static uint152(e){return Ie(e,152)}static uint160(e){return Ie(e,160)}static uint168(e){return Ie(e,168)}static uint176(e){return Ie(e,176)}static uint184(e){return Ie(e,184)}static uint192(e){return Ie(e,192)}static uint200(e){return Ie(e,200)}static uint208(e){return Ie(e,208)}static uint216(e){return Ie(e,216)}static uint224(e){return Ie(e,224)}static uint232(e){return Ie(e,232)}static uint240(e){return Ie(e,240)}static uint248(e){return Ie(e,248)}static uint256(e){return Ie(e,256)}static uint(e){return Ie(e,256)}static int8(e){return Ie(e,-8)}static int16(e){return Ie(e,-16)}static int24(e){return Ie(e,-24)}static int32(e){return Ie(e,-32)}static int40(e){return Ie(e,-40)}static int48(e){return Ie(e,-48)}static int56(e){return Ie(e,-56)}static int64(e){return Ie(e,-64)}static int72(e){return Ie(e,-72)}static int80(e){return Ie(e,-80)}static int88(e){return Ie(e,-88)}static int96(e){return Ie(e,-96)}static int104(e){return Ie(e,-104)}static int112(e){return Ie(e,-112)}static int120(e){return Ie(e,-120)}static int128(e){return Ie(e,-128)}static int136(e){return Ie(e,-136)}static int144(e){return Ie(e,-144)}static int152(e){return Ie(e,-152)}static int160(e){return Ie(e,-160)}static int168(e){return Ie(e,-168)}static int176(e){return Ie(e,-176)}static int184(e){return Ie(e,-184)}static int192(e){return Ie(e,-192)}static int200(e){return Ie(e,-200)}static int208(e){return Ie(e,-208)}static int216(e){return Ie(e,-216)}static int224(e){return Ie(e,-224)}static int232(e){return Ie(e,-232)}static int240(e){return Ie(e,-240)}static int248(e){return Ie(e,-248)}static int256(e){return Ie(e,-256)}static int(e){return Ie(e,-256)}static bytes1(e){return Je(e,1)}static bytes2(e){return Je(e,2)}static bytes3(e){return Je(e,3)}static bytes4(e){return Je(e,4)}static bytes5(e){return Je(e,5)}static bytes6(e){return Je(e,6)}static bytes7(e){return Je(e,7)}static bytes8(e){return Je(e,8)}static bytes9(e){return Je(e,9)}static bytes10(e){return Je(e,10)}static bytes11(e){return Je(e,11)}static bytes12(e){return Je(e,12)}static bytes13(e){return Je(e,13)}static bytes14(e){return Je(e,14)}static bytes15(e){return Je(e,15)}static bytes16(e){return Je(e,16)}static bytes17(e){return Je(e,17)}static bytes18(e){return Je(e,18)}static bytes19(e){return Je(e,19)}static bytes20(e){return Je(e,20)}static bytes21(e){return Je(e,21)}static bytes22(e){return Je(e,22)}static bytes23(e){return Je(e,23)}static bytes24(e){return Je(e,24)}static bytes25(e){return Je(e,25)}static bytes26(e){return Je(e,26)}static bytes27(e){return Je(e,27)}static bytes28(e){return Je(e,28)}static bytes29(e){return Je(e,29)}static bytes30(e){return Je(e,30)}static bytes31(e){return Je(e,31)}static bytes32(e){return Je(e,32)}static address(e){return new Rt(Wr,"address",e)}static bool(e){return new Rt(Wr,"bool",!!e)}static bytes(e){return new Rt(Wr,"bytes",e)}static string(e){return new Rt(Wr,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new Rt(Wr,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===_b}static dereference(e,t){if(Rt.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}}class FR extends cn{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=Rt.dereference(t,"string");try{n=$e(n)}catch(i){return this._throwError(i.message,t)}return e.writeValue(n)}decode(e){return $e(sn(e.readValue(),20))}}class DR extends cn{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}function Zg(r,e,t){let n=[];if(Array.isArray(t))n=t;else if(t&&typeof t=="object"){let l={};n=e.map(d=>{const h=d.localName;return fe(h,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:d},value:t}),fe(!l[h],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:d},value:t}),l[h]=!0,t[h]})}else j(!1,"invalid tuple value","tuple",t);j(e.length===n.length,"types/value length mismatch","tuple",t);let i=new $f,a=new $f,c=[];e.forEach((l,d)=>{let h=n[d];if(l.dynamic){let m=a.length;l.encode(a,h);let y=i.writeUpdatableValue();c.push(E=>{y(E+m)})}else l.encode(i,h)}),c.forEach(l=>{l(i.length)});let u=r.appendWriter(i);return u+=r.appendWriter(a),u}function e1(r,e){let t=[],n=[],i=r.subReader(0);return e.forEach(a=>{let c=null;if(a.dynamic){let u=r.readIndex(),l=i.subReader(u);try{c=a.decode(l)}catch(d){if(zt(d,"BUFFER_OVERRUN"))throw d;c=d,c.baseType=a.name,c.name=a.localName,c.type=a.type}}else try{c=a.decode(r)}catch(u){if(zt(u,"BUFFER_OVERRUN"))throw u;c=u,c.baseType=a.name,c.name=a.localName,c.type=a.type}if(c==null)throw new Error("investigate");t.push(c),n.push(a.localName||null)}),Zr.fromItems(t,n)}class UR extends cn{coder;length;constructor(e,t,n){const i=e.type+"["+(t>=0?t:"")+"]",a=t===-1||e.dynamic;super("array",i,n,a),Pe(this,{coder:e,length:t})}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){const n=Rt.dereference(t,"array");Array.isArray(n)||this._throwError("expected array value",n);let i=this.length;i===-1&&(i=n.length,e.writeValue(n.length)),jy(n.length,i,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let c=0;c<n.length;c++)a.push(this.coder);return Zg(e,a,n)}decode(e){let t=this.length;t===-1&&(t=e.readIndex(),fe(t*er<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*er,length:e.dataLength}));let n=[];for(let i=0;i<t;i++)n.push(new DR(this.coder));return e1(e,n)}}class LR extends cn{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){const n=Rt.dereference(t,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class t1 extends cn{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=Ht(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class MR extends t1{constructor(e){super("bytes",e)}decode(e){return xe(super.decode(e))}}class _R extends cn{size;constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),Pe(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,t){let n=Ht(Rt.dereference(t,this.type));return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return xe(e.readBytes(this.size))}}const VR=new Uint8Array([]);class GR extends cn{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return t!=null&&this._throwError("not null",t),e.writeBytes(VR)}decode(e){return e.readBytes(0),null}}const jR=BigInt(0),zR=BigInt(1),HR=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class qR extends cn{size;signed;constructor(e,t,n){const i=(t?"int":"uint")+e*8;super(i,i,n,!1),Pe(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let n=Se(Rt.dereference(t,this.type)),i=ls(HR,er*8);if(this.signed){let a=ls(i,this.size*8-1);(n>a||n<-(a+zR))&&this._throwError("value out-of-bounds",t),n=$y(n,8*er)}else(n<jR||n>ls(i,this.size*8))&&this._throwError("value out-of-bounds",t);return e.writeValue(n)}decode(e){let t=ls(e.readValue(),this.size*8);return this.signed&&(t=S5(t,this.size*8)),t}}class $R extends t1{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,nr(Rt.dereference(t,"string")))}decode(e){return za(super.decode(e))}}class Ra extends cn{coders;constructor(e,t){let n=!1;const i=[];e.forEach(c=>{c.dynamic&&(n=!0),i.push(c.type)});const a="tuple("+i.join(",")+")";super("tuple",a,t,n),Pe(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const t=this.coders.reduce((n,i)=>{const a=i.localName;return a&&(n[a]||(n[a]=0),n[a]++),n},{});return this.coders.forEach((n,i)=>{let a=n.localName;!a||t[a]!==1||(a==="length"&&(a="_length"),e[a]==null&&(e[a]=e[i]))}),Object.freeze(e)}encode(e,t){const n=Rt.dereference(t,"tuple");return Zg(e,this.coders,n)}decode(e){return e1(e,this.coders)}}function wf(r,e){return{address:$e(r),storageKeys:e.map((t,n)=>(j(ht(t,32),"invalid slot",`storageKeys[${n}]`,t),t.toLowerCase()))}}function Zn(r){if(Array.isArray(r))return r.map((t,n)=>Array.isArray(t)?(j(t.length===2,"invalid slot set",`value[${n}]`,t),wf(t[0],t[1])):(j(t!=null&&typeof t=="object","invalid address-slot set","value",r),wf(t.address,t.storageKeys)));j(r!=null&&typeof r=="object","invalid access list","value",r);const e=Object.keys(r).map(t=>{const n=r[t].reduce((i,a)=>(i[a]=!0,i),{});return wf(t,Object.keys(n).sort())});return e.sort((t,n)=>t.address.localeCompare(n.address)),e}function r1(r){return{address:$e(r.address),nonce:Se(r.nonce!=null?r.nonce:0),chainId:Se(r.chainId!=null?r.chainId:0),signature:gt.from(r.signature)}}function $s(r){let e;return typeof r=="string"?e=ar.computePublicKey(r,!1):e=r.publicKey,$e(bt("0x"+e.substring(4)).substring(26))}function KR(r,e){return $s(ar.recoverPublicKey(r,e))}const Ut=BigInt(0),WR=BigInt(2),QR=BigInt(27),JR=BigInt(28),YR=BigInt(35),XR=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ZR=Symbol.for("nodejs.util.inspect.custom"),Af=4096*32,Da=128;function e9(r){return{blobToKzgCommitment:n=>{if("computeBlobProof"in r){if("blobToKzgCommitment"in r&&typeof r.blobToKzgCommitment=="function")return ve(r.blobToKzgCommitment(xe(n)))}else if("blobToKzgCommitment"in r&&typeof r.blobToKzgCommitment=="function")return ve(r.blobToKzgCommitment(n));if("blobToKZGCommitment"in r&&typeof r.blobToKZGCommitment=="function")return ve(r.blobToKZGCommitment(xe(n)));j(!1,"unsupported KZG library","kzg",r)},computeBlobKzgProof:(n,i)=>{if("computeBlobProof"in r&&typeof r.computeBlobProof=="function")return ve(r.computeBlobProof(xe(n),xe(i)));if("computeBlobKzgProof"in r&&typeof r.computeBlobKzgProof=="function")return r.computeBlobKzgProof(n,i);if("computeBlobKZGProof"in r&&typeof r.computeBlobKZGProof=="function")return ve(r.computeBlobKZGProof(xe(n),xe(i)));j(!1,"unsupported KZG library","kzg",r)}}}function Vb(r,e){let t=r.toString(16);for(;t.length<2;)t="0"+t;return t+=Rr(e).substring(4),"0x"+t}function zi(r){return r==="0x"?null:$e(r)}function yo(r,e){try{return Zn(r)}catch(t){j(!1,t.message,e,r)}}function t9(r,e){try{if(!Array.isArray(r))throw new Error("authorizationList: invalid array");const t=[];for(let n=0;n<r.length;n++){const i=r[n];if(!Array.isArray(i))throw new Error(`authorization[${n}]: invalid array`);if(i.length!==6)throw new Error(`authorization[${n}]: wrong length`);if(!i[1])throw new Error(`authorization[${n}]: null address`);t.push({address:zi(i[1]),nonce:ot(i[2],"nonce"),chainId:ot(i[0],"chainId"),signature:gt.from({yParity:ei(i[3],"yParity"),r:nn(i[4],32),s:nn(i[5],32)})})}return t}catch(t){j(!1,t.message,e,r)}}function ei(r,e){return r==="0x"?0:Le(r,e)}function ot(r,e){if(r==="0x")return Ut;const t=Se(r,e);return j(t<=XR,"value exceeds uint size",e,t),t}function qe(r,e){const t=Se(r,"value"),n=At(t);return j(n.length<=32,"value too large",`tx.${e}`,t),n}function go(r){return Zn(r).map(e=>[e.address,e.storageKeys])}function r9(r){return r.map(e=>[qe(e.chainId,"chainId"),e.address,qe(e.nonce,"nonce"),qe(e.signature.yParity,"yParity"),At(e.signature.r),At(e.signature._s)])}function n9(r,e){j(Array.isArray(r),`invalid ${e}`,"value",r);for(let t=0;t<r.length;t++)j(ht(r[t],32),"invalid ${ param } hash",`value[${t}]`,r[t]);return r}function i9(r){const e=Hs(r);j(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",r);const t={type:0,nonce:ei(e[0],"nonce"),gasPrice:ot(e[1],"gasPrice"),gasLimit:ot(e[2],"gasLimit"),to:zi(e[3]),value:ot(e[4],"value"),data:xe(e[5]),chainId:Ut};if(e.length===6)return t;const n=ot(e[6],"v"),i=ot(e[7],"r"),a=ot(e[8],"s");if(i===Ut&&a===Ut)t.chainId=n;else{let c=(n-YR)/WR;c<Ut&&(c=Ut),t.chainId=c,j(c!==Ut||n===QR||n===JR,"non-canonical legacy v","v",e[6]),t.signature=gt.from({r:nn(e[7],32),s:nn(e[8],32),v:n})}return t}function s9(r,e){const t=[qe(r.nonce,"nonce"),qe(r.gasPrice||0,"gasPrice"),qe(r.gasLimit,"gasLimit"),r.to||"0x",qe(r.value,"value"),r.data];let n=Ut;if(r.chainId!=Ut)n=Se(r.chainId,"tx.chainId"),j(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(r.signature){const a=r.signature.legacyChainId;a!=null&&(n=a)}if(!e)return n!==Ut&&(t.push(At(n)),t.push("0x"),t.push("0x")),qr(t);let i=BigInt(27+e.yParity);return n!==Ut?i=gt.getChainIdV(n,e.v):BigInt(e.v)!==i&&j(!1,"tx.chainId/sig.v mismatch","sig",e),t.push(At(i)),t.push(At(e.r)),t.push(At(e._s)),qr(t)}function wo(r,e){let t;try{if(t=ei(e[0],"yParity"),t!==0&&t!==1)throw new Error("bad yParity")}catch{j(!1,"invalid yParity","yParity",e[0])}const n=nn(e[1],32),i=nn(e[2],32),a=gt.from({r:n,s:i,yParity:t});r.signature=a}function a9(r){const e=Hs(ve(r).slice(1));j(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",xe(r));const t={type:2,chainId:ot(e[0],"chainId"),nonce:ei(e[1],"nonce"),maxPriorityFeePerGas:ot(e[2],"maxPriorityFeePerGas"),maxFeePerGas:ot(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:ot(e[4],"gasLimit"),to:zi(e[5]),value:ot(e[6],"value"),data:xe(e[7]),accessList:yo(e[8],"accessList")};return e.length===9||wo(t,e.slice(9)),t}function o9(r,e){const t=[qe(r.chainId,"chainId"),qe(r.nonce,"nonce"),qe(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),qe(r.maxFeePerGas||0,"maxFeePerGas"),qe(r.gasLimit,"gasLimit"),r.to||"0x",qe(r.value,"value"),r.data,go(r.accessList||[])];return e&&(t.push(qe(e.yParity,"yParity")),t.push(At(e.r)),t.push(At(e.s))),Ye(["0x02",qr(t)])}function c9(r){const e=Hs(ve(r).slice(1));j(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",xe(r));const t={type:1,chainId:ot(e[0],"chainId"),nonce:ei(e[1],"nonce"),gasPrice:ot(e[2],"gasPrice"),gasLimit:ot(e[3],"gasLimit"),to:zi(e[4]),value:ot(e[5],"value"),data:xe(e[6]),accessList:yo(e[7],"accessList")};return e.length===8||wo(t,e.slice(8)),t}function u9(r,e){const t=[qe(r.chainId,"chainId"),qe(r.nonce,"nonce"),qe(r.gasPrice||0,"gasPrice"),qe(r.gasLimit,"gasLimit"),r.to||"0x",qe(r.value,"value"),r.data,go(r.accessList||[])];return e&&(t.push(qe(e.yParity,"recoveryParam")),t.push(At(e.r)),t.push(At(e.s))),Ye(["0x01",qr(t)])}function l9(r){let e=Hs(ve(r).slice(1)),t="3",n=null,i=null;if(e.length===4&&Array.isArray(e[0])){t="3 (network format)";const c=e[1],u=e[2],l=e[3];j(Array.isArray(c),"invalid network format: blobs not an array","fields[1]",c),j(Array.isArray(u),"invalid network format: commitments not an array","fields[2]",u),j(Array.isArray(l),"invalid network format: proofs not an array","fields[3]",l),j(c.length===u.length,"invalid network format: blobs/commitments length mismatch","fields",e),j(c.length===l.length,"invalid network format: blobs/proofs length mismatch","fields",e),i=[];for(let d=0;d<e[1].length;d++)i.push({data:c[d],commitment:u[d],proof:l[d]});e=e[0]}else if(e.length===5&&Array.isArray(e[0])){t="3 (EIP-7594 network format)",n=Le(e[1]);const c=e[2],u=e[3],l=e[4];j(n===1,`unsupported EIP-7594 network format version: ${n}`,"fields[1]",n),j(Array.isArray(c),"invalid EIP-7594 network format: blobs not an array","fields[2]",c),j(Array.isArray(u),"invalid EIP-7594 network format: commitments not an array","fields[3]",u),j(Array.isArray(l),"invalid EIP-7594 network format: proofs not an array","fields[4]",l),j(c.length===u.length,"invalid network format: blobs/commitments length mismatch","fields",e),j(c.length*Da===l.length,"invalid network format: blobs/proofs length mismatch","fields",e),i=[];for(let d=0;d<c.length;d++){const h=[];for(let m=0;m<Da;m++)h.push(l[d*Da+m]);i.push({data:c[d],commitment:u[d],proof:Ye(h)})}e=e[0]}j(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${t}`,"data",xe(r));const a={type:3,chainId:ot(e[0],"chainId"),nonce:ei(e[1],"nonce"),maxPriorityFeePerGas:ot(e[2],"maxPriorityFeePerGas"),maxFeePerGas:ot(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:ot(e[4],"gasLimit"),to:zi(e[5]),value:ot(e[6],"value"),data:xe(e[7]),accessList:yo(e[8],"accessList"),maxFeePerBlobGas:ot(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10],blobWrapperVersion:n};i&&(a.blobs=i),j(a.to!=null,`invalid address for transaction type: ${t}`,"data",r),j(Array.isArray(a.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",r);for(let c=0;c<a.blobVersionedHashes.length;c++)j(ht(a.blobVersionedHashes[c],32),`invalid blobVersionedHash at index ${c}: must be length 32`,"data",r);return e.length===11||wo(a,e.slice(11)),a}function f9(r,e,t){const n=[qe(r.chainId,"chainId"),qe(r.nonce,"nonce"),qe(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),qe(r.maxFeePerGas||0,"maxFeePerGas"),qe(r.gasLimit,"gasLimit"),r.to||Ss,qe(r.value,"value"),r.data,go(r.accessList||[]),qe(r.maxFeePerBlobGas||0,"maxFeePerBlobGas"),n9(r.blobVersionedHashes||[],"blobVersionedHashes")];if(e&&(n.push(qe(e.yParity,"yParity")),n.push(At(e.r)),n.push(At(e.s)),t)){if(r.blobWrapperVersion!=null){const i=At(r.blobWrapperVersion),a=[];for(const{proof:c}of t){const u=ve(c),l=u.length/Da;for(let d=0;d<u.length;d+=l)a.push(u.subarray(d,d+l))}return Ye(["0x03",qr([n,i,t.map(c=>c.data),t.map(c=>c.commitment),a])])}return Ye(["0x03",qr([n,t.map(i=>i.data),t.map(i=>i.commitment),t.map(i=>i.proof)])])}return Ye(["0x03",qr(n)])}function h9(r){const e=Hs(ve(r).slice(1));j(Array.isArray(e)&&(e.length===10||e.length===13),"invalid field count for transaction type: 4","data",xe(r));const t={type:4,chainId:ot(e[0],"chainId"),nonce:ei(e[1],"nonce"),maxPriorityFeePerGas:ot(e[2],"maxPriorityFeePerGas"),maxFeePerGas:ot(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:ot(e[4],"gasLimit"),to:zi(e[5]),value:ot(e[6],"value"),data:xe(e[7]),accessList:yo(e[8],"accessList"),authorizationList:t9(e[9],"authorizationList")};return e.length===10||wo(t,e.slice(10)),t}function d9(r,e){const t=[qe(r.chainId,"chainId"),qe(r.nonce,"nonce"),qe(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),qe(r.maxFeePerGas||0,"maxFeePerGas"),qe(r.gasLimit,"gasLimit"),r.to||"0x",qe(r.value,"value"),r.data,go(r.accessList||[]),r9(r.authorizationList||[])];return e&&(t.push(qe(e.yParity,"yParity")),t.push(At(e.r)),t.push(At(e.s))),Ye(["0x04",qr(t)])}class Ar{#e;#t;#r;#n;#i;#a;#s;#o;#d;#u;#p;#m;#c;#l;#f;#h;#y;#b;get type(){return this.#e}set type(e){switch(e){case null:this.#e=null;break;case 0:case"legacy":this.#e=0;break;case 1:case"berlin":case"eip-2930":this.#e=1;break;case 2:case"london":case"eip-1559":this.#e=2;break;case 3:case"cancun":case"eip-4844":this.#e=3;break;case 4:case"pectra":case"eip-7702":this.#e=4;break;default:j(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const e=this.#t;return e==null&&this.type===3?Ss:e}set to(e){this.#t=e==null?null:$e(e)}get nonce(){return this.#n}set nonce(e){this.#n=Le(e,"value")}get gasLimit(){return this.#i}set gasLimit(e){this.#i=Se(e)}get gasPrice(){const e=this.#a;return e==null&&(this.type===0||this.type===1)?Ut:e}set gasPrice(e){this.#a=e==null?null:Se(e,"gasPrice")}get maxPriorityFeePerGas(){const e=this.#s;return e??(this.type===2||this.type===3?Ut:null)}set maxPriorityFeePerGas(e){this.#s=e==null?null:Se(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const e=this.#o;return e??(this.type===2||this.type===3?Ut:null)}set maxFeePerGas(e){this.#o=e==null?null:Se(e,"maxFeePerGas")}get data(){return this.#r}set data(e){this.#r=xe(e)}get value(){return this.#d}set value(e){this.#d=Se(e,"value")}get chainId(){return this.#u}set chainId(e){this.#u=Se(e)}get signature(){return this.#p||null}set signature(e){this.#p=e==null?null:gt.from(e)}isValid(){const e=this.signature;if(e&&!e.isValid())return!1;const t=this.authorizationList;if(t){for(const n of t)if(!n.signature.isValid())return!1}return!0}get accessList(){const e=this.#m||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){this.#m=e==null?null:Zn(e)}get authorizationList(){const e=this.#y||null;return e==null&&this.type===4?[]:e}set authorizationList(e){this.#y=e==null?null:e.map(t=>r1(t))}get maxFeePerBlobGas(){const e=this.#c;return e==null&&this.type===3?Ut:e}set maxFeePerBlobGas(e){this.#c=e==null?null:Se(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#l;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){j(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)j(ht(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#l=e}get blobs(){return this.#h==null?null:this.#h.map(e=>Object.assign({},e))}set blobs(e){if(e==null){this.#h=null;return}const t=[],n=[];for(let i=0;i<e.length;i++){const a=e[i];if(fo(a)){fe(this.#f,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let c=ve(a);if(j(c.length<=Af,"blob is too large",`blobs[${i}]`,a),c.length!==Af){const d=new Uint8Array(Af);d.set(c),c=d}const u=this.#f.blobToKzgCommitment(c),l=xe(this.#f.computeBlobKzgProof(c,u));t.push({data:xe(c),commitment:xe(u),proof:l}),n.push(Vb(1,u))}else{const c=xe(a.data),u=xe(a.commitment),l=xe(a.proof);t.push({data:c,commitment:u,proof:l}),n.push(Vb(1,u))}}this.#h=t,this.#l=n}get kzg(){return this.#f}set kzg(e){e==null?this.#f=null:this.#f=e9(e)}get blobWrapperVersion(){return this.#b}set blobWrapperVersion(e){this.#b=e}constructor(){this.#e=null,this.#t=null,this.#n=0,this.#i=Ut,this.#a=null,this.#s=null,this.#o=null,this.#r="0x",this.#d=Ut,this.#u=Ut,this.#p=null,this.#m=null,this.#c=null,this.#l=null,this.#f=null,this.#h=null,this.#y=null,this.#b=null}get hash(){return this.signature==null?null:bt(this.#x(!0,!1))}get unsignedHash(){return bt(this.unsignedSerialized)}get from(){return this.signature==null?null:KR(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){return this.signature==null?null:ar.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return this.signature!=null}#x(e,t){fe(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=e?this.signature:null;switch(this.inferType()){case 0:return s9(this,n);case 1:return u9(this,n);case 2:return o9(this,n);case 3:return f9(this,n,t?this.blobs:null);case 4:return d9(this,n)}fe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#x(!0,!0)}get unsignedSerialized(){return this.#x(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,t=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,i=this.#c!=null||this.#l;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&fe(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),fe(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),fe(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const a=[];return this.type!=null?a.push(this.type):this.authorizationList&&this.authorizationList.length?a.push(4):t?a.push(2):e?(a.push(1),n||a.push(0)):n?(a.push(1),a.push(2)):(i&&this.to||(a.push(0),a.push(1),a.push(2)),a.push(3)),a.sort(),a}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Ar.from(this)}toJSON(){const e=t=>t==null?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[ZR](){return this.toString()}toString(){const e=[],t=i=>{let a=this[i];typeof a=="string"&&(a=JSON.stringify(a)),e.push(`${i}: ${a}`)};this.type&&t("type"),t("to"),t("data"),t("nonce"),t("gasLimit"),t("value"),this.chainId!=null&&t("chainId"),this.signature&&(t("from"),e.push(`signature: ${this.signature.toString()}`));const n=this.authorizationList;if(n){const i=[];for(const a of n){const c=[];c.push(`address: ${JSON.stringify(a.address)}`),a.nonce!=null&&c.push(`nonce: ${a.nonce}`),a.chainId!=null&&c.push(`chainId: ${a.chainId}`),a.signature&&c.push(`signature: ${a.signature.toString()}`),i.push(`Authorization { ${c.join(", ")} }`)}e.push(`authorizations: [ ${i.join(", ")} ]`)}return`Transaction { ${e.join(", ")} }`}static from(e){if(e==null)return new Ar;if(typeof e=="string"){const n=ve(e);if(n[0]>=127)return Ar.from(i9(n));switch(n[0]){case 1:return Ar.from(c9(n));case 2:return Ar.from(a9(n));case 3:return Ar.from(l9(n));case 4:return Ar.from(h9(n))}fe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new Ar;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=gt.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.authorizationList!=null&&(t.authorizationList=e.authorizationList),e.blobVersionedHashes!=null&&(t.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(t.kzg=e.kzg),e.blobWrapperVersion!=null&&(t.blobWrapperVersion=e.blobWrapperVersion),e.blobs!=null&&(t.blobs=e.blobs),e.hash!=null&&(j(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),j(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(j(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),j(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}}function p9(r){return j(typeof r.address=="string","invalid address for hashAuthorization","auth.address",r),bt(Ye(["0x05",qr([r.chainId!=null?At(r.chainId):"0x",$e(r.address),r.nonce!=null?At(r.nonce):"0x"])]))}function an(r){return bt(nr(r))}var m9="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const Gb=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),jb=4;function b9(r){let e=0;function t(){return r[e++]<<8|r[e++]}let n=t(),i=1,a=[0,1];for(let U=1;U<n;U++)a.push(i+=t());let c=t(),u=e;e+=c;let l=0,d=0;function h(){return l==0&&(d=d<<8|r[e++],l=8),d>>--l&1}const m=31,y=2**m,E=y>>>1,O=E>>1,R=y-1;let P=0;for(let U=0;U<m;U++)P=P<<1|h();let v=[],C=0,N=y;for(;;){let U=Math.floor(((P-C+1)*i-1)/N),V=0,L=n;for(;L-V>1;){let re=V+L>>>1;U<a[re]?L=re:V=re}if(V==0)break;v.push(V);let G=C+Math.floor(N*a[V]/i),Q=C+Math.floor(N*a[V+1]/i)-1;for(;((G^Q)&E)==0;)P=P<<1&R|h(),G=G<<1&R,Q=Q<<1&R|1;for(;G&~Q&O;)P=P&E|P<<1&R>>>1|h(),G=G<<1^E,Q=(Q^E)<<1|E|1;C=G,N=1+Q-G}let F=n-4;return v.map(U=>{switch(U-F){case 3:return F+65792+(r[u++]<<16|r[u++]<<8|r[u++]);case 2:return F+256+(r[u++]<<8|r[u++]);case 1:return F+r[u++];default:return U-1}})}function x9(r){let e=0;return()=>r[e++]}function n1(r){return x9(b9(y9(r)))}function y9(r){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let t=r.length,n=new Uint8Array(6*t>>3);for(let i=0,a=0,c=0,u=0;i<t;i++)u=u<<6|e[r.charCodeAt(i)],c+=6,c>=8&&(n[a++]=u>>(c-=8));return n}function g9(r){return r&1?~r>>1:r>>1}function w9(r,e){let t=Array(r);for(let n=0,i=0;n<r;n++)t[n]=i+=g9(e());return t}function Os(r,e=0){let t=[];for(;;){let n=r(),i=r();if(!i)break;e+=n;for(let a=0;a<i;a++)t.push(e+a);e+=i+1}return t}function i1(r){return Is(()=>{let e=Os(r);if(e.length)return e})}function s1(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(A9(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(E9(t,r))}return e.flat()}function Is(r){let e=[];for(;;){let t=r(e.length);if(!t)break;e.push(t)}return e}function a1(r,e,t){let n=Array(r).fill().map(()=>[]);for(let i=0;i<e;i++)w9(r,t).forEach((a,c)=>n[c].push(a));return n}function A9(r,e){let t=1+e(),n=e(),i=Is(e);return a1(i.length,1+r,e).flatMap((c,u)=>{let[l,...d]=c;return Array(i[u]).fill().map((h,m)=>{let y=m*n;return[l+m*t,d.map(E=>E+y)]})})}function E9(r,e){let t=1+e();return a1(t,1+r,e).map(i=>[i[0],i.slice(1)])}function v9(r){let e=[],t=Os(r);return i(n([]),[]),e;function n(a){let c=r(),u=Is(()=>{let l=Os(r).map(d=>t[d]);if(l.length)return n(l)});return{S:c,B:u,Q:a}}function i({S:a,B:c},u,l){if(!(a&4&&l===u[u.length-1])){a&2&&(l=u[u.length-1]),a&1&&e.push(u);for(let d of c)for(let h of d.Q)i(d,[...u,h],l)}}}function R9(r){return r.toString(16).toUpperCase().padStart(2,"0")}function o1(r){return`{${R9(r)}}`}function B9(r){let e=[];for(let t=0,n=r.length;t<n;){let i=r.codePointAt(t);t+=i<65536?1:2,e.push(i)}return e}function Ii(r){let t=r.length;if(t<4096)return String.fromCodePoint(...r);let n=[];for(let i=0;i<t;)n.push(String.fromCodePoint(...r.slice(i,i+=4096)));return n.join("")}function T9(r,e){let t=r.length,n=t-e.length;for(let i=0;n==0&&i<t;i++)n=r[i]-e[i];return n}var S9="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const Cs=44032,Ha=4352,qa=4449,$a=4519,c1=19,u1=21,Ci=28,Ka=u1*Ci,O9=c1*Ka,I9=Cs+O9,C9=Ha+c1,P9=qa+u1,N9=$a+Ci;function fs(r){return r>>24&255}function l1(r){return r&16777215}let Zf,zb,e0,Ua;function k9(){let r=n1(S9);Zf=new Map(i1(r).flatMap((e,t)=>e.map(n=>[n,t+1<<24]))),zb=new Set(Os(r)),e0=new Map,Ua=new Map;for(let[e,t]of s1(r)){if(!zb.has(e)&&t.length==2){let[n,i]=t,a=Ua.get(n);a||(a=new Map,Ua.set(n,a)),a.set(i,e)}e0.set(e,t.reverse())}}function f1(r){return r>=Cs&&r<I9}function F9(r,e){if(r>=Ha&&r<C9&&e>=qa&&e<P9)return Cs+(r-Ha)*Ka+(e-qa)*Ci;if(f1(r)&&e>$a&&e<N9&&(r-Cs)%Ci==0)return r+(e-$a);{let t=Ua.get(r);return t&&(t=t.get(e),t)?t:-1}}function h1(r){Zf||k9();let e=[],t=[],n=!1;function i(a){let c=Zf.get(a);c&&(n=!0,a|=c),e.push(a)}for(let a of r)for(;;){if(a<128)e.push(a);else if(f1(a)){let c=a-Cs,u=c/Ka|0,l=c%Ka/Ci|0,d=c%Ci;i(Ha+u),i(qa+l),d>0&&i($a+d)}else{let c=e0.get(a);c?t.push(...c):i(a)}if(!t.length)break;a=t.pop()}if(n&&e.length>1){let a=fs(e[0]);for(let c=1;c<e.length;c++){let u=fs(e[c]);if(u==0||a<=u){a=u;continue}let l=c-1;for(;;){let d=e[l+1];if(e[l+1]=e[l],e[l]=d,!l||(a=fs(e[--l]),a<=u))break}a=fs(e[c])}}return e}function D9(r){let e=[],t=[],n=-1,i=0;for(let a of r){let c=fs(a),u=l1(a);if(n==-1)c==0?n=u:e.push(u);else if(i>0&&i>=c)c==0?(e.push(n,...t),t.length=0,n=u):t.push(u),i=c;else{let l=F9(n,u);l>=0?n=l:i==0&&c==0?(e.push(n),n=u):(t.push(u),i=c)}}return n>=0&&e.push(n,...t),e}function d1(r){return h1(r).map(l1)}function U9(r){return D9(h1(r))}const Hb=45,p1=".",m1=65039,b1=1,Wa=r=>Array.from(r);function Ps(r,e){return r.P.has(e)||r.Q.has(e)}class L9 extends Array{get is_emoji(){return!0}}let t0,x1,Vn,r0,y1,wi,Ef,pi,Fn,qb,n0;function Q0(){if(t0)return;let r=n1(m9);const e=()=>Os(r),t=()=>new Set(e()),n=(h,m)=>m.forEach(y=>h.add(y));t0=new Map(s1(r)),x1=t(),Vn=e(),r0=new Set(e().map(h=>Vn[h])),Vn=new Set(Vn),y1=t(),t();let i=i1(r),a=r();const c=()=>{let h=new Set;return e().forEach(m=>n(h,i[m])),n(h,e()),h};wi=Is(h=>{let m=Is(r).map(y=>y+96);if(m.length){let y=h>=a;m[0]-=32,m=Ii(m),y&&(m=`Restricted[${m}]`);let E=c(),O=c(),R=!r();return{N:m,P:E,Q:O,M:R,R:y}}}),Ef=t(),pi=new Map;let u=e().concat(Wa(Ef)).sort((h,m)=>h-m);u.forEach((h,m)=>{let y=r(),E=u[m]=y?u[m-y]:{V:[],M:new Map};E.V.push(h),Ef.has(h)||pi.set(h,E)});for(let{V:h,M:m}of new Set(pi.values())){let y=[];for(let O of h){let R=wi.filter(v=>Ps(v,O)),P=y.find(({G:v})=>R.some(C=>v.has(C)));P||(P={G:new Set,V:[]},y.push(P)),P.V.push(O),n(P.G,R)}let E=y.flatMap(O=>Wa(O.G));for(let{G:O,V:R}of y){let P=new Set(E.filter(v=>!O.has(v)));for(let v of R)m.set(v,P)}}Fn=new Set;let l=new Set;const d=h=>Fn.has(h)?l.add(h):Fn.add(h);for(let h of wi){for(let m of h.P)d(m);for(let m of h.Q)d(m)}for(let h of Fn)!pi.has(h)&&!l.has(h)&&pi.set(h,b1);n(Fn,d1(Fn)),qb=v9(r).map(h=>L9.from(h)).sort(T9),n0=new Map;for(let h of qb){let m=[n0];for(let y of h){let E=m.map(O=>{let R=O.get(y);return R||(R=new Map,O.set(y,R)),R});y===m1?m.push(...E):m=E}for(let y of m)y.V=h}}function J0(r){return(g1(r)?"":`${Y0(Ao([r]))} `)+o1(r)}function Y0(r){return`"${r}"`}function M9(r){if(r.length>=4&&r[2]==Hb&&r[3]==Hb)throw new Error(`invalid label extension: "${Ii(r.slice(0,4))}"`)}function _9(r){for(let t=r.lastIndexOf(95);t>0;)if(r[--t]!==95)throw new Error("underscore allowed only at start")}function V9(r){let e=r[0],t=Gb.get(e);if(t)throw ys(`leading ${t}`);let n=r.length,i=-1;for(let a=1;a<n;a++){e=r[a];let c=Gb.get(e);if(c){if(i==a)throw ys(`${t} + ${c}`);i=a+1,t=c}}if(i==n)throw ys(`trailing ${t}`)}function Ao(r,e=1/0,t=o1){let n=[];G9(r[0])&&n.push("◌"),r.length>e&&(e>>=1,r=[...r.slice(0,e),8230,...r.slice(-e)]);let i=0,a=r.length;for(let c=0;c<a;c++){let u=r[c];g1(u)&&(n.push(Ii(r.slice(i,c))),n.push(t(u)),i=c+1)}return n.push(Ii(r.slice(i,a))),n.join("")}function G9(r){return Q0(),Vn.has(r)}function g1(r){return Q0(),y1.has(r)}function j9(r){return $9(z9(r,U9,Q9))}function z9(r,e,t){if(!r)return[];Q0();let n=0;return r.split(p1).map(i=>{let a=B9(i),c={input:a,offset:n};n+=a.length+1;try{let u=c.tokens=W9(a,e,t),l=u.length,d;if(!l)throw new Error("empty label");let h=c.output=u.flat();if(_9(h),!(c.emoji=l>1||u[0].is_emoji)&&h.every(y=>y<128))M9(h),d="ASCII";else{let y=u.flatMap(E=>E.is_emoji?[]:E);if(!y.length)d="Emoji";else{if(Vn.has(h[0]))throw ys("leading combining mark");for(let R=1;R<l;R++){let P=u[R];if(!P.is_emoji&&Vn.has(P[0]))throw ys(`emoji + combining mark: "${Ii(u[R-1])} + ${Ao([P[0]])}"`)}V9(h);let E=Wa(new Set(y)),[O]=q9(E);K9(O,y),H9(O,E),d=O.N}}c.type=d}catch(u){c.error=u}return c})}function H9(r,e){let t,n=[];for(let i of e){let a=pi.get(i);if(a===b1)return;if(a){let c=a.M.get(i);if(t=t?t.filter(u=>c.has(u)):Wa(c),!t.length)return}else n.push(i)}if(t){for(let i of t)if(n.every(a=>Ps(i,a)))throw new Error(`whole-script confusable: ${r.N}/${i.N}`)}}function q9(r){let e=wi;for(let t of r){let n=e.filter(i=>Ps(i,t));if(!n.length)throw wi.some(i=>Ps(i,t))?A1(e[0],t):w1(t);if(e=n,n.length==1)break}return e}function $9(r){return r.map(({input:e,error:t,output:n})=>{if(t){let i=t.message;throw new Error(r.length==1?i:`Invalid label ${Y0(Ao(e,63))}: ${i}`)}return Ii(n)}).join(p1)}function w1(r){return new Error(`disallowed character: ${J0(r)}`)}function A1(r,e){let t=J0(e),n=wi.find(i=>i.P.has(e));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${r.N} + ${t}`)}function ys(r){return new Error(`illegal placement: ${r}`)}function K9(r,e){for(let t of e)if(!Ps(r,t))throw A1(r,t);if(r.M){let t=d1(e);for(let n=1,i=t.length;n<i;n++)if(r0.has(t[n])){let a=n+1;for(let c;a<i&&r0.has(c=t[a]);a++)for(let u=n;u<a;u++)if(t[u]==c)throw new Error(`duplicate non-spacing marks: ${J0(c)}`);if(a-n>jb)throw new Error(`excessive non-spacing marks: ${Y0(Ao(t.slice(n-1,a)))} (${a-n}/${jb})`);n=a}}}function W9(r,e,t){let n=[],i=[];for(r=r.slice().reverse();r.length;){let a=J9(r);if(a)i.length&&(n.push(e(i)),i=[]),n.push(t(a));else{let c=r.pop();if(Fn.has(c))i.push(c);else{let u=t0.get(c);if(u)i.push(...u);else if(!x1.has(c))throw w1(c)}}}return i.length&&n.push(e(i)),n}function Q9(r){return r.filter(e=>e!=m1)}function J9(r,e){let t=n0,n,i=r.length;for(;i&&(t=t.get(r[--i]),!!t);){let{V:a}=t;a&&(n=a,r.length=i)}return n}const E1=new Uint8Array(32);E1.fill(0);function $b(r){return j(r.length!==0,"invalid ENS name; empty component","comp",r),r}function v1(r){const e=nr(Y9(r)),t=[];if(r.length===0)return t;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(t.push($b(e.slice(n,i))),n=i+1);return j(n<e.length,"invalid ENS name; empty component","name",r),t.push($b(e.slice(n))),t}function Y9(r){try{if(r.length===0)throw new Error("empty label");return j9(r)}catch(e){j(!1,`invalid ENS name (${e.message})`,"name",r)}}function i0(r){j(typeof r=="string","invalid ENS name; not a string","name",r),j(r.length,"invalid ENS name (empty label)","name",r);let e=E1;const t=v1(r);for(;t.length;)e=bt(Ye([e,bt(t.pop())]));return xe(e)}function X9(r,e){const t=e;return j(t<=255,"DNS encoded label cannot exceed 255","length",t),xe(Ye(v1(r).map(n=>{j(n.length<=t,`label ${JSON.stringify(r)} exceeds ${t} bytes`,"name",r);const i=new Uint8Array(n.length+1);return i.set(n,1),i[0]=i.length-1,i})))+"00"}function Z9(r){return typeof r=="string"&&(r=nr(r)),bt(Ye([nr(BR),nr(String(r.length)),r]))}const R1=new Uint8Array(32);R1.fill(0);const eB=BigInt(-1),B1=BigInt(0),T1=BigInt(1),tB=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function rB(r){const e=ve(r),t=e.length%32;return t?Ye([e,R1.slice(t)]):xe(e)}const nB=sn(T1,32),iB=sn(B1,32),Kb={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},vf=["name","version","chainId","verifyingContract","salt"];function Wb(r){return function(e){return j(typeof e=="string",`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,e),e}}const sB={name:Wb("name"),version:Wb("version"),chainId:function(r){const e=Se(r,"domain.chainId");return j(e>=0,"invalid chain ID","domain.chainId",r),Number.isSafeInteger(e)?Number(e):Or(e)},verifyingContract:function(r){try{return $e(r).toLowerCase()}catch{}j(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){const e=ve(r,"domain.salt");return j(e.length===32,'invalid domain value "salt"',"domain.salt",r),xe(e)}};function Rf(r){{const e=r.match(/^(u?)int(\d+)$/);if(e){const t=e[1]==="",n=parseInt(e[2]);j(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",r);const i=ls(tB,t?n-1:n),a=t?(i+T1)*eB:B1;return function(c){const u=Se(c,"value");return j(u>=a&&u<=i,`value out-of-bounds for ${r}`,"value",u),sn(t?$y(u,256):u,32)}}}{const e=r.match(/^bytes(\d+)$/);if(e){const t=parseInt(e[1]);return j(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",r),function(n){const i=ve(n);return j(i.length===t,`invalid length for ${r}`,"value",n),rB(n)}}}switch(r){case"address":return function(e){return nn($e(e),32)};case"bool":return function(e){return e?nB:iB};case"bytes":return function(e){return bt(e)};case"string":return function(e){return an(e)}}return null}function Qb(r,e){return`${r}(${e.map(({name:t,type:n})=>n+" "+t).join(",")})`}function Ba(r){const e=r.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:r}}class Zt{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#r;constructor(e){this.#t=new Map,this.#r=new Map;const t=new Map,n=new Map,i=new Map,a={};Object.keys(e).forEach(l=>{a[l]=e[l].map(({name:d,type:h})=>{let{base:m,index:y}=Ba(h);return m==="int"&&!e.int&&(m="int256"),m==="uint"&&!e.uint&&(m="uint256"),{name:d,type:m+(y||"")}}),t.set(l,new Set),n.set(l,[]),i.set(l,new Set)}),this.#e=JSON.stringify(a);for(const l in a){const d=new Set;for(const h of a[l]){j(!d.has(h.name),`duplicate variable name ${JSON.stringify(h.name)} in ${JSON.stringify(l)}`,"types",e),d.add(h.name);const m=Ba(h.type).base;j(m!==l,`circular type reference to ${JSON.stringify(m)}`,"types",e),!Rf(m)&&(j(n.has(m),`unknown type ${JSON.stringify(m)}`,"types",e),n.get(m).push(l),t.get(l).add(m))}}const c=Array.from(n.keys()).filter(l=>n.get(l).length===0);j(c.length!==0,"missing primary type","types",e),j(c.length===1,`ambiguous primary types or unused types: ${c.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),Pe(this,{primaryType:c[0]});function u(l,d){j(!d.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),d.add(l);for(const h of t.get(l))if(n.has(h)){u(h,d);for(const m of d)i.get(m).add(h)}d.delete(l)}u(this.primaryType,new Set);for(const[l,d]of i){const h=Array.from(d);h.sort(),this.#t.set(l,Qb(l,a[l])+h.map(m=>Qb(m,a[m])).join(""))}}getEncoder(e){let t=this.#r.get(e);return t||(t=this.#n(e),this.#r.set(e,t)),t}#n(e){{const i=Rf(e);if(i)return i}const t=Ba(e).array;if(t){const i=t.prefix,a=this.getEncoder(i);return c=>{j(t.count===-1||t.count===c.length,`array length mismatch; expected length ${t.count}`,"value",c);let u=c.map(a);return this.#t.has(i)&&(u=u.map(bt)),bt(Ye(u))}}const n=this.types[e];if(n){const i=an(this.#t.get(e));return a=>{const c=n.map(({name:u,type:l})=>{const d=this.getEncoder(l)(a[u]);return this.#t.has(l)?bt(d):d});return c.unshift(i),Ye(c)}}j(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const t=this.#t.get(e);return j(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return bt(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(Rf(e))return n(e,t);const i=Ba(e).array;if(i)return j(i.count===-1||i.count===t.length,`array length mismatch; expected length ${i.count}`,"value",t),t.map(c=>this._visit(i.prefix,c,n));const a=this.types[e];if(a)return a.reduce((c,{name:u,type:l})=>(c[u]=this._visit(l,t[u],n),c),{});j(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Zt(e)}static getPrimaryType(e){return Zt.from(e).primaryType}static hashStruct(e,t,n){return Zt.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){if(e[n]==null)continue;const i=Kb[n];j(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:i})}return t.sort((n,i)=>vf.indexOf(n.name)-vf.indexOf(i.name)),Zt.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return Ye(["0x1901",Zt.hashDomain(e),Zt.from(t).hash(n)])}static hash(e,t,n){return bt(Zt.encode(e,t,n))}static async resolveNames(e,t,n,i){e=Object.assign({},e);for(const u in e)e[u]==null&&delete e[u];const a={};e.verifyingContract&&!ht(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const c=Zt.from(t);c.visit(n,(u,l)=>(u==="address"&&!ht(l,20)&&(a[l]="0x"),l));for(const u in a)a[u]=await i(u);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),n=c.visit(n,(u,l)=>u==="address"&&a[l]?a[l]:l),{domain:e,value:n}}static getPayload(e,t,n){Zt.hashDomain(e);const i={},a=[];vf.forEach(l=>{const d=e[l];d!=null&&(i[l]=sB[l](d),a.push({name:l,type:Kb[l]}))});const c=Zt.from(t);t=c.types;const u=Object.assign({},t);return j(u.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),u.EIP712Domain=a,c.encode(n),{types:u,domain:i,primaryType:c.primaryType,message:c.visit(n,(l,d)=>{if(l.match(/^bytes(\d*)/))return xe(ve(d));if(l.match(/^u?int/))return Se(d).toString();switch(l){case"address":return d.toLowerCase();case"bool":return!!d;case"string":return j(typeof d=="string","invalid string","value",d),d}j(!1,"unsupported type","type",l)})}}}function tr(r){const e=new Set;return r.forEach(t=>e.add(t)),Object.freeze(e)}const aB="external public payable override",oB=tr(aB.split(" ")),S1="constant external internal payable private public pure view override",cB=tr(S1.split(" ")),O1="constructor error event fallback function receive struct",I1=tr(O1.split(" ")),C1="calldata memory storage payable indexed",uB=tr(C1.split(" ")),lB="tuple returns",fB=[O1,C1,lB,S1].join(" "),hB=tr(fB.split(" ")),dB={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},pB=new RegExp("^(\\s*)"),mB=new RegExp("^([0-9]+)"),bB=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),P1=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),N1=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class Br{#e;#t;get offset(){return this.#e}get length(){return this.#t.length-this.#e}constructor(e){this.#e=0,this.#t=e.slice()}clone(){return new Br(this.#t)}reset(){this.#e=0}#r(e=0,t=0){return new Br(this.#t.slice(e,t).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))}popKeyword(e){const t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=this.#r(this.#e+1,e.match+1);return this.#e=e.match+1,t}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=[];for(;this.#e<e.match-1;){const n=this.peek().linkNext;t.push(this.#r(this.#e+1,n)),this.#e=n}return this.#e=e.match+1,t}peek(){if(this.#e>=this.#t.length)throw new Error("out-of-bounds");return this.#t[this.#e]}peekKeyword(e){const t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return this.#e++,e}toString(){const e=[];for(let t=this.#e;t<this.#t.length;t++){const n=this.#t[t];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}}function Tn(r){const e=[],t=c=>{const u=a<r.length?JSON.stringify(r[a]):"$EOI";throw new Error(`invalid token ${u} at ${a}: ${c}`)};let n=[],i=[],a=0;for(;a<r.length;){let c=r.substring(a),u=c.match(pB);u&&(a+=u[1].length,c=r.substring(a));const l={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:a,value:-1};e.push(l);let d=dB[c[0]]||"";if(d){if(l.type=d,l.text=c[0],a++,d==="OPEN_PAREN")n.push(e.length-1),i.push(e.length-1);else if(d=="CLOSE_PAREN")n.length===0&&t("no matching open bracket"),l.match=n.pop(),e[l.match].match=e.length-1,l.depth--,l.linkBack=i.pop(),e[l.linkBack].linkNext=e.length-1;else if(d==="COMMA")l.linkBack=i.pop(),e[l.linkBack].linkNext=e.length-1,i.push(e.length-1);else if(d==="OPEN_BRACKET")l.type="BRACKET";else if(d==="CLOSE_BRACKET"){let h=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const m=e.pop().text;h=m+h,e[e.length-1].value=Le(m)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=h}continue}if(u=c.match(bB),u){if(l.text=u[1],a+=l.text.length,hB.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(N1)){l.type="TYPE";continue}l.type="ID";continue}if(u=c.match(mB),u){l.text=u[1],l.type="NUMBER",a+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(c[0])} at position ${a}`)}return new Br(e.map(c=>Object.freeze(c)))}function Jb(r,e){let t=[];for(const n in e.keys())r.has(n)&&t.push(n);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function Eo(r,e){if(e.peekKeyword(I1)){const t=e.pop().text;if(t!==r)throw new Error(`expected ${r}, got ${t}`)}return e.popType("ID")}function on(r,e){const t=new Set;for(;;){const n=r.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(r.pop(),t.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);t.add(n)}return Object.freeze(t)}function k1(r){let e=on(r,cB);return Jb(e,tr("constant payable nonpayable".split(" "))),Jb(e,tr("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function rn(r,e){return r.popParams().map(t=>ft.from(t,e))}function F1(r){if(r.peekType("AT")){if(r.pop(),r.peekType("NUMBER"))return Se(r.pop().text);throw new Error("invalid gas")}return null}function $n(r){if(r.length)throw new Error(`unexpected tokens at offset ${r.offset}: ${r.toString()}`)}const xB=new RegExp(/^(.*)\[([0-9]*)\]$/);function Yb(r){const e=r.match(N1);if(j(e,"invalid type","type",r),r==="uint")return"uint256";if(r==="int")return"int256";if(e[2]){const t=parseInt(e[2]);j(t!==0&&t<=32,"invalid bytes length","type",r)}else if(e[3]){const t=parseInt(e[3]);j(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",r)}return r}const wt={},or=Symbol.for("_ethers_internal"),Xb="_ParamTypeInternal",Zb="_ErrorInternal",ex="_EventInternal",tx="_ConstructorInternal",rx="_FallbackInternal",nx="_FunctionInternal",ix="_StructInternal";class ft{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,n,i,a,c,u,l){if(Xn(e,wt,"ParamType"),Object.defineProperty(this,or,{value:Xb}),c&&(c=Object.freeze(c.slice())),i==="array"){if(u==null||l==null)throw new Error("")}else if(u!=null||l!=null)throw new Error("");if(i==="tuple"){if(c==null)throw new Error("")}else if(c!=null)throw new Error("");Pe(this,{name:t,type:n,baseType:i,indexed:a,components:c,arrayLength:u,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=n,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,a)=>n.components[a].walk(i,t))}return t(this.type,e)}#e(e,t,n,i){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const c=this.arrayChildren,u=t.slice();u.forEach((l,d)=>{c.#e(e,l,n,h=>{u[d]=h})}),i(u);return}if(this.isTuple()){const c=this.components;let u;if(Array.isArray(t))u=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");u=c.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in t))throw new Error(`missing value for component ${l.name}`);return t[l.name]})}if(u.length!==this.components.length)throw new Error("array is wrong length");u.forEach((l,d)=>{c[d].#e(e,l,n,h=>{u[d]=h})}),i(u);return}const a=n(this.type,t);a.then?e.push((async function(){i(await a)})()):i(a)}async walkAsync(e,t){const n=[],i=[e];return this.#e(n,e,t,a=>{i[0]=a}),n.length&&await Promise.all(n),i[0]}static from(e,t){if(ft.isParamType(e))return e;if(typeof e=="string")try{return ft.from(Tn(e),t)}catch{j(!1,"invalid param type","obj",e)}else if(e instanceof Br){let u="",l="",d=null;on(e,tr(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",d=e.popParams().map(R=>ft.from(R)),u=`tuple(${d.map(R=>R.format()).join(",")})`):(u=Yb(e.popType("TYPE")),l=u);let h=null,m=null;for(;e.length&&e.peekType("BRACKET");){const R=e.pop();h=new ft(wt,"",u,l,null,d,m,h),m=R.value,u+=R.text,l="array",d=null}let y=null;if(on(e,uB).has("indexed")){if(!t)throw new Error("");y=!0}const O=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new ft(wt,O,u,l,y,d,m,h)}const n=e.name;j(!n||typeof n=="string"&&n.match(P1),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(j(t,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,c=a.match(xB);if(c){const u=parseInt(c[2]||"-1"),l=ft.from({type:c[1],components:e.components});return new ft(wt,n||"",a,"array",i,null,u,l)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const u=e.components!=null?e.components.map(d=>ft.from(d)):null;return new ft(wt,n||"",a,"tuple",i,u,null,null)}return a=Yb(e.type),new ft(wt,n||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[or]===Xb}}class Kn{type;inputs;constructor(e,t,n){Xn(e,wt,"Fragment"),n=Object.freeze(n.slice()),Pe(this,{type:t,inputs:n})}static from(e){if(typeof e=="string"){try{Kn.from(JSON.parse(e))}catch{}return Kn.from(Tn(e))}if(e instanceof Br)switch(e.peekKeyword(I1)){case"constructor":return en.from(e);case"error":return sr.from(e);case"event":return zr.from(e);case"fallback":case"receive":return Qr.from(e);case"function":return Hr.from(e);case"struct":return qn.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return en.from(e);case"error":return sr.from(e);case"event":return zr.from(e);case"fallback":case"receive":return Qr.from(e);case"function":return Hr.from(e);case"struct":return qn.from(e)}fe(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}j(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return en.isFragment(e)}static isError(e){return sr.isFragment(e)}static isEvent(e){return zr.isFragment(e)}static isFunction(e){return Hr.isFragment(e)}static isStruct(e){return qn.isFragment(e)}}class vo extends Kn{name;constructor(e,t,n,i){super(e,t,i),j(typeof n=="string"&&n.match(P1),"invalid identifier","name",n),i=Object.freeze(i.slice()),Pe(this,{name:n})}}function Ns(r,e){return"("+e.map(t=>t.format(r)).join(r==="full"?", ":",")+")"}class sr extends vo{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,or,{value:Zb})}get selector(){return an(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+Ns(e,this.inputs)),t.join(" ")}static from(e){if(sr.isFragment(e))return e;if(typeof e=="string")return sr.from(Tn(e));if(e instanceof Br){const t=Eo("error",e),n=rn(e);return $n(e),new sr(wt,t,n)}return new sr(wt,e.name,e.inputs?e.inputs.map(ft.from):[])}static isFragment(e){return e&&e[or]===Zb}}class zr extends vo{anonymous;constructor(e,t,n,i){super(e,"event",t,n),Object.defineProperty(this,or,{value:ex}),Pe(this,{anonymous:i})}get topicHash(){return an(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("event"),t.push(this.name+Ns(e,this.inputs)),e!=="sighash"&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){return t=(t||[]).map(i=>ft.from(i)),new zr(wt,e,t,!1).topicHash}static from(e){if(zr.isFragment(e))return e;if(typeof e=="string")try{return zr.from(Tn(e))}catch{j(!1,"invalid event fragment","obj",e)}else if(e instanceof Br){const t=Eo("event",e),n=rn(e,!0),i=!!on(e,tr(["anonymous"])).has("anonymous");return $n(e),new zr(wt,t,n,i)}return new zr(wt,e.name,e.inputs?e.inputs.map(t=>ft.from(t,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[or]===ex}}class en extends Kn{payable;gas;constructor(e,t,n,i,a){super(e,t,n),Object.defineProperty(this,or,{value:tx}),Pe(this,{payable:i,gas:a})}format(e){if(fe(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[`constructor${Ns(e,this.inputs)}`];return this.payable&&t.push("payable"),this.gas!=null&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(en.isFragment(e))return e;if(typeof e=="string")try{return en.from(Tn(e))}catch{j(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof Br){on(e,tr(["constructor"]));const t=rn(e),n=!!on(e,oB).has("payable"),i=F1(e);return $n(e),new en(wt,"constructor",t,n,i)}return new en(wt,"constructor",e.inputs?e.inputs.map(ft.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[or]===tx}}class Qr extends Kn{payable;constructor(e,t,n){super(e,"fallback",t),Object.defineProperty(this,or,{value:rx}),Pe(this,{payable:n})}format(e){const t=this.inputs.length===0?"receive":"fallback";if(e==="json"){const n=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:n})}return`${t}()${this.payable?" payable":""}`}static from(e){if(Qr.isFragment(e))return e;if(typeof e=="string")try{return Qr.from(Tn(e))}catch{j(!1,"invalid fallback fragment","obj",e)}else if(e instanceof Br){const t=e.toString(),n=e.peekKeyword(tr(["fallback","receive"]));if(j(n,"type must be fallback or receive","obj",t),e.popKeyword(tr(["fallback","receive"]))==="receive"){const u=rn(e);return j(u.length===0,"receive cannot have arguments","obj.inputs",u),on(e,tr(["payable"])),$n(e),new Qr(wt,[],!0)}let a=rn(e);a.length?j(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(u=>u.format("minimal")).join(", ")):a=[ft.from("bytes")];const c=k1(e);if(j(c==="nonpayable"||c==="payable","fallback cannot be constants","obj.stateMutability",c),on(e,tr(["returns"])).has("returns")){const u=rn(e);j(u.length===1&&u[0].type==="bytes","invalid fallback outputs","obj.outputs",u.map(l=>l.format("minimal")).join(", "))}return $n(e),new Qr(wt,a,c==="payable")}if(e.type==="receive")return new Qr(wt,[],!0);if(e.type==="fallback"){const t=[ft.from("bytes")],n=e.stateMutability==="payable";return new Qr(wt,t,n)}j(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[or]===rx}}class Hr extends vo{constant;outputs;stateMutability;payable;gas;constructor(e,t,n,i,a,c){super(e,"function",t,i),Object.defineProperty(this,or,{value:nx}),a=Object.freeze(a.slice()),Pe(this,{constant:n==="view"||n==="pure",gas:c,outputs:a,payable:n==="payable",stateMutability:n})}get selector(){return an(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("function"),t.push(this.name+Ns(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(Ns(e,this.outputs))),this.gas!=null&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){return t=(t||[]).map(i=>ft.from(i)),new Hr(wt,e,"view",t,[],null).selector}static from(e){if(Hr.isFragment(e))return e;if(typeof e=="string")try{return Hr.from(Tn(e))}catch{j(!1,"invalid function fragment","obj",e)}else if(e instanceof Br){const n=Eo("function",e),i=rn(e),a=k1(e);let c=[];on(e,tr(["returns"])).has("returns")&&(c=rn(e));const u=F1(e);return $n(e),new Hr(wt,n,a,i,c,u)}let t=e.stateMutability;return t==null&&(t="payable",typeof e.constant=="boolean"?(t="view",e.constant||(t="payable",typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable")),new Hr(wt,e.name,t,e.inputs?e.inputs.map(ft.from):[],e.outputs?e.outputs.map(ft.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[or]===nx}}class qn extends vo{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,or,{value:ix})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return qn.from(Tn(e))}catch{j(!1,"invalid struct fragment","obj",e)}else if(e instanceof Br){const t=Eo("struct",e),n=rn(e);return $n(e),new qn(wt,t,n)}return new qn(wt,e.name,e.inputs?e.inputs.map(ft.from):[])}static isFragment(e){return e&&e[or]===ix}}const kr=new Map;kr.set(0,"GENERIC_PANIC");kr.set(1,"ASSERT_FALSE");kr.set(17,"OVERFLOW");kr.set(18,"DIVIDE_BY_ZERO");kr.set(33,"ENUM_RANGE_ERROR");kr.set(34,"BAD_STORAGE_DATA");kr.set(49,"STACK_UNDERFLOW");kr.set(50,"ARRAY_RANGE_ERROR");kr.set(65,"OUT_OF_MEMORY");kr.set(81,"UNINITIALIZED_FUNCTION_CALL");const yB=new RegExp(/^bytes([0-9]*)$/),gB=new RegExp(/^(u?int)([0-9]*)$/);let Bf=null,sx=1024;function wB(r,e,t,n){let i="missing revert data",a=null;const c=null;let u=null;if(t){i="execution reverted";const d=ve(t);if(t=xe(t),d.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(d.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(xe(d.slice(0,4))==="0x08c379a0")try{a=n.decode(["string"],d.slice(4))[0],u={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(xe(d.slice(0,4))==="0x4e487b71")try{const h=Number(n.decode(["uint256"],d.slice(4))[0]);u={signature:"Panic(uint256)",name:"Panic",args:[h]},a=`Panic due to ${kr.get(h)||"UNKNOWN"}(${h})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?$e(e.to):null,data:e.data||"0x"};return e.from&&(l.from=$e(e.from)),yt(i,"CALL_EXCEPTION",{action:r,data:t,reason:a,transaction:l,invocation:c,revert:u})}class Pi{#e(e){if(e.isArray())return new UR(this.#e(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Ra(e.components.map(n=>this.#e(n)),e.name);switch(e.baseType){case"address":return new FR(e.name);case"bool":return new LR(e.name);case"string":return new $R(e.name);case"bytes":return new MR(e.name);case"":return new GR(e.name)}let t=e.type.match(gB);if(t){let n=parseInt(t[2]||"256");return j(n!==0&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new qR(n/8,t[1]==="int",e.name)}if(t=e.type.match(yB),t){let n=parseInt(t[1]);return j(n!==0&&n<=32,"invalid bytes length","param",e),new _R(n,e.name)}j(!1,"invalid type","type",e.type)}getDefaultValue(e){const t=e.map(i=>this.#e(ft.from(i)));return new Ra(t,"_").defaultValue()}encode(e,t){jy(t.length,e.length,"types/values length mismatch");const n=e.map(c=>this.#e(ft.from(c))),i=new Ra(n,"_"),a=new $f;return i.encode(a,t),a.data}decode(e,t,n){const i=e.map(c=>this.#e(ft.from(c)));return new Ra(i,"_").decode(new D0(t,n,sx))}static _setDefaultMaxInflation(e){j(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),sx=e}static defaultAbiCoder(){return Bf==null&&(Bf=new Pi),Bf}static getBuiltinCallException(e,t,n){return wB(e,t,n,Pi.defaultAbiCoder())}}class AB{fragment;name;signature;topic;args;constructor(e,t,n){const i=e.name,a=e.format();Pe(this,{fragment:e,name:i,signature:a,topic:t,args:n})}}class EB{fragment;name;args;signature;selector;value;constructor(e,t,n,i){const a=e.name,c=e.format();Pe(this,{fragment:e,name:a,args:n,signature:c,selector:t,value:i})}}class vB{fragment;name;args;signature;selector;constructor(e,t,n){const i=e.name,a=e.format();Pe(this,{fragment:e,name:i,args:n,signature:a,selector:t})}}class ax{hash;_isIndexed;static isIndexed(e){return!!(e&&e._isIndexed)}constructor(e){Pe(this,{hash:e,_isIndexed:!0})}}const ox={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},cx={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:r=>`reverted with reason string ${JSON.stringify(r)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:r=>{let e="unknown panic code";return r>=0&&r<=255&&ox[r.toString()]&&(e=ox[r.toString()]),`reverted with panic code 0x${r.toString(16)} (${e})`}}};class Mn{fragments;deploy;fallback;receive;#e;#t;#r;#n;constructor(e){let t=[];typeof e=="string"?t=JSON.parse(e):t=e,this.#r=new Map,this.#e=new Map,this.#t=new Map;const n=[];for(const c of t)try{n.push(Kn.from(c))}catch(u){console.log(`[Warning] Invalid Fragment ${JSON.stringify(c)}:`,u.message)}Pe(this,{fragments:Object.freeze(n)});let i=null,a=!1;this.#n=this.getAbiCoder(),this.fragments.forEach((c,u)=>{let l;switch(c.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Pe(this,{deploy:c});return;case"fallback":c.inputs.length===0?a=!0:(j(!i||c.payable!==i.payable,"conflicting fallback fragments",`fragments[${u}]`,c),i=c,a=i.payable);return;case"function":l=this.#r;break;case"event":l=this.#t;break;case"error":l=this.#e;break;default:return}const d=c.format();l.has(d)||l.set(d,c)}),this.deploy||Pe(this,{deploy:en.from("constructor()")}),Pe(this,{fallback:i,receive:a})}format(e){const t=e?"minimal":"full";return this.fragments.map(i=>i.format(t))}formatJson(){const e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return Pi.defaultAbiCoder()}#i(e,t,n){if(ht(e)){const a=e.toLowerCase();for(const c of this.#r.values())if(a===c.selector)return c;return null}if(e.indexOf("(")===-1){const a=[];for(const[c,u]of this.#r)c.split("(")[0]===e&&a.push(u);if(t){const c=t.length>0?t[t.length-1]:null;let u=t.length,l=!0;Rt.isTyped(c)&&c.type==="overrides"&&(l=!1,u--);for(let d=a.length-1;d>=0;d--){const h=a[d].inputs.length;h!==u&&(!l||h!==u-1)&&a.splice(d,1)}for(let d=a.length-1;d>=0;d--){const h=a[d].inputs;for(let m=0;m<t.length;m++)if(Rt.isTyped(t[m])){if(m>=h.length){if(t[m].type==="overrides")continue;a.splice(d,1);break}if(t[m].type!==h[m].baseType){a.splice(d,1);break}}}}if(a.length===1&&t&&t.length!==a[0].inputs.length){const c=t[t.length-1];(c==null||Array.isArray(c)||typeof c!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&n){const c=a.map(u=>JSON.stringify(u.format())).join(", ");j(!1,`ambiguous function description (i.e. matches ${c})`,"key",e)}return a[0]}const i=this.#r.get(Hr.from(e).format());return i||null}getFunctionName(e){const t=this.#i(e,null,!1);return j(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#i(e,null,!1)}getFunction(e,t){return this.#i(e,t||null,!0)}forEachFunction(e){const t=Array.from(this.#r.keys());t.sort((n,i)=>n.localeCompare(i));for(let n=0;n<t.length;n++){const i=t[n];e(this.#r.get(i),n)}}#a(e,t,n){if(ht(e)){const a=e.toLowerCase();for(const c of this.#t.values())if(a===c.topicHash)return c;return null}if(e.indexOf("(")===-1){const a=[];for(const[c,u]of this.#t)c.split("(")[0]===e&&a.push(u);if(t){for(let c=a.length-1;c>=0;c--)a[c].inputs.length<t.length&&a.splice(c,1);for(let c=a.length-1;c>=0;c--){const u=a[c].inputs;for(let l=0;l<t.length;l++)if(Rt.isTyped(t[l])&&t[l].type!==u[l].baseType){a.splice(c,1);break}}}if(a.length===0)return null;if(a.length>1&&n){const c=a.map(u=>JSON.stringify(u.format())).join(", ");j(!1,`ambiguous event description (i.e. matches ${c})`,"key",e)}return a[0]}const i=this.#t.get(zr.from(e).format());return i||null}getEventName(e){const t=this.#a(e,null,!1);return j(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#a(e,null,!1)}getEvent(e,t){return this.#a(e,t||null,!0)}forEachEvent(e){const t=Array.from(this.#t.keys());t.sort((n,i)=>n.localeCompare(i));for(let n=0;n<t.length;n++){const i=t[n];e(this.#t.get(i),n)}}getError(e,t){if(ht(e)){const i=e.toLowerCase();if(cx[i])return sr.from(cx[i].signature);for(const a of this.#e.values())if(i===a.selector)return a;return null}if(e.indexOf("(")===-1){const i=[];for(const[a,c]of this.#e)a.split("(")[0]===e&&i.push(c);if(i.length===0)return e==="Error"?sr.from("error Error(string)"):e==="Panic"?sr.from("error Panic(uint256)"):null;if(i.length>1){const a=i.map(c=>JSON.stringify(c.format())).join(", ");j(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=sr.from(e).format(),e==="Error(string)")return sr.from("error Error(string)");if(e==="Panic(uint256)")return sr.from("error Panic(uint256)");const n=this.#e.get(e);return n||null}forEachError(e){const t=Array.from(this.#e.keys());t.sort((n,i)=>n.localeCompare(i));for(let n=0;n<t.length;n++){const i=t[n];e(this.#e.get(i),n)}}_decodeParams(e,t){return this.#n.decode(e,t)}_encodeParams(e,t){return this.#n.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if(typeof e=="string"){const n=this.getError(e);j(n,"unknown error","fragment",e),e=n}return j(pt(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,pt(t,4))}encodeErrorResult(e,t){if(typeof e=="string"){const n=this.getError(e);j(n,"unknown error","fragment",e),e=n}return Ye([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if(typeof e=="string"){const n=this.getFunction(e);j(n,"unknown function","fragment",e),e=n}return j(pt(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,pt(t,4))}encodeFunctionData(e,t){if(typeof e=="string"){const n=this.getFunction(e);j(n,"unknown function","fragment",e),e=n}return Ye([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if(typeof e=="string"){const a=this.getFunction(e);j(a,"unknown function","fragment",e),e=a}let n="invalid length for result data";const i=Ht(t);if(i.length%32===0)try{return this.#n.decode(e.outputs,i)}catch{n="could not decode result data"}fe(!1,n,"BAD_DATA",{value:xe(i),info:{method:e.name,signature:e.format()}})}makeError(e,t){const n=ve(e,"data"),i=Pi.getBuiltinCallException("call",t,n);if(i.message.startsWith("execution reverted (unknown custom error)")){const u=xe(n.slice(0,4)),l=this.getError(u);if(l)try{const d=this.#n.decode(l.inputs,n.slice(4));i.revert={name:l.name,signature:l.format(),args:d},i.reason=i.revert.signature,i.message=`execution reverted: ${i.reason}`}catch{i.message="execution reverted (coult not decode custom error)"}}const c=this.parseTransaction(t);return c&&(i.invocation={method:c.name,signature:c.signature,args:c.args}),i}encodeFunctionResult(e,t){if(typeof e=="string"){const n=this.getFunction(e);j(n,"unknown function","fragment",e),e=n}return xe(this.#n.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if(typeof e=="string"){const a=this.getEvent(e);j(a,"unknown event","eventFragment",e),e=a}fe(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const i=(a,c)=>a.type==="string"?an(c):a.type==="bytes"?bt(xe(c)):(a.type==="bool"&&typeof c=="boolean"?c=c?"0x01":"0x00":a.type.match(/^u?int/)?c=sn(c):a.type.match(/^bytes/)?c=T5(c,32):a.type==="address"&&this.#n.encode(["address"],[c]),nn(xe(c),32));for(t.forEach((a,c)=>{const u=e.inputs[c];if(!u.indexed){j(a==null,"cannot filter non-indexed parameters; must be null","contract."+u.name,a);return}a==null?n.push(null):u.baseType==="array"||u.baseType==="tuple"?j(!1,"filtering with tuples or arrays not supported","contract."+u.name,a):Array.isArray(a)?n.push(a.map(l=>i(u,l))):n.push(i(u,a))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,t){if(typeof e=="string"){const c=this.getEvent(e);j(c,"unknown event","eventFragment",e),e=c}const n=[],i=[],a=[];return e.anonymous||n.push(e.topicHash),j(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((c,u)=>{const l=t[u];if(c.indexed)if(c.type==="string")n.push(an(l));else if(c.type==="bytes")n.push(bt(l));else{if(c.baseType==="tuple"||c.baseType==="array")throw new Error("not implemented");n.push(this.#n.encode([c.type],[l]))}else i.push(c),a.push(l)}),{data:this.#n.encode(i,a),topics:n}}decodeEventLog(e,t,n){if(typeof e=="string"){const E=this.getEvent(e);j(E,"unknown event","eventFragment",e),e=E}if(n!=null&&!e.anonymous){const E=e.topicHash;j(ht(n[0],32)&&n[0].toLowerCase()===E,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],a=[],c=[];e.inputs.forEach((E,O)=>{E.indexed?E.type==="string"||E.type==="bytes"||E.baseType==="tuple"||E.baseType==="array"?(i.push(ft.from({type:"bytes32",name:E.name})),c.push(!0)):(i.push(E),c.push(!1)):(a.push(E),c.push(!1))});const u=n!=null?this.#n.decode(i,Ye(n)):null,l=this.#n.decode(a,t,!0),d=[],h=[];let m=0,y=0;return e.inputs.forEach((E,O)=>{let R=null;if(E.indexed)if(u==null)R=new ax(null);else if(c[O])R=new ax(u[y++]);else try{R=u[y++]}catch(P){R=P}else try{R=l[m++]}catch(P){R=P}d.push(R),h.push(E.name||null)}),Zr.fromItems(d,h)}parseTransaction(e){const t=ve(e.data,"tx.data"),n=Se(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(xe(t.slice(0,4)));if(!i)return null;const a=this.#n.decode(i.inputs,t.slice(4));return new EB(i,i.selector,a,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new AB(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=xe(e),n=this.getError(pt(t,0,4));if(!n)return null;const i=this.#n.decode(n.inputs,pt(t,4));return new vB(n,n.selector,i)}static from(e){return e instanceof Mn?e:typeof e=="string"?new Mn(JSON.parse(e)):typeof e.formatJson=="function"?new Mn(e.formatJson()):typeof e.format=="function"?new Mn(e.format("json")):new Mn(e)}}const D1=BigInt(0);function Ai(r){return r??null}function St(r){return r==null?null:r.toString()}class ux{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,n){Pe(this,{gasPrice:Ai(e),maxFeePerGas:Ai(t),maxPriorityFeePerGas:Ai(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:St(e),maxFeePerGas:St(t),maxPriorityFeePerGas:St(n)}}}function ks(r){const e={};r.to&&(e.to=r.to),r.from&&(e.from=r.from),r.data&&(e.data=xe(r.data));const t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of t)!(i in r)||r[i]==null||(e[i]=Se(r[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in r)||r[i]==null||(e[i]=Le(r[i],`request.${i}`));return r.accessList&&(e.accessList=Zn(r.accessList)),r.authorizationList&&(e.authorizationList=r.authorizationList.slice()),"blockTag"in r&&(e.blockTag=r.blockTag),"enableCcipRead"in r&&(e.enableCcipRead=!!r.enableCcipRead),"customData"in r&&(e.customData=r.customData),"blobVersionedHashes"in r&&r.blobVersionedHashes&&(e.blobVersionedHashes=r.blobVersionedHashes.slice()),"kzg"in r&&(e.kzg=r.kzg),"blobWrapperVersion"in r&&(e.blobWrapperVersion=r.blobWrapperVersion),"blobs"in r&&r.blobs&&(e.blobs=r.blobs.map(i=>fo(i)?xe(i):Object.assign({},i))),e}class RB{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#e;constructor(e,t){this.#e=e.transactions.map(n=>typeof n!="string"?new Ws(n,t):n),Pe(this,{provider:t,hash:Ai(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Ai(e.prevRandao),extraData:e.extraData,baseFeePerGas:Ai(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#e.map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=this.#e.slice();return e.length===0?[]:(fe(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:i,gasUsed:a,hash:c,miner:u,prevRandao:l,nonce:d,number:h,parentHash:m,parentBeaconBlockRoot:y,stateRoot:E,receiptsRoot:O,timestamp:R,transactions:P}=this;return{_type:"Block",baseFeePerGas:St(e),difficulty:St(t),extraData:n,gasLimit:St(i),gasUsed:St(a),blobGasUsed:St(this.blobGasUsed),excessBlobGas:St(this.excessBlobGas),hash:c,miner:u,prevRandao:l,nonce:d,number:h,parentHash:m,timestamp:R,parentBeaconBlockRoot:y,stateRoot:E,receiptsRoot:O,transactions:P}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#e.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let t;if(typeof e=="number")t=this.#e[e];else{const n=e.toLowerCase();for(const i of this.#e)if(typeof i=="string"){if(i!==n)continue;t=i;break}else{if(i.hash!==n)continue;t=i;break}}if(t==null)throw new Error("no such tx");return typeof t=="string"?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){const t=this.prefetchedTransactions;if(typeof e=="number")return t[e];e=e.toLowerCase();for(const n of t)if(n.hash===e)return n;j(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return BB(this)}}class Ks{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,t){this.provider=t;const n=Object.freeze(e.topics.slice());Pe(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:t,blockNumber:n,data:i,index:a,removed:c,topics:u,transactionHash:l,transactionIndex:d}=this;return{_type:"log",address:e,blockHash:t,blockNumber:n,data:i,index:a,removed:c,topics:u,transactionHash:l,transactionIndex:d}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return fe(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return fe(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return fe(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return TB(this)}}class U1{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#e;constructor(e,t){this.#e=Object.freeze(e.logs.map(i=>new Ks(i,t)));let n=D1;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Pe(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#e}toJSON(){const{to:e,from:t,contractAddress:n,hash:i,index:a,blockHash:c,blockNumber:u,logsBloom:l,logs:d,status:h,root:m}=this;return{_type:"TransactionReceipt",blockHash:c,blockNumber:u,contractAddress:n,cumulativeGasUsed:St(this.cumulativeGasUsed),from:t,gasPrice:St(this.gasPrice),blobGasUsed:St(this.blobGasUsed),blobGasPrice:St(this.blobGasPrice),gasUsed:St(this.gasUsed),hash:i,index:a,logs:d,logsBloom:l,root:m,status:h,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return M1(this)}reorderedEvent(e){return fe(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),L1(this,e)}}class Ws{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;authorizationList;#e;constructor(e,t){this.provider=t,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,this.authorizationList=e.authorizationList!=null?e.authorizationList:null,this.#e=-1}toJSON(){const{blockNumber:e,blockHash:t,index:n,hash:i,type:a,to:c,from:u,nonce:l,data:d,signature:h,accessList:m,blobVersionedHashes:y}=this;return{_type:"TransactionResponse",accessList:m,blockNumber:e,blockHash:t,blobVersionedHashes:y,chainId:St(this.chainId),data:d,from:u,gasLimit:St(this.gasLimit),gasPrice:St(this.gasPrice),hash:i,maxFeePerGas:St(this.maxFeePerGas),maxPriorityFeePerGas:St(this.maxPriorityFeePerGas),maxFeePerBlobGas:St(this.maxFeePerBlobGas),nonce:l,signature:h,to:c,index:n,type:a,value:St(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;const t=this.provider.getBlock(e);if(t==null)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:t,blockNumber:n}=await Kt({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return t==null||t.blockNumber==null?0:n-t.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){const n=e??1,i=t??0;let a=this.#e,c=-1,u=a===-1;const l=async()=>{if(u)return null;const{blockNumber:y,nonce:E}=await Kt({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(E<this.nonce){a=y;return}if(u)return null;const O=await this.getTransaction();if(!(O&&O.blockNumber!=null))for(c===-1&&(c=a-3,c<this.#e&&(c=this.#e));c<=y;){if(u)return null;const R=await this.provider.getBlock(c,!0);if(R==null)return;for(const P of R)if(P===this.hash)return;for(let P=0;P<R.length;P++){const v=await R.getTransaction(P);if(v.from===this.from&&v.nonce===this.nonce){if(u)return null;const C=await this.provider.getTransactionReceipt(v.hash);if(C==null||y-C.blockNumber+1<n)return;let N="replaced";v.data===this.data&&v.to===this.to&&v.value===this.value?N="repriced":v.data==="0x"&&v.from===v.to&&v.value===D1&&(N="cancelled"),fe(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:N==="replaced"||N==="cancelled",reason:N,replacement:v.replaceableTransaction(a),hash:v.hash,receipt:C})}}c++}},d=y=>{if(y==null||y.status!==0)return y;fe(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:y.to,from:y.from,data:""},receipt:y})},h=await this.provider.getTransactionReceipt(this.hash);if(n===0)return d(h);if(h){if(n===1||await h.confirmations()>=n)return d(h)}else if(await l(),n===0)return null;return await new Promise((y,E)=>{const O=[],R=()=>{O.forEach(v=>v())};if(O.push(()=>{u=!0}),i>0){const v=setTimeout(()=>{R(),E(yt("wait for transaction timeout","TIMEOUT"))},i);O.push(()=>{clearTimeout(v)})}const P=async v=>{if(await v.confirmations()>=n){R();try{y(d(v))}catch(C){E(C)}}};if(O.push(()=>{this.provider.off(this.hash,P)}),this.provider.on(this.hash,P),a>=0){const v=async()=>{try{await l()}catch(C){if(zt(C,"TRANSACTION_REPLACED")){R(),E(C);return}}u||this.provider.once("block",v)};O.push(()=>{this.provider.off("block",v)}),this.provider.once("block",v)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return fe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),M1(this)}reorderedEvent(e){return fe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),fe(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),L1(this,e)}replaceableTransaction(e){j(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new Ws(this,this.provider);return t.#e=e,t}}function BB(r){return{orphan:"drop-block",hash:r.hash,number:r.number}}function L1(r,e){return{orphan:"reorder-transaction",tx:r,other:e}}function M1(r){return{orphan:"drop-transaction",tx:r}}function TB(r){return{orphan:"drop-log",log:{transactionHash:r.transactionHash,blockHash:r.blockHash,blockNumber:r.blockNumber,address:r.address,data:r.data,topics:Object.freeze(r.topics.slice()),index:r.index}}}class X0 extends Ks{interface;fragment;args;constructor(e,t,n){super(e,e.provider);const i=t.decodeEventLog(n,e.data,e.topics);Pe(this,{args:i,fragment:n,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class _1 extends Ks{error;constructor(e,t){super(e,e.provider),Pe(this,{error:t})}}class SB extends U1{#e;constructor(e,t,n){super(n,t),this.#e=e}get logs(){return super.logs.map(e=>{const t=e.topics.length?this.#e.getEvent(e.topics[0]):null;if(t)try{return new X0(e,this.#e,t)}catch(n){return new _1(e,n)}return e})}}class Z0 extends Ws{#e;constructor(e,t,n){super(n,t),this.#e=e}async wait(e,t){const n=await super.wait(e,t);return n==null?null:new SB(this.#e,this.provider,n)}}class V1 extends Wy{log;constructor(e,t,n,i){super(e,t,n),Pe(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class OB extends V1{constructor(e,t,n,i,a){super(e,t,n,new X0(a,e.interface,i));const c=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Pe(this,{args:c,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const lx=BigInt(0);function G1(r){return r&&typeof r.call=="function"}function j1(r){return r&&typeof r.estimateGas=="function"}function Ro(r){return r&&typeof r.resolveName=="function"}function z1(r){return r&&typeof r.sendTransaction=="function"}function H1(r){if(r!=null){if(Ro(r))return r;if(r.provider)return r.provider}}class IB{#e;fragment;constructor(e,t,n){if(Pe(this,{fragment:t}),t.inputs.length<n.length)throw new Error("too many arguments");const i=Wn(e.runner,"resolveName"),a=Ro(i)?i:null;this.#e=(async function(){const c=await Promise.all(t.inputs.map((u,l)=>n[l]==null?null:u.walkAsync(n[l],(h,m)=>h==="address"?Array.isArray(m)?Promise.all(m.map(y=>_t(y,a))):_t(m,a):m)));return e.interface.encodeFilterTopics(t,c)})()}getTopicFilter(){return this.#e}}function Wn(r,e){return r==null?null:typeof r[e]=="function"?r:r.provider&&typeof r.provider[e]=="function"?r.provider:null}function Gn(r){return r==null?null:r.provider||null}async function q1(r,e){const t=Rt.dereference(r,"overrides");j(typeof t=="object","invalid overrides parameter","overrides",r);const n=ks(t);return j(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),j(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function CB(r,e,t){const n=Wn(r,"resolveName"),i=Ro(n)?n:null;return await Promise.all(e.map((a,c)=>a.walkAsync(t[c],(u,l)=>(l=Rt.dereference(l,u),u==="address"?_t(l,i):l))))}function PB(r){const e=async function(c){const u=await q1(c,["data"]);u.to=await r.getAddress(),u.from&&(u.from=await _t(u.from,H1(r.runner)));const l=r.interface,d=Se(u.value||lx,"overrides.value")===lx,h=(u.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!h&&!d&&j(!1,"cannot send data to receive or send value to non-payable fallback","overrides",c),j(l.fallback||h,"cannot send data to receive-only contract","overrides.data",u.data);const m=l.receive||l.fallback&&l.fallback.payable;return j(m||d,"cannot send value to non-payable fallback","overrides.value",u.value),j(l.fallback||h,"cannot send data to receive-only contract","overrides.data",u.data),u},t=async function(c){const u=Wn(r.runner,"call");fe(G1(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(c);try{return await u.call(l)}catch(d){throw F0(d)&&d.data?r.interface.makeError(d.data,l):d}},n=async function(c){const u=r.runner;fe(z1(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await u.sendTransaction(await e(c)),d=Gn(r.runner);return new Z0(r.interface,d,l)},i=async function(c){const u=Wn(r.runner,"estimateGas");return fe(j1(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await e(c))},a=async c=>await n(c);return Pe(a,{_contract:r,estimateGas:i,populateTransaction:e,send:n,staticCall:t}),a}function NB(r,e){const t=function(...d){const h=r.interface.getFunction(e,d);return fe(h,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:d}}),h},n=async function(...d){const h=t(...d);let m={};if(h.inputs.length+1===d.length&&(m=await q1(d.pop()),m.from&&(m.from=await _t(m.from,H1(r.runner)))),h.inputs.length!==d.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const y=await CB(r.runner,h.inputs,d);return Object.assign({},m,await Kt({to:r.getAddress(),data:r.interface.encodeFunctionData(h,y)}))},i=async function(...d){const h=await u(...d);return h.length===1?h[0]:h},a=async function(...d){const h=r.runner;fe(z1(h),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const m=await h.sendTransaction(await n(...d)),y=Gn(r.runner);return new Z0(r.interface,y,m)},c=async function(...d){const h=Wn(r.runner,"estimateGas");return fe(j1(h),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await h.estimateGas(await n(...d))},u=async function(...d){const h=Wn(r.runner,"call");fe(G1(h),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const m=await n(...d);let y="0x";try{y=await h.call(m)}catch(O){throw F0(O)&&O.data?r.interface.makeError(O.data,m):O}const E=t(...d);return r.interface.decodeFunctionResult(E,y)},l=async(...d)=>t(...d).constant?await i(...d):await a(...d);return Pe(l,{name:r.interface.getFunctionName(e),_contract:r,_key:e,getFragment:t,estimateGas:c,populateTransaction:n,send:a,staticCall:i,staticCallResult:u}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const d=r.interface.getFunction(e);return fe(d,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),d}}),l}function kB(r,e){const t=function(...i){const a=r.interface.getEvent(e,i);return fe(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},n=function(...i){return new IB(r,t(...i),i)};return Pe(n,{name:r.interface.getEventName(e),_contract:r,_key:e,getFragment:t}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=r.interface.getEvent(e);return fe(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const Qa=Symbol.for("_ethersInternal_contract"),$1=new WeakMap;function FB(r,e){$1.set(r[Qa],e)}function ur(r){return $1.get(r[Qa])}function DB(r){return r&&typeof r=="object"&&"getTopicFilter"in r&&typeof r.getTopicFilter=="function"&&r.fragment}async function eh(r,e){let t,n=null;if(Array.isArray(e)){const a=function(c){if(ht(c,32))return c;const u=r.interface.getEvent(c);return j(u,"unknown fragment","name",c),u.topicHash};t=e.map(c=>c==null?null:Array.isArray(c)?c.map(a):a(c))}else e==="*"?t=[null]:typeof e=="string"?ht(e,32)?t=[e]:(n=r.interface.getEvent(e),j(n,"unknown fragment","event",e),t=[n.topicHash]):DB(e)?t=await e.getTopicFilter():"fragment"in e?(n=e.fragment,t=[n.topicHash]):j(!1,"unknown event name","event",e);t=t.map(a=>{if(a==null)return null;if(Array.isArray(a)){const c=Array.from(new Set(a.map(u=>u.toLowerCase())).values());return c.length===1?c[0]:(c.sort(),c)}return a.toLowerCase()});const i=t.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:n,tag:i,topics:t}}async function hs(r,e){const{subs:t}=ur(r);return t.get((await eh(r,e)).tag)||null}async function fx(r,e,t){const n=Gn(r.runner);fe(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:c}=await eh(r,t),{addr:u,subs:l}=ur(r);let d=l.get(a);if(!d){const m={address:u||r,topics:c},y=P=>{let v=i;if(v==null)try{v=r.interface.getEvent(P.topics[0])}catch{}if(v){const C=v,N=i?r.interface.decodeEventLog(i,P.data,P.topics):[];a0(r,t,N,F=>new OB(r,F,t,C,P))}else a0(r,t,[],C=>new V1(r,C,t,P))};let E=[];d={tag:a,listeners:[],start:()=>{E.length||E.push(n.on(m,y))},stop:async()=>{if(E.length==0)return;let P=E;E=[],await Promise.all(P),n.off(m,y)}},l.set(a,d)}return d}let s0=Promise.resolve();async function UB(r,e,t,n){await s0;const i=await hs(r,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:c,once:u})=>{const l=Array.from(t);n&&l.push(n(u?null:c));try{c.call(r,...l)}catch{}return!u}),i.listeners.length===0&&(i.stop(),ur(r).subs.delete(i.tag)),a>0}async function a0(r,e,t,n){try{await s0}catch{}const i=UB(r,e,t,n);return s0=i,await i}const Ta=["then"];class gs{target;interface;runner;filters;[Qa];fallback;constructor(e,t,n,i){j(typeof e=="string"||Xg(e),"invalid value for Contract target","target",e),n==null&&(n=null);const a=Mn.from(t);Pe(this,{target:e,runner:n,interface:a}),Object.defineProperty(this,Qa,{value:{}});let c,u=null,l=null;if(i){const m=Gn(n);l=new Z0(this.interface,m,i)}let d=new Map;if(typeof e=="string")if(ht(e))u=e,c=Promise.resolve(e);else{const m=Wn(n,"resolveName");if(!Ro(m))throw yt("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});c=m.resolveName(e).then(y=>{if(y==null)throw yt("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return ur(this).addr=y,y})}else c=e.getAddress().then(m=>{if(m==null)throw new Error("TODO");return ur(this).addr=m,m});FB(this,{addrPromise:c,addr:u,deployTx:l,subs:d});const h=new Proxy({},{get:(m,y,E)=>{if(typeof y=="symbol"||Ta.indexOf(y)>=0)return Reflect.get(m,y,E);try{return this.getEvent(y)}catch(O){if(!zt(O,"INVALID_ARGUMENT")||O.argument!=="key")throw O}},has:(m,y)=>Ta.indexOf(y)>=0?Reflect.has(m,y):Reflect.has(m,y)||this.interface.hasEvent(String(y))});return Pe(this,{filters:h}),Pe(this,{fallback:a.receive||a.fallback?PB(this):null}),new Proxy(this,{get:(m,y,E)=>{if(typeof y=="symbol"||y in m||Ta.indexOf(y)>=0)return Reflect.get(m,y,E);try{return m.getFunction(y)}catch(O){if(!zt(O,"INVALID_ARGUMENT")||O.argument!=="key")throw O}},has:(m,y)=>typeof y=="symbol"||y in m||Ta.indexOf(y)>=0?Reflect.has(m,y):m.interface.hasFunction(y)})}connect(e){return new gs(this.target,this.interface,e)}attach(e){return new gs(e,this.interface,this.runner)}async getAddress(){return await ur(this).addrPromise}async getDeployedCode(){const e=Gn(this.runner);fe(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=Gn(this.runner);return fe(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const c=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",c)}catch(u){a(u)}};c()})}deploymentTransaction(){return ur(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),NB(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),kB(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){t==null&&(t=0),n==null&&(n="latest");const{addr:i,addrPromise:a}=ur(this),c=i||await a,{fragment:u,topics:l}=await eh(this,e),d={address:c,topics:l,fromBlock:t,toBlock:n},h=Gn(this.runner);return fe(h,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await h.getLogs(d)).map(m=>{let y=u;if(y==null)try{y=this.interface.getEvent(m.topics[0])}catch{}if(y)try{return new X0(m,this.interface,y)}catch(E){return new _1(m,E)}return new Ks(m,h)})}async on(e,t){const n=await fx(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){const n=await fx(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e,...t){return await a0(this,e,t,null)}async listenerCount(e){if(e){const i=await hs(this,e);return i?i.listeners.length:0}const{subs:t}=ur(this);let n=0;for(const{listeners:i}of t.values())n+=i.length;return n}async listeners(e){if(e){const i=await hs(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:t}=ur(this);let n=[];for(const{listeners:i}of t.values())n=n.concat(i.map(({listener:a})=>a));return n}async off(e,t){const n=await hs(this,e);if(!n)return this;if(t){const i=n.listeners.map(({listener:a})=>a).indexOf(t);i>=0&&n.listeners.splice(i,1)}return(t==null||n.listeners.length===0)&&(n.stop(),ur(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const t=await hs(this,e);if(!t)return this;t.stop(),ur(this).subs.delete(t.tag)}else{const{subs:t}=ur(this);for(const{tag:n,stop:i}of t.values())i(),t.delete(n)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends gs{constructor(i,a=null){super(i,e,a)}}return t}static from(e,t,n){return n==null&&(n=null),new this(e,t,n)}}function LB(){return gs}class ws extends LB(){}function Tf(r){return r.match(/^ipfs:\/\/ipfs\//i)?r=r.substring(12):r.match(/^ipfs:\/\//i)?r=r.substring(7):j(!1,"unsupported IPFS format","link",r),`https://gateway.ipfs.io/ipfs/${r}`}class MB{name;constructor(e){Pe(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}const K1=new RegExp("^(ipfs)://(.*)$","i"),hx=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),K1,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class Ei{provider;address;name;#e;#t;constructor(e,t,n){Pe(this,{provider:e,address:t,name:n}),this.#e=null,this.#t=new ws(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return this.#e==null&&(this.#e=(async()=>{try{return await this.#t.supportsInterface("0x9061b923")}catch(e){if(zt(e,"CALL_EXCEPTION"))return!1;throw this.#e=null,e}})()),await this.#e}async#r(e,t){t=(t||[]).slice();const n=this.#t.interface;t.unshift(i0(this.name));let i=null;await this.supportsWildcard()&&(i=n.getFunction(e),fe(i,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[X9(this.name,255),n.encodeFunctionData(i,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{const a=await this.#t[e](...t);return i?n.decodeFunctionResult(i,a)[0]:a}catch(a){if(!zt(a,"CALL_EXCEPTION"))throw a}return null}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await this.#r("addr(bytes32)");return a==null||a===Ss?null:a}catch(a){if(zt(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const c=await this.#r("addr(bytes32,uint)",[a]);if(ht(c,20))return $e(c)}let t=null;for(const a of this.provider.plugins)if(a instanceof MB&&a.supportsCoinType(e)){t=a;break}if(t==null)return null;const n=await this.#r("addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await t.decodeAddress(e,n);if(i!=null)return i;fe(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const t=await this.#r("text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){const e=await this.#r("contenthash(bytes32)");if(e==null||e==="0x")return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const i=t[1]==="e3010170"?"ipfs":"ipns",a=parseInt(t[4],16);if(t[5].length===a*2)return`${i}://${Ky("0x"+t[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;fe(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let n=0;n<hx.length;n++){const i=t.match(hx[n]);if(i==null)continue;const a=i[1].toLowerCase();switch(a){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{const c=Tf(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:c}),{linkage:e,url:c}}case"erc721":case"erc1155":{const c=a==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:a,value:t});const u=await this.getAddress();if(u==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const l=(i[2]||"").split("/");if(l.length!==2)return e.push({type:`!${a}caip`,value:i[2]||""}),{url:null,linkage:e};const d=l[1],h=new ws(l[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(a==="erc721"){const R=await h.ownerOf(d);if(u!==R)return e.push({type:"!owner",value:R}),{url:null,linkage:e};e.push({type:"owner",value:R})}else if(a==="erc1155"){const R=await h.balanceOf(u,d);if(!R)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:R.toString()})}let m=await h[c](d);if(m==null||m==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:m}),a==="erc1155"&&(m=m.replace("{id}",sn(d,32).substring(2)),e.push({type:"metadata-url-expanded",value:m})),m.match(/^ipfs:/i)&&(m=Tf(m)),e.push({type:"metadata-url",value:m});let y={};const E=await new $r(m).send();E.assertOk();try{y=E.bodyJson}catch{try{e.push({type:"!metadata",value:E.bodyText})}catch{const v=E.body;return v&&e.push({type:"!metadata",value:xe(v)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!y)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(y)});let O=y.image;if(typeof O!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!O.match(/^(https:\/\/|data:)/i)){if(O.match(K1)==null)return e.push({type:"!imageUrl-ipfs",value:O}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:O}),O=Tf(O)}return e.push({type:"url",value:O}),{linkage:e,url:O}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const t=await e.getNetwork(),n=t.getPlugin("org.ethers.plugins.network.Ens");return fe(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),n.address}static async#n(e,t){const n=await Ei.getEnsAddress(e);try{const a=await new ws(n,["function resolver(bytes32) view returns (address)"],e).resolver(i0(t),{enableCcipRead:!0});return a===Ss?null:a}catch(i){throw i}return null}static async fromName(e,t){let n=t;for(;;){if(n===""||n==="."||t!=="eth"&&n==="eth")return null;const i=await Ei.#n(e,n);if(i!=null){const a=new Ei(e,i,t);return n!==t&&!await a.supportsWildcard()?null:a}n=n.split(".").slice(1).join(".")}}}const dx=BigInt(0);function He(r,e){return(function(t){return t==null?e:r(t)})}function Fs(r,e){return(t=>{if(e&&t==null)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map(n=>r(n))})}function Qs(r,e){return(t=>{const n={};for(const i in r){let a=i;if(e&&i in e&&!(a in t)){for(const c of e[i])if(c in t){a=c;break}}try{const c=r[i](t[a]);c!==void 0&&(n[i]=c)}catch(c){const u=c instanceof Error?c.message:"not-an-error";fe(!1,`invalid value for value.${i} (${u})`,"BAD_DATA",{value:t})}}return n})}function _B(r){switch(r){case!0:case"true":return!0;case!1:case"false":return!1}j(!1,`invalid boolean; ${JSON.stringify(r)}`,"value",r)}function Ni(r){return j(ht(r,!0),"invalid data","value",r),r}function Gt(r){return j(ht(r,32),"invalid hash","value",r),r}const VB=Qs({address:$e,blockHash:Gt,blockNumber:Le,data:Ni,index:Le,removed:He(_B,!1),topics:Fs(Gt),transactionHash:Gt,transactionIndex:Le},{index:["logIndex"]});function GB(r){return VB(r)}const jB=Qs({hash:He(Gt),parentHash:Gt,parentBeaconBlockRoot:He(Gt,null),number:Le,timestamp:Le,nonce:He(Ni),difficulty:Se,gasLimit:Se,gasUsed:Se,stateRoot:He(Gt,null),receiptsRoot:He(Gt,null),blobGasUsed:He(Se,null),excessBlobGas:He(Se,null),miner:He($e),prevRandao:He(Gt,null),extraData:Ni,baseFeePerGas:He(Se)},{prevRandao:["mixHash"]});function zB(r){const e=jB(r);return e.transactions=r.transactions.map(t=>typeof t=="string"?t:W1(t)),e}const HB=Qs({transactionIndex:Le,blockNumber:Le,transactionHash:Gt,address:$e,topics:Fs(Gt),data:Ni,index:Le,blockHash:Gt},{index:["logIndex"]});function qB(r){return HB(r)}const $B=Qs({to:He($e,null),from:He($e,null),contractAddress:He($e,null),index:Le,root:He(xe),gasUsed:Se,blobGasUsed:He(Se,null),logsBloom:He(Ni),blockHash:Gt,hash:Gt,logs:Fs(qB),blockNumber:Le,cumulativeGasUsed:Se,effectiveGasPrice:He(Se),blobGasPrice:He(Se,null),status:He(Le),type:He(Le,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function KB(r){return $B(r)}function W1(r){r.to&&Se(r.to)===dx&&(r.to="0x0000000000000000000000000000000000000000");const e=Qs({hash:Gt,index:He(Le,void 0),type:t=>t==="0x"||t==null?0:Le(t),accessList:He(Zn,null),blobVersionedHashes:He(Fs(Gt,!0),null),authorizationList:He(Fs(t=>{let n;if(t.signature)n=t.signature;else{let i=t.yParity;i==="0x1b"?i=0:i==="0x1c"&&(i=1),n=Object.assign({},t,{yParity:i})}return{address:$e(t.address),chainId:Se(t.chainId),nonce:Se(t.nonce),signature:gt.from(n)}},!1),null),blockHash:He(Gt,null),blockNumber:He(Le,null),transactionIndex:He(Le,null),from:$e,gasPrice:He(Se),maxPriorityFeePerGas:He(Se),maxFeePerGas:He(Se),maxFeePerBlobGas:He(Se,null),gasLimit:Se,to:He($e,null),value:Se,nonce:Le,data:Ni,creates:He($e,null),chainId:He(Se,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(r);if(e.to==null&&e.creates==null&&(e.creates=kR(e)),(r.type===1||r.type===2)&&r.accessList==null&&(e.accessList=[]),r.signature?e.signature=gt.from(r.signature):e.signature=gt.from(r),e.chainId==null){const t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&Se(e.blockHash)===dx&&(e.blockHash=null),e}const WB="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Js{name;constructor(e){Pe(this,{name:e})}clone(){return new Js(this.name)}}class Bo extends Js{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){e==null&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const n={effectiveBlock:e};function i(a,c){let u=(t||{})[a];u==null&&(u=c),j(typeof u=="number",`invalud value for ${a}`,"costs",t),n[a]=u}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),Pe(this,n)}clone(){return new Bo(this.effectiveBlock,this)}}class To extends Js{address;targetNetwork;constructor(e,t){super("org.ethers.plugins.network.Ens"),Pe(this,{address:e||WB,targetNetwork:t??1})}clone(){return new To(this.address,this.targetNetwork)}}class QB extends Js{#e;#t;get url(){return this.#e}get processFunc(){return this.#t}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#e=e,this.#t=t}clone(){return this}}const Sf=new Map;class hr{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=Se(t),this.#r=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#e}set name(e){this.#e=e}get chainId(){return this.#t}set chainId(e){this.#t=Se(e,"chainId")}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Se(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Se(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Se(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(this.#r.values())}attachPlugin(e){if(this.#r.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#r.set(e.name,e.clone()),this}getPlugin(e){return this.#r.get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){const e=new hr(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new Bo;let n=t.txBase;if(e.to==null&&(n+=t.txCreate),e.data)for(let i=2;i<e.data.length;i+=2)e.data.substring(i,i+2)==="00"?n+=t.txDataZero:n+=t.txDataNonzero;if(e.accessList){const i=Zn(e.accessList);for(const a in i)n+=t.txAccessListAddress+t.txAccessListStorageKey*i[a].storageKeys.length}return n}static from(e){if(JB(),e==null)return hr.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const t=Sf.get(e);if(t)return t();if(typeof e=="bigint")return new hr("unknown",e);j(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){j(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const t=new hr(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&t.attachPlugin(new To(e.ensAddress,e.ensNetwork)),t}j(!1,"invalid network","network",e)}static register(e,t){typeof e=="number"&&(e=BigInt(e));const n=Sf.get(e);n&&j(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),Sf.set(e,t)}}function px(r,e){const t=String(r);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${r}`);const n=t.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${r}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function mx(r){return new QB(r,async(e,t,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[a,c]=await Promise.all([n.send(),e()]);i=a;const u=i.bodyJson.standard;return{gasPrice:c.gasPrice,maxFeePerGas:px(u.maxFee,9),maxPriorityFeePerGas:px(u.maxPriorityFee,9)}}catch(a){fe(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:a})}})}let bx=!1;function JB(){if(bx)return;bx=!0;function r(e,t,n){const i=function(){const a=new hr(e,t);return n.ensNetwork!=null&&a.attachPlugin(new To(null,n.ensNetwork)),a.attachPlugin(new Bo),(n.plugins||[]).forEach(c=>{a.attachPlugin(c)}),a};hr.register(e,i),hr.register(t,i),n.altNames&&n.altNames.forEach(a=>{hr.register(a,i)})}r("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),r("ropsten",3,{ensNetwork:3}),r("rinkeby",4,{ensNetwork:4}),r("goerli",5,{ensNetwork:5}),r("kovan",42,{ensNetwork:42}),r("sepolia",11155111,{ensNetwork:11155111}),r("holesky",17e3,{ensNetwork:17e3}),r("classic",61,{}),r("classicKotti",6,{}),r("arbitrum",42161,{ensNetwork:1}),r("arbitrum-goerli",421613,{}),r("arbitrum-sepolia",421614,{}),r("base",8453,{ensNetwork:1}),r("base-goerli",84531,{}),r("base-sepolia",84532,{}),r("bnb",56,{ensNetwork:1}),r("bnbt",97,{}),r("filecoin",314,{}),r("filecoin-calibration",314159,{}),r("linea",59144,{ensNetwork:1}),r("linea-goerli",59140,{}),r("linea-sepolia",59141,{}),r("matic",137,{ensNetwork:1,plugins:[mx("https://gasstation.polygon.technology/v2")]}),r("matic-amoy",80002,{}),r("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[mx("https://gasstation-testnet.polygon.technology/v2")]}),r("optimism",10,{ensNetwork:1,plugins:[]}),r("optimism-goerli",420,{}),r("optimism-sepolia",11155420,{}),r("xdai",100,{ensNetwork:1})}function o0(r){return JSON.parse(JSON.stringify(r))}class YB{#e;#t;#r;#n;constructor(e){this.#e=e,this.#t=null,this.#r=4e3,this.#n=-2}get pollingInterval(){return this.#r}set pollingInterval(e){this.#r=e}async#i(){try{const e=await this.#e.getBlockNumber();if(this.#n===-2){this.#n=e;return}if(e!==this.#n){for(let t=this.#n+1;t<=e;t++){if(this.#t==null)return;await this.#e.emit("block",t)}this.#n=e}}catch{}this.#t!=null&&(this.#t=this.#e._setTimeout(this.#i.bind(this),this.#r))}start(){this.#t||(this.#t=this.#e._setTimeout(this.#i.bind(this),this.#r),this.#i())}stop(){this.#t&&(this.#e._clearTimeout(this.#t),this.#t=null)}pause(e){this.stop(),e&&(this.#n=-2)}resume(){this.start()}}class th{#e;#t;#r;constructor(e){this.#e=e,this.#r=!1,this.#t=t=>{this._poll(t,this.#e)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#r||(this.#r=!0,this.#t(-2),this.#e.on("block",this.#t))}stop(){this.#r&&(this.#r=!1,this.#e.off("block",this.#t))}pause(e){this.stop()}resume(){this.start()}}class XB extends th{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=-2}pause(e){e&&(this.#t=-2),super.pause(e)}async _poll(e,t){const n=await t.getBlock(this.#e);n!=null&&(this.#t===-2?this.#t=n.number:n.number>this.#t&&(t.emit(this.#e,n.number),this.#t=n.number))}}class ZB extends th{#e;constructor(e,t){super(e),this.#e=o0(t)}async _poll(e,t){throw new Error("@TODO")}}class eT extends th{#e;constructor(e,t){super(e),this.#e=t}async _poll(e,t){const n=await t.getTransactionReceipt(this.#e);n&&t.emit(this.#e,n)}}class rh{#e;#t;#r;#n;#i;constructor(e,t){this.#e=e,this.#t=o0(t),this.#r=this.#a.bind(this),this.#n=!1,this.#i=-2}async#a(e){if(this.#i===-2)return;const t=o0(this.#t);t.fromBlock=this.#i+1,t.toBlock=e;const n=await this.#e.getLogs(t);if(n.length===0){this.#i<e-60&&(this.#i=e-60);return}for(const i of n)this.#e.emit(this.#t,i),this.#i=i.blockNumber}start(){this.#n||(this.#n=!0,this.#i===-2&&this.#e.getBlockNumber().then(e=>{this.#i=e}),this.#e.on("block",this.#r))}stop(){this.#n&&(this.#n=!1,this.#e.off("block",this.#r))}pause(e){this.stop(),e&&(this.#i=-2)}resume(){this.start()}}const tT=BigInt(2),rT=10;function Sa(r){return r&&typeof r.then=="function"}function La(r,e){return r+":"+JSON.stringify(e,(t,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((a,c)=>(a[c]=n[c],a),{})}return n})}class Q1{name;constructor(e){Pe(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function nT(r){return JSON.parse(JSON.stringify(r))}function c0(r){return r=Array.from(new Set(r).values()),r.sort(),r}async function Of(r,e){if(r==null)throw new Error("invalid event");if(Array.isArray(r)&&(r={topics:r}),typeof r=="string")switch(r){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:r,tag:r}}if(ht(r,32)){const t=r.toLowerCase();return{type:"transaction",tag:La("tx",{hash:t}),hash:t}}if(r.orphan){const t=r;return{type:"orphan",tag:La("orphan",t),filter:nT(t)}}if(r.address||r.topics){const t=r,n={topics:(t.topics||[]).map(i=>i==null?null:Array.isArray(i)?c0(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(t.address){const i=[],a=[],c=u=>{ht(u)?i.push(u):a.push((async()=>{i.push(await _t(u,e))})())};Array.isArray(t.address)?t.address.forEach(c):c(t.address),a.length&&await Promise.all(a),n.address=c0(i.map(u=>u.toLowerCase()))}return{filter:n,tag:La("event",n),type:"event"}}j(!1,"unknown ProviderEvent","event",r)}function If(){return new Date().getTime()}const iT={cacheTimeout:250,pollingInterval:4e3};class sT{#e;#t;#r;#n;#i;#a;#s;#o;#d;#u;#p;#m;constructor(e,t){if(this.#m=Object.assign({},iT,t||{}),e==="any")this.#a=!0,this.#i=null;else if(e){const n=hr.from(e);this.#a=!1,this.#i=Promise.resolve(n),setTimeout(()=>{this.emit("network",n,null)},0)}else this.#a=!1,this.#i=null;this.#o=-1,this.#s=new Map,this.#e=new Map,this.#t=new Map,this.#r=null,this.#n=!1,this.#d=1,this.#u=new Map,this.#p=!1}get pollingInterval(){return this.#m.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#t.values())}attachPlugin(e){if(this.#t.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#t.set(e.name,e.connect(this)),this}getPlugin(e){return this.#t.get(e)||null}get disableCcipRead(){return this.#p}set disableCcipRead(e){this.#p=!!e}async#c(e){const t=this.#m.cacheTimeout;if(t<0)return await this._perform(e);const n=La(e.method,e);let i=this.#s.get(n);return i||(i=this._perform(e),this.#s.set(n,i),setTimeout(()=>{this.#s.get(n)===i&&this.#s.delete(n)},t)),await i}async ccipReadFetch(e,t,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=t.toLowerCase(),c=[];for(let u=0;u<n.length;u++){const l=n[u],d=l.replace("{sender}",i).replace("{data}",a),h=new $r(d);l.indexOf("{data}")===-1&&(h.body={data:a,sender:i}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:h,index:u,urls:n});let m="unknown error",y;try{y=await h.send()}catch(E){c.push(E.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:h,result:{error:E}});continue}try{const E=y.bodyJson;if(E.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:h,result:E}),E.data;E.message&&(m=E.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:h,result:E})}catch{}fe(y.statusCode<400||y.statusCode>=500,`response not found during CCIP fetch: ${m}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:m}}),c.push(m)}fe(!1,`error encountered during CCIP fetch: ${c.map(u=>JSON.stringify(u)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:c}})}_wrapBlock(e,t){return new RB(zB(e),this)}_wrapLog(e,t){return new Ks(GB(e),this)}_wrapTransactionReceipt(e,t){return new U1(KB(e),this)}_wrapTransactionResponse(e,t){return new Ws(W1(e),this)}_detectNetwork(){fe(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){fe(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Le(await this.#c({method:"getBlockNumber"}),"%response");return this.#o>=0&&(this.#o=e),e}_getAddress(e){return _t(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(ht(e))return ht(e,32)?e:Or(e);if(typeof e=="bigint"&&(e=Le(e,"blockTag")),typeof e=="number")return e>=0?Or(e):this.#o>=0?Or(this.#o+e):this.getBlockNumber().then(t=>Or(t+e));j(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const t=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?c0(l.map(d=>d.toLowerCase())):l.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(l,d,h)=>{let m;switch(l.length){case 0:break;case 1:m=l[0];break;default:l.sort(),m=l}if(n&&(d!=null||h!=null))throw new Error("invalid filter");const y={};return m&&(y.address=m),t.length&&(y.topics=t),d&&(y.fromBlock=d),h&&(y.toBlock=h),n&&(y.blockHash=n),y};let a=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)a.push(this._getAddress(l));else a.push(this._getAddress(e.address));let c;"fromBlock"in e&&(c=this._getBlockTag(e.fromBlock));let u;return"toBlock"in e&&(u=this._getBlockTag(e.toBlock)),a.filter(l=>typeof l!="string").length||c!=null&&typeof c!="string"||u!=null&&typeof u!="string"?Promise.all([Promise.all(a),c,u]).then(l=>i(l[0],l[1],l[2])):i(a,c,u)}_getTransactionRequest(e){const t=ks(e),n=[];if(["to","from"].forEach(i=>{if(t[i]==null)return;const a=_t(t[i],this);Sa(a)?n.push((async function(){t[i]=await a})()):t[i]=a}),t.blockTag!=null){const i=this._getBlockTag(t.blockTag);Sa(i)?n.push((async function(){t.blockTag=await i})()):t.blockTag=i}return n.length?(async function(){return await Promise.all(n),t})():t}async getNetwork(){if(this.#i==null){const i=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw this.#i===i&&(this.#i=null),a}})();return this.#i=i,(await i).clone()}const e=this.#i,[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(this.#a?(this.emit("network",n,t),this.#i===e&&(this.#i=Promise.resolve(n))):fe(!1,`network changed: ${t.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:i,gasPrice:a,priorityFee:c}=await Kt({_block:this.#y("latest",!1),gasPrice:(async()=>{try{const h=await this.#c({method:"getGasPrice"});return Se(h,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const h=await this.#c({method:"getPriorityFee"});return Se(h,"%response")}catch{}return null})()});let u=null,l=null;const d=this._wrapBlock(i,e);return d&&d.baseFeePerGas&&(l=c??BigInt("1000000000"),u=d.baseFeePerGas*tT+l),new ux(a,u,l)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new $r(n.url),a=await n.processFunc(t,this,i);return new ux(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return Sa(t)&&(t=await t),Se(await this.#c({method:"estimateGas",transaction:t}),"%response")}async#l(e,t,n){fe(n<rT,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});const i=ks(e);try{return xe(await this._perform({method:"call",transaction:i,blockTag:t}))}catch(a){if(!this.disableCcipRead&&F0(a)&&a.data&&n>=0&&t==="latest"&&i.to!=null&&pt(a.data,0,4)==="0x556f1830"){const c=a.data,u=await _t(i.to,this);let l;try{l=lT(pt(a.data,4))}catch(m){fe(!1,m.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:c}})}fe(l.sender.toLowerCase()===u.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:c,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const d=await this.ccipReadFetch(i,l.calldata,l.urls);fe(d!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:l.errorArgs}});const h={to:u,data:Ye([l.selector,uT([d,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:h});try{const m=await this.#l(h,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},h),result:m}),m}catch(m){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},h),error:m}),m}}throw a}}async#f(e){const{value:t}=await Kt({network:this.getNetwork(),value:e});return t}async call(e){const{tx:t,blockTag:n}=await Kt({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#f(this.#l(t,n,e.enableCcipRead?0:-1))}async#h(e,t,n){let i=this._getAddress(t),a=this._getBlockTag(n);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await this.#f(this.#c(Object.assign(e,{address:i,blockTag:a})))}async getBalance(e,t){return Se(await this.#h({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return Le(await this.#h({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return xe(await this.#h({method:"getCode"},e,t))}async getStorage(e,t,n){const i=Se(t,"position");return xe(await this.#h({method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:t,hash:n,network:i}=await Kt({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=Ar.from(e);if(a.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(t)}async#y(e,t){if(ht(e,32))return await this.#c({method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await this.#c({method:"getBlock",blockTag:n,includeTransactions:t})}async getBlock(e,t){const{network:n,params:i}=await Kt({network:this.getNetwork(),params:this.#y(e,!!t)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:t,params:n}=await Kt({network:this.getNetwork(),params:this.#c({method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){const{network:t,params:n}=await Kt({network:this.getNetwork(),params:this.#c({method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await this.#c({method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){const{result:t}=await Kt({network:this.getNetwork(),result:this.#c({method:"getTransactionResult",hash:e})});return t==null?null:xe(t)}async getLogs(e){let t=this._getFilter(e);Sa(t)&&(t=await t);const{network:n,params:i}=await Kt({network:this.getNetwork(),params:this.#c({method:"getLogs",filter:t})});return i.map(a=>this._wrapLog(a,n))}_getProvider(e){fe(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Ei.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=$e(e);const t=i0(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await Ei.getEnsAddress(this),a=await new ws(n,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(a==null||a===Ss)return null;const u=await new ws(a,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(u)!==e?null:u}catch(n){if(zt(n,"BAD_DATA")&&n.value==="0x"||zt(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,t,n){const i=t??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,c)=>{let u=null;const l=(async d=>{try{const h=await this.getTransactionReceipt(e);if(h!=null&&d-h.blockNumber+1>=i){a(h),u&&(clearTimeout(u),u=null);return}}catch(h){console.log("EEE",h)}this.once("block",l)});n!=null&&(u=setTimeout(()=>{u!=null&&(u=null,this.off("block",l),c(yt("timeout","TIMEOUT",{reason:"timeout"})))},n)),l(await this.getBlockNumber())})}async waitForBlock(e){fe(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=this.#u.get(e);t&&(t.timer&&clearTimeout(t.timer),this.#u.delete(e))}_setTimeout(e,t){t==null&&(t=0);const n=this.#d++,i=()=>{this.#u.delete(n),e()};if(this.paused)this.#u.set(n,{timer:null,func:i,time:t});else{const a=setTimeout(i,t);this.#u.set(n,{timer:a,func:i,time:If()})}return n}_forEachSubscriber(e){for(const t of this.#e.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Q1(e.type);case"block":{const t=new YB(this);return t.pollingInterval=this.pollingInterval,t}case"safe":case"finalized":return new XB(this,e.type);case"event":return new rh(this,e.filter);case"transaction":return new eT(this,e.hash);case"orphan":return new ZB(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const n of this.#e.values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),this.#r!=null&&t.pause(this.#r);break}}async#b(e,t){let n=await Of(e,this);return n.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(n=await Of({orphan:"drop-log",log:t[0]},this)),this.#e.get(n.tag)||null}async#x(e){const t=await Of(e,this),n=t.tag;let i=this.#e.get(n);return i||(i={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#e.set(n,i)),i}async on(e,t){const n=await this.#x(e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,this.#r!=null&&n.subscriber.pause(this.#r)),this}async once(e,t){const n=await this.#x(e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,this.#r!=null&&n.subscriber.pause(this.#r)),this}async emit(e,...t){const n=await this.#b(e,t);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:a,once:c})=>{const u=new Wy(this,c?null:a,e);try{a.call(this,...t,u)}catch{}return!c}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await this.#b(e);return n?n.listeners.length:0}let t=0;for(const{listeners:n}of this.#e.values())t+=n.length;return t}async listeners(e){if(e){const n=await this.#b(e);return n?n.listeners.map(({listener:i})=>i):[]}let t=[];for(const{listeners:n}of this.#e.values())t=t.concat(n.map(({listener:i})=>i));return t}async off(e,t){const n=await this.#b(e);if(!n)return this;if(t){const i=n.listeners.map(({listener:a})=>a).indexOf(t);i>=0&&n.listeners.splice(i,1)}return(!t||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:n,subscriber:i}=await this.#x(e);n&&i.stop(),this.#e.delete(t)}else for(const[t,{started:n,subscriber:i}]of this.#e)n&&i.stop(),this.#e.delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#n}destroy(){this.removeAllListeners();for(const e of this.#u.keys())this._clearTimeout(e);this.#n=!0}get paused(){return this.#r!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#o=-1,this.#r!=null){if(this.#r==!!e)return;fe(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),this.#r=!!e;for(const t of this.#u.values())t.timer&&clearTimeout(t.timer),t.time=If()-t.time}resume(){if(this.#r!=null){this._forEachSubscriber(e=>e.resume()),this.#r=null;for(const e of this.#u.values()){let t=e.time;t<0&&(t=0),e.time=If(),setTimeout(e.func,t)}}}}function aT(r,e){try{const t=u0(r,e);if(t)return za(t)}catch{}return null}function u0(r,e){if(r==="0x")return null;try{const t=Le(pt(r,e,e+32)),n=Le(pt(r,t,t+32));return pt(r,t+32,t+32+n)}catch{}return null}function xx(r){const e=At(r);if(e.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(e,32-e.length),t}function oT(r){if(r.length%32===0)return r;const e=new Uint8Array(Math.ceil(r.length/32)*32);return e.set(r),e}const cT=new Uint8Array([]);function uT(r){const e=[];let t=0;for(let n=0;n<r.length;n++)e.push(cT),t+=32;for(let n=0;n<r.length;n++){const i=ve(r[n]);e[n]=xx(t),e.push(xx(i.length)),e.push(oT(i)),t+=32+Math.ceil(i.length/32)*32}return Ye(e)}const yx="0x0000000000000000000000000000000000000000000000000000000000000000";function lT(r){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};fe(yi(r)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const t=pt(r,0,32);fe(pt(t,0,12)===pt(yx,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=pt(t,12);try{const n=[],i=Le(pt(r,32,64)),a=Le(pt(r,i,i+32)),c=pt(r,i+32);for(let u=0;u<a;u++){const l=aT(c,u*32);if(l==null)throw new Error("abort");n.push(l)}e.urls=n}catch{fe(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const n=u0(r,64);if(n==null)throw new Error("abort");e.calldata=n}catch{fe(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}fe(pt(r,100,128)===pt(yx,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=pt(r,96,100);try{const n=u0(r,128);if(n==null)throw new Error("abort");e.extraData=n}catch{fe(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}function kn(r,e){if(r.provider)return r.provider;fe(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function gx(r,e){let t=ks(e);if(t.to!=null&&(t.to=_t(t.to,r)),t.from!=null){const n=t.from;t.from=Promise.all([r.getAddress(),_t(n,r)]).then(([i,a])=>(j(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else t.from=r.getAddress();return await Kt(t)}class nh{provider;constructor(e){Pe(this,{provider:e||null})}async getNonce(e){return kn(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await gx(this,e)}async populateTransaction(e){const t=kn(this,"populateTransaction"),n=await gx(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const c=Se(n.chainId);j(c===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const a=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||a)?j(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&a&&j(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const c=await t.getFeeData();fe(c.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=c.gasPrice)}else{const c=await t.getFeeData();if(n.type==null)if(c.maxFeePerGas!=null&&c.maxPriorityFeePerGas!=null)if(n.authorizationList&&n.authorizationList.length?n.type=4:n.type=2,n.gasPrice!=null){const u=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=u,n.maxPriorityFeePerGas=u}else n.maxFeePerGas==null&&(n.maxFeePerGas=c.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=c.maxPriorityFeePerGas);else c.gasPrice!=null?(fe(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=c.gasPrice),n.type=0):fe(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3||n.type===4)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=c.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=c.maxPriorityFeePerGas))}return await Kt(n)}async populateAuthorization(e){const t=Object.assign({},e);return t.chainId==null&&(t.chainId=(await kn(this,"getNetwork").getNetwork()).chainId),t.nonce==null&&(t.nonce=await this.getNonce()),t}async estimateGas(e){return kn(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return kn(this,"call").call(await this.populateCall(e))}async resolveName(e){return await kn(this,"resolveName").resolveName(e)}async sendTransaction(e){const t=kn(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=Ar.from(n);return await t.broadcastTransaction(await this.signTransaction(i))}authorize(e){fe(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}class ih extends nh{address;constructor(e,t){super(t),Pe(this,{address:e})}async getAddress(){return this.address}connect(e){return new ih(this.address,e)}#e(e,t){fe(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:t})}async signTransaction(e){this.#e("transactions","signTransaction")}async signMessage(e){this.#e("messages","signMessage")}async signTypedData(e,t,n){this.#e("typed-data","signTypedData")}}function fT(r){return JSON.parse(JSON.stringify(r))}class J1{#e;#t;#r;#n;#i;#a;constructor(e){this.#e=e,this.#t=null,this.#r=this.#s.bind(this),this.#n=!1,this.#i=null,this.#a=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#s(e){try{this.#t==null&&(this.#t=this._subscribe(this.#e));let t=null;try{t=await this.#t}catch(a){if(!zt(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(t==null){this.#t=null,this.#e._recoverSubscriber(this,this._recover(this.#e));return}const n=await this.#e.getNetwork();if(this.#i||(this.#i=n),this.#i.chainId!==n.chainId)throw new Error("chaid changed");if(this.#a)return;const i=await this.#e.send("eth_getFilterChanges",[t]);await this._emitResults(this.#e,i)}catch(t){console.log("@TODO",t)}this.#e.once("block",this.#r)}#o(){const e=this.#t;e&&(this.#t=null,e.then(t=>{this.#e.destroyed||this.#e.send("eth_uninstallFilter",[t])}))}start(){this.#n||(this.#n=!0,this.#s(-2))}stop(){this.#n&&(this.#n=!1,this.#a=!0,this.#o(),this.#e.off("block",this.#r))}pause(e){e&&this.#o(),this.#e.off("block",this.#r)}resume(){this.start()}}class hT extends J1{#e;constructor(e,t){super(e),this.#e=fT(t)}_recover(e){return new rh(e,this.#e)}async _subscribe(e){return await e.send("eth_newFilter",[this.#e])}async _emitResults(e,t){for(const n of t)e.emit(this.#e,e._wrapLog(n,e._network))}}class dT extends J1{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const n of t)e.emit("pending",n)}}const pT="bigint,boolean,function,number,string,symbol".split(/,/g);function Ma(r){if(r==null||pT.indexOf(typeof r)>=0||typeof r.getAddress=="function")return r;if(Array.isArray(r))return r.map(Ma);if(typeof r=="object")return Object.keys(r).reduce((e,t)=>(e[t]=r[t],e),{});throw new Error(`should not happen: ${r} (${typeof r})`)}function mT(r){return new Promise(e=>{setTimeout(e,r)})}function li(r){return r&&r.toLowerCase()}function wx(r){return r&&typeof r.pollingInterval=="number"}const Y1={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class Cf extends nh{address;constructor(e,t){super(e),t=$e(t),Pe(this,{address:t})}connect(e){fe(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const t=Ma(e),n=[];if(t.from){const a=t.from;n.push((async()=>{const c=await _t(a,this.provider);j(c!=null&&c.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=c})())}else t.from=this.address;if(t.gasLimit==null&&n.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),t.to!=null){const a=t.to;n.push((async()=>{t.to=await _t(a,this.provider)})())}n.length&&await Promise.all(n);const i=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(e){const t=await this.provider.getBlockNumber(),n=await this.sendUncheckedTransaction(e);return await new Promise((i,a)=>{const c=[1e3,100];let u=0;const l=async()=>{try{const d=await this.provider.getTransaction(n);if(d!=null){i(d.replaceableTransaction(t));return}}catch(d){if(zt(d,"CANCELLED")||zt(d,"BAD_DATA")||zt(d,"NETWORK_ERROR")||zt(d,"UNSUPPORTED_OPERATION")){d.info==null&&(d.info={}),d.info.sendTransactionHash=n,a(d);return}if(zt(d,"INVALID_ARGUMENT")&&(u++,d.info==null&&(d.info={}),d.info.sendTransactionHash=n,u>10)){a(d);return}this.provider.emit("error",yt("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:d}))}this.provider._setTimeout(()=>{l()},c.pop()||4e3)};l()})}async signTransaction(e){const t=Ma(e);if(t.from){const i=await _t(t.from,this.provider);j(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=i}else t.from=this.address;const n=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[n])}async signMessage(e){const t=typeof e=="string"?nr(e):e;return await this.provider.send("personal_sign",[xe(t),this.address.toLowerCase()])}async signTypedData(e,t,n){const i=Ma(n),a=await Zt.resolveNames(e,t,i,async c=>{const u=await _t(c);return j(u!=null,"TypedData does not support null address","value",c),u});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(Zt.getPayload(a.domain,t,a.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const t=typeof e=="string"?nr(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),xe(t)])}}class bT extends sT{#e;#t;#r;#n;#i;#a;#s;#o(){if(this.#n)return;const e=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#n=setTimeout(()=>{this.#n=null;const t=this.#r;for(this.#r=[];t.length;){const n=[t.shift()];for(;t.length&&n.length!==this.#e.batchMaxCount;)if(n.push(t.shift()),JSON.stringify(n.map(a=>a.payload)).length>this.#e.batchMaxSize){t.unshift(n.pop());break}(async()=>{const i=n.length===1?n[0].payload:n.map(a=>a.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{const a=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:a});for(const{resolve:c,reject:u,payload:l}of n){if(this.destroyed){u(yt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:l.method}));continue}const d=a.filter(h=>h.id===l.id)[0];if(d==null){const h=yt("missing response for request","BAD_DATA",{value:a,info:{payload:l}});this.emit("error",h),u(h);continue}if("error"in d){u(this.getRpcError(l,d));continue}c(d.result)}}catch(a){this.emit("debug",{action:"receiveRpcError",error:a});for(const{reject:c}of n)c(a)}})()}},e)}constructor(e,t){super(e,t),this.#t=1,this.#e=Object.assign({},Y1,t||{}),this.#r=[],this.#n=null,this.#a=null,this.#s=null;{let i=null;const a=new Promise(c=>{i=c});this.#i={promise:a,resolve:i}}const n=this._getOption("staticNetwork");typeof n=="boolean"?(j(!n||e!=="any","staticNetwork cannot be used on special network 'any'","options",t),n&&e!=null&&(this.#a=hr.from(e))):n&&(j(e==null||n.matches(e),"staticNetwork MUST match network object","options",t),this.#a=n)}_getOption(e){return this.#e[e]}get _network(){return fe(this.#a,"network is not available yet","NETWORK_ERROR"),this.#a}async _perform(e){if(e.method==="call"||e.method==="estimateGas"){let n=e.transaction;if(n&&n.type!=null&&Se(n.type)&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){const i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(e=Object.assign({},e,{transaction:Object.assign({},n,{type:void 0})}))}}const t=this.getRpcRequest(e);return t!=null?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e)if(e===!0){if(this.#a)return this.#a}else return e;return this.#s?await this.#s:this.ready?(this.#s=(async()=>{try{const t=hr.from(Se(await this.send("eth_chainId",[])));return this.#s=null,t}catch(t){throw this.#s=null,t}})(),await this.#s):(this.#s=(async()=>{const t={id:this.#t++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:t});let n;try{n=(await this._send(t))[0],this.#s=null}catch(i){throw this.#s=null,this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:n}),"result"in n)return hr.from(Se(n.result));throw this.getRpcError(t,n)})(),await this.#s)}_start(){this.#i==null||this.#i.resolve==null||(this.#i.resolve(),this.#i=null,(async()=>{for(;this.#a==null&&!this.destroyed;)try{this.#a=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",yt("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await mT(1e3)}this.#o()})())}async _waitUntilReady(){if(this.#i!=null)return await this.#i.promise}_getSubscriber(e){return e.type==="pending"?new dT(this):e.type==="event"?this._getOption("polling")?new rh(this,e.filter):new hT(this,e.filter):e.type==="orphan"&&e.filter.orphan==="drop-log"?new Q1("orphan"):super._getSubscriber(e)}get ready(){return this.#i==null}getRpcTransaction(e){const t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(n=>{if(e[n]==null)return;let i=n;n==="gasLimit"&&(i="gas"),t[i]=Or(Se(e[n],`tx.${n}`))}),["from","to","data"].forEach(n=>{e[n]!=null&&(t[n]=xe(e[n]))}),e.accessList&&(t.accessList=Zn(e.accessList)),e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.map(n=>n.toLowerCase())),e.authorizationList&&(t.authorizationList=e.authorizationList.map(n=>{const i=r1(n);return{address:i.address,nonce:Or(i.nonce),chainId:Or(i.chainId),yParity:Or(i.signature.yParity),r:Or(i.signature.r),s:Or(i.signature.s)}})),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[li(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[li(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[li(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[li(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&e.filter.address!=null&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(li):e.filter.address=li(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){const{method:n}=e,{error:i}=t;if(n==="eth_estimateGas"&&i.message){const u=i.message;if(!u.match(/revert/i)&&u.match(/insufficient funds/i))return yt("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:i}});if(u.match(/nonce/i)&&u.match(/too low/i))return yt("nonce has already been used","NONCE_EXPIRED",{transaction:e.params[0],info:{payload:e,error:i}})}if(n==="eth_call"||n==="eth_estimateGas"){const u=l0(i),l=Pi.getBuiltinCallException(n==="eth_call"?"call":"estimateGas",e.params[0],u?u.data:null);return l.info={error:i,payload:e},l}const a=JSON.stringify(yT(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return yt("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[n]||"unknown",reason:"rejected",info:{payload:e,error:i}});if(n==="eth_sendRawTransaction"||n==="eth_sendTransaction"){const u=e.params[0];if(a.match(/insufficient funds|base fee exceeds gas limit/i))return yt("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:u,info:{error:i}});if(a.match(/nonce/i)&&a.match(/too low/i))return yt("nonce has already been used","NONCE_EXPIRED",{transaction:u,info:{error:i}});if(a.match(/replacement transaction/i)&&a.match(/underpriced/i))return yt("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:u,info:{error:i}});if(a.match(/only replay-protected/i))return yt("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:n,info:{transaction:u,info:{error:i}}})}let c=!!a.match(/the method .* does not exist/i);return c||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(c=!0),c?yt("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:i,payload:e}}):yt("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:e})}send(e,t){if(this.destroyed)return Promise.reject(yt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const n=this.#t++,i=new Promise((a,c)=>{this.#r.push({resolve:a,reject:c,payload:{method:e,params:t,id:n,jsonrpc:"2.0"}})});return this.#o(),i}async getSigner(e){e==null&&(e=0);const t=this.send("eth_accounts",[]);if(typeof e=="number"){const i=await t;if(e>=i.length)throw new Error("no such account");return new Cf(this,i[e])}const{accounts:n}=await Kt({network:this.getNetwork(),accounts:t});e=$e(e);for(const i of n)if($e(i)===e)return new Cf(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(t=>new Cf(this,t))}destroy(){this.#n&&(clearTimeout(this.#n),this.#n=null);for(const{payload:e,reject:t}of this.#r)t(yt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#r=[],super.destroy()}}class xT extends bT{#e;constructor(e,t){super(e,t);let n=this._getOption("pollingInterval");n==null&&(n=Y1.pollingInterval),this.#e=n}_getSubscriber(e){const t=super._getSubscriber(e);return wx(t)&&(t.pollingInterval=this.#e),t}get pollingInterval(){return this.#e}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#e=e,this._forEachSubscriber(t=>{wx(t)&&(t.pollingInterval=this.#e)})}}class rS extends xT{#e;constructor(e,t,n){e==null&&(e="http://localhost:8545"),super(t,n),typeof e=="string"?this.#e=new $r(e):this.#e=e.clone()}_getConnection(){return this.#e.clone()}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){const t=this._getConnection();t.body=JSON.stringify(e),t.setHeader("content-type","application/json");const n=await t.send();n.assertOk();let i=n.bodyJson;return Array.isArray(i)||(i=[i]),i}}function l0(r){if(r==null)return null;if(typeof r.message=="string"&&r.message.match(/revert/i)&&ht(r.data))return{message:r.message,data:r.data};if(typeof r=="object"){for(const e in r){const t=l0(r[e]);if(t)return t}return null}if(typeof r=="string")try{return l0(JSON.parse(r))}catch{}return null}function f0(r,e){if(r!=null){if(typeof r.message=="string"&&e.push(r.message),typeof r=="object")for(const t in r)f0(r[t],e);if(typeof r=="string")try{return f0(JSON.parse(r),e)}catch{}}}function yT(r){const e=[];return f0(r,e),e}class So extends nh{address;#e;constructor(e,t){super(t),j(e&&typeof e.sign=="function","invalid private key","privateKey","[ REDACTED ]"),this.#e=e;const n=$s(this.signingKey.publicKey);Pe(this,{address:n})}get signingKey(){return this.#e}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new So(this.#e,e)}async signTransaction(e){e=ks(e);const{to:t,from:n}=await Kt({to:e.to?_t(e.to,this):void 0,from:e.from?_t(e.from,this):void 0});t!=null&&(e.to=t),n!=null&&(e.from=n),e.from!=null&&(j($e(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const i=Ar.from(e);return i.signature=this.signingKey.sign(i.unsignedHash),i.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(Z9(e)).serialized}authorizeSync(e){j(typeof e.address=="string","invalid address for authorizeSync","auth.address",e);const t=this.signingKey.sign(p9(e));return Object.assign({},{address:$e(e.address),nonce:Se(e.nonce||0),chainId:Se(e.chainId||0)},{signature:t})}async authorize(e){return e=Object.assign({},e,{address:await _t(e.address,this)}),this.authorizeSync(await this.populateAuthorization(e))}async signTypedData(e,t,n){const i=await Zt.resolveNames(e,t,n,async a=>{fe(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:a}});const c=await this.provider.resolveName(a);return fe(c!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:a}),c});return this.signingKey.sign(Zt.hash(i.domain,t,i.value)).serialized}}const Ja=" !#$%&'()*+,-./<=>?@[]^_`{|}~",gT=/^[a-z]*$/i;function Ax(r,e){let t=97;return r.reduce((n,i)=>(i===e?t++:i.match(gT)?n.push(String.fromCharCode(t)+i):(t=97,n.push(i)),n),[])}function wT(r,e){for(let i=Ja.length-1;i>=0;i--)r=r.split(Ja[i]).join(e.substring(2*i,2*i+2));const t=[],n=r.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(i,a,c,u)=>{if(c)for(let l=parseInt(c);l>=0;l--)t.push(";");else t.push(a.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return Ax(Ax(t,";"),":")}function AT(r){return j(r[0]==="0","unsupported auwl data","data",r),wT(r.substring(1+2*Ja.length),r.substring(1,1+2*Ja.length))}class ET{locale;constructor(e){Pe(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}class vT extends ET{#e;#t;constructor(e,t,n){super(e),this.#e=t,this.#t=n,this.#r=null}get _data(){return this.#e}_decodeWords(){return AT(this.#e)}#r;#n(){if(this.#r==null){const e=this._decodeWords();if(an(e.join(`
|
|
24
|
-
`)+`
|
|
25
|
-
`)!==this.#t)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#r=e}return this.#r}getWord(e){const t=this.#n();return j(e>=0&&e<t.length,`invalid word index: ${e}`,"index",e),t[e]}getWordIndex(e){return this.#n().indexOf(e)}}const RT="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",BT="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let Pf=null;class Qn extends vT{constructor(){super("en",RT,BT)}static wordlist(){return Pf==null&&(Pf=new Qn),Pf}}function X1(r){return(1<<r)-1<<8-r&255}function TT(r){return(1<<r)-1&255}function Nf(r,e){zy("NFKD"),e==null&&(e=Qn.wordlist());const t=e.split(r);j(t.length%3===0&&t.length>=12&&t.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const n=new Uint8Array(Math.ceil(11*t.length/8));let i=0;for(let d=0;d<t.length;d++){let h=e.getWordIndex(t[d].normalize("NFKD"));j(h>=0,`invalid mnemonic word at index ${d}`,"mnemonic","[ REDACTED ]");for(let m=0;m<11;m++)h&1<<10-m&&(n[i>>3]|=1<<7-i%8),i++}const a=32*t.length/3,c=t.length/3,u=X1(c),l=ve(Rr(n.slice(0,a/8)))[0]&u;return j(l===(n[n.length-1]&u),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),xe(n.slice(0,a/8))}function kf(r,e){j(r.length%4===0&&r.length>=16&&r.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=Qn.wordlist());const t=[0];let n=11;for(let c=0;c<r.length;c++)n>8?(t[t.length-1]<<=8,t[t.length-1]|=r[c],n-=8):(t[t.length-1]<<=n,t[t.length-1]|=r[c]>>8-n,t.push(r[c]&TT(8-n)),n+=3);const i=r.length/4,a=parseInt(Rr(r).substring(2,4),16)&X1(i);return t[t.length-1]<<=i,t[t.length-1]|=a>>8-i,e.join(t.map(c=>e.getWord(c)))}const Ff={};class ki{phrase;password;wordlist;entropy;constructor(e,t,n,i,a){i==null&&(i=""),a==null&&(a=Qn.wordlist()),Xn(e,Ff,"Mnemonic"),Pe(this,{phrase:n,password:i,wordlist:a,entropy:t})}computeSeed(){const e=nr("mnemonic"+this.password,"NFKD");return Bn(nr(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,n){const i=Nf(e,n);return e=kf(ve(i),n),new ki(Ff,i,e,t,n)}static fromEntropy(e,t,n){const i=ve(e,"entropy"),a=kf(i,n);return new ki(Ff,xe(i),a,t,n)}static entropyToPhrase(e,t){const n=ve(e,"entropy");return kf(n,t)}static phraseToEntropy(e,t){return Nf(e,t)}static isValidMnemonic(e,t){try{return Nf(e,t),!0}catch{}return!1}}var Vt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Df=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},_a,xr,Mr;const ST={16:10,24:12,32:14},OT=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],mr=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Oa=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],IT=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],CT=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],PT=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],NT=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],kT=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],FT=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],DT=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],UT=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],LT=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],MT=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],_T=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],VT=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Uf(r){const e=[];for(let t=0;t<r.length;t+=4)e.push(r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3]);return e}class sh{get key(){return Vt(this,_a,"f").slice()}constructor(e){if(_a.set(this,void 0),xr.set(this,void 0),Mr.set(this,void 0),!(this instanceof sh))throw Error("AES must be instanitated with `new`");Df(this,_a,new Uint8Array(e),"f");const t=ST[this.key.length];if(t==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");Df(this,Mr,[],"f"),Df(this,xr,[],"f");for(let h=0;h<=t;h++)Vt(this,Mr,"f").push([0,0,0,0]),Vt(this,xr,"f").push([0,0,0,0]);const n=(t+1)*4,i=this.key.length/4,a=Uf(this.key);let c;for(let h=0;h<i;h++)c=h>>2,Vt(this,Mr,"f")[c][h%4]=a[h],Vt(this,xr,"f")[t-c][h%4]=a[h];let u=0,l=i,d;for(;l<n;){if(d=a[i-1],a[0]^=mr[d>>16&255]<<24^mr[d>>8&255]<<16^mr[d&255]<<8^mr[d>>24&255]^OT[u]<<24,u+=1,i!=8)for(let E=1;E<i;E++)a[E]^=a[E-1];else{for(let E=1;E<i/2;E++)a[E]^=a[E-1];d=a[i/2-1],a[i/2]^=mr[d&255]^mr[d>>8&255]<<8^mr[d>>16&255]<<16^mr[d>>24&255]<<24;for(let E=i/2+1;E<i;E++)a[E]^=a[E-1]}let h=0,m,y;for(;h<i&&l<n;)m=l>>2,y=l%4,Vt(this,Mr,"f")[m][y]=a[h],Vt(this,xr,"f")[t-m][y]=a[h++],l++}for(let h=1;h<t;h++)for(let m=0;m<4;m++)d=Vt(this,xr,"f")[h][m],Vt(this,xr,"f")[h][m]=LT[d>>24&255]^MT[d>>16&255]^_T[d>>8&255]^VT[d&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const t=Vt(this,Mr,"f").length-1,n=[0,0,0,0];let i=Uf(e);for(let u=0;u<4;u++)i[u]^=Vt(this,Mr,"f")[0][u];for(let u=1;u<t;u++){for(let l=0;l<4;l++)n[l]=IT[i[l]>>24&255]^CT[i[(l+1)%4]>>16&255]^PT[i[(l+2)%4]>>8&255]^NT[i[(l+3)%4]&255]^Vt(this,Mr,"f")[u][l];i=n.slice()}const a=new Uint8Array(16);let c=0;for(let u=0;u<4;u++)c=Vt(this,Mr,"f")[t][u],a[4*u]=(mr[i[u]>>24&255]^c>>24)&255,a[4*u+1]=(mr[i[(u+1)%4]>>16&255]^c>>16)&255,a[4*u+2]=(mr[i[(u+2)%4]>>8&255]^c>>8)&255,a[4*u+3]=(mr[i[(u+3)%4]&255]^c)&255;return a}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const t=Vt(this,xr,"f").length-1,n=[0,0,0,0];let i=Uf(e);for(let u=0;u<4;u++)i[u]^=Vt(this,xr,"f")[0][u];for(let u=1;u<t;u++){for(let l=0;l<4;l++)n[l]=kT[i[l]>>24&255]^FT[i[(l+3)%4]>>16&255]^DT[i[(l+2)%4]>>8&255]^UT[i[(l+1)%4]&255]^Vt(this,xr,"f")[u][l];i=n.slice()}const a=new Uint8Array(16);let c=0;for(let u=0;u<4;u++)c=Vt(this,xr,"f")[t][u],a[4*u]=(Oa[i[u]>>24&255]^c>>24)&255,a[4*u+1]=(Oa[i[(u+3)%4]>>16&255]^c>>16)&255,a[4*u+2]=(Oa[i[(u+2)%4]>>8&255]^c>>8)&255,a[4*u+3]=(Oa[i[(u+1)%4]&255]^c)&255;return a}}_a=new WeakMap,xr=new WeakMap,Mr=new WeakMap;class Z1{constructor(e,t,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new sh(t)},name:{enumerable:!0,value:e}})}}var Ia=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},fi=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ds,Kr;class ah extends Z1{constructor(e,t){if(super("ECC",e,ah),ds.set(this,void 0),Kr.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Ia(this,ds,new Uint8Array(t),"f")}else Ia(this,ds,new Uint8Array(16),"f");Ia(this,Kr,this.iv,"f")}get iv(){return new Uint8Array(fi(this,ds,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){for(let i=0;i<16;i++)fi(this,Kr,"f")[i]^=e[n+i];Ia(this,Kr,this.aes.encrypt(fi(this,Kr,"f")),"f"),t.set(fi(this,Kr,"f"),n)}return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){const i=this.aes.decrypt(e.subarray(n,n+16));for(let a=0;a<16;a++)t[n+a]=i[a]^fi(this,Kr,"f")[a],fi(this,Kr,"f")[a]=e[n+a]}return t}}ds=new WeakMap,Kr=new WeakMap;var hi=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},br=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ps,Dn,yr;class Fi extends Z1{constructor(e,t){super("CTR",e,Fi),ps.set(this,void 0),Dn.set(this,void 0),yr.set(this,void 0),hi(this,yr,new Uint8Array(16),"f"),br(this,yr,"f").fill(0),hi(this,ps,br(this,yr,"f"),"f"),hi(this,Dn,16,"f"),t==null&&(t=1),typeof t=="number"?this.setCounterValue(t):this.setCounterBytes(t)}get counter(){return new Uint8Array(br(this,yr,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)br(this,yr,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");br(this,yr,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(br(this,yr,"f")[e]===255)br(this,yr,"f")[e]=0;else{br(this,yr,"f")[e]++;break}}encrypt(e){var t,n;const i=new Uint8Array(e);for(let a=0;a<i.length;a++)br(this,Dn,"f")===16&&(hi(this,ps,this.aes.encrypt(br(this,yr,"f")),"f"),hi(this,Dn,0,"f"),this.increment()),i[a]^=br(this,ps,"f")[hi(this,Dn,(n=br(this,Dn,"f"),t=n++,n),"f"),t];return i}decrypt(e){return this.encrypt(e)}}ps=new WeakMap,Dn=new WeakMap,yr=new WeakMap;function GT(r){if(r.length<16)throw new TypeError("PKCS#7 invalid length");const e=r[r.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");const t=r.length-e;for(let n=0;n<e;n++)if(r[t+n]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(r.subarray(0,t))}function ew(r){return typeof r=="string"&&!r.startsWith("0x")&&(r="0x"+r),Ht(r)}function us(r,e){for(r=String(r);r.length<e;)r="0"+r;return r}function Ys(r){return typeof r=="string"?nr(r,"NFKC"):Ht(r)}function Tt(r,e){const t=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);j(t!=null,"invalid path","path",e);const n=t[1],i=t[3],a=t[4]==="!";let c=r;for(const u of n.toLowerCase().split(".")){if(Array.isArray(c)){if(!u.match(/^[0-9]+$/))break;c=c[parseInt(u)]}else if(typeof c=="object"){let l=null;for(const d in c)if(d.toLowerCase()===u){l=c[d];break}c=l}else c=null;if(c==null)break}if(j(!a||c!=null,"missing required value","path",n),i&&c!=null){if(i==="int"){if(typeof c=="string"&&c.match(/^-?[0-9]+$/))return parseInt(c);if(Number.isSafeInteger(c))return c}if(i==="number"&&typeof c=="string"&&c.match(/^-?[0-9.]*$/))return parseFloat(c);if(i==="data"&&typeof c=="string")return ew(c);if(i==="array"&&Array.isArray(c)||i===typeof c)return c;j(!1,`wrong type found for ${i} `,"path",n)}return c}const tw="m/44'/60'/0'/0/0";function Ex(r){try{const e=JSON.parse(r);if((e.version!=null?parseInt(e.version):0)===3)return!0}catch{}return!1}function jT(r,e,t){if(Tt(r,"crypto.cipher:string")==="aes-128-ctr"){const i=Tt(r,"crypto.cipherparams.iv:data!"),a=new Fi(e,i);return xe(a.decrypt(t))}fe(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function Ya(r,e){const t=ve(e),n=Tt(r,"crypto.ciphertext:data!"),i=xe(bt(Ye([t.slice(16,32),n]))).substring(2);j(i===Tt(r,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const a=jT(r,t.slice(0,16),n),c=$s(a);if(r.address){let d=r.address.toLowerCase();d.startsWith("0x")||(d="0x"+d),j($e(d)===c,"keystore address/privateKey mismatch","address",r.address)}const u={address:c,privateKey:a};if(Tt(r,"x-ethers.version:string")==="0.1"){const d=t.slice(32,64),h=Tt(r,"x-ethers.mnemonicCiphertext:data!"),m=Tt(r,"x-ethers.mnemonicCounter:data!"),y=new Fi(d,m);u.mnemonic={path:Tt(r,"x-ethers.path:string")||tw,locale:Tt(r,"x-ethers.locale:string")||"en",entropy:xe(ve(y.decrypt(h)))}}return u}function rw(r){const e=Tt(r,"crypto.kdf:string");if(e&&typeof e=="string"){if(e.toLowerCase()==="scrypt"){const t=Tt(r,"crypto.kdfparams.salt:data!"),n=Tt(r,"crypto.kdfparams.n:int!"),i=Tt(r,"crypto.kdfparams.r:int!"),a=Tt(r,"crypto.kdfparams.p:int!");j(n>0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),j(i>0&&a>0,"invalid kdf","kdf",e);const c=Tt(r,"crypto.kdfparams.dklen:int!");return j(c===32,"invalid kdf.dklen","kdf.dflen",c),{name:"scrypt",salt:t,N:n,r:i,p:a,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){const t=Tt(r,"crypto.kdfparams.salt:data!"),n=Tt(r,"crypto.kdfparams.prf:string!"),i=n.split("-").pop();j(i==="sha256"||i==="sha512","invalid kdf.pdf","kdf.pdf",n);const a=Tt(r,"crypto.kdfparams.c:int!"),c=Tt(r,"crypto.kdfparams.dklen:int!");return j(c===32,"invalid kdf.dklen","kdf.dklen",c),{name:"pbkdf2",salt:t,count:a,dkLen:c,algorithm:i}}}j(!1,"unsupported key-derivation function","kdf",e)}function zT(r,e){const t=JSON.parse(r),n=Ys(e),i=rw(t);if(i.name==="pbkdf2"){const{salt:m,count:y,dkLen:E,algorithm:O}=i,R=Bn(n,m,y,E,O);return Ya(t,R)}fe(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:a,N:c,r:u,p:l,dkLen:d}=i,h=ji(n,a,c,u,l,d);return Ya(t,h)}function vx(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}async function HT(r,e,t){const n=JSON.parse(r),i=Ys(e),a=rw(n);if(a.name==="pbkdf2"){t&&(t(0),await vx(0));const{salt:y,count:E,dkLen:O,algorithm:R}=a,P=Bn(i,y,E,O,R);return t&&(t(1),await vx(0)),Ya(n,P)}fe(a.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:a});const{salt:c,N:u,r:l,p:d,dkLen:h}=a,m=await Gi(i,c,u,l,d,h,t);return Ya(n,m)}function nw(r){const e=r.salt!=null?ve(r.salt,"options.salt"):tn(32);let t=1<<17,n=8,i=1;return r.scrypt&&(r.scrypt.N&&(t=r.scrypt.N),r.scrypt.r&&(n=r.scrypt.r),r.scrypt.p&&(i=r.scrypt.p)),j(typeof t=="number"&&t>0&&Number.isSafeInteger(t)&&(BigInt(t)&BigInt(t-1))===BigInt(0),"invalid scrypt N parameter","options.N",t),j(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),j(typeof i=="number"&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:e,N:t,r:n,p:i}}function iw(r,e,t,n){const i=ve(t.privateKey,"privateKey"),a=n.iv!=null?ve(n.iv,"options.iv"):tn(16);j(a.length===16,"invalid options.iv length","options.iv",n.iv);const c=n.uuid!=null?ve(n.uuid,"options.uuid"):tn(16);j(c.length===16,"invalid options.uuid length","options.uuid",n.iv);const u=r.slice(0,16),l=r.slice(16,32),d=new Fi(u,a),h=ve(d.encrypt(i)),m=bt(Ye([l,h])),y={address:t.address.substring(2).toLowerCase(),id:K5(c),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:xe(a).substring(2)},ciphertext:xe(h).substring(2),kdf:"scrypt",kdfparams:{salt:xe(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:m.substring(2)}};if(t.mnemonic){const E=n.client!=null?n.client:`ethers/${Gy}`,O=t.mnemonic.path||tw,R=t.mnemonic.locale||"en",P=r.slice(32,64),v=ve(t.mnemonic.entropy,"account.mnemonic.entropy"),C=tn(16),N=new Fi(P,C),F=ve(N.encrypt(v)),U=new Date,L="UTC--"+(U.getUTCFullYear()+"-"+us(U.getUTCMonth()+1,2)+"-"+us(U.getUTCDate(),2)+"T"+us(U.getUTCHours(),2)+"-"+us(U.getUTCMinutes(),2)+"-"+us(U.getUTCSeconds(),2)+".0Z")+"--"+y.address;y["x-ethers"]={client:E,gethFilename:L,path:O,locale:R,mnemonicCounter:xe(C).substring(2),mnemonicCiphertext:xe(F).substring(2),version:"0.1"}}return JSON.stringify(y)}function sw(r,e,t){t==null&&(t={});const n=Ys(e),i=nw(t),a=ji(n,i.salt,i.N,i.r,i.p,64);return iw(ve(a),i,r,t)}async function aw(r,e,t){t==null&&(t={});const n=Ys(e),i=nw(t),a=await Gi(n,i.salt,i.N,i.r,i.p,64,t.progressCallback);return iw(ve(a),i,r,t)}const Lf="m/44'/60'/0'/0/0",qT=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),En=2147483648,$T=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),KT="0123456789abcdef";function Xa(r,e){let t="";for(;r;)t=KT[r%16]+t,r=Math.trunc(r/16);for(;t.length<e*2;)t="0"+t;return"0x"+t}function h0(r){const e=ve(r),t=pt(Rr(Rr(e)),0,4),n=Ye([e,t]);return Ky(n)}const Vr={};function ow(r,e,t,n){const i=new Uint8Array(37);r&En?(fe(n!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),i.set(ve(n),1)):i.set(ve(t));for(let c=24;c>=0;c-=8)i[33+(c>>3)]=r>>24-c&255;const a=ve(_i("sha512",e,i));return{IL:a.slice(0,32),IR:a.slice(32)}}function cw(r,e){const t=e.split("/");j(t.length>0,"invalid path","path",e),t[0]==="m"&&(j(r.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${r.depth}`,"path",e),t.shift());let n=r;for(let i=0;i<t.length;i++){const a=t[i];if(a.match(/^[0-9]+'$/)){const c=parseInt(a.substring(0,a.length-1));j(c<En,"invalid path index",`path[${i}]`,a),n=n.deriveChild(En+c)}else if(a.match(/^[0-9]+$/)){const c=parseInt(a);j(c<En,"invalid path index",`path[${i}]`,a),n=n.deriveChild(c)}else j(!1,"invalid path component",`path[${i}]`,a)}return n}class Er extends So{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,t,n,i,a,c,u,l,d){super(t,d),Xn(e,Vr,"HDNodeWallet"),Pe(this,{publicKey:t.compressedPublicKey});const h=pt(Vi(Rr(this.publicKey)),0,4);Pe(this,{parentFingerprint:n,fingerprint:h,chainCode:i,path:a,index:c,depth:u}),Pe(this,{mnemonic:l})}connect(e){return new Er(Vr,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,e)}#e(){const e={address:this.address,privateKey:this.privateKey},t=this.mnemonic;return this.path&&t&&t.wordlist.locale==="en"&&t.password===""&&(e.mnemonic={path:this.path,locale:"en",entropy:t.entropy}),e}async encrypt(e,t){return await aw(this.#e(),e,{progressCallback:t})}encryptSync(e){return sw(this.#e(),e)}get extendedKey(){return fe(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),h0(Ye(["0x0488ADE4",Xa(this.depth,1),this.parentFingerprint,Xa(this.index,4),this.chainCode,Ye(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new Ds(Vr,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(e){const t=Le(e,"index");j(t<=4294967295,"invalid index","index",t);let n=this.path;n&&(n+="/"+(t&~En),t&En&&(n+="'"));const{IR:i,IL:a}=ow(t,this.chainCode,this.publicKey,this.privateKey),c=new ar(sn((po(a)+BigInt(this.privateKey))%$T,32));return new Er(Vr,c,this.fingerprint,xe(i),n,t,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return cw(this,e)}static#t(e,t){j(fo(e),"invalid seed","seed","[REDACTED]");const n=ve(e,"seed");j(n.length>=16&&n.length<=64,"invalid seed","seed","[REDACTED]");const i=ve(_i("sha512",qT,n)),a=new ar(xe(i.slice(0,32)));return new Er(Vr,a,"0x00000000",xe(i.slice(32)),"m",0,0,t,null)}static fromExtendedKey(e){const t=At(P5(e));j(t.length===82||h0(t.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");const n=t[4],i=xe(t.slice(5,9)),a=parseInt(xe(t.slice(9,13)).substring(2),16),c=xe(t.slice(13,45)),u=t.slice(45,78);switch(xe(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const l=xe(u);return new Ds(Vr,$s(l),l,i,c,null,a,n,null)}case"0x0488ade4":case"0x04358394 ":if(u[0]!==0)break;return new Er(Vr,new ar(u.slice(1)),i,c,null,a,n,null,null)}j(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(e,t,n){e==null&&(e=""),t==null&&(t=Lf),n==null&&(n=Qn.wordlist());const i=ki.fromEntropy(tn(16),e,n);return Er.#t(i.computeSeed(),i).derivePath(t)}static fromMnemonic(e,t){return t||(t=Lf),Er.#t(e.computeSeed(),e).derivePath(t)}static fromPhrase(e,t,n,i){t==null&&(t=""),n==null&&(n=Lf),i==null&&(i=Qn.wordlist());const a=ki.fromPhrase(e,t,i);return Er.#t(a.computeSeed(),a).derivePath(n)}static fromSeed(e){return Er.#t(e,null)}}class Ds extends ih{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,n,i,a,c,u,l,d){super(t,d),Xn(e,Vr,"HDNodeVoidWallet"),Pe(this,{publicKey:n});const h=pt(Vi(Rr(n)),0,4);Pe(this,{publicKey:n,fingerprint:h,parentFingerprint:i,chainCode:a,path:c,index:u,depth:l})}connect(e){return new Ds(Vr,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return fe(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),h0(Ye(["0x0488B21E",Xa(this.depth,1),this.parentFingerprint,Xa(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(e){const t=Le(e,"index");j(t<=4294967295,"invalid index","index",t);let n=this.path;n&&(n+="/"+(t&~En),t&En&&(n+="'"));const{IR:i,IL:a}=ow(t,this.chainCode,this.publicKey,null),c=ar.addPoints(a,this.publicKey,!0),u=$s(c);return new Ds(Vr,u,c,this.fingerprint,xe(i),n,t,this.depth+1,this.provider)}derivePath(e){return cw(this,e)}}function Rx(r){try{if(JSON.parse(r).encseed)return!0}catch{}return!1}function Bx(r,e){const t=JSON.parse(r),n=Ys(e),i=$e(Tt(t,"ethaddr:string!")),a=ew(Tt(t,"encseed:string!"));j(a&&a.length%16===0,"invalid encseed","json",r);const c=ve(Bn(n,n,2e3,32,"sha256")).slice(0,16),u=a.slice(0,16),l=a.slice(16),d=new ah(c,u),h=GT(ve(d.decrypt(l)));let m="";for(let y=0;y<h.length;y++)m+=String.fromCharCode(h[y]);return{address:i,privateKey:an(m)}}function Tx(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}class ms extends So{constructor(e,t){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new ar(e):e;super(n,t)}connect(e){return new ms(this.signingKey,e)}async encrypt(e,t){const n={address:this.address,privateKey:this.privateKey};return await aw(n,e,{progressCallback:t})}encryptSync(e){const t={address:this.address,privateKey:this.privateKey};return sw(t,e)}static#e(e){if(j(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){const n=ki.fromEntropy(e.mnemonic.entropy),i=Er.fromMnemonic(n,e.mnemonic.path);if(i.address===e.address&&i.privateKey===e.privateKey)return i;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const t=new ms(e.privateKey);return j(t.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),t}static async fromEncryptedJson(e,t,n){let i=null;return Ex(e)?i=await HT(e,t,n):Rx(e)&&(n&&(n(0),await Tx(0)),i=Bx(e,t),n&&(n(1),await Tx(0))),ms.#e(i)}static fromEncryptedJsonSync(e,t){let n=null;return Ex(e)?n=zT(e,t):Rx(e)?n=Bx(e,t):j(!1,"invalid JSON wallet","json","[ REDACTED ]"),ms.#e(n)}static createRandom(e){const t=Er.createRandom();return e?t.connect(e):t}static fromPhrase(e,t){const n=Er.fromPhrase(e);return t?n.connect(t):n}}export{ZT as B,ws as C,vt as D,Wt as E,Qt as F,Lt as I,rS as J,zn as M,eS as N,vr as P,ke as R,Ir as S,B as T,ms as W,by as a,mi as b,_e as c,ze as d,Jr as e,ut as f,$e as g,Yr as h,di as i,$t as j,lr as k,JT as l,Fx as m,Vf as n,ey as o,Ca as p,YT as q,tn as r,oi as s,ci as t,Ur as u};
|