browser-evm-signer 0.1.0

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,46 @@
1
+ var ja=Object.defineProperty;var _i=e=>{throw TypeError(e)};var $a=(e,t,n)=>t in e?ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ve=(e,t,n)=>$a(e,typeof t!="symbol"?t+"":t,n),Xr=(e,t,n)=>t.has(e)||_i("Cannot "+n);var h=(e,t,n)=>(Xr(e,t,"read from private field"),n?n.call(e):t.get(e)),M=(e,t,n)=>t.has(e)?_i("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),F=(e,t,n,r)=>(Xr(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),we=(e,t,n)=>(Xr(e,t,"access private method"),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const Da="5";var Zi;typeof window<"u"&&((Zi=window.__svelte??(window.__svelte={})).v??(Zi.v=new Set)).add(Da);const Ha=1,Va=2,pe=Symbol(),Wa=Symbol("filename"),Ka="http://www.w3.org/1999/xhtml";var Qi,eo;const xi=(eo=(Qi=globalThis.process)==null?void 0:Qi.env)==null?void 0:eo.NODE_ENV,P=xi&&!xi.toLowerCase().startsWith("prod");var Ya=Array.isArray,Xa=Array.prototype.indexOf,Nt=Array.prototype.includes,Ja=Array.from,jt=Object.defineProperty,rn=Object.getOwnPropertyDescriptor,Za=Object.getOwnPropertyDescriptors,Qa=Object.prototype,ec=Array.prototype,to=Object.getPrototypeOf,Pi=Object.isExtensible;function tc(e){for(var t=0;t<e.length;t++)e[t]()}function no(){var e,t,n=new Promise((r,s)=>{e=r,t=s});return{promise:n,resolve:e,reject:t}}const ge=2,as=4,Or=8,ro=1<<24,dt=16,rt=32,Wt=64,zs=128,Me=512,fe=1024,ye=2048,De=4096,tt=8192,wt=16384,qs=32768,vn=65536,Er=1<<17,so=1<<18,Pn=1<<19,nc=1<<20,At=32768,cs=1<<21,Lr=1<<22,_t=1<<23,Bn=Symbol("$state"),rc=Symbol(""),io=Symbol("proxy path"),Qt=new class extends Error{constructor(){super(...arguments);Ve(this,"name","StaleReactionError");Ve(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function oo(e){if(P){const t=new Error(`lifecycle_outside_component
2
+ \`${e}(...)\` can only be used during component initialisation
3
+ https://svelte.dev/e/lifecycle_outside_component`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function sc(){if(P){const e=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function ic(){if(P){const e=new Error(`derived_references_self
4
+ A derived value cannot reference itself recursively
5
+ https://svelte.dev/e/derived_references_self`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/derived_references_self")}function oc(e){if(P){const t=new Error(`effect_in_teardown
6
+ \`${e}\` cannot be used inside an effect cleanup function
7
+ https://svelte.dev/e/effect_in_teardown`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function ac(){if(P){const e=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function cc(e){if(P){const t=new Error(`effect_orphan
8
+ \`${e}\` can only be used inside an effect (e.g. during component initialisation)
9
+ https://svelte.dev/e/effect_orphan`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function uc(){if(P){const e=new Error(`effect_update_depth_exceeded
10
+ Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
11
+ https://svelte.dev/e/effect_update_depth_exceeded`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function lc(e){if(P){const t=new Error(`rune_outside_svelte
12
+ The \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
13
+ https://svelte.dev/e/rune_outside_svelte`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function fc(){if(P){const e=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function dc(){if(P){const e=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function hc(){if(P){const e=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function pc(){if(P){const e=new Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var ao="font-weight: bold",co="font-weight: normal";function Jr(e){P?console.warn(`%c[svelte] state_proxy_equality_mismatch
14
+ %cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${e}\` will produce unexpected results
15
+ https://svelte.dev/e/state_proxy_equality_mismatch`,ao,co):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function vc(){P?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",ao,co):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function uo(e){return e===this.v}let mc=!1;function Ke(e,t){return e.label=t,lo(e.v,t),e}function lo(e,t){var n;return(n=e==null?void 0:e[io])==null||n.call(e,t),e}function gc(e){const t=new Error,n=yc();return n.length===0?null:(n.unshift(`
16
+ `),jt(t,"stack",{value:n.join(`
17
+ `)}),jt(t,"name",{value:e}),t)}function yc(){const e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;const t=new Error().stack;if(Error.stackTraceLimit=e,!t)return[];const n=t.split(`
18
+ `),r=[];for(let s=0;s<n.length;s++){const i=n[s],o=i.replaceAll("\\","/");if(i.trim()!=="Error"){if(i.includes("validate_each_keys"))return[];o.includes("svelte/src/internal")||o.includes("node_modules/.vite")||r.push(i)}}return r}let le=null;function mn(e){le=e}let zn=null;function Ar(e){zn=e}let rr=null;function Ei(e){rr=e}function sr(e,t=!1,n){le={p:le,i:!1,c:null,e:null,s:e,x:null,l:null},P&&(le.function=n,rr=n)}function ir(e){var t=le,n=t.e;if(n!==null){t.e=null;for(var r of n)Co(r)}return t.i=!0,le=t.p,P&&(rr=(le==null?void 0:le.function)??null),{}}function fo(){return!0}let en=[];function bc(){var e=en;en=[],tc(e)}function sn(e){if(en.length===0){var t=en;queueMicrotask(()=>{t===en&&bc()})}en.push(e)}const us=new WeakMap;function ho(e){var t=W;if(t===null)return L.f|=_t,e;if(P&&e instanceof Error&&!us.has(e)&&us.set(e,wc(e,t)),(t.f&qs)===0){if((t.f&zs)===0)throw P&&!t.parent&&e instanceof Error&&po(e),e;t.b.error(e)}else gn(e,t)}function gn(e,t){for(;t!==null;){if((t.f&zs)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw P&&e instanceof Error&&po(e),e}function wc(e,t){var o,a,c;const n=rn(e,"message");if(!(n&&!n.configurable)){for(var r=Us?" ":" ",s=`
19
+ ${r}in ${((o=t.fn)==null?void 0:o.name)||"<unknown>"}`,i=t.ctx;i!==null;)s+=`
20
+ ${r}in ${(a=i.function)==null?void 0:a[Wa].split("/").pop()}`,i=i.p;return{message:e.message+`
21
+ ${s}
22
+ `,stack:(c=e.stack)==null?void 0:c.split(`
23
+ `).filter(u=>!u.includes("svelte/src/internal")).join(`
24
+ `)}}}function po(e){const t=us.get(e);t&&(jt(e,"message",{value:t.message}),jt(e,"stack",{value:t.stack}))}const _c=-7169;function re(e,t){e.f=e.f&_c|t}function Ms(e){(e.f&Me)!==0||e.deps===null?re(e,fe):re(e,De)}function vo(e){if(e!==null)for(const t of e)(t.f&ge)===0||(t.f&At)===0||(t.f^=At,vo(t.deps))}function mo(e,t,n){(e.f&ye)!==0?t.add(e):(e.f&De)!==0&&n.add(e),vo(e.deps),re(e,fe)}const hr=new Set;let K=null,ve=null,qe=[],Os=null,ls=!1;var cn,un,zt,ln,Qn,er,qt,at,fn,nt,fs,ds,go;const bi=class bi{constructor(){M(this,nt);Ve(this,"committed",!1);Ve(this,"current",new Map);Ve(this,"previous",new Map);M(this,cn,new Set);M(this,un,new Set);M(this,zt,0);M(this,ln,0);M(this,Qn,null);M(this,er,new Set);M(this,qt,new Set);M(this,at,new Map);Ve(this,"is_fork",!1);M(this,fn,!1)}is_deferred(){return this.is_fork||h(this,ln)>0}skip_effect(t){h(this,at).has(t)||h(this,at).set(t,{d:[],m:[]})}unskip_effect(t){var n=h(this,at).get(t);if(n){h(this,at).delete(t);for(var r of n.d)re(r,ye),Re(r);for(r of n.m)re(r,De),Re(r)}}process(t){var s;qe=[],this.apply();var n=[],r=[];for(const i of t)we(this,nt,fs).call(this,i,n,r);if(this.is_deferred()){we(this,nt,ds).call(this,r),we(this,nt,ds).call(this,n);for(const[i,o]of h(this,at))wo(i,o)}else{for(const i of h(this,cn))i();h(this,cn).clear(),h(this,zt)===0&&we(this,nt,go).call(this),K=null,Ai(r),Ai(n),(s=h(this,Qn))==null||s.resolve()}ve=null}capture(t,n){n!==pe&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&_t)===0&&(this.current.set(t,t.v),ve==null||ve.set(t,t.v))}activate(){K=this,this.apply()}deactivate(){K===this&&(K=null,ve=null)}flush(){if(this.activate(),qe.length>0){if(xc(),K!==null&&K!==this)return}else h(this,zt)===0&&this.process([]);this.deactivate()}discard(){for(const t of h(this,un))t(this);h(this,un).clear()}increment(t){F(this,zt,h(this,zt)+1),t&&F(this,ln,h(this,ln)+1)}decrement(t){F(this,zt,h(this,zt)-1),t&&F(this,ln,h(this,ln)-1),!h(this,fn)&&(F(this,fn,!0),sn(()=>{F(this,fn,!1),this.is_deferred()?qe.length>0&&this.flush():this.revive()}))}revive(){for(const t of h(this,er))h(this,qt).delete(t),re(t,ye),Re(t);for(const t of h(this,qt))re(t,De),Re(t);this.flush()}oncommit(t){h(this,cn).add(t)}ondiscard(t){h(this,un).add(t)}settled(){return(h(this,Qn)??F(this,Qn,no())).promise}static ensure(){if(K===null){const t=K=new bi;hr.add(K),sn(()=>{K===t&&t.flush()})}return K}apply(){}};cn=new WeakMap,un=new WeakMap,zt=new WeakMap,ln=new WeakMap,Qn=new WeakMap,er=new WeakMap,qt=new WeakMap,at=new WeakMap,fn=new WeakMap,nt=new WeakSet,fs=function(t,n,r){t.f^=fe;for(var s=t.first,i=null;s!==null;){var o=s.f,a=(o&(rt|Wt))!==0,c=a&&(o&fe)!==0,u=c||(o&tt)!==0||h(this,at).has(s);if(!u&&s.fn!==null){a?s.f^=fe:i!==null&&(o&(as|Or|ro))!==0?i.b.defer_effect(s):(o&as)!==0?n.push(s):or(s)&&((o&dt)!==0&&h(this,qt).add(s),qn(s));var f=s.first;if(f!==null){s=f;continue}}var l=s.parent;for(s=s.next;s===null&&l!==null;)l===i&&(i=null),s=l.next,l=l.parent}},ds=function(t){for(var n=0;n<t.length;n+=1)mo(t[n],h(this,er),h(this,qt))},go=function(){var s;if(hr.size>1){this.previous.clear();var t=ve,n=!0;for(const i of hr){if(i===this){n=!1;continue}const o=[];for(const[c,u]of this.current){if(i.current.has(c))if(n&&u!==i.current.get(c))i.current.set(c,u);else continue;o.push(c)}if(o.length===0)continue;const a=[...i.current.keys()].filter(c=>!this.current.has(c));if(a.length>0){var r=qe;qe=[];const c=new Set,u=new Map;for(const f of o)yo(f,a,c,u);if(qe.length>0){K=i,i.apply();for(const f of qe)we(s=i,nt,fs).call(s,f,[],[]);i.deactivate()}qe=r}}K=null,ve=t}this.committed=!0,hr.delete(this)};let xt=bi;function xc(){ls=!0;var e=P?new Set:null;try{for(var t=0;qe.length>0;){var n=xt.ensure();if(t++>1e3){if(P){var r=new Map;for(const i of n.current.keys())for(const[o,a]of i.updated??[]){var s=r.get(o);s||(s={error:a.error,count:0},r.set(o,s)),s.count+=a.count}for(const i of r.values())i.error&&console.error(i.error)}Pc()}if(n.process(qe),Pt.clear(),P)for(const i of n.current.keys())e.add(i)}}finally{if(qe=[],ls=!1,Os=null,P)for(const i of e)i.updated=null}}function Pc(){try{uc()}catch(e){P&&jt(e,"stack",{value:""}),gn(e,Os)}}let Ge=null;function Ai(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(wt|tt))===0&&or(r)&&(Ge=new Set,qn(r),r.deps===null&&r.first===null&&r.nodes===null&&(r.teardown===null&&r.ac===null?Fo(r):r.fn=null),(Ge==null?void 0:Ge.size)>0)){Pt.clear();for(const s of Ge){if((s.f&(wt|tt))!==0)continue;const i=[s];let o=s.parent;for(;o!==null;)Ge.has(o)&&(Ge.delete(o),i.push(o)),o=o.parent;for(let a=i.length-1;a>=0;a--){const c=i[a];(c.f&(wt|tt))===0&&qn(c)}}Ge.clear()}}Ge=null}}function yo(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const i=s.f;(i&ge)!==0?yo(s,t,n,r):(i&(Lr|dt))!==0&&(i&ye)===0&&bo(s,t,r)&&(re(s,ye),Re(s))}}function bo(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(Nt.call(t,s))return!0;if((s.f&ge)!==0&&bo(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function Re(e){for(var t=Os=e;t.parent!==null;){t=t.parent;var n=t.f;if(ls&&t===W&&(n&dt)!==0&&(n&so)===0)return;if((n&(Wt|rt))!==0){if((n&fe)===0)return;t.f^=fe}}qe.push(t)}function wo(e,t){if(!((e.f&rt)!==0&&(e.f&fe)!==0)){(e.f&ye)!==0?t.d.push(e):(e.f&De)!==0&&t.m.push(e),re(e,fe);for(var n=e.first;n!==null;)wo(n,t),n=n.next}}function Ec(e){let t=0,n=Gr(0),r;return P&&Ke(n,"createSubscriber version"),()=>{Rs()&&(b(n),Kc(()=>(t===0&&(r=Ns(()=>e(()=>Sn(n)))),t+=1,()=>{sn(()=>{t-=1,t===0&&(r==null||r(),r=void 0,Sn(n))})})))}}var Ac=vn|Pn|zs;function Tc(e,t,n){new Ic(e,t,n)}var Fe,Fs,Ye,Mt,Xe,ze,Pe,Je,ct,yt,Ot,bt,dn,Lt,hn,pn,Ze,qr,de,Cc,kc,hs,_r,xr,ps;class Ic{constructor(t,n,r){M(this,de);Ve(this,"parent");Ve(this,"is_pending",!1);M(this,Fe);M(this,Fs,null);M(this,Ye);M(this,Mt);M(this,Xe);M(this,ze,null);M(this,Pe,null);M(this,Je,null);M(this,ct,null);M(this,yt,null);M(this,Ot,0);M(this,bt,0);M(this,dn,!1);M(this,Lt,!1);M(this,hn,new Set);M(this,pn,new Set);M(this,Ze,null);M(this,qr,Ec(()=>(F(this,Ze,Gr(h(this,Ot))),P&&Ke(h(this,Ze),"$effect.pending()"),()=>{F(this,Ze,null)})));F(this,Fe,t),F(this,Ye,n),F(this,Mt,r),this.parent=W.b,this.is_pending=!!h(this,Ye).pending,F(this,Xe,ko(()=>{W.b=this;{var s=we(this,de,hs).call(this);try{F(this,ze,ot(()=>r(s)))}catch(i){this.error(i)}h(this,bt)>0?we(this,de,xr).call(this):this.is_pending=!1}return()=>{var i;(i=h(this,yt))==null||i.remove()}},Ac))}defer_effect(t){mo(t,h(this,hn),h(this,pn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!h(this,Ye).pending}update_pending_count(t){we(this,de,ps).call(this,t),F(this,Ot,h(this,Ot)+t),!(!h(this,Ze)||h(this,dn))&&(F(this,dn,!0),sn(()=>{F(this,dn,!1),h(this,Ze)&&Tr(h(this,Ze),h(this,Ot))}))}get_effect_pending(){return h(this,qr).call(this),b(h(this,Ze))}error(t){var n=h(this,Ye).onerror;let r=h(this,Ye).failed;if(h(this,Lt)||!n&&!r)throw t;h(this,ze)&&(ke(h(this,ze)),F(this,ze,null)),h(this,Pe)&&(ke(h(this,Pe)),F(this,Pe,null)),h(this,Je)&&(ke(h(this,Je)),F(this,Je,null));var s=!1,i=!1;const o=()=>{if(s){vc();return}s=!0,i&&pc(),xt.ensure(),F(this,Ot,0),h(this,Je)!==null&&Fn(h(this,Je),()=>{F(this,Je,null)}),this.is_pending=this.has_pending_snippet(),F(this,ze,we(this,de,_r).call(this,()=>(F(this,Lt,!1),ot(()=>h(this,Mt).call(this,h(this,Fe)))))),h(this,bt)>0?we(this,de,xr).call(this):this.is_pending=!1};sn(()=>{try{i=!0,n==null||n(t,o),i=!1}catch(a){gn(a,h(this,Xe)&&h(this,Xe).parent)}r&&F(this,Je,we(this,de,_r).call(this,()=>{xt.ensure(),F(this,Lt,!0);try{return ot(()=>{r(h(this,Fe),()=>t,()=>o)})}catch(a){return gn(a,h(this,Xe).parent),null}finally{F(this,Lt,!1)}}))})}}Fe=new WeakMap,Fs=new WeakMap,Ye=new WeakMap,Mt=new WeakMap,Xe=new WeakMap,ze=new WeakMap,Pe=new WeakMap,Je=new WeakMap,ct=new WeakMap,yt=new WeakMap,Ot=new WeakMap,bt=new WeakMap,dn=new WeakMap,Lt=new WeakMap,hn=new WeakMap,pn=new WeakMap,Ze=new WeakMap,qr=new WeakMap,de=new WeakSet,Cc=function(){try{F(this,ze,ot(()=>h(this,Mt).call(this,h(this,Fe))))}catch(t){this.error(t)}},kc=function(){const t=h(this,Ye).pending;t&&(F(this,Pe,ot(()=>t(h(this,Fe)))),sn(()=>{var n=we(this,de,hs).call(this);F(this,ze,we(this,de,_r).call(this,()=>(xt.ensure(),ot(()=>h(this,Mt).call(this,n))))),h(this,bt)>0?we(this,de,xr).call(this):(Fn(h(this,Pe),()=>{F(this,Pe,null)}),this.is_pending=!1)}))},hs=function(){var t=h(this,Fe);return this.is_pending&&(F(this,yt,bn()),h(this,Fe).before(h(this,yt)),t=h(this,yt)),t},_r=function(t){var n=W,r=L,s=le;je(h(this,Xe)),Le(h(this,Xe)),mn(h(this,Xe).ctx);try{return t()}catch(i){return ho(i),null}finally{je(n),Le(r),mn(s)}},xr=function(){const t=h(this,Ye).pending;h(this,ze)!==null&&(F(this,ct,document.createDocumentFragment()),h(this,ct).append(h(this,yt)),Mo(h(this,ze),h(this,ct))),h(this,Pe)===null&&F(this,Pe,ot(()=>t(h(this,Fe))))},ps=function(t){var n;if(!this.has_pending_snippet()){this.parent&&we(n=this.parent,de,ps).call(n,t);return}if(F(this,bt,h(this,bt)+t),h(this,bt)===0){this.is_pending=!1;for(const r of h(this,hn))re(r,ye),Re(r);for(const r of h(this,pn))re(r,De),Re(r);h(this,hn).clear(),h(this,pn).clear(),h(this,Pe)&&Fn(h(this,Pe),()=>{F(this,Pe,null)}),h(this,ct)&&(h(this,Fe).before(h(this,ct)),F(this,ct,null))}};function Bc(e,t,n,r){const s=_o;var i=e.filter(d=>!d.settled);if(n.length===0&&i.length===0){r(t.map(s));return}var o=K,a=W,c=Sc(),u=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(d=>d.promise)):null;function f(d){c();try{r(d)}catch(p){(a.f&wt)===0&&gn(p,a)}o==null||o.deactivate(),vs()}if(n.length===0){u.then(()=>f(t.map(s)));return}function l(){c(),Promise.all(n.map(d=>zc(d))).then(d=>f([...t.map(s),...d])).catch(d=>gn(d,a))}u?u.then(l):l()}function Sc(){var e=W,t=L,n=le,r=K;if(P)var s=zn;return function(o=!0){je(e),Le(t),mn(n),o&&(r==null||r.activate()),P&&Ar(s)}}function vs(){je(null),Le(null),mn(null),P&&Ar(null)}const Fc=new Set;function _o(e){var t=ge|ye,n=L!==null&&(L.f&ge)!==0?L:null;return W!==null&&(W.f|=Pn),{ctx:le,deps:null,effects:null,equals:uo,f:t,fn:e,reactions:null,rv:0,v:pe,wv:0,parent:n??W,ac:null}}function zc(e,t,n){let r=W;r===null&&sc();var s=r.b,i=void 0,o=Gr(pe);P&&(o.label=t);var a=!L,c=new Map;return Wc(()=>{var p;var u=no();i=u.promise;try{Promise.resolve(e()).then(u.resolve,u.reject).then(()=>{f===K&&f.committed&&f.deactivate(),vs()})}catch(v){u.reject(v),vs()}var f=K;if(a){var l=s.is_rendered();s.update_pending_count(1),f.increment(l),(p=c.get(f))==null||p.reject(Qt),c.delete(f),c.set(f,u)}const d=(v,g=void 0)=>{if(f.activate(),g)g!==Qt&&(o.f|=_t,Tr(o,g));else{(o.f&_t)!==0&&(o.f^=_t),Tr(o,v);for(const[y,E]of c){if(c.delete(y),y===f)break;E.reject(Qt)}}a&&(s.update_pending_count(-1),f.decrement(l))};u.promise.then(d,v=>d(null,v||"unknown"))}),Dc(()=>{for(const u of c.values())u.reject(Qt)}),P&&(o.f|=Lr),new Promise(u=>{function f(l){function d(){l===i?u(o):f(i)}l.then(d,d)}f(i)})}function ms(e){const t=_o(e);return Oo(t),t}function gs(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)ke(t[n])}}let Zr=[];function qc(e){for(var t=e.parent;t!==null;){if((t.f&ge)===0)return(t.f&wt)===0?t:null;t=t.parent}return null}function Ls(e){var t,n=W;if(je(qc(e)),P){let r=yn;Ti(new Set);try{Nt.call(Zr,e)&&ic(),Zr.push(e),e.f&=~At,gs(e),t=ys(e)}finally{je(n),Ti(r),Zr.pop()}}else try{e.f&=~At,gs(e),t=ys(e)}finally{je(n)}return t}function xo(e){var t=Ls(e);if(!e.equals(t)&&(e.wv=Go(),(!(K!=null&&K.is_fork)||e.deps===null)&&(e.v=t,e.deps===null))){re(e,fe);return}$t||(ve!==null?(Rs()||K!=null&&K.is_fork)&&ve.set(e,t):Ms(e))}let yn=new Set;const Pt=new Map;function Ti(e){yn=e}let Gs=!1;function Mc(){Gs=!0}function Gr(e,t){var n={f:0,v:e,reactions:null,equals:uo,rv:0,wv:0};return n}function oe(e,t){const n=Gr(e);return Oo(n),n}function C(e,t,n=!1){L!==null&&(!Ne||(L.f&Er)!==0)&&fo()&&(L.f&(ge|dt|Lr|Er))!==0&&(Oe===null||!Nt.call(Oe,e))&&hc();let r=n?tn(t):t;return P&&lo(r,e.label),Tr(e,r)}function Tr(e,t){var s;if(!e.equals(t)){var n=e.v;$t?Pt.set(e,t):Pt.set(e,n),e.v=t;var r=xt.ensure();if(r.capture(e,n),P){if(W!==null){e.updated??(e.updated=new Map);const i=(((s=e.updated.get(""))==null?void 0:s.count)??0)+1;if(e.updated.set("",{error:null,count:i}),i>5){const o=gc("updated at");if(o!==null){let a=e.updated.get(o.stack);a||(a={error:o,count:0},e.updated.set(o.stack,a)),a.count++}}}W!==null&&(e.set_during_effect=!0)}if((e.f&ge)!==0){const i=e;(e.f&ye)!==0&&Ls(i),Ms(i)}e.wv=Go(),Eo(e,ye),W!==null&&(W.f&fe)!==0&&(W.f&(rt|Wt))===0&&(Se===null?Zc([e]):Se.push(e)),!r.is_fork&&yn.size>0&&!Gs&&Po()}return t}function Po(){Gs=!1;for(const e of yn)(e.f&fe)!==0&&re(e,De),or(e)&&qn(e);yn.clear()}function Sn(e){C(e,e.v+1)}function Eo(e,t){var n=e.reactions;if(n!==null)for(var r=n.length,s=0;s<r;s++){var i=n[s],o=i.f;if(P&&(o&Er)!==0){yn.add(i);continue}var a=(o&ye)===0;if(a&&re(i,t),(o&ge)!==0){var c=i;ve==null||ve.delete(c),(o&At)===0&&(o&Me&&(i.f|=At),Eo(c,De))}else a&&((o&dt)!==0&&Ge!==null&&Ge.add(i),Re(i))}}const Oc=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function tn(e){if(typeof e!="object"||e===null||Bn in e)return e;const t=to(e);if(t!==Qa&&t!==ec)return e;var n=new Map,r=Ya(e),s=oe(0),i=Ut,o=f=>{if(Ut===i)return f();var l=L,d=Ut;Le(null),ki(i);var p=f();return Le(l),ki(d),p};r&&(n.set("length",oe(e.length)),P&&(e=Gc(e)));var a="";let c=!1;function u(f){if(!c){c=!0,a=f,Ke(s,`${a} version`);for(const[l,d]of n)Ke(d,St(a,l));c=!1}}return new Proxy(e,{defineProperty(f,l,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&fc();var p=n.get(l);return p===void 0?p=o(()=>{var v=oe(d.value);return n.set(l,v),P&&typeof l=="string"&&Ke(v,St(a,l)),v}):C(p,d.value,!0),!0},deleteProperty(f,l){var d=n.get(l);if(d===void 0){if(l in f){const p=o(()=>oe(pe));n.set(l,p),Sn(s),P&&Ke(p,St(a,l))}}else C(d,pe),Sn(s);return!0},get(f,l,d){var y;if(l===Bn)return e;if(P&&l===io)return u;var p=n.get(l),v=l in f;if(p===void 0&&(!v||(y=rn(f,l))!=null&&y.writable)&&(p=o(()=>{var E=tn(v?f[l]:pe),O=oe(E);return P&&Ke(O,St(a,l)),O}),n.set(l,p)),p!==void 0){var g=b(p);return g===pe?void 0:g}return Reflect.get(f,l,d)},getOwnPropertyDescriptor(f,l){var d=Reflect.getOwnPropertyDescriptor(f,l);if(d&&"value"in d){var p=n.get(l);p&&(d.value=b(p))}else if(d===void 0){var v=n.get(l),g=v==null?void 0:v.v;if(v!==void 0&&g!==pe)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return d},has(f,l){var g;if(l===Bn)return!0;var d=n.get(l),p=d!==void 0&&d.v!==pe||Reflect.has(f,l);if(d!==void 0||W!==null&&(!p||(g=rn(f,l))!=null&&g.writable)){d===void 0&&(d=o(()=>{var y=p?tn(f[l]):pe,E=oe(y);return P&&Ke(E,St(a,l)),E}),n.set(l,d));var v=b(d);if(v===pe)return!1}return p},set(f,l,d,p){var x;var v=n.get(l),g=l in f;if(r&&l==="length")for(var y=d;y<v.v;y+=1){var E=n.get(y+"");E!==void 0?C(E,pe):y in f&&(E=o(()=>oe(pe)),n.set(y+"",E),P&&Ke(E,St(a,y)))}if(v===void 0)(!g||(x=rn(f,l))!=null&&x.writable)&&(v=o(()=>oe(void 0)),P&&Ke(v,St(a,l)),C(v,tn(d)),n.set(l,v));else{g=v.v!==pe;var O=o(()=>tn(d));C(v,O)}var z=Reflect.getOwnPropertyDescriptor(f,l);if(z!=null&&z.set&&z.set.call(p,d),!g){if(r&&typeof l=="string"){var T=n.get("length"),S=Number(l);Number.isInteger(S)&&S>=T.v&&C(T,S+1)}Sn(s)}return!0},ownKeys(f){b(s);var l=Reflect.ownKeys(f).filter(v=>{var g=n.get(v);return g===void 0||g.v!==pe});for(var[d,p]of n)p.v!==pe&&!(d in f)&&l.push(d);return l},setPrototypeOf(){dc()}})}function St(e,t){return typeof t=="symbol"?`${e}[Symbol(${t.description??""})]`:Oc.test(t)?`${e}.${t}`:/^\d+$/.test(t)?`${e}[${t}]`:`${e}['${t}']`}function Qr(e){try{if(e!==null&&typeof e=="object"&&Bn in e)return e[Bn]}catch{}return e}const Lc=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function Gc(e){return new Proxy(e,{get(t,n,r){var s=Reflect.get(t,n,r);return Lc.has(n)?function(...i){Mc();var o=s.apply(this,i);return Po(),o}:s}})}function Uc(){const e=Array.prototype,t=Array.__svelte_cleanup;t&&t();const{indexOf:n,lastIndexOf:r,includes:s}=e;e.indexOf=function(i,o){const a=n.call(this,i,o);if(a===-1){for(let c=o??0;c<this.length;c+=1)if(Qr(this[c])===i){Jr("array.indexOf(...)");break}}return a},e.lastIndexOf=function(i,o){const a=r.call(this,i,o??this.length-1);if(a===-1){for(let c=0;c<=(o??this.length-1);c+=1)if(Qr(this[c])===i){Jr("array.lastIndexOf(...)");break}}return a},e.includes=function(i,o){const a=s.call(this,i,o);if(!a){for(let c=0;c<this.length;c+=1)if(Qr(this[c])===i){Jr("array.includes(...)");break}}return a},Array.__svelte_cleanup=()=>{e.indexOf=n,e.lastIndexOf=r,e.includes=s}}var Ii,Us,Ao,To;function Rc(){if(Ii===void 0){Ii=window,Us=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Ao=rn(t,"firstChild").get,To=rn(t,"nextSibling").get,Pi(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Pi(n)&&(n.__t=void 0),P&&(e.__svelte_meta=null,Uc())}}function bn(e=""){return document.createTextNode(e)}function Ir(e){return Ao.call(e)}function Ur(e){return To.call(e)}function _(e,t){return Ir(e)}function X(e,t=!1){{var n=Ir(e);return n instanceof Comment&&n.data===""?Ur(n):n}}function I(e,t=1,n=!1){let r=e;for(;t--;)r=Ur(r);return r}function Nc(){return!1}function Io(e){var t=L,n=W;Le(null),je(null);try{return e()}finally{Le(t),je(n)}}function jc(e){W===null&&(L===null&&cc(e),ac()),$t&&oc(e)}function $c(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function kt(e,t,n){var r=W;if(P)for(;r!==null&&(r.f&Er)!==0;)r=r.parent;r!==null&&(r.f&tt)!==0&&(e|=tt);var s={ctx:le,deps:null,nodes:null,f:e|ye|Me,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(P&&(s.component_function=rr),n)try{qn(s),s.f|=qs}catch(a){throw ke(s),a}else t!==null&&Re(s);var i=s;if(n&&i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&Pn)===0&&(i=i.first,(e&dt)!==0&&(e&vn)!==0&&i!==null&&(i.f|=vn)),i!==null&&(i.parent=r,r!==null&&$c(i,r),L!==null&&(L.f&ge)!==0&&(e&Wt)===0)){var o=L;(o.effects??(o.effects=[])).push(i)}return s}function Rs(){return L!==null&&!Ne}function Dc(e){const t=kt(Or,null,!1);return re(t,fe),t.teardown=e,t}function Hc(e){jc("$effect"),P&&jt(e,"name",{value:"$effect"});var t=W.f,n=!L&&(t&rt)!==0&&(t&qs)===0;if(n){var r=le;(r.e??(r.e=[])).push(e)}else return Co(e)}function Co(e){return kt(as|nc,e,!1)}function Vc(e){xt.ensure();const t=kt(Wt|Pn,e,!0);return(n={})=>new Promise(r=>{n.outro?Fn(t,()=>{ke(t),r(void 0)}):(ke(t),r(void 0))})}function Wc(e){return kt(Lr|Pn,e,!0)}function Kc(e,t=0){return kt(Or|t,e,!0)}function Q(e,t=[],n=[],r=[]){Bc(r,t,n,s=>{kt(Or,()=>e(...s.map(b)),!0)})}function ko(e,t=0){var n=kt(dt|t,e,!0);return P&&(n.dev_stack=zn),n}function ot(e){return kt(rt|Pn,e,!0)}function Bo(e){var t=e.teardown;if(t!==null){const n=$t,r=L;Ci(!0),Le(null);try{t.call(null)}finally{Ci(n),Le(r)}}}function So(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&Io(()=>{s.abort(Qt)});var r=n.next;(n.f&Wt)!==0?n.parent=null:ke(n,t),n=r}}function Yc(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&rt)===0&&ke(t),t=n}}function ke(e,t=!0){var n=!1;(t||(e.f&so)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Xc(e.nodes.start,e.nodes.end),n=!0),So(e,t&&!n),Cr(e,0),re(e,wt);var r=e.nodes&&e.nodes.t;if(r!==null)for(const i of r)i.stop();Bo(e);var s=e.parent;s!==null&&s.first!==null&&Fo(e),P&&(e.component_function=null),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function Xc(e,t){for(;e!==null;){var n=e===t?null:Ur(e);e.remove(),e=n}}function Fo(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Fn(e,t,n=!0){var r=[];zo(e,r,!0);var s=()=>{n&&ke(e),t&&t()},i=r.length;if(i>0){var o=()=>--i||s();for(var a of r)a.out(o)}else s()}function zo(e,t,n){if((e.f&tt)===0){e.f^=tt;var r=e.nodes&&e.nodes.t;if(r!==null)for(const a of r)(a.is_global||n)&&t.push(a);for(var s=e.first;s!==null;){var i=s.next,o=(s.f&vn)!==0||(s.f&rt)!==0&&(e.f&dt)!==0;zo(s,t,o?n:!1),s=i}}}function Jc(e){qo(e,!0)}function qo(e,t){if((e.f&tt)!==0){e.f^=tt,(e.f&fe)===0&&(re(e,ye),Re(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&vn)!==0||(n.f&rt)!==0;qo(n,s?t:!1),n=r}var i=e.nodes&&e.nodes.t;if(i!==null)for(const o of i)(o.is_global||t)&&o.in()}}function Mo(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:Ur(n);t.append(n),n=s}}let Pr=!1,$t=!1;function Ci(e){$t=e}let L=null,Ne=!1;function Le(e){L=e}let W=null;function je(e){W=e}let Oe=null;function Oo(e){L!==null&&(Oe===null?Oe=[e]:Oe.push(e))}let Ee=null,Ie=0,Se=null;function Zc(e){Se=e}let Lo=1,Ft=0,Ut=Ft;function ki(e){Ut=e}function Go(){return++Lo}function or(e){var t=e.f;if((t&ye)!==0)return!0;if(t&ge&&(e.f&=~At),(t&De)!==0){for(var n=e.deps,r=n.length,s=0;s<r;s++){var i=n[s];if(or(i)&&xo(i),i.wv>e.wv)return!0}(t&Me)!==0&&ve===null&&re(e,fe)}return!1}function Uo(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Oe!==null&&Nt.call(Oe,e)))for(var s=0;s<r.length;s++){var i=r[s];(i.f&ge)!==0?Uo(i,t,!1):t===i&&(n?re(i,ye):(i.f&fe)!==0&&re(i,De),Re(i))}}function ys(e){var g;var t=Ee,n=Ie,r=Se,s=L,i=Oe,o=le,a=Ne,c=Ut,u=e.f;Ee=null,Ie=0,Se=null,L=(u&(rt|Wt))===0?e:null,Oe=null,mn(e.ctx),Ne=!1,Ut=++Ft,e.ac!==null&&(Io(()=>{e.ac.abort(Qt)}),e.ac=null);try{e.f|=cs;var f=e.fn,l=f(),d=e.deps,p=K==null?void 0:K.is_fork;if(Ee!==null){var v;if(p||Cr(e,Ie),d!==null&&Ie>0)for(d.length=Ie+Ee.length,v=0;v<Ee.length;v++)d[Ie+v]=Ee[v];else e.deps=d=Ee;if(Rs()&&(e.f&Me)!==0)for(v=Ie;v<d.length;v++)((g=d[v]).reactions??(g.reactions=[])).push(e)}else!p&&d!==null&&Ie<d.length&&(Cr(e,Ie),d.length=Ie);if(fo()&&Se!==null&&!Ne&&d!==null&&(e.f&(ge|De|ye))===0)for(v=0;v<Se.length;v++)Uo(Se[v],e);if(s!==null&&s!==e){if(Ft++,s.deps!==null)for(let y=0;y<n;y+=1)s.deps[y].rv=Ft;if(t!==null)for(const y of t)y.rv=Ft;Se!==null&&(r===null?r=Se:r.push(...Se))}return(e.f&_t)!==0&&(e.f^=_t),l}catch(y){return ho(y)}finally{e.f^=cs,Ee=t,Ie=n,Se=r,L=s,Oe=i,mn(o),Ne=a,Ut=c}}function Qc(e,t){let n=t.reactions;if(n!==null){var r=Xa.call(n,e);if(r!==-1){var s=n.length-1;s===0?n=t.reactions=null:(n[r]=n[s],n.pop())}}if(n===null&&(t.f&ge)!==0&&(Ee===null||!Nt.call(Ee,t))){var i=t;(i.f&Me)!==0&&(i.f^=Me,i.f&=~At),Ms(i),gs(i),Cr(i,0)}}function Cr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Qc(e,n[r])}function qn(e){var t=e.f;if((t&wt)===0){re(e,fe);var n=W,r=Pr;if(W=e,Pr=!0,P){var s=rr;Ei(e.component_function);var i=zn;Ar(e.dev_stack??zn)}try{(t&(dt|ro))!==0?Yc(e):So(e),Bo(e);var o=ys(e);e.teardown=typeof o=="function"?o:null,e.wv=Lo;var a;P&&mc&&(e.f&ye)!==0&&e.deps}finally{Pr=r,W=n,P&&(Ei(s),Ar(i))}}}function b(e){var t=e.f,n=(t&ge)!==0;if(L!==null&&!Ne){var r=W!==null&&(W.f&wt)!==0;if(!r&&(Oe===null||!Nt.call(Oe,e))){var s=L.deps;if((L.f&cs)!==0)e.rv<Ft&&(e.rv=Ft,Ee===null&&s!==null&&s[Ie]===e?Ie++:Ee===null?Ee=[e]:Ee.push(e));else{(L.deps??(L.deps=[])).push(e);var i=e.reactions;i===null?e.reactions=[L]:Nt.call(i,L)||i.push(L)}}}if(P&&Fc.delete(e),$t&&Pt.has(e))return Pt.get(e);if(n){var o=e;if($t){var a=o.v;return((o.f&fe)===0&&o.reactions!==null||No(o))&&(a=Ls(o)),Pt.set(o,a),a}var c=(o.f&Me)===0&&!Ne&&L!==null&&(Pr||(L.f&Me)!==0),u=o.deps===null;or(o)&&(c&&(o.f|=Me),xo(o)),c&&!u&&Ro(o)}if(ve!=null&&ve.has(e))return ve.get(e);if((e.f&_t)!==0)throw e.v;return e.v}function Ro(e){if(e.deps!==null){e.f|=Me;for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),(t.f&ge)!==0&&(t.f&Me)===0&&Ro(t)}}function No(e){if(e.v===pe)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(Pt.has(t)||(t.f&ge)!==0&&No(t))return!0;return!1}function Ns(e){var t=Ne;try{return Ne=!0,e()}finally{Ne=t}}const jo=new Set,bs=new Set;function js(e){for(var t=0;t<e.length;t++)jo.add(e[t]);for(var n of bs)n(e)}let Bi=null;function pr(e){var y;var t=this,n=t.ownerDocument,r=e.type,s=((y=e.composedPath)==null?void 0:y.call(e))||[],i=s[0]||e.target;Bi=e;var o=0,a=Bi===e&&e.__root;if(a){var c=s.indexOf(a);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var u=s.indexOf(t);if(u===-1)return;c<=u&&(o=c)}if(i=s[o]||e.target,i!==t){jt(e,"currentTarget",{configurable:!0,get(){return i||n}});var f=L,l=W;Le(null),je(null);try{for(var d,p=[];i!==null;){var v=i.assignedSlot||i.parentNode||i.host||null;try{var g=i["__"+r];g!=null&&(!i.disabled||e.target===i)&&g.call(i,e)}catch(E){d?p.push(E):d=E}if(e.cancelBubble||v===t||v===null)break;i=v}if(d){for(let E of p)queueMicrotask(()=>{throw E});throw d}}finally{e.__root=t,delete e.currentTarget,Le(f),je(l)}}}function eu(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function kr(e,t){var n=W;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function j(e,t){var n=(t&Ha)!==0,r=(t&Va)!==0,s,i=!e.startsWith("<!>");return()=>{s===void 0&&(s=eu(i?e:"<!>"+e),n||(s=Ir(s)));var o=r||Us?document.importNode(s,!0):s.cloneNode(!0);if(n){var a=Ir(o),c=o.lastChild;kr(a,c)}else kr(o,o);return o}}function ut(e=""){{var t=bn(e+"");return kr(t,t),t}}function me(){var e=document.createDocumentFragment(),t=document.createComment(""),n=bn();return e.append(t,n),kr(t,n),e}function w(e,t){e!==null&&e.before(t)}const tu=["touchstart","touchmove"];function nu(e){return tu.includes(e)}function ne(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n+"")}function ru(e,t){return su(e,t)}const Zt=new Map;function su(e,{target:t,anchor:n,props:r={},events:s,context:i,intro:o=!0}){Rc();var a=new Set,c=l=>{for(var d=0;d<l.length;d++){var p=l[d];if(!a.has(p)){a.add(p);var v=nu(p);t.addEventListener(p,pr,{passive:v});var g=Zt.get(p);g===void 0?(document.addEventListener(p,pr,{passive:v}),Zt.set(p,1)):Zt.set(p,g+1)}}};c(Ja(jo)),bs.add(c);var u=void 0,f=Vc(()=>{var l=n??t.appendChild(bn());return Tc(l,{pending:()=>{}},d=>{sr({});var p=le;i&&(p.c=i),s&&(r.$$events=s),u=e(d,r)||{},ir()}),()=>{var v;for(var d of a){t.removeEventListener(d,pr);var p=Zt.get(d);--p===0?(document.removeEventListener(d,pr),Zt.delete(d)):Zt.set(d,p)}bs.delete(c),l!==n&&((v=l.parentNode)==null||v.removeChild(l))}});return iu.set(u,f),u}let iu=new WeakMap;var Ue,Qe,Ce,Gt,tr,nr,Mr;class ou{constructor(t,n=!0){Ve(this,"anchor");M(this,Ue,new Map);M(this,Qe,new Map);M(this,Ce,new Map);M(this,Gt,new Set);M(this,tr,!0);M(this,nr,()=>{var t=K;if(h(this,Ue).has(t)){var n=h(this,Ue).get(t),r=h(this,Qe).get(n);if(r)Jc(r),h(this,Gt).delete(n);else{var s=h(this,Ce).get(n);s&&(h(this,Qe).set(n,s.effect),h(this,Ce).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[i,o]of h(this,Ue)){if(h(this,Ue).delete(i),i===t)break;const a=h(this,Ce).get(o);a&&(ke(a.effect),h(this,Ce).delete(o))}for(const[i,o]of h(this,Qe)){if(i===n||h(this,Gt).has(i))continue;const a=()=>{if(Array.from(h(this,Ue).values()).includes(i)){var u=document.createDocumentFragment();Mo(o,u),u.append(bn()),h(this,Ce).set(i,{effect:o,fragment:u})}else ke(o);h(this,Gt).delete(i),h(this,Qe).delete(i)};h(this,tr)||!r?(h(this,Gt).add(i),Fn(o,a,!1)):a()}}});M(this,Mr,t=>{h(this,Ue).delete(t);const n=Array.from(h(this,Ue).values());for(const[r,s]of h(this,Ce))n.includes(r)||(ke(s.effect),h(this,Ce).delete(r))});this.anchor=t,F(this,tr,n)}ensure(t,n){var r=K,s=Nc();if(n&&!h(this,Qe).has(t)&&!h(this,Ce).has(t))if(s){var i=document.createDocumentFragment(),o=bn();i.append(o),h(this,Ce).set(t,{effect:ot(()=>n(o)),fragment:i})}else h(this,Qe).set(t,ot(()=>n(this.anchor)));if(h(this,Ue).set(r,t),s){for(const[a,c]of h(this,Qe))a===t?r.unskip_effect(c):r.skip_effect(c);for(const[a,c]of h(this,Ce))a===t?r.unskip_effect(c.effect):r.skip_effect(c.effect);r.oncommit(h(this,nr)),r.ondiscard(h(this,Mr))}else h(this,nr).call(this)}}Ue=new WeakMap,Qe=new WeakMap,Ce=new WeakMap,Gt=new WeakMap,tr=new WeakMap,nr=new WeakMap,Mr=new WeakMap;if(P){let e=function(t){if(!(t in globalThis)){let n;Object.defineProperty(globalThis,t,{configurable:!0,get:()=>{if(n!==void 0)return n;lc(t)},set:r=>{n=r}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}function $o(e){le===null&&oo("onMount"),Hc(()=>{const t=Ns(e);if(typeof t=="function")return t})}function au(e){le===null&&oo("onDestroy"),$o(()=>()=>Ns(e))}function U(e,t,n=!1){var r=new ou(e),s=n?vn:0;function i(o,a){r.ensure(o,a)}ko(()=>{var o=!1;t((a,c=!0)=>{o=!0,i(c,a)}),o||i(!1,null)},s)}const cu=Symbol("is custom element"),uu=Symbol("is html");function Si(e,t,n,r){var s=lu(e);s[t]!==(s[t]=n)&&(t==="loading"&&(e[rc]=n),n==null?e.removeAttribute(t):typeof n!="string"&&fu(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function lu(e){return e.__attributes??(e.__attributes={[cu]:e.nodeName.includes("-"),[uu]:e.namespaceURI===Ka})}var Fi=new Map;function fu(e){var t=e.getAttribute("is")||e.nodeName,n=Fi.get(t);if(n)return n;Fi.set(t,n=[]);for(var r,s=e,i=Element.prototype;i!==s;){r=Za(s);for(var o in r)r[o].set&&n.push(o);s=to(s)}return n}async function du(e){const t=await fetch(`/api/pending/${e}`);if(!t.ok){const r=await t.json().catch(()=>({error:"Unknown error"}));throw new Error(r.error||`HTTP ${t.status}`)}return(await t.json()).request}async function Do(e,t){const n=await fetch(`/api/complete/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({error:"Unknown error"}));throw new Error(r.error||`HTTP ${n.status}`)}}async function $s(e,t){await Do(e,{success:!0,result:t})}async function Rt(e,t){await Do(e,{success:!1,error:t})}function hu(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const zi=/^tuple(?<array>(\[(\d*)\])*)$/;function ws(e){let t=e.type;if(zi.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s<n;s++){const i=e.components[s];t+=ws(i),s<n-1&&(t+=", ")}const r=hu(zi,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,ws({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function In(e){let t="";const n=e.length;for(let r=0;r<n;r++){const s=e[r];t+=ws(s),r!==n-1&&(t+=", ")}return t}function pu(e){return e.type==="function"?`function ${e.name}(${In(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs.length?` returns (${In(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${In(e.inputs)})`:e.type==="error"?`error ${e.name}(${In(e.inputs)})`:e.type==="constructor"?`constructor(${In(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?"fallback()":"receive() external payable"}function Ae(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:i=>t(e,i)}function wn(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Tu(e.type);return`${e.name}(${Ds(e.inputs,{includeName:t})})`}function Ds(e,{includeName:t=!1}={}){return e?e.map(n=>vu(n,{includeName:t})).join(t?", ":","):""}function vu(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Ds(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Tt(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function ae(e){return Tt(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const Ho="2.21.0";let vr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:Ho};class m extends Error{constructor(t,n={}){var a;const r=(()=>{var c;return n.cause instanceof m?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof m&&n.cause.docsPath||n.docsPath,i=(a=vr.getDocsUrl)==null?void 0:a.call(vr,{...n,docsPath:s}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],`Version: ${vr.version}`].join(`
25
+ `);super(o,n.cause?{cause:n.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=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Ho}walk(t){return Vo(this,t)}}function Vo(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e?Vo(e.cause,t):t?null:e}class mu extends m{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
26
+ `),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class qi extends m{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
27
+ `),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class gu extends m{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
28
+ `),{metaMessages:[`Params: (${Ds(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class Hs extends m{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class yu extends m{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
29
+ `),{name:"AbiEncodingArrayLengthMismatchError"})}}class bu extends m{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${ae(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class wu extends m{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
30
+ `),{name:"AbiEncodingLengthMismatchError"})}}class Wo extends m{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
31
+ `),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class Mi extends m{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
32
+ `),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class _u extends m{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${wn(t.abiItem)}\`, and`,`\`${n.type}\` in \`${wn(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class xu extends m{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}}class Pu extends m{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
33
+ `),{docsPath:n,name:"InvalidAbiEncodingType"})}}class Eu extends m{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
34
+ `),{docsPath:n,name:"InvalidAbiDecodingType"})}}class Au extends m{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
35
+ `),{name:"InvalidArrayError"})}}class Tu extends m{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
36
+ `),{name:"InvalidDefinitionTypeError"})}}class Ko extends m{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class Yo extends m{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}class Oi extends m{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function En(e,{dir:t,size:n=32}={}){return typeof e=="string"?Et(e,{dir:t,size:n}):Iu(e,{dir:t,size:n})}function Et(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new Yo({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Iu(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new Yo({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s<n;s++){const i=t==="right";r[i?s:n-s-1]=e[i?s:e.length-s-1]}return r}class Cu extends m{constructor({max:t,min:n,signed:r,size:s,value:i}){super(`Number "${i}" is not in safe ${s?`${s*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class ku extends m{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class Bu extends m{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function Dt(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let s=0;s<n.length-1&&n[t==="left"?s:n.length-s-1].toString()==="0";s++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function st(e,{size:t}){if(ae(e)>t)throw new Bu({givenSize:ae(e),maxSize:t})}function et(e,t={}){const{signed:n}=t;t.size&&st(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,i=(1n<<BigInt(s)*8n-1n)-1n;return r<=i?r:r-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function It(e,t={}){return Number(et(e,t))}const Su=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function k(e,t={}){return typeof e=="number"||typeof e=="bigint"?H(e,t):typeof e=="string"?Rr(e,t):typeof e=="boolean"?Xo(e,t):xe(e,t)}function Xo(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(st(n,{size:t.size}),En(n,{size:t.size})):n}function xe(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=Su[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(st(r,{size:t.size}),En(r,{dir:"right",size:t.size})):r}function H(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let i;r?n?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof i=="bigint"&&n?-i-1n:0;if(i&&s>i||s<o){const c=typeof e=="bigint"?"n":"";throw new Cu({max:i?`${i}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${e}${c}`})}const a=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?En(a,{size:r}):a}const Fu=new TextEncoder;function Rr(e,t={}){const n=Fu.encode(e);return xe(n,t)}const zu=new TextEncoder;function Vs(e,t={}){return typeof e=="number"||typeof e=="bigint"?Mu(e,t):typeof e=="boolean"?qu(e,t):Tt(e)?ft(e,t):Jo(e,t)}function qu(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(st(n,{size:t.size}),En(n,{size:t.size})):n}const it={zero:48,nine:57,A:65,F:70,a:97,f:102};function Li(e){if(e>=it.zero&&e<=it.nine)return e-it.zero;if(e>=it.A&&e<=it.F)return e-(it.A-10);if(e>=it.a&&e<=it.f)return e-(it.a-10)}function ft(e,t={}){let n=e;t.size&&(st(n,{size:t.size}),n=En(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,i=new Uint8Array(s);for(let o=0,a=0;o<s;o++){const c=Li(r.charCodeAt(a++)),u=Li(r.charCodeAt(a++));if(c===void 0||u===void 0)throw new m(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);i[o]=c*16+u}return i}function Mu(e,t){const n=H(e,t);return ft(n)}function Jo(e,t={}){const n=zu.encode(e);return typeof t.size=="number"?(st(n,{size:t.size}),En(n,{dir:"right",size:t.size})):n}function Br(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function Ou(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Nr(e,...t){if(!Ou(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function $h(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Br(e.outputLen),Br(e.blockLen)}function Sr(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 Zo(e,t){Nr(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const mr=BigInt(2**32-1),Gi=BigInt(32);function Lu(e,t=!1){return t?{h:Number(e&mr),l:Number(e>>Gi&mr)}:{h:Number(e>>Gi&mr)|0,l:Number(e&mr)|0}}function Gu(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:i,l:o}=Lu(e[s],t);[n[s],r[s]]=[i,o]}return[n,r]}const Uu=(e,t,n)=>e<<n|t>>>32-n,Ru=(e,t,n)=>t<<n|e>>>32-n,Nu=(e,t,n)=>t<<n-32|e>>>64-n,ju=(e,t,n)=>e<<n-32|t>>>64-n,es=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const $u=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),ts=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),We=(e,t)=>e<<32-t|e>>>t,Ui=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Du=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function Ri(e){for(let t=0;t<e.length;t++)e[t]=Du(e[t])}function Hu(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Ws(e){return typeof e=="string"&&(e=Hu(e)),Nr(e),e}function Dh(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];Nr(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const i=e[r];n.set(i,s),s+=i.length}return n}class Qo{clone(){return this._cloneInto()}}function ea(e){const t=r=>e().update(Ws(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Hh(e=32){if(es&&typeof es.getRandomValues=="function")return es.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const ta=[],na=[],ra=[],Vu=BigInt(0),Cn=BigInt(1),Wu=BigInt(2),Ku=BigInt(7),Yu=BigInt(256),Xu=BigInt(113);for(let e=0,t=Cn,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],ta.push(2*(5*r+n)),na.push((e+1)*(e+2)/2%64);let s=Vu;for(let i=0;i<7;i++)t=(t<<Cn^(t>>Ku)*Xu)%Yu,t&Wu&&(s^=Cn<<(Cn<<BigInt(i))-Cn);ra.push(s)}const[Ju,Zu]=Gu(ra,!0),Ni=(e,t,n)=>n>32?Nu(e,t,n):Uu(e,t,n),ji=(e,t,n)=>n>32?ju(e,t,n):Ru(e,t,n);function Qu(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=n[c],f=n[c+1],l=Ni(u,f,1)^n[a],d=ji(u,f,1)^n[a+1];for(let p=0;p<50;p+=10)e[o+p]^=l,e[o+p+1]^=d}let s=e[2],i=e[3];for(let o=0;o<24;o++){const a=na[o],c=Ni(s,i,a),u=ji(s,i,a),f=ta[o];s=e[f],i=e[f+1],e[f]=c,e[f+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=Ju[r],e[1]^=Zu[r]}n.fill(0)}class Ks extends Qo{constructor(t,n,r,s=!1,i=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Br(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=$u(this.state)}keccak(){Ui||Ri(this.state32),Qu(this.state32,this.rounds),Ui||Ri(this.state32),this.posOut=0,this.pos=0}update(t){Sr(this);const{blockLen:n,state:r}=this;t=Ws(t);const s=t.length;for(let i=0;i<s;){const o=Math.min(n-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,(n&128)!==0&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){Sr(this,!1),Nr(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,i=t.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Br(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Zo(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,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return t||(t=new Ks(n,r,s,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}}const el=(e,t,n)=>ea(()=>new Ks(t,e,n)),tl=el(1,136,256/8);function ar(e,t){const n=t||"hex",r=tl(Tt(e,{strict:!1})?Vs(e):e);return n==="bytes"?r:k(r)}const nl=e=>ar(Vs(e));function rl(e){return nl(e)}function sl(e){let t=!0,n="",r=0,s="",i=!1;for(let o=0;o<e.length;o++){const a=e[o];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function",""].includes(s))s="";else if(s+=a,a===")"){i=!0;break}continue}if(a===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=a,n+=a}}if(!i)throw new m("Unable to normalize signature.");return s}const il=e=>{const t=typeof e=="string"?e:pu(e);return sl(t)};function sa(e){return rl(il(e))}const ol=sa;class Be extends m{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"})}}class Ys extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}set(t,n){return super.set(t,n),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}const ns=new Ys(8192);function cr(e,t){if(ns.has(`${e}.${t}`))return ns.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=ar(Jo(n),"bytes"),s=n.split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(r[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());const i=`0x${s.join("")}`;return ns.set(`${e}.${t}`,i),i}function al(e,t){if(!_e(e,{strict:!1}))throw new Be({address:e});return cr(e,t)}const cl=/^0x[a-fA-F0-9]{40}$/,rs=new Ys(8192);function _e(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(rs.has(r))return rs.get(r);const s=cl.test(e)?e.toLowerCase()===e?!0:n?cr(e)===e:!0:!1;return rs.set(r,s),s}function _n(e){return typeof e[0]=="string"?ht(e):ul(e)}function ul(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function ht(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Mn(e,t,n,{strict:r}={}){return Tt(e,{strict:!1})?ll(e,t,n,{strict:r}):aa(e,t,n,{strict:r})}function ia(e,t){if(typeof t=="number"&&t>0&&t>ae(e)-1)throw new Ko({offset:t,position:"start",size:ae(e)})}function oa(e,t,n){if(typeof t=="number"&&typeof n=="number"&&ae(e)!==n-t)throw new Ko({offset:n,position:"end",size:ae(e)})}function aa(e,t,n,{strict:r}={}){ia(e,t);const s=e.slice(t,n);return r&&oa(s,t,n),s}function ll(e,t,n,{strict:r}={}){ia(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&oa(s,t,n),s}function ca(e,t){if(e.length!==t.length)throw new wu({expectedLength:e.length,givenLength:t.length});const n=fl({params:e,values:t}),r=Js(n);return r.length===0?"0x":r}function fl({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Xs({param:e[r],value:t[r]}));return n}function Xs({param:e,value:t}){const n=Zs(e.type);if(n){const[r,s]=n;return hl(t,{length:r,param:{...e,type:s}})}if(e.type==="tuple")return yl(t,{param:e});if(e.type==="address")return dl(t);if(e.type==="bool")return vl(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int");return ml(t,{signed:r})}if(e.type.startsWith("bytes"))return pl(t,{param:e});if(e.type==="string")return gl(t);throw new Pu(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Js(e){let t=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:a}=e[i];o?t+=32:t+=ae(a)}const n=[],r=[];let s=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:a}=e[i];o?(n.push(H(t+s,{size:32})),r.push(a),s+=ae(a)):n.push(a)}return _n([...n,...r])}function dl(e){if(!_e(e))throw new Be({address:e});return{dynamic:!1,encoded:Et(e.toLowerCase())}}function hl(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Au(e);if(!r&&e.length!==t)throw new yu({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=!1;const i=[];for(let o=0;o<e.length;o++){const a=Xs({param:n,value:e[o]});a.dynamic&&(s=!0),i.push(a)}if(r||s){const o=Js(i);if(r){const a=H(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?_n([a,o]):a}}if(s)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:_n(i.map(({encoded:o})=>o))}}function pl(e,{param:t}){const[,n]=t.type.split("bytes"),r=ae(e);if(!n){let s=e;return r%32!==0&&(s=Et(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:_n([Et(H(r,{size:32})),s])}}if(r!==Number.parseInt(n))throw new bu({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:Et(e,{dir:"right"})}}function vl(e){if(typeof e!="boolean")throw new m(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Et(Xo(e))}}function ml(e,{signed:t}){return{dynamic:!1,encoded:H(e,{size:32,signed:t})}}function gl(e){const t=Rr(e),n=Math.ceil(ae(t)/32),r=[];for(let s=0;s<n;s++)r.push(Et(Mn(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:_n([Et(H(ae(t),{size:32})),...r])}}function yl(e,{param:t}){let n=!1;const r=[];for(let s=0;s<t.components.length;s++){const i=t.components[s],o=Array.isArray(e)?s:i.name,a=Xs({param:i,value:e[o]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Js(r):_n(r.map(({encoded:s})=>s))}}function Zs(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Qs=e=>Mn(sa(e),0,4);function ua(e){const{abi:t,args:n=[],name:r}=e,s=Tt(r,{strict:!1}),i=t.filter(a=>s?a.type==="function"?Qs(a)===r:a.type==="event"?ol(a)===r:!1:"name"in a&&a.name===r);if(i.length===0)return;if(i.length===1)return i[0];let o;for(const a of i){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((u,f)=>{const l="inputs"in a&&a.inputs[f];return l?_s(u,l):!1})){if(o&&"inputs"in o&&o.inputs){const u=la(a.inputs,o.inputs,n);if(u)throw new _u({abiItem:a,type:u[0]},{abiItem:o,type:u[1]})}o=a}}return o||i[0]}function _s(e,t){const n=typeof e,r=t.type;switch(r){case"address":return _e(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,i)=>_s(Object.values(e)[i],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>_s(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function la(e,t,n){for(const r in e){const s=e[r],i=t[r];if(s.type==="tuple"&&i.type==="tuple"&&"components"in s&&"components"in i)return la(s.components,i.components,n[r]);const o=[s.type,i.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?_e(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?_e(n[r],{strict:!1}):!1)return o}}function pt(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const $i="/docs/contract/encodeFunctionData";function bl(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const i=ua({abi:t,args:n,name:r});if(!i)throw new Mi(r,{docsPath:$i});s=i}if(s.type!=="function")throw new Mi(void 0,{docsPath:$i});return{abi:[s],functionName:Qs(wn(s))}}function wl(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var a;return e.abi.length===1&&((a=e.functionName)!=null&&a.startsWith("0x"))?e:bl(e)})(),s=n[0],i=r,o="inputs"in s&&s.inputs?ca(s.inputs,t??[]):void 0;return ht([i,o??"0x"])}const _l={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},xl={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Pl={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class Di extends m{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class El extends m{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class Al extends m{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const Tl={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 Al({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new El({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Di({offset:e});const 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 Di({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const 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();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function ei(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Tl);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Il(e,t={}){typeof t.size<"u"&&st(e,{size:t.size});const n=xe(e,t);return et(n,t)}function Cl(e,t={}){let n=e;if(typeof t.size<"u"&&(st(n,{size:t.size}),n=Dt(n)),n.length>1||n[0]>1)throw new ku(n);return!!n[0]}function lt(e,t={}){typeof t.size<"u"&&st(e,{size:t.size});const n=xe(e,t);return It(n,t)}function kl(e,t={}){let n=e;return typeof t.size<"u"&&(st(n,{size:t.size}),n=Dt(n,{dir:"right"})),new TextDecoder().decode(n)}function Bl(e,t){const n=typeof t=="string"?ft(t):t,r=ei(n);if(ae(n)===0&&e.length>0)throw new Hs;if(ae(t)&&ae(t)<32)throw new gu({data:typeof t=="string"?t:xe(t),params:e,size:ae(t)});let s=0;const i=[];for(let o=0;o<e.length;++o){const a=e[o];r.setPosition(s);const[c,u]=on(r,a,{staticPosition:0});s+=u,i.push(c)}return i}function on(e,t,{staticPosition:n}){const r=Zs(t.type);if(r){const[s,i]=r;return Fl(e,{...t,type:i},{length:s,staticPosition:n})}if(t.type==="tuple")return Ol(e,t,{staticPosition:n});if(t.type==="address")return Sl(e);if(t.type==="bool")return zl(e);if(t.type.startsWith("bytes"))return ql(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Ml(e,t);if(t.type==="string")return Ll(e,{staticPosition:n});throw new Eu(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const Hi=32,xs=32;function Sl(e){const t=e.readBytes(32);return[cr(xe(aa(t,-20))),32]}function Fl(e,t,{length:n,staticPosition:r}){if(!n){const o=lt(e.readBytes(xs)),a=r+o,c=a+Hi;e.setPosition(a);const u=lt(e.readBytes(Hi)),f=On(t);let l=0;const d=[];for(let p=0;p<u;++p){e.setPosition(c+(f?p*32:l));const[v,g]=on(e,t,{staticPosition:c});l+=g,d.push(v)}return e.setPosition(r+32),[d,32]}if(On(t)){const o=lt(e.readBytes(xs)),a=r+o,c=[];for(let u=0;u<n;++u){e.setPosition(a+u*32);const[f]=on(e,t,{staticPosition:a});c.push(f)}return e.setPosition(r+32),[c,32]}let s=0;const i=[];for(let o=0;o<n;++o){const[a,c]=on(e,t,{staticPosition:r+s});s+=c,i.push(a)}return[i,s]}function zl(e){return[Cl(e.readBytes(32),{size:32}),32]}function ql(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const o=lt(e.readBytes(32));e.setPosition(n+o);const a=lt(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[xe(c),32]}return[xe(e.readBytes(Number.parseInt(s),32)),32]}function Ml(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),s=e.readBytes(32);return[r>48?Il(s,{signed:n}):lt(s,{signed:n}),32]}function Ol(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:o})=>!o),s=r?[]:{};let i=0;if(On(t)){const o=lt(e.readBytes(xs)),a=n+o;for(let c=0;c<t.components.length;++c){const u=t.components[c];e.setPosition(a+i);const[f,l]=on(e,u,{staticPosition:a});i+=l,s[r?c:u==null?void 0:u.name]=f}return e.setPosition(n+32),[s,32]}for(let o=0;o<t.components.length;++o){const a=t.components[o],[c,u]=on(e,a,{staticPosition:n});s[r?o:a==null?void 0:a.name]=c,i+=u}return[s,i]}function Ll(e,{staticPosition:t}){const n=lt(e.readBytes(32)),r=t+n;e.setPosition(r);const s=lt(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const i=e.readBytes(s,32),o=kl(Dt(i));return e.setPosition(t+32),[o,32]}function On(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(On);const n=Zs(e.type);return!!(n&&On({...e,type:n[1]}))}function Gl(e){const{abi:t,data:n}=e,r=Mn(n,0,4);if(r==="0x")throw new Hs;const i=[...t||[],xl,Pl].find(o=>o.type==="error"&&r===Qs(wn(o)));if(!i)throw new Wo(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?Bl(i.inputs,Mn(n,4)):void 0,errorName:i.name}}const ur=(e,t,n)=>JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString():s,n);function fa({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((s,i)=>`${r&&s.name?`${s.name}: `:""}${typeof t[i]=="object"?ur(t[i]):t[i]}`).join(", ")})`}const Ul={gwei:9,wei:18},Rl={ether:-9,wei:9};function da(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${i?`.${i}`:""}`}function ti(e,t="wei"){return da(e,Ul[t])}function $e(e,t="wei"){return da(e,Rl[t])}class Nl extends m{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class jl extends m{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function jr(e){const t=Object.entries(e).map(([r,s])=>s===void 0||s===!1?null:[r,s]).filter(Boolean),n=t.reduce((r,[s])=>Math.max(r,s.length),0);return t.map(([r,s])=>` ${`${r}:`.padEnd(n+1)} ${s}`).join(`
37
+ `)}class $l extends m{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
38
+ `),{name:"FeeConflictError"})}}class Dl extends m{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class Hl extends m{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",jr(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"})}}class Vl extends m{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class Wl extends m{constructor(t,{account:n,docsPath:r,chain:s,data:i,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:l,value:d}){var v;const p=jr({chain:s&&`${s==null?void 0:s.name} (id: ${s==null?void 0:s.id})`,from:n==null?void 0:n.address,to:l,value:typeof d<"u"&&`${ti(d)} ${((v=s==null?void 0:s.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:i,gas:o,gasPrice:typeof a<"u"&&`${$e(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${$e(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${$e(u)} gwei`,nonce:f});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",p].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}const Kl=e=>e,ha=e=>e;class Yl extends m{constructor(t,{abi:n,args:r,contractAddress:s,docsPath:i,functionName:o,sender:a}){const c=ua({abi:n,args:r,name:o}),u=c?fa({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,f=c?wn(c,{includeName:!0}):void 0,l=jr({address:s&&Kl(s),function:f,args:u&&u!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${u}`,sender:a});super(t.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:t,docsPath:i,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],l&&"Contract Call:",l].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=s,this.functionName=o,this.sender=a}}class Xl extends m{constructor({abi:t,data:n,functionName:r,message:s}){let i,o,a,c;if(n&&n!=="0x")try{o=Gl({abi:t,data:n});const{abiItem:f,errorName:l,args:d}=o;if(l==="Error")c=d[0];else if(l==="Panic"){const[p]=d;c=_l[p]}else{const p=f?wn(f,{includeName:!0}):void 0,v=f&&d?fa({abiItem:f,args:d,includeFunctionName:!1,includeName:!1}):void 0;a=[p?`Error: ${p}`:"",v&&v!=="()"?` ${[...Array((l==null?void 0:l.length)??0).keys()].map(()=>" ").join("")}${v}`:""]}}catch(f){i=f}else s&&(c=s);let u;i instanceof Wo&&(u=i.signature,a=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${u}.`]),super(c&&c!=="execution reverted"||u?[`The contract function "${r}" reverted with the following ${u?"signature":"reason"}:`,c||u].join(`
39
+ `):`The contract function "${r}" reverted.`,{cause:i,metaMessages:a,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.reason=c,this.signature=u}}class Jl extends m{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class Zl extends m{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}class pa extends m{constructor({body:t,cause:n,details:r,headers:s,status:i,url:o}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${ha(o)}`,t&&`Request body: ${ur(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=s,this.status=i,this.url=o}}class Ql extends m{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${ha(r)}`,`Request body: ${ur(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code}}const ef=-1;class Te extends m{constructor(t,{code:n,docsPath:r,metaMessages:s,name:i,shortMessage:o}){super(o,{cause:t,docsPath:r,metaMessages:s||(t==null?void 0:t.metaMessages),name:i||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=i||t.name,this.code=t instanceof Ql?t.code:n??ef}}class An extends Te{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class Ln extends Te{constructor(t){super(t,{code:Ln.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Ln,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Gn extends Te{constructor(t){super(t,{code:Gn.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Gn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Un extends Te{constructor(t,{method:n}={}){super(t,{code:Un.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(Un,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Rn extends Te{constructor(t){super(t,{code:Rn.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
40
+ `)})}}Object.defineProperty(Rn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Ht extends Te{constructor(t){super(t,{code:Ht.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(Ht,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Nn extends Te{constructor(t){super(t,{code:Nn.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
41
+ `)})}}Object.defineProperty(Nn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class jn extends Te{constructor(t){super(t,{code:jn.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(jn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class $n extends Te{constructor(t){super(t,{code:$n.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty($n,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Dn extends Te{constructor(t){super(t,{code:Dn.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(Dn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Hn extends Te{constructor(t,{method:n}={}){super(t,{code:Hn.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not implemented.`})}}Object.defineProperty(Hn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class xn extends Te{constructor(t){super(t,{code:xn.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(xn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Vn extends Te{constructor(t){super(t,{code:Vn.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Vn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class an extends An{constructor(t){super(t,{code:an.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(an,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Wn extends An{constructor(t){super(t,{code:Wn.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(Wn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Kn extends An{constructor(t,{method:n}={}){super(t,{code:Kn.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(Kn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Yn extends An{constructor(t){super(t,{code:Yn.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(Yn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Xn extends An{constructor(t){super(t,{code:Xn.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(Xn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Jn extends An{constructor(t){super(t,{code:Jn.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Jn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class tf extends Te{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const nf=3;function rf(e,{abi:t,address:n,args:r,docsPath:s,functionName:i,sender:o}){const{code:a,data:c,message:u,shortMessage:f}=e instanceof Zl?e:e instanceof m?e.walk(d=>"data"in d)||e.walk():{},l=e instanceof Hs?new Jl({functionName:i}):[nf,Ht.code].includes(a)&&(c||u||f)?new Xl({abi:t,data:typeof c=="object"?c.data:c,functionName:i,message:f??u}):e;return new Yl(l,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:i,sender:o})}function sf(e){const t=ar(`0x${e.substring(4)}`).substring(26);return cr(`0x${t}`)}const of="modulepreload",af=function(e){return"/"+e},Vi={},cf=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(n.map(u=>{if(u=af(u),u in Vi)return;Vi[u]=!0;const f=u.endsWith(".css"),l=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${l}`))return;const d=document.createElement("link");if(d.rel=f?"stylesheet":of,f||(d.as="script"),d.crossOrigin="",d.href=u,c&&d.setAttribute("nonce",c),document.head.appendChild(d),f)return new Promise((p,v)=>{d.addEventListener("load",p),d.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};async function uf({hash:e,signature:t}){const n=Tt(e)?e:k(e),{secp256k1:r}=await cf(async()=>{const{secp256k1:o}=await import("./secp256k1-B4KiQCBs.js");return{secp256k1:o}},[]);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:u,s:f,v:l,yParity:d}=t,p=Number(d??l),v=Wi(p);return new r.Signature(et(u),et(f)).addRecoveryBit(v)}const o=Tt(t)?t:k(t),a=It(`0x${o.slice(130)}`),c=Wi(a);return r.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function Wi(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function lf({hash:e,signature:t}){return sf(await uf({hash:e,signature:t}))}function Ct(e,t="hex"){const n=va(e),r=ei(new Uint8Array(n.length));return n.encode(r),t==="hex"?xe(r.bytes):r.bytes}function va(e){return Array.isArray(e)?ff(e.map(t=>va(t))):df(e)}function ff(e){const t=e.reduce((s,i)=>s+i.length,0),n=ma(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:i}of e)i(s)}}}function df(e){const t=typeof e=="string"?ft(e):e,n=ma(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function ma(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new m("Length is too large.")}function hf(e){const{chainId:t,contractAddress:n,nonce:r,to:s}=e,i=ar(ht(["0x05",Ct([H(t),n,H(r)])]));return s==="bytes"?ft(i):i}async function ga(e){const{authorization:t,signature:n}=e;return lf({hash:hf(t),signature:n??t})}class pf extends m{constructor(t,{account:n,docsPath:r,chain:s,data:i,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:l,value:d}){var v;const p=jr({from:n==null?void 0:n.address,to:l,value:typeof d<"u"&&`${ti(d)} ${((v=s==null?void 0:s.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:i,gas:o,gasPrice:typeof a<"u"&&`${$e(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${$e(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${$e(u)} gwei`,nonce:f});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class nn extends m{constructor({cause:t,message:n}={}){var s;const r=(s=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(nn,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(nn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Vt extends m{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${$e(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(Vt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class Ps extends m{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${$e(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(Ps,"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/});class Es extends m{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(Es,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class As extends m{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
42
+ `),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(As,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Ts extends m{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(Ts,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Is extends m{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
43
+ `),{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(Is,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Cs extends m{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(Cs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class ks extends m{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(ks,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Bs extends m{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Bs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Zn extends m{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${$e(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${$e(r)} gwei`:""}).`].join(`
44
+ `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(Zn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class ni extends m{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function ya(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof m?e.walk(s=>s.code===nn.code):e;return r instanceof m?new nn({cause:e,message:r.details}):nn.nodeMessage.test(n)?new nn({cause:e,message:e.details}):Vt.nodeMessage.test(n)?new Vt({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Ps.nodeMessage.test(n)?new Ps({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Es.nodeMessage.test(n)?new Es({cause:e,nonce:t==null?void 0:t.nonce}):As.nodeMessage.test(n)?new As({cause:e,nonce:t==null?void 0:t.nonce}):Ts.nodeMessage.test(n)?new Ts({cause:e,nonce:t==null?void 0:t.nonce}):Is.nodeMessage.test(n)?new Is({cause:e}):Cs.nodeMessage.test(n)?new Cs({cause:e,gas:t==null?void 0:t.gas}):ks.nodeMessage.test(n)?new ks({cause:e,gas:t==null?void 0:t.gas}):Bs.nodeMessage.test(n)?new Bs({cause:e}):Zn.nodeMessage.test(n)?new Zn({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new ni({cause:e})}function vf(e,{docsPath:t,...n}){const r=(()=>{const s=ya(e,n);return s instanceof ni?e:s})();return new pf(r,{docsPath:t,...n})}function ba(e,{format:t}){if(!t)return{};const n={};function r(i){const o=Object.keys(i);for(const a of o)a in e&&(n[a]=e[a]),i[a]&&typeof i[a]=="object"&&!Array.isArray(i[a])&&r(i[a])}const s=t(e||{});return r(s),n}function ri(e,t){return({exclude:n,format:r})=>({exclude:n,format:s=>{const i=t(s);if(n)for(const o of n)delete i[o];return{...i,...r(s)}},type:e})}const mf={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function si(e){const t={};return typeof e.authorizationList<"u"&&(t.authorizationList=gf(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>xe(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=H(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=H(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=H(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=H(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=H(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=H(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=mf[e.type]),typeof e.value<"u"&&(t.value=H(e.value)),t}function gf(e){return e.map(t=>({address:t.contractAddress,r:t.r,s:t.s,chainId:H(t.chainId),nonce:H(t.nonce),...typeof t.yParity<"u"?{yParity:H(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:H(t.v)}:{}}))}function Ki(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Oi({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Oi({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function yf(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:i}=e,o={};if(i!==void 0&&(o.code=i),t!==void 0&&(o.balance=H(t)),n!==void 0&&(o.nonce=H(n)),r!==void 0&&(o.state=Ki(r)),s!==void 0){if(o.state)throw new jl;o.stateDiff=Ki(s)}return o}function bf(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!_e(n,{strict:!1}))throw new Be({address:n});if(t[n])throw new Nl({address:n});t[n]=yf(r)}return t}function $r(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:i}=e,o=t?pt(t):void 0;if(o&&!_e(o.address))throw new Be({address:o.address});if(i&&!_e(i))throw new Be({address:i});if(typeof n<"u"&&(typeof r<"u"||typeof s<"u"))throw new $l;if(r&&r>2n**256n-1n)throw new Vt({maxFeePerGas:r});if(s&&r&&s>r)throw new Zn({maxFeePerGas:r,maxPriorityFeePerGas:s})}class wf extends m{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class ii extends m{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class _f extends m{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${$e(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class xf extends m{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const wa={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function oi(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?It(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?It(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?wa[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&&(t.authorizationList=Ef(e.authorizationList)),t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),t.type==="legacy"&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),t.type==="eip2930"&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t.type==="eip1559"&&delete t.maxFeePerBlobGas,t}const Pf=ri("transaction",oi);function Ef(e){return e.map(t=>({contractAddress:t.address,r:t.r,s:t.s,chainId:Number(t.chainId),nonce:Number(t.nonce),...typeof t.yParity<"u"?{yParity:Number(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:Number(t.v)}:{}}))}function _a(e){var n;const t=(n=e.transactions)==null?void 0:n.map(r=>typeof r=="string"?r:oi(r));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:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Af=ri("block",_a);async function Fr(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:s}={}){var f,l,d;const i=r??"latest",o=s??!1,a=n!==void 0?H(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,o]},{dedupe:!0}):c=await e.request({method:"eth_getBlockByNumber",params:[a||i,o]},{dedupe:!!a}),!c)throw new xf({blockHash:t,blockNumber:n});return(((d=(l=(f=e.chain)==null?void 0:f.formatters)==null?void 0:l.block)==null?void 0:d.format)||_a)(c)}async function xa(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Tf(e,t){var i,o;const{block:n,chain:r=e.chain,request:s}=t||{};try{const a=((i=r==null?void 0:r.fees)==null?void 0:i.maxPriorityFeePerGas)??((o=r==null?void 0:r.fees)==null?void 0:o.defaultPriorityFee);if(typeof a=="function"){const u=n||await Ae(e,Fr,"getBlock")({}),f=await a({block:u,client:e,request:s});if(f===null)throw new Error;return f}if(typeof a<"u")return a;const c=await e.request({method:"eth_maxPriorityFeePerGas"});return et(c)}catch{const[a,c]=await Promise.all([n?Promise.resolve(n):Ae(e,Fr,"getBlock")({}),Ae(e,xa,"getGasPrice")({})]);if(typeof a.baseFeePerGas!="bigint")throw new ii;const u=c-a.baseFeePerGas;return u<0n?0n:u}}async function Yi(e,t){var d,p;const{block:n,chain:r=e.chain,request:s,type:i="eip1559"}=t||{},o=await(async()=>{var v,g;return typeof((v=r==null?void 0:r.fees)==null?void 0:v.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):((g=r==null?void 0:r.fees)==null?void 0:g.baseFeeMultiplier)??1.2})();if(o<1)throw new wf;const c=10**(((d=o.toString().split(".")[1])==null?void 0:d.length)??0),u=v=>v*BigInt(Math.ceil(o*c))/BigInt(c),f=n||await Ae(e,Fr,"getBlock")({});if(typeof((p=r==null?void 0:r.fees)==null?void 0:p.estimateFeesPerGas)=="function"){const v=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:u,request:s,type:i});if(v!==null)return v}if(i==="eip1559"){if(typeof f.baseFeePerGas!="bigint")throw new ii;const v=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await Tf(e,{block:f,chain:r,request:s}),g=u(f.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??g+v,maxPriorityFeePerGas:v}}return{gasPrice:(s==null?void 0:s.gasPrice)??u(await Ae(e,xa,"getGasPrice")({}))}}async function If(e,{address:t,blockTag:n="latest",blockNumber:r}){const s=await e.request({method:"eth_getTransactionCount",params:[t,r?H(r):n]},{dedupe:!!r});return It(s)}function ai(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>ft(i)):e.blobs,s=[];for(const i of r)s.push(Uint8Array.from(t.blobToKzgCommitment(i)));return n==="bytes"?s:s.map(i=>xe(i))}function ci(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(o=>ft(o)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(o=>ft(o)):e.commitments,i=[];for(let o=0;o<r.length;o++){const a=r[o],c=s[o];i.push(Uint8Array.from(t.computeBlobKzgProof(a,c)))}return n==="bytes"?i:i.map(o=>xe(o))}function Cf(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,a,r)}const kf=(e,t,n)=>e&t^~e&n,Bf=(e,t,n)=>e&t^e&n^t&n;class Sf extends Qo{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=ts(this.buffer)}update(t){Sr(this);const{view:n,buffer:r,blockLen:s}=this;t=Ws(t);const i=t.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const c=ts(t);for(;s<=i-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Sr(this),Zo(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let l=o;l<s;l++)n[l]=0;Cf(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=ts(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<u;l++)a.setUint32(4*l,f[l],i)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return t.length=s,t.pos=a,t.finished=i,t.destroyed=o,s%n&&t.buffer.set(r),t}}const Ff=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]),mt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),gt=new Uint32Array(64);class zf extends Sf{constructor(){super(64,32,8,!1),this.A=mt[0]|0,this.B=mt[1]|0,this.C=mt[2]|0,this.D=mt[3]|0,this.E=mt[4]|0,this.F=mt[5]|0,this.G=mt[6]|0,this.H=mt[7]|0}get(){const{A:t,B:n,C:r,D:s,E:i,F:o,G:a,H:c}=this;return[t,n,r,s,i,o,a,c]}set(t,n,r,s,i,o,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(t,n){for(let l=0;l<16;l++,n+=4)gt[l]=t.getUint32(n,!1);for(let l=16;l<64;l++){const d=gt[l-15],p=gt[l-2],v=We(d,7)^We(d,18)^d>>>3,g=We(p,17)^We(p,19)^p>>>10;gt[l]=g+gt[l-7]+v+gt[l-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:c,G:u,H:f}=this;for(let l=0;l<64;l++){const d=We(a,6)^We(a,11)^We(a,25),p=f+d+kf(a,c,u)+Ff[l]+gt[l]|0,g=(We(r,2)^We(r,13)^We(r,22))+Bf(r,s,i)|0;f=u,u=c,c=a,a=o+p|0,o=i,i=s,s=r,r=p+g|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,s,i,o,a,c,u,f)}roundClean(){gt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const qf=ea(()=>new zf);function Mf(e,t){return qf(Tt(e,{strict:!1})?Vs(e):e)}function Of(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=Mf(t);return s.set([n],0),r==="bytes"?s:xe(s)}function Pa(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const i of t)s.push(Of({commitment:i,to:r,version:n}));return s}const Xi=6,Ea=32,ui=4096,Aa=Ea*ui,Ji=Aa*Xi-1-1*ui*Xi,Ta=1;class Lf extends m{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Ia extends m{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class Gf extends m{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class Uf extends m{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${Ta}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function Rf(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?ft(e.data):e.data,r=ae(n);if(!r)throw new Ia;if(r>Ji)throw new Lf({maxSize:Ji,size:r});const s=[];let i=!0,o=0;for(;i;){const a=ei(new Uint8Array(Aa));let c=0;for(;c<ui;){const u=n.slice(o,o+(Ea-1));if(a.pushByte(0),a.pushBytes(u),u.length<31){a.pushByte(128),i=!1;break}c++,o+=31}s.push(a)}return t==="bytes"?s.map(a=>a.bytes):s.map(a=>xe(a.bytes))}function Ca(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??Rf({data:t,to:r}),i=e.commitments??ai({blobs:s,kzg:n,to:r}),o=e.proofs??ci({blobs:s,commitments:i,kzg:n,to:r}),a=[];for(let c=0;c<s.length;c++)a.push({blob:s[c],commitment:i[c],proof:o[c]});return a}function ka(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new Hl({transaction:e})}async function Dr(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return It(t)}const Ba=["blobVersionedHashes","chainId","fees","gas","nonce","type"];async function li(e,t){const{account:n=e.account,blobs:r,chain:s,gas:i,kzg:o,nonce:a,nonceManager:c,parameters:u=Ba,type:f}=t,l=n?pt(n):void 0,d={...t,...l?{from:l==null?void 0:l.address}:{}};let p;async function v(){return p||(p=await Ae(e,Fr,"getBlock")({blockTag:"latest"}),p)}let g;async function y(){return g||(s?s.id:typeof t.chainId<"u"?t.chainId:(g=await Ae(e,Dr,"getChainId")({}),g))}if((u.includes("blobVersionedHashes")||u.includes("sidecars"))&&r&&o){const E=ai({blobs:r,kzg:o});if(u.includes("blobVersionedHashes")){const O=Pa({commitments:E,to:"hex"});d.blobVersionedHashes=O}if(u.includes("sidecars")){const O=ci({blobs:r,commitments:E,kzg:o}),z=Ca({blobs:r,commitments:E,proofs:O,to:"hex"});d.sidecars=z}}if(u.includes("chainId")&&(d.chainId=await y()),u.includes("nonce")&&typeof a>"u"&&l)if(c){const E=await y();d.nonce=await c.consume({address:l.address,chainId:E,client:e})}else d.nonce=await Ae(e,If,"getTransactionCount")({address:l.address,blockTag:"pending"});if((u.includes("fees")||u.includes("type"))&&typeof f>"u")try{d.type=ka(d)}catch{const E=await v();d.type=typeof(E==null?void 0:E.baseFeePerGas)=="bigint"?"eip1559":"legacy"}if(u.includes("fees"))if(d.type!=="legacy"&&d.type!=="eip2930"){if(typeof d.maxFeePerGas>"u"||typeof d.maxPriorityFeePerGas>"u"){const E=await v(),{maxFeePerGas:O,maxPriorityFeePerGas:z}=await Yi(e,{block:E,chain:s,request:d});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas<z)throw new _f({maxPriorityFeePerGas:z});d.maxPriorityFeePerGas=z,d.maxFeePerGas=O}}else{if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")throw new ii;const E=await v(),{gasPrice:O}=await Yi(e,{block:E,chain:s,request:d,type:"legacy"});d.gasPrice=O}return u.includes("gas")&&typeof i>"u"&&(d.gas=await Ae(e,jf,"estimateGas")({...d,account:l?{address:l.address,type:"json-rpc"}:void 0})),$r(d),delete d.parameters,d}async function Nf(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n?H(n):void 0,i=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(i)}async function jf(e,t){var s,i,o;const n=t.account??e.account,r=n?pt(n):void 0;try{let te=function(J){const{block:ce,request:N,rpcStateOverride:q}=J;return e.request({method:"eth_estimateGas",params:q?[N,ce??"latest",q]:ce?[N,ce]:[N]})};const{accessList:a,authorizationList:c,blobs:u,blobVersionedHashes:f,blockNumber:l,blockTag:d,data:p,gas:v,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:E,maxPriorityFeePerGas:O,nonce:z,value:T,stateOverride:S,...x}=await li(e,{...t,parameters:(r==null?void 0:r.type)==="local"?void 0:["blobVersionedHashes"]}),A=(l?H(l):void 0)||d,B=bf(S),Y=await(async()=>{if(x.to)return x.to;if(c&&c.length>0)return await ga({authorization:c[0]}).catch(()=>{throw new m("`to` is required. Could not infer from `authorizationList`")})})();$r(t);const V=(o=(i=(s=e.chain)==null?void 0:s.formatters)==null?void 0:i.transactionRequest)==null?void 0:o.format,ee=(V||si)({...ba(x,{format:V}),from:r==null?void 0:r.address,accessList:a,authorizationList:c,blobs:u,blobVersionedHashes:f,data:p,gas:v,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:E,maxPriorityFeePerGas:O,nonce:z,to:Y,value:T});let he=BigInt(await te({block:A,request:ee,rpcStateOverride:B}));if(c){const J=await Nf(e,{address:ee.from}),ce=await Promise.all(c.map(async N=>{const{contractAddress:q}=N,R=await te({block:A,request:{authorizationList:void 0,data:p,from:r==null?void 0:r.address,to:q,value:H(J)},rpcStateOverride:B}).catch(()=>100000n);return 2n*BigInt(R)}));he+=ce.reduce((N,q)=>N+q,0n)}return he}catch(a){throw vf(a,{...t,account:r,chain:e.chain})}}function $f(e,{args:t,eventName:n}={}){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,...n?{args:t,eventName:n}:{}}}class Df extends m{constructor({chain:t,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t.id} – ${t.name}`],name:"ChainMismatchError"})}}class Hf extends m{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
45
+ `),{name:"ChainNotFoundError"})}}class Hr extends m{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const ss="/docs/contract/encodeDeployData";function Vf(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const s=t.find(o=>"type"in o&&o.type==="constructor");if(!s)throw new mu({docsPath:ss});if(!("inputs"in s))throw new qi({docsPath:ss});if(!s.inputs||s.inputs.length===0)throw new qi({docsPath:ss});const i=ca(s.inputs,n);return ht([r,i])}async function Wf(e){return new Promise(t=>setTimeout(t,e))}class lr extends m{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
46
+ `),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class is extends m{constructor({docsPath:t,metaMessages:n,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:t,metaMessages:n,name:"AccountTypeNotSupportedError"})}}function Sa({chain:e,currentChainId:t}){if(!e)throw new Hf;if(t!==e.id)throw new Df({chain:e,currentChainId:t})}function Kf(e,{docsPath:t,...n}){const r=(()=>{const s=ya(e,n);return s instanceof ni?e:s})();return new Wl(r,{docsPath:t,...n})}async function Fa(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}async function fi(e,t){var E,O,z,T;const{account:n=e.account,chain:r=e.chain,accessList:s,authorizationList:i,blobs:o,data:a,gas:c,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:d,nonce:p,value:v,...g}=t;if(!n)throw new lr({docsPath:"/docs/actions/wallet/sendTransaction"});const y=pt(n);try{$r(t);const S=await(async()=>{if(t.to)return t.to;if(i&&i.length>0)return await ga({authorization:i[0]}).catch(()=>{throw new m("`to` is required. Could not infer from `authorizationList`.")})})();if(y.type==="json-rpc"){let x;r!==null&&(x=await Ae(e,Dr,"getChainId")({}),Sa({currentChainId:x,chain:r}));const G=(z=(O=(E=e.chain)==null?void 0:E.formatters)==null?void 0:O.transactionRequest)==null?void 0:z.format,B=(G||si)({...ba(g,{format:G}),accessList:s,authorizationList:i,blobs:o,chainId:x,data:a,from:y.address,gas:c,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:d,nonce:p,to:S,value:v});return await e.request({method:"eth_sendTransaction",params:[B]},{retryCount:0})}if(y.type==="local"){const x=await Ae(e,li,"prepareTransactionRequest")({account:y,accessList:s,authorizationList:i,blobs:o,chain:r,data:a,gas:c,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:d,nonce:p,nonceManager:y.nonceManager,parameters:[...Ba,"sidecars"],value:v,...g,to:S}),G=(T=r==null?void 0:r.serializers)==null?void 0:T.transaction,A=await y.signTransaction(x,{serializer:G});return await Ae(e,Fa,"sendRawTransaction")({serializedTransaction:A})}throw y.type==="smart"?new is({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new is({docsPath:"/docs/actions/wallet/sendTransaction",type:y.type})}catch(S){throw S instanceof is?S:Kf(S,{...t,account:y,chain:t.chain||void 0})}}async function Yf(e,t){const{abi:n,account:r=e.account,address:s,args:i,dataSuffix:o,functionName:a,...c}=t;if(!r)throw new lr({docsPath:"/docs/contract/writeContract"});const u=pt(r),f=wl({abi:n,args:i,functionName:a});try{return await Ae(e,fi,"sendTransaction")({data:`${f}${o?o.replace("0x",""):""}`,to:s,account:u,...c})}catch(l){throw rf(l,{abi:n,address:s,args:i,docsPath:"/docs/contract/writeContract",functionName:a,sender:u.address})}}async function Xf(e,{chain:t}){const{id:n,name:r,nativeCurrency:s,rpcUrls:i,blockExplorers:o}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:H(n),chainName:r,nativeCurrency:s,rpcUrls:i.default.http,blockExplorerUrls:o?Object.values(o).map(({url:a})=>a):void 0}]},{dedupe:!0,retryCount:0})}const Ss=256;let gr=Ss,yr;function za(e=11){if(!yr||gr+e>Ss*2){yr="",gr=0;for(let t=0;t<Ss;t++)yr+=(256+Math.random()*256|0).toString(16).substring(1)}return yr.substring(gr,gr+++e)}function Jf(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,ccipRead:r,key:s="base",name:i="Base Client",pollingInterval:o=4e3,type:a="base"}=e,c=e.chain,u=e.account?pt(e.account):void 0,{config:f,request:l,value:d}=e.transport({chain:c,pollingInterval:o}),p={...f,...d},v={account:u,batch:t,cacheTime:n,ccipRead:r,chain:c,key:s,name:i,pollingInterval:o,request:l,transport:p,type:a,uid:za()};function g(y){return E=>{const O=E(y);for(const T in v)delete O[T];const z={...y,...O};return Object.assign(z,{extend:g(z)})}}return Object.assign(v,{extend:g(v)})}const br=new Ys(8192);function Zf(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(br.get(n))return br.get(n);const r=e().finally(()=>br.delete(n));return br.set(n,r),r}function Qf(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((s,i)=>{const o=async({count:a=0}={})=>{const c=async({error:u})=>{const f=typeof t=="function"?t({count:a,error:u}):t;f&&await Wf(f),o({count:a+1})};try{const u=await e();s(u)}catch(u){if(a<n&&await r({count:a,error:u}))return c({error:u});i(u)}};o()})}function ed(e,t={}){return async(n,r={})=>{const{dedupe:s=!1,retryDelay:i=150,retryCount:o=3,uid:a}={...t,...r},c=s?ar(Rr(`${a}.${ur(n)}`)):void 0;return Zf(()=>Qf(async()=>{try{return await e(n)}catch(u){const f=u;switch(f.code){case Ln.code:throw new Ln(f);case Gn.code:throw new Gn(f);case Un.code:throw new Un(f,{method:n.method});case Rn.code:throw new Rn(f);case Ht.code:throw new Ht(f);case Nn.code:throw new Nn(f);case jn.code:throw new jn(f);case $n.code:throw new $n(f);case Dn.code:throw new Dn(f);case Hn.code:throw new Hn(f,{method:n.method});case xn.code:throw new xn(f);case Vn.code:throw new Vn(f);case an.code:throw new an(f);case Wn.code:throw new Wn(f);case Kn.code:throw new Kn(f);case Yn.code:throw new Yn(f);case Xn.code:throw new Xn(f);case Jn.code:throw new Jn(f);case 5e3:throw new an(f);default:throw u instanceof m?u:new tf(f)}}},{delay:({count:u,error:f})=>{var l;if(f&&f instanceof pa){const d=(l=f==null?void 0:f.headers)==null?void 0:l.get("Retry-After");if(d!=null&&d.match(/\d/))return Number.parseInt(d)*1e3}return~~(1<<u)*i},retryCount:o,shouldRetry:({error:u})=>td(u)}),{enabled:s,id:c})}}function td(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===xn.code||e.code===Ht.code:e instanceof pa&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function nd({key:e,name:t,request:n,retryCount:r=3,retryDelay:s=150,timeout:i,type:o},a){const c=za();return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:s,timeout:i,type:o},request:ed(n,{retryCount:r,retryDelay:s,uid:c}),value:a}}function rd(e,t={}){const{key:n="custom",name:r="Custom Provider",retryDelay:s}=t;return({retryCount:i})=>nd({key:n,name:r,request:e.request.bind(e),retryCount:t.retryCount??i,retryDelay:s,type:"custom"})}function Bt(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const sd=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,id=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function od(e){const{domain:t,message:n,primaryType:r,types:s}=e,i=(c,u)=>{const f={...u};for(const l of c){const{name:d,type:p}=l;p==="address"&&(f[d]=f[d].toLowerCase())}return f},o=s.EIP712Domain?t?i(s.EIP712Domain,t):{}:{},a=(()=>{if(r!=="EIP712Domain")return i(s[r],n)})();return ur({domain:o,message:a,primaryType:r,types:s})}function ad(e){const{domain:t,message:n,primaryType:r,types:s}=e,i=(o,a)=>{for(const c of o){const{name:u,type:f}=c,l=a[u],d=f.match(id);if(d&&(typeof l=="number"||typeof l=="bigint")){const[g,y,E]=d;H(l,{signed:y==="int",size:Number.parseInt(E)/8})}if(f==="address"&&typeof l=="string"&&!_e(l))throw new Be({address:l});const p=f.match(sd);if(p){const[g,y]=p;if(y&&ae(l)!==Number.parseInt(y))throw new xu({expectedSize:Number.parseInt(y),givenSize:ae(l)})}const v=s[f];v&&i(v,l)}};s.EIP712Domain&&t&&i(s.EIP712Domain,t),r!=="EIP712Domain"&&i(s[r],n)}function cd({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},typeof(e==null?void 0:e.chainId)=="number"&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const ud={"0x0":"reverted","0x1":"success"};function ld(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>$f(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?It(e.transactionIndex):null,status:e.status?ud[e.status]:null,type:e.type?wa[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const fd=ri("transactionReceipt",ld);function dd(e){const{authorizationList:t}=e;if(t)for(const n of t){const{contractAddress:r,chainId:s}=n;if(!_e(r))throw new Be({address:r});if(s<=0)throw new Hr({chainId:s})}di(e)}function hd(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new Ia;for(const n of t){const r=ae(n),s=It(Mn(n,0,1));if(r!==32)throw new Gf({hash:n,size:r});if(s!==Ta)throw new Uf({hash:n,version:s})}}di(e)}function di(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new Hr({chainId:t});if(s&&!_e(s))throw new Be({address:s});if(r&&r>2n**256n-1n)throw new Vt({maxFeePerGas:r});if(n&&r&&n>r)throw new Zn({maxFeePerGas:r,maxPriorityFeePerGas:n})}function pd(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i}=e;if(t<=0)throw new Hr({chainId:t});if(i&&!_e(i))throw new Be({address:i});if(n||s)throw new m("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new Vt({maxFeePerGas:r})}function vd(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i}=e;if(i&&!_e(i))throw new Be({address:i});if(typeof t<"u"&&t<=0)throw new Hr({chainId:t});if(n||s)throw new m("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new Vt({maxFeePerGas:r})}function md(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{contractAddress:r,chainId:s,nonce:i,...o}=n;t.push([k(s),r,k(i),...fr({},o)])}return t}function Vr(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:s}=e[n];for(let i=0;i<s.length;i++)if(s[i].length-2!==64)throw new Vl({storageKey:s[i]});if(!_e(r,{strict:!1}))throw new Be({address:r});t.push([r,s])}return t}function gd(e,t){const n=ka(e);return n==="eip1559"?wd(e,t):n==="eip2930"?_d(e,t):n==="eip4844"?bd(e,t):n==="eip7702"?yd(e,t):xd(e,t)}function yd(e,t){const{authorizationList:n,chainId:r,gas:s,nonce:i,to:o,value:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:f,data:l}=e;dd(e);const d=Vr(f),p=md(n);return ht(["0x04",Ct([k(r),i?k(i):"0x",u?k(u):"0x",c?k(c):"0x",s?k(s):"0x",o??"0x",a?k(a):"0x",l??"0x",d,p,...fr(e,t)])])}function bd(e,t){const{chainId:n,gas:r,nonce:s,to:i,value:o,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:f,data:l}=e;hd(e);let d=e.blobVersionedHashes,p=e.sidecars;if(e.blobs&&(typeof d>"u"||typeof p>"u")){const z=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(x=>xe(x)),T=e.kzg,S=ai({blobs:z,kzg:T});if(typeof d>"u"&&(d=Pa({commitments:S})),typeof p>"u"){const x=ci({blobs:z,commitments:S,kzg:T});p=Ca({blobs:z,commitments:S,proofs:x})}}const v=Vr(f),g=[k(n),s?k(s):"0x",u?k(u):"0x",c?k(c):"0x",r?k(r):"0x",i??"0x",o?k(o):"0x",l??"0x",v,a?k(a):"0x",d??[],...fr(e,t)],y=[],E=[],O=[];if(p)for(let z=0;z<p.length;z++){const{blob:T,commitment:S,proof:x}=p[z];y.push(T),E.push(S),O.push(x)}return ht(["0x03",Ct(p?[g,y,E,O]:g)])}function wd(e,t){const{chainId:n,gas:r,nonce:s,to:i,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:u,data:f}=e;di(e);const l=Vr(u),d=[k(n),s?k(s):"0x",c?k(c):"0x",a?k(a):"0x",r?k(r):"0x",i??"0x",o?k(o):"0x",f??"0x",l,...fr(e,t)];return ht(["0x02",Ct(d)])}function _d(e,t){const{chainId:n,gas:r,data:s,nonce:i,to:o,value:a,accessList:c,gasPrice:u}=e;pd(e);const f=Vr(c),l=[k(n),i?k(i):"0x",u?k(u):"0x",r?k(r):"0x",o??"0x",a?k(a):"0x",s??"0x",f,...fr(e,t)];return ht(["0x01",Ct(l)])}function xd(e,t){const{chainId:n=0,gas:r,data:s,nonce:i,to:o,value:a,gasPrice:c}=e;vd(e);let u=[i?k(i):"0x",c?k(c):"0x",r?k(r):"0x",o??"0x",a?k(a):"0x",s??"0x"];if(t){const f=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const p=27n+(t.v===27n?0n:1n);if(t.v!==p)throw new Dl({v:t.v});return p})(),l=Dt(t.r),d=Dt(t.s);u=[...u,k(f),l==="0x00"?"0x":l,d==="0x00"?"0x":d]}else n>0&&(u=[...u,k(n),"0x","0x"]);return Ct(u)}function fr(e,t){const n=t??e,{v:r,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof s>"u")return[];const i=Dt(n.r),o=Dt(n.s);return[typeof s=="number"?s?k(1):"0x":r===0n?"0x":r===1n?k(1):r===27n?"0x":k(1),i==="0x00"?"0x":i,o==="0x00"?"0x":o]}function Pd(e,t){const{abi:n,args:r,bytecode:s,...i}=t,o=Vf({abi:n,args:r,bytecode:s});return fi(e,{...i,data:o})}async function Ed(e){var n;return((n=e.account)==null?void 0:n.type)==="local"?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map(r=>cr(r))}async function Ad(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}async function Td(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(n=>al(n))}async function Id(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}async function Cd(e,{account:t=e.account,message:n}){if(!t)throw new lr({docsPath:"/docs/actions/wallet/signMessage"});const r=pt(t);if(r.signMessage)return r.signMessage({message:n});const s=typeof n=="string"?Rr(n):n.raw instanceof Uint8Array?k(n.raw):n.raw;return e.request({method:"personal_sign",params:[s,r.address]},{retryCount:0})}async function kd(e,t){var u,f,l,d;const{account:n=e.account,chain:r=e.chain,...s}=t;if(!n)throw new lr({docsPath:"/docs/actions/wallet/signTransaction"});const i=pt(n);$r({account:i,...t});const o=await Ae(e,Dr,"getChainId")({});r!==null&&Sa({currentChainId:o,chain:r});const a=(r==null?void 0:r.formatters)||((u=e.chain)==null?void 0:u.formatters),c=((f=a==null?void 0:a.transactionRequest)==null?void 0:f.format)||si;return i.signTransaction?i.signTransaction({...s,chainId:o},{serializer:(d=(l=e.chain)==null?void 0:l.serializers)==null?void 0:d.transaction}):await e.request({method:"eth_signTransaction",params:[{...c(s),chainId:H(o),from:i.address}]},{retryCount:0})}async function Bd(e,t){const{account:n=e.account,domain:r,message:s,primaryType:i}=t;if(!n)throw new lr({docsPath:"/docs/actions/wallet/signTypedData"});const o=pt(n),a={EIP712Domain:cd({domain:r}),...t.types};if(ad({domain:r,message:s,primaryType:i,types:a}),o.signTypedData)return o.signTypedData({domain:r,message:s,primaryType:i,types:a});const c=od({domain:r,message:s,primaryType:i,types:a});return e.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function Sd(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:H(t)}]},{retryCount:0})}async function Fd(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}function zd(e){return{addChain:t=>Xf(e,t),deployContract:t=>Pd(e,t),getAddresses:()=>Ed(e),getChainId:()=>Dr(e),getPermissions:()=>Ad(e),prepareTransactionRequest:t=>li(e,t),requestAddresses:()=>Td(e),requestPermissions:t=>Id(e,t),sendRawTransaction:t=>Fa(e,t),sendTransaction:t=>fi(e,t),signMessage:t=>Cd(e,t),signTransaction:t=>kd(e,t),signTypedData:t=>Bd(e,t),switchChain:t=>Sd(e,t),watchAsset:t=>Fd(e,t),writeContract:t=>Yf(e,t)}}function qd(e){const{key:t="wallet",name:n="Wallet Client",transport:r}=e;return Jf({...e,key:t,name:n,transport:r,type:"walletClient"}).extend(zd)}const Md={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},Od={block:Af({format(e){var n;return{transactions:(n=e.transactions)==null?void 0:n.map(r=>{if(typeof r=="string")return r;const s=oi(r);return s.typeHex==="0x7e"&&(s.isSystemTx=r.isSystemTx,s.mint=r.mint?et(r.mint):void 0,s.sourceHash=r.sourceHash,s.type="deposit"),s}),stateRoot:e.stateRoot}}}),transaction:Pf({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?et(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:fd({format(e){return{l1GasPrice:e.l1GasPrice?et(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?et(e.l1GasUsed):null,l1Fee:e.l1Fee?et(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function Ld(e,t){return Rd(e)?Ud(e):gd(e,t)}const Gd={transaction:Ld};function Ud(e){Nd(e);const{sourceHash:t,data:n,from:r,gas:s,isSystemTx:i,mint:o,to:a,value:c}=e,u=[t,r,a??"0x",o?k(o):"0x",c?k(c):"0x",s?k(s):"0x",i?"0x1":"0x",n??"0x"];return ht(["0x7e",Ct(u)])}function Rd(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function Nd(e){const{from:t,to:n}=e;if(t&&!_e(t))throw new Be({address:t});if(n&&!_e(n))throw new Be({address:n})}const zr={contracts:Md,formatters:Od,serializers:Gd},jd=Bt({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),$d=Bt({id:43114,name:"Avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),wr=1,Dd=Bt({...zr,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...zr.contracts,l2OutputOracle:{[wr]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[wr]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[wr]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:wr}),Hd=Bt({id:56,name:"BNB Smart Chain",nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://rpc.ankr.com/bsc"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),qa=Bt({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),kn=1,Vd=Bt({...zr,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...zr.contracts,disputeGameFactory:{[kn]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[kn]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[kn]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[kn]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:kn}),Wd=Bt({id:137,name:"Polygon",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),Kd=Bt({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.sepolia.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0});function Yd(e){if(typeof window>"u")return;const t=n=>e(n.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)}function Xd(){const e=new Set;let t=[];const n=()=>Yd(s=>{t.some(({info:i})=>i.uuid===s.info.uuid)||(t=[...t,s],e.forEach(i=>i(t,{added:[s]})))});let r=n();return{_listeners(){return e},clear(){e.forEach(s=>s([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),r==null||r()},findProvider({rdns:s}){return t.find(i=>i.info.rdns===s)},getProviders(){return t},reset(){this.clear(),r==null||r(),r=n()},subscribe(s,{emitImmediately:i}={}){return e.add(s),i&&s(t,{added:t}),()=>e.delete(s)}}}const Ma={1:qa,11155111:Kd,137:Wd,42161:jd,10:Vd,8453:Dd,43114:$d,56:Hd};let os=null;function Jd(){return os===null&&typeof window<"u"&&(os=Xd()),os}function hi(){var t;const e=((t=Jd())==null?void 0:t.getProviders())??[];return e.length>0?e[0]:null}function Kt(){const e=hi();return e?e.provider:window.ethereum??null}function pi(){return typeof window<"u"&&Kt()!==null}function Zd(){const e=hi();if(e)return e.info.name;const t=window.ethereum;return t?t.isMetaMask?"MetaMask":"Browser Wallet":"Unknown"}function Qd(){const e=hi();return(e==null?void 0:e.info.icon)??null}function vi(e){const t=Kt();if(!t)throw new Error("No wallet detected");const n=Ma[e]||qa;return qd({chain:n,transport:rd(t)})}async function mi(e){const t=Kt();if(!t)throw new Error("No wallet detected. Please install a browser wallet to continue.");const n=await t.request({method:"eth_requestAccounts"});if(!n||n.length===0)throw new Error("No accounts returned from wallet");return n[0]}async function dr(){const e=Kt();return e?await e.request({method:"eth_accounts"})||[]:[]}async function gi(e){const t=Kt();if(!t)throw new Error("No wallet detected");const n=`0x${e.toString(16)}`;try{await t.request({method:"wallet_switchEthereumChain",params:[{chainId:n}]})}catch(r){if((r==null?void 0:r.code)===4902){const s=Ma[e];if(s)await t.request({method:"wallet_addEthereumChain",params:[{chainId:n,chainName:s.name,nativeCurrency:s.nativeCurrency,rpcUrls:[s.rpcUrls.default.http[0]],blockExplorerUrls:s.blockExplorers?[s.blockExplorers.default.url]:void 0}]});else throw new Error(`Unknown chain ID: ${e}`)}else throw r}}function eh(e){const t=Kt();return t?(t.on("accountsChanged",e),()=>t.removeListener("accountsChanged",e)):()=>{}}async function yi(){const e=Kt();if(!e)throw new Error("No wallet detected");const t=await e.request({method:"eth_chainId"});return parseInt(t,16)}async function th(e){const t=vi(e.chainId),n=await dr();if(n.length===0)throw new Error("No connected account");return await t.sendTransaction({chain:null,account:n[0],to:e.to,value:e.value,data:e.data,gas:e.gasLimit,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas})}async function nh(e){const t=vi(e.chainId),n=await dr(),r=e.address||n[0];if(!r)throw new Error("No connected account");return await t.signMessage({account:r,message:e.message})}async function rh(e){const t=vi(e.chainId),n=await dr(),r=e.address||n[0];if(!r)throw new Error("No connected account");return await t.signTypedData({account:r,domain:e.domain,types:e.types,primaryType:e.primaryType,message:e.message})}var sh=j('<div class="chain-badge svelte-a3gxm7"> </div>'),ih=j('<div class="required-address svelte-a3gxm7">Required: <span class="address svelte-a3gxm7"> </span></div>'),oh=j('<div class="error-box svelte-a3gxm7"><p>No wallet detected</p> <p class="small svelte-a3gxm7">Please install a browser wallet to continue.</p></div>'),ah=j('<div class="success-box svelte-a3gxm7"><p>Connected!</p> <p class="address svelte-a3gxm7"> </p> <p class="small svelte-a3gxm7">This window will close automatically...</p></div>'),ch=j('<div class="error-box svelte-a3gxm7"><p>Wrong Address</p> <p class="small svelte-a3gxm7">Expected: <span class="address svelte-a3gxm7"> </span></p> <p class="small svelte-a3gxm7">Connected: <span class="address svelte-a3gxm7"> </span></p> <p class="small svelte-a3gxm7">Switch to the correct account in your wallet, or click Try Again.</p></div> <div class="buttons svelte-a3gxm7"><button class="btn-secondary svelte-a3gxm7">Cancel</button> <button class="btn-primary svelte-a3gxm7">Try Again</button></div>',1),uh=j('<div class="error-box svelte-a3gxm7"><p>Connection Failed</p> <p class="small svelte-a3gxm7"> </p></div> <div class="buttons svelte-a3gxm7"><button class="btn-secondary svelte-a3gxm7">Cancel</button> <button class="btn-primary svelte-a3gxm7">Try Again</button></div>',1),lh=j('<img class="wallet-icon svelte-a3gxm7"/>'),fh=j('<div class="wallet-info svelte-a3gxm7"><!> <span class="wallet-name svelte-a3gxm7"> </span> detected</div> <div class="buttons svelte-a3gxm7"><button class="btn-secondary svelte-a3gxm7">Cancel</button> <button class="btn-primary svelte-a3gxm7"><!></button></div>',1),dh=j('<div class="container svelte-a3gxm7"><div class="card svelte-a3gxm7"><div class="icon svelte-a3gxm7"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-a3gxm7"><path d="M21 18v1c0 1.1-.9 2-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h14c1.1 0 2 .9 2 2v1h-9a2 2 0 00-2 2v8a2 2 0 002 2h9zm-9-2h10V8H12v8zm4-2.5a1.5 1.5 0 10-3 0 1.5 1.5 0 003 0z"></path></svg></div> <h1 class="svelte-a3gxm7">Connect Wallet</h1> <p class="description svelte-a3gxm7">An application is requesting to connect to your wallet.</p> <!> <!> <!></div></div>');function hh(e,t){sr(t,!0);let n=oe("idle"),r=oe(""),s=oe("");const i=t.request.address,o=pi(),a=o?Zd():"",c=o?Qd():null;let u=null;function f(A,B){return A.toLowerCase()===B.toLowerCase()}async function l(A){t.request.chainId&&await yi()!==t.request.chainId&&(C(n,"switching"),await gi(t.request.chainId)),u&&(u(),u=null),await $s(t.request.id,A),C(n,"success"),C(s,A,!0),setTimeout(()=>window.close(),1500)}function d(){u&&u(),u=eh(async A=>{if(!i||A.length===0)return;const B=A[0];if(f(B,i))try{await l(B)}catch(Y){C(r,Y instanceof Error?Y.message:"Connection failed",!0),C(n,"error"),await Rt(t.request.id,b(r)).catch(()=>{})}else C(s,B,!0)})}async function p(){C(n,"connecting"),C(r,"");try{const A=await mi();if(C(s,A,!0),i&&!f(A,i)){C(n,"wrong_address"),d();return}await l(A)}catch(A){C(r,A instanceof Error?A.message:"Connection failed",!0),C(n,"error"),await Rt(t.request.id,b(r)).catch(()=>{})}}function v(){u&&(u(),u=null),Rt(t.request.id,"User cancelled").catch(()=>{}),window.close()}au(()=>{u&&(u(),u=null)});var g=dh(),y=_(g),E=I(_(y),6);{var O=A=>{var B=sh(),Y=_(B);Q(()=>ne(Y,`Chain ID: ${t.request.chainId??""}`)),w(A,B)};U(E,A=>{t.request.chainId&&A(O)})}var z=I(E,2);{var T=A=>{var B=ih(),Y=I(_(B)),V=_(Y);Q(()=>ne(V,i)),w(A,B)};U(z,A=>{i&&b(n)!=="success"&&b(n)!=="wrong_address"&&A(T)})}var S=I(z,2);{var x=A=>{var B=oh();w(A,B)},G=A=>{var B=me(),Y=X(B);{var V=ee=>{var te=ah(),he=I(_(te),2),J=_(he);Q(()=>ne(J,b(s))),w(ee,te)},se=ee=>{var te=me(),he=X(te);{var J=N=>{var q=ch(),R=X(q),$=I(_(R),2),ue=I(_($)),D=_(ue),Z=I($,2),ie=I(_(Z)),be=_(ie),Tn=I(R,2),Yt=_(Tn);Yt.__click=v;var Xt=I(Yt,2);Xt.__click=p,Q(()=>{ne(D,i),ne(be,b(s))}),w(N,q)},ce=N=>{var q=me(),R=X(q);{var $=D=>{var Z=uh(),ie=X(Z),be=I(_(ie),2),Tn=_(be),Yt=I(ie,2),Xt=_(Yt);Xt.__click=v;var Wr=I(Xt,2);Wr.__click=p,Q(()=>ne(Tn,b(r))),w(D,Z)},ue=D=>{var Z=fh(),ie=X(Z),be=_(ie);{var Tn=He=>{var vt=lh();Q(()=>{Si(vt,"src",c),Si(vt,"alt",a)}),w(He,vt)};U(be,He=>{c&&He(Tn)})}var Yt=I(be,2),Xt=_(Yt),Wr=I(ie,2),wi=_(Wr);wi.__click=v;var Kr=I(wi,2);Kr.__click=p;var Oa=_(Kr);{var La=He=>{var vt=ut("Connecting...");w(He,vt)},Ga=He=>{var vt=me(),Ua=X(vt);{var Ra=Jt=>{var Yr=ut("Switching Chain...");w(Jt,Yr)},Na=Jt=>{var Yr=ut("Connect");w(Jt,Yr)};U(Ua,Jt=>{b(n)==="switching"?Jt(Ra):Jt(Na,!1)},!0)}w(He,vt)};U(Oa,He=>{b(n)==="connecting"?He(La):He(Ga,!1)})}Q(()=>{ne(Xt,a),Kr.disabled=b(n)==="connecting"||b(n)==="switching"}),w(D,Z)};U(R,D=>{b(n)==="error"?D($):D(ue,!1)},!0)}w(N,q)};U(he,N=>{b(n)==="wrong_address"?N(J):N(ce,!1)},!0)}w(ee,te)};U(Y,ee=>{b(n)==="success"?ee(V):ee(se,!1)},!0)}w(A,B)};U(S,A=>{o?A(G,!1):A(x)})}w(e,g),ir()}js(["click"]);var ph=j('<div class="success-box svelte-1g1z4he"><p>Transaction Sent!</p> <p class="hash svelte-1g1z4he"> </p> <p class="small svelte-1g1z4he">This window will close automatically...</p></div>'),vh=j('<div class="error-box svelte-1g1z4he"><p>Transaction Failed</p> <p class="small svelte-1g1z4he"> </p></div>'),mh=j('<div class="detail-row svelte-1g1z4he"><span class="label svelte-1g1z4he">Data</span> <span class="value mono svelte-1g1z4he"> </span></div>'),gh=j('<div class="detail-row svelte-1g1z4he"><span class="label svelte-1g1z4he">Chain ID</span> <span class="value svelte-1g1z4he"> </span></div>'),yh=j('<div class="detail-row svelte-1g1z4he"><span class="label svelte-1g1z4he">Gas Limit</span> <span class="value svelte-1g1z4he"> </span></div>'),bh=j('<div class="tx-details svelte-1g1z4he"><div class="detail-row svelte-1g1z4he"><span class="label svelte-1g1z4he">To</span> <span class="value address svelte-1g1z4he"> </span></div> <div class="detail-row svelte-1g1z4he"><span class="label svelte-1g1z4he">Value</span> <span class="value svelte-1g1z4he"> </span></div> <!> <!> <!></div>'),wh=j('<div class="error-box svelte-1g1z4he"><p>No wallet detected</p> <p class="small svelte-1g1z4he">Please install a browser wallet to continue.</p></div>'),_h=j('<div class="connected-badge svelte-1g1z4he"> </div>'),xh=j('<!> <div class="buttons svelte-1g1z4he"><button class="btn-secondary svelte-1g1z4he">Reject</button> <button class="btn-primary svelte-1g1z4he"><!></button></div>',1),Ph=j('<div class="container svelte-1g1z4he"><div class="card svelte-1g1z4he"><div class="icon svelte-1g1z4he"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-1g1z4he"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"></path></svg></div> <h1 class="svelte-1g1z4he">Send Transaction</h1> <!> <!></div></div>');function Eh(e,t){sr(t,!0);let n=oe("idle"),r=oe(""),s=oe(""),i=oe("");const o=pi(),a=ms(()=>t.request.value?ti(BigInt(t.request.value)):"0"),c=ms(()=>t.request.data?t.request.data.length>66?`${t.request.data.slice(0,66)}...`:t.request.data:"None");async function u(){const T=await dr();if(T.length>0)return C(i,T[0],!0),T[0];C(n,"connecting");const S=await mi();return C(i,S,!0),S}async function f(){C(n,"connecting"),C(r,"");try{await u(),t.request.chainId&&await yi()!==t.request.chainId&&await gi(t.request.chainId),C(n,"signing");const T=await th({to:t.request.to,value:t.request.value?BigInt(t.request.value):void 0,data:t.request.data,chainId:t.request.chainId||1,gasLimit:t.request.gasLimit?BigInt(t.request.gasLimit):void 0,maxFeePerGas:t.request.maxFeePerGas?BigInt(t.request.maxFeePerGas):void 0,maxPriorityFeePerGas:t.request.maxPriorityFeePerGas?BigInt(t.request.maxPriorityFeePerGas):void 0});C(s,T,!0),await $s(t.request.id,T),C(n,"success"),setTimeout(()=>window.close(),2e3)}catch(T){C(r,T instanceof Error?T.message:"Transaction failed",!0),C(n,"error"),await Rt(t.request.id,b(r)).catch(()=>{})}}function l(){Rt(t.request.id,"User rejected transaction").catch(()=>{}),window.close()}var d=Ph(),p=_(d),v=I(_(p),4);{var g=T=>{var S=ph(),x=I(_(S),2),G=_(x);Q(()=>ne(G,b(s))),w(T,S)},y=T=>{var S=me(),x=X(S);{var G=B=>{var Y=vh(),V=I(_(Y),2),se=_(V);Q(()=>ne(se,b(r))),w(B,Y)},A=B=>{var Y=bh(),V=_(Y),se=I(_(V),2),ee=_(se),te=I(V,2),he=I(_(te),2),J=_(he),ce=I(te,2);{var N=D=>{var Z=mh(),ie=I(_(Z),2),be=_(ie);Q(()=>ne(be,b(c))),w(D,Z)};U(ce,D=>{t.request.data&&t.request.data!=="0x"&&D(N)})}var q=I(ce,2);{var R=D=>{var Z=gh(),ie=I(_(Z),2),be=_(ie);Q(()=>ne(be,t.request.chainId)),w(D,Z)};U(q,D=>{t.request.chainId&&D(R)})}var $=I(q,2);{var ue=D=>{var Z=yh(),ie=I(_(Z),2),be=_(ie);Q(()=>ne(be,t.request.gasLimit)),w(D,Z)};U($,D=>{t.request.gasLimit&&D(ue)})}Q(()=>{ne(ee,t.request.to),ne(J,`${b(a)??""} ETH`)}),w(B,Y)};U(x,B=>{b(n)==="error"?B(G):B(A,!1)},!0)}w(T,S)};U(v,T=>{b(n)==="success"?T(g):T(y,!1)})}var E=I(v,2);{var O=T=>{var S=wh();w(T,S)},z=T=>{var S=me(),x=X(S);{var G=A=>{var B=xh(),Y=X(B);{var V=N=>{var q=_h(),R=_(q);Q(($,ue)=>ne(R,`Connected: ${$??""}...${ue??""}`),[()=>b(i).slice(0,6),()=>b(i).slice(-4)]),w(N,q)};U(Y,N=>{b(i)&&N(V)})}var se=I(Y,2),ee=_(se);ee.__click=l;var te=I(ee,2);te.__click=f;var he=_(te);{var J=N=>{var q=ut("Connecting...");w(N,q)},ce=N=>{var q=me(),R=X(q);{var $=D=>{var Z=ut("Confirm in Wallet...");w(D,Z)},ue=D=>{var Z=ut("Sign & Send");w(D,Z)};U(R,D=>{b(n)==="signing"?D($):D(ue,!1)},!0)}w(N,q)};U(he,N=>{b(n)==="connecting"?N(J):N(ce,!1)})}Q(()=>te.disabled=b(n)==="connecting"||b(n)==="signing"),w(A,B)};U(x,A=>{b(n)!=="success"&&A(G)},!0)}w(T,S)};U(E,T=>{o?T(z,!1):T(O)})}w(e,d),ir()}js(["click"]);var Ah=j('<div class="success-box svelte-tqpuk1"><p>Signed Successfully!</p> <p class="signature svelte-tqpuk1"> </p> <p class="small svelte-tqpuk1">This window will close automatically...</p></div>'),Th=j('<div class="error-box svelte-tqpuk1"><p>Signing Failed</p> <p class="small svelte-tqpuk1"> </p></div>'),Ih=j('<div class="label svelte-tqpuk1">Typed Data (EIP-712)</div> <pre class="typed-data svelte-tqpuk1"> </pre>',1),Ch=j('<div class="label svelte-tqpuk1">Message</div> <div class="message svelte-tqpuk1"> </div>',1),kh=j('<div class="chain-badge svelte-tqpuk1"> </div>'),Bh=j('<div class="message-box svelte-tqpuk1"><!></div> <!>',1),Sh=j('<div class="error-box svelte-tqpuk1"><p>No wallet detected</p> <p class="small svelte-tqpuk1">Please install a browser wallet to continue.</p></div>'),Fh=j('<div class="connected-badge svelte-tqpuk1"> </div>'),zh=j('<!> <div class="buttons svelte-tqpuk1"><button class="btn-secondary svelte-tqpuk1">Reject</button> <button class="btn-primary svelte-tqpuk1"><!></button></div>',1),qh=j('<div class="container svelte-tqpuk1"><div class="card svelte-tqpuk1"><div class="icon svelte-tqpuk1"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-tqpuk1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg></div> <h1 class="svelte-tqpuk1"> </h1> <!> <!></div></div>');function Mh(e,t){sr(t,!0);let n=oe("idle"),r=oe(""),s=oe(""),i=oe("");const o=pi(),a=t.request.type==="sign_typed_data",c=ms(()=>a&&t.request.domain?JSON.stringify({domain:t.request.domain,primaryType:t.request.primaryType,message:t.request.message},null,2):"");async function u(){const x=await dr();if(x.length>0)return C(i,x[0],!0),x[0];C(n,"connecting");const G=await mi();return C(i,G,!0),G}async function f(){C(n,"connecting"),C(r,"");try{const x=await u();t.request.chainId&&await yi()!==t.request.chainId&&await gi(t.request.chainId),C(n,"signing");let G;if(a&&t.request.domain&&t.request.types&&t.request.primaryType&&t.request.message)G=await rh({domain:{name:t.request.domain.name,version:t.request.domain.version,chainId:t.request.domain.chainId,verifyingContract:t.request.domain.verifyingContract,salt:t.request.domain.salt},types:t.request.types,primaryType:t.request.primaryType,message:t.request.message,address:t.request.address||x,chainId:t.request.chainId||1});else if(t.request.message)G=await nh({message:t.request.message,address:t.request.address||x,chainId:t.request.chainId||1});else throw new Error("Invalid signing request");C(s,G,!0),await $s(t.request.id,G),C(n,"success"),setTimeout(()=>window.close(),2e3)}catch(x){C(r,x instanceof Error?x.message:"Signing failed",!0),C(n,"error"),await Rt(t.request.id,b(r)).catch(()=>{})}}function l(){Rt(t.request.id,"User rejected signing").catch(()=>{}),window.close()}var d=qh(),p=_(d),v=I(_(p),2),g=_(v),y=I(v,2);{var E=x=>{var G=Ah(),A=I(_(G),2),B=_(A);Q(()=>ne(B,b(s))),w(x,G)},O=x=>{var G=me(),A=X(G);{var B=V=>{var se=Th(),ee=I(_(se),2),te=_(ee);Q(()=>ne(te,b(r))),w(V,se)},Y=V=>{var se=Bh(),ee=X(se),te=_(ee);{var he=q=>{var R=Ih(),$=I(X(R),2),ue=_($);Q(()=>ne(ue,b(c))),w(q,R)},J=q=>{var R=Ch(),$=I(X(R),2),ue=_($);Q(()=>ne(ue,t.request.message)),w(q,R)};U(te,q=>{a?q(he):q(J,!1)})}var ce=I(ee,2);{var N=q=>{var R=kh(),$=_(R);Q(()=>ne($,`Chain ID: ${t.request.chainId??""}`)),w(q,R)};U(ce,q=>{t.request.chainId&&q(N)})}w(V,se)};U(A,V=>{b(n)==="error"?V(B):V(Y,!1)},!0)}w(x,G)};U(y,x=>{b(n)==="success"?x(E):x(O,!1)})}var z=I(y,2);{var T=x=>{var G=Sh();w(x,G)},S=x=>{var G=me(),A=X(G);{var B=Y=>{var V=zh(),se=X(V);{var ee=R=>{var $=Fh(),ue=_($);Q((D,Z)=>ne(ue,`Connected: ${D??""}...${Z??""}`),[()=>b(i).slice(0,6),()=>b(i).slice(-4)]),w(R,$)};U(se,R=>{b(i)&&R(ee)})}var te=I(se,2),he=_(te);he.__click=l;var J=I(he,2);J.__click=f;var ce=_(J);{var N=R=>{var $=ut("Connecting...");w(R,$)},q=R=>{var $=me(),ue=X($);{var D=ie=>{var be=ut("Confirm in Wallet...");w(ie,be)},Z=ie=>{var be=ut("Sign");w(ie,be)};U(ue,ie=>{b(n)==="signing"?ie(D):ie(Z,!1)},!0)}w(R,$)};U(ce,R=>{b(n)==="connecting"?R(N):R(q,!1)})}Q(()=>J.disabled=b(n)==="connecting"||b(n)==="signing"),w(Y,V)};U(A,Y=>{b(n)!=="success"&&Y(B)},!0)}w(x,G)};U(z,x=>{o?x(S,!1):x(T)})}Q(()=>ne(g,a?"Sign Typed Data":"Sign Message")),w(e,d),ir()}js(["click"]);var Oh=j('<div class="loading-container svelte-1n46o8q"><div class="spinner svelte-1n46o8q"></div> <p class="svelte-1n46o8q">Loading request...</p></div>'),Lh=j('<div class="error-container svelte-1n46o8q"><div class="error-icon svelte-1n46o8q">!</div> <h1 class="svelte-1n46o8q">Error</h1> <p class="svelte-1n46o8q"> </p></div>'),Gh=j(`<div class="error-container svelte-1n46o8q"><div class="error-icon svelte-1n46o8q">?</div> <h1 class="svelte-1n46o8q">Request Not Found</h1> <p class="svelte-1n46o8q">This signing request has expired or doesn't exist.</p> <p class="hint svelte-1n46o8q">You can close this window.</p></div>`),Uh=j('<div class="error-container svelte-1n46o8q"><div class="error-icon svelte-1n46o8q">?</div> <h1 class="svelte-1n46o8q">Unknown Request Type</h1> <p class="svelte-1n46o8q">This request type is not supported.</p></div>');function Rh(e,t){sr(t,!0);let n=oe(tn({type:"loading"}));function r(){const u=window.location.pathname.match(/^\/(connect|sign)\/([a-f0-9-]+)$/);return u?u[2]:null}$o(async()=>{const c=r();if(!c){C(n,{type:"not_found"},!0);return}try{const u=await du(c);C(n,{type:"request",request:u},!0)}catch(u){const f=u instanceof Error?u.message:"Failed to load request";f.includes("not found")||f.includes("404")?C(n,{type:"not_found"},!0):C(n,{type:"error",message:f},!0)}});var s=me(),i=X(s);{var o=c=>{var u=Oh();w(c,u)},a=c=>{var u=me(),f=X(u);{var l=p=>{var v=Lh(),g=I(_(v),4),y=_(g);Q(()=>ne(y,b(n).message)),w(p,v)},d=p=>{var v=me(),g=X(v);{var y=O=>{var z=Gh();w(O,z)},E=O=>{var z=me(),T=X(z);{var S=x=>{var G=me(),A=X(G);{var B=V=>{hh(V,{get request(){return b(n).request}})},Y=V=>{var se=me(),ee=X(se);{var te=J=>{Eh(J,{get request(){return b(n).request}})},he=J=>{var ce=me(),N=X(ce);{var q=$=>{Mh($,{get request(){return b(n).request}})},R=$=>{var ue=Uh();w($,ue)};U(N,$=>{b(n).request.type==="sign_message"||b(n).request.type==="sign_typed_data"?$(q):$(R,!1)},!0)}w(J,ce)};U(ee,J=>{b(n).request.type==="send_transaction"?J(te):J(he,!1)},!0)}w(V,se)};U(A,V=>{b(n).request.type==="connect"?V(B):V(Y,!1)})}w(x,G)};U(T,x=>{b(n).type==="request"&&x(S)},!0)}w(O,z)};U(g,O=>{b(n).type==="not_found"?O(y):O(E,!1)},!0)}w(p,v)};U(f,p=>{b(n).type==="error"?p(l):p(d,!1)},!0)}w(c,u)};U(i,c=>{b(n).type==="loading"?c(o):c(a,!1)})}w(e,s),ir()}ru(Rh,{target:document.getElementById("app")});export{Qo as H,Nr as b,Dh as c,Sr as e,$h as h,Hh as r,qf as s,Ws as t};
@@ -0,0 +1 @@
1
+ .container.svelte-a3gxm7{display:flex;justify-content:center;align-items:center;min-height:100vh;padding:20px}.card.svelte-a3gxm7{background:#ffffff0d;border:1px solid rgba(255,255,255,.1);border-radius:16px;padding:32px;max-width:400px;width:100%;text-align:center;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.icon.svelte-a3gxm7{width:64px;height:64px;margin:0 auto 20px;color:#6366f1}.icon.svelte-a3gxm7 svg:where(.svelte-a3gxm7){width:100%;height:100%}h1.svelte-a3gxm7{font-size:24px;font-weight:600;margin-bottom:12px;color:#fff}.description.svelte-a3gxm7{color:#9ca3af;margin-bottom:24px}.chain-badge.svelte-a3gxm7{display:inline-block;background:#6366f133;color:#a5b4fc;padding:6px 12px;border-radius:20px;font-size:14px;margin-bottom:24px}.required-address.svelte-a3gxm7{background:#eab3081a;border:1px solid rgba(234,179,8,.3);color:#fbbf24;padding:8px 12px;border-radius:8px;font-size:13px;margin-bottom:24px;word-break:break-all}.wallet-info.svelte-a3gxm7{display:flex;align-items:center;justify-content:center;gap:8px;color:#9ca3af;margin-bottom:24px}.wallet-icon.svelte-a3gxm7{width:24px;height:24px;border-radius:4px}.wallet-name.svelte-a3gxm7{color:#6366f1;font-weight:500}.buttons.svelte-a3gxm7{display:flex;gap:12px;justify-content:center}.btn-primary.svelte-a3gxm7,.btn-secondary.svelte-a3gxm7{padding:12px 24px;border-radius:8px;font-size:16px;font-weight:500;cursor:pointer;transition:all .2s;border:none}.btn-primary.svelte-a3gxm7{background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff}.btn-primary.svelte-a3gxm7:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 4px 12px #6366f166}.btn-primary.svelte-a3gxm7:disabled{opacity:.6;cursor:not-allowed}.btn-secondary.svelte-a3gxm7{background:#ffffff1a;color:#e0e0e0}.btn-secondary.svelte-a3gxm7:hover{background:#ffffff26}.success-box.svelte-a3gxm7,.error-box.svelte-a3gxm7{padding:16px;border-radius:8px;margin-bottom:20px}.success-box.svelte-a3gxm7{background:#22c55e1a;border:1px solid rgba(34,197,94,.3);color:#4ade80}.error-box.svelte-a3gxm7{background:#ef44441a;border:1px solid rgba(239,68,68,.3);color:#f87171}.address.svelte-a3gxm7{font-family:monospace;font-size:12px;word-break:break-all;margin-top:8px}.small.svelte-a3gxm7{font-size:12px;opacity:.8;margin-top:8px}.container.svelte-1g1z4he{display:flex;justify-content:center;align-items:center;min-height:100vh;padding:20px}.card.svelte-1g1z4he{background:#ffffff0d;border:1px solid rgba(255,255,255,.1);border-radius:16px;padding:32px;max-width:450px;width:100%;text-align:center;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.icon.svelte-1g1z4he{width:64px;height:64px;margin:0 auto 20px;color:#f59e0b}.icon.svelte-1g1z4he svg:where(.svelte-1g1z4he){width:100%;height:100%}h1.svelte-1g1z4he{font-size:24px;font-weight:600;margin-bottom:24px;color:#fff}.tx-details.svelte-1g1z4he{background:#0003;border-radius:12px;padding:16px;margin-bottom:24px;text-align:left}.detail-row.svelte-1g1z4he{display:flex;justify-content:space-between;align-items:flex-start;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.05)}.detail-row.svelte-1g1z4he:last-child{border-bottom:none}.label.svelte-1g1z4he{color:#9ca3af;font-size:14px;flex-shrink:0}.value.svelte-1g1z4he{color:#e0e0e0;font-size:14px;text-align:right;word-break:break-all;margin-left:16px}.value.address.svelte-1g1z4he{font-family:monospace;font-size:12px}.value.mono.svelte-1g1z4he{font-family:monospace;font-size:11px}.connected-badge.svelte-1g1z4he{display:inline-block;background:#22c55e33;color:#4ade80;padding:6px 12px;border-radius:20px;font-size:12px;font-family:monospace;margin-bottom:20px}.buttons.svelte-1g1z4he{display:flex;gap:12px;justify-content:center}.btn-primary.svelte-1g1z4he,.btn-secondary.svelte-1g1z4he{padding:12px 24px;border-radius:8px;font-size:16px;font-weight:500;cursor:pointer;transition:all .2s;border:none}.btn-primary.svelte-1g1z4he{background:linear-gradient(135deg,#f59e0b,#d97706);color:#fff}.btn-primary.svelte-1g1z4he:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 4px 12px #f59e0b66}.btn-primary.svelte-1g1z4he:disabled{opacity:.6;cursor:not-allowed}.btn-secondary.svelte-1g1z4he{background:#ffffff1a;color:#e0e0e0}.btn-secondary.svelte-1g1z4he:hover{background:#ffffff26}.success-box.svelte-1g1z4he,.error-box.svelte-1g1z4he{padding:16px;border-radius:8px;margin-bottom:20px}.success-box.svelte-1g1z4he{background:#22c55e1a;border:1px solid rgba(34,197,94,.3);color:#4ade80}.error-box.svelte-1g1z4he{background:#ef44441a;border:1px solid rgba(239,68,68,.3);color:#f87171}.hash.svelte-1g1z4he{font-family:monospace;font-size:11px;word-break:break-all;margin-top:8px}.small.svelte-1g1z4he{font-size:12px;opacity:.8;margin-top:8px}.container.svelte-tqpuk1{display:flex;justify-content:center;align-items:center;min-height:100vh;padding:20px}.card.svelte-tqpuk1{background:#ffffff0d;border:1px solid rgba(255,255,255,.1);border-radius:16px;padding:32px;max-width:500px;width:100%;text-align:center;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.icon.svelte-tqpuk1{width:64px;height:64px;margin:0 auto 20px;color:#8b5cf6}.icon.svelte-tqpuk1 svg:where(.svelte-tqpuk1){width:100%;height:100%}h1.svelte-tqpuk1{font-size:24px;font-weight:600;margin-bottom:24px;color:#fff}.message-box.svelte-tqpuk1{background:#0003;border-radius:12px;padding:16px;margin-bottom:24px;text-align:left}.label.svelte-tqpuk1{color:#9ca3af;font-size:12px;text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px}.message.svelte-tqpuk1{color:#e0e0e0;font-size:14px;word-break:break-word;white-space:pre-wrap;max-height:200px;overflow-y:auto}.typed-data.svelte-tqpuk1{color:#e0e0e0;font-size:11px;font-family:monospace;white-space:pre-wrap;word-break:break-word;max-height:300px;overflow-y:auto;margin:0;padding:8px;background:#0003;border-radius:8px}.chain-badge.svelte-tqpuk1{display:inline-block;background:#8b5cf633;color:#c4b5fd;padding:6px 12px;border-radius:20px;font-size:14px;margin-bottom:20px}.connected-badge.svelte-tqpuk1{display:inline-block;background:#22c55e33;color:#4ade80;padding:6px 12px;border-radius:20px;font-size:12px;font-family:monospace;margin-bottom:20px}.buttons.svelte-tqpuk1{display:flex;gap:12px;justify-content:center}.btn-primary.svelte-tqpuk1,.btn-secondary.svelte-tqpuk1{padding:12px 24px;border-radius:8px;font-size:16px;font-weight:500;cursor:pointer;transition:all .2s;border:none}.btn-primary.svelte-tqpuk1{background:linear-gradient(135deg,#8b5cf6,#6366f1);color:#fff}.btn-primary.svelte-tqpuk1:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 4px 12px #8b5cf666}.btn-primary.svelte-tqpuk1:disabled{opacity:.6;cursor:not-allowed}.btn-secondary.svelte-tqpuk1{background:#ffffff1a;color:#e0e0e0}.btn-secondary.svelte-tqpuk1:hover{background:#ffffff26}.success-box.svelte-tqpuk1,.error-box.svelte-tqpuk1{padding:16px;border-radius:8px;margin-bottom:20px}.success-box.svelte-tqpuk1{background:#22c55e1a;border:1px solid rgba(34,197,94,.3);color:#4ade80}.error-box.svelte-tqpuk1{background:#ef44441a;border:1px solid rgba(239,68,68,.3);color:#f87171}.signature.svelte-tqpuk1{font-family:monospace;font-size:10px;word-break:break-all;margin-top:8px}.small.svelte-tqpuk1{font-size:12px;opacity:.8;margin-top:8px}.loading-container.svelte-1n46o8q,.error-container.svelte-1n46o8q{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:100vh;padding:20px;text-align:center}.loading-container.svelte-1n46o8q p:where(.svelte-1n46o8q){color:#9ca3af;margin-top:16px}.spinner.svelte-1n46o8q{width:48px;height:48px;border:3px solid rgba(99,102,241,.2);border-top-color:#6366f1;border-radius:50%;animation:svelte-1n46o8q-spin 1s linear infinite}@keyframes svelte-1n46o8q-spin{to{transform:rotate(360deg)}}.error-icon.svelte-1n46o8q{width:64px;height:64px;background:#ef444433;border:2px solid rgba(239,68,68,.5);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:32px;font-weight:700;color:#f87171;margin-bottom:24px}.error-container.svelte-1n46o8q h1:where(.svelte-1n46o8q){font-size:24px;font-weight:600;color:#fff;margin-bottom:12px}.error-container.svelte-1n46o8q p:where(.svelte-1n46o8q){color:#9ca3af;max-width:400px}.hint.svelte-1n46o8q{margin-top:24px;font-size:14px;color:#6b7280!important}
@@ -0,0 +1 @@
1
+ import{H as Yt,h as Kt,t as Mt,e as qt,b as Pt,r as Ft,c as Gt,s as Wt}from"./index-C17Xxzpm.js";/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */BigInt(0);const Xt=BigInt(1),Dt=BigInt(2);function nt(n){return n instanceof Uint8Array||n!=null&&typeof n=="object"&&n.constructor.name==="Uint8Array"}function lt(n){if(!nt(n))throw new Error("Uint8Array expected")}const Qt=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function st(n){lt(n);let e="";for(let t=0;t<n.length;t++)e+=Qt[n[t]];return e}function Et(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return BigInt(n===""?"0":`0x${n}`)}const P={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function Ot(n){if(n>=P._0&&n<=P._9)return n-P._0;if(n>=P._A&&n<=P._F)return n-(P._A-10);if(n>=P._a&&n<=P._f)return n-(P._a-10)}function at(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);const e=n.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(t);for(let s=0,i=0;s<t;s++,i+=2){const l=Ot(n.charCodeAt(i)),c=Ot(n.charCodeAt(i+1));if(l===void 0||c===void 0){const o=n[i]+n[i+1];throw new Error('hex string expected, got non-hex character "'+o+'" at index '+i)}r[s]=l*16+c}return r}function et(n){return Et(st(n))}function Bt(n){return lt(n),Et(st(Uint8Array.from(n).reverse()))}function ct(n,e){return at(n.toString(16).padStart(e*2,"0"))}function xt(n,e){return ct(n,e).reverse()}function M(n,e,t){let r;if(typeof e=="string")try{r=at(e)}catch(i){throw new Error(`${n} must be valid hex string, got "${e}". Cause: ${i}`)}else if(nt(e))r=Uint8Array.from(e);else throw new Error(`${n} must be hex string or Uint8Array`);const s=r.length;if(typeof t=="number"&&s!==t)throw new Error(`${n} expected ${t} bytes, got ${s}`);return r}function ut(...n){let e=0;for(let r=0;r<n.length;r++){const s=n[r];lt(s),e+=s.length}const t=new Uint8Array(e);for(let r=0,s=0;r<n.length;r++){const i=n[r];t.set(i,s),s+=i.length}return t}const vt=n=>(Dt<<BigInt(n-1))-Xt,gt=n=>new Uint8Array(n),Nt=n=>Uint8Array.from(n);function Zt(n,e,t){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=gt(n),s=gt(n),i=0;const l=()=>{r.fill(1),s.fill(0),i=0},c=(...w)=>t(s,r,...w),o=(w=gt())=>{s=c(Nt([0]),w),r=c(),w.length!==0&&(s=c(Nt([1]),w),r=c())},a=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let w=0;const q=[];for(;w<e;){r=c();const H=r.slice();q.push(H),w+=r.length}return ut(...q)};return(w,q)=>{l(),o(w);let H;for(;!(H=q(a()));)o();return l(),H}}const Jt={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||nt(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,e)=>e.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)};function dt(n,e,t={}){const r=(s,i,l)=>{const c=Jt[i];if(typeof c!="function")throw new Error(`Invalid validator "${i}", expected function`);const o=n[s];if(!(l&&o===void 0)&&!c(o,n))throw new Error(`Invalid param ${String(s)}=${o} (${typeof o}), expected ${i}`)};for(const[s,i]of Object.entries(e))r(s,i,!1);for(const[s,i]of Object.entries(t))r(s,i,!0);return n}const te=Object.freeze(Object.defineProperty({__proto__:null,abytes:lt,bitMask:vt,bytesToHex:st,bytesToNumberBE:et,bytesToNumberLE:Bt,concatBytes:ut,createHmacDrbg:Zt,ensureBytes:M,hexToBytes:at,hexToNumber:Et,isBytes:nt,numberToBytesBE:ct,numberToBytesLE:xt,validateObject:dt},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const T=BigInt(0),L=BigInt(1),J=BigInt(2),ee=BigInt(3),pt=BigInt(4),_t=BigInt(5),Ht=BigInt(8);BigInt(9);BigInt(16);function U(n,e){const t=n%e;return t>=T?t:e+t}function ne(n,e,t){if(t<=T||e<T)throw new Error("Expected power/modulo > 0");if(t===L)return T;let r=L;for(;e>T;)e&L&&(r=r*n%t),n=n*n%t,e>>=L;return r}function V(n,e,t){let r=n;for(;e-- >T;)r*=r,r%=t;return r}function yt(n,e){if(n===T||e<=T)throw new Error(`invert: expected positive integers, got n=${n} mod=${e}`);let t=U(n,e),r=e,s=T,i=L;for(;t!==T;){const c=r/t,o=r%t,a=s-i*c;r=t,t=o,s=i,i=a}if(r!==L)throw new Error("invert: does not exist");return U(s,e)}function re(n){const e=(n-L)/J;let t,r,s;for(t=n-L,r=0;t%J===T;t/=J,r++);for(s=J;s<n&&ne(s,e,n)!==n-L;s++);if(r===1){const l=(n+L)/pt;return function(o,a){const y=o.pow(a,l);if(!o.eql(o.sqr(y),a))throw new Error("Cannot find square root");return y}}const i=(t+L)/J;return function(c,o){if(c.pow(o,e)===c.neg(c.ONE))throw new Error("Cannot find square root");let a=r,y=c.pow(c.mul(c.ONE,s),t),w=c.pow(o,i),q=c.pow(o,t);for(;!c.eql(q,c.ONE);){if(c.eql(q,c.ZERO))return c.ZERO;let H=1;for(let f=c.sqr(q);H<a&&!c.eql(f,c.ONE);H++)f=c.sqr(f);const m=c.pow(y,L<<BigInt(a-H-1));y=c.sqr(m),w=c.mul(w,m),q=c.mul(q,y),a=H}return w}}function oe(n){if(n%pt===ee){const e=(n+L)/pt;return function(r,s){const i=r.pow(s,e);if(!r.eql(r.sqr(i),s))throw new Error("Cannot find square root");return i}}if(n%Ht===_t){const e=(n-_t)/Ht;return function(r,s){const i=r.mul(s,J),l=r.pow(i,e),c=r.mul(s,l),o=r.mul(r.mul(c,J),l),a=r.mul(c,r.sub(o,r.ONE));if(!r.eql(r.sqr(a),s))throw new Error("Cannot find square root");return a}}return re(n)}const ie=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function se(n){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=ie.reduce((r,s)=>(r[s]="function",r),e);return dt(n,t)}function ce(n,e,t){if(t<T)throw new Error("Expected power > 0");if(t===T)return n.ONE;if(t===L)return e;let r=n.ONE,s=e;for(;t>T;)t&L&&(r=n.mul(r,s)),s=n.sqr(s),t>>=L;return r}function fe(n,e){const t=new Array(e.length),r=e.reduce((i,l,c)=>n.is0(l)?i:(t[c]=i,n.mul(i,l)),n.ONE),s=n.inv(r);return e.reduceRight((i,l,c)=>n.is0(l)?i:(t[c]=n.mul(i,t[c]),n.mul(i,l)),s),t}function Rt(n,e){const t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function ae(n,e,t=!1,r={}){if(n<=T)throw new Error(`Expected Field ORDER > 0, got ${n}`);const{nBitLength:s,nByteLength:i}=Rt(n,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const l=oe(n),c=Object.freeze({ORDER:n,BITS:s,BYTES:i,MASK:vt(s),ZERO:T,ONE:L,create:o=>U(o,n),isValid:o=>{if(typeof o!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof o}`);return T<=o&&o<n},is0:o=>o===T,isOdd:o=>(o&L)===L,neg:o=>U(-o,n),eql:(o,a)=>o===a,sqr:o=>U(o*o,n),add:(o,a)=>U(o+a,n),sub:(o,a)=>U(o-a,n),mul:(o,a)=>U(o*a,n),pow:(o,a)=>ce(c,o,a),div:(o,a)=>U(o*yt(a,n),n),sqrN:o=>o*o,addN:(o,a)=>o+a,subN:(o,a)=>o-a,mulN:(o,a)=>o*a,inv:o=>yt(o,n),sqrt:r.sqrt||(o=>l(c,o)),invertBatch:o=>fe(c,o),cmov:(o,a,y)=>y?a:o,toBytes:o=>t?xt(o,i):ct(o,i),fromBytes:o=>{if(o.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${o.length}`);return t?Bt(o):et(o)}});return Object.freeze(c)}function Ut(n){if(typeof n!="bigint")throw new Error("field order must be bigint");const e=n.toString(2).length;return Math.ceil(e/8)}function Ct(n){const e=Ut(n);return e+Math.ceil(e/2)}function ue(n,e,t=!1){const r=n.length,s=Ut(e),i=Ct(e);if(r<16||r<i||r>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const l=t?et(n):Bt(n),c=U(l,e-L)+L;return t?xt(c,s):ct(c,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const le=BigInt(0),wt=BigInt(1);function de(n,e){const t=(s,i)=>{const l=i.negate();return s?l:i},r=s=>{const i=Math.ceil(e/s)+1,l=2**(s-1);return{windows:i,windowSize:l}};return{constTimeNegate:t,unsafeLadder(s,i){let l=n.ZERO,c=s;for(;i>le;)i&wt&&(l=l.add(c)),c=c.double(),i>>=wt;return l},precomputeWindow(s,i){const{windows:l,windowSize:c}=r(i),o=[];let a=s,y=a;for(let w=0;w<l;w++){y=a,o.push(y);for(let q=1;q<c;q++)y=y.add(a),o.push(y);a=y.double()}return o},wNAF(s,i,l){const{windows:c,windowSize:o}=r(s);let a=n.ZERO,y=n.BASE;const w=BigInt(2**s-1),q=2**s,H=BigInt(s);for(let m=0;m<c;m++){const f=m*o;let d=Number(l&w);l>>=H,d>o&&(d-=q,l+=wt);const h=f,b=f+Math.abs(d)-1,B=m%2!==0,S=d<0;d===0?y=y.add(t(B,i[h])):a=a.add(t(S,i[b]))}return{p:a,f:y}},wNAFCached(s,i,l,c){const o=s._WINDOW_SIZE||1;let a=i.get(s);return a||(a=this.precomputeWindow(s,o),o!==1&&i.set(s,c(a))),this.wNAF(o,a,l)}}}function zt(n){return se(n.Fp),dt(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Rt(n.n,n.nBitLength),...n,p:n.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function he(n){const e=zt(n);dt(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:r,a:s}=e;if(t){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:ge,hexToBytes:we}=te,tt={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(n){const{Err:e}=tt;if(n.length<2||n[0]!==2)throw new e("Invalid signature integer tag");const t=n[1],r=n.subarray(2,t+2);if(!t||r.length!==t)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:ge(r),l:n.subarray(t+2)}},toSig(n){const{Err:e}=tt,t=typeof n=="string"?we(n):n;lt(t);let r=t.length;if(r<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:s,l:i}=tt._parseInt(t.subarray(2)),{d:l,l:c}=tt._parseInt(i);if(c.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:l}},hexFromSig(n){const e=a=>Number.parseInt(a[0],16)&8?"00"+a:a,t=a=>{const y=a.toString(16);return y.length&1?`0${y}`:y},r=e(t(n.s)),s=e(t(n.r)),i=r.length/2,l=s.length/2,c=t(i),o=t(l);return`30${t(l+i+4)}02${o}${s}02${c}${r}`}},F=BigInt(0),j=BigInt(1);BigInt(2);const Lt=BigInt(3);BigInt(4);function pe(n){const e=he(n),{Fp:t}=e,r=e.toBytes||((m,f,d)=>{const h=f.toAffine();return ut(Uint8Array.from([4]),t.toBytes(h.x),t.toBytes(h.y))}),s=e.fromBytes||(m=>{const f=m.subarray(1),d=t.fromBytes(f.subarray(0,t.BYTES)),h=t.fromBytes(f.subarray(t.BYTES,2*t.BYTES));return{x:d,y:h}});function i(m){const{a:f,b:d}=e,h=t.sqr(m),b=t.mul(h,m);return t.add(t.add(b,t.mul(m,f)),d)}if(!t.eql(t.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function l(m){return typeof m=="bigint"&&F<m&&m<e.n}function c(m){if(!l(m))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function o(m){const{allowedPrivateKeyLengths:f,nByteLength:d,wrapPrivateKey:h,n:b}=e;if(f&&typeof m!="bigint"){if(nt(m)&&(m=st(m)),typeof m!="string"||!f.includes(m.length))throw new Error("Invalid key");m=m.padStart(d*2,"0")}let B;try{B=typeof m=="bigint"?m:et(M("private key",m,d))}catch{throw new Error(`private key must be ${d} bytes, hex or bigint, not ${typeof m}`)}return h&&(B=U(B,b)),c(B),B}const a=new Map;function y(m){if(!(m instanceof w))throw new Error("ProjectivePoint expected")}class w{constructor(f,d,h){if(this.px=f,this.py=d,this.pz=h,f==null||!t.isValid(f))throw new Error("x required");if(d==null||!t.isValid(d))throw new Error("y required");if(h==null||!t.isValid(h))throw new Error("z required")}static fromAffine(f){const{x:d,y:h}=f||{};if(!f||!t.isValid(d)||!t.isValid(h))throw new Error("invalid affine point");if(f instanceof w)throw new Error("projective point not allowed");const b=B=>t.eql(B,t.ZERO);return b(d)&&b(h)?w.ZERO:new w(d,h,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(f){const d=t.invertBatch(f.map(h=>h.pz));return f.map((h,b)=>h.toAffine(d[b])).map(w.fromAffine)}static fromHex(f){const d=w.fromAffine(s(M("pointHex",f)));return d.assertValidity(),d}static fromPrivateKey(f){return w.BASE.multiply(o(f))}_setWindowSize(f){this._WINDOW_SIZE=f,a.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:f,y:d}=this.toAffine();if(!t.isValid(f)||!t.isValid(d))throw new Error("bad point: x or y not FE");const h=t.sqr(d),b=i(f);if(!t.eql(h,b))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:f}=this.toAffine();if(t.isOdd)return!t.isOdd(f);throw new Error("Field doesn't support isOdd")}equals(f){y(f);const{px:d,py:h,pz:b}=this,{px:B,py:S,pz:I}=f,p=t.eql(t.mul(d,I),t.mul(B,b)),E=t.eql(t.mul(h,I),t.mul(S,b));return p&&E}negate(){return new w(this.px,t.neg(this.py),this.pz)}double(){const{a:f,b:d}=e,h=t.mul(d,Lt),{px:b,py:B,pz:S}=this;let I=t.ZERO,p=t.ZERO,E=t.ZERO,v=t.mul(b,b),k=t.mul(B,B),_=t.mul(S,S),A=t.mul(b,B);return A=t.add(A,A),E=t.mul(b,S),E=t.add(E,E),I=t.mul(f,E),p=t.mul(h,_),p=t.add(I,p),I=t.sub(k,p),p=t.add(k,p),p=t.mul(I,p),I=t.mul(A,I),E=t.mul(h,E),_=t.mul(f,_),A=t.sub(v,_),A=t.mul(f,A),A=t.add(A,E),E=t.add(v,v),v=t.add(E,v),v=t.add(v,_),v=t.mul(v,A),p=t.add(p,v),_=t.mul(B,S),_=t.add(_,_),v=t.mul(_,A),I=t.sub(I,v),E=t.mul(_,k),E=t.add(E,E),E=t.add(E,E),new w(I,p,E)}add(f){y(f);const{px:d,py:h,pz:b}=this,{px:B,py:S,pz:I}=f;let p=t.ZERO,E=t.ZERO,v=t.ZERO;const k=e.a,_=t.mul(e.b,Lt);let A=t.mul(d,B),C=t.mul(h,S),z=t.mul(b,I),G=t.add(d,h),u=t.add(B,S);G=t.mul(G,u),u=t.add(A,C),G=t.sub(G,u),u=t.add(d,b);let g=t.add(B,I);return u=t.mul(u,g),g=t.add(A,z),u=t.sub(u,g),g=t.add(h,b),p=t.add(S,I),g=t.mul(g,p),p=t.add(C,z),g=t.sub(g,p),v=t.mul(k,u),p=t.mul(_,z),v=t.add(p,v),p=t.sub(C,v),v=t.add(C,v),E=t.mul(p,v),C=t.add(A,A),C=t.add(C,A),z=t.mul(k,z),u=t.mul(_,u),C=t.add(C,z),z=t.sub(A,z),z=t.mul(k,z),u=t.add(u,z),A=t.mul(C,u),E=t.add(E,A),A=t.mul(g,u),p=t.mul(G,p),p=t.sub(p,A),A=t.mul(G,C),v=t.mul(g,v),v=t.add(v,A),new w(p,E,v)}subtract(f){return this.add(f.negate())}is0(){return this.equals(w.ZERO)}wNAF(f){return H.wNAFCached(this,a,f,d=>{const h=t.invertBatch(d.map(b=>b.pz));return d.map((b,B)=>b.toAffine(h[B])).map(w.fromAffine)})}multiplyUnsafe(f){const d=w.ZERO;if(f===F)return d;if(c(f),f===j)return this;const{endo:h}=e;if(!h)return H.unsafeLadder(this,f);let{k1neg:b,k1:B,k2neg:S,k2:I}=h.splitScalar(f),p=d,E=d,v=this;for(;B>F||I>F;)B&j&&(p=p.add(v)),I&j&&(E=E.add(v)),v=v.double(),B>>=j,I>>=j;return b&&(p=p.negate()),S&&(E=E.negate()),E=new w(t.mul(E.px,h.beta),E.py,E.pz),p.add(E)}multiply(f){c(f);let d=f,h,b;const{endo:B}=e;if(B){const{k1neg:S,k1:I,k2neg:p,k2:E}=B.splitScalar(d);let{p:v,f:k}=this.wNAF(I),{p:_,f:A}=this.wNAF(E);v=H.constTimeNegate(S,v),_=H.constTimeNegate(p,_),_=new w(t.mul(_.px,B.beta),_.py,_.pz),h=v.add(_),b=k.add(A)}else{const{p:S,f:I}=this.wNAF(d);h=S,b=I}return w.normalizeZ([h,b])[0]}multiplyAndAddUnsafe(f,d,h){const b=w.BASE,B=(I,p)=>p===F||p===j||!I.equals(b)?I.multiplyUnsafe(p):I.multiply(p),S=B(this,d).add(B(f,h));return S.is0()?void 0:S}toAffine(f){const{px:d,py:h,pz:b}=this,B=this.is0();f==null&&(f=B?t.ONE:t.inv(b));const S=t.mul(d,f),I=t.mul(h,f),p=t.mul(b,f);if(B)return{x:t.ZERO,y:t.ZERO};if(!t.eql(p,t.ONE))throw new Error("invZ was invalid");return{x:S,y:I}}isTorsionFree(){const{h:f,isTorsionFree:d}=e;if(f===j)return!0;if(d)return d(w,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:f,clearCofactor:d}=e;return f===j?this:d?d(w,this):this.multiplyUnsafe(e.h)}toRawBytes(f=!0){return this.assertValidity(),r(w,this,f)}toHex(f=!0){return st(this.toRawBytes(f))}}w.BASE=new w(e.Gx,e.Gy,t.ONE),w.ZERO=new w(t.ZERO,t.ONE,t.ZERO);const q=e.nBitLength,H=de(w,e.endo?Math.ceil(q/2):q);return{CURVE:e,ProjectivePoint:w,normPrivateKeyToScalar:o,weierstrassEquation:i,isWithinCurveOrder:l}}function ye(n){const e=zt(n);return dt(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function me(n){const e=ye(n),{Fp:t,n:r}=e,s=t.BYTES+1,i=2*t.BYTES+1;function l(u){return F<u&&u<t.ORDER}function c(u){return U(u,r)}function o(u){return yt(u,r)}const{ProjectivePoint:a,normPrivateKeyToScalar:y,weierstrassEquation:w,isWithinCurveOrder:q}=pe({...e,toBytes(u,g,x){const N=g.toAffine(),O=t.toBytes(N.x),$=ut;return x?$(Uint8Array.from([g.hasEvenY()?2:3]),O):$(Uint8Array.from([4]),O,t.toBytes(N.y))},fromBytes(u){const g=u.length,x=u[0],N=u.subarray(1);if(g===s&&(x===2||x===3)){const O=et(N);if(!l(O))throw new Error("Point is not on curve");const $=w(O);let Z;try{Z=t.sqrt($)}catch(Y){const X=Y instanceof Error?": "+Y.message:"";throw new Error("Point is not on curve"+X)}const R=(Z&j)===j;return(x&1)===1!==R&&(Z=t.neg(Z)),{x:O,y:Z}}else if(g===i&&x===4){const O=t.fromBytes(N.subarray(0,t.BYTES)),$=t.fromBytes(N.subarray(t.BYTES,2*t.BYTES));return{x:O,y:$}}else throw new Error(`Point of length ${g} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),H=u=>st(ct(u,e.nByteLength));function m(u){const g=r>>j;return u>g}function f(u){return m(u)?c(-u):u}const d=(u,g,x)=>et(u.slice(g,x));class h{constructor(g,x,N){this.r=g,this.s=x,this.recovery=N,this.assertValidity()}static fromCompact(g){const x=e.nByteLength;return g=M("compactSignature",g,x*2),new h(d(g,0,x),d(g,x,2*x))}static fromDER(g){const{r:x,s:N}=tt.toSig(M("DER",g));return new h(x,N)}assertValidity(){if(!q(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!q(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(g){return new h(this.r,this.s,g)}recoverPublicKey(g){const{r:x,s:N,recovery:O}=this,$=E(M("msgHash",g));if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");const Z=O===2||O===3?x+e.n:x;if(Z>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const R=(O&1)===0?"02":"03",W=a.fromHex(R+H(Z)),Y=o(Z),X=c(-$*Y),ft=c(N*Y),D=a.BASE.multiplyAndAddUnsafe(W,X,ft);if(!D)throw new Error("point at infinify");return D.assertValidity(),D}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new h(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return at(this.toDERHex())}toDERHex(){return tt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return at(this.toCompactHex())}toCompactHex(){return H(this.r)+H(this.s)}}const b={isValidPrivateKey(u){try{return y(u),!0}catch{return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{const u=Ct(e.n);return ue(e.randomBytes(u),e.n)},precompute(u=8,g=a.BASE){return g._setWindowSize(u),g.multiply(BigInt(3)),g}};function B(u,g=!0){return a.fromPrivateKey(u).toRawBytes(g)}function S(u){const g=nt(u),x=typeof u=="string",N=(g||x)&&u.length;return g?N===s||N===i:x?N===2*s||N===2*i:u instanceof a}function I(u,g,x=!0){if(S(u))throw new Error("first arg must be private key");if(!S(g))throw new Error("second arg must be public key");return a.fromHex(g).multiply(y(u)).toRawBytes(x)}const p=e.bits2int||function(u){const g=et(u),x=u.length*8-e.nBitLength;return x>0?g>>BigInt(x):g},E=e.bits2int_modN||function(u){return c(p(u))},v=vt(e.nBitLength);function k(u){if(typeof u!="bigint")throw new Error("bigint expected");if(!(F<=u&&u<v))throw new Error(`bigint expected < 2^${e.nBitLength}`);return ct(u,e.nByteLength)}function _(u,g,x=A){if(["recovered","canonical"].some(Q=>Q in x))throw new Error("sign() legacy options not supported");const{hash:N,randomBytes:O}=e;let{lowS:$,prehash:Z,extraEntropy:R}=x;$==null&&($=!0),u=M("msgHash",u),Z&&(u=M("prehashed msgHash",N(u)));const W=E(u),Y=y(g),X=[k(Y),k(W)];if(R!=null&&R!==!1){const Q=R===!0?O(t.BYTES):R;X.push(M("extraEntropy",Q))}const ft=ut(...X),D=W;function ht(Q){const rt=p(Q);if(!q(rt))return;const It=o(rt),ot=a.BASE.multiply(rt).toAffine(),K=c(ot.x);if(K===F)return;const it=c(It*c(D+K*Y));if(it===F)return;let St=(ot.x===K?0:2)|Number(ot.y&j),At=it;return $&&m(it)&&(At=f(it),St^=1),new h(K,At,St)}return{seed:ft,k2sig:ht}}const A={lowS:e.lowS,prehash:!1},C={lowS:e.lowS,prehash:!1};function z(u,g,x=A){const{seed:N,k2sig:O}=_(u,g,x),$=e;return Zt($.hash.outputLen,$.nByteLength,$.hmac)(N,O)}a.BASE._setWindowSize(8);function G(u,g,x,N=C){var ot;const O=u;if(g=M("msgHash",g),x=M("publicKey",x),"strict"in N)throw new Error("options.strict was renamed to lowS");const{lowS:$,prehash:Z}=N;let R,W;try{if(typeof O=="string"||nt(O))try{R=h.fromDER(O)}catch(K){if(!(K instanceof tt.Err))throw K;R=h.fromCompact(O)}else if(typeof O=="object"&&typeof O.r=="bigint"&&typeof O.s=="bigint"){const{r:K,s:it}=O;R=new h(K,it)}else throw new Error("PARSE");W=a.fromHex(x)}catch(K){if(K.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if($&&R.hasHighS())return!1;Z&&(g=e.hash(g));const{r:Y,s:X}=R,ft=E(g),D=o(X),ht=c(ft*D),Q=c(Y*D),rt=(ot=a.BASE.multiplyAndAddUnsafe(W,ht,Q))==null?void 0:ot.toAffine();return rt?c(rt.x)===Y:!1}return{CURVE:e,getPublicKey:B,getSharedSecret:I,sign:z,verify:G,ProjectivePoint:a,Signature:h,utils:b}}class kt extends Yt{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Kt(e);const r=Mt(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?e.create().update(r).digest():r);for(let l=0;l<i.length;l++)i[l]^=54;this.iHash.update(i),this.oHash=e.create();for(let l=0;l<i.length;l++)i[l]^=106;this.oHash.update(i),i.fill(0)}update(e){return qt(this),this.iHash.update(e),this}digestInto(e){qt(this),Pt(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:s,destroyed:i,blockLen:l,outputLen:c}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=l,e.outputLen=c,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Vt=(n,e,t)=>new kt(n,e).update(t).digest();Vt.create=(n,e)=>new kt(n,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function be(n){return{hash:n,hmac:(e,...t)=>Vt(n,e,Gt(...t)),randomBytes:Ft}}function Ee(n,e){const t=r=>me({...n,...be(r)});return Object.freeze({...t(e),create:t})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const jt=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),$t=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Be=BigInt(1),mt=BigInt(2),Tt=(n,e)=>(n+e/mt)/e;function xe(n){const e=jt,t=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),l=BigInt(23),c=BigInt(44),o=BigInt(88),a=n*n*n%e,y=a*a*n%e,w=V(y,t,e)*y%e,q=V(w,t,e)*y%e,H=V(q,mt,e)*a%e,m=V(H,s,e)*H%e,f=V(m,i,e)*m%e,d=V(f,c,e)*f%e,h=V(d,o,e)*d%e,b=V(h,c,e)*f%e,B=V(b,t,e)*y%e,S=V(B,l,e)*m%e,I=V(S,r,e)*a%e,p=V(I,mt,e);if(!bt.eql(bt.sqr(p),n))throw new Error("Cannot find square root");return p}const bt=ae(jt,void 0,void 0,{sqrt:xe}),ve=Ee({a:BigInt(0),b:BigInt(7),Fp:bt,n:$t,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:n=>{const e=$t,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Be*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,l=BigInt("0x100000000000000000000000000000000"),c=Tt(i*n,e),o=Tt(-r*n,e);let a=U(n-c*t-o*s,e),y=U(-c*r-o*i,e);const w=a>l,q=y>l;if(w&&(a=e-a),q&&(y=e-y),a>l||y>l)throw new Error("splitScalar: Endomorphism failed, k="+n);return{k1neg:w,k1:a,k2neg:q,k2:y}}}},Wt);BigInt(0);ve.ProjectivePoint;export{ve as secp256k1};
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
2
+ <defs>
3
+ <linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="100%">
4
+ <stop offset="0%" style="stop-color:#6366f1;stop-opacity:1" />
5
+ <stop offset="100%" style="stop-color:#8b5cf6;stop-opacity:1" />
6
+ </linearGradient>
7
+ </defs>
8
+ <rect width="100" height="100" rx="20" fill="url(#grad)"/>
9
+ <path d="M30 50 L45 65 L70 35" stroke="white" stroke-width="8" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
10
+ </svg>
package/web/index.html ADDED
@@ -0,0 +1,27 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>MCP Wallet Signer</title>
8
+ <style>
9
+ * {
10
+ box-sizing: border-box;
11
+ margin: 0;
12
+ padding: 0;
13
+ }
14
+ body {
15
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
16
+ background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
17
+ min-height: 100vh;
18
+ color: #e0e0e0;
19
+ }
20
+ </style>
21
+ <script type="module" crossorigin src="/assets/index-C17Xxzpm.js"></script>
22
+ <link rel="stylesheet" crossorigin href="/assets/index-C5BDQo8n.css">
23
+ </head>
24
+ <body>
25
+ <div id="app"></div>
26
+ </body>
27
+ </html>