UNPKG

phala

Version:
11 lines 139 kB
import { createRequire } from 'module';const require = createRequire(import.meta.url); var Pi=Object.create;var Rn=Object.defineProperty;var Li=Object.getOwnPropertyDescriptor;var $i=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,zi=Object.prototype.hasOwnProperty;var Re=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var L=(e,t)=>()=>(e&&(t=e(e=0)),t);var ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ri=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $i(t))!zi.call(e,o)&&o!==r&&Rn(e,o,{get:()=>t[o],enumerable:!(n=Li(t,o))||n.enumerable});return e};var kt=(e,t,r)=>(r=e!=null?Pi(Bi(e)):{},Ri(t||!e||!e.__esModule?Rn(r,"default",{value:e,enumerable:!0}):r,e));var Un=ue((rm,jn)=>{var ot=1e3,st=ot*60,it=st*60,We=it*24,ji=We*7,Ui=We*365.25;jn.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Fi(e);if(r==="number"&&isFinite(e))return t.long?Oi(e):Hi(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Fi(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Ui;case"weeks":case"week":case"w":return r*ji;case"days":case"day":case"d":return r*We;case"hours":case"hour":case"hrs":case"hr":case"h":return r*it;case"minutes":case"minute":case"mins":case"min":case"m":return r*st;case"seconds":case"second":case"secs":case"sec":case"s":return r*ot;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Hi(e){var t=Math.abs(e);return t>=We?Math.round(e/We)+"d":t>=it?Math.round(e/it)+"h":t>=st?Math.round(e/st)+"m":t>=ot?Math.round(e/ot)+"s":e+"ms"}function Oi(e){var t=Math.abs(e);return t>=We?qt(e,t,We,"day"):t>=it?qt(e,t,it,"hour"):t>=st?qt(e,t,st,"minute"):t>=ot?qt(e,t,ot,"second"):e+" ms"}function qt(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}});var jr=ue((nm,Fn)=>{function Ni(e){r.debug=r,r.default=r,r.coerce=l,r.disable=i,r.enable=o,r.enabled=a,r.humanize=Un(),r.destroy=u,Object.keys(e).forEach(p=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let f=0;for(let h=0;h<p.length;h++)f=(f<<5)-f+p.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=t;function r(p){let f,h=null,g,_;function P(...B){if(!P.enabled)return;let G=P,J=Number(new Date),V=J-(f||J);G.diff=V,G.prev=f,G.curr=J,f=J,B[0]=r.coerce(B[0]),typeof B[0]!="string"&&B.unshift("%O");let Z=0;B[0]=B[0].replace(/%([a-zA-Z%])/g,(le,Dt)=>{if(le==="%%")return"%";Z++;let zn=r.formatters[Dt];if(typeof zn=="function"){let Ai=B[Z];le=zn.call(G,Ai),B.splice(Z,1),Z--}return le}),r.formatArgs.call(G,B),(G.log||r.log).apply(G,B)}return P.namespace=p,P.useColors=r.useColors(),P.color=r.selectColor(p),P.extend=n,P.destroy=r.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,_=r.enabled(p)),_),set:B=>{h=B}}),typeof r.init=="function"&&r.init(P),P}function n(p,f){let h=r(this.namespace+(typeof f>"u"?":":f)+p);return h.log=this.log,h}function o(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let f=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of f)h[0]==="-"?r.skips.push(h.slice(1)):r.names.push(h)}function s(p,f){let h=0,g=0,_=-1,P=0;for(;h<p.length;)if(g<f.length&&(f[g]===p[h]||f[g]==="*"))f[g]==="*"?(_=g,P=h,g++):(h++,g++);else if(_!==-1)g=_+1,P++,h=P;else return!1;for(;g<f.length&&f[g]==="*";)g++;return g===f.length}function i(){let p=[...r.names,...r.skips.map(f=>"-"+f)].join(",");return r.enable(""),p}function a(p){for(let f of r.skips)if(s(p,f))return!1;for(let f of r.names)if(s(p,f))return!0;return!1}function l(p){return p instanceof Error?p.stack||p.message:p}function u(){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 r.enable(r.load()),r}Fn.exports=Ni});var Hn=ue((ne,Mt)=>{ne.formatArgs=Di;ne.save=qi;ne.load=Mi;ne.useColors=Gi;ne.storage=Vi();ne.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})();ne.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 Gi(){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 e;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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Di(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Mt.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),e.splice(n,0,t)}ne.log=console.debug||console.log||(()=>{});function qi(e){try{e?ne.storage.setItem("debug",e):ne.storage.removeItem("debug")}catch{}}function Mi(){let e;try{e=ne.storage.getItem("debug")||ne.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Vi(){try{return localStorage}catch{}}Mt.exports=jr()(ne);var{formatters:Ki}=Mt.exports;Ki.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Nn=ue((D,Kt)=>{var Wi=Re("tty"),Vt=Re("util");D.init=ta;D.log=Yi;D.formatArgs=Ji;D.save=Qi;D.load=ea;D.useColors=Xi;D.destroy=Vt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");D.colors=[6,2,3,4,5,1];try{let e=Re("supports-color");e&&(e.stderr||e).level>=2&&(D.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}D.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function Xi(){return"colors"in D.inspectOpts?!!D.inspectOpts.colors:Wi.isatty(process.stderr.fd)}function Ji(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${t} \x1B[0m`;e[0]=s+e[0].split(` `).join(` `+s),e.push(o+"m+"+Kt.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Zi()+t+" "+e[0]}function Zi(){return D.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Yi(...e){return process.stderr.write(Vt.formatWithOptions(D.inspectOpts,...e)+` `)}function Qi(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function ea(){return process.env.DEBUG}function ta(e){e.inspectOpts={};let t=Object.keys(D.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=D.inspectOpts[t[r]]}Kt.exports=jr()(D);var{formatters:On}=Kt.exports;On.o=function(e){return this.inspectOpts.colors=this.useColors,Vt.inspect(e,this.inspectOpts).split(` `).map(t=>t.trim()).join(" ")};On.O=function(e){return this.inspectOpts.colors=this.useColors,Vt.inspect(e,this.inspectOpts)}});var Gn=ue((om,Ur)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ur.exports=Hn():Ur.exports=Nn()});var Fr,qn=L(()=>{Fr="2.38.6"});function Mn(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Mn(e.cause,t):t?null:e}var Hr,v,pe=L(()=>{qn();Hr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${Fr}`},v=class e extends Error{constructor(t,r={}){let n=r.cause instanceof e?r.cause.details:r.cause?.message?r.cause.message:r.details,o=r.cause instanceof e&&r.cause.docsPath||r.docsPath,s=Hr.getDocsUrl?.({...r,docsPath:o}),i=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...Hr.version?[`Version: ${Hr.version}`]:[]].join(` `);super(i,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=o,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=Fr}walk(t){return Mn(this,t)}}});var Wt,Xt,Or=L(()=>{pe();Wt=class extends v{constructor({max:t,min:r,signed:n,size:o,value:s}){super(`Number "${s}" is not in safe ${o?`${o*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},Xt=class extends v{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}});function we(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}var at=L(()=>{});function fe(e){return we(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var St=L(()=>{at()});function Et(e,{dir:t="left"}={}){let r=typeof e=="string"?e.replace("0x",""):e,n=0;for(let o=0;o<r.length-1&&r[t==="left"?o:r.length-o-1].toString()==="0";o++)n++;return r=t==="left"?r.slice(n):r.slice(0,r.length-n),typeof e=="string"?(r.length===1&&t==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}var Vn=L(()=>{});var Tt,It,Nr=L(()=>{pe();Tt=class extends v{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},It=class extends v{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}});function je(e,{dir:t,size:r=32}={}){return typeof e=="string"?ra(e,{dir:t,size:r}):na(e,{dir:t,size:r})}function ra(e,{dir:t,size:r=32}={}){if(r===null)return e;let n=e.replace("0x","");if(n.length>r*2)throw new It({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function na(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new It({size:e.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let o=0;o<r;o++){let s=t==="right";n[s?o:r-o-1]=e[s?o:e.length-o-1]}return n}var Gr=L(()=>{Nr()});function he(e,t={}){return typeof e=="number"||typeof e=="bigint"?S(e,t):typeof e=="string"?aa(e,t):typeof e=="boolean"?sa(e,t):oe(e,t)}function sa(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?(Ue(r,{size:t.size}),je(r,{size:t.size})):r}function oe(e,t={}){let r="";for(let o=0;o<e.length;o++)r+=oa[e[o]];let n=`0x${r}`;return typeof t.size=="number"?(Ue(n,{size:t.size}),je(n,{dir:"right",size:t.size})):n}function S(e,t={}){let{signed:r,size:n}=t,o=BigInt(e),s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));let i=typeof s=="bigint"&&r?-s-1n:0;if(s&&o>s||o<i){let l=typeof e=="bigint"?"n":"";throw new Wt({max:s?`${s}${l}`:void 0,min:`${i}${l}`,signed:r,size:n,value:`${e}${l}`})}let a=`0x${(r&&o<0?(1n<<BigInt(n*8))+BigInt(o):o).toString(16)}`;return n?je(a,{size:n}):a}function aa(e,t={}){let r=ia.encode(e);return oe(r,t)}var oa,ia,me=L(()=>{Or();Gr();Je();oa=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));ia=new TextEncoder});function Jt(e,t={}){return typeof e=="number"||typeof e=="bigint"?ua(e,t):typeof e=="boolean"?la(e,t):we(e)?ge(e,t):Dr(e,t)}function la(e,t={}){let r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(Ue(r,{size:t.size}),je(r,{size:t.size})):r}function Kn(e){if(e>=Le.zero&&e<=Le.nine)return e-Le.zero;if(e>=Le.A&&e<=Le.F)return e-(Le.A-10);if(e>=Le.a&&e<=Le.f)return e-(Le.a-10)}function ge(e,t={}){let r=e;t.size&&(Ue(r,{size:t.size}),r=je(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);let o=n.length/2,s=new Uint8Array(o);for(let i=0,a=0;i<o;i++){let l=Kn(n.charCodeAt(a++)),u=Kn(n.charCodeAt(a++));if(l===void 0||u===void 0)throw new v(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);s[i]=l*16+u}return s}function ua(e,t){let r=S(e,t);return ge(r)}function Dr(e,t={}){let r=ca.encode(e);return typeof t.size=="number"?(Ue(r,{size:t.size}),je(r,{dir:"right",size:t.size})):r}var ca,Le,Fe=L(()=>{pe();at();Gr();Je();me();ca=new TextEncoder;Le={zero:48,nine:57,A:65,F:70,a:97,f:102}});function Ue(e,{size:t}){if(fe(e)>t)throw new Xt({givenSize:fe(e),maxSize:t})}function Ze(e,t={}){let{signed:r}=t;t.size&&Ue(e,{size:t.size});let n=BigInt(e);if(!r)return n;let o=(e.length-2)/2,s=(1n<<BigInt(o)*8n-1n)-1n;return n<=s?n:n-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function Ye(e,t={}){return Number(Ze(e,t))}var Je=L(()=>{Or();St()});function ct(e,t){return({exclude:r,format:n})=>({exclude:r,format:(o,s)=>{let i=t(o,s);if(r)for(let a of r)delete i[a];return{...i,...n(o,s)}},type:e})}var Zt=L(()=>{});var Km,Wm,Xm,Jm,Zm,Ym,Qm,ed,td,rd,nd,od,sd,id,ad,cd,ld,ud,pd,fd,md,dd,hd,gd,xd,bd,yd,vd,wd,_d,Cd,kd,Sd,Ed,Td,Id,Ad,Pd,Ld,$d,Bd,zd,Rd,jd,Ud,Fd,Hd,Od,Nd,Gd,Dd,qd,Md,Vd,Kd,Wd,Xd,Jd,Zd,Yd,Qd,eh,th,rh,nh,oh,sh,ih,ah,ch,lh,uh,ph,fh,mh,dh,hh,gh,xh,bh,yh,vh,wh,_h,Ch,kh,Sh,Eh,Th,Ih,Ah,Ph,Lh,$h,Bh,Yt,Yn=L(()=>{Km=2n**(8n-1n)-1n,Wm=2n**(16n-1n)-1n,Xm=2n**(24n-1n)-1n,Jm=2n**(32n-1n)-1n,Zm=2n**(40n-1n)-1n,Ym=2n**(48n-1n)-1n,Qm=2n**(56n-1n)-1n,ed=2n**(64n-1n)-1n,td=2n**(72n-1n)-1n,rd=2n**(80n-1n)-1n,nd=2n**(88n-1n)-1n,od=2n**(96n-1n)-1n,sd=2n**(104n-1n)-1n,id=2n**(112n-1n)-1n,ad=2n**(120n-1n)-1n,cd=2n**(128n-1n)-1n,ld=2n**(136n-1n)-1n,ud=2n**(144n-1n)-1n,pd=2n**(152n-1n)-1n,fd=2n**(160n-1n)-1n,md=2n**(168n-1n)-1n,dd=2n**(176n-1n)-1n,hd=2n**(184n-1n)-1n,gd=2n**(192n-1n)-1n,xd=2n**(200n-1n)-1n,bd=2n**(208n-1n)-1n,yd=2n**(216n-1n)-1n,vd=2n**(224n-1n)-1n,wd=2n**(232n-1n)-1n,_d=2n**(240n-1n)-1n,Cd=2n**(248n-1n)-1n,kd=2n**(256n-1n)-1n,Sd=-(2n**(8n-1n)),Ed=-(2n**(16n-1n)),Td=-(2n**(24n-1n)),Id=-(2n**(32n-1n)),Ad=-(2n**(40n-1n)),Pd=-(2n**(48n-1n)),Ld=-(2n**(56n-1n)),$d=-(2n**(64n-1n)),Bd=-(2n**(72n-1n)),zd=-(2n**(80n-1n)),Rd=-(2n**(88n-1n)),jd=-(2n**(96n-1n)),Ud=-(2n**(104n-1n)),Fd=-(2n**(112n-1n)),Hd=-(2n**(120n-1n)),Od=-(2n**(128n-1n)),Nd=-(2n**(136n-1n)),Gd=-(2n**(144n-1n)),Dd=-(2n**(152n-1n)),qd=-(2n**(160n-1n)),Md=-(2n**(168n-1n)),Vd=-(2n**(176n-1n)),Kd=-(2n**(184n-1n)),Wd=-(2n**(192n-1n)),Xd=-(2n**(200n-1n)),Jd=-(2n**(208n-1n)),Zd=-(2n**(216n-1n)),Yd=-(2n**(224n-1n)),Qd=-(2n**(232n-1n)),eh=-(2n**(240n-1n)),th=-(2n**(248n-1n)),rh=-(2n**(256n-1n)),nh=2n**8n-1n,oh=2n**16n-1n,sh=2n**24n-1n,ih=2n**32n-1n,ah=2n**40n-1n,ch=2n**48n-1n,lh=2n**56n-1n,uh=2n**64n-1n,ph=2n**72n-1n,fh=2n**80n-1n,mh=2n**88n-1n,dh=2n**96n-1n,hh=2n**104n-1n,gh=2n**112n-1n,xh=2n**120n-1n,bh=2n**128n-1n,yh=2n**136n-1n,vh=2n**144n-1n,wh=2n**152n-1n,_h=2n**160n-1n,Ch=2n**168n-1n,kh=2n**176n-1n,Sh=2n**184n-1n,Eh=2n**192n-1n,Th=2n**200n-1n,Ih=2n**208n-1n,Ah=2n**216n-1n,Ph=2n**224n-1n,Lh=2n**232n-1n,$h=2n**240n-1n,Bh=2n**248n-1n,Yt=2n**256n-1n});function Qe(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}var Mr=L(()=>{});var Pt,Qt,er,Qn=L(()=>{pe();Pt=class extends v{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},Qt=class extends v{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},er=class extends v{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}});function tr(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(ha);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}var ha,Vr=L(()=>{Qn();ha={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new er({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Qt({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Pt({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Pt({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}}});var ro,no=L(()=>{ro={ether:-9,wei:9}});function oo(e,t){let r=e.toString(),n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(t,"0");let[o,s]=[r.slice(0,r.length-t),r.slice(r.length-t)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${o||"0"}${s?`.${s}`:""}`}var so=L(()=>{});function Lt(e,t="wei"){return oo(e,ro[t])}var io=L(()=>{no();so()});function ba(e){let t=Object.entries(e).map(([n,o])=>o===void 0||o===!1?null:[n,o]).filter(Boolean),r=t.reduce((n,[o])=>Math.max(n,o.length),0);return t.map(([n,o])=>` ${`${n}:`.padEnd(r+1)} ${o}`).join(` `)}var rr,nr,or,sr=L(()=>{pe();rr=class extends v{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}},nr=class extends v{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",ba(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}},or=class extends v{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}});function ya(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Kr(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function et(e,...t){if(!ya(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function pt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function cr(e,t){et(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function co(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function He(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function lr(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function xe(e,t){return e<<32-t|e>>>t}function wa(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function _a(e){for(let t=0;t<e.length;t++)e[t]=wa(e[t]);return e}function Ca(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function $t(e){return typeof e=="string"&&(e=Ca(e)),et(e),e}function ur(e){let t=n=>e().update($t(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}var va,Wr,ut,pr=L(()=>{va=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;Wr=va?e=>e:_a;ut=class{}});function Sa(e,t=!1){return t?{h:Number(e&mr),l:Number(e>>po&mr)}:{h:Number(e>>po&mr)|0,l:Number(e&mr)|0}}function fo(e,t=!1){let r=e.length,n=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s<r;s++){let{h:i,l:a}=Sa(e[s],t);[n[s],o[s]]=[i,a]}return[n,o]}var mr,po,mo,ho,go,xo,bo=L(()=>{mr=BigInt(4294967295),po=BigInt(32);mo=(e,t,r)=>e<<r|t>>>32-r,ho=(e,t,r)=>t<<r|e>>>32-r,go=(e,t,r)=>t<<r-32|e>>>64-r,xo=(e,t,r)=>e<<r-32|t>>>64-r});var de,br=L(()=>{pe();de=class extends v{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var tt,Eo=L(()=>{pe();tt=class extends v{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}});var yr,rt,Xr,Jr,Zr,Yr,Qr,en,tn,rn,Bt,To=L(()=>{io();pe();yr=class extends v{constructor({cause:t,message:r}={}){let n=r?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}};Object.defineProperty(yr,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(yr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});rt=class extends v{constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Lt(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}};Object.defineProperty(rt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});Xr=class extends v{constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Lt(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}};Object.defineProperty(Xr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});Jr=class extends v{constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}};Object.defineProperty(Jr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});Zr=class extends v{constructor({cause:t,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` `),{cause:t,name:"NonceTooLowError"})}};Object.defineProperty(Zr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});Yr=class extends v{constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}};Object.defineProperty(Yr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});Qr=class extends v{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` `),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};Object.defineProperty(Qr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});en=class extends v{constructor({cause:t,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(en,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});tn=class extends v{constructor({cause:t,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(tn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});rn=class extends v{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty(rn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});Bt=class extends v{constructor({cause:t,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${Lt(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Lt(n)} gwei`:""}).`].join(` `),{cause:t,name:"TipAboveFeeCapError"})}};Object.defineProperty(Bt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/})});var mt,nn=L(()=>{mt=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let n=this.keys().next().value;n&&this.delete(n)}return this}}});function ja(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let i=0;i<10;i++)r[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){let a=(i+8)%10,l=(i+2)%10,u=r[l],p=r[l+1],f=Io(u,p,1)^r[a],h=Ao(u,p,1)^r[a+1];for(let g=0;g<50;g+=10)e[i+g]^=f,e[i+g+1]^=h}let o=e[2],s=e[3];for(let i=0;i<24;i++){let a=Lo[i],l=Io(o,s,a),u=Ao(o,s,a),p=Po[i];o=e[p],s=e[p+1],e[p]=l,e[p+1]=u}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)r[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=za[n],e[1]^=Ra[n]}He(r)}var Aa,zt,Pa,La,$a,Ba,Po,Lo,$o,Bo,za,Ra,Io,Ao,on,Ua,zo,Ro=L(()=>{bo();pr();Aa=BigInt(0),zt=BigInt(1),Pa=BigInt(2),La=BigInt(7),$a=BigInt(256),Ba=BigInt(113),Po=[],Lo=[],$o=[];for(let e=0,t=zt,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Po.push(2*(5*n+r)),Lo.push((e+1)*(e+2)/2%64);let o=Aa;for(let s=0;s<7;s++)t=(t<<zt^(t>>La)*Ba)%$a,t&Pa&&(o^=zt<<(zt<<BigInt(s))-zt);$o.push(o)}Bo=fo($o,!0),za=Bo[0],Ra=Bo[1],Io=(e,t,r)=>r>32?go(e,t,r):mo(e,t,r),Ao=(e,t,r)=>r>32?xo(e,t,r):ho(e,t,r);on=class e extends ut{constructor(t,r,n,o=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=s,Kr(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=co(this.state)}clone(){return this._cloneInto()}keccak(){Wr(this.state32),ja(this.state32,this.rounds),Wr(this.state32),this.posOut=0,this.pos=0}update(t){pt(this),t=$t(t),et(t);let{blockLen:r,state:n}=this,o=t.length;for(let s=0;s<o;){let i=Math.min(r-this.pos,o-s);for(let a=0;a<i;a++)n[this.pos++]^=t[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){pt(this,!1),et(t),this.finish();let r=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let i=Math.min(n-this.posOut,s-o);t.set(r.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Kr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(cr(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,He(this.state)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new e(r,n,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}},Ua=(e,t,r)=>ur(()=>new on(t,e,r)),zo=Ua(1,136,256/8)});function jo(e,t){let r=t||"hex",n=zo(we(e,{strict:!1})?Jt(e):e);return r==="bytes"?n:he(n)}var Uo=L(()=>{Ro();at();Fe();me()});function Fo(e,t){if(sn.has(`${e}.${t}`))return sn.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=jo(Dr(r),"bytes"),o=(t?r.substring(`${t}0x`.length):r).split("");for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&o[i]&&(o[i]=o[i].toUpperCase()),(n[i>>1]&15)>=8&&o[i+1]&&(o[i+1]=o[i+1].toUpperCase());let s=`0x${o.join("")}`;return sn.set(`${e}.${t}`,s),s}var sn,Ho=L(()=>{Fe();Uo();nn();sn=new mt(8192)});function _e(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(an.has(n))return an.get(n);let o=Fa.test(e)?e.toLowerCase()===e?!0:r?Fo(e)===e:!0:!1;return an.set(n,o),o}var Fa,an,vr=L(()=>{nn();Ho();Fa=/^0x[a-fA-F0-9]{40}$/,an=new mt(8192)});function Oo(e,t,r,{strict:n}={}){return we(e,{strict:!1})?Oa(e,t,r,{strict:n}):Ha(e,t,r,{strict:n})}function No(e,t){if(typeof t=="number"&&t>0&&t>fe(e)-1)throw new Tt({offset:t,position:"start",size:fe(e)})}function Go(e,t,r){if(typeof t=="number"&&typeof r=="number"&&fe(e)!==r-t)throw new Tt({offset:r,position:"end",size:fe(e)})}function Ha(e,t,r,{strict:n}={}){No(e,t);let o=e.slice(t,r);return n&&Go(o,t,r),o}function Oa(e,t,r,{strict:n}={}){No(e,t);let o=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&Go(o,t,r),o}var Do=L(()=>{Nr();at();St()});var pn=ue(Ft=>{"use strict";var Za=Ft&&Ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.encryptEnvVars=ec;var ln=Re("@noble/curves/ed25519"),un=Za(Re("crypto"));function Ya(e){var t,r;return e=e.startsWith("0x")?e.slice(2):e,new Uint8Array((r=(t=e.match(/.{1,2}/g))===null||t===void 0?void 0:t.map(n=>parseInt(n,16)))!==null&&r!==void 0?r:[])}function Qa(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}async function ec(e,t){let r=JSON.stringify({env:e}),n=ln.x25519.utils.randomPrivateKey(),o=ln.x25519.getPublicKey(n),s=Ya(t),i=ln.x25519.getSharedSecret(n,s),a=await un.default.subtle.importKey("raw",i,{name:"AES-GCM",length:256},!0,["encrypt"]),l=un.default.getRandomValues(new Uint8Array(12)),u=await un.default.subtle.encrypt({name:"AES-GCM",iv:l},a,new TextEncoder().encode(r)),p=new Uint8Array(o.length+l.length+u.byteLength);return p.set(o),p.set(l,o.length),p.set(new Uint8Array(u),o.length+l.length),Qa(p)}});var Qo=ue(Ht=>{"use strict";var tc=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.getComposeHash=sc;var rc=tc(Re("crypto"));function fn(e){return e==null?e:Array.isArray(e)?e.map(fn):e&&typeof e=="object"&&e.constructor===Object?Object.keys(e).sort().reduce((t,r)=>{let n=e[r];return t[r]=fn(n),t},{}):e}function nc(e){let t={...e};return t.runner==="bash"&&"docker_compose_file"in t?delete t.docker_compose_file:t.runner==="docker-compose"&&"bash_script"in t&&delete t.bash_script,"pre_launch_script"in t&&!t.pre_launch_script&&delete t.pre_launch_script,t}function oc(e){let t=fn(e);return JSON.stringify(t,(r,n)=>typeof n=="number"&&(isNaN(n)||!isFinite(n))?null:n)}function sc(e,t=!1){t&&(e=nc(e));let r=oc(e);return rc.default.createHash("sha256").update(r,"utf8").digest("hex")}});var ws=ue(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.toBig=w.shrSL=w.shrSH=w.rotrSL=w.rotrSH=w.rotrBL=w.rotrBH=w.rotr32L=w.rotr32H=w.rotlSL=w.rotlSH=w.rotlBL=w.rotlBH=w.add5L=w.add5H=w.add4L=w.add4H=w.add3L=w.add3H=void 0;w.add=ds;w.fromBig=dn;w.split=es;var kr=BigInt(2**32-1),mn=BigInt(32);function dn(e,t=!1){return t?{h:Number(e&kr),l:Number(e>>mn&kr)}:{h:Number(e>>mn&kr)|0,l:Number(e&kr)|0}}function es(e,t=!1){let r=e.length,n=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s<r;s++){let{h:i,l:a}=dn(e[s],t);[n[s],o[s]]=[i,a]}return[n,o]}var ts=(e,t)=>BigInt(e>>>0)<<mn|BigInt(t>>>0);w.toBig=ts;var rs=(e,t,r)=>e>>>r;w.shrSH=rs;var ns=(e,t,r)=>e<<32-r|t>>>r;w.shrSL=ns;var os=(e,t,r)=>e>>>r|t<<32-r;w.rotrSH=os;var ss=(e,t,r)=>e<<32-r|t>>>r;w.rotrSL=ss;var is=(e,t,r)=>e<<64-r|t>>>r-32;w.rotrBH=is;var as=(e,t,r)=>e>>>r-32|t<<64-r;w.rotrBL=as;var cs=(e,t)=>t;w.rotr32H=cs;var ls=(e,t)=>e;w.rotr32L=ls;var us=(e,t,r)=>e<<r|t>>>32-r;w.rotlSH=us;var ps=(e,t,r)=>t<<r|e>>>32-r;w.rotlSL=ps;var fs=(e,t,r)=>t<<r-32|e>>>64-r;w.rotlBH=fs;var ms=(e,t,r)=>e<<r-32|t>>>64-r;w.rotlBL=ms;function ds(e,t,r,n){let o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}var hs=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);w.add3L=hs;var gs=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;w.add3H=gs;var xs=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);w.add4L=xs;var bs=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0;w.add4H=bs;var ys=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0);w.add5L=ys;var vs=(e,t,r,n,o,s)=>t+r+n+o+s+(e/2**32|0)|0;w.add5H=vs;var ic={fromBig:dn,split:es,toBig:ts,shrSH:rs,shrSL:ns,rotrSH:os,rotrSL:ss,rotrBH:is,rotrBL:as,rotr32H:cs,rotr32L:ls,rotlSH:us,rotlSL:ps,rotlBH:fs,rotlBL:ms,add:ds,add3L:hs,add3H:gs,add4L:xs,add4H:bs,add5H:vs,add5L:ys};w.default=ic});var _s=ue(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.crypto=void 0;var Ne=Re("crypto");Sr.crypto=Ne&&typeof Ne=="object"&&"webcrypto"in Ne?Ne.webcrypto:Ne&&typeof Ne=="object"&&"randomBytes"in Ne?Ne:void 0});var Ps=ue(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.wrapXOFConstructorWithOpts=b.wrapConstructorWithOpts=b.wrapConstructor=b.Hash=b.nextTick=b.swap32IfBE=b.byteSwapIfBE=b.swap8IfBE=b.isLE=void 0;b.isBytes=ks;b.anumber=hn;b.abytes=ht;b.ahash=ac;b.aexists=cc;b.aoutput=lc;b.u8=uc;b.u32=pc;b.clean=fc;b.createView=mc;b.rotr=dc;b.rotl=hc;b.byteSwap=xn;b.byteSwap32=Ss;b.bytesToHex=xc;b.hexToBytes=bc;b.asyncLoop=vc;b.utf8ToBytes=bn;b.bytesToUtf8=wc;b.toBytes=Er;b.kdfInputToBytes=_c;b.concatBytes=Cc;b.checkOpts=kc;b.createHasher=Ts;b.createOptHasher=Is;b.createXOFer=As;b.randomBytes=Sc;var dt=_s();function ks(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function hn(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function ht(e,...t){if(!ks(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function ac(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");hn(e.outputLen),hn(e.blockLen)}function cc(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function lc(e,t){ht(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function uc(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function pc(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function fc(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function mc(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function dc(e,t){return e<<32-t|e>>>t}function hc(e,t){return e<<t|e>>>32-t>>>0}b.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function xn(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}b.swap8IfBE=b.isLE?e=>e:e=>xn(e);b.byteSwapIfBE=b.swap8IfBE;function Ss(e){for(let t=0;t<e.length;t++)e[t]=xn(e[t]);return e}b.swap32IfBE=b.isLE?e=>e:Ss;var Es=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",gc=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function xc(e){if(ht(e),Es)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=gc[e[r]];return t}var ze={_0:48,_9:57,A:65,F:70,a:97,f:102};function Cs(e){if(e>=ze._0&&e<=ze._9)return e-ze._0;if(e>=ze.A&&e<=ze.F)return e-(ze.A-10);if(e>=ze.a&&e<=ze.f)return e-(ze.a-10)}function bc(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Es)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let o=0,s=0;o<r;o++,s+=2){let i=Cs(e.charCodeAt(s)),a=Cs(e.charCodeAt(s+1));if(i===void 0||a===void 0){let l=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+s)}n[o]=i*16+a}return n}var yc=async()=>{};b.nextTick=yc;async function vc(e,t,r){let n=Date.now();for(let o=0;o<e;o++){r(o);let s=Date.now()-n;s>=0&&s<t||(await(0,b.nextTick)(),n+=s)}}function bn(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function wc(e){return new TextDecoder().decode(e)}function Er(e){return typeof e=="string"&&(e=bn(e)),ht(e),e}function _c(e){return typeof e=="string"&&(e=bn(e)),ht(e),e}function Cc(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];ht(o),t+=o.length}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let s=e[n];r.set(s,o),o+=s.length}return r}function kc(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(e,t)}var gn=class{};b.Hash=gn;function Ts(e){let t=n=>e().update(Er(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Is(e){let t=(n,o)=>e(o).update(Er(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function As(e){let t=(n,o)=>e(o).update(Er(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}b.wrapConstructor=Ts;b.wrapConstructorWithOpts=Is;b.wrapXOFConstructorWithOpts=As;function Sc(e=32){if(dt.crypto&&typeof dt.crypto.getRandomValues=="function")return dt.crypto.getRandomValues(new Uint8Array(e));if(dt.crypto&&typeof dt.crypto.randomBytes=="function")return Uint8Array.from(dt.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}});var Hs=ue(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.shake256=R.shake128=R.keccak_512=R.keccak_384=R.keccak_256=R.keccak_224=R.sha3_512=R.sha3_384=R.sha3_256=R.sha3_224=R.Keccak=void 0;R.keccakP=Us;var Nt=ws(),K=Ps(),Ec=BigInt(0),Ot=BigInt(1),Tc=BigInt(2),Ic=BigInt(7),Ac=BigInt(256),Pc=BigInt(113),Bs=[],zs=[],Rs=[];for(let e=0,t=Ot,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Bs.push(2*(5*n+r)),zs.push((e+1)*(e+2)/2%64);let o=Ec;for(let s=0;s<7;s++)t=(t<<Ot^(t>>Ic)*Pc)%Ac,t&Tc&&(o^=Ot<<(Ot<<BigInt(s))-Ot);Rs.push(o)}var js=(0,Nt.split)(Rs,!0),Lc=js[0],$c=js[1],Ls=(e,t,r)=>r>32?(0,Nt.rotlBH)(e,t,r):(0,Nt.rotlSH)(e,t,r),$s=(e,t,r)=>r>32?(0,Nt.rotlBL)(e,t,r):(0,Nt.rotlSL)(e,t,r);function Us(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let i=0;i<10;i++)r[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){let a=(i+8)%10,l=(i+2)%10,u=r[l],p=r[l+1],f=Ls(u,p,1)^r[a],h=$s(u,p,1)^r[a+1];for(let g=0;g<50;g+=10)e[i+g]^=f,e[i+g+1]^=h}let o=e[2],s=e[3];for(let i=0;i<24;i++){let a=zs[i],l=Ls(o,s,a),u=$s(o,s,a),p=Bs[i];o=e[p],s=e[p+1],e[p]=l,e[p+1]=u}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)r[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=Lc[n],e[1]^=$c[n]}(0,K.clean)(r)}var Gt=class e extends K.Hash{constructor(t,r,n,o=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=s,(0,K.anumber)(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,K.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,K.swap32IfBE)(this.state32),Us(this.state32,this.rounds),(0,K.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(t){(0,K.aexists)(this),t=(0,K.toBytes)(t),(0,K.abytes)(t);let{blockLen:r,state:n}=this,o=t.length;for(let s=0;s<o;){let i=Math.min(r-this.pos,o-s);for(let a=0;a<i;a++)n[this.pos++]^=t[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){(0,K.aexists)(this,!1),(0,K.abytes)(t),this.finish();let r=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let i=Math.min(n-this.posOut,s-o);t.set(r.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,K.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,K.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,K.clean)(this.state)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new e(r,n,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}};R.Keccak=Gt;var Ge=(e,t,r)=>(0,K.createHasher)(()=>new Gt(t,e,r));R.sha3_224=Ge(6,144,224/8);R.sha3_256=Ge(6,136,256/8);R.sha3_384=Ge(6,104,384/8);R.sha3_512=Ge(6,72,512/8);R.keccak_224=Ge(1,144,224/8);R.keccak_256=Ge(1,136,256/8);R.keccak_384=Ge(1,104,384/8);R.keccak_512=Ge(1,72,512/8);var Fs=(e,t,r)=>(0,K.createXOFer)((n={})=>new Gt(t,e,n.dkLen===void 0?r:n.dkLen,!0));R.shake128=Fs(31,168,128/8);R.shake256=Fs(31,136,256/8)});var Os=ue(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.verifyEnvEncryptPublicKey=Rc;var Bc=Hs(),zc=Re("@noble/curves/secp256k1");function Rc(e,t,r){if(t.length!==65)return null;let n=Buffer.from("dstack-env-encrypt-pubkey","utf8"),o=r;r.startsWith("0x")&&(o=r.slice(2));let s=Buffer.from(o,"hex"),i=Buffer.from(":","utf8"),a=Buffer.concat([n,i,s,Buffer.from(e)]),l=(0,Bc.keccak_256)(a);try{let u=t.slice(0,32),p=t.slice(32,64),f=t[64],h=new Uint8Array(64);h.set(u,0),h.set(p,32);let g=zc.secp256k1.Signature.fromCompact(h).addRecoveryBit(f).recoverPublicKey(l);return"0x"+Buffer.from(g.toRawBytes(!0)).toString("hex")}catch(u){return console.error("signature verification failed:",u),null}}});var Ws=kt(Gn(),1);import{ofetch as jc}from"ofetch";function Dn(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(o){o(r)}),(n=e.get("*"))&&n.slice().map(function(o){o(t,r)})}}}import{z as q}from"zod";import{z as j}from"zod";import{z as De}from"zod";import{z as k}from"zod";import{z as qe}from"zod";function Xe(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}Zt();Je();Zt();var qr={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function At(e,t){let r={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Ye(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?Ye(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?qr[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(r.authorizationList=pa(e.authorizationList)),r.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof r.v=="bigint"){if(r.v===0n||r.v===27n)return 0;if(r.v===1n||r.v===28n)return 1;if(r.v>=35n)return r.v%2n===0n?1:0}})(),r.type==="legacy"&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),r.type==="eip2930"&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),r.type==="eip1559"&&delete r.maxFeePerBlobGas,r}var Wn=ct("transaction",At);function pa(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function fa(e,t){let r=(e.transactions??[]).map(n=>typeof n=="string"?n:At(n));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:r,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}var Xn=ct("block",fa);function Jn(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}Je();Zt();var ma={"0x0":"reverted","0x1":"success"};function da(e,t){let r={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress: