@ethersphere/bee-dashboard 0.35.1 → 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.
@@ -0,0 +1,87 @@
1
+ import{p as Ce,g as uh,c as Ir,a as vd}from"./vendor-react-mui-Dv6xxk4a.js";var Ou={},Rd;function l4(){return Rd||(Rd=1,(function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.Vector=t.Cache=t.Assertions=t.Strings=t.Types=t.Objects=t.Dates=t.Promises=t.Numbers=t.System=t.Arrays=t.Random=t.Elliptic=t.Binary=t.Lock=t.Solver=t.RollingValueProvider=t.TrieRouter=t.AsyncQueue=t.PubSubChannel=t.FixedPointNumber=t.MerkleTree=t.Chunk=t.Uint8ArrayWriter=t.Uint8ArrayReader=t.AsyncLazy=t.Lazy=t.Optional=void 0;async function r(s){return new Promise((c,f)=>s.then(f,c))}async function n(s){return r(Promise.all(s.map(r)))}async function i(s,c=1){const f=K0(s,c),p=[],b=f.map(async R=>{for(const G of R)p.push(await G())});return await Promise.all(b),p}async function o(s){return new Promise(c=>setTimeout(()=>{c(!0)},s))}function a(s,c=Math.random){for(let f=s.length-1;f>0;f--){const p=Math.floor(c()*(f+1)),b=s[f];s[f]=s[p],s[p]=b}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 h(s){return s.length>0?s[0]:null}function d(s){if(!s.length)throw Error("Received empty array");return s[0]}function m(s,c){const f=[];for(let p=0;p<s;p++)f.push(c(p));return f}function y(s){const c=[];for(let f=0;f<s[0].length;f++){c.push([]);for(let p=0;p<s.length;p++)c[f].push(s[p][f])}return c}function w(s,c,f){const p=[];for(let b=0;b<s;b++){p.push([]);for(let R=0;R<c;R++)p[b].push(f)}return p}function T(s,c,f,p){if(f<0||p<0||p+c[0].length>s[0].length||f+c.length>s.length)return!1;for(let b=0;b<c.length;b++)for(let R=0;R<c[b].length;R++)if(c[b][R]!==void 0&&s[f+b][p+R]!==c[b][R])return!1;return!0}function E(s,c,f=Math.random){return a(m0(0,s.length-1),f).slice(0,c)}function B(s,c){return s.map(f=>f[c])}function A(s){let c=s,f=3405648695,p=3735928559;return function(){return c+=f,f^=c<<7,c*=p,p^=c<<13,c^=f^p,(c>>>0)/4294967296}}function P(s,c,f=Math.random){return Math.floor(f()*(c-s+1))+s}function I(s,c,f=Math.random){return f()*(c-s)+s}function S(){return Math.random()*2-1}function N(s,c,f){return c>=s.x&&c<s.x+s.width&&f>=s.y&&f<s.y+s.height}function _(s,c,f,p=Math.random){let b,R;do b=P(0,s-1,p),R=P(0,c-1,p);while(f&&N(f,b,R));return[b,R]}function F(s,c=Math.random){const f=Math.floor(s),p=s-f;return U(p,c)?f+1:f}function U(s,c=Math.random){return c()<s}function H(s,c=Math.random){return s[Math.floor(s.length*c())]}function K(s,c,f=Math.random){if(c>s.length)throw new Error(`Count (${c}) is greater than array length (${s.length})`);return E(s,c,f).map(p=>s[p])}function le(s,c,f,p=Math.random){if(c>s.length)throw new Error(`Count (${c}) is greater than array length (${s.length})`);const b=[];for(;b.length<c;){const R=H(s,p);b.some(G=>f(G,R))||b.push(R)}return b}function L(s,c,f,p,b,R=Math.random){const G=s.filter(Y=>Y!==c&&Y!==f),te=[];for(c!==null&&te.push(c);G.length&&te.length<p;){const Y=t.Random.intBetween(0,G.length-1,R);b(G[Y],te)&&te.push(G[Y]),G.splice(Y,1)}return a(te,R),{values:te,indexOfGuaranteed:c!==null?te.indexOf(c):-1}}function me(s){if(!s.length)throw Error("Received empty array");return s[s.length-1]}function Be(s,c,f){return f(c.reduce((p,b)=>b(p),s))}function re(s,c){return f=>Be(f,s,c)}function ue(s,c,f){if(f===void 0&&(f=Math.random()),s.length!==c.length)throw new Error("Array length mismatch");let p=c.reduce((R,G)=>R+G,0);const b=f*p;for(let R=0;R<s.length-1;R++)if(p-=c[R],b>=p)return s[R];return me(s)}function ye(s,c,f=Math.random){const p=c.map(R=>f()*R),b=[];for(let R=0;R<s.length;R++)b.push([s[R],p[R]]);return b.sort((R,G)=>G[1]-R[1]).map(R=>R[0])}function Ae(s,c){if(s==null)return null;const f=c.split(".");let p=s;for(const b of f){if(p[b]===null||p[b]===void 0)return null;p=p[b]}return p}function Ee(s,c,f){const p=c.split(/\.|\[/);let b=s;for(let R=0;R<p.length;R++){const G=p[R],te=R<p.length-1&&p[R+1].includes("]"),Y=G.includes("]")?G.replace(/\[|\]/g,""):G;if(R===p.length-1)return b[Y]=f,f;xt(b[Y])||(te?b[Y]=[]:b[Y]={}),b=b[Y]}return f}function Se(s,c,f=1){const p=Ae(s,c)||0;return Ee(s,c,p+f),p}function Le(s,c,f){return Ae(s,c)||Ee(s,c,f)}function _e(s,c){const f=dc(c,"."),p=g0(c,".");if(!f||!p)return;const b=Ae(s,f);b&&delete b[p]}function j(s,c,f){const p=Ae(s,c);if(!p)throw new Error("Key '"+c+"' does not exist.");return Ee(s,c,f),p}function W(s,c,f){for(const p of c){const b=Ae(s,p);if(b)return b}if(f){const p=Object.values(s);if(p.length)return p[0]}return null}async function se(s,c,f){for(;;){try{await s()}catch(p){f&&f("Error in forever",p)}await o(c)}}function M(s,c){s();const f=setInterval(()=>{s()},c);return()=>clearInterval(f)}function z(){const s=globalThis.process;return s?s.browser===!0?"browser":"node":"browser"}async function Q(s,c,f,p,b,R){let G=null;for(let te=0;te<=c;te++)try{return await s()}catch(Y){if(G=Y,te===c)break;const we=f+(p-f)*(te/(c-1));b&&b("Error in withRetries, retrying",{attempt:te+1,allowedFailures:c,delayMillis:we,error:Y}),R&&R(),await o(we)}throw G}function ie(s){return s/1024/1024}function oe(s,c=1024){return s>=c*c*c*c?(s/c/c/c/c).toFixed(3)+" TB":s>=c*c*c?(s/c/c/c).toFixed(3)+" GB":s>=c*c?(s/c/c).toFixed(3)+" MB":s>=c?(s/c).toFixed(3)+" KB":s+" B"}function O(s){const c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(s.toLowerCase());if(!c)throw new Error("Invalid hex color: "+s);return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)]}function k(s){return"#"+s.map(c=>c.toString(16).padStart(2,"0")).join("")}function Z(s,c,f,p){const b=s*Math.PI/180,R=f*Math.PI/180,G=(f-s)*Math.PI/180,te=(p-c)*Math.PI/180,Y=Math.sin(G/2)*Math.sin(G/2)+Math.cos(b)*Math.cos(R)*Math.sin(te/2)*Math.sin(te/2);return 6371e3*(2*Math.atan2(Math.sqrt(Y),Math.sqrt(1-Y)))}function fe(s,c){return Math.round(s/c)*c}function Pe(s){return s>1e3?(s/1e3).toFixed(0)+" km":s>=500?fe(s,100)+" m":s>=100?fe(s,50)+" m":fe(s,10)+" m"}function xe(s){return s*(s+1)/2}function De(s){const c=s.match(/-?\d+(\.\d+)?/);if(!c)throw Error("No float found in "+s);return parseFloat(c[0])}function Ut(s,c,f=Math.random){const p=s*c,b=Math.sqrt(s*c*(1-c)),R=(f()+f()+f()+f()+f()+f()-3)*Math.SQRT2,G=Math.round(p+b*R);return Math.max(0,Math.min(s,G))}function X(s,c){if(!s.includes("."))return s;if(parseFloat(s)===0)return"0";const[f,p]=s.split("."),b=f.replace("-",""),R=b.length;if(R>=c)return f;if(b!=="0"){const Y=c-R,we=p.slice(0,Y);return/[1-9]/.test(we)?`${f}.${we.replace(/0+$/,"")}`:f}const G=p.match(/^0*/)?.[0].length??0,te=c+G;return`${f}.${p.slice(0,te)}`}function xt(s,c=!0){return!s||c&&!jt(s._readableState)||c&&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 wt(s){return xt(s)&&!Array.isArray(s)}function qe(s){return Array.isArray(s)&&s.length===0}function st(s){return wt(s)&&Object.keys(s).length===0}function jt(s){return s===void 0}function Er(s){return Object.prototype.toString.call(s)==="[object Function]"||Object.prototype.toString.call(s)==="[object AsyncFunction]"}function at(s){return Object.prototype.toString.call(s)==="[object String]"}function Bt(s){return typeof s=="number"&&isFinite(s)}function cr(s){return s===!0||s===!1}function rr(s){return Object.prototype.toString.call(s)==="[object Date]"}function cn(s){return!at(s)||s.trim().length===0}function li(s){return Bt(s)&&Number.isInteger(s)&&s>=1}function Ao(s){return at(s)&&s.match(/^-?\d+$/)!==null}function is(s){return at(s)&&s.match(/^(0x)?[0-9a-f]+$/i)!==null}const un="!@#$%^&*()_+-=[]{}|;:<>?,./",Nn="!@#$%^&*()_+-=[]{}|;:<>?,./".split(""),ss="abcdefghijklmnopqrstuvwxyz",cc="ABCDEFGHIJKLMNOPQRSTUVWXYZ",os="1234567890",as=ss+cc+os,Eo=as+un,cs=["—","\\","東","京","都","𝖆","𝖇","𝖈","👾","🙇","💁","🙅","ᚠ","ᛇ","ᚻ","ᛦ"],Cn="0123456789abcdef";function ur(s,c=Math.random){let f="";for(let p=0;p<s;p++)f+=ss[Math.floor(c()*ss.length)];return f}function us(s,c=Math.random){let f="";for(let p=0;p<s;p++)f+=as[Math.floor(c()*as.length)];return f}function uc(s,c=Math.random){let f="";for(let p=0;p<s;p++)f+=Eo[Math.floor(c()*Eo.length)];return f}function Nr(s,c=Math.random){let f="";for(let p=0;p<s;p++)f+=cs[Math.floor(c()*cs.length)];return f}function lc(s,c){const f=new RegExp(`[0-9a-f]{${c}}`,"i"),p=s.match(f);return p?p[0]:null}function v(s,c,f=Nn){const p=y0(s,f);for(const b of p)if(c(b))return b;return null}function g(s,c=Math.random){let f="";for(let p=0;p<s;p++)f+=Cn[Math.floor(c()*Cn.length)];return f}function x(s,c){if(!Ao(s))throw new TypeError(`Expected integer string${c?.name?` for ${c.name}`:""}, got: `+s);const f=BigInt(s);if(c&&(c.min&&f<c.min||c.max&&f>c.max))throw RangeError(`Expected integer string${c?.name?` for ${c.name}`:""} in range: ${c.min??"-inf"}..${c.max??"inf"}; got: `+f);return s}function C(s,c){if(cn(s))throw new TypeError(`Expected string${c?.name?` for ${c.name}`:""}, got: `+s);if(c&&(c.min!==void 0&&s.length<c.min||c.max!==void 0&&s.length>c.max))throw RangeError(`Expected string${c?.name?` for ${c.name}`:""} length in range: ${c.min??"-inf"}..${c.max??"inf"}; got: ${s.length}`);return s}function V(s,c){if(!is(s))throw new TypeError(`Expected hex string${c?.name?` for ${c.name}`:""}, got: `+s);if(c?.strictPrefix&&!s.startsWith("0x")&&!s.startsWith("0X"))throw new TypeError(`Expected hex string with 0x prefix${c?.name?` for ${c.name}`:""}, got: `+s);const f=s.replace(/^0x/i,"");if(f.length%2!==0&&!c?.uneven)throw RangeError(`Expected even number of hex digits${c?.name?` for ${c.name}`:""}; got: `+s);if(c&&c.byteLength&&f.length!==c.byteLength*2)throw RangeError(`Expected hex string${c?.name?` for ${c.name}`:""} of byte length ${c.byteLength}; got: `+f);return`0x${f}`}function q(s,c){if(!C(s,c).split("").every(f=>f==="_"||hs(f)))throw new TypeError(`Expected safe string${c?.name?` for ${c.name}`:""}, got: `+s);return s}function ee(s,c){if(c.min!==void 0&&s<c.min||c.max!==void 0&&s>c.max)throw RangeError(`Expected value${c?.name?` for ${c.name}`:""} in range: ${c.min??"-inf"}..${c.max??"inf"}; got: ${s}`)}function Ne(s,c){if(!Er(s))throw new TypeError(`Expected function${c?.name?` for ${c.name}`:""}, got: `+s);return s}function We(s,c){if(Bt(s))return c&&ee(s,c),s;if(!at(s)||!s.match(/^-?\d+(\.\d+)?$/))throw new TypeError(`Expected number${c?.name?` for ${c.name}`:""}, got: `+s);const f=parseFloat(s);return c&&ee(f,c),f}function Ze(s,c){return Math.trunc(We(s,c))}function ct(s,c){if(s==="true")return!0;if(s==="false")return!1;if(!cr(s))throw new TypeError(`Expected boolean${c?.name?` for ${c.name}`:""}, got: `+s);return s}function Ke(s,c){if(!rr(s))throw new TypeError(`Expected date${c?.name?` for ${c.name}`:""}, got: `+s);return s}function Bw(s){return cn(s)?null:s}function Sw(s,c){if(!at(s))throw new TypeError(`Expected string${c?.name?` for ${c.name}`:""}, got: `+s);return s}function Ow(s,c){if(li(s))return s;const f=parseInt(s,10);if(!li(f))throw new TypeError(`Expected id${c?.name?` for ${c.name}`:""}, got: `+s);return f}function Pw(s,c){if(!at(s))throw new TypeError(`Expected time${c?.name?` for ${c.name}`:""}, got: `+s);const f=s.split(":");if(f.length!==2)throw new TypeError(`Expected time${c?.name?` for ${c.name}`:""}, got: `+s);const p=parseInt(f[0],10),b=parseInt(f[1],10);if(!Bt(p)||!Bt(b)||p<0||p>23||b<0||b>59)throw new TypeError(`Expected time, got${c?.name?` for ${c.name}`:""}: `+s);return`${String(p).padStart(2,"0")}:${String(b).padStart(2,"0")}`}function Iw(s,c){if(!Array.isArray(s))throw new TypeError(`Expected array${c?.name?` for ${c.name}`:""}, got: `+s);return s}function vo(s,c){if(!wt(s))throw new TypeError(`Expected object${c?.name?` for ${c.name}`:""}, got: `+s);return s}function kw(s,c){return s===null?null:vo(s,c)}function Nw(s,c){const f=vo(s,c);for(const p of Object.keys(f))if(!at(f[p]))throw new TypeError(`Expected string map${c?.name?` for ${c.name}`:""}, got: `+s);return f}function Cw(s,c){const f=vo(s),p=Object.keys(f),b=Object.values(f);if(!p.every(at)||!b.every(Bt))throw new TypeError(`Expected numeric dictionary${c?.name?` for ${c.name}`:""}, got: `+s);return f}function l0(s){return at(s)&&s.match(/^https?:\/\/.+/)!==null}function _w(s,c){if(!l0(s))throw new TypeError(`Expected url${c?.name?` for ${c.name}`:""}, got: `+s);return s}function f0(s){return typeof s=="bigint"}function h0(s,c){if(!f0(s))throw new TypeError(`Expected bigint${c?.name?` for ${c.name}`:""}, got: `+s);if(c?.min!==void 0&&s<c?.min||c?.max!==void 0&&s>c?.max)throw RangeError(`Expected value${c?.name?` for ${c.name}`:""} in range: ${c.min??"-inf"}..${c.max??"inf"}; got: ${s}`);return s}function Dw(s,c){return c==null?!0:s(c)}function Fw(s,c){return c==null?null:s(c)}function Uw(s,c){return c===""?void 0:s(c)}function Lw(s,c){return c==null?void 0:s(c)}function d0(s,c){for(const[f,p]of Object.entries(c))if(!p(s[f]))throw TypeError(`${f} in value does not exist or match shape`);for(const f of Object.keys(s))if(!c[f])throw TypeError(`${f} exists in value but not in shape`);return!0}function Mw(s,c){return s.every(f=>d0(f,c))}function ls(s,c="json",f=0){if(s&&Er(s.represent)){const p=s.represent();if(at(p))return c==="json"&&f===0?JSON.stringify(p):p}if(xt(s,!1)){if(f>1)return"[object Object]";if(c==="json"){if(Array.isArray(s)){const b=s.map(R=>ls(R,"json",f+1));return f===0?JSON.stringify(b):b}const p={};s.message&&(p.message=ls(s.message,"json",f+1));for(const[b,R]of Object.entries(s))p[b]=ls(R,"json",f+1);return f===0?JSON.stringify(p):p}else if(c==="key-value"){const p=Object.keys(s);return s.message&&!p.includes("message")&&p.unshift("message"),p.map(b=>`${b}=${JSON.stringify(ls(s[b],"json",f+1))}`).join(" ")}}return jt(s)&&(s="undefined"),f===0?JSON.stringify(s):s}function zw(s,c){if(at(s))return s;const f=Object.keys(s);s.message&&!f.includes("message")&&f.push("message");const p=f.map(b=>`${b}: ${s[b]}`).join("; ");return c&&s.stack?p+`
2
+ `+s.stack:p}function _n(s,c){if(wt(s)&&wt(c))for(const f in c)wt(c[f])?(s[f]||(s[f]={}),_n(s[f],c[f])):Array.isArray(c[f])?s[f]=[...c[f]]:(c[f]!==null&&c[f]!==void 0||s[f]===null||s[f]===void 0)&&(s[f]=c[f]);return s}function Vw(s,c){const f={};return _n(f,s),_n(f,c),f}function Gw(s,c,f){const p={};return _n(p,s),_n(p,c),_n(p,f),p}function p0(s,c){const f={};for(const p of s)for(const b of Object.keys(p))f[b]?f[b]=c(f[b],p[b]):f[b]=p[b];return f}function $w(s){return p0(s,(c,f)=>c+f)}function jw(s,c,f){s[c]||(s[c]=[]),s[c].push(f)}function Hw(s,c,f){for(s.unshift(c);s.length>f;)s.pop()}function qw(s,c){let f=c%s.length;return f<0&&(f+=s.length),s[f]}function Ro(s,c){Array.prototype.push.apply(s,c)}function Zw(s,c){Array.prototype.unshift.apply(s,c)}async function Kw(s,c){const f=[];for(const p of s)f.push(await c(p));return f}function Ww(s,c){const f=[];for(let p=0;p<s.length;p++)f.push(s[p]),p<s.length-1&&(Er(c)?f.push(c()):f.push(c));return f}function Jw(s,c){if(s!==c)throw Error(`Expected [${s}] to equal [${c}]`);return[s,c]}function Qw(s){if(s!==!0)throw Error(`Expected [true], got: [${s}]`);return s}function Yw(s){if(!s)throw Error(`Expected truthy value, got: [${s}]`);return s}function Xw(s){if(s!==!1)throw Error(`Expected [false], got: [${s}]`);return s}function e2(s){if(s)throw Error(`Expected falsy value, got: [${s}]`);return s}function t2(s,c){if(!c.includes(s))throw Error(`Expected any of [${c.join(", ")}], got: [${s}]`);return s}function r2(s,c){for(let f=0;f<s.length;f++){const p=s[f],b=c[f],R=Math.max(0,b.getTime()-Date.now());setTimeout(p,R)}}function n2(s,c,f){return s+(c-s)*f}function i2(s){return s.reduce((c,f)=>c+f,0)}function s2(s){return s.reduce((c,f)=>c+f,0)/s.length}function o2(s){const c=[...s].sort((p,b)=>p-b),f=Math.floor(c.length/2);return c.length%2===0?(c[f]+c[f-1])/2:c[f]}function a2(s,c){return s-(c-1)/2}function m0(s,c){const f=[];for(let p=s;p<=c;p++)f.push(p);return f}function c2(s,c){return c.some(f=>s.includes(f))}function u2(s){return/^[\u4E00-\u9FA5]+$/.test(s)}function fc(s,c=()=>!1){return s.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").split("").map(f=>/[a-z0-9]/.test(f)||c(f)?f:"-").join("").replace(/-+/g,"-").replace(/^-|-$/g,"")}function l2(s){return fc(s).replaceAll("-","")}function f2(s){return So(s.replace(/([A-Z])/g," $1"))}function h2(s){return s.split("-").map(So).join(" ")}function d2(s){return x0(s.split("-").map(So).join(""))}function p2(s,c=", ",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(c)}${f}${s[s.length-1]}`}function m2(s,c){return c+s.split("").join(c)+c}function g2(s){return fc(s).replace(/-/g,"_").toUpperCase()}function To(s,c){if(c.length===0)return 0;const f=s.toLowerCase(),p=c.toLowerCase();return s===c?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 y2(s,c){return s.filter(f=>To(f,c)).sort((f,p)=>To(p,c)-To(f,c))}function b2(s){return s.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const x2={"&amp;":"&","&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<"};function w2(s){let c=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(x2))c=c.replaceAll(f,p);return c}function hc(s,c){const f=s.indexOf(c);return f===-1?null:s.slice(0,f)}function Bo(s,c){const f=s.indexOf(c);return f===-1?null:s.slice(f+c.length)}function dc(s,c){const f=s.lastIndexOf(c);return f===-1?null:s.slice(0,f)}function g0(s,c){const f=s.lastIndexOf(c);return f===-1?null:s.slice(f+c.length)}function A2(s,c,f){const p=dc(s,f);return p?Bo(p,c):null}function E2(s,c,f){const p=Bo(s,c);return p?hc(p,f):null}function pc(s,c,f=!1){const p=f?s.lastIndexOf(c):s.indexOf(c);return p===-1?f?[null,s]:[s,null]:[s.slice(0,p),s.slice(p+c.length)]}function y0(s,c){let f=[s];for(const p of c)f=f.flatMap(b=>b.split(p));return f.filter(p=>p)}function mc(s){const c=me(s.split(/\\|\//g)),f=c.lastIndexOf(".",c.length-1);return f<=0?"":c.slice(f+1)}function gc(s){const c=me(s.split(/\\|\//g)),f=c.lastIndexOf(".",c.length-1);return f<=0?c:c.slice(0,f)}function v2(s){let[c,f]=s.split("@");c=fs(c.replaceAll(".","").toLowerCase()).replaceAll(" ","");const[p]=c.split("+");if(!p||!f||f.indexOf(".")===-1||f.indexOf(".")===f.length-1)throw new Error("Invalid email");return f=fs(f.toLowerCase()).replaceAll(" ",""),`${p}@${f}`}function R2(s){const c=gc(s),f=mc(s);return f?`${c}.${f}`:c}function T2(s){const c=gc(s),f=mc(s);return{basename:c,extension:f,filename:f?`${c}.${f}`:c}}function B2(s,c=Math.random){return s.replace(/\{(.+?)\}/g,(f,p)=>H(p.split("|"),c))}function b0(s){const c=/\{(.+?)\}/,f=s.match(c);if(!f||!f.index)return[s];const p=f[1].split(","),b=s.slice(0,f.index),R=s.slice(f.index+f[0].length);let G=[];for(const te of p){const Y=b0(b+te+R);G=G.concat(Y)}return G}function fs(s){return s.split(`
3
+ `).map(c=>c.trim().replace(/\s+/g," ")).filter(c=>c.length>0).join(`
4
+ `)}function So(s){return s.charAt(0).toUpperCase()+s.slice(1)}function x0(s){return s.charAt(0).toLowerCase()+s.slice(1)}function w0(s){if(!s)return!1;const c=s.charCodeAt(0);return c>=65&&c<=90||c>=97&&c<=122}function A0(s){if(!s)return!1;const c=s.charCodeAt(0);return c>=48&&c<=57}function hs(s){return w0(s)||A0(s)}const S2=`
5
+ \r.,?!:;"'\`(){}[]~@#$%^&*-+=|<>/\\`.split("");function O2(s){return S2.includes(s)}function P2(s){return hs(s)||s==="."||s==="["||s==="]"||s==="_"}function I2(s,c,f,p,b){return s.slice(0,c)+p+s.slice(c,c+f)+b+s.slice(c+f)}function E0(s,c,f=0){const p=c.exec(s.slice(f));return p?{index:p.index,match:p[0]}:null}function v0(s,c,f=!0){if(!f)return c.every(b=>b instanceof RegExp?b.test(s):s.indexOf(b,0)!==-1);let p=0;for(const b of c)if(b instanceof RegExp){const R=E0(s,b,p);if(!R)return!1;p=R.index+R.match.length}else{const R=s.indexOf(b,p);if(R===-1)return!1;p=R+b.length}return!0}function k2(s,c,f=!0){let p=0;for(const b of c){let R=!1;for(;!R&&p<s.length;)v0(s[p],b,f)&&(R=!0),p++;if(!R)return!1}return!0}function N2(s){return s.match(/"|,/)?`"${s.replace(/"/g,'""')}"`:s}function R0(s,c,f=0){const p=[];let b=s.indexOf(c,f);for(;b!==-1;)p.push(b),b=s.indexOf(c,b+c.length);return p}function fi(s,c,f=0){let p=-1;for(const b of c){const R=s.indexOf(b,f);R!==-1&&(p===-1||R<p)&&(p=R)}return p}function C2(s,c=0){for(let f=c;f<s.length;f++)if(O2(s[f]))return f;return-1}function _2(s,c=0){for(let f=c;f<s.length;f++)if(s[f]==="#"&&hs(s[f+1]))return f;return-1}function T0(s,c,f=0){return s.slice(0,f).lastIndexOf(c)}function B0(s,c=0,f="{",p="}"){let b=1;for(let R=c;R<s.length;R++)if(s.slice(R,R+p.length)===p){if(--b===0)return R}else s.slice(R,R+f.length)===f&&b++;return-1}function S0(s,c){const f=c.wordBoundary?fi(s,[`${c.opening} `,`${c.opening}
6
+ `],c.start||0):s.indexOf(c.opening,c.start||0);if(f===-1)return null;const p=B0(s,f+c.opening.length,c.opening,c.closing);return p===-1?null:c.exclusive?s.slice(f+c.opening.length,p):s.slice(f,p+c.closing.length)}function D2(s,c){const f=[];let p=c.wordBoundary?fi(s,[`${c.opening} `,`${c.opening}
7
+ `],c.start||0):s.indexOf(c.opening,c.start||0);for(;;){if(p===-1)return f;const b=S0(s,{...c,start:p});if(!b)return f;f.push(b),p=c.wordBoundary?fi(s,[`${c.opening} `,`${c.opening}
8
+ `],p+b.length):s.indexOf(c.opening,p+b.length)}}function F2(s,c,f){let p=0;for(;;){const b=t.Strings.extractBlock(s,{...f,start:p});if(!b)return s;const R=c(b);p=s.indexOf(b,p)+R.length,s=s.replace(b,R)}}function U2(s,c){const f=[];let p=0;for(;p<s.length;){const b=s.indexOf(c,p);if(b===-1){f.push({string:s.slice(p),symbol:null});break}const R=s.indexOf(c,b+c.length);if(b>p&&R!==-1&&f.push({string:s.slice(p,b),symbol:null}),R===-1){f.push({string:s.slice(p),symbol:null});break}f.push({string:s.slice(b+c.length,R),symbol:c}),p=R+c.length}return f}function L2(s){const c=[];let f=0;for(;f<s.length;){const p=_2(s,f);if(p===-1){c.push({string:s.slice(f),symbol:null});break}const b=C2(s,p+1);if(b===-1){c.push({string:s.slice(f,p),symbol:null}),c.push({string:s.slice(p+1),symbol:"#"});break}p>f&&c.push({string:s.slice(f,p),symbol:null}),c.push({string:s.slice(p+1,b),symbol:"#"}),f=b}return c}function M2(s){const c=[];let f=0;for(;f<s.length;){const p=fi(s,["http://","https://"],f);if(p===-1){c.push({string:s.slice(f),symbol:null});break}const b=fi(s,[" ",`
9
+ `],p);if(b===-1){p>f&&c.push({string:s.slice(f,p),symbol:null}),c.push({string:s.slice(p),symbol:"http"});break}p>f&&c.push({string:s.slice(f,p),symbol:null}),c.push({string:s.slice(p,b),symbol:"http"}),f=b}return c}const O0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",P0="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function z2(s){return I0(s,O0)}function V2(s){return k0(s,O0)}function G2(s){return I0(s,P0)}function $2(s){return k0(s,P0)}function I0(s,c){const p=c.length;let b=0,R=0;const G=[];for(let te=0;te<s.length;te++){const Y=s[te];if(Y==="=")break;const we=c.indexOf(Y);if(we===-1)throw new Error(`Invalid character: ${Y}`);R=R<<Math.log2(p)|we,b+=Math.log2(p),b>=8&&(b-=8,G.push(R>>b&255))}return new Uint8Array(G)}function k0(s,c){const f=c.length;let p=0,b=0,R="";for(let G=0;G<s.length;G++)for(b=b<<8|s[G],p+=8;p>=Math.log2(f);)p-=Math.log2(f),R+=c[b>>p&f-1];return p>0&&(R+=c[b<<Math.log2(f)-p&f-1]),R.length%4!==0&&(R+="=".repeat(4-R.length%4)),R}function j2(s){(s.startsWith("0x")||s.startsWith("0X"))&&(s=s.slice(2));const c=s.length/2,f=new Uint8Array(c);for(let p=0;p<c;p++){const b=parseInt(s.slice(p*2,p*2+2),16);f[p]=b}return f}function H2(s){return Array.from(s).map(c=>c.toString(16).padStart(2,"0")).join("")}function q2(s){return Array.from(s).map(c=>c.toString(2).padStart(8,"0")).join("")}function Z2(s){const c=Math.ceil(s.length/8),f=new Uint8Array(c);for(let p=0;p<c;p++){const b=parseInt(s.slice(p*8,p*8+8),2);f[p]=b}return f}function K2(s,c){const f=s.split("/").filter(R=>R),p=c.split("/").filter(R=>R);if(f.length!==p.length)return null;const b={};for(let R=0;R<f.length;R++){const G=f[R];if(G.startsWith(":"))b[G.slice(1)]=p[R];else if(G!==p[R])return null}return b}function yc(s,c,f){const p=[];for(const b of f)b!==c&&p.push(s.replace(c,b));return p}function W2(s,c,f,p=Math.random){const b=t.Arrays.shuffle(c.map(G=>({variants:t.Arrays.shuffle(G.variants.map(te=>te),p),avoid:G.avoid})),p),R=[];for(const G of b){const te=G.variants.filter(we=>we!==G.avoid),Y=te.find(we=>s.includes(we));if(Y&&(Ro(R,yc(s,Y,te)),R.length>=f))break}if(R.length<f)for(const G of b){const te=G.variants.find(Y=>s.includes(Y));if(te&&(Ro(R,yc(s,te,G.variants)),R.length>=f))break}return R.slice(0,f)}function J2(s,c,f,p=!1){const b=new RegExp(p?`(?<=\\s|^)${c}(?=\\s|$)`:`\\b${c}\\b`,"g");return s.replace(b,f)}function Q2(s,c){const f=/\b[A-Z][a-zA-Z0-9]*\b/g;return s.replace(f,p=>p.toUpperCase()===p?p:c(p))}function Y2(s){return s.replace(/<[^>]*>/g,"")}function N0(s){const c=s.lastIndexOf(" ");if(c===-1)return{line:s,rest:""};const f=s.slice(0,c),p=s.slice(c+1);return{line:f,rest:p}}function X2(s,c={}){return[...s].reduce((f,p)=>f+(c[p]||1),0)}function e3(s,c,f={}){const p=[];let b="",R=0;for(let G=0;G<s.length;G++){const te=s[G],Y=f[te]||1;if(b+=te,R+=Y,R>c){const{line:we,rest:Rt}=N0(b);p.push(we),b=Rt,R=Rt.split("").map(Ht=>f[Ht]||1).reduce((Ht,mi)=>Ht+mi,0)}}return b&&p.push(b),p}function t3(s,c){const f=[];for(let p=0;p<=s.length;p++)f[p]=[p];for(let p=0;p<=c.length;p++)f[0][p]=p;for(let p=1;p<=s.length;p++)for(let b=1;b<=c.length;b++){const R=s[p-1]===c[b-1]?0:1;f[p][b]=Math.min(f[p-1][b]+1,f[p][b-1]+1,f[p-1][b-1]+R)}return f[s.length][c.length]}function C0(s){const c=s.reduce((p,b)=>p.length<b.length?p:b);let f="";for(let p=0;p<c.length;p++){const b=c[p];if(s.every(R=>R[p]===b))f+=b;else break}return f}function r3(s){const c=C0(s),f=c.lastIndexOf("/");return f===-1?"":c.slice(0,f+1)}function bc(s,c){return new RegExp(`\\b${c}\\b`).test(s)}function n3(s,c,f){return f==="any"?c.some(p=>bc(s,p)):c.every(p=>bc(s,p))}function i3(s){const c={},f=s.match(/([a-z\-]+)="([^"]+)"/g);if(f)for(const p of f){const[b,R]=pc(p,"=");c[b]=R.slice(1,R.length-1)}return c}function ds(s,c,f=[]){let p="";for(;c<s.length&&(hs(s[c])||f.includes(s[c]));)p+=s[c++];return p}function s3(s,c,f=[]){const p=R0(s,c),b=[];for(const R of p)b.push(ds(s,R+c.length,f));return b}function o3(s,c,f="$",p=":"){for(const b in c)s=_0(s,b,c[b],f,p);return s=D0(s),s}function _0(s,c,f,p="$",b=":"){if(f==="")return s;let R=s.indexOf(`${p}${c}`);for(;R!==-1;){if(s[R+c.length+1]===b)if(s[R+c.length+2]===b)s=s.replace(`${p}${c}${b}${b}`,f);else{const G=ds(s,R+c.length+2,["_"]);s=s.replace(`${p}${c}${b}${G}`,f)}else s=s.replace(`${p}${c}`,f);R=s.indexOf(`${p}${c}`,R+f.length)}return s}function D0(s,c="$",f=":"){let p=s.indexOf(c);for(;p!==-1;){const b=ds(s,p+1);if(s[p+b.length+1]===f)if(s[p+b.length+2]===f)s=s.replace(`${c}${b}${f}${f}`,"");else{const R=ds(s,p+b.length+2);s=s.replace(`${c}${b}${f}${R}`,R)}p=s.indexOf(c,p+1)}return s}function a3(s,c){let f=s.indexOf("](");for(;f!==-1;){const p=T0(s,"[",f),b=s.indexOf(")",f);if(p!==-1&&b!==-1){const[R,G]=s.slice(p+1,b).split("]("),te=c(R,G);s=s.slice(0,p)+te+s.slice(b+1)}f=s.indexOf("](",f+1)}return s}function F0(s,c=!0){const f=Object.entries(s).filter(([p,b])=>b!=null).map(([p,b])=>`${p}=${encodeURIComponent(b)}`).join("&");return f?(c?"?":"")+f:""}function c3(s){const c={},f=s.split("&");for(const p of f){const[b,R]=p.split("=");b&&R&&(c[b]=decodeURIComponent(R))}return c}function u3(s,c){return Object.prototype.hasOwnProperty.call(s,c)}function l3(s,c){let f=null,p=-1/0;for(const[b,R]of Object.entries(s)){const G=c(R);G>p&&(p=G,f=b)}return f?[f,s[f]]:null}function f3(s,c,f,p){const b=s.find(G=>G[c]===f),R=s.find(G=>G[c]===f+p);b&&R?(b[c]=f+p,R[c]=f):b&&(b[c]=f+p),s.sort((G,te)=>We(G[c])-We(te[c])),s.forEach((G,te)=>G[c]=te+1)}function h3(s){const c=Object.keys(s);if(c.length===1)return s[c[0]];throw new Error("Expected object to have a single key")}function d3(s,c=":"){return Object.fromEntries(s.map(f=>pc(f,c)).map(f=>f[0]&&f[1]?[fs(f[0]),fs(f[1])]:null).filter(f=>f))}function p3(s,c){if(!s)return!1;const f=s.message;return typeof f=="string"&&f.includes(c)}function m3(s,c,f){return z0([s,c])+F0(f||{})}function g3(s,c=",",f='"'){const p=[];let b="",R=!1;const G=s.split("");for(const te of G)te===c&&!R?(p.push(b),b=""):te===f&&(!b&&!R||R)?R=!R:b+=te;return p.push(b),p}function y3(s){return`[${Math.floor(s.progress*100)}%] ${Oo(s.deltaMs)} out of ${Oo(s.totalTimeMs)} (${Oo(s.remainingTimeMs)} left) [${Math.round(s.baseTimeMs)} ms each]`}async function b3(s,c){let f=c.requiredConsecutivePasses||1,p=0;for(let b=0;b<c.attempts;b++){try{if(await s()){if(p++,p>=f)return}else p=0}catch{p=0}b<c.attempts-1&&await o(c.waitMillis)}throw Error("Timed out waiting for predicate")}function x3(s,c){const f=[];for(let p=s.length-1;p>=0;p--)c(s[p])&&f.push(s.splice(p,1)[0]);return f}function w3(s){return JSON.parse(JSON.stringify(s))}function A3(s){return Math.ceil((s||Date.now())/1e3)}function E3(s){return(s||new Date).toISOString().slice(0,10)}function v3(s){return(s||new Date).toISOString().slice(0,19).replace(/T|:/g,"-")}function R3(s){const c=new Date(s);return new Date(c.getTime()-c.getTimezoneOffset()*6e4)}function T3(s){return new Date(s)}function Cr(s){return String(Math.floor(s)).padStart(2,"0")}function B3(s){let[c,f]=s.split(":");Bt(parseInt(c,10))||(c="0"),Bt(parseInt(f,10))||(f="0");let p=Ec(Ze(c),0,23),b=Ec(Ze(f),0,59);return`${Cr(p)}:${Cr(b)}`}function Oo(s){const c=Math.floor(s/36e5);s=s%36e5;const f=Math.floor(s/6e4);s=s%6e4;const p=Math.floor(s/1e3);return c?`${Cr(c)}:${Cr(f)}:${Cr(p)}`:`${Cr(f)}:${Cr(p)}`}function Dn(s){return Math.floor((rr(s)?s.getTime():s)/864e5)}const S3={today:(s,c)=>Cr(s)+":"+Cr(c),yesterday:()=>"Yesterday",monday:()=>"Mon",tuesday:()=>"Tue",wednesday:()=>"Wed",thursday:()=>"Thu",friday:()=>"Fri",saturday:()=>"Sat",sunday:()=>"Sun",weeks:s=>`${s}w`};function O3(s,c){const f=new Date(c?.now||Date.now()),p=c?.labels||S3,b=rr(s)?s:new Date(s);if(Dn(f)===Dn(b))return p.today(b.getUTCHours(),b.getUTCMinutes(),b.getUTCHours()>12);if(Dn(f)-Dn(b)===1)return p.yesterday();const R=wc(b);return Dn(f)-Dn(b)<7?p[R.day]():p.weeks(Math.round((f.getTime()-b.getTime())/6048e5))}const U0={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 L0(s,c){const f=c?.now??Date.now(),p=c?.labels||U0,b=t.Types.isDate(s)?s.getTime():s;let R=(f-b)/1e3;return R<10?p.now():R<120?p.seconds(Math.floor(R)):(R/=60,R<120?p.minutes(Math.floor(R)):(R/=60,R<48?p.hours(Math.floor(R)):(R/=24,R<14?p.days(Math.floor(R)):(R/=7,p.weeks(Math.floor(R))))))}function P3(s,c=U0){return L0(0,{now:s*1e3,labels:c})}function I3(s,c,f){const p=(f?.now??Date.now())-s,b=Math.floor(p/c),R=c/(f?.precision??1)-Math.ceil(p%c/(f?.precision??1));return{cycles:b,remaining:R}}const xc={};function k3(s,c){return!xc[s]||Date.now()>xc[s]?(xc[s]=Date.now()+c,!0):!1}const N3={s:1e3,m:6e4,h:36e5,d:864e5};function C3(s,c,f){return c=rr(c)?c.getTime():c,f=f?rr(f)?f.getTime():f:Date.now(),(f-c)/N3[s]}function _3(s,c,f,p){p||(p=Date.now());const b=c/f,R=p-s,G=R/c,te=G*f,Y=te-R;return{deltaMs:R,progress:b,baseTimeMs:G,totalTimeMs:te,remainingTimeMs:Y}}const D3={0:"sunday",1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday"};function M0(s){return{zeroBasedIndex:s,day:D3[s]}}function wc(s){return M0(s.getDay())}function F3(s){return wc(new Date(s))}function U3(s){return s*1e3}function L3(s){return s*6e4}function M3(s){return s*36e5}function z3(s){return s*864e5}const V3={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 G3(s){const c=parseFloat(s);if(isNaN(c))throw Error("makeDate got NaN for input");const f=s.replace(/^-?[0-9.]+/,"").trim().toLowerCase(),p=f===""?1:V3[f];if(!p)throw Error(`Unknown unit: "${f}"`);return Math.ceil(c*p)}const $3={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 j3(s,c=1024){const f=parseFloat(s);if(isNaN(f))throw Error("makeStorage got NaN for input");const p=s.replace(/^-?[0-9.]+/,"").trim().toLowerCase(),b=p===""?0:$3[p];if(b==null)throw Error(`Unknown unit: "${p}"`);return Math.ceil(f*c**b)}function H3(s){return s.replace(/ +/g," ").replace(/^ /gm,"")}const _r=new Map;async function q3(s,c,f,p){const b=Date.now(),R=_r.get(s);if(R&&R.validUntil>b)return R.value;p?.onMiss?.();try{const G=await f();return _r.set(s,{value:G,validUntil:b+c}),G}catch(G){throw p?.onFailure?.(G),G}}function Z3(s,c,f,p){const b=Date.now(),R=_r.get(s);if(R&&R.validUntil>b)return R.value;p?.onMiss?.();const G=f();return _r.set(s,{value:G,validUntil:b+c}),G.catch(te=>{_r.delete(s),p?.onFailure?.(te)}),G}function K3(s){_r.delete(s)}function W3(){_r.clear()}function J3(){const s=Date.now();for(const[c,f]of _r.entries())f.validUntil<=s&&_r.delete(c)}function Q3(){return _r.size}function z0(s,c=!1){s=s.filter(R=>R),c&&at(s[1])&&(s[1]="../"+s[1]);let f="";at(s[0])&&s[0].includes("://")&&(f=hc(s[0],"://")??"",s[0]=Bo(s[0],"://")??"");const p=s.map(R=>String(R)).flatMap(R=>R.split("/")),b=[];for(let R=0;R<p.length;R++)p[R]!=="."&&(p[R]===".."?(!f||b.length>1)&&b.pop():b.push(p[R]));return(f?f+"://":"")+b.join("/").replaceAll(/\/{2,}/g,"/")}function Y3(s,c,f,p,b=!0){const R=s.indexOf(c),G=s.indexOf(f,R+c.length);if(R===-1||G===-1)throw Error("Start or end not found");return b?s.substring(0,R+c.length)+p+s.substring(G):s.substring(0,R)+p+s.substring(G+f.length)}function X3(s){let c="p";s.startsWith("#")?(c="h1",s=s.slice(1).trim()):s.startsWith("-")&&(c="li",s=s.slice(1).trim());const f=s[0]===s[0].toUpperCase(),p=/[.?!]$/.test(s),b=/:$/.test(s);return{type:c,isCapitalized:f,hasPunctuation:p,endsWithColon:b}}function eA(s,c="(",f=")"){let p=0,b=0;for(;b<s.length;)if(s.startsWith(c,b)?(p++,b+=c.length):s.startsWith(f,b)?(p--,b+=f.length):b++,p<0)return!1;return c===f?p%2===0:p===0}function tA(s){s=s.normalize("NFD").replace(/[\u0300-\u036f]/g,"");let c=s.length;for(;s=s.replace(/(\w+)[\s,']+\w+/g,"$1"),s.length!==c;)c=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 V0(s){const c=Object.keys(s).sort((p,b)=>p.localeCompare(b)),f={};for(const p of c)f[p]=Fn(s[p]);return f}function G0(s){const c=[];return s.sort((f,p)=>JSON.stringify(Fn(f)).localeCompare(JSON.stringify(Fn(p)))).forEach(f=>c.push(Fn(f))),c}function Fn(s){return Array.isArray(s)?G0(s):xt(s)?V0(s):s}function $0(s,c){return JSON.stringify(Fn(s))===JSON.stringify(Fn(c))}function rA(...s){for(let c=1;c<s.length;c++)if(!$0(s[c-1],s[c]))return!1;return!0}function nA(s){try{return JSON.parse(s)}catch{return null}}function iA(){let s=0;return{next:()=>s++}}function sA(s){let c=0;return{next:()=>s[c++%s.length]}}function oA(s){let c;return f=>{const p=f===s&&c!==s;return c=f,p}}function aA(s,c,f,p,b){const R={};for(const G of Object.keys(c))R[G]=[];R[p]=[],b&&(s=s.sort(b));for(const G of s){const te=G[f],Y=c[te]?te:p;R[Y].length>=c[Y]?R[p].push(G):R[Y].push(G)}return R}function cA(s,c){const f=Object.keys(s),p=Object.keys(c);return{uniqueToA:f.filter(b=>!p.includes(b)),uniqueToB:p.filter(b=>!f.includes(b))}}function j0(s){const c=Object.keys(s);return c[Math.floor(Math.random()*c.length)]}function uA(s,c){const f=j0(s);return s[f]=c(s[f]),f}function lA(s){return s=s.replace(/\r\n/g,`
10
+ `),s=s.replace(/(\w+)\((.+)\)/g,(c,f,p)=>`${f}(${p.replaceAll(",","&comma;")})`),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,(c,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,(c,f,p,b)=>`"${f}":"${p.trim()}"${b}`),s=s.replace(/("'|'")/g,'"'),s=s.replaceAll("&comma;",","),JSON.parse(s)}const ln=[1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24,1e27,1e30,1e9,1e16,1e18,1e18,1e18,1e33],fA=["thousand","million","billion","trillion","quadrillion","quintillion","sextillion","septillion","octillion","nonillion","gwei","bzz","btc","eth","dai","decillion"],H0=["K","M","B","T","Qa","Qi","Sx","Sp","O","N","gwei","bzz","eth","btc","dai","D"];function hA(s,c,f){let p=s.length-c;if(p<=0)return"0."+"0".repeat(-p)+s+(f?" "+f:"");let b=s.substring(0,p),R=s.substring(p);return b===""&&(b="0"),b+"."+R+(f?" "+f:"")}function dA(s,c){const f=c?.longForm??!1,p=c?.unit?` ${c.unit}`:"",b=f?fA:H0,R=c?.precision??1;if(s<ln[0])return`${s}${p}`;for(let G=0;G<ln.length-1;G++)if(s<ln[G+1])return`${(s/ln[G]).toFixed(R)}${f?" ":""}${b[G]}${p}`;return`${(s/ln[ln.length-1]).toFixed(R)}${f?" ":""}${b[ln.length-1]}${p}`}function Ac(s){const c=parseFloat(s);if(isNaN(c))throw Error("makeNumber got NaN for input");const f=s.replace(/^-?[0-9.]+/,"").trim(),p=H0.findIndex(b=>b.toLowerCase()===f.toLowerCase());return p===-1?c:c*ln[p]}function Ec(s,c,f){return s<c?c:s>f?f:s}function pA(s,c,f){const p=s+c;return p>f?f:p}function mA(s,c,f){const p=s-c;return p<f?f:p}function gA(s,c){return c(s),s}function yA(s,c){s&&c(s)}function bA(s,c){const f=Object.keys(c);for(const p of f)Array.isArray(c[p])&&Array.isArray(s[p])&&Ro(s[p],c[p])}function xA(s){return s.splice(0,s.length),s}function wA(s){for(const c of Object.keys(s))(qe(s[c])||Array.isArray(s[c])&&s[c].every(f=>f==null))&&delete s[c];return s}function AA(s){for(const c of Object.entries(s))(c[1]===null||c[1]===void 0||at(c[1])&&cn(c[1]))&&delete s[c[0]];return s}function EA(s,c){const f={};for(const[p,b]of Object.entries(s))c(p)&&(f[p]=b);return f}function vA(s,c){const f={};for(const[p,b]of Object.entries(s))c(b)&&(f[p]=b);return f}function RA(s,c){const f={};for(const p of Object.entries(s))f[p[0]]=c(p[1]);return f}function TA(s,c){const f=[];let p=0;for(const b of s)f.push(c(b,p++));return f}async function BA(s,c){try{return await s()}catch{throw c}}function SA(s,c,f){f!=null&&(s[c]=f)}function OA(s,c,f,p){const b=Ae(f,p);b!=null&&Ee(s,c,b)}function PA(s){const c={};for(const[f,p]of Object.entries(s))c[p]=f;return c}function IA(s){const c=Object.keys(s),f=c.map(te=>s[te].length),p=f.reduce((te,Y)=>te*=Y);let b=1;const R=[1];for(let te=0;te<f.length-1;te++)b*=f[te],R.push(b);const G=[];for(let te=0;te<p;te++){const Y={};for(let we=0;we<c.length;we++){const Rt=s[c[we]],Ht=Math.floor(te/R[we])%Rt.length;Y[c[we]]=Rt[Ht]}G.push(Y)}return G}function kA(s){return Object.values(s).filter(c=>c).length}function NA(s,c,f){return s+(f?"["+c+"]":(s.length?".":"")+c)}function Po(s,c,f,p,b){if(!xt(c))return c;for(const[R,G]of Object.entries(c)){const te=NA(f,R,p);Array.isArray(G)?b?Po(s,G,te,!0,b):s[te]=G.map(Y=>Po(Array.isArray(Y)?[]:{},Y,"",!1,b)):xt(G)?Po(s,G,te,!1,b):s[te]=G}return s}function CA(s,c=!1,f){return Po({},s,f||"",!1,c)}function q0(s){if(!xt(s))return s;const c=Array.isArray(s)?[]:{};for(const[f,p]of Object.entries(s))Array.isArray(p)?Ee(c,f,p.map(b=>q0(b))):Ee(c,f,p);return c}function _A(s,c,f){return c[s]?c[s]:f}function Z0(s,c){const f={};for(const p of s){const b=c(p);f[b]=p}return f}function DA(s,c){const f={};for(const p of s){const b=c(p);f[b]||(f[b]=[]),f[b].push(p)}return f}function FA(s,c){const f=[];for(let p=0;p<s.length;p+=c)f.push(s.slice(p,p+c));return f}function K0(s,c){const f=Math.ceil(s.length/c),p=[];for(let b=0;b<s.length;b+=f)p.push(s.slice(b,b+f));return p}function W0(s,c){const f=[],p=Math.ceil(s.length/c);for(let b=0;b<p;b++)f.push(s.slice(b*c,b*c+c));return f}function UA(s,c){const f=Math.ceil(s.length/c);return W0(s,f)}function LA(s,c){return Object.values(Z0(s,c))}function MA(s,c,f,p,b){const R=c?s.map(c):s,G={};for(const Y of R)G[Y]=(G[Y]||0)+1;const te=p?J0(G,b?(Y,we)=>Y[1]-we[1]:(Y,we)=>we[1]-Y[1]):G;return f?Object.keys(te):te}function J0(s,c){return Object.fromEntries(Object.entries(s).sort(c))}function zA(s){const c=[],f=Object.keys(s),p=s[f[0]].length;for(let b=0;b<p;b++){const R={};for(const G of f)R[G]=s[G][b];c.push(R)}return c}function VA(s,c,f=1){for(const p of s)p[c]+=f}function GA(s,c,f){for(const p of s)p[c]=f}function vc(s,c){const f=[];let p=[];return s.forEach((b,R)=>{(R===0||!c(b,s[R-1]))&&(p=[],f.push(p)),p.push(b)}),f}function $A(){return{map:new Map,keys:[]}}function jA(){return{map:new Map,keys:[]}}function Q0(s,c,f,p=100){if(s.map.has(c)){const b=s.keys.indexOf(c);s.keys.splice(b,1)}if(s.map.set(c,f),s.keys.push(c),s.keys.length>p){const b=s.keys.shift();b&&s.map.delete(b)}}function HA(s,c,f,p=100){if(s.map.has(c)){const b=s.keys.indexOf(c);s.keys.splice(b,1)}if(s.map.set(c,f),s.keys.unshift(c),s.keys.length>p){const b=s.keys.shift();b&&s.map.delete(b)}}function qA(s,c,f,p,b=100){Q0(s,c,{validUntil:Date.now()+p,data:f},b)}function ZA(s,c){const f=s.map.get(c);return f&&f.validUntil>Date.now()?f.data:null}class fn{constructor(c){this.value=c}static of(c){return new fn(c)}static empty(){return new fn(null)}map(c){return new fn(this.value!==null&&this.value!==void 0?c(this.value):null)}mapAsync(c){return this.value!==null&&this.value!==void 0?c(this.value).then(f=>fn.of(f)):Promise.resolve(fn.empty())}ifPresent(c){return this.value!==null&&this.value!==void 0&&c(this.value),this}ifPresentAsync(c){return this.value!==null&&this.value!==void 0?c(this.value).then(()=>this):Promise.resolve(this)}ifAbsent(c){return(this.value===null||this.value===void 0)&&c(),this}ifAbsentAsync(c){return this.value===null||this.value===void 0?c().then(()=>this):Promise.resolve(this)}getOrFallback(c){return this.value??c()}getOrFallbackAsync(c){return this.value!==null&&this.value!==void 0?Promise.resolve(this.value):c()}getOrThrow(){if(this.value===null||this.value===void 0)throw Error("Optional.value is empty");return this.value}}t.Optional=fn;class KA{constructor(c){this.supplier=c,this.value=null}get(){return this.value||(this.value=this.supplier()),this.value}}t.Lazy=KA;class WA{constructor(c){this.supplier=c,this.value=null}async get(){return this.value||(this.value=await this.supplier()),this.value}}t.AsyncLazy=WA;function JA(s){return()=>s.forEach(c=>c())}function QA(s,c){return s.reduce((f,p)=>c(f)>c(p)?f:p)}function YA(s,c){return s.reduce((f,p)=>c(f)<c(p)?f:p)}function XA(s,c){const f=[];return s.forEach((p,b)=>{c(p)&&f.push(b)}),f}function e8(s,c){const f=s.find(p=>p instanceof c);return fn.of(f)}function t8(s,c){return s.filter(f=>f instanceof c)}function r8(s,c){const f=[],p=Math.max(s.length,c.length);for(let b=0;b<p;b++)s[b]&&f.push(s[b]),c[b]&&f.push(c[b]);return f}function n8(s,c){return s.includes(c)?s.filter(f=>f!==c):[...s,c]}class i8{constructor(c){this.value=c,this.children=[]}}function s8(s,c,f,p,b=!1){const R=new Map,G=[];s.forEach(Y=>{const we=new i8(Y);R.set(Y[c],we)}),s.forEach(Y=>{const we=R.get(Y[c]);if(!we)return;const Rt=Y[f];if(Rt){const Ht=R.get(Rt);Ht&&Ht.children.push(we)}else G.push(we)});const te=Y=>{Y.children.sort((we,Rt)=>{const Ht=we.value[p],mi=Rt.value[p];return b?mi-Ht:Ht-mi}),Y.children.forEach(te)};return G.forEach(te),G}function Y0(s,c){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 b=0;b<f.length;b+=2){const R=f[b+1];p.push(c(f[b],R))}f=p}return f[0]}function hi(...s){const c=s.reduce((b,R)=>b+R.length,0),f=new Uint8Array(c);let p=0;return s.forEach(b=>{f.set(b,p),p+=b.length}),f}function X0(s){return s[0]===137&&s[1]===80&&s[2]===78&&s[3]===71}function ed(s){return s[0]===255&&s[1]===216}function td(s){return s[8]===87&&s[9]===69&&s[10]===66&&s[11]===80}function o8(s){return X0(s)||ed(s)||td(s)}function a8(s){return new Uint8Array([s])}function c8(s){return s[0]}function u8(s,c){const f=new ArrayBuffer(2);return new DataView(f).setUint16(0,s,c==="LE"),new Uint8Array(f)}function l8(s,c){return new DataView(s.buffer).getUint16(s.byteOffset,c==="LE")}function f8(s,c){const f=new ArrayBuffer(4);return new DataView(f).setUint32(0,s,c==="LE"),new Uint8Array(f)}function h8(s,c){return new DataView(s.buffer).getUint32(s.byteOffset,c==="LE")}function Rc(s,c){const f=new ArrayBuffer(8);return new DataView(f).setBigUint64(0,BigInt(s),c==="LE"),new Uint8Array(f)}function d8(s,c){return new DataView(s.buffer).getBigUint64(s.byteOffset,c==="LE")}function di(s,c){const f=new Uint8Array(32);let p=s;if(c==="LE"){for(let b=0;b<32;b++)f[b]=Number(p&0xffn),p>>=8n;return f}for(let b=31;b>=0;b--)f[b]=Number(p&0xffn),p>>=8n;return f}function pi(s,c){let f=0n;if(c==="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 p8(s,c){const f=[];let p=0;for(const b of c)f.push(s.subarray(p,p+b)),p+=b;return f}function Tc(s,c){const f=[];for(let p=0;p<s.length;p+=c)f.push(s.subarray(p,p+c));return f}const rd=[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 m8(s){for(let c=0;c<24;c++){const f=s[0]^s[10]^s[20]^s[30]^s[40],p=s[1]^s[11]^s[21]^s[31]^s[41],b=s[2]^s[12]^s[22]^s[32]^s[42],R=s[3]^s[13]^s[23]^s[33]^s[43],G=s[4]^s[14]^s[24]^s[34]^s[44],te=s[5]^s[15]^s[25]^s[35]^s[45],Y=s[6]^s[16]^s[26]^s[36]^s[46],we=s[7]^s[17]^s[27]^s[37]^s[47],Rt=s[8]^s[18]^s[28]^s[38]^s[48],Ht=s[9]^s[19]^s[29]^s[39]^s[49],mi=b<<1|R>>>31,t4=R<<1|b>>>31,gs=Rt^mi,ys=Ht^t4,r4=G<<1|te>>>31,n4=te<<1|G>>>31,bs=f^r4,xs=p^n4,i4=Y<<1|we>>>31,s4=we<<1|Y>>>31,ws=b^i4,As=R^s4,o4=Rt<<1|Ht>>>31,a4=Ht<<1|Rt>>>31,Es=G^o4,vs=te^a4,c4=f<<1|p>>>31,u4=p<<1|f>>>31,Rs=Y^c4,Ts=we^u4;s[0]^=gs,s[1]^=ys,s[2]^=bs,s[3]^=xs,s[4]^=ws,s[5]^=As,s[6]^=Es,s[7]^=vs,s[8]^=Rs,s[9]^=Ts,s[10]^=gs,s[11]^=ys,s[12]^=bs,s[13]^=xs,s[14]^=ws,s[15]^=As,s[16]^=Es,s[17]^=vs,s[18]^=Rs,s[19]^=Ts,s[20]^=gs,s[21]^=ys,s[22]^=bs,s[23]^=xs,s[24]^=ws,s[25]^=As,s[26]^=Es,s[27]^=vs,s[28]^=Rs,s[29]^=Ts,s[30]^=gs,s[31]^=ys,s[32]^=bs,s[33]^=xs,s[34]^=ws,s[35]^=As,s[36]^=Es,s[37]^=vs,s[38]^=Rs,s[39]^=Ts,s[40]^=gs,s[41]^=ys,s[42]^=bs,s[43]^=xs,s[44]^=ws,s[45]^=As,s[46]^=Es,s[47]^=vs,s[48]^=Rs,s[49]^=Ts;const Nc=s[0],Cc=s[1],_c=s[2]<<1|s[3]>>>31,Dc=s[3]<<1|s[2]>>>31,Fc=s[5]<<30|s[4]>>>2,Uc=s[4]<<30|s[5]>>>2,Lc=s[6]<<28|s[7]>>>4,Mc=s[7]<<28|s[6]>>>4,zc=s[8]<<27|s[9]>>>5,Vc=s[9]<<27|s[8]>>>5,Gc=s[11]<<4|s[10]>>>28,$c=s[10]<<4|s[11]>>>28,jc=s[13]<<12|s[12]>>>20,Hc=s[12]<<12|s[13]>>>20,qc=s[14]<<6|s[15]>>>26,Zc=s[15]<<6|s[14]>>>26,Kc=s[17]<<23|s[16]>>>9,Wc=s[16]<<23|s[17]>>>9,Jc=s[18]<<20|s[19]>>>12,Qc=s[19]<<20|s[18]>>>12,Yc=s[20]<<3|s[21]>>>29,Xc=s[21]<<3|s[20]>>>29,eu=s[22]<<10|s[23]>>>22,tu=s[23]<<10|s[22]>>>22,ru=s[25]<<11|s[24]>>>21,nu=s[24]<<11|s[25]>>>21,iu=s[26]<<25|s[27]>>>7,su=s[27]<<25|s[26]>>>7,ou=s[29]<<7|s[28]>>>25,au=s[28]<<7|s[29]>>>25,cu=s[31]<<9|s[30]>>>23,uu=s[30]<<9|s[31]>>>23,lu=s[33]<<13|s[32]>>>19,fu=s[32]<<13|s[33]>>>19,hu=s[34]<<15|s[35]>>>17,du=s[35]<<15|s[34]>>>17,pu=s[36]<<21|s[37]>>>11,mu=s[37]<<21|s[36]>>>11,gu=s[38]<<8|s[39]>>>24,yu=s[39]<<8|s[38]>>>24,bu=s[40]<<18|s[41]>>>14,xu=s[41]<<18|s[40]>>>14,wu=s[42]<<2|s[43]>>>30,Au=s[43]<<2|s[42]>>>30,Eu=s[45]<<29|s[44]>>>3,vu=s[44]<<29|s[45]>>>3,Ru=s[47]<<24|s[46]>>>8,Tu=s[46]<<24|s[47]>>>8,Bu=s[48]<<14|s[49]>>>18,Su=s[49]<<14|s[48]>>>18;s[0]=Nc^~jc&ru,s[1]=Cc^~Hc&nu,s[2]=jc^~ru&pu,s[3]=Hc^~nu&mu,s[4]=ru^~pu&Bu,s[5]=nu^~mu&Su,s[6]=pu^~Bu&Nc,s[7]=mu^~Su&Cc,s[8]=Bu^~Nc&jc,s[9]=Su^~Cc&Hc,s[10]=Lc^~Jc&Yc,s[11]=Mc^~Qc&Xc,s[12]=Jc^~Yc&lu,s[13]=Qc^~Xc&fu,s[14]=Yc^~lu&Eu,s[15]=Xc^~fu&vu,s[16]=lu^~Eu&Lc,s[17]=fu^~vu&Mc,s[18]=Eu^~Lc&Jc,s[19]=vu^~Mc&Qc,s[20]=_c^~qc&iu,s[21]=Dc^~Zc&su,s[22]=qc^~iu&gu,s[23]=Zc^~su&yu,s[24]=iu^~gu&bu,s[25]=su^~yu&xu,s[26]=gu^~bu&_c,s[27]=yu^~xu&Dc,s[28]=bu^~_c&qc,s[29]=xu^~Dc&Zc,s[30]=zc^~Gc&eu,s[31]=Vc^~$c&tu,s[32]=Gc^~eu&hu,s[33]=$c^~tu&du,s[34]=eu^~hu&Ru,s[35]=tu^~du&Tu,s[36]=hu^~Ru&zc,s[37]=du^~Tu&Vc,s[38]=Ru^~zc&Gc,s[39]=Tu^~Vc&$c,s[40]=Fc^~Kc&ou,s[41]=Uc^~Wc&au,s[42]=Kc^~ou&cu,s[43]=Wc^~au&uu,s[44]=ou^~cu&wu,s[45]=au^~uu&Au,s[46]=cu^~wu&Fc,s[47]=uu^~Au&Uc,s[48]=wu^~Fc&Kc,s[49]=Au^~Uc&Wc,s[0]^=rd[c*2],s[1]^=rd[c*2+1]}}function nd(s){const c=[];for(let f=0;f<s.length;f+=4)c.push(s[f]|s[f+1]<<8|s[f+2]<<16|s[f+3]<<24);return c}function id(s,c){if(!s.length){const b=new Uint8Array(136);return b[0]=c,b[135]=128,[nd(b)]}const f=Tc(s,136),p=f[f.length-1];if(p.length<136){const b=new Uint8Array(136);b.set(p),b[p.length]=c,b[135]|=128,f[f.length-1]=b}if(p.length===136){const b=new Uint8Array(136);b[0]=c,b[135]=128,f.push(b)}return f.map(nd)}function sd(s,c){for(const f of c){for(let p=0;p<34;p+=2)s[p]^=f[p+1],s[p+1]^=f[p];m8(s)}return s}function od(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 hn(s){return od(sd(new Array(50).fill(0),id(s,1)))}function g8(s){return od(sd(new Array(50).fill(0),id(s,6)))}function y8(s,c){const f=Math.min(s.length,c.length);for(let p=0;p<f;p++){const b=s[p]^c[p];for(let R=0;R<8;R++)if(b>>7-R&1)return p*8+R}return Math.min(s.length,c.length)*8}function b8(s,c){const f=Math.min(s.length,c.length);for(let p=0;p<f;p++)if(s[p]!==c[p])return s.subarray(0,p);return s.subarray(0,f)}function x8(s,c,f,p){const b=Math.floor(c/8),R=c%8;f===1?s[b]|=1<<(p==="BE"?7-R:R):s[b]&=~(1<<(p==="BE"?7-R:R))}function w8(s,c,f){const p=Math.floor(c/8),b=c%8;return s[p]>>(f==="BE"?7-b:b)&1}function A8(s,c,f=0){for(let p=f;p<s.length;p++)for(let b=0;b<c.length&&s[p+b]===c[b];b++)if(b===c.length-1)return p;return-1}function ad(s,c,f=0){if(s.length>=c)return s;const p=new Uint8Array(c);return p.fill(f),p.set(s,c-s.length),p}function E8(s,c,f=0){const p=s.length%c;return p===0?s:ad(s,s.length+c-p,f)}function cd(s,c,f=0){if(s.length>=c)return s;const p=new Uint8Array(c);return p.fill(f),p.set(s,0),p}function v8(s,c,f=0){const p=s.length%c;return p===0?s:cd(s,s.length+c-p,f)}function R8(s,c){const f=new Uint8Array(s.length);for(let p=0;p<s.length;p++)f[p]=s[p]^c[p%c.length];return f}function T8(s){for(let c=0;c<s.length;c++){const f=s[c];if(!(f<128))if((f&224)===192){if(c+1>=s.length||(s[c+1]&192)!==128)return!1;c+=1}else if((f&240)===224){if(c+2>=s.length||(s[c+1]&192)!==128||(s[c+2]&192)!==128)return!1;c+=2}else if((f&248)===240){if(c+3>=s.length||(s[c+1]&192)!==128||(s[c+2]&192)!==128||(s[c+3]&192)!==128)return!1;c+=3}else return!1}return!0}function B8(s,c){if(s.length!==c.length)return!1;for(let f=0;f<s.length;f++)if(s[f]!==c[f])return!1;return!0}function rt(s,c){return(s%c+c)%c}function ps(s,c){s=rt(s,c);let[f,p]=[0n,1n],[b,R]=[c,s];for(;R!==0n;){const G=b/R;[f,p]=[p,f-G*p],[b,R]=[R,b-G*R]}if(b>1n)throw new Error("a is not invertible");return f<0n&&(f+=c),f}function S8(s,c,f){let p=1n;for(s=rt(s,f);c>0;)c%2n===1n&&(p=rt(p*s,f)),s=rt(s*s,f),c=c/2n;return p}function ud(s,c){return rt(s,c)===0n?0n:c%4n===3n?S8(s,(c+1n)/4n,c):null}const Lt=0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,St=0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,Io=0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,ko=0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n;function Bc(s,c,f){if(c===0n)return[0n,0n];const p=rt(3n*s*s*ps(2n*c,f),f),b=rt(p*p-2n*s,f),R=rt(p*(s-b)-c,f);return[b,R]}function No(s,c,f,p,b){if(s===0n&&c===0n)return[f,p];if(f===0n&&p===0n)return[s,c];if(s===f&&c===rt(-p,b))return[0n,0n];if(s===f&&c===p)return Bc(s,c,b);const R=rt((p-c)*ps(f-s,b),b),G=rt(R*R-s-f,b),te=rt(R*(s-G)-c,b);return[G,te]}function O8(s){if(s<=0n||s>=St)throw new Error("Invalid private key");return Un(Io,ko,s,Lt)}function P8(s){const c=s[1]%2n===0n?2:3;return new Uint8Array([c,...di(s[0],"BE")])}function I8(s){if(s.length!==33||s[0]!==2&&s[0]!==3)throw new Error("Invalid compressed public key");const c=pi(s.slice(1),"BE"),f=ud(rt(c**3n+7n,Lt),Lt);if(!f)throw Error("Invalid x: does not correspond to a valid curve point");const p=rt(-f,Lt),b=f%2n===0n;return[c,s[0]===2?b?f:p:b?p:f]}function k8(s){const c=new Uint8Array(20),f=hn(hi(di(s[0],"BE"),di(s[1],"BE")));return c.set(f.subarray(12)),c}function N8(s){const c=t.Binary.uint8ArrayToHex(s),f=t.Binary.uint8ArrayToHex(t.Binary.keccak256(new Uint8Array([...c].map(b=>b.charCodeAt(0)))));let p="0x";for(let b=0;b<c.length;b++)parseInt(f[b],16)>7?p+=c[b].toUpperCase():p+=c[b];return p}function Un(s,c,f,p){let b=[0n,0n],R=[s,c];const G=f.toString(2);for(const te of G)te==="0"?(R=No(b[0],b[1],R[0],R[1],p),b=Bc(b[0],b[1],p)):(b=No(b[0],b[1],R[0],R[1],p),R=Bc(R[0],R[1],p));return b}function C8(s,c,f){return ld(pi(hn(s),"BE"),c,f)}function ld(s,c,f){if(c<=0n||c>=St)throw new Error("Invalid private key");if(f||(f=rt(pi(hn(hi(hn(di(c,"BE")),di(s,"BE"))),"BE"),St)),f<=0n||f>=St)throw new Error("Invalid nonce");const p=rt(s,St),b=Un(Io,ko,f,Lt),R=rt(b[0],St);let G=rt((p+rt(R,St)*c)*ps(f,St),St);if(R===0n||G===0n)throw new Error("Invalid r or s value");let te=b[1]%2n===0n?27n:28n;return G>St/2n&&(G=St-G,te=te===27n?28n:27n),[R,G,te]}function _8(s,c,f,p){const b=ud(rt(c**3n+7n,Lt),Lt);if(!b)throw new Error("Invalid r: does not correspond to a valid curve point");const R=p===27n?0n:1n,G=b%2n===R?b:Lt-b,te=rt(pi(hn(s),"BE"),St),Y=Un(c,G,f,Lt),we=Un(Io,ko,te,Lt),Rt=No(Y[0],Y[1],we[0],rt(-we[1],Lt),Lt);return Un(Rt[0],Rt[1],ps(c,St),Lt)}function D8(s,c,f,p){const b=rt(pi(hn(s),"BE"),St),R=ps(p,St),G=rt(b*R,St),te=rt(f*R,St),Y=Un(Io,ko,G,Lt),we=Un(c[0],c[1],te,Lt),Rt=No(Y[0],Y[1],we[0],we[1],Lt);return f===rt(Rt[0],St)}class fd{constructor(c){this.cursor=0,this.buffer=c}read(c){const f=this.buffer.subarray(this.cursor,this.cursor+c);return this.cursor+=c,f}max(){return this.buffer.length-this.cursor}}t.Uint8ArrayReader=fd;class hd{constructor(c){this.buffer=c,this.cursor=0}write(c){const f=Math.min(this.max(),c.max());return this.buffer.set(c.read(f),this.cursor),this.cursor+=f,f}max(){return this.buffer.length-this.cursor}}t.Uint8ArrayWriter=hd;class dn{constructor(c,f=0n){this.span=f,this.writer=new hd(new Uint8Array(c))}build(){return hi(Rc(this.span,"LE"),this.writer.buffer)}hash(){const c=Y0(Tc(this.writer.buffer,32),(f,p)=>dn.hashFunction(hi(f,p)));return dn.hashFunction(hi(Rc(this.span,"LE"),c))}}t.Chunk=dn,dn.hashFunction=hn;class Sc{constructor(c,f=4096){this.counters=[1],this.capacity=f,this.chunks=[new dn(f)],this.onChunk=c}static async root(c,f=4096){const p=new e(e.NOOP,f);return await p.append(c),p.finalize()}async append(c,f=0,p=0n){const b=new fd(c);for(;b.max()>0;){this.chunks[f].writer.max()===0&&await this.elevate(f);const R=this.chunks[f].writer.write(b);p?this.chunks[f].span+=p:this.chunks[0].span+=BigInt(R)}}async elevate(c){this.counters[c]=++this.counters[c]%(this.capacity/32),this.chunks[c+1]||(this.chunks.push(new dn(this.capacity)),this.counters.push(1)),await this.append(this.chunks[c].hash(),c+1,this.chunks[c].span),await this.onChunk(this.chunks[c]),this.chunks[c]=new dn(this.capacity)}async finalize(c=0){return this.chunks[c+1]?this.counters[c]===1?(await this.elevate(c+1),this.chunks[c+1]=this.chunks[c],this.finalize(c+1)):(await this.elevate(c),this.finalize(c+1)):(await this.onChunk(this.chunks[c]),this.chunks[c])}}t.MerkleTree=Sc,e=Sc,Sc.NOOP=async s=>{};class nr{constructor(c,f){if(f<0)throw Error("Scale must be non-negative");this.value=BigInt(c),this.scale=f}static cast(c){if(!c)throw Error("Cannot cast falsy value to FixedPointNumber");if(c instanceof nr)return c;const f=h0(c.value),p=We(c.scale);return new nr(f,p)}static fromDecimalString(c,f){/e\-\d+$/i.test(c)&&(c=parseFloat(c).toFixed(f));let[p,b]=c.split(".");return b=(b||"").padEnd(f,"0").slice(0,f),new nr(BigInt(p+b),f)}static fromFloat(c,f){return nr.fromDecimalString(c.toString(),f)}add(c){return this.assertSameScale(c),new nr(this.value+c.value,this.scale)}subtract(c){return this.assertSameScale(c),new nr(this.value-c.value,this.scale)}multiply(c){return new nr(this.value*c,this.scale)}divmod(c){if(c===0n)throw new Error("Division by zero is not allowed");const f=this.value/c,p=this.value%c;return[new nr(f,this.scale),new nr(p,this.scale)]}exchange(c,f,p){if(c==="*"){const R=this.value*f.value/10n**BigInt(this.scale);return new nr(R,p)}this.assertSameScale(f);const b=this.value*10n**BigInt(p)/f.value;return new nr(b,p)}compare(c){return this.assertSameScale(c),this.value>c.value?1:this.value<c.value?-1:0}toDecimalString(){if(this.scale===0)return this.value.toString();const c=this.value.toString(),f=c.slice(0,-this.scale)||"0",p=c.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(c){if(this.scale!==c.scale)throw new Error(`Scale mismatch: expected ${this.scale}, but got ${c.scale}`)}}t.FixedPointNumber=nr;function F8(s){if(s.length===0)return null;const c=s[0];return c.ttlMax?--c.ttl<=0&&s.shift():c.ttlMax=c.ttl,{progress:(c.ttlMax-c.ttl)/c.ttlMax,data:c.data}}function Co(s,c,f,p){const b=s.findIndex(te=>te===`--${c}`||te.startsWith(`--${c}=`)),R=s[b];if(!R)return(f||{})[p||c||""]||null;if(R.includes("="))return R.split("=")[1];const G=s[b+1];return G&&!G.startsWith("-")?G:(f||{})[p||c||""]||null}function U8(s,c,f,p){const b=Co(s,c,f,p);if(!b)return null;try{return Ac(b)}catch{throw new Error(`Invalid number argument ${c}: ${b}`)}}function L8(s,c,f,p){const b=s.some(Y=>Y.endsWith("-"+c)),R=Co(s,c,f,p);if(!R&&b)return!0;if(!R&&!b)return null;const G=["true","1","yes","y","on"],te=["false","0","no","n","off"];if(G.includes(R.toLowerCase()))return!0;if(te.includes(R.toLowerCase()))return!1;throw Error(`Invalid boolean argument ${c}: ${R}`)}function dd(s,c,f,p){const b=Co(s,c,f,p);if(!b)throw new Error(`Missing argument ${c}`);return b}function M8(s,c,f,p){const b=dd(s,c,f,p);try{return Ac(b)}catch{throw new Error(`Invalid argument ${c}: ${b}`)}}function pd(s,c){const f=s[c];s.splice(c,1),s.unshift(f)}function z8(s,c){const f=[...s];return pd(f,c),f}function md(s,c){return{x:s.x+c.x,y:s.y+c.y}}function V8(s,c){return{x:s.x-c.x,y:s.y-c.y}}function Oc(s,c){return{x:s.x*c,y:s.y*c}}function G8(s){const c=Math.sqrt(s.x*s.x+s.y*s.y);return{x:s.x/c,y:s.y/c}}function gd(s,c,f){return{x:s.x+Math.cos(c)*f,y:s.y+Math.sin(c)*f}}function yd(s,c){return Math.sqrt((s.x-c.x)**2+(s.y-c.y)**2)}function ms(s,c,f="row-first"){const p=[];if(f==="column-first")for(let b=0;b<s.length;b++)for(let R=0;R<s[0].length;R++)c(b,R)&&p.push({x:b,y:R});else for(let b=0;b<s[0].length;b++)for(let R=0;R<s.length;R++)c(R,b)&&p.push({x:R,y:b});return p}function $8(s,c,f){return s[c+1]?.[f]&&s[c-1]?.[f]&&!s[c][f-1]&&!s[c][f+1]}function j8(s,c,f){return s[c][f+1]&&s[c][f-1]&&!s[c-1]?.[f]&&!s[c+1]?.[f]}function bd(s,c,f){return!s[c-1]?.[f]}function xd(s,c,f){return!s[c+1]?.[f]}function wd(s,c,f){return!s[c][f-1]}function Ad(s,c,f){return!s[c][f+1]}function H8(s,c,f){const p=[];return s[c][f]?$8(s,c,f)||j8(s,c,f)?[]:(!s[c-1]?.[f-1]&&bd(s,c,f)&&wd(s,c,f)&&p.push({x:c,y:f}),!s[c+1]?.[f-1]&&xd(s,c,f)&&wd(s,c,f)&&p.push({x:c+1,y:f}),!s[c-1]?.[f+1]&&bd(s,c,f)&&Ad(s,c,f)&&p.push({x:c,y:f+1}),!s[c+1]?.[f+1]&&xd(s,c,f)&&Ad(s,c,f)&&p.push({x:c+1,y:f+1}),p):(s[c-1]?.[f]&&s[c][f-1]&&p.push({x:c,y:f}),s[c+1]?.[f]&&s[c][f-1]&&p.push({x:c+1,y:f}),s[c-1]?.[f]&&s[c][f+1]&&p.push({x:c,y:f+1}),s[c+1]?.[f]&&s[c][f+1]&&p.push({x:c+1,y:f+1}),p)}function q8(s,c,f,p){const b=[{x:0,y:0},{x:f,y:0},{x:0,y:p},{x:f,y:p}];for(let R=0;R<s.length;R++)for(let G=0;G<s[0].length;G++){const te=H8(s,R,G);for(const Y of te)b.some(we=>we.x===Y.x&&we.y===Y.y)||b.push(Y)}return b.map(R=>({x:R.x*c,y:R.y*c}))}function Z8(s,c){const f=ms(s,(Y,we)=>s[Y][we]===0&&s[Y][we+1]!==0,"row-first").map(Y=>({...Y,dx:1,dy:0})),p=ms(s,(Y,we)=>s[Y][we]===0&&s[Y][we-1]!==0,"row-first").map(Y=>({...Y,dx:1,dy:0})),b=ms(s,(Y,we)=>s[Y][we]===0&&s[Y-1]?.[we]!==0,"column-first").map(Y=>({...Y,dx:0,dy:1})),R=ms(s,(Y,we)=>s[Y][we]===0&&s[Y+1]?.[we]!==0,"column-first").map(Y=>({...Y,dx:0,dy:1}));f.forEach(Y=>Y.y++),R.forEach(Y=>Y.x++);const G=vc([...b,...R],(Y,we)=>Y.x===we.x&&Y.y-1===we.y),te=vc([...p,...f],(Y,we)=>Y.y===we.y&&Y.x-1===we.x);return[...G,...te].map(Y=>({start:Y[0],end:me(Y)})).map(Y=>({start:Oc(Y.start,c),end:Oc(md(Y.end,{x:Y.start.dx,y:Y.start.dy}),c)}))}function K8(s,c){return Math.atan2(c.y-s.y,c.x-s.x)}function W8(s,c){return c.map(f=>K8(s,f)).sort((f,p)=>f-p)}function Ed(s,c,f,p){const b=(p.y-f.y)*(c.x-s.x)-(p.x-f.x)*(c.y-s.y);if(b===0)return null;let R=s.y-f.y,G=s.x-f.x;const te=(p.x-f.x)*R-(p.y-f.y)*G,Y=(c.x-s.x)*R-(c.y-s.y)*G;return R=te/b,G=Y/b,R>0&&R<1&&G>0&&G<1?{x:s.x+R*(c.x-s.x),y:s.y+R*(c.y-s.y)}:null}function Pc(s,c,f){const p=[],b=gd(s,f,1e4);for(const R of c){const G=Ed(s,b,R.start,R.end);G&&p.push(G)}return p.length?p.reduce((R,G)=>{const te=yd(s,G),Y=yd(s,R);return te<Y?G:R}):null}function J8(s,c,f){const p=W8(s,f),b=[];for(const R of p){const G=Pc(s,c,R-.001),te=Pc(s,c,R+.001);G&&b.push(G),te&&b.push(te)}return b}class Ic{constructor(){this.subscribers=[]}subscribe(c){return this.subscribers.push(c),()=>{this.subscribers=this.subscribers.filter(f=>f!==c)}}publish(c){this.subscribers.forEach(f=>f(c))}clear(){this.subscribers=[]}getSubscriberCount(){return this.subscribers.length}}t.PubSubChannel=Ic;class Q8{constructor(c,f){this.queue=[],this.running=0,this.onProcessed=new Ic,this.onDrained=new Ic,this.concurrency=c,this.capacity=f}process(){if(this.running>=this.concurrency)return;const c=this.queue.shift();c&&(this.running++,c().finally(()=>{this.running--,this.process(),this.onProcessed.publish(),this.running===0&&this.onDrained.publish()}))}enqueue(c){if(this.queue.length<this.capacity)return this.queue.push(c),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(c),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(c=>{this.onDrained.subscribe(()=>{this.onDrained.clear(),c()})})}}t.AsyncQueue=Q8;class kc{constructor(){this.forks=new Map}insert(c,f){if(c.length===0){this.handler=f;return}const p=c[0];let b=p,R;if(p.startsWith(":")&&(b=":",R=p.slice(1)),!this.forks.has(b)){const G=new kc;R&&(G.variableName=R),this.forks.set(b,G)}this.forks.get(b).insert(c.slice(1),f)}async handle(c,f,p,b){if(c.length===0)return this.handler?(await this.handler(f,p,b),!0):!1;const R=c[0],G=this.forks.get(R);if(G)return G.handle(c.slice(1),f,p,b);const te=this.forks.get(":");if(te)return te.variableName&&b.set(te.variableName,decodeURIComponent(R)),te.handle(c.slice(1),f,p,b);const Y=this.forks.get("*");return Y?(b.set("wildcard",c.join("/")),Y.handler?(await Y.handler(f,p,b),!0):!1):!1}}t.TrieRouter=kc;class Y8{constructor(c){this.index=0,this.values=c}current(){return this.values[this.index]}next(){return this.index=(this.index+1)%this.values.length,this.values[this.index]}}t.RollingValueProvider=Y8;class X8{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(c=>[c.name,"pending"]))}setHooks(c){c.onStatusChange&&(this.onStatusChange=c.onStatusChange),c.onStepChange&&(this.onStepChange=c.onStepChange),c.onFinish&&(this.onFinish=c.onFinish),c.onError&&(this.onError=c.onError)}addStep(c){if(this.steps.find(f=>f.name===c.name))throw Error(`Step with name ${c.name} already exists`);this.steps.push(c)}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 c=this.createInitialState();for(const f of this.steps)try{if(f.transientSkipStepName){const p=c[f.transientSkipStepName];if(p==="skipped"||p==="failed"){c={...c,[f.name]:"skipped"},await this.onStepChange(c);continue}}if(!(!f.precondition||await f.precondition(this.context))){c={...c,[f.name]:"skipped"},await this.onStepChange(c);continue}c={...c,[f.name]:"in-progress"},await this.onStepChange(c);for(let p=0;await f.action(this.context,p)==="retry";p++);c={...c,[f.name]:"completed"},await this.onStepChange(c)}catch(p){throw c={...c,[f.name]:"failed"},this.status="failed",await this.onStatusChange(this.status),await this.onStepChange(c),await this.onError(p),p}return this.status="completed",await this.onStatusChange(this.status),await this.onFinish(),this.context}}t.Solver=X8;class e4{constructor(c){this.queryFunction=c.queryFunction,this.lockFunction=c.lockFunction,this.unlockFunction=c.unlockFunction,this.timeoutMillis=c.timeoutMillis}async couldLock(){const c=await this.queryFunction();try{const f=Ze(c);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()}}t.Lock=e4,t.Binary={hexToUint8Array:j2,uint8ArrayToHex:H2,binaryToUint8Array:Z2,uint8ArrayToBinary:q2,base64ToUint8Array:z2,uint8ArrayToBase64:V2,base32ToUint8Array:G2,uint8ArrayToBase32:$2,log2Reduce:Y0,partition:Tc,concatBytes:hi,numberToUint8:a8,uint8ToNumber:c8,numberToUint16:u8,uint16ToNumber:l8,numberToUint32:f8,uint32ToNumber:h8,numberToUint64:Rc,uint64ToNumber:d8,numberToUint256:di,uint256ToNumber:pi,sliceBytes:p8,keccak256:hn,sha3_256:g8,proximity:y8,commonPrefix:b8,setBit:x8,getBit:w8,indexOf:A8,equals:B8,padStart:ad,padStartToMultiple:E8,padEnd:cd,padEndToMultiple:v8,xorCypher:R8,isUtf8:T8},t.Elliptic={privateKeyToPublicKey:O8,compressPublicKey:P8,publicKeyFromCompressed:I8,publicKeyToAddress:k8,signMessage:C8,signHash:ld,verifySignature:D8,recoverPublicKey:_8,checksumEncode:N8},t.Random={intBetween:P,floatBetween:I,chance:U,signed:S,makeSeededRng:A,point:_,procs:F},t.Arrays={countUnique:MA,makeUnique:LA,splitBySize:FA,splitByCount:K0,index:Z0,indexCollection:DA,onlyOrThrow:u,onlyOrNull:l,firstOrThrow:d,firstOrNull:h,shuffle:a,initialize:m,initialize2D:w,rotate2D:y,containsShape:T,glue:Ww,pluck:B,pick:H,pickMany:K,pickManyUnique:le,pickWeighted:ue,pickRandomIndices:E,pickGuaranteed:L,last:me,pipe:Be,makePipe:re,sortWeighted:ye,pushAll:Ro,unshiftAll:Zw,filterAndRemove:x3,merge:bA,empty:xA,pushToBucket:jw,unshiftAndLimit:Hw,atRolling:qw,group:vc,createOscillator:sA,organiseWithLimits:aA,tickPlaybook:F8,getArgument:Co,getBooleanArgument:L8,getNumberArgument:U8,requireStringArgument:dd,requireNumberArgument:M8,bringToFront:z8,bringToFrontInPlace:pd,findInstance:e8,filterInstances:t8,interleave:r8,toggle:n8,createHierarchy:s8,multicall:JA,maxBy:QA,minBy:YA,allIndexOf:XA},t.System={sleepMillis:o,forever:se,scheduleMany:r2,waitFor:b3,expandError:zw,runAndSetInterval:M,whereAmI:z,withRetries:Q},t.Numbers={make:Ac,sum:i2,average:s2,median:o2,getDistanceFromMidpoint:a2,clamp:Ec,range:m0,interpolate:n2,createSequence:iA,increment:pA,decrement:mA,format:dA,fromDecimals:hA,makeStorage:j3,asMegabytes:ie,convertBytes:oe,hexToRgb:O,rgbToHex:k,haversineDistanceToMeters:Z,roundToNearest:fe,formatDistance:Pe,triangularNumber:xe,searchFloat:De,binomialSample:Ut,toSignificantDigits:X},t.Promises={raceFulfilled:n,invert:r,runInParallelBatches:i},t.Dates={getTimestamp:O3,getTimeDelta:L0,secondsToHumanTime:P3,countCycles:I3,isoDate:E3,throttle:k3,timeSince:C3,dateTimeSlug:v3,unixTimestamp:A3,fromUtcString:R3,fromMillis:T3,getProgress:_3,humanizeTime:Oo,humanizeProgress:y3,createTimeDigits:Cr,mapDayNumber:M0,getDayInfoFromDate:wc,getDayInfoFromDateTimeString:F3,seconds:U3,minutes:L3,hours:M3,days:z3,make:G3,normalizeTime:B3,absoluteDays:Dn},t.Objects={safeParse:nA,deleteDeep:_e,getDeep:Ae,setDeep:Ee,incrementDeep:Se,ensureDeep:Le,replaceDeep:j,getFirstDeep:W,deepMergeInPlace:_n,deepMerge2:Vw,deepMerge3:Gw,mapAllAsync:Kw,cloneWithJson:w3,sortObject:V0,sortArray:G0,sortAny:Fn,deepEquals:$0,deepEqualsEvery:rA,runOn:gA,ifPresent:yA,zip:p0,zipSum:$w,removeEmptyArrays:wA,removeEmptyValues:AA,flatten:CA,unflatten:q0,match:_A,sort:J0,map:RA,mapIterable:TA,filterKeys:EA,filterValues:vA,rethrow:BA,setSomeOnObject:SA,setSomeDeep:OA,flip:PA,getAllPermutations:IA,countTruthyValues:kA,transformToArray:zA,setMulti:GA,incrementMulti:VA,createBidirectionalMap:$A,createTemporalBidirectionalMap:jA,pushToBidirectionalMap:Q0,unshiftToBidirectionalMap:HA,addToTemporalBidirectionalMap:qA,getFromTemporalBidirectionalMap:ZA,createStatefulToggle:oA,diffKeys:cA,pickRandomKey:j0,mapRandomKey:uA,fromObjectString:lA,toQueryString:F0,parseQueryString:c3,hasKey:u3,selectMax:l3,reposition:f3,unwrapSingleKey:h3,parseKeyValues:d3,errorMatches:p3},t.Types={isFunction:Er,isObject:xt,isStrictlyObject:wt,isEmptyArray:qe,isEmptyObject:st,isUndefined:jt,isString:at,isNumber:Bt,isBoolean:cr,isDate:rr,isBlank:cn,isId:li,isIntegerString:Ao,isHexString:is,isUrl:l0,isBigint:f0,isNullable:Dw,asString:C,asHexString:V,asSafeString:q,asIntegerString:x,asNumber:We,asFunction:Ne,asInteger:Ze,asBoolean:ct,asDate:Ke,asNullableString:Bw,asEmptiableString:Sw,asId:Ow,asTime:Pw,asArray:Iw,asObject:vo,asNullableObject:kw,asStringMap:Nw,asNumericDictionary:Cw,asUrl:_w,asBigint:h0,asEmptiable:Uw,asNullable:Fw,asOptional:Lw,enforceObjectShape:d0,enforceArrayShape:Mw,isPng:X0,isJpg:ed,isWebp:td,isImage:o8},t.Strings={tokenizeByCount:UA,tokenizeByLength:W0,searchHex:lc,searchSubstring:v,randomHex:g,randomLetter:ur,randomAlphanumeric:us,randomRichAscii:uc,randomUnicode:Nr,includesAny:c2,slugify:fc,normalForm:l2,enumify:g2,escapeHtml:b2,decodeHtmlEntities:w2,after:Bo,afterLast:g0,before:hc,beforeLast:dc,betweenWide:A2,betweenNarrow:E2,getPreLine:H3,containsWord:bc,containsWords:n3,joinUrl:z0,getFuzzyMatchScore:To,sortByFuzzyScore:y2,splitOnce:pc,splitAll:y0,randomize:B2,expand:b0,shrinkTrim:fs,capitalize:So,decapitalize:x0,csvEscape:N2,parseCsv:g3,surroundInOut:m2,getExtension:mc,getBasename:gc,normalizeEmail:v2,normalizeFilename:R2,parseFilename:T2,camelToTitle:f2,slugToTitle:h2,slugToCamel:d2,joinHumanly:p2,findWeightedPair:B0,extractBlock:S0,extractAllBlocks:D2,replaceBlocks:F2,indexOfEarliest:fi,lastIndexOfBefore:T0,parseHtmlAttributes:i3,readNextWord:ds,readWordsAfterAll:s3,resolveVariables:o3,resolveVariableWithDefaultSyntax:_0,resolveRemainingVariablesWithDefaults:D0,isLetter:w0,isDigit:A0,isLetterOrDigit:hs,isValidObjectPathCharacter:P2,insert:I2,indexOfRegex:E0,allIndexOf:R0,lineMatches:v0,linesMatchInOrder:k2,represent:ls,resolveMarkdownLinks:a3,buildUrl:m3,isChinese:u2,replaceBetweenStrings:Y3,describeMarkdown:X3,isBalanced:eA,textToFormat:tA,splitFormatting:U2,splitHashtags:L2,splitUrls:M2,route:K2,explodeReplace:yc,generateVariants:W2,replaceWord:J2,replacePascalCaseWords:Q2,stripHtml:Y2,breakLine:N0,measureTextWidth:X2,toLines:e3,levenshteinDistance:t3,findCommonPrefix:C0,findCommonDirectory:r3},t.Assertions={asEqual:Jw,asTrue:Qw,asTruthy:Yw,asFalse:Xw,asFalsy:e2,asEither:t2},t.Cache={get:q3,getDeferred:Z3,delete:K3,deleteExpired:J3,size:Q3,clear:W3},t.Vector={addPoint:md,subtractPoint:V8,multiplyPoint:Oc,normalizePoint:G8,pushPoint:gd,filterCoordinates:ms,findCorners:q8,findLines:Z8,raycast:Pc,raycastCircle:J8,getLineIntersectionPoint:Ed}})(Ou)),Ou}var $=l4(),Td;function J(t,e,r){function n(u,l){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),u._zod.traits.has(t))return;u._zod.traits.add(t),e(u,l);const h=a.prototype,d=Object.keys(h);for(let m=0;m<d.length;m++){const y=d[m];y in u||(u[y]=h[y].bind(u))}}const i=r?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:t});function a(u){var l;const h=r?.Parent?new o:this;n(h,u),(l=h._zod).deferred??(l.deferred=[]);for(const d of h._zod.deferred)d();return h}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:u=>r?.Parent&&u instanceof r.Parent?!0:u?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}class Si extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class my extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(Td=globalThis).__zod_globalConfig??(Td.__zod_globalConfig={});const lh=globalThis.__zod_globalConfig;function en(t){return lh}function gy(t){const e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function Nf(t,e){return typeof e=="bigint"?e.toString():e}function fh(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function hh(t){return t==null}function dh(t){const e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function f4(t,e){const r=t/e,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}const Bd=Symbol("evaluating");function Ye(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Bd)return n===void 0&&(n=Bd,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}function ni(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Sn(...t){const e={};for(const r of t){const n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function Sd(t){return JSON.stringify(t)}function h4(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const yy="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function da(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const d4=fh(()=>{if(lh.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function _i(t){if(da(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const r=e.prototype;return!(da(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function by(t){return _i(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const p4=new Set(["string","number","symbol"]);function Di(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function On(t,e,r){const n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function Re(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function m4(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const g4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function y4(t,e){const r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Sn(t._zod.def,{get shape(){const a={};for(const u in e){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);e[u]&&(a[u]=r.shape[u])}return ni(this,"shape",a),a},checks:[]});return On(t,o)}function b4(t,e){const r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Sn(t._zod.def,{get shape(){const a={...t._zod.def.shape};for(const u in e){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);e[u]&&delete a[u]}return ni(this,"shape",a),a},checks:[]});return On(t,o)}function x4(t,e){if(!_i(e))throw new Error("Invalid input to extend: expected a plain object");const r=t._zod.def.checks;if(r&&r.length>0){const o=t._zod.def.shape;for(const a in e)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Sn(t._zod.def,{get shape(){const o={...t._zod.def.shape,...e};return ni(this,"shape",o),o}});return On(t,i)}function w4(t,e){if(!_i(e))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Sn(t._zod.def,{get shape(){const n={...t._zod.def.shape,...e};return ni(this,"shape",n),n}});return On(t,r)}function A4(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=Sn(t._zod.def,{get shape(){const n={...t._zod.def.shape,...e._zod.def.shape};return ni(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return On(t,r)}function E4(t,e,r){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=Sn(e._zod.def,{get shape(){const u=e._zod.def.shape,l={...u};if(r)for(const h in r){if(!(h in u))throw new Error(`Unrecognized key: "${h}"`);r[h]&&(l[h]=t?new t({type:"optional",innerType:u[h]}):u[h])}else for(const h in u)l[h]=t?new t({type:"optional",innerType:u[h]}):u[h];return ni(this,"shape",l),l},checks:[]});return On(e,a)}function v4(t,e,r){const n=Sn(e._zod.def,{get shape(){const i=e._zod.def.shape,o={...i};if(r)for(const a in r){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(o[a]=new t({type:"nonoptional",innerType:i[a]}))}else for(const a in i)o[a]=new t({type:"nonoptional",innerType:i[a]});return ni(this,"shape",o),o}});return On(e,n)}function vi(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function R4(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function An(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function _o(t){return typeof t=="string"?t:t?.message}function tn(t,e,r){const n=t.message?t.message:_o(t.inst?._zod.def?.error?.(t))??_o(e?.error?.(t))??_o(r.customError?.(t))??_o(r.localeError?.(t))??"Invalid input",{inst:i,continue:o,input:a,...u}=t;return u.path??(u.path=[]),u.message=n,e?.reportInput&&(u.input=a),u}function ph(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Vs(...t){const[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}const xy=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Nf,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},wy=J("$ZodError",xy),Na=J("$ZodError",xy,{Parent:Error});function T4(t,e=r=>r.message){const r={},n=[];for(const i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function B4(t,e=r=>r.message){const r={_errors:[]},n=(i,o=[])=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(u=>n({issues:u},[...o,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...o,...a.path]);else{const u=[...o,...a.path];if(u.length===0)r._errors.push(e(a));else{let l=r,h=0;for(;h<u.length;){const d=u[h];h===u.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(e(a))):l[d]=l[d]||{_errors:[]},l=l[d],h++}}}};return n(t),r}const Ca=t=>(e,r,n,i)=>{const o=n?{...n,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new Si;if(a.issues.length){const u=new(i?.Err??t)(a.issues.map(l=>tn(l,o,en())));throw yy(u,i?.callee),u}return a.value},Od=Ca(Na),_a=t=>async(e,r,n,i)=>{const o=n?{...n,async:!0}:{async:!0};let a=e._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const u=new(i?.Err??t)(a.issues.map(l=>tn(l,o,en())));throw yy(u,i?.callee),u}return a.value},Pd=_a(Na),Da=t=>(e,r,n)=>{const i=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new Si;return o.issues.length?{success:!1,error:new(t??wy)(o.issues.map(a=>tn(a,i,en())))}:{success:!0,data:o.value}},S4=Da(Na),Fa=t=>async(e,r,n)=>{const i=n?{...n,async:!0}:{async:!0};let o=e._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(a=>tn(a,i,en())))}:{success:!0,data:o.value}},O4=Fa(Na),P4=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return Ca(t)(e,r,i)},I4=t=>(e,r,n)=>Ca(t)(e,r,n),k4=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return _a(t)(e,r,i)},N4=t=>async(e,r,n)=>_a(t)(e,r,n),C4=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return Da(t)(e,r,i)},_4=t=>(e,r,n)=>Da(t)(e,r,n),D4=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return Fa(t)(e,r,i)},F4=t=>async(e,r,n)=>Fa(t)(e,r,n),U4=/^[cC][0-9a-z]{6,}$/,L4=/^[0-9a-z]+$/,M4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,z4=/^[0-9a-vA-V]{20}$/,V4=/^[A-Za-z0-9]{27}$/,G4=/^[a-zA-Z0-9_-]{21}$/,$4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,j4=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Id=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,H4=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,q4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Z4(){return new RegExp(q4,"u")}const K4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,W4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,J4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Q4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Y4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ay=/^[A-Za-z0-9_-]*$/,X4=/^https?$/,e6=/^\+[1-9]\d{6,14}$/,Ey="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",t6=new RegExp(`^${Ey}$`);function vy(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function r6(t){return new RegExp(`^${vy(t)}$`)}function n6(t){const e=vy({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Ey}T(?:${n})$`)}const i6=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},s6=/^-?\d+n?$/,o6=/^-?\d+$/,Ry=/^-?\d+(?:\.\d+)?$/,a6=/^(?:true|false)$/i,c6=/^[^A-Z]*$/,u6=/^[^a-z]*$/,tr=J("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Ty={number:"number",bigint:"bigint",object:"date"},By=J("$ZodCheckLessThan",(t,e)=>{tr.init(t,e);const r=Ty[typeof e.value];t._zod.onattach.push(n=>{const i=n._zod.bag,o=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Sy=J("$ZodCheckGreaterThan",(t,e)=>{tr.init(t,e);const r=Ty[typeof e.value];t._zod.onattach.push(n=>{const i=n._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),l6=J("$ZodCheckMultipleOf",(t,e)=>{tr.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):f4(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),f6=J("$ZodCheckNumberFormat",(t,e)=>{tr.init(t,e),e.format=e.format||"float64";const r=e.format?.includes("int"),n=r?"int":"number",[i,o]=g4[e.format];t._zod.onattach.push(a=>{const u=a._zod.bag;u.format=e.format,u.minimum=i,u.maximum=o,r&&(u.pattern=o6)}),t._zod.check=a=>{const u=a.value;if(r){if(!Number.isInteger(u)){a.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:u,inst:t});return}if(!Number.isSafeInteger(u)){u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}u<i&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),u>o&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),h6=J("$ZodCheckMaxLength",(t,e)=>{var r;tr.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!hh(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{const i=n.value;if(i.length<=e.maximum)return;const a=ph(i);n.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),d6=J("$ZodCheckMinLength",(t,e)=>{var r;tr.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!hh(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{const i=n.value;if(i.length>=e.minimum)return;const a=ph(i);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),p6=J("$ZodCheckLengthEquals",(t,e)=>{var r;tr.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!hh(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=n=>{const i=n.value,o=i.length;if(o===e.length)return;const a=ph(i),u=o>e.length;n.issues.push({origin:a,...u?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),Ua=J("$ZodCheckStringFormat",(t,e)=>{var r,n;tr.init(t,e),t._zod.onattach.push(i=>{const o=i._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),m6=J("$ZodCheckRegex",(t,e)=>{Ua.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),g6=J("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=c6),Ua.init(t,e)}),y6=J("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=u6),Ua.init(t,e)}),b6=J("$ZodCheckIncludes",(t,e)=>{tr.init(t,e);const r=Di(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),x6=J("$ZodCheckStartsWith",(t,e)=>{tr.init(t,e);const r=new RegExp(`^${Di(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),w6=J("$ZodCheckEndsWith",(t,e)=>{tr.init(t,e);const r=new RegExp(`.*${Di(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}}),A6=J("$ZodCheckOverwrite",(t,e)=>{tr.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});class E6{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const n=e.split(`
11
+ `).filter(a=>a),i=Math.min(...n.map(a=>a.length-a.trimStart().length)),o=n.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of o)this.content.push(a)}compile(){const e=Function,r=this?.args,i=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,i.join(`
12
+ `))}}const v6={major:4,minor:4,patch:3},Xe=J("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=v6;const n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(const i of n)for(const o of i._zod.onattach)o(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const i=(a,u,l)=>{let h=vi(a),d;for(const m of u){if(m._zod.def.when){if(R4(a)||!m._zod.def.when(a))continue}else if(h)continue;const y=a.issues.length,w=m._zod.check(a);if(w instanceof Promise&&l?.async===!1)throw new Si;if(d||w instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await w,a.issues.length!==y&&(h||(h=vi(a,y)))});else{if(a.issues.length===y)continue;h||(h=vi(a,y))}}return d?d.then(()=>a):a},o=(a,u,l)=>{if(vi(a))return a.aborted=!0,a;const h=i(u,n,l);if(h instanceof Promise){if(l.async===!1)throw new Si;return h.then(d=>t._zod.parse(d,l))}return t._zod.parse(h,l)};t._zod.run=(a,u)=>{if(u.skipChecks)return t._zod.parse(a,u);if(u.direction==="backward"){const h=t._zod.parse({value:a.value,issues:[]},{...u,skipChecks:!0});return h instanceof Promise?h.then(d=>o(d,a,u)):o(h,a,u)}const l=t._zod.parse(a,u);if(l instanceof Promise){if(u.async===!1)throw new Si;return l.then(h=>i(h,n,u))}return i(l,n,u)}}Ye(t,"~standard",()=>({validate:i=>{try{const o=S4(t,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return O4(t,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),mh=J("$ZodString",(t,e)=>{Xe.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??i6(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),ft=J("$ZodStringFormat",(t,e)=>{Ua.init(t,e),mh.init(t,e)}),R6=J("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=j4),ft.init(t,e)}),T6=J("$ZodUUID",(t,e)=>{if(e.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Id(n))}else e.pattern??(e.pattern=Id());ft.init(t,e)}),B6=J("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=H4),ft.init(t,e)}),S6=J("$ZodURL",(t,e)=>{ft.init(t,e),t._zod.check=r=>{try{const n=r.value.trim();if(!e.normalize&&e.protocol?.source===X4.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}const i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),O6=J("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Z4()),ft.init(t,e)}),P6=J("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=G4),ft.init(t,e)}),I6=J("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=U4),ft.init(t,e)}),k6=J("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=L4),ft.init(t,e)}),N6=J("$ZodULID",(t,e)=>{e.pattern??(e.pattern=M4),ft.init(t,e)}),C6=J("$ZodXID",(t,e)=>{e.pattern??(e.pattern=z4),ft.init(t,e)}),_6=J("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=V4),ft.init(t,e)}),D6=J("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=n6(e)),ft.init(t,e)}),F6=J("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=t6),ft.init(t,e)}),U6=J("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=r6(e)),ft.init(t,e)}),L6=J("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=$4),ft.init(t,e)}),M6=J("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=K4),ft.init(t,e),t._zod.bag.format="ipv4"}),z6=J("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=W4),ft.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),V6=J("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=J4),ft.init(t,e)}),G6=J("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Q4),ft.init(t,e),t._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[i,o]=n;if(!o)throw new Error;const a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Oy(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const $6=J("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Y4),ft.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Oy(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function j6(t){if(!Ay.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Oy(r)}const H6=J("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Ay),ft.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{j6(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),q6=J("$ZodE164",(t,e)=>{e.pattern??(e.pattern=e6),ft.init(t,e)});function Z6(t,e=null){try{const r=t.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const K6=J("$ZodJWT",(t,e)=>{ft.init(t,e),t._zod.check=r=>{Z6(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Py=J("$ZodNumber",(t,e)=>{Xe.init(t,e),t._zod.pattern=t._zod.bag.pattern??Ry,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}const i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;const o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...o?{received:o}:{}}),r}}),W6=J("$ZodNumberFormat",(t,e)=>{f6.init(t,e),Py.init(t,e)}),J6=J("$ZodBoolean",(t,e)=>{Xe.init(t,e),t._zod.pattern=a6,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}const i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),Q6=J("$ZodBigInt",(t,e)=>{Xe.init(t,e),t._zod.pattern=s6,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),Y6=J("$ZodAny",(t,e)=>{Xe.init(t,e),t._zod.parse=r=>r}),X6=J("$ZodUnknown",(t,e)=>{Xe.init(t,e),t._zod.parse=r=>r}),eE=J("$ZodNever",(t,e)=>{Xe.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function kd(t,e,r){t.issues.length&&e.issues.push(...An(r,t.issues)),e.value[r]=t.value}const tE=J("$ZodArray",(t,e)=>{Xe.init(t,e),t._zod.parse=(r,n)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);const o=[];for(let a=0;a<i.length;a++){const u=i[a],l=e.element._zod.run({value:u,issues:[]},n);l instanceof Promise?o.push(l.then(h=>kd(h,r,a))):kd(l,r,a)}return o.length?Promise.all(o).then(()=>r):r}});function pa(t,e,r,n,i,o){const a=r in n;if(t.issues.length){if(i&&o&&!a)return;e.issues.push(...An(r,t.issues))}if(!a&&!i){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?a&&(e.value[r]=void 0):e.value[r]=t.value}function Iy(t){const e=Object.keys(t.shape);for(const n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const r=m4(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function ky(t,e,r,n,i,o){const a=[],u=i.keySet,l=i.catchall._zod,h=l.def.type,d=l.optin==="optional",m=l.optout==="optional";for(const y in e){if(y==="__proto__"||u.has(y))continue;if(h==="never"){a.push(y);continue}const w=l.run({value:e[y],issues:[]},n);w instanceof Promise?t.push(w.then(T=>pa(T,r,y,e,d,m))):pa(w,r,y,e,d,m)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),t.length?Promise.all(t).then(()=>r):r}const rE=J("$ZodObject",(t,e)=>{if(Xe.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){const u=e.shape;Object.defineProperty(e,"shape",{get:()=>{const l={...u};return Object.defineProperty(e,"shape",{value:l}),l}})}const n=fh(()=>Iy(e));Ye(t._zod,"propValues",()=>{const u=e.shape,l={};for(const h in u){const d=u[h]._zod;if(d.values){l[h]??(l[h]=new Set);for(const m of d.values)l[h].add(m)}}return l});const i=da,o=e.catchall;let a;t._zod.parse=(u,l)=>{a??(a=n.value);const h=u.value;if(!i(h))return u.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),u;u.value={};const d=[],m=a.shape;for(const y of a.keys){const w=m[y],T=w._zod.optin==="optional",E=w._zod.optout==="optional",B=w._zod.run({value:h[y],issues:[]},l);B instanceof Promise?d.push(B.then(A=>pa(A,u,y,h,T,E))):pa(B,u,y,h,T,E)}return o?ky(d,h,u,l,n.value,t):d.length?Promise.all(d).then(()=>u):u}}),nE=J("$ZodObjectJIT",(t,e)=>{rE.init(t,e);const r=t._zod.parse,n=fh(()=>Iy(e)),i=y=>{const w=new E6(["shape","payload","ctx"]),T=n.value,E=I=>{const S=Sd(I);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};w.write("const input = payload.value;");const B=Object.create(null);let A=0;for(const I of T.keys)B[I]=`key_${A++}`;w.write("const newResult = {};");for(const I of T.keys){const S=B[I],N=Sd(I),_=y[I],F=_?._zod?.optin==="optional",U=_?._zod?.optout==="optional";w.write(`const ${S} = ${E(I)};`),F&&U?w.write(`
13
+ if (${S}.issues.length) {
14
+ if (${N} in input) {
15
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
16
+ ...iss,
17
+ path: iss.path ? [${N}, ...iss.path] : [${N}]
18
+ })));
19
+ }
20
+ }
21
+
22
+ if (${S}.value === undefined) {
23
+ if (${N} in input) {
24
+ newResult[${N}] = undefined;
25
+ }
26
+ } else {
27
+ newResult[${N}] = ${S}.value;
28
+ }
29
+
30
+ `):F?w.write(`
31
+ if (${S}.issues.length) {
32
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
33
+ ...iss,
34
+ path: iss.path ? [${N}, ...iss.path] : [${N}]
35
+ })));
36
+ }
37
+
38
+ if (${S}.value === undefined) {
39
+ if (${N} in input) {
40
+ newResult[${N}] = undefined;
41
+ }
42
+ } else {
43
+ newResult[${N}] = ${S}.value;
44
+ }
45
+
46
+ `):w.write(`
47
+ const ${S}_present = ${N} in input;
48
+ if (${S}.issues.length) {
49
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
50
+ ...iss,
51
+ path: iss.path ? [${N}, ...iss.path] : [${N}]
52
+ })));
53
+ }
54
+ if (!${S}_present && !${S}.issues.length) {
55
+ payload.issues.push({
56
+ code: "invalid_type",
57
+ expected: "nonoptional",
58
+ input: undefined,
59
+ path: [${N}]
60
+ });
61
+ }
62
+
63
+ if (${S}_present) {
64
+ if (${S}.value === undefined) {
65
+ newResult[${N}] = undefined;
66
+ } else {
67
+ newResult[${N}] = ${S}.value;
68
+ }
69
+ }
70
+
71
+ `)}w.write("payload.value = newResult;"),w.write("return payload;");const P=w.compile();return(I,S)=>P(y,I,S)};let o;const a=da,u=!lh.jitless,h=u&&d4.value,d=e.catchall;let m;t._zod.parse=(y,w)=>{m??(m=n.value);const T=y.value;return a(T)?u&&h&&w?.async===!1&&w.jitless!==!0?(o||(o=i(e.shape)),y=o(y,w),d?ky([],T,y,w,m,t):y):r(y,w):(y.issues.push({expected:"object",code:"invalid_type",input:T,inst:t}),y)}});function Nd(t,e,r,n){for(const o of t)if(o.issues.length===0)return e.value=o.value,e;const i=t.filter(o=>!vi(o));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(a=>tn(a,n,en())))}),e)}const iE=J("$ZodUnion",(t,e)=>{Xe.init(t,e),Ye(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Ye(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Ye(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),Ye(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){const n=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>dh(i.source)).join("|")})$`)}});const r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let o=!1;const a=[];for(const u of e.options){const l=u._zod.run({value:n.value,issues:[]},i);if(l instanceof Promise)a.push(l),o=!0;else{if(l.issues.length===0)return l;a.push(l)}}return o?Promise.all(a).then(u=>Nd(u,n,t,i)):Nd(a,n,t,i)}}),sE=J("$ZodIntersection",(t,e)=>{Xe.init(t,e),t._zod.parse=(r,n)=>{const i=r.value,o=e.left._zod.run({value:i,issues:[]},n),a=e.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([l,h])=>Cd(r,l,h)):Cd(r,o,a)}});function Cf(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(_i(t)&&_i(e)){const r=Object.keys(e),n=Object.keys(t).filter(o=>r.indexOf(o)!==-1),i={...t,...e};for(const o of n){const a=Cf(t[o],e[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<t.length;n++){const i=t[n],o=e[n],a=Cf(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Cd(t,e,r){const n=new Map;let i;for(const u of e.issues)if(u.code==="unrecognized_keys"){i??(i=u);for(const l of u.keys)n.has(l)||n.set(l,{}),n.get(l).l=!0}else t.issues.push(u);for(const u of r.issues)if(u.code==="unrecognized_keys")for(const l of u.keys)n.has(l)||n.set(l,{}),n.get(l).r=!0;else t.issues.push(u);const o=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(o.length&&i&&t.issues.push({...i,keys:o}),vi(t))return t;const a=Cf(e.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return t.value=a.data,t}const Ny=J("$ZodTuple",(t,e)=>{Xe.init(t,e);const r=e.items;t._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];const a=[],u=_d(r,"optin"),l=_d(r,"optout");if(!e.rest){if(o.length<u)return n.issues.push({code:"too_small",minimum:u,inclusive:!0,input:o,inst:t,origin:"array"}),n;o.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:o,inst:t,origin:"array"})}const h=new Array(r.length);for(let d=0;d<r.length;d++){const m=r[d]._zod.run({value:o[d],issues:[]},i);m instanceof Promise?a.push(m.then(y=>{h[d]=y})):h[d]=m}if(e.rest){let d=r.length-1;const m=o.slice(r.length);for(const y of m){d++;const w=e.rest._zod.run({value:y,issues:[]},i);w instanceof Promise?a.push(w.then(T=>Dd(T,n,d))):Dd(w,n,d)}}return a.length?Promise.all(a).then(()=>Fd(h,n,r,o,l)):Fd(h,n,r,o,l)}});function _d(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}function Dd(t,e,r){t.issues.length&&e.issues.push(...An(r,t.issues)),e.value[r]=t.value}function Fd(t,e,r,n,i){for(let o=0;o<r.length;o++){const a=t[o],u=o<n.length;if(a.issues.length){if(!u&&o>=i){e.value.length=o;break}e.issues.push(...An(o,a.issues))}e.value[o]=a.value}for(let o=e.value.length-1;o>=n.length&&(r[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}const oE=J("$ZodRecord",(t,e)=>{Xe.init(t,e),t._zod.parse=(r,n)=>{const i=r.value;if(!_i(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;const o=[],a=e.keyType._zod.values;if(a){r.value={};const u=new Set;for(const h of a)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){u.add(typeof h=="number"?h.toString():h);const d=e.keyType._zod.run({value:h,issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(w=>tn(w,n,en())),input:h,path:[h],inst:t});continue}const m=d.value,y=e.valueType._zod.run({value:i[h],issues:[]},n);y instanceof Promise?o.push(y.then(w=>{w.issues.length&&r.issues.push(...An(h,w.issues)),r.value[m]=w.value})):(y.issues.length&&r.issues.push(...An(h,y.issues)),r.value[m]=y.value)}let l;for(const h in i)u.has(h)||(l=l??[],l.push(h));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:l})}else{r.value={};for(const u of Reflect.ownKeys(i)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,u))continue;let l=e.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Ry.test(u)&&l.issues.length){const m=e.keyType._zod.run({value:Number(u),issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(l=m)}if(l.issues.length){e.mode==="loose"?r.value[u]=i[u]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(m=>tn(m,n,en())),input:u,path:[u],inst:t});continue}const d=e.valueType._zod.run({value:i[u],issues:[]},n);d instanceof Promise?o.push(d.then(m=>{m.issues.length&&r.issues.push(...An(u,m.issues)),r.value[l.value]=m.value})):(d.issues.length&&r.issues.push(...An(u,d.issues)),r.value[l.value]=d.value)}}return o.length?Promise.all(o).then(()=>r):r}}),aE=J("$ZodEnum",(t,e)=>{Xe.init(t,e);const r=gy(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>p4.has(typeof i)).map(i=>typeof i=="string"?Di(i):i.toString()).join("|")})$`),t._zod.parse=(i,o)=>{const a=i.value;return n.has(a)||i.issues.push({code:"invalid_value",values:r,input:a,inst:t}),i}}),cE=J("$ZodLiteral",(t,e)=>{if(Xe.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Di(n):n?Di(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{const o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),n}}),uE=J("$ZodTransform",(t,e)=>{Xe.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new my(t.constructor.name);const i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(r.value=a,r.fallback=!0,r));if(i instanceof Promise)throw new Si;return r.value=i,r.fallback=!0,r}});function Ud(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}const Cy=J("$ZodOptional",(t,e)=>{Xe.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Ye(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Ye(t._zod,"pattern",()=>{const r=e.innerType._zod.pattern;return r?new RegExp(`^(${dh(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){const i=r.value,o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>Ud(a,i)):Ud(o,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),lE=J("$ZodExactOptional",(t,e)=>{Cy.init(t,e),Ye(t._zod,"values",()=>e.innerType._zod.values),Ye(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),fE=J("$ZodNullable",(t,e)=>{Xe.init(t,e),Ye(t._zod,"optin",()=>e.innerType._zod.optin),Ye(t._zod,"optout",()=>e.innerType._zod.optout),Ye(t._zod,"pattern",()=>{const r=e.innerType._zod.pattern;return r?new RegExp(`^(${dh(r.source)}|null)$`):void 0}),Ye(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),hE=J("$ZodDefault",(t,e)=>{Xe.init(t,e),t._zod.optin="optional",Ye(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>Ld(o,e)):Ld(i,e)}});function Ld(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const dE=J("$ZodPrefault",(t,e)=>{Xe.init(t,e),t._zod.optin="optional",Ye(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),pE=J("$ZodNonOptional",(t,e)=>{Xe.init(t,e),Ye(t._zod,"values",()=>{const r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>Md(o,t)):Md(i,t)}});function Md(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const mE=J("$ZodCatch",(t,e)=>{Xe.init(t,e),t._zod.optin="optional",Ye(t._zod,"optout",()=>e.innerType._zod.optout),Ye(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(a=>tn(a,n,en()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(o=>tn(o,n,en()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),gE=J("$ZodPipe",(t,e)=>{Xe.init(t,e),Ye(t._zod,"values",()=>e.in._zod.values),Ye(t._zod,"optin",()=>e.in._zod.optin),Ye(t._zod,"optout",()=>e.out._zod.optout),Ye(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){const o=e.out._zod.run(r,n);return o instanceof Promise?o.then(a=>Do(a,e.in,n)):Do(o,e.in,n)}const i=e.in._zod.run(r,n);return i instanceof Promise?i.then(o=>Do(o,e.out,n)):Do(i,e.out,n)}});function Do(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}const yE=J("$ZodReadonly",(t,e)=>{Xe.init(t,e),Ye(t._zod,"propValues",()=>e.innerType._zod.propValues),Ye(t._zod,"values",()=>e.innerType._zod.values),Ye(t._zod,"optin",()=>e.innerType?._zod?.optin),Ye(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(zd):zd(i)}});function zd(t){return t.value=Object.freeze(t.value),t}const bE=J("$ZodFunction",(t,e)=>(Xe.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){const i=t._def.input?Od(t._def.input,n):n,o=Reflect.apply(r,this,i);return t._def.output?Od(t._def.output,o):o}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){const i=t._def.input?await Pd(t._def.input,n):n,o=await Reflect.apply(r,this,i);return t._def.output?await Pd(t._def.output,o):o}},t._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{const n=t.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Ny({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new n({type:"function",input:r[0],output:t._def.output})},t.output=r=>{const n=t.constructor;return new n({type:"function",input:t._def.input,output:r})},t)),xE=J("$ZodCustom",(t,e)=>{tr.init(t,e),Xe.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{const n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(o=>Vd(o,r,n,t));Vd(i,r,n,t)}});function Vd(t,e,r,n){if(!t){const i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(Vs(i))}}var Gd;class wE{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){const n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){const r=e._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function AE(){return new wE}(Gd=globalThis).__zod_globalRegistry??(Gd.__zod_globalRegistry=AE());const Ps=globalThis.__zod_globalRegistry;function EE(t,e){return new t({type:"string",...Re(e)})}function vE(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Re(e)})}function $d(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Re(e)})}function RE(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Re(e)})}function TE(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Re(e)})}function BE(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Re(e)})}function SE(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Re(e)})}function OE(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Re(e)})}function PE(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Re(e)})}function IE(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Re(e)})}function kE(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Re(e)})}function NE(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Re(e)})}function CE(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Re(e)})}function _E(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Re(e)})}function DE(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Re(e)})}function FE(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Re(e)})}function UE(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Re(e)})}function LE(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Re(e)})}function ME(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Re(e)})}function zE(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Re(e)})}function VE(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Re(e)})}function GE(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Re(e)})}function $E(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Re(e)})}function jE(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Re(e)})}function HE(t,e){return new t({type:"string",format:"date",check:"string_format",...Re(e)})}function qE(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Re(e)})}function ZE(t,e){return new t({type:"string",format:"duration",check:"string_format",...Re(e)})}function KE(t,e){return new t({type:"number",checks:[],...Re(e)})}function WE(t,e){return new t({type:"number",coerce:!0,checks:[],...Re(e)})}function JE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Re(e)})}function QE(t,e){return new t({type:"boolean",...Re(e)})}function YE(t,e){return new t({type:"bigint",...Re(e)})}function XE(t){return new t({type:"any"})}function ev(t){return new t({type:"unknown"})}function tv(t,e){return new t({type:"never",...Re(e)})}function ma(t,e){return new By({check:"less_than",...Re(e),value:t,inclusive:!1})}function Oi(t,e){return new By({check:"less_than",...Re(e),value:t,inclusive:!0})}function ga(t,e){return new Sy({check:"greater_than",...Re(e),value:t,inclusive:!1})}function wn(t,e){return new Sy({check:"greater_than",...Re(e),value:t,inclusive:!0})}function _f(t,e){return new l6({check:"multiple_of",...Re(e),value:t})}function _y(t,e){return new h6({check:"max_length",...Re(e),maximum:t})}function ya(t,e){return new d6({check:"min_length",...Re(e),minimum:t})}function Dy(t,e){return new p6({check:"length_equals",...Re(e),length:t})}function rv(t,e){return new m6({check:"string_format",format:"regex",...Re(e),pattern:t})}function nv(t){return new g6({check:"string_format",format:"lowercase",...Re(t)})}function iv(t){return new y6({check:"string_format",format:"uppercase",...Re(t)})}function sv(t,e){return new b6({check:"string_format",format:"includes",...Re(e),includes:t})}function ov(t,e){return new x6({check:"string_format",format:"starts_with",...Re(e),prefix:t})}function av(t,e){return new w6({check:"string_format",format:"ends_with",...Re(e),suffix:t})}function Wi(t){return new A6({check:"overwrite",tx:t})}function cv(t){return Wi(e=>e.normalize(t))}function uv(){return Wi(t=>t.trim())}function lv(){return Wi(t=>t.toLowerCase())}function fv(){return Wi(t=>t.toUpperCase())}function hv(){return Wi(t=>h4(t))}function dv(t,e,r){return new t({type:"array",element:e,...Re(r)})}function pv(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Re(r)})}function mv(t,e){const r=gv(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(Vs(i,n.value,r._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),n.issues.push(Vs(o))}},t(n.value,n)),e);return r}function gv(t,e){const r=new tr({check:"custom",...Re(e)});return r._zod.check=t,r}function Fy(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Ps,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function bt(t,e,r={path:[],schemaPath:[]}){var n;const i=t._zod.def,o=e.seen.get(t);if(o)return o.count++,r.schemaPath.includes(t)&&(o.cycle=r.path),o.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,a);const u=t._zod.toJSONSchema?.();if(u)a.schema=u;else{const d={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,a.schema,d);else{const y=a.schema,w=e.processors[i.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);w(t,e,y,d)}const m=t._zod.parent;m&&(a.ref||(a.ref=m),bt(m,e,d),e.seen.get(m).isParent=!0)}const l=e.metadataRegistry.get(t);return l&&Object.assign(a.schema,l),e.io==="input"&&qt(t)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(t).schema}function Uy(t,e){const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const a of t.seen.entries()){const u=t.metadataRegistry.get(a[0])?.id;if(u){const l=n.get(u);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(u,a[0])}}const i=a=>{const u=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const m=t.external.registry.get(a[0])?.id,y=t.external.uri??(T=>T);if(m)return{ref:y(m)};const w=a[1].defId??a[1].schema.id??`schema${t.counter++}`;return a[1].defId=w,{defId:w,ref:`${y("__shared")}#/${u}/${w}`}}if(a[1]===r)return{ref:"#"};const h=`#/${u}/`,d=a[1].schema.id??`__schema${t.counter++}`;return{defId:d,ref:h+d}},o=a=>{if(a[1].schema.$ref)return;const u=a[1],{ref:l,defId:h}=i(a);u.def={...u.schema},h&&(u.defId=h);const d=u.schema;for(const m in d)delete d[m];d.$ref=l};if(t.cycles==="throw")for(const a of t.seen.entries()){const u=a[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
72
+
73
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of t.seen.entries()){const u=a[1];if(e===a[0]){o(a);continue}if(t.external){const h=t.external.registry.get(a[0])?.id;if(e!==a[0]&&h){o(a);continue}}if(t.metadataRegistry.get(a[0])?.id){o(a);continue}if(u.cycle){o(a);continue}if(u.count>1&&t.reused==="ref"){o(a);continue}}}function Ly(t,e){const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=u=>{const l=t.seen.get(u);if(l.ref===null)return;const h=l.def??l.schema,d={...h},m=l.ref;if(l.ref=null,m){n(m);const w=t.seen.get(m),T=w.schema;if(T.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(T)):Object.assign(h,T),Object.assign(h,d),u._zod.parent===m)for(const B in h)B==="$ref"||B==="allOf"||B in d||delete h[B];if(T.$ref&&w.def)for(const B in h)B==="$ref"||B==="allOf"||B in w.def&&JSON.stringify(h[B])===JSON.stringify(w.def[B])&&delete h[B]}const y=u._zod.parent;if(y&&y!==m){n(y);const w=t.seen.get(y);if(w?.schema.$ref&&(h.$ref=w.schema.$ref,w.def))for(const T in h)T==="$ref"||T==="allOf"||T in w.def&&JSON.stringify(h[T])===JSON.stringify(w.def[T])&&delete h[T]}t.override({zodSchema:u,jsonSchema:h,path:l.path??[]})};for(const u of[...t.seen.entries()].reverse())n(u[0]);const i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){const u=t.external.registry.get(e)?.id;if(!u)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(u)}Object.assign(i,r.def??r.schema);const o=t.metadataRegistry.get(e)?.id;o!==void 0&&i.id===o&&delete i.id;const a=t.external?.defs??{};for(const u of t.seen.entries()){const l=u[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,a[l.defId]=l.def)}t.external||Object.keys(a).length>0&&(t.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const u=JSON.parse(JSON.stringify(i));return Object.defineProperty(u,"~standard",{value:{...e["~standard"],jsonSchema:{input:ba(e,"input",t.processors),output:ba(e,"output",t.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function qt(t,e){const r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);const n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return qt(n.element,r);if(n.type==="set")return qt(n.valueType,r);if(n.type==="lazy")return qt(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return qt(n.innerType,r);if(n.type==="intersection")return qt(n.left,r)||qt(n.right,r);if(n.type==="record"||n.type==="map")return qt(n.keyType,r)||qt(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:qt(n.in,r)||qt(n.out,r);if(n.type==="object"){for(const i in n.shape)if(qt(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(qt(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(qt(i,r))return!0;return!!(n.rest&&qt(n.rest,r))}return!1}const yv=(t,e={})=>r=>{const n=Fy({...r,processors:e});return bt(t,n),Uy(n,t),Ly(n,t)},ba=(t,e,r={})=>n=>{const{libraryOptions:i,target:o}=n??{},a=Fy({...i??{},target:o,io:e,processors:r});return bt(t,a),Uy(a,t),Ly(a,t)},bv={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},xv=(t,e,r,n)=>{const i=r;i.type="string";const{minimum:o,maximum:a,format:u,patterns:l,contentEncoding:h}=t._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),u&&(i.format=bv[u]??u,i.format===""&&delete i.format,u==="time"&&delete i.format),h&&(i.contentEncoding=h),l&&l.size>0){const d=[...l];d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(m=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},wv=(t,e,r,n)=>{const i=r,{minimum:o,maximum:a,format:u,multipleOf:l,exclusiveMaximum:h,exclusiveMinimum:d}=t._zod.bag;typeof u=="string"&&u.includes("int")?i.type="integer":i.type="number";const m=typeof d=="number"&&d>=(o??Number.NEGATIVE_INFINITY),y=typeof h=="number"&&h<=(a??Number.POSITIVE_INFINITY),w=e.target==="draft-04"||e.target==="openapi-3.0";m?w?(i.minimum=d,i.exclusiveMinimum=!0):i.exclusiveMinimum=d:typeof o=="number"&&(i.minimum=o),y?w?(i.maximum=h,i.exclusiveMaximum=!0):i.exclusiveMaximum=h:typeof a=="number"&&(i.maximum=a),typeof l=="number"&&(i.multipleOf=l)},Av=(t,e,r,n)=>{r.type="boolean"},Ev=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},vv=(t,e,r,n)=>{r.not={}},Rv=(t,e,r,n)=>{},Tv=(t,e,r,n)=>{},Bv=(t,e,r,n)=>{const i=t._zod.def,o=gy(i.entries);o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),r.enum=o},Sv=(t,e,r,n)=>{const i=t._zod.def,o=[];for(const a of i.values)if(a===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){const a=o[0];r.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[a]:r.const=a}else o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),o.every(a=>typeof a=="boolean")&&(r.type="boolean"),o.every(a=>a===null)&&(r.type="null"),r.enum=o},Ov=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Pv=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Iv=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},kv=(t,e,r,n)=>{const i=r,o=t._zod.def,{minimum:a,maximum:u}=t._zod.bag;typeof a=="number"&&(i.minItems=a),typeof u=="number"&&(i.maxItems=u),i.type="array",i.items=bt(o.element,e,{...n,path:[...n.path,"items"]})},Nv=(t,e,r,n)=>{const i=r,o=t._zod.def;i.type="object",i.properties={};const a=o.shape;for(const h in a)i.properties[h]=bt(a[h],e,{...n,path:[...n.path,"properties",h]});const u=new Set(Object.keys(a)),l=new Set([...u].filter(h=>{const d=o.shape[h]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(i.required=Array.from(l)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=bt(o.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},Cv=(t,e,r,n)=>{const i=t._zod.def,o=i.inclusive===!1,a=i.options.map((u,l)=>bt(u,e,{...n,path:[...n.path,o?"oneOf":"anyOf",l]}));o?r.oneOf=a:r.anyOf=a},_v=(t,e,r,n)=>{const i=t._zod.def,o=bt(i.left,e,{...n,path:[...n.path,"allOf",0]}),a=bt(i.right,e,{...n,path:[...n.path,"allOf",1]}),u=h=>"allOf"in h&&Object.keys(h).length===1,l=[...u(o)?o.allOf:[o],...u(a)?a.allOf:[a]];r.allOf=l},Dv=(t,e,r,n)=>{const i=r,o=t._zod.def;i.type="array";const a=e.target==="draft-2020-12"?"prefixItems":"items",u=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",l=o.items.map((y,w)=>bt(y,e,{...n,path:[...n.path,a,w]})),h=o.rest?bt(o.rest,e,{...n,path:[...n.path,u,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=l,h&&(i.items=h)):e.target==="openapi-3.0"?(i.items={anyOf:l},h&&i.items.anyOf.push(h),i.minItems=l.length,h||(i.maxItems=l.length)):(i.items=l,h&&(i.additionalItems=h));const{minimum:d,maximum:m}=t._zod.bag;typeof d=="number"&&(i.minItems=d),typeof m=="number"&&(i.maxItems=m)},Fv=(t,e,r,n)=>{const i=r,o=t._zod.def;i.type="object";const a=o.keyType,l=a._zod.bag?.patterns;if(o.mode==="loose"&&l&&l.size>0){const d=bt(o.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(const m of l)i.patternProperties[m.source]=d}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=bt(o.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=bt(o.valueType,e,{...n,path:[...n.path,"additionalProperties"]});const h=a._zod.values;if(h){const d=[...h].filter(m=>typeof m=="string"||typeof m=="number");d.length>0&&(i.required=d)}},Uv=(t,e,r,n)=>{const i=t._zod.def,o=bt(i.innerType,e,n),a=e.seen.get(t);e.target==="openapi-3.0"?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Lv=(t,e,r,n)=>{const i=t._zod.def;bt(i.innerType,e,n);const o=e.seen.get(t);o.ref=i.innerType},Mv=(t,e,r,n)=>{const i=t._zod.def;bt(i.innerType,e,n);const o=e.seen.get(t);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},zv=(t,e,r,n)=>{const i=t._zod.def;bt(i.innerType,e,n);const o=e.seen.get(t);o.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Vv=(t,e,r,n)=>{const i=t._zod.def;bt(i.innerType,e,n);const o=e.seen.get(t);o.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Gv=(t,e,r,n)=>{const i=t._zod.def,o=i.in._zod.traits.has("$ZodTransform"),a=e.io==="input"?o?i.out:i.in:i.out;bt(a,e,n);const u=e.seen.get(t);u.ref=a},$v=(t,e,r,n)=>{const i=t._zod.def;bt(i.innerType,e,n);const o=e.seen.get(t);o.ref=i.innerType,r.readOnly=!0},My=(t,e,r,n)=>{const i=t._zod.def;bt(i.innerType,e,n);const o=e.seen.get(t);o.ref=i.innerType},jv=J("ZodISODateTime",(t,e)=>{D6.init(t,e),gt.init(t,e)});function Hv(t){return jE(jv,t)}const qv=J("ZodISODate",(t,e)=>{F6.init(t,e),gt.init(t,e)});function Zv(t){return HE(qv,t)}const Kv=J("ZodISOTime",(t,e)=>{U6.init(t,e),gt.init(t,e)});function Wv(t){return qE(Kv,t)}const Jv=J("ZodISODuration",(t,e)=>{L6.init(t,e),gt.init(t,e)});function Qv(t){return ZE(Jv,t)}const Yv=(t,e)=>{wy.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>B4(t,r)},flatten:{value:r=>T4(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Nf,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Nf,2)}},isEmpty:{get(){return t.issues.length===0}}})},Ar=J("ZodError",Yv,{Parent:Error}),Xv=Ca(Ar),e5=_a(Ar),t5=Da(Ar),r5=Fa(Ar),n5=P4(Ar),i5=I4(Ar),s5=k4(Ar),o5=N4(Ar),a5=C4(Ar),c5=_4(Ar),u5=D4(Ar),l5=F4(Ar),jd=new WeakMap;function io(t,e,r){const n=Object.getPrototypeOf(t);let i=jd.get(n);if(i||(i=new Set,jd.set(n,i)),!i.has(e)){i.add(e);for(const o in r){const a=r[o];Object.defineProperty(n,o,{configurable:!0,enumerable:!1,get(){const u=a.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:u}),u},set(u){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:u})}})}}}const tt=J("ZodType",(t,e)=>(Xe.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:ba(t,"input"),output:ba(t,"output")}}),t.toJSONSchema=yv(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>Xv(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>t5(t,r,n),t.parseAsync=async(r,n)=>e5(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>r5(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>n5(t,r,n),t.decode=(r,n)=>i5(t,r,n),t.encodeAsync=async(r,n)=>s5(t,r,n),t.decodeAsync=async(r,n)=>o5(t,r,n),t.safeEncode=(r,n)=>a5(t,r,n),t.safeDecode=(r,n)=>c5(t,r,n),t.safeEncodeAsync=async(r,n)=>u5(t,r,n),t.safeDecodeAsync=async(r,n)=>l5(t,r,n),io(t,"ZodType",{check(...r){const n=this.def;return this.clone(Sn(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return On(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(u9(r,n))},superRefine(r,n){return this.check(l9(r,n))},overwrite(r){return this.check(Wi(r))},optional(){return Gs(this)},exactOptional(){return W5(this)},nullable(){return Kd(this)},nullish(){return Gs(Kd(this))},nonoptional(r){return t9(this,r)},array(){return Ft(this)},or(r){return M5([this,r])},and(r){return V5(this,r)},transform(r){return Wd(this,Z5(r))},default(r){return Y5(this,r)},prefault(r){return e9(this,r)},catch(r){return n9(this,r)},pipe(r){return Wd(this,r)},readonly(){return o9(this)},describe(r){const n=this.clone();return Ps.add(n,{description:r}),n},meta(...r){if(r.length===0)return Ps.get(this);const n=this.clone();return Ps.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return Ps.get(t)?.description},configurable:!0}),t)),zy=J("_ZodString",(t,e)=>{mh.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(n,i,o)=>xv(t,n,i);const r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,io(t,"_ZodString",{regex(...n){return this.check(rv(...n))},includes(...n){return this.check(sv(...n))},startsWith(...n){return this.check(ov(...n))},endsWith(...n){return this.check(av(...n))},min(...n){return this.check(ya(...n))},max(...n){return this.check(_y(...n))},length(...n){return this.check(Dy(...n))},nonempty(...n){return this.check(ya(1,...n))},lowercase(n){return this.check(nv(n))},uppercase(n){return this.check(iv(n))},trim(){return this.check(uv())},normalize(...n){return this.check(cv(...n))},toLowerCase(){return this.check(lv())},toUpperCase(){return this.check(fv())},slugify(){return this.check(hv())}})}),f5=J("ZodString",(t,e)=>{mh.init(t,e),zy.init(t,e),t.email=r=>t.check(vE(h5,r)),t.url=r=>t.check(OE(d5,r)),t.jwt=r=>t.check($E(O5,r)),t.emoji=r=>t.check(PE(p5,r)),t.guid=r=>t.check($d(Hd,r)),t.uuid=r=>t.check(RE(Fo,r)),t.uuidv4=r=>t.check(TE(Fo,r)),t.uuidv6=r=>t.check(BE(Fo,r)),t.uuidv7=r=>t.check(SE(Fo,r)),t.nanoid=r=>t.check(IE(m5,r)),t.guid=r=>t.check($d(Hd,r)),t.cuid=r=>t.check(kE(g5,r)),t.cuid2=r=>t.check(NE(y5,r)),t.ulid=r=>t.check(CE(b5,r)),t.base64=r=>t.check(zE(T5,r)),t.base64url=r=>t.check(VE(B5,r)),t.xid=r=>t.check(_E(x5,r)),t.ksuid=r=>t.check(DE(w5,r)),t.ipv4=r=>t.check(FE(A5,r)),t.ipv6=r=>t.check(UE(E5,r)),t.cidrv4=r=>t.check(LE(v5,r)),t.cidrv6=r=>t.check(ME(R5,r)),t.e164=r=>t.check(GE(S5,r)),t.datetime=r=>t.check(Hv(r)),t.date=r=>t.check(Zv(r)),t.time=r=>t.check(Wv(r)),t.duration=r=>t.check(Qv(r))});function ce(t){return EE(f5,t)}const gt=J("ZodStringFormat",(t,e)=>{ft.init(t,e),zy.init(t,e)}),h5=J("ZodEmail",(t,e)=>{B6.init(t,e),gt.init(t,e)}),Hd=J("ZodGUID",(t,e)=>{R6.init(t,e),gt.init(t,e)}),Fo=J("ZodUUID",(t,e)=>{T6.init(t,e),gt.init(t,e)}),d5=J("ZodURL",(t,e)=>{S6.init(t,e),gt.init(t,e)}),p5=J("ZodEmoji",(t,e)=>{O6.init(t,e),gt.init(t,e)}),m5=J("ZodNanoID",(t,e)=>{P6.init(t,e),gt.init(t,e)}),g5=J("ZodCUID",(t,e)=>{I6.init(t,e),gt.init(t,e)}),y5=J("ZodCUID2",(t,e)=>{k6.init(t,e),gt.init(t,e)}),b5=J("ZodULID",(t,e)=>{N6.init(t,e),gt.init(t,e)}),x5=J("ZodXID",(t,e)=>{C6.init(t,e),gt.init(t,e)}),w5=J("ZodKSUID",(t,e)=>{_6.init(t,e),gt.init(t,e)}),A5=J("ZodIPv4",(t,e)=>{M6.init(t,e),gt.init(t,e)}),E5=J("ZodIPv6",(t,e)=>{z6.init(t,e),gt.init(t,e)}),v5=J("ZodCIDRv4",(t,e)=>{V6.init(t,e),gt.init(t,e)}),R5=J("ZodCIDRv6",(t,e)=>{G6.init(t,e),gt.init(t,e)}),T5=J("ZodBase64",(t,e)=>{$6.init(t,e),gt.init(t,e)}),B5=J("ZodBase64URL",(t,e)=>{H6.init(t,e),gt.init(t,e)}),S5=J("ZodE164",(t,e)=>{q6.init(t,e),gt.init(t,e)}),O5=J("ZodJWT",(t,e)=>{K6.init(t,e),gt.init(t,e)}),gh=J("ZodNumber",(t,e)=>{Py.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(n,i,o)=>wv(t,n,i),io(t,"ZodNumber",{gt(n,i){return this.check(ga(n,i))},gte(n,i){return this.check(wn(n,i))},min(n,i){return this.check(wn(n,i))},lt(n,i){return this.check(ma(n,i))},lte(n,i){return this.check(Oi(n,i))},max(n,i){return this.check(Oi(n,i))},int(n){return this.check(qd(n))},safe(n){return this.check(qd(n))},positive(n){return this.check(ga(0,n))},nonnegative(n){return this.check(wn(0,n))},negative(n){return this.check(ma(0,n))},nonpositive(n){return this.check(Oi(0,n))},multipleOf(n,i){return this.check(_f(n,i))},step(n,i){return this.check(_f(n,i))},finite(){return this}});const r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function pe(t){return KE(gh,t)}const P5=J("ZodNumberFormat",(t,e)=>{W6.init(t,e),gh.init(t,e)});function qd(t){return JE(P5,t)}const I5=J("ZodBoolean",(t,e)=>{J6.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Av(t,r,n)});function Qe(t){return QE(I5,t)}const k5=J("ZodBigInt",(t,e)=>{Q6.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(n,i,o)=>Ev(t,n),t.gte=(n,i)=>t.check(wn(n,i)),t.min=(n,i)=>t.check(wn(n,i)),t.gt=(n,i)=>t.check(ga(n,i)),t.gte=(n,i)=>t.check(wn(n,i)),t.min=(n,i)=>t.check(wn(n,i)),t.lt=(n,i)=>t.check(ma(n,i)),t.lte=(n,i)=>t.check(Oi(n,i)),t.max=(n,i)=>t.check(Oi(n,i)),t.positive=n=>t.check(ga(BigInt(0),n)),t.negative=n=>t.check(ma(BigInt(0),n)),t.nonpositive=n=>t.check(Oi(BigInt(0),n)),t.nonnegative=n=>t.check(wn(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(_f(n,i));const r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function Vy(t){return YE(k5,t)}const N5=J("ZodAny",(t,e)=>{Y6.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Rv()});function Yn(){return XE(N5)}const C5=J("ZodUnknown",(t,e)=>{X6.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Tv()});function Fi(){return ev(C5)}const _5=J("ZodNever",(t,e)=>{eE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vv(t,r,n)});function D5(t){return tv(_5,t)}const F5=J("ZodArray",(t,e)=>{tE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kv(t,r,n,i),t.element=e.element,io(t,"ZodArray",{min(r,n){return this.check(ya(r,n))},nonempty(r){return this.check(ya(1,r))},max(r,n){return this.check(_y(r,n))},length(r,n){return this.check(Dy(r,n))},unwrap(){return this.element}})});function Ft(t,e){return dv(F5,t,e)}const U5=J("ZodObject",(t,e)=>{nE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Nv(t,r,n,i),Ye(t,"shape",()=>e.shape),io(t,"ZodObject",{keyof(){return $y(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Fi()})},loose(){return this.clone({...this._zod.def,catchall:Fi()})},strict(){return this.clone({...this._zod.def,catchall:D5()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return x4(this,r)},safeExtend(r){return w4(this,r)},merge(r){return A4(this,r)},pick(r){return y4(this,r)},omit(r){return b4(this,r)},partial(...r){return E4(jy,this,r[0])},required(...r){return v4(Hy,this,r[0])}})});function ve(t,e){const r={type:"object",shape:t??{},...Re(e)};return new U5(r)}const L5=J("ZodUnion",(t,e)=>{iE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Cv(t,r,n,i),t.options=e.options});function M5(t,e){return new L5({type:"union",options:t,...Re(e)})}const z5=J("ZodIntersection",(t,e)=>{sE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_v(t,r,n,i)});function V5(t,e){return new z5({type:"intersection",left:t,right:e})}const G5=J("ZodTuple",(t,e)=>{Ny.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Dv(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function $5(t,e,r){const n=e instanceof Xe,i=n?r:e,o=n?e:null;return new G5({type:"tuple",items:t,rest:o,...Re(i)})}const Zd=J("ZodRecord",(t,e)=>{oE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Fv(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function Gy(t,e,r){return!e||!e._zod?new Zd({type:"record",keyType:ce(),valueType:t,...Re(e)}):new Zd({type:"record",keyType:t,valueType:e,...Re(r)})}const Df=J("ZodEnum",(t,e)=>{aE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(n,i,o)=>Bv(t,n,i),t.enum=e.entries,t.options=Object.values(e.entries);const r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{const o={};for(const a of n)if(r.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Df({...e,checks:[],...Re(i),entries:o})},t.exclude=(n,i)=>{const o={...e.entries};for(const a of n)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Df({...e,checks:[],...Re(i),entries:o})}});function $y(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Df({type:"enum",entries:r,...Re(e)})}const j5=J("ZodLiteral",(t,e)=>{cE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Sv(t,r,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function H5(t,e){return new j5({type:"literal",values:Array.isArray(t)?t:[t],...Re(e)})}const q5=J("ZodTransform",(t,e)=>{uE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Iv(t,r),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new my(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(Vs(o,r.value,e));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=t),r.issues.push(Vs(a))}};const i=e.transform(r.value,r);return i instanceof Promise?i.then(o=>(r.value=o,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function Z5(t){return new q5({type:"transform",transform:t})}const jy=J("ZodOptional",(t,e)=>{Cy.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>My(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Gs(t){return new jy({type:"optional",innerType:t})}const K5=J("ZodExactOptional",(t,e)=>{lE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>My(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function W5(t){return new K5({type:"optional",innerType:t})}const J5=J("ZodNullable",(t,e)=>{fE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Uv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Kd(t){return new J5({type:"nullable",innerType:t})}const Q5=J("ZodDefault",(t,e)=>{hE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Mv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Y5(t,e){return new Q5({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():by(e)}})}const X5=J("ZodPrefault",(t,e)=>{dE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function e9(t,e){return new X5({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():by(e)}})}const Hy=J("ZodNonOptional",(t,e)=>{pE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Lv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function t9(t,e){return new Hy({type:"nonoptional",innerType:t,...Re(e)})}const r9=J("ZodCatch",(t,e)=>{mE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Vv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function n9(t,e){return new r9({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const i9=J("ZodPipe",(t,e)=>{gE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Gv(t,r,n,i),t.in=e.in,t.out=e.out});function Wd(t,e){return new i9({type:"pipe",in:t,out:e})}const s9=J("ZodReadonly",(t,e)=>{yE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$v(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function o9(t){return new s9({type:"readonly",innerType:t})}const a9=J("ZodFunction",(t,e)=>{bE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Pv(t,r)});function qy(t){return new a9({type:"function",input:Array.isArray(t?.input)?$5(t?.input):Ft(Fi()),output:Fi()})}const c9=J("ZodCustom",(t,e)=>{xE.init(t,e),tt.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Ov(t,r)});function u9(t,e={}){return pv(c9,t,e)}function l9(t,e){return mv(t,e)}function Zy(t){return WE(gh,t)}var Uo={exports:{}},Pu,Jd;function f9(){if(Jd)return Pu;Jd=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,o=n*365.25;Pu=function(d,m){m=m||{};var y=typeof d;if(y==="string"&&d.length>0)return a(d);if(y==="number"&&isFinite(d))return m.long?l(d):u(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function a(d){if(d=String(d),!(d.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(d);if(m){var y=parseFloat(m[1]),w=(m[2]||"ms").toLowerCase();switch(w){case"years":case"year":case"yrs":case"yr":case"y":return y*o;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*r;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*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function u(d){var m=Math.abs(d);return m>=n?Math.round(d/n)+"d":m>=r?Math.round(d/r)+"h":m>=e?Math.round(d/e)+"m":m>=t?Math.round(d/t)+"s":d+"ms"}function l(d){var m=Math.abs(d);return m>=n?h(d,m,n,"day"):m>=r?h(d,m,r,"hour"):m>=e?h(d,m,e,"minute"):m>=t?h(d,m,t,"second"):d+" ms"}function h(d,m,y,w){var T=m>=y*1.5;return Math.round(d/y)+" "+w+(T?"s":"")}return Pu}var Iu,Qd;function h9(){if(Qd)return Iu;Qd=1;function t(e){n.debug=n,n.default=n,n.coerce=h,n.disable=u,n.enable=o,n.enabled=l,n.humanize=f9(),n.destroy=d,Object.keys(e).forEach(m=>{n[m]=e[m]}),n.names=[],n.skips=[],n.formatters={};function r(m){let y=0;for(let w=0;w<m.length;w++)y=(y<<5)-y+m.charCodeAt(w),y|=0;return n.colors[Math.abs(y)%n.colors.length]}n.selectColor=r;function n(m){let y,w=null,T,E;function B(...A){if(!B.enabled)return;const P=B,I=Number(new Date),S=I-(y||I);P.diff=S,P.prev=y,P.curr=I,y=I,A[0]=n.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let N=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(F,U)=>{if(F==="%%")return"%";N++;const H=n.formatters[U];if(typeof H=="function"){const K=A[N];F=H.call(P,K),A.splice(N,1),N--}return F}),n.formatArgs.call(P,A),(P.log||n.log).apply(P,A)}return B.namespace=m,B.useColors=n.useColors(),B.color=n.selectColor(m),B.extend=i,B.destroy=n.destroy,Object.defineProperty(B,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(T!==n.namespaces&&(T=n.namespaces,E=n.enabled(m)),E),set:A=>{w=A}}),typeof n.init=="function"&&n.init(B),B}function i(m,y){const w=n(this.namespace+(typeof y>"u"?":":y)+m);return w.log=this.log,w}function o(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 w of y)w[0]==="-"?n.skips.push(w.slice(1)):n.names.push(w)}function a(m,y){let w=0,T=0,E=-1,B=0;for(;w<m.length;)if(T<y.length&&(y[T]===m[w]||y[T]==="*"))y[T]==="*"?(E=T,B=w,T++):(w++,T++);else if(E!==-1)T=E+1,B++,w=B;else return!1;for(;T<y.length&&y[T]==="*";)T++;return T===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(a(m,y))return!1;for(const y of n.names)if(a(m,y))return!0;return!1}function h(m){return m instanceof Error?m.stack||m.message:m}function d(){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 Iu=t,Iu}var Yd;function d9(){return Yd||(Yd=1,(function(t,e){var r={};e.formatArgs=i,e.save=o,e.load=a,e.useColors=n,e.storage=u(),e.destroy=(()=>{let h=!1;return()=>{h||(h=!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 h;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&&(h=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(h[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(h){if(h[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+h[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const d="color: "+this.color;h.splice(1,0,d,"color: inherit");let m=0,y=0;h[0].replace(/%[a-zA-Z%]/g,w=>{w!=="%%"&&(m++,w==="%c"&&(y=m))}),h.splice(y,0,d)}e.log=console.debug||console.log||(()=>{});function o(h){try{h?e.storage.setItem("debug",h):e.storage.removeItem("debug")}catch{}}function a(){let h;try{h=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!h&&typeof Ce<"u"&&"env"in Ce&&(h=r.DEBUG),h}function u(){try{return localStorage}catch{}}t.exports=h9()(e);const{formatters:l}=t.exports;l.j=function(h){try{return JSON.stringify(h)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}}})(Uo,Uo.exports)),Uo.exports}var p9=d9();const yh=uh(p9),Xd=ce().regex(/^(?:0x)?[0-9a-fA-F]*$/i,"expected hex string").refine(t=>t.replace(/^0x/i,"").length%2===0,"expected even-length hex string"),m9=yh("bee-js:bytes"),g9=new TextDecoder,y9=new TextEncoder;class Ue{constructor(e,r){if(!e)throw Error(`Bytes#constructor: constructor parameter is falsy: ${e}`);if(e instanceof Ue)this.bytes=e.bytes;else if(typeof e=="string")this.bytes=$.Binary.hexToUint8Array(Xd.parse(e));else if(e instanceof ArrayBuffer)this.bytes=new Uint8Array(e);else if(e instanceof Uint8Array)this.bytes=e;else{const n=e,i=$.Objects.getDeep(n,"toHex");if(qy().safeParse(i).success){const o=i.call(n);this.bytes=$.Binary.hexToUint8Array(Xd.parse(o))}else throw m9("bytes",e),new Error(`Bytes#constructor: unsupported type: ${typeof e}`)}if(this.length=this.bytes.length,r){if(Array.isArray(r)){if(!r.includes(this.length))throw new Error(`Bytes#checkByteLength: bytes length is ${this.length} but expected ${r.join(" or ")}`)}else if(this.length!==r)throw new Error(`Bytes#checkByteLength: bytes length is ${this.length} but expected ${r}`)}}static keccak256(e){return new Ue($.Binary.keccak256(new Ue(e).toUint8Array()))}static fromUtf8(e){return new Ue(y9.encode(e))}static fromSlice(e,r,n){return n===void 0?new Ue(e.slice(r)):new Ue(e.slice(r,r+n))}offset(e){return new Uint8Array(this.bytes.slice(e))}toUint8Array(){return new Uint8Array(this.bytes)}toHex(){return $.Binary.uint8ArrayToHex(this.bytes)}toBase64(){return $.Binary.uint8ArrayToBase64(this.bytes)}toBase32(){return $.Binary.uint8ArrayToBase32(this.bytes)}toString(){return this.toHex()}toUtf8(){return g9.decode(this.bytes)}toJSON(){return JSON.parse(this.toUtf8())}equals(e){return this.toHex()===new Ue(e).toHex()}represent(){return this.toHex()}}function Ky(t){const e={B:1,kB:1e3,MB:1e6,GB:1e9,TB:1e12,PB:1e15},r=t.match(/^([\d.]+)\s*(B|kB|MB|GB|TB|PB)$/);if(!r)throw new Error(`Invalid size format: ${t}`);const n=parseFloat(r[1]),i=r[2];return Math.ceil(n*e[i])}const Wy=250,Jy=251,ep={[Wy]:"manifest",[Jy]:"feed"};function b9(t,e){t=new Oe(t);const r="b",n=new Uint8Array([1]),i=new Uint8Array([e==="feed"?Jy:Wy]),o=new Uint8Array([1]),a=new Uint8Array([27]),u=new Uint8Array([32]),l=$.Binary.uint8ArrayToBase32($.Binary.concatBytes(n,i,o,a,u)).replace(/\=+$/,""),h=t.toBase32().replace(/\=+$/,"");return`${r}${l}${h}`.toLowerCase()}function x9(t){const e=$.Binary.base32ToUint8Array(t.toUpperCase().slice(1)),r=e[1];if(!ep[r])throw new Error("Unknown codec");const n=new Oe(e.slice(-32));return{type:ep[r],reference:n}}const Ui=new TextEncoder;class qr extends Ue{constructor(e){super(e,32)}publicKey(){const[e,r]=$.Elliptic.privateKeyToPublicKey($.Binary.uint256ToNumber(this.bytes,"BE"));return new br($.Binary.concatBytes($.Binary.numberToUint256(e,"BE"),$.Binary.numberToUint256(r,"BE")))}sign(e){const r=$.Binary.concatBytes(Ui.encode(`Ethereum Signed Message:
74
+ 32`),$.Binary.keccak256(e instanceof Uint8Array?e:Ui.encode(e))),[n,i,o]=$.Elliptic.signMessage(r,$.Binary.uint256ToNumber(this.bytes,"BE"));return new Bn($.Binary.concatBytes($.Binary.numberToUint256(n,"BE"),$.Binary.numberToUint256(i,"BE"),new Uint8Array([Number(o)])))}}qr.LENGTH=32;class br extends Ue{constructor(e){const r=new Ue(e);if(r.length===33){const[n,i]=$.Elliptic.publicKeyFromCompressed(r.toUint8Array());super($.Binary.concatBytes($.Binary.numberToUint256(n,"BE"),$.Binary.numberToUint256(i,"BE")),64)}else super(e,64)}address(){const e=$.Binary.uint256ToNumber(this.bytes.slice(0,32),"BE"),r=$.Binary.uint256ToNumber(this.bytes.slice(32,64),"BE");return new Vt($.Elliptic.publicKeyToAddress([e,r]))}toCompressedUint8Array(){const e=$.Binary.uint256ToNumber(this.bytes.slice(0,32),"BE"),r=$.Binary.uint256ToNumber(this.bytes.slice(32,64),"BE");return $.Elliptic.compressPublicKey([e,r])}toCompressedHex(){return $.Binary.uint8ArrayToHex(this.toCompressedUint8Array())}}br.LENGTH=64;class Vt extends Ue{constructor(e){super(e,20)}toChecksum(){return $.Elliptic.checksumEncode(this.bytes)}}Vt.LENGTH=20;class Pt extends Ue{constructor(e){super(e,32)}static fromString(e){return new Pt($.Binary.keccak256(Ui.encode(e)))}}Pt.LENGTH=32;class Oe extends Ue{constructor(e){if(typeof e=="string"&&e.startsWith("bah5")){const r=x9(e);super(r.reference.bytes,32)}else super(e,[32,64])}toCid(e){return b9(this.bytes,e)}static isValid(e){try{return new Oe(e),!0}catch{return!1}}}Oe.LENGTH=32;class Qr extends Ue{constructor(e){super(e,32)}}Qr.LENGTH=32;class Tt extends Ue{constructor(e){super(e,8)}static fromBigInt(e){return new Tt($.Binary.numberToUint64(e,"LE"))}toBigInt(){return $.Binary.uint64ToNumber(this.bytes,"LE")}static fromSlice(e,r){return new Tt(e.slice(r,r+Tt.LENGTH))}}Tt.LENGTH=8;class vr extends Ue{constructor(e){super(e,32)}}vr.LENGTH=32;class et extends Ue{constructor(e){super(e,32)}}et.LENGTH=32;let Bn=class Ff extends Ue{constructor(e){super(e,65)}static fromSlice(e,r){return new Ff(e.slice(r,r+Ff.LENGTH))}recoverPublicKey(e){const r=$.Binary.uint256ToNumber(this.bytes.slice(0,32),"BE"),n=$.Binary.uint256ToNumber(this.bytes.slice(32,64),"BE"),i=BigInt(this.bytes[64]),[o,a]=$.Elliptic.recoverPublicKey($.Binary.concatBytes(Ui.encode(`Ethereum Signed Message:
75
+ 32`),$.Binary.keccak256(e instanceof Uint8Array?e:Ui.encode(e))),r,n,i);return new br($.Binary.concatBytes($.Binary.numberToUint256(o,"BE"),$.Binary.numberToUint256(a,"BE")))}isValid(e,r){return this.recoverPublicKey(e).address().equals(r)}};Bn.LENGTH=65;class Zr extends Ue{constructor(e){super(e,32)}static fromString(e){return new Zr($.Binary.keccak256(Ui.encode(e)))}}Zr.LENGTH=32;const Qy=new Uint8Array(8).fill(255,0,8);class Gt extends Ue{constructor(e){super(e,8)}static fromBigInt(e){return new Gt($.Binary.numberToUint64(e,"BE"))}toBigInt(){return $.Binary.uint64ToNumber(this.bytes,"BE")}next(){return $.Binary.equals(this.bytes,Qy)?Gt.fromBigInt(0n):Gt.fromBigInt(this.toBigInt()+1n)}}Gt.LENGTH=8;Gt.MINUS_ONE=new Gt(Qy);class Pr extends Error{constructor(e){super(e)}}class Tr extends Pr{constructor(e,r){super(e),this.value=r}}class $s extends Pr{constructor(e,r,n,i,o,a){super(n),this.method=e,this.url=r,this.responseBody=i,this.status=o,this.statusText=a,this.response={status:o,data:i,statusText:a}}}const ku=4096,w9=32;function Yy(t){const e=t.slice(0,Tt.LENGTH),r=t.slice(Tt.LENGTH),n=A9(r),i=$.Binary.keccak256($.Binary.concatBytes(e,n));return new Oe(i)}function A9(t){if(t.length>ku)throw new Tr(`payload size ${t.length} exceeds maximum chunk payload size ${ku}`,t);const e=new Uint8Array(ku);return e.set(t),$.Binary.log2Reduce($.Binary.partition(e,w9),(r,n)=>$.Binary.keccak256($.Binary.concatBytes(r,n)))}const ii=ve({reference:ce().transform(t=>new Oe(t))});var Ri;(function(t){t.FULL="full",t.LIGHT="light",t.ULTRA_LIGHT="ultra-light",t.DEV="dev"})(Ri||(Ri={}));function Xy(t){switch(t){case"full":return Ri.FULL;case"light":return Ri.LIGHT;case"ultra-light":return Ri.ULTRA_LIGHT;case"dev":return Ri.DEV;default:throw new Error(`Unknown Bee mode: ${t}`)}}const E9=32,v9=128,Lo=E9*v9,tp=17,rp=255,R9=1,T9=1e3;var Mt;(function(t){t[t.OFF=0]="OFF",t[t.MEDIUM=1]="MEDIUM",t[t.STRONG=2]="STRONG",t[t.INSANE=3]="INSANE",t[t.PARANOID=4]="PARANOID"})(Mt||(Mt={}));var np;(function(t){t[t.NONE=0]="NONE",t[t.DATA=1]="DATA",t[t.PROX=2]="PROX",t[t.RACE=3]="RACE"})(np||(np={}));const eb={ENCRYPTION_OFF:{[Mt.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%"}],[Mt.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%"}],[Mt.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%"}],[Mt.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%"}],[Mt.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:{[Mt.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%"}],[Mt.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%"}],[Mt.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%"}],[Mt.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%"}],[Mt.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 sr{constructor(e){this.seconds=Math.ceil(e),e<0&&(this.seconds=0)}static fromMilliseconds(e){return new sr(e/1e3)}static fromSeconds(e){return new sr(e)}static fromHours(e){return new sr(e*60*60)}static fromDays(e){return new sr(e*24*60*60)}static fromWeeks(e){return new sr(e*7*24*60*60)}static fromYears(e){return new sr(e*365*24*60*60)}static fromEndDate(e,r){return new sr((e.getTime()-(r??new Date).getTime())/1e3)}static parseFromString(e){return sr.fromSeconds($.Dates.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 $.Dates.secondsToHumanTime(this.seconds)}isZero(){return this.seconds===0}}sr.ZERO=new sr(0);class Sr{constructor(e){if(this.bytes=Math.ceil(e),e<0)throw Error("Size must be at least 0")}static fromBytes(e){return new Sr(e)}static fromKilobytes(e){return new Sr(e*1e3)}static fromMegabytes(e){return new Sr(e*1e3*1e3)}static fromGigabytes(e){return new Sr(e*1e3*1e3*1e3)}static parseFromString(e){return Sr.fromBytes($.Numbers.makeStorage(e,1e3))}toBytes(){return this.bytes}toGigabytes(){return this.bytes/1e3/1e3/1e3}toFormattedString(){return $.Numbers.convertBytes(this.bytes,1e3)}represent(){return this.toFormattedString()}}class Fe{constructor(e){this.state=e}static fromDecimalString(e){return new Fe($.FixedPointNumber.fromDecimalString(e,Fe.DIGITS))}static fromPLUR(e){return new Fe(new $.FixedPointNumber(e,Fe.DIGITS))}static fromFloat(e){return new Fe($.FixedPointNumber.fromFloat(e,Fe.DIGITS))}toPLURString(){return this.state.toString()}toPLURBigInt(){return this.state.value}toDecimalString(){return this.state.toDecimalString()}toFloat(){return this.state.toFloat()}toSignificantDigits(e){return this.toDecimalString().slice(0,this.toDecimalString().indexOf(".")+e+1)}plus(e){return new Fe(this.state.add(e instanceof Fe?e.state:new $.FixedPointNumber(e,Fe.DIGITS)))}minus(e){return new Fe(this.state.subtract(e instanceof Fe?e.state:new $.FixedPointNumber(e,Fe.DIGITS)))}divide(e){return new Fe(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 ut.fromWei(this.state.exchange("*",new $.FixedPointNumber(e.toWeiBigInt(),ut.DIGITS),ut.DIGITS).value)}}Fe.DIGITS=16;class ut{constructor(e){this.state=e}static fromDecimalString(e){return new ut($.FixedPointNumber.fromDecimalString(e,ut.DIGITS))}static fromWei(e){return new ut(new $.FixedPointNumber(e,ut.DIGITS))}static fromFloat(e){return new ut($.FixedPointNumber.fromFloat(e,ut.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)}toFloat(){return this.state.toFloat()}plus(e){return new ut(this.state.add(e instanceof ut?e.state:new $.FixedPointNumber(e,ut.DIGITS)))}minus(e){return new ut(this.state.subtract(e instanceof ut?e.state:new $.FixedPointNumber(e,ut.DIGITS)))}divide(e){return new ut(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 Fe.fromPLUR(this.state.exchange("/",new $.FixedPointNumber(e.toWeiBigInt(),ut.DIGITS),Fe.DIGITS).value)}}ut.DIGITS=18;var Mo={exports:{}},ip;function bh(){if(ip)return Mo.exports;ip=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(N,_,F){return Function.prototype.apply.call(N,_,F)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:r=function(N){return Object.getOwnPropertyNames(N)};function n(S){console&&console.warn&&console.warn(S)}var i=Number.isNaN||function(N){return N!==N};function o(){o.init.call(this)}Mo.exports=o,Mo.exports.once=A,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function u(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(S){if(typeof S!="number"||S<0||i(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");a=S}}),o.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},o.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||i(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function l(S){return S._maxListeners===void 0?o.defaultMaxListeners:S._maxListeners}o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(N){for(var _=[],F=1;F<arguments.length;F++)_.push(arguments[F]);var U=N==="error",H=this._events;if(H!==void 0)U=U&&H.error===void 0;else if(!U)return!1;if(U){var K;if(_.length>0&&(K=_[0]),K instanceof Error)throw K;var le=new Error("Unhandled error."+(K?" ("+K.message+")":""));throw le.context=K,le}var L=H[N];if(L===void 0)return!1;if(typeof L=="function")e(L,this,_);else for(var me=L.length,Be=T(L,me),F=0;F<me;++F)e(Be[F],this,_);return!0};function h(S,N,_,F){var U,H,K;if(u(_),H=S._events,H===void 0?(H=S._events=Object.create(null),S._eventsCount=0):(H.newListener!==void 0&&(S.emit("newListener",N,_.listener?_.listener:_),H=S._events),K=H[N]),K===void 0)K=H[N]=_,++S._eventsCount;else if(typeof K=="function"?K=H[N]=F?[_,K]:[K,_]:F?K.unshift(_):K.push(_),U=l(S),U>0&&K.length>U&&!K.warned){K.warned=!0;var le=new Error("Possible EventEmitter memory leak detected. "+K.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");le.name="MaxListenersExceededWarning",le.emitter=S,le.type=N,le.count=K.length,n(le)}return S}o.prototype.addListener=function(N,_){return h(this,N,_,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(N,_){return h(this,N,_,!0)};function d(){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(S,N,_){var F={fired:!1,wrapFn:void 0,target:S,type:N,listener:_},U=d.bind(F);return U.listener=_,F.wrapFn=U,U}o.prototype.once=function(N,_){return u(_),this.on(N,m(this,N,_)),this},o.prototype.prependOnceListener=function(N,_){return u(_),this.prependListener(N,m(this,N,_)),this},o.prototype.removeListener=function(N,_){var F,U,H,K,le;if(u(_),U=this._events,U===void 0)return this;if(F=U[N],F===void 0)return this;if(F===_||F.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete U[N],U.removeListener&&this.emit("removeListener",N,F.listener||_));else if(typeof F!="function"){for(H=-1,K=F.length-1;K>=0;K--)if(F[K]===_||F[K].listener===_){le=F[K].listener,H=K;break}if(H<0)return this;H===0?F.shift():E(F,H),F.length===1&&(U[N]=F[0]),U.removeListener!==void 0&&this.emit("removeListener",N,le||_)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(N){var _,F,U;if(F=this._events,F===void 0)return this;if(F.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):F[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete F[N]),this;if(arguments.length===0){var H=Object.keys(F),K;for(U=0;U<H.length;++U)K=H[U],K!=="removeListener"&&this.removeAllListeners(K);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(_=F[N],typeof _=="function")this.removeListener(N,_);else if(_!==void 0)for(U=_.length-1;U>=0;U--)this.removeListener(N,_[U]);return this};function y(S,N,_){var F=S._events;if(F===void 0)return[];var U=F[N];return U===void 0?[]:typeof U=="function"?_?[U.listener||U]:[U]:_?B(U):T(U,U.length)}o.prototype.listeners=function(N){return y(this,N,!0)},o.prototype.rawListeners=function(N){return y(this,N,!1)},o.listenerCount=function(S,N){return typeof S.listenerCount=="function"?S.listenerCount(N):w.call(S,N)},o.prototype.listenerCount=w;function w(S){var N=this._events;if(N!==void 0){var _=N[S];if(typeof _=="function")return 1;if(_!==void 0)return _.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function T(S,N){for(var _=new Array(N),F=0;F<N;++F)_[F]=S[F];return _}function E(S,N){for(;N+1<S.length;N++)S[N]=S[N+1];S.pop()}function B(S){for(var N=new Array(S.length),_=0;_<N.length;++_)N[_]=S[_].listener||S[_];return N}function A(S,N){return new Promise(function(_,F){function U(K){S.removeListener(N,H),F(K)}function H(){typeof S.removeListener=="function"&&S.removeListener("error",U),_([].slice.call(arguments))}I(S,N,H,{once:!0}),N!=="error"&&P(S,U,{once:!0})})}function P(S,N,_){typeof S.on=="function"&&I(S,"error",N,_)}function I(S,N,_,F){if(typeof S.on=="function")F.once?S.once(N,_):S.on(N,_);else if(typeof S.addEventListener=="function")S.addEventListener(N,function U(H){F.once&&S.removeEventListener(N,U),_(H)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}return Mo.exports}var zo={exports:{}},sp;function si(){return sp||(sp=1,typeof Object.create=="function"?zo.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:zo.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}),zo.exports}var Nu,op;function tb(){return op||(op=1,Nu=bh().EventEmitter),Nu}var Cu={},ap;function La(){return ap||(ap=1,(function(t){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e={},r={};r.byteLength=d,r.toByteArray=y,r.fromByteArray=E;for(var n=[],i=[],o=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,l=a.length;u<l;++u)n[u]=a[u],i[a.charCodeAt(u)]=u;i[45]=62,i[95]=63;function h(P){var I=P.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var S=P.indexOf("=");S===-1&&(S=I);var N=S===I?0:4-S%4;return[S,N]}function d(P){var I=h(P),S=I[0],N=I[1];return(S+N)*3/4-N}function m(P,I,S){return(I+S)*3/4-S}function y(P){var I,S=h(P),N=S[0],_=S[1],F=new o(m(P,N,_)),U=0,H=_>0?N-4:N,K;for(K=0;K<H;K+=4)I=i[P.charCodeAt(K)]<<18|i[P.charCodeAt(K+1)]<<12|i[P.charCodeAt(K+2)]<<6|i[P.charCodeAt(K+3)],F[U++]=I>>16&255,F[U++]=I>>8&255,F[U++]=I&255;return _===2&&(I=i[P.charCodeAt(K)]<<2|i[P.charCodeAt(K+1)]>>4,F[U++]=I&255),_===1&&(I=i[P.charCodeAt(K)]<<10|i[P.charCodeAt(K+1)]<<4|i[P.charCodeAt(K+2)]>>2,F[U++]=I>>8&255,F[U++]=I&255),F}function w(P){return n[P>>18&63]+n[P>>12&63]+n[P>>6&63]+n[P&63]}function T(P,I,S){for(var N,_=[],F=I;F<S;F+=3)N=(P[F]<<16&16711680)+(P[F+1]<<8&65280)+(P[F+2]&255),_.push(w(N));return _.join("")}function E(P){for(var I,S=P.length,N=S%3,_=[],F=16383,U=0,H=S-N;U<H;U+=F)_.push(T(P,U,U+F>H?H:U+F));return N===1?(I=P[S-1],_.push(n[I>>2]+n[I<<4&63]+"==")):N===2&&(I=(P[S-2]<<8)+P[S-1],_.push(n[I>>10]+n[I>>4&63]+n[I<<2&63]+"=")),_.join("")}var B={};B.read=function(P,I,S,N,_){var F,U,H=_*8-N-1,K=(1<<H)-1,le=K>>1,L=-7,me=S?_-1:0,Be=S?-1:1,re=P[I+me];for(me+=Be,F=re&(1<<-L)-1,re>>=-L,L+=H;L>0;F=F*256+P[I+me],me+=Be,L-=8);for(U=F&(1<<-L)-1,F>>=-L,L+=N;L>0;U=U*256+P[I+me],me+=Be,L-=8);if(F===0)F=1-le;else{if(F===K)return U?NaN:(re?-1:1)*(1/0);U=U+Math.pow(2,N),F=F-le}return(re?-1:1)*U*Math.pow(2,F-N)},B.write=function(P,I,S,N,_,F){var U,H,K,le=F*8-_-1,L=(1<<le)-1,me=L>>1,Be=_===23?Math.pow(2,-24)-Math.pow(2,-77):0,re=N?0:F-1,ue=N?1:-1,ye=I<0||I===0&&1/I<0?1:0;for(I=Math.abs(I),isNaN(I)||I===1/0?(H=isNaN(I)?1:0,U=L):(U=Math.floor(Math.log(I)/Math.LN2),I*(K=Math.pow(2,-U))<1&&(U--,K*=2),U+me>=1?I+=Be/K:I+=Be*Math.pow(2,1-me),I*K>=2&&(U++,K/=2),U+me>=L?(H=0,U=L):U+me>=1?(H=(I*K-1)*Math.pow(2,_),U=U+me):(H=I*Math.pow(2,me-1)*Math.pow(2,_),U=0));_>=8;P[S+re]=H&255,re+=ue,H/=256,_-=8);for(U=U<<_|H,le+=_;le>0;P[S+re]=U&255,re+=ue,U/=256,le-=8);P[S+re-ue]|=ye*128};(function(P){const I=r,S=B,N=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;P.Buffer=L,P.SlowBuffer=j,P.INSPECT_MAX_BYTES=50;const _=2147483647;P.kMaxLength=_;const{Uint8Array:F,ArrayBuffer:U,SharedArrayBuffer:H}=globalThis;L.TYPED_ARRAY_SUPPORT=K(),!L.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 K(){try{const v=new F(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,F.prototype),Object.setPrototypeOf(v,g),v.foo()===42}catch{return!1}}Object.defineProperty(L.prototype,"parent",{enumerable:!0,get:function(){if(L.isBuffer(this))return this.buffer}}),Object.defineProperty(L.prototype,"offset",{enumerable:!0,get:function(){if(L.isBuffer(this))return this.byteOffset}});function le(v){if(v>_)throw new RangeError('The value "'+v+'" is invalid for option "size"');const g=new F(v);return Object.setPrototypeOf(g,L.prototype),g}function L(v,g,x){if(typeof v=="number"){if(typeof g=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ue(v)}return me(v,g,x)}L.poolSize=8192;function me(v,g,x){if(typeof v=="string")return ye(v,g);if(U.isView(v))return Ee(v);if(v==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v);if(ur(v,U)||v&&ur(v.buffer,U)||typeof H<"u"&&(ur(v,H)||v&&ur(v.buffer,H)))return Se(v,g,x);if(typeof v=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const C=v.valueOf&&v.valueOf();if(C!=null&&C!==v)return L.from(C,g,x);const V=Le(v);if(V)return V;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof v[Symbol.toPrimitive]=="function")return L.from(v[Symbol.toPrimitive]("string"),g,x);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v)}L.from=function(v,g,x){return me(v,g,x)},Object.setPrototypeOf(L.prototype,F.prototype),Object.setPrototypeOf(L,F);function Be(v){if(typeof v!="number")throw new TypeError('"size" argument must be of type number');if(v<0)throw new RangeError('The value "'+v+'" is invalid for option "size"')}function re(v,g,x){return Be(v),v<=0?le(v):g!==void 0?typeof x=="string"?le(v).fill(g,x):le(v).fill(g):le(v)}L.alloc=function(v,g,x){return re(v,g,x)};function ue(v){return Be(v),le(v<0?0:_e(v)|0)}L.allocUnsafe=function(v){return ue(v)},L.allocUnsafeSlow=function(v){return ue(v)};function ye(v,g){if((typeof g!="string"||g==="")&&(g="utf8"),!L.isEncoding(g))throw new TypeError("Unknown encoding: "+g);const x=W(v,g)|0;let C=le(x);const V=C.write(v,g);return V!==x&&(C=C.slice(0,V)),C}function Ae(v){const g=v.length<0?0:_e(v.length)|0,x=le(g);for(let C=0;C<g;C+=1)x[C]=v[C]&255;return x}function Ee(v){if(ur(v,F)){const g=new F(v);return Se(g.buffer,g.byteOffset,g.byteLength)}return Ae(v)}function Se(v,g,x){if(g<0||v.byteLength<g)throw new RangeError('"offset" is outside of buffer bounds');if(v.byteLength<g+(x||0))throw new RangeError('"length" is outside of buffer bounds');let C;return g===void 0&&x===void 0?C=new F(v):x===void 0?C=new F(v,g):C=new F(v,g,x),Object.setPrototypeOf(C,L.prototype),C}function Le(v){if(L.isBuffer(v)){const g=_e(v.length)|0,x=le(g);return x.length===0||v.copy(x,0,0,g),x}if(v.length!==void 0)return typeof v.length!="number"||us(v.length)?le(0):Ae(v);if(v.type==="Buffer"&&Array.isArray(v.data))return Ae(v.data)}function _e(v){if(v>=_)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_.toString(16)+" bytes");return v|0}function j(v){return+v!=v&&(v=0),L.alloc(+v)}L.isBuffer=function(g){return g!=null&&g._isBuffer===!0&&g!==L.prototype},L.compare=function(g,x){if(ur(g,F)&&(g=L.from(g,g.offset,g.byteLength)),ur(x,F)&&(x=L.from(x,x.offset,x.byteLength)),!L.isBuffer(g)||!L.isBuffer(x))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(g===x)return 0;let C=g.length,V=x.length;for(let q=0,ee=Math.min(C,V);q<ee;++q)if(g[q]!==x[q]){C=g[q],V=x[q];break}return C<V?-1:V<C?1:0},L.isEncoding=function(g){switch(String(g).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}},L.concat=function(g,x){if(!Array.isArray(g))throw new TypeError('"list" argument must be an Array of Buffers');if(g.length===0)return L.alloc(0);let C;if(x===void 0)for(x=0,C=0;C<g.length;++C)x+=g[C].length;const V=L.allocUnsafe(x);let q=0;for(C=0;C<g.length;++C){let ee=g[C];if(ur(ee,F))q+ee.length>V.length?(L.isBuffer(ee)||(ee=L.from(ee)),ee.copy(V,q)):F.prototype.set.call(V,ee,q);else if(L.isBuffer(ee))ee.copy(V,q);else throw new TypeError('"list" argument must be an Array of Buffers');q+=ee.length}return V};function W(v,g){if(L.isBuffer(v))return v.length;if(U.isView(v)||ur(v,U))return v.byteLength;if(typeof v!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof v);const x=v.length,C=arguments.length>2&&arguments[2]===!0;if(!C&&x===0)return 0;let V=!1;for(;;)switch(g){case"ascii":case"latin1":case"binary":return x;case"utf8":case"utf-8":return os(v).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x*2;case"hex":return x>>>1;case"base64":return cs(v).length;default:if(V)return C?-1:os(v).length;g=(""+g).toLowerCase(),V=!0}}L.byteLength=W;function se(v,g,x){let C=!1;if((g===void 0||g<0)&&(g=0),g>this.length||((x===void 0||x>this.length)&&(x=this.length),x<=0)||(x>>>=0,g>>>=0,x<=g))return"";for(v||(v="utf8");;)switch(v){case"hex":return xt(this,g,x);case"utf8":case"utf-8":return Pe(this,g,x);case"ascii":return Ut(this,g,x);case"latin1":case"binary":return X(this,g,x);case"base64":return fe(this,g,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wt(this,g,x);default:if(C)throw new TypeError("Unknown encoding: "+v);v=(v+"").toLowerCase(),C=!0}}L.prototype._isBuffer=!0;function M(v,g,x){const C=v[g];v[g]=v[x],v[x]=C}L.prototype.swap16=function(){const g=this.length;if(g%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let x=0;x<g;x+=2)M(this,x,x+1);return this},L.prototype.swap32=function(){const g=this.length;if(g%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let x=0;x<g;x+=4)M(this,x,x+3),M(this,x+1,x+2);return this},L.prototype.swap64=function(){const g=this.length;if(g%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let x=0;x<g;x+=8)M(this,x,x+7),M(this,x+1,x+6),M(this,x+2,x+5),M(this,x+3,x+4);return this},L.prototype.toString=function(){const g=this.length;return g===0?"":arguments.length===0?Pe(this,0,g):se.apply(this,arguments)},L.prototype.toLocaleString=L.prototype.toString,L.prototype.equals=function(g){if(!L.isBuffer(g))throw new TypeError("Argument must be a Buffer");return this===g?!0:L.compare(this,g)===0},L.prototype.inspect=function(){let g="";const x=P.INSPECT_MAX_BYTES;return g=this.toString("hex",0,x).replace(/(.{2})/g,"$1 ").trim(),this.length>x&&(g+=" ... "),"<Buffer "+g+">"},N&&(L.prototype[N]=L.prototype.inspect),L.prototype.compare=function(g,x,C,V,q){if(ur(g,F)&&(g=L.from(g,g.offset,g.byteLength)),!L.isBuffer(g))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof g);if(x===void 0&&(x=0),C===void 0&&(C=g?g.length:0),V===void 0&&(V=0),q===void 0&&(q=this.length),x<0||C>g.length||V<0||q>this.length)throw new RangeError("out of range index");if(V>=q&&x>=C)return 0;if(V>=q)return-1;if(x>=C)return 1;if(x>>>=0,C>>>=0,V>>>=0,q>>>=0,this===g)return 0;let ee=q-V,Ne=C-x;const We=Math.min(ee,Ne),Ze=this.slice(V,q),ct=g.slice(x,C);for(let Ke=0;Ke<We;++Ke)if(Ze[Ke]!==ct[Ke]){ee=Ze[Ke],Ne=ct[Ke];break}return ee<Ne?-1:Ne<ee?1:0};function z(v,g,x,C,V){if(v.length===0)return-1;if(typeof x=="string"?(C=x,x=0):x>2147483647?x=2147483647:x<-2147483648&&(x=-2147483648),x=+x,us(x)&&(x=V?0:v.length-1),x<0&&(x=v.length+x),x>=v.length){if(V)return-1;x=v.length-1}else if(x<0)if(V)x=0;else return-1;if(typeof g=="string"&&(g=L.from(g,C)),L.isBuffer(g))return g.length===0?-1:Q(v,g,x,C,V);if(typeof g=="number")return g=g&255,typeof F.prototype.indexOf=="function"?V?F.prototype.indexOf.call(v,g,x):F.prototype.lastIndexOf.call(v,g,x):Q(v,[g],x,C,V);throw new TypeError("val must be string, number or Buffer")}function Q(v,g,x,C,V){let q=1,ee=v.length,Ne=g.length;if(C!==void 0&&(C=String(C).toLowerCase(),C==="ucs2"||C==="ucs-2"||C==="utf16le"||C==="utf-16le")){if(v.length<2||g.length<2)return-1;q=2,ee/=2,Ne/=2,x/=2}function We(ct,Ke){return q===1?ct[Ke]:ct.readUInt16BE(Ke*q)}let Ze;if(V){let ct=-1;for(Ze=x;Ze<ee;Ze++)if(We(v,Ze)===We(g,ct===-1?0:Ze-ct)){if(ct===-1&&(ct=Ze),Ze-ct+1===Ne)return ct*q}else ct!==-1&&(Ze-=Ze-ct),ct=-1}else for(x+Ne>ee&&(x=ee-Ne),Ze=x;Ze>=0;Ze--){let ct=!0;for(let Ke=0;Ke<Ne;Ke++)if(We(v,Ze+Ke)!==We(g,Ke)){ct=!1;break}if(ct)return Ze}return-1}L.prototype.includes=function(g,x,C){return this.indexOf(g,x,C)!==-1},L.prototype.indexOf=function(g,x,C){return z(this,g,x,C,!0)},L.prototype.lastIndexOf=function(g,x,C){return z(this,g,x,C,!1)};function ie(v,g,x,C){x=Number(x)||0;const V=v.length-x;C?(C=Number(C),C>V&&(C=V)):C=V;const q=g.length;C>q/2&&(C=q/2);let ee;for(ee=0;ee<C;++ee){const Ne=parseInt(g.substr(ee*2,2),16);if(us(Ne))return ee;v[x+ee]=Ne}return ee}function oe(v,g,x,C){return Cn(os(g,v.length-x),v,x,C)}function O(v,g,x,C){return Cn(as(g),v,x,C)}function k(v,g,x,C){return Cn(cs(g),v,x,C)}function Z(v,g,x,C){return Cn(Eo(g,v.length-x),v,x,C)}L.prototype.write=function(g,x,C,V){if(x===void 0)V="utf8",C=this.length,x=0;else if(C===void 0&&typeof x=="string")V=x,C=this.length,x=0;else if(isFinite(x))x=x>>>0,isFinite(C)?(C=C>>>0,V===void 0&&(V="utf8")):(V=C,C=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const q=this.length-x;if((C===void 0||C>q)&&(C=q),g.length>0&&(C<0||x<0)||x>this.length)throw new RangeError("Attempt to write outside buffer bounds");V||(V="utf8");let ee=!1;for(;;)switch(V){case"hex":return ie(this,g,x,C);case"utf8":case"utf-8":return oe(this,g,x,C);case"ascii":case"latin1":case"binary":return O(this,g,x,C);case"base64":return k(this,g,x,C);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,g,x,C);default:if(ee)throw new TypeError("Unknown encoding: "+V);V=(""+V).toLowerCase(),ee=!0}},L.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function fe(v,g,x){return g===0&&x===v.length?I.fromByteArray(v):I.fromByteArray(v.slice(g,x))}function Pe(v,g,x){x=Math.min(v.length,x);const C=[];let V=g;for(;V<x;){const q=v[V];let ee=null,Ne=q>239?4:q>223?3:q>191?2:1;if(V+Ne<=x){let We,Ze,ct,Ke;switch(Ne){case 1:q<128&&(ee=q);break;case 2:We=v[V+1],(We&192)===128&&(Ke=(q&31)<<6|We&63,Ke>127&&(ee=Ke));break;case 3:We=v[V+1],Ze=v[V+2],(We&192)===128&&(Ze&192)===128&&(Ke=(q&15)<<12|(We&63)<<6|Ze&63,Ke>2047&&(Ke<55296||Ke>57343)&&(ee=Ke));break;case 4:We=v[V+1],Ze=v[V+2],ct=v[V+3],(We&192)===128&&(Ze&192)===128&&(ct&192)===128&&(Ke=(q&15)<<18|(We&63)<<12|(Ze&63)<<6|ct&63,Ke>65535&&Ke<1114112&&(ee=Ke))}}ee===null?(ee=65533,Ne=1):ee>65535&&(ee-=65536,C.push(ee>>>10&1023|55296),ee=56320|ee&1023),C.push(ee),V+=Ne}return De(C)}const xe=4096;function De(v){const g=v.length;if(g<=xe)return String.fromCharCode.apply(String,v);let x="",C=0;for(;C<g;)x+=String.fromCharCode.apply(String,v.slice(C,C+=xe));return x}function Ut(v,g,x){let C="";x=Math.min(v.length,x);for(let V=g;V<x;++V)C+=String.fromCharCode(v[V]&127);return C}function X(v,g,x){let C="";x=Math.min(v.length,x);for(let V=g;V<x;++V)C+=String.fromCharCode(v[V]);return C}function xt(v,g,x){const C=v.length;(!g||g<0)&&(g=0),(!x||x<0||x>C)&&(x=C);let V="";for(let q=g;q<x;++q)V+=uc[v[q]];return V}function wt(v,g,x){const C=v.slice(g,x);let V="";for(let q=0;q<C.length-1;q+=2)V+=String.fromCharCode(C[q]+C[q+1]*256);return V}L.prototype.slice=function(g,x){const C=this.length;g=~~g,x=x===void 0?C:~~x,g<0?(g+=C,g<0&&(g=0)):g>C&&(g=C),x<0?(x+=C,x<0&&(x=0)):x>C&&(x=C),x<g&&(x=g);const V=this.subarray(g,x);return Object.setPrototypeOf(V,L.prototype),V};function qe(v,g,x){if(v%1!==0||v<0)throw new RangeError("offset is not uint");if(v+g>x)throw new RangeError("Trying to access beyond buffer length")}L.prototype.readUintLE=L.prototype.readUIntLE=function(g,x,C){g=g>>>0,x=x>>>0,C||qe(g,x,this.length);let V=this[g],q=1,ee=0;for(;++ee<x&&(q*=256);)V+=this[g+ee]*q;return V},L.prototype.readUintBE=L.prototype.readUIntBE=function(g,x,C){g=g>>>0,x=x>>>0,C||qe(g,x,this.length);let V=this[g+--x],q=1;for(;x>0&&(q*=256);)V+=this[g+--x]*q;return V},L.prototype.readUint8=L.prototype.readUInt8=function(g,x){return g=g>>>0,x||qe(g,1,this.length),this[g]},L.prototype.readUint16LE=L.prototype.readUInt16LE=function(g,x){return g=g>>>0,x||qe(g,2,this.length),this[g]|this[g+1]<<8},L.prototype.readUint16BE=L.prototype.readUInt16BE=function(g,x){return g=g>>>0,x||qe(g,2,this.length),this[g]<<8|this[g+1]},L.prototype.readUint32LE=L.prototype.readUInt32LE=function(g,x){return g=g>>>0,x||qe(g,4,this.length),(this[g]|this[g+1]<<8|this[g+2]<<16)+this[g+3]*16777216},L.prototype.readUint32BE=L.prototype.readUInt32BE=function(g,x){return g=g>>>0,x||qe(g,4,this.length),this[g]*16777216+(this[g+1]<<16|this[g+2]<<8|this[g+3])},L.prototype.readBigUInt64LE=Nr(function(g){g=g>>>0,un(g,"offset");const x=this[g],C=this[g+7];(x===void 0||C===void 0)&&Nn(g,this.length-8);const V=x+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24,q=this[++g]+this[++g]*2**8+this[++g]*2**16+C*2**24;return BigInt(V)+(BigInt(q)<<BigInt(32))}),L.prototype.readBigUInt64BE=Nr(function(g){g=g>>>0,un(g,"offset");const x=this[g],C=this[g+7];(x===void 0||C===void 0)&&Nn(g,this.length-8);const V=x*2**24+this[++g]*2**16+this[++g]*2**8+this[++g],q=this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+C;return(BigInt(V)<<BigInt(32))+BigInt(q)}),L.prototype.readIntLE=function(g,x,C){g=g>>>0,x=x>>>0,C||qe(g,x,this.length);let V=this[g],q=1,ee=0;for(;++ee<x&&(q*=256);)V+=this[g+ee]*q;return q*=128,V>=q&&(V-=Math.pow(2,8*x)),V},L.prototype.readIntBE=function(g,x,C){g=g>>>0,x=x>>>0,C||qe(g,x,this.length);let V=x,q=1,ee=this[g+--V];for(;V>0&&(q*=256);)ee+=this[g+--V]*q;return q*=128,ee>=q&&(ee-=Math.pow(2,8*x)),ee},L.prototype.readInt8=function(g,x){return g=g>>>0,x||qe(g,1,this.length),this[g]&128?(255-this[g]+1)*-1:this[g]},L.prototype.readInt16LE=function(g,x){g=g>>>0,x||qe(g,2,this.length);const C=this[g]|this[g+1]<<8;return C&32768?C|4294901760:C},L.prototype.readInt16BE=function(g,x){g=g>>>0,x||qe(g,2,this.length);const C=this[g+1]|this[g]<<8;return C&32768?C|4294901760:C},L.prototype.readInt32LE=function(g,x){return g=g>>>0,x||qe(g,4,this.length),this[g]|this[g+1]<<8|this[g+2]<<16|this[g+3]<<24},L.prototype.readInt32BE=function(g,x){return g=g>>>0,x||qe(g,4,this.length),this[g]<<24|this[g+1]<<16|this[g+2]<<8|this[g+3]},L.prototype.readBigInt64LE=Nr(function(g){g=g>>>0,un(g,"offset");const x=this[g],C=this[g+7];(x===void 0||C===void 0)&&Nn(g,this.length-8);const V=this[g+4]+this[g+5]*2**8+this[g+6]*2**16+(C<<24);return(BigInt(V)<<BigInt(32))+BigInt(x+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24)}),L.prototype.readBigInt64BE=Nr(function(g){g=g>>>0,un(g,"offset");const x=this[g],C=this[g+7];(x===void 0||C===void 0)&&Nn(g,this.length-8);const V=(x<<24)+this[++g]*2**16+this[++g]*2**8+this[++g];return(BigInt(V)<<BigInt(32))+BigInt(this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+C)}),L.prototype.readFloatLE=function(g,x){return g=g>>>0,x||qe(g,4,this.length),S.read(this,g,!0,23,4)},L.prototype.readFloatBE=function(g,x){return g=g>>>0,x||qe(g,4,this.length),S.read(this,g,!1,23,4)},L.prototype.readDoubleLE=function(g,x){return g=g>>>0,x||qe(g,8,this.length),S.read(this,g,!0,52,8)},L.prototype.readDoubleBE=function(g,x){return g=g>>>0,x||qe(g,8,this.length),S.read(this,g,!1,52,8)};function st(v,g,x,C,V,q){if(!L.isBuffer(v))throw new TypeError('"buffer" argument must be a Buffer instance');if(g>V||g<q)throw new RangeError('"value" argument is out of bounds');if(x+C>v.length)throw new RangeError("Index out of range")}L.prototype.writeUintLE=L.prototype.writeUIntLE=function(g,x,C,V){if(g=+g,x=x>>>0,C=C>>>0,!V){const Ne=Math.pow(2,8*C)-1;st(this,g,x,C,Ne,0)}let q=1,ee=0;for(this[x]=g&255;++ee<C&&(q*=256);)this[x+ee]=g/q&255;return x+C},L.prototype.writeUintBE=L.prototype.writeUIntBE=function(g,x,C,V){if(g=+g,x=x>>>0,C=C>>>0,!V){const Ne=Math.pow(2,8*C)-1;st(this,g,x,C,Ne,0)}let q=C-1,ee=1;for(this[x+q]=g&255;--q>=0&&(ee*=256);)this[x+q]=g/ee&255;return x+C},L.prototype.writeUint8=L.prototype.writeUInt8=function(g,x,C){return g=+g,x=x>>>0,C||st(this,g,x,1,255,0),this[x]=g&255,x+1},L.prototype.writeUint16LE=L.prototype.writeUInt16LE=function(g,x,C){return g=+g,x=x>>>0,C||st(this,g,x,2,65535,0),this[x]=g&255,this[x+1]=g>>>8,x+2},L.prototype.writeUint16BE=L.prototype.writeUInt16BE=function(g,x,C){return g=+g,x=x>>>0,C||st(this,g,x,2,65535,0),this[x]=g>>>8,this[x+1]=g&255,x+2},L.prototype.writeUint32LE=L.prototype.writeUInt32LE=function(g,x,C){return g=+g,x=x>>>0,C||st(this,g,x,4,4294967295,0),this[x+3]=g>>>24,this[x+2]=g>>>16,this[x+1]=g>>>8,this[x]=g&255,x+4},L.prototype.writeUint32BE=L.prototype.writeUInt32BE=function(g,x,C){return g=+g,x=x>>>0,C||st(this,g,x,4,4294967295,0),this[x]=g>>>24,this[x+1]=g>>>16,this[x+2]=g>>>8,this[x+3]=g&255,x+4};function jt(v,g,x,C,V){is(g,C,V,v,x,7);let q=Number(g&BigInt(4294967295));v[x++]=q,q=q>>8,v[x++]=q,q=q>>8,v[x++]=q,q=q>>8,v[x++]=q;let ee=Number(g>>BigInt(32)&BigInt(4294967295));return v[x++]=ee,ee=ee>>8,v[x++]=ee,ee=ee>>8,v[x++]=ee,ee=ee>>8,v[x++]=ee,x}function Er(v,g,x,C,V){is(g,C,V,v,x,7);let q=Number(g&BigInt(4294967295));v[x+7]=q,q=q>>8,v[x+6]=q,q=q>>8,v[x+5]=q,q=q>>8,v[x+4]=q;let ee=Number(g>>BigInt(32)&BigInt(4294967295));return v[x+3]=ee,ee=ee>>8,v[x+2]=ee,ee=ee>>8,v[x+1]=ee,ee=ee>>8,v[x]=ee,x+8}L.prototype.writeBigUInt64LE=Nr(function(g,x=0){return jt(this,g,x,BigInt(0),BigInt("0xffffffffffffffff"))}),L.prototype.writeBigUInt64BE=Nr(function(g,x=0){return Er(this,g,x,BigInt(0),BigInt("0xffffffffffffffff"))}),L.prototype.writeIntLE=function(g,x,C,V){if(g=+g,x=x>>>0,!V){const We=Math.pow(2,8*C-1);st(this,g,x,C,We-1,-We)}let q=0,ee=1,Ne=0;for(this[x]=g&255;++q<C&&(ee*=256);)g<0&&Ne===0&&this[x+q-1]!==0&&(Ne=1),this[x+q]=(g/ee>>0)-Ne&255;return x+C},L.prototype.writeIntBE=function(g,x,C,V){if(g=+g,x=x>>>0,!V){const We=Math.pow(2,8*C-1);st(this,g,x,C,We-1,-We)}let q=C-1,ee=1,Ne=0;for(this[x+q]=g&255;--q>=0&&(ee*=256);)g<0&&Ne===0&&this[x+q+1]!==0&&(Ne=1),this[x+q]=(g/ee>>0)-Ne&255;return x+C},L.prototype.writeInt8=function(g,x,C){return g=+g,x=x>>>0,C||st(this,g,x,1,127,-128),g<0&&(g=255+g+1),this[x]=g&255,x+1},L.prototype.writeInt16LE=function(g,x,C){return g=+g,x=x>>>0,C||st(this,g,x,2,32767,-32768),this[x]=g&255,this[x+1]=g>>>8,x+2},L.prototype.writeInt16BE=function(g,x,C){return g=+g,x=x>>>0,C||st(this,g,x,2,32767,-32768),this[x]=g>>>8,this[x+1]=g&255,x+2},L.prototype.writeInt32LE=function(g,x,C){return g=+g,x=x>>>0,C||st(this,g,x,4,2147483647,-2147483648),this[x]=g&255,this[x+1]=g>>>8,this[x+2]=g>>>16,this[x+3]=g>>>24,x+4},L.prototype.writeInt32BE=function(g,x,C){return g=+g,x=x>>>0,C||st(this,g,x,4,2147483647,-2147483648),g<0&&(g=4294967295+g+1),this[x]=g>>>24,this[x+1]=g>>>16,this[x+2]=g>>>8,this[x+3]=g&255,x+4},L.prototype.writeBigInt64LE=Nr(function(g,x=0){return jt(this,g,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),L.prototype.writeBigInt64BE=Nr(function(g,x=0){return Er(this,g,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function at(v,g,x,C,V,q){if(x+C>v.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("Index out of range")}function Bt(v,g,x,C,V){return g=+g,x=x>>>0,V||at(v,g,x,4),S.write(v,g,x,C,23,4),x+4}L.prototype.writeFloatLE=function(g,x,C){return Bt(this,g,x,!0,C)},L.prototype.writeFloatBE=function(g,x,C){return Bt(this,g,x,!1,C)};function cr(v,g,x,C,V){return g=+g,x=x>>>0,V||at(v,g,x,8),S.write(v,g,x,C,52,8),x+8}L.prototype.writeDoubleLE=function(g,x,C){return cr(this,g,x,!0,C)},L.prototype.writeDoubleBE=function(g,x,C){return cr(this,g,x,!1,C)},L.prototype.copy=function(g,x,C,V){if(!L.isBuffer(g))throw new TypeError("argument should be a Buffer");if(C||(C=0),!V&&V!==0&&(V=this.length),x>=g.length&&(x=g.length),x||(x=0),V>0&&V<C&&(V=C),V===C||g.length===0||this.length===0)return 0;if(x<0)throw new RangeError("targetStart out of bounds");if(C<0||C>=this.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("sourceEnd out of bounds");V>this.length&&(V=this.length),g.length-x<V-C&&(V=g.length-x+C);const q=V-C;return this===g&&typeof F.prototype.copyWithin=="function"?this.copyWithin(x,C,V):F.prototype.set.call(g,this.subarray(C,V),x),q},L.prototype.fill=function(g,x,C,V){if(typeof g=="string"){if(typeof x=="string"?(V=x,x=0,C=this.length):typeof C=="string"&&(V=C,C=this.length),V!==void 0&&typeof V!="string")throw new TypeError("encoding must be a string");if(typeof V=="string"&&!L.isEncoding(V))throw new TypeError("Unknown encoding: "+V);if(g.length===1){const ee=g.charCodeAt(0);(V==="utf8"&&ee<128||V==="latin1")&&(g=ee)}}else typeof g=="number"?g=g&255:typeof g=="boolean"&&(g=Number(g));if(x<0||this.length<x||this.length<C)throw new RangeError("Out of range index");if(C<=x)return this;x=x>>>0,C=C===void 0?this.length:C>>>0,g||(g=0);let q;if(typeof g=="number")for(q=x;q<C;++q)this[q]=g;else{const ee=L.isBuffer(g)?g:L.from(g,V),Ne=ee.length;if(Ne===0)throw new TypeError('The value "'+g+'" is invalid for argument "value"');for(q=0;q<C-x;++q)this[q+x]=ee[q%Ne]}return this};const rr={};function cn(v,g,x){rr[v]=class extends x{constructor(){super(),Object.defineProperty(this,"message",{value:g.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${v}]`,this.stack,delete this.name}get code(){return v}set code(V){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:V,writable:!0})}toString(){return`${this.name} [${v}]: ${this.message}`}}}cn("ERR_BUFFER_OUT_OF_BOUNDS",function(v){return v?`${v} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),cn("ERR_INVALID_ARG_TYPE",function(v,g){return`The "${v}" argument must be of type number. Received type ${typeof g}`},TypeError),cn("ERR_OUT_OF_RANGE",function(v,g,x){let C=`The value of "${v}" is out of range.`,V=x;return Number.isInteger(x)&&Math.abs(x)>2**32?V=li(String(x)):typeof x=="bigint"&&(V=String(x),(x>BigInt(2)**BigInt(32)||x<-(BigInt(2)**BigInt(32)))&&(V=li(V)),V+="n"),C+=` It must be ${g}. Received ${V}`,C},RangeError);function li(v){let g="",x=v.length;const C=v[0]==="-"?1:0;for(;x>=C+4;x-=3)g=`_${v.slice(x-3,x)}${g}`;return`${v.slice(0,x)}${g}`}function Ao(v,g,x){un(g,"offset"),(v[g]===void 0||v[g+x]===void 0)&&Nn(g,v.length-(x+1))}function is(v,g,x,C,V,q){if(v>x||v<g){const ee=typeof g=="bigint"?"n":"";let Ne;throw g===0||g===BigInt(0)?Ne=`>= 0${ee} and < 2${ee} ** ${(q+1)*8}${ee}`:Ne=`>= -(2${ee} ** ${(q+1)*8-1}${ee}) and < 2 ** ${(q+1)*8-1}${ee}`,new rr.ERR_OUT_OF_RANGE("value",Ne,v)}Ao(C,V,q)}function un(v,g){if(typeof v!="number")throw new rr.ERR_INVALID_ARG_TYPE(g,"number",v)}function Nn(v,g,x){throw Math.floor(v)!==v?(un(v,x),new rr.ERR_OUT_OF_RANGE("offset","an integer",v)):g<0?new rr.ERR_BUFFER_OUT_OF_BOUNDS:new rr.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${g}`,v)}const ss=/[^+/0-9A-Za-z-_]/g;function cc(v){if(v=v.split("=")[0],v=v.trim().replace(ss,""),v.length<2)return"";for(;v.length%4!==0;)v=v+"=";return v}function os(v,g){g=g||1/0;let x;const C=v.length;let V=null;const q=[];for(let ee=0;ee<C;++ee){if(x=v.charCodeAt(ee),x>55295&&x<57344){if(!V){if(x>56319){(g-=3)>-1&&q.push(239,191,189);continue}else if(ee+1===C){(g-=3)>-1&&q.push(239,191,189);continue}V=x;continue}if(x<56320){(g-=3)>-1&&q.push(239,191,189),V=x;continue}x=(V-55296<<10|x-56320)+65536}else V&&(g-=3)>-1&&q.push(239,191,189);if(V=null,x<128){if((g-=1)<0)break;q.push(x)}else if(x<2048){if((g-=2)<0)break;q.push(x>>6|192,x&63|128)}else if(x<65536){if((g-=3)<0)break;q.push(x>>12|224,x>>6&63|128,x&63|128)}else if(x<1114112){if((g-=4)<0)break;q.push(x>>18|240,x>>12&63|128,x>>6&63|128,x&63|128)}else throw new Error("Invalid code point")}return q}function as(v){const g=[];for(let x=0;x<v.length;++x)g.push(v.charCodeAt(x)&255);return g}function Eo(v,g){let x,C,V;const q=[];for(let ee=0;ee<v.length&&!((g-=2)<0);++ee)x=v.charCodeAt(ee),C=x>>8,V=x%256,q.push(V),q.push(C);return q}function cs(v){return I.toByteArray(cc(v))}function Cn(v,g,x,C){let V;for(V=0;V<C&&!(V+x>=g.length||V>=v.length);++V)g[V+x]=v[V];return V}function ur(v,g){return v instanceof g||v!=null&&v.constructor!=null&&v.constructor.name!=null&&v.constructor.name===g.name}function us(v){return v!==v}const uc=(function(){const v="0123456789abcdef",g=new Array(256);for(let x=0;x<16;++x){const C=x*16;for(let V=0;V<16;++V)g[C+V]=v[x]+v[V]}return g})();function Nr(v){return typeof BigInt>"u"?lc:v}function lc(){throw new Error("BigInt not supported")}})(e);const A=e.Buffer;t.Blob=e.Blob,t.BlobOptions=e.BlobOptions,t.Buffer=e.Buffer,t.File=e.File,t.FileOptions=e.FileOptions,t.INSPECT_MAX_BYTES=e.INSPECT_MAX_BYTES,t.SlowBuffer=e.SlowBuffer,t.TranscodeEncoding=e.TranscodeEncoding,t.atob=e.atob,t.btoa=e.btoa,t.constants=e.constants,t.default=A,t.isAscii=e.isAscii,t.isUtf8=e.isUtf8,t.kMaxLength=e.kMaxLength,t.kStringMaxLength=e.kStringMaxLength,t.resolveObjectURL=e.resolveObjectURL,t.transcode=e.transcode})(Cu)),Cu}var _u={},Du={},Fu,cp;function rb(){return cp||(cp=1,Fu=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var o 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 a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(e,r);if(u.value!==i||u.enumerable!==!0)return!1}return!0}),Fu}var Uu,up;function Ma(){if(up)return Uu;up=1;var t=rb();return Uu=function(){return t()&&!!Symbol.toStringTag},Uu}var Lu,lp;function nb(){return lp||(lp=1,Lu=Object),Lu}var Mu,fp;function B9(){return fp||(fp=1,Mu=Error),Mu}var zu,hp;function S9(){return hp||(hp=1,zu=EvalError),zu}var Vu,dp;function O9(){return dp||(dp=1,Vu=RangeError),Vu}var Gu,pp;function P9(){return pp||(pp=1,Gu=ReferenceError),Gu}var $u,mp;function ib(){return mp||(mp=1,$u=SyntaxError),$u}var ju,gp;function so(){return gp||(gp=1,ju=TypeError),ju}var Hu,yp;function I9(){return yp||(yp=1,Hu=URIError),Hu}var qu,bp;function k9(){return bp||(bp=1,qu=Math.abs),qu}var Zu,xp;function N9(){return xp||(xp=1,Zu=Math.floor),Zu}var Ku,wp;function C9(){return wp||(wp=1,Ku=Math.max),Ku}var Wu,Ap;function _9(){return Ap||(Ap=1,Wu=Math.min),Wu}var Ju,Ep;function D9(){return Ep||(Ep=1,Ju=Math.pow),Ju}var Qu,vp;function F9(){return vp||(vp=1,Qu=Math.round),Qu}var Yu,Rp;function U9(){return Rp||(Rp=1,Yu=Number.isNaN||function(e){return e!==e}),Yu}var Xu,Tp;function L9(){if(Tp)return Xu;Tp=1;var t=U9();return Xu=function(r){return t(r)||r===0?r:r<0?-1:1},Xu}var el,Bp;function M9(){return Bp||(Bp=1,el=Object.getOwnPropertyDescriptor),el}var tl,Sp;function Ji(){if(Sp)return tl;Sp=1;var t=M9();if(t)try{t([],"length")}catch{t=null}return tl=t,tl}var rl,Op;function za(){if(Op)return rl;Op=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return rl=t,rl}var nl,Pp;function z9(){if(Pp)return nl;Pp=1;var t=typeof Symbol<"u"&&Symbol,e=rb();return nl=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},nl}var il,Ip;function sb(){return Ip||(Ip=1,il=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),il}var sl,kp;function ob(){if(kp)return sl;kp=1;var t=nb();return sl=t.getPrototypeOf||null,sl}var ol,Np;function V9(){if(Np)return ol;Np=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(l,h){for(var d=[],m=0;m<l.length;m+=1)d[m]=l[m];for(var y=0;y<h.length;y+=1)d[y+l.length]=h[y];return d},o=function(l,h){for(var d=[],m=h,y=0;m<l.length;m+=1,y+=1)d[y]=l[m];return d},a=function(u,l){for(var h="",d=0;d<u.length;d+=1)h+=u[d],d+1<u.length&&(h+=l);return h};return ol=function(l){var h=this;if(typeof h!="function"||e.apply(h)!==n)throw new TypeError(t+h);for(var d=o(arguments,1),m,y=function(){if(this instanceof m){var A=h.apply(this,i(d,arguments));return Object(A)===A?A:this}return h.apply(l,i(d,arguments))},w=r(0,h.length-d.length),T=[],E=0;E<w;E++)T[E]="$"+E;if(m=Function("binder","return function ("+a(T,",")+"){ return binder.apply(this,arguments); }")(y),h.prototype){var B=function(){};B.prototype=h.prototype,m.prototype=new B,B.prototype=null}return m},ol}var al,Cp;function oo(){if(Cp)return al;Cp=1;var t=V9();return al=Function.prototype.bind||t,al}var cl,_p;function xh(){return _p||(_p=1,cl=Function.prototype.call),cl}var ul,Dp;function wh(){return Dp||(Dp=1,ul=Function.prototype.apply),ul}var ll,Fp;function G9(){return Fp||(Fp=1,ll=typeof Reflect<"u"&&Reflect&&Reflect.apply),ll}var fl,Up;function ab(){if(Up)return fl;Up=1;var t=oo(),e=wh(),r=xh(),n=G9();return fl=n||t.call(r,e),fl}var hl,Lp;function Ah(){if(Lp)return hl;Lp=1;var t=oo(),e=so(),r=xh(),n=ab();return hl=function(o){if(o.length<1||typeof o[0]!="function")throw new e("a function is required");return n(t,r,o)},hl}var dl,Mp;function $9(){if(Mp)return dl;Mp=1;var t=Ah(),e=Ji(),r;try{r=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var n=!!r&&e&&e(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return dl=n&&typeof n.get=="function"?t([n.get]):typeof o=="function"?function(u){return o(u==null?u:i(u))}:!1,dl}var pl,zp;function Eh(){if(zp)return pl;zp=1;var t=sb(),e=ob(),r=$9();return pl=t?function(i){return t(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:r?function(i){return r(i)}:null,pl}var ml,Vp;function cb(){if(Vp)return ml;Vp=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=oo();return ml=r.call(t,e),ml}var gl,Gp;function ub(){if(Gp)return gl;Gp=1;var t,e=nb(),r=B9(),n=S9(),i=O9(),o=P9(),a=ib(),u=so(),l=I9(),h=k9(),d=N9(),m=C9(),y=_9(),w=D9(),T=F9(),E=L9(),B=Function,A=function(ie){try{return B('"use strict"; return ('+ie+").constructor;")()}catch{}},P=Ji(),I=za(),S=function(){throw new u},N=P?(function(){try{return arguments.callee,S}catch{try{return P(arguments,"callee").get}catch{return S}}})():S,_=z9()(),F=Eh(),U=ob(),H=sb(),K=wh(),le=xh(),L={},me=typeof Uint8Array>"u"||!F?t:F(Uint8Array),Be={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":_&&F?F([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":L,"%AsyncGenerator%":L,"%AsyncGeneratorFunction%":L,"%AsyncIteratorPrototype%":L,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":B,"%GeneratorFunction%":L,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_&&F?F(F([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!_||!F?t:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":P,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!_||!F?t:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_&&F?F(""[Symbol.iterator]()):t,"%Symbol%":_?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":N,"%TypedArray%":me,"%TypeError%":u,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":le,"%Function.prototype.apply%":K,"%Object.defineProperty%":I,"%Object.getPrototypeOf%":U,"%Math.abs%":h,"%Math.floor%":d,"%Math.max%":m,"%Math.min%":y,"%Math.pow%":w,"%Math.round%":T,"%Math.sign%":E,"%Reflect.getPrototypeOf%":H};if(F)try{null.error}catch(ie){var re=F(F(ie));Be["%Error.prototype%"]=re}var ue=function ie(oe){var O;if(oe==="%AsyncFunction%")O=A("async function () {}");else if(oe==="%GeneratorFunction%")O=A("function* () {}");else if(oe==="%AsyncGeneratorFunction%")O=A("async function* () {}");else if(oe==="%AsyncGenerator%"){var k=ie("%AsyncGeneratorFunction%");k&&(O=k.prototype)}else if(oe==="%AsyncIteratorPrototype%"){var Z=ie("%AsyncGenerator%");Z&&F&&(O=F(Z.prototype))}return Be[oe]=O,O},ye={__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"]},Ae=oo(),Ee=cb(),Se=Ae.call(le,Array.prototype.concat),Le=Ae.call(K,Array.prototype.splice),_e=Ae.call(le,String.prototype.replace),j=Ae.call(le,String.prototype.slice),W=Ae.call(le,RegExp.prototype.exec),se=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,z=function(oe){var O=j(oe,0,1),k=j(oe,-1);if(O==="%"&&k!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(k==="%"&&O!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var Z=[];return _e(oe,se,function(fe,Pe,xe,De){Z[Z.length]=xe?_e(De,M,"$1"):Pe||fe}),Z},Q=function(oe,O){var k=oe,Z;if(Ee(ye,k)&&(Z=ye[k],k="%"+Z[0]+"%"),Ee(Be,k)){var fe=Be[k];if(fe===L&&(fe=ue(k)),typeof fe>"u"&&!O)throw new u("intrinsic "+oe+" exists, but is not available. Please file an issue!");return{alias:Z,name:k,value:fe}}throw new a("intrinsic "+oe+" does not exist!")};return gl=function(oe,O){if(typeof oe!="string"||oe.length===0)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof O!="boolean")throw new u('"allowMissing" argument must be a boolean');if(W(/^%?[^%]*%?$/,oe)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var k=z(oe),Z=k.length>0?k[0]:"",fe=Q("%"+Z+"%",O),Pe=fe.name,xe=fe.value,De=!1,Ut=fe.alias;Ut&&(Z=Ut[0],Le(k,Se([0,1],Ut)));for(var X=1,xt=!0;X<k.length;X+=1){var wt=k[X],qe=j(wt,0,1),st=j(wt,-1);if((qe==='"'||qe==="'"||qe==="`"||st==='"'||st==="'"||st==="`")&&qe!==st)throw new a("property names with quotes must have matching quotes");if((wt==="constructor"||!xt)&&(De=!0),Z+="."+wt,Pe="%"+Z+"%",Ee(Be,Pe))xe=Be[Pe];else if(xe!=null){if(!(wt in xe)){if(!O)throw new u("base intrinsic for "+oe+" exists, but the property is not available.");return}if(P&&X+1>=k.length){var jt=P(xe,wt);xt=!!jt,xt&&"get"in jt&&!("originalValue"in jt.get)?xe=jt.get:xe=xe[wt]}else xt=Ee(xe,wt),xe=xe[wt];xt&&!De&&(Be[Pe]=xe)}}return xe},gl}var yl,$p;function ao(){if($p)return yl;$p=1;var t=ub(),e=Ah(),r=e([t("%String.prototype.indexOf%")]);return yl=function(i,o){var a=t(i,!!o);return typeof a=="function"&&r(i,".prototype.")>-1?e([a]):a},yl}var bl,jp;function j9(){if(jp)return bl;jp=1;var t=Ma()(),e=ao(),r=e("Object.prototype.toString"),n=function(u){return t&&u&&typeof u=="object"&&Symbol.toStringTag in u?!1:r(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&&r(u)!=="[object Array]"&&"callee"in u&&r(u.callee)==="[object Function]"},o=(function(){return n(arguments)})();return n.isLegacyArguments=i,bl=o?n:i,bl}var xl,Hp;function H9(){if(Hp)return xl;Hp=1;var t=ao(),e=Ma()(),r=cb(),n=Ji(),i;if(e){var o=t("RegExp.prototype.exec"),a={},u=function(){throw a},l={toString:u,valueOf:u};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=u),i=function(y){if(!y||typeof y!="object")return!1;var w=n(y,"lastIndex"),T=w&&r(w,"value");if(!T)return!1;try{o(y,l)}catch(E){return E===a}}}else{var h=t("Object.prototype.toString"),d="[object RegExp]";i=function(y){return!y||typeof y!="object"&&typeof y!="function"?!1:h(y)===d}}return xl=i,xl}var wl,qp;function q9(){if(qp)return wl;qp=1;var t=ao(),e=H9(),r=t("RegExp.prototype.exec"),n=so();return wl=function(o){if(!e(o))throw new n("`regex` must be a RegExp");return function(u){return r(o,u)!==null}},wl}var Al,Zp;function Z9(){if(Zp)return Al;Zp=1;const t=(function*(){}).constructor;return Al=()=>t,Al}var El,Kp;function K9(){if(Kp)return El;Kp=1;var t=ao(),e=q9(),r=e(/^\s*(?:function)?\*/),n=Ma()(),i=Eh(),o=t("Object.prototype.toString"),a=t("Function.prototype.toString"),u=Z9();return El=function(h){if(typeof h!="function")return!1;if(r(a(h)))return!0;if(!n){var d=o(h);return d==="[object GeneratorFunction]"}if(!i)return!1;var m=u();return m&&i(h)===m.prototype},El}var vl,Wp;function W9(){if(Wp)return vl;Wp=1;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},e(function(){throw 42},null,r)}catch(P){P!==n&&(e=null)}else e=null;var i=/^\s*class\b/,o=function(I){try{var S=t.call(I);return i.test(S)}catch{return!1}},a=function(I){try{return o(I)?!1:(t.call(I),!0)}catch{return!1}},u=Object.prototype.toString,l="[object Object]",h="[object Function]",d="[object GeneratorFunction]",m="[object HTMLAllCollection]",y="[object HTML document.all class]",w="[object HTMLCollection]",T=typeof Symbol=="function"&&!!Symbol.toStringTag,E=!(0 in[,]),B=function(){return!1};if(typeof document=="object"){var A=document.all;u.call(A)===u.call(document.all)&&(B=function(I){if((E||!I)&&(typeof I>"u"||typeof I=="object"))try{var S=u.call(I);return(S===m||S===y||S===w||S===l)&&I("")==null}catch{}return!1})}return vl=e?function(I){if(B(I))return!0;if(!I||typeof I!="function"&&typeof I!="object")return!1;try{e(I,null,r)}catch(S){if(S!==n)return!1}return!o(I)&&a(I)}:function(I){if(B(I))return!0;if(!I||typeof I!="function"&&typeof I!="object")return!1;if(T)return a(I);if(o(I))return!1;var S=u.call(I);return S!==h&&S!==d&&!/^\[object HTML/.test(S)?!1:a(I)},vl}var Rl,Jp;function J9(){if(Jp)return Rl;Jp=1;var t=W9(),e=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(l,h,d){for(var m=0,y=l.length;m<y;m++)r.call(l,m)&&(d==null?h(l[m],m,l):h.call(d,l[m],m,l))},i=function(l,h,d){for(var m=0,y=l.length;m<y;m++)d==null?h(l.charAt(m),m,l):h.call(d,l.charAt(m),m,l)},o=function(l,h,d){for(var m in l)r.call(l,m)&&(d==null?h(l[m],m,l):h.call(d,l[m],m,l))};function a(u){return e.call(u)==="[object Array]"}return Rl=function(l,h,d){if(!t(h))throw new TypeError("iterator must be a function");var m;arguments.length>=3&&(m=d),a(l)?n(l,h,m):typeof l=="string"?i(l,h,m):o(l,h,m)},Rl}var Tl,Qp;function Q9(){return Qp||(Qp=1,Tl=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Tl}var Bl,Yp;function Y9(){if(Yp)return Bl;Yp=1;var t=Q9(),e=typeof globalThis>"u"?Ir:globalThis;return Bl=function(){for(var n=[],i=0;i<t.length;i++)typeof e[t[i]]=="function"&&(n[n.length]=t[i]);return n},Bl}var Sl={exports:{}},Ol,Xp;function X9(){if(Xp)return Ol;Xp=1;var t=za(),e=ib(),r=so(),n=Ji();return Ol=function(o,a,u){if(!o||typeof o!="object"&&typeof o!="function")throw new r("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,h=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,m=arguments.length>6?arguments[6]:!1,y=!!n&&n(o,a);if(t)t(o,a,{configurable:d===null&&y?y.configurable:!d,enumerable:l===null&&y?y.enumerable:!l,value:u,writable:h===null&&y?y.writable:!h});else if(m||!l&&!h&&!d)o[a]=u;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Ol}var Pl,em;function e7(){if(em)return Pl;em=1;var t=za(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Pl=e,Pl}var Il,tm;function t7(){if(tm)return Il;tm=1;var t=ub(),e=X9(),r=e7()(),n=Ji(),i=so(),o=t("%Math.floor%");return Il=function(u,l){if(typeof u!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new i("`length` must be a positive 32-bit integer");var h=arguments.length>2&&!!arguments[2],d=!0,m=!0;if("length"in u&&n){var y=n(u,"length");y&&!y.configurable&&(d=!1),y&&!y.writable&&(m=!1)}return(d||m||!h)&&(r?e(u,"length",l,!0,!0):e(u,"length",l)),u},Il}var kl,rm;function r7(){if(rm)return kl;rm=1;var t=oo(),e=wh(),r=ab();return kl=function(){return r(t,e,arguments)},kl}var nm;function n7(){return nm||(nm=1,(function(t){var e=t7(),r=za(),n=Ah(),i=r7();t.exports=function(a){var u=n(arguments),l=a.length-(arguments.length-1);return e(u,1+(l>0?l:0),!0)},r?r(t.exports,"apply",{value:i}):t.exports.apply=i})(Sl)),Sl.exports}var Nl,im;function lb(){if(im)return Nl;im=1;var t=J9(),e=Y9(),r=n7(),n=ao(),i=Ji(),o=Eh(),a=n("Object.prototype.toString"),u=Ma()(),l=typeof globalThis>"u"?Ir:globalThis,h=e(),d=n("String.prototype.slice"),m=n("Array.prototype.indexOf",!0)||function(B,A){for(var P=0;P<B.length;P+=1)if(B[P]===A)return P;return-1},y={__proto__:null};u&&i&&o?t(h,function(E){var B=new l[E];if(Symbol.toStringTag in B&&o){var A=o(B),P=i(A,Symbol.toStringTag);if(!P&&A){var I=o(A);P=i(I,Symbol.toStringTag)}if(P&&P.get){var S=r(P.get);y["$"+E]=S}}}):t(h,function(E){var B=new l[E],A=B.slice||B.set;if(A){var P=r(A);y["$"+E]=P}});var w=function(B){var A=!1;return t(y,function(P,I){if(!A)try{"$"+P(B)===I&&(A=d(I,1))}catch{}}),A},T=function(B){var A=!1;return t(y,function(P,I){if(!A)try{P(B),A=d(I,1)}catch{}}),A};return Nl=function(B){if(!B||typeof B!="object")return!1;if(!u){var A=d(a(B),8,-1);return m(h,A)>-1?A:A!=="Object"?!1:T(B)}return i?w(B):null},Nl}var Cl,sm;function i7(){if(sm)return Cl;sm=1;var t=lb();return Cl=function(r){return!!t(r)},Cl}var om;function s7(){return om||(om=1,(function(t){var e=j9(),r=K9(),n=lb(),i=i7();function o(X){return X.call.bind(X)}var a=typeof BigInt<"u",u=typeof Symbol<"u",l=o(Object.prototype.toString),h=o(Number.prototype.valueOf),d=o(String.prototype.valueOf),m=o(Boolean.prototype.valueOf);if(a)var y=o(BigInt.prototype.valueOf);if(u)var w=o(Symbol.prototype.valueOf);function T(X,xt){if(typeof X!="object")return!1;try{return xt(X),!0}catch{return!1}}t.isArgumentsObject=e,t.isGeneratorFunction=r,t.isTypedArray=i;function E(X){return typeof Promise<"u"&&X instanceof Promise||X!==null&&typeof X=="object"&&typeof X.then=="function"&&typeof X.catch=="function"}t.isPromise=E;function B(X){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(X):i(X)||j(X)}t.isArrayBufferView=B;function A(X){return n(X)==="Uint8Array"}t.isUint8Array=A;function P(X){return n(X)==="Uint8ClampedArray"}t.isUint8ClampedArray=P;function I(X){return n(X)==="Uint16Array"}t.isUint16Array=I;function S(X){return n(X)==="Uint32Array"}t.isUint32Array=S;function N(X){return n(X)==="Int8Array"}t.isInt8Array=N;function _(X){return n(X)==="Int16Array"}t.isInt16Array=_;function F(X){return n(X)==="Int32Array"}t.isInt32Array=F;function U(X){return n(X)==="Float32Array"}t.isFloat32Array=U;function H(X){return n(X)==="Float64Array"}t.isFloat64Array=H;function K(X){return n(X)==="BigInt64Array"}t.isBigInt64Array=K;function le(X){return n(X)==="BigUint64Array"}t.isBigUint64Array=le;function L(X){return l(X)==="[object Map]"}L.working=typeof Map<"u"&&L(new Map);function me(X){return typeof Map>"u"?!1:L.working?L(X):X instanceof Map}t.isMap=me;function Be(X){return l(X)==="[object Set]"}Be.working=typeof Set<"u"&&Be(new Set);function re(X){return typeof Set>"u"?!1:Be.working?Be(X):X instanceof Set}t.isSet=re;function ue(X){return l(X)==="[object WeakMap]"}ue.working=typeof WeakMap<"u"&&ue(new WeakMap);function ye(X){return typeof WeakMap>"u"?!1:ue.working?ue(X):X instanceof WeakMap}t.isWeakMap=ye;function Ae(X){return l(X)==="[object WeakSet]"}Ae.working=typeof WeakSet<"u"&&Ae(new WeakSet);function Ee(X){return Ae(X)}t.isWeakSet=Ee;function Se(X){return l(X)==="[object ArrayBuffer]"}Se.working=typeof ArrayBuffer<"u"&&Se(new ArrayBuffer);function Le(X){return typeof ArrayBuffer>"u"?!1:Se.working?Se(X):X instanceof ArrayBuffer}t.isArrayBuffer=Le;function _e(X){return l(X)==="[object DataView]"}_e.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&_e(new DataView(new ArrayBuffer(1),0,1));function j(X){return typeof DataView>"u"?!1:_e.working?_e(X):X instanceof DataView}t.isDataView=j;var W=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function se(X){return l(X)==="[object SharedArrayBuffer]"}function M(X){return typeof W>"u"?!1:(typeof se.working>"u"&&(se.working=se(new W)),se.working?se(X):X instanceof W)}t.isSharedArrayBuffer=M;function z(X){return l(X)==="[object AsyncFunction]"}t.isAsyncFunction=z;function Q(X){return l(X)==="[object Map Iterator]"}t.isMapIterator=Q;function ie(X){return l(X)==="[object Set Iterator]"}t.isSetIterator=ie;function oe(X){return l(X)==="[object Generator]"}t.isGeneratorObject=oe;function O(X){return l(X)==="[object WebAssembly.Module]"}t.isWebAssemblyCompiledModule=O;function k(X){return T(X,h)}t.isNumberObject=k;function Z(X){return T(X,d)}t.isStringObject=Z;function fe(X){return T(X,m)}t.isBooleanObject=fe;function Pe(X){return a&&T(X,y)}t.isBigIntObject=Pe;function xe(X){return u&&T(X,w)}t.isSymbolObject=xe;function De(X){return k(X)||Z(X)||fe(X)||Pe(X)||xe(X)}t.isBoxedPrimitive=De;function Ut(X){return typeof Uint8Array<"u"&&(Le(X)||M(X))}t.isAnyArrayBuffer=Ut,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(X){Object.defineProperty(t,X,{enumerable:!1,value:function(){throw new Error(X+" is not supported in userland")}})})})(Du)),Du}var _l,am;function o7(){return am||(am=1,_l=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),_l}var cm;function fb(){return cm||(cm=1,(function(t){var e={},r=Object.getOwnPropertyDescriptors||function(W){for(var se=Object.keys(W),M={},z=0;z<se.length;z++)M[se[z]]=Object.getOwnPropertyDescriptor(W,se[z]);return M},n=/%[sdj%]/g;t.format=function(j){if(!_(j)){for(var W=[],se=0;se<arguments.length;se++)W.push(u(arguments[se]));return W.join(" ")}for(var se=1,M=arguments,z=M.length,Q=String(j).replace(n,function(oe){if(oe==="%%")return"%";if(se>=z)return oe;switch(oe){case"%s":return String(M[se++]);case"%d":return Number(M[se++]);case"%j":try{return JSON.stringify(M[se++])}catch{return"[Circular]"}default:return oe}}),ie=M[se];se<z;ie=M[++se])I(ie)||!K(ie)?Q+=" "+ie:Q+=" "+u(ie);return Q},t.deprecate=function(j,W){if(typeof Ce<"u"&&Ce.noDeprecation===!0)return j;if(typeof Ce>"u")return function(){return t.deprecate(j,W).apply(this,arguments)};var se=!1;function M(){if(!se){if(Ce.throwDeprecation)throw new Error(W);Ce.traceDeprecation?console.trace(W):console.error(W),se=!0}return j.apply(this,arguments)}return M};var i={},o=/^$/;if(e.NODE_DEBUG){var a=e.NODE_DEBUG;a=a.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+a+"$","i")}t.debuglog=function(j){if(j=j.toUpperCase(),!i[j])if(o.test(j)){var W=Ce.pid;i[j]=function(){var se=t.format.apply(t,arguments);console.error("%s %d: %s",j,W,se)}}else i[j]=function(){};return i[j]};function u(j,W){var se={seen:[],stylize:h};return arguments.length>=3&&(se.depth=arguments[2]),arguments.length>=4&&(se.colors=arguments[3]),P(W)?se.showHidden=W:W&&t._extend(se,W),U(se.showHidden)&&(se.showHidden=!1),U(se.depth)&&(se.depth=2),U(se.colors)&&(se.colors=!1),U(se.customInspect)&&(se.customInspect=!0),se.colors&&(se.stylize=l),m(se,j,se.depth)}t.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(j,W){var se=u.styles[W];return se?"\x1B["+u.colors[se][0]+"m"+j+"\x1B["+u.colors[se][1]+"m":j}function h(j,W){return j}function d(j){var W={};return j.forEach(function(se,M){W[se]=!0}),W}function m(j,W,se){if(j.customInspect&&W&&me(W.inspect)&&W.inspect!==t.inspect&&!(W.constructor&&W.constructor.prototype===W)){var M=W.inspect(se,j);return _(M)||(M=m(j,M,se)),M}var z=y(j,W);if(z)return z;var Q=Object.keys(W),ie=d(Q);if(j.showHidden&&(Q=Object.getOwnPropertyNames(W)),L(W)&&(Q.indexOf("message")>=0||Q.indexOf("description")>=0))return w(W);if(Q.length===0){if(me(W)){var oe=W.name?": "+W.name:"";return j.stylize("[Function"+oe+"]","special")}if(H(W))return j.stylize(RegExp.prototype.toString.call(W),"regexp");if(le(W))return j.stylize(Date.prototype.toString.call(W),"date");if(L(W))return w(W)}var O="",k=!1,Z=["{","}"];if(A(W)&&(k=!0,Z=["[","]"]),me(W)){var fe=W.name?": "+W.name:"";O=" [Function"+fe+"]"}if(H(W)&&(O=" "+RegExp.prototype.toString.call(W)),le(W)&&(O=" "+Date.prototype.toUTCString.call(W)),L(W)&&(O=" "+w(W)),Q.length===0&&(!k||W.length==0))return Z[0]+O+Z[1];if(se<0)return H(W)?j.stylize(RegExp.prototype.toString.call(W),"regexp"):j.stylize("[Object]","special");j.seen.push(W);var Pe;return k?Pe=T(j,W,se,ie,Q):Pe=Q.map(function(xe){return E(j,W,se,ie,xe,k)}),j.seen.pop(),B(Pe,O,Z)}function y(j,W){if(U(W))return j.stylize("undefined","undefined");if(_(W)){var se="'"+JSON.stringify(W).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return j.stylize(se,"string")}if(N(W))return j.stylize(""+W,"number");if(P(W))return j.stylize(""+W,"boolean");if(I(W))return j.stylize("null","null")}function w(j){return"["+Error.prototype.toString.call(j)+"]"}function T(j,W,se,M,z){for(var Q=[],ie=0,oe=W.length;ie<oe;++ie)Ee(W,String(ie))?Q.push(E(j,W,se,M,String(ie),!0)):Q.push("");return z.forEach(function(O){O.match(/^\d+$/)||Q.push(E(j,W,se,M,O,!0))}),Q}function E(j,W,se,M,z,Q){var ie,oe,O;if(O=Object.getOwnPropertyDescriptor(W,z)||{value:W[z]},O.get?O.set?oe=j.stylize("[Getter/Setter]","special"):oe=j.stylize("[Getter]","special"):O.set&&(oe=j.stylize("[Setter]","special")),Ee(M,z)||(ie="["+z+"]"),oe||(j.seen.indexOf(O.value)<0?(I(se)?oe=m(j,O.value,null):oe=m(j,O.value,se-1),oe.indexOf(`
76
+ `)>-1&&(Q?oe=oe.split(`
77
+ `).map(function(k){return" "+k}).join(`
78
+ `).slice(2):oe=`
79
+ `+oe.split(`
80
+ `).map(function(k){return" "+k}).join(`
81
+ `))):oe=j.stylize("[Circular]","special")),U(ie)){if(Q&&z.match(/^\d+$/))return oe;ie=JSON.stringify(""+z),ie.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ie=ie.slice(1,-1),ie=j.stylize(ie,"name")):(ie=ie.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ie=j.stylize(ie,"string"))}return ie+": "+oe}function B(j,W,se){var M=j.reduce(function(z,Q){return Q.indexOf(`
82
+ `)>=0,z+Q.replace(/\u001b\[\d\d?m/g,"").length+1},0);return M>60?se[0]+(W===""?"":W+`
83
+ `)+" "+j.join(`,
84
+ `)+" "+se[1]:se[0]+W+" "+j.join(", ")+" "+se[1]}t.types=s7();function A(j){return Array.isArray(j)}t.isArray=A;function P(j){return typeof j=="boolean"}t.isBoolean=P;function I(j){return j===null}t.isNull=I;function S(j){return j==null}t.isNullOrUndefined=S;function N(j){return typeof j=="number"}t.isNumber=N;function _(j){return typeof j=="string"}t.isString=_;function F(j){return typeof j=="symbol"}t.isSymbol=F;function U(j){return j===void 0}t.isUndefined=U;function H(j){return K(j)&&re(j)==="[object RegExp]"}t.isRegExp=H,t.types.isRegExp=H;function K(j){return typeof j=="object"&&j!==null}t.isObject=K;function le(j){return K(j)&&re(j)==="[object Date]"}t.isDate=le,t.types.isDate=le;function L(j){return K(j)&&(re(j)==="[object Error]"||j instanceof Error)}t.isError=L,t.types.isNativeError=L;function me(j){return typeof j=="function"}t.isFunction=me;function Be(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}t.isPrimitive=Be,t.isBuffer=o7();function re(j){return Object.prototype.toString.call(j)}function ue(j){return j<10?"0"+j.toString(10):j.toString(10)}var ye=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ae(){var j=new Date,W=[ue(j.getHours()),ue(j.getMinutes()),ue(j.getSeconds())].join(":");return[j.getDate(),ye[j.getMonth()],W].join(" ")}t.log=function(){console.log("%s - %s",Ae(),t.format.apply(t,arguments))},t.inherits=si(),t._extend=function(j,W){if(!W||!K(W))return j;for(var se=Object.keys(W),M=se.length;M--;)j[se[M]]=W[se[M]];return j};function Ee(j,W){return Object.prototype.hasOwnProperty.call(j,W)}var Se=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;t.promisify=function(W){if(typeof W!="function")throw new TypeError('The "original" argument must be of type Function');if(Se&&W[Se]){var se=W[Se];if(typeof se!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(se,Se,{value:se,enumerable:!1,writable:!1,configurable:!0}),se}function se(){for(var M,z,Q=new Promise(function(O,k){M=O,z=k}),ie=[],oe=0;oe<arguments.length;oe++)ie.push(arguments[oe]);ie.push(function(O,k){O?z(O):M(k)});try{W.apply(this,ie)}catch(O){z(O)}return Q}return Object.setPrototypeOf(se,Object.getPrototypeOf(W)),Se&&Object.defineProperty(se,Se,{value:se,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(se,r(W))},t.promisify.custom=Se;function Le(j,W){if(!j){var se=new Error("Promise was rejected with a falsy value");se.reason=j,j=se}return W(j)}function _e(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');function W(){for(var se=[],M=0;M<arguments.length;M++)se.push(arguments[M]);var z=se.pop();if(typeof z!="function")throw new TypeError("The last argument must be of type Function");var Q=this,ie=function(){return z.apply(Q,arguments)};j.apply(this,se).then(function(oe){Ce.nextTick(ie.bind(null,null,oe))},function(oe){Ce.nextTick(Le.bind(null,oe,ie))})}return Object.setPrototypeOf(W,Object.getPrototypeOf(j)),Object.defineProperties(W,r(j)),W}t.callbackify=_e})(_u)),_u}var Dl,um;function a7(){if(um)return Dl;um=1;function t(T,E){var B=Object.keys(T);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(T);E&&(A=A.filter(function(P){return Object.getOwnPropertyDescriptor(T,P).enumerable})),B.push.apply(B,A)}return B}function e(T){for(var E=1;E<arguments.length;E++){var B=arguments[E]!=null?arguments[E]:{};E%2?t(Object(B),!0).forEach(function(A){r(T,A,B[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(B)):t(Object(B)).forEach(function(A){Object.defineProperty(T,A,Object.getOwnPropertyDescriptor(B,A))})}return T}function r(T,E,B){return E=a(E),E in T?Object.defineProperty(T,E,{value:B,enumerable:!0,configurable:!0,writable:!0}):T[E]=B,T}function n(T,E){if(!(T instanceof E))throw new TypeError("Cannot call a class as a function")}function i(T,E){for(var B=0;B<E.length;B++){var A=E[B];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(T,a(A.key),A)}}function o(T,E,B){return E&&i(T.prototype,E),Object.defineProperty(T,"prototype",{writable:!1}),T}function a(T){var E=u(T,"string");return typeof E=="symbol"?E:String(E)}function u(T,E){if(typeof T!="object"||T===null)return T;var B=T[Symbol.toPrimitive];if(B!==void 0){var A=B.call(T,E);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(T)}var l=La(),h=l.Buffer,d=fb(),m=d.inspect,y=m&&m.custom||"inspect";function w(T,E,B){h.prototype.copy.call(T,E,B)}return Dl=(function(){function T(){n(this,T),this.head=null,this.tail=null,this.length=0}return o(T,[{key:"push",value:function(B){var A={data:B,next:null};this.length>0?this.tail.next=A:this.head=A,this.tail=A,++this.length}},{key:"unshift",value:function(B){var A={data:B,next:this.head};this.length===0&&(this.tail=A),this.head=A,++this.length}},{key:"shift",value:function(){if(this.length!==0){var B=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,B}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(B){if(this.length===0)return"";for(var A=this.head,P=""+A.data;A=A.next;)P+=B+A.data;return P}},{key:"concat",value:function(B){if(this.length===0)return h.alloc(0);for(var A=h.allocUnsafe(B>>>0),P=this.head,I=0;P;)w(P.data,A,I),I+=P.data.length,P=P.next;return A}},{key:"consume",value:function(B,A){var P;return B<this.head.data.length?(P=this.head.data.slice(0,B),this.head.data=this.head.data.slice(B)):B===this.head.data.length?P=this.shift():P=A?this._getString(B):this._getBuffer(B),P}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(B){var A=this.head,P=1,I=A.data;for(B-=I.length;A=A.next;){var S=A.data,N=B>S.length?S.length:B;if(N===S.length?I+=S:I+=S.slice(0,B),B-=N,B===0){N===S.length?(++P,A.next?this.head=A.next:this.head=this.tail=null):(this.head=A,A.data=S.slice(N));break}++P}return this.length-=P,I}},{key:"_getBuffer",value:function(B){var A=h.allocUnsafe(B),P=this.head,I=1;for(P.data.copy(A),B-=P.data.length;P=P.next;){var S=P.data,N=B>S.length?S.length:B;if(S.copy(A,A.length-B,0,N),B-=N,B===0){N===S.length?(++I,P.next?this.head=P.next:this.head=this.tail=null):(this.head=P,P.data=S.slice(N));break}++I}return this.length-=I,A}},{key:y,value:function(B,A){return m(this,e(e({},A),{},{depth:0,customInspect:!1}))}}]),T})(),Dl}var Fl,lm;function hb(){if(lm)return Fl;lm=1;function t(a,u){var l=this,h=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;return h||d?(u?u(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Ce.nextTick(i,this,a)):Ce.nextTick(i,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(m){!u&&m?l._writableState?l._writableState.errorEmitted?Ce.nextTick(r,l):(l._writableState.errorEmitted=!0,Ce.nextTick(e,l,m)):Ce.nextTick(e,l,m):u?(Ce.nextTick(r,l),u(m)):Ce.nextTick(r,l)}),this)}function e(a,u){i(a,u),r(a)}function r(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.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(a,u){a.emit("error",u)}function o(a,u){var l=a._readableState,h=a._writableState;l&&l.autoDestroy||h&&h.autoDestroy?a.destroy(u):a.emit("error",u)}return Fl={destroy:t,undestroy:n,errorOrDestroy:o},Fl}var Ul={},fm;function Qi(){if(fm)return Ul;fm=1;function t(u,l){u.prototype=Object.create(l.prototype),u.prototype.constructor=u,u.__proto__=l}var e={};function r(u,l,h){h||(h=Error);function d(y,w,T){return typeof l=="string"?l:l(y,w,T)}var m=(function(y){t(w,y);function w(T,E,B){return y.call(this,d(T,E,B))||this}return w})(h);m.prototype.name=h.name,m.prototype.code=u,e[u]=m}function n(u,l){if(Array.isArray(u)){var h=u.length;return u=u.map(function(d){return String(d)}),h>2?"one of ".concat(l," ").concat(u.slice(0,h-1).join(", "),", or ")+u[h-1]:h===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,h){return u.substr(0,l.length)===l}function o(u,l,h){return(h===void 0||h>u.length)&&(h=u.length),u.substring(h-l.length,h)===l}function a(u,l,h){return typeof h!="number"&&(h=0),h+l.length>u.length?!1:u.indexOf(l,h)!==-1}return r("ERR_INVALID_OPT_VALUE",function(u,l){return'The value "'+l+'" is invalid for option "'+u+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(u,l,h){var d;typeof l=="string"&&i(l,"not ")?(d="must not be",l=l.replace(/^not /,"")):d="must be";var m;if(o(u," argument"))m="The ".concat(u," ").concat(d," ").concat(n(l,"type"));else{var y=a(u,".")?"property":"argument";m='The "'.concat(u,'" ').concat(y," ").concat(d," ").concat(n(l,"type"))}return m+=". Received type ".concat(typeof h),m},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(u){return"The "+u+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(u){return"Cannot call "+u+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(u){return"Unknown encoding: "+u},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ul.codes=e,Ul}var Ll,hm;function db(){if(hm)return Ll;hm=1;var t=Qi().codes.ERR_INVALID_OPT_VALUE;function e(n,i,o){return n.highWaterMark!=null?n.highWaterMark:i?n[o]:null}function r(n,i,o,a){var u=e(i,a,o);if(u!=null){if(!(isFinite(u)&&Math.floor(u)===u)||u<0){var l=a?o:"highWaterMark";throw new t(l,u)}return Math.floor(u)}return n.objectMode?16:16*1024}return Ll={getHighWaterMark:r},Ll}var Ml,dm;function c7(){if(dm)return Ml;dm=1,Ml=t;function t(r,n){if(e("noDeprecation"))return r;var i=!1;function o(){if(!i){if(e("throwDeprecation"))throw new Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),i=!0}return r.apply(this,arguments)}return o}function e(r){try{if(!Ir.localStorage)return!1}catch{return!1}var n=Ir.localStorage[r];return n==null?!1:String(n).toLowerCase()==="true"}return Ml}var zl,pm;function pb(){if(pm)return zl;pm=1,zl=U;function t(M){var z=this;this.next=null,this.entry=null,this.finish=function(){se(z,M)}}var e;U.WritableState=_;var r={deprecate:c7()},n=tb(),i=La().Buffer,o=(typeof Ir<"u"?Ir:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(M){return i.from(M)}function u(M){return i.isBuffer(M)||M instanceof o}var l=hb(),h=db(),d=h.getHighWaterMark,m=Qi().codes,y=m.ERR_INVALID_ARG_TYPE,w=m.ERR_METHOD_NOT_IMPLEMENTED,T=m.ERR_MULTIPLE_CALLBACK,E=m.ERR_STREAM_CANNOT_PIPE,B=m.ERR_STREAM_DESTROYED,A=m.ERR_STREAM_NULL_VALUES,P=m.ERR_STREAM_WRITE_AFTER_END,I=m.ERR_UNKNOWN_ENCODING,S=l.errorOrDestroy;si()(U,n);function N(){}function _(M,z,Q){e=e||Li(),M=M||{},typeof Q!="boolean"&&(Q=z instanceof e),this.objectMode=!!M.objectMode,Q&&(this.objectMode=this.objectMode||!!M.writableObjectMode),this.highWaterMark=d(this,M,"writableHighWaterMark",Q),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var ie=M.decodeStrings===!1;this.decodeStrings=!ie,this.defaultEncoding=M.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(oe){ue(z,oe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=M.emitClose!==!1,this.autoDestroy=!!M.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}_.prototype.getBuffer=function(){for(var z=this.bufferedRequest,Q=[];z;)Q.push(z),z=z.next;return Q},(function(){try{Object.defineProperty(_.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var F;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(F=Function.prototype[Symbol.hasInstance],Object.defineProperty(U,Symbol.hasInstance,{value:function(z){return F.call(this,z)?!0:this!==U?!1:z&&z._writableState instanceof _}})):F=function(z){return z instanceof this};function U(M){e=e||Li();var z=this instanceof e;if(!z&&!F.call(U,this))return new U(M);this._writableState=new _(M,this,z),this.writable=!0,M&&(typeof M.write=="function"&&(this._write=M.write),typeof M.writev=="function"&&(this._writev=M.writev),typeof M.destroy=="function"&&(this._destroy=M.destroy),typeof M.final=="function"&&(this._final=M.final)),n.call(this)}U.prototype.pipe=function(){S(this,new E)};function H(M,z){var Q=new P;S(M,Q),Ce.nextTick(z,Q)}function K(M,z,Q,ie){var oe;return Q===null?oe=new A:typeof Q!="string"&&!z.objectMode&&(oe=new y("chunk",["string","Buffer"],Q)),oe?(S(M,oe),Ce.nextTick(ie,oe),!1):!0}U.prototype.write=function(M,z,Q){var ie=this._writableState,oe=!1,O=!ie.objectMode&&u(M);return O&&!i.isBuffer(M)&&(M=a(M)),typeof z=="function"&&(Q=z,z=null),O?z="buffer":z||(z=ie.defaultEncoding),typeof Q!="function"&&(Q=N),ie.ending?H(this,Q):(O||K(this,ie,M,Q))&&(ie.pendingcb++,oe=L(this,ie,O,M,z,Q)),oe},U.prototype.cork=function(){this._writableState.corked++},U.prototype.uncork=function(){var M=this._writableState;M.corked&&(M.corked--,!M.writing&&!M.corked&&!M.bufferProcessing&&M.bufferedRequest&&Ee(this,M))},U.prototype.setDefaultEncoding=function(z){if(typeof z=="string"&&(z=z.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((z+"").toLowerCase())>-1))throw new I(z);return this._writableState.defaultEncoding=z,this},Object.defineProperty(U.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function le(M,z,Q){return!M.objectMode&&M.decodeStrings!==!1&&typeof z=="string"&&(z=i.from(z,Q)),z}Object.defineProperty(U.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function L(M,z,Q,ie,oe,O){if(!Q){var k=le(z,ie,oe);ie!==k&&(Q=!0,oe="buffer",ie=k)}var Z=z.objectMode?1:ie.length;z.length+=Z;var fe=z.length<z.highWaterMark;if(fe||(z.needDrain=!0),z.writing||z.corked){var Pe=z.lastBufferedRequest;z.lastBufferedRequest={chunk:ie,encoding:oe,isBuf:Q,callback:O,next:null},Pe?Pe.next=z.lastBufferedRequest:z.bufferedRequest=z.lastBufferedRequest,z.bufferedRequestCount+=1}else me(M,z,!1,Z,ie,oe,O);return fe}function me(M,z,Q,ie,oe,O,k){z.writelen=ie,z.writecb=k,z.writing=!0,z.sync=!0,z.destroyed?z.onwrite(new B("write")):Q?M._writev(oe,z.onwrite):M._write(oe,O,z.onwrite),z.sync=!1}function Be(M,z,Q,ie,oe){--z.pendingcb,Q?(Ce.nextTick(oe,ie),Ce.nextTick(j,M,z),M._writableState.errorEmitted=!0,S(M,ie)):(oe(ie),M._writableState.errorEmitted=!0,S(M,ie),j(M,z))}function re(M){M.writing=!1,M.writecb=null,M.length-=M.writelen,M.writelen=0}function ue(M,z){var Q=M._writableState,ie=Q.sync,oe=Q.writecb;if(typeof oe!="function")throw new T;if(re(Q),z)Be(M,Q,ie,z,oe);else{var O=Se(Q)||M.destroyed;!O&&!Q.corked&&!Q.bufferProcessing&&Q.bufferedRequest&&Ee(M,Q),ie?Ce.nextTick(ye,M,Q,O,oe):ye(M,Q,O,oe)}}function ye(M,z,Q,ie){Q||Ae(M,z),z.pendingcb--,ie(),j(M,z)}function Ae(M,z){z.length===0&&z.needDrain&&(z.needDrain=!1,M.emit("drain"))}function Ee(M,z){z.bufferProcessing=!0;var Q=z.bufferedRequest;if(M._writev&&Q&&Q.next){var ie=z.bufferedRequestCount,oe=new Array(ie),O=z.corkedRequestsFree;O.entry=Q;for(var k=0,Z=!0;Q;)oe[k]=Q,Q.isBuf||(Z=!1),Q=Q.next,k+=1;oe.allBuffers=Z,me(M,z,!0,z.length,oe,"",O.finish),z.pendingcb++,z.lastBufferedRequest=null,O.next?(z.corkedRequestsFree=O.next,O.next=null):z.corkedRequestsFree=new t(z),z.bufferedRequestCount=0}else{for(;Q;){var fe=Q.chunk,Pe=Q.encoding,xe=Q.callback,De=z.objectMode?1:fe.length;if(me(M,z,!1,De,fe,Pe,xe),Q=Q.next,z.bufferedRequestCount--,z.writing)break}Q===null&&(z.lastBufferedRequest=null)}z.bufferedRequest=Q,z.bufferProcessing=!1}U.prototype._write=function(M,z,Q){Q(new w("_write()"))},U.prototype._writev=null,U.prototype.end=function(M,z,Q){var ie=this._writableState;return typeof M=="function"?(Q=M,M=null,z=null):typeof z=="function"&&(Q=z,z=null),M!=null&&this.write(M,z),ie.corked&&(ie.corked=1,this.uncork()),ie.ending||W(this,ie,Q),this},Object.defineProperty(U.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Se(M){return M.ending&&M.length===0&&M.bufferedRequest===null&&!M.finished&&!M.writing}function Le(M,z){M._final(function(Q){z.pendingcb--,Q&&S(M,Q),z.prefinished=!0,M.emit("prefinish"),j(M,z)})}function _e(M,z){!z.prefinished&&!z.finalCalled&&(typeof M._final=="function"&&!z.destroyed?(z.pendingcb++,z.finalCalled=!0,Ce.nextTick(Le,M,z)):(z.prefinished=!0,M.emit("prefinish")))}function j(M,z){var Q=Se(z);if(Q&&(_e(M,z),z.pendingcb===0&&(z.finished=!0,M.emit("finish"),z.autoDestroy))){var ie=M._readableState;(!ie||ie.autoDestroy&&ie.endEmitted)&&M.destroy()}return Q}function W(M,z,Q){z.ending=!0,j(M,z),Q&&(z.finished?Ce.nextTick(Q):M.once("finish",Q)),z.ended=!0,M.writable=!1}function se(M,z,Q){var ie=M.entry;for(M.entry=null;ie;){var oe=ie.callback;z.pendingcb--,oe(Q),ie=ie.next}z.corkedRequestsFree.next=M}return Object.defineProperty(U.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(z){this._writableState&&(this._writableState.destroyed=z)}}),U.prototype.destroy=l.destroy,U.prototype._undestroy=l.undestroy,U.prototype._destroy=function(M,z){z(M)},zl}var Vl,mm;function Li(){if(mm)return Vl;mm=1;var t=Object.keys||function(h){var d=[];for(var m in h)d.push(m);return d};Vl=a;var e=mb(),r=pb();si()(a,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var o=n[i];a.prototype[o]||(a.prototype[o]=r.prototype[o])}function a(h){if(!(this instanceof a))return new a(h);e.call(this,h),r.call(this,h),this.allowHalfOpen=!0,h&&(h.readable===!1&&(this.readable=!1),h.writable===!1&&(this.writable=!1),h.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",u)))}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function u(){this._writableState.ended||Ce.nextTick(l,this)}function l(h){h.end()}return Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),Vl}var Gl={},Vo={exports:{}};var gm;function u7(){return gm||(gm=1,(function(t,e){var r=La(),n=r.Buffer;function i(a,u){for(var l in a)u[l]=a[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=o);function o(a,u,l){return n(a,u,l)}o.prototype=Object.create(n.prototype),i(n,o),o.from=function(a,u,l){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,u,l)},o.alloc=function(a,u,l){if(typeof a!="number")throw new TypeError("Argument must be a number");var h=n(a);return u!==void 0?typeof l=="string"?h.fill(u,l):h.fill(u):h.fill(0),h},o.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},o.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(a)}})(Vo,Vo.exports)),Vo.exports}var ym;function bm(){if(ym)return Gl;ym=1;var t=u7().Buffer,e=t.isEncoding||function(A){switch(A=""+A,A&&A.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 r(A){if(!A)return"utf8";for(var P;;)switch(A){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 A;default:if(P)return;A=(""+A).toLowerCase(),P=!0}}function n(A){var P=r(A);if(typeof P!="string"&&(t.isEncoding===e||!e(A)))throw new Error("Unknown encoding: "+A);return P||A}Gl.StringDecoder=i;function i(A){this.encoding=n(A);var P;switch(this.encoding){case"utf16le":this.text=m,this.end=y,P=4;break;case"utf8":this.fillLast=l,P=4;break;case"base64":this.text=w,this.end=T,P=3;break;default:this.write=E,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(P)}i.prototype.write=function(A){if(A.length===0)return"";var P,I;if(this.lastNeed){if(P=this.fillLast(A),P===void 0)return"";I=this.lastNeed,this.lastNeed=0}else I=0;return I<A.length?P?P+this.text(A,I):this.text(A,I):P||""},i.prototype.end=d,i.prototype.text=h,i.prototype.fillLast=function(A){if(this.lastNeed<=A.length)return A.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,this.lastTotal-this.lastNeed,0,A.length),this.lastNeed-=A.length};function o(A){return A<=127?0:A>>5===6?2:A>>4===14?3:A>>3===30?4:A>>6===2?-1:-2}function a(A,P,I){var S=P.length-1;if(S<I)return 0;var N=o(P[S]);return N>=0?(N>0&&(A.lastNeed=N-1),N):--S<I||N===-2?0:(N=o(P[S]),N>=0?(N>0&&(A.lastNeed=N-2),N):--S<I||N===-2?0:(N=o(P[S]),N>=0?(N>0&&(N===2?N=0:A.lastNeed=N-3),N):0))}function u(A,P,I){if((P[0]&192)!==128)return A.lastNeed=0,"�";if(A.lastNeed>1&&P.length>1){if((P[1]&192)!==128)return A.lastNeed=1,"�";if(A.lastNeed>2&&P.length>2&&(P[2]&192)!==128)return A.lastNeed=2,"�"}}function l(A){var P=this.lastTotal-this.lastNeed,I=u(this,A);if(I!==void 0)return I;if(this.lastNeed<=A.length)return A.copy(this.lastChar,P,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,P,0,A.length),this.lastNeed-=A.length}function h(A,P){var I=a(this,A,P);if(!this.lastNeed)return A.toString("utf8",P);this.lastTotal=I;var S=A.length-(I-this.lastNeed);return A.copy(this.lastChar,0,S),A.toString("utf8",P,S)}function d(A){var P=A&&A.length?this.write(A):"";return this.lastNeed?P+"�":P}function m(A,P){if((A.length-P)%2===0){var I=A.toString("utf16le",P);if(I){var S=I.charCodeAt(I.length-1);if(S>=55296&&S<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1],I.slice(0,-1)}return I}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=A[A.length-1],A.toString("utf16le",P,A.length-1)}function y(A){var P=A&&A.length?this.write(A):"";if(this.lastNeed){var I=this.lastTotal-this.lastNeed;return P+this.lastChar.toString("utf16le",0,I)}return P}function w(A,P){var I=(A.length-P)%3;return I===0?A.toString("base64",P):(this.lastNeed=3-I,this.lastTotal=3,I===1?this.lastChar[0]=A[A.length-1]:(this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1]),A.toString("base64",P,A.length-I))}function T(A){var P=A&&A.length?this.write(A):"";return this.lastNeed?P+this.lastChar.toString("base64",0,3-this.lastNeed):P}function E(A){return A.toString(this.encoding)}function B(A){return A&&A.length?this.write(A):""}return Gl}var $l,xm;function vh(){if(xm)return $l;xm=1;var t=Qi().codes.ERR_STREAM_PREMATURE_CLOSE;function e(o){var a=!1;return function(){if(!a){a=!0;for(var u=arguments.length,l=new Array(u),h=0;h<u;h++)l[h]=arguments[h];o.apply(this,l)}}}function r(){}function n(o){return o.setHeader&&typeof o.abort=="function"}function i(o,a,u){if(typeof a=="function")return i(o,null,a);a||(a={}),u=e(u||r);var l=a.readable||a.readable!==!1&&o.readable,h=a.writable||a.writable!==!1&&o.writable,d=function(){o.writable||y()},m=o._writableState&&o._writableState.finished,y=function(){h=!1,m=!0,l||u.call(o)},w=o._readableState&&o._readableState.endEmitted,T=function(){l=!1,w=!0,h||u.call(o)},E=function(I){u.call(o,I)},B=function(){var I;if(l&&!w)return(!o._readableState||!o._readableState.ended)&&(I=new t),u.call(o,I);if(h&&!m)return(!o._writableState||!o._writableState.ended)&&(I=new t),u.call(o,I)},A=function(){o.req.on("finish",y)};return n(o)?(o.on("complete",y),o.on("abort",B),o.req?A():o.on("request",A)):h&&!o._writableState&&(o.on("end",d),o.on("close",d)),o.on("end",T),o.on("finish",y),a.error!==!1&&o.on("error",E),o.on("close",B),function(){o.removeListener("complete",y),o.removeListener("abort",B),o.removeListener("request",A),o.req&&o.req.removeListener("finish",y),o.removeListener("end",d),o.removeListener("close",d),o.removeListener("finish",y),o.removeListener("end",T),o.removeListener("error",E),o.removeListener("close",B)}}return $l=i,$l}var jl,wm;function l7(){if(wm)return jl;wm=1;var t;function e(I,S,N){return S=r(S),S in I?Object.defineProperty(I,S,{value:N,enumerable:!0,configurable:!0,writable:!0}):I[S]=N,I}function r(I){var S=n(I,"string");return typeof S=="symbol"?S:String(S)}function n(I,S){if(typeof I!="object"||I===null)return I;var N=I[Symbol.toPrimitive];if(N!==void 0){var _=N.call(I,S);if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(I)}var i=vh(),o=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),h=Symbol("lastPromise"),d=Symbol("handlePromise"),m=Symbol("stream");function y(I,S){return{value:I,done:S}}function w(I){var S=I[o];if(S!==null){var N=I[m].read();N!==null&&(I[h]=null,I[o]=null,I[a]=null,S(y(N,!1)))}}function T(I){Ce.nextTick(w,I)}function E(I,S){return function(N,_){I.then(function(){if(S[l]){N(y(void 0,!0));return}S[d](N,_)},_)}}var B=Object.getPrototypeOf(function(){}),A=Object.setPrototypeOf((t={get stream(){return this[m]},next:function(){var S=this,N=this[u];if(N!==null)return Promise.reject(N);if(this[l])return Promise.resolve(y(void 0,!0));if(this[m].destroyed)return new Promise(function(H,K){Ce.nextTick(function(){S[u]?K(S[u]):H(y(void 0,!0))})});var _=this[h],F;if(_)F=new Promise(E(_,this));else{var U=this[m].read();if(U!==null)return Promise.resolve(y(U,!1));F=new Promise(this[d])}return this[h]=F,F}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var S=this;return new Promise(function(N,_){S[m].destroy(null,function(F){if(F){_(F);return}N(y(void 0,!0))})})}),t),B),P=function(S){var N,_=Object.create(A,(N={},e(N,m,{value:S,writable:!0}),e(N,o,{value:null,writable:!0}),e(N,a,{value:null,writable:!0}),e(N,u,{value:null,writable:!0}),e(N,l,{value:S._readableState.endEmitted,writable:!0}),e(N,d,{value:function(U,H){var K=_[m].read();K?(_[h]=null,_[o]=null,_[a]=null,U(y(K,!1))):(_[o]=U,_[a]=H)},writable:!0}),N));return _[h]=null,i(S,function(F){if(F&&F.code!=="ERR_STREAM_PREMATURE_CLOSE"){var U=_[a];U!==null&&(_[h]=null,_[o]=null,_[a]=null,U(F)),_[u]=F;return}var H=_[o];H!==null&&(_[h]=null,_[o]=null,_[a]=null,H(y(void 0,!0))),_[l]=!0}),S.on("readable",T.bind(null,_)),_};return jl=P,jl}var Hl,Am;function f7(){return Am||(Am=1,Hl=function(){throw new Error("Readable.from is not available in the browser")}),Hl}var ql,Em;function mb(){if(Em)return ql;Em=1,ql=H;var t;H.ReadableState=U,bh().EventEmitter;var e=function(k,Z){return k.listeners(Z).length},r=tb(),n=La().Buffer,i=(typeof Ir<"u"?Ir:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(O){return n.from(O)}function a(O){return n.isBuffer(O)||O instanceof i}var u=fb(),l;u&&u.debuglog?l=u.debuglog("stream"):l=function(){};var h=a7(),d=hb(),m=db(),y=m.getHighWaterMark,w=Qi().codes,T=w.ERR_INVALID_ARG_TYPE,E=w.ERR_STREAM_PUSH_AFTER_EOF,B=w.ERR_METHOD_NOT_IMPLEMENTED,A=w.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,P,I,S;si()(H,r);var N=d.errorOrDestroy,_=["error","close","destroy","pause","resume"];function F(O,k,Z){if(typeof O.prependListener=="function")return O.prependListener(k,Z);!O._events||!O._events[k]?O.on(k,Z):Array.isArray(O._events[k])?O._events[k].unshift(Z):O._events[k]=[Z,O._events[k]]}function U(O,k,Z){t=t||Li(),O=O||{},typeof Z!="boolean"&&(Z=k instanceof t),this.objectMode=!!O.objectMode,Z&&(this.objectMode=this.objectMode||!!O.readableObjectMode),this.highWaterMark=y(this,O,"readableHighWaterMark",Z),this.buffer=new h,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=O.emitClose!==!1,this.autoDestroy=!!O.autoDestroy,this.destroyed=!1,this.defaultEncoding=O.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,O.encoding&&(P||(P=bm().StringDecoder),this.decoder=new P(O.encoding),this.encoding=O.encoding)}function H(O){if(t=t||Li(),!(this instanceof H))return new H(O);var k=this instanceof t;this._readableState=new U(O,this,k),this.readable=!0,O&&(typeof O.read=="function"&&(this._read=O.read),typeof O.destroy=="function"&&(this._destroy=O.destroy)),r.call(this)}Object.defineProperty(H.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(k){this._readableState&&(this._readableState.destroyed=k)}}),H.prototype.destroy=d.destroy,H.prototype._undestroy=d.undestroy,H.prototype._destroy=function(O,k){k(O)},H.prototype.push=function(O,k){var Z=this._readableState,fe;return Z.objectMode?fe=!0:typeof O=="string"&&(k=k||Z.defaultEncoding,k!==Z.encoding&&(O=n.from(O,k),k=""),fe=!0),K(this,O,k,!1,fe)},H.prototype.unshift=function(O){return K(this,O,null,!0,!1)};function K(O,k,Z,fe,Pe){l("readableAddChunk",k);var xe=O._readableState;if(k===null)xe.reading=!1,ue(O,xe);else{var De;if(Pe||(De=L(xe,k)),De)N(O,De);else if(xe.objectMode||k&&k.length>0)if(typeof k!="string"&&!xe.objectMode&&Object.getPrototypeOf(k)!==n.prototype&&(k=o(k)),fe)xe.endEmitted?N(O,new A):le(O,xe,k,!0);else if(xe.ended)N(O,new E);else{if(xe.destroyed)return!1;xe.reading=!1,xe.decoder&&!Z?(k=xe.decoder.write(k),xe.objectMode||k.length!==0?le(O,xe,k,!1):Ee(O,xe)):le(O,xe,k,!1)}else fe||(xe.reading=!1,Ee(O,xe))}return!xe.ended&&(xe.length<xe.highWaterMark||xe.length===0)}function le(O,k,Z,fe){k.flowing&&k.length===0&&!k.sync?(k.awaitDrain=0,O.emit("data",Z)):(k.length+=k.objectMode?1:Z.length,fe?k.buffer.unshift(Z):k.buffer.push(Z),k.needReadable&&ye(O)),Ee(O,k)}function L(O,k){var Z;return!a(k)&&typeof k!="string"&&k!==void 0&&!O.objectMode&&(Z=new T("chunk",["string","Buffer","Uint8Array"],k)),Z}H.prototype.isPaused=function(){return this._readableState.flowing===!1},H.prototype.setEncoding=function(O){P||(P=bm().StringDecoder);var k=new P(O);this._readableState.decoder=k,this._readableState.encoding=this._readableState.decoder.encoding;for(var Z=this._readableState.buffer.head,fe="";Z!==null;)fe+=k.write(Z.data),Z=Z.next;return this._readableState.buffer.clear(),fe!==""&&this._readableState.buffer.push(fe),this._readableState.length=fe.length,this};var me=1073741824;function Be(O){return O>=me?O=me:(O--,O|=O>>>1,O|=O>>>2,O|=O>>>4,O|=O>>>8,O|=O>>>16,O++),O}function re(O,k){return O<=0||k.length===0&&k.ended?0:k.objectMode?1:O!==O?k.flowing&&k.length?k.buffer.head.data.length:k.length:(O>k.highWaterMark&&(k.highWaterMark=Be(O)),O<=k.length?O:k.ended?k.length:(k.needReadable=!0,0))}H.prototype.read=function(O){l("read",O),O=parseInt(O,10);var k=this._readableState,Z=O;if(O!==0&&(k.emittedReadable=!1),O===0&&k.needReadable&&((k.highWaterMark!==0?k.length>=k.highWaterMark:k.length>0)||k.ended))return l("read: emitReadable",k.length,k.ended),k.length===0&&k.ended?Q(this):ye(this),null;if(O=re(O,k),O===0&&k.ended)return k.length===0&&Q(this),null;var fe=k.needReadable;l("need readable",fe),(k.length===0||k.length-O<k.highWaterMark)&&(fe=!0,l("length less than watermark",fe)),k.ended||k.reading?(fe=!1,l("reading or ended",fe)):fe&&(l("do read"),k.reading=!0,k.sync=!0,k.length===0&&(k.needReadable=!0),this._read(k.highWaterMark),k.sync=!1,k.reading||(O=re(Z,k)));var Pe;return O>0?Pe=z(O,k):Pe=null,Pe===null?(k.needReadable=k.length<=k.highWaterMark,O=0):(k.length-=O,k.awaitDrain=0),k.length===0&&(k.ended||(k.needReadable=!0),Z!==O&&k.ended&&Q(this)),Pe!==null&&this.emit("data",Pe),Pe};function ue(O,k){if(l("onEofChunk"),!k.ended){if(k.decoder){var Z=k.decoder.end();Z&&Z.length&&(k.buffer.push(Z),k.length+=k.objectMode?1:Z.length)}k.ended=!0,k.sync?ye(O):(k.needReadable=!1,k.emittedReadable||(k.emittedReadable=!0,Ae(O)))}}function ye(O){var k=O._readableState;l("emitReadable",k.needReadable,k.emittedReadable),k.needReadable=!1,k.emittedReadable||(l("emitReadable",k.flowing),k.emittedReadable=!0,Ce.nextTick(Ae,O))}function Ae(O){var k=O._readableState;l("emitReadable_",k.destroyed,k.length,k.ended),!k.destroyed&&(k.length||k.ended)&&(O.emit("readable"),k.emittedReadable=!1),k.needReadable=!k.flowing&&!k.ended&&k.length<=k.highWaterMark,M(O)}function Ee(O,k){k.readingMore||(k.readingMore=!0,Ce.nextTick(Se,O,k))}function Se(O,k){for(;!k.reading&&!k.ended&&(k.length<k.highWaterMark||k.flowing&&k.length===0);){var Z=k.length;if(l("maybeReadMore read 0"),O.read(0),Z===k.length)break}k.readingMore=!1}H.prototype._read=function(O){N(this,new B("_read()"))},H.prototype.pipe=function(O,k){var Z=this,fe=this._readableState;switch(fe.pipesCount){case 0:fe.pipes=O;break;case 1:fe.pipes=[fe.pipes,O];break;default:fe.pipes.push(O);break}fe.pipesCount+=1,l("pipe count=%d opts=%j",fe.pipesCount,k);var Pe=(!k||k.end!==!1)&&O!==Ce.stdout&&O!==Ce.stderr,xe=Pe?Ut:at;fe.endEmitted?Ce.nextTick(xe):Z.once("end",xe),O.on("unpipe",De);function De(Bt,cr){l("onunpipe"),Bt===Z&&cr&&cr.hasUnpiped===!1&&(cr.hasUnpiped=!0,wt())}function Ut(){l("onend"),O.end()}var X=Le(Z);O.on("drain",X);var xt=!1;function wt(){l("cleanup"),O.removeListener("close",jt),O.removeListener("finish",Er),O.removeListener("drain",X),O.removeListener("error",st),O.removeListener("unpipe",De),Z.removeListener("end",Ut),Z.removeListener("end",at),Z.removeListener("data",qe),xt=!0,fe.awaitDrain&&(!O._writableState||O._writableState.needDrain)&&X()}Z.on("data",qe);function qe(Bt){l("ondata");var cr=O.write(Bt);l("dest.write",cr),cr===!1&&((fe.pipesCount===1&&fe.pipes===O||fe.pipesCount>1&&oe(fe.pipes,O)!==-1)&&!xt&&(l("false write response, pause",fe.awaitDrain),fe.awaitDrain++),Z.pause())}function st(Bt){l("onerror",Bt),at(),O.removeListener("error",st),e(O,"error")===0&&N(O,Bt)}F(O,"error",st);function jt(){O.removeListener("finish",Er),at()}O.once("close",jt);function Er(){l("onfinish"),O.removeListener("close",jt),at()}O.once("finish",Er);function at(){l("unpipe"),Z.unpipe(O)}return O.emit("pipe",Z),fe.flowing||(l("pipe resume"),Z.resume()),O};function Le(O){return function(){var Z=O._readableState;l("pipeOnDrain",Z.awaitDrain),Z.awaitDrain&&Z.awaitDrain--,Z.awaitDrain===0&&e(O,"data")&&(Z.flowing=!0,M(O))}}H.prototype.unpipe=function(O){var k=this._readableState,Z={hasUnpiped:!1};if(k.pipesCount===0)return this;if(k.pipesCount===1)return O&&O!==k.pipes?this:(O||(O=k.pipes),k.pipes=null,k.pipesCount=0,k.flowing=!1,O&&O.emit("unpipe",this,Z),this);if(!O){var fe=k.pipes,Pe=k.pipesCount;k.pipes=null,k.pipesCount=0,k.flowing=!1;for(var xe=0;xe<Pe;xe++)fe[xe].emit("unpipe",this,{hasUnpiped:!1});return this}var De=oe(k.pipes,O);return De===-1?this:(k.pipes.splice(De,1),k.pipesCount-=1,k.pipesCount===1&&(k.pipes=k.pipes[0]),O.emit("unpipe",this,Z),this)},H.prototype.on=function(O,k){var Z=r.prototype.on.call(this,O,k),fe=this._readableState;return O==="data"?(fe.readableListening=this.listenerCount("readable")>0,fe.flowing!==!1&&this.resume()):O==="readable"&&!fe.endEmitted&&!fe.readableListening&&(fe.readableListening=fe.needReadable=!0,fe.flowing=!1,fe.emittedReadable=!1,l("on readable",fe.length,fe.reading),fe.length?ye(this):fe.reading||Ce.nextTick(j,this)),Z},H.prototype.addListener=H.prototype.on,H.prototype.removeListener=function(O,k){var Z=r.prototype.removeListener.call(this,O,k);return O==="readable"&&Ce.nextTick(_e,this),Z},H.prototype.removeAllListeners=function(O){var k=r.prototype.removeAllListeners.apply(this,arguments);return(O==="readable"||O===void 0)&&Ce.nextTick(_e,this),k};function _e(O){var k=O._readableState;k.readableListening=O.listenerCount("readable")>0,k.resumeScheduled&&!k.paused?k.flowing=!0:O.listenerCount("data")>0&&O.resume()}function j(O){l("readable nexttick read 0"),O.read(0)}H.prototype.resume=function(){var O=this._readableState;return O.flowing||(l("resume"),O.flowing=!O.readableListening,W(this,O)),O.paused=!1,this};function W(O,k){k.resumeScheduled||(k.resumeScheduled=!0,Ce.nextTick(se,O,k))}function se(O,k){l("resume",k.reading),k.reading||O.read(0),k.resumeScheduled=!1,O.emit("resume"),M(O),k.flowing&&!k.reading&&O.read(0)}H.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 M(O){var k=O._readableState;for(l("flow",k.flowing);k.flowing&&O.read()!==null;);}H.prototype.wrap=function(O){var k=this,Z=this._readableState,fe=!1;O.on("end",function(){if(l("wrapped end"),Z.decoder&&!Z.ended){var De=Z.decoder.end();De&&De.length&&k.push(De)}k.push(null)}),O.on("data",function(De){if(l("wrapped data"),Z.decoder&&(De=Z.decoder.write(De)),!(Z.objectMode&&De==null)&&!(!Z.objectMode&&(!De||!De.length))){var Ut=k.push(De);Ut||(fe=!0,O.pause())}});for(var Pe in O)this[Pe]===void 0&&typeof O[Pe]=="function"&&(this[Pe]=(function(Ut){return function(){return O[Ut].apply(O,arguments)}})(Pe));for(var xe=0;xe<_.length;xe++)O.on(_[xe],this.emit.bind(this,_[xe]));return this._read=function(De){l("wrapped _read",De),fe&&(fe=!1,O.resume())},this},typeof Symbol=="function"&&(H.prototype[Symbol.asyncIterator]=function(){return I===void 0&&(I=l7()),I(this)}),Object.defineProperty(H.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(H.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(H.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(k){this._readableState&&(this._readableState.flowing=k)}}),H._fromList=z,Object.defineProperty(H.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function z(O,k){if(k.length===0)return null;var Z;return k.objectMode?Z=k.buffer.shift():!O||O>=k.length?(k.decoder?Z=k.buffer.join(""):k.buffer.length===1?Z=k.buffer.first():Z=k.buffer.concat(k.length),k.buffer.clear()):Z=k.buffer.consume(O,k.decoder),Z}function Q(O){var k=O._readableState;l("endReadable",k.endEmitted),k.endEmitted||(k.ended=!0,Ce.nextTick(ie,k,O))}function ie(O,k){if(l("endReadableNT",O.endEmitted,O.length),!O.endEmitted&&O.length===0&&(O.endEmitted=!0,k.readable=!1,k.emit("end"),O.autoDestroy)){var Z=k._writableState;(!Z||Z.autoDestroy&&Z.finished)&&k.destroy()}}typeof Symbol=="function"&&(H.from=function(O,k){return S===void 0&&(S=f7()),S(H,O,k)});function oe(O,k){for(var Z=0,fe=O.length;Z<fe;Z++)if(O[Z]===k)return Z;return-1}return ql}var Zl,vm;function gb(){if(vm)return Zl;vm=1,Zl=u;var t=Qi().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,r=t.ERR_MULTIPLE_CALLBACK,n=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=t.ERR_TRANSFORM_WITH_LENGTH_0,o=Li();si()(u,o);function a(d,m){var y=this._transformState;y.transforming=!1;var w=y.writecb;if(w===null)return this.emit("error",new r);y.writechunk=null,y.writecb=null,m!=null&&this.push(m),w(d);var T=this._readableState;T.reading=!1,(T.needReadable||T.length<T.highWaterMark)&&this._read(T.highWaterMark)}function u(d){if(!(this instanceof u))return new u(d);o.call(this,d),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",l)}function l(){var d=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(m,y){h(d,m,y)}):h(this,null,null)}u.prototype.push=function(d,m){return this._transformState.needTransform=!1,o.prototype.push.call(this,d,m)},u.prototype._transform=function(d,m,y){y(new e("_transform()"))},u.prototype._write=function(d,m,y){var w=this._transformState;if(w.writecb=y,w.writechunk=d,w.writeencoding=m,!w.transforming){var T=this._readableState;(w.needTransform||T.needReadable||T.length<T.highWaterMark)&&this._read(T.highWaterMark)}},u.prototype._read=function(d){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(d,m){o.prototype._destroy.call(this,d,function(y){m(y)})};function h(d,m,y){if(m)return d.emit("error",m);if(y!=null&&d.push(y),d._writableState.length)throw new i;if(d._transformState.transforming)throw new n;return d.push(null)}return Zl}var Kl,Rm;function h7(){if(Rm)return Kl;Rm=1,Kl=e;var t=gb();si()(e,t);function e(r){if(!(this instanceof e))return new e(r);t.call(this,r)}return e.prototype._transform=function(r,n,i){i(null,r)},Kl}var Wl,Tm;function d7(){if(Tm)return Wl;Tm=1;var t;function e(y){var w=!1;return function(){w||(w=!0,y.apply(void 0,arguments))}}var r=Qi().codes,n=r.ERR_MISSING_ARGS,i=r.ERR_STREAM_DESTROYED;function o(y){if(y)throw y}function a(y){return y.setHeader&&typeof y.abort=="function"}function u(y,w,T,E){E=e(E);var B=!1;y.on("close",function(){B=!0}),t===void 0&&(t=vh()),t(y,{readable:w,writable:T},function(P){if(P)return E(P);B=!0,E()});var A=!1;return function(P){if(!B&&!A){if(A=!0,a(y))return y.abort();if(typeof y.destroy=="function")return y.destroy();E(P||new i("pipe"))}}}function l(y){y()}function h(y,w){return y.pipe(w)}function d(y){return!y.length||typeof y[y.length-1]!="function"?o:y.pop()}function m(){for(var y=arguments.length,w=new Array(y),T=0;T<y;T++)w[T]=arguments[T];var E=d(w);if(Array.isArray(w[0])&&(w=w[0]),w.length<2)throw new n("streams");var B,A=w.map(function(P,I){var S=I<w.length-1,N=I>0;return u(P,S,N,function(_){B||(B=_),_&&A.forEach(l),!S&&(A.forEach(l),E(B))})});return w.reduce(h)}return Wl=m,Wl}var Jl,Bm;function p7(){if(Bm)return Jl;Bm=1,Jl=r;var t=bh().EventEmitter,e=si();e(r,t),r.Readable=mb(),r.Writable=pb(),r.Duplex=Li(),r.Transform=gb(),r.PassThrough=h7(),r.finished=vh(),r.pipeline=d7(),r.Stream=r;function r(){t.call(this)}return r.prototype.pipe=function(n,i){var o=this;function a(w){n.writable&&n.write(w)===!1&&o.pause&&o.pause()}o.on("data",a);function u(){o.readable&&o.resume&&o.resume()}n.on("drain",u),!n._isStdio&&(!i||i.end!==!1)&&(o.on("end",h),o.on("close",d));var l=!1;function h(){l||(l=!0,n.end())}function d(){l||(l=!0,typeof n.destroy=="function"&&n.destroy())}function m(w){if(y(),t.listenerCount(this,"error")===0)throw w}o.on("error",m),n.on("error",m);function y(){o.removeListener("data",a),n.removeListener("drain",u),o.removeListener("end",h),o.removeListener("close",d),o.removeListener("error",m),n.removeListener("error",m),o.removeListener("end",y),o.removeListener("close",y),n.removeListener("close",y)}return o.on("end",y),o.on("close",y),n.on("close",y),n.emit("pipe",o),n},Jl}var Sm=p7();function yb(t){if(typeof File=="function"&&t instanceof File)return!0;const e=t;return typeof e=="object"&&typeof e.name=="string"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")}async function bb(t){return t.arrayBuffer?t.arrayBuffer():new Promise(e=>{const r=new FileReader;r.onload=()=>e(r.result),r.readAsArrayBuffer(t)})}const Kn=Yn().refine(t=>qy().safeParse(t).success,"expected a function"),m7=Yn().transform(t=>(Vy().safeParse(t).success&&(t=String(t)),ce().regex(/^-?\d+$/,"expected integer string").parse(t))),Om=Yn().transform(t=>(Vy().safeParse(t).success&&(t=String(t)),ce().regex(/^\d+$/,"expected non-negative integer string").parse(t))),g7=ve({baseURL:ce().optional(),timeout:pe().int().min(0).optional(),headers:Gy(ce(),ce()).optional(),onRequest:Kn.optional(),httpAgent:Fi().optional(),httpsAgent:Fi().optional(),endlesslyRetry:Qe().optional(),signal:Yn().optional()}),xn=ve({redundancyStrategy:pe().int().optional(),fallback:Qe().optional(),timeoutMs:pe().int().min(0).optional(),actPublisher:Gs(Yn().transform(t=>new br(t))),actHistoryAddress:Gs(Yn().transform(t=>new Oe(t))),actTimestamp:Zy().optional()}),js=ve({act:Qe().optional(),actHistoryAddress:Gs(Yn().transform(t=>new Oe(t))),deferred:Qe().optional(),encrypt:Qe().optional(),pin:Qe().optional(),tag:pe().int().min(0).optional()}),y7=js.extend({redundancyLevel:pe().int().min(0).optional()}),b7=js.extend({size:pe().int().min(0).optional(),contentType:ce().optional(),redundancyLevel:pe().int().min(0).optional()}),Ql=js.extend({errorDocument:ce().optional(),indexDocument:ce().optional(),redundancyLevel:pe().int().min(0).optional()}),x7=ve({uid:pe().int()}),w7=Zy().min(0),A7=ve({onMessage:Kn,onError:Kn,onClose:Kn}),E7=ve({onMessage:Kn,onError:Kn,onClose:Kn}),Pm=ve({gasPrice:m7.optional(),immutableFlag:Qe().optional(),label:ce().optional(),waitForUsable:Qe().optional(),waitForUsableTimeout:pe().int().min(0).optional()}),Im=ve({gasLimit:Om.optional(),gasPrice:Om.optional()}),v7=ve({limit:pe().int().min(R9).max(T9).optional(),offset:pe().int().min(0).optional()});function xb(t){return typeof Sm.Readable<"u"&&t instanceof Sm.Readable}function He(t,e){if(typeof t=="bigint"&&(t=t.toString()),typeof t!="string"||!/^-?\d+$/.test(t))throw new TypeError(`${e?.name??"value"} is not a valid integer string, got: ${t}`);if(e?.min!==void 0&&BigInt(t)<e.min)throw new RangeError(`${e?.name??"value"} must be >= ${e.min}, got: ${t}`);if(e?.max!==void 0&&BigInt(t)>e.max)throw new RangeError(`${e?.name??"value"} must be <= ${e.max}, got: ${t}`);return t}function R7(t){return x7.safeParse(t).success}function km(t){if(typeof t!="string"&&!(t instanceof Uint8Array))throw new TypeError("Data must be either string or Uint8Array!")}function T7(t){if(typeof t!="string"&&!(t instanceof Uint8Array)&&!yb(t)&&!xb(t))throw new TypeError("Data must be either string, Readable, Uint8Array or File!")}function vn(t){if(t==null)throw new TypeError(`Expected number | Tag | string from tagUid, got: ${t}`);if(R7(t))return t.uid;if(typeof t=="number"||typeof t=="string")return w7.parse(t);throw new TypeError(`Expected number | Tag | string from tagUid, got: ${t}`)}function B7(t){return!Number.isInteger(t)||t<1?1:t>3155695200?3155695200:t}function S7(t){return!Number.isInteger(t)||t<24e3?24e3:t}const O7=.9;function P7(t,e,r){return t/Math.pow(2,e-r)}function wb(t){return 4096*2**t}const Ab=[[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 na(t,e,r){if(t<17)return 0;if(e!==void 0&&r!==void 0){const o=eb[e?"ENCRYPTION_ON":"ENCRYPTION_OFF"][r].find(a=>a.batchDepth===t);if(o?.effectiveVolume)return Ky(o.effectiveVolume)}else{const n=Ab.find(([i,o])=>{if(t===i)return o});if(n)return n[1]*1e3*1e3*1e3}return Math.ceil(wb(t)*O7)}function ON(t,e){const r=new Map;for(let n=17;n<35;n++)r.set(n,na(n,t,e));return r}function gi(t,e){return Fe.fromPLUR(2n**BigInt(t)*BigInt(e))}function I7(t,e,r){const n=BigInt(He(t));return sr.fromSeconds(Number(n*BigInt(r)/BigInt(e)))}function Dr(t,e,r){return BigInt(t.toSeconds())/BigInt(r)*BigInt(e)+1n}function yi(t,e,r){if(e!==void 0&&r!==void 0){const o=eb[e?"ENCRYPTION_ON":"ENCRYPTION_OFF"][r].find(a=>t.toBytes()<=Ky(a.effectiveVolume));if(o?.effectiveVolume)return o.batchDepth}else for(const[n,i]of Ab)if(t.toBytes()<=i*1e3*1e3*1e3)return n;return 35}function k7(t){return N7(t.signature,t.batchId.toUint8Array(),t.timestamp,t.index)}function N7(t,e,r,n){if(t.length!==65)throw Error("invalid signature length");if(e.length!==32)throw Error("invalid batch ID length");if(r.length!==8)throw Error("invalid timestamp length");if(n.length!==8)throw Error("invalid index length");return new Ue($.Binary.concatBytes(e,n,r,t))}function Eb(t,e,r){const n=B7(t.batchTTL),i=sr.fromSeconds(n),o=na(t.depth,e,r),a=t.utilizationRatio??P7(t.utilization,t.depth,t.bucketDepth);return{batchID:new et(t.batchID),utilization:t.utilization,usable:t.usable,label:t.label,depth:t.depth,amount:He(t.amount),bucketDepth:t.bucketDepth,blockNumber:t.blockNumber,immutableFlag:t.immutableFlag,usage:a,usageText:`${Math.round(a*100)}%`,size:Sr.fromBytes(o),remainingSize:Sr.fromBytes(Math.ceil(o*(1-a))),theoreticalSize:Sr.fromBytes(wb(t.depth)),duration:i,calculateSize(u,l){const h=na(t.depth,u,l);return Sr.fromBytes(h)},calculateRemainingSize(u,l){const h=na(t.depth,u,l);return Sr.fromBytes(Math.ceil(h*(1-this.usage)))}}}function vb(t){const e=C7(t["content-disposition"]),r=_7(t["swarm-tag-uid"]),n=t["content-type"]||void 0;return{name:e,tagUid:r,contentType:n}}function C7(t){if(!t)throw new Pr("missing content-disposition header");const e=t.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?;?/i);if(e&&e.length>0)return e[1];throw new Pr("invalid content-disposition header")}function _7(t){if(t)return parseInt(t,10)}function $t(t,e){const r={};if(D7(t)?r["swarm-postage-stamp"]=k7(t).toHex():t&&(t=new et(t),r["swarm-postage-batch-id"]=t.toHex()),!e)return r;const n=e;n.size&&(r["content-length"]=String(n.size)),n.contentType&&(r["content-type"]=String(n.contentType)),n.redundancyLevel&&(r["swarm-redundancy-level"]=String(n.redundancyLevel));const i=Qe().safeParse(n.act);i.success&&(r["swarm-act"]=String(i.data));const o=Qe().safeParse(n.pin);o.success&&(r["swarm-pin"]=String(o.data));const a=Qe().safeParse(n.encrypt);a.success&&(r["swarm-encrypt"]=String(a.data)),n.tag&&(r["swarm-tag"]=String(n.tag));const u=Qe().safeParse(n.deferred);u.success&&(r["swarm-deferred-upload"]=String(u.data)),n.redundancyStrategy&&(r["swarm-redundancy-strategy"]=String(n.redundancyStrategy));const l=Qe().safeParse(n.fallback);return l.success&&(r["swarm-redundancy-fallback-mode"]=String(l.data)),n.timeoutMs&&(r["swarm-chunk-retrieval-timeout"]=String(n.timeoutMs)),n.indexDocument&&(r["swarm-index-document"]=String(n.indexDocument)),n.errorDocument&&(r["swarm-error-document"]=String(n.errorDocument)),n.actPublisher&&(r["swarm-act-publisher"]=new br(n.actPublisher).toCompressedHex()),n.actHistoryAddress&&(r["swarm-act-history-address"]=new Oe(n.actHistoryAddress).toHex()),n.actTimestamp&&(r["swarm-act-timestamp"]=String(n.actTimestamp)),(n.actPublisher||n.actHistoryAddress||n.actTimestamp)&&(r["swarm-act"]="true"),n.gasPrice&&(r["gas-price"]=String(n.gasPrice)),n.gasLimit&&(r["gas-limit"]=String(n.gasLimit)),r}function D7(t){if(!ve({}).safeParse(t).success)return!1;const r=t;return r.issuer!==void 0&&r.index!==void 0&&r.signature!==void 0&&r.timestamp!==void 0&&r.batchId!==void 0}const F7=yh("bee-js:http"),U7=1e5,L7=200,M7=1e3,z7=300,V7={headers:{accept:"application/json, text/plain, */*"}};async function he(t,e){const r=$.Objects.deepMerge3(V7,e,t);if(t.signal&&(r.signal=t.signal),G7(r),r.params)for(const a of Object.keys(r.params))r.params[a]===void 0&&delete r.params[a];const n=H7(r),i=(r.method||"GET").toUpperCase();r.method=i,t.onRequest?.({method:i,url:$.Strings.joinUrl([r.baseURL??"",r.url??""]),headers:{...r.headers},params:r.params});let o=0;for(;o<U7;)try{F7(`${i} ${n}`,{headers:r.headers,params:r.params});const a=await fetch(n,r);return a.ok||await $7(i,n,a,r.responseType),Rb(a,r.responseType)}catch(a){if(a instanceof $s)throw a;const u=a;if(u.name==="TimeoutError"&&t.endlesslyRetry)o++,await $.System.sleepMillis(o<z7?L7:M7);else throw j7(u,i,n)}throw Error("Max number of failed attempts reached")}function G7(t){if(t.data===void 0)return;const e=t.data;if(e!==null&&typeof e=="object"&&e.constructor===Object||Array.isArray(e))t.body=JSON.stringify(e),t.headers={"content-type":"application/json",...t.headers};else{t.body=e,t.duplex="half";const n=e instanceof Blob&&e.type?e.type:"application/octet-stream";t.headers={"content-type":n,...t.headers}}}async function $7(t,e,r,n){const i=await Rb(r,n).catch(()=>({data:void 0})),o=typeof i.data=="string"?i.data:JSON.stringify(i.data),a=o&&o!=="undefined"?`${r.statusText}: ${o}`:r.statusText;throw new $s(t,e,a,i.data,r.status,r.statusText)}function j7(t,e,r){if(t.name==="AbortError")return new $s(e,r,"Request aborted",void 0,void 0,"ERR_CANCELED");const n=t.cause,i=n?.message?`${t.message}: ${n.message}`:t.message;return new $s(e,r,i)}async function Rb(t,e="json"){let r;switch(e){case"arraybuffer":r=await t.arrayBuffer();break;case"text":r=await t.text();break;case"blob":r=await t.blob();break;case"stream":r=t.body;break;default:{const n=await t.text();r=n?JSON.parse(n):null}}return{data:r,status:t.status,statusText:t.statusText,headers:Object.fromEntries(t.headers.entries()),raw:t}}function H7(t){let e=$.Strings.joinUrl([t.baseURL??"",t.url??""]);if(t.params){const r=new URLSearchParams(Object.entries(t.params).filter(([,n])=>n!==void 0).map(([n,i])=>[n,String(i)])).toString();r&&(e+=`?${r}`)}return e}const Tb="chunks";async function q7(t,e,r,n){const i=await he(t,{method:"post",url:`${Tb}`,data:e,headers:{"content-type":"application/octet-stream",...$t(r,n)},responseType:"json"});return{reference:ii.parse(i.data).reference,tagUid:i.headers["swarm-tag"]?vn(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?$.Optional.of(new Oe(i.headers["swarm-act-history-address"])):$.Optional.empty()}}async function co(t,e,r){e=new Oe(e);const n=await he(t,{responseType:"arraybuffer",url:`${Tb}/${e}`,headers:$t(null,r)});return new Uint8Array(n.data)}const Z7="soc";async function K7(t,e,r,n,i,o,a){const u=await he(t,{method:"post",url:`${Z7}/${e}/${r}`,data:i,headers:{"content-type":"application/octet-stream",...$t(o,a)},responseType:"json",params:{sig:n.toHex()}});return{reference:ii.parse(u.data).reference,tagUid:u.headers["swarm-tag"]?vn(u.headers["swarm-tag"]):void 0,historyAddress:u.headers["swarm-act-history-address"]?$.Optional.of(new Oe(u.headers["swarm-act-history-address"])):$.Optional.empty()}}const Bb=Pt.LENGTH,Sb=Pt.LENGTH+Bn.LENGTH,W7=Pt.LENGTH+Bn.LENGTH+Tt.LENGTH;function J7(t){const e=t.slice(Sb),r=Yy(e),n=Bn.fromSlice(t,Bb),i=Ue.fromSlice(t,0,Pt.LENGTH),o=$.Binary.concatBytes(i.toUint8Array(),r.toUint8Array());return n.recoverPublicKey(o).address()}function Va(t,e){t=t instanceof Ue?t.toUint8Array():t,e=new Oe(e);const r=J7(t),n=Ue.fromSlice(t,0,Pt.LENGTH),i=new Oe($.Binary.keccak256($.Binary.concatBytes(n.toUint8Array(),r.toUint8Array())));if(!$.Binary.equals(e.toUint8Array(),i.toUint8Array()))throw new Pr("SOC data does not match given address!");const o=Bn.fromSlice(t,Bb),a=Tt.fromSlice(t,Sb),u=Ue.fromSlice(t,W7);return{data:t,identifier:n,signature:o,span:a,payload:u,address:i,owner:r}}function Fs(t,e){return new Oe($.Binary.keccak256($.Binary.concatBytes(t.toUint8Array(),e.toUint8Array())))}function Ob(t,e,r,n,i){n=new Pt(n),i=new qr(i);const o=Fs(n,i.publicKey().address()),a=i.sign($.Binary.concatBytes(n.toUint8Array(),t.toUint8Array()));return{data:$.Binary.concatBytes(n.toUint8Array(),a.toUint8Array(),e.toUint8Array(),r.toUint8Array()),identifier:n,signature:a,span:e,payload:r,address:o,owner:i.publicKey().address()}}async function Rh(t,e,r,n){const i=$.Binary.concatBytes(e.span.toUint8Array(),e.payload.toUint8Array());return K7(t,e.owner,e.identifier,e.signature,i,r,n)}async function Th(t,e,r,n,i,o){e=new qr(e),n=new Pt(n);const u=Hs(i).toSingleOwnerChunk(n,e);return Rh(t,u,r,o)}async function Q7(t,e,r,n,i,o){e=new qr(e),n=new Pt(n);const a=i.toSingleOwnerChunk(n,e);return Rh(t,a,r,o)}async function Y7(t,e,r){r=new Pt(r),e=new Vt(e);const n=Fs(r,e),i=await co(t,n.toHex());return Va(i,n)}const Nm=1,Cm=4096;function Pb(t){return t=new Ue(t),Hs(t.toUint8Array().slice(Tt.LENGTH),Tt.fromSlice(t.toUint8Array(),0))}function Hs(t,e){const r=ce().safeParse(t);if(r.success&&(t=Ue.fromUtf8(r.data)),t.length<Nm||t.length>Cm)throw new RangeError(`payload size ${t.length} exceeds limits [${Nm}, ${Cm}]`);const n=e?typeof e=="bigint"?Tt.fromBigInt(e):e:Tt.fromBigInt(BigInt(t.length)),i=new Ue(t),o=$.Binary.concatBytes(n.toUint8Array(),i.toUint8Array()),a=Yy(o);return{data:o,span:n,payload:i,address:a,toSingleOwnerChunk:(u,l)=>Ob(a,n,i,u,l)}}const Ga="bytes";async function Ib(t,e,r,n){const i=await he(t,{url:Ga,method:"post",responseType:"json",data:e,headers:{"content-type":"application/octet-stream",...$t(r,n)}});return{reference:ii.parse(i.data).reference,tagUid:i.headers["swarm-tag"]?vn(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?$.Optional.of(new Oe(i.headers["swarm-act-history-address"])):$.Optional.empty()}}async function X7(t,e){e=new Oe(e);const r=await he(t,{url:`${Ga}/${e}`,method:"head",responseType:"json"});return{contentLength:parseInt(r.headers["content-length"])}}async function kb(t,e,r){r&&(r=xn.parse(r));const n=await he(t,{responseType:"arraybuffer",url:`${Ga}/${e}`,headers:$t(null,r)});return new Ue(n.data)}async function eR(t,e,r){return r&&(r=xn.parse(r)),(await he(t,{responseType:"stream",url:`${Ga}/${e}`,headers:$t(null,r)})).data}const Bh="feeds";async function tR(t,e,r,n,i){const o=await he(t,{method:"post",responseType:"json",url:`${Bh}/${e}/${r}`,headers:$t(n,i)});return ii.parse(o.data).reference}function Nb(t){const e=t["swarm-feed-index"],r=t["swarm-feed-index-next"];if(!e)throw new Pr("Response did not contain expected swarm-feed-index!");if(!r)throw new Pr("Response did not contain expected swarm-feed-index-next!");return{feedIndex:new Gt(e),feedIndexNext:new Gt(r)}}async function xa(t,e,r,n){const i=await he(t,{responseType:"arraybuffer",url:`${Bh}/${e}/${r}`,params:{...n}});return{payload:new Ue(i.data),...Nb(i.headers)}}async function rR(t,e,r){const n=await he(t,{responseType:"arraybuffer",url:`${Bh}/${e}/${r}`,params:{"Swarm-Only-Root-Chunk":!0}});return Nb(n.headers)}class ia{constructor(e){this.raw=e}toString(){const e=ce().safeParse(this.raw);return e.success&&e.data.includes(".eth")?e.data:new Oe(this.raw).toHex()}}function Sh(t,e){return e=typeof e=="number"?Gt.fromBigInt(BigInt(e)):e,new Pt($.Binary.keccak256($.Binary.concatBytes(t.toUint8Array(),e.toUint8Array())))}const nR=0,Cb=8,iR=Cb;async function _b(t,e,r){try{const n=await xa(t,e,r);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 $s)return Gt.fromBigInt(0n);throw n}}async function sR(t,e,r,n,i,o){n=new Oe(n);const a=o?.index??await _b(t,e.publicKey().address(),r),u=Sh(r,a),l=o?.at??Date.now()/1e3,h=$.Binary.numberToUint64(BigInt(Math.floor(l)),"BE"),d=$.Binary.concatBytes(h,n.toUint8Array());return Th(t,e,i,u,d,o)}async function oR(t,e,r,n,i,o){const a=o?.index??await _b(t,e.publicKey().address(),r),u=Sh(r,a);if(n.length>4096){const h=await Ib(t,n,i,o),d=Pb(await co(t,h.reference));return Q7(t,e,i,u,d,o)}const l=ce().safeParse(n);return Th(t,e,i,u,l.success?Ue.fromUtf8(l.data).toUint8Array():n,o)}function Oh(t,e,r){const n=Sh(e,r);return new Oe($.Binary.keccak256($.Binary.concatBytes(n.toUint8Array(),t.toUint8Array())))}async function aR(t,e,r,n,i=!1){n=typeof n=="number"?Gt.fromBigInt(BigInt(n)):n;const o=Oh(e,r,n),a=await co(t,o.toHex()),u=Va(a,o);let l=$.Optional.empty();if(i){const h=Ue.fromSlice(u.payload.toUint8Array(),nR,Cb);l=$.Optional.of(Number($.Binary.uint64ToNumber(h.toUint8Array(),"BE")))}return{timestamp:l,payload:new Ue(u.payload.offset(i?iR:0))}}async function cR(t,e,r,n){n=typeof n=="number"?Gt.fromBigInt(BigInt(n)):n;const i=Oh(e,r,n),o=await co(t,i),a=Va(o,i);return Hs(a.payload,a.span)}function Db(t,e,r){const n=async a=>{if(a?.index===void 0)return xa(t,r,e);const u=await aR(t,r,e,a.index,a.hasTimestamp??!0),l=typeof a.index=="number"?Gt.fromBigInt(BigInt(a.index)):a.index;return{payload:u.payload,feedIndex:l,feedIndexNext:l.next()}};return{download:n,downloadPayload:async a=>{if(a?.index===void 0)return xa(t,r,e);const u=await cR(t,r,e,a.index),l=u.span.toBigInt()<=4096n?u.payload:await kb(t,new ia(u.address)),h=typeof a.index=="number"?Gt.fromBigInt(BigInt(a.index)):a.index;return{payload:l,feedIndex:h,feedIndexNext:h.next()}},downloadReference:async a=>{let u=a?.index;u===void 0&&(u=(await rR(t,r,e)).feedIndex);const l=await n({...a,index:u});return{reference:new Oe(l.payload.toUint8Array()),feedIndex:l.feedIndex,feedIndexNext:l.feedIndexNext??l.feedIndex.next()}},owner:r,topic:e}}function uR(t,e,r){const n=async(o,a,u)=>sR(t,r,e,a,o,u),i=async(o,a,u)=>oR(t,r,e,a,o,u);return{...Db(t,e,r.publicKey().address()),upload:n,uploadReference:n,uploadPayload:i}}async function lR(t,e,r,n){try{return await t.downloadChunk(e,r,n),!0}catch(i){const o=$.Objects.getDeep(i,"status");if(o===404||o===500)return!1;throw i}}function fR(t,e,r){const n=r.toBigInt(),i=[];for(let o=0n;o<=n;o++)i.push(Oh(t,e,Gt.fromBigInt(o)));return i}async function hR(t,e,r,n,i,o){const a=fR(e,r,n).map(async u=>lR(t,u,i,o));return(await Promise.all(a)).every(u=>u)}function dR(t){return Array.isArray(t)?t.every(e=>typeof e=="object"&&e.path&&e.size!==void 0):!1}function Fb(t){if(!dR(t))throw new Tr("invalid collection",t)}function Ub(t){if(t.webkitRelativePath&&t.webkitRelativePath!=="")return t.webkitRelativePath.replace(/.*?\//i,"");if(t.name)return t.name;throw new TypeError("file is not valid File object")}function pR(t){return Array.from(t).map(e=>({path:Ub(e),size:e.size,file:e}))}class mR{constructor(){this.pieces=[],this.currentFileSize=0}get output(){return this.pieces.reduce((e,r)=>{const n=new Uint8Array(e.length+r.length);return n.set(e),n.set(r,e.length),n})}beginFile(e,r){const{name:n,prefix:i,longLink:o}=gR(e);if(o){const l=new TextEncoder().encode(e+"\0");this.pieces.push(yR(l.length)),this.pieces.push(l);const h=l.length%512===0?0:512-l.length%512;h>0&&this.pieces.push(new Uint8Array(h))}const a=bR(n,i,r);this.pieces.push(a),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(xR())}}function gR(t){if(t.length<=100)return{name:t,prefix:"",longLink:!1};for(let n=t.length-1;n>=0;n--)if(t[n]==="/"){const i=t.substring(n+1),o=t.substring(0,n);if(i.length<=100&&o.length<=155)return{name:i,prefix:o,longLink:!1}}const e=t.lastIndexOf("/");return{name:(e>=0?t.substring(e+1):t).slice(0,100),prefix:"",longLink:!0}}function yR(t){const e=new TextEncoder;function r(o,a,u){const l=e.encode(o);n.set(l.slice(0,u),a)}const n=new Uint8Array(512);n.fill(0),r("././@LongLink",0,100),r("0000644\0",100,8),r("0000000\0",108,8),r("0000000\0",116,8),r(t.toString(8).padStart(11,"0")+"\0",124,12),r("00000000000\0",136,12),r(" ",148,8),r("L",156,1),r("ustar\0\0",257,8);let i=0;for(let o=0;o<512;o++)i+=n[o];return r(i.toString(8).padStart(6,"0")+"\0 ",148,8),n}function bR(t,e,r){const n=new TextEncoder;function i(l,h,d){const m=n.encode(l);o.set(m.slice(0,d),h)}const o=new Uint8Array(512);o.fill(0,0,512),i(t.slice(0,100).padEnd(100,"\0"),0,100),i("0000777\0",100,8),i("0001750\0",108,8),i("0001750\0",116,8),i(r.toString(8).padStart(11,"0")+"\0",124,12);const a=Math.floor(new Date().getTime()/1e3);i(a.toString(8).padStart(11,"0")+"\0",136,12),i(" ",148,8),i("0",156,1),i("ustar\0\0",257,8),e&&i(e.slice(0,155).padEnd(155,"\0"),345,155);let u=0;for(let l=0;l<512;l++)u+=o[l];return i(u.toString(8).padStart(6,"0")+"\0 ",148,8),o}function xR(){return new Uint8Array(1024)}async function wR(t,e){for(const r of t)if(r.file)e.beginFile(r.path,r.file.size),await e.appendFile(new Uint8Array(await bb(r.file))),await e.endFile();else throw new Error("Invalid collection item")}const AR="bzz";async function ER(t,e,r,n){const i=new mR;return await wR(e,i),await i.end(),await he(t,{method:"post",url:AR,data:i.output,responseType:"json",headers:{"content-type":"application/x-tar","swarm-collection":"true",...$t(r,n)}})}const Ph="bzz";async function _m(t,e,r,n,i){xb(e)&&!i?.contentType&&(i||(i={}),i.contentType="application/octet-stream");const o=await he(t,{method:"post",url:Ph,data:e,headers:$t(r,i),params:{name:n},responseType:"json"});return{reference:ii.parse(o.data).reference,tagUid:o.headers["swarm-tag"]?vn(o.headers["swarm-tag"]):void 0,historyAddress:o.headers["swarm-act-history-address"]?$.Optional.of(new Oe(o.headers["swarm-act-history-address"])):$.Optional.empty()}}async function vR(t,e,r="",n){const i=await he(t,{method:"GET",responseType:"arraybuffer",url:`${Ph}/${e}/${r}`,headers:$t(null,n)});return{...vb(i.headers),data:new Ue(i.data)}}async function RR(t,e,r="",n){e=new Oe(e);const i=await he(t,{method:"GET",responseType:"stream",url:`${Ph}/${e}/${r}`,headers:$t(null,n)});return{...vb(i.headers),data:i.data}}async function Yl(t,e,r,n){Fb(e);const i=await ER(t,e,r,n);return{reference:ii.parse(i.data).reference,tagUid:i.headers["swarm-tag"]?vn(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?$.Optional.of(new Oe(i.headers["swarm-act-history-address"])):$.Optional.empty()}}const Lb=ve({peer:ce(),balance:ce().transform(t=>Fe.fromPLUR(He(t,{name:"balance"})))}),Mb=ve({balances:Ft(Lb)}),zb=Lb,Vb="balances",Gb="consumed";async function TR(t){const e=await he(t,{url:Vb,responseType:"json"});return Mb.parse(e.data)}async function BR(t,e){const r=await he(t,{url:`${Vb}/${e}`,responseType:"json"});return zb.parse(r.data)}async function SR(t){const e=await he(t,{url:Gb,responseType:"json"});return Mb.parse(e.data)}async function OR(t,e){const r=await he(t,{url:`${Gb}/${e}`,responseType:"json"});return zb.parse(r.data)}const qs=ve({beneficiary:ce().transform(t=>new Vt(t)),chequebook:ce().transform(t=>new Vt(t)),payout:ce().transform(t=>Fe.fromPLUR(He(t,{name:"payout"})))}),PR=ve({recipient:ce(),lastPayout:ce().transform(t=>Fe.fromPLUR(He(t,{name:"lastPayout"}))),bounced:Qe()}),IR=ve({chequebookAddress:ce().transform(t=>new Vt(t))}),kR=ve({availableBalance:ce().transform(t=>Fe.fromPLUR(He(t,{name:"availableBalance"}))),totalBalance:ce().transform(t=>Fe.fromPLUR(He(t,{name:"totalBalance"})))}),NR=ve({peer:ce(),uncashedAmount:ce().transform(t=>Fe.fromPLUR(He(t,{name:"uncashedAmount"}))),transactionHash:ce().nullish().transform(t=>t??null),lastCashedCheque:qs.nullish().transform(t=>t??null),result:PR.nullish().transform(t=>t??null)}),CR=ve({peer:ce(),lastreceived:qs.nullish().transform(t=>t??null),lastsent:qs.nullish().transform(t=>t??null)}),_R=ve({lastcheques:Ft(ve({peer:ce(),lastreceived:qs.nullish().transform(t=>t??null),lastsent:qs.nullish().transform(t=>t??null)}))}),Ih=ve({transactionHash:ce().transform(t=>new Qr(t))}),Pn="chequebook";async function DR(t){const e=await he(t,{url:Pn+"/address",responseType:"json"});return IR.parse(e.data)}async function FR(t){const e=await he(t,{url:Pn+"/balance",responseType:"json"});return kR.parse(e.data)}async function UR(t,e){const r=await he(t,{url:Pn+`/cashout/${e}`,responseType:"json"});return NR.parse(r.data)}async function LR(t,e,r){const n=await he(t,{method:"post",url:Pn+`/cashout/${e}`,responseType:"json",headers:$t(null,r)});return Ih.parse(n.data).transactionHash}async function MR(t,e){const r=await he(t,{url:Pn+`/cheque/${e}`,responseType:"json"});return CR.parse(r.data)}async function zR(t){const e=await he(t,{url:Pn+"/cheque",responseType:"json"});return _R.parse(e.data)}async function VR(t,e,r){const n={};r&&(n["gas-price"]=r.toString());const i=await he(t,{method:"post",url:Pn+"/deposit",responseType:"json",params:{amount:e.toString(10)},headers:n});return Ih.parse(i.data).transactionHash}async function GR(t,e,r){const n={};r&&(n["gas-price"]=r.toString());const i=await he(t,{method:"post",url:Pn+"/withdraw",responseType:"json",params:{amount:e.toString(10)},headers:n});return Ih.parse(i.data).transactionHash}const $b=ve({address:ce(),fullNode:Qe()}),$R=ve({population:pe(),connected:pe(),connectedPeers:Ft(ve({address:ce()})).nullish().transform(t=>t??[]),disconnectedPeers:Ft(ve({address:ce()})).nullish().transform(t=>t??[])}),jR=Gy(ce(),$R),HR=ve({overlay:ce().transform(t=>new vr(t)),underlay:Ft(ce()),ethereum:ce().transform(t=>new Vt(t)),publicKey:ce().transform(t=>new br(t)),pssPublicKey:ce().transform(t=>new br(t))}),qR=ve({peers:Ft($b)}),ZR=ve({peers:Ft($b)}),KR=ve({baseAddr:ce(),population:pe(),connected:pe(),timestamp:ce(),nnLowWatermark:pe(),depth:pe(),reachability:ce(),networkAvailability:ce(),bins:jR});async function WR(t){const e=await he(t,{url:"addresses",responseType:"json"});return HR.parse(e.data)}async function JR(t){const e=await he(t,{url:"peers",responseType:"json"});return qR.parse(e.data).peers}async function QR(t){const e=await he(t,{url:"blocklist",responseType:"json"});return ZR.parse(e.data).peers}async function YR(t,e){return(await he(t,{url:`peers/${e}`,responseType:"json",method:"DELETE"})).data}async function XR(t){const e=await he(t,{url:"topology",responseType:"json"});return KR.parse(e.data)}async function eT(t,e){return(await he(t,{url:`pingpong/${e}`,responseType:"json",method:"POST"})).data}const jb=ve({peer:ce(),sent:ce().transform(t=>Fe.fromPLUR(He(t,{name:"sent"}))),received:ce().transform(t=>Fe.fromPLUR(He(t,{name:"received"})))}),tT=jb,rT=ve({totalSent:ce().transform(t=>Fe.fromPLUR(He(t,{name:"totalSent"}))),totalReceived:ce().transform(t=>Fe.fromPLUR(He(t,{name:"totalReceived"}))),settlements:Ft(jb)}),Hb="settlements";async function nT(t,e){const r=await he(t,{url:`${Hb}/${e}`,responseType:"json"});return tT.parse(r.data)}async function iT(t){const e=await he(t,{url:Hb,responseType:"json"});return rT.parse(e.data)}const sT=ve({stakedAmount:ce().transform(t=>Fe.fromPLUR(He(t,{name:"stakedAmount"})))}),oT=ve({withdrawableAmount:ce().transform(t=>Fe.fromPLUR(He(t,{name:"withdrawableAmount"})))}),kh=ve({txHash:ce().transform(t=>new Qr(t))}),aT=ve({minimumGasFunds:ce().transform(t=>ut.fromWei(He(t,{name:"minimumGasFunds"}))),hasSufficientFunds:Qe(),isFrozen:Qe(),isFullySynced:Qe(),phase:ce(),round:pe(),lastWonRound:pe(),lastPlayedRound:pe(),lastFrozenRound:pe(),lastSelectedRound:pe(),lastSampleDurationSeconds:pe(),block:pe(),reward:ce().transform(t=>Fe.fromPLUR(He(t,{name:"reward"}))),fees:ce().transform(t=>ut.fromWei(He(t,{name:"fees"}))),isHealthy:Qe()}),uo="stake",cT="redistributionstate";async function uT(t){const e=await he(t,{method:"get",responseType:"json",url:`${uo}`});return sT.parse(e.data).stakedAmount}async function lT(t){const e=await he(t,{method:"get",responseType:"json",url:`${uo}/withdrawable`});return oT.parse(e.data).withdrawableAmount}async function fT(t){const e=await he(t,{method:"delete",responseType:"json",url:`${uo}/withdrawable`});return kh.parse(e.data).txHash}async function hT(t){const e=await he(t,{method:"delete",responseType:"json",url:uo});return kh.parse(e.data).txHash}async function dT(t,e,r){const n=await he(t,{method:"post",responseType:"json",url:`${uo}/${e}`,headers:$t(null,r)});return kh.parse(n.data).txHash}async function pT(t){const e=await he(t,{method:"get",responseType:"json",url:cT});return aT.parse(e.data)}const qb=ve({batchID:ce(),utilization:pe(),utilizationRatio:pe().optional(),usable:Qe(),label:ce(),depth:pe(),amount:ce(),bucketDepth:pe(),blockNumber:pe(),immutableFlag:Qe(),batchTTL:pe()}),Zb=ve({batchID:ce().transform(t=>new et(t)),batchTTL:pe(),bucketDepth:pe(),depth:pe(),immutable:Qe(),owner:ce().transform(t=>new Vt(t)),start:pe(),value:ce().transform(t=>He(t,{name:"value"}))}),mT=ve({batches:Ft(Zb)}),gT=ve({stamps:Ft(qb)}),yT=qb,bT=ve({depth:pe(),bucketDepth:pe(),bucketUpperBound:pe(),buckets:Ft(ve({bucketID:pe(),collisions:pe()}))}),Nh=ve({batchID:ce().transform(t=>new et(t))}),oi="stamps",Kb="batches";async function Dm(t){const e=await he(t,{method:"get",url:`${Kb}`,responseType:"json"});return mT.parse(e.data).batches}async function xT(t,e){const r=await he(t,{method:"get",url:`${Kb}/${e}`,responseType:"json"});return Zb.parse(r.data)}async function Fm(t){const e=await he(t,{method:"get",url:`${oi}`,responseType:"json"});return gT.parse(e.data).stamps.map(r=>Eb(r))}async function wT(t,e,r,n){const i=await he(t,{method:"get",url:`${oi}/${e}`,responseType:"json"});return Eb(yT.parse(i.data),r,n)}async function AT(t,e){const r=await he(t,{method:"get",url:`${oi}/${e}/buckets`,responseType:"json"});return bT.parse(r.data)}async function ET(t,e,r,n){const i={};n?.gasPrice&&(i["gas-price"]=n.gasPrice.toString()),n?.immutableFlag!==void 0&&(i.immutable=String(n.immutableFlag));const o=await he(t,{method:"post",url:`${oi}/${e}/${r}`,responseType:"json",params:{label:n?.label},headers:i});return Nh.parse(o.data).batchID}async function vT(t,e,r){await he(t,{method:"patch",url:`${oi}/${e}`,responseType:"json",data:{label:r}})}async function RT(t,e,r){const n=await he(t,{method:"patch",url:`${oi}/topup/${e}/${r}`,responseType:"json"});return Nh.parse(n.data).batchID}async function TT(t,e,r){const n=await he(t,{method:"patch",url:`${oi}/dilute/${e}/${r}`,responseType:"json"});return Nh.parse(n.data).batchID}const BT=ve({commitment:pe(),radius:pe(),storageRadius:pe(),reserveCapacityDoubling:pe()}),ST=ve({block:pe(),chainTip:pe(),totalAmount:ce().transform(t=>He(t,{name:"totalAmount"})),currentPrice:ce().transform(Number).transform(t=>S7(t)),minimumValidityBlocks:pe().optional()}),OT=ve({bzzBalance:ce().transform(t=>Fe.fromPLUR(He(t,{name:"bzzBalance"}))),nativeTokenBalance:ce().transform(t=>ut.fromWei(He(t,{name:"nativeTokenBalance"}))),chainID:pe(),chequebookContractAddress:ce(),walletAddress:ce()}),Wb=ve({transactionHash:ce().transform(t=>new Qr(t))}),PT="reservestate",Ch="wallet",IT="chainstate";async function kT(t){const e=await he(t,{method:"get",url:`${PT}`,responseType:"json"});return BT.parse(e.data)}async function NT(t){const e=await he(t,{method:"get",url:`${IT}`,responseType:"json"});return ST.parse(e.data)}async function CT(t){const e=await he(t,{method:"get",url:`${Ch}`,responseType:"json"});return OT.parse(e.data)}async function _T(t,e,r){const n=await he(t,{method:"post",url:`${Ch}/withdraw/bzz`,responseType:"json",params:{amount:e.toPLURString(),address:r.toHex()}});return Wb.parse(n.data).transactionHash}async function DT(t,e,r){const n=await he(t,{method:"post",url:`${Ch}/withdraw/nativetoken`,responseType:"json",params:{amount:e.toWeiString(),address:r.toHex()}});return Wb.parse(n.data).transactionHash}var Xl,Um;function Jb(){if(Um)return Xl;Um=1;var t={};return Xl=typeof Ce=="object"&&t&&t.NODE_DEBUG&&/\bsemver\b/i.test(t.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{},Xl}var ef,Lm;function Qb(){if(Lm)return ef;Lm=1;const t="2.0.0",e=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,i=e-6;return ef={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ef}var Go={exports:{}},Mm;function FT(){return Mm||(Mm=1,(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Qb(),o=Jb();e=t.exports={};const a=e.re=[],u=e.safeRe=[],l=e.src=[],h=e.safeSrc=[],d=e.t={};let m=0;const y="[a-zA-Z0-9-]",w=[["\\s",1],["\\d",i],[y,n]],T=B=>{for(const[A,P]of w)B=B.split(`${A}*`).join(`${A}{0,${P}}`).split(`${A}+`).join(`${A}{1,${P}}`);return B},E=(B,A,P)=>{const I=T(A),S=m++;o(B,S,A),d[B]=S,l[S]=A,h[S]=I,a[S]=new RegExp(A,P?"g":void 0),u[S]=new RegExp(I,P?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),E("MAINVERSION",`(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASE",`(?:-(${l[d.PRERELEASEIDENTIFIER]}(?:\\.${l[d.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${l[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[d.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${y}+`),E("BUILD",`(?:\\+(${l[d.BUILDIDENTIFIER]}(?:\\.${l[d.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${l[d.MAINVERSION]}${l[d.PRERELEASE]}?${l[d.BUILD]}?`),E("FULL",`^${l[d.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${l[d.MAINVERSIONLOOSE]}${l[d.PRERELEASELOOSE]}?${l[d.BUILD]}?`),E("LOOSE",`^${l[d.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${l[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${l[d.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:${l[d.PRERELEASE]})?${l[d.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:${l[d.PRERELEASELOOSE]})?${l[d.BUILD]}?)?)?`),E("XRANGE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),E("COERCE",`${l[d.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",l[d.COERCEPLAIN]+`(?:${l[d.PRERELEASE]})?(?:${l[d.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",l[d.COERCE],!0),E("COERCERTLFULL",l[d.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${l[d.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",E("TILDE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${l[d.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",E("CARET",`^${l[d.LONECARET]}${l[d.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${l[d.LONECARET]}${l[d.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${l[d.GTLT]}\\s*(${l[d.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]}|${l[d.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${l[d.XRANGEPLAIN]})\\s+-\\s+(${l[d.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${l[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[d.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Go,Go.exports)),Go.exports}var tf,zm;function UT(){if(zm)return tf;zm=1;const t=Object.freeze({loose:!0}),e=Object.freeze({});return tf=n=>n?typeof n!="object"?t:n:e,tf}var rf,Vm;function LT(){if(Vm)return rf;Vm=1;const t=/^[0-9]+$/,e=(n,i)=>{if(typeof n=="number"&&typeof i=="number")return n===i?0:n<i?-1:1;const o=t.test(n),a=t.test(i);return o&&a&&(n=+n,i=+i),n===i?0:o&&!a?-1:a&&!o?1:n<i?-1:1};return rf={compareIdentifiers:e,rcompareIdentifiers:(n,i)=>e(i,n)},rf}var nf,Gm;function MT(){if(Gm)return nf;Gm=1;const t=Jb(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:r}=Qb(),{safeRe:n,t:i}=FT(),o=UT(),{compareIdentifiers:a}=LT(),u=(h,d)=>{const m=d.split(".");if(m.length>h.length)return!1;for(let y=0;y<m.length;y++)if(a(h[y],m[y])!==0)return!1;return!0};class l{constructor(d,m){if(m=o(m),d instanceof l){if(d.loose===!!m.loose&&d.includePrerelease===!!m.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`);t("SemVer",d,m),this.options=m,this.loose=!!m.loose,this.includePrerelease=!!m.includePrerelease;const y=d.trim().match(m.loose?n[i.LOOSE]:n[i.FULL]);if(!y)throw new TypeError(`Invalid Version: ${d}`);if(this.raw=d,this.major=+y[1],this.minor=+y[2],this.patch=+y[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");y[4]?this.prerelease=y[4].split(".").map(w=>{if(/^[0-9]+$/.test(w)){const T=+w;if(T>=0&&T<r)return T}return w}):this.prerelease=[],this.build=y[5]?y[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(t("SemVer.compare",this.version,this.options,d),!(d instanceof l)){if(typeof d=="string"&&d===this.version)return 0;d=new l(d,this.options)}return d.version===this.version?0:this.compareMain(d)||this.comparePre(d)}compareMain(d){return d instanceof l||(d=new l(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 l||(d=new l(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 m=0;do{const y=this.prerelease[m],w=d.prerelease[m];if(t("prerelease compare",m,y,w),y===void 0&&w===void 0)return 0;if(w===void 0)return 1;if(y===void 0)return-1;if(y===w)continue;return a(y,w)}while(++m)}compareBuild(d){d instanceof l||(d=new l(d,this.options));let m=0;do{const y=this.build[m],w=d.build[m];if(t("build compare",m,y,w),y===void 0&&w===void 0)return 0;if(w===void 0)return 1;if(y===void 0)return-1;if(y===w)continue;return a(y,w)}while(++m)}inc(d,m,y){if(d.startsWith("pre")){if(!m&&y===!1)throw new Error("invalid increment argument: identifier is empty");if(m){const w=`-${m}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!w||w[1]!==m)throw new Error(`invalid identifier: ${m}`)}}switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",m,y);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",m,y);break;case"prepatch":this.prerelease.length=0,this.inc("patch",m,y),this.inc("pre",m,y);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",m,y),this.inc("pre",m,y);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 w=Number(y)?1:0;if(this.prerelease.length===0)this.prerelease=[w];else{let T=this.prerelease.length;for(;--T>=0;)typeof this.prerelease[T]=="number"&&(this.prerelease[T]++,T=-2);if(T===-1){if(m===this.prerelease.join(".")&&y===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(w)}}if(m){let T=[m,w];if(y===!1&&(T=[m]),u(this.prerelease,m)){const E=this.prerelease[m.split(".").length];isNaN(E)&&(this.prerelease=T)}else this.prerelease=T}break}default:throw new Error(`invalid increment argument: ${d}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return nf=l,nf}var sf,$m;function zT(){if($m)return sf;$m=1;const t=MT();return sf=(r,n)=>new t(r,n).major,sf}var VT=zT();const jm=uh(VT),GT=ve({overlay:ce(),proximity:pe(),beeMode:ce().transform(Xy),reserveSize:pe(),reserveSizeWithinRadius:pe(),pullsyncRate:pe(),storageRadius:pe(),connectedPeers:pe(),neighborhoodSize:pe(),batchCommitment:pe(),isReachable:Qe(),lastSyncedBlock:pe(),committedDepth:pe(),isWarmingUp:Qe()}),$T=ve({apiVersion:ce(),version:ce(),status:H5("ok")}),jT=ve({apiVersion:ce(),version:ce(),status:$y(["ready","notReady"])}),HT=ve({beeMode:ce().transform(Xy),chequebookEnabled:Qe(),swapEnabled:Qe()}),qT=ve({gateway:Qe()}),_h="2.8.1-7cf53193";_h.split("-")[0];const Yb="8.1.0",ZT="node",KT="status",WT="health",JT="readiness";async function QT(t){const e=await he(t,{method:"get",url:KT,responseType:"json"});return GT.parse(e.data)}async function $a(t){const e=await he(t,{method:"get",url:WT,responseType:"json"});return $T.parse(e.data)}async function YT(t){const e=await he(t,{method:"get",url:JT});return jT.parse(e.data)}async function XT(t){const e=await he(t,{method:"get",url:ZT,responseType:"json"});return HT.parse(e.data)}async function eB(t){const{version:e}=await $a(t);return e===_h}async function tB(t){const{apiVersion:e}=await $a(t);return jm(e)===jm(Yb)}async function rB(t){const{version:e,apiVersion:r}=await $a(t);return{supportedBeeVersion:_h,supportedBeeApiVersion:Yb,beeVersion:e,beeApiVersion:r}}const Xb=ve({transactionHash:ce().transform(t=>new Qr(t)),to:ce(),nonce:pe(),gasPrice:ce().transform(t=>He(t,{name:"gasPrice"})),gasLimit:pe(),data:ce(),created:ce(),description:ce(),value:ce().transform(t=>He(t,{name:"value"}))}),nB=ve({pendingTransactions:Ft(Xb)}),iB=Xb,ex=ve({transactionHash:ce().transform(t=>new Qr(t))}),ja="transactions";async function sB(t){const e=await he(t,{url:ja,responseType:"json"});return nB.parse(e.data).pendingTransactions}async function oB(t,e){const r=await he(t,{url:`${ja}/${e}`,responseType:"json"});return iB.parse(r.data)}async function aB(t,e){const r=await he(t,{method:"post",url:`${ja}/${e}`,responseType:"json"});return ex.parse(r.data).transactionHash}async function cB(t,e,r){const n={};r&&(n["gas-price"]=r.toString());const i=await he(t,{method:"delete",headers:n,url:`${ja}/${e}`,responseType:"json"});return ex.parse(i.data).transactionHash}const uB=ve({issuer:ce().transform(t=>$.Binary.hexToUint8Array(t)),index:ce().transform(t=>$.Binary.hexToUint8Array(t)),timestamp:ce().transform(t=>$.Binary.hexToUint8Array(t)),signature:ce().transform(t=>$.Binary.hexToUint8Array(t))}),lB="envelope";async function fB(t,e,r){const n=await he(t,{method:"post",responseType:"json",url:`${lB}/${r}`,headers:{"swarm-postage-batch-id":e.toHex()}}),i=uB.parse(n.data);return{issuer:i.issuer,index:i.index,timestamp:i.timestamp,signature:i.signature,batchId:e}}const hB=Ft(ce().transform(t=>new br(t))),tx=ve({ref:ce().transform(t=>new Oe(t)),historyref:ce().transform(t=>new Oe(t))}),Dh="grantee";async function dB(t,e){const r=await he(e,{method:"get",url:`${Dh}/${t}`,responseType:"json"});return{status:r.status,statusText:r.statusText,grantees:hB.parse(r.data)}}async function pB(t,e,r){const n=await he(t,{method:"post",url:Dh,data:{grantees:r.map(o=>o.toCompressedHex())},headers:$t(e),responseType:"json"}),i=tx.parse(n.data);return{status:n.status,statusText:n.statusText,ref:i.ref,historyref:i.historyref}}async function mB(t,e,r,n,i){const o=await he(i,{method:"patch",url:`${Dh}/${e}`,data:{add:n.add?.map(u=>u.toCompressedHex()),revoke:n.revoke?.map(u=>u.toCompressedHex())},headers:{...$t(t),"swarm-act-history-address":r.toHex()},responseType:"json"}),a=tx.parse(o.data);return{status:o.status,statusText:o.statusText,ref:a.ref,historyref:a.historyref}}var of,Hm;function gB(){if(Hm)return of;Hm=1;var t=null;return typeof WebSocket<"u"?t=WebSocket:typeof MozWebSocket<"u"?t=MozWebSocket:typeof Ir<"u"?t=Ir.WebSocket||Ir.MozWebSocket:typeof window<"u"?t=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(t=self.WebSocket||self.MozWebSocket),of=t,of}var yB=gB();const wa=uh(yB),qm="gsoc";async function bB(t,e,r,n){return Rh(t,e,r,n)}function xB(t,e,r){const n=t.replace(/^http/i,"ws");return $.System.whereAmI()==="browser"?new wa(`${n}/${qm}/subscribe/${e.toHex()}`):new wa(`${n}/${qm}/subscribe/${e.toHex()}`,{headers:r})}const wB=ve({references:Ft(ce()).nullable()}),Ha="pins";async function AB(t,e){await he(t,{method:"post",responseType:"json",url:`${Ha}/${e}`})}async function EB(t,e){await he(t,{method:"delete",responseType:"json",url:`${Ha}/${e}`})}async function vB(t,e){const r=await he(t,{method:"get",responseType:"json",url:`${Ha}/${e}`});return ii.parse(r.data)}async function RB(t){const e=await he(t,{method:"get",responseType:"json",url:`${Ha}`}),{references:r}=wB.parse(e.data);return(r??[]).map(n=>new Oe(n))}const Uf="pss";async function Zm(t,e,r,n,i,o){await he(t,{method:"post",url:`${Uf}/send/${e}/${r}`,data:n,responseType:"json",params:{recipient:o},headers:$t(i)})}function TB(t,e,r){const n=t.replace(/^http/i,"ws");return $.System.whereAmI()==="browser"?new wa(`${n}/${Uf}/subscribe/${e.toHex()}`):new wa(`${n}/${Uf}/subscribe/${e.toHex()}`,{headers:r})}const BB=ve({durationSeconds:pe()}),SB="rchash";async function OB(t,e,r,n){const i=await he(t,{responseType:"json",url:`${SB}/${e}/${r}/${n}`});return BB.parse(i.data).durationSeconds}async function Km(t){await he(t,{url:"",responseType:"text"})}async function PB(t){try{const e=await he(t,{url:"/gateway"});return qT.parse(e.data).gateway}catch{return!1}}const IB=ve({isRetrievable:Qe()}),rx="stewardship";async function kB(t,e,r){await he(t,{method:"put",url:`${rx}/${r}`,headers:{"swarm-postage-batch-id":e.toHex()}})}async function NB(t,e){e=new Oe(e);const r=await he(t,{method:"get",responseType:"json",url:`${rx}/${e}`});return IB.parse(r.data).isRetrievable}const Fh=ve({address:ce().nullish().transform(t=>t??""),seen:pe(),sent:pe(),split:pe(),startedAt:ce(),stored:pe(),synced:pe(),uid:pe()}),CB=ve({tags:Ft(Fh)}),lo="tags";async function _B(t){const e=await he(t,{method:"post",url:lo,responseType:"json"});return Fh.parse(e.data)}async function DB(t,e){const r=await he(t,{url:`${lo}/${e}`,responseType:"json"});return Fh.parse(r.data)}async function FB(t,e,r){const n=await he(t,{url:lo,params:{offset:e,limit:r},responseType:"json"});return CB.parse(n.data).tags}async function UB(t,e){await he(t,{method:"delete",url:`${lo}/${e}`})}async function LB(t,e,r){await he(t,{method:"patch",url:`${lo}/${e}`,data:{reference:r}})}const Lf=yh("bee-js:manifest"),sa=new TextEncoder,Us=new TextDecoder,MB=2,zB=4,VB=8,nx=16,af=new Uint8Array([47]),GB="5768b3b6a7db56d21d1abff40d41cebfc83448fed8d7e9b06ec0d3b073f28f7b",Wm=$.Binary.hexToUint8Array(GB);class En{constructor(e,r){this.prefix=e,this.node=r}static split(e,r){const n=$.Binary.commonPrefix(e.prefix,r.prefix);if(n.length===e.prefix.length){const u=r.prefix.slice(n.length);return r.node.path=r.prefix.slice(n.length),r.prefix=r.prefix.slice(n.length),r.node.parent=e.node,e.node.forks.set(u[0],r),e}if(n.length===r.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=r.node,r.node.forks.set(u[0],e),r}const i=new Wn({path:n}),o=new En(e.prefix.slice(n.length),e.node),a=new En(r.prefix.slice(n.length),r.node);return e.node.path=e.prefix.slice(n.length),r.node.path=r.prefix.slice(n.length),e.prefix=e.prefix.slice(n.length),r.prefix=r.prefix.slice(n.length),i.forks.set(o.prefix[0],o),i.forks.set(a.prefix[0],a),o.node.parent=i,a.node.parent=i,new En(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($.Binary.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),Lf("marshalling fork",{prefixLength:this.prefix.length,prefix:Us.decode(this.prefix),address:$.Binary.uint8ArrayToHex(this.node.selfAddress)}),this.node.metadata){const r=$.Binary.padEndToMultiple(new Uint8Array([0,0,...sa.encode(JSON.stringify(this.node.metadata))]),32,10),n=$.Binary.numberToUint16(r.length-2,"BE");r.set(n,0),e.push(r)}return $.Binary.concatBytes(...e)}static unmarshal(e,r){const n=$.Binary.uint8ToNumber(e.read(1)),i=$.Binary.uint8ToNumber(e.read(1)),o=e.read(i);i<30&&e.read(30-i);const a=e.read(r);Lf("unmarshalling fork",{type:n,prefixLength:i,prefix:Us.decode(o),addressLength:r,address:$.Binary.uint8ArrayToHex(a)});let u;if($B(n,nx)){const l=$.Binary.uint16ToNumber(e.read(2),"BE");u=JSON.parse(Us.decode(e.read(l)))}return new En(o,new Wn({selfAddress:a,metadata:u,path:o}))}}class Wn{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 $.Binary.concatBytes(this.parent?.fullPath??new Uint8Array(0),this.path)}get fullPathString(){return Us.decode(this.fullPath)}getRootMetadata(){const e=this.find("/");return e&&e.metadata?$.Optional.of(e.metadata):$.Optional.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,r){const n=this.find("/");if(!n||!n.metadata)return $.Optional.empty();const i=n.metadata["swarm-feed-owner"],o=n.metadata["swarm-feed-topic"];return!i||!o?$.Optional.empty():$.Optional.of(await e.fetchLatestFeedUpdate(o,i,r))}async marshal(){for(const o of this.forks.values())o.node.selfAddress||(o.node.selfAddress=(await o.node.calculateSelfAddress()).toUint8Array());const e=new Uint8Array(32);e.set(Wm,0),e.set($.Binary.equals(this.targetAddress,Ai)&&$.Binary.equals(this.path,new Uint8Array([47]))?$.Binary.numberToUint8(0):$.Binary.numberToUint8(this.targetAddress.length),31);const r=new Uint8Array(32);for(const o of this.forks.keys())$.Binary.setBit(r,o,1,"LE");const n=[];for(let o=0;o<256;o++)$.Binary.getBit(r,o,"LE")&&n.push(this.forks.get(o).marshal());const i=$.Binary.xorCypher($.Binary.concatBytes(e,$.Binary.equals(this.targetAddress,Ai)&&$.Binary.equals(this.path,new Uint8Array([47]))?new Uint8Array(0):this.targetAddress,r,...n),this.obfuscationKey);return $.Binary.concatBytes(this.obfuscationKey,i)}static async unmarshal(e,r,n,i){r=new Oe(r);const o=(await e.downloadData(r,n,i)).toUint8Array();return this.unmarshalFromData(o,r.toUint8Array())}static unmarshalFromData(e,r){const n=e.subarray(0,32),i=$.Binary.xorCypher(e.subarray(32),n),o=new $.Uint8ArrayReader(i),a=o.read(31);if(!$.Binary.equals(a,Wm.slice(0,31)))throw new Error("MantarayNode#unmarshal invalid version hash");const u=$.Binary.uint8ToNumber(o.read(1)),l=u?o.read(u):Ai,h=new Wn({selfAddress:r,targetAddress:l,obfuscationKey:n}),d=o.read(32);for(let m=0;m<256;m++)if($.Binary.getBit(d,m,"LE")){const y=En.unmarshal(o,r.length);h.forks.set(m,y),y.node.parent=h}return h}addFork(e,r,n){this.selfAddress=null,e=e instanceof Uint8Array?e:sa.encode(e),Lf("adding fork",{path:Us.decode(e),reference:new Oe(r).represent()});let i=this;for(;e.length;){const o=e.slice(0,30);e=e.slice(30);const a=e.length===0,[u,l]=i.findClosest(o),h=o.slice(l.length);if(l.length&&(i=u),!h.length)continue;const d=new En(h,new Wn({targetAddress:a?new Oe(r).toUint8Array():void 0,metadata:a?n:void 0,path:h})),m=u.forks.get(h[0]);if(m){const y=En.split(d,m);i.forks.set(h[0],y),y.node.parent=i,i.selfAddress=null,i=d.node}else i.forks.set(h[0],d),d.node.parent=i,i.selfAddress=null,i=d.node}}removeFork(e){if(this.selfAddress=null,e=e instanceof Uint8Array?e:sa.encode(e),e.length===0)throw Error("MantarayNode#removeFork [path] parameter cannot be empty");const r=this.find(e);if(!r)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 o of r.forks.values())n.addFork($.Binary.concatBytes(r.path,o.prefix),o.node.targetAddress,o.node.metadata)}async calculateSelfAddress(){return this.selfAddress?new Oe(this.selfAddress):new Oe((await $.MerkleTree.root(await this.marshal())).hash())}async saveRecursively(e,r,n,i){for(const a of this.forks.values()){const u=await a.node.saveRecursively(e,r,n,i);if(n?.act){let l;u.historyAddress.ifPresent(h=>l=h),l&&(a.node.metadata||(a.node.metadata={}),a.node.metadata["swarm-act-history-address"]=l.toHex())}}const o=await e.uploadData(r,await this.marshal(),n,i);return this.selfAddress=o.reference.toUint8Array(),o}async loadRecursively(e,r,n){for(const i of this.forks.values()){if(!i.node.selfAddress)throw Error("MantarayNode#loadRecursively fork.node.selfAddress is not set");let o=r;i.node.metadata&&i.node.metadata["swarm-act-history-address"]&&(o={...r,actHistoryAddress:i.node.metadata["swarm-act-history-address"]});const a=await Wn.unmarshal(e,i.node.selfAddress,o,n);i.node.targetAddress=a.targetAddress,i.node.forks=a.forks,i.node.path=i.prefix,i.node.parent=this,await i.node.loadRecursively(e,r,n)}}find(e){const[r,n]=this.findClosest(e);return n.length===e.length?r:null}findClosest(e,r=new Uint8Array){if(e=e instanceof Uint8Array?e:sa.encode(e),e.length===0)return[this,r];const n=this.forks.get(e[0]);return n&&$.Binary.commonPrefix(n.prefix,e).length===n.prefix.length?n.node.findClosest(e.slice(n.prefix.length),$.Binary.concatBytes(r,n.prefix)):[this,r]}collect(e=[]){for(const r of this.forks.values())$.Binary.equals(r.node.targetAddress,Ai)||e.push(r.node),r.node.collect(e);return e}collectAndMap(){const e=this.collect(),r={};for(const n of e)r[n.fullPathString]=new Oe(n.targetAddress).toHex();return r}determineType(){let e=0;return(!$.Binary.equals(this.targetAddress,Ai)||$.Binary.equals(this.path,af))&&(e|=MB),this.forks.size>0&&(e|=zB),$.Binary.indexOf(this.path,af)!==-1&&!$.Binary.equals(this.path,af)&&(e|=VB),this.metadata&&(e|=nx),e}}function $B(t,e){return(t&e)===e}function jB(t){function n(o){if(o<=1)return o;const a=Math.ceil(o/128);return o+n(a)}const i=Math.ceil(t/4096);return n(i)}const HB={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 qB(t){throw new Error("Hashing directories is not supported in browsers!")}async function ZB(t,e,r,n,i,o){throw new Error("Streaming directories is not supported in browsers!")}async function KB(t,e,r,n,i,o){const a=o?.signal;if(a?.aborted)throw new Error("Request aborted");const u=new $.AsyncQueue(64,64);let l=0,h=0;for(const y of e)l+=jB(y.size);r=new et(r);async function d(y){await u.enqueue(async()=>{if(!a?.aborted)try{await t.uploadChunk(r,y.build(),i,o),n?.({total:l,processed:++h})}catch(w){if(a?.aborted)return;throw w}})}const m=new Wn;for(const y of e){if(a?.aborted)throw new Error("Request aborted");const w=await new Promise((B,A)=>{const P=new $.MerkleTree(d);let I=0;const S=new FileReader;S.onerror=()=>{A(S.error)};const N=async()=>{if(a?.aborted){A(new Error("Request aborted"));return}if(I>=y.size){const F=await P.finalize();B(F);return}const _=y.slice(I,I+4096);S.readAsArrayBuffer(_)};S.onload=async _=>{if(!_.target){A("No event target");return}const F=_.target.result;F&&(await P.append(new Uint8Array(F)),I+=4096),N()},N()});await u.drain();const{filename:T,extension:E}=$.Strings.parseFilename(y.name);m.addFork(Ub(y),w.hash(),{"Content-Type":WB(HB[E.toLowerCase()]||"application/octet-stream"),Filename:T}),y.name==="index.html"&&m.addFork("/",Ai,{"website-index-document":"index.html"})}if(a?.aborted)throw new Error("Request aborted");return m.saveRecursively(t,r,i,o)}function WB(t){return["text/html","text/css"].includes(t)?`${t}; charset=utf-8`:t}async function JB(t){throw new Error("Creating Collection from File System is not supported in browsers!")}async function Jm(t){if(typeof t=="string")return new TextEncoder().encode(t);if(t instanceof ArrayBuffer)return new Uint8Array(t);if(t instanceof Blob)return new Uint8Array(await new Response(t).arrayBuffer());throw new TypeError("unknown websocket data type")}const QB=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"];function YB(t){try{if(typeof t!="string")return!1;const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function XB(t){if(typeof t!="string"||QB.includes(t))return!1;const e=parseInt(t,10);return e>0&&e<65536&&!isNaN(e)}function eS(t){if(!YB(t))throw new Tr("URL is not valid!",t);const e=new URL(t).port;if(e&&!XB(e))throw new Tr("Port in URL is considered bad port and cannot be used!",e)}function tS(t){return t.endsWith("/")?t.slice(0,-1):t}class PN{constructor(e,r){eS(e),this.url=tS(e),r?.signer&&(this.signer=new qr(r.signer)),this.network=r?.network??"gnosis",this.requestOptions={baseURL:this.url,timeout:r?.timeout??0,headers:r?.headers,onRequest:r?.onRequest,httpAgent:r?.httpAgent,httpsAgent:r?.httpsAgent}}async uploadData(e,r,n,i){return e=new et(e),km(r),n&&(n=y7.parse(n)),Ib(this.getRequestOptionsForCall(i),r,e,n)}async probeData(e,r){return e=new Oe(e),X7(this.getRequestOptionsForCall(r),e)}async downloadData(e,r,n){return r&&(r=xn.parse(r)),kb(this.getRequestOptionsForCall(n),new ia(e),r)}async downloadReadableData(e,r,n){return r&&(r=xn.parse(r)),eR(this.getRequestOptionsForCall(n),new ia(e),r)}async uploadChunk(e,r,n,i){const o="identifier"in r&&"signature"in r&&"owner"in r;if(r=r instanceof Uint8Array?r:r.data,n&&(n=js.parse(n)),r.length<Tt.LENGTH)throw new Tr(`Chunk has to have size of at least ${Tt.LENGTH}.`,r);if(!o&&r.length>Lo+Tt.LENGTH)throw new Tr(`Content Addressed Chunk must not exceed ${Lo+Tt.LENGTH} bytes.`,r);if(o&&r.length>Lo+Tt.LENGTH+Bn.LENGTH+Pt.LENGTH)throw new Tr(`Single Owner Chunk must not exceed ${Lo+Tt.LENGTH+Bn.LENGTH+Pt.LENGTH} bytes.`,r);return q7(this.getRequestOptionsForCall(i),r,e,n)}async downloadChunk(e,r,n){return e=new Oe(e),r&&(r=xn.parse(r)),co(this.getRequestOptionsForCall(n),e,r)}async createGrantees(e,r,n){return e=new et(e),r=r.map(i=>new br(i)),pB(this.getRequestOptionsForCall(n),e,r)}async getGrantees(e,r){return e=new Oe(e),dB(e,this.getRequestOptionsForCall(r))}async patchGrantees(e,r,n,i,o){e=new et(e),r=new Oe(r),n=new Oe(n);const a={add:i.add?.map(u=>new br(u))??[],revoke:i.revoke?.map(u=>new br(u))??[]};return mB(e,r,n,a,this.getRequestOptionsForCall(o))}async uploadFile(e,r,n,i,o){if(e=new et(e),T7(r),i&&(i=b7.parse(i)),n&&typeof n!="string")throw new TypeError("name has to be string or undefined!");if(yb(r)){const a=await bb(r),u=n??r.name,l=r.type,h={...i,contentType:l};return _m(this.getRequestOptionsForCall(o),a,e,u,h)}else return _m(this.getRequestOptionsForCall(o),r,e,n,i)}async downloadFile(e,r="",n,i){return n&&(n=xn.parse(n)),vR(this.getRequestOptionsForCall(i),new ia(e),r,n)}async downloadReadableFile(e,r="",n,i){return e=new Oe(e),n&&(n=xn.parse(n)),RR(this.getRequestOptionsForCall(i),e,r,n)}async uploadFiles(e,r,n,i){e=new et(e),n&&(n=Ql.parse(n));const o=pR(r);return Yl(this.getRequestOptionsForCall(i),o,e,n)}async hashDirectory(e){return qB()}async streamDirectory(e,r,n,i,o){return e=new et(e),ZB(this,r,e,n,i,this.getRequestOptionsForCall(o))}async streamFiles(e,r,n,i,o){return e=new et(e),KB(this,r,e,n,i,this.getRequestOptionsForCall(o))}async uploadCollection(e,r,n,i){return e=new et(e),Fb(r),n&&(n=Ql.parse(n)),Yl(this.getRequestOptionsForCall(i),r,e,n)}async uploadFilesFromDirectory(e,r,n,i){e=new et(e),n&&(n=Ql.parse(n));const o=await JB();return Yl(this.getRequestOptionsForCall(i),o,e,n)}async createTag(e){return _B(this.getRequestOptionsForCall(e))}async getAllTags(e,r){return e&&(e=v7.parse(e)),FB(this.getRequestOptionsForCall(r),e?.offset,e?.limit)}async retrieveTag(e,r){return e=vn(e),DB(this.getRequestOptionsForCall(r),e)}async deleteTag(e,r){return e=vn(e),UB(this.getRequestOptionsForCall(r),e)}async updateTag(e,r,n){return r=new Oe(r),e=vn(e),LB(this.getRequestOptionsForCall(n),e,r)}async pin(e,r){return e=new Oe(e),AB(this.getRequestOptionsForCall(r),e)}async unpin(e,r){return e=new Oe(e),EB(this.getRequestOptionsForCall(r),e)}async getAllPins(e){return RB(this.getRequestOptionsForCall(e))}async getPin(e,r){return e=new Oe(e),vB(this.getRequestOptionsForCall(r),e)}async reuploadPinnedData(e,r,n){e=new et(e),r=new Oe(r),await kB(this.getRequestOptionsForCall(n),e,r)}async isReferenceRetrievable(e,r){return e=new Oe(e),NB(this.getRequestOptionsForCall(r),e)}async isFeedRetrievable(e,r,n,i,o){if(e=new Vt(e),r=new Zr(r),i&&(i=xn.parse(i)),!n)try{return await this.makeFeedReader(r,e,o).download(),!0}catch(a){const u=$.Objects.getDeep(a,"status");if(u===404||u===500)return!1;throw a}return hR(this,e,r,n,i,this.getRequestOptionsForCall(o))}async pssSend(e,r,n,i,o,a){return e=new et(e),km(i),o?(o=new br(o),Zm(this.getRequestOptionsForCall(a),r,n,i,e,o)):Zm(this.getRequestOptionsForCall(a),r,n,i,e)}pssSubscribe(e,r){r=A7.parse(r);const n=TB(this.url,e,this.requestOptions.headers);let i=!1;const a={topic:e,cancel:()=>{i||(i=!0,n.terminate?n.terminate():n.close())}};return n.onmessage=async u=>{const l=await Jm(u.data);l.length&&r.onMessage(new Ue(l),a)},n.onerror=u=>{i||r.onError(new Pr(u.message),a)},n.onclose=()=>{r.onClose(a)},a}async pssReceive(e,r=0){if(typeof r!="number")throw new TypeError("timeoutMsc parameter has to be a number!");return new Promise((n,i)=>{let o;const a=this.pssSubscribe(e,{onError:u=>{clearTimeout(o),a.cancel(),i(u.message)},onMessage:u=>{clearTimeout(o),a.cancel(),n(u)},onClose:()=>{clearTimeout(o),a.cancel()}});r>0&&(o=setTimeout(()=>{a.cancel(),i(new Pr("pssReceive timeout"))},r))})}gsocMine(e,r,n=12){e=new vr(e),r=new Pt(r);const i=0xb33n;for(let o=0n;o<0xffffn;o++){const a=new qr($.Binary.numberToUint256(i+o,"BE")),u=Fs(r,a.publicKey().address());if(256-$.Binary.proximity(u.toUint8Array(),e.toUint8Array())<=256-n)return a}throw Error("Could not mine a valid signer")}async gsocSend(e,r,n,i,o,a){e=new et(e),r=new qr(r),n=new Pt(n);const l=Hs(i).toSingleOwnerChunk(n,r);return bB(this.getRequestOptionsForCall(a),l,e,o)}gsocSubscribe(e,r,n){e=new Vt(e),r=new Pt(r),n=E7.parse(n);const i=Fs(r,e),o=xB(this.url,i,this.requestOptions.headers);let a=!1;const l={address:e,cancel:()=>{a||(a=!0,o.terminate?o.terminate():o.close())}};return o.onmessage=async h=>{const d=await Jm(h.data);d.length&&n.onMessage(new Ue(d),l)},o.onerror=h=>{a||n.onError(new Pr(h.message),l)},o.onclose=()=>{n.onClose(l)},l}async createFeedManifest(e,r,n,i,o){return e=new et(e),r=new Zr(r),n=new Vt(n),i&&(i=js.parse(i)),tR(this.getRequestOptionsForCall(o),n,r,e,i)}makeFeedReader(e,r,n){return e=new Zr(e),r=new Vt(r),Db(this.getRequestOptionsForCall(n),e,r)}makeFeedWriter(e,r,n){if(e=new Zr(e),r=r?new qr(r):this.signer,!r)throw Error("No signer provided");return uR(this.getRequestOptionsForCall(n),e,r)}async fetchLatestFeedUpdate(e,r,n){return e=new Zr(e),r=new Vt(r),xa(this.getRequestOptionsForCall(n),r,e)}makeContentAddressedChunk(e,r){return Hs(e,r)}unmarshalContentAddressedChunk(e){return Pb(e)}makeSingleOwnerChunk(e,r,n,i,o){return Ob(e,r,n,i,o)}calculateSingleOwnerChunkAddress(e,r){return Fs(e,r)}unmarshalSingleOwnerChunk(e,r){return Va(e,r)}makeSOCReader(e,r){return e=new Vt(e),{owner:e,download:Y7.bind(null,this.getRequestOptionsForCall(r),e)}}makeSOCWriter(e,r){if(e=e?new qr(e):this.signer,!e)throw Error("No signer provided");return{...this.makeSOCReader(e.publicKey().address(),r),upload:Th.bind(null,this.getRequestOptionsForCall(r),e)}}async createEnvelope(e,r,n){return e=new et(e),r=new Oe(r),fB(this.getRequestOptionsForCall(n),e,r)}async rchash(e,r,n,i){return OB(this.getRequestOptionsForCall(i),e,r,n)}async checkConnection(e){return Km(this.getRequestOptionsForCall(e))}async isConnected(e){try{await Km(this.getRequestOptionsForCall(e))}catch{return!1}return!0}async isGateway(e){return PB(this.getRequestOptionsForCall(e))}async getNodeAddresses(e){return WR(this.getRequestOptionsForCall(e))}async getBlocklist(e){return QR(this.getRequestOptionsForCall(e))}async getPeers(e){return JR(this.getRequestOptionsForCall(e))}async removePeer(e,r){return e=new vr(e),YR(this.getRequestOptionsForCall(r),e)}async getTopology(e){return XR(this.getRequestOptionsForCall(e))}async pingPeer(e,r){return e=new vr(e),eT(this.getRequestOptionsForCall(r),e)}async getAllBalances(e){return TR(this.getRequestOptionsForCall(e))}async getPeerBalance(e,r){return e=new vr(e),BR(this.getRequestOptionsForCall(r),e)}async getPastDueConsumptionBalances(e){return SR(this.getRequestOptionsForCall(e))}async getPastDueConsumptionPeerBalance(e,r){return e=new vr(e),OR(this.getRequestOptionsForCall(r),e)}async getChequebookAddress(e){return DR(this.getRequestOptionsForCall(e))}async getChequebookBalance(e){return FR(this.getRequestOptionsForCall(e))}async getLastCheques(e){return zR(this.getRequestOptionsForCall(e))}async getLastChequesForPeer(e,r){return e=new vr(e),MR(this.getRequestOptionsForCall(r),e)}async getLastCashoutAction(e,r){return e=new vr(e),UR(this.getRequestOptionsForCall(r),e)}async cashoutLastCheque(e,r,n){return e=new vr(e),r&&(r=Im.parse(r)),LR(this.getRequestOptionsForCall(n),e,r)}async depositTokens(e,r,n){return this.depositBZZToChequebook(e,r,n)}async depositBZZToChequebook(e,r,n){const i=e instanceof Fe?e.toPLURString():He(e,{min:1n,name:"amount"});let o;return r&&(o=He(e,{min:0n,name:"gasPrice"})),VR(this.getRequestOptionsForCall(n),i,o)}async withdrawTokens(e,r,n){return this.withdrawBZZFromChequebook(e,r,n)}async withdrawBZZFromChequebook(e,r,n){const i=e instanceof Fe?e.toPLURString():He(e,{min:1n,name:"amount"});let o;return r&&(o=He(e,{min:0n,name:"gasPrice"})),GR(this.getRequestOptionsForCall(n),i,o)}async withdrawBZZToExternalWallet(e,r,n){return e=e instanceof Fe?e:Fe.fromPLUR(e),r=new Vt(r),_T(this.getRequestOptionsForCall(n),e,r)}async withdrawDAIToExternalWallet(e,r,n){return e=e instanceof ut?e:ut.fromWei(e),r=new Vt(r),DT(this.getRequestOptionsForCall(n),e,r)}async getSettlements(e,r){return e=new vr(e),nT(this.getRequestOptionsForCall(r),e)}async getAllSettlements(e){return iT(this.getRequestOptionsForCall(e))}async getStatus(e){return QT(this.getRequestOptionsForCall(e))}async getHealth(e){return $a(this.getRequestOptionsForCall(e))}async getReadiness(e){return YT(this.getRequestOptionsForCall(e))}async getNodeInfo(e){return XT(this.getRequestOptionsForCall(e))}async isSupportedExactVersion(e){return eB(this.getRequestOptionsForCall(e))}async isSupportedApiVersion(e){return tB(this.getRequestOptionsForCall(e))}async getVersions(e){return rB(this.getRequestOptionsForCall(e))}async getReserveState(e){return kT(this.getRequestOptionsForCall(e))}async getChainState(e){return NT(this.getRequestOptionsForCall(e))}async getWalletBalance(e){return CT(this.getRequestOptionsForCall(e))}async createPostageBatch(e,r,n,i){const o=He(e,{min:0n,name:"amount"});if(n&&(n=Pm.parse(n)),r<tp||r>rp)throw new Tr(`Depth has to be between ${tp}..${rp}`,r);const a=await this.getChainState(),u=BigInt(a.currentPrice)*17280n+1n;if(BigInt(o)<u)throw new Tr(`Amount has to be at least ${u} (1 day at current price ${a.currentPrice})`,o);const l=await ET(this.getRequestOptionsForCall(i),o,r,n);return n?.waitForUsable!==!1&&await this.waitForUsablePostageStamp(l,n?.waitForUsableTimeout),l}async buyStorage(e,r,n,i,o,a){const u=await this.getChainState(i),l=Dr(r,u.currentPrice,this.network==="gnosis"?5:15),h=yi(e,o,a);return n&&(n=Pm.parse(n)),this.createPostageBatch(l,h,n,i)}async getStorageCost(e,r,n,i,o){const a=await this.getChainState(n),u=Dr(r,a.currentPrice,this.network==="gnosis"?5:15),l=yi(e,i,o);return gi(l,u)}async extendStorage(e,r,n,i,o,a){const u=await this.getPostageBatch(e,i),l=yi(r,o,a),h=await this.getChainState(i),d=l-u.depth,m=d<=0?1n:2n**BigInt(d),y=this.network==="gnosis"?5:15,w=Dr(n,h.currentPrice,y),T=Dr(u.duration,h.currentPrice,y),B=(n.isZero()?T*m:(T+w)*m)-T;let A;if(B>0n&&(A=await this.topUpBatch(u.batchID,B,i)),d>0)return this.diluteBatch(u.batchID,l,i);if(!A)throw new Error("Nothing to extend, both size and duration are already sufficient");return A}async extendStorageSize(e,r,n,i,o){const a=await this.getChainState(n),u=await this.getPostageBatch(e,n),l=yi(r,i,o),h=l-u.depth;if(h<=0)throw new Tr("New depth has to be greater than the original depth",l);const d=Dr(u.duration,a.currentPrice,this.network==="gnosis"?5:15);return await this.topUpBatch(u.batchID,d*(2n**BigInt(h)-1n)+1n,n),this.diluteBatch(u.batchID,l,n)}async extendStorageDuration(e,r,n){const i=await this.getPostageBatch(e,n),o=await this.getChainState(n),a=Dr(r,o.currentPrice,this.network==="gnosis"?5:15);return this.topUpBatch(i.batchID,a,n)}async getExtensionCost(e,r,n,i,o,a){const u=await this.getPostageBatch(e,i),l=await this.getChainState(i),h=this.network==="gnosis"?5:15,d=n.isZero()?0n:Dr(n,l.currentPrice,h),m=yi(r,o,a),y=Dr(u.duration,l.currentPrice,h),w=gi(u.depth,y);return gi(Math.max(u.depth,m),y+d).minus(w)}async getSizeExtensionCost(e,r,n,i,o){const a=await this.getPostageBatch(e,n),u=await this.getChainState(n),l=yi(r,i,o);if(l-a.depth<=0)throw new Tr("New depth has to be greater than the original depth",l);const d=Dr(a.duration,u.currentPrice,this.network==="gnosis"?5:15),m=gi(a.depth,d);return gi(l,d).minus(m)}async getDurationExtensionCost(e,r,n){const i=await this.getPostageBatch(e,n),o=await this.getChainState(n),a=Dr(r,o.currentPrice,this.network==="gnosis"?5:15);return gi(i.depth,a)}async updatePostageBatchLabel(e,r,n){return e=new et(e),vT(this.getRequestOptionsForCall(n),e,r)}async renameStorage(e,r,n){return this.updatePostageBatchLabel(e,r,n)}async calculateTopUpForBzz(e,r,n){const i=await this.getChainState(n),o=this.network==="gnosis"?5:15,a=r.toPLURBigInt()/2n**BigInt(e),u=I7(a,i.currentPrice,o);return{amount:a,duration:u}}async topUpBatch(e,r,n){e=new et(e);const i=He(r,{min:1n,name:"amount"});return RT(this.getRequestOptionsForCall(n),e,i)}async diluteBatch(e,r,n){return e=new et(e),r=pe().int().min(18).max(255).parse(r),TT(this.getRequestOptionsForCall(n),e,r)}async getPostageBatch(e,r,n,i){return e=new et(e),wT(this.getRequestOptionsForCall(r),e,n,i)}async getGlobalPostageBatch(e,r){return e=new et(e),xT(this.getRequestOptionsForCall(r),e)}async getPostageBatchBuckets(e,r){return e=new et(e),AT(this.getRequestOptionsForCall(r),e)}async getAllPostageBatch(e){return Fm(this.getRequestOptionsForCall(e))}async getAllGlobalPostageBatch(e){return Dm(this.getRequestOptionsForCall(e))}async getPostageBatches(e){return Fm(this.getRequestOptionsForCall(e))}async getGlobalPostageBatches(e){return Dm(this.getRequestOptionsForCall(e))}async getAllPendingTransactions(e){return sB(this.getRequestOptionsForCall(e))}async getPendingTransaction(e,r){return e=new Qr(e),oB(this.getRequestOptionsForCall(r),e)}async rebroadcastPendingTransaction(e,r){return e=new Qr(e),aB(this.getRequestOptionsForCall(r),e)}async cancelPendingTransaction(e,r,n){e=new Qr(e);let i;return r&&(i=He(r,{min:0n,name:"gasPrice"})),cB(this.getRequestOptionsForCall(n),e,i)}async getStake(e){return uT(this.getRequestOptionsForCall(e))}async getWithdrawableStake(e){return lT(this.getRequestOptionsForCall(e))}async withdrawSurplusStake(e){return fT(this.getRequestOptionsForCall(e))}async migrateStake(e){return hT(this.getRequestOptionsForCall(e))}async depositStake(e,r,n){const i=e instanceof Fe?e.toPLURString():He(e,{min:1n,name:"amount"});return r&&(r=Im.parse(r)),dT(this.getRequestOptionsForCall(n),i,r)}async getRedistributionState(e){return pT(this.getRequestOptionsForCall(e))}async waitForUsablePostageStamp(e,r=24e4){for(let i=0;i<r;i+=3e3){try{if((await this.getPostageBatch(e)).usable)return}catch{}await $.System.sleepMillis(3e3)}throw new Pr("Timeout on waiting for postage stamp to become usable")}getRequestOptionsForCall(e){return e&&(e=g7.parse(e)),e?$.Objects.deepMerge2(this.requestOptions,e):this.requestOptions}}new et("0000000000000000000000000000000000000000000000000000000000000000");const IN=new Zr("0000000000000000000000000000000000000000000000000000000000000000"),Ai=new Uint8Array(32);Mt.MEDIUM;Mt.STRONG;Mt.INSANE;Mt.PARANOID;const ix="6.16.0";function rS(t,e,r){const n=e.split("|").map(o=>o.trim());for(let o=0;o<n.length;o++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error(`invalid value for type ${e}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${r}`,i.value=t,i}async function zt(t){const e=Object.keys(t);return(await Promise.all(e.map(n=>Promise.resolve(t[n])))).reduce((n,i,o)=>(n[e[o]]=i,n),{})}function Te(t,e,r){for(let n in e){let i=e[n];const o=r?r[n]:null;o&&rS(i,o,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function Ti(t,e){if(t==null)return"null";if(e==null&&(e=new Set),typeof t=="object"){if(e.has(t))return"[Circular]";e.add(t)}if(Array.isArray(t))return"[ "+t.map(r=>Ti(r,e)).join(", ")+" ]";if(t instanceof Uint8Array){const r="0123456789abcdef";let n="0x";for(let i=0;i<t.length;i++)n+=r[t[i]>>4],n+=r[t[i]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return Ti(t.toJSON(),e);switch(typeof t){case"boolean":case"number":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const r=Object.keys(t);return r.sort(),"{ "+r.map(n=>`${Ti(n,e)}: ${Ti(t[n],e)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function _t(t,e){return t&&t.code===e}function Uh(t){return _t(t,"CALL_EXCEPTION")}function ht(t,e,r){let n=t;{const o=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${Ti(r)}`);for(const a in r){if(a==="shortMessage")continue;const u=r[a];o.push(a+"="+Ti(u))}}o.push(`code=${e}`),o.push(`version=${ix}`),o.length&&(t+=" ("+o.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return Te(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Te(i,{shortMessage:n}),i}function ne(t,e,r,n){if(!t)throw ht(e,r,n)}function D(t,e,r,n){ne(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function sx(t,e,r){r==null&&(r=""),r&&(r=": "+r),ne(t>=e,"missing argument"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),ne(t<=e,"too many arguments"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const nS=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function ox(t){ne(nS.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function ai(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),ne(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function ax(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.length%2===0&&t.match(/^0x[0-9a-f]*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let o=0;o<n.length;o++)n[o]=parseInt(t.substring(i,i+2),16),i+=2;return n}D(!1,"invalid BytesLike value",e||"value",t)}function de(t,e){return ax(t,e,!1)}function Dt(t,e){return ax(t,e,!0)}function it(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&t.length!==2+2*e||e===!0&&t.length%2!==0)}function qa(t){return it(t,!0)||t instanceof Uint8Array}const Qm="0123456789abcdef";function ae(t){const e=de(t);let r="0x";for(let n=0;n<e.length;n++){const i=e[n];r+=Qm[(i&240)>>4]+Qm[i&15]}return r}function je(t){return"0x"+t.map(e=>ae(e).substring(2)).join("")}function Pi(t){return it(t,!0)?(t.length-2)/2:de(t).length}function ot(t,e,r){const n=de(t);return r!=null&&r>n.length&&ne(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),ae(n.slice(e??0,r??n.length))}function cx(t,e,r){const n=de(t);ne(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),r?i.set(n,e-n.length):i.set(n,0),ae(i)}function rn(t,e){return cx(t,e,!0)}function iS(t,e){return cx(t,e,!1)}const fo=BigInt(0),Or=BigInt(1),Bi=9007199254740991;function sS(t,e){const r=Za(t,"value"),n=BigInt(Ie(e,"width"));if(ne(r>>n===fo,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-Or){const i=(Or<<n)-Or;return-((~r&i)+Or)}return r}function ux(t,e){let r=ge(t,"value");const n=BigInt(Ie(e,"width")),i=Or<<n-Or;if(r<fo){r=-r,ne(r<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const o=(Or<<n)-Or;return(~r&o)+Or}else ne(r<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return r}function Is(t,e){const r=Za(t,"value"),n=BigInt(Ie(e,"bits"));return r&(Or<<n)-Or}function ge(t,e){switch(typeof t){case"bigint":return t;case"number":return D(Number.isInteger(t),"underflow",e||"value",t),D(t>=-Bi&&t<=Bi,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(r){D(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}D(!1,"invalid BigNumberish value",e||"value",t)}function Za(t,e){const r=ge(t,e);return ne(r>=fo,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const Ym="0123456789abcdef";function Ka(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=Ym[r>>4],e+=Ym[r&15];return BigInt(e)}return ge(t)}function Ie(t,e){switch(typeof t){case"bigint":return D(t>=-Bi&&t<=Bi,"overflow",e||"value",t),Number(t);case"number":return D(Number.isInteger(t),"underflow",e||"value",t),D(t>=-Bi&&t<=Bi,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Ie(BigInt(t),e)}catch(r){D(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}D(!1,"invalid numeric value",e||"value",t)}function oS(t){return Ie(Ka(t))}function nn(t,e){const r=Za(t,"value");let n=r.toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=Ie(e,"width");if(i===0&&r===fo)return"0x";for(ne(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length<i*2;)n="0"+n}return"0x"+n}function mt(t,e){const r=Za(t,"value");if(r===fo)return new Uint8Array(0);let n=r.toString(16);n.length%2&&(n="0"+n);const i=new Uint8Array(n.length/2);for(let o=0;o<i.length;o++){const a=o*2;i[o]=parseInt(n.substring(a,a+2),16)}return i}function Br(t){let e=ae(qa(t)?t:mt(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const Aa="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let $o=null;function aS(t){if($o==null){$o={};for(let r=0;r<Aa.length;r++)$o[Aa[r]]=BigInt(r)}const e=$o[t];return D(e!=null,"invalid base58 value","letter",t),e}const cS=BigInt(0),Mf=BigInt(58);function lx(t){const e=de(t);let r=Ka(e),n="";for(;r;)n=Aa[Number(r%Mf)]+n,r/=Mf;for(let i=0;i<e.length&&!e[i];i++)n=Aa[0]+n;return n}function uS(t){let e=cS;for(let r=0;r<t.length;r++)e*=Mf,e+=aS(t[r]);return e}function lS(t){t=atob(t);const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return de(e)}function fS(t){const e=de(t);let r="";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r)}class fx{filter;emitter;#e;constructor(e,r,n){this.#e=r,Te(this,{emitter:e,filter:n})}async removeListener(){this.#e!=null&&await this.emitter.off(this.filter,this.#e)}}function hS(t,e,r,n,i){D(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function hx(t,e,r,n,i){if(t==="BAD_PREFIX"||t==="UNEXPECTED_CONTINUE"){let o=0;for(let a=e+1;a<r.length&&r[a]>>6===2;a++)o++;return o}return t==="OVERRUN"?r.length-e-1:0}function dS(t,e,r,n,i){return t==="OVERLONG"?(D(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),hx(t,e,r))}const pS=Object.freeze({error:hS,ignore:hx,replace:dS});function mS(t,e){e==null&&(e=pS.error);const r=de(t,"bytes"),n=[];let i=0;for(;i<r.length;){const o=r[i++];if(o>>7===0){n.push(o);continue}let a=null,u=null;if((o&224)===192)a=1,u=127;else if((o&240)===224)a=2,u=2047;else if((o&248)===240)a=3,u=65535;else{(o&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+a>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let l=o&(1<<8-a-1)-1;for(let h=0;h<a;h++){let d=r[i];if((d&192)!=128){i+=e("MISSING_CONTINUE",i,r,n),l=null;break}l=l<<6|d&63,i++}if(l!==null){if(l>1114111){i+=e("OUT_OF_RANGE",i-1-a,r,n,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-a,r,n,l);continue}if(l<=u){i+=e("OVERLONG",i-1-a,r,n,l);continue}n.push(l)}}return n}function Jt(t,e){D(typeof t=="string","invalid string value","str",t),e!=null&&(ox(e),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const o=t.charCodeAt(n);D(n<t.length&&(o&64512)===56320,"invalid surrogate pair","str",t);const a=65536+((i&1023)<<10)+(o&1023);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(a&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function gS(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Ea(t,e){return gS(mS(t,e))}function dx(t){async function e(r,n){ne(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");const i=r.url.split(":")[0].toLowerCase();ne(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),ne(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let o=null;const a=new AbortController,u=setTimeout(()=>{o=ht("request timeout","TIMEOUT"),a.abort()},r.timeout);n&&n.addListener(()=>{o=ht("request cancelled","CANCELLED"),a.abort()});const l=Object.assign({},t,{method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:a.signal});let h;try{h=await fetch(r.url,l)}catch(w){throw clearTimeout(u),o||w}clearTimeout(u);const d={};h.headers.forEach((w,T)=>{d[T.toLowerCase()]=w});const m=await h.arrayBuffer(),y=m==null?null:new Uint8Array(m);return{statusCode:h.status,statusMessage:h.statusText,headers:d,body:y}}return e}const yS=12,bS=250;let Xm=dx();const xS=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),wS=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let cf=!1;async function px(t,e){try{const r=t.match(xS);if(!r)throw new Error("invalid data");return new Rn(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?lS(r[3]):ES(r[3]))}catch{return new Rn(599,"BAD REQUEST (invalid data: URI)",{},null,new Gr(t))}}function mx(t){async function e(r,n){try{const i=r.match(wS);if(!i)throw new Error("invalid link");return new Gr(`${t}${i[2]}`)}catch{return new Rn(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Gr(r))}}return e}const jo={data:px,ipfs:mx("https://gateway.ipfs.io/ipfs/")},gx=new WeakMap;class AS{#e;#t;constructor(e){this.#e=[],this.#t=!1,gx.set(e,()=>{if(!this.#t){this.#t=!0;for(const r of this.#e)setTimeout(()=>{r()},0);this.#e=[]}})}addListener(e){ne(!this.#t,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#e.push(e)}get cancelled(){return this.#t}checkSignal(){ne(!this.cancelled,"cancelled","CANCELLED",{})}}function Ho(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}class Gr{#e;#t;#r;#n;#i;#o;#s;#a;#d;#u;#p;#m;#c;#l;#f;get url(){return this.#o}set url(e){this.#o=String(e)}get body(){return this.#s==null?null:new Uint8Array(this.#s)}set body(e){if(e==null)this.#s=void 0,this.#a=void 0;else if(typeof e=="string")this.#s=Jt(e),this.#a="text/plain";else if(e instanceof Uint8Array)this.#s=e,this.#a="application/octet-stream";else if(typeof e=="object")this.#s=Jt(JSON.stringify(e)),this.#a="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 ${fS(Jt(this.#d))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&this.#a&&(e["content-type"]=this.#a),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){this.#r[String(e).toLowerCase()]=String(r)}clearHeaders(){this.#r={}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n<r.length){const i=r[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#d||null}setCredentials(e,r){D(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#d=`${e}:${r}`}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){D(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||Xm}set getUrlFunc(e){this.#f=e}constructor(e){this.#o=String(e),this.#e=!1,this.#t=!0,this.#r={},this.#n="",this.#i=3e5,this.#l={slotInterval:bS,maxAttempts:yS},this.#f=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#s?ae(this.#s):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(this.#l.slotInterval=e.slotInterval),e.maxAttempts!=null&&(this.#l.maxAttempts=e.maxAttempts)}async#h(e,r,n,i,o){if(e>=this.#l.maxAttempts)return o.makeServerError("exceeded maximum retry limit");ne(eg()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await vS(n);let a=this.clone();const u=(a.url.split(":")[0]||"").toLowerCase();if(u in jo){const d=await jo[u](a.url,Ho(i.#c));if(d instanceof Rn){let m=d;if(this.processFunc){Ho(i.#c);try{m=await this.processFunc(a,m)}catch(y){(y.throttle==null||typeof y.stall!="number")&&m.makeServerError("error in post-processing function",y).assertOk()}}return m}a=d}this.preflightFunc&&(a=await this.preflightFunc(a));const l=await this.getUrlFunc(a,Ho(i.#c));let h=new Rn(l.statusCode,l.statusMessage,l.headers,l.body,i);if(h.statusCode===301||h.statusCode===302){try{const d=h.headers.location||"";return a.redirect(d).#h(e+1,r,0,i,h)}catch{}return h}else if(h.statusCode===429&&(this.retryFunc==null||await this.retryFunc(a,h,e))){const d=h.headers["retry-after"];let m=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof d=="string"&&d.match(/^[1-9][0-9]*$/)&&(m=parseInt(d)),a.clone().#h(e+1,r,m,i,h)}if(this.processFunc){Ho(i.#c);try{h=await this.processFunc(a,h)}catch(d){(d.throttle==null||typeof d.stall!="number")&&h.makeServerError("error in post-processing function",d).assertOk();let m=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return d.stall>=0&&(m=d.stall),a.clone().#h(e+1,r,m,i,h)}}return h}send(){return ne(this.#c==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#c=new AS(this),this.#h(0,eg()+this.timeout,0,this,new Rn(0,"",{},null,this))}cancel(){ne(this.#c!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=gx.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();ne(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new Gr(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.#a=this.#a,i}clone(){const e=new Gr(this.url);return e.#n=this.#n,this.#s&&(e.#s=this.#s),e.#a=this.#a,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(){cf=!0}static getGateway(e){return jo[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(cf)throw new Error("gateways locked");jo[e]=r}static registerGetUrl(e){if(cf)throw new Error("gateways locked");Xm=e}static createGetUrlFunc(e){return dx(e)}static createDataGateway(){return px}static createIpfsGatewayFunc(e){return mx(e)}}class Rn{#e;#t;#r;#n;#i;#o;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#n?ae(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?"":Ea(this.#n)}catch{ne(!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{ne(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n<r.length){const i=r[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,r,n,i,o){this.#e=e,this.#t=r,this.#r=Object.keys(n).reduce((a,u)=>(a[u.toLowerCase()]=String(n[u]),a),{}),this.#n=i==null?null:new Uint8Array(i),this.#i=o||null,this.#o={message:""}}makeServerError(e,r){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 Rn(599,n,this.headers,this.body,this.#i||void 0);return i.#o={message:e,error:r},i}throwThrottleError(e,r){r==null?r=-1:D(Number.isInteger(r)&&r>=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Te(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return this.#n!=null}get request(){return this.#i}ok(){return this.#o.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=this.#o;e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let i=null;try{this.#n&&(i=Ea(this.#n))}catch{}ne(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r,info:{requestUrl:n,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function eg(){return new Date().getTime()}function ES(t){return Jt(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function vS(t){return new Promise(e=>setTimeout(e,t))}function RS(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function tg(t,e,r){let n=0;for(let i=0;i<r;i++)n=n*256+t[e+i];return n}function rg(t,e,r,n){const i=[];for(;r<e+1+n;){const o=yx(t,r);i.push(o.result),r+=o.consumed,ne(r<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:t,length:n,offset:e})}return{consumed:1+n,result:i}}function yx(t,e){ne(t.length!==0,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const r=n=>{ne(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=tg(t,e+1,n);return r(e+1+n+i),rg(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),rg(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=tg(t,e+1,n);r(e+1+n+i);const o=ae(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:o}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=ae(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:RS(t[e])}}function ho(t){const e=de(t,"data"),r=yx(e,0);return D(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function ng(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function bx(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(o){n=n.concat(bx(o))}),n.length<=55)return n.unshift(192+n.length),n;const i=ng(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(de(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=ng(e.length);return r.unshift(183+r.length),r.concat(e)}const ig="0123456789abcdef";function Vr(t){let e="0x";for(const r of bx(t))e+=ig[r>>4],e+=ig[r&15];return e}function TS(t){const e=de(t,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=ae(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const Kt=32,zf=new Uint8Array(Kt),BS=["then"],qo={},xx=new WeakMap;function Gn(t){return xx.get(t)}function sg(t,e){xx.set(t,e)}function Bs(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}function Vf(t,e,r){return t.indexOf(null)>=0?e.map((n,i)=>n instanceof Wr?Vf(Gn(n),n,r):n):t.reduce((n,i,o)=>{let a=e.getValue(i);return i in n||(r&&a instanceof Wr&&(a=Vf(Gn(a),a,r)),n[i]=a),n},{})}class Wr extends Array{#e;constructor(...e){const r=e[0];let n=e[1],i=(e[2]||[]).slice(),o=!0;r!==qo&&(n=e,i=[],o=!1),super(n.length),n.forEach((l,h)=>{this[h]=l});const a=i.reduce((l,h)=>(typeof h=="string"&&l.set(h,(l.get(h)||0)+1),l),new Map);if(sg(this,Object.freeze(n.map((l,h)=>{const d=i[h];return d!=null&&a.get(d)===1?d:null}))),this.#e=[],this.#e==null&&this.#e,!o)return;Object.freeze(this);const u=new Proxy(this,{get:(l,h,d)=>{if(typeof h=="string"){if(h.match(/^[0-9]+$/)){const y=Ie(h,"%index");if(y<0||y>=this.length)throw new RangeError("out of result range");const w=l[y];return w instanceof Error&&Bs(`index ${y}`,w),w}if(BS.indexOf(h)>=0)return Reflect.get(l,h,d);const m=l[h];if(m instanceof Function)return function(...y){return m.apply(this===d?l:this,y)};if(!(h in l))return l.getValue.apply(this===d?l:this,[h])}return Reflect.get(l,h,d)}});return sg(u,Gn(this)),u}toArray(e){const r=[];return this.forEach((n,i)=>{n instanceof Error&&Bs(`index ${i}`,n),e&&n instanceof Wr&&(n=n.toArray(e)),r.push(n)}),r}toObject(e){const r=Gn(this);return r.reduce((n,i,o)=>(ne(i!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Vf(r,this,e)),{})}slice(e,r){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const n=Gn(this),i=[],o=[];for(let a=e;a<r;a++)i.push(this[a]),o.push(n[a]);return new Wr(qo,i,o)}filter(e,r){const n=Gn(this),i=[],o=[];for(let a=0;a<this.length;a++){const u=this[a];u instanceof Error&&Bs(`index ${a}`,u),e.call(r,u,a,this)&&(i.push(u),o.push(n[a]))}return new Wr(qo,i,o)}map(e,r){const n=[];for(let i=0;i<this.length;i++){const o=this[i];o instanceof Error&&Bs(`index ${i}`,o),n.push(e.call(r,o,i,this))}return n}getValue(e){const r=Gn(this).indexOf(e);if(r===-1)return;const n=this[r];return n instanceof Error&&Bs(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(e,r){return new Wr(qo,e,r)}}function og(t){let e=mt(t);return ne(e.length<=Kt,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:Kt,offset:e.length}),e.length!==Kt&&(e=Dt(je([zf.slice(e.length%Kt),e]))),e}class an{name;type;localName;dynamic;constructor(e,r,n,i){Te(this,{name:e,type:r,localName:n,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,r){D(!1,e,this.localName,r)}}class Gf{#e;#t;constructor(){this.#e=[],this.#t=0}get data(){return je(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(Dt(e.data))}writeBytes(e){let r=Dt(e);const n=r.length%Kt;return n&&(r=Dt(je([r,zf.slice(n)]))),this.#r(r)}writeValue(e){return this.#r(og(e))}writeUpdatableValue(){const e=this.#e.length;return this.#e.push(zf),this.#t+=Kt,r=>{this.#e[e]=og(r)}}}class Lh{allowLoose;#e;#t;#r;#n;#i;constructor(e,r,n){Te(this,{allowLoose:!!r}),this.#e=Dt(e),this.#r=0,this.#n=null,this.#i=n??1024,this.#t=0}get data(){return ae(this.#e)}get dataLength(){return this.#e.length}get consumed(){return this.#t}get bytes(){return new Uint8Array(this.#e)}#o(e){if(this.#n)return this.#n.#o(e);this.#r+=e,ne(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:Dt(this.#e),offset:this.#t,length:e,info:{bytesRead:this.#r,dataLength:this.dataLength}})}#s(e,r,n){let i=Math.ceil(r/Kt)*Kt;return this.#t+i>this.#e.length&&(this.allowLoose&&n&&this.#t+r<=this.#e.length?i=r:ne(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Dt(this.#e),length:this.#e.length,offset:this.#t+i})),this.#e.slice(this.#t,this.#t+i)}subReader(e){const r=new Lh(this.#e.slice(this.#t+e),this.allowLoose,this.#i);return r.#n=this,r}readBytes(e,r){let n=this.#s(0,e,!!r);return this.#o(e),this.#t+=n.length,n.slice(0,e)}readValue(){return Ka(this.readBytes(Kt))}readIndex(){return oS(this.readBytes(Kt))}}function or(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Mh(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function wx(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");or(t.outputLen),or(t.blockLen)}function Mi(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ax(t,e){Mh(t);const r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}const uf=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;const Ex=t=>t instanceof Uint8Array,oa=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),aa=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Fr=(t,e)=>t<<32-e|t>>>e,SS=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!SS)throw new Error("Non little-endian hardware is not supported");const OS=async()=>{};async function ag(t,e,r){let n=Date.now();for(let i=0;i<t;i++){r(i);const o=Date.now()-n;o>=0&&o<e||(await OS(),n+=o)}}function PS(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function zi(t){if(typeof t=="string"&&(t=PS(t)),!Ex(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function IS(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!Ex(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class zh{clone(){return this._cloneInto()}}const kS={}.toString;function vx(t,e){if(e!==void 0&&kS.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function Wa(t){const e=n=>t().update(zi(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function NS(t=32){if(uf&&typeof uf.getRandomValues=="function")return uf.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class Rx extends zh{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,wx(e);const n=zi(r);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,o=new Uint8Array(i);o.set(n.length>i?e.create().update(n).digest():n);for(let a=0;a<o.length;a++)o[a]^=54;this.iHash.update(o),this.oHash=e.create();for(let a=0;a<o.length;a++)o[a]^=106;this.oHash.update(o),o.fill(0)}update(e){return Mi(this),this.iHash.update(e),this}digestInto(e){Mi(this),Mh(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:r,iHash:n,finished:i,destroyed:o,blockLen:a,outputLen:u}=this;return e=e,e.finished=i,e.destroyed=o,e.blockLen=a,e.outputLen=u,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Ja=(t,e,r)=>new Rx(t,e).update(r).digest();Ja.create=(t,e)=>new Rx(t,e);function CS(t,e,r,n){wx(t);const i=vx({dkLen:32,asyncTick:10},n),{c:o,dkLen:a,asyncTick:u}=i;if(or(o),or(a),or(u),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const l=zi(e),h=zi(r),d=new Uint8Array(a),m=Ja.create(t,l),y=m._cloneInto().update(h);return{c:o,dkLen:a,asyncTick:u,DK:d,PRF:m,PRFSalt:y}}function _S(t,e,r,n,i){return t.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),r}function Vh(t,e,r,n){const{c:i,dkLen:o,DK:a,PRF:u,PRFSalt:l}=CS(t,e,r,n);let h;const d=new Uint8Array(4),m=aa(d),y=new Uint8Array(u.outputLen);for(let w=1,T=0;T<o;w++,T+=u.outputLen){const E=a.subarray(T,T+u.outputLen);m.setInt32(0,w,!1),(h=l._cloneInto(h)).update(d).digestInto(y),E.set(y.subarray(0,E.length));for(let B=1;B<i;B++){u._cloneInto(h).update(y).digestInto(y);for(let A=0;A<E.length;A++)E[A]^=y[A]}}return _S(u,l,a,h,y)}function DS(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),o=BigInt(4294967295),a=Number(r>>i&o),u=Number(r&o),l=n?4:0,h=n?0:4;t.setUint32(e+l,a,n),t.setUint32(e+h,u,n)}class Gh extends zh{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,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=aa(this.buffer)}update(e){Mi(this);const{view:r,buffer:n,blockLen:i}=this;e=zi(e);const o=e.length;for(let a=0;a<o;){const u=Math.min(i-this.pos,o-a);if(u===i){const l=aa(e);for(;i<=o-a;a+=i)this.process(l,a);continue}n.set(e.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Mi(this),Ax(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:o}=this;let{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>i-a&&(this.process(n,0),a=0);for(let m=a;m<i;m++)r[m]=0;DS(n,i-8,BigInt(this.length*8),o),this.process(n,0);const u=aa(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const h=l/4,d=this.get();if(h>d.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<h;m++)u.setUint32(4*m,d[m],o)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:o,destroyed:a,pos:u}=this;return e.length=i,e.pos=u,e.finished=o,e.destroyed=a,i%r&&e.buffer.set(n),e}}const FS=(t,e,r)=>t&e^~t&r,US=(t,e,r)=>t&e^t&r^e&r,LS=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]),pn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),mn=new Uint32Array(64);class MS extends Gh{constructor(){super(64,32,8,!1),this.A=pn[0]|0,this.B=pn[1]|0,this.C=pn[2]|0,this.D=pn[3]|0,this.E=pn[4]|0,this.F=pn[5]|0,this.G=pn[6]|0,this.H=pn[7]|0}get(){const{A:e,B:r,C:n,D:i,E:o,F:a,G:u,H:l}=this;return[e,r,n,i,o,a,u,l]}set(e,r,n,i,o,a,u,l){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=a|0,this.G=u|0,this.H=l|0}process(e,r){for(let m=0;m<16;m++,r+=4)mn[m]=e.getUint32(r,!1);for(let m=16;m<64;m++){const y=mn[m-15],w=mn[m-2],T=Fr(y,7)^Fr(y,18)^y>>>3,E=Fr(w,17)^Fr(w,19)^w>>>10;mn[m]=E+mn[m-7]+T+mn[m-16]|0}let{A:n,B:i,C:o,D:a,E:u,F:l,G:h,H:d}=this;for(let m=0;m<64;m++){const y=Fr(u,6)^Fr(u,11)^Fr(u,25),w=d+y+FS(u,l,h)+LS[m]+mn[m]|0,E=(Fr(n,2)^Fr(n,13)^Fr(n,22))+US(n,i,o)|0;d=h,h=l,l=u,u=a+w|0,a=o,o=i,i=n,n=w+E|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,h=h+this.G|0,d=d+this.H|0,this.set(n,i,o,a,u,l,h,d)}roundClean(){mn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Yi=Wa(()=>new MS),Zo=BigInt(2**32-1),$f=BigInt(32);function Tx(t,e=!1){return e?{h:Number(t&Zo),l:Number(t>>$f&Zo)}:{h:Number(t>>$f&Zo)|0,l:Number(t&Zo)|0}}function Bx(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:o,l:a}=Tx(t[i],e);[r[i],n[i]]=[o,a]}return[r,n]}const zS=(t,e)=>BigInt(t>>>0)<<$f|BigInt(e>>>0),VS=(t,e,r)=>t>>>r,GS=(t,e,r)=>t<<32-r|e>>>r,$S=(t,e,r)=>t>>>r|e<<32-r,jS=(t,e,r)=>t<<32-r|e>>>r,HS=(t,e,r)=>t<<64-r|e>>>r-32,qS=(t,e,r)=>t>>>r-32|e<<64-r,ZS=(t,e)=>e,KS=(t,e)=>t,Sx=(t,e,r)=>t<<r|e>>>32-r,Ox=(t,e,r)=>e<<r|t>>>32-r,Px=(t,e,r)=>e<<r-32|t>>>64-r,Ix=(t,e,r)=>t<<r-32|e>>>64-r;function WS(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const JS=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),QS=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,YS=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),XS=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,eO=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),tO=(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0,ke={fromBig:Tx,split:Bx,toBig:zS,shrSH:VS,shrSL:GS,rotrSH:$S,rotrSL:jS,rotrBH:HS,rotrBL:qS,rotr32H:ZS,rotr32L:KS,rotlSH:Sx,rotlSL:Ox,rotlBH:Px,rotlBL:Ix,add:WS,add3L:JS,add3H:QS,add4L:YS,add4H:XS,add5H:tO,add5L:eO},[rO,nO]=ke.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(t=>BigInt(t))),gn=new Uint32Array(80),yn=new Uint32Array(80);class iO extends Gh{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:r,Bh:n,Bl:i,Ch:o,Cl:a,Dh:u,Dl:l,Eh:h,El:d,Fh:m,Fl:y,Gh:w,Gl:T,Hh:E,Hl:B}=this;return[e,r,n,i,o,a,u,l,h,d,m,y,w,T,E,B]}set(e,r,n,i,o,a,u,l,h,d,m,y,w,T,E,B){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=a|0,this.Dh=u|0,this.Dl=l|0,this.Eh=h|0,this.El=d|0,this.Fh=m|0,this.Fl=y|0,this.Gh=w|0,this.Gl=T|0,this.Hh=E|0,this.Hl=B|0}process(e,r){for(let I=0;I<16;I++,r+=4)gn[I]=e.getUint32(r),yn[I]=e.getUint32(r+=4);for(let I=16;I<80;I++){const S=gn[I-15]|0,N=yn[I-15]|0,_=ke.rotrSH(S,N,1)^ke.rotrSH(S,N,8)^ke.shrSH(S,N,7),F=ke.rotrSL(S,N,1)^ke.rotrSL(S,N,8)^ke.shrSL(S,N,7),U=gn[I-2]|0,H=yn[I-2]|0,K=ke.rotrSH(U,H,19)^ke.rotrBH(U,H,61)^ke.shrSH(U,H,6),le=ke.rotrSL(U,H,19)^ke.rotrBL(U,H,61)^ke.shrSL(U,H,6),L=ke.add4L(F,le,yn[I-7],yn[I-16]),me=ke.add4H(L,_,K,gn[I-7],gn[I-16]);gn[I]=me|0,yn[I]=L|0}let{Ah:n,Al:i,Bh:o,Bl:a,Ch:u,Cl:l,Dh:h,Dl:d,Eh:m,El:y,Fh:w,Fl:T,Gh:E,Gl:B,Hh:A,Hl:P}=this;for(let I=0;I<80;I++){const S=ke.rotrSH(m,y,14)^ke.rotrSH(m,y,18)^ke.rotrBH(m,y,41),N=ke.rotrSL(m,y,14)^ke.rotrSL(m,y,18)^ke.rotrBL(m,y,41),_=m&w^~m&E,F=y&T^~y&B,U=ke.add5L(P,N,F,nO[I],yn[I]),H=ke.add5H(U,A,S,_,rO[I],gn[I]),K=U|0,le=ke.rotrSH(n,i,28)^ke.rotrBH(n,i,34)^ke.rotrBH(n,i,39),L=ke.rotrSL(n,i,28)^ke.rotrBL(n,i,34)^ke.rotrBL(n,i,39),me=n&o^n&u^o&u,Be=i&a^i&l^a&l;A=E|0,P=B|0,E=w|0,B=T|0,w=m|0,T=y|0,{h:m,l:y}=ke.add(h|0,d|0,H|0,K|0),h=u|0,d=l|0,u=o|0,l=a|0,o=n|0,a=i|0;const re=ke.add3L(K,L,Be);n=ke.add3H(re,H,le,me),i=re|0}({h:n,l:i}=ke.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:a}=ke.add(this.Bh|0,this.Bl|0,o|0,a|0),{h:u,l}=ke.add(this.Ch|0,this.Cl|0,u|0,l|0),{h,l:d}=ke.add(this.Dh|0,this.Dl|0,h|0,d|0),{h:m,l:y}=ke.add(this.Eh|0,this.El|0,m|0,y|0),{h:w,l:T}=ke.add(this.Fh|0,this.Fl|0,w|0,T|0),{h:E,l:B}=ke.add(this.Gh|0,this.Gl|0,E|0,B|0),{h:A,l:P}=ke.add(this.Hh|0,this.Hl|0,A|0,P|0),this.set(n,i,o,a,u,l,h,d,m,y,w,T,E,B,A,P)}roundClean(){gn.fill(0),yn.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 $h=Wa(()=>new iO);function sO(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof vd<"u")return vd;throw new Error("unable to locate global object")}const cg=sO(),ug=cg.crypto||cg.msCrypto;function oO(t){switch(t){case"sha256":return Yi.create();case"sha512":return $h.create()}D(!1,"invalid hashing algorithm name","algorithm",t)}function aO(t,e){const r={sha256:Yi,sha512:$h}[t];return D(r!=null,"invalid hmac algorithm","algorithm",t),Ja.create(r,e)}function cO(t,e,r,n,i){const o={sha256:Yi,sha512:$h}[i];return D(o!=null,"invalid pbkdf2 algorithm","algorithm",i),Vh(o,t,e,{c:r,dkLen:n})}function uO(t){ne(ug!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),D(Number.isInteger(t)&&t>0&&t<=1024,"invalid length","length",t);const e=new Uint8Array(t);return ug.getRandomValues(e),e}let kx=!1;const Nx=function(t,e,r){return aO(t,e).update(r).digest()};let Cx=Nx;function Xi(t,e,r){const n=de(e,"key"),i=de(r,"data");return ae(Cx(t,n,i))}Xi._=Nx;Xi.lock=function(){kx=!0};Xi.register=function(t){if(kx)throw new Error("computeHmac is locked");Cx=t};Object.freeze(Xi);const[_x,Dx,Fx]=[[],[],[]],lO=BigInt(0),Ss=BigInt(1),fO=BigInt(2),hO=BigInt(7),dO=BigInt(256),pO=BigInt(113);for(let t=0,e=Ss,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],_x.push(2*(5*n+r)),Dx.push((t+1)*(t+2)/2%64);let i=lO;for(let o=0;o<7;o++)e=(e<<Ss^(e>>hO)*pO)%dO,e&fO&&(i^=Ss<<(Ss<<BigInt(o))-Ss);Fx.push(i)}const[mO,gO]=Bx(Fx,!0),lg=(t,e,r)=>r>32?Px(t,e,r):Sx(t,e,r),fg=(t,e,r)=>r>32?Ix(t,e,r):Ox(t,e,r);function yO(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)r[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){const u=(a+8)%10,l=(a+2)%10,h=r[l],d=r[l+1],m=lg(h,d,1)^r[u],y=fg(h,d,1)^r[u+1];for(let w=0;w<50;w+=10)t[a+w]^=m,t[a+w+1]^=y}let i=t[2],o=t[3];for(let a=0;a<24;a++){const u=Dx[a],l=lg(i,o,u),h=fg(i,o,u),d=_x[a];i=t[d],o=t[d+1],t[d]=l,t[d+1]=h}for(let a=0;a<50;a+=10){for(let u=0;u<10;u++)r[u]=t[a+u];for(let u=0;u<10;u++)t[a+u]^=~r[(u+2)%10]&r[(u+4)%10]}t[0]^=mO[n],t[1]^=gO[n]}r.fill(0)}class jh extends zh{constructor(e,r,n,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,or(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=oa(this.state)}keccak(){yO(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Mi(this);const{blockLen:r,state:n}=this;e=zi(e);const i=e.length;for(let o=0;o<i;){const a=Math.min(r-this.pos,i-o);for(let u=0;u<a;u++)n[this.pos++]^=e[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Mi(this,!1),Mh(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,o=e.length;i<o;){this.posOut>=n&&this.keccak();const a=Math.min(n-this.posOut,o-i);e.set(r.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return or(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Ax(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:r,suffix:n,outputLen:i,rounds:o,enableXOF:a}=this;return e||(e=new jh(r,n,i,a,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=n,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}}const bO=(t,e,r)=>Wa(()=>new jh(e,t,r)),xO=bO(1,136,256/8);let Ux=!1;const Lx=function(t){return xO(t)};let Mx=Lx;function lt(t){const e=de(t,"data");return ae(Mx(e))}lt._=Lx;lt.lock=function(){Ux=!0};lt.register=function(t){if(Ux)throw new TypeError("keccak256 is locked");Mx=t};Object.freeze(lt);const wO=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),zx=Uint8Array.from({length:16},(t,e)=>e),AO=zx.map(t=>(9*t+5)%16);let Hh=[zx],qh=[AO];for(let t=0;t<4;t++)for(let e of[Hh,qh])e.push(e[t].map(r=>wO[r]));const Vx=[[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(t=>new Uint8Array(t)),EO=Hh.map((t,e)=>t.map(r=>Vx[e][r])),vO=qh.map((t,e)=>t.map(r=>Vx[e][r])),RO=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),TO=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Ko=(t,e)=>t<<e|t>>>32-e;function hg(t,e,r,n){return t===0?e^r^n:t===1?e&r|~e&n:t===2?(e|~r)^n:t===3?e&n|r&~n:e^(r|~n)}const Wo=new Uint32Array(16);class BO extends Gh{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:r,h2:n,h3:i,h4:o}=this;return[e,r,n,i,o]}set(e,r,n,i,o){this.h0=e|0,this.h1=r|0,this.h2=n|0,this.h3=i|0,this.h4=o|0}process(e,r){for(let w=0;w<16;w++,r+=4)Wo[w]=e.getUint32(r,!0);let n=this.h0|0,i=n,o=this.h1|0,a=o,u=this.h2|0,l=u,h=this.h3|0,d=h,m=this.h4|0,y=m;for(let w=0;w<5;w++){const T=4-w,E=RO[w],B=TO[w],A=Hh[w],P=qh[w],I=EO[w],S=vO[w];for(let N=0;N<16;N++){const _=Ko(n+hg(w,o,u,h)+Wo[A[N]]+E,I[N])+m|0;n=m,m=h,h=Ko(u,10)|0,u=o,o=_}for(let N=0;N<16;N++){const _=Ko(i+hg(T,a,l,d)+Wo[P[N]]+B,S[N])+y|0;i=y,y=d,d=Ko(l,10)|0,l=a,a=_}}this.set(this.h1+u+d|0,this.h2+h+y|0,this.h3+m+i|0,this.h4+n+a|0,this.h0+o+l|0)}roundClean(){Wo.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const SO=Wa(()=>new BO);let Gx=!1;const $x=function(t){return SO(t)};let jx=$x;function es(t){const e=de(t,"data");return ae(jx(e))}es._=$x;es.lock=function(){Gx=!0};es.register=function(t){if(Gx)throw new TypeError("ripemd160 is locked");jx=t};Object.freeze(es);let Hx=!1;const qx=function(t,e,r,n,i){return cO(t,e,r,n,i)};let Zx=qx;function In(t,e,r,n,i){const o=de(t,"password"),a=de(e,"salt");return ae(Zx(o,a,r,n,i))}In._=qx;In.lock=function(){Hx=!0};In.register=function(t){if(Hx)throw new Error("pbkdf2 is locked");Zx=t};Object.freeze(In);let Kx=!1;const Wx=function(t){return new Uint8Array(uO(t))};let Jx=Wx;function Yr(t){return Jx(t)}Yr._=Wx;Yr.lock=function(){Kx=!0};Yr.register=function(t){if(Kx)throw new Error("randomBytes is locked");Jx=t};Object.freeze(Yr);const Ge=(t,e)=>t<<e|t>>>32-e;function dg(t,e,r,n,i,o){let a=t[e++]^r[n++],u=t[e++]^r[n++],l=t[e++]^r[n++],h=t[e++]^r[n++],d=t[e++]^r[n++],m=t[e++]^r[n++],y=t[e++]^r[n++],w=t[e++]^r[n++],T=t[e++]^r[n++],E=t[e++]^r[n++],B=t[e++]^r[n++],A=t[e++]^r[n++],P=t[e++]^r[n++],I=t[e++]^r[n++],S=t[e++]^r[n++],N=t[e++]^r[n++],_=a,F=u,U=l,H=h,K=d,le=m,L=y,me=w,Be=T,re=E,ue=B,ye=A,Ae=P,Ee=I,Se=S,Le=N;for(let _e=0;_e<8;_e+=2)K^=Ge(_+Ae|0,7),Be^=Ge(K+_|0,9),Ae^=Ge(Be+K|0,13),_^=Ge(Ae+Be|0,18),re^=Ge(le+F|0,7),Ee^=Ge(re+le|0,9),F^=Ge(Ee+re|0,13),le^=Ge(F+Ee|0,18),Se^=Ge(ue+L|0,7),U^=Ge(Se+ue|0,9),L^=Ge(U+Se|0,13),ue^=Ge(L+U|0,18),H^=Ge(Le+ye|0,7),me^=Ge(H+Le|0,9),ye^=Ge(me+H|0,13),Le^=Ge(ye+me|0,18),F^=Ge(_+H|0,7),U^=Ge(F+_|0,9),H^=Ge(U+F|0,13),_^=Ge(H+U|0,18),L^=Ge(le+K|0,7),me^=Ge(L+le|0,9),K^=Ge(me+L|0,13),le^=Ge(K+me|0,18),ye^=Ge(ue+re|0,7),Be^=Ge(ye+ue|0,9),re^=Ge(Be+ye|0,13),ue^=Ge(re+Be|0,18),Ae^=Ge(Le+Se|0,7),Ee^=Ge(Ae+Le|0,9),Se^=Ge(Ee+Ae|0,13),Le^=Ge(Se+Ee|0,18);i[o++]=a+_|0,i[o++]=u+F|0,i[o++]=l+U|0,i[o++]=h+H|0,i[o++]=d+K|0,i[o++]=m+le|0,i[o++]=y+L|0,i[o++]=w+me|0,i[o++]=T+Be|0,i[o++]=E+re|0,i[o++]=B+ue|0,i[o++]=A+ye|0,i[o++]=P+Ae|0,i[o++]=I+Ee|0,i[o++]=S+Se|0,i[o++]=N+Le|0}function Ii(t,e,r,n,i){let o=n+0,a=n+16*i;for(let u=0;u<16;u++)r[a+u]=t[e+(2*i-1)*16+u];for(let u=0;u<i;u++,o+=16,e+=16)dg(r,a,t,e,r,o),u>0&&(a+=16),dg(r,o,t,e+=16,r,a)}function Qx(t,e,r){const n=vx({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:o,p:a,dkLen:u,asyncTick:l,maxmem:h,onProgress:d}=n;if(or(i),or(o),or(a),or(u),or(l),or(h),d!==void 0&&typeof d!="function")throw new Error("progressCb should be function");const m=128*o,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(a<0||a>(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 w=m*(i+a);if(w>h)throw new Error(`Scrypt: parameters too large, ${w} (128 * r * (N + p)) > ${h} (maxmem)`);const T=Vh(Yi,t,e,{c:1,dkLen:m*a}),E=oa(T),B=oa(new Uint8Array(m*i)),A=oa(new Uint8Array(m));let P=()=>{};if(d){const I=2*i*a,S=Math.max(Math.floor(I/1e4),1);let N=0;P=()=>{N++,d&&(!(N%S)||N===I)&&d(N/I)}}return{N:i,r:o,p:a,dkLen:u,blockSize32:y,V:B,B32:E,B:T,tmp:A,blockMixCb:P,asyncTick:l}}function Yx(t,e,r,n,i){const o=Vh(Yi,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),i.fill(0),o}function OO(t,e,r){const{N:n,r:i,p:o,dkLen:a,blockSize32:u,V:l,B32:h,B:d,tmp:m,blockMixCb:y}=Qx(t,e,r);for(let w=0;w<o;w++){const T=u*w;for(let E=0;E<u;E++)l[E]=h[T+E];for(let E=0,B=0;E<n-1;E++)Ii(l,B,l,B+=u,i),y();Ii(l,(n-1)*u,h,T,i),y();for(let E=0;E<n;E++){const B=h[T+u-16]%n;for(let A=0;A<u;A++)m[A]=h[T+A]^l[B*u+A];Ii(m,0,h,T,i),y()}}return Yx(t,a,d,l,m)}async function PO(t,e,r){const{N:n,r:i,p:o,dkLen:a,blockSize32:u,V:l,B32:h,B:d,tmp:m,blockMixCb:y,asyncTick:w}=Qx(t,e,r);for(let T=0;T<o;T++){const E=u*T;for(let A=0;A<u;A++)l[A]=h[E+A];let B=0;await ag(n-1,w,()=>{Ii(l,B,l,B+=u,i),y()}),Ii(l,(n-1)*u,h,E,i),y(),await ag(n,w,()=>{const A=h[E+u-16]%n;for(let P=0;P<u;P++)m[P]=h[E+P]^l[A*u+P];Ii(m,0,h,E,i),y()})}return Yx(t,a,d,l,m)}let Xx=!1,e1=!1;const t1=async function(t,e,r,n,i,o,a){return await PO(t,e,{N:r,r:n,p:i,dkLen:o,onProgress:a})},r1=function(t,e,r,n,i,o){return OO(t,e,{N:r,r:n,p:i,dkLen:o})};let n1=t1,i1=r1;async function ts(t,e,r,n,i,o,a){const u=de(t,"passwd"),l=de(e,"salt");return ae(await n1(u,l,r,n,i,o,a))}ts._=t1;ts.lock=function(){e1=!0};ts.register=function(t){if(e1)throw new Error("scrypt is locked");n1=t};Object.freeze(ts);function rs(t,e,r,n,i,o){const a=de(t,"passwd"),u=de(e,"salt");return ae(i1(a,u,r,n,i,o))}rs._=r1;rs.lock=function(){Xx=!0};rs.register=function(t){if(Xx)throw new Error("scryptSync is locked");i1=t};Object.freeze(rs);const s1=function(t){return oO("sha256").update(t).digest()};let o1=s1,a1=!1;function xr(t){const e=de(t,"data");return ae(o1(e))}xr._=s1;xr.lock=function(){a1=!0};xr.register=function(t){if(a1)throw new Error("sha256 is locked");o1=t};Object.freeze(xr);Object.freeze(xr);BigInt(0);const IO=BigInt(1),kO=BigInt(2),Qa=t=>t instanceof Uint8Array,NO=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Vi(t){if(!Qa(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=NO[t[r]];return e}function Zh(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function Zs(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(e/2);for(let n=0;n<r.length;n++){const i=n*2,o=t.slice(i,i+2),a=Number.parseInt(o,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");r[n]=a}return r}function Jn(t){return Zh(Vi(t))}function Kh(t){if(!Qa(t))throw new Error("Uint8Array expected");return Zh(Vi(Uint8Array.from(t).reverse()))}function Gi(t,e){return Zs(t.toString(16).padStart(e*2,"0"))}function Wh(t,e){return Gi(t,e).reverse()}function Rr(t,e,r){let n;if(typeof e=="string")try{n=Zs(e)}catch(o){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${o}`)}else if(Qa(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(`${t} expected ${r} bytes, got ${i}`);return n}function Ks(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!Qa(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}const Jh=t=>(kO<<BigInt(t-1))-IO,lf=t=>new Uint8Array(t),pg=t=>Uint8Array.from(t);function c1(t,e,r){if(typeof t!="number"||t<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 r!="function")throw new Error("hmacFn must be a function");let n=lf(t),i=lf(t),o=0;const a=()=>{n.fill(1),i.fill(0),o=0},u=(...m)=>r(i,n,...m),l=(m=lf())=>{i=u(pg([0]),m),n=u(),m.length!==0&&(i=u(pg([1]),m),n=u())},h=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let m=0;const y=[];for(;m<e;){n=u();const w=n.slice();y.push(w),m+=n.length}return Ks(...y)};return(m,y)=>{a(),l(m);let w;for(;!(w=y(h()));)l();return a(),w}}const CO={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function po(t,e,r={}){const n=(i,o,a)=>{const u=CO[o];if(typeof u!="function")throw new Error(`Invalid validator "${o}", expected function`);const l=t[i];if(!(a&&l===void 0)&&!u(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${o}`)};for(const[i,o]of Object.entries(e))n(i,o,!1);for(const[i,o]of Object.entries(r))n(i,o,!0);return t}const _O=Object.freeze(Object.defineProperty({__proto__:null,bitMask:Jh,bytesToHex:Vi,bytesToNumberBE:Jn,bytesToNumberLE:Kh,concatBytes:Ks,createHmacDrbg:c1,ensureBytes:Rr,hexToBytes:Zs,hexToNumber:Zh,numberToBytesBE:Gi,numberToBytesLE:Wh,validateObject:po},Symbol.toStringTag,{value:"Module"}));const It=BigInt(0),vt=BigInt(1),$n=BigInt(2),DO=BigInt(3),jf=BigInt(4),mg=BigInt(5),gg=BigInt(8);BigInt(9);BigInt(16);function Qt(t,e){const r=t%e;return r>=It?r:e+r}function FO(t,e,r){if(r<=It||e<It)throw new Error("Expected power/modulo > 0");if(r===vt)return It;let n=vt;for(;e>It;)e&vt&&(n=n*t%r),t=t*t%r,e>>=vt;return n}function lr(t,e,r){let n=t;for(;e-- >It;)n*=n,n%=r;return n}function Hf(t,e){if(t===It||e<=It)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Qt(t,e),n=e,i=It,o=vt;for(;r!==It;){const u=n/r,l=n%r,h=i-o*u;n=r,r=l,i=o,o=h}if(n!==vt)throw new Error("invert: does not exist");return Qt(i,e)}function UO(t){const e=(t-vt)/$n;let r,n,i;for(r=t-vt,n=0;r%$n===It;r/=$n,n++);for(i=$n;i<t&&FO(i,e,t)!==t-vt;i++);if(n===1){const a=(t+vt)/jf;return function(l,h){const d=l.pow(h,a);if(!l.eql(l.sqr(d),h))throw new Error("Cannot find square root");return d}}const o=(r+vt)/$n;return function(u,l){if(u.pow(l,e)===u.neg(u.ONE))throw new Error("Cannot find square root");let h=n,d=u.pow(u.mul(u.ONE,i),r),m=u.pow(l,o),y=u.pow(l,r);for(;!u.eql(y,u.ONE);){if(u.eql(y,u.ZERO))return u.ZERO;let w=1;for(let E=u.sqr(y);w<h&&!u.eql(E,u.ONE);w++)E=u.sqr(E);const T=u.pow(d,vt<<BigInt(h-w-1));d=u.sqr(T),m=u.mul(m,T),y=u.mul(y,d),h=w}return m}}function LO(t){if(t%jf===DO){const e=(t+vt)/jf;return function(n,i){const o=n.pow(i,e);if(!n.eql(n.sqr(o),i))throw new Error("Cannot find square root");return o}}if(t%gg===mg){const e=(t-mg)/gg;return function(n,i){const o=n.mul(i,$n),a=n.pow(o,e),u=n.mul(i,a),l=n.mul(n.mul(u,$n),a),h=n.mul(u,n.sub(l,n.ONE));if(!n.eql(n.sqr(h),i))throw new Error("Cannot find square root");return h}}return UO(t)}const MO=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function zO(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=MO.reduce((n,i)=>(n[i]="function",n),e);return po(t,r)}function VO(t,e,r){if(r<It)throw new Error("Expected power > 0");if(r===It)return t.ONE;if(r===vt)return e;let n=t.ONE,i=e;for(;r>It;)r&vt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=vt;return n}function GO(t,e){const r=new Array(e.length),n=e.reduce((o,a,u)=>t.is0(a)?o:(r[u]=o,t.mul(o,a)),t.ONE),i=t.inv(n);return e.reduceRight((o,a,u)=>t.is0(a)?o:(r[u]=t.mul(o,r[u]),t.mul(o,a)),i),r}function u1(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function $O(t,e,r=!1,n={}){if(t<=It)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:o}=u1(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=LO(t),u=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:Jh(i),ZERO:It,ONE:vt,create:l=>Qt(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return It<=l&&l<t},is0:l=>l===It,isOdd:l=>(l&vt)===vt,neg:l=>Qt(-l,t),eql:(l,h)=>l===h,sqr:l=>Qt(l*l,t),add:(l,h)=>Qt(l+h,t),sub:(l,h)=>Qt(l-h,t),mul:(l,h)=>Qt(l*h,t),pow:(l,h)=>VO(u,l,h),div:(l,h)=>Qt(l*Hf(h,t),t),sqrN:l=>l*l,addN:(l,h)=>l+h,subN:(l,h)=>l-h,mulN:(l,h)=>l*h,inv:l=>Hf(l,t),sqrt:n.sqrt||(l=>a(u,l)),invertBatch:l=>GO(u,l),cmov:(l,h,d)=>d?h:l,toBytes:l=>r?Wh(l,o):Gi(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?Kh(l):Jn(l)}});return Object.freeze(u)}function l1(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function f1(t){const e=l1(t);return e+Math.ceil(e/2)}function jO(t,e,r=!1){const n=t.length,i=l1(e),o=f1(e);if(n<16||n<o||n>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${n}`);const a=r?Jn(t):Kh(t),u=Qt(a,e-vt)+vt;return r?Wh(u,i):Gi(u,i)}const HO=BigInt(0),ff=BigInt(1);function qO(t,e){const r=(i,o)=>{const a=o.negate();return i?a:o},n=i=>{const o=Math.ceil(e/i)+1,a=2**(i-1);return{windows:o,windowSize:a}};return{constTimeNegate:r,unsafeLadder(i,o){let a=t.ZERO,u=i;for(;o>HO;)o&ff&&(a=a.add(u)),u=u.double(),o>>=ff;return a},precomputeWindow(i,o){const{windows:a,windowSize:u}=n(o),l=[];let h=i,d=h;for(let m=0;m<a;m++){d=h,l.push(d);for(let y=1;y<u;y++)d=d.add(h),l.push(d);h=d.double()}return l},wNAF(i,o,a){const{windows:u,windowSize:l}=n(i);let h=t.ZERO,d=t.BASE;const m=BigInt(2**i-1),y=2**i,w=BigInt(i);for(let T=0;T<u;T++){const E=T*l;let B=Number(a&m);a>>=w,B>l&&(B-=y,a+=ff);const A=E,P=E+Math.abs(B)-1,I=T%2!==0,S=B<0;B===0?d=d.add(r(I,o[A])):h=h.add(r(S,o[P]))}return{p:h,f:d}},wNAFCached(i,o,a,u){const l=i._WINDOW_SIZE||1;let h=o.get(i);return h||(h=this.precomputeWindow(i,l),l!==1&&o.set(i,u(h))),this.wNAF(l,h,a)}}}function h1(t){return zO(t.Fp),po(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...u1(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}function ZO(t){const e=h1(t);po(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:KO,hexToBytes:WO}=_O,Hn={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Hn;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)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:KO(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=Hn,r=typeof t=="string"?WO(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:o}=Hn._parseInt(r.subarray(2)),{d:a,l:u}=Hn._parseInt(o);if(u.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:a}},hexFromSig(t){const e=h=>Number.parseInt(h[0],16)&8?"00"+h:h,r=h=>{const d=h.toString(16);return d.length&1?`0${d}`:d},n=e(r(t.s)),i=e(r(t.r)),o=n.length/2,a=i.length/2,u=r(o),l=r(a);return`30${r(a+o+4)}02${l}${i}02${u}${n}`}},Kr=BigInt(0),mr=BigInt(1);BigInt(2);const yg=BigInt(3);BigInt(4);function JO(t){const e=ZO(t),{Fp:r}=e,n=e.toBytes||((T,E,B)=>{const A=E.toAffine();return Ks(Uint8Array.from([4]),r.toBytes(A.x),r.toBytes(A.y))}),i=e.fromBytes||(T=>{const E=T.subarray(1),B=r.fromBytes(E.subarray(0,r.BYTES)),A=r.fromBytes(E.subarray(r.BYTES,2*r.BYTES));return{x:B,y:A}});function o(T){const{a:E,b:B}=e,A=r.sqr(T),P=r.mul(A,T);return r.add(r.add(P,r.mul(T,E)),B)}if(!r.eql(r.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(T){return typeof T=="bigint"&&Kr<T&&T<e.n}function u(T){if(!a(T))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(T){const{allowedPrivateKeyLengths:E,nByteLength:B,wrapPrivateKey:A,n:P}=e;if(E&&typeof T!="bigint"){if(T instanceof Uint8Array&&(T=Vi(T)),typeof T!="string"||!E.includes(T.length))throw new Error("Invalid key");T=T.padStart(B*2,"0")}let I;try{I=typeof T=="bigint"?T:Jn(Rr("private key",T,B))}catch{throw new Error(`private key must be ${B} bytes, hex or bigint, not ${typeof T}`)}return A&&(I=Qt(I,P)),u(I),I}const h=new Map;function d(T){if(!(T instanceof m))throw new Error("ProjectivePoint expected")}class m{constructor(E,B,A){if(this.px=E,this.py=B,this.pz=A,E==null||!r.isValid(E))throw new Error("x required");if(B==null||!r.isValid(B))throw new Error("y required");if(A==null||!r.isValid(A))throw new Error("z required")}static fromAffine(E){const{x:B,y:A}=E||{};if(!E||!r.isValid(B)||!r.isValid(A))throw new Error("invalid affine point");if(E instanceof m)throw new Error("projective point not allowed");const P=I=>r.eql(I,r.ZERO);return P(B)&&P(A)?m.ZERO:new m(B,A,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(E){const B=r.invertBatch(E.map(A=>A.pz));return E.map((A,P)=>A.toAffine(B[P])).map(m.fromAffine)}static fromHex(E){const B=m.fromAffine(i(Rr("pointHex",E)));return B.assertValidity(),B}static fromPrivateKey(E){return m.BASE.multiply(l(E))}_setWindowSize(E){this._WINDOW_SIZE=E,h.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:E,y:B}=this.toAffine();if(!r.isValid(E)||!r.isValid(B))throw new Error("bad point: x or y not FE");const A=r.sqr(B),P=o(E);if(!r.eql(A,P))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:E}=this.toAffine();if(r.isOdd)return!r.isOdd(E);throw new Error("Field doesn't support isOdd")}equals(E){d(E);const{px:B,py:A,pz:P}=this,{px:I,py:S,pz:N}=E,_=r.eql(r.mul(B,N),r.mul(I,P)),F=r.eql(r.mul(A,N),r.mul(S,P));return _&&F}negate(){return new m(this.px,r.neg(this.py),this.pz)}double(){const{a:E,b:B}=e,A=r.mul(B,yg),{px:P,py:I,pz:S}=this;let N=r.ZERO,_=r.ZERO,F=r.ZERO,U=r.mul(P,P),H=r.mul(I,I),K=r.mul(S,S),le=r.mul(P,I);return le=r.add(le,le),F=r.mul(P,S),F=r.add(F,F),N=r.mul(E,F),_=r.mul(A,K),_=r.add(N,_),N=r.sub(H,_),_=r.add(H,_),_=r.mul(N,_),N=r.mul(le,N),F=r.mul(A,F),K=r.mul(E,K),le=r.sub(U,K),le=r.mul(E,le),le=r.add(le,F),F=r.add(U,U),U=r.add(F,U),U=r.add(U,K),U=r.mul(U,le),_=r.add(_,U),K=r.mul(I,S),K=r.add(K,K),U=r.mul(K,le),N=r.sub(N,U),F=r.mul(K,H),F=r.add(F,F),F=r.add(F,F),new m(N,_,F)}add(E){d(E);const{px:B,py:A,pz:P}=this,{px:I,py:S,pz:N}=E;let _=r.ZERO,F=r.ZERO,U=r.ZERO;const H=e.a,K=r.mul(e.b,yg);let le=r.mul(B,I),L=r.mul(A,S),me=r.mul(P,N),Be=r.add(B,A),re=r.add(I,S);Be=r.mul(Be,re),re=r.add(le,L),Be=r.sub(Be,re),re=r.add(B,P);let ue=r.add(I,N);return re=r.mul(re,ue),ue=r.add(le,me),re=r.sub(re,ue),ue=r.add(A,P),_=r.add(S,N),ue=r.mul(ue,_),_=r.add(L,me),ue=r.sub(ue,_),U=r.mul(H,re),_=r.mul(K,me),U=r.add(_,U),_=r.sub(L,U),U=r.add(L,U),F=r.mul(_,U),L=r.add(le,le),L=r.add(L,le),me=r.mul(H,me),re=r.mul(K,re),L=r.add(L,me),me=r.sub(le,me),me=r.mul(H,me),re=r.add(re,me),le=r.mul(L,re),F=r.add(F,le),le=r.mul(ue,re),_=r.mul(Be,_),_=r.sub(_,le),le=r.mul(Be,L),U=r.mul(ue,U),U=r.add(U,le),new m(_,F,U)}subtract(E){return this.add(E.negate())}is0(){return this.equals(m.ZERO)}wNAF(E){return w.wNAFCached(this,h,E,B=>{const A=r.invertBatch(B.map(P=>P.pz));return B.map((P,I)=>P.toAffine(A[I])).map(m.fromAffine)})}multiplyUnsafe(E){const B=m.ZERO;if(E===Kr)return B;if(u(E),E===mr)return this;const{endo:A}=e;if(!A)return w.unsafeLadder(this,E);let{k1neg:P,k1:I,k2neg:S,k2:N}=A.splitScalar(E),_=B,F=B,U=this;for(;I>Kr||N>Kr;)I&mr&&(_=_.add(U)),N&mr&&(F=F.add(U)),U=U.double(),I>>=mr,N>>=mr;return P&&(_=_.negate()),S&&(F=F.negate()),F=new m(r.mul(F.px,A.beta),F.py,F.pz),_.add(F)}multiply(E){u(E);let B=E,A,P;const{endo:I}=e;if(I){const{k1neg:S,k1:N,k2neg:_,k2:F}=I.splitScalar(B);let{p:U,f:H}=this.wNAF(N),{p:K,f:le}=this.wNAF(F);U=w.constTimeNegate(S,U),K=w.constTimeNegate(_,K),K=new m(r.mul(K.px,I.beta),K.py,K.pz),A=U.add(K),P=H.add(le)}else{const{p:S,f:N}=this.wNAF(B);A=S,P=N}return m.normalizeZ([A,P])[0]}multiplyAndAddUnsafe(E,B,A){const P=m.BASE,I=(N,_)=>_===Kr||_===mr||!N.equals(P)?N.multiplyUnsafe(_):N.multiply(_),S=I(this,B).add(I(E,A));return S.is0()?void 0:S}toAffine(E){const{px:B,py:A,pz:P}=this,I=this.is0();E==null&&(E=I?r.ONE:r.inv(P));const S=r.mul(B,E),N=r.mul(A,E),_=r.mul(P,E);if(I)return{x:r.ZERO,y:r.ZERO};if(!r.eql(_,r.ONE))throw new Error("invZ was invalid");return{x:S,y:N}}isTorsionFree(){const{h:E,isTorsionFree:B}=e;if(E===mr)return!0;if(B)return B(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:E,clearCofactor:B}=e;return E===mr?this:B?B(m,this):this.multiplyUnsafe(e.h)}toRawBytes(E=!0){return this.assertValidity(),n(m,this,E)}toHex(E=!0){return Vi(this.toRawBytes(E))}}m.BASE=new m(e.Gx,e.Gy,r.ONE),m.ZERO=new m(r.ZERO,r.ONE,r.ZERO);const y=e.nBitLength,w=qO(m,e.endo?Math.ceil(y/2):y);return{CURVE:e,ProjectivePoint:m,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:a}}function QO(t){const e=h1(t);return po(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function YO(t){const e=QO(t),{Fp:r,n}=e,i=r.BYTES+1,o=2*r.BYTES+1;function a(re){return Kr<re&&re<r.ORDER}function u(re){return Qt(re,n)}function l(re){return Hf(re,n)}const{ProjectivePoint:h,normPrivateKeyToScalar:d,weierstrassEquation:m,isWithinCurveOrder:y}=JO({...e,toBytes(re,ue,ye){const Ae=ue.toAffine(),Ee=r.toBytes(Ae.x),Se=Ks;return ye?Se(Uint8Array.from([ue.hasEvenY()?2:3]),Ee):Se(Uint8Array.from([4]),Ee,r.toBytes(Ae.y))},fromBytes(re){const ue=re.length,ye=re[0],Ae=re.subarray(1);if(ue===i&&(ye===2||ye===3)){const Ee=Jn(Ae);if(!a(Ee))throw new Error("Point is not on curve");const Se=m(Ee);let Le=r.sqrt(Se);const _e=(Le&mr)===mr;return(ye&1)===1!==_e&&(Le=r.neg(Le)),{x:Ee,y:Le}}else if(ue===o&&ye===4){const Ee=r.fromBytes(Ae.subarray(0,r.BYTES)),Se=r.fromBytes(Ae.subarray(r.BYTES,2*r.BYTES));return{x:Ee,y:Se}}else throw new Error(`Point of length ${ue} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}}),w=re=>Vi(Gi(re,e.nByteLength));function T(re){const ue=n>>mr;return re>ue}function E(re){return T(re)?u(-re):re}const B=(re,ue,ye)=>Jn(re.slice(ue,ye));class A{constructor(ue,ye,Ae){this.r=ue,this.s=ye,this.recovery=Ae,this.assertValidity()}static fromCompact(ue){const ye=e.nByteLength;return ue=Rr("compactSignature",ue,ye*2),new A(B(ue,0,ye),B(ue,ye,2*ye))}static fromDER(ue){const{r:ye,s:Ae}=Hn.toSig(Rr("DER",ue));return new A(ye,Ae)}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(ue){return new A(this.r,this.s,ue)}recoverPublicKey(ue){const{r:ye,s:Ae,recovery:Ee}=this,Se=F(Rr("msgHash",ue));if(Ee==null||![0,1,2,3].includes(Ee))throw new Error("recovery id invalid");const Le=Ee===2||Ee===3?ye+e.n:ye;if(Le>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const _e=(Ee&1)===0?"02":"03",j=h.fromHex(_e+w(Le)),W=l(Le),se=u(-Se*W),M=u(Ae*W),z=h.BASE.multiplyAndAddUnsafe(j,se,M);if(!z)throw new Error("point at infinify");return z.assertValidity(),z}hasHighS(){return T(this.s)}normalizeS(){return this.hasHighS()?new A(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return Zs(this.toDERHex())}toDERHex(){return Hn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Zs(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}const P={isValidPrivateKey(re){try{return d(re),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const re=f1(e.n);return jO(e.randomBytes(re),e.n)},precompute(re=8,ue=h.BASE){return ue._setWindowSize(re),ue.multiply(BigInt(3)),ue}};function I(re,ue=!0){return h.fromPrivateKey(re).toRawBytes(ue)}function S(re){const ue=re instanceof Uint8Array,ye=typeof re=="string",Ae=(ue||ye)&&re.length;return ue?Ae===i||Ae===o:ye?Ae===2*i||Ae===2*o:re instanceof h}function N(re,ue,ye=!0){if(S(re))throw new Error("first arg must be private key");if(!S(ue))throw new Error("second arg must be public key");return h.fromHex(ue).multiply(d(re)).toRawBytes(ye)}const _=e.bits2int||function(re){const ue=Jn(re),ye=re.length*8-e.nBitLength;return ye>0?ue>>BigInt(ye):ue},F=e.bits2int_modN||function(re){return u(_(re))},U=Jh(e.nBitLength);function H(re){if(typeof re!="bigint")throw new Error("bigint expected");if(!(Kr<=re&&re<U))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Gi(re,e.nByteLength)}function K(re,ue,ye=le){if(["recovered","canonical"].some(ie=>ie in ye))throw new Error("sign() legacy options not supported");const{hash:Ae,randomBytes:Ee}=e;let{lowS:Se,prehash:Le,extraEntropy:_e}=ye;Se==null&&(Se=!0),re=Rr("msgHash",re),Le&&(re=Rr("prehashed msgHash",Ae(re)));const j=F(re),W=d(ue),se=[H(W),H(j)];if(_e!=null){const ie=_e===!0?Ee(r.BYTES):_e;se.push(Rr("extraEntropy",ie))}const M=Ks(...se),z=j;function Q(ie){const oe=_(ie);if(!y(oe))return;const O=l(oe),k=h.BASE.multiply(oe).toAffine(),Z=u(k.x);if(Z===Kr)return;const fe=u(O*u(z+Z*W));if(fe===Kr)return;let Pe=(k.x===Z?0:2)|Number(k.y&mr),xe=fe;return Se&&T(fe)&&(xe=E(fe),Pe^=1),new A(Z,xe,Pe)}return{seed:M,k2sig:Q}}const le={lowS:e.lowS,prehash:!1},L={lowS:e.lowS,prehash:!1};function me(re,ue,ye=le){const{seed:Ae,k2sig:Ee}=K(re,ue,ye),Se=e;return c1(Se.hash.outputLen,Se.nByteLength,Se.hmac)(Ae,Ee)}h.BASE._setWindowSize(8);function Be(re,ue,ye,Ae=L){const Ee=re;if(ue=Rr("msgHash",ue),ye=Rr("publicKey",ye),"strict"in Ae)throw new Error("options.strict was renamed to lowS");const{lowS:Se,prehash:Le}=Ae;let _e,j;try{if(typeof Ee=="string"||Ee instanceof Uint8Array)try{_e=A.fromDER(Ee)}catch(k){if(!(k instanceof Hn.Err))throw k;_e=A.fromCompact(Ee)}else if(typeof Ee=="object"&&typeof Ee.r=="bigint"&&typeof Ee.s=="bigint"){const{r:k,s:Z}=Ee;_e=new A(k,Z)}else throw new Error("PARSE");j=h.fromHex(ye)}catch(k){if(k.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Se&&_e.hasHighS())return!1;Le&&(ue=e.hash(ue));const{r:W,s:se}=_e,M=F(ue),z=l(se),Q=u(M*z),ie=u(W*z),oe=h.BASE.multiplyAndAddUnsafe(j,Q,ie)?.toAffine();return oe?u(oe.x)===W:!1}return{CURVE:e,getPublicKey:I,getSharedSecret:N,sign:me,verify:Be,ProjectivePoint:h,Signature:A,utils:P}}function XO(t){return{hash:t,hmac:(e,...r)=>Ja(t,e,IS(...r)),randomBytes:NS}}function eP(t,e){const r=n=>YO({...t,...XO(n)});return Object.freeze({...r(e),create:r})}const d1=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),bg=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),tP=BigInt(1),qf=BigInt(2),xg=(t,e)=>(t+e/qf)/e;function rP(t){const e=d1,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),a=BigInt(23),u=BigInt(44),l=BigInt(88),h=t*t*t%e,d=h*h*t%e,m=lr(d,r,e)*d%e,y=lr(m,r,e)*d%e,w=lr(y,qf,e)*h%e,T=lr(w,i,e)*w%e,E=lr(T,o,e)*T%e,B=lr(E,u,e)*E%e,A=lr(B,l,e)*B%e,P=lr(A,u,e)*E%e,I=lr(P,r,e)*d%e,S=lr(I,a,e)*T%e,N=lr(S,n,e)*h%e,_=lr(N,qf,e);if(!Zf.eql(Zf.sqr(_),t))throw new Error("Cannot find square root");return _}const Zf=$O(d1,void 0,void 0,{sqrt:rP}),bn=eP({a:BigInt(0),b:BigInt(7),Fp:Zf,n:bg,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=bg,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-tP*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),u=xg(o*t,e),l=xg(-n*t,e);let h=Qt(t-u*r-l*i,e),d=Qt(-u*n-l*o,e);const m=h>a,y=d>a;if(m&&(h=e-h),y&&(d=e-d),h>a||d>a)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:m,k1:h,k2neg:y,k2:d}}}},Yi);BigInt(0);bn.ProjectivePoint;const Ws="0x0000000000000000000000000000000000000000",wg="0x0000000000000000000000000000000000000000000000000000000000000000",nP=`Ethereum Signed Message:
85
+ `,Ag=BigInt(0),Eg=BigInt(1),Kf=BigInt(2),vg=BigInt(27),Rg=BigInt(28),Jo=BigInt(35),p1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),iP=p1/Kf,sP=Symbol.for("nodejs.util.inspect.custom"),Ln={};function hf(t){return rn(mt(t),32)}class dt{#e;#t;#r;#n;get r(){return this.#e}set r(e){D(Pi(e)===32,"invalid r","value",e),this.#e=ae(e)}get s(){return D(parseInt(this.#t.substring(0,3))<8,"non-canonical s; use ._s","s",this.#t),this.#t}set s(e){D(Pi(e)===32,"invalid s","value",e),this.#t=ae(e)}get _s(){return this.#t}isValid(){return BigInt(this.#t)<=iP}get v(){return this.#r}set v(e){const r=Ie(e,"value");D(r===27||r===28,"invalid v","v",e),this.#r=r}get networkV(){return this.#n}get legacyChainId(){const e=this.networkV;return e==null?null:dt.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=de(this.s);return this.yParity&&(e[0]|=128),ae(e)}get compactSerialized(){return je([this.r,this.yParityAndS])}get serialized(){return je([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,r,n,i){ai(e,Ln,"Signature"),this.#e=r,this.#t=n,this.#r=i,this.#n=null}getCanonical(){if(this.isValid())return this;const e=p1-BigInt(this._s),r=55-this.v,n=new dt(Ln,this.r,hf(e),r);return this.networkV&&(n.#n=this.networkV),n}clone(){const e=new dt(Ln,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}}[sP](){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 r=ge(e,"v");return r==vg||r==Rg?Ag:(D(r>=Jo,"invalid EIP-155 v","v",e),(r-Jo)/Kf)}static getChainIdV(e,r){return ge(e)*Kf+BigInt(35+r-27)}static getNormalizedV(e){const r=ge(e);return r===Ag||r===vg?27:r===Eg||r===Rg?28:(D(r>=Jo,"invalid v","v",e),r&Eg?27:28)}static from(e){function r(h,d){D(h,d,"signature",e)}if(e==null)return new dt(Ln,wg,wg,27);if(typeof e=="string"){const h=de(e,"signature");if(h.length===64){const d=ae(h.slice(0,32)),m=h.slice(32,64),y=m[0]&128?28:27;return m[0]&=127,new dt(Ln,d,ae(m),y)}if(h.length===65){const d=ae(h.slice(0,32)),m=ae(h.slice(32,64)),y=dt.getNormalizedV(h[64]);return new dt(Ln,d,m,y)}r(!1,"invalid raw signature length")}if(e instanceof dt)return e.clone();const n=e.r;r(n!=null,"missing r");const i=hf(n),o=(function(h,d){if(h!=null)return hf(h);if(d!=null){r(it(d,32),"invalid yParityAndS");const m=de(d);return m[0]&=127,ae(m)}r(!1,"missing s")})(e.s,e.yParityAndS),{networkV:a,v:u}=(function(h,d,m){if(h!=null){const y=ge(h);return{networkV:y>=Jo?y:void 0,v:dt.getNormalizedV(y)}}if(d!=null)return r(it(d,32),"invalid yParityAndS"),{v:de(d)[0]&128?28:27};if(m!=null){switch(Ie(m,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")})(e.v,e.yParityAndS,e.yParity),l=new dt(Ln,i,o,u);return a&&(l.#n=a),r(e.yParity==null||Ie(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}}class Xt{#e;constructor(e){D(Pi(e)===32,"invalid private key","privateKey","[REDACTED]"),this.#e=ae(e)}get privateKey(){return this.#e}get publicKey(){return Xt.computePublicKey(this.#e)}get compressedPublicKey(){return Xt.computePublicKey(this.#e,!0)}sign(e){D(Pi(e)===32,"invalid digest length","digest",e);const r=bn.sign(Dt(e),Dt(this.#e),{lowS:!0});return dt.from({r:nn(r.r,32),s:nn(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Xt.computePublicKey(e);return ae(bn.getSharedSecret(Dt(this.#e),de(r),!1))}static computePublicKey(e,r){let n=de(e,"key");if(n.length===32){const o=bn.getPublicKey(n,!!r);return ae(o)}if(n.length===64){const o=new Uint8Array(65);o[0]=4,o.set(n,1),n=o}const i=bn.ProjectivePoint.fromHex(n);return ae(i.toRawBytes(r))}static recoverPublicKey(e,r){D(Pi(e)===32,"invalid digest length","digest",e);const n=dt.from(r);let i=bn.Signature.fromCompact(Dt(je([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const o=i.recoverPublicKey(Dt(e));return D(o!=null,"invalid signature for digest","signature",r),"0x"+o.toHex(!1)}static addPoints(e,r,n){const i=bn.ProjectivePoint.fromHex(Xt.computePublicKey(e).substring(2)),o=bn.ProjectivePoint.fromHex(Xt.computePublicKey(r).substring(2));return"0x"+i.add(o).toHex(!!n)}}const oP=BigInt(0),aP=BigInt(36);function Tg(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=de(lt(r));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 Qh={};for(let t=0;t<10;t++)Qh[String(t)]=String(t);for(let t=0;t<26;t++)Qh[String.fromCharCode(65+t)]=String(10+t);const Bg=15;function cP(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Qh[n]).join("");for(;e.length>=Bg;){let n=e.substring(0,Bg);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const uP=(function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t})();function lP(t){t=t.toLowerCase();let e=oP;for(let r=0;r<t.length;r++)e=e*aP+uP[t[r]];return e}function Ve(t){if(D(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=Tg(t);return D(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){D(t.substring(2,4)===cP(t),"bad icap checksum","address",t);let e=lP(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return Tg("0x"+e)}D(!1,"invalid address","address",t)}function fP(t){const e=Ve(t.from);let n=ge(t.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,Ve(ot(lt(Vr([e,n])),12))}function m1(t){return t&&typeof t.getAddress=="function"}async function df(t,e){const r=await e;return(r==null||r==="0x0000000000000000000000000000000000000000")&&(ne(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),D(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),Ve(r)}function kt(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?Ve(t):(ne(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),df(t,e.resolveName(t)));if(m1(t))return df(t,t.getAddress());if(t&&typeof t.then=="function")return df(t,t);D(!1,"unsupported addressable value","target",t)}const jr={};function be(t,e){let r=!1;return e<0&&(r=!0,e*=-1),new yt(jr,`${r?"":"u"}int${e}`,t,{signed:r,width:e})}function $e(t,e){return new yt(jr,`bytes${e||""}`,t,{size:e})}const Sg=Symbol.for("_ethers_typed");class yt{type;value;#e;_typedSymbol;constructor(e,r,n,i){i==null&&(i=null),ai(jr,e,"Typed"),Te(this,{_typedSymbol:Sg,type:r,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,r){return new yt(jr,e,r)}static uint8(e){return be(e,8)}static uint16(e){return be(e,16)}static uint24(e){return be(e,24)}static uint32(e){return be(e,32)}static uint40(e){return be(e,40)}static uint48(e){return be(e,48)}static uint56(e){return be(e,56)}static uint64(e){return be(e,64)}static uint72(e){return be(e,72)}static uint80(e){return be(e,80)}static uint88(e){return be(e,88)}static uint96(e){return be(e,96)}static uint104(e){return be(e,104)}static uint112(e){return be(e,112)}static uint120(e){return be(e,120)}static uint128(e){return be(e,128)}static uint136(e){return be(e,136)}static uint144(e){return be(e,144)}static uint152(e){return be(e,152)}static uint160(e){return be(e,160)}static uint168(e){return be(e,168)}static uint176(e){return be(e,176)}static uint184(e){return be(e,184)}static uint192(e){return be(e,192)}static uint200(e){return be(e,200)}static uint208(e){return be(e,208)}static uint216(e){return be(e,216)}static uint224(e){return be(e,224)}static uint232(e){return be(e,232)}static uint240(e){return be(e,240)}static uint248(e){return be(e,248)}static uint256(e){return be(e,256)}static uint(e){return be(e,256)}static int8(e){return be(e,-8)}static int16(e){return be(e,-16)}static int24(e){return be(e,-24)}static int32(e){return be(e,-32)}static int40(e){return be(e,-40)}static int48(e){return be(e,-48)}static int56(e){return be(e,-56)}static int64(e){return be(e,-64)}static int72(e){return be(e,-72)}static int80(e){return be(e,-80)}static int88(e){return be(e,-88)}static int96(e){return be(e,-96)}static int104(e){return be(e,-104)}static int112(e){return be(e,-112)}static int120(e){return be(e,-120)}static int128(e){return be(e,-128)}static int136(e){return be(e,-136)}static int144(e){return be(e,-144)}static int152(e){return be(e,-152)}static int160(e){return be(e,-160)}static int168(e){return be(e,-168)}static int176(e){return be(e,-176)}static int184(e){return be(e,-184)}static int192(e){return be(e,-192)}static int200(e){return be(e,-200)}static int208(e){return be(e,-208)}static int216(e){return be(e,-216)}static int224(e){return be(e,-224)}static int232(e){return be(e,-232)}static int240(e){return be(e,-240)}static int248(e){return be(e,-248)}static int256(e){return be(e,-256)}static int(e){return be(e,-256)}static bytes1(e){return $e(e,1)}static bytes2(e){return $e(e,2)}static bytes3(e){return $e(e,3)}static bytes4(e){return $e(e,4)}static bytes5(e){return $e(e,5)}static bytes6(e){return $e(e,6)}static bytes7(e){return $e(e,7)}static bytes8(e){return $e(e,8)}static bytes9(e){return $e(e,9)}static bytes10(e){return $e(e,10)}static bytes11(e){return $e(e,11)}static bytes12(e){return $e(e,12)}static bytes13(e){return $e(e,13)}static bytes14(e){return $e(e,14)}static bytes15(e){return $e(e,15)}static bytes16(e){return $e(e,16)}static bytes17(e){return $e(e,17)}static bytes18(e){return $e(e,18)}static bytes19(e){return $e(e,19)}static bytes20(e){return $e(e,20)}static bytes21(e){return $e(e,21)}static bytes22(e){return $e(e,22)}static bytes23(e){return $e(e,23)}static bytes24(e){return $e(e,24)}static bytes25(e){return $e(e,25)}static bytes26(e){return $e(e,26)}static bytes27(e){return $e(e,27)}static bytes28(e){return $e(e,28)}static bytes29(e){return $e(e,29)}static bytes30(e){return $e(e,30)}static bytes31(e){return $e(e,31)}static bytes32(e){return $e(e,32)}static address(e){return new yt(jr,"address",e)}static bool(e){return new yt(jr,"bool",!!e)}static bytes(e){return new yt(jr,"bytes",e)}static string(e){return new yt(jr,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new yt(jr,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===Sg}static dereference(e,r){if(yt.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}}class hP extends an{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=yt.dereference(r,"string");try{n=Ve(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return Ve(nn(e.readValue(),20))}}class dP extends an{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}function g1(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(h=>{const d=h.localName;return ne(d,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:h},value:r}),ne(!l[d],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:h},value:r}),l[d]=!0,r[d]})}else D(!1,"invalid tuple value","tuple",r);D(e.length===n.length,"types/value length mismatch","tuple",r);let i=new Gf,o=new Gf,a=[];e.forEach((l,h)=>{let d=n[h];if(l.dynamic){let m=o.length;l.encode(o,d);let y=i.writeUpdatableValue();a.push(w=>{y(w+m)})}else l.encode(i,d)}),a.forEach(l=>{l(i.length)});let u=t.appendWriter(i);return u+=t.appendWriter(o),u}function y1(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(o=>{let a=null;if(o.dynamic){let u=t.readIndex(),l=i.subReader(u);try{a=o.decode(l)}catch(h){if(_t(h,"BUFFER_OVERRUN"))throw h;a=h,a.baseType=o.name,a.name=o.localName,a.type=o.type}}else try{a=o.decode(t)}catch(u){if(_t(u,"BUFFER_OVERRUN"))throw u;a=u,a.baseType=o.name,a.name=o.localName,a.type=o.type}if(a==null)throw new Error("investigate");r.push(a),n.push(o.localName||null)}),Wr.fromItems(r,n)}class pP extends an{coder;length;constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",o=r===-1||e.dynamic;super("array",i,n,o),Te(this,{coder:e,length:r})}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;n<this.length;n++)r.push(e);return r}encode(e,r){const n=yt.dereference(r,"array");Array.isArray(n)||this._throwError("expected array value",n);let i=this.length;i===-1&&(i=n.length,e.writeValue(n.length)),sx(n.length,i,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let a=0;a<n.length;a++)o.push(this.coder);return g1(e,o,n)}decode(e){let r=this.length;r===-1&&(r=e.readIndex(),ne(r*Kt<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:r*Kt,length:e.dataLength}));let n=[];for(let i=0;i<r;i++)n.push(new dP(this.coder));return y1(e,n)}}class mP extends an{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,r){const n=yt.dereference(r,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class b1 extends an{constructor(e,r){super(e,e,r,!0)}defaultValue(){return"0x"}encode(e,r){r=Dt(r);let n=e.writeValue(r.length);return n+=e.writeBytes(r),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class gP extends b1{constructor(e){super("bytes",e)}decode(e){return ae(super.decode(e))}}class yP extends an{size;constructor(e,r){let n="bytes"+String(e);super(n,n,r,!1),Te(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,r){let n=Dt(yt.dereference(r,this.type));return n.length!==this.size&&this._throwError("incorrect data length",r),e.writeBytes(n)}decode(e){return ae(e.readBytes(this.size))}}const bP=new Uint8Array([]);class xP extends an{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes(bP)}decode(e){return e.readBytes(0),null}}const wP=BigInt(0),AP=BigInt(1),EP=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class vP extends an{size;signed;constructor(e,r,n){const i=(r?"int":"uint")+e*8;super(i,i,n,!1),Te(this,{size:e,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,r){let n=ge(yt.dereference(r,this.type)),i=Is(EP,Kt*8);if(this.signed){let o=Is(i,this.size*8-1);(n>o||n<-(o+AP))&&this._throwError("value out-of-bounds",r),n=ux(n,8*Kt)}else(n<wP||n>Is(i,this.size*8))&&this._throwError("value out-of-bounds",r);return e.writeValue(n)}decode(e){let r=Is(e.readValue(),this.size*8);return this.signed&&(r=sS(r,this.size*8)),r}}class RP extends b1{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Jt(yt.dereference(r,"string")))}decode(e){return Ea(super.decode(e))}}class Qo extends an{coders;constructor(e,r){let n=!1;const i=[];e.forEach(a=>{a.dynamic&&(n=!0),i.push(a.type)});const o="tuple("+i.join(",")+")";super("tuple",o,r,n),Te(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const o=i.localName;return o&&(n[o]||(n[o]=0),n[o]++),n},{});return this.coders.forEach((n,i)=>{let o=n.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),e[o]==null&&(e[o]=e[i]))}),Object.freeze(e)}encode(e,r){const n=yt.dereference(r,"tuple");return g1(e,this.coders,n)}decode(e){return y1(e,this.coders)}}function pf(t,e){return{address:Ve(t),storageKeys:e.map((r,n)=>(D(it(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function ci(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(D(r.length===2,"invalid slot set",`value[${n}]`,r),pf(r[0],r[1])):(D(r!=null&&typeof r=="object","invalid address-slot set","value",t),pf(r.address,r.storageKeys)));D(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,o)=>(i[o]=!0,i),{});return pf(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function x1(t){return{address:Ve(t.address),nonce:ge(t.nonce!=null?t.nonce:0),chainId:ge(t.chainId!=null?t.chainId:0),signature:dt.from(t.signature)}}function mo(t){let e;return typeof t=="string"?e=Xt.computePublicKey(t,!1):e=t.publicKey,Ve(lt("0x"+e.substring(4)).substring(26))}function TP(t,e){return mo(Xt.recoverPublicKey(t,e))}const Ot=BigInt(0),BP=BigInt(2),SP=BigInt(27),OP=BigInt(28),PP=BigInt(35),IP=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),kP=Symbol.for("nodejs.util.inspect.custom"),mf=4096*32,ca=128;function NP(t){return{blobToKzgCommitment:n=>{if("computeBlobProof"in t){if("blobToKzgCommitment"in t&&typeof t.blobToKzgCommitment=="function")return de(t.blobToKzgCommitment(ae(n)))}else if("blobToKzgCommitment"in t&&typeof t.blobToKzgCommitment=="function")return de(t.blobToKzgCommitment(n));if("blobToKZGCommitment"in t&&typeof t.blobToKZGCommitment=="function")return de(t.blobToKZGCommitment(ae(n)));D(!1,"unsupported KZG library","kzg",t)},computeBlobKzgProof:(n,i)=>{if("computeBlobProof"in t&&typeof t.computeBlobProof=="function")return de(t.computeBlobProof(ae(n),ae(i)));if("computeBlobKzgProof"in t&&typeof t.computeBlobKzgProof=="function")return t.computeBlobKzgProof(n,i);if("computeBlobKZGProof"in t&&typeof t.computeBlobKZGProof=="function")return de(t.computeBlobKZGProof(ae(n),ae(i)));D(!1,"unsupported KZG library","kzg",t)}}}function Og(t,e){let r=t.toString(16);for(;r.length<2;)r="0"+r;return r+=xr(e).substring(4),"0x"+r}function ns(t){return t==="0x"?null:Ve(t)}function Ya(t,e){try{return ci(t)}catch(r){D(!1,r.message,e,t)}}function CP(t,e){try{if(!Array.isArray(t))throw new Error("authorizationList: invalid array");const r=[];for(let n=0;n<t.length;n++){const i=t[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`);r.push({address:ns(i[1]),nonce:Je(i[2],"nonce"),chainId:Je(i[0],"chainId"),signature:dt.from({yParity:ui(i[3],"yParity"),r:rn(i[4],32),s:rn(i[5],32)})})}return r}catch(r){D(!1,r.message,e,t)}}function ui(t,e){return t==="0x"?0:Ie(t,e)}function Je(t,e){if(t==="0x")return Ot;const r=ge(t,e);return D(r<=IP,"value exceeds uint size",e,r),r}function ze(t,e){const r=ge(t,"value"),n=mt(r);return D(n.length<=32,"value too large",`tx.${e}`,r),n}function Xa(t){return ci(t).map(e=>[e.address,e.storageKeys])}function _P(t){return t.map(e=>[ze(e.chainId,"chainId"),e.address,ze(e.nonce,"nonce"),ze(e.signature.yParity,"yParity"),mt(e.signature.r),mt(e.signature._s)])}function DP(t,e){D(Array.isArray(t),`invalid ${e}`,"value",t);for(let r=0;r<t.length;r++)D(it(t[r],32),"invalid ${ param } hash",`value[${r}]`,t[r]);return t}function FP(t){const e=ho(t);D(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const r={type:0,nonce:ui(e[0],"nonce"),gasPrice:Je(e[1],"gasPrice"),gasLimit:Je(e[2],"gasLimit"),to:ns(e[3]),value:Je(e[4],"value"),data:ae(e[5]),chainId:Ot};if(e.length===6)return r;const n=Je(e[6],"v"),i=Je(e[7],"r"),o=Je(e[8],"s");if(i===Ot&&o===Ot)r.chainId=n;else{let a=(n-PP)/BP;a<Ot&&(a=Ot),r.chainId=a,D(a!==Ot||n===SP||n===OP,"non-canonical legacy v","v",e[6]),r.signature=dt.from({r:rn(e[7],32),s:rn(e[8],32),v:n})}return r}function UP(t,e){const r=[ze(t.nonce,"nonce"),ze(t.gasPrice||0,"gasPrice"),ze(t.gasLimit,"gasLimit"),t.to||"0x",ze(t.value,"value"),t.data];let n=Ot;if(t.chainId!=Ot)n=ge(t.chainId,"tx.chainId"),D(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const o=t.signature.legacyChainId;o!=null&&(n=o)}if(!e)return n!==Ot&&(r.push(mt(n)),r.push("0x"),r.push("0x")),Vr(r);let i=BigInt(27+e.yParity);return n!==Ot?i=dt.getChainIdV(n,e.v):BigInt(e.v)!==i&&D(!1,"tx.chainId/sig.v mismatch","sig",e),r.push(mt(i)),r.push(mt(e.r)),r.push(mt(e._s)),Vr(r)}function ec(t,e){let r;try{if(r=ui(e[0],"yParity"),r!==0&&r!==1)throw new Error("bad yParity")}catch{D(!1,"invalid yParity","yParity",e[0])}const n=rn(e[1],32),i=rn(e[2],32),o=dt.from({r:n,s:i,yParity:r});t.signature=o}function LP(t){const e=ho(de(t).slice(1));D(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",ae(t));const r={type:2,chainId:Je(e[0],"chainId"),nonce:ui(e[1],"nonce"),maxPriorityFeePerGas:Je(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Je(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Je(e[4],"gasLimit"),to:ns(e[5]),value:Je(e[6],"value"),data:ae(e[7]),accessList:Ya(e[8],"accessList")};return e.length===9||ec(r,e.slice(9)),r}function MP(t,e){const r=[ze(t.chainId,"chainId"),ze(t.nonce,"nonce"),ze(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ze(t.maxFeePerGas||0,"maxFeePerGas"),ze(t.gasLimit,"gasLimit"),t.to||"0x",ze(t.value,"value"),t.data,Xa(t.accessList||[])];return e&&(r.push(ze(e.yParity,"yParity")),r.push(mt(e.r)),r.push(mt(e.s))),je(["0x02",Vr(r)])}function zP(t){const e=ho(de(t).slice(1));D(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",ae(t));const r={type:1,chainId:Je(e[0],"chainId"),nonce:ui(e[1],"nonce"),gasPrice:Je(e[2],"gasPrice"),gasLimit:Je(e[3],"gasLimit"),to:ns(e[4]),value:Je(e[5],"value"),data:ae(e[6]),accessList:Ya(e[7],"accessList")};return e.length===8||ec(r,e.slice(8)),r}function VP(t,e){const r=[ze(t.chainId,"chainId"),ze(t.nonce,"nonce"),ze(t.gasPrice||0,"gasPrice"),ze(t.gasLimit,"gasLimit"),t.to||"0x",ze(t.value,"value"),t.data,Xa(t.accessList||[])];return e&&(r.push(ze(e.yParity,"recoveryParam")),r.push(mt(e.r)),r.push(mt(e.s))),je(["0x01",Vr(r)])}function GP(t){let e=ho(de(t).slice(1)),r="3",n=null,i=null;if(e.length===4&&Array.isArray(e[0])){r="3 (network format)";const a=e[1],u=e[2],l=e[3];D(Array.isArray(a),"invalid network format: blobs not an array","fields[1]",a),D(Array.isArray(u),"invalid network format: commitments not an array","fields[2]",u),D(Array.isArray(l),"invalid network format: proofs not an array","fields[3]",l),D(a.length===u.length,"invalid network format: blobs/commitments length mismatch","fields",e),D(a.length===l.length,"invalid network format: blobs/proofs length mismatch","fields",e),i=[];for(let h=0;h<e[1].length;h++)i.push({data:a[h],commitment:u[h],proof:l[h]});e=e[0]}else if(e.length===5&&Array.isArray(e[0])){r="3 (EIP-7594 network format)",n=Ie(e[1]);const a=e[2],u=e[3],l=e[4];D(n===1,`unsupported EIP-7594 network format version: ${n}`,"fields[1]",n),D(Array.isArray(a),"invalid EIP-7594 network format: blobs not an array","fields[2]",a),D(Array.isArray(u),"invalid EIP-7594 network format: commitments not an array","fields[3]",u),D(Array.isArray(l),"invalid EIP-7594 network format: proofs not an array","fields[4]",l),D(a.length===u.length,"invalid network format: blobs/commitments length mismatch","fields",e),D(a.length*ca===l.length,"invalid network format: blobs/proofs length mismatch","fields",e),i=[];for(let h=0;h<a.length;h++){const d=[];for(let m=0;m<ca;m++)d.push(l[h*ca+m]);i.push({data:a[h],commitment:u[h],proof:je(d)})}e=e[0]}D(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${r}`,"data",ae(t));const o={type:3,chainId:Je(e[0],"chainId"),nonce:ui(e[1],"nonce"),maxPriorityFeePerGas:Je(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Je(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Je(e[4],"gasLimit"),to:ns(e[5]),value:Je(e[6],"value"),data:ae(e[7]),accessList:Ya(e[8],"accessList"),maxFeePerBlobGas:Je(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10],blobWrapperVersion:n};i&&(o.blobs=i),D(o.to!=null,`invalid address for transaction type: ${r}`,"data",t),D(Array.isArray(o.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let a=0;a<o.blobVersionedHashes.length;a++)D(it(o.blobVersionedHashes[a],32),`invalid blobVersionedHash at index ${a}: must be length 32`,"data",t);return e.length===11||ec(o,e.slice(11)),o}function $P(t,e,r){const n=[ze(t.chainId,"chainId"),ze(t.nonce,"nonce"),ze(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ze(t.maxFeePerGas||0,"maxFeePerGas"),ze(t.gasLimit,"gasLimit"),t.to||Ws,ze(t.value,"value"),t.data,Xa(t.accessList||[]),ze(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),DP(t.blobVersionedHashes||[],"blobVersionedHashes")];if(e&&(n.push(ze(e.yParity,"yParity")),n.push(mt(e.r)),n.push(mt(e.s)),r)){if(t.blobWrapperVersion!=null){const i=mt(t.blobWrapperVersion),o=[];for(const{proof:a}of r){const u=de(a),l=u.length/ca;for(let h=0;h<u.length;h+=l)o.push(u.subarray(h,h+l))}return je(["0x03",Vr([n,i,r.map(a=>a.data),r.map(a=>a.commitment),o])])}return je(["0x03",Vr([n,r.map(i=>i.data),r.map(i=>i.commitment),r.map(i=>i.proof)])])}return je(["0x03",Vr(n)])}function jP(t){const e=ho(de(t).slice(1));D(Array.isArray(e)&&(e.length===10||e.length===13),"invalid field count for transaction type: 4","data",ae(t));const r={type:4,chainId:Je(e[0],"chainId"),nonce:ui(e[1],"nonce"),maxPriorityFeePerGas:Je(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Je(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Je(e[4],"gasLimit"),to:ns(e[5]),value:Je(e[6],"value"),data:ae(e[7]),accessList:Ya(e[8],"accessList"),authorizationList:CP(e[9],"authorizationList")};return e.length===10||ec(r,e.slice(10)),r}function HP(t,e){const r=[ze(t.chainId,"chainId"),ze(t.nonce,"nonce"),ze(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ze(t.maxFeePerGas||0,"maxFeePerGas"),ze(t.gasLimit,"gasLimit"),t.to||"0x",ze(t.value,"value"),t.data,Xa(t.accessList||[]),_P(t.authorizationList||[])];return e&&(r.push(ze(e.yParity,"yParity")),r.push(mt(e.r)),r.push(mt(e.s))),je(["0x04",Vr(r)])}class gr{#e;#t;#r;#n;#i;#o;#s;#a;#d;#u;#p;#m;#c;#l;#f;#h;#b;#g;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:D(!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?Ws:e}set to(e){this.#t=e==null?null:Ve(e)}get nonce(){return this.#n}set nonce(e){this.#n=Ie(e,"value")}get gasLimit(){return this.#i}set gasLimit(e){this.#i=ge(e)}get gasPrice(){const e=this.#o;return e==null&&(this.type===0||this.type===1)?Ot:e}set gasPrice(e){this.#o=e==null?null:ge(e,"gasPrice")}get maxPriorityFeePerGas(){const e=this.#s;return e??(this.type===2||this.type===3?Ot:null)}set maxPriorityFeePerGas(e){this.#s=e==null?null:ge(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const e=this.#a;return e??(this.type===2||this.type===3?Ot:null)}set maxFeePerGas(e){this.#a=e==null?null:ge(e,"maxFeePerGas")}get data(){return this.#r}set data(e){this.#r=ae(e)}get value(){return this.#d}set value(e){this.#d=ge(e,"value")}get chainId(){return this.#u}set chainId(e){this.#u=ge(e)}get signature(){return this.#p||null}set signature(e){this.#p=e==null?null:dt.from(e)}isValid(){const e=this.signature;if(e&&!e.isValid())return!1;const r=this.authorizationList;if(r){for(const n of r)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:ci(e)}get authorizationList(){const e=this.#b||null;return e==null&&this.type===4?[]:e}set authorizationList(e){this.#b=e==null?null:e.map(r=>x1(r))}get maxFeePerBlobGas(){const e=this.#c;return e==null&&this.type===3?Ot:e}set maxFeePerBlobGas(e){this.#c=e==null?null:ge(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#l;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){D(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let r=0;r<e.length;r++)D(it(e[r],32),"invalid blobVersionedHash",`value[${r}]`,e[r])}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 r=[],n=[];for(let i=0;i<e.length;i++){const o=e[i];if(qa(o)){ne(this.#f,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let a=de(o);if(D(a.length<=mf,"blob is too large",`blobs[${i}]`,o),a.length!==mf){const h=new Uint8Array(mf);h.set(a),a=h}const u=this.#f.blobToKzgCommitment(a),l=ae(this.#f.computeBlobKzgProof(a,u));r.push({data:ae(a),commitment:ae(u),proof:l}),n.push(Og(1,u))}else{const a=ae(o.data),u=ae(o.commitment),l=ae(o.proof);r.push({data:a,commitment:u,proof:l}),n.push(Og(1,u))}}this.#h=r,this.#l=n}get kzg(){return this.#f}set kzg(e){e==null?this.#f=null:this.#f=NP(e)}get blobWrapperVersion(){return this.#g}set blobWrapperVersion(e){this.#g=e}constructor(){this.#e=null,this.#t=null,this.#n=0,this.#i=Ot,this.#o=null,this.#s=null,this.#a=null,this.#r="0x",this.#d=Ot,this.#u=Ot,this.#p=null,this.#m=null,this.#c=null,this.#l=null,this.#f=null,this.#h=null,this.#b=null,this.#g=null}get hash(){return this.signature==null?null:lt(this.#y(!0,!1))}get unsignedHash(){return lt(this.unsignedSerialized)}get from(){return this.signature==null?null:TP(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){return this.signature==null?null:Xt.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return this.signature!=null}#y(e,r){ne(!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 UP(this,n);case 1:return VP(this,n);case 2:return MP(this,n);case 3:return $P(this,n,r?this.blobs:null);case 4:return HP(this,n)}ne(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#y(!0,!0)}get unsignedSerialized(){return this.#y(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,i=this.#c!=null||this.#l;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&ne(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ne(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ne(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const o=[];return this.type!=null?o.push(this.type):this.authorizationList&&this.authorizationList.length?o.push(4):r?o.push(2):e?(o.push(1),n||o.push(0)):n?(o.push(1),o.push(2)):(i&&this.to||(o.push(0),o.push(1),o.push(2)),o.push(3)),o.sort(),o}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return gr.from(this)}toJSON(){const e=r=>r==null?null:r.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}}[kP](){return this.toString()}toString(){const e=[],r=i=>{let o=this[i];typeof o=="string"&&(o=JSON.stringify(o)),e.push(`${i}: ${o}`)};this.type&&r("type"),r("to"),r("data"),r("nonce"),r("gasLimit"),r("value"),this.chainId!=null&&r("chainId"),this.signature&&(r("from"),e.push(`signature: ${this.signature.toString()}`));const n=this.authorizationList;if(n){const i=[];for(const o of n){const a=[];a.push(`address: ${JSON.stringify(o.address)}`),o.nonce!=null&&a.push(`nonce: ${o.nonce}`),o.chainId!=null&&a.push(`chainId: ${o.chainId}`),o.signature&&a.push(`signature: ${o.signature.toString()}`),i.push(`Authorization { ${a.join(", ")} }`)}e.push(`authorizations: [ ${i.join(", ")} ]`)}return`Transaction { ${e.join(", ")} }`}static from(e){if(e==null)return new gr;if(typeof e=="string"){const n=de(e);if(n[0]>=127)return gr.from(FP(n));switch(n[0]){case 1:return gr.from(zP(n));case 2:return gr.from(LP(n));case 3:return gr.from(GP(n));case 4:return gr.from(jP(n))}ne(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new gr;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(r.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=dt.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.authorizationList!=null&&(r.authorizationList=e.authorizationList),e.blobVersionedHashes!=null&&(r.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(r.kzg=e.kzg),e.blobWrapperVersion!=null&&(r.blobWrapperVersion=e.blobWrapperVersion),e.blobs!=null&&(r.blobs=e.blobs),e.hash!=null&&(D(r.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),D(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(D(r.isSigned(),"unsigned transaction cannot define '.from'","tx",e),D(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}}function qP(t){return D(typeof t.address=="string","invalid address for hashAuthorization","auth.address",t),lt(je(["0x05",Vr([t.chainId!=null?mt(t.chainId):"0x",Ve(t.address),t.nonce!=null?mt(t.nonce):"0x"])]))}function sn(t){return lt(Jt(t))}var ZP="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 Pg=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Ig=4;function KP(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,o=[0,1];for(let N=1;N<n;N++)o.push(i+=r());let a=r(),u=e;e+=a;let l=0,h=0;function d(){return l==0&&(h=h<<8|t[e++],l=8),h>>--l&1}const m=31,y=2**m,w=y>>>1,T=w>>1,E=y-1;let B=0;for(let N=0;N<m;N++)B=B<<1|d();let A=[],P=0,I=y;for(;;){let N=Math.floor(((B-P+1)*i-1)/I),_=0,F=n;for(;F-_>1;){let K=_+F>>>1;N<o[K]?F=K:_=K}if(_==0)break;A.push(_);let U=P+Math.floor(I*o[_]/i),H=P+Math.floor(I*o[_+1]/i)-1;for(;((U^H)&w)==0;)B=B<<1&E|d(),U=U<<1&E,H=H<<1&E|1;for(;U&~H&T;)B=B&w|B<<1&E>>>1|d(),U=U<<1^w,H=(H^w)<<1|w|1;P=U,I=1+H-U}let S=n-4;return A.map(N=>{switch(N-S){case 3:return S+65792+(t[u++]<<16|t[u++]<<8|t[u++]);case 2:return S+256+(t[u++]<<8|t[u++]);case 1:return S+t[u++];default:return N-1}})}function WP(t){let e=0;return()=>t[e++]}function w1(t){return WP(KP(JP(t)))}function JP(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,o)=>e[i.charCodeAt(0)]=o);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,o=0,a=0,u=0;i<r;i++)u=u<<6|e[t.charCodeAt(i)],a+=6,a>=8&&(n[o++]=u>>(a-=8));return n}function QP(t){return t&1?~t>>1:t>>1}function YP(t,e){let r=Array(t);for(let n=0,i=0;n<t;n++)r[n]=i+=QP(e());return r}function Js(t,e=0){let r=[];for(;;){let n=t(),i=t();if(!i)break;e+=n;for(let o=0;o<i;o++)r.push(e+o);e+=i+1}return r}function A1(t){return Qs(()=>{let e=Js(t);if(e.length)return e})}function E1(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(XP(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(eI(r,t))}return e.flat()}function Qs(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function v1(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;i<e;i++)YP(t,r).forEach((o,a)=>n[a].push(o));return n}function XP(t,e){let r=1+e(),n=e(),i=Qs(e);return v1(i.length,1+t,e).flatMap((a,u)=>{let[l,...h]=a;return Array(i[u]).fill().map((d,m)=>{let y=m*n;return[l+m*r,h.map(w=>w+y)]})})}function eI(t,e){let r=1+e();return v1(r,1+t,e).map(i=>[i[0],i.slice(1)])}function tI(t){let e=[],r=Js(t);return i(n([]),[]),e;function n(o){let a=t(),u=Qs(()=>{let l=Js(t).map(h=>r[h]);if(l.length)return n(l)});return{S:a,B:u,Q:o}}function i({S:o,B:a},u,l){if(!(o&4&&l===u[u.length-1])){o&2&&(l=u[u.length-1]),o&1&&e.push(u);for(let h of a)for(let d of h.Q)i(h,[...u,d],l)}}}function rI(t){return t.toString(16).toUpperCase().padStart(2,"0")}function R1(t){return`{${rI(t)}}`}function nI(t){let e=[];for(let r=0,n=t.length;r<n;){let i=t.codePointAt(r);r+=i<65536?1:2,e.push(i)}return e}function $i(t){let r=t.length;if(r<4096)return String.fromCodePoint(...t);let n=[];for(let i=0;i<r;)n.push(String.fromCodePoint(...t.slice(i,i+=4096)));return n.join("")}function iI(t,e){let r=t.length,n=r-e.length;for(let i=0;n==0&&i<r;i++)n=t[i]-e[i];return n}var sI="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 Ys=44032,va=4352,Ra=4449,Ta=4519,T1=19,B1=21,ji=28,Ba=B1*ji,oI=T1*Ba,aI=Ys+oI,cI=va+T1,uI=Ra+B1,lI=Ta+ji;function ks(t){return t>>24&255}function S1(t){return t&16777215}let Wf,kg,Jf,ua;function fI(){let t=w1(sI);Wf=new Map(A1(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),kg=new Set(Js(t)),Jf=new Map,ua=new Map;for(let[e,r]of E1(t)){if(!kg.has(e)&&r.length==2){let[n,i]=r,o=ua.get(n);o||(o=new Map,ua.set(n,o)),o.set(i,e)}Jf.set(e,r.reverse())}}function O1(t){return t>=Ys&&t<aI}function hI(t,e){if(t>=va&&t<cI&&e>=Ra&&e<uI)return Ys+(t-va)*Ba+(e-Ra)*ji;if(O1(t)&&e>Ta&&e<lI&&(t-Ys)%ji==0)return t+(e-Ta);{let r=ua.get(t);return r&&(r=r.get(e),r)?r:-1}}function P1(t){Wf||fI();let e=[],r=[],n=!1;function i(o){let a=Wf.get(o);a&&(n=!0,o|=a),e.push(o)}for(let o of t)for(;;){if(o<128)e.push(o);else if(O1(o)){let a=o-Ys,u=a/Ba|0,l=a%Ba/ji|0,h=a%ji;i(va+u),i(Ra+l),h>0&&i(Ta+h)}else{let a=Jf.get(o);a?r.push(...a):i(o)}if(!r.length)break;o=r.pop()}if(n&&e.length>1){let o=ks(e[0]);for(let a=1;a<e.length;a++){let u=ks(e[a]);if(u==0||o<=u){o=u;continue}let l=a-1;for(;;){let h=e[l+1];if(e[l+1]=e[l],e[l]=h,!l||(o=ks(e[--l]),o<=u))break}o=ks(e[a])}}return e}function dI(t){let e=[],r=[],n=-1,i=0;for(let o of t){let a=ks(o),u=S1(o);if(n==-1)a==0?n=u:e.push(u);else if(i>0&&i>=a)a==0?(e.push(n,...r),r.length=0,n=u):r.push(u),i=a;else{let l=hI(n,u);l>=0?n=l:i==0&&a==0?(e.push(n),n=u):(r.push(u),i=a)}}return n>=0&&e.push(n,...r),e}function I1(t){return P1(t).map(S1)}function pI(t){return dI(P1(t))}const Ng=45,k1=".",N1=65039,C1=1,Sa=t=>Array.from(t);function Xs(t,e){return t.P.has(e)||t.Q.has(e)}class mI extends Array{get is_emoji(){return!0}}let Qf,_1,qn,Yf,D1,ki,gf,Ei,zn,Cg,Xf;function Yh(){if(Qf)return;let t=w1(ZP);const e=()=>Js(t),r=()=>new Set(e()),n=(d,m)=>m.forEach(y=>d.add(y));Qf=new Map(E1(t)),_1=r(),qn=e(),Yf=new Set(e().map(d=>qn[d])),qn=new Set(qn),D1=r(),r();let i=A1(t),o=t();const a=()=>{let d=new Set;return e().forEach(m=>n(d,i[m])),n(d,e()),d};ki=Qs(d=>{let m=Qs(t).map(y=>y+96);if(m.length){let y=d>=o;m[0]-=32,m=$i(m),y&&(m=`Restricted[${m}]`);let w=a(),T=a(),E=!t();return{N:m,P:w,Q:T,M:E,R:y}}}),gf=r(),Ei=new Map;let u=e().concat(Sa(gf)).sort((d,m)=>d-m);u.forEach((d,m)=>{let y=t(),w=u[m]=y?u[m-y]:{V:[],M:new Map};w.V.push(d),gf.has(d)||Ei.set(d,w)});for(let{V:d,M:m}of new Set(Ei.values())){let y=[];for(let T of d){let E=ki.filter(A=>Xs(A,T)),B=y.find(({G:A})=>E.some(P=>A.has(P)));B||(B={G:new Set,V:[]},y.push(B)),B.V.push(T),n(B.G,E)}let w=y.flatMap(T=>Sa(T.G));for(let{G:T,V:E}of y){let B=new Set(w.filter(A=>!T.has(A)));for(let A of E)m.set(A,B)}}zn=new Set;let l=new Set;const h=d=>zn.has(d)?l.add(d):zn.add(d);for(let d of ki){for(let m of d.P)h(m);for(let m of d.Q)h(m)}for(let d of zn)!Ei.has(d)&&!l.has(d)&&Ei.set(d,C1);n(zn,I1(zn)),Cg=tI(t).map(d=>mI.from(d)).sort(iI),Xf=new Map;for(let d of Cg){let m=[Xf];for(let y of d){let w=m.map(T=>{let E=T.get(y);return E||(E=new Map,T.set(y,E)),E});y===N1?m.push(...w):m=w}for(let y of m)y.V=d}}function Xh(t){return(F1(t)?"":`${e0(tc([t]))} `)+R1(t)}function e0(t){return`"${t}"‎`}function gI(t){if(t.length>=4&&t[2]==Ng&&t[3]==Ng)throw new Error(`invalid label extension: "${$i(t.slice(0,4))}"`)}function yI(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function bI(t){let e=t[0],r=Pg.get(e);if(r)throw Ls(`leading ${r}`);let n=t.length,i=-1;for(let o=1;o<n;o++){e=t[o];let a=Pg.get(e);if(a){if(i==o)throw Ls(`${r} + ${a}`);i=o+1,r=a}}if(i==n)throw Ls(`trailing ${r}`)}function tc(t,e=1/0,r=R1){let n=[];xI(t[0])&&n.push("◌"),t.length>e&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,o=t.length;for(let a=0;a<o;a++){let u=t[a];F1(u)&&(n.push($i(t.slice(i,a))),n.push(r(u)),i=a+1)}return n.push($i(t.slice(i,o))),n.join("")}function xI(t){return Yh(),qn.has(t)}function F1(t){return Yh(),D1.has(t)}function wI(t){return RI(AI(t,pI,SI))}function AI(t,e,r){if(!t)return[];Yh();let n=0;return t.split(k1).map(i=>{let o=nI(i),a={input:o,offset:n};n+=o.length+1;try{let u=a.tokens=BI(o,e,r),l=u.length,h;if(!l)throw new Error("empty label");let d=a.output=u.flat();if(yI(d),!(a.emoji=l>1||u[0].is_emoji)&&d.every(y=>y<128))gI(d),h="ASCII";else{let y=u.flatMap(w=>w.is_emoji?[]:w);if(!y.length)h="Emoji";else{if(qn.has(d[0]))throw Ls("leading combining mark");for(let E=1;E<l;E++){let B=u[E];if(!B.is_emoji&&qn.has(B[0]))throw Ls(`emoji + combining mark: "${$i(u[E-1])} + ${tc([B[0]])}"`)}bI(d);let w=Sa(new Set(y)),[T]=vI(w);TI(T,y),EI(T,w),h=T.N}}a.type=h}catch(u){a.error=u}return a})}function EI(t,e){let r,n=[];for(let i of e){let o=Ei.get(i);if(o===C1)return;if(o){let a=o.M.get(i);if(r=r?r.filter(u=>a.has(u)):Sa(a),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(o=>Xs(i,o)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function vI(t){let e=ki;for(let r of t){let n=e.filter(i=>Xs(i,r));if(!n.length)throw ki.some(i=>Xs(i,r))?L1(e[0],r):U1(r);if(e=n,n.length==1)break}return e}function RI(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${e0(tc(e,63))}: ${i}`)}return $i(n)}).join(k1)}function U1(t){return new Error(`disallowed character: ${Xh(t)}`)}function L1(t,e){let r=Xh(e),n=ki.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function Ls(t){return new Error(`illegal placement: ${t}`)}function TI(t,e){for(let r of e)if(!Xs(t,r))throw L1(t,r);if(t.M){let r=I1(e);for(let n=1,i=r.length;n<i;n++)if(Yf.has(r[n])){let o=n+1;for(let a;o<i&&Yf.has(a=r[o]);o++)for(let u=n;u<o;u++)if(r[u]==a)throw new Error(`duplicate non-spacing marks: ${Xh(a)}`);if(o-n>Ig)throw new Error(`excessive non-spacing marks: ${e0(tc(r.slice(n-1,o)))} (${o-n}/${Ig})`);n=o}}}function BI(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let o=OI(t);if(o)i.length&&(n.push(e(i)),i=[]),n.push(r(o));else{let a=t.pop();if(zn.has(a))i.push(a);else{let u=Qf.get(a);if(u)i.push(...u);else if(!_1.has(a))throw U1(a)}}}return i.length&&n.push(e(i)),n}function SI(t){return t.filter(e=>e!=N1)}function OI(t,e){let r=Xf,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:o}=r;o&&(n=o,t.length=i)}return n}const M1=new Uint8Array(32);M1.fill(0);function _g(t){return D(t.length!==0,"invalid ENS name; empty component","comp",t),t}function z1(t){const e=Jt(PI(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(r.push(_g(e.slice(n,i))),n=i+1);return D(n<e.length,"invalid ENS name; empty component","name",t),r.push(_g(e.slice(n))),r}function PI(t){try{if(t.length===0)throw new Error("empty label");return wI(t)}catch(e){D(!1,`invalid ENS name (${e.message})`,"name",t)}}function eh(t){D(typeof t=="string","invalid ENS name; not a string","name",t),D(t.length,"invalid ENS name (empty label)","name",t);let e=M1;const r=z1(t);for(;r.length;)e=lt(je([e,lt(r.pop())]));return ae(e)}function II(t,e){const r=e;return D(r<=255,"DNS encoded label cannot exceed 255","length",r),ae(je(z1(t).map(n=>{D(n.length<=r,`label ${JSON.stringify(t)} exceeds ${r} bytes`,"name",t);const i=new Uint8Array(n.length+1);return i.set(n,1),i[0]=i.length-1,i})))+"00"}function kI(t){return typeof t=="string"&&(t=Jt(t)),lt(je([Jt(nP),Jt(String(t.length)),t]))}const V1=new Uint8Array(32);V1.fill(0);const NI=BigInt(-1),G1=BigInt(0),$1=BigInt(1),CI=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function _I(t){const e=de(t),r=e.length%32;return r?je([e,V1.slice(r)]):ae(e)}const DI=nn($1,32),FI=nn(G1,32),Dg={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},yf=["name","version","chainId","verifyingContract","salt"];function Fg(t){return function(e){return D(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const UI={name:Fg("name"),version:Fg("version"),chainId:function(t){const e=ge(t,"domain.chainId");return D(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Br(e)},verifyingContract:function(t){try{return Ve(t).toLowerCase()}catch{}D(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=de(t,"domain.salt");return D(e.length===32,'invalid domain value "salt"',"domain.salt",t),ae(e)}};function bf(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const r=e[1]==="",n=parseInt(e[2]);D(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",t);const i=Is(CI,r?n-1:n),o=r?(i+$1)*NI:G1;return function(a){const u=ge(a,"value");return D(u>=o&&u<=i,`value out-of-bounds for ${t}`,"value",u),nn(r?ux(u,256):u,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return D(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=de(n);return D(i.length===r,`invalid length for ${t}`,"value",n),_I(n)}}}switch(t){case"address":return function(e){return rn(Ve(e),32)};case"bool":return function(e){return e?DI:FI};case"bytes":return function(e){return lt(e)};case"string":return function(e){return sn(e)}}return null}function Ug(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}function Yo(t){const e=t.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:t}}class Zt{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#r;constructor(e){this.#t=new Map,this.#r=new Map;const r=new Map,n=new Map,i=new Map,o={};Object.keys(e).forEach(l=>{o[l]=e[l].map(({name:h,type:d})=>{let{base:m,index:y}=Yo(d);return m==="int"&&!e.int&&(m="int256"),m==="uint"&&!e.uint&&(m="uint256"),{name:h,type:m+(y||"")}}),r.set(l,new Set),n.set(l,[]),i.set(l,new Set)}),this.#e=JSON.stringify(o);for(const l in o){const h=new Set;for(const d of o[l]){D(!h.has(d.name),`duplicate variable name ${JSON.stringify(d.name)} in ${JSON.stringify(l)}`,"types",e),h.add(d.name);const m=Yo(d.type).base;D(m!==l,`circular type reference to ${JSON.stringify(m)}`,"types",e),!bf(m)&&(D(n.has(m),`unknown type ${JSON.stringify(m)}`,"types",e),n.get(m).push(l),r.get(l).add(m))}}const a=Array.from(n.keys()).filter(l=>n.get(l).length===0);D(a.length!==0,"missing primary type","types",e),D(a.length===1,`ambiguous primary types or unused types: ${a.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),Te(this,{primaryType:a[0]});function u(l,h){D(!h.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),h.add(l);for(const d of r.get(l))if(n.has(d)){u(d,h);for(const m of h)i.get(m).add(d)}h.delete(l)}u(this.primaryType,new Set);for(const[l,h]of i){const d=Array.from(h);d.sort(),this.#t.set(l,Ug(l,o[l])+d.map(m=>Ug(m,o[m])).join(""))}}getEncoder(e){let r=this.#r.get(e);return r||(r=this.#n(e),this.#r.set(e,r)),r}#n(e){{const i=bf(e);if(i)return i}const r=Yo(e).array;if(r){const i=r.prefix,o=this.getEncoder(i);return a=>{D(r.count===-1||r.count===a.length,`array length mismatch; expected length ${r.count}`,"value",a);let u=a.map(o);return this.#t.has(i)&&(u=u.map(lt)),lt(je(u))}}const n=this.types[e];if(n){const i=sn(this.#t.get(e));return o=>{const a=n.map(({name:u,type:l})=>{const h=this.getEncoder(l)(o[u]);return this.#t.has(l)?lt(h):h});return a.unshift(i),je(a)}}D(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const r=this.#t.get(e);return D(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return lt(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(bf(e))return n(e,r);const i=Yo(e).array;if(i)return D(i.count===-1||i.count===r.length,`array length mismatch; expected length ${i.count}`,"value",r),r.map(a=>this._visit(i.prefix,a,n));const o=this.types[e];if(o)return o.reduce((a,{name:u,type:l})=>(a[u]=this._visit(l,r[u],n),a),{});D(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Zt(e)}static getPrimaryType(e){return Zt.from(e).primaryType}static hashStruct(e,r,n){return Zt.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=Dg[n];D(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>yf.indexOf(n.name)-yf.indexOf(i.name)),Zt.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return je(["0x1901",Zt.hashDomain(e),Zt.from(r).hash(n)])}static hash(e,r,n){return lt(Zt.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const u in e)e[u]==null&&delete e[u];const o={};e.verifyingContract&&!it(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const a=Zt.from(r);a.visit(n,(u,l)=>(u==="address"&&!it(l,20)&&(o[l]="0x"),l));for(const u in o)o[u]=await i(u);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),n=a.visit(n,(u,l)=>u==="address"&&o[l]?o[l]:l),{domain:e,value:n}}static getPayload(e,r,n){Zt.hashDomain(e);const i={},o=[];yf.forEach(l=>{const h=e[l];h!=null&&(i[l]=UI[l](h),o.push({name:l,type:Dg[l]}))});const a=Zt.from(r);r=a.types;const u=Object.assign({},r);return D(u.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),u.EIP712Domain=o,a.encode(n),{types:u,domain:i,primaryType:a.primaryType,message:a.visit(n,(l,h)=>{if(l.match(/^bytes(\d*)/))return ae(de(h));if(l.match(/^u?int/))return ge(h).toString();switch(l){case"address":return h.toLowerCase();case"bool":return!!h;case"string":return D(typeof h=="string","invalid string","value",h),h}D(!1,"unsupported type","type",l)})}}}function Wt(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const LI="external public payable override",MI=Wt(LI.split(" ")),j1="constant external internal payable private public pure view override",zI=Wt(j1.split(" ")),H1="constructor error event fallback function receive struct",q1=Wt(H1.split(" ")),Z1="calldata memory storage payable indexed",VI=Wt(Z1.split(" ")),GI="tuple returns",$I=[H1,Z1,GI,j1].join(" "),jI=Wt($I.split(" ")),HI={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},qI=new RegExp("^(\\s*)"),ZI=new RegExp("^([0-9]+)"),KI=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),K1=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),W1=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class wr{#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 wr(this.#t)}reset(){this.#e=0}#r(e=0,r=0){return new wr(this.#t.slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const r=this.peek();throw new Error(`expected ${e}; got ${r.type} ${JSON.stringify(r.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=this.#r(this.#e+1,e.match+1);return this.#e=e.match+1,r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;this.#e<e.match-1;){const n=this.peek().linkNext;r.push(this.#r(this.#e+1,n)),this.#e=n}return this.#e=e.match+1,r}peek(){if(this.#e>=this.#t.length)throw new Error("out-of-bounds");return this.#t[this.#e]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return this.#e++,e}toString(){const e=[];for(let r=this.#e;r<this.#t.length;r++){const n=this.#t[r];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}}function kn(t){const e=[],r=a=>{const u=o<t.length?JSON.stringify(t[o]):"$EOI";throw new Error(`invalid token ${u} at ${o}: ${a}`)};let n=[],i=[],o=0;for(;o<t.length;){let a=t.substring(o),u=a.match(qI);u&&(o+=u[1].length,a=t.substring(o));const l={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:o,value:-1};e.push(l);let h=HI[a[0]]||"";if(h){if(l.type=h,l.text=a[0],o++,h==="OPEN_PAREN")n.push(e.length-1),i.push(e.length-1);else if(h=="CLOSE_PAREN")n.length===0&&r("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(h==="COMMA")l.linkBack=i.pop(),e[l.linkBack].linkNext=e.length-1,i.push(e.length-1);else if(h==="OPEN_BRACKET")l.type="BRACKET";else if(h==="CLOSE_BRACKET"){let d=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const m=e.pop().text;d=m+d,e[e.length-1].value=Ie(m)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=d}continue}if(u=a.match(KI),u){if(l.text=u[1],o+=l.text.length,jI.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(W1)){l.type="TYPE";continue}l.type="ID";continue}if(u=a.match(ZI),u){l.text=u[1],l.type="NUMBER",o+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${o}`)}return new wr(e.map(a=>Object.freeze(a)))}function Lg(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function rc(t,e){if(e.peekKeyword(q1)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function on(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function J1(t){let e=on(t,zI);return Lg(e,Wt("constant payable nonpayable".split(" "))),Lg(e,Wt("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 Xr(t,e){return t.popParams().map(r=>nt.from(r,e))}function Q1(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return ge(t.pop().text);throw new Error("invalid gas")}return null}function Xn(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const WI=new RegExp(/^(.*)\[([0-9]*)\]$/);function Mg(t){const e=t.match(W1);if(D(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);D(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);D(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const pt={},er=Symbol.for("_ethers_internal"),zg="_ParamTypeInternal",Vg="_ErrorInternal",Gg="_EventInternal",$g="_ConstructorInternal",jg="_FallbackInternal",Hg="_FunctionInternal",qg="_StructInternal";class nt{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,r,n,i,o,a,u,l){if(ai(e,pt,"ParamType"),Object.defineProperty(this,er,{value:zg}),a&&(a=Object.freeze(a.slice())),i==="array"){if(u==null||l==null)throw new Error("")}else if(u!=null||l!=null)throw new Error("");if(i==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");Te(this,{name:r,type:n,baseType:i,indexed:o,components:a,arrayLength:u,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const o=JSON.parse(this.arrayChildren.format("json"));return o.name=n,o.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(o)}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(o=>JSON.parse(o.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){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,r))}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,o)=>n.components[o].walk(i,r))}return r(this.type,e)}#e(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,u=r.slice();u.forEach((l,h)=>{a.#e(e,l,n,d=>{u[h]=d})}),i(u);return}if(this.isTuple()){const a=this.components;let u;if(Array.isArray(r))u=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");u=a.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in r))throw new Error(`missing value for component ${l.name}`);return r[l.name]})}if(u.length!==this.components.length)throw new Error("array is wrong length");u.forEach((l,h)=>{a[h].#e(e,l,n,d=>{u[h]=d})}),i(u);return}const o=n(this.type,r);o.then?e.push((async function(){i(await o)})()):i(o)}async walkAsync(e,r){const n=[],i=[e];return this.#e(n,e,r,o=>{i[0]=o}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(nt.isParamType(e))return e;if(typeof e=="string")try{return nt.from(kn(e),r)}catch{D(!1,"invalid param type","obj",e)}else if(e instanceof wr){let u="",l="",h=null;on(e,Wt(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",h=e.popParams().map(E=>nt.from(E)),u=`tuple(${h.map(E=>E.format()).join(",")})`):(u=Mg(e.popType("TYPE")),l=u);let d=null,m=null;for(;e.length&&e.peekType("BRACKET");){const E=e.pop();d=new nt(pt,"",u,l,null,h,m,d),m=E.value,u+=E.text,l="array",h=null}let y=null;if(on(e,VI).has("indexed")){if(!r)throw new Error("");y=!0}const T=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new nt(pt,T,u,l,y,h,m,d)}const n=e.name;D(!n||typeof n=="string"&&n.match(K1),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(D(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let o=e.type,a=o.match(WI);if(a){const u=parseInt(a[2]||"-1"),l=nt.from({type:a[1],components:e.components});return new nt(pt,n||"",o,"array",i,null,u,l)}if(o==="tuple"||o.startsWith("tuple(")||o.startsWith("(")){const u=e.components!=null?e.components.map(h=>nt.from(h)):null;return new nt(pt,n||"",o,"tuple",i,u,null,null)}return o=Mg(e.type),new nt(pt,n||"",o,o,i,null,null,null)}static isParamType(e){return e&&e[er]===zg}}class ei{type;inputs;constructor(e,r,n){ai(e,pt,"Fragment"),n=Object.freeze(n.slice()),Te(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{ei.from(JSON.parse(e))}catch{}return ei.from(kn(e))}if(e instanceof wr)switch(e.peekKeyword(q1)){case"constructor":return Jr.from(e);case"error":return Yt.from(e);case"event":return Mr.from(e);case"fallback":case"receive":return Hr.from(e);case"function":return zr.from(e);case"struct":return Qn.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Jr.from(e);case"error":return Yt.from(e);case"event":return Mr.from(e);case"fallback":case"receive":return Hr.from(e);case"function":return zr.from(e);case"struct":return Qn.from(e)}ne(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}D(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Jr.isFragment(e)}static isError(e){return Yt.isFragment(e)}static isEvent(e){return Mr.isFragment(e)}static isFunction(e){return zr.isFragment(e)}static isStruct(e){return Qn.isFragment(e)}}class nc extends ei{name;constructor(e,r,n,i){super(e,r,i),D(typeof n=="string"&&n.match(K1),"invalid identifier","name",n),i=Object.freeze(i.slice()),Te(this,{name:n})}}function eo(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class Yt extends nc{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,er,{value:Vg})}get selector(){return sn(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 r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+eo(e,this.inputs)),r.join(" ")}static from(e){if(Yt.isFragment(e))return e;if(typeof e=="string")return Yt.from(kn(e));if(e instanceof wr){const r=rc("error",e),n=Xr(e);return Xn(e),new Yt(pt,r,n)}return new Yt(pt,e.name,e.inputs?e.inputs.map(nt.from):[])}static isFragment(e){return e&&e[er]===Vg}}class Mr extends nc{anonymous;constructor(e,r,n,i){super(e,"event",r,n),Object.defineProperty(this,er,{value:Gg}),Te(this,{anonymous:i})}get topicHash(){return sn(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 r=[];return e!=="sighash"&&r.push("event"),r.push(this.name+eo(e,this.inputs)),e!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(e,r){return r=(r||[]).map(i=>nt.from(i)),new Mr(pt,e,r,!1).topicHash}static from(e){if(Mr.isFragment(e))return e;if(typeof e=="string")try{return Mr.from(kn(e))}catch{D(!1,"invalid event fragment","obj",e)}else if(e instanceof wr){const r=rc("event",e),n=Xr(e,!0),i=!!on(e,Wt(["anonymous"])).has("anonymous");return Xn(e),new Mr(pt,r,n,i)}return new Mr(pt,e.name,e.inputs?e.inputs.map(r=>nt.from(r,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[er]===Gg}}class Jr extends ei{payable;gas;constructor(e,r,n,i,o){super(e,r,n),Object.defineProperty(this,er,{value:$g}),Te(this,{payable:i,gas:o})}format(e){if(ne(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 r=[`constructor${eo(e,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(e){if(Jr.isFragment(e))return e;if(typeof e=="string")try{return Jr.from(kn(e))}catch{D(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof wr){on(e,Wt(["constructor"]));const r=Xr(e),n=!!on(e,MI).has("payable"),i=Q1(e);return Xn(e),new Jr(pt,"constructor",r,n,i)}return new Jr(pt,"constructor",e.inputs?e.inputs.map(nt.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[er]===$g}}class Hr extends ei{payable;constructor(e,r,n){super(e,"fallback",r),Object.defineProperty(this,er,{value:jg}),Te(this,{payable:n})}format(e){const r=this.inputs.length===0?"receive":"fallback";if(e==="json"){const n=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:n})}return`${r}()${this.payable?" payable":""}`}static from(e){if(Hr.isFragment(e))return e;if(typeof e=="string")try{return Hr.from(kn(e))}catch{D(!1,"invalid fallback fragment","obj",e)}else if(e instanceof wr){const r=e.toString(),n=e.peekKeyword(Wt(["fallback","receive"]));if(D(n,"type must be fallback or receive","obj",r),e.popKeyword(Wt(["fallback","receive"]))==="receive"){const u=Xr(e);return D(u.length===0,"receive cannot have arguments","obj.inputs",u),on(e,Wt(["payable"])),Xn(e),new Hr(pt,[],!0)}let o=Xr(e);o.length?D(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(u=>u.format("minimal")).join(", ")):o=[nt.from("bytes")];const a=J1(e);if(D(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),on(e,Wt(["returns"])).has("returns")){const u=Xr(e);D(u.length===1&&u[0].type==="bytes","invalid fallback outputs","obj.outputs",u.map(l=>l.format("minimal")).join(", "))}return Xn(e),new Hr(pt,o,a==="payable")}if(e.type==="receive")return new Hr(pt,[],!0);if(e.type==="fallback"){const r=[nt.from("bytes")],n=e.stateMutability==="payable";return new Hr(pt,r,n)}D(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[er]===jg}}class zr extends nc{constant;outputs;stateMutability;payable;gas;constructor(e,r,n,i,o,a){super(e,"function",r,i),Object.defineProperty(this,er,{value:Hg}),o=Object.freeze(o.slice()),Te(this,{constant:n==="view"||n==="pure",gas:a,outputs:o,payable:n==="payable",stateMutability:n})}get selector(){return sn(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 r=[];return e!=="sighash"&&r.push("function"),r.push(this.name+eo(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(eo(e,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(e,r){return r=(r||[]).map(i=>nt.from(i)),new zr(pt,e,"view",r,[],null).selector}static from(e){if(zr.isFragment(e))return e;if(typeof e=="string")try{return zr.from(kn(e))}catch{D(!1,"invalid function fragment","obj",e)}else if(e instanceof wr){const n=rc("function",e),i=Xr(e),o=J1(e);let a=[];on(e,Wt(["returns"])).has("returns")&&(a=Xr(e));const u=Q1(e);return Xn(e),new zr(pt,n,o,i,a,u)}let r=e.stateMutability;return r==null&&(r="payable",typeof e.constant=="boolean"?(r="view",e.constant||(r="payable",typeof e.payable=="boolean"&&!e.payable&&(r="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(r="nonpayable")),new zr(pt,e.name,r,e.inputs?e.inputs.map(nt.from):[],e.outputs?e.outputs.map(nt.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[er]===Hg}}class Qn extends nc{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,er,{value:qg})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Qn.from(kn(e))}catch{D(!1,"invalid struct fragment","obj",e)}else if(e instanceof wr){const r=rc("struct",e),n=Xr(e);return Xn(e),new Qn(pt,r,n)}return new Qn(pt,e.name,e.inputs?e.inputs.map(nt.from):[])}static isFragment(e){return e&&e[er]===qg}}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 JI=new RegExp(/^bytes([0-9]*)$/),QI=new RegExp(/^(u?int)([0-9]*)$/);let xf=null,Zg=1024;function YI(t,e,r,n){let i="missing revert data",o=null;const a=null;let u=null;if(r){i="execution reverted";const h=de(r);if(r=ae(r),h.length===0)i+=" (no data present; likely require(false) occurred",o="require(false)";else if(h.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(ae(h.slice(0,4))==="0x08c379a0")try{o=n.decode(["string"],h.slice(4))[0],u={signature:"Error(string)",name:"Error",args:[o]},i+=`: ${JSON.stringify(o)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(ae(h.slice(0,4))==="0x4e487b71")try{const d=Number(n.decode(["uint256"],h.slice(4))[0]);u={signature:"Panic(uint256)",name:"Panic",args:[d]},o=`Panic due to ${kr.get(d)||"UNKNOWN"}(${d})`,i+=`: ${o}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?Ve(e.to):null,data:e.data||"0x"};return e.from&&(l.from=Ve(e.from)),ht(i,"CALL_EXCEPTION",{action:t,data:r,reason:o,transaction:l,invocation:a,revert:u})}class Hi{#e(e){if(e.isArray())return new pP(this.#e(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Qo(e.components.map(n=>this.#e(n)),e.name);switch(e.baseType){case"address":return new hP(e.name);case"bool":return new mP(e.name);case"string":return new RP(e.name);case"bytes":return new gP(e.name);case"":return new xP(e.name)}let r=e.type.match(QI);if(r){let n=parseInt(r[2]||"256");return D(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new vP(n/8,r[1]==="int",e.name)}if(r=e.type.match(JI),r){let n=parseInt(r[1]);return D(n!==0&&n<=32,"invalid bytes length","param",e),new yP(n,e.name)}D(!1,"invalid type","type",e.type)}getDefaultValue(e){const r=e.map(i=>this.#e(nt.from(i)));return new Qo(r,"_").defaultValue()}encode(e,r){sx(r.length,e.length,"types/values length mismatch");const n=e.map(a=>this.#e(nt.from(a))),i=new Qo(n,"_"),o=new Gf;return i.encode(o,r),o.data}decode(e,r,n){const i=e.map(a=>this.#e(nt.from(a)));return new Qo(i,"_").decode(new Lh(r,n,Zg))}static _setDefaultMaxInflation(e){D(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),Zg=e}static defaultAbiCoder(){return xf==null&&(xf=new Hi),xf}static getBuiltinCallException(e,r,n){return YI(e,r,n,Hi.defaultAbiCoder())}}class XI{fragment;name;signature;topic;args;constructor(e,r,n){const i=e.name,o=e.format();Te(this,{fragment:e,name:i,signature:o,topic:r,args:n})}}class ek{fragment;name;args;signature;selector;value;constructor(e,r,n,i){const o=e.name,a=e.format();Te(this,{fragment:e,name:o,args:n,signature:a,selector:r,value:i})}}class tk{fragment;name;args;signature;selector;constructor(e,r,n){const i=e.name,o=e.format();Te(this,{fragment:e,name:i,args:n,signature:o,selector:r})}}class Kg{hash;_isIndexed;static isIndexed(e){return!!(e&&e._isIndexed)}constructor(e){Te(this,{hash:e,_isIndexed:!0})}}const Wg={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"},Jg={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&Wg[t.toString()]&&(e=Wg[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};class jn{fragments;deploy;fallback;receive;#e;#t;#r;#n;constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,this.#r=new Map,this.#e=new Map,this.#t=new Map;const n=[];for(const a of r)try{n.push(ei.from(a))}catch(u){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,u.message)}Te(this,{fragments:Object.freeze(n)});let i=null,o=!1;this.#n=this.getAbiCoder(),this.fragments.forEach((a,u)=>{let l;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Te(this,{deploy:a});return;case"fallback":a.inputs.length===0?o=!0:(D(!i||a.payable!==i.payable,"conflicting fallback fragments",`fragments[${u}]`,a),i=a,o=i.payable);return;case"function":l=this.#r;break;case"event":l=this.#t;break;case"error":l=this.#e;break;default:return}const h=a.format();l.has(h)||l.set(h,a)}),this.deploy||Te(this,{deploy:Jr.from("constructor()")}),Te(this,{fallback:i,receive:o})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return Hi.defaultAbiCoder()}#i(e,r,n){if(it(e)){const o=e.toLowerCase();for(const a of this.#r.values())if(o===a.selector)return a;return null}if(e.indexOf("(")===-1){const o=[];for(const[a,u]of this.#r)a.split("(")[0]===e&&o.push(u);if(r){const a=r.length>0?r[r.length-1]:null;let u=r.length,l=!0;yt.isTyped(a)&&a.type==="overrides"&&(l=!1,u--);for(let h=o.length-1;h>=0;h--){const d=o[h].inputs.length;d!==u&&(!l||d!==u-1)&&o.splice(h,1)}for(let h=o.length-1;h>=0;h--){const d=o[h].inputs;for(let m=0;m<r.length;m++)if(yt.isTyped(r[m])){if(m>=d.length){if(r[m].type==="overrides")continue;o.splice(h,1);break}if(r[m].type!==d[m].baseType){o.splice(h,1);break}}}}if(o.length===1&&r&&r.length!==o[0].inputs.length){const a=r[r.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&o.splice(0,1)}if(o.length===0)return null;if(o.length>1&&n){const a=o.map(u=>JSON.stringify(u.format())).join(", ");D(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return o[0]}const i=this.#r.get(zr.from(e).format());return i||null}getFunctionName(e){const r=this.#i(e,null,!1);return D(r,"no matching function","key",e),r.name}hasFunction(e){return!!this.#i(e,null,!1)}getFunction(e,r){return this.#i(e,r||null,!0)}forEachFunction(e){const r=Array.from(this.#r.keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(this.#r.get(i),n)}}#o(e,r,n){if(it(e)){const o=e.toLowerCase();for(const a of this.#t.values())if(o===a.topicHash)return a;return null}if(e.indexOf("(")===-1){const o=[];for(const[a,u]of this.#t)a.split("(")[0]===e&&o.push(u);if(r){for(let a=o.length-1;a>=0;a--)o[a].inputs.length<r.length&&o.splice(a,1);for(let a=o.length-1;a>=0;a--){const u=o[a].inputs;for(let l=0;l<r.length;l++)if(yt.isTyped(r[l])&&r[l].type!==u[l].baseType){o.splice(a,1);break}}}if(o.length===0)return null;if(o.length>1&&n){const a=o.map(u=>JSON.stringify(u.format())).join(", ");D(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return o[0]}const i=this.#t.get(Mr.from(e).format());return i||null}getEventName(e){const r=this.#o(e,null,!1);return D(r,"no matching event","key",e),r.name}hasEvent(e){return!!this.#o(e,null,!1)}getEvent(e,r){return this.#o(e,r||null,!0)}forEachEvent(e){const r=Array.from(this.#t.keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(this.#t.get(i),n)}}getError(e,r){if(it(e)){const i=e.toLowerCase();if(Jg[i])return Yt.from(Jg[i].signature);for(const o of this.#e.values())if(i===o.selector)return o;return null}if(e.indexOf("(")===-1){const i=[];for(const[o,a]of this.#e)o.split("(")[0]===e&&i.push(a);if(i.length===0)return e==="Error"?Yt.from("error Error(string)"):e==="Panic"?Yt.from("error Panic(uint256)"):null;if(i.length>1){const o=i.map(a=>JSON.stringify(a.format())).join(", ");D(!1,`ambiguous error description (i.e. ${o})`,"name",e)}return i[0]}if(e=Yt.from(e).format(),e==="Error(string)")return Yt.from("error Error(string)");if(e==="Panic(uint256)")return Yt.from("error Panic(uint256)");const n=this.#e.get(e);return n||null}forEachError(e){const r=Array.from(this.#e.keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(this.#e.get(i),n)}}_decodeParams(e,r){return this.#n.decode(e,r)}_encodeParams(e,r){return this.#n.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);D(n,"unknown error","fragment",e),e=n}return D(ot(r,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",r),this._decodeParams(e.inputs,ot(r,4))}encodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);D(n,"unknown error","fragment",e),e=n}return je([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);D(n,"unknown function","fragment",e),e=n}return D(ot(r,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",r),this._decodeParams(e.inputs,ot(r,4))}encodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);D(n,"unknown function","fragment",e),e=n}return je([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionResult(e,r){if(typeof e=="string"){const o=this.getFunction(e);D(o,"unknown function","fragment",e),e=o}let n="invalid length for result data";const i=Dt(r);if(i.length%32===0)try{return this.#n.decode(e.outputs,i)}catch{n="could not decode result data"}ne(!1,n,"BAD_DATA",{value:ae(i),info:{method:e.name,signature:e.format()}})}makeError(e,r){const n=de(e,"data"),i=Hi.getBuiltinCallException("call",r,n);if(i.message.startsWith("execution reverted (unknown custom error)")){const u=ae(n.slice(0,4)),l=this.getError(u);if(l)try{const h=this.#n.decode(l.inputs,n.slice(4));i.revert={name:l.name,signature:l.format(),args:h},i.reason=i.revert.signature,i.message=`execution reverted: ${i.reason}`}catch{i.message="execution reverted (coult not decode custom error)"}}const a=this.parseTransaction(r);return a&&(i.invocation={method:a.name,signature:a.signature,args:a.args}),i}encodeFunctionResult(e,r){if(typeof e=="string"){const n=this.getFunction(e);D(n,"unknown function","fragment",e),e=n}return ae(this.#n.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){if(typeof e=="string"){const o=this.getEvent(e);D(o,"unknown event","eventFragment",e),e=o}ne(r.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:r.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const i=(o,a)=>o.type==="string"?sn(a):o.type==="bytes"?lt(ae(a)):(o.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":o.type.match(/^u?int/)?a=nn(a):o.type.match(/^bytes/)?a=iS(a,32):o.type==="address"&&this.#n.encode(["address"],[a]),rn(ae(a),32));for(r.forEach((o,a)=>{const u=e.inputs[a];if(!u.indexed){D(o==null,"cannot filter non-indexed parameters; must be null","contract."+u.name,o);return}o==null?n.push(null):u.baseType==="array"||u.baseType==="tuple"?D(!1,"filtering with tuples or arrays not supported","contract."+u.name,o):Array.isArray(o)?n.push(o.map(l=>i(u,l))):n.push(i(u,o))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const a=this.getEvent(e);D(a,"unknown event","eventFragment",e),e=a}const n=[],i=[],o=[];return e.anonymous||n.push(e.topicHash),D(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((a,u)=>{const l=r[u];if(a.indexed)if(a.type==="string")n.push(sn(l));else if(a.type==="bytes")n.push(lt(l));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");n.push(this.#n.encode([a.type],[l]))}else i.push(a),o.push(l)}),{data:this.#n.encode(i,o),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const w=this.getEvent(e);D(w,"unknown event","eventFragment",e),e=w}if(n!=null&&!e.anonymous){const w=e.topicHash;D(it(n[0],32)&&n[0].toLowerCase()===w,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],o=[],a=[];e.inputs.forEach((w,T)=>{w.indexed?w.type==="string"||w.type==="bytes"||w.baseType==="tuple"||w.baseType==="array"?(i.push(nt.from({type:"bytes32",name:w.name})),a.push(!0)):(i.push(w),a.push(!1)):(o.push(w),a.push(!1))});const u=n!=null?this.#n.decode(i,je(n)):null,l=this.#n.decode(o,r,!0),h=[],d=[];let m=0,y=0;return e.inputs.forEach((w,T)=>{let E=null;if(w.indexed)if(u==null)E=new Kg(null);else if(a[T])E=new Kg(u[y++]);else try{E=u[y++]}catch(B){E=B}else try{E=l[m++]}catch(B){E=B}h.push(E),d.push(w.name||null)}),Wr.fromItems(h,d)}parseTransaction(e){const r=de(e.data,"tx.data"),n=ge(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(ae(r.slice(0,4)));if(!i)return null;const o=this.#n.decode(i.inputs,r.slice(4));return new ek(i,i.selector,o,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new XI(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=ae(e),n=this.getError(ot(r,0,4));if(!n)return null;const i=this.#n.decode(n.inputs,ot(r,4));return new tk(n,n.selector,i)}static from(e){return e instanceof jn?e:typeof e=="string"?new jn(JSON.parse(e)):typeof e.formatJson=="function"?new jn(e.formatJson()):typeof e.format=="function"?new jn(e.format("json")):new jn(e)}}const Y1=BigInt(0);function Ni(t){return t??null}function Et(t){return t==null?null:t.toString()}class Qg{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,r,n){Te(this,{gasPrice:Ni(e),maxFeePerGas:Ni(r),maxPriorityFeePerGas:Ni(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Et(e),maxFeePerGas:Et(r),maxPriorityFeePerGas:Et(n)}}}function to(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=ae(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=ge(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=Ie(t[i],`request.${i}`));return t.accessList&&(e.accessList=ci(t.accessList)),t.authorizationList&&(e.authorizationList=t.authorizationList.slice()),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobWrapperVersion"in t&&(e.blobWrapperVersion=t.blobWrapperVersion),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(i=>qa(i)?ae(i):Object.assign({},i))),e}class rk{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#e;constructor(e,r){this.#e=e.transactions.map(n=>typeof n!="string"?new yo(n,r):n),Te(this,{provider:r,hash:Ni(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:Ni(e.prevRandao),extraData:e.extraData,baseFeePerGas:Ni(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?[]:(ne(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:o,hash:a,miner:u,prevRandao:l,nonce:h,number:d,parentHash:m,parentBeaconBlockRoot:y,stateRoot:w,receiptsRoot:T,timestamp:E,transactions:B}=this;return{_type:"Block",baseFeePerGas:Et(e),difficulty:Et(r),extraData:n,gasLimit:Et(i),gasUsed:Et(o),blobGasUsed:Et(this.blobGasUsed),excessBlobGas:Et(this.excessBlobGas),hash:a,miner:u,prevRandao:l,nonce:h,number:d,parentHash:m,timestamp:E,parentBeaconBlockRoot:y,stateRoot:w,receiptsRoot:T,transactions:B}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>e<this.length?{value:r[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 r;if(typeof e=="number")r=this.#e[e];else{const n=e.toLowerCase();for(const i of this.#e)if(typeof i=="string"){if(i!==n)continue;r=i;break}else{if(i.hash!==n)continue;r=i;break}}if(r==null)throw new Error("no such tx");return typeof r=="string"?await this.provider.getTransaction(r):r}getPrefetchedTransaction(e){const r=this.prefetchedTransactions;if(typeof e=="number")return r[e];e=e.toLowerCase();for(const n of r)if(n.hash===e)return n;D(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return nk(this)}}class go{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,r){this.provider=r;const n=Object.freeze(e.topics.slice());Te(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:r,blockNumber:n,data:i,index:o,removed:a,topics:u,transactionHash:l,transactionIndex:h}=this;return{_type:"log",address:e,blockHash:r,blockNumber:n,data:i,index:o,removed:a,topics:u,transactionHash:l,transactionIndex:h}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return ne(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return ne(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return ne(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return ik(this)}}class X1{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#e;constructor(e,r){this.#e=Object.freeze(e.logs.map(i=>new go(i,r)));let n=Y1;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Te(this,{provider:r,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:r,contractAddress:n,hash:i,index:o,blockHash:a,blockNumber:u,logsBloom:l,logs:h,status:d,root:m}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:u,contractAddress:n,cumulativeGasUsed:Et(this.cumulativeGasUsed),from:r,gasPrice:Et(this.gasPrice),blobGasUsed:Et(this.blobGasUsed),blobGasPrice:Et(this.blobGasPrice),gasUsed:Et(this.gasUsed),hash:i,index:o,logs:h,logsBloom:l,root:m,status:d,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 tw(this)}reorderedEvent(e){return ne(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),ew(this,e)}}class yo{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;authorizationList;#e;constructor(e,r){this.provider=r,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:r,index:n,hash:i,type:o,to:a,from:u,nonce:l,data:h,signature:d,accessList:m,blobVersionedHashes:y}=this;return{_type:"TransactionResponse",accessList:m,blockNumber:e,blockHash:r,blobVersionedHashes:y,chainId:Et(this.chainId),data:h,from:u,gasLimit:Et(this.gasLimit),gasPrice:Et(this.gasPrice),hash:i,maxFeePerGas:Et(this.maxFeePerGas),maxPriorityFeePerGas:Et(this.maxPriorityFeePerGas),maxFeePerBlobGas:Et(this.maxFeePerBlobGas),nonce:l,signature:d,to:a,index:n,type:o,value:Et(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 r=this.provider.getBlock(e);if(r==null)throw new Error("TODO");return r}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:r,blockNumber:n}=await zt({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return r==null||r.blockNumber==null?0:n-r.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,r){const n=e??1,i=r??0;let o=this.#e,a=-1,u=o===-1;const l=async()=>{if(u)return null;const{blockNumber:y,nonce:w}=await zt({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(w<this.nonce){o=y;return}if(u)return null;const T=await this.getTransaction();if(!(T&&T.blockNumber!=null))for(a===-1&&(a=o-3,a<this.#e&&(a=this.#e));a<=y;){if(u)return null;const E=await this.provider.getBlock(a,!0);if(E==null)return;for(const B of E)if(B===this.hash)return;for(let B=0;B<E.length;B++){const A=await E.getTransaction(B);if(A.from===this.from&&A.nonce===this.nonce){if(u)return null;const P=await this.provider.getTransactionReceipt(A.hash);if(P==null||y-P.blockNumber+1<n)return;let I="replaced";A.data===this.data&&A.to===this.to&&A.value===this.value?I="repriced":A.data==="0x"&&A.from===A.to&&A.value===Y1&&(I="cancelled"),ne(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:I==="replaced"||I==="cancelled",reason:I,replacement:A.replaceableTransaction(o),hash:A.hash,receipt:P})}}a++}},h=y=>{if(y==null||y.status!==0)return y;ne(!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})},d=await this.provider.getTransactionReceipt(this.hash);if(n===0)return h(d);if(d){if(n===1||await d.confirmations()>=n)return h(d)}else if(await l(),n===0)return null;return await new Promise((y,w)=>{const T=[],E=()=>{T.forEach(A=>A())};if(T.push(()=>{u=!0}),i>0){const A=setTimeout(()=>{E(),w(ht("wait for transaction timeout","TIMEOUT"))},i);T.push(()=>{clearTimeout(A)})}const B=async A=>{if(await A.confirmations()>=n){E();try{y(h(A))}catch(P){w(P)}}};if(T.push(()=>{this.provider.off(this.hash,B)}),this.provider.on(this.hash,B),o>=0){const A=async()=>{try{await l()}catch(P){if(_t(P,"TRANSACTION_REPLACED")){E(),w(P);return}}u||this.provider.once("block",A)};T.push(()=>{this.provider.off("block",A)}),this.provider.once("block",A)}})}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 ne(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),tw(this)}reorderedEvent(e){return ne(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ne(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ew(this,e)}replaceableTransaction(e){D(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new yo(this,this.provider);return r.#e=e,r}}function nk(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function ew(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function tw(t){return{orphan:"drop-transaction",tx:t}}function ik(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class t0 extends go{interface;fragment;args;constructor(e,r,n){super(e,e.provider);const i=r.decodeEventLog(n,e.data,e.topics);Te(this,{args:i,fragment:n,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class rw extends go{error;constructor(e,r){super(e,e.provider),Te(this,{error:r})}}class sk extends X1{#e;constructor(e,r,n){super(n,r),this.#e=e}get logs(){return super.logs.map(e=>{const r=e.topics.length?this.#e.getEvent(e.topics[0]):null;if(r)try{return new t0(e,this.#e,r)}catch(n){return new rw(e,n)}return e})}}class r0 extends yo{#e;constructor(e,r,n){super(n,r),this.#e=e}async wait(e,r){const n=await super.wait(e,r);return n==null?null:new sk(this.#e,this.provider,n)}}class nw extends fx{log;constructor(e,r,n,i){super(e,r,n),Te(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 ok extends nw{constructor(e,r,n,i,o){super(e,r,n,new t0(o,e.interface,i));const a=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Te(this,{args:a,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const Yg=BigInt(0);function iw(t){return t&&typeof t.call=="function"}function sw(t){return t&&typeof t.estimateGas=="function"}function ic(t){return t&&typeof t.resolveName=="function"}function ow(t){return t&&typeof t.sendTransaction=="function"}function aw(t){if(t!=null){if(ic(t))return t;if(t.provider)return t.provider}}class ak{#e;fragment;constructor(e,r,n){if(Te(this,{fragment:r}),r.inputs.length<n.length)throw new Error("too many arguments");const i=ti(e.runner,"resolveName"),o=ic(i)?i:null;this.#e=(async function(){const a=await Promise.all(r.inputs.map((u,l)=>n[l]==null?null:u.walkAsync(n[l],(d,m)=>d==="address"?Array.isArray(m)?Promise.all(m.map(y=>kt(y,o))):kt(m,o):m)));return e.interface.encodeFilterTopics(r,a)})()}getTopicFilter(){return this.#e}}function ti(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Zn(t){return t==null?null:t.provider||null}async function cw(t,e){const r=yt.dereference(t,"overrides");D(typeof r=="object","invalid overrides parameter","overrides",t);const n=to(r);return D(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),D(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function ck(t,e,r){const n=ti(t,"resolveName"),i=ic(n)?n:null;return await Promise.all(e.map((o,a)=>o.walkAsync(r[a],(u,l)=>(l=yt.dereference(l,u),u==="address"?kt(l,i):l))))}function uk(t){const e=async function(a){const u=await cw(a,["data"]);u.to=await t.getAddress(),u.from&&(u.from=await kt(u.from,aw(t.runner)));const l=t.interface,h=ge(u.value||Yg,"overrides.value")===Yg,d=(u.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!d&&!h&&D(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),D(l.fallback||d,"cannot send data to receive-only contract","overrides.data",u.data);const m=l.receive||l.fallback&&l.fallback.payable;return D(m||h,"cannot send value to non-payable fallback","overrides.value",u.value),D(l.fallback||d,"cannot send data to receive-only contract","overrides.data",u.data),u},r=async function(a){const u=ti(t.runner,"call");ne(iw(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(a);try{return await u.call(l)}catch(h){throw Uh(h)&&h.data?t.interface.makeError(h.data,l):h}},n=async function(a){const u=t.runner;ne(ow(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await u.sendTransaction(await e(a)),h=Zn(t.runner);return new r0(t.interface,h,l)},i=async function(a){const u=ti(t.runner,"estimateGas");return ne(sw(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await e(a))},o=async a=>await n(a);return Te(o,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),o}function lk(t,e){const r=function(...h){const d=t.interface.getFunction(e,h);return ne(d,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:h}}),d},n=async function(...h){const d=r(...h);let m={};if(d.inputs.length+1===h.length&&(m=await cw(h.pop()),m.from&&(m.from=await kt(m.from,aw(t.runner)))),d.inputs.length!==h.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const y=await ck(t.runner,d.inputs,h);return Object.assign({},m,await zt({to:t.getAddress(),data:t.interface.encodeFunctionData(d,y)}))},i=async function(...h){const d=await u(...h);return d.length===1?d[0]:d},o=async function(...h){const d=t.runner;ne(ow(d),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const m=await d.sendTransaction(await n(...h)),y=Zn(t.runner);return new r0(t.interface,y,m)},a=async function(...h){const d=ti(t.runner,"estimateGas");return ne(sw(d),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await d.estimateGas(await n(...h))},u=async function(...h){const d=ti(t.runner,"call");ne(iw(d),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const m=await n(...h);let y="0x";try{y=await d.call(m)}catch(T){throw Uh(T)&&T.data?t.interface.makeError(T.data,m):T}const w=r(...h);return t.interface.decodeFunctionResult(w,y)},l=async(...h)=>r(...h).constant?await i(...h):await o(...h);return Te(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:a,populateTransaction:n,send:o,staticCall:i,staticCallResult:u}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const h=t.interface.getFunction(e);return ne(h,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),h}}),l}function fk(t,e){const r=function(...i){const o=t.interface.getEvent(e,i);return ne(o,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),o},n=function(...i){return new ak(t,r(...i),i)};return Te(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return ne(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const Oa=Symbol.for("_ethersInternal_contract"),uw=new WeakMap;function hk(t,e){uw.set(t[Oa],e)}function ir(t){return uw.get(t[Oa])}function dk(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function n0(t,e){let r,n=null;if(Array.isArray(e)){const o=function(a){if(it(a,32))return a;const u=t.interface.getEvent(a);return D(u,"unknown fragment","name",a),u.topicHash};r=e.map(a=>a==null?null:Array.isArray(a)?a.map(o):o(a))}else e==="*"?r=[null]:typeof e=="string"?it(e,32)?r=[e]:(n=t.interface.getEvent(e),D(n,"unknown fragment","event",e),r=[n.topicHash]):dk(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):D(!1,"unknown event name","event",e);r=r.map(o=>{if(o==null)return null;if(Array.isArray(o)){const a=Array.from(new Set(o.map(u=>u.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return o.toLowerCase()});const i=r.map(o=>o==null?"null":Array.isArray(o)?o.join("|"):o).join("&");return{fragment:n,tag:i,topics:r}}async function Ns(t,e){const{subs:r}=ir(t);return r.get((await n0(t,e)).tag)||null}async function Xg(t,e,r){const n=Zn(t.runner);ne(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:o,topics:a}=await n0(t,r),{addr:u,subs:l}=ir(t);let h=l.get(o);if(!h){const m={address:u||t,topics:a},y=B=>{let A=i;if(A==null)try{A=t.interface.getEvent(B.topics[0])}catch{}if(A){const P=A,I=i?t.interface.decodeEventLog(i,B.data,B.topics):[];rh(t,r,I,S=>new ok(t,S,r,P,B))}else rh(t,r,[],P=>new nw(t,P,r,B))};let w=[];h={tag:o,listeners:[],start:()=>{w.length||w.push(n.on(m,y))},stop:async()=>{if(w.length==0)return;let B=w;w=[],await Promise.all(B),n.off(m,y)}},l.set(o,h)}return h}let th=Promise.resolve();async function pk(t,e,r,n){await th;const i=await Ns(t,e);if(!i)return!1;const o=i.listeners.length;return i.listeners=i.listeners.filter(({listener:a,once:u})=>{const l=Array.from(r);n&&l.push(n(u?null:a));try{a.call(t,...l)}catch{}return!u}),i.listeners.length===0&&(i.stop(),ir(t).subs.delete(i.tag)),o>0}async function rh(t,e,r,n){try{await th}catch{}const i=pk(t,e,r,n);return th=i,await i}const Xo=["then"];class Ms{target;interface;runner;filters;[Oa];fallback;constructor(e,r,n,i){D(typeof e=="string"||m1(e),"invalid value for Contract target","target",e),n==null&&(n=null);const o=jn.from(r);Te(this,{target:e,runner:n,interface:o}),Object.defineProperty(this,Oa,{value:{}});let a,u=null,l=null;if(i){const m=Zn(n);l=new r0(this.interface,m,i)}let h=new Map;if(typeof e=="string")if(it(e))u=e,a=Promise.resolve(e);else{const m=ti(n,"resolveName");if(!ic(m))throw ht("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=m.resolveName(e).then(y=>{if(y==null)throw ht("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return ir(this).addr=y,y})}else a=e.getAddress().then(m=>{if(m==null)throw new Error("TODO");return ir(this).addr=m,m});hk(this,{addrPromise:a,addr:u,deployTx:l,subs:h});const d=new Proxy({},{get:(m,y,w)=>{if(typeof y=="symbol"||Xo.indexOf(y)>=0)return Reflect.get(m,y,w);try{return this.getEvent(y)}catch(T){if(!_t(T,"INVALID_ARGUMENT")||T.argument!=="key")throw T}},has:(m,y)=>Xo.indexOf(y)>=0?Reflect.has(m,y):Reflect.has(m,y)||this.interface.hasEvent(String(y))});return Te(this,{filters:d}),Te(this,{fallback:o.receive||o.fallback?uk(this):null}),new Proxy(this,{get:(m,y,w)=>{if(typeof y=="symbol"||y in m||Xo.indexOf(y)>=0)return Reflect.get(m,y,w);try{return m.getFunction(y)}catch(T){if(!_t(T,"INVALID_ARGUMENT")||T.argument!=="key")throw T}},has:(m,y)=>typeof y=="symbol"||y in m||Xo.indexOf(y)>=0?Reflect.has(m,y):m.interface.hasFunction(y)})}connect(e){return new Ms(this.target,this.interface,e)}attach(e){return new Ms(e,this.interface,this.runner)}async getAddress(){return await ir(this).addrPromise}async getDeployedCode(){const e=Zn(this.runner);ne(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=Zn(this.runner);return ne(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,o)=>{const a=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",a)}catch(u){o(u)}};a()})}deploymentTransaction(){return ir(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),lk(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),fk(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:o}=ir(this),a=i||await o,{fragment:u,topics:l}=await n0(this,e),h={address:a,topics:l,fromBlock:r,toBlock:n},d=Zn(this.runner);return ne(d,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await d.getLogs(h)).map(m=>{let y=u;if(y==null)try{y=this.interface.getEvent(m.topics[0])}catch{}if(y)try{return new t0(m,this.interface,y)}catch(w){return new rw(m,w)}return new go(m,d)})}async on(e,r){const n=await Xg(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await Xg(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await rh(this,e,r,null)}async listenerCount(e){if(e){const i=await Ns(this,e);return i?i.listeners.length:0}const{subs:r}=ir(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await Ns(this,e);return i?i.listeners.map(({listener:o})=>o):[]}const{subs:r}=ir(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:o})=>o));return n}async off(e,r){const n=await Ns(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:o})=>o).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),ir(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await Ns(this,e);if(!r)return this;r.stop(),ir(this).subs.delete(r.tag)}else{const{subs:r}=ir(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends Ms{constructor(i,o=null){super(i,e,o)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}}function mk(){return Ms}class zs extends mk(){}function wf(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):D(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class gk{name;constructor(e){Te(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const lw=new RegExp("^(ipfs)://(.*)$","i"),ey=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),lw,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class Ci{provider;address;name;#e;#t;constructor(e,r,n){Te(this,{provider:e,address:r,name:n}),this.#e=null,this.#t=new zs(r,["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(_t(e,"CALL_EXCEPTION"))return!1;throw this.#e=null,e}})()),await this.#e}async#r(e,r){r=(r||[]).slice();const n=this.#t.interface;r.unshift(eh(this.name));let i=null;await this.supportsWildcard()&&(i=n.getFunction(e),ne(i,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),r=[II(this.name,255),n.encodeFunctionData(i,r)],e="resolve(bytes,bytes)"),r.push({enableCcipRead:!0});try{const o=await this.#t[e](...r);return i?n.decodeFunctionResult(i,o)[0]:o}catch(o){if(!_t(o,"CALL_EXCEPTION"))throw o}return null}async getAddress(e){if(e==null&&(e=60),e===60)try{const o=await this.#r("addr(bytes32)");return o==null||o===Ws?null:o}catch(o){if(_t(o,"CALL_EXCEPTION"))return null;throw o}if(e>=0&&e<2147483648){let o=e+2147483648;const a=await this.#r("addr(bytes32,uint)",[o]);if(it(a,20))return Ve(a)}let r=null;for(const o of this.provider.plugins)if(o instanceof gk&&o.supportsCoinType(e)){r=o;break}if(r==null)return null;const n=await this.#r("addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;ne(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await this.#r("text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await this.#r("contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",o=parseInt(r[4],16);if(r[5].length===o*2)return`${i}://${lx("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;ne(!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 r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n<ey.length;n++){const i=r.match(ey[n]);if(i==null)continue;const o=i[1].toLowerCase();switch(o){case"https":case"data":return e.push({type:"url",value:r}),{linkage:e,url:r};case"ipfs":{const a=wf(r);return e.push({type:"ipfs",value:r}),e.push({type:"url",value:a}),{linkage:e,url:a}}case"erc721":case"erc1155":{const a=o==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:o,value:r});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:`!${o}caip`,value:i[2]||""}),{url:null,linkage:e};const h=l[1],d=new zs(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(o==="erc721"){const E=await d.ownerOf(h);if(u!==E)return e.push({type:"!owner",value:E}),{url:null,linkage:e};e.push({type:"owner",value:E})}else if(o==="erc1155"){const E=await d.balanceOf(u,h);if(!E)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:E.toString()})}let m=await d[a](h);if(m==null||m==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:m}),o==="erc1155"&&(m=m.replace("{id}",nn(h,32).substring(2)),e.push({type:"metadata-url-expanded",value:m})),m.match(/^ipfs:/i)&&(m=wf(m)),e.push({type:"metadata-url",value:m});let y={};const w=await new Gr(m).send();w.assertOk();try{y=w.bodyJson}catch{try{e.push({type:"!metadata",value:w.bodyText})}catch{const A=w.body;return A&&e.push({type:"!metadata",value:ae(A)}),{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 T=y.image;if(typeof T!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!T.match(/^(https:\/\/|data:)/i)){if(T.match(lw)==null)return e.push({type:"!imageUrl-ipfs",value:T}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:T}),T=wf(T)}return e.push({type:"url",value:T}),{linkage:e,url:T}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const r=await e.getNetwork(),n=r.getPlugin("org.ethers.plugins.network.Ens");return ne(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:r}}),n.address}static async#n(e,r){const n=await Ci.getEnsAddress(e);try{const o=await new zs(n,["function resolver(bytes32) view returns (address)"],e).resolver(eh(r),{enableCcipRead:!0});return o===Ws?null:o}catch(i){throw i}return null}static async fromName(e,r){let n=r;for(;;){if(n===""||n==="."||r!=="eth"&&n==="eth")return null;const i=await Ci.#n(e,n);if(i!=null){const o=new Ci(e,i,r);return n!==r&&!await o.supportsWildcard()?null:o}n=n.split(".").slice(1).join(".")}}}const ty=BigInt(0);function Me(t,e){return(function(r){return r==null?e:t(r)})}function ro(t,e){return(r=>{if(e&&r==null)return null;if(!Array.isArray(r))throw new Error("not an array");return r.map(n=>t(n))})}function bo(t,e){return(r=>{const n={};for(const i in t){let o=i;if(e&&i in e&&!(o in r)){for(const a of e[i])if(a in r){o=a;break}}try{const a=t[i](r[o]);a!==void 0&&(n[i]=a)}catch(a){const u=a instanceof Error?a.message:"not-an-error";ne(!1,`invalid value for value.${i} (${u})`,"BAD_DATA",{value:r})}}return n})}function yk(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}D(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function qi(t){return D(it(t,!0),"invalid data","value",t),t}function Ct(t){return D(it(t,32),"invalid hash","value",t),t}const bk=bo({address:Ve,blockHash:Ct,blockNumber:Ie,data:qi,index:Ie,removed:Me(yk,!1),topics:ro(Ct),transactionHash:Ct,transactionIndex:Ie},{index:["logIndex"]});function xk(t){return bk(t)}const wk=bo({hash:Me(Ct),parentHash:Ct,parentBeaconBlockRoot:Me(Ct,null),number:Ie,timestamp:Ie,nonce:Me(qi),difficulty:ge,gasLimit:ge,gasUsed:ge,stateRoot:Me(Ct,null),receiptsRoot:Me(Ct,null),blobGasUsed:Me(ge,null),excessBlobGas:Me(ge,null),miner:Me(Ve),prevRandao:Me(Ct,null),extraData:qi,baseFeePerGas:Me(ge)},{prevRandao:["mixHash"]});function Ak(t){const e=wk(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:fw(r)),e}const Ek=bo({transactionIndex:Ie,blockNumber:Ie,transactionHash:Ct,address:Ve,topics:ro(Ct),data:qi,index:Ie,blockHash:Ct},{index:["logIndex"]});function vk(t){return Ek(t)}const Rk=bo({to:Me(Ve,null),from:Me(Ve,null),contractAddress:Me(Ve,null),index:Ie,root:Me(ae),gasUsed:ge,blobGasUsed:Me(ge,null),logsBloom:Me(qi),blockHash:Ct,hash:Ct,logs:ro(vk),blockNumber:Ie,cumulativeGasUsed:ge,effectiveGasPrice:Me(ge),blobGasPrice:Me(ge,null),status:Me(Ie),type:Me(Ie,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Tk(t){return Rk(t)}function fw(t){t.to&&ge(t.to)===ty&&(t.to="0x0000000000000000000000000000000000000000");const e=bo({hash:Ct,index:Me(Ie,void 0),type:r=>r==="0x"||r==null?0:Ie(r),accessList:Me(ci,null),blobVersionedHashes:Me(ro(Ct,!0),null),authorizationList:Me(ro(r=>{let n;if(r.signature)n=r.signature;else{let i=r.yParity;i==="0x1b"?i=0:i==="0x1c"&&(i=1),n=Object.assign({},r,{yParity:i})}return{address:Ve(r.address),chainId:ge(r.chainId),nonce:ge(r.nonce),signature:dt.from(n)}},!1),null),blockHash:Me(Ct,null),blockNumber:Me(Ie,null),transactionIndex:Me(Ie,null),from:Ve,gasPrice:Me(ge),maxPriorityFeePerGas:Me(ge),maxFeePerGas:Me(ge),maxFeePerBlobGas:Me(ge,null),gasLimit:ge,to:Me(Ve,null),value:ge,nonce:Ie,data:qi,creates:Me(Ve,null),chainId:Me(ge,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=fP(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=dt.from(t.signature):e.signature=dt.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&ge(e.blockHash)===ty&&(e.blockHash=null),e}const Bk="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class xo{name;constructor(e){Te(this,{name:e})}clone(){return new xo(this.name)}}class sc extends xo{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,r){e==null&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const n={effectiveBlock:e};function i(o,a){let u=(r||{})[o];u==null&&(u=a),D(typeof u=="number",`invalud value for ${o}`,"costs",r),n[o]=u}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),Te(this,n)}clone(){return new sc(this.effectiveBlock,this)}}class oc extends xo{address;targetNetwork;constructor(e,r){super("org.ethers.plugins.network.Ens"),Te(this,{address:e||Bk,targetNetwork:r??1})}clone(){return new oc(this.address,this.targetNetwork)}}class Sk extends xo{#e;#t;get url(){return this.#e}get processFunc(){return this.#t}constructor(e,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#e=e,this.#t=r}clone(){return this}}const Af=new Map;class ar{#e;#t;#r;constructor(e,r){this.#e=e,this.#t=ge(r),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=ge(e,"chainId")}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===ge(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===ge(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===ge(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(r=>r.name.split("#")[0]===e)}clone(){const e=new ar(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new sc;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i<e.data.length;i+=2)e.data.substring(i,i+2)==="00"?n+=r.txDataZero:n+=r.txDataNonzero;if(e.accessList){const i=ci(e.accessList);for(const o in i)n+=r.txAccessListAddress+r.txAccessListStorageKey*i[o].storageKeys.length}return n}static from(e){if(Ok(),e==null)return ar.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const r=Af.get(e);if(r)return r();if(typeof e=="bigint")return new ar("unknown",e);D(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){D(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const r=new ar(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&r.attachPlugin(new oc(e.ensAddress,e.ensNetwork)),r}D(!1,"invalid network","network",e)}static register(e,r){typeof e=="number"&&(e=BigInt(e));const n=Af.get(e);n&&D(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),Af.set(e,r)}}function ry(t,e){const r=String(t);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const n=r.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${t}`);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 ny(t){return new Sk(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[o,a]=await Promise.all([n.send(),e()]);i=o;const u=i.bodyJson.standard;return{gasPrice:a.gasPrice,maxFeePerGas:ry(u.maxFee,9),maxPriorityFeePerGas:ry(u.maxPriorityFee,9)}}catch(o){ne(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:o})}})}let iy=!1;function Ok(){if(iy)return;iy=!0;function t(e,r,n){const i=function(){const o=new ar(e,r);return n.ensNetwork!=null&&o.attachPlugin(new oc(null,n.ensNetwork)),o.attachPlugin(new sc),(n.plugins||[]).forEach(a=>{o.attachPlugin(a)}),o};ar.register(e,i),ar.register(r,i),n.altNames&&n.altNames.forEach(o=>{ar.register(o,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("filecoin",314,{}),t("filecoin-calibration",314159,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[ny("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[ny("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function nh(t){return JSON.parse(JSON.stringify(t))}class Pk{#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 r=this.#n+1;r<=e;r++){if(this.#t==null)return;await this.#e.emit("block",r)}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 i0{#e;#t;#r;constructor(e){this.#e=e,this.#r=!1,this.#t=r=>{this._poll(r,this.#e)}}async _poll(e,r){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 Ik extends i0{#e;#t;constructor(e,r){super(e),this.#e=r,this.#t=-2}pause(e){e&&(this.#t=-2),super.pause(e)}async _poll(e,r){const n=await r.getBlock(this.#e);n!=null&&(this.#t===-2?this.#t=n.number:n.number>this.#t&&(r.emit(this.#e,n.number),this.#t=n.number))}}class kk extends i0{#e;constructor(e,r){super(e),this.#e=nh(r)}async _poll(e,r){throw new Error("@TODO")}}class Nk extends i0{#e;constructor(e,r){super(e),this.#e=r}async _poll(e,r){const n=await r.getTransactionReceipt(this.#e);n&&r.emit(this.#e,n)}}class s0{#e;#t;#r;#n;#i;constructor(e,r){this.#e=e,this.#t=nh(r),this.#r=this.#o.bind(this),this.#n=!1,this.#i=-2}async#o(e){if(this.#i===-2)return;const r=nh(this.#t);r.fromBlock=this.#i+1,r.toBlock=e;const n=await this.#e.getLogs(r);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 Ck=BigInt(2),_k=10;function ea(t){return t&&typeof t.then=="function"}function la(t,e){return t+":"+JSON.stringify(e,(r,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((o,a)=>(o[a]=n[a],o),{})}return n})}class hw{name;constructor(e){Te(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function Dk(t){return JSON.parse(JSON.stringify(t))}function ih(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function Ef(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(it(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:la("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:la("orphan",r),filter:Dk(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?ih(i.map(o=>o.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],o=[],a=u=>{it(u)?i.push(u):o.push((async()=>{i.push(await kt(u,e))})())};Array.isArray(r.address)?r.address.forEach(a):a(r.address),o.length&&await Promise.all(o),n.address=ih(i.map(u=>u.toLowerCase()))}return{filter:n,tag:la("event",n),type:"event"}}D(!1,"unknown ProviderEvent","event",t)}function vf(){return new Date().getTime()}const Fk={cacheTimeout:250,pollingInterval:4e3};class Uk{#e;#t;#r;#n;#i;#o;#s;#a;#d;#u;#p;#m;constructor(e,r){if(this.#m=Object.assign({},Fk,r||{}),e==="any")this.#o=!0,this.#i=null;else if(e){const n=ar.from(e);this.#o=!1,this.#i=Promise.resolve(n),setTimeout(()=>{this.emit("network",n,null)},0)}else this.#o=!1,this.#i=null;this.#a=-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 r=this.#m.cacheTimeout;if(r<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)},r)),await i}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),o=r.toLowerCase(),a=[];for(let u=0;u<n.length;u++){const l=n[u],h=l.replace("{sender}",i).replace("{data}",o),d=new Gr(h);l.indexOf("{data}")===-1&&(d.body={data:o,sender:i}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:d,index:u,urls:n});let m="unknown error",y;try{y=await d.send()}catch(w){a.push(w.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:d,result:{error:w}});continue}try{const w=y.bodyJson;if(w.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:d,result:w}),w.data;w.message&&(m=w.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:d,result:w})}catch{}ne(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}}),a.push(m)}ne(!1,`error encountered during CCIP fetch: ${a.map(u=>JSON.stringify(u)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:a}})}_wrapBlock(e,r){return new rk(Ak(e),this)}_wrapLog(e,r){return new go(xk(e),this)}_wrapTransactionReceipt(e,r){return new X1(Tk(e),this)}_wrapTransactionResponse(e,r){return new yo(fw(e),this)}_detectNetwork(){ne(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){ne(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Ie(await this.#c({method:"getBlockNumber"}),"%response");return this.#a>=0&&(this.#a=e),e}_getAddress(e){return kt(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(it(e))return it(e,32)?e:Br(e);if(typeof e=="bigint"&&(e=Ie(e,"blockTag")),typeof e=="number")return e>=0?Br(e):this.#a>=0?Br(this.#a+e):this.getBlockNumber().then(r=>Br(r+e));D(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?ih(l.map(h=>h.toLowerCase())):l.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(l,h,d)=>{let m;switch(l.length){case 0:break;case 1:m=l[0];break;default:l.sort(),m=l}if(n&&(h!=null||d!=null))throw new Error("invalid filter");const y={};return m&&(y.address=m),r.length&&(y.topics=r),h&&(y.fromBlock=h),d&&(y.toBlock=d),n&&(y.blockHash=n),y};let o=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)o.push(this._getAddress(l));else o.push(this._getAddress(e.address));let a;"fromBlock"in e&&(a=this._getBlockTag(e.fromBlock));let u;return"toBlock"in e&&(u=this._getBlockTag(e.toBlock)),o.filter(l=>typeof l!="string").length||a!=null&&typeof a!="string"||u!=null&&typeof u!="string"?Promise.all([Promise.all(o),a,u]).then(l=>i(l[0],l[1],l[2])):i(o,a,u)}_getTransactionRequest(e){const r=to(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const o=kt(r[i],this);ea(o)?n.push((async function(){r[i]=await o})()):r[i]=o}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);ea(i)?n.push((async function(){r.blockTag=await i})()):r.blockTag=i}return n.length?(async function(){return await Promise.all(n),r})():r}async getNetwork(){if(this.#i==null){const i=(async()=>{try{const o=await this._detectNetwork();return this.emit("network",o,null),o}catch(o){throw this.#i===i&&(this.#i=null),o}})();return this.#i=i,(await i).clone()}const e=this.#i,[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(this.#o?(this.emit("network",n,r),this.#i===e&&(this.#i=Promise.resolve(n))):ne(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:o,priorityFee:a}=await zt({_block:this.#b("latest",!1),gasPrice:(async()=>{try{const d=await this.#c({method:"getGasPrice"});return ge(d,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const d=await this.#c({method:"getPriorityFee"});return ge(d,"%response")}catch{}return null})()});let u=null,l=null;const h=this._wrapBlock(i,e);return h&&h.baseFeePerGas&&(l=a??BigInt("1000000000"),u=h.baseFeePerGas*Ck+l),new Qg(o,u,l)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new Gr(n.url),o=await n.processFunc(r,this,i);return new Qg(o.gasPrice,o.maxFeePerGas,o.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return ea(r)&&(r=await r),ge(await this.#c({method:"estimateGas",transaction:r}),"%response")}async#l(e,r,n){ne(n<_k,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:r,enableCcipRead:!0})});const i=to(e);try{return ae(await this._perform({method:"call",transaction:i,blockTag:r}))}catch(o){if(!this.disableCcipRead&&Uh(o)&&o.data&&n>=0&&r==="latest"&&i.to!=null&&ot(o.data,0,4)==="0x556f1830"){const a=o.data,u=await kt(i.to,this);let l;try{l=Gk(ot(o.data,4))}catch(m){ne(!1,m.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:a}})}ne(l.sender.toLowerCase()===u.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:a,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const h=await this.ccipReadFetch(i,l.calldata,l.urls);ne(h!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:o.data,errorArgs:l.errorArgs}});const d={to:u,data:je([l.selector,Vk([h,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:d});try{const m=await this.#l(d,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},d),result:m}),m}catch(m){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},d),error:m}),m}}throw o}}async#f(e){const{value:r}=await zt({network:this.getNetwork(),value:e});return r}async call(e){const{tx:r,blockTag:n}=await zt({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#f(this.#l(r,n,e.enableCcipRead?0:-1))}async#h(e,r,n){let i=this._getAddress(r),o=this._getBlockTag(n);return(typeof i!="string"||typeof o!="string")&&([i,o]=await Promise.all([i,o])),await this.#f(this.#c(Object.assign(e,{address:i,blockTag:o})))}async getBalance(e,r){return ge(await this.#h({method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return Ie(await this.#h({method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return ae(await this.#h({method:"getCode"},e,r))}async getStorage(e,r,n){const i=ge(r,"position");return ae(await this.#h({method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await zt({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),o=gr.from(e);if(o.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(o,i).replaceableTransaction(r)}async#b(e,r){if(it(e,32))return await this.#c({method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await this.#c({method:"getBlock",blockTag:n,includeTransactions:r})}async getBlock(e,r){const{network:n,params:i}=await zt({network:this.getNetwork(),params:this.#b(e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await zt({network:this.getNetwork(),params:this.#c({method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await zt({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,r)}async getTransactionResult(e){const{result:r}=await zt({network:this.getNetwork(),result:this.#c({method:"getTransactionResult",hash:e})});return r==null?null:ae(r)}async getLogs(e){let r=this._getFilter(e);ea(r)&&(r=await r);const{network:n,params:i}=await zt({network:this.getNetwork(),params:this.#c({method:"getLogs",filter:r})});return i.map(o=>this._wrapLog(o,n))}_getProvider(e){ne(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Ci.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=Ve(e);const r=eh(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await Ci.getEnsAddress(this),o=await new zs(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(o==null||o===Ws)return null;const u=await new zs(o,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(u)!==e?null:u}catch(n){if(_t(n,"BAD_DATA")&&n.value==="0x"||_t(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(o,a)=>{let u=null;const l=(async h=>{try{const d=await this.getTransactionReceipt(e);if(d!=null&&h-d.blockNumber+1>=i){o(d),u&&(clearTimeout(u),u=null);return}}catch(d){console.log("EEE",d)}this.once("block",l)});n!=null&&(u=setTimeout(()=>{u!=null&&(u=null,this.off("block",l),a(ht("timeout","TIMEOUT",{reason:"timeout"})))},n)),l(await this.getBlockNumber())})}async waitForBlock(e){ne(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=this.#u.get(e);r&&(r.timer&&clearTimeout(r.timer),this.#u.delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=this.#d++,i=()=>{this.#u.delete(n),e()};if(this.paused)this.#u.set(n,{timer:null,func:i,time:r});else{const o=setTimeout(i,r);this.#u.set(n,{timer:o,func:i,time:vf()})}return n}_forEachSubscriber(e){for(const r of this.#e.values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new hw(e.type);case"block":{const r=new Pk(this);return r.pollingInterval=this.pollingInterval,r}case"safe":case"finalized":return new Ik(this,e.type);case"event":return new s0(this,e.filter);case"transaction":return new Nk(this,e.hash);case"orphan":return new kk(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of this.#e.values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),this.#r!=null&&r.pause(this.#r);break}}async#g(e,r){let n=await Ef(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await Ef({orphan:"drop-log",log:r[0]},this)),this.#e.get(n.tag)||null}async#y(e){const r=await Ef(e,this),n=r.tag;let i=this.#e.get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#e.set(n,i)),i}async on(e,r){const n=await this.#y(e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,this.#r!=null&&n.subscriber.pause(this.#r)),this}async once(e,r){const n=await this.#y(e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,this.#r!=null&&n.subscriber.pause(this.#r)),this}async emit(e,...r){const n=await this.#g(e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:o,once:a})=>{const u=new fx(this,a?null:o,e);try{o.call(this,...r,u)}catch{}return!a}),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.#g(e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of this.#e.values())r+=n.length;return r}async listeners(e){if(e){const n=await this.#g(e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of this.#e.values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await this.#g(e);if(!n)return this;if(r){const i=n.listeners.map(({listener:o})=>o).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await this.#y(e);n&&i.stop(),this.#e.delete(r)}else for(const[r,{started:n,subscriber:i}]of this.#e)n&&i.stop(),this.#e.delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}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.#a=-1,this.#r!=null){if(this.#r==!!e)return;ne(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),this.#r=!!e;for(const r of this.#u.values())r.timer&&clearTimeout(r.timer),r.time=vf()-r.time}resume(){if(this.#r!=null){this._forEachSubscriber(e=>e.resume()),this.#r=null;for(const e of this.#u.values()){let r=e.time;r<0&&(r=0),e.time=vf(),setTimeout(e.func,r)}}}}function Lk(t,e){try{const r=sh(t,e);if(r)return Ea(r)}catch{}return null}function sh(t,e){if(t==="0x")return null;try{const r=Ie(ot(t,e,e+32)),n=Ie(ot(t,r,r+32));return ot(t,r+32,r+32+n)}catch{}return null}function sy(t){const e=mt(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function Mk(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const zk=new Uint8Array([]);function Vk(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(zk),r+=32;for(let n=0;n<t.length;n++){const i=de(t[n]);e[n]=sy(r),e.push(sy(i.length)),e.push(Mk(i)),r+=32+Math.ceil(i.length/32)*32}return je(e)}const oy="0x0000000000000000000000000000000000000000000000000000000000000000";function Gk(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};ne(Pi(t)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=ot(t,0,32);ne(ot(r,0,12)===ot(oy,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=ot(r,12);try{const n=[],i=Ie(ot(t,32,64)),o=Ie(ot(t,i,i+32)),a=ot(t,i+32);for(let u=0;u<o;u++){const l=Lk(a,u*32);if(l==null)throw new Error("abort");n.push(l)}e.urls=n}catch{ne(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const n=sh(t,64);if(n==null)throw new Error("abort");e.calldata=n}catch{ne(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}ne(ot(t,100,128)===ot(oy,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=ot(t,96,100);try{const n=sh(t,128);if(n==null)throw new Error("abort");e.extraData=n}catch{ne(!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 Mn(t,e){if(t.provider)return t.provider;ne(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function ay(t,e){let r=to(e);if(r.to!=null&&(r.to=kt(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),kt(n,t)]).then(([i,o])=>(D(i.toLowerCase()===o.toLowerCase(),"transaction from mismatch","tx.from",o),i))}else r.from=t.getAddress();return await zt(r)}class o0{provider;constructor(e){Te(this,{provider:e||null})}async getNonce(e){return Mn(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await ay(this,e)}async populateTransaction(e){const r=Mn(this,"populateTransaction"),n=await ay(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 a=ge(n.chainId);D(a===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const o=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||o)?D(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&o&&D(!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 a=await r.getFeeData();ne(a.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice)}else{const a=await r.getFeeData();if(n.type==null)if(a.maxFeePerGas!=null&&a.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=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?(ne(!o,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice),n.type=0):ne(!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=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return await zt(n)}async populateAuthorization(e){const r=Object.assign({},e);return r.chainId==null&&(r.chainId=(await Mn(this,"getNetwork").getNetwork()).chainId),r.nonce==null&&(r.nonce=await this.getNonce()),r}async estimateGas(e){return Mn(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Mn(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Mn(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=Mn(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=gr.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}authorize(e){ne(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}class a0 extends o0{address;constructor(e,r){super(r),Te(this,{address:e})}async getAddress(){return this.address}connect(e){return new a0(this.address,e)}#e(e,r){ne(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:r})}async signTransaction(e){this.#e("transactions","signTransaction")}async signMessage(e){this.#e("messages","signMessage")}async signTypedData(e,r,n){this.#e("typed-data","signTypedData")}}function $k(t){return JSON.parse(JSON.stringify(t))}class dw{#e;#t;#r;#n;#i;#o;constructor(e){this.#e=e,this.#t=null,this.#r=this.#s.bind(this),this.#n=!1,this.#i=null,this.#o=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,r){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 r=null;try{r=await this.#t}catch(o){if(!_t(o,"UNSUPPORTED_OPERATION")||o.operation!=="eth_newFilter")throw o}if(r==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.#o)return;const i=await this.#e.send("eth_getFilterChanges",[r]);await this._emitResults(this.#e,i)}catch(r){console.log("@TODO",r)}this.#e.once("block",this.#r)}#a(){const e=this.#t;e&&(this.#t=null,e.then(r=>{this.#e.destroyed||this.#e.send("eth_uninstallFilter",[r])}))}start(){this.#n||(this.#n=!0,this.#s(-2))}stop(){this.#n&&(this.#n=!1,this.#o=!0,this.#a(),this.#e.off("block",this.#r))}pause(e){e&&this.#a(),this.#e.off("block",this.#r)}resume(){this.start()}}class jk extends dw{#e;constructor(e,r){super(e),this.#e=$k(r)}_recover(e){return new s0(e,this.#e)}async _subscribe(e){return await e.send("eth_newFilter",[this.#e])}async _emitResults(e,r){for(const n of r)e.emit(this.#e,e._wrapLog(n,e._network))}}class Hk extends dw{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,r){for(const n of r)e.emit("pending",n)}}const qk="bigint,boolean,function,number,string,symbol".split(/,/g);function fa(t){if(t==null||qk.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(fa);if(typeof t=="object")return Object.keys(t).reduce((e,r)=>(e[r]=t[r],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function Zk(t){return new Promise(e=>{setTimeout(e,t)})}function bi(t){return t&&t.toLowerCase()}function cy(t){return t&&typeof t.pollingInterval=="number"}const pw={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class Rf extends o0{address;constructor(e,r){super(e),r=Ve(r),Te(this,{address:r})}connect(e){ne(!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 r=fa(e),n=[];if(r.from){const o=r.from;n.push((async()=>{const a=await kt(o,this.provider);D(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),r.from=a})())}else r.from=this.address;if(r.gasLimit==null&&n.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;n.push((async()=>{r.to=await kt(o,this.provider)})())}n.length&&await Promise.all(n);const i=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(e){const r=await this.provider.getBlockNumber(),n=await this.sendUncheckedTransaction(e);return await new Promise((i,o)=>{const a=[1e3,100];let u=0;const l=async()=>{try{const h=await this.provider.getTransaction(n);if(h!=null){i(h.replaceableTransaction(r));return}}catch(h){if(_t(h,"CANCELLED")||_t(h,"BAD_DATA")||_t(h,"NETWORK_ERROR")||_t(h,"UNSUPPORTED_OPERATION")){h.info==null&&(h.info={}),h.info.sendTransactionHash=n,o(h);return}if(_t(h,"INVALID_ARGUMENT")&&(u++,h.info==null&&(h.info={}),h.info.sendTransactionHash=n,u>10)){o(h);return}this.provider.emit("error",ht("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:h}))}this.provider._setTimeout(()=>{l()},a.pop()||4e3)};l()})}async signTransaction(e){const r=fa(e);if(r.from){const i=await kt(r.from,this.provider);D(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),r.from=i}else r.from=this.address;const n=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[n])}async signMessage(e){const r=typeof e=="string"?Jt(e):e;return await this.provider.send("personal_sign",[ae(r),this.address.toLowerCase()])}async signTypedData(e,r,n){const i=fa(n),o=await Zt.resolveNames(e,r,i,async a=>{const u=await kt(a);return D(u!=null,"TypedData does not support null address","value",a),u});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(Zt.getPayload(o.domain,r,o.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const r=typeof e=="string"?Jt(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),ae(r)])}}class Kk extends Uk{#e;#t;#r;#n;#i;#o;#s;#a(){if(this.#n)return;const e=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#n=setTimeout(()=>{this.#n=null;const r=this.#r;for(this.#r=[];r.length;){const n=[r.shift()];for(;r.length&&n.length!==this.#e.batchMaxCount;)if(n.push(r.shift()),JSON.stringify(n.map(o=>o.payload)).length>this.#e.batchMaxSize){r.unshift(n.pop());break}(async()=>{const i=n.length===1?n[0].payload:n.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{const o=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:a,reject:u,payload:l}of n){if(this.destroyed){u(ht("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:l.method}));continue}const h=o.filter(d=>d.id===l.id)[0];if(h==null){const d=ht("missing response for request","BAD_DATA",{value:o,info:{payload:l}});this.emit("error",d),u(d);continue}if("error"in h){u(this.getRpcError(l,h));continue}a(h.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:a}of n)a(o)}})()}},e)}constructor(e,r){super(e,r),this.#t=1,this.#e=Object.assign({},pw,r||{}),this.#r=[],this.#n=null,this.#o=null,this.#s=null;{let i=null;const o=new Promise(a=>{i=a});this.#i={promise:o,resolve:i}}const n=this._getOption("staticNetwork");typeof n=="boolean"?(D(!n||e!=="any","staticNetwork cannot be used on special network 'any'","options",r),n&&e!=null&&(this.#o=ar.from(e))):n&&(D(e==null||n.matches(e),"staticNetwork MUST match network object","options",r),this.#o=n)}_getOption(e){return this.#e[e]}get _network(){return ne(this.#o,"network is not available yet","NETWORK_ERROR"),this.#o}async _perform(e){if(e.method==="call"||e.method==="estimateGas"){let n=e.transaction;if(n&&n.type!=null&&ge(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 r=this.getRpcRequest(e);return r!=null?await this.send(r.method,r.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e)if(e===!0){if(this.#o)return this.#o}else return e;return this.#s?await this.#s:this.ready?(this.#s=(async()=>{try{const r=ar.from(ge(await this.send("eth_chainId",[])));return this.#s=null,r}catch(r){throw this.#s=null,r}})(),await this.#s):(this.#s=(async()=>{const r={id:this.#t++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let n;try{n=(await this._send(r))[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 ar.from(ge(n.result));throw this.getRpcError(r,n)})(),await this.#s)}_start(){this.#i==null||this.#i.resolve==null||(this.#i.resolve(),this.#i=null,(async()=>{for(;this.#o==null&&!this.destroyed;)try{this.#o=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",ht("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await Zk(1e3)}this.#a()})())}async _waitUntilReady(){if(this.#i!=null)return await this.#i.promise}_getSubscriber(e){return e.type==="pending"?new Hk(this):e.type==="event"?this._getOption("polling")?new s0(this,e.filter):new jk(this,e.filter):e.type==="orphan"&&e.filter.orphan==="drop-log"?new hw("orphan"):super._getSubscriber(e)}get ready(){return this.#i==null}getRpcTransaction(e){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(n=>{if(e[n]==null)return;let i=n;n==="gasLimit"&&(i="gas"),r[i]=Br(ge(e[n],`tx.${n}`))}),["from","to","data"].forEach(n=>{e[n]!=null&&(r[n]=ae(e[n]))}),e.accessList&&(r.accessList=ci(e.accessList)),e.blobVersionedHashes&&(r.blobVersionedHashes=e.blobVersionedHashes.map(n=>n.toLowerCase())),e.authorizationList&&(r.authorizationList=e.authorizationList.map(n=>{const i=x1(n);return{address:i.address,nonce:Br(i.nonce),chainId:Br(i.chainId),yParity:Br(i.signature.yParity),r:Br(i.signature.r),s:Br(i.signature.s)}})),r}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:[bi(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[bi(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[bi(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[bi(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(bi):e.filter.address=bi(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,r){const{method:n}=e,{error:i}=r;if(n==="eth_estimateGas"&&i.message){const u=i.message;if(!u.match(/revert/i)&&u.match(/insufficient funds/i))return ht("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:i}});if(u.match(/nonce/i)&&u.match(/too low/i))return ht("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=oh(i),l=Hi.getBuiltinCallException(n==="eth_call"?"call":"estimateGas",e.params[0],u?u.data:null);return l.info={error:i,payload:e},l}const o=JSON.stringify(Jk(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return ht("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(o.match(/insufficient funds|base fee exceeds gas limit/i))return ht("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:u,info:{error:i}});if(o.match(/nonce/i)&&o.match(/too low/i))return ht("nonce has already been used","NONCE_EXPIRED",{transaction:u,info:{error:i}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return ht("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:u,info:{error:i}});if(o.match(/only replay-protected/i))return ht("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:n,info:{transaction:u,info:{error:i}}})}let a=!!o.match(/the method .* does not exist/i);return a||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(a=!0),a?ht("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:i,payload:e}}):ht("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:e})}send(e,r){if(this.destroyed)return Promise.reject(ht("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const n=this.#t++,i=new Promise((o,a)=>{this.#r.push({resolve:o,reject:a,payload:{method:e,params:r,id:n,jsonrpc:"2.0"}})});return this.#a(),i}async getSigner(e){e==null&&(e=0);const r=this.send("eth_accounts",[]);if(typeof e=="number"){const i=await r;if(e>=i.length)throw new Error("no such account");return new Rf(this,i[e])}const{accounts:n}=await zt({network:this.getNetwork(),accounts:r});e=Ve(e);for(const i of n)if(Ve(i)===e)return new Rf(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new Rf(this,r))}destroy(){this.#n&&(clearTimeout(this.#n),this.#n=null);for(const{payload:e,reject:r}of this.#r)r(ht("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#r=[],super.destroy()}}class Wk extends Kk{#e;constructor(e,r){super(e,r);let n=this._getOption("pollingInterval");n==null&&(n=pw.pollingInterval),this.#e=n}_getSubscriber(e){const r=super._getSubscriber(e);return cy(r)&&(r.pollingInterval=this.#e),r}get pollingInterval(){return this.#e}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#e=e,this._forEachSubscriber(r=>{cy(r)&&(r.pollingInterval=this.#e)})}}class NN extends Wk{#e;constructor(e,r,n){e==null&&(e="http://localhost:8545"),super(r,n),typeof e=="string"?this.#e=new Gr(e):this.#e=e.clone()}_getConnection(){return this.#e.clone()}async send(e,r){return await this._start(),await super.send(e,r)}async _send(e){const r=this._getConnection();r.body=JSON.stringify(e),r.setHeader("content-type","application/json");const n=await r.send();n.assertOk();let i=n.bodyJson;return Array.isArray(i)||(i=[i]),i}}function oh(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&it(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const r=oh(t[e]);if(r)return r}return null}if(typeof t=="string")try{return oh(JSON.parse(t))}catch{}return null}function ah(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const r in t)ah(t[r],e);if(typeof t=="string")try{return ah(JSON.parse(t),e)}catch{}}}function Jk(t){const e=[];return ah(t,e),e}class ac extends o0{address;#e;constructor(e,r){super(r),D(e&&typeof e.sign=="function","invalid private key","privateKey","[ REDACTED ]"),this.#e=e;const n=mo(this.signingKey.publicKey);Te(this,{address:n})}get signingKey(){return this.#e}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new ac(this.#e,e)}async signTransaction(e){e=to(e);const{to:r,from:n}=await zt({to:e.to?kt(e.to,this):void 0,from:e.from?kt(e.from,this):void 0});r!=null&&(e.to=r),n!=null&&(e.from=n),e.from!=null&&(D(Ve(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const i=gr.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(kI(e)).serialized}authorizeSync(e){D(typeof e.address=="string","invalid address for authorizeSync","auth.address",e);const r=this.signingKey.sign(qP(e));return Object.assign({},{address:Ve(e.address),nonce:ge(e.nonce||0),chainId:ge(e.chainId||0)},{signature:r})}async authorize(e){return e=Object.assign({},e,{address:await kt(e.address,this)}),this.authorizeSync(await this.populateAuthorization(e))}async signTypedData(e,r,n){const i=await Zt.resolveNames(e,r,n,async o=>{ne(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:o}});const a=await this.provider.resolveName(o);return ne(a!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:o}),a});return this.signingKey.sign(Zt.hash(i.domain,r,i.value)).serialized}}const Pa=" !#$%&'()*+,-./<=>?@[]^_`{|}~",Qk=/^[a-z]*$/i;function uy(t,e){let r=97;return t.reduce((n,i)=>(i===e?r++:i.match(Qk)?n.push(String.fromCharCode(r)+i):(r=97,n.push(i)),n),[])}function Yk(t,e){for(let i=Pa.length-1;i>=0;i--)t=t.split(Pa[i]).join(e.substring(2*i,2*i+2));const r=[],n=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(i,o,a,u)=>{if(a)for(let l=parseInt(a);l>=0;l--)r.push(";");else r.push(o.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return uy(uy(r,";"),":")}function Xk(t){return D(t[0]==="0","unsupported auwl data","data",t),Yk(t.substring(1+2*Pa.length),t.substring(1,1+2*Pa.length))}class eN{locale;constructor(e){Te(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}class tN extends eN{#e;#t;constructor(e,r,n){super(e),this.#e=r,this.#t=n,this.#r=null}get _data(){return this.#e}_decodeWords(){return Xk(this.#e)}#r;#n(){if(this.#r==null){const e=this._decodeWords();if(sn(e.join(`
86
+ `)+`
87
+ `)!==this.#t)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#r=e}return this.#r}getWord(e){const r=this.#n();return D(e>=0&&e<r.length,`invalid word index: ${e}`,"index",e),r[e]}getWordIndex(e){return this.#n().indexOf(e)}}const rN="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",nN="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let Tf=null;class ri extends tN{constructor(){super("en",rN,nN)}static wordlist(){return Tf==null&&(Tf=new ri),Tf}}function mw(t){return(1<<t)-1<<8-t&255}function iN(t){return(1<<t)-1&255}function Bf(t,e){ox("NFKD"),e==null&&(e=ri.wordlist());const r=e.split(t);D(r.length%3===0&&r.length>=12&&r.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const n=new Uint8Array(Math.ceil(11*r.length/8));let i=0;for(let h=0;h<r.length;h++){let d=e.getWordIndex(r[h].normalize("NFKD"));D(d>=0,`invalid mnemonic word at index ${h}`,"mnemonic","[ REDACTED ]");for(let m=0;m<11;m++)d&1<<10-m&&(n[i>>3]|=1<<7-i%8),i++}const o=32*r.length/3,a=r.length/3,u=mw(a),l=de(xr(n.slice(0,o/8)))[0]&u;return D(l===(n[n.length-1]&u),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),ae(n.slice(0,o/8))}function Sf(t,e){D(t.length%4===0&&t.length>=16&&t.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=ri.wordlist());const r=[0];let n=11;for(let a=0;a<t.length;a++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=t[a],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[a]>>8-n,r.push(t[a]&iN(8-n)),n+=3);const i=t.length/4,o=parseInt(xr(t).substring(2,4),16)&mw(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,e.join(r.map(a=>e.getWord(a)))}const Of={};class Zi{phrase;password;wordlist;entropy;constructor(e,r,n,i,o){i==null&&(i=""),o==null&&(o=ri.wordlist()),ai(e,Of,"Mnemonic"),Te(this,{phrase:n,password:i,wordlist:o,entropy:r})}computeSeed(){const e=Jt("mnemonic"+this.password,"NFKD");return In(Jt(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,r,n){const i=Bf(e,n);return e=Sf(de(i),n),new Zi(Of,i,e,r,n)}static fromEntropy(e,r,n){const i=de(e,"entropy"),o=Sf(i,n);return new Zi(Of,ae(i),o,r,n)}static entropyToPhrase(e,r){const n=de(e,"entropy");return Sf(n,r)}static phraseToEntropy(e,r){return Bf(e,r)}static isValidMnemonic(e,r){try{return Bf(e,r),!0}catch{}return!1}}var Nt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Pf=function(t,e,r,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"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ha,dr,Ur;const sN={16:10,24:12,32:14},oN=[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],fr=[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],ta=[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],aN=[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],cN=[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],uN=[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],lN=[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],fN=[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],hN=[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],dN=[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],pN=[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],mN=[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],gN=[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],yN=[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],bN=[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 If(t){const e=[];for(let r=0;r<t.length;r+=4)e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]);return e}class c0{get key(){return Nt(this,ha,"f").slice()}constructor(e){if(ha.set(this,void 0),dr.set(this,void 0),Ur.set(this,void 0),!(this instanceof c0))throw Error("AES must be instanitated with `new`");Pf(this,ha,new Uint8Array(e),"f");const r=sN[this.key.length];if(r==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");Pf(this,Ur,[],"f"),Pf(this,dr,[],"f");for(let d=0;d<=r;d++)Nt(this,Ur,"f").push([0,0,0,0]),Nt(this,dr,"f").push([0,0,0,0]);const n=(r+1)*4,i=this.key.length/4,o=If(this.key);let a;for(let d=0;d<i;d++)a=d>>2,Nt(this,Ur,"f")[a][d%4]=o[d],Nt(this,dr,"f")[r-a][d%4]=o[d];let u=0,l=i,h;for(;l<n;){if(h=o[i-1],o[0]^=fr[h>>16&255]<<24^fr[h>>8&255]<<16^fr[h&255]<<8^fr[h>>24&255]^oN[u]<<24,u+=1,i!=8)for(let w=1;w<i;w++)o[w]^=o[w-1];else{for(let w=1;w<i/2;w++)o[w]^=o[w-1];h=o[i/2-1],o[i/2]^=fr[h&255]^fr[h>>8&255]<<8^fr[h>>16&255]<<16^fr[h>>24&255]<<24;for(let w=i/2+1;w<i;w++)o[w]^=o[w-1]}let d=0,m,y;for(;d<i&&l<n;)m=l>>2,y=l%4,Nt(this,Ur,"f")[m][y]=o[d],Nt(this,dr,"f")[r-m][y]=o[d++],l++}for(let d=1;d<r;d++)for(let m=0;m<4;m++)h=Nt(this,dr,"f")[d][m],Nt(this,dr,"f")[d][m]=mN[h>>24&255]^gN[h>>16&255]^yN[h>>8&255]^bN[h&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const r=Nt(this,Ur,"f").length-1,n=[0,0,0,0];let i=If(e);for(let u=0;u<4;u++)i[u]^=Nt(this,Ur,"f")[0][u];for(let u=1;u<r;u++){for(let l=0;l<4;l++)n[l]=aN[i[l]>>24&255]^cN[i[(l+1)%4]>>16&255]^uN[i[(l+2)%4]>>8&255]^lN[i[(l+3)%4]&255]^Nt(this,Ur,"f")[u][l];i=n.slice()}const o=new Uint8Array(16);let a=0;for(let u=0;u<4;u++)a=Nt(this,Ur,"f")[r][u],o[4*u]=(fr[i[u]>>24&255]^a>>24)&255,o[4*u+1]=(fr[i[(u+1)%4]>>16&255]^a>>16)&255,o[4*u+2]=(fr[i[(u+2)%4]>>8&255]^a>>8)&255,o[4*u+3]=(fr[i[(u+3)%4]&255]^a)&255;return o}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const r=Nt(this,dr,"f").length-1,n=[0,0,0,0];let i=If(e);for(let u=0;u<4;u++)i[u]^=Nt(this,dr,"f")[0][u];for(let u=1;u<r;u++){for(let l=0;l<4;l++)n[l]=fN[i[l]>>24&255]^hN[i[(l+3)%4]>>16&255]^dN[i[(l+2)%4]>>8&255]^pN[i[(l+1)%4]&255]^Nt(this,dr,"f")[u][l];i=n.slice()}const o=new Uint8Array(16);let a=0;for(let u=0;u<4;u++)a=Nt(this,dr,"f")[r][u],o[4*u]=(ta[i[u]>>24&255]^a>>24)&255,o[4*u+1]=(ta[i[(u+3)%4]>>16&255]^a>>16)&255,o[4*u+2]=(ta[i[(u+2)%4]>>8&255]^a>>8)&255,o[4*u+3]=(ta[i[(u+1)%4]&255]^a)&255;return o}}ha=new WeakMap,dr=new WeakMap,Ur=new WeakMap;class gw{constructor(e,r,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new c0(r)},name:{enumerable:!0,value:e}})}}var ra=function(t,e,r,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"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},xi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Cs,$r;class u0 extends gw{constructor(e,r){if(super("ECC",e,u0),Cs.set(this,void 0),$r.set(this,void 0),r){if(r.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");ra(this,Cs,new Uint8Array(r),"f")}else ra(this,Cs,new Uint8Array(16),"f");ra(this,$r,this.iv,"f")}get iv(){return new Uint8Array(xi(this,Cs,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const r=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){for(let i=0;i<16;i++)xi(this,$r,"f")[i]^=e[n+i];ra(this,$r,this.aes.encrypt(xi(this,$r,"f")),"f"),r.set(xi(this,$r,"f"),n)}return r}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const r=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 o=0;o<16;o++)r[n+o]=i[o]^xi(this,$r,"f")[o],xi(this,$r,"f")[o]=e[n+o]}return r}}Cs=new WeakMap,$r=new WeakMap;var wi=function(t,e,r,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"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},hr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},_s,Vn,pr;class Ki extends gw{constructor(e,r){super("CTR",e,Ki),_s.set(this,void 0),Vn.set(this,void 0),pr.set(this,void 0),wi(this,pr,new Uint8Array(16),"f"),hr(this,pr,"f").fill(0),wi(this,_s,hr(this,pr,"f"),"f"),wi(this,Vn,16,"f"),r==null&&(r=1),typeof r=="number"?this.setCounterValue(r):this.setCounterBytes(r)}get counter(){return new Uint8Array(hr(this,pr,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let r=15;r>=0;--r)hr(this,pr,"f")[r]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");hr(this,pr,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(hr(this,pr,"f")[e]===255)hr(this,pr,"f")[e]=0;else{hr(this,pr,"f")[e]++;break}}encrypt(e){var r,n;const i=new Uint8Array(e);for(let o=0;o<i.length;o++)hr(this,Vn,"f")===16&&(wi(this,_s,this.aes.encrypt(hr(this,pr,"f")),"f"),wi(this,Vn,0,"f"),this.increment()),i[o]^=hr(this,_s,"f")[wi(this,Vn,(n=hr(this,Vn,"f"),r=n++,n),"f"),r];return i}decrypt(e){return this.encrypt(e)}}_s=new WeakMap,Vn=new WeakMap,pr=new WeakMap;function xN(t){if(t.length<16)throw new TypeError("PKCS#7 invalid length");const e=t[t.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");const r=t.length-e;for(let n=0;n<e;n++)if(t[r+n]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(t.subarray(0,r))}function yw(t){return typeof t=="string"&&!t.startsWith("0x")&&(t="0x"+t),Dt(t)}function Os(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function wo(t){return typeof t=="string"?Jt(t,"NFKC"):Dt(t)}function At(t,e){const r=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);D(r!=null,"invalid path","path",e);const n=r[1],i=r[3],o=r[4]==="!";let a=t;for(const u of n.toLowerCase().split(".")){if(Array.isArray(a)){if(!u.match(/^[0-9]+$/))break;a=a[parseInt(u)]}else if(typeof a=="object"){let l=null;for(const h in a)if(h.toLowerCase()===u){l=a[h];break}a=l}else a=null;if(a==null)break}if(D(!o||a!=null,"missing required value","path",n),i&&a!=null){if(i==="int"){if(typeof a=="string"&&a.match(/^-?[0-9]+$/))return parseInt(a);if(Number.isSafeInteger(a))return a}if(i==="number"&&typeof a=="string"&&a.match(/^-?[0-9.]*$/))return parseFloat(a);if(i==="data"&&typeof a=="string")return yw(a);if(i==="array"&&Array.isArray(a)||i===typeof a)return a;D(!1,`wrong type found for ${i} `,"path",n)}return a}const bw="m/44'/60'/0'/0/0";function ly(t){try{const e=JSON.parse(t);if((e.version!=null?parseInt(e.version):0)===3)return!0}catch{}return!1}function wN(t,e,r){if(At(t,"crypto.cipher:string")==="aes-128-ctr"){const i=At(t,"crypto.cipherparams.iv:data!"),o=new Ki(e,i);return ae(o.decrypt(r))}ne(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function Ia(t,e){const r=de(e),n=At(t,"crypto.ciphertext:data!"),i=ae(lt(je([r.slice(16,32),n]))).substring(2);D(i===At(t,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const o=wN(t,r.slice(0,16),n),a=mo(o);if(t.address){let h=t.address.toLowerCase();h.startsWith("0x")||(h="0x"+h),D(Ve(h)===a,"keystore address/privateKey mismatch","address",t.address)}const u={address:a,privateKey:o};if(At(t,"x-ethers.version:string")==="0.1"){const h=r.slice(32,64),d=At(t,"x-ethers.mnemonicCiphertext:data!"),m=At(t,"x-ethers.mnemonicCounter:data!"),y=new Ki(h,m);u.mnemonic={path:At(t,"x-ethers.path:string")||bw,locale:At(t,"x-ethers.locale:string")||"en",entropy:ae(de(y.decrypt(d)))}}return u}function xw(t){const e=At(t,"crypto.kdf:string");if(e&&typeof e=="string"){if(e.toLowerCase()==="scrypt"){const r=At(t,"crypto.kdfparams.salt:data!"),n=At(t,"crypto.kdfparams.n:int!"),i=At(t,"crypto.kdfparams.r:int!"),o=At(t,"crypto.kdfparams.p:int!");D(n>0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),D(i>0&&o>0,"invalid kdf","kdf",e);const a=At(t,"crypto.kdfparams.dklen:int!");return D(a===32,"invalid kdf.dklen","kdf.dflen",a),{name:"scrypt",salt:r,N:n,r:i,p:o,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){const r=At(t,"crypto.kdfparams.salt:data!"),n=At(t,"crypto.kdfparams.prf:string!"),i=n.split("-").pop();D(i==="sha256"||i==="sha512","invalid kdf.pdf","kdf.pdf",n);const o=At(t,"crypto.kdfparams.c:int!"),a=At(t,"crypto.kdfparams.dklen:int!");return D(a===32,"invalid kdf.dklen","kdf.dklen",a),{name:"pbkdf2",salt:r,count:o,dkLen:a,algorithm:i}}}D(!1,"unsupported key-derivation function","kdf",e)}function AN(t,e){const r=JSON.parse(t),n=wo(e),i=xw(r);if(i.name==="pbkdf2"){const{salt:m,count:y,dkLen:w,algorithm:T}=i,E=In(n,m,y,w,T);return Ia(r,E)}ne(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:o,N:a,r:u,p:l,dkLen:h}=i,d=rs(n,o,a,u,l,h);return Ia(r,d)}function fy(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async function EN(t,e,r){const n=JSON.parse(t),i=wo(e),o=xw(n);if(o.name==="pbkdf2"){r&&(r(0),await fy(0));const{salt:y,count:w,dkLen:T,algorithm:E}=o,B=In(i,y,w,T,E);return r&&(r(1),await fy(0)),Ia(n,B)}ne(o.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:o});const{salt:a,N:u,r:l,p:h,dkLen:d}=o,m=await ts(i,a,u,l,h,d,r);return Ia(n,m)}function ww(t){const e=t.salt!=null?de(t.salt,"options.salt"):Yr(32);let r=1<<17,n=8,i=1;return t.scrypt&&(t.scrypt.N&&(r=t.scrypt.N),t.scrypt.r&&(n=t.scrypt.r),t.scrypt.p&&(i=t.scrypt.p)),D(typeof r=="number"&&r>0&&Number.isSafeInteger(r)&&(BigInt(r)&BigInt(r-1))===BigInt(0),"invalid scrypt N parameter","options.N",r),D(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),D(typeof i=="number"&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:e,N:r,r:n,p:i}}function Aw(t,e,r,n){const i=de(r.privateKey,"privateKey"),o=n.iv!=null?de(n.iv,"options.iv"):Yr(16);D(o.length===16,"invalid options.iv length","options.iv",n.iv);const a=n.uuid!=null?de(n.uuid,"options.uuid"):Yr(16);D(a.length===16,"invalid options.uuid length","options.uuid",n.iv);const u=t.slice(0,16),l=t.slice(16,32),h=new Ki(u,o),d=de(h.encrypt(i)),m=lt(je([l,d])),y={address:r.address.substring(2).toLowerCase(),id:TS(a),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:ae(o).substring(2)},ciphertext:ae(d).substring(2),kdf:"scrypt",kdfparams:{salt:ae(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:m.substring(2)}};if(r.mnemonic){const w=n.client!=null?n.client:`ethers/${ix}`,T=r.mnemonic.path||bw,E=r.mnemonic.locale||"en",B=t.slice(32,64),A=de(r.mnemonic.entropy,"account.mnemonic.entropy"),P=Yr(16),I=new Ki(B,P),S=de(I.encrypt(A)),N=new Date,F="UTC--"+(N.getUTCFullYear()+"-"+Os(N.getUTCMonth()+1,2)+"-"+Os(N.getUTCDate(),2)+"T"+Os(N.getUTCHours(),2)+"-"+Os(N.getUTCMinutes(),2)+"-"+Os(N.getUTCSeconds(),2)+".0Z")+"--"+y.address;y["x-ethers"]={client:w,gethFilename:F,path:T,locale:E,mnemonicCounter:ae(P).substring(2),mnemonicCiphertext:ae(S).substring(2),version:"0.1"}}return JSON.stringify(y)}function Ew(t,e,r){r==null&&(r={});const n=wo(e),i=ww(r),o=rs(n,i.salt,i.N,i.r,i.p,64);return Aw(de(o),i,t,r)}async function vw(t,e,r){r==null&&(r={});const n=wo(e),i=ww(r),o=await ts(n,i.salt,i.N,i.r,i.p,64,r.progressCallback);return Aw(de(o),i,t,r)}const kf="m/44'/60'/0'/0/0",vN=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Tn=2147483648,RN=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),TN="0123456789abcdef";function ka(t,e){let r="";for(;t;)r=TN[t%16]+r,t=Math.trunc(t/16);for(;r.length<e*2;)r="0"+r;return"0x"+r}function ch(t){const e=de(t),r=ot(xr(xr(e)),0,4),n=je([e,r]);return lx(n)}const Lr={};function Rw(t,e,r,n){const i=new Uint8Array(37);t&Tn?(ne(n!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),i.set(de(n),1)):i.set(de(r));for(let a=24;a>=0;a-=8)i[33+(a>>3)]=t>>24-a&255;const o=de(Xi("sha512",e,i));return{IL:o.slice(0,32),IR:o.slice(32)}}function Tw(t,e){const r=e.split("/");D(r.length>0,"invalid path","path",e),r[0]==="m"&&(D(t.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${t.depth}`,"path",e),r.shift());let n=t;for(let i=0;i<r.length;i++){const o=r[i];if(o.match(/^[0-9]+'$/)){const a=parseInt(o.substring(0,o.length-1));D(a<Tn,"invalid path index",`path[${i}]`,o),n=n.deriveChild(Tn+a)}else if(o.match(/^[0-9]+$/)){const a=parseInt(o);D(a<Tn,"invalid path index",`path[${i}]`,o),n=n.deriveChild(a)}else D(!1,"invalid path component",`path[${i}]`,o)}return n}class yr extends ac{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,r,n,i,o,a,u,l,h){super(r,h),ai(e,Lr,"HDNodeWallet"),Te(this,{publicKey:r.compressedPublicKey});const d=ot(es(xr(this.publicKey)),0,4);Te(this,{parentFingerprint:n,fingerprint:d,chainCode:i,path:o,index:a,depth:u}),Te(this,{mnemonic:l})}connect(e){return new yr(Lr,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,e)}#e(){const e={address:this.address,privateKey:this.privateKey},r=this.mnemonic;return this.path&&r&&r.wordlist.locale==="en"&&r.password===""&&(e.mnemonic={path:this.path,locale:"en",entropy:r.entropy}),e}async encrypt(e,r){return await vw(this.#e(),e,{progressCallback:r})}encryptSync(e){return Ew(this.#e(),e)}get extendedKey(){return ne(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),ch(je(["0x0488ADE4",ka(this.depth,1),this.parentFingerprint,ka(this.index,4),this.chainCode,je(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new no(Lr,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(e){const r=Ie(e,"index");D(r<=4294967295,"invalid index","index",r);let n=this.path;n&&(n+="/"+(r&~Tn),r&Tn&&(n+="'"));const{IR:i,IL:o}=Rw(r,this.chainCode,this.publicKey,this.privateKey),a=new Xt(nn((Ka(o)+BigInt(this.privateKey))%RN,32));return new yr(Lr,a,this.fingerprint,ae(i),n,r,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return Tw(this,e)}static#t(e,r){D(qa(e),"invalid seed","seed","[REDACTED]");const n=de(e,"seed");D(n.length>=16&&n.length<=64,"invalid seed","seed","[REDACTED]");const i=de(Xi("sha512",vN,n)),o=new Xt(ae(i.slice(0,32)));return new yr(Lr,o,"0x00000000",ae(i.slice(32)),"m",0,0,r,null)}static fromExtendedKey(e){const r=mt(uS(e));D(r.length===82||ch(r.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");const n=r[4],i=ae(r.slice(5,9)),o=parseInt(ae(r.slice(9,13)).substring(2),16),a=ae(r.slice(13,45)),u=r.slice(45,78);switch(ae(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const l=ae(u);return new no(Lr,mo(l),l,i,a,null,o,n,null)}case"0x0488ade4":case"0x04358394 ":if(u[0]!==0)break;return new yr(Lr,new Xt(u.slice(1)),i,a,null,o,n,null,null)}D(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(e,r,n){e==null&&(e=""),r==null&&(r=kf),n==null&&(n=ri.wordlist());const i=Zi.fromEntropy(Yr(16),e,n);return yr.#t(i.computeSeed(),i).derivePath(r)}static fromMnemonic(e,r){return r||(r=kf),yr.#t(e.computeSeed(),e).derivePath(r)}static fromPhrase(e,r,n,i){r==null&&(r=""),n==null&&(n=kf),i==null&&(i=ri.wordlist());const o=Zi.fromPhrase(e,r,i);return yr.#t(o.computeSeed(),o).derivePath(n)}static fromSeed(e){return yr.#t(e,null)}}class no extends a0{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,r,n,i,o,a,u,l,h){super(r,h),ai(e,Lr,"HDNodeVoidWallet"),Te(this,{publicKey:n});const d=ot(es(xr(n)),0,4);Te(this,{publicKey:n,fingerprint:d,parentFingerprint:i,chainCode:o,path:a,index:u,depth:l})}connect(e){return new no(Lr,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return ne(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),ch(je(["0x0488B21E",ka(this.depth,1),this.parentFingerprint,ka(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(e){const r=Ie(e,"index");D(r<=4294967295,"invalid index","index",r);let n=this.path;n&&(n+="/"+(r&~Tn),r&Tn&&(n+="'"));const{IR:i,IL:o}=Rw(r,this.chainCode,this.publicKey,null),a=Xt.addPoints(o,this.publicKey,!0),u=mo(a);return new no(Lr,u,a,this.fingerprint,ae(i),n,r,this.depth+1,this.provider)}derivePath(e){return Tw(this,e)}}function hy(t){try{if(JSON.parse(t).encseed)return!0}catch{}return!1}function dy(t,e){const r=JSON.parse(t),n=wo(e),i=Ve(At(r,"ethaddr:string!")),o=yw(At(r,"encseed:string!"));D(o&&o.length%16===0,"invalid encseed","json",t);const a=de(In(n,n,2e3,32,"sha256")).slice(0,16),u=o.slice(0,16),l=o.slice(16),h=new u0(a,u),d=xN(de(h.decrypt(l)));let m="";for(let y=0;y<d.length;y++)m+=String.fromCharCode(d[y]);return{address:i,privateKey:sn(m)}}function py(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}class Ds extends ac{constructor(e,r){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new Xt(e):e;super(n,r)}connect(e){return new Ds(this.signingKey,e)}async encrypt(e,r){const n={address:this.address,privateKey:this.privateKey};return await vw(n,e,{progressCallback:r})}encryptSync(e){const r={address:this.address,privateKey:this.privateKey};return Ew(r,e)}static#e(e){if(D(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){const n=Zi.fromEntropy(e.mnemonic.entropy),i=yr.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 r=new Ds(e.privateKey);return D(r.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),r}static async fromEncryptedJson(e,r,n){let i=null;return ly(e)?i=await EN(e,r,n):hy(e)&&(n&&(n(0),await py(0)),i=dy(e,r),n&&(n(1),await py(0))),Ds.#e(i)}static fromEncryptedJsonSync(e,r){let n=null;return ly(e)?n=AN(e,r):hy(e)?n=dy(e,r):D(!1,"invalid JSON wallet","json","[ REDACTED ]"),Ds.#e(n)}static createRandom(e){const r=yr.createRandom();return e?r.connect(e):r}static fromPhrase(e,r){const n=yr.fromPhrase(e);return r?n.connect(r):n}}export{PN as B,zs as C,ut as D,Vt as E,Gt as F,Pt as I,NN as J,Wn as M,IN as N,br as P,Oe as R,Sr as S,Zr as T,Ds as W,Ri as a,Fe as b,Ue as c,qr as d,et as e,Ai as f,Ve as g,Mt as h,sr as i,ON as j,eb as k,wb as l,na as m,I7 as n,gi as o,yi as p,Dr as q,Yr as r};