@dev.sail.money/sailor 1.3.0-234 → 1.3.0-237

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.
Files changed (93) hide show
  1. package/README.md +17 -9
  2. package/package.json +1 -5
  3. package/packages/cli/README.md +1 -1
  4. package/packages/cli/dist/index.cjs +3 -3
  5. package/packages/sdk/dist/intelligence.d.ts +1 -1
  6. package/packages/sdk/dist/intelligence.js +1 -1
  7. package/packages/ui/dist/assets/{add-DoHGZfJI.js → add-CBbu2pe_.js} +1 -1
  8. package/packages/ui/dist/assets/{all-wallets-CUKVFyT3.js → all-wallets-C1oy4NUu.js} +1 -1
  9. package/packages/ui/dist/assets/{app-store-DyQ4PZOs.js → app-store-DKqyf0Zv.js} +1 -1
  10. package/packages/ui/dist/assets/{apple-Dc-GOiDW.js → apple-DyoIbCFy.js} +1 -1
  11. package/packages/ui/dist/assets/{arrow-bottom-circle-BH2LebvP.js → arrow-bottom-circle-CMS-OqZQ.js} +1 -1
  12. package/packages/ui/dist/assets/{arrow-bottom-C-dI8Oh_.js → arrow-bottom-pUWeEqYu.js} +1 -1
  13. package/packages/ui/dist/assets/{arrow-left-CUIn5NsD.js → arrow-left-B81HMJNL.js} +1 -1
  14. package/packages/ui/dist/assets/{arrow-right-B-X57DDF.js → arrow-right-Z5czoKlC.js} +1 -1
  15. package/packages/ui/dist/assets/{arrow-top-BNOmzVbg.js → arrow-top-C6ym1oll.js} +1 -1
  16. package/packages/ui/dist/assets/{bank-Dqcy3Map.js → bank-B41nlslf.js} +1 -1
  17. package/packages/ui/dist/assets/{basic-CN95kOlB.js → basic-CWqOb7CV.js} +1 -1
  18. package/packages/ui/dist/assets/{browser-v-WzD6Au.js → browser-DDKdqoZ9.js} +1 -1
  19. package/packages/ui/dist/assets/{card-DJmQXuOi.js → card-BgOmTajq.js} +1 -1
  20. package/packages/ui/dist/assets/{ccip-8oS512uk.js → ccip-CtJUKWRd.js} +1 -1
  21. package/packages/ui/dist/assets/{checkmark-6Rvy6Al7.js → checkmark-CGqQipH4.js} +1 -1
  22. package/packages/ui/dist/assets/{checkmark-bold-GYXSMFUr.js → checkmark-bold-Ci5xf90j.js} +1 -1
  23. package/packages/ui/dist/assets/{chevron-bottom-BF1Fa2NO.js → chevron-bottom-D7Xert17.js} +1 -1
  24. package/packages/ui/dist/assets/{chevron-left-kj9KjPLp.js → chevron-left-BGbUebR2.js} +1 -1
  25. package/packages/ui/dist/assets/{chevron-right-CHH0lg7_.js → chevron-right-xVsESnHU.js} +1 -1
  26. package/packages/ui/dist/assets/{chevron-top-DjHmnG32.js → chevron-top-DEA9cR6v.js} +1 -1
  27. package/packages/ui/dist/assets/{chrome-store-KzNe4H9H.js → chrome-store-BsyI-4PI.js} +1 -1
  28. package/packages/ui/dist/assets/{clock-xHvMNQNx.js → clock-Dct9oQ3M.js} +1 -1
  29. package/packages/ui/dist/assets/{close-nKtgX0WM.js → close-BvSCnI2y.js} +1 -1
  30. package/packages/ui/dist/assets/{coinPlaceholder-gnwD3g4G.js → coinPlaceholder-p7RiWkon.js} +1 -1
  31. package/packages/ui/dist/assets/{compass-wnLBxh3w.js → compass-BUeeZqX4.js} +1 -1
  32. package/packages/ui/dist/assets/{copy-CmLisiOG.js → copy-C5jXbxLq.js} +1 -1
  33. package/packages/ui/dist/assets/{core-BLOM5s8O.js → core-CiAm42Mq.js} +3 -3
  34. package/packages/ui/dist/assets/{cursor-DgwjrlpZ.js → cursor-C0T7JWFO.js} +1 -1
  35. package/packages/ui/dist/assets/{cursor-transparent-CjVDknUI.js → cursor-transparent-BZp3-JmA.js} +1 -1
  36. package/packages/ui/dist/assets/{desktop-BSGjR5fT.js → desktop-BIui_Lzb.js} +1 -1
  37. package/packages/ui/dist/assets/{disconnect-DkOQ_j9U.js → disconnect-B3Bxdchp.js} +1 -1
  38. package/packages/ui/dist/assets/{discord-DtvZ281_.js → discord-VWI0yDyx.js} +1 -1
  39. package/packages/ui/dist/assets/{etherscan-BB3baLbR.js → etherscan-BpBvUT9i.js} +1 -1
  40. package/packages/ui/dist/assets/{exclamation-triangle-BrR8a-pR.js → exclamation-triangle-o1TJHIUw.js} +1 -1
  41. package/packages/ui/dist/assets/{extension-BiGAMg97.js → extension-4RaLvbh5.js} +1 -1
  42. package/packages/ui/dist/assets/{external-link-qUc7QuKA.js → external-link-BHIwjDgj.js} +1 -1
  43. package/packages/ui/dist/assets/{facebook-BuXatc22.js → facebook-Bes5g-wN.js} +1 -1
  44. package/packages/ui/dist/assets/{farcaster-USwPlLU8.js → farcaster-CiJ-352m.js} +1 -1
  45. package/packages/ui/dist/assets/{filters-BWx3pZxN.js → filters-DMOteumb.js} +1 -1
  46. package/packages/ui/dist/assets/{github-CUSWD7ff.js → github-D2nDec9X.js} +1 -1
  47. package/packages/ui/dist/assets/{google-CxJSLEaz.js → google-lZZlQZPQ.js} +1 -1
  48. package/packages/ui/dist/assets/{help-circle-_8isjSO0.js → help-circle-D4cSSziR.js} +1 -1
  49. package/packages/ui/dist/assets/{id-DJCzMfx_.js → id-BmhXZq5P.js} +1 -1
  50. package/packages/ui/dist/assets/{image-CmG69MZj.js → image-Dz4FPeET.js} +1 -1
  51. package/packages/ui/dist/assets/{index-BIqjq0q5.js → index-BeUp3nOq.js} +1 -1
  52. package/packages/ui/dist/assets/{index-DsxB7ORb.js → index-CvRylmZJ.js} +1 -1
  53. package/packages/ui/dist/assets/{index-3YqzzyrK.js → index-DeoQO45V.js} +3 -3
  54. package/packages/ui/dist/assets/{index-DHVwxjrm.js → index-Et5S3ZaW.js} +1 -1
  55. package/packages/ui/dist/assets/{index-D8zwDy7d.js → index-LiKeH8Cd.js} +4 -4
  56. package/packages/ui/dist/assets/{index.es-Hqwz_Ukd.js → index.es-dfpEui-9.js} +4 -4
  57. package/packages/ui/dist/assets/{info-XYctdUoY.js → info-77RSvIMg.js} +1 -1
  58. package/packages/ui/dist/assets/{info-circle-D_fYZUhv.js → info-circle-CWsII-NN.js} +1 -1
  59. package/packages/ui/dist/assets/{lightbulb-BqKkDThe.js → lightbulb-BZXzm7XE.js} +1 -1
  60. package/packages/ui/dist/assets/{mail-CM4laVWT.js → mail-DMG1YqB0.js} +1 -1
  61. package/packages/ui/dist/assets/{metamask-sdk-8TvB8vxr.js → metamask-sdk-K1x_iqcc.js} +1 -1
  62. package/packages/ui/dist/assets/{mobile-C2cl_MIN.js → mobile-DuJfOBSk.js} +1 -1
  63. package/packages/ui/dist/assets/{more-DOik7ytj.js → more-Cs9ySK2F.js} +1 -1
  64. package/packages/ui/dist/assets/{network-placeholder-CC9Cg0q_.js → network-placeholder-CMDPmB1E.js} +1 -1
  65. package/packages/ui/dist/assets/{nftPlaceholder-Oe_bTYkM.js → nftPlaceholder-Cj0f9y2u.js} +1 -1
  66. package/packages/ui/dist/assets/{off-ao0Rdo1E.js → off-9zSSsm-e.js} +1 -1
  67. package/packages/ui/dist/assets/{play-store-BcQlROdR.js → play-store-CPwIb8Gj.js} +1 -1
  68. package/packages/ui/dist/assets/{plus-DSOprccT.js → plus-BOHQri8o.js} +1 -1
  69. package/packages/ui/dist/assets/{qr-code-B64-C9CJ.js → qr-code-DqhbK276.js} +1 -1
  70. package/packages/ui/dist/assets/{recycle-horizontal-BJg7qNO9.js → recycle-horizontal-BpGM56Qz.js} +1 -1
  71. package/packages/ui/dist/assets/{refresh-Dexg1q9p.js → refresh-BPzZlhTP.js} +1 -1
  72. package/packages/ui/dist/assets/{reown-logo-D8KP4d24.js → reown-logo-OCkI0xzo.js} +1 -1
  73. package/packages/ui/dist/assets/{search-CBfhIhB0.js → search-B1JEJvwq.js} +1 -1
  74. package/packages/ui/dist/assets/{secp256k1-BOKPNuRR.js → secp256k1-BqUeV9Cb.js} +1 -1
  75. package/packages/ui/dist/assets/{send-DpJV-P0b.js → send-JNsDlNoq.js} +1 -1
  76. package/packages/ui/dist/assets/{swapHorizontal-DC-Elc2j.js → swapHorizontal-C3Z1FImK.js} +1 -1
  77. package/packages/ui/dist/assets/{swapHorizontalBold-Unn8xI55.js → swapHorizontalBold-Cmdy2iAn.js} +1 -1
  78. package/packages/ui/dist/assets/{swapHorizontalMedium-B58RR8wP.js → swapHorizontalMedium-DFX57Nn9.js} +1 -1
  79. package/packages/ui/dist/assets/{swapHorizontalRoundedBold-UTrbE6zM.js → swapHorizontalRoundedBold-baB389c8.js} +1 -1
  80. package/packages/ui/dist/assets/{swapVertical-CLBtBVG1.js → swapVertical-DmAYGfK1.js} +1 -1
  81. package/packages/ui/dist/assets/{telegram-C_tvCVU8.js → telegram-BHbYE-nI.js} +1 -1
  82. package/packages/ui/dist/assets/{three-dots-BIn_IFa0.js → three-dots-BwRWl6qJ.js} +1 -1
  83. package/packages/ui/dist/assets/{twitch-BqiEXRul.js → twitch-Drx0q6B6.js} +1 -1
  84. package/packages/ui/dist/assets/{twitterIcon-CquA5TCG.js → twitterIcon-AuJ2KQ6p.js} +1 -1
  85. package/packages/ui/dist/assets/{verify-DOUX5_SE.js → verify-Dkrd3q7o.js} +1 -1
  86. package/packages/ui/dist/assets/{verify-filled-nMk53S_a.js → verify-filled-B9e3-nz-.js} +1 -1
  87. package/packages/ui/dist/assets/{w3m-modal-B-JVYtbP.js → w3m-modal-DtkEjQA7.js} +1 -1
  88. package/packages/ui/dist/assets/{wallet-BjbzMOXA.js → wallet-CqYzSiBd.js} +1 -1
  89. package/packages/ui/dist/assets/{wallet-placeholder-DPidGoJt.js → wallet-placeholder-B05kTN_K.js} +1 -1
  90. package/packages/ui/dist/assets/{walletconnect-Dw14KwDj.js → walletconnect-BwoPXLaS.js} +1 -1
  91. package/packages/ui/dist/assets/{warning-circle-Ewxxj9bx.js → warning-circle-DK9Ai8rT.js} +1 -1
  92. package/packages/ui/dist/assets/{x-B5Li_yME.js → x-BNdh5DVW.js} +1 -1
  93. package/packages/ui/dist/index.html +1 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BIqjq0q5.js","assets/index-BV8s6ez1.js","assets/index-DHVwxjrm.js","assets/events-DQ172AOg.js","assets/index.es-Hqwz_Ukd.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BeUp3nOq.js","assets/index-BV8s6ez1.js","assets/index-Et5S3ZaW.js","assets/events-DQ172AOg.js","assets/index.es-dfpEui-9.js"])))=>i.map(i=>d[i]);
2
2
  var zS=Object.defineProperty;var Sw=e=>{throw TypeError(e)};var $S=(e,t,n)=>t in e?zS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ka=(e,t,n)=>$S(e,typeof t!="symbol"?t+"":t,n),Em=(e,t,n)=>t.has(e)||Sw("Cannot "+n);var V=(e,t,n)=>(Em(e,t,"read from private field"),n?n.call(e):t.get(e)),We=(e,t,n)=>t.has(e)?Sw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Me=(e,t,n,r)=>(Em(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),tt=(e,t,n)=>(Em(e,t,"access private method"),n);var qf=(e,t,n,r)=>({set _(a){Me(e,t,a,n)},get _(){return V(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const l of c.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(a){if(a.ep)return;a.ep=!0;const c=n(a);fetch(a.href,c)}})();var sge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function age(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Nm={exports:{}},nu={},Mm={exports:{}},rt={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -1680,7 +1680,7 @@ ${T7(v)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
1680
1680
  `);super(p,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{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,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{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,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=n.cause,this.details=r,this.docs=l,this.docsOrigin=c,this.docsPath=a,this.shortMessage=t,this.showVersion=u,this.version=d}walk(t){return B3(this,t)}};Object.defineProperty(st,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${rE()}`}});st.setStaticOptions(st.defaultStaticOptions);function B3(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?B3(e.cause,t):t?null:e}function xd(e,t){if(Sc(e)>t)throw new wE({givenSize:Sc(e),maxSize:t})}const Qs={zero:48,nine:57,A:65,F:70,a:97,f:102};function p5(e){if(e>=Qs.zero&&e<=Qs.nine)return e-Qs.zero;if(e>=Qs.A&&e<=Qs.F)return e-(Qs.A-10);if(e>=Qs.a&&e<=Qs.f)return e-(Qs.a-10)}function sE(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new _E({size:e.length,targetSize:r,type:"Bytes"});const a=new Uint8Array(r);for(let c=0;c<r;c++){const l=n==="right";a[l?c:r-c-1]=e[l?c:e.length-c-1]}return a}function T3(e,t={}){const{dir:n="left"}=t;let r=e,a=0;for(let c=0;c<r.length-1&&r[n==="left"?c:r.length-c-1].toString()==="0";c++)a++;return r=n==="left"?r.slice(a):r.slice(0,r.length-a),r}function yp(e,t){if(wr(e)>t)throw new AE({givenSize:wr(e),maxSize:t})}function aE(e,t){if(typeof t=="number"&&t>0&&t>wr(e)-1)throw new H3({offset:t,position:"start",size:wr(e)})}function oE(e,t,n){if(typeof t=="number"&&typeof n=="number"&&wr(e)!==n-t)throw new H3({offset:n,position:"end",size:wr(e)})}function P3(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const a=e.replace("0x","");if(a.length>r*2)throw new EE({size:Math.ceil(a.length/2),targetSize:r,type:"Hex"});return`0x${a[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const iE="#__bigint";function R3(e,t,n){return JSON.stringify(e,(r,a)=>typeof a=="bigint"?a.toString()+iE:a,n)}const cE=new TextDecoder,lE=new TextEncoder;function uE(e){return e instanceof Uint8Array?e:typeof e=="string"?L3(e):dE(e)}function dE(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function L3(e,t={}){const{size:n}=t;let r=e;n&&(yp(e,n),r=Ci(e,n));let a=r.slice(2);a.length%2&&(a=`0${a}`);const c=a.length/2,l=new Uint8Array(c);for(let u=0,d=0;u<c;u++){const p=p5(a.charCodeAt(d++)),h=p5(a.charCodeAt(d++));if(p===void 0||h===void 0)throw new st(`Invalid byte sequence ("${a[d-2]}${a[d-1]}" in "${a}").`);l[u]=p<<4|h}return l}function fE(e,t={}){const{size:n}=t,r=lE.encode(e);return typeof n=="number"?(xd(r,n),hE(r,n)):r}function hE(e,t){return sE(e,{dir:"right",size:t})}function Sc(e){return e.length}function pE(e,t,n,r={}){const{strict:a}=r;return e.slice(t,n)}function mE(e,t={}){const{size:n}=t;typeof n<"u"&&xd(e,n);const r=is(e,t);return F3(r,t)}function gE(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(xd(r,n),r=D3(r)),r.length>1||r[0]>1)throw new bE(r);return!!r[0]}function ca(e,t={}){const{size:n}=t;typeof n<"u"&&xd(e,n);const r=is(e,t);return z3(r,t)}function yE(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(xd(r,n),r=vE(r)),cE.decode(r)}function D3(e){return T3(e,{dir:"left"})}function vE(e){return T3(e,{dir:"right"})}class bE extends st{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let wE=class extends st{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},_E=class extends st{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const xE=new TextEncoder,CE=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function kE(e,t={}){const{strict:n=!1}=t;if(!e)throw new m5(e);if(typeof e!="string")throw new m5(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new g5(e);if(!e.startsWith("0x"))throw new g5(e)}function os(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function jE(e){return e instanceof Uint8Array?is(e):Array.isArray(e)?is(new Uint8Array(e)):e}function O3(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(yp(n,t.size),xi(n,t.size)):n}function is(e,t={}){let n="";for(let a=0;a<e.length;a++)n+=CE[e[a]];const r=`0x${n}`;return typeof t.size=="number"?(yp(r,t.size),Ci(r,t.size)):r}function Ln(e,t={}){const{signed:n,size:r}=t,a=BigInt(e);let c;r?n?c=(1n<<BigInt(r)*8n-1n)-1n:c=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(c=BigInt(Number.MAX_SAFE_INTEGER));const l=typeof c=="bigint"&&n?-c-1n:0;if(c&&a>c||a<l){const p=typeof e=="bigint"?"n":"";throw new $3({max:c?`${c}${p}`:void 0,min:`${l}${p}`,signed:n,size:r,value:`${e}${p}`})}const d=`0x${(n&&a<0?BigInt.asUintN(r*8,BigInt(a)):a).toString(16)}`;return r?xi(d,r):d}function Hy(e,t={}){return is(xE.encode(e),t)}function xi(e,t){return P3(e,{dir:"left",size:t})}function Ci(e,t){return P3(e,{dir:"right",size:t})}function Ss(e,t,n,r={}){const{strict:a}=r;aE(e,t);const c=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return a&&oE(c,t,n),c}function wr(e){return Math.ceil((e.length-2)/2)}function F3(e,t={}){const{signed:n}=t;t.size&&yp(e,t.size);const r=BigInt(e);if(!n)return r;const a=(e.length-2)/2,c=(1n<<BigInt(a)*8n)-1n,l=c>>1n;return r<=l?r:r-c-1n}function z3(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:F3(e,t))}function SE(e,t={}){const{strict:n=!1}=t;try{return kE(e,{strict:n}),!0}catch{return!1}}class $3 extends st{constructor({max:t,min:n,signed:r,size:a,value:c}){super(`Number \`${c}\` is not in safe${a?` ${a*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class m5 extends st{constructor(t){super(`Value \`${typeof t=="object"?R3(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class g5 extends st{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class AE extends st{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class H3 extends st{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class EE extends st{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function NE(e){return{address:e.address,amount:Ln(e.amount),index:Ln(e.index),validatorIndex:Ln(e.validatorIndex)}}function U3(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Ln(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Ln(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Ln(e.gasLimit)},...typeof e.number=="bigint"&&{number:Ln(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Ln(e.prevRandao)},...typeof e.time=="bigint"&&{time:Ln(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(NE)}}}const ME="0x82ad56cb",W3="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",IE="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",BE="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Uy="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033",Wm="/docs/contract/encodeDeployData";function Wy(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const a=t.find(l=>"type"in l&&l.type==="constructor");if(!a)throw new dA({docsPath:Wm});if(!("inputs"in a))throw new Hw({docsPath:Wm});if(!a.inputs||a.inputs.length===0)throw new Hw({docsPath:Wm});const c=Ii(a.inputs,n);return _r([r,c])}function el(e,t){if(!Ft(e,{strict:!1}))throw new An({address:e});if(!Ft(t,{strict:!1}))throw new An({address:t});return e.toLowerCase()===t.toLowerCase()}function Ti(e){const{blockHash:t,blockNumber:n,blockTag:r,requireCanonical:a}=e;if(a!==void 0&&!t)throw new le("`requireCanonical` can only be provided when `blockHash` is set.");return t?a?{blockHash:t,requireCanonical:a}:{blockHash:t}:typeof n=="bigint"?we(n):r??"latest"}class Ac extends le{constructor({cause:t,message:n}={}){var a;const r=(a=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:a.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(Ac,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Ac,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class ki extends le{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${rr(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(ki,"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 gg extends le{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${rr(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(gg,"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 yg extends le{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(yg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class vg extends le{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(`
1681
1681
  `),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(vg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class bg extends le{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(bg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class wg extends le{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
1682
1682
  `),{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(wg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class _g extends le{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(_g,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class xg extends le{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(xg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Cg extends le{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Cg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Qu extends le{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${rr(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${rr(r)} gwei`:""}).`].join(`
1683
- `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(Qu,"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 Cd extends le{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function vp(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof le?e.walk(a=>(a==null?void 0:a.code)===Ac.code):e;return r instanceof le?new Ac({cause:e,message:r.details}):Ac.nodeMessage.test(n)?new Ac({cause:e,message:e.details}):ki.nodeMessage.test(n)?new ki({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):gg.nodeMessage.test(n)?new gg({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):yg.nodeMessage.test(n)?new yg({cause:e,nonce:t==null?void 0:t.nonce}):vg.nodeMessage.test(n)?new vg({cause:e,nonce:t==null?void 0:t.nonce}):bg.nodeMessage.test(n)?new bg({cause:e,nonce:t==null?void 0:t.nonce}):wg.nodeMessage.test(n)?new wg({cause:e}):_g.nodeMessage.test(n)?new _g({cause:e,gas:t==null?void 0:t.gas}):xg.nodeMessage.test(n)?new xg({cause:e,gas:t==null?void 0:t.gas}):Cg.nodeMessage.test(n)?new Cg({cause:e}):Qu.nodeMessage.test(n)?new Qu({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new Cd({cause:e})}function V3(e,{docsPath:t,...n}){const r=(()=>{const a=vp(e,n);return a instanceof Cd?e:a})();return new S3(r,{docsPath:t,...n})}function kd(e,{format:t}){if(!t)return{};const n={};function r(c){const l=Object.keys(c);for(const u of l)u in e&&(n[u]=e[u]),c[u]&&typeof c[u]=="object"&&!Array.isArray(c[u])&&r(c[u])}const a=t(e||{});return r(a),n}function Vy(e,t){return({exclude:n,format:r})=>({exclude:n,format:(a,c)=>{const l=t(a,c);if(n)for(const u of n)delete l[u];return{...l,...r(a,c)}},type:e})}const TE={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function dl(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=PE(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>Vt(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=we(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=we(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=we(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=we(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=we(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=we(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=TE[e.type]),typeof e.value<"u"&&(n.value=we(e.value)),n}function PE(e){return e.map(t=>({address:t.address,r:t.r?we(BigInt(t.r)):t.r,s:t.s?we(BigInt(t.s)):t.s,chainId:we(t.chainId),nonce:we(t.nonce),...typeof t.yParity<"u"?{yParity:we(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:we(t.v)}:{}}))}function G3(){let e=()=>{},t=()=>{};return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}const Vm=new Map;function q3({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:a}){const c=async()=>{const h=d();l();const m=h.map(({args:g})=>g);m.length!==0&&e(m).then(g=>{a&&Array.isArray(g)&&g.sort(a);for(let v=0;v<h.length;v++){const{resolve:b}=h[v];b==null||b([g[v],g])}}).catch(g=>{for(let v=0;v<h.length;v++){const{reject:b}=h[v];b==null||b(g)}})},l=()=>Vm.delete(t),u=()=>d().map(({args:h})=>h),d=()=>Vm.get(t)||[],p=h=>Vm.set(t,[...d(),h]);return{flush:l,async schedule(h){const{promise:m,resolve:g,reject:v}=G3();return(n==null?void 0:n([...u(),h]))&&c(),d().length>0?(p({args:h,resolve:g,reject:v}),m):(p({args:h,resolve:g,reject:v}),setTimeout(c,r),m)}}}function y5(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Vw({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Vw({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function RE(e){const{balance:t,nonce:n,state:r,stateDiff:a,code:c}=e,l={};if(c!==void 0&&(l.code=c),t!==void 0&&(l.balance=we(t)),n!==void 0&&(l.nonce=we(n)),r!==void 0&&(l.state=y5(r)),a!==void 0){if(l.state)throw new B7;l.stateDiff=y5(a)}return l}function Gy(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!Ft(n,{strict:!1}))throw new An({address:n});if(t[n])throw new I7({address:n});t[n]=RE(r)}return t}const bp=2n**256n-1n;function Pi(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:a}=e,c=t?mn(t):void 0;if(c&&!Ft(c.address))throw new An({address:c.address});if(a&&!Ft(a))throw new An({address:a});if(n&&n>bp)throw new ki({maxFeePerGas:n});if(r&&n&&r>n)throw new Qu({maxFeePerGas:n,maxPriorityFeePerGas:r})}async function fl(e,t){var L,se,D,X,te,W;const{account:n=e.account,authorizationList:r,batch:a=!!((L=e.batch)!=null&&L.multicall),blockHash:c,blockNumber:l,blockTag:u=e.experimental_blockTag??"latest",requireCanonical:d,accessList:p,blobs:h,blockOverrides:m,code:g,data:v,factory:b,factoryData:_,gas:x,gasPrice:j,maxFeePerBlobGas:A,maxFeePerGas:k,maxPriorityFeePerGas:N,nonce:E,requestOptions:B,to:M,value:P,stateOverride:R,...z}=t,q=n?mn(n):void 0;if(g&&(b||_))throw new le("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(g&&M)throw new le("Cannot provide both `code` & `to` as parameters.");const Q=g&&v,O=b&&_&&M&&v,K=Q||O,$=Q?Q3({code:g,data:v}):O?$E({data:v,factory:b,factoryData:_,to:M}):v;try{Pi(t);const oe=Ti({blockHash:c,blockNumber:l,blockTag:u,requireCanonical:d}),be=m?U3(m):void 0,Y=Gy(R),ue=(X=(D=(se=e.chain)==null?void 0:se.formatters)==null?void 0:D.transactionRequest)==null?void 0:X.format,Re=(ue||dl)({...kd(z,{format:ue}),accessList:p,account:q,authorizationList:r,blobs:h,data:$,gas:x,gasPrice:j,maxFeePerBlobGas:A,maxFeePerGas:k,maxPriorityFeePerGas:N,nonce:E,to:K?void 0:M,value:P},"call");if(a&&LE({request:Re})&&!be&&c===void 0)try{const{deployless:Xe=!1}=typeof((te=e.batch)==null?void 0:te.multicall)=="object"?e.batch.multicall:{},Tt=K3(e,{blockNumber:l,deployless:Xe});if(!Tt||!zE(Y,Tt))return await FE(e,{...Re,blockHash:c,blockNumber:l,blockTag:u,multicallAddress:Tt,requestOptions:B,requireCanonical:d,rpcStateOverride:Y})}catch(Xe){if(!(Xe instanceof w3)&&!(Xe instanceof fg))throw Xe}const Ae=(()=>{const Xe=[Re,oe];return Y&&be?[...Xe,Y,be]:Y?[...Xe,Y]:be?[...Xe,{},be]:Xe})(),qe=await e.request({method:"eth_call",params:Ae},B);return qe==="0x"?{data:void 0}:{data:qe}}catch(oe){if((W=B==null?void 0:B.signal)!=null&&W.aborted)throw vo(B.signal);if(ul(oe))throw oe;const be=HE(oe),{offchainLookup:Y,offchainLookupSignature:ue}=await je(async()=>{const{offchainLookup:xe,offchainLookupSignature:Re}=await import("./ccip-8oS512uk.js");return{offchainLookup:xe,offchainLookupSignature:Re}},[]);if(e.ccipRead!==!1&&(be==null?void 0:be.slice(0,10))===ue&&M)return{data:await Y(e,{data:be,requestOptions:B,to:M})};throw K&&(be==null?void 0:be.slice(0,10))==="0x101bb98d"?new H7({factory:b}):V3(oe,{...t,account:q,chain:e.chain})}}function LE({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(ME)||!n||Object.values(r).filter(a=>typeof a<"u").length>0)}let DE=0;const v5=new WeakMap;function OE(e){if(!e)return"default";const t=v5.get(e);if(t!==void 0)return t;const n=DE++;return v5.set(e,n),n}async function FE(e,t){var E;const{batchSize:n=1024,deployless:r=!1,wait:a=0}=typeof((E=e.batch)==null?void 0:E.multicall)=="object"?e.batch.multicall:{},{blockHash:c,blockNumber:l,blockTag:u=e.experimental_blockTag??"latest",requireCanonical:d,data:p,multicallAddress:h,requestOptions:m,rpcStateOverride:g,to:v}=t,b=h!==void 0?h:K3(e,{blockNumber:l,deployless:r}),_=Ti({blockHash:c,blockNumber:l,blockTag:u,requireCanonical:d}),x=typeof _=="string"?_:JSON.stringify(_),j=g?`.${JSON.stringify(g)}`:"",{schedule:A}=q3({id:`${e.uid}.${x}.${OE(m)}${j}`,wait:a,shouldSplitBatch(B){return B.reduce((P,{data:R})=>P+(R.length-2),0)>n*2},fn:async B=>{const M=B.map(q=>({allowFailure:!0,callData:q.data,target:q.to})),P=At({abi:Qc,args:[M],functionName:"aggregate3"}),R={...b===null?{data:Q3({code:Uy,data:P})}:{to:b,data:P}},z=await e.request({method:"eth_call",params:g?[R,_,g]:[R,_]},m);return ko({abi:Qc,args:[M],functionName:"aggregate3",data:z||"0x"})}}),[{returnData:k,success:N}]=await A({data:p,to:v});if(!N)throw new hp({data:k});return k==="0x"?{data:void 0}:{data:k}}function K3(e,t){const{blockNumber:n,deployless:r}=t;if(r)return null;if(e.chain)return ll({blockNumber:n,chain:e.chain,contract:"multicall3"});throw new w3}function zE(e,t){return e?Object.keys(e).some(n=>el(n,t)):!1}function Q3(e){const{code:t,data:n}=e;return Wy({abi:y3(["constructor(bytes, bytes)"]),bytecode:W3,args:[t,n]})}function $E(e){const{data:t,factory:n,factoryData:r,to:a}=e;return Wy({abi:y3(["constructor(address, bytes, address, bytes)"]),bytecode:IE,args:[a,t,n,r]})}function HE(e){var n;if(!(e instanceof le))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function Lr(e,t){const{abi:n,address:r,args:a,functionName:c,...l}=t,u=At({abi:n,args:a,functionName:c});try{const{data:d}=await Ue(e,fl,"call")({...l,data:u,to:r});return ko({abi:n,args:a,functionName:c,data:d||"0x"})}catch(d){throw Zc(d,{abi:n,address:r,args:a,docsPath:"/docs/contract/readContract",functionName:c})}}async function UE(e,t){const{blockNumber:n,blockTag:r,coinType:a,name:c,gatewayUrls:l,strict:u}=t,{chain:d}=e,p=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!d)throw new Error("client chain not configured. universalResolverAddress is required.");return ll({blockNumber:n,chain:d,contract:"ensUniversalResolver"})})(),h=d==null?void 0:d.ensTlds;if(h&&!h.some(g=>c.endsWith(g)))return null;const m=a!=null?[pg(c),BigInt(a)]:[pg(c)];try{const g=At({abi:Px,functionName:"addr",args:m}),v={address:p,abi:Tx,functionName:"resolveWithGateways",args:[nr(Oy(c)),g,l??[pp]],blockNumber:n,blockTag:r},_=await Ue(e,Lr,"readContract")(v);if(_[0]==="0x")return null;const x=WE({coinType:a,data:_[0],args:m});return x==="0x"||tr(x)==="0x00"?null:x}catch(g){if(u)throw g;if(Dy(g))return null;throw g}}function WE({coinType:e,data:t,args:n}){try{return ko({abi:Px,args:n,functionName:"addr",data:t})}catch(r){if(e==null)throw r;const a=tr(t);if(jt(a)===20)return xt(a);throw r}}class VE extends le{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class ou extends le{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class qy extends le{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class GE extends le{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const qE=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,KE=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,QE=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,YE=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function JE(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function b5(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Y3({uri:e,gatewayUrls:t}){const n=QE.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=b5(t==null?void 0:t.ipfs,"https://ipfs.io"),a=b5(t==null?void 0:t.arweave,"https://arweave.net"),c=e.match(qE),{protocol:l,subpath:u,target:d,subtarget:p=""}=(c==null?void 0:c.groups)||{},h=l==="ipns:/"||u==="ipns/",m=l==="ipfs:/"||u==="ipfs/"||KE.test(e);if(e.startsWith("http")&&!h&&!m){let v=e;return t!=null&&t.arweave&&(v=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:v,isOnChain:!1,isEncoded:!1}}if((h||m)&&d)return{uri:`${r}/${h?"ipns":"ipfs"}/${d}${p}`,isOnChain:!1,isEncoded:!1};if(l==="ar:/"&&d)return{uri:`${a}/${d}${p||""}`,isOnChain:!1,isEncoded:!1};let g=e.replace(YE,"");if(g.startsWith("<svg")&&(g=`data:image/svg+xml;base64,${btoa(g)}`),g.startsWith("data:")||g.startsWith("{"))return{uri:g,isOnChain:!0,isEncoded:!1};throw new qy({uri:e})}function J3(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new VE({data:e});return e.image||e.image_url||e.image_data}async function XE({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(a=>a.json());return await Ky({gatewayUrls:e,uri:J3(n)})}catch{throw new qy({uri:t})}}async function Ky({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=Y3({uri:t,gatewayUrls:e});if(r||await JE(n))return n;throw new qy({uri:t})}function ZE(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,a]=t.split("/"),[c,l]=n.split(":"),[u,d]=r.split(":");if(!c||c.toLowerCase()!=="eip155")throw new ou({reason:"Only EIP-155 supported"});if(!l)throw new ou({reason:"Chain ID not found"});if(!d)throw new ou({reason:"Contract address not found"});if(!a)throw new ou({reason:"Token ID not found"});if(!u)throw new ou({reason:"ERC namespace not found"});return{chainID:Number.parseInt(l,10),namespace:u.toLowerCase(),contractAddress:d,tokenID:a}}async function eN(e,{nft:t}){if(t.namespace==="erc721")return Lr(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return Lr(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new GE({namespace:t.namespace})}async function tN(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?nN(e,{gatewayUrls:t,record:n}):Ky({uri:n,gatewayUrls:t})}async function nN(e,{gatewayUrls:t,record:n}){const r=ZE(n),a=await eN(e,{nft:r}),{uri:c,isOnChain:l,isEncoded:u}=Y3({uri:a,gatewayUrls:t});if(l&&(c.includes("data:application/json;base64,")||c.startsWith("{"))){const p=u?atob(c.replace("data:application/json;base64,","")):c,h=JSON.parse(p);return Ky({uri:J3(h),gatewayUrls:t})}let d=r.tokenID;return r.namespace==="erc1155"&&(d=d.replace("0x","").padStart(64,"0")),XE({gatewayUrls:t,uri:c.replace(/(?:0x)?{id}/,d)})}async function X3(e,t){const{blockNumber:n,blockTag:r,key:a,name:c,gatewayUrls:l,strict:u}=t,{chain:d}=e,p=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!d)throw new Error("client chain not configured. universalResolverAddress is required.");return ll({blockNumber:n,chain:d,contract:"ensUniversalResolver"})})(),h=d==null?void 0:d.ensTlds;if(h&&!h.some(m=>c.endsWith(m)))return null;try{const m={address:p,abi:Tx,args:[nr(Oy(c)),At({abi:zw,functionName:"text",args:[pg(c),a]}),l??[pp]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},v=await Ue(e,Lr,"readContract")(m);if(v[0]==="0x")return null;const b=ko({abi:zw,functionName:"text",data:v[0]});return b===""?null:b}catch(m){if(u)throw m;if(Dy(m))return null;throw m}}async function Z3(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:a,gatewayUrls:c,strict:l,universalResolverAddress:u}){const d=await Ue(e,X3,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:a,universalResolverAddress:u,gatewayUrls:c,strict:l});if(!d)return null;try{return await tN(e,{record:d,gatewayUrls:r})}catch{return null}}async function eC(e,t){const{address:n,blockNumber:r,blockTag:a,coinType:c=60n,gatewayUrls:l,strict:u}=t,{chain:d}=e,p=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!d)throw new Error("client chain not configured. universalResolverAddress is required.");return ll({blockNumber:r,chain:d,contract:"ensUniversalResolver"})})();try{const h={address:p,abi:lA,args:[n,c,l??[pp]],functionName:"reverseWithGateways",blockNumber:r,blockTag:a},m=Ue(e,Lr,"readContract"),[g]=await m(h);return g||null}catch(h){if(u)throw h;if(Dy(h))return null;throw h}}async function rN(e,t){const{blockNumber:n,blockTag:r,name:a}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return ll({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(p=>a.endsWith(p)))throw new Error(`${a} is not a valid ENS TLD (${u==null?void 0:u.join(", ")}) for chain "${c.name}" (id: ${c.id}).`);const[d]=await Ue(e,Lr,"readContract")({address:l,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[nr(Oy(a))],blockNumber:n,blockTag:r});return d}async function tC(e,t){var x,j,A;const{account:n=e.account,blockNumber:r,blockTag:a="latest",blobs:c,data:l,gas:u,gasPrice:d,maxFeePerBlobGas:p,maxFeePerGas:h,maxPriorityFeePerGas:m,to:g,value:v,...b}=t,_=n?mn(n):void 0;try{Pi(t);const N=(typeof r=="bigint"?we(r):void 0)||a,E=(A=(j=(x=e.chain)==null?void 0:x.formatters)==null?void 0:j.transactionRequest)==null?void 0:A.format,M=(E||dl)({...kd(b,{format:E}),account:_,blobs:c,data:l,gas:u,gasPrice:d,maxFeePerBlobGas:p,maxFeePerGas:h,maxPriorityFeePerGas:m,to:g,value:v},"createAccessList"),P=await e.request({method:"eth_createAccessList",params:[M,N]});if(P.error)throw new le(P.error,{details:P.error});return{accessList:P.accessList,gasUsed:BigInt(P.gasUsed)}}catch(k){throw V3(k,{...t,account:_,chain:e.chain})}}function wp(e,{method:t}){var r,a;const n={};return e.transport.type==="fallback"&&((a=(r=e.transport).onResponse)==null||a.call(r,({method:c,response:l,status:u,transport:d})=>{u==="success"&&t===c&&(n[l]=d.request)})),(c=>n[c]||e.request)}async function sN(e){const t=wp(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}class aN extends le{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const w5="/docs/contract/encodeEventTopics";function jd(e){var d;const{abi:t,eventName:n,args:r}=e;let a=t[0];if(n){const p=Bi({abi:t,name:n});if(!p)throw new Ww(n,{docsPath:w5});a=p}if(a.type!=="event")throw new Ww(void 0,{docsPath:w5});let c=[];if(r&&"inputs"in a){const p=(d=a.inputs)==null?void 0:d.filter(m=>"indexed"in m&&m.indexed),h=Array.isArray(r)?r:Object.values(r).length>0?(p==null?void 0:p.map(m=>r[m.name]))??[]:[];h.length>0&&(c=(p==null?void 0:p.map((m,g)=>Array.isArray(h[g])?h[g].map((v,b)=>_5({param:m,value:h[g][b]})):typeof h[g]<"u"&&h[g]!==null?_5({param:m,value:h[g]}):null))??[])}if(a.anonymous)return c;const l=as(a);return[up(l),...c]}function _5({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return cn(il(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new aN(e.type);return Ii([e],[t])}async function nC(e,t){const{address:n,abi:r,args:a,eventName:c,fromBlock:l,strict:u,toBlock:d}=t,p=wp(e,{method:"eth_newFilter"}),h=c?jd({abi:r,args:a,eventName:c}):void 0,m=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof l=="bigint"?we(l):l,toBlock:typeof d=="bigint"?we(d):d,topics:h}]});return{abi:r,args:a,eventName:c,id:m,request:p(m),strict:!!u,type:"event"}}async function rC(e,{address:t,args:n,event:r,events:a,fromBlock:c,strict:l,toBlock:u}={}){const d=a??(r?[r]:void 0),p=wp(e,{method:"eth_newFilter"});let h=[];d&&(h=[d.flatMap(v=>jd({abi:[v],eventName:v.name,args:n}))],r&&(h=h[0]));const m=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof c=="bigint"?we(c):c,toBlock:typeof u=="bigint"?we(u):u,...h.length?{topics:h}:{}}]});return{abi:d,args:n,eventName:r?r.name:void 0,fromBlock:c,id:m,request:p(m),strict:!!l,toBlock:u,type:"event"}}async function sC(e){const t=wp(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}function oN(e){const t=cn(`0x${e.substring(4)}`).substring(26);return cp(`0x${t}`)}async function iN({hash:e,signature:t}){const n=Es(e)?e:nr(e),{secp256k1:r}=await je(async()=>{const{secp256k1:l}=await Promise.resolve().then(()=>BI);return{secp256k1:l}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:p,s:h,v:m,yParity:g}=t,v=Number(g??m),b=x5(v);return new r.Signature(jn(p),jn(h)).addRecoveryBit(b)}const l=Es(t)?t:nr(t);if(jt(l)!==65)throw new Error("invalid signature length");const u=Tr(`0x${l.slice(130)}`),d=x5(u);return r.Signature.fromCompact(l.substring(2,130)).addRecoveryBit(d)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function x5(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 kg({hash:e,signature:t}){return oN(await iN({hash:e,signature:t}))}function wo(e,t="hex"){const n=aC(e),r=Ey(new Uint8Array(n.length));return n.encode(r),t==="hex"?Vt(r.bytes):r.bytes}function aC(e){return Array.isArray(e)?cN(e.map(t=>aC(t))):lN(e)}function cN(e){const t=e.reduce((a,c)=>a+c.length,0),n=oC(t);return{length:t<=55?1+t:1+n+t,encode(a){t<=55?a.pushByte(192+t):(a.pushByte(247+n),n===1?a.pushUint8(t):n===2?a.pushUint16(t):n===3?a.pushUint24(t):a.pushUint32(t));for(const{encode:c}of e)c(a)}}}function lN(e){const t=typeof e=="string"?Pr(e):e,n=oC(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(a){t.length===1&&t[0]<128?a.pushBytes(t):t.length<=55?(a.pushByte(128+t.length),a.pushBytes(t)):(a.pushByte(183+n),n===1?a.pushUint8(t.length):n===2?a.pushUint16(t.length):n===3?a.pushUint24(t.length):a.pushUint32(t.length),a.pushBytes(t))}}}function oC(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 le("Length is too large.")}function uN(e){const{chainId:t,nonce:n,to:r}=e,a=e.contractAddress??e.address,c=cn(_r(["0x05",wo([t?we(t):"0x",a,n?we(n):"0x"])]));return r==="bytes"?Pr(c):c}async function Qy(e){const{authorization:t,signature:n}=e;return kg({hash:uN(t),signature:n??t})}class dN extends le{constructor(t,{account:n,docsPath:r,chain:a,data:c,gas:l,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,to:m,value:g}){var b;const v=bd({from:n==null?void 0:n.address,to:m,value:typeof g<"u"&&`${Py(g)} ${((b=a==null?void 0:a.nativeCurrency)==null?void 0:b.symbol)||"ETH"}`,data:c,gas:l,gasPrice:typeof u<"u"&&`${rr(u)} gwei`,maxFeePerGas:typeof d<"u"&&`${rr(d)} gwei`,maxPriorityFeePerGas:typeof p<"u"&&`${rr(p)} gwei`,nonce:h});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",v].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function fN(e,{docsPath:t,...n}){const r=(()=>{const a=vp(e,n);return a instanceof Cd?e:a})();return new dN(r,{docsPath:t,...n})}class iC extends le{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Yy extends le{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class hN extends le{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${rr(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class Jy extends le{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 cC={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Sd(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,...e.blockTimestamp!=null&&{blockTimestamp:BigInt(e.blockTimestamp)},chainId:e.chainId?Tr(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?Tr(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?cC[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&&(n.authorizationList=mN(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const pN=Vy("transaction",Sd);function mN(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Xy(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:Sd(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:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const gN=Vy("block",Xy);async function ts(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:a}={}){var p,h,m;const c=a??!1,l=n!==void 0?we(n):void 0;let u=null;if(t?u=await e.request({method:"eth_getBlockByHash",params:[t,c]},{dedupe:!0}):u=await e.request({method:"eth_getBlockByNumber",params:[l||r,c]},{dedupe:!!l}),!u)throw new Jy({blockHash:t,blockNumber:n});return(((m=(h=(p=e.chain)==null?void 0:p.formatters)==null?void 0:h.block)==null?void 0:m.format)||Xy)(u,"getBlock")}async function Zy(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function yN(e,t){return lC(e,t)}async function lC(e,t){var c,l;const{block:n,chain:r=e.chain,request:a}=t||{};try{const u=((c=r==null?void 0:r.fees)==null?void 0:c.maxPriorityFeePerGas)??((l=r==null?void 0:r.fees)==null?void 0:l.defaultPriorityFee);if(typeof u=="function"){const p=n||await Ue(e,ts,"getBlock")({}),h=await u({block:p,client:e,request:a});if(h===null)throw new Error;return h}if(typeof u<"u")return u;const d=await e.request({method:"eth_maxPriorityFeePerGas"});return jn(d)}catch{const[u,d]=await Promise.all([n?Promise.resolve(n):Ue(e,ts,"getBlock")({}),Ue(e,Zy,"getGasPrice")({})]);if(typeof u.baseFeePerGas!="bigint")throw new Yy;const p=d-u.baseFeePerGas;return p<0n?0n:p}}async function vN(e,t){return jg(e,t)}async function jg(e,t){var g,v;const{block:n,chain:r=e.chain,request:a,type:c="eip1559"}=t||{},l=await(async()=>{var b,_;return typeof((b=r==null?void 0:r.fees)==null?void 0:b.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:a}):((_=r==null?void 0:r.fees)==null?void 0:_.baseFeeMultiplier)??1.2})();if(l<1)throw new iC;const d=10**(((g=l.toString().split(".")[1])==null?void 0:g.length)??0),p=b=>b*BigInt(Math.ceil(l*d))/BigInt(d),h=n||await Ue(e,ts,"getBlock")({});if(typeof((v=r==null?void 0:r.fees)==null?void 0:v.estimateFeesPerGas)=="function"){const b=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:p,request:a,type:c});if(b!==null)return b}if(c==="eip1559"){if(typeof h.baseFeePerGas!="bigint")throw new Yy;const b=typeof(a==null?void 0:a.maxPriorityFeePerGas)=="bigint"?a.maxPriorityFeePerGas:await lC(e,{block:h,chain:r,request:a}),_=p(h.baseFeePerGas);return{maxFeePerGas:(a==null?void 0:a.maxFeePerGas)??_+b,maxPriorityFeePerGas:b}}return{gasPrice:(a==null?void 0:a.gasPrice)??p(await Ue(e,Zy,"getGasPrice")({}))}}async function uC(e,{address:t,blockHash:n,blockNumber:r,blockTag:a="latest",requireCanonical:c}){const l=Ti({blockHash:n,blockNumber:r,blockTag:a,requireCanonical:c}),u=await e.request({method:"eth_getTransactionCount",params:[t,l]},{dedupe:typeof r=="bigint"||n!==void 0});return Tr(u)}function ev(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(c=>Pr(c)):e.blobs,a=[];for(const c of r)a.push(Uint8Array.from(t.blobToKzgCommitment(c)));return n==="bytes"?a:a.map(c=>Vt(c))}function tv(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(l=>Pr(l)):e.blobs,a=typeof e.commitments[0]=="string"?e.commitments.map(l=>Pr(l)):e.commitments,c=[];for(let l=0;l<r.length;l++){const u=r[l],d=a[l];c.push(Uint8Array.from(t.computeBlobKzgProof(u,d)))}return n==="bytes"?c:c.map(l=>Vt(l))}function bN(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const a=BigInt(32),c=BigInt(4294967295),l=Number(n>>a&c),u=Number(n&c),d=r?4:0,p=r?0:4;e.setUint32(t+d,l,r),e.setUint32(t+p,u,r)}function wN(e,t,n){return e&t^~e&n}function _N(e,t,n){return e&t^e&n^t&n}class dC extends Sy{constructor(t,n,r,a){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=a,this.buffer=new Uint8Array(t),this.view=Rm(this.buffer)}update(t){Jc(this),t=op(t),mo(t);const{view:n,buffer:r,blockLen:a}=this,c=t.length;for(let l=0;l<c;){const u=Math.min(a-this.pos,c-l);if(u===a){const d=Rm(t);for(;a<=c-l;l+=a)this.process(d,l);continue}r.set(t.subarray(l,l+u),this.pos),this.pos+=u,l+=u,this.pos===a&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Jc(this),Kx(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:a,isLE:c}=this;let{pos:l}=this;n[l++]=128,go(this.buffer.subarray(l)),this.padOffset>a-l&&(this.process(r,0),l=0);for(let m=l;m<a;m++)n[m]=0;bN(r,a-8,BigInt(this.length*8),c),this.process(r,0);const u=Rm(t),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const p=d/4,h=this.get();if(p>h.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<p;m++)u.setUint32(4*m,h[m],c)}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:a,finished:c,destroyed:l,pos:u}=this;return t.destroyed=l,t.finished=c,t.length=a,t.pos=u,a%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const Qa=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),xn=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Cn=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),xN=Uint32Array.from([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]),Ya=new Uint32Array(64);class CN extends dC{constructor(t=32){super(64,t,8,!1),this.A=Qa[0]|0,this.B=Qa[1]|0,this.C=Qa[2]|0,this.D=Qa[3]|0,this.E=Qa[4]|0,this.F=Qa[5]|0,this.G=Qa[6]|0,this.H=Qa[7]|0}get(){const{A:t,B:n,C:r,D:a,E:c,F:l,G:u,H:d}=this;return[t,n,r,a,c,l,u,d]}set(t,n,r,a,c,l,u,d){this.A=t|0,this.B=n|0,this.C=r|0,this.D=a|0,this.E=c|0,this.F=l|0,this.G=u|0,this.H=d|0}process(t,n){for(let m=0;m<16;m++,n+=4)Ya[m]=t.getUint32(n,!1);for(let m=16;m<64;m++){const g=Ya[m-15],v=Ya[m-2],b=gs(g,7)^gs(g,18)^g>>>3,_=gs(v,17)^gs(v,19)^v>>>10;Ya[m]=_+Ya[m-7]+b+Ya[m-16]|0}let{A:r,B:a,C:c,D:l,E:u,F:d,G:p,H:h}=this;for(let m=0;m<64;m++){const g=gs(u,6)^gs(u,11)^gs(u,25),v=h+g+wN(u,d,p)+xN[m]+Ya[m]|0,_=(gs(r,2)^gs(r,13)^gs(r,22))+_N(r,a,c)|0;h=p,p=d,d=u,u=l+v|0,l=c,c=a,a=r,r=v+_|0}r=r+this.A|0,a=a+this.B|0,c=c+this.C|0,l=l+this.D|0,u=u+this.E|0,d=d+this.F|0,p=p+this.G|0,h=h+this.H|0,this.set(r,a,c,l,u,d,p,h)}roundClean(){go(Ya)}destroy(){this.set(0,0,0,0,0,0,0,0),go(this.buffer)}}const fC=qx(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),kN=fC[0],jN=fC[1],Ja=new Uint32Array(80),Xa=new Uint32Array(80);class hC extends dC{constructor(t=64){super(128,t,16,!1),this.Ah=Cn[0]|0,this.Al=Cn[1]|0,this.Bh=Cn[2]|0,this.Bl=Cn[3]|0,this.Ch=Cn[4]|0,this.Cl=Cn[5]|0,this.Dh=Cn[6]|0,this.Dl=Cn[7]|0,this.Eh=Cn[8]|0,this.El=Cn[9]|0,this.Fh=Cn[10]|0,this.Fl=Cn[11]|0,this.Gh=Cn[12]|0,this.Gl=Cn[13]|0,this.Hh=Cn[14]|0,this.Hl=Cn[15]|0}get(){const{Ah:t,Al:n,Bh:r,Bl:a,Ch:c,Cl:l,Dh:u,Dl:d,Eh:p,El:h,Fh:m,Fl:g,Gh:v,Gl:b,Hh:_,Hl:x}=this;return[t,n,r,a,c,l,u,d,p,h,m,g,v,b,_,x]}set(t,n,r,a,c,l,u,d,p,h,m,g,v,b,_,x){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=a|0,this.Ch=c|0,this.Cl=l|0,this.Dh=u|0,this.Dl=d|0,this.Eh=p|0,this.El=h|0,this.Fh=m|0,this.Fl=g|0,this.Gh=v|0,this.Gl=b|0,this.Hh=_|0,this.Hl=x|0}process(t,n){for(let k=0;k<16;k++,n+=4)Ja[k]=t.getUint32(n),Xa[k]=t.getUint32(n+=4);for(let k=16;k<80;k++){const N=Ja[k-15]|0,E=Xa[k-15]|0,B=lc(N,E,1)^lc(N,E,8)^Qw(N,E,7),M=uc(N,E,1)^uc(N,E,8)^Yw(N,E,7),P=Ja[k-2]|0,R=Xa[k-2]|0,z=lc(P,R,19)^Yf(P,R,61)^Qw(P,R,6),q=uc(P,R,19)^Jf(P,R,61)^Yw(P,R,6),Q=FA(M,q,Xa[k-7],Xa[k-16]),O=zA(Q,B,z,Ja[k-7],Ja[k-16]);Ja[k]=O|0,Xa[k]=Q|0}let{Ah:r,Al:a,Bh:c,Bl:l,Ch:u,Cl:d,Dh:p,Dl:h,Eh:m,El:g,Fh:v,Fl:b,Gh:_,Gl:x,Hh:j,Hl:A}=this;for(let k=0;k<80;k++){const N=lc(m,g,14)^lc(m,g,18)^Yf(m,g,41),E=uc(m,g,14)^uc(m,g,18)^Jf(m,g,41),B=m&v^~m&_,M=g&b^~g&x,P=$A(A,E,M,jN[k],Xa[k]),R=HA(P,j,N,B,kN[k],Ja[k]),z=P|0,q=lc(r,a,28)^Yf(r,a,34)^Yf(r,a,39),Q=uc(r,a,28)^Jf(r,a,34)^Jf(r,a,39),O=r&c^r&u^c&u,K=a&l^a&d^l&d;j=_|0,A=x|0,_=v|0,x=b|0,v=m|0,b=g|0,{h:m,l:g}=Gs(p|0,h|0,R|0,z|0),p=u|0,h=d|0,u=c|0,d=l|0,c=r|0,l=a|0;const $=DA(z,Q,K);r=OA($,R,q,O),a=$|0}({h:r,l:a}=Gs(this.Ah|0,this.Al|0,r|0,a|0)),{h:c,l}=Gs(this.Bh|0,this.Bl|0,c|0,l|0),{h:u,l:d}=Gs(this.Ch|0,this.Cl|0,u|0,d|0),{h:p,l:h}=Gs(this.Dh|0,this.Dl|0,p|0,h|0),{h:m,l:g}=Gs(this.Eh|0,this.El|0,m|0,g|0),{h:v,l:b}=Gs(this.Fh|0,this.Fl|0,v|0,b|0),{h:_,l:x}=Gs(this.Gh|0,this.Gl|0,_|0,x|0),{h:j,l:A}=Gs(this.Hh|0,this.Hl|0,j|0,A|0),this.set(r,a,c,l,u,d,p,h,m,g,v,b,_,x,j,A)}roundClean(){go(Ja,Xa)}destroy(){go(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class SN extends hC{constructor(){super(48),this.Ah=xn[0]|0,this.Al=xn[1]|0,this.Bh=xn[2]|0,this.Bl=xn[3]|0,this.Ch=xn[4]|0,this.Cl=xn[5]|0,this.Dh=xn[6]|0,this.Dl=xn[7]|0,this.Eh=xn[8]|0,this.El=xn[9]|0,this.Fh=xn[10]|0,this.Fl=xn[11]|0,this.Gh=xn[12]|0,this.Gl=xn[13]|0,this.Hh=xn[14]|0,this.Hl=xn[15]|0}}const pC=ip(()=>new CN),xge=ip(()=>new hC),Cge=ip(()=>new SN),AN=pC;function EN(e,t){return AN(Es(e,{strict:!1})?il(e):e)}function NN(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),a=EN(t);return a.set([n],0),r==="bytes"?a:Vt(a)}function mC(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),a=[];for(const c of t)a.push(NN({commitment:c,to:r,version:n}));return a}const C5=6,gC=32,nv=4096,yC=gC*nv,k5=yC*C5-1-1*nv*C5,vC=1;class MN extends le{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class bC extends le{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class IN extends le{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class BN extends le{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${vC}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function TN(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?Pr(e.data):e.data,r=jt(n);if(!r)throw new bC;if(r>k5)throw new MN({maxSize:k5,size:r});const a=[];let c=!0,l=0;for(;c;){const u=Ey(new Uint8Array(yC));let d=0;for(;d<nv;){const p=n.slice(l,l+(gC-1));if(u.pushByte(0),u.pushBytes(p),p.length<31){u.pushByte(128),c=!1;break}d++,l+=31}a.push(u)}return t==="bytes"?a.map(u=>u.bytes):a.map(u=>Vt(u.bytes))}function wC(e){const{data:t,kzg:n,to:r}=e,a=e.blobs??TN({data:t,to:r}),c=e.commitments??ev({blobs:a,kzg:n,to:r}),l=e.proofs??tv({blobs:a,commitments:c,kzg:n,to:r}),u=[];for(let d=0;d<a.length;d++)u.push({blob:a[d],commitment:c[d],proof:l[d]});return u}function _C(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 R7({transaction:e})}function xC(e,{docsPath:t,...n}){const r=(()=>{const a=vp(e,n);return a instanceof Cd?e:a})();return new D7(r,{docsPath:t,...n})}async function Yu(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return Tr(t)}async function CC(e,t){var P,R,z,q,Q;const{account:n=e.account,accessList:r,authorizationList:a,chain:c=e.chain,blobVersionedHashes:l,blobs:u,data:d,gas:p,gasPrice:h,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:v,nonce:b,nonceManager:_,to:x,type:j,value:A,...k}=t,N=await(async()=>{if(!n||!_||typeof b<"u")return b;const O=mn(n),K=c?c.id:await Ue(e,Yu,"getChainId")({});return await _.consume({address:O.address,chainId:K,client:e})})();Pi(t);const E=(R=(P=c==null?void 0:c.formatters)==null?void 0:P.transactionRequest)==null?void 0:R.format,M=(E||dl)({...kd(k,{format:E}),account:n?mn(n):void 0,accessList:r,authorizationList:a,blobs:u,blobVersionedHashes:l,data:d,gas:p,gasPrice:h,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:v,nonce:N,to:x,type:j,value:A},"fillTransaction");try{const O=await e.request({method:"eth_fillTransaction",params:[M]}),$=(((q=(z=c==null?void 0:c.formatters)==null?void 0:z.transaction)==null?void 0:q.format)||Sd)(O.tx);delete $.blockHash,delete $.blockNumber,delete $.r,delete $.s,delete $.transactionIndex,delete $.v,delete $.yParity,$.data=$.input,$.gas&&($.gas=t.gas??$.gas),$.gasPrice&&($.gasPrice=t.gasPrice??$.gasPrice),$.maxFeePerBlobGas&&($.maxFeePerBlobGas=t.maxFeePerBlobGas??$.maxFeePerBlobGas),$.maxFeePerGas&&($.maxFeePerGas=t.maxFeePerGas??$.maxFeePerGas),$.maxPriorityFeePerGas&&($.maxPriorityFeePerGas=t.maxPriorityFeePerGas??$.maxPriorityFeePerGas),typeof $.nonce<"u"&&($.nonce=t.nonce??$.nonce);const L=await(async()=>{var te,W;if(typeof((te=c==null?void 0:c.fees)==null?void 0:te.baseFeeMultiplier)=="function"){const oe=await Ue(e,ts,"getBlock")({});return c.fees.baseFeeMultiplier({block:oe,client:e,request:t})}return((W=c==null?void 0:c.fees)==null?void 0:W.baseFeeMultiplier)??1.2})();if(L<1)throw new iC;const D=10**(((Q=L.toString().split(".")[1])==null?void 0:Q.length)??0),X=te=>te*BigInt(Math.ceil(L*D))/BigInt(D);return $.feePayerSignature||($.maxFeePerGas&&!t.maxFeePerGas&&($.maxFeePerGas=X($.maxFeePerGas)),$.gasPrice&&!t.gasPrice&&($.gasPrice=X($.gasPrice))),{raw:O.raw,transaction:{from:M.from,...$},...O.capabilities?{capabilities:O.capabilities}:{}}}catch(O){throw xC(O,{...t,chain:e.chain})}}const kC=["blobVersionedHashes","chainId","fees","gas","nonce","type"],j5=new Map,Gm=new gd(128);async function rv(e,t){var N,E,B;let n=t;n.account??(n.account=e.account),n.parameters??(n.parameters=kC);const{account:r,chain:a=e.chain,nonceManager:c,parameters:l}=n,u=(()=>{if(typeof(a==null?void 0:a.prepareTransactionRequest)=="function")return{fn:a.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(a==null?void 0:a.prepareTransactionRequest))return{fn:a.prepareTransactionRequest[0],runAt:a.prepareTransactionRequest[1].runAt}})();let d;async function p(){return d||(typeof n.chainId<"u"?n.chainId:a?a.id:(d=await Ue(e,Yu,"getChainId")({}),d))}const h=r&&mn(r);let m=n.nonce;if(l.includes("nonce")&&typeof m>"u"&&h&&c){const M=await p();m=await c.consume({address:h.address,chainId:M,client:e})}u!=null&&u.fn&&((N=u.runAt)!=null&&N.includes("beforeFillTransaction"))&&(n=await u.fn({...n,chain:a},{client:e,phase:"beforeFillTransaction"}),m??(m=n.nonce));const v=((l.includes("blobVersionedHashes")||l.includes("sidecars"))&&n.kzg&&n.blobs||Gm.get(e.uid)===!1||!["fees","gas"].some(P=>l.includes(P))?!1:!!(l.includes("chainId")&&typeof n.chainId!="number"||l.includes("nonce")&&typeof m!="number"||l.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||l.includes("gas")&&typeof n.gas!="bigint"))?await Ue(e,CC,"fillTransaction")({...n,nonce:m}).then(M=>{const{chainId:P,from:R,gas:z,gasPrice:q,nonce:Q,maxFeePerBlobGas:O,maxFeePerGas:K,maxPriorityFeePerGas:$,type:L,...se}=M.transaction;return Gm.set(e.uid,!0),{...n,...R?{from:R}:{},...L&&!n.type?{type:L}:{},...typeof P<"u"?{chainId:P}:{},...typeof z<"u"?{gas:z}:{},...typeof q<"u"?{gasPrice:q}:{},...typeof Q<"u"?{nonce:Q}:{},...typeof O<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerBlobGas:O}:{},...typeof K<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerGas:K}:{},...typeof $<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxPriorityFeePerGas:$}:{},..."nonceKey"in se&&typeof se.nonceKey<"u"?{nonceKey:se.nonceKey}:{},..."keyAuthorization"in se&&typeof se.keyAuthorization<"u"&&se.keyAuthorization!==null&&!("keyAuthorization"in n)?{keyAuthorization:se.keyAuthorization}:{},..."feePayerSignature"in se&&typeof se.feePayerSignature<"u"&&se.feePayerSignature!==null?{feePayerSignature:se.feePayerSignature}:{},..."feeToken"in se&&typeof se.feeToken<"u"&&se.feeToken!==null&&!("feeToken"in n)?{feeToken:se.feeToken}:{},...M.capabilities?{_capabilities:M.capabilities}:{}}}).catch(M=>{var q,Q;const P=M;if(P.name!=="TransactionExecutionError")return n;if((q=P.walk)==null?void 0:q.call(P,O=>O.name==="ExecutionRevertedError"))throw M;return((Q=P.walk)==null?void 0:Q.call(P,O=>{var $;const K=O;return K.name==="MethodNotFoundRpcError"||K.name==="MethodNotSupportedRpcError"||(($=K.message)==null?void 0:$.includes("eth_fillTransaction is not available"))}))&&Gm.set(e.uid,!1),n}):n;m??(m=v.nonce),n={...v,...h?{from:h==null?void 0:h.address}:{},...typeof m<"u"?{nonce:m}:{}};const{blobs:b,gas:_,kzg:x,type:j}=n;u!=null&&u.fn&&((E=u.runAt)!=null&&E.includes("beforeFillParameters"))&&(n=await u.fn({...n,chain:a},{client:e,phase:"beforeFillParameters"}));let A;async function k(){return A||(A=await Ue(e,ts,"getBlock")({blockTag:"latest"}),A)}if(l.includes("nonce")&&typeof m>"u"&&h&&!c&&(n.nonce=await Ue(e,uC,"getTransactionCount")({address:h.address,blockTag:"pending"})),(l.includes("blobVersionedHashes")||l.includes("sidecars"))&&b&&x){const M=ev({blobs:b,kzg:x});if(l.includes("blobVersionedHashes")){const P=mC({commitments:M,to:"hex"});n.blobVersionedHashes=P}if(l.includes("sidecars")){const P=tv({blobs:b,commitments:M,kzg:x}),R=wC({blobs:b,commitments:M,proofs:P,to:"hex"});n.sidecars=R}}if(l.includes("chainId")&&(n.chainId=await p()),(l.includes("fees")||l.includes("type"))&&typeof j>"u")try{n.type=_C(n)}catch{let M=j5.get(e.uid);if(typeof M>"u"){const P=await k();M=typeof(P==null?void 0:P.baseFeePerGas)=="bigint",j5.set(e.uid,M)}n.type=M?"eip1559":"legacy"}if(l.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const M=await k(),{maxFeePerGas:P,maxPriorityFeePerGas:R}=await jg(e,{block:M,chain:a,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<R)throw new hN({maxPriorityFeePerGas:R});n.maxPriorityFeePerGas=R,n.maxFeePerGas=P}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new Yy;if(typeof n.gasPrice>"u"){const M=await k(),{gasPrice:P}=await jg(e,{block:M,chain:a,request:n,type:"legacy"});n.gasPrice=P}}return l.includes("gas")&&typeof _>"u"&&(n.gas=await Ue(e,sv,"estimateGas")({...n,account:h,prepare:(h==null?void 0:h.type)==="local"?[]:["blobVersionedHashes"]})),u!=null&&u.fn&&((B=u.runAt)!=null&&B.includes("afterFillParameters"))&&(n=await u.fn({...n,chain:a},{client:e,phase:"afterFillParameters"})),Pi(n),delete n.parameters,n}async function sv(e,t){var l,u,d;const{account:n=e.account,prepare:r=!0}=t,a=n?mn(n):void 0,c=(()=>{if(Array.isArray(r))return r;if((a==null?void 0:a.type)!=="local")return["blobVersionedHashes"]})();try{const p=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await Qy({authorization:t.authorizationList[0]}).catch(()=>{throw new le("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:h,authorizationList:m,blobs:g,blobVersionedHashes:v,blockNumber:b,blockTag:_,data:x,gas:j,gasPrice:A,maxFeePerBlobGas:k,maxFeePerGas:N,maxPriorityFeePerGas:E,nonce:B,value:M,stateOverride:P,...R}=r?await rv(e,{...t,parameters:c,to:p}):t;if(j&&t.gas!==j)return j;const q=(typeof b=="bigint"?we(b):void 0)||_,Q=Gy(P);Pi(t);const O=(d=(u=(l=e.chain)==null?void 0:l.formatters)==null?void 0:u.transactionRequest)==null?void 0:d.format,$=(O||dl)({...kd(R,{format:O}),account:a,accessList:h,authorizationList:m,blobs:g,blobVersionedHashes:v,data:x,gasPrice:A,maxFeePerBlobGas:k,maxFeePerGas:N,maxPriorityFeePerGas:E,nonce:B,to:p,value:M},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:Q?[$,q??e.experimental_blockTag??"latest",Q]:q?[$,q]:[$]}))}catch(p){throw fN(p,{...t,account:a,chain:e.chain})}}async function PN(e,t){var p;const{abi:n,address:r,args:a,functionName:c,dataSuffix:l=typeof e.dataSuffix=="string"?e.dataSuffix:(p=e.dataSuffix)==null?void 0:p.value,...u}=t,d=At({abi:n,args:a,functionName:c});try{return await Ue(e,sv,"estimateGas")({data:`${d}${l?l.replace("0x",""):""}`,to:r,...u})}catch(h){const m=u.account?mn(u.account):void 0;throw Zc(h,{abi:n,address:r,args:a,docsPath:"/docs/contract/estimateContractGas",functionName:c,sender:m==null?void 0:m.address})}}async function jC(e,{address:t,blockHash:n,blockNumber:r,blockTag:a=e.experimental_blockTag??"latest",requireCanonical:c}){var d,p,h;const l=Ti({blockHash:n,blockNumber:r,blockTag:a,requireCanonical:c});if((d=e.batch)!=null&&d.multicall&&((h=(p=e.chain)==null?void 0:p.contracts)!=null&&h.multicall3)){const m=e.chain.contracts.multicall3.address,g=At({abi:Qc,functionName:"getEthBalance",args:[t]}),{data:v}=await Ue(e,fl,"call")({to:m,data:g,blockHash:n,blockNumber:r,blockTag:a,requireCanonical:c});return ko({abi:Qc,functionName:"getEthBalance",args:[t],data:v||"0x"})}const u=await e.request({method:"eth_getBalance",params:[t,l]});return BigInt(u)}async function RN(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}const LN=new Map,DN=new Map;function ON(e){const t=(a,c)=>({clear:()=>c.delete(a),get:()=>c.get(a),set:l=>c.set(a,l)}),n=t(e,LN),r=t(e,DN);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function FN(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=ON(t),a=r.response.get();if(a&&n>0&&Date.now()-a.created.getTime()<n)return a.data;let c=r.promise.get();c||(c=e(),r.promise.set(c));try{const l=await c;return r.response.set({created:new Date,data:l}),l}finally{r.promise.clear()}}const zN=e=>`blockNumber.${e}`;async function Ad(e,{cacheTime:t=e.cacheTime}={}){const n=await FN(()=>e.request({method:"eth_blockNumber"}),{cacheKey:zN(e.uid),cacheTime:t});return BigInt(n)}function Ns(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,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}:{}}}const $N={"0x0":"reverted","0x1":"success"};function _p(e,t){const n={...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(r=>Ns(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Tr(e.transactionIndex):null,status:e.status?$N[e.status]:null,type:e.type?cC[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const HN=Vy("transactionReceipt",_p);async function UN(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}={}){var u,d,p;const a=n!==void 0?we(n):void 0,c=await e.request({method:"eth_getBlockReceipts",params:[t||a||r]},{dedupe:!!(t||a)});if(!c)throw new Jy({blockHash:t,blockNumber:n});const l=((p=(d=(u=e.chain)==null?void 0:u.formatters)==null?void 0:d.transactionReceipt)==null?void 0:p.format)||_p;return c.map(h=>l(h,"getBlockReceipts"))}async function WN(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const a=n!==void 0?we(n):void 0;let c;return t?c=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):c=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[a||r]},{dedupe:!!a}),Tr(c)}async function Fh(e,{address:t,blockHash:n,blockNumber:r,blockTag:a="latest",requireCanonical:c}){const l=Ti({blockHash:n,blockNumber:r,blockTag:a,requireCanonical:c}),u=await e.request({method:"eth_getCode",params:[t,l]},{dedupe:typeof r=="bigint"||n!==void 0});if(u!=="0x")return u}const S5="/docs/contract/decodeEventLog";function zh(e){const{abi:t,data:n,strict:r,topics:a}=e,c=r??!0,[l,...u]=a;if(!l)throw new mA({docsPath:S5});const d=t.find(j=>j.type==="event"&&l===up(as(j)));if(!(d&&"name"in d)||d.type!=="event")throw new gA(l,{docsPath:S5});const{name:p,inputs:h}=d,m=h==null?void 0:h.some(j=>!("name"in j&&j.name)),g=m?[]:{},v=h.map((j,A)=>[j,A]).filter(([j])=>"indexed"in j&&j.indexed),b=[];for(let j=0;j<v.length;j++){const[A,k]=v[j],N=u[j];if(!N){if(c)throw new xy({abiItem:d,param:A});b.push([A,k]);continue}g[m?k:A.name||k]=VN({param:A,value:N})}const _=h.filter(j=>!("indexed"in j&&j.indexed)),x=c?_:[...b.map(([j])=>j),..._];if(x.length>0){if(n&&n!=="0x")try{const j=yd(x,n);if(j){let A=0;if(!c)for(const[k,N]of b)g[m?N:k.name||N]=j[A++];if(m)for(let k=0;k<h.length;k++)g[k]===void 0&&A<j.length&&(g[k]=j[A++]);else for(let k=0;k<_.length;k++)g[_[k].name]=j[A++]}}catch(j){if(c)throw j instanceof Ox||j instanceof t3?new Rh({abiItem:d,data:n,params:x,size:jt(n)}):j}else if(c)throw new Rh({abiItem:d,data:"0x",params:x,size:0})}return{eventName:p,args:Object.values(g).length>0?g:void 0}}function VN({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(yd([e],t)||[])[0]}function xp(e){const{abi:t,args:n,logs:r,strict:a=!0}=e,c=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),l=t.filter(u=>u.type==="event").map(u=>({abi:u,selector:up(u)}));return r.map(u=>{var g;const d=typeof u.blockNumber=="string"?Ns(u):u,p=l.filter(v=>d.topics[0]===v.selector);if(p.length===0)return null;let h,m;for(const v of p)try{h=zh({...d,abi:[v.abi],strict:!0}),m=v;break}catch{}if(!h&&!a){m=p[0];try{h=zh({data:d.data,topics:d.topics,abi:[m.abi],strict:!1})}catch{const v=(g=m.abi.inputs)==null?void 0:g.some(b=>!("name"in b&&b.name));return{...d,args:v?[]:{},eventName:m.abi.name}}}return!h||!m||c&&!c.includes(h.eventName)||!GN({args:h.args,inputs:m.abi.inputs,matchArgs:n})?null:{...h,...d}}).filter(Boolean)}function GN(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function a(c,l,u){try{return c.type==="address"?el(l,u):c.type==="string"||c.type==="bytes"?cn(il(l))===u:l===u}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((c,l)=>{if(c==null)return!0;const u=n[l];return u?(Array.isArray(c)?c:[c]).some(p=>a(u,p,t[l])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([c,l])=>{if(l==null)return!0;const u=n.find(p=>p.name===c);return u?(Array.isArray(l)?l:[l]).some(p=>a(u,p,t[c])):!1}):!1}async function av(e,{address:t,blockHash:n,fromBlock:r,toBlock:a,event:c,events:l,args:u,strict:d}={}){const p=d??!1,h=l??(c?[c]:void 0);let m=[];h&&(m=[h.flatMap(_=>jd({abi:[_],eventName:_.name,args:l?void 0:u}))],c&&(m=m[0]));let g;n?g=await e.request({method:"eth_getLogs",params:[{address:t,topics:m,blockHash:n}]}):g=await e.request({method:"eth_getLogs",params:[{address:t,topics:m,fromBlock:typeof r=="bigint"?we(r):r,toBlock:typeof a=="bigint"?we(a):a}]});const v=g.map(b=>Ns(b));return h?xp({abi:h,args:u,logs:v,strict:p}):v}async function SC(e,t){const{abi:n,address:r,args:a,blockHash:c,eventName:l,fromBlock:u,toBlock:d,strict:p}=t,h=l?Bi({abi:n,name:l}):void 0,m=h?void 0:n.filter(g=>g.type==="event");return Ue(e,av,"getLogs")({address:r,args:a,blockHash:c,event:h,events:m,fromBlock:u,toBlock:d,strict:p})}async function qN(e,{address:t,blockNumber:n,blockTag:r="latest"}){const a=await Fh(e,{address:t,...n!==void 0?{blockNumber:n}:{blockTag:r}});if(a&&jt(a)===23&&a.startsWith("0xef0100"))return xt(yo(a,3,23))}class KN extends le{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function QN(e,t){const{address:n,factory:r,factoryData:a}=t;try{const[c,l,u,d,p,h,m]=await Ue(e,Lr,"readContract")({abi:YN,address:n,functionName:"eip712Domain",factory:r,factoryData:a});return{domain:{name:l,version:u,chainId:Number(d),verifyingContract:p,salt:h},extensions:m,fields:c}}catch(c){const l=c;throw l.name==="ContractFunctionExecutionError"&&l.cause.name==="ContractFunctionZeroDataError"?new KN({address:n}):l}}const YN=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function JN(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function XN(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:a}){const c=typeof n=="bigint"?we(n):void 0,l=await e.request({method:"eth_feeHistory",params:[we(t),c||r,a]},{dedupe:!!c});return JN(l)}async function Cp(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const a=r.map(c=>Ns(c));return!("abi"in t)||!t.abi?a:xp({abi:t.abi,logs:a,strict:n})}async function ZN(e,{filter:t}){const n=t.strict??!1,a=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(c=>Ns(c));return t.abi?xp({abi:t.abi,logs:a,strict:n}):a}function AC(e,t){if(e.length!==t.length)throw new Fx({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const a=e[r],c=t[r];n.push(EC(a,c))}return _r(n)}function EC(e,t,n=!1){if(e==="address"){const l=t;if(!Ft(l))throw new An({address:l});return br(l.toLowerCase(),{size:n?32:null})}if(e==="string")return wi(t);if(e==="bytes")return t;if(e==="bool")return br(jy(t),{size:n?32:1});const r=e.match(Ny);if(r){const[l,u,d="256"]=r,p=Number.parseInt(d,10)/8;return we(t,{size:n?32:p,signed:u==="int"})}const a=e.match(a3);if(a){const[l,u]=a;if(Number.parseInt(u,10)!==(t.length-2)/2)throw new Hx({expectedSize:Number.parseInt(u,10),givenSize:(t.length-2)/2});return br(t,{dir:"right",size:n?32:null})}const c=e.match(g9);if(c&&Array.isArray(t)){const[l,u]=c,d=[];for(let p=0;p<t.length;p++)d.push(EC(u,t[p],!0));return d.length===0?"0x":_r(d)}throw new xA(e)}function eM(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:r}=n,a=n.address;if(!Ft(a))throw new An({address:a});if(r<0)throw new dp({chainId:r})}ov(e)}function tM(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new bC;for(const n of t){const r=jt(n),a=Tr(yo(n,0,1));if(r!==32)throw new IN({hash:n,size:r});if(a!==vC)throw new BN({hash:n,version:a})}}ov(e)}function ov(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:a}=e;if(t<=0)throw new dp({chainId:t});if(a&&!Ft(a))throw new An({address:a});if(r&&r>bp)throw new ki({maxFeePerGas:r});if(n&&r&&n>r)throw new Qu({maxFeePerGas:r,maxPriorityFeePerGas:n})}function nM(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:c}=e;if(t<=0)throw new dp({chainId:t});if(c&&!Ft(c))throw new An({address:c});if(n||a)throw new le("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>bp)throw new ki({maxFeePerGas:r})}function rM(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:c}=e;if(c&&!Ft(c))throw new An({address:c});if(typeof t<"u"&&t<=0)throw new dp({chainId:t});if(n||a)throw new le("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>bp)throw new ki({maxFeePerGas:r})}function kp(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:a}=e[n];for(let c=0;c<a.length;c++)if(a[c].length-2!==64)throw new L7({storageKey:a[c]});if(!Ft(r,{strict:!1}))throw new An({address:r});t.push([r,a])}return t}function sM(e,t){const n=_C(e);return n==="eip1559"?iM(e,t):n==="eip2930"?cM(e,t):n==="eip4844"?oM(e,t):n==="eip7702"?aM(e,t):lM(e,t)}function aM(e,t){const{authorizationList:n,chainId:r,gas:a,nonce:c,to:l,value:u,maxFeePerGas:d,maxPriorityFeePerGas:p,accessList:h,data:m}=e;eM(e);const g=kp(h),v=uM(n);return _r(["0x04",wo([we(r),c?we(c):"0x",p?we(p):"0x",d?we(d):"0x",a?we(a):"0x",l??"0x",u?we(u):"0x",m??"0x",g,v,...Ed(e,t)])])}function oM(e,t){const{chainId:n,gas:r,nonce:a,to:c,value:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,accessList:h,data:m}=e;tM(e);let g=e.blobVersionedHashes,v=e.sidecars;if(e.blobs&&(typeof g>"u"||typeof v>"u")){const k=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(B=>Vt(B)),N=e.kzg,E=ev({blobs:k,kzg:N});if(typeof g>"u"&&(g=mC({commitments:E})),typeof v>"u"){const B=tv({blobs:k,commitments:E,kzg:N});v=wC({blobs:k,commitments:E,proofs:B})}}const b=kp(h),_=[we(n),a?we(a):"0x",p?we(p):"0x",d?we(d):"0x",r?we(r):"0x",c??"0x",l?we(l):"0x",m??"0x",b,u?we(u):"0x",g??[],...Ed(e,t)],x=[],j=[],A=[];if(v)for(let k=0;k<v.length;k++){const{blob:N,commitment:E,proof:B}=v[k];x.push(N),j.push(E),A.push(B)}return _r(["0x03",wo(v?[_,x,j,A]:_)])}function iM(e,t){const{chainId:n,gas:r,nonce:a,to:c,value:l,maxFeePerGas:u,maxPriorityFeePerGas:d,accessList:p,data:h}=e;ov(e);const m=kp(p),g=[we(n),a?we(a):"0x",d?we(d):"0x",u?we(u):"0x",r?we(r):"0x",c??"0x",l?we(l):"0x",h??"0x",m,...Ed(e,t)];return _r(["0x02",wo(g)])}function cM(e,t){const{chainId:n,gas:r,data:a,nonce:c,to:l,value:u,accessList:d,gasPrice:p}=e;nM(e);const h=kp(d),m=[we(n),c?we(c):"0x",p?we(p):"0x",r?we(r):"0x",l??"0x",u?we(u):"0x",a??"0x",h,...Ed(e,t)];return _r(["0x01",wo(m)])}function lM(e,t){const{chainId:n=0,gas:r,data:a,nonce:c,to:l,value:u,gasPrice:d}=e;rM(e);let p=[c?we(c):"0x",d?we(d):"0x",r?we(r):"0x",l??"0x",u?we(u):"0x",a??"0x"];if(t){const h=(()=>{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 v=27n+(t.v===27n?0n:1n);if(t.v!==v)throw new P7({v:t.v});return v})(),m=tr(t.r),g=tr(t.s);p=[...p,we(h),m==="0x00"?"0x":m,g==="0x00"?"0x":g]}else n>0&&(p=[...p,we(n),"0x","0x"]);return wo(p)}function Ed(e,t){const n=t??e,{v:r,yParity:a}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof a>"u")return[];const c=tr(n.r),l=tr(n.s);return[typeof a=="number"?a?we(1):"0x":r===0n?"0x":r===1n?we(1):r===27n?"0x":we(1),c==="0x00"?"0x":c,l==="0x00"?"0x":l]}function uM(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:r,nonce:a,...c}=n,l=n.address;t.push([r?nr(r):"0x",l,a?nr(a):"0x",...Ed({},c)])}return t}async function dM({address:e,authorization:t,signature:n}){return el(xt(e),await Qy({authorization:t,signature:n}))}const Zf=new gd(8192);function fM(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Zf.get(n))return Zf.get(n);const r=e().finally(()=>Zf.delete(n));return Zf.set(n,r),r}async function Sg(e,{signal:t}={}){return new Promise((n,r)=>{if(t!=null&&t.aborted){r(vo(t));return}const a=()=>t==null?void 0:t.removeEventListener("abort",l),c=setTimeout(()=>{a(),n()},e),l=()=>{clearTimeout(c),a(),r(vo(t))};t==null||t.addEventListener("abort",l,{once:!0})})}function tl(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0,signal:a}={}){return new Promise((c,l)=>{const u=async({count:d=0}={})=>{if(a!=null&&a.aborted){l(vo(a));return}const p=async({error:h})=>{const m=typeof t=="function"?t({count:d,error:h}):t;if(m)try{await Sg(m,{signal:a})}catch(g){l(g);return}u({count:d+1})};try{const h=await e();c(h)}catch(h){if(a!=null&&a.aborted){l(vo(a));return}if(ul(h)){l(h);return}if(d<n&&await r({count:d,error:h}))return p({error:h});l(h)}};u()})}function hM(e,t={}){return async(n,r={})=>{var g;const{dedupe:a=!1,methods:c,retryDelay:l=150,retryCount:u=3,signal:d,uid:p}={...t,...r},{method:h}=n;if((g=c==null?void 0:c.exclude)!=null&&g.includes(h))throw new si(new Error("method not supported"),{method:h});if(c!=null&&c.include&&!c.include.includes(h))throw new si(new Error("method not supported"),{method:h});if(d!=null&&d.aborted)throw vo(d);const m=a?mM(`${p}.${ln(n)}`):void 0;return fM(()=>tl(async()=>{try{return await e(n,d?{signal:d}:void 0)}catch(v){if(d!=null&&d.aborted)throw vo(d);if(ul(v))throw v;const b=v;switch(b.code){case Eu.code:throw new Eu(b);case Nu.code:throw new Nu(b);case Mu.code:throw new Mu(b,{method:n.method});case Iu.code:throw new Iu(b);case _i.code:throw new _i(b);case bo.code:throw new bo(b);case Bu.code:throw new Bu(b);case js.code:throw new js(b);case Tu.code:throw new Tu(b);case si.code:throw new si(b,{method:n.method});case Xc.code:throw new Xc(b);case Pu.code:throw new Pu(b);case ct.code:throw new ct(b);case Ru.code:throw new Ru(b);case Lu.code:throw new Lu(b);case Du.code:throw new Du(b);case Ou.code:throw new Ou(b);case sr.code:throw new sr(b);case Fu.code:throw new Fu(b);case zu.code:throw new zu(b);case $u.code:throw new $u(b);case Hu.code:throw new Hu(b);case Uu.code:throw new Uu(b);case Wu.code:throw new Wu(b);case Vu.code:throw new Vu(b);case 5e3:throw new ct(b);case Gu.code:throw new Gu(b);default:throw v instanceof le?v:new Y7(b)}}},{delay:({count:v,error:b})=>{var _;if(b&&b instanceof Cu){const x=(_=b==null?void 0:b.headers)==null?void 0:_.get("Retry-After");if(x!=null&&x.match(/\d/))return Number.parseInt(x,10)*1e3}return~~(1<<v)*l},retryCount:u,signal:d,shouldRetry:({error:v})=>pM(v)}),{enabled:a,id:m})}}function pM(e){return ul(e)?!1:"code"in e&&typeof e.code=="number"?e.code===-1||e.code===Xc.code||e.code===_i.code||e.code===429:e instanceof Cu&&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 mM(e,t=0){let n=3735928559^t,r=1103547991^t;for(let a=0;a<e.length;a++){const c=e.charCodeAt(a);n=Math.imul(n^c,2654435761),r=Math.imul(r^c,1597334677)}return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>16,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>16,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36)}function gM({chain:e,currentChainId:t}){if(!e)throw new j7;if(t!==e.id)throw new k7({chain:e,currentChainId:t})}function Is(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return a=>{const c=typeof a=="function"?a(r):a,l={...r,...c};return Object.assign(l,{extend:n(l)})}}return Object.assign(t,{extend:n(t)})}function jp(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((a,c)=>{(async()=>{let l;const u=new AbortController;try{n>0&&(l=setTimeout(()=>{r?u.abort():c(t)},n)),a(await e({signal:(u==null?void 0:u.signal)||null}))}catch(d){if(u!=null&&u.signal.aborted&&ul(d)){c(t);return}c(d)}finally{clearTimeout(l)}})()})}function yM(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const A5=yM();function NC(e,t={}){const{url:n,headers:r}=vM(e);return{async request(a){var b,_,x;const{body:c,fetchFn:l=t.fetchFn??fetch,onRequest:u=t.onRequest,onResponse:d=t.onResponse,timeout:p=t.timeout??1e4}=a,h={...t.fetchOptions??{},...a.fetchOptions??{}},{headers:m,method:g,signal:v}=h;try{const j=await jp(async({signal:k})=>{const N={...h,body:Array.isArray(c)?ln(c.map(P=>({jsonrpc:"2.0",id:P.id??A5.take(),...P}))):ln({jsonrpc:"2.0",id:c.id??A5.take(),...c}),headers:{...r,"Content-Type":"application/json",...m},method:g||"POST",signal:v||(p>0?k:null)},E=new Request(n,N),B=await(u==null?void 0:u(E,N))??{...N,url:n};return await l(B.url??n,B)},{errorInstance:new u5({body:c,url:n}),timeout:p,signal:!0});d&&await d(j);let A;if((b=j.headers.get("Content-Type"))!=null&&b.startsWith("application/json"))A=await j.json();else{A=await j.text();try{A=JSON.parse(A||"{}")}catch(k){if(j.ok)throw k;A={error:A}}}if(!j.ok){if(typeof((_=A.error)==null?void 0:_.code)=="number"&&typeof((x=A.error)==null?void 0:x.message)=="string")return A;throw new Cu({body:c,details:ln(A.error)||j.statusText,headers:j.headers,status:j.status,url:n})}return A}catch(j){throw v!=null&&v.aborted?vo(v):ul(j)||j instanceof Cu||j instanceof u5?j:new Cu({body:c,cause:j,url:n})}}}}function vM(e){try{const t=new URL(e),n=(()=>{if(t.username){const r=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(r)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}function bM(e,{body:t,onError:n,onResponse:r}){return e.request({body:t,onError:n,onResponse:r}),e}async function wM(e,{body:t,timeout:n=1e4}){return e.requestAsync({body:t,timeout:n})}const qm={http(e,t){return NC(e).request(t)},webSocket:bM,webSocketAsync:wM},_M=`Ethereum Signed Message:
1683
+ `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(Qu,"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 Cd extends le{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function vp(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof le?e.walk(a=>(a==null?void 0:a.code)===Ac.code):e;return r instanceof le?new Ac({cause:e,message:r.details}):Ac.nodeMessage.test(n)?new Ac({cause:e,message:e.details}):ki.nodeMessage.test(n)?new ki({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):gg.nodeMessage.test(n)?new gg({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):yg.nodeMessage.test(n)?new yg({cause:e,nonce:t==null?void 0:t.nonce}):vg.nodeMessage.test(n)?new vg({cause:e,nonce:t==null?void 0:t.nonce}):bg.nodeMessage.test(n)?new bg({cause:e,nonce:t==null?void 0:t.nonce}):wg.nodeMessage.test(n)?new wg({cause:e}):_g.nodeMessage.test(n)?new _g({cause:e,gas:t==null?void 0:t.gas}):xg.nodeMessage.test(n)?new xg({cause:e,gas:t==null?void 0:t.gas}):Cg.nodeMessage.test(n)?new Cg({cause:e}):Qu.nodeMessage.test(n)?new Qu({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new Cd({cause:e})}function V3(e,{docsPath:t,...n}){const r=(()=>{const a=vp(e,n);return a instanceof Cd?e:a})();return new S3(r,{docsPath:t,...n})}function kd(e,{format:t}){if(!t)return{};const n={};function r(c){const l=Object.keys(c);for(const u of l)u in e&&(n[u]=e[u]),c[u]&&typeof c[u]=="object"&&!Array.isArray(c[u])&&r(c[u])}const a=t(e||{});return r(a),n}function Vy(e,t){return({exclude:n,format:r})=>({exclude:n,format:(a,c)=>{const l=t(a,c);if(n)for(const u of n)delete l[u];return{...l,...r(a,c)}},type:e})}const TE={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function dl(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=PE(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>Vt(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=we(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=we(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=we(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=we(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=we(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=we(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=TE[e.type]),typeof e.value<"u"&&(n.value=we(e.value)),n}function PE(e){return e.map(t=>({address:t.address,r:t.r?we(BigInt(t.r)):t.r,s:t.s?we(BigInt(t.s)):t.s,chainId:we(t.chainId),nonce:we(t.nonce),...typeof t.yParity<"u"?{yParity:we(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:we(t.v)}:{}}))}function G3(){let e=()=>{},t=()=>{};return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}const Vm=new Map;function q3({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:a}){const c=async()=>{const h=d();l();const m=h.map(({args:g})=>g);m.length!==0&&e(m).then(g=>{a&&Array.isArray(g)&&g.sort(a);for(let v=0;v<h.length;v++){const{resolve:b}=h[v];b==null||b([g[v],g])}}).catch(g=>{for(let v=0;v<h.length;v++){const{reject:b}=h[v];b==null||b(g)}})},l=()=>Vm.delete(t),u=()=>d().map(({args:h})=>h),d=()=>Vm.get(t)||[],p=h=>Vm.set(t,[...d(),h]);return{flush:l,async schedule(h){const{promise:m,resolve:g,reject:v}=G3();return(n==null?void 0:n([...u(),h]))&&c(),d().length>0?(p({args:h,resolve:g,reject:v}),m):(p({args:h,resolve:g,reject:v}),setTimeout(c,r),m)}}}function y5(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Vw({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Vw({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function RE(e){const{balance:t,nonce:n,state:r,stateDiff:a,code:c}=e,l={};if(c!==void 0&&(l.code=c),t!==void 0&&(l.balance=we(t)),n!==void 0&&(l.nonce=we(n)),r!==void 0&&(l.state=y5(r)),a!==void 0){if(l.state)throw new B7;l.stateDiff=y5(a)}return l}function Gy(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!Ft(n,{strict:!1}))throw new An({address:n});if(t[n])throw new I7({address:n});t[n]=RE(r)}return t}const bp=2n**256n-1n;function Pi(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:a}=e,c=t?mn(t):void 0;if(c&&!Ft(c.address))throw new An({address:c.address});if(a&&!Ft(a))throw new An({address:a});if(n&&n>bp)throw new ki({maxFeePerGas:n});if(r&&n&&r>n)throw new Qu({maxFeePerGas:n,maxPriorityFeePerGas:r})}async function fl(e,t){var L,se,D,X,te,W;const{account:n=e.account,authorizationList:r,batch:a=!!((L=e.batch)!=null&&L.multicall),blockHash:c,blockNumber:l,blockTag:u=e.experimental_blockTag??"latest",requireCanonical:d,accessList:p,blobs:h,blockOverrides:m,code:g,data:v,factory:b,factoryData:_,gas:x,gasPrice:j,maxFeePerBlobGas:A,maxFeePerGas:k,maxPriorityFeePerGas:N,nonce:E,requestOptions:B,to:M,value:P,stateOverride:R,...z}=t,q=n?mn(n):void 0;if(g&&(b||_))throw new le("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(g&&M)throw new le("Cannot provide both `code` & `to` as parameters.");const Q=g&&v,O=b&&_&&M&&v,K=Q||O,$=Q?Q3({code:g,data:v}):O?$E({data:v,factory:b,factoryData:_,to:M}):v;try{Pi(t);const oe=Ti({blockHash:c,blockNumber:l,blockTag:u,requireCanonical:d}),be=m?U3(m):void 0,Y=Gy(R),ue=(X=(D=(se=e.chain)==null?void 0:se.formatters)==null?void 0:D.transactionRequest)==null?void 0:X.format,Re=(ue||dl)({...kd(z,{format:ue}),accessList:p,account:q,authorizationList:r,blobs:h,data:$,gas:x,gasPrice:j,maxFeePerBlobGas:A,maxFeePerGas:k,maxPriorityFeePerGas:N,nonce:E,to:K?void 0:M,value:P},"call");if(a&&LE({request:Re})&&!be&&c===void 0)try{const{deployless:Xe=!1}=typeof((te=e.batch)==null?void 0:te.multicall)=="object"?e.batch.multicall:{},Tt=K3(e,{blockNumber:l,deployless:Xe});if(!Tt||!zE(Y,Tt))return await FE(e,{...Re,blockHash:c,blockNumber:l,blockTag:u,multicallAddress:Tt,requestOptions:B,requireCanonical:d,rpcStateOverride:Y})}catch(Xe){if(!(Xe instanceof w3)&&!(Xe instanceof fg))throw Xe}const Ae=(()=>{const Xe=[Re,oe];return Y&&be?[...Xe,Y,be]:Y?[...Xe,Y]:be?[...Xe,{},be]:Xe})(),qe=await e.request({method:"eth_call",params:Ae},B);return qe==="0x"?{data:void 0}:{data:qe}}catch(oe){if((W=B==null?void 0:B.signal)!=null&&W.aborted)throw vo(B.signal);if(ul(oe))throw oe;const be=HE(oe),{offchainLookup:Y,offchainLookupSignature:ue}=await je(async()=>{const{offchainLookup:xe,offchainLookupSignature:Re}=await import("./ccip-CtJUKWRd.js");return{offchainLookup:xe,offchainLookupSignature:Re}},[]);if(e.ccipRead!==!1&&(be==null?void 0:be.slice(0,10))===ue&&M)return{data:await Y(e,{data:be,requestOptions:B,to:M})};throw K&&(be==null?void 0:be.slice(0,10))==="0x101bb98d"?new H7({factory:b}):V3(oe,{...t,account:q,chain:e.chain})}}function LE({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(ME)||!n||Object.values(r).filter(a=>typeof a<"u").length>0)}let DE=0;const v5=new WeakMap;function OE(e){if(!e)return"default";const t=v5.get(e);if(t!==void 0)return t;const n=DE++;return v5.set(e,n),n}async function FE(e,t){var E;const{batchSize:n=1024,deployless:r=!1,wait:a=0}=typeof((E=e.batch)==null?void 0:E.multicall)=="object"?e.batch.multicall:{},{blockHash:c,blockNumber:l,blockTag:u=e.experimental_blockTag??"latest",requireCanonical:d,data:p,multicallAddress:h,requestOptions:m,rpcStateOverride:g,to:v}=t,b=h!==void 0?h:K3(e,{blockNumber:l,deployless:r}),_=Ti({blockHash:c,blockNumber:l,blockTag:u,requireCanonical:d}),x=typeof _=="string"?_:JSON.stringify(_),j=g?`.${JSON.stringify(g)}`:"",{schedule:A}=q3({id:`${e.uid}.${x}.${OE(m)}${j}`,wait:a,shouldSplitBatch(B){return B.reduce((P,{data:R})=>P+(R.length-2),0)>n*2},fn:async B=>{const M=B.map(q=>({allowFailure:!0,callData:q.data,target:q.to})),P=At({abi:Qc,args:[M],functionName:"aggregate3"}),R={...b===null?{data:Q3({code:Uy,data:P})}:{to:b,data:P}},z=await e.request({method:"eth_call",params:g?[R,_,g]:[R,_]},m);return ko({abi:Qc,args:[M],functionName:"aggregate3",data:z||"0x"})}}),[{returnData:k,success:N}]=await A({data:p,to:v});if(!N)throw new hp({data:k});return k==="0x"?{data:void 0}:{data:k}}function K3(e,t){const{blockNumber:n,deployless:r}=t;if(r)return null;if(e.chain)return ll({blockNumber:n,chain:e.chain,contract:"multicall3"});throw new w3}function zE(e,t){return e?Object.keys(e).some(n=>el(n,t)):!1}function Q3(e){const{code:t,data:n}=e;return Wy({abi:y3(["constructor(bytes, bytes)"]),bytecode:W3,args:[t,n]})}function $E(e){const{data:t,factory:n,factoryData:r,to:a}=e;return Wy({abi:y3(["constructor(address, bytes, address, bytes)"]),bytecode:IE,args:[a,t,n,r]})}function HE(e){var n;if(!(e instanceof le))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function Lr(e,t){const{abi:n,address:r,args:a,functionName:c,...l}=t,u=At({abi:n,args:a,functionName:c});try{const{data:d}=await Ue(e,fl,"call")({...l,data:u,to:r});return ko({abi:n,args:a,functionName:c,data:d||"0x"})}catch(d){throw Zc(d,{abi:n,address:r,args:a,docsPath:"/docs/contract/readContract",functionName:c})}}async function UE(e,t){const{blockNumber:n,blockTag:r,coinType:a,name:c,gatewayUrls:l,strict:u}=t,{chain:d}=e,p=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!d)throw new Error("client chain not configured. universalResolverAddress is required.");return ll({blockNumber:n,chain:d,contract:"ensUniversalResolver"})})(),h=d==null?void 0:d.ensTlds;if(h&&!h.some(g=>c.endsWith(g)))return null;const m=a!=null?[pg(c),BigInt(a)]:[pg(c)];try{const g=At({abi:Px,functionName:"addr",args:m}),v={address:p,abi:Tx,functionName:"resolveWithGateways",args:[nr(Oy(c)),g,l??[pp]],blockNumber:n,blockTag:r},_=await Ue(e,Lr,"readContract")(v);if(_[0]==="0x")return null;const x=WE({coinType:a,data:_[0],args:m});return x==="0x"||tr(x)==="0x00"?null:x}catch(g){if(u)throw g;if(Dy(g))return null;throw g}}function WE({coinType:e,data:t,args:n}){try{return ko({abi:Px,args:n,functionName:"addr",data:t})}catch(r){if(e==null)throw r;const a=tr(t);if(jt(a)===20)return xt(a);throw r}}class VE extends le{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class ou extends le{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class qy extends le{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class GE extends le{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const qE=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,KE=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,QE=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,YE=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function JE(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function b5(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Y3({uri:e,gatewayUrls:t}){const n=QE.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=b5(t==null?void 0:t.ipfs,"https://ipfs.io"),a=b5(t==null?void 0:t.arweave,"https://arweave.net"),c=e.match(qE),{protocol:l,subpath:u,target:d,subtarget:p=""}=(c==null?void 0:c.groups)||{},h=l==="ipns:/"||u==="ipns/",m=l==="ipfs:/"||u==="ipfs/"||KE.test(e);if(e.startsWith("http")&&!h&&!m){let v=e;return t!=null&&t.arweave&&(v=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:v,isOnChain:!1,isEncoded:!1}}if((h||m)&&d)return{uri:`${r}/${h?"ipns":"ipfs"}/${d}${p}`,isOnChain:!1,isEncoded:!1};if(l==="ar:/"&&d)return{uri:`${a}/${d}${p||""}`,isOnChain:!1,isEncoded:!1};let g=e.replace(YE,"");if(g.startsWith("<svg")&&(g=`data:image/svg+xml;base64,${btoa(g)}`),g.startsWith("data:")||g.startsWith("{"))return{uri:g,isOnChain:!0,isEncoded:!1};throw new qy({uri:e})}function J3(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new VE({data:e});return e.image||e.image_url||e.image_data}async function XE({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(a=>a.json());return await Ky({gatewayUrls:e,uri:J3(n)})}catch{throw new qy({uri:t})}}async function Ky({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=Y3({uri:t,gatewayUrls:e});if(r||await JE(n))return n;throw new qy({uri:t})}function ZE(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,a]=t.split("/"),[c,l]=n.split(":"),[u,d]=r.split(":");if(!c||c.toLowerCase()!=="eip155")throw new ou({reason:"Only EIP-155 supported"});if(!l)throw new ou({reason:"Chain ID not found"});if(!d)throw new ou({reason:"Contract address not found"});if(!a)throw new ou({reason:"Token ID not found"});if(!u)throw new ou({reason:"ERC namespace not found"});return{chainID:Number.parseInt(l,10),namespace:u.toLowerCase(),contractAddress:d,tokenID:a}}async function eN(e,{nft:t}){if(t.namespace==="erc721")return Lr(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return Lr(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new GE({namespace:t.namespace})}async function tN(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?nN(e,{gatewayUrls:t,record:n}):Ky({uri:n,gatewayUrls:t})}async function nN(e,{gatewayUrls:t,record:n}){const r=ZE(n),a=await eN(e,{nft:r}),{uri:c,isOnChain:l,isEncoded:u}=Y3({uri:a,gatewayUrls:t});if(l&&(c.includes("data:application/json;base64,")||c.startsWith("{"))){const p=u?atob(c.replace("data:application/json;base64,","")):c,h=JSON.parse(p);return Ky({uri:J3(h),gatewayUrls:t})}let d=r.tokenID;return r.namespace==="erc1155"&&(d=d.replace("0x","").padStart(64,"0")),XE({gatewayUrls:t,uri:c.replace(/(?:0x)?{id}/,d)})}async function X3(e,t){const{blockNumber:n,blockTag:r,key:a,name:c,gatewayUrls:l,strict:u}=t,{chain:d}=e,p=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!d)throw new Error("client chain not configured. universalResolverAddress is required.");return ll({blockNumber:n,chain:d,contract:"ensUniversalResolver"})})(),h=d==null?void 0:d.ensTlds;if(h&&!h.some(m=>c.endsWith(m)))return null;try{const m={address:p,abi:Tx,args:[nr(Oy(c)),At({abi:zw,functionName:"text",args:[pg(c),a]}),l??[pp]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},v=await Ue(e,Lr,"readContract")(m);if(v[0]==="0x")return null;const b=ko({abi:zw,functionName:"text",data:v[0]});return b===""?null:b}catch(m){if(u)throw m;if(Dy(m))return null;throw m}}async function Z3(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:a,gatewayUrls:c,strict:l,universalResolverAddress:u}){const d=await Ue(e,X3,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:a,universalResolverAddress:u,gatewayUrls:c,strict:l});if(!d)return null;try{return await tN(e,{record:d,gatewayUrls:r})}catch{return null}}async function eC(e,t){const{address:n,blockNumber:r,blockTag:a,coinType:c=60n,gatewayUrls:l,strict:u}=t,{chain:d}=e,p=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!d)throw new Error("client chain not configured. universalResolverAddress is required.");return ll({blockNumber:r,chain:d,contract:"ensUniversalResolver"})})();try{const h={address:p,abi:lA,args:[n,c,l??[pp]],functionName:"reverseWithGateways",blockNumber:r,blockTag:a},m=Ue(e,Lr,"readContract"),[g]=await m(h);return g||null}catch(h){if(u)throw h;if(Dy(h))return null;throw h}}async function rN(e,t){const{blockNumber:n,blockTag:r,name:a}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return ll({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(p=>a.endsWith(p)))throw new Error(`${a} is not a valid ENS TLD (${u==null?void 0:u.join(", ")}) for chain "${c.name}" (id: ${c.id}).`);const[d]=await Ue(e,Lr,"readContract")({address:l,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[nr(Oy(a))],blockNumber:n,blockTag:r});return d}async function tC(e,t){var x,j,A;const{account:n=e.account,blockNumber:r,blockTag:a="latest",blobs:c,data:l,gas:u,gasPrice:d,maxFeePerBlobGas:p,maxFeePerGas:h,maxPriorityFeePerGas:m,to:g,value:v,...b}=t,_=n?mn(n):void 0;try{Pi(t);const N=(typeof r=="bigint"?we(r):void 0)||a,E=(A=(j=(x=e.chain)==null?void 0:x.formatters)==null?void 0:j.transactionRequest)==null?void 0:A.format,M=(E||dl)({...kd(b,{format:E}),account:_,blobs:c,data:l,gas:u,gasPrice:d,maxFeePerBlobGas:p,maxFeePerGas:h,maxPriorityFeePerGas:m,to:g,value:v},"createAccessList"),P=await e.request({method:"eth_createAccessList",params:[M,N]});if(P.error)throw new le(P.error,{details:P.error});return{accessList:P.accessList,gasUsed:BigInt(P.gasUsed)}}catch(k){throw V3(k,{...t,account:_,chain:e.chain})}}function wp(e,{method:t}){var r,a;const n={};return e.transport.type==="fallback"&&((a=(r=e.transport).onResponse)==null||a.call(r,({method:c,response:l,status:u,transport:d})=>{u==="success"&&t===c&&(n[l]=d.request)})),(c=>n[c]||e.request)}async function sN(e){const t=wp(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}class aN extends le{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const w5="/docs/contract/encodeEventTopics";function jd(e){var d;const{abi:t,eventName:n,args:r}=e;let a=t[0];if(n){const p=Bi({abi:t,name:n});if(!p)throw new Ww(n,{docsPath:w5});a=p}if(a.type!=="event")throw new Ww(void 0,{docsPath:w5});let c=[];if(r&&"inputs"in a){const p=(d=a.inputs)==null?void 0:d.filter(m=>"indexed"in m&&m.indexed),h=Array.isArray(r)?r:Object.values(r).length>0?(p==null?void 0:p.map(m=>r[m.name]))??[]:[];h.length>0&&(c=(p==null?void 0:p.map((m,g)=>Array.isArray(h[g])?h[g].map((v,b)=>_5({param:m,value:h[g][b]})):typeof h[g]<"u"&&h[g]!==null?_5({param:m,value:h[g]}):null))??[])}if(a.anonymous)return c;const l=as(a);return[up(l),...c]}function _5({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return cn(il(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new aN(e.type);return Ii([e],[t])}async function nC(e,t){const{address:n,abi:r,args:a,eventName:c,fromBlock:l,strict:u,toBlock:d}=t,p=wp(e,{method:"eth_newFilter"}),h=c?jd({abi:r,args:a,eventName:c}):void 0,m=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof l=="bigint"?we(l):l,toBlock:typeof d=="bigint"?we(d):d,topics:h}]});return{abi:r,args:a,eventName:c,id:m,request:p(m),strict:!!u,type:"event"}}async function rC(e,{address:t,args:n,event:r,events:a,fromBlock:c,strict:l,toBlock:u}={}){const d=a??(r?[r]:void 0),p=wp(e,{method:"eth_newFilter"});let h=[];d&&(h=[d.flatMap(v=>jd({abi:[v],eventName:v.name,args:n}))],r&&(h=h[0]));const m=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof c=="bigint"?we(c):c,toBlock:typeof u=="bigint"?we(u):u,...h.length?{topics:h}:{}}]});return{abi:d,args:n,eventName:r?r.name:void 0,fromBlock:c,id:m,request:p(m),strict:!!l,toBlock:u,type:"event"}}async function sC(e){const t=wp(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}function oN(e){const t=cn(`0x${e.substring(4)}`).substring(26);return cp(`0x${t}`)}async function iN({hash:e,signature:t}){const n=Es(e)?e:nr(e),{secp256k1:r}=await je(async()=>{const{secp256k1:l}=await Promise.resolve().then(()=>BI);return{secp256k1:l}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:p,s:h,v:m,yParity:g}=t,v=Number(g??m),b=x5(v);return new r.Signature(jn(p),jn(h)).addRecoveryBit(b)}const l=Es(t)?t:nr(t);if(jt(l)!==65)throw new Error("invalid signature length");const u=Tr(`0x${l.slice(130)}`),d=x5(u);return r.Signature.fromCompact(l.substring(2,130)).addRecoveryBit(d)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function x5(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 kg({hash:e,signature:t}){return oN(await iN({hash:e,signature:t}))}function wo(e,t="hex"){const n=aC(e),r=Ey(new Uint8Array(n.length));return n.encode(r),t==="hex"?Vt(r.bytes):r.bytes}function aC(e){return Array.isArray(e)?cN(e.map(t=>aC(t))):lN(e)}function cN(e){const t=e.reduce((a,c)=>a+c.length,0),n=oC(t);return{length:t<=55?1+t:1+n+t,encode(a){t<=55?a.pushByte(192+t):(a.pushByte(247+n),n===1?a.pushUint8(t):n===2?a.pushUint16(t):n===3?a.pushUint24(t):a.pushUint32(t));for(const{encode:c}of e)c(a)}}}function lN(e){const t=typeof e=="string"?Pr(e):e,n=oC(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(a){t.length===1&&t[0]<128?a.pushBytes(t):t.length<=55?(a.pushByte(128+t.length),a.pushBytes(t)):(a.pushByte(183+n),n===1?a.pushUint8(t.length):n===2?a.pushUint16(t.length):n===3?a.pushUint24(t.length):a.pushUint32(t.length),a.pushBytes(t))}}}function oC(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 le("Length is too large.")}function uN(e){const{chainId:t,nonce:n,to:r}=e,a=e.contractAddress??e.address,c=cn(_r(["0x05",wo([t?we(t):"0x",a,n?we(n):"0x"])]));return r==="bytes"?Pr(c):c}async function Qy(e){const{authorization:t,signature:n}=e;return kg({hash:uN(t),signature:n??t})}class dN extends le{constructor(t,{account:n,docsPath:r,chain:a,data:c,gas:l,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,to:m,value:g}){var b;const v=bd({from:n==null?void 0:n.address,to:m,value:typeof g<"u"&&`${Py(g)} ${((b=a==null?void 0:a.nativeCurrency)==null?void 0:b.symbol)||"ETH"}`,data:c,gas:l,gasPrice:typeof u<"u"&&`${rr(u)} gwei`,maxFeePerGas:typeof d<"u"&&`${rr(d)} gwei`,maxPriorityFeePerGas:typeof p<"u"&&`${rr(p)} gwei`,nonce:h});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",v].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function fN(e,{docsPath:t,...n}){const r=(()=>{const a=vp(e,n);return a instanceof Cd?e:a})();return new dN(r,{docsPath:t,...n})}class iC extends le{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Yy extends le{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class hN extends le{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${rr(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class Jy extends le{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 cC={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Sd(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,...e.blockTimestamp!=null&&{blockTimestamp:BigInt(e.blockTimestamp)},chainId:e.chainId?Tr(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?Tr(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?cC[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&&(n.authorizationList=mN(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const pN=Vy("transaction",Sd);function mN(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Xy(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:Sd(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:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const gN=Vy("block",Xy);async function ts(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:a}={}){var p,h,m;const c=a??!1,l=n!==void 0?we(n):void 0;let u=null;if(t?u=await e.request({method:"eth_getBlockByHash",params:[t,c]},{dedupe:!0}):u=await e.request({method:"eth_getBlockByNumber",params:[l||r,c]},{dedupe:!!l}),!u)throw new Jy({blockHash:t,blockNumber:n});return(((m=(h=(p=e.chain)==null?void 0:p.formatters)==null?void 0:h.block)==null?void 0:m.format)||Xy)(u,"getBlock")}async function Zy(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function yN(e,t){return lC(e,t)}async function lC(e,t){var c,l;const{block:n,chain:r=e.chain,request:a}=t||{};try{const u=((c=r==null?void 0:r.fees)==null?void 0:c.maxPriorityFeePerGas)??((l=r==null?void 0:r.fees)==null?void 0:l.defaultPriorityFee);if(typeof u=="function"){const p=n||await Ue(e,ts,"getBlock")({}),h=await u({block:p,client:e,request:a});if(h===null)throw new Error;return h}if(typeof u<"u")return u;const d=await e.request({method:"eth_maxPriorityFeePerGas"});return jn(d)}catch{const[u,d]=await Promise.all([n?Promise.resolve(n):Ue(e,ts,"getBlock")({}),Ue(e,Zy,"getGasPrice")({})]);if(typeof u.baseFeePerGas!="bigint")throw new Yy;const p=d-u.baseFeePerGas;return p<0n?0n:p}}async function vN(e,t){return jg(e,t)}async function jg(e,t){var g,v;const{block:n,chain:r=e.chain,request:a,type:c="eip1559"}=t||{},l=await(async()=>{var b,_;return typeof((b=r==null?void 0:r.fees)==null?void 0:b.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:a}):((_=r==null?void 0:r.fees)==null?void 0:_.baseFeeMultiplier)??1.2})();if(l<1)throw new iC;const d=10**(((g=l.toString().split(".")[1])==null?void 0:g.length)??0),p=b=>b*BigInt(Math.ceil(l*d))/BigInt(d),h=n||await Ue(e,ts,"getBlock")({});if(typeof((v=r==null?void 0:r.fees)==null?void 0:v.estimateFeesPerGas)=="function"){const b=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:p,request:a,type:c});if(b!==null)return b}if(c==="eip1559"){if(typeof h.baseFeePerGas!="bigint")throw new Yy;const b=typeof(a==null?void 0:a.maxPriorityFeePerGas)=="bigint"?a.maxPriorityFeePerGas:await lC(e,{block:h,chain:r,request:a}),_=p(h.baseFeePerGas);return{maxFeePerGas:(a==null?void 0:a.maxFeePerGas)??_+b,maxPriorityFeePerGas:b}}return{gasPrice:(a==null?void 0:a.gasPrice)??p(await Ue(e,Zy,"getGasPrice")({}))}}async function uC(e,{address:t,blockHash:n,blockNumber:r,blockTag:a="latest",requireCanonical:c}){const l=Ti({blockHash:n,blockNumber:r,blockTag:a,requireCanonical:c}),u=await e.request({method:"eth_getTransactionCount",params:[t,l]},{dedupe:typeof r=="bigint"||n!==void 0});return Tr(u)}function ev(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(c=>Pr(c)):e.blobs,a=[];for(const c of r)a.push(Uint8Array.from(t.blobToKzgCommitment(c)));return n==="bytes"?a:a.map(c=>Vt(c))}function tv(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(l=>Pr(l)):e.blobs,a=typeof e.commitments[0]=="string"?e.commitments.map(l=>Pr(l)):e.commitments,c=[];for(let l=0;l<r.length;l++){const u=r[l],d=a[l];c.push(Uint8Array.from(t.computeBlobKzgProof(u,d)))}return n==="bytes"?c:c.map(l=>Vt(l))}function bN(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const a=BigInt(32),c=BigInt(4294967295),l=Number(n>>a&c),u=Number(n&c),d=r?4:0,p=r?0:4;e.setUint32(t+d,l,r),e.setUint32(t+p,u,r)}function wN(e,t,n){return e&t^~e&n}function _N(e,t,n){return e&t^e&n^t&n}class dC extends Sy{constructor(t,n,r,a){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=a,this.buffer=new Uint8Array(t),this.view=Rm(this.buffer)}update(t){Jc(this),t=op(t),mo(t);const{view:n,buffer:r,blockLen:a}=this,c=t.length;for(let l=0;l<c;){const u=Math.min(a-this.pos,c-l);if(u===a){const d=Rm(t);for(;a<=c-l;l+=a)this.process(d,l);continue}r.set(t.subarray(l,l+u),this.pos),this.pos+=u,l+=u,this.pos===a&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Jc(this),Kx(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:a,isLE:c}=this;let{pos:l}=this;n[l++]=128,go(this.buffer.subarray(l)),this.padOffset>a-l&&(this.process(r,0),l=0);for(let m=l;m<a;m++)n[m]=0;bN(r,a-8,BigInt(this.length*8),c),this.process(r,0);const u=Rm(t),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const p=d/4,h=this.get();if(p>h.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<p;m++)u.setUint32(4*m,h[m],c)}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:a,finished:c,destroyed:l,pos:u}=this;return t.destroyed=l,t.finished=c,t.length=a,t.pos=u,a%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const Qa=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),xn=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Cn=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),xN=Uint32Array.from([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]),Ya=new Uint32Array(64);class CN extends dC{constructor(t=32){super(64,t,8,!1),this.A=Qa[0]|0,this.B=Qa[1]|0,this.C=Qa[2]|0,this.D=Qa[3]|0,this.E=Qa[4]|0,this.F=Qa[5]|0,this.G=Qa[6]|0,this.H=Qa[7]|0}get(){const{A:t,B:n,C:r,D:a,E:c,F:l,G:u,H:d}=this;return[t,n,r,a,c,l,u,d]}set(t,n,r,a,c,l,u,d){this.A=t|0,this.B=n|0,this.C=r|0,this.D=a|0,this.E=c|0,this.F=l|0,this.G=u|0,this.H=d|0}process(t,n){for(let m=0;m<16;m++,n+=4)Ya[m]=t.getUint32(n,!1);for(let m=16;m<64;m++){const g=Ya[m-15],v=Ya[m-2],b=gs(g,7)^gs(g,18)^g>>>3,_=gs(v,17)^gs(v,19)^v>>>10;Ya[m]=_+Ya[m-7]+b+Ya[m-16]|0}let{A:r,B:a,C:c,D:l,E:u,F:d,G:p,H:h}=this;for(let m=0;m<64;m++){const g=gs(u,6)^gs(u,11)^gs(u,25),v=h+g+wN(u,d,p)+xN[m]+Ya[m]|0,_=(gs(r,2)^gs(r,13)^gs(r,22))+_N(r,a,c)|0;h=p,p=d,d=u,u=l+v|0,l=c,c=a,a=r,r=v+_|0}r=r+this.A|0,a=a+this.B|0,c=c+this.C|0,l=l+this.D|0,u=u+this.E|0,d=d+this.F|0,p=p+this.G|0,h=h+this.H|0,this.set(r,a,c,l,u,d,p,h)}roundClean(){go(Ya)}destroy(){this.set(0,0,0,0,0,0,0,0),go(this.buffer)}}const fC=qx(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),kN=fC[0],jN=fC[1],Ja=new Uint32Array(80),Xa=new Uint32Array(80);class hC extends dC{constructor(t=64){super(128,t,16,!1),this.Ah=Cn[0]|0,this.Al=Cn[1]|0,this.Bh=Cn[2]|0,this.Bl=Cn[3]|0,this.Ch=Cn[4]|0,this.Cl=Cn[5]|0,this.Dh=Cn[6]|0,this.Dl=Cn[7]|0,this.Eh=Cn[8]|0,this.El=Cn[9]|0,this.Fh=Cn[10]|0,this.Fl=Cn[11]|0,this.Gh=Cn[12]|0,this.Gl=Cn[13]|0,this.Hh=Cn[14]|0,this.Hl=Cn[15]|0}get(){const{Ah:t,Al:n,Bh:r,Bl:a,Ch:c,Cl:l,Dh:u,Dl:d,Eh:p,El:h,Fh:m,Fl:g,Gh:v,Gl:b,Hh:_,Hl:x}=this;return[t,n,r,a,c,l,u,d,p,h,m,g,v,b,_,x]}set(t,n,r,a,c,l,u,d,p,h,m,g,v,b,_,x){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=a|0,this.Ch=c|0,this.Cl=l|0,this.Dh=u|0,this.Dl=d|0,this.Eh=p|0,this.El=h|0,this.Fh=m|0,this.Fl=g|0,this.Gh=v|0,this.Gl=b|0,this.Hh=_|0,this.Hl=x|0}process(t,n){for(let k=0;k<16;k++,n+=4)Ja[k]=t.getUint32(n),Xa[k]=t.getUint32(n+=4);for(let k=16;k<80;k++){const N=Ja[k-15]|0,E=Xa[k-15]|0,B=lc(N,E,1)^lc(N,E,8)^Qw(N,E,7),M=uc(N,E,1)^uc(N,E,8)^Yw(N,E,7),P=Ja[k-2]|0,R=Xa[k-2]|0,z=lc(P,R,19)^Yf(P,R,61)^Qw(P,R,6),q=uc(P,R,19)^Jf(P,R,61)^Yw(P,R,6),Q=FA(M,q,Xa[k-7],Xa[k-16]),O=zA(Q,B,z,Ja[k-7],Ja[k-16]);Ja[k]=O|0,Xa[k]=Q|0}let{Ah:r,Al:a,Bh:c,Bl:l,Ch:u,Cl:d,Dh:p,Dl:h,Eh:m,El:g,Fh:v,Fl:b,Gh:_,Gl:x,Hh:j,Hl:A}=this;for(let k=0;k<80;k++){const N=lc(m,g,14)^lc(m,g,18)^Yf(m,g,41),E=uc(m,g,14)^uc(m,g,18)^Jf(m,g,41),B=m&v^~m&_,M=g&b^~g&x,P=$A(A,E,M,jN[k],Xa[k]),R=HA(P,j,N,B,kN[k],Ja[k]),z=P|0,q=lc(r,a,28)^Yf(r,a,34)^Yf(r,a,39),Q=uc(r,a,28)^Jf(r,a,34)^Jf(r,a,39),O=r&c^r&u^c&u,K=a&l^a&d^l&d;j=_|0,A=x|0,_=v|0,x=b|0,v=m|0,b=g|0,{h:m,l:g}=Gs(p|0,h|0,R|0,z|0),p=u|0,h=d|0,u=c|0,d=l|0,c=r|0,l=a|0;const $=DA(z,Q,K);r=OA($,R,q,O),a=$|0}({h:r,l:a}=Gs(this.Ah|0,this.Al|0,r|0,a|0)),{h:c,l}=Gs(this.Bh|0,this.Bl|0,c|0,l|0),{h:u,l:d}=Gs(this.Ch|0,this.Cl|0,u|0,d|0),{h:p,l:h}=Gs(this.Dh|0,this.Dl|0,p|0,h|0),{h:m,l:g}=Gs(this.Eh|0,this.El|0,m|0,g|0),{h:v,l:b}=Gs(this.Fh|0,this.Fl|0,v|0,b|0),{h:_,l:x}=Gs(this.Gh|0,this.Gl|0,_|0,x|0),{h:j,l:A}=Gs(this.Hh|0,this.Hl|0,j|0,A|0),this.set(r,a,c,l,u,d,p,h,m,g,v,b,_,x,j,A)}roundClean(){go(Ja,Xa)}destroy(){go(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class SN extends hC{constructor(){super(48),this.Ah=xn[0]|0,this.Al=xn[1]|0,this.Bh=xn[2]|0,this.Bl=xn[3]|0,this.Ch=xn[4]|0,this.Cl=xn[5]|0,this.Dh=xn[6]|0,this.Dl=xn[7]|0,this.Eh=xn[8]|0,this.El=xn[9]|0,this.Fh=xn[10]|0,this.Fl=xn[11]|0,this.Gh=xn[12]|0,this.Gl=xn[13]|0,this.Hh=xn[14]|0,this.Hl=xn[15]|0}}const pC=ip(()=>new CN),xge=ip(()=>new hC),Cge=ip(()=>new SN),AN=pC;function EN(e,t){return AN(Es(e,{strict:!1})?il(e):e)}function NN(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),a=EN(t);return a.set([n],0),r==="bytes"?a:Vt(a)}function mC(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),a=[];for(const c of t)a.push(NN({commitment:c,to:r,version:n}));return a}const C5=6,gC=32,nv=4096,yC=gC*nv,k5=yC*C5-1-1*nv*C5,vC=1;class MN extends le{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class bC extends le{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class IN extends le{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class BN extends le{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${vC}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function TN(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?Pr(e.data):e.data,r=jt(n);if(!r)throw new bC;if(r>k5)throw new MN({maxSize:k5,size:r});const a=[];let c=!0,l=0;for(;c;){const u=Ey(new Uint8Array(yC));let d=0;for(;d<nv;){const p=n.slice(l,l+(gC-1));if(u.pushByte(0),u.pushBytes(p),p.length<31){u.pushByte(128),c=!1;break}d++,l+=31}a.push(u)}return t==="bytes"?a.map(u=>u.bytes):a.map(u=>Vt(u.bytes))}function wC(e){const{data:t,kzg:n,to:r}=e,a=e.blobs??TN({data:t,to:r}),c=e.commitments??ev({blobs:a,kzg:n,to:r}),l=e.proofs??tv({blobs:a,commitments:c,kzg:n,to:r}),u=[];for(let d=0;d<a.length;d++)u.push({blob:a[d],commitment:c[d],proof:l[d]});return u}function _C(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 R7({transaction:e})}function xC(e,{docsPath:t,...n}){const r=(()=>{const a=vp(e,n);return a instanceof Cd?e:a})();return new D7(r,{docsPath:t,...n})}async function Yu(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return Tr(t)}async function CC(e,t){var P,R,z,q,Q;const{account:n=e.account,accessList:r,authorizationList:a,chain:c=e.chain,blobVersionedHashes:l,blobs:u,data:d,gas:p,gasPrice:h,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:v,nonce:b,nonceManager:_,to:x,type:j,value:A,...k}=t,N=await(async()=>{if(!n||!_||typeof b<"u")return b;const O=mn(n),K=c?c.id:await Ue(e,Yu,"getChainId")({});return await _.consume({address:O.address,chainId:K,client:e})})();Pi(t);const E=(R=(P=c==null?void 0:c.formatters)==null?void 0:P.transactionRequest)==null?void 0:R.format,M=(E||dl)({...kd(k,{format:E}),account:n?mn(n):void 0,accessList:r,authorizationList:a,blobs:u,blobVersionedHashes:l,data:d,gas:p,gasPrice:h,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:v,nonce:N,to:x,type:j,value:A},"fillTransaction");try{const O=await e.request({method:"eth_fillTransaction",params:[M]}),$=(((q=(z=c==null?void 0:c.formatters)==null?void 0:z.transaction)==null?void 0:q.format)||Sd)(O.tx);delete $.blockHash,delete $.blockNumber,delete $.r,delete $.s,delete $.transactionIndex,delete $.v,delete $.yParity,$.data=$.input,$.gas&&($.gas=t.gas??$.gas),$.gasPrice&&($.gasPrice=t.gasPrice??$.gasPrice),$.maxFeePerBlobGas&&($.maxFeePerBlobGas=t.maxFeePerBlobGas??$.maxFeePerBlobGas),$.maxFeePerGas&&($.maxFeePerGas=t.maxFeePerGas??$.maxFeePerGas),$.maxPriorityFeePerGas&&($.maxPriorityFeePerGas=t.maxPriorityFeePerGas??$.maxPriorityFeePerGas),typeof $.nonce<"u"&&($.nonce=t.nonce??$.nonce);const L=await(async()=>{var te,W;if(typeof((te=c==null?void 0:c.fees)==null?void 0:te.baseFeeMultiplier)=="function"){const oe=await Ue(e,ts,"getBlock")({});return c.fees.baseFeeMultiplier({block:oe,client:e,request:t})}return((W=c==null?void 0:c.fees)==null?void 0:W.baseFeeMultiplier)??1.2})();if(L<1)throw new iC;const D=10**(((Q=L.toString().split(".")[1])==null?void 0:Q.length)??0),X=te=>te*BigInt(Math.ceil(L*D))/BigInt(D);return $.feePayerSignature||($.maxFeePerGas&&!t.maxFeePerGas&&($.maxFeePerGas=X($.maxFeePerGas)),$.gasPrice&&!t.gasPrice&&($.gasPrice=X($.gasPrice))),{raw:O.raw,transaction:{from:M.from,...$},...O.capabilities?{capabilities:O.capabilities}:{}}}catch(O){throw xC(O,{...t,chain:e.chain})}}const kC=["blobVersionedHashes","chainId","fees","gas","nonce","type"],j5=new Map,Gm=new gd(128);async function rv(e,t){var N,E,B;let n=t;n.account??(n.account=e.account),n.parameters??(n.parameters=kC);const{account:r,chain:a=e.chain,nonceManager:c,parameters:l}=n,u=(()=>{if(typeof(a==null?void 0:a.prepareTransactionRequest)=="function")return{fn:a.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(a==null?void 0:a.prepareTransactionRequest))return{fn:a.prepareTransactionRequest[0],runAt:a.prepareTransactionRequest[1].runAt}})();let d;async function p(){return d||(typeof n.chainId<"u"?n.chainId:a?a.id:(d=await Ue(e,Yu,"getChainId")({}),d))}const h=r&&mn(r);let m=n.nonce;if(l.includes("nonce")&&typeof m>"u"&&h&&c){const M=await p();m=await c.consume({address:h.address,chainId:M,client:e})}u!=null&&u.fn&&((N=u.runAt)!=null&&N.includes("beforeFillTransaction"))&&(n=await u.fn({...n,chain:a},{client:e,phase:"beforeFillTransaction"}),m??(m=n.nonce));const v=((l.includes("blobVersionedHashes")||l.includes("sidecars"))&&n.kzg&&n.blobs||Gm.get(e.uid)===!1||!["fees","gas"].some(P=>l.includes(P))?!1:!!(l.includes("chainId")&&typeof n.chainId!="number"||l.includes("nonce")&&typeof m!="number"||l.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||l.includes("gas")&&typeof n.gas!="bigint"))?await Ue(e,CC,"fillTransaction")({...n,nonce:m}).then(M=>{const{chainId:P,from:R,gas:z,gasPrice:q,nonce:Q,maxFeePerBlobGas:O,maxFeePerGas:K,maxPriorityFeePerGas:$,type:L,...se}=M.transaction;return Gm.set(e.uid,!0),{...n,...R?{from:R}:{},...L&&!n.type?{type:L}:{},...typeof P<"u"?{chainId:P}:{},...typeof z<"u"?{gas:z}:{},...typeof q<"u"?{gasPrice:q}:{},...typeof Q<"u"?{nonce:Q}:{},...typeof O<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerBlobGas:O}:{},...typeof K<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerGas:K}:{},...typeof $<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxPriorityFeePerGas:$}:{},..."nonceKey"in se&&typeof se.nonceKey<"u"?{nonceKey:se.nonceKey}:{},..."keyAuthorization"in se&&typeof se.keyAuthorization<"u"&&se.keyAuthorization!==null&&!("keyAuthorization"in n)?{keyAuthorization:se.keyAuthorization}:{},..."feePayerSignature"in se&&typeof se.feePayerSignature<"u"&&se.feePayerSignature!==null?{feePayerSignature:se.feePayerSignature}:{},..."feeToken"in se&&typeof se.feeToken<"u"&&se.feeToken!==null&&!("feeToken"in n)?{feeToken:se.feeToken}:{},...M.capabilities?{_capabilities:M.capabilities}:{}}}).catch(M=>{var q,Q;const P=M;if(P.name!=="TransactionExecutionError")return n;if((q=P.walk)==null?void 0:q.call(P,O=>O.name==="ExecutionRevertedError"))throw M;return((Q=P.walk)==null?void 0:Q.call(P,O=>{var $;const K=O;return K.name==="MethodNotFoundRpcError"||K.name==="MethodNotSupportedRpcError"||(($=K.message)==null?void 0:$.includes("eth_fillTransaction is not available"))}))&&Gm.set(e.uid,!1),n}):n;m??(m=v.nonce),n={...v,...h?{from:h==null?void 0:h.address}:{},...typeof m<"u"?{nonce:m}:{}};const{blobs:b,gas:_,kzg:x,type:j}=n;u!=null&&u.fn&&((E=u.runAt)!=null&&E.includes("beforeFillParameters"))&&(n=await u.fn({...n,chain:a},{client:e,phase:"beforeFillParameters"}));let A;async function k(){return A||(A=await Ue(e,ts,"getBlock")({blockTag:"latest"}),A)}if(l.includes("nonce")&&typeof m>"u"&&h&&!c&&(n.nonce=await Ue(e,uC,"getTransactionCount")({address:h.address,blockTag:"pending"})),(l.includes("blobVersionedHashes")||l.includes("sidecars"))&&b&&x){const M=ev({blobs:b,kzg:x});if(l.includes("blobVersionedHashes")){const P=mC({commitments:M,to:"hex"});n.blobVersionedHashes=P}if(l.includes("sidecars")){const P=tv({blobs:b,commitments:M,kzg:x}),R=wC({blobs:b,commitments:M,proofs:P,to:"hex"});n.sidecars=R}}if(l.includes("chainId")&&(n.chainId=await p()),(l.includes("fees")||l.includes("type"))&&typeof j>"u")try{n.type=_C(n)}catch{let M=j5.get(e.uid);if(typeof M>"u"){const P=await k();M=typeof(P==null?void 0:P.baseFeePerGas)=="bigint",j5.set(e.uid,M)}n.type=M?"eip1559":"legacy"}if(l.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const M=await k(),{maxFeePerGas:P,maxPriorityFeePerGas:R}=await jg(e,{block:M,chain:a,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<R)throw new hN({maxPriorityFeePerGas:R});n.maxPriorityFeePerGas=R,n.maxFeePerGas=P}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new Yy;if(typeof n.gasPrice>"u"){const M=await k(),{gasPrice:P}=await jg(e,{block:M,chain:a,request:n,type:"legacy"});n.gasPrice=P}}return l.includes("gas")&&typeof _>"u"&&(n.gas=await Ue(e,sv,"estimateGas")({...n,account:h,prepare:(h==null?void 0:h.type)==="local"?[]:["blobVersionedHashes"]})),u!=null&&u.fn&&((B=u.runAt)!=null&&B.includes("afterFillParameters"))&&(n=await u.fn({...n,chain:a},{client:e,phase:"afterFillParameters"})),Pi(n),delete n.parameters,n}async function sv(e,t){var l,u,d;const{account:n=e.account,prepare:r=!0}=t,a=n?mn(n):void 0,c=(()=>{if(Array.isArray(r))return r;if((a==null?void 0:a.type)!=="local")return["blobVersionedHashes"]})();try{const p=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await Qy({authorization:t.authorizationList[0]}).catch(()=>{throw new le("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:h,authorizationList:m,blobs:g,blobVersionedHashes:v,blockNumber:b,blockTag:_,data:x,gas:j,gasPrice:A,maxFeePerBlobGas:k,maxFeePerGas:N,maxPriorityFeePerGas:E,nonce:B,value:M,stateOverride:P,...R}=r?await rv(e,{...t,parameters:c,to:p}):t;if(j&&t.gas!==j)return j;const q=(typeof b=="bigint"?we(b):void 0)||_,Q=Gy(P);Pi(t);const O=(d=(u=(l=e.chain)==null?void 0:l.formatters)==null?void 0:u.transactionRequest)==null?void 0:d.format,$=(O||dl)({...kd(R,{format:O}),account:a,accessList:h,authorizationList:m,blobs:g,blobVersionedHashes:v,data:x,gasPrice:A,maxFeePerBlobGas:k,maxFeePerGas:N,maxPriorityFeePerGas:E,nonce:B,to:p,value:M},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:Q?[$,q??e.experimental_blockTag??"latest",Q]:q?[$,q]:[$]}))}catch(p){throw fN(p,{...t,account:a,chain:e.chain})}}async function PN(e,t){var p;const{abi:n,address:r,args:a,functionName:c,dataSuffix:l=typeof e.dataSuffix=="string"?e.dataSuffix:(p=e.dataSuffix)==null?void 0:p.value,...u}=t,d=At({abi:n,args:a,functionName:c});try{return await Ue(e,sv,"estimateGas")({data:`${d}${l?l.replace("0x",""):""}`,to:r,...u})}catch(h){const m=u.account?mn(u.account):void 0;throw Zc(h,{abi:n,address:r,args:a,docsPath:"/docs/contract/estimateContractGas",functionName:c,sender:m==null?void 0:m.address})}}async function jC(e,{address:t,blockHash:n,blockNumber:r,blockTag:a=e.experimental_blockTag??"latest",requireCanonical:c}){var d,p,h;const l=Ti({blockHash:n,blockNumber:r,blockTag:a,requireCanonical:c});if((d=e.batch)!=null&&d.multicall&&((h=(p=e.chain)==null?void 0:p.contracts)!=null&&h.multicall3)){const m=e.chain.contracts.multicall3.address,g=At({abi:Qc,functionName:"getEthBalance",args:[t]}),{data:v}=await Ue(e,fl,"call")({to:m,data:g,blockHash:n,blockNumber:r,blockTag:a,requireCanonical:c});return ko({abi:Qc,functionName:"getEthBalance",args:[t],data:v||"0x"})}const u=await e.request({method:"eth_getBalance",params:[t,l]});return BigInt(u)}async function RN(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}const LN=new Map,DN=new Map;function ON(e){const t=(a,c)=>({clear:()=>c.delete(a),get:()=>c.get(a),set:l=>c.set(a,l)}),n=t(e,LN),r=t(e,DN);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function FN(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=ON(t),a=r.response.get();if(a&&n>0&&Date.now()-a.created.getTime()<n)return a.data;let c=r.promise.get();c||(c=e(),r.promise.set(c));try{const l=await c;return r.response.set({created:new Date,data:l}),l}finally{r.promise.clear()}}const zN=e=>`blockNumber.${e}`;async function Ad(e,{cacheTime:t=e.cacheTime}={}){const n=await FN(()=>e.request({method:"eth_blockNumber"}),{cacheKey:zN(e.uid),cacheTime:t});return BigInt(n)}function Ns(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,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}:{}}}const $N={"0x0":"reverted","0x1":"success"};function _p(e,t){const n={...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(r=>Ns(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Tr(e.transactionIndex):null,status:e.status?$N[e.status]:null,type:e.type?cC[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const HN=Vy("transactionReceipt",_p);async function UN(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}={}){var u,d,p;const a=n!==void 0?we(n):void 0,c=await e.request({method:"eth_getBlockReceipts",params:[t||a||r]},{dedupe:!!(t||a)});if(!c)throw new Jy({blockHash:t,blockNumber:n});const l=((p=(d=(u=e.chain)==null?void 0:u.formatters)==null?void 0:d.transactionReceipt)==null?void 0:p.format)||_p;return c.map(h=>l(h,"getBlockReceipts"))}async function WN(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const a=n!==void 0?we(n):void 0;let c;return t?c=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):c=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[a||r]},{dedupe:!!a}),Tr(c)}async function Fh(e,{address:t,blockHash:n,blockNumber:r,blockTag:a="latest",requireCanonical:c}){const l=Ti({blockHash:n,blockNumber:r,blockTag:a,requireCanonical:c}),u=await e.request({method:"eth_getCode",params:[t,l]},{dedupe:typeof r=="bigint"||n!==void 0});if(u!=="0x")return u}const S5="/docs/contract/decodeEventLog";function zh(e){const{abi:t,data:n,strict:r,topics:a}=e,c=r??!0,[l,...u]=a;if(!l)throw new mA({docsPath:S5});const d=t.find(j=>j.type==="event"&&l===up(as(j)));if(!(d&&"name"in d)||d.type!=="event")throw new gA(l,{docsPath:S5});const{name:p,inputs:h}=d,m=h==null?void 0:h.some(j=>!("name"in j&&j.name)),g=m?[]:{},v=h.map((j,A)=>[j,A]).filter(([j])=>"indexed"in j&&j.indexed),b=[];for(let j=0;j<v.length;j++){const[A,k]=v[j],N=u[j];if(!N){if(c)throw new xy({abiItem:d,param:A});b.push([A,k]);continue}g[m?k:A.name||k]=VN({param:A,value:N})}const _=h.filter(j=>!("indexed"in j&&j.indexed)),x=c?_:[...b.map(([j])=>j),..._];if(x.length>0){if(n&&n!=="0x")try{const j=yd(x,n);if(j){let A=0;if(!c)for(const[k,N]of b)g[m?N:k.name||N]=j[A++];if(m)for(let k=0;k<h.length;k++)g[k]===void 0&&A<j.length&&(g[k]=j[A++]);else for(let k=0;k<_.length;k++)g[_[k].name]=j[A++]}}catch(j){if(c)throw j instanceof Ox||j instanceof t3?new Rh({abiItem:d,data:n,params:x,size:jt(n)}):j}else if(c)throw new Rh({abiItem:d,data:"0x",params:x,size:0})}return{eventName:p,args:Object.values(g).length>0?g:void 0}}function VN({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(yd([e],t)||[])[0]}function xp(e){const{abi:t,args:n,logs:r,strict:a=!0}=e,c=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),l=t.filter(u=>u.type==="event").map(u=>({abi:u,selector:up(u)}));return r.map(u=>{var g;const d=typeof u.blockNumber=="string"?Ns(u):u,p=l.filter(v=>d.topics[0]===v.selector);if(p.length===0)return null;let h,m;for(const v of p)try{h=zh({...d,abi:[v.abi],strict:!0}),m=v;break}catch{}if(!h&&!a){m=p[0];try{h=zh({data:d.data,topics:d.topics,abi:[m.abi],strict:!1})}catch{const v=(g=m.abi.inputs)==null?void 0:g.some(b=>!("name"in b&&b.name));return{...d,args:v?[]:{},eventName:m.abi.name}}}return!h||!m||c&&!c.includes(h.eventName)||!GN({args:h.args,inputs:m.abi.inputs,matchArgs:n})?null:{...h,...d}}).filter(Boolean)}function GN(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function a(c,l,u){try{return c.type==="address"?el(l,u):c.type==="string"||c.type==="bytes"?cn(il(l))===u:l===u}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((c,l)=>{if(c==null)return!0;const u=n[l];return u?(Array.isArray(c)?c:[c]).some(p=>a(u,p,t[l])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([c,l])=>{if(l==null)return!0;const u=n.find(p=>p.name===c);return u?(Array.isArray(l)?l:[l]).some(p=>a(u,p,t[c])):!1}):!1}async function av(e,{address:t,blockHash:n,fromBlock:r,toBlock:a,event:c,events:l,args:u,strict:d}={}){const p=d??!1,h=l??(c?[c]:void 0);let m=[];h&&(m=[h.flatMap(_=>jd({abi:[_],eventName:_.name,args:l?void 0:u}))],c&&(m=m[0]));let g;n?g=await e.request({method:"eth_getLogs",params:[{address:t,topics:m,blockHash:n}]}):g=await e.request({method:"eth_getLogs",params:[{address:t,topics:m,fromBlock:typeof r=="bigint"?we(r):r,toBlock:typeof a=="bigint"?we(a):a}]});const v=g.map(b=>Ns(b));return h?xp({abi:h,args:u,logs:v,strict:p}):v}async function SC(e,t){const{abi:n,address:r,args:a,blockHash:c,eventName:l,fromBlock:u,toBlock:d,strict:p}=t,h=l?Bi({abi:n,name:l}):void 0,m=h?void 0:n.filter(g=>g.type==="event");return Ue(e,av,"getLogs")({address:r,args:a,blockHash:c,event:h,events:m,fromBlock:u,toBlock:d,strict:p})}async function qN(e,{address:t,blockNumber:n,blockTag:r="latest"}){const a=await Fh(e,{address:t,...n!==void 0?{blockNumber:n}:{blockTag:r}});if(a&&jt(a)===23&&a.startsWith("0xef0100"))return xt(yo(a,3,23))}class KN extends le{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function QN(e,t){const{address:n,factory:r,factoryData:a}=t;try{const[c,l,u,d,p,h,m]=await Ue(e,Lr,"readContract")({abi:YN,address:n,functionName:"eip712Domain",factory:r,factoryData:a});return{domain:{name:l,version:u,chainId:Number(d),verifyingContract:p,salt:h},extensions:m,fields:c}}catch(c){const l=c;throw l.name==="ContractFunctionExecutionError"&&l.cause.name==="ContractFunctionZeroDataError"?new KN({address:n}):l}}const YN=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function JN(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function XN(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:a}){const c=typeof n=="bigint"?we(n):void 0,l=await e.request({method:"eth_feeHistory",params:[we(t),c||r,a]},{dedupe:!!c});return JN(l)}async function Cp(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const a=r.map(c=>Ns(c));return!("abi"in t)||!t.abi?a:xp({abi:t.abi,logs:a,strict:n})}async function ZN(e,{filter:t}){const n=t.strict??!1,a=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(c=>Ns(c));return t.abi?xp({abi:t.abi,logs:a,strict:n}):a}function AC(e,t){if(e.length!==t.length)throw new Fx({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const a=e[r],c=t[r];n.push(EC(a,c))}return _r(n)}function EC(e,t,n=!1){if(e==="address"){const l=t;if(!Ft(l))throw new An({address:l});return br(l.toLowerCase(),{size:n?32:null})}if(e==="string")return wi(t);if(e==="bytes")return t;if(e==="bool")return br(jy(t),{size:n?32:1});const r=e.match(Ny);if(r){const[l,u,d="256"]=r,p=Number.parseInt(d,10)/8;return we(t,{size:n?32:p,signed:u==="int"})}const a=e.match(a3);if(a){const[l,u]=a;if(Number.parseInt(u,10)!==(t.length-2)/2)throw new Hx({expectedSize:Number.parseInt(u,10),givenSize:(t.length-2)/2});return br(t,{dir:"right",size:n?32:null})}const c=e.match(g9);if(c&&Array.isArray(t)){const[l,u]=c,d=[];for(let p=0;p<t.length;p++)d.push(EC(u,t[p],!0));return d.length===0?"0x":_r(d)}throw new xA(e)}function eM(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:r}=n,a=n.address;if(!Ft(a))throw new An({address:a});if(r<0)throw new dp({chainId:r})}ov(e)}function tM(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new bC;for(const n of t){const r=jt(n),a=Tr(yo(n,0,1));if(r!==32)throw new IN({hash:n,size:r});if(a!==vC)throw new BN({hash:n,version:a})}}ov(e)}function ov(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:a}=e;if(t<=0)throw new dp({chainId:t});if(a&&!Ft(a))throw new An({address:a});if(r&&r>bp)throw new ki({maxFeePerGas:r});if(n&&r&&n>r)throw new Qu({maxFeePerGas:r,maxPriorityFeePerGas:n})}function nM(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:c}=e;if(t<=0)throw new dp({chainId:t});if(c&&!Ft(c))throw new An({address:c});if(n||a)throw new le("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>bp)throw new ki({maxFeePerGas:r})}function rM(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:c}=e;if(c&&!Ft(c))throw new An({address:c});if(typeof t<"u"&&t<=0)throw new dp({chainId:t});if(n||a)throw new le("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>bp)throw new ki({maxFeePerGas:r})}function kp(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:a}=e[n];for(let c=0;c<a.length;c++)if(a[c].length-2!==64)throw new L7({storageKey:a[c]});if(!Ft(r,{strict:!1}))throw new An({address:r});t.push([r,a])}return t}function sM(e,t){const n=_C(e);return n==="eip1559"?iM(e,t):n==="eip2930"?cM(e,t):n==="eip4844"?oM(e,t):n==="eip7702"?aM(e,t):lM(e,t)}function aM(e,t){const{authorizationList:n,chainId:r,gas:a,nonce:c,to:l,value:u,maxFeePerGas:d,maxPriorityFeePerGas:p,accessList:h,data:m}=e;eM(e);const g=kp(h),v=uM(n);return _r(["0x04",wo([we(r),c?we(c):"0x",p?we(p):"0x",d?we(d):"0x",a?we(a):"0x",l??"0x",u?we(u):"0x",m??"0x",g,v,...Ed(e,t)])])}function oM(e,t){const{chainId:n,gas:r,nonce:a,to:c,value:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,accessList:h,data:m}=e;tM(e);let g=e.blobVersionedHashes,v=e.sidecars;if(e.blobs&&(typeof g>"u"||typeof v>"u")){const k=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(B=>Vt(B)),N=e.kzg,E=ev({blobs:k,kzg:N});if(typeof g>"u"&&(g=mC({commitments:E})),typeof v>"u"){const B=tv({blobs:k,commitments:E,kzg:N});v=wC({blobs:k,commitments:E,proofs:B})}}const b=kp(h),_=[we(n),a?we(a):"0x",p?we(p):"0x",d?we(d):"0x",r?we(r):"0x",c??"0x",l?we(l):"0x",m??"0x",b,u?we(u):"0x",g??[],...Ed(e,t)],x=[],j=[],A=[];if(v)for(let k=0;k<v.length;k++){const{blob:N,commitment:E,proof:B}=v[k];x.push(N),j.push(E),A.push(B)}return _r(["0x03",wo(v?[_,x,j,A]:_)])}function iM(e,t){const{chainId:n,gas:r,nonce:a,to:c,value:l,maxFeePerGas:u,maxPriorityFeePerGas:d,accessList:p,data:h}=e;ov(e);const m=kp(p),g=[we(n),a?we(a):"0x",d?we(d):"0x",u?we(u):"0x",r?we(r):"0x",c??"0x",l?we(l):"0x",h??"0x",m,...Ed(e,t)];return _r(["0x02",wo(g)])}function cM(e,t){const{chainId:n,gas:r,data:a,nonce:c,to:l,value:u,accessList:d,gasPrice:p}=e;nM(e);const h=kp(d),m=[we(n),c?we(c):"0x",p?we(p):"0x",r?we(r):"0x",l??"0x",u?we(u):"0x",a??"0x",h,...Ed(e,t)];return _r(["0x01",wo(m)])}function lM(e,t){const{chainId:n=0,gas:r,data:a,nonce:c,to:l,value:u,gasPrice:d}=e;rM(e);let p=[c?we(c):"0x",d?we(d):"0x",r?we(r):"0x",l??"0x",u?we(u):"0x",a??"0x"];if(t){const h=(()=>{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 v=27n+(t.v===27n?0n:1n);if(t.v!==v)throw new P7({v:t.v});return v})(),m=tr(t.r),g=tr(t.s);p=[...p,we(h),m==="0x00"?"0x":m,g==="0x00"?"0x":g]}else n>0&&(p=[...p,we(n),"0x","0x"]);return wo(p)}function Ed(e,t){const n=t??e,{v:r,yParity:a}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof a>"u")return[];const c=tr(n.r),l=tr(n.s);return[typeof a=="number"?a?we(1):"0x":r===0n?"0x":r===1n?we(1):r===27n?"0x":we(1),c==="0x00"?"0x":c,l==="0x00"?"0x":l]}function uM(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:r,nonce:a,...c}=n,l=n.address;t.push([r?nr(r):"0x",l,a?nr(a):"0x",...Ed({},c)])}return t}async function dM({address:e,authorization:t,signature:n}){return el(xt(e),await Qy({authorization:t,signature:n}))}const Zf=new gd(8192);function fM(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Zf.get(n))return Zf.get(n);const r=e().finally(()=>Zf.delete(n));return Zf.set(n,r),r}async function Sg(e,{signal:t}={}){return new Promise((n,r)=>{if(t!=null&&t.aborted){r(vo(t));return}const a=()=>t==null?void 0:t.removeEventListener("abort",l),c=setTimeout(()=>{a(),n()},e),l=()=>{clearTimeout(c),a(),r(vo(t))};t==null||t.addEventListener("abort",l,{once:!0})})}function tl(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0,signal:a}={}){return new Promise((c,l)=>{const u=async({count:d=0}={})=>{if(a!=null&&a.aborted){l(vo(a));return}const p=async({error:h})=>{const m=typeof t=="function"?t({count:d,error:h}):t;if(m)try{await Sg(m,{signal:a})}catch(g){l(g);return}u({count:d+1})};try{const h=await e();c(h)}catch(h){if(a!=null&&a.aborted){l(vo(a));return}if(ul(h)){l(h);return}if(d<n&&await r({count:d,error:h}))return p({error:h});l(h)}};u()})}function hM(e,t={}){return async(n,r={})=>{var g;const{dedupe:a=!1,methods:c,retryDelay:l=150,retryCount:u=3,signal:d,uid:p}={...t,...r},{method:h}=n;if((g=c==null?void 0:c.exclude)!=null&&g.includes(h))throw new si(new Error("method not supported"),{method:h});if(c!=null&&c.include&&!c.include.includes(h))throw new si(new Error("method not supported"),{method:h});if(d!=null&&d.aborted)throw vo(d);const m=a?mM(`${p}.${ln(n)}`):void 0;return fM(()=>tl(async()=>{try{return await e(n,d?{signal:d}:void 0)}catch(v){if(d!=null&&d.aborted)throw vo(d);if(ul(v))throw v;const b=v;switch(b.code){case Eu.code:throw new Eu(b);case Nu.code:throw new Nu(b);case Mu.code:throw new Mu(b,{method:n.method});case Iu.code:throw new Iu(b);case _i.code:throw new _i(b);case bo.code:throw new bo(b);case Bu.code:throw new Bu(b);case js.code:throw new js(b);case Tu.code:throw new Tu(b);case si.code:throw new si(b,{method:n.method});case Xc.code:throw new Xc(b);case Pu.code:throw new Pu(b);case ct.code:throw new ct(b);case Ru.code:throw new Ru(b);case Lu.code:throw new Lu(b);case Du.code:throw new Du(b);case Ou.code:throw new Ou(b);case sr.code:throw new sr(b);case Fu.code:throw new Fu(b);case zu.code:throw new zu(b);case $u.code:throw new $u(b);case Hu.code:throw new Hu(b);case Uu.code:throw new Uu(b);case Wu.code:throw new Wu(b);case Vu.code:throw new Vu(b);case 5e3:throw new ct(b);case Gu.code:throw new Gu(b);default:throw v instanceof le?v:new Y7(b)}}},{delay:({count:v,error:b})=>{var _;if(b&&b instanceof Cu){const x=(_=b==null?void 0:b.headers)==null?void 0:_.get("Retry-After");if(x!=null&&x.match(/\d/))return Number.parseInt(x,10)*1e3}return~~(1<<v)*l},retryCount:u,signal:d,shouldRetry:({error:v})=>pM(v)}),{enabled:a,id:m})}}function pM(e){return ul(e)?!1:"code"in e&&typeof e.code=="number"?e.code===-1||e.code===Xc.code||e.code===_i.code||e.code===429:e instanceof Cu&&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 mM(e,t=0){let n=3735928559^t,r=1103547991^t;for(let a=0;a<e.length;a++){const c=e.charCodeAt(a);n=Math.imul(n^c,2654435761),r=Math.imul(r^c,1597334677)}return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>16,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>16,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36)}function gM({chain:e,currentChainId:t}){if(!e)throw new j7;if(t!==e.id)throw new k7({chain:e,currentChainId:t})}function Is(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return a=>{const c=typeof a=="function"?a(r):a,l={...r,...c};return Object.assign(l,{extend:n(l)})}}return Object.assign(t,{extend:n(t)})}function jp(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((a,c)=>{(async()=>{let l;const u=new AbortController;try{n>0&&(l=setTimeout(()=>{r?u.abort():c(t)},n)),a(await e({signal:(u==null?void 0:u.signal)||null}))}catch(d){if(u!=null&&u.signal.aborted&&ul(d)){c(t);return}c(d)}finally{clearTimeout(l)}})()})}function yM(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const A5=yM();function NC(e,t={}){const{url:n,headers:r}=vM(e);return{async request(a){var b,_,x;const{body:c,fetchFn:l=t.fetchFn??fetch,onRequest:u=t.onRequest,onResponse:d=t.onResponse,timeout:p=t.timeout??1e4}=a,h={...t.fetchOptions??{},...a.fetchOptions??{}},{headers:m,method:g,signal:v}=h;try{const j=await jp(async({signal:k})=>{const N={...h,body:Array.isArray(c)?ln(c.map(P=>({jsonrpc:"2.0",id:P.id??A5.take(),...P}))):ln({jsonrpc:"2.0",id:c.id??A5.take(),...c}),headers:{...r,"Content-Type":"application/json",...m},method:g||"POST",signal:v||(p>0?k:null)},E=new Request(n,N),B=await(u==null?void 0:u(E,N))??{...N,url:n};return await l(B.url??n,B)},{errorInstance:new u5({body:c,url:n}),timeout:p,signal:!0});d&&await d(j);let A;if((b=j.headers.get("Content-Type"))!=null&&b.startsWith("application/json"))A=await j.json();else{A=await j.text();try{A=JSON.parse(A||"{}")}catch(k){if(j.ok)throw k;A={error:A}}}if(!j.ok){if(typeof((_=A.error)==null?void 0:_.code)=="number"&&typeof((x=A.error)==null?void 0:x.message)=="string")return A;throw new Cu({body:c,details:ln(A.error)||j.statusText,headers:j.headers,status:j.status,url:n})}return A}catch(j){throw v!=null&&v.aborted?vo(v):ul(j)||j instanceof Cu||j instanceof u5?j:new Cu({body:c,cause:j,url:n})}}}}function vM(e){try{const t=new URL(e),n=(()=>{if(t.username){const r=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(r)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}function bM(e,{body:t,onError:n,onResponse:r}){return e.request({body:t,onError:n,onResponse:r}),e}async function wM(e,{body:t,timeout:n=1e4}){return e.requestAsync({body:t,timeout:n})}const qm={http(e,t){return NC(e).request(t)},webSocket:bM,webSocketAsync:wM},_M=`Ethereum Signed Message:
1684
1684
  `;function xM(e){const t=typeof e=="string"?wi(e):typeof e.raw=="string"?e.raw:Vt(e.raw),n=wi(`${_M}${jt(t)}`);return Rr([n,t])}function MC(e,t){return cn(xM(e),t)}class CM extends le{constructor({domain:t}){super(`Invalid domain "${ln(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class kM extends le{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class jM extends le{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function SM(e){const{domain:t,message:n,primaryType:r,types:a}=e,c=(d,p)=>{const h={...p};for(const m of d){const{name:g,type:v}=m;v==="address"&&(h[g]=h[g].toLowerCase())}return h},l=a.EIP712Domain?t?c(a.EIP712Domain,t):{}:{},u=(()=>{if(r!=="EIP712Domain")return c(a[r],n)})();return ln({domain:l,message:u,primaryType:r,types:a})}function IC(e){const{domain:t,message:n,primaryType:r,types:a}=e,c=(l,u)=>{for(const d of l){const{name:p,type:h}=d,m=u[p],g=h.match(Ny);if(g&&(typeof m=="number"||typeof m=="bigint")){const[_,x,j]=g;we(m,{signed:x==="int",size:Number.parseInt(j,10)/8})}if(h==="address"&&typeof m=="string"&&!Ft(m))throw new An({address:m});const v=h.match(a3);if(v){const[_,x]=v;if(x&&jt(m)!==Number.parseInt(x,10))throw new Hx({expectedSize:Number.parseInt(x,10),givenSize:jt(m)})}const b=a[h];b&&(AM(h),c(b,m))}};if(a.EIP712Domain&&t){if(typeof t!="object")throw new CM({domain:t});c(a.EIP712Domain,t)}if(r!=="EIP712Domain")if(a[r])c(a[r],n);else throw new kM({primaryType:r,types:a})}function BC({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"||typeof(e==null?void 0:e.chainId)=="bigint")&&{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)}function AM(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new jM({type:e})}function EM(e){const{domain:t={},message:n,primaryType:r}=e,a={EIP712Domain:BC({domain:t}),...e.types};IC({domain:t,message:n,primaryType:r,types:a});const c=["0x1901"];return t&&c.push(NM({domain:t,types:a})),r!=="EIP712Domain"&&c.push(TC({data:n,primaryType:r,types:a})),cn(Rr(c))}function NM({domain:e,types:t}){return TC({data:e,primaryType:"EIP712Domain",types:t})}function TC({data:e,primaryType:t,types:n}){const r=PC({data:e,primaryType:t,types:n});return cn(r)}function PC({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],a=[MM({primaryType:t,types:n})];for(const c of n[t]){const[l,u]=LC({types:n,name:c.name,type:c.type,value:e[c.name]});r.push(l),a.push(u)}return Ii(r,a)}function MM({primaryType:e,types:t}){const n=nr(IM({primaryType:e,types:t}));return cn(n)}function IM({primaryType:e,types:t}){let n="";const r=RC({primaryType:e,types:t});r.delete(e);const a=[e,...Array.from(r).sort()];for(const c of a)n+=`${c}(${t[c].map(({name:l,type:u})=>`${u} ${l}`).join(",")})`;return n}function RC({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),a=r==null?void 0:r[0];if(n.has(a)||t[a]===void 0)return n;n.add(a);for(const c of t[a])RC({primaryType:c.type,types:t},n);return n}function LC({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},cn(PC({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},cn(r)];if(n==="string")return[{type:"bytes32"},cn(nr(r))];if(n.lastIndexOf("]")===n.length-1){const a=n.slice(0,n.lastIndexOf("[")),c=r.map(l=>LC({name:t,type:a,types:e,value:l}));return[{type:"bytes32"},cn(Ii(c.map(([l])=>l),c.map(([,l])=>l)))]}return[{type:n},r]}class BM extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const TM={checksum:new BM(8192)},Km=TM.checksum;class DC extends Sy{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,WA(t);const r=op(n);if(this.iHash=t.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 a=this.blockLen,c=new Uint8Array(a);c.set(r.length>a?t.create().update(r).digest():r);for(let l=0;l<c.length;l++)c[l]^=54;this.iHash.update(c),this.oHash=t.create();for(let l=0;l<c.length;l++)c[l]^=106;this.oHash.update(c),go(c)}update(t){return Jc(this),this.iHash.update(t),this}digestInto(t){Jc(this),mo(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:a,destroyed:c,blockLen:l,outputLen:u}=this;return t=t,t.finished=a,t.destroyed=c,t.blockLen=l,t.outputLen=u,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const OC=(e,t,n)=>new DC(e,t).update(n).digest();OC.create=(e,t)=>new DC(e,t);function FC(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=e3(uE(e));return n==="Bytes"?r:is(r)}const PM=/^0x[a-fA-F0-9]{40}$/;function Sp(e,t={}){const{strict:n=!0}=t;if(!PM.test(e))throw new E5({address:e,cause:new RM});if(n){if(e.toLowerCase()===e)return;if(zC(e)!==e)throw new E5({address:e,cause:new LM})}}function zC(e){if(Km.has(e))return Km.get(e);Sp(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=FC(fE(t),{as:"Bytes"}),r=t.split("");for(let c=0;c<40;c+=2)n[c>>1]>>4>=8&&r[c]&&(r[c]=r[c].toUpperCase()),(n[c>>1]&15)>=8&&r[c+1]&&(r[c+1]=r[c+1].toUpperCase());const a=`0x${r.join("")}`;return Km.set(e,a),a}function Ag(e,t={}){const{strict:n=!0}=t??{};try{return Sp(e,{strict:n}),!0}catch{return!1}}class E5 extends st{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class RM extends st{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class LM extends st{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const DM=/^(.*)\[([0-9]*)\]$/,OM=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,$C=/^(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)?$/,N5=2n**256n-1n;function Tc(e,t,n){const{checksumAddress:r,staticPosition:a}=n,c=lv(t.type);if(c){const[l,u]=c;return zM(e,{...t,type:u},{checksumAddress:r,length:l,staticPosition:a})}if(t.type==="tuple")return WM(e,t,{checksumAddress:r,staticPosition:a});if(t.type==="address")return FM(e,{checksum:r});if(t.type==="bool")return $M(e);if(t.type.startsWith("bytes"))return HM(e,t,{staticPosition:a});if(t.type.startsWith("uint")||t.type.startsWith("int"))return UM(e,t);if(t.type==="string")return VM(e,{staticPosition:a});throw new dv(t.type)}const M5=32,Eg=32;function FM(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(c=>n?zC(c):c)(is(pE(r,-20))),32]}function zM(e,t,n){const{checksumAddress:r,length:a,staticPosition:c}=n;if(!a){const d=ca(e.readBytes(Eg)),p=c+d,h=p+M5;e.setPosition(p);const m=ca(e.readBytes(M5)),g=Ju(t);let v=0;const b=[];for(let _=0;_<m;++_){e.setPosition(h+(g?_*32:v));const[x,j]=Tc(e,t,{checksumAddress:r,staticPosition:h});v+=j,b.push(x)}return e.setPosition(c+32),[b,32]}if(Ju(t)){const d=ca(e.readBytes(Eg)),p=c+d,h=[];for(let m=0;m<a;++m){e.setPosition(p+m*32);const[g]=Tc(e,t,{checksumAddress:r,staticPosition:p});h.push(g)}return e.setPosition(c+32),[h,32]}let l=0;const u=[];for(let d=0;d<a;++d){const[p,h]=Tc(e,t,{checksumAddress:r,staticPosition:c+l});l+=h,u.push(p)}return[u,l]}function $M(e){return[gE(e.readBytes(32),{size:32}),32]}function HM(e,t,{staticPosition:n}){const[r,a]=t.type.split("bytes");if(!a){const l=ca(e.readBytes(32));e.setPosition(n+l);const u=ca(e.readBytes(32));if(u===0)return e.setPosition(n+32),["0x",32];const d=e.readBytes(u);return e.setPosition(n+32),[is(d),32]}return[is(e.readBytes(Number.parseInt(a,10),32)),32]}function UM(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),a=e.readBytes(32);return[r>48?mE(a,{signed:n}):ca(a,{signed:n}),32]}function WM(e,t,n){const{checksumAddress:r,staticPosition:a}=n,c=t.components.length===0||t.components.some(({name:d})=>!d),l=c?[]:{};let u=0;if(Ju(t)){const d=ca(e.readBytes(Eg)),p=a+d;for(let h=0;h<t.components.length;++h){const m=t.components[h];e.setPosition(p+u);const[g,v]=Tc(e,m,{checksumAddress:r,staticPosition:p});u+=v,l[c?h:m==null?void 0:m.name]=g}return e.setPosition(a+32),[l,32]}for(let d=0;d<t.components.length;++d){const p=t.components[d],[h,m]=Tc(e,p,{checksumAddress:r,staticPosition:a});l[c?d:p==null?void 0:p.name]=h,u+=m}return[l,u]}function VM(e,{staticPosition:t}){const n=ca(e.readBytes(32)),r=t+n;e.setPosition(r);const a=ca(e.readBytes(32));if(a===0)return e.setPosition(t+32),["",32];const c=e.readBytes(a,32),l=yE(D3(c));return e.setPosition(t+32),[l,32]}function GM({checksumAddress:e,parameters:t,values:n}){const r=[];for(let a=0;a<t.length;a++)r.push(iv({checksumAddress:e,parameter:t[a],value:n[a]}));return r}function iv({checksumAddress:e=!1,parameter:t,value:n}){const r=t,a=lv(r.type);if(a){const[c,l]=a;return KM(n,{checksumAddress:e,length:c,parameter:{...r,type:l}})}if(r.type==="tuple")return ZM(n,{checksumAddress:e,parameter:r});if(r.type==="address")return qM(n,{checksum:e});if(r.type==="bool")return YM(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const c=r.type.startsWith("int"),[,,l="256"]=$C.exec(r.type)??[];return JM(n,{signed:c,size:Number(l)})}if(r.type.startsWith("bytes"))return QM(n,{type:r.type});if(r.type==="string")return XM(n);throw new dv(r.type)}function cv(e){let t=0;for(let c=0;c<e.length;c++){const{dynamic:l,encoded:u}=e[c];l?t+=32:t+=wr(u)}const n=[],r=[];let a=0;for(let c=0;c<e.length;c++){const{dynamic:l,encoded:u}=e[c];l?(n.push(Ln(t+a,{size:32})),r.push(u),a+=wr(u)):n.push(u)}return os(...n,...r)}function qM(e,t){const{checksum:n=!1}=t;return Sp(e,{strict:n}),{dynamic:!1,encoded:xi(e.toLowerCase())}}function KM(e,t){const{checksumAddress:n,length:r,parameter:a}=t,c=r===null;if(!Array.isArray(e))throw new cI(e);if(!c&&e.length!==r)throw new iI({expectedLength:r,givenLength:e.length,type:`${a.type}[${r}]`});let l=!1;const u=[];for(let d=0;d<e.length;d++){const p=iv({checksumAddress:n,parameter:a,value:e[d]});p.dynamic&&(l=!0),u.push(p)}if(c||l){const d=cv(u);if(c){const p=Ln(u.length,{size:32});return{dynamic:!0,encoded:u.length>0?os(p,d):p}}if(l)return{dynamic:!0,encoded:d}}return{dynamic:!1,encoded:os(...u.map(({encoded:d})=>d))}}function QM(e,{type:t}){const[,n]=t.split("bytes"),r=wr(e);if(!n){let a=e;return r%32!==0&&(a=Ci(a,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:os(xi(Ln(r,{size:32})),a)}}if(r!==Number.parseInt(n,10))throw new UC({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:Ci(e)}}function YM(e){if(typeof e!="boolean")throw new st(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:xi(O3(e))}}function JM(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,a=t?-r-1n:0n;if(e>r||e<a)throw new $3({max:r.toString(),min:a.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Ln(e,{size:32,signed:t})}}function XM(e){const t=Hy(e),n=Math.ceil(wr(t)/32),r=[];for(let a=0;a<n;a++)r.push(Ci(Ss(t,a*32,(a+1)*32)));return{dynamic:!0,encoded:os(Ci(Ln(wr(t),{size:32})),...r)}}function ZM(e,t){const{checksumAddress:n,parameter:r}=t;let a=!1;const c=[];for(let l=0;l<r.components.length;l++){const u=r.components[l],d=Array.isArray(e)?l:u.name,p=iv({checksumAddress:n,parameter:u,value:e[d]});c.push(p),p.dynamic&&(a=!0)}return{dynamic:a,encoded:a?cv(c):os(...c.map(({encoded:l})=>l))}}function lv(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Ju(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(Ju);const n=lv(e.type);return!!(n&&Ju({...e,type:n[1]}))}const eI={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 rI({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new nI({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new I5({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 I5({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 tI(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(eI);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class I5 extends st{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class nI extends st{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class rI extends st{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function sI(e,t,n={}){const{as:r="Array",checksumAddress:a=!1}=n,c=typeof t=="string"?L3(t):t,l=tI(c);if(Sc(c)===0&&e.length>0)throw new oI;if(Sc(c)&&Sc(c)<32)throw new aI({data:typeof t=="string"?t:is(t),parameters:e,size:Sc(c)});let u=0;const d=r==="Array"?[]:{};for(let p=0;p<e.length;++p){const h=e[p];l.setPosition(u);const[m,g]=Tc(l,h,{checksumAddress:a,staticPosition:0});u+=g,r==="Array"?d.push(m):d[h.name??p]=m}return d}function uv(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new WC({expectedLength:e.length,givenLength:t.length});const a=GM({checksumAddress:r,parameters:e,values:t}),c=cv(a);return c.length===0?"0x":c}function Ng(e,t){if(e.length!==t.length)throw new WC({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const a=e[r],c=t[r];n.push(Ng.encode(a,c))}return os(...n)}(function(e){function t(n,r,a=!1){if(n==="address"){const d=r;return Sp(d),xi(d.toLowerCase(),a?32:0)}if(n==="string")return Hy(r);if(n==="bytes")return r;if(n==="bool")return xi(O3(r),a?32:1);const c=n.match($C);if(c){const[d,p,h="256"]=c,m=Number.parseInt(h,10)/8;return Ln(r,{size:a?32:m,signed:p==="int"})}const l=n.match(OM);if(l){const[d,p]=l;if(Number.parseInt(p,10)!==(r.length-2)/2)throw new UC({expectedSize:Number.parseInt(p,10),value:r});return Ci(r,a?32:0)}const u=n.match(DM);if(u&&Array.isArray(r)){const[d,p]=u,h=[];for(let m=0;m<r.length;m++)h.push(t(p,r[m],!0));return h.length===0?"0x":os(...h)}throw new dv(n)}e.encode=t})(Ng||(Ng={}));function HC(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?o5(e):e}class aI extends st{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Cc(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class oI extends st{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class iI extends st{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class UC extends st{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${wr(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class WC extends st{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
1685
1685
  `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class cI extends st{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class dv extends st{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Zn=BigInt(0),Dn=BigInt(1),ai=BigInt(2),lI=BigInt(3),VC=BigInt(4),GC=BigInt(5),qC=BigInt(8);function Xn(e,t){const n=e%t;return n>=Zn?n:t+n}function Nr(e,t,n){let r=e;for(;t-- >Zn;)r*=r,r%=n;return r}function Mg(e,t){if(e===Zn)throw new Error("invert: expected non-zero number");if(t<=Zn)throw new Error("invert: expected positive modulus, got "+t);let n=Xn(e,t),r=t,a=Zn,c=Dn;for(;n!==Zn;){const u=r/n,d=r%n,p=a-c*u;r=n,n=d,a=c,c=p}if(r!==Dn)throw new Error("invert: does not exist");return Xn(a,t)}function KC(e,t){const n=(e.ORDER+Dn)/VC,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function uI(e,t){const n=(e.ORDER-GC)/qC,r=e.mul(t,ai),a=e.pow(r,n),c=e.mul(t,a),l=e.mul(e.mul(c,ai),a),u=e.mul(c,e.sub(l,e.ONE));if(!e.eql(e.sqr(u),t))throw new Error("Cannot find square root");return u}function dI(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-Dn,n=0;for(;t%ai===Zn;)t/=ai,n++;let r=ai;const a=fv(e);for(;B5(a,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return KC;let c=a.pow(r,t);const l=(t+Dn)/ai;return function(d,p){if(d.is0(p))return p;if(B5(d,p)!==1)throw new Error("Cannot find square root");let h=n,m=d.mul(d.ONE,c),g=d.pow(p,t),v=d.pow(p,l);for(;!d.eql(g,d.ONE);){if(d.is0(g))return d.ZERO;let b=1,_=d.sqr(g);for(;!d.eql(_,d.ONE);)if(b++,_=d.sqr(_),b===h)throw new Error("Cannot find square root");const x=Dn<<BigInt(h-b-1),j=d.pow(m,x);h=b,m=d.sqr(j),g=d.mul(g,m),v=d.mul(v,j)}return v}}function fI(e){return e%VC===lI?KC:e%qC===GC?uI:dI(e)}const hI=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function pI(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=hI.reduce((r,a)=>(r[a]="function",r),t);return gp(e,n)}function mI(e,t,n){if(n<Zn)throw new Error("invalid exponent, negatives unsupported");if(n===Zn)return e.ONE;if(n===Dn)return t;let r=e.ONE,a=t;for(;n>Zn;)n&Dn&&(r=e.mul(r,a)),a=e.sqr(a),n>>=Dn;return r}function QC(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),a=t.reduce((l,u,d)=>e.is0(u)?l:(r[d]=l,e.mul(l,u)),e.ONE),c=e.inv(a);return t.reduceRight((l,u,d)=>e.is0(u)?l:(r[d]=e.mul(l,r[d]),e.mul(l,u)),c),r}function B5(e,t){const n=(e.ORDER-Dn)/ai,r=e.pow(t,n),a=e.eql(r,e.ONE),c=e.eql(r,e.ZERO),l=e.eql(r,e.neg(e.ONE));if(!a&&!c&&!l)throw new Error("invalid Legendre symbol result");return a?1:c?0:-1}function YC(e,t){t!==void 0&&Su(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function fv(e,t,n=!1,r={}){if(e<=Zn)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:a,nByteLength:c}=YC(e,t);if(c>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let l;const u=Object.freeze({ORDER:e,isLE:n,BITS:a,BYTES:c,MASK:mp(a),ZERO:Zn,ONE:Dn,create:d=>Xn(d,e),isValid:d=>{if(typeof d!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof d);return Zn<=d&&d<e},is0:d=>d===Zn,isOdd:d=>(d&Dn)===Dn,neg:d=>Xn(-d,e),eql:(d,p)=>d===p,sqr:d=>Xn(d*d,e),add:(d,p)=>Xn(d+p,e),sub:(d,p)=>Xn(d-p,e),mul:(d,p)=>Xn(d*p,e),pow:(d,p)=>mI(u,d,p),div:(d,p)=>Xn(d*Mg(p,e),e),sqrN:d=>d*d,addN:(d,p)=>d+p,subN:(d,p)=>d-p,mulN:(d,p)=>d*p,inv:d=>Mg(d,e),sqrt:r.sqrt||(d=>(l||(l=fI(e)),l(u,d))),toBytes:d=>n?I3(d,c):_d(d,c),fromBytes:d=>{if(d.length!==c)throw new Error("Field.fromBytes: expected "+c+" bytes, got "+d.length);return n?M3(d):vi(d)},invertBatch:d=>QC(u,d),cmov:(d,p,h)=>h?p:d});return Object.freeze(u)}function JC(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function XC(e){const t=JC(e);return t+Math.ceil(t/2)}function gI(e,t,n=!1){const r=e.length,a=JC(t),c=XC(t);if(r<16||r<c||r>1024)throw new Error("expected "+c+"-1024 bytes of input, got "+r);const l=n?M3(e):vi(e),u=Xn(l,t-Dn)+Dn;return n?I3(u,a):_d(u,a)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const T5=BigInt(0),Ig=BigInt(1);function Qm(e,t){const n=t.negate();return e?n:t}function ZC(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Ym(e,t){ZC(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),a=2**e,c=mp(e),l=BigInt(e);return{windows:n,windowSize:r,mask:c,maxNumber:a,shiftBy:l}}function P5(e,t,n){const{windowSize:r,mask:a,maxNumber:c,shiftBy:l}=n;let u=Number(e&a),d=e>>l;u>r&&(u-=c,d+=Ig);const p=t*r,h=p+Math.abs(u)-1,m=u===0,g=u<0,v=t%2!==0;return{nextN:d,offset:h,isZero:m,isNeg:g,isNegF:v,offsetF:p}}function yI(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function vI(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const Jm=new WeakMap,ek=new WeakMap;function Xm(e){return ek.get(e)||1}function bI(e,t){return{constTimeNegate:Qm,hasPrecomputes(n){return Xm(n)!==1},unsafeLadder(n,r,a=e.ZERO){let c=n;for(;r>T5;)r&Ig&&(a=a.add(c)),c=c.double(),r>>=Ig;return a},precomputeWindow(n,r){const{windows:a,windowSize:c}=Ym(r,t),l=[];let u=n,d=u;for(let p=0;p<a;p++){d=u,l.push(d);for(let h=1;h<c;h++)d=d.add(u),l.push(d);u=d.double()}return l},wNAF(n,r,a){let c=e.ZERO,l=e.BASE;const u=Ym(n,t);for(let d=0;d<u.windows;d++){const{nextN:p,offset:h,isZero:m,isNeg:g,isNegF:v,offsetF:b}=P5(a,d,u);a=p,m?l=l.add(Qm(v,r[b])):c=c.add(Qm(g,r[h]))}return{p:c,f:l}},wNAFUnsafe(n,r,a,c=e.ZERO){const l=Ym(n,t);for(let u=0;u<l.windows&&a!==T5;u++){const{nextN:d,offset:p,isZero:h,isNeg:m}=P5(a,u,l);if(a=d,!h){const g=r[p];c=c.add(m?g.negate():g)}}return c},getPrecomputes(n,r,a){let c=Jm.get(r);return c||(c=this.precomputeWindow(r,n),n!==1&&Jm.set(r,a(c))),c},wNAFCached(n,r,a){const c=Xm(n);return this.wNAF(c,this.getPrecomputes(c,n,a),r)},wNAFCachedUnsafe(n,r,a,c){const l=Xm(n);return l===1?this.unsafeLadder(n,r,c):this.wNAFUnsafe(l,this.getPrecomputes(l,n,a),r,c)},setWindowSize(n,r){ZC(r,t),ek.set(n,r),Jm.delete(n)}}}function wI(e,t,n,r){yI(n,e),vI(r,t);const a=n.length,c=r.length;if(a!==c)throw new Error("arrays of points and scalars must have equal length");const l=e.ZERO,u=Z7(BigInt(a));let d=1;u>12?d=u-3:u>4?d=u-2:u>0&&(d=2);const p=mp(d),h=new Array(Number(p)+1).fill(l),m=Math.floor((t.BITS-1)/d)*d;let g=l;for(let v=m;v>=0;v-=d){h.fill(l);for(let _=0;_<c;_++){const x=r[_],j=Number(x>>BigInt(v)&p);h[j]=h[j].add(n[_])}let b=l;for(let _=h.length-1,x=l;_>0;_--)x=x.add(h[_]),b=b.add(x);if(g=g.add(b),v!==0)for(let _=0;_<d;_++)g=g.double()}return g}function tk(e){return pI(e.Fp),gp(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...YC(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function R5(e){e.lowS!==void 0&&qu("lowS",e.lowS),e.prehash!==void 0&&qu("prehash",e.prehash)}function _I(e){const t=tk(e);gp(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a}=t;if(n){if(!r.eql(a,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class xI extends Error{constructor(t=""){super(t)}}const ea={Err:xI,_tlv:{encode:(e,t)=>{const{Err:n}=ea;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,a=Xf(r);if(a.length/2&128)throw new n("tlv.encode: long form length too big");const c=r>127?Xf(a.length/2|128):"";return Xf(e)+c+a+t},decode(e,t){const{Err:n}=ea;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const a=t[r++],c=!!(a&128);let l=0;if(!c)l=a;else{const d=a&127;if(!d)throw new n("tlv.decode(long): indefinite length not supported");if(d>4)throw new n("tlv.decode(long): byte length is too big");const p=t.subarray(r,r+d);if(p.length!==d)throw new n("tlv.decode: length bytes not complete");if(p[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const h of p)l=l<<8|h;if(r+=d,l<128)throw new n("tlv.decode(long): not minimal encoding")}const u=t.subarray(r,r+l);if(u.length!==l)throw new n("tlv.decode: wrong value length");return{v:u,l:t.subarray(r+l)}}},_int:{encode(e){const{Err:t}=ea;if(e<aa)throw new t("integer: negative integers are not allowed");let n=Xf(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=ea;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return vi(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=ea,a=Mr("signature",e),{v:c,l}=r.decode(48,a);if(l.length)throw new t("invalid signature: left bytes after parsing");const{v:u,l:d}=r.decode(2,c),{v:p,l:h}=r.decode(2,d);if(h.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(u),s:n.decode(p)}},hexFromSig(e){const{_tlv:t,_int:n}=ea,r=t.encode(2,n.encode(e.r)),a=t.encode(2,n.encode(e.s)),c=r+a;return t.encode(48,c)}};function Zm(e,t){return Ku(_d(e,t))}const aa=BigInt(0),on=BigInt(1);BigInt(2);const e1=BigInt(3),CI=BigInt(4);function kI(e){const t=_I(e),{Fp:n}=t,r=fv(t.n,t.nBitLength),a=t.toBytes||((k,N,E)=>{const B=N.toAffine();return Oh(Uint8Array.from([4]),n.toBytes(B.x),n.toBytes(B.y))}),c=t.fromBytes||(k=>{const N=k.subarray(1),E=n.fromBytes(N.subarray(0,n.BYTES)),B=n.fromBytes(N.subarray(n.BYTES,2*n.BYTES));return{x:E,y:B}});function l(k){const{a:N,b:E}=t,B=n.sqr(k),M=n.mul(B,k);return n.add(n.add(M,n.mul(k,N)),E)}function u(k,N){const E=n.sqr(N),B=l(k);return n.eql(E,B)}if(!u(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const d=n.mul(n.pow(t.a,e1),CI),p=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(d,p)))throw new Error("bad curve params: a or b");function h(k){return $y(k,on,t.n)}function m(k){const{allowedPrivateKeyLengths:N,nByteLength:E,wrapPrivateKey:B,n:M}=t;if(N&&typeof k!="bigint"){if(wd(k)&&(k=Ku(k)),typeof k!="string"||!N.includes(k.length))throw new Error("invalid private key");k=k.padStart(E*2,"0")}let P;try{P=typeof k=="bigint"?k:vi(Mr("private key",k,E))}catch{throw new Error("invalid private key, expected hex or "+E+" bytes, got "+typeof k)}return B&&(P=Xn(P,M)),Bc("private key",P,on,M),P}function g(k){if(!(k instanceof _))throw new Error("ProjectivePoint expected")}const v=h5((k,N)=>{const{px:E,py:B,pz:M}=k;if(n.eql(M,n.ONE))return{x:E,y:B};const P=k.is0();N==null&&(N=P?n.ONE:n.inv(M));const R=n.mul(E,N),z=n.mul(B,N),q=n.mul(M,N);if(P)return{x:n.ZERO,y:n.ZERO};if(!n.eql(q,n.ONE))throw new Error("invZ was invalid");return{x:R,y:z}}),b=h5(k=>{if(k.is0()){if(t.allowInfinityPoint&&!n.is0(k.py))return;throw new Error("bad point: ZERO")}const{x:N,y:E}=k.toAffine();if(!n.isValid(N)||!n.isValid(E))throw new Error("bad point: x or y not FE");if(!u(N,E))throw new Error("bad point: equation left != right");if(!k.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class _{constructor(N,E,B){if(N==null||!n.isValid(N))throw new Error("x required");if(E==null||!n.isValid(E)||n.is0(E))throw new Error("y required");if(B==null||!n.isValid(B))throw new Error("z required");this.px=N,this.py=E,this.pz=B,Object.freeze(this)}static fromAffine(N){const{x:E,y:B}=N||{};if(!N||!n.isValid(E)||!n.isValid(B))throw new Error("invalid affine point");if(N instanceof _)throw new Error("projective point not allowed");const M=P=>n.eql(P,n.ZERO);return M(E)&&M(B)?_.ZERO:new _(E,B,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(N){const E=QC(n,N.map(B=>B.pz));return N.map((B,M)=>B.toAffine(E[M])).map(_.fromAffine)}static fromHex(N){const E=_.fromAffine(c(Mr("pointHex",N)));return E.assertValidity(),E}static fromPrivateKey(N){return _.BASE.multiply(m(N))}static msm(N,E){return wI(_,r,N,E)}_setWindowSize(N){A.setWindowSize(this,N)}assertValidity(){b(this)}hasEvenY(){const{y:N}=this.toAffine();if(n.isOdd)return!n.isOdd(N);throw new Error("Field doesn't support isOdd")}equals(N){g(N);const{px:E,py:B,pz:M}=this,{px:P,py:R,pz:z}=N,q=n.eql(n.mul(E,z),n.mul(P,M)),Q=n.eql(n.mul(B,z),n.mul(R,M));return q&&Q}negate(){return new _(this.px,n.neg(this.py),this.pz)}double(){const{a:N,b:E}=t,B=n.mul(E,e1),{px:M,py:P,pz:R}=this;let z=n.ZERO,q=n.ZERO,Q=n.ZERO,O=n.mul(M,M),K=n.mul(P,P),$=n.mul(R,R),L=n.mul(M,P);return L=n.add(L,L),Q=n.mul(M,R),Q=n.add(Q,Q),z=n.mul(N,Q),q=n.mul(B,$),q=n.add(z,q),z=n.sub(K,q),q=n.add(K,q),q=n.mul(z,q),z=n.mul(L,z),Q=n.mul(B,Q),$=n.mul(N,$),L=n.sub(O,$),L=n.mul(N,L),L=n.add(L,Q),Q=n.add(O,O),O=n.add(Q,O),O=n.add(O,$),O=n.mul(O,L),q=n.add(q,O),$=n.mul(P,R),$=n.add($,$),O=n.mul($,L),z=n.sub(z,O),Q=n.mul($,K),Q=n.add(Q,Q),Q=n.add(Q,Q),new _(z,q,Q)}add(N){g(N);const{px:E,py:B,pz:M}=this,{px:P,py:R,pz:z}=N;let q=n.ZERO,Q=n.ZERO,O=n.ZERO;const K=t.a,$=n.mul(t.b,e1);let L=n.mul(E,P),se=n.mul(B,R),D=n.mul(M,z),X=n.add(E,B),te=n.add(P,R);X=n.mul(X,te),te=n.add(L,se),X=n.sub(X,te),te=n.add(E,M);let W=n.add(P,z);return te=n.mul(te,W),W=n.add(L,D),te=n.sub(te,W),W=n.add(B,M),q=n.add(R,z),W=n.mul(W,q),q=n.add(se,D),W=n.sub(W,q),O=n.mul(K,te),q=n.mul($,D),O=n.add(q,O),q=n.sub(se,O),O=n.add(se,O),Q=n.mul(q,O),se=n.add(L,L),se=n.add(se,L),D=n.mul(K,D),te=n.mul($,te),se=n.add(se,D),D=n.sub(L,D),D=n.mul(K,D),te=n.add(te,D),L=n.mul(se,te),Q=n.add(Q,L),L=n.mul(W,te),q=n.mul(X,q),q=n.sub(q,L),L=n.mul(X,se),O=n.mul(W,O),O=n.add(O,L),new _(q,Q,O)}subtract(N){return this.add(N.negate())}is0(){return this.equals(_.ZERO)}wNAF(N){return A.wNAFCached(this,N,_.normalizeZ)}multiplyUnsafe(N){const{endo:E,n:B}=t;Bc("scalar",N,aa,B);const M=_.ZERO;if(N===aa)return M;if(this.is0()||N===on)return this;if(!E||A.hasPrecomputes(this))return A.wNAFCachedUnsafe(this,N,_.normalizeZ);let{k1neg:P,k1:R,k2neg:z,k2:q}=E.splitScalar(N),Q=M,O=M,K=this;for(;R>aa||q>aa;)R&on&&(Q=Q.add(K)),q&on&&(O=O.add(K)),K=K.double(),R>>=on,q>>=on;return P&&(Q=Q.negate()),z&&(O=O.negate()),O=new _(n.mul(O.px,E.beta),O.py,O.pz),Q.add(O)}multiply(N){const{endo:E,n:B}=t;Bc("scalar",N,on,B);let M,P;if(E){const{k1neg:R,k1:z,k2neg:q,k2:Q}=E.splitScalar(N);let{p:O,f:K}=this.wNAF(z),{p:$,f:L}=this.wNAF(Q);O=A.constTimeNegate(R,O),$=A.constTimeNegate(q,$),$=new _(n.mul($.px,E.beta),$.py,$.pz),M=O.add($),P=K.add(L)}else{const{p:R,f:z}=this.wNAF(N);M=R,P=z}return _.normalizeZ([M,P])[0]}multiplyAndAddUnsafe(N,E,B){const M=_.BASE,P=(z,q)=>q===aa||q===on||!z.equals(M)?z.multiplyUnsafe(q):z.multiply(q),R=P(this,E).add(P(N,B));return R.is0()?void 0:R}toAffine(N){return v(this,N)}isTorsionFree(){const{h:N,isTorsionFree:E}=t;if(N===on)return!0;if(E)return E(_,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:N,clearCofactor:E}=t;return N===on?this:E?E(_,this):this.multiplyUnsafe(t.h)}toRawBytes(N=!0){return qu("isCompressed",N),this.assertValidity(),a(_,this,N)}toHex(N=!0){return qu("isCompressed",N),Ku(this.toRawBytes(N))}}_.BASE=new _(t.Gx,t.Gy,n.ONE),_.ZERO=new _(n.ZERO,n.ONE,n.ZERO);const{endo:x,nBitLength:j}=t,A=bI(_,x?Math.ceil(j/2):j);return{CURVE:t,ProjectivePoint:_,normPrivateKeyToScalar:m,weierstrassEquation:l,isWithinCurveOrder:h}}function jI(e){const t=tk(e);return gp(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function SI(e){const t=jI(e),{Fp:n,n:r,nByteLength:a,nBitLength:c}=t,l=n.BYTES+1,u=2*n.BYTES+1;function d($){return Xn($,r)}function p($){return Mg($,r)}const{ProjectivePoint:h,normPrivateKeyToScalar:m,weierstrassEquation:g,isWithinCurveOrder:v}=kI({...t,toBytes($,L,se){const D=L.toAffine(),X=n.toBytes(D.x),te=Oh;return qu("isCompressed",se),se?te(Uint8Array.from([L.hasEvenY()?2:3]),X):te(Uint8Array.from([4]),X,n.toBytes(D.y))},fromBytes($){const L=$.length,se=$[0],D=$.subarray(1);if(L===l&&(se===2||se===3)){const X=vi(D);if(!$y(X,on,n.ORDER))throw new Error("Point is not on curve");const te=g(X);let W;try{W=n.sqrt(te)}catch(Y){const ue=Y instanceof Error?": "+Y.message:"";throw new Error("Point is not on curve"+ue)}const oe=(W&on)===on;return(se&1)===1!==oe&&(W=n.neg(W)),{x:X,y:W}}else if(L===u&&se===4){const X=n.fromBytes(D.subarray(0,n.BYTES)),te=n.fromBytes(D.subarray(n.BYTES,2*n.BYTES));return{x:X,y:te}}else{const X=l,te=u;throw new Error("invalid Point, expected length of "+X+", or uncompressed "+te+", got "+L)}}});function b($){const L=r>>on;return $>L}function _($){return b($)?d(-$):$}const x=($,L,se)=>vi($.slice(L,se));class j{constructor(L,se,D){Bc("r",L,on,r),Bc("s",se,on,r),this.r=L,this.s=se,D!=null&&(this.recovery=D),Object.freeze(this)}static fromCompact(L){const se=a;return L=Mr("compactSignature",L,se*2),new j(x(L,0,se),x(L,se,2*se))}static fromDER(L){const{r:se,s:D}=ea.toSig(Mr("DER",L));return new j(se,D)}assertValidity(){}addRecoveryBit(L){return new j(this.r,this.s,L)}recoverPublicKey(L){const{r:se,s:D,recovery:X}=this,te=M(Mr("msgHash",L));if(X==null||![0,1,2,3].includes(X))throw new Error("recovery id invalid");const W=X===2||X===3?se+t.n:se;if(W>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const oe=(X&1)===0?"02":"03",be=h.fromHex(oe+Zm(W,n.BYTES)),Y=p(W),ue=d(-te*Y),xe=d(D*Y),Re=h.BASE.multiplyAndAddUnsafe(be,ue,xe);if(!Re)throw new Error("point at infinify");return Re.assertValidity(),Re}hasHighS(){return b(this.s)}normalizeS(){return this.hasHighS()?new j(this.r,d(-this.s),this.recovery):this}toDERRawBytes(){return Dh(this.toDERHex())}toDERHex(){return ea.hexFromSig(this)}toCompactRawBytes(){return Dh(this.toCompactHex())}toCompactHex(){const L=a;return Zm(this.r,L)+Zm(this.s,L)}}const A={isValidPrivateKey($){try{return m($),!0}catch{return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{const $=XC(t.n);return gI(t.randomBytes($),t.n)},precompute($=8,L=h.BASE){return L._setWindowSize($),L.multiply(BigInt(3)),L}};function k($,L=!0){return h.fromPrivateKey($).toRawBytes(L)}function N($){if(typeof $=="bigint")return!1;if($ instanceof h)return!0;const se=Mr("key",$).length,D=n.BYTES,X=D+1,te=2*D+1;if(!(t.allowedPrivateKeyLengths||a===X))return se===X||se===te}function E($,L,se=!0){if(N($)===!0)throw new Error("first arg must be private key");if(N(L)===!1)throw new Error("second arg must be public key");return h.fromHex(L).multiply(m($)).toRawBytes(se)}const B=t.bits2int||function($){if($.length>8192)throw new Error("input is too large");const L=vi($),se=$.length*8-c;return se>0?L>>BigInt(se):L},M=t.bits2int_modN||function($){return d(B($))},P=mp(c);function R($){return Bc("num < 2^"+c,$,aa,P),_d($,a)}function z($,L,se=q){if(["recovered","canonical"].some(qe=>qe in se))throw new Error("sign() legacy options not supported");const{hash:D,randomBytes:X}=t;let{lowS:te,prehash:W,extraEntropy:oe}=se;te==null&&(te=!0),$=Mr("msgHash",$),R5(se),W&&($=Mr("prehashed msgHash",D($)));const be=M($),Y=m(L),ue=[R(Y),R(be)];if(oe!=null&&oe!==!1){const qe=oe===!0?X(n.BYTES):oe;ue.push(Mr("extraEntropy",qe))}const xe=Oh(...ue),Re=be;function Ae(qe){const Xe=B(qe);if(!v(Xe))return;const Tt=p(Xe),zt=h.BASE.multiply(Xe).toAffine(),Qt=d(zt.x);if(Qt===aa)return;const $t=d(Tt*d(Re+Qt*Y));if($t===aa)return;let yt=(zt.x===Qt?0:2)|Number(zt.y&on),dn=$t;return te&&b($t)&&(dn=_($t),yt^=1),new j(Qt,dn,yt)}return{seed:xe,k2sig:Ae}}const q={lowS:t.lowS,prehash:!1},Q={lowS:t.lowS,prehash:!1};function O($,L,se=q){const{seed:D,k2sig:X}=z($,L,se),te=t;return eE(te.hash.outputLen,te.nByteLength,te.hmac)(D,X)}h.BASE._setWindowSize(8);function K($,L,se,D=Q){var yt;const X=$;L=Mr("msgHash",L),se=Mr("publicKey",se);const{lowS:te,prehash:W,format:oe}=D;if(R5(D),"strict"in D)throw new Error("options.strict was renamed to lowS");if(oe!==void 0&&oe!=="compact"&&oe!=="der")throw new Error("format must be compact or der");const be=typeof X=="string"||wd(X),Y=!be&&!oe&&typeof X=="object"&&X!==null&&typeof X.r=="bigint"&&typeof X.s=="bigint";if(!be&&!Y)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let ue,xe;try{if(Y&&(ue=new j(X.r,X.s)),be){try{oe!=="compact"&&(ue=j.fromDER(X))}catch(dn){if(!(dn instanceof ea.Err))throw dn}!ue&&oe!=="der"&&(ue=j.fromCompact(X))}xe=h.fromHex(se)}catch{return!1}if(!ue||te&&ue.hasHighS())return!1;W&&(L=t.hash(L));const{r:Re,s:Ae}=ue,qe=M(L),Xe=p(Ae),Tt=d(qe*Xe),zt=d(Re*Xe),Qt=(yt=h.BASE.multiplyAndAddUnsafe(xe,Tt,zt))==null?void 0:yt.toAffine();return Qt?d(Qt.x)===Re:!1}return{CURVE:t,getPublicKey:k,getSharedSecret:E,sign:O,verify:K,ProjectivePoint:h,Signature:j,utils:A}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function AI(e){return{hash:e,hmac:(t,...n)=>OC(e,t,JA(...n)),randomBytes:XA}}function EI(e,t){const n=r=>SI({...e,...AI(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const nk=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),L5=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),NI=BigInt(0),MI=BigInt(1),Bg=BigInt(2),D5=(e,t)=>(e+t/Bg)/t;function II(e){const t=nk,n=BigInt(3),r=BigInt(6),a=BigInt(11),c=BigInt(22),l=BigInt(23),u=BigInt(44),d=BigInt(88),p=e*e*e%t,h=p*p*e%t,m=Nr(h,n,t)*h%t,g=Nr(m,n,t)*h%t,v=Nr(g,Bg,t)*p%t,b=Nr(v,a,t)*v%t,_=Nr(b,c,t)*b%t,x=Nr(_,u,t)*_%t,j=Nr(x,d,t)*x%t,A=Nr(j,u,t)*_%t,k=Nr(A,n,t)*h%t,N=Nr(k,l,t)*b%t,E=Nr(N,r,t)*p%t,B=Nr(E,Bg,t);if(!Tg.eql(Tg.sqr(B),e))throw new Error("Cannot find square root");return B}const Tg=fv(nk,void 0,void 0,{sqrt:II}),rk=EI({a:NI,b:BigInt(7),Fp:Tg,n:L5,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=L5,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-MI*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),a=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),c=n,l=BigInt("0x100000000000000000000000000000000"),u=D5(c*e,t),d=D5(-r*e,t);let p=Xn(e-u*n-d*a,t),h=Xn(-u*r-d*c,t);const m=p>l,g=h>l;if(m&&(p=t-p),g&&(h=t-h),p>l||h>l)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:m,k1:p,k2neg:g,k2:h}}}},pC),BI=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:rk},Symbol.toStringTag,{value:"Module"}));function sk(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new t1({signature:e});if(typeof e.s>"u")throw new t1({signature:e});if(n&&typeof e.yParity>"u")throw new t1({signature:e});if(e.r<0n||e.r>N5)throw new FI({value:e.r});if(e.s<0n||e.s>N5)throw new zI({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new pv({value:e.yParity})}function TI(e){return ak(is(e))}function ak(e){if(e.length!==130&&e.length!==132)throw new OI({signature:e});const t=BigInt(Ss(e,0,32)),n=BigInt(Ss(e,32,64)),r=(()=>{const a=+`0x${e.slice(130)}`;if(!Number.isNaN(a))try{return hv(a)}catch{throw new pv({value:a})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function PI(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return RI(e)}function RI(e){const t=typeof e=="string"?ak(e):e instanceof Uint8Array?TI(e):typeof e.r=="string"?DI(e):e.v?LI(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return sk(t),t}function LI(e){return{r:e.r,s:e.s,yParity:hv(e.v)}}function DI(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=hv(n)),typeof r!="number")throw new pv({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function hv(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new $I({value:e})}class OI extends st{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${wr(jE(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class t1 extends st{constructor({signature:t}){super(`Signature \`${R3(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class FI extends st{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class zI extends st{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class pv extends st{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class $I extends st{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function HI(e,t={}){return typeof e.chainId=="string"?UI(e):{...e,...t.signature}}function UI(e){const{address:t,chainId:n,nonce:r}=e,a=PI(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...a}}const WI="0x8010801080108010801080108010801080108010801080108010801080108010",VI=HC("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function ok(e){if(typeof e=="string"){if(Ss(e,-32)!==WI)throw new KI(e)}else sk(e.authorization)}function GI(e){ok(e);const t=z3(Ss(e,-64,-32)),n=Ss(e,-t-64,-64),r=Ss(e,0,-t-64),[a,c,l]=sI(VI,n);return{authorization:HI({address:a.delegation,chainId:Number(a.chainId),nonce:a.nonce,yParity:a.yParity,r:a.r,s:a.s}),signature:r,...l&&l!=="0x"?{data:l,to:c}:{}}}function qI(e){try{return ok(e),!0}catch{return!1}}let KI=class extends st{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};class QI extends le{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function YI(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new QI({value:e});let[n,r="0"]=e.split(".");const a=n.startsWith("-");if(a&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[c,l,u]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],d=Math.round(+`${l}.${u}`);d>9?r=`${BigInt(c)+BigInt(1)}0`.padStart(c.length+1,"0"):r=`${c}${d}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${a?"-":""}${n}${r}`)}function JI(e,t="wei"){return YI(e,C3[t])}function XI(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function ZI(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Tr(e.nonce):void 0,storageProof:e.storageProof?XI(e.storageProof):void 0}}async function eB(e,{address:t,blockHash:n,blockNumber:r,blockTag:a="latest",requireCanonical:c,storageKeys:l}){const u=Ti({blockHash:n,blockNumber:r,blockTag:a,requireCanonical:c}),d=await e.request({method:"eth_getProof",params:[t,l,u]});return ZI(d)}async function tB(e,{address:t,blockHash:n,blockNumber:r,blockTag:a="latest",requireCanonical:c,slot:l}){const u=Ti({blockHash:n,blockNumber:r,blockTag:a,requireCanonical:c});return await e.request({method:"eth_getStorageAt",params:[t,l,u]})}async function Ap(e,{blockHash:t,blockNumber:n,blockTag:r,hash:a,index:c,sender:l,nonce:u}){var g,v,b;const d=r||"latest",p=n!==void 0?we(n):void 0;let h=null;if(a?h=await e.request({method:"eth_getTransactionByHash",params:[a]},{dedupe:!0}):t?h=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,we(c)]},{dedupe:!0}):typeof c=="number"?h=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[p||d,we(c)]},{dedupe:!!p}):l&&typeof u=="number"&&(h=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[l,we(u)]},{dedupe:!0})),!h)throw new k3({blockHash:t,blockNumber:n,blockTag:d,hash:a,index:c});return(((b=(v=(g=e.chain)==null?void 0:g.formatters)==null?void 0:v.transaction)==null?void 0:b.format)||Sd)(h,"getTransaction")}async function nB(e,{hash:t,transactionReceipt:n}){const[r,a]=await Promise.all([Ue(e,Ad,"getBlockNumber")({}),t?Ue(e,Ap,"getTransaction")({hash:t}):void 0]),c=(n==null?void 0:n.blockNumber)||(a==null?void 0:a.blockNumber);return c?r-c+1n:0n}async function kh(e,{hash:t}){var a,c,l;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new j3({hash:t});return(((l=(c=(a=e.chain)==null?void 0:a.formatters)==null?void 0:c.transactionReceipt)==null?void 0:l.format)||_p)(n,"getTransactionReceipt")}async function ik(e,t){var N;const{account:n,authorizationList:r,allowFailure:a=!0,blockHash:c,blockNumber:l,blockOverrides:u,blockTag:d,requireCanonical:p,stateOverride:h}=t,m=t.contracts,{batchSize:g=t.batchSize??1024,deployless:v=t.deployless??!1}=typeof((N=e.batch)==null?void 0:N.multicall)=="object"?e.batch.multicall:{},b=(()=>{if(t.multicallAddress)return t.multicallAddress;if(v)return null;if(e.chain)return ll({blockNumber:l,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),_=[[]];let x=0,j=0;for(let E=0;E<m.length;E++){const{abi:B,address:M,args:P,functionName:R}=m[E];try{const z=At({abi:B,args:P,functionName:R});j+=(z.length-2)/2,g>0&&j>g&&_[x].length>0&&(x++,j=(z.length-2)/2,_[x]=[]),_[x]=[..._[x],{allowFailure:!0,callData:z,target:M}]}catch(z){const q=Zc(z,{abi:B,address:M,args:P,docsPath:"/docs/contract/multicall",functionName:R,sender:n});if(!a)throw q;_[x]=[..._[x],{allowFailure:!0,callData:"0x",target:M}]}}const A=await Promise.allSettled(_.map(E=>Ue(e,Lr,"readContract")({...b===null?{code:Uy}:{address:b},abi:Qc,account:n,args:[E],authorizationList:r,blockHash:c,blockNumber:l,blockOverrides:u,blockTag:d,functionName:"aggregate3",requireCanonical:p,stateOverride:h}))),k=[];for(let E=0;E<A.length;E++){const B=A[E];if(B.status==="rejected"){if(!a)throw B.reason;for(let P=0;P<_[E].length;P++)k.push({status:"failure",error:B.reason,result:void 0});continue}const M=B.value;for(let P=0;P<M.length;P++){const{returnData:R,success:z}=M[P],{callData:q}=_[E][P],{abi:Q,address:O,functionName:K,args:$}=m[k.length];try{if(q==="0x")throw new md;if(!z)throw new hp({data:R});const L=ko({abi:Q,args:$,data:R,functionName:K});k.push(a?{result:L,status:"success"}:L)}catch(L){const se=Zc(L,{abi:Q,address:O,args:$,docsPath:"/docs/contract/multicall",functionName:K});if(!a)throw se;k.push({error:se,result:void 0,status:"failure"})}}}if(k.length!==m.length)throw new le("multicall results mismatch");return k}async function Pg(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:a,returnFullTransactions:c,traceTransfers:l,validation:u}=t;try{const d=[];for(const g of a){const v=g.blockOverrides?U3(g.blockOverrides):void 0,b=g.calls.map(x=>{const j=x,A=j.account?mn(j.account):void 0,k=j.abi?At(j):j.data,N={...j,account:A,data:j.dataSuffix?Rr([k||"0x",j.dataSuffix]):k,from:j.from??(A==null?void 0:A.address)};return Pi(N),dl(N)}),_=g.stateOverrides?Gy(g.stateOverrides):void 0;d.push({blockOverrides:v,calls:b,stateOverrides:_})}const h=(typeof n=="bigint"?we(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:d,returnFullTransactions:c,traceTransfers:l,validation:u},h]})).map((g,v)=>({...Xy(g),calls:g.calls.map((b,_)=>{var z,q;const{abi:x,args:j,functionName:A,to:k}=a[v].calls[_],N=((z=b.error)==null?void 0:z.data)??b.returnData,E=BigInt(b.gasUsed),B=(q=b.logs)==null?void 0:q.map(Q=>Ns(Q)),M=b.status==="0x1"?"success":"failure",P=x&&M==="success"&&N!=="0x"?ko({abi:x,data:N,functionName:A}):null,R=(()=>{if(M==="success")return;let Q;if(N==="0x"?Q=new md:N&&(Q=new hp({data:N})),!!Q)return Zc(Q,{abi:x??[],address:k??"0x",args:j,functionName:A??"<unknown>"})})();return{data:N,gasUsed:E,logs:B,status:M,...M==="success"?{result:P}:{error:R}}})}))}catch(d){const p=d,h=vp(p,{});throw h instanceof Cd?p:h}}function Rg(e){let t=!0,n="",r=0,a="",c=!1;for(let l=0;l<e.length;l++){const u=e[l];if(["(",")",","].includes(u)&&(t=!0),u==="("&&r++,u===")"&&r--,!!t){if(r===0){if(u===" "&&["event","function","error",""].includes(a))a="";else if(a+=u,u===")"){c=!0;break}continue}if(u===" "){e[l-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}a+=u,n+=u}}if(!c)throw new st("Unable to normalize signature.");return a}function Lg(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Ag(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((a,c)=>Lg(Object.values(e)[c],a)):/^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(a=>Lg(a,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function ck(e,t,n){for(const r in e){const a=e[r],c=t[r];if(a.type==="tuple"&&c.type==="tuple"&&"components"in a&&"components"in c)return ck(a.components,c.components,n[r]);const l=[a.type,c.type];if(l.includes("address")&&l.includes("bytes20")?!0:l.includes("address")&&l.includes("string")?Ag(n[r],{strict:!1}):l.includes("address")&&l.includes("bytes")?Ag(n[r],{strict:!1}):!1)return l}}function lk(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?a5(e):e;return{...r,...n?{hash:Ec(r)}:{}}}function Ep(e,t,n){const{args:r=[],prepare:a=!0}=n??{},c=SE(t,{strict:!1}),l=e.filter(p=>c?p.type==="function"||p.type==="error"?uk(p)===Ss(t,0,4):p.type==="event"?Ec(p)===t:!1:"name"in p&&p.name===t);if(l.length===0)throw new $h({name:t});if(l.length===1)return{...l[0],...a?{hash:Ec(l[0])}:{}};let u;for(const p of l){if(!("inputs"in p))continue;if(!r||r.length===0){if(!p.inputs||p.inputs.length===0)return{...p,...a?{hash:Ec(p)}:{}};continue}if(!p.inputs||p.inputs.length===0||p.inputs.length!==r.length)continue;if(r.every((m,g)=>{const v="inputs"in p&&p.inputs[g];return v?Lg(m,v):!1})){if(u&&"inputs"in u&&u.inputs){const m=ck(p.inputs,u.inputs,r);if(m)throw new sB({abiItem:p,type:m[0]},{abiItem:u,type:m[1]})}u=p}}const d=(()=>{if(u)return u;const[p,...h]=l;return{...p,overloads:h}})();if(!d)throw new $h({name:t});return{...d,...a?{hash:Ec(d)}:{}}}function uk(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Ep(n,r)}return e[0]})();return Ss(Ec(t),0,4)}function rB(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,a]=e;return Ep(r,a)}return e[0]})(),n=typeof t=="string"?t:Lh(t);return Rg(n)}function Ec(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Ep(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:FC(Hy(rB(t)))}class sB extends st{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${Rg(Lh(t.abiItem))}\`, and`,`\`${n.type}\` in \`${Rg(Lh(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class $h extends st{constructor({name:t,data:n,type:r="item"}){const a=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${a} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function aB(...e){var c;const[t,n]=(()=>{if(Array.isArray(e[0])){const[l,u]=e;return[iB(l),u]}return e})(),{bytecode:r,args:a}=n;return os(r,(c=t.inputs)!=null&&c.length&&(a!=null&&a.length)?uv(t.inputs,a):"0x")}function oB(e){return lk(e)}function iB(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new $h({name:"constructor"});return t}function cB(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[p,h,m]=e;return[O5(p,h,{args:m}),m]}const[u,d]=e;return[u,d]})(),{overloads:r}=t,a=r?O5([t,...r],t.name,{args:n}):t,c=lB(a),l=n.length>0?uv(a.inputs,n):void 0;return l?os(c,l):c}function fc(e,t={}){return lk(e,t)}function O5(e,t,n){const r=Ep(e,t,n);if(r.type!=="function")throw new $h({name:t,type:"function"});return r}function lB(e){return uk(e)}const uB="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Bt="0x0000000000000000000000000000000000000000",dB="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function fB(e,t){const{blockNumber:n,blockTag:r,calls:a,stateOverrides:c,traceAssetChanges:l,traceTransfers:u,validation:d}=t,p=t.account?mn(t.account):void 0;if(l&&!p)throw new le("`account` is required when `traceAssetChanges` is true");const h=p?aB(oB("constructor(bytes, bytes)"),{bytecode:W3,args:[dB,cB(fc("function getBalance(address)"),[p.address])]}):void 0,m=l?await Promise.all(t.calls.map(async D=>{if(!D.data&&!D.abi)return;const{accessList:X}=await tC(e,{account:p.address,...D,data:D.abi?At(D):D.data});return X.map(({address:te,storageKeys:W})=>W.length>0?te:null)})).then(D=>D.flat().filter(Boolean)):[],g=await Pg(e,{blockNumber:n,blockTag:r,blocks:[...l?[{calls:[{data:h}],stateOverrides:c},{calls:m.map((D,X)=>({abi:[fc("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[p.address],to:D,from:Bt,nonce:X})),stateOverrides:[{address:Bt,nonce:0}]}]:[],{calls:[...a,{to:Bt}].map(D=>({...D,from:p==null?void 0:p.address})),stateOverrides:c},...l?[{calls:[{data:h}]},{calls:m.map((D,X)=>({abi:[fc("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[p.address],to:D,from:Bt,nonce:X})),stateOverrides:[{address:Bt,nonce:0}]},{calls:m.map((D,X)=>({to:D,abi:[fc("function decimals() returns (uint256)")],functionName:"decimals",from:Bt,nonce:X})),stateOverrides:[{address:Bt,nonce:0}]},{calls:m.map((D,X)=>({to:D,abi:[fc("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Bt,nonce:X})),stateOverrides:[{address:Bt,nonce:0}]},{calls:m.map((D,X)=>({to:D,abi:[fc("function symbol() returns (string)")],functionName:"symbol",from:Bt,nonce:X})),stateOverrides:[{address:Bt,nonce:0}]}]:[]],traceTransfers:u,validation:d}),v=l?g[2]:g[0],[b,_,,x,j,A,k,N]=l?g:[],{calls:E,...B}=v,M=E.slice(0,-1)??[],P=(b==null?void 0:b.calls)??[],R=(_==null?void 0:_.calls)??[],z=[...P,...R].map(D=>D.status==="success"?jn(D.data):null),q=(x==null?void 0:x.calls)??[],Q=(j==null?void 0:j.calls)??[],O=[...q,...Q].map(D=>D.status==="success"?jn(D.data):null),K=((A==null?void 0:A.calls)??[]).map(D=>D.status==="success"?D.result:null),$=((N==null?void 0:N.calls)??[]).map(D=>D.status==="success"?D.result:null),L=((k==null?void 0:k.calls)??[]).map(D=>D.status==="success"?D.result:null),se=[];for(const[D,X]of O.entries()){const te=z[D];if(typeof X!="bigint"||typeof te!="bigint")continue;const W=K[D-1],oe=$[D-1],be=L[D-1],Y=D===0?{address:uB,decimals:18,symbol:"ETH"}:{address:m[D-1],decimals:be||W?Number(W??1):void 0,symbol:oe??void 0};se.some(ue=>ue.token.address===Y.address)||se.push({token:Y,value:{pre:te,post:X,diff:X-te}})}return{assetChanges:se,block:B,results:M}}async function hB(e,t){var h;const{abi:n,address:r,args:a,functionName:c,dataSuffix:l=typeof e.dataSuffix=="string"?e.dataSuffix:(h=e.dataSuffix)==null?void 0:h.value,...u}=t,d=u.account?mn(u.account):e.account,p=At({abi:n,args:a,functionName:c});try{const{data:m}=await Ue(e,fl,"call")({batch:!1,data:`${p}${l?l.replace("0x",""):""}`,to:r,...u,account:d}),g=ko({abi:n,args:a,functionName:c,data:m||"0x"}),v=n.filter(b=>"name"in b&&b.name===t.functionName);return{result:g,request:{abi:v,address:r,args:a,dataSuffix:l,functionName:c,...u,account:d}}}catch(m){throw Zc(m,{abi:n,address:r,args:a,docsPath:"/docs/contract/simulateContract",functionName:c,sender:d==null?void 0:d.address})}}async function Np(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}const dk="0x6492649264926492649264926492649264926492649264926492649264926492";function pB(e){if(Ss(e,-32)!==dk)throw new yB(e)}function mB(e){const{data:t,signature:n,to:r}=e;return os(uv(HC("address, bytes, bytes"),[r,t,n]),dk)}function gB(e){try{return pB(e),!0}catch{return!1}}class yB extends st{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function vB({r:e,s:t,to:n="hex",v:r,yParity:a}){const c=(()=>{if(a===0||a===1)return a;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),l=`0x${new rk.Signature(jn(e),jn(t)).toCompactHex()}${c===0?"1b":"1c"}`;return n==="hex"?l:Pr(l)}async function Mp(e,t){var p,h,m,g;const{address:n,chain:r=e.chain,hash:a,erc6492VerifierAddress:c=t.universalSignatureVerifierAddress??((h=(p=r==null?void 0:r.contracts)==null?void 0:p.erc6492Verifier)==null?void 0:h.address),multicallAddress:l=t.multicallAddress??((g=(m=r==null?void 0:r.contracts)==null?void 0:m.multicall3)==null?void 0:g.address),mode:u="auto"}=t;if(r!=null&&r.verifyHash)return await r.verifyHash(e,t);const d=(()=>{const v=t.signature;return Es(v)?v:typeof v=="object"&&"r"in v&&"s"in v?vB(v):Vt(v)})();try{if(u==="eoa")try{if(el(xt(n),await kg({hash:a,signature:d})))return!0}catch{}return qI(d)?await bB(e,{...t,multicallAddress:l,signature:d}):await wB(e,{...t,verifierAddress:c,signature:d})}catch(v){if(u!=="eoa")try{if(el(xt(n),await kg({hash:a,signature:d})))return!0}catch{}if(v instanceof ji)return!1;throw v}}async function bB(e,t){var x;const{address:n,blockNumber:r,blockTag:a,hash:c,multicallAddress:l}=t,{authorization:u,data:d,signature:p,to:h}=GI(t.signature);if(await Fh(e,{address:n,blockNumber:r,blockTag:a})===_r(["0xef0100",u.address]))return await _B(e,{address:n,blockNumber:r,blockTag:a,hash:c,signature:p});const g={address:u.address,chainId:Number(u.chainId),nonce:Number(u.nonce),r:we(u.r,{size:32}),s:we(u.s,{size:32}),yParity:u.yParity};if(!await dM({address:n,authorization:g}))throw new ji;const b=await Ue(e,Lr,"readContract")({...l?{address:l}:{code:Uy},authorizationList:[g],abi:Qc,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...d?[{allowFailure:!0,target:h??n,callData:d}]:[],{allowFailure:!0,target:n,callData:At({abi:Rx,functionName:"isValidSignature",args:[c,p]})}]]}),_=(x=b[b.length-1])==null?void 0:x.returnData;if(_!=null&&_.startsWith("0x1626ba7e"))return!0;throw new ji}async function wB(e,t){const{address:n,factory:r,factoryData:a,hash:c,signature:l,verifierAddress:u,...d}=t,p=await(async()=>!r&&!a||gB(l)?l:mB({data:a,signature:l,to:r}))(),h=u?{to:u,data:At({abi:$w,functionName:"isValidSig",args:[n,c,p]}),...d}:{data:Wy({abi:$w,args:[n,c,p],bytecode:BE}),...d},{data:m}=await Ue(e,fl,"call")(h).catch(g=>{throw g instanceof S3?new ji:g});if(Gx(m??"0x0"))return!0;throw new ji}async function _B(e,t){const{address:n,blockNumber:r,blockTag:a,hash:c,signature:l}=t;if((await Ue(e,Lr,"readContract")({address:n,abi:Rx,args:[c,l],blockNumber:r,blockTag:a,functionName:"isValidSignature"}).catch(d=>{throw d instanceof Ly?new ji:d})).startsWith("0x1626ba7e"))return!0;throw new ji}class ji extends Error{}async function xB(e,{address:t,message:n,factory:r,factoryData:a,signature:c,...l}){const u=MC(n);return Ue(e,Mp,"verifyHash")({address:t,factory:r,factoryData:a,hash:u,signature:c,...l})}async function CB(e,t){const{address:n,factory:r,factoryData:a,signature:c,message:l,primaryType:u,types:d,domain:p,...h}=t,m=EM({message:l,primaryType:u,types:d,domain:p});return Ue(e,Mp,"verifyHash")({address:n,factory:r,factoryData:a,hash:m,signature:c,...h})}const eh=new Map,n1=new Map;let kB=0;function _o(e,t,n){const r=++kB,a=()=>eh.get(e)||[],c=()=>{const m=a().filter(g=>g.id!==r);if(m.length===0){eh.delete(e),n1.delete(e);return}eh.set(e,m)},l=()=>{const h=a();if(!h.some(g=>g.id===r))return;const m=n1.get(e);if(h.length===1&&m){const g=m();g instanceof Promise&&g.catch(()=>{})}c()},u=a();if(eh.set(e,[...u,{id:r,fns:t}]),u&&u.length>0)return l;const d={};for(const h in t)d[h]=((...m)=>{var v,b;const g=a();if(g.length!==0)for(const _ of g)(b=(v=_.fns)[h])==null||b.call(v,...m)});const p=n(d);return typeof p=="function"&&n1.set(e,p),l}function Nd(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let a=!0;const c=()=>a=!1;return(async()=>{let u;t&&(u=await e({unpoll:c}));const d=await(n==null?void 0:n(u))??r;await Sg(d);const p=async()=>{a&&(await e({unpoll:c}),await Sg(r),p())};p()})(),c}function fk(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:a,poll:c,pollingInterval:l=e.pollingInterval}){const u=typeof c<"u"?c:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let d;return u?(()=>{const m=ln(["watchBlockNumber",e.uid,t,n,l]);return _o(m,{onBlockNumber:r,onError:a},g=>Nd(async()=>{var v;try{const b=await Ue(e,Ad,"getBlockNumber")({cacheTime:0});if(d!==void 0){if(b===d)return;if(b-d>1&&n)for(let _=d+1n;_<b;_++)g.onBlockNumber(_,d),d=_}(d===void 0||b>d)&&(g.onBlockNumber(b,d),d=b)}catch(b){(v=g.onError)==null||v.call(g,b)}},{emitOnBegin:t,interval:l}))})():(()=>{const m=ln(["watchBlockNumber",e.uid,t,n]);return _o(m,{onBlockNumber:r,onError:a},g=>{let v=!0,b=()=>v=!1;return(async()=>{try{const _=(()=>{if(e.transport.type==="fallback"){const j=e.transport.transports.find(A=>A.config.type==="webSocket"||A.config.type==="ipc");return j?j.value:e.transport}return e.transport})(),{unsubscribe:x}=await _.subscribe({params:["newHeads"],onData(j){var k;if(!v)return;const A=jn((k=j.result)==null?void 0:k.number);g.onBlockNumber(A,d),d=A},onError(j){var A;(A=g.onError)==null||A.call(g,j)}});b=x,v||b()}catch(_){a==null||a(_)}})(),()=>b()})})()}async function mv(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:a,onReplaced:c,retryCount:l=6,retryDelay:u=({count:E})=>~~(1<<E)*200,timeout:d=18e4}=t,p=ln(["waitForTransactionReceipt",e.uid,a]),h=(()=>{var E;return t.pollingInterval?t.pollingInterval:(E=e.chain)!=null&&E.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let m,g,v,b=!1,_,x;const{promise:j,resolve:A,reject:k}=G3(),N=d?setTimeout(()=>{x==null||x(),_==null||_(),k(new F7({hash:a}))},d):void 0;return _=_o(p,{onReplaced:c,resolve:A,reject:k},async E=>{if(v=await Ue(e,kh,"getTransactionReceipt")({hash:a}).catch(()=>{}),v&&r<=1){clearTimeout(N),E.resolve(v),_==null||_();return}x=Ue(e,fk,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:h,async onBlockNumber(B){const M=R=>{clearTimeout(N),x==null||x(),R(),_==null||_()};let P=B;if(!b)try{if(v){if(r>1&&(!v.blockNumber||P-v.blockNumber+1n<r))return;M(()=>E.resolve(v));return}if(n&&!m&&(b=!0,await tl(async()=>{m=await Ue(e,Ap,"getTransaction")({hash:a}),m.blockNumber&&(P=m.blockNumber)},{delay:u,retryCount:l}),b=!1),v=await Ue(e,kh,"getTransactionReceipt")({hash:a}),r>1&&(!v.blockNumber||P-v.blockNumber+1n<r))return;M(()=>E.resolve(v))}catch(R){if(R instanceof k3||R instanceof j3){if(!m){b=!1;return}try{g=m,b=!0;const z=await tl(()=>Ue(e,ts,"getBlock")({blockNumber:P,includeTransactions:!0}),{delay:u,retryCount:l,shouldRetry:({error:O})=>O instanceof Jy});b=!1;const q=z.transactions.find(({from:O,nonce:K})=>O===g.from&&K===g.nonce);if(!q||(v=await Ue(e,kh,"getTransactionReceipt")({hash:q.hash}),r>1&&(!v.blockNumber||P-v.blockNumber+1n<r)))return;let Q="replaced";q.to===g.to&&q.value===g.value&&q.input===g.input?Q="repriced":q.from===q.to&&q.value===0n&&(Q="cancelled"),M(()=>{var O;(O=E.onReplaced)==null||O.call(E,{reason:Q,replacedTransaction:g,transaction:q,transactionReceipt:v}),E.resolve(v)})}catch(z){M(()=>E.reject(z))}}else M(()=>E.reject(R))}}})}),j}function jB(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:a,onError:c,includeTransactions:l,poll:u,pollingInterval:d=e.pollingInterval}){const p=typeof u<"u"?u:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),h=l??!1;let m;return p?(()=>{const b=ln(["watchBlocks",e.uid,t,n,r,h,d]);return _o(b,{onBlock:a,onError:c},_=>Nd(async()=>{var x;try{const j=await Ue(e,ts,"getBlock")({blockTag:t,includeTransactions:h});if(j.number!==null&&(m==null?void 0:m.number)!=null){if(j.number===m.number)return;if(j.number-m.number>1&&n)for(let A=(m==null?void 0:m.number)+1n;A<j.number;A++){const k=await Ue(e,ts,"getBlock")({blockNumber:A,includeTransactions:h});_.onBlock(k,m),m=k}}((m==null?void 0:m.number)==null||t==="pending"&&(j==null?void 0:j.number)==null||j.number!==null&&j.number>m.number)&&(_.onBlock(j,m),m=j)}catch(j){(x=_.onError)==null||x.call(_,j)}},{emitOnBegin:r,interval:d}))})():(()=>{let b=!0,_=!0,x=()=>b=!1;return(async()=>{try{r&&Ue(e,ts,"getBlock")({blockTag:t,includeTransactions:h}).then(k=>{b&&_&&(a(k,void 0),_=!1)}).catch(c);const j=(()=>{if(e.transport.type==="fallback"){const k=e.transport.transports.find(N=>N.config.type==="webSocket"||N.config.type==="ipc");return k?k.value:e.transport}return e.transport})(),{unsubscribe:A}=await j.subscribe({params:["newHeads"],async onData(k){var E;if(!b)return;const N=await Ue(e,ts,"getBlock")({blockNumber:(E=k.result)==null?void 0:E.number,includeTransactions:h}).catch(()=>{});b&&(a(N,m),_=!1,m=N)},onError(k){c==null||c(k)}});x=A,b||x()}catch(j){c==null||c(j)}})(),()=>x()})()}function SB(e,t){const{abi:n,address:r,args:a,batch:c=!0,eventName:l,fromBlock:u,onError:d,onLogs:p,poll:h,pollingInterval:m=e.pollingInterval,strict:g}=t;return(typeof h<"u"?h:typeof u=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const x=g??!1,j=ln(["watchContractEvent",r,a,c,e.uid,l,m,x,u]);return _o(j,{onLogs:p,onError:d},A=>{let k;u!==void 0&&(k=u-1n);let N,E=!1;const B=Nd(async()=>{var M;if(!E){try{N=await Ue(e,nC,"createContractEventFilter")({abi:n,address:r,args:a,eventName:l,strict:x,fromBlock:u})}catch{}E=!0;return}try{let P;if(N)P=await Ue(e,Cp,"getFilterChanges")({filter:N});else{const R=await Ue(e,Ad,"getBlockNumber")({});k&&k<R?P=await Ue(e,SC,"getContractEvents")({abi:n,address:r,args:a,eventName:l,fromBlock:k+1n,toBlock:R,strict:x}):P=[],k=R}if(P.length===0)return;if(c)A.onLogs(P);else for(const R of P)A.onLogs([R])}catch(P){N&&P instanceof bo&&(E=!1),(M=A.onError)==null||M.call(A,P)}},{emitOnBegin:!0,interval:m});return async()=>{N&&await Ue(e,Np,"uninstallFilter")({filter:N}),B()}})})():(()=>{const x=g??!1,j=ln(["watchContractEvent",r,a,c,e.uid,l,m,x]);let A=!0,k=()=>A=!1;return _o(j,{onLogs:p,onError:d},N=>((async()=>{try{const E=(()=>{if(e.transport.type==="fallback"){const P=e.transport.transports.find(R=>R.config.type==="webSocket"||R.config.type==="ipc");return P?P.value:e.transport}return e.transport})(),B=l?jd({abi:n,eventName:l,args:a}):[],{unsubscribe:M}=await E.subscribe({params:["logs",{address:r,topics:B}],onData(P){var z;if(!A)return;const R=P.result;try{const{eventName:q,args:Q}=zh({abi:n,data:R.data,topics:R.topics,strict:g}),O=Ns(R,{args:Q,eventName:q});N.onLogs([O])}catch(q){let Q,O;if(q instanceof Rh||q instanceof xy){if(g)return;Q=q.abiItem.name,O=(z=q.abiItem.inputs)==null?void 0:z.some($=>!("name"in $&&$.name))}const K=Ns(R,{args:O?[]:{},eventName:Q});N.onLogs([K])}},onError(P){var R;(R=N.onError)==null||R.call(N,P)}});k=M,A||k()}catch(E){d==null||d(E)}})(),()=>k()))})()}function AB(e,{address:t,args:n,batch:r=!0,event:a,events:c,fromBlock:l,onError:u,onLogs:d,poll:p,pollingInterval:h=e.pollingInterval,strict:m}){const g=typeof p<"u"?p:typeof l=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),v=m??!1;return g?(()=>{const x=ln(["watchEvent",t,n,r,e.uid,a,h,l]);return _o(x,{onLogs:d,onError:u},j=>{let A;l!==void 0&&(A=l-1n);let k,N=!1;const E=Nd(async()=>{var B;if(!N){try{k=await Ue(e,rC,"createEventFilter")({address:t,args:n,event:a,events:c,strict:v,fromBlock:l})}catch{}N=!0;return}try{let M;if(k)M=await Ue(e,Cp,"getFilterChanges")({filter:k});else{const P=await Ue(e,Ad,"getBlockNumber")({});A&&A!==P?M=await Ue(e,av,"getLogs")({address:t,args:n,event:a,events:c,fromBlock:A+1n,toBlock:P}):M=[],A=P}if(M.length===0)return;if(r)j.onLogs(M);else for(const P of M)j.onLogs([P])}catch(M){k&&M instanceof bo&&(N=!1),(B=j.onError)==null||B.call(j,M)}},{emitOnBegin:!0,interval:h});return async()=>{k&&await Ue(e,Np,"uninstallFilter")({filter:k}),E()}})})():(()=>{let x=!0,j=()=>x=!1;return(async()=>{try{const A=(()=>{if(e.transport.type==="fallback"){const B=e.transport.transports.find(M=>M.config.type==="webSocket"||M.config.type==="ipc");return B?B.value:e.transport}return e.transport})(),k=c??(a?[a]:void 0);let N=[];k&&(N=[k.flatMap(M=>jd({abi:[M],eventName:M.name,args:n}))],a&&(N=N[0]));const{unsubscribe:E}=await A.subscribe({params:["logs",{address:t,topics:N}],onData(B){var P;if(!x)return;const M=B.result;try{const{eventName:R,args:z}=zh({abi:k??[],data:M.data,topics:M.topics,strict:v}),q=Ns(M,{args:z,eventName:R});d([q])}catch(R){let z,q;if(R instanceof Rh||R instanceof xy){if(m)return;z=R.abiItem.name,q=(P=R.abiItem.inputs)==null?void 0:P.some(O=>!("name"in O&&O.name))}const Q=Ns(M,{args:q?[]:{},eventName:z});d([Q])}},onError(B){u==null||u(B)}});j=E,x||j()}catch(A){u==null||u(A)}})(),()=>j()})()}function EB(e,{batch:t=!0,onError:n,onTransactions:r,poll:a,pollingInterval:c=e.pollingInterval}){return(typeof a<"u"?a:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const p=ln(["watchPendingTransactions",e.uid,t,c]);return _o(p,{onTransactions:r,onError:n},h=>{let m;const g=Nd(async()=>{var v;try{if(!m)try{m=await Ue(e,sC,"createPendingTransactionFilter")({});return}catch(_){throw g(),_}const b=await Ue(e,Cp,"getFilterChanges")({filter:m});if(b.length===0)return;if(t)h.onTransactions(b);else for(const _ of b)h.onTransactions([_])}catch(b){(v=h.onError)==null||v.call(h,b)}},{emitOnBegin:!0,interval:c});return async()=>{m&&await Ue(e,Np,"uninstallFilter")({filter:m}),g()}})})():(()=>{let p=!0,h=()=>p=!1;return(async()=>{try{const{unsubscribe:m}=await e.transport.subscribe({params:["newPendingTransactions"],onData(g){if(!p)return;const v=g.result;r([v])},onError(g){n==null||n(g)}});h=m,p||h()}catch(m){n==null||n(m)}})(),()=>h()})()}class gv extends le{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(`
1686
1686
  `),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class r1 extends le{constructor({docsPath:t,metaMessages:n,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:t,metaMessages:n,name:"AccountTypeNotSupportedError"})}}async function hk(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const s1=new gd(128);async function NB(e,t){var E,B,M,P,R,z;const{account:n=e.account,assertChainId:r=!0,chain:a=e.chain,accessList:c,authorizationList:l,blobs:u,data:d,dataSuffix:p=typeof e.dataSuffix=="string"?e.dataSuffix:(E=e.dataSuffix)==null?void 0:E.value,gas:h,gasPrice:m,maxFeePerBlobGas:g,maxFeePerGas:v,maxPriorityFeePerGas:b,nonce:_,type:x,value:j,...A}=t;if(typeof n>"u")throw new gv({docsPath:"/docs/actions/wallet/sendTransaction"});const k=n?mn(n):null;let N;try{Pi(t);const q=await(async()=>{if(t.to)return t.to;if(t.to!==null&&l&&l.length>0)return await Qy({authorization:l[0]}).catch(()=>{throw new le("`to` is required. Could not infer from `authorizationList`.")})})();if((k==null?void 0:k.type)==="json-rpc"||k===null){let Q;a!==null&&(Q=await Ue(e,Yu,"getChainId")({}),r&&gM({currentChainId:Q,chain:a}));const O=(P=(M=(B=e.chain)==null?void 0:B.formatters)==null?void 0:M.transactionRequest)==null?void 0:P.format,$=(O||dl)({...kd(A,{format:O}),accessList:c,account:k,authorizationList:l,blobs:u,chainId:Q,data:p?Rr([d??"0x",p]):d,gas:h,gasPrice:m,maxFeePerBlobGas:g,maxFeePerGas:v,maxPriorityFeePerGas:b,nonce:_,to:q,type:x,value:j},"sendTransaction"),L=s1.get(e.uid),se=L?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:se,params:[$]},{retryCount:0})}catch(D){if(L===!1)throw D;const X=D;if(X.name==="InvalidInputRpcError"||X.name==="InvalidParamsRpcError"||X.name==="MethodNotFoundRpcError"||X.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[$]},{retryCount:0}).then(te=>(s1.set(e.uid,!0),te)).catch(te=>{const W=te;throw W.name==="MethodNotFoundRpcError"||W.name==="MethodNotSupportedRpcError"?(s1.set(e.uid,!1),X):W});throw X}}if((k==null?void 0:k.type)==="local"){if(k.nonceManager&&typeof _>"u"){const $=A.chainId,L=await(async()=>typeof $=="number"?$:a?a.id:Ue(e,Yu,"getChainId")({}))();N={address:k.address,chainId:L}}const Q=await Ue(e,rv,"prepareTransactionRequest")({account:k,accessList:c,authorizationList:l,blobs:u,chain:a,data:p?Rr([d??"0x",p]):d,gas:h,gasPrice:m,maxFeePerBlobGas:g,maxFeePerGas:v,maxPriorityFeePerGas:b,nonce:_,nonceManager:k.nonceManager,parameters:[...kC,"sidecars"],type:x,value:j,...A,to:q}),O=(R=a==null?void 0:a.serializers)==null?void 0:R.transaction,K=await k.signTransaction(Q,{serializer:O});return await Ue(e,hk,"sendRawTransaction")({serializedTransaction:K})}throw(k==null?void 0:k.type)==="smart"?new r1({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new r1({docsPath:"/docs/actions/wallet/sendTransaction",type:k==null?void 0:k.type})}catch(q){throw q instanceof r1?q:(N&&((z=k==null?void 0:k.nonceManager)==null||z.reset(N)),xC(q,{...t,account:k,chain:t.chain||void 0}))}}async function MB(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){var u,d,p;const a=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,r]:[t]},{retryCount:0}),l=(((p=(d=(u=e.chain)==null?void 0:u.formatters)==null?void 0:d.transactionReceipt)==null?void 0:p.format)||_p)(a);if(l.status==="reverted"&&n)throw new O7({receipt:l});return l}async function IB(e,{account:t=e.account,message:n}){if(!t)throw new gv({docsPath:"/docs/actions/wallet/signMessage"});const r=mn(t);if(r.signMessage)return r.signMessage({message:n});const a=typeof n=="string"?wi(n):n.raw instanceof Uint8Array?nr(n.raw):n.raw;return e.request({method:"personal_sign",params:[a,r.address]},{retryCount:0})}async function BB(e,t){const{account:n=e.account,domain:r,message:a,primaryType:c}=t;if(!n)throw new gv({docsPath:"/docs/actions/wallet/signTypedData"});const l=mn(n),u={EIP712Domain:BC({domain:r}),...t.types};if(IC({domain:r,message:a,primaryType:c,types:u}),l.signTypedData)return l.signTypedData({domain:r,message:a,primaryType:c,types:u});const d=SM({domain:r,message:a,primaryType:c,types:u});return e.request({method:"eth_signTypedData_v4",params:[l.address,d]},{retryCount:0})}function ss(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const a=e[n];return typeof a=="function"?a:c=>t(e,c)}const jh="2.22.1",TB=()=>`@wagmi/core@${jh}`;var pk=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Hh,mk;let ba=class Dg extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return TB()}constructor(t,n={}){var c;super(),Hh.add(this),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,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const r=n.cause instanceof Dg?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details,a=n.cause instanceof Dg&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${this.docsBaseUrl}${a}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(`
@@ -1756,7 +1756,7 @@ distributed under the License is distributed on an "AS IS" BASIS,
1756
1756
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1757
1757
  See the License for the specific language governing permissions and
1758
1758
  limitations under the License.
1759
- */const fu={newline:10,reset:27};function WL(e){if(!Number.isSafeInteger(e))throw new Error(`integer expected: ${e}`)}function VL(e){if(!Number.isSafeInteger(e)||e<1||e>40)throw new Error(`Invalid version=${e}. Expected number [1..40]`)}function qo(e,t){return e.toString(2).padStart(t,"0")}function P_(e,t){const n=e%t;return n>=0?n:t+n}function bs(e,t){return new Array(e).fill(t)}function A1(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}function R_(e){let t=0,n=0;for(const c of e)t=Math.max(t,c.length),n+=c.length;const r=new Uint8Array(n);let a=0;for(let c=0;c<t;c++)for(const l of e)c<l.length&&(r[a++]=l[c]);return r}function GL(){let e,t=1/0;return{add(n,r){n>=t||(e=r,t=n)},get:()=>e,score:()=>t}}function L_(e){return Object.freeze({has:t=>e.includes(t),decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})},encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(WL(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})}})}function D_(e){if(e.length!==32)throw new Error("expects 32 element matrix");const t=[1431655765,858993459,252645135,16711935,65535];for(let n=0;n<5;n++){const r=t[n]>>>0,a=1<<n,c=a<<1;for(let l=0;l<32;l+=c)for(let u=0;u<a;u++){const d=l+u,p=d+a,h=e[d]>>>0,m=e[p]>>>0,g=(h>>>a^m)&r;e[d]=(h^g<<a)>>>0,e[p]=(m^g)>>>0}}}const hu=e=>1<<(e&31)>>>0,Ko=(e,t)=>t===0?0:t===32?4294967295:(1<<t)-1<<e>>>0;class Tn{constructor(t,n){Ka(this,"defined");Ka(this,"value");Ka(this,"tailMask");Ka(this,"words");Ka(this,"fullWords");Ka(this,"height");Ka(this,"width");const{height:r,width:a}=Tn.size(t);if(!Number.isSafeInteger(r)||r<=0)throw new Error(`Bitmap: invalid height=${r}, expected positive safe integer dimension`);if(!Number.isSafeInteger(a)||a<=0)throw new Error(`Bitmap: invalid width=${a}, expected positive safe integer dimension`);if(this.height=r,this.width=a,this.tailMask=Ko(0,a&31||32),this.words=Math.ceil(a/32)|0,this.fullWords=Math.floor(a/32)|0,this.value=new Uint32Array(this.words*r),this.defined=new Uint32Array(this.value.length),n){if(n.length!==r)throw new Error(`Bitmap: data height mismatch: exp=${r} got=${n.length}`);for(let c=0;c<r;c++){const l=n[c];if(!l||l.length!==a)throw new Error(`Bitmap: data width mismatch at y=${c}: exp=${a} got=${l==null?void 0:l.length}`);for(let u=0;u<a;u++)this.set(u,c,l[u])}}}static size(t,n){if(typeof t=="number"&&(t={height:t,width:t}),!Number.isSafeInteger(t.height)&&t.height!==1/0)throw new Error(`Bitmap: invalid height=${t.height} (${typeof t.height})`);if(!Number.isSafeInteger(t.width)&&t.width!==1/0)throw new Error(`Bitmap: invalid width=${t.width} (${typeof t.width})`);return n!==void 0&&(t={width:Math.min(t.width,n.width),height:Math.min(t.height,n.height)}),t}static fromString(t){t=t.replace(/^\n+/g,"").replace(/\n+$/g,"");const n=t.split(String.fromCharCode(fu.newline)),r=n.length;let a;const c=[];for(const l of n){const u=l.split("").map(d=>{if(d==="X")return!0;if(d===" ")return!1;if(d!=="?")throw new Error(`Bitmap.fromString: unknown symbol=${d}`)});if(a!==void 0&&u.length!==a)throw new Error(`Bitmap.fromString different row sizes: width=${a} cur=${u.length}`);a=u.length,c.push(u)}return a===void 0&&(a=0),new Tn({height:r,width:a},c)}point(t){return this.get(t.x,t.y)}isInside(t){return 0<=t.x&&t.x<this.width&&0<=t.y&&t.y<this.height}size(t){if(!t)return{height:this.height,width:this.width};const{x:n,y:r}=this.xy(t);return{height:this.height-r,width:this.width-n}}xy(t){if(typeof t=="number"&&(t={x:t,y:t}),!Number.isSafeInteger(t.x))throw new Error(`Bitmap: invalid x=${t.x}`);if(!Number.isSafeInteger(t.y))throw new Error(`Bitmap: invalid y=${t.y}`);return t.x=P_(t.x,this.width),t.y=P_(t.y,this.height),t}wordIndex(t,n){return n*this.words+(t>>>5)}bitIndex(t,n){return{word:this.wordIndex(t,n),bit:t&31}}isDefined(t,n){const r=this.wordIndex(t,n),a=hu(t);return(this.defined[r]&a)!==0}get(t,n){const r=this.wordIndex(t,n),a=hu(t);return(this.value[r]&a)!==0}maskWord(t,n,r){const{defined:a,value:c}=this;a[t]|=n,c[t]=c[t]&~n|-r&n}set(t,n,r){r!==void 0&&this.maskWord(this.wordIndex(t,n),hu(t),r)}fillRectConst(t,n,r,a,c){if(r<=0||a<=0||c===void 0)return;const{value:l,defined:u,words:d}=this,p=t>>>5,h=t+r-1>>>5,m=t&31,g=t+r-1&31;for(let v=0;v<a;v++){const b=(n+v)*d;if(p===h){const _=Ko(m,g-m+1);this.maskWord(b+p,_,c);continue}this.maskWord(b+p,Ko(m,32-m),c);for(let _=p+1;_<h;_++)u[b+_]=4294967295,l[b+_]=c?4294967295:0;this.maskWord(b+h,Ko(0,g+1),c)}}rectWords(t,n,r,a,c){for(let l=0;l<a;l++){const u=n+l;for(let d=0;d<r;){const p=t+d,{bit:h,word:m}=this.bitIndex(p,u),g=Math.min(32-h,r-d);c(m,p,d,l,g),d+=g}}}rect(t,n,r){const{x:a,y:c}=this.xy(t),{height:l,width:u}=Tn.size(n,this.size({x:a,y:c}));if(typeof r!="function")return this.fillRectConst(a,c,u,l,r),this;const{defined:d,value:p}=this;return this.rectWords(a,c,u,l,(h,m,g,v,b)=>{let _=0,x=p[h];for(let j=0;j<b;j++){const A=hu(m+j),k=r({x:g+j,y:v},(x&A)!==0);k!==void 0&&(_|=A,x=x&~A|-k&A)}d[h]|=_,p[h]=x}),this}rectRead(t,n,r){const{x:a,y:c}=this.xy(t),{height:l,width:u}=Tn.size(n,this.size({x:a,y:c})),{value:d}=this;return this.rectWords(a,c,u,l,(p,h,m,g,v)=>{const b=d[p];for(let _=0;_<v;_++){const x=hu(h+_);r({x:m+_,y:g},(b&x)!==0)}}),this}hLine(t,n,r){return this.rect(t,{width:n,height:1},r)}vLine(t,n,r){return this.rect(t,{width:1,height:n},r)}border(t=2,n){if(!Number.isSafeInteger(t)||t<=0)throw new Error(`Bitmap.border: invalid size=${t}`);const r=this.height+2*t,a=this.width+2*t,c=new Tn({height:r,width:a});return c.rect(0,1/0,n),c.embed({x:t,y:t},this),c}embed(t,n){const{x:r,y:a}=this.xy(t),{height:c,width:l}=Tn.size(n.size(),this.size({x:r,y:a}));if(l<=0||c<=0)return this;const{value:u,defined:d}=this,{words:p,value:h}=n;for(let m=0;m<c;m++){const g=m*p;for(let v=0;v<l;){const b=r+v,{word:_,bit:x}=this.bitIndex(b,a+m),{word:j,bit:A}=n.bitIndex(v,m),k=Math.min(32-x,l-v),N=h[j],E=A&&j+1<g+p?h[j+1]:0,B=A?(N>>>A|E<<32-A)>>>0:N,M=Ko(x,k),P=(B&Ko(0,k))<<x>>>0;d[_]|=M,u[_]=u[_]&~M|P,v+=k}}return this}rectSlice(t,n=this.size()){const{x:r,y:a}=this.xy(t),{height:c,width:l}=Tn.size(n,this.size({x:r,y:a})),u=new Tn({height:c,width:l});return this.rectRead({x:r,y:a},{height:c,width:l},(d,p)=>{this.isDefined(r+d.x,a+d.y)&&u.set(d.x,d.y,p)}),u}transpose(){const{height:t,width:n,value:r,defined:a,words:c}=this,l=new Tn({height:n,width:t}),{words:u,value:d,defined:p,tailMask:h}=l,m=new Uint32Array(32),g=new Uint32Array(32);for(let v=0;v<t;v+=32)for(let b=0;b<c;b++){const _=Math.min(32,t-v);for(let x=0;x<_;x++){const j=this.wordIndex(32*b,v+x);m[x]=r[j],g[x]=a[j]}m.fill(0,_),g.fill(0,_),D_(m),D_(g);for(let x=0;x<32;x++){const j=b*32+x;if(j>=n)break;const A=l.wordIndex(v,j),k=v>>>5===u-1?h:4294967295;d[A]=m[x]&k,p[A]=g[x]&k}}return l}negate(){const t=this.defined.length;for(let n=0;n<t;n++)this.value[n]=~this.value[n],this.defined[n]=4294967295;return this}scale(t){if(!Number.isSafeInteger(t)||t>1024)throw new Error(`invalid scale factor: ${t}`);const{height:n,width:r}=this;return new Tn({height:t*n,width:t*r}).rect({x:0,y:0},1/0,({x:c,y:l})=>this.get(c/t|0,l/t|0))}clone(){const t=new Tn(this.size());return t.defined.set(this.defined),t.value.set(this.value),t}assertDrawn(){const{height:t,width:n,defined:r,tailMask:a,fullWords:c,words:l}=this;if(!(!t||!n))for(let u=0;u<t;u++){const d=u*l;for(let p=0;p<c;p++)if(r[d+p]!==4294967295)throw new Error("Invalid color type=undefined");if(l!==c&&(r[d+c]&a)!==a)throw new Error("Invalid color type=undefined")}}countPatternInRow(t,n,...r){if(!Number.isSafeInteger(n)||n<=0||n>=32)throw new Error("wrong patternLen");const a=(1<<n)-1,{height:c,width:l,value:u,words:d}=this;if(!Number.isSafeInteger(t)||t<0||t>=c)return 0;let p=0;const h=this.wordIndex(0,t);for(let m=0,g=0;m<d;m++){const v=u[h+m],b=m===d-1&&l&31||32;for(let _=0;_<b;_++)if(g=(g<<1|v>>>_&1)&a,!(m*32+_+1<n)){for(const x of r)if(g===x){p++;break}}}return p}getRuns(t,n){const{height:r,width:a,value:c,words:l}=this;if(a===0||!Number.isSafeInteger(t)||t<0||t>=r)return;let u=0,d;const p=this.wordIndex(0,t);for(let h=0;h<l;h++){const m=c[p+h],g=h===l-1&&a&31||32;for(let v=0;v<g;v++){const b=(m&1<<v)!==0;if(b===d){u++;continue}d!==void 0&&n(u,d),d=b,u=1}}d!==void 0&&n(u,d)}popcnt(){const{height:t,width:n,words:r,fullWords:a,tailMask:c}=this;if(!t||!n)return 0;let l=0;for(let u=0;u<t;u++){const d=u*r;for(let p=0;p<a;p++)l+=A1(this.value[d+p]);r!==a&&(l+=A1(this.value[d+a]&c))}return l}countBoxes2x2(t){const{height:n,width:r,words:a}=this;if(r<2||!Number.isSafeInteger(t)||t<0||t+1>=n)return 0;const c=this.wordIndex(0,t),l=this.wordIndex(0,t+1),d=(r&31)===0?2147483647:Ko(0,r-1&31);let p=0;for(let h=0;h<a;h++){const m=this.value[c+h],g=this.value[l+h],v=~(m^g)>>>0,b=h+1<a?this.value[c+h+1]>>>0:0,_=~(m^(m>>>1|(b&1)<<31)>>>0)>>>0,x=h+1<a?this.value[l+h+1]>>>0:0,j=~(g^(g>>>1|(x&1)<<31)>>>0)>>>0;let A=(v&_&j)>>>0;h===a-1&&(A&=d),p+=A1(A)}return p}toString(){const t=String.fromCharCode(fu.newline);let n="";for(let r=0;r<this.height;r++){let a="";for(let c=0;c<this.width;c++){const l=this.get(c,r);a+=this.isDefined(c,r)?l?"X":" ":"?"}n+=a+(r+1===this.height?"":t)}return n}toRaw(){const t=Array.from({length:this.height},()=>new Array(this.width));for(let n=0;n<this.height;n++){const r=t[n];for(let a=0;a<this.width;a++)r[a]=this.get(a,n)}return t}toASCII(){const{height:t,width:n}=this;let r="";for(let a=0;a<t;a+=2){for(let c=0;c<n;c++){const l=this.get(c,a),u=a+1>=t?!0:this.get(c,a+1);!l&&!u?r+="█":!l&&u?r+="▀":l&&!u?r+="▄":l&&u&&(r+=" ")}r+=String.fromCharCode(fu.newline)}return r}toTerm(){const t=String.fromCharCode(fu.reset),n=t+"[0m",r=t+"[1;47m "+n,a=t+"[40m "+n,c=String.fromCharCode(fu.newline);let l="";for(let u=0;u<this.height;u++){for(let d=0;d<this.width;d++){const p=this.get(d,u);l+=p?a:r}l+=c}return l}toSVG(t=!0){let n=`<svg viewBox="0 0 ${this.width} ${this.height}" xmlns="http://www.w3.org/2000/svg">`,r="",a;return this.rectRead(0,1/0,(c,l)=>{if(!l)return;const{x:u,y:d}=c;if(!t){n+=`<rect x="${u}" y="${d}" width="1" height="1" />`;return}let p=`M${u} ${d}`;if(a){const m=`m${u-a.x} ${d-a.y}`;m.length<=p.length&&(p=m)}const h=u<10?`H${u}`:"h-1";r+=`${p}h1v1${h}Z`,a=c}),t&&(n+=`<path d="${r}"/>`),n+="</svg>",n}toGIF(){const t=u=>[u&255,u>>>8&255],n=[...t(this.width),...t(this.height)],r=[];this.rectRead(0,1/0,(u,d)=>r.push(+(d===!0)));const a=126,c=[71,73,70,56,55,97,...n,246,0,0,255,255,255,...bs(381,0),44,0,0,0,0,...n,0,7],l=Math.floor(r.length/a);for(let u=0;u<l;u++)c.push(a+1,128,...r.slice(a*u,a*(u+1)).map(d=>+d));return c.push(r.length%a+1,128,...r.slice(l*a).map(u=>+u)),c.push(1,129,0,59),new Uint8Array(c)}toImage(t=!1){const{height:n,width:r}=this.size(),a=new Uint8Array(n*r*(t?3:4));let c=0;for(let l=0;l<n;l++)for(let u=0;u<r;u++){const d=this.get(u,l)?0:255;a[c++]=d,a[c++]=d,a[c++]=d,t||(a[c++]=255)}return{height:n,width:r,data:a}}}const O_=Object.freeze(["low","medium","quartile","high"]),F_=Object.freeze(["numeric","alphanumeric","byte","kanji","eci"]),qL=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],KL={low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]},QL={low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]},Sn=Object.freeze({size:Object.freeze({encode:e=>21+4*(e-1),decode:e=>(e-17)/4}),sizeType:e=>Math.floor((e+7)/17),alignmentPatterns(e){if(e===1)return[];const t=6,n=Sn.size.encode(e)-t-1,r=n-t,a=Math.ceil(r/28);let c=Math.floor(r/a);c%2?c+=1:r%a*2>=a&&(c+=2);const l=[t];for(let u=1;u<a;u++)l.push(n-(a-u)*c);return l.push(n),l},ECCode:Object.freeze({low:1,medium:0,quartile:3,high:2}),formatMask:21522,formatBits(e,t){const n=Sn.ECCode[e]<<3|t;let r=n;for(let a=0;a<10;a++)r=r<<1^(r>>9)*1335;return(n<<10|r)^Sn.formatMask},versionBits(e){let t=e;for(let n=0;n<12;n++)t=t<<1^(t>>11)*7973;return e<<12|t},alphabet:Object.freeze({numeric:L_("0123456789"),alphanumerc:L_("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")}),lengthBits(e,t){return{numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]}[t][Sn.sizeType(e)]},modeBits:Object.freeze({numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"}),capacity(e,t){const n=qL[e-1],r=KL[t][e-1],a=QL[t][e-1],c=Math.floor(n/a)-r,l=a-n%a;return{words:r,numBlocks:a,shortBlocks:l,blockLen:c,capacity:(n-r*a)*8,total:(r+c)*a+a-l}}}),Iv=Object.freeze([(e,t)=>(e+t)%2==0,(e,t)=>t%2==0,(e,t)=>e%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(t/2)+Math.floor(e/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0]),Te={tables:(e=>{const t=bs(256,0),n=bs(256,0);for(let r=0,a=1;r<256;r++)t[r]=a,n[a]=r,a<<=1,a&256&&(a^=e);return{exp:t,log:n}})(285),exp:e=>Te.tables.exp[e],log(e){if(e===0)throw new Error(`GF.log: invalid arg=${e}`);return Te.tables.log[e]%255},mul(e,t){return e===0||t===0?0:Te.tables.exp[(Te.tables.log[e]+Te.tables.log[t])%255]},add:(e,t)=>e^t,pow:(e,t)=>Te.tables.exp[Te.tables.log[e]*t%255],inv(e){if(e===0)throw new Error(`GF.inverse: invalid arg=${e}`);return Te.tables.exp[255-Te.tables.log[e]]},polynomial(e){if(e.length==0)throw new Error("GF.polymomial: invalid length");if(e[0]!==0)return e;let t=0;for(;t<e.length-1&&e[t]==0;t++);return e.slice(t)},monomial(e,t){if(e<0)throw new Error(`GF.monomial: invalid degree=${e}`);if(t==0)return[0];let n=bs(e+1,0);return n[0]=t,Te.polynomial(n)},degree:e=>e.length-1,coefficient:(e,t)=>e[Te.degree(e)-t],mulPoly(e,t){if(e[0]===0||t[0]===0)return[0];const n=bs(e.length+t.length-1,0);for(let r=0;r<e.length;r++)for(let a=0;a<t.length;a++)n[r+a]=Te.add(n[r+a],Te.mul(e[r],t[a]));return Te.polynomial(n)},mulPolyScalar(e,t){if(t==0)return[0];if(t==1)return e;const n=bs(e.length,0);for(let r=0;r<e.length;r++)n[r]=Te.mul(e[r],t);return Te.polynomial(n)},mulPolyMonomial(e,t,n){if(t<0)throw new Error("GF.mulPolyMonomial: invalid degree");if(n==0)return[0];const r=bs(e.length+t,0);for(let a=0;a<e.length;a++)r[a]=Te.mul(e[a],n);return Te.polynomial(r)},addPoly(e,t){if(e[0]===0)return t;if(t[0]===0)return e;let n=e,r=t;n.length>r.length&&([n,r]=[r,n]);let a=bs(r.length,0),c=r.length-n.length,l=r.slice(0,c);for(let u=0;u<l.length;u++)a[u]=l[u];for(let u=c;u<r.length;u++)a[u]=Te.add(n[u-c],r[u]);return Te.polynomial(a)},remainderPoly(e,t){const n=Array.from(e);for(let r=0;r<e.length-t.length+1;r++){const a=n[r];if(a!==0)for(let c=1;c<t.length;c++)t[c]!==0&&(n[r+c]=Te.add(n[r+c],Te.mul(t[c],a)))}return n.slice(e.length-t.length+1,n.length)},divisorPoly(e){let t=[1];for(let n=0;n<e;n++)t=Te.mulPoly(t,[1,Te.pow(2,n)]);return t},evalPoly(e,t){if(t==0)return Te.coefficient(e,0);let n=e[0];for(let r=1;r<e.length;r++)n=Te.add(Te.mul(t,n),e[r]);return n},euclidian(e,t,n){Te.degree(e)<Te.degree(t)&&([e,t]=[t,e]);let r=e,a=t,c=[0],l=[1];for(;2*Te.degree(a)>=n;){let p=r,h=c;if(r=a,c=l,r[0]===0)throw new Error("rLast[0] === 0");a=p;let m=[0];const g=Te.inv(r[0]);for(;Te.degree(a)>=Te.degree(r)&&a[0]!==0;){const v=Te.degree(a)-Te.degree(r),b=Te.mul(a[0],g);m=Te.addPoly(m,Te.monomial(v,b)),a=Te.addPoly(a,Te.mulPolyMonomial(r,v,b))}if(m=Te.mulPoly(m,c),l=Te.addPoly(m,h),Te.degree(a)>=Te.degree(r))throw new Error(`Division failed r: ${a}, rLast: ${r}`)}const u=Te.coefficient(l,0);if(u==0)throw new Error("sigmaTilde(0) was zero");const d=Te.inv(u);return[Te.mulPolyScalar(l,d),Te.mulPolyScalar(a,d)]}};function YL(e){return{encode(t){const n=Te.divisorPoly(e),r=Array.from(t);return r.push(...n.slice(0,-1).fill(0)),Uint8Array.from(Te.remainderPoly(r,n))},decode(t){const n=t.slice(),r=Te.polynomial(Array.from(t));let a=bs(e,0),c=!1;for(let m=0;m<e;m++){const g=Te.evalPoly(r,Te.exp(m));a[a.length-1-m]=g,g!==0&&(c=!0)}if(!c)return n;a=Te.polynomial(a);const l=Te.monomial(e,1),[u,d]=Te.euclidian(l,a,e),p=bs(Te.degree(u),0);let h=0;for(let m=1;m<256&&h<p.length;m++)Te.evalPoly(u,m)===0&&(p[h++]=Te.inv(m));if(h!==p.length)throw new Error("RS.decode: invalid errors number");for(let m=0;m<p.length;m++){const g=n.length-1-Te.log(p[m]);if(g<0)throw new Error("RS.decode: invalid error location");const v=Te.inv(p[m]);let b=1;for(let _=0;_<p.length;_++)m!==_&&(b=Te.mul(b,Te.add(1,Te.mul(p[_],v))));n[g]=Te.add(n[g],Te.mul(Te.evalPoly(d,v),Te.inv(b)))}return n}}}function JL(e,t){const{words:n,shortBlocks:r,numBlocks:a,blockLen:c,total:l}=Sn.capacity(e,t),u=YL(n);return{encode(d){const p=[],h=[];for(let b=0;b<a;b++){const _=b<r,x=c+(_?0:1);p.push(d.subarray(0,x)),h.push(u.encode(d.subarray(0,x))),d=d.subarray(x)}const m=R_(p),g=R_(h),v=new Uint8Array(m.length+g.length);return v.set(m),v.set(g,m.length),v},decode(d){if(d.length!==l)throw new Error(`interleave.decode: len(data)=${d.length}, total=${l}`);const p=[];for(let g=0;g<a;g++){const v=g<r;p.push(new Uint8Array(n+c+(v?0:1)))}let h=0;for(let g=0;g<c;g++)for(let v=0;v<a;v++)p[v][g]=d[h++];for(let g=r;g<a;g++)p[g][c]=d[h++];for(let g=c;g<c+n;g++)for(let v=0;v<a;v++){const b=v<r;p[v][g+(b?0:1)]=d[h++]}const m=[];for(const g of p)m.push(...Array.from(u.decode(g)).slice(0,-n));return Uint8Array.from(m)}}}function XL(e,t,n,r=!1){const a=Sn.size.encode(e);let c=new Tn(a+2);const l=new Tn(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);c=c.embed(0,l).embed({x:-l.width,y:0},l).embed({x:0,y:-l.height},l),c=c.rectSlice(1,a);const u=new Tn(1).rect(0,1,!0).border(1,!1).border(1,!0),d=Sn.alignmentPatterns(e);for(const p of d)for(const h of d)c.isDefined(h,p)||c.embed({x:h-2,y:p-2},u);c=c.hLine({x:0,y:6},1/0,({x:p})=>c.isDefined(p,6)?void 0:p%2==0).vLine({x:6,y:0},1/0,({y:p})=>c.isDefined(6,p)?void 0:p%2==0);{const p=Sn.formatBits(t,n),h=m=>!r&&(p>>m&1)==1;for(let m=0;m<6;m++)c.set(8,m,h(m));for(let m=6;m<8;m++)c.set(8,m+1,h(m));for(let m=8;m<15;m++)c.set(8,a-15+m,h(m));for(let m=0;m<8;m++)c.set(a-m-1,8,h(m));for(let m=8;m<9;m++)c.set(15-m-1+1,8,h(m));for(let m=9;m<15;m++)c.set(15-m-1,8,h(m));c.set(8,a-8,!r)}if(e>=7){const p=Sn.versionBits(e);for(let h=0;h<18;h+=1){const m=!r&&(p>>h&1)==1,g=Math.floor(h/3),v=h%3+a-8-3;c.set(v,g,m),c.set(g,v,m)}}return c}function ZL(e,t,n){const r=e,a=r.height,c=Iv[t];let l=-1,u=a-1;for(let d=a-1;d>0;d-=2){for(d==6&&(d=5);;u+=l){for(let p=0;p<2;p+=1){const h=d-p;r.isDefined(h,u)||n(h,u,c(h,u))}if(u+l<0||u+l>=a)break}l=-l}}function eD(e){let t="numeric";for(let n of e)if(!Sn.alphabet.numeric.has(n)&&(t="alphanumeric",!Sn.alphabet.alphanumerc.has(n)))return"byte";return t}function tD(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function z_(e,t,n,r,a=tD){let c="",l=n.length;if(r==="numeric"){const g=Sn.alphabet.numeric.decode(n.split("")),v=g.length;for(let b=0;b<v-2;b+=3)c+=qo(g[b]*100+g[b+1]*10+g[b+2],10);v%3===1?c+=qo(g[v-1],4):v%3===2&&(c+=qo(g[v-2]*10+g[v-1],7))}else if(r==="alphanumeric"){const g=Sn.alphabet.alphanumerc.decode(n.split("")),v=g.length;for(let b=0;b<v-1;b+=2)c+=qo(g[b]*45+g[b+1],11);v%2==1&&(c+=qo(g[v-1],6))}else if(r==="byte"){const g=a(n);l=g.length,c=Array.from(g).map(v=>qo(v,8)).join("")}else throw new Error("encode: unsupported type");const{capacity:u}=Sn.capacity(e,t),d=qo(l,Sn.lengthBits(e,r));let p=Sn.modeBits[r]+d+c;if(p.length>u)throw new Error("Capacity overflow");p+="0".repeat(Math.min(4,Math.max(0,u-p.length))),p.length%8&&(p+="0".repeat(8-p.length%8));const h="1110110000010001";for(let g=0;p.length!==u;g++)p+=h[g%h.length];const m=Uint8Array.from(p.match(/(.{8})/g).map(g=>+`0b${g}`));return JL(e,t).encode(m)}function $_(e,t,n,r,a=!1){const c=XL(e,t,r,a);let l=0;const u=8*n.length;if(ZL(c,r,(d,p,h)=>{let m=!1;l<u&&(m=(n[l>>>3]>>(7-l&7)&1)!==0,l++),c.set(d,p,m!==h)}),l!==u)throw new Error("QR: bytes left after draw");return c}const N4=e=>{const t=e.map(n=>n?"1":"0").join("");return{len:t.length,n:+`0b${t}`}},M4=[!0,!1,!0,!0,!0,!1,!0],I4=[!1,!1,!1,!1],ph=N4([...M4,...I4]),H_=N4([...I4,...M4]);function nD(e){const t=e,{width:n,height:r}=t,a=t.transpose();let c=0;for(let g=0;g<r;g++)t.getRuns(g,v=>{v>=5&&(c+=3+(v-5))});for(let g=0;g<n;g++)a.getRuns(g,v=>{v>=5&&(c+=3+(v-5))});let l=0;for(let g=0;g<r-1;g++)l+=3*t.countBoxes2x2(g);let u=0;for(let g=0;g<r;g++)u+=40*t.countPatternInRow(g,ph.len,ph.n,H_.n);for(let g=0;g<n;g++)u+=40*a.countPatternInRow(g,ph.len,ph.n,H_.n);const d=r*n,p=t.popcnt(),m=10*Math.ceil(Math.max(0,Math.abs(p*100-d*50)-d*5)/(d*5));return c+l+u+m}function rD(e,t,n,r){if(r===void 0){const a=GL();for(let c=0;c<Iv.length;c++)a.add(nD($_(e,t,n,c,!0)),c);r=a.get()}if(r===void 0)throw new Error("Cannot find mask");return $_(e,t,n,r)}function sD(e){if(!O_.includes(e))throw new Error(`Invalid error correction mode=${e}. Expected: ${O_}`)}function aD(e){if(!F_.includes(e))throw new Error(`Encoding: invalid mode=${e}. Expected: ${F_}`);if(e==="kanji"||e==="eci")throw new Error(`Encoding: ${e} is not supported (yet?).`)}function oD(e){if(![0,1,2,3,4,5,6,7].includes(e)||!Iv[e])throw new Error(`Invalid mask=${e}. Expected number [0..7]`)}function iD(e,t="raw",n={}){const r=n,a=r.ecc!==void 0?r.ecc:"medium";sD(a);const c=r.encoding!==void 0?r.encoding:eD(e);aD(c),r.mask!==void 0&&oD(r.mask);let l=r.version,u,d=new Error("Unknown error");if(l!==void 0)VL(l),u=z_(l,a,e,c,r.textEncoder);else for(let m=1;m<=40;m++)try{u=z_(m,a,e,c,r.textEncoder),l=m;break}catch(g){d=g}if(!l||!u)throw d;let p=rD(l,a,u,r.mask);p.assertDrawn();const h=r.border===void 0?2:r.border;if(!Number.isSafeInteger(h)||h<=0)throw new Error(`invalid border=${h}`);if(p=p.border(h,!1),r.scale!==void 0&&(p=p.scale(r.scale)),t==="raw")return p.toRaw();if(t==="ascii")return p.toASCII();if(t==="svg")return p.toSVG(r.optimize);if(t==="gif")return p.toGIF();if(t==="term")return p.toTerm();throw new Error(`Unknown output: ${t}`)}function cD(e,t={}){const{errorCorrection:n,version:r}=t,a=iD(e,"raw",{border:0,ecc:n,scale:1,version:r});return{edgeLength:a.length,finderLength:7,grid:a,value:e}}function ks(e){const{arena:t,...n}=e;return o.jsxs(ks.Root,{...n,children:[o.jsx(ks.Finder,{}),o.jsx(ks.Cells,{}),t&&o.jsx(ks.Arena,{children:typeof t=="string"?o.jsx("img",{alt:"Arena",src:t,style:{borderRadius:1,height:"100%",objectFit:"cover",width:"100%"}}):t})]})}(function(e){e.Context=I.createContext(null);function t(c){const{children:l,size:u="100%",value:d,version:p,errorCorrection:h,...m}=c,g=I.useMemo(()=>(I.Children.map(l,k=>!I.isValidElement(k)||typeof k.type=="string"?null:"displayName"in k.type&&k.type.displayName==="Arena"?!0:null)??[]).some(Boolean),[l]),v=I.useMemo(()=>{let k=h;return g&&h==="low"&&(k="medium"),cD(d,{errorCorrection:k,version:p})},[d,g,h,p]),b=1,_=v.edgeLength*b,x=v.finderLength*b/2,j=g?Math.floor(_/4):0,A=I.useMemo(()=>({arenaSize:j,cellSize:b,edgeSize:_,qrcode:v,finderSize:x}),[j,_,v,x]);return o.jsx(e.Context.Provider,{value:A,children:o.jsxs("svg",{...m,width:u,height:u,viewBox:`0 0 ${_} ${_}`,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("title",{children:"QR Code"}),l]})})}e.Root=t,(function(c){c.displayName="Root"})(t=e.Root||(e.Root={}));function n(c){const{className:l,fill:u,innerClassName:d,radius:p=.25}=c,{cellSize:h,edgeSize:m,finderSize:g}=I.useContext(e.Context);function v({position:b}){let _=g-(g-h)-h/2;b==="top-right"&&(_=m-g-(g-h)-h/2);let x=g-(g-h)-h/2;b==="bottom-left"&&(x=m-g-(g-h)-h/2);let j=g-h*1.5;b==="top-right"&&(j=m-g-h*1.5);let A=g-h*1.5;return b==="bottom-left"&&(A=m-g-h*1.5),o.jsxs(o.Fragment,{children:[o.jsx("rect",{className:l,stroke:u??"currentColor",fill:"transparent",x:_,y:x,width:h+(g-h)*2,height:h+(g-h)*2,rx:2*p*(g-h),ry:2*p*(g-h),strokeWidth:h}),o.jsx("rect",{className:d,fill:u??"currentColor",x:j,y:A,width:h*3,height:h*3,rx:2*p*h,ry:2*p*h})]})}return o.jsxs(o.Fragment,{children:[o.jsx(v,{position:"top-left"}),o.jsx(v,{position:"top-right"}),o.jsx(v,{position:"bottom-left"})]})}e.Finder=n,(function(c){c.displayName="Finder"})(n=e.Finder||(e.Finder={}));function r(c){const{className:l,fill:u="currentColor",inset:d=!0,radius:p=1}=c,{arenaSize:h,cellSize:m,qrcode:g}=I.useContext(e.Context),{edgeLength:v,finderLength:b}=g,_=I.useMemo(()=>{let x="";for(let j=0;j<g.grid.length;j++){const A=g.grid[j];if(A)for(let k=0;k<A.length;k++){if(!A[k])continue;const E=v/2-h/2,B=E+h;if(j>=E&&j<=B&&k>=E&&k<=B)continue;const M=j<b&&k<b,P=j<b&&k>=v-b,R=j>=v-b&&k<b;if(M||P||R)continue;const z=d?m*.1:0,q=(m-z*2)/2,Q=k*m+m/2,O=j*m+m/2,K=Q-q,$=Q+q,L=O-q,se=O+q,D=p*q;x+=[`M ${K+D},${L}`,`L ${$-D},${L}`,`A ${D},${D} 0 0,1 ${$},${L+D}`,`L ${$},${se-D}`,`A ${D},${D} 0 0,1 ${$-D},${se}`,`L ${K+D},${se}`,`A ${D},${D} 0 0,1 ${K},${se-D}`,`L ${K},${L+D}`,`A ${D},${D} 0 0,1 ${K+D},${L}`,"z"].join(" ")}}return x},[h,m,v,b,g.grid,d,p]);return o.jsx("path",{className:l,d:_,fill:u})}e.Cells=r,(function(c){c.displayName="Cells"})(r=e.Cells||(e.Cells={}));function a(c){const{children:l}=c,{arenaSize:u,cellSize:d,edgeSize:p}=I.useContext(e.Context),h=Math.ceil(p/2-u/2),m=u+u%2,g=d/2;return o.jsx("foreignObject",{x:h,y:h,width:m,height:m,children:o.jsx("div",{style:{alignItems:"center",display:"flex",fontSize:1,justifyContent:"center",height:"100%",overflow:"hidden",width:"100%",padding:g,boxSizing:"border-box"},children:l})})}e.Arena=a,(function(c){c.displayName="Arena"})(a=e.Arena||(e.Arena={}))})(ks||(ks={}));function lD(e={}){let t,n,r,a;return c=>({id:"baseAccount",name:"Base Account",rdns:"app.base.account",type:"baseAccount",async connect({chainId:l,withCapabilities:u,...d}={}){var p;try{const h=await this.getProvider(),m=l??((p=c.chains[0])==null?void 0:p.id);if(!m)throw new pa;const g=await h.request({method:"wallet_connect",params:[{capabilities:"capabilities"in d&&d.capabilities?d.capabilities:{},chainIds:[we(m),...c.chains.filter(_=>_.id!==m).map(_=>we(_.id))]}]}),v=g.accounts.map(_=>({address:xt(_.address),capabilities:_.capabilities??{}}));let b=Number(g.chainIds[0]);if(n||(n=this.onAccountsChanged.bind(this),h.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),h.on("chainChanged",r)),a||(a=this.onDisconnect.bind(this),h.on("disconnect",a)),l&&b!==l){const _=await this.switchChain({chainId:l}).catch(x=>{if(x.code===ct.code)throw x;return{id:b}});b=(_==null?void 0:_.id)??b}return{accounts:u?v:v.map(_=>_.address),chainId:b}}catch(h){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(h.message)?new ct(h):h}},async disconnect(){const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),r&&(l.removeListener("chainChanged",r),r=void 0),a&&(l.removeListener("disconnect",a),a=void 0),l.disconnect()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(u=>xt(u))},async getChainId(){const u=await(await this.getProvider()).request({method:"eth_chainId"});return Number(u)},async getProvider(){if(!t){const l=(()=>{var p;return typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:((p=e.preference)==null?void 0:p.options)??"all"}})(),{createBaseAccountSDK:u}=await je(async()=>{const{createBaseAccountSDK:p}=await import("./index-DsxB7ORb.js");return{createBaseAccountSDK:p}},[]);t=u({...e,appChainIds:c.chains.map(p=>p.id),preference:l}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:u}){var h,m,g,v;const d=c.chains.find(b=>b.id===u);if(!d)throw new sr(new pa);const p=await this.getProvider();try{return await p.request({method:"wallet_switchEthereumChain",params:[{chainId:we(d.id)}]}),d}catch(b){if(b.code===4902)try{let _;l!=null&&l.blockExplorerUrls?_=l.blockExplorerUrls:_=(h=d.blockExplorers)!=null&&h.default.url?[(m=d.blockExplorers)==null?void 0:m.default.url]:[];let x;(g=l==null?void 0:l.rpcUrls)!=null&&g.length?x=l.rpcUrls:x=[((v=d.rpcUrls.default)==null?void 0:v.http[0])??""];const j={blockExplorerUrls:_,chainId:we(u),chainName:(l==null?void 0:l.chainName)??d.name,iconUrls:l==null?void 0:l.iconUrls,nativeCurrency:(l==null?void 0:l.nativeCurrency)??d.nativeCurrency,rpcUrls:x};return await p.request({method:"wallet_addEthereumChain",params:[j]}),d}catch(_){throw new ct(_)}throw new sr(b)}},onAccountsChanged(l){l.length===0?this.onDisconnect():c.emitter.emit("change",{accounts:l.map(u=>xt(u))})},onChainChanged(l){const u=Number(l);c.emitter.emit("change",{chainId:u})},async onDisconnect(l){c.emitter.emit("disconnect");const u=await this.getProvider();n&&(u.removeListener("accountsChanged",n),n=void 0),r&&(u.removeListener("chainChanged",r),r=void 0),a&&(u.removeListener("disconnect",a),a=void 0)}})}Bv.type="metaMask";function Bv(e={}){let t,n,r,a,c,l,u,d;return p=>({id:"metaMaskSDK",name:"MetaMask",rdns:["io.metamask","io.metamask.mobile"],type:Bv.type,async setup(){const h=await this.getProvider();h!=null&&h.on&&(l||(l=this.onConnect.bind(this),h.on("connect",l)),a||(a=this.onAccountsChanged.bind(this),h.on("accountsChanged",a)))},async connect({chainId:h,isReconnecting:m,withCapabilities:g}={}){const v=await this.getProvider();u||(u=this.onDisplayUri,v.on("display_uri",u));let b=[];m&&(b=await this.getAccounts().catch(()=>[]));try{let _,x;b!=null&&b.length||(e.connectAndSign||e.connectWith?(e.connectAndSign?_=await t.connectAndSign({msg:e.connectAndSign}):e.connectWith&&(x=await t.connectWith({method:e.connectWith.method,params:e.connectWith.params})),b=await this.getAccounts()):b=(await t.connect()).map(k=>xt(k)));let j=await this.getChainId();if(h&&j!==h){const A=await this.switchChain({chainId:h}).catch(k=>{if(k.code===ct.code)throw k;return{id:j}});j=(A==null?void 0:A.id)??j}return u&&(v.removeListener("display_uri",u),u=void 0),_?v.emit("connectAndSign",{accounts:b,chainId:j,signResponse:_}):x&&v.emit("connectWith",{accounts:b,chainId:j,connectWithResponse:x}),l&&(v.removeListener("connect",l),l=void 0),a||(a=this.onAccountsChanged.bind(this),v.on("accountsChanged",a)),c||(c=this.onChainChanged.bind(this),v.on("chainChanged",c)),d||(d=this.onDisconnect.bind(this),v.on("disconnect",d)),{accounts:g?b.map(A=>({address:A,capabilities:{}})):b,chainId:j}}catch(_){const x=_;throw x.code===ct.code?new ct(x):x.code===js.code?new js(x):x}},async disconnect(){const h=await this.getProvider();c&&(h.removeListener("chainChanged",c),c=void 0),d&&(h.removeListener("disconnect",d),d=void 0),l||(l=this.onConnect.bind(this),h.on("connect",l)),await t.terminate()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(g=>xt(g))},async getChainId(){const h=await this.getProvider(),m=h.getChainId()||await(h==null?void 0:h.request({method:"eth_chainId"}));return Number(m)},async getProvider(){async function h(){var _,x,j,A,k;const m=await(async()=>{const{default:N}=await je(async()=>{const{default:E}=await import("./metamask-sdk-8TvB8vxr.js");return{default:E}},[]);return typeof N!="function"&&typeof N.default=="function"?N.default:N})(),g={};for(const N of p.chains)g[we(N.id)]=(_=Sk({chain:N,transports:p.transports}))==null?void 0:_[0];t=new m({_source:"wagmi",forceDeleteProvider:!1,forceInjectProvider:!1,injectProvider:!1,...e,readonlyRPCMap:g,dappMetadata:{...e.dappMetadata,name:(x=e.dappMetadata)!=null&&x.name?(j=e.dappMetadata)==null?void 0:j.name:"wagmi",url:(A=e.dappMetadata)!=null&&A.url?(k=e.dappMetadata)==null?void 0:k.url:typeof window<"u"?window.location.origin:"https://wagmi.sh"},useDeeplink:e.useDeeplink??!0});const v=await t.init(),b=v!=null&&v.activeProvider?v.activeProvider:t.getProvider();if(!b)throw new gr;return b}return n||(r||(r=h()),n=await r),n},async isAuthorized(){try{return!!(await tl(()=>jp(()=>this.getAccounts(),{timeout:200}),{delay:201,retryCount:3})).length}catch{return!1}},async switchChain({addEthereumChainParameter:h,chainId:m}){var x,j;const g=await this.getProvider(),v=p.chains.find(A=>A.id===m);if(!v)throw new sr(new pa);try{return await g.request({method:"wallet_switchEthereumChain",params:[{chainId:we(m)}]}),await b(),await _(m),v}catch(A){const k=A;if(k.code===ct.code)throw new ct(k);if(k.code===4902||((j=(x=k==null?void 0:k.data)==null?void 0:x.originalError)==null?void 0:j.code)===4902)try{return await g.request({method:"wallet_addEthereumChain",params:[{blockExplorerUrls:(()=>{const{default:N,...E}=v.blockExplorers??{};if(h!=null&&h.blockExplorerUrls)return h.blockExplorerUrls;if(N)return[N.url,...Object.values(E).map(B=>B.url)]})(),chainId:we(m),chainName:(h==null?void 0:h.chainName)??v.name,iconUrls:h==null?void 0:h.iconUrls,nativeCurrency:(h==null?void 0:h.nativeCurrency)??v.nativeCurrency,rpcUrls:(()=>{var N,E;return(N=h==null?void 0:h.rpcUrls)!=null&&N.length?h.rpcUrls:[((E=v.rpcUrls.default)==null?void 0:E.http[0])??""]})()}]}),await b(),await _(m),v}catch(N){const E=N;throw E.code===ct.code?new ct(E):new sr(E)}throw new sr(k)}async function b(){await tl(async()=>{const A=Tr(await g.request({method:"eth_chainId"}));if(A!==m)throw new Error("User rejected switch after adding network.");return A},{delay:50,retryCount:20})}async function _(A){await new Promise(k=>{const N=(E=>{"chainId"in E&&E.chainId===A&&(p.emitter.off("change",N),k())});p.emitter.on("change",N),p.emitter.emit("change",{chainId:A})})}},async onAccountsChanged(h){if(h.length===0)if(t.isExtensionActive())this.onDisconnect();else return;else if(p.emitter.listenerCount("connect")){const m=(await this.getChainId()).toString();this.onConnect({chainId:m})}else p.emitter.emit("change",{accounts:h.map(m=>xt(m))})},onChainChanged(h){const m=Number(h);p.emitter.emit("change",{chainId:m})},async onConnect(h){const m=await this.getAccounts();if(m.length===0)return;const g=Number(h.chainId);p.emitter.emit("connect",{accounts:m,chainId:g});const v=await this.getProvider();l&&(v.removeListener("connect",l),l=void 0),a||(a=this.onAccountsChanged.bind(this),v.on("accountsChanged",a)),c||(c=this.onChainChanged.bind(this),v.on("chainChanged",c)),d||(d=this.onDisconnect.bind(this),v.on("disconnect",d))},async onDisconnect(h){const m=await this.getProvider();h&&h.code===1013&&m&&(await this.getAccounts()).length||(p.emitter.emit("disconnect"),c&&(m.removeListener("chainChanged",c),c=void 0),d&&(m.removeListener("disconnect",d),d=void 0),l||(l=this.onConnect.bind(this),m.on("connect",l)))},onDisplayUri(h){p.emitter.emit("message",{type:"display_uri",data:h})}})}Tv.type="safe";function Tv(e={}){const{shimDisconnect:t=!1}=e;let n,r;return a=>({id:"safe",name:"Safe",type:Tv.type,async connect({withCapabilities:c}={}){var p;const l=await this.getProvider();if(!l)throw new gr;const u=await this.getAccounts(),d=await this.getChainId();return r||(r=this.onDisconnect.bind(this),l.on("disconnect",r)),t&&await((p=a.storage)==null?void 0:p.removeItem("safe.disconnected")),{accounts:c?u.map(h=>({address:h,capabilities:{}})):u,chainId:d}},async disconnect(){var l;const c=await this.getProvider();if(!c)throw new gr;r&&(c.removeListener("disconnect",r),r=void 0),t&&await((l=a.storage)==null?void 0:l.setItem("safe.disconnected",!0))},async getAccounts(){const c=await this.getProvider();if(!c)throw new gr;return(await c.request({method:"eth_accounts"})).map(xt)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!n){const{default:l}=await je(async()=>{const{default:h}=await import("./index-BIqjq0q5.js");return{default:h}},__vite__mapDeps([0,1])),u=new l(e),d=await jp(()=>u.safe.getInfo(),{timeout:e.unstable_getInfoTimeout??10});if(!d)throw new Error("Could not load Safe information");const p=await(async()=>{const h=await je(()=>import("./index-DHVwxjrm.js").then(m=>m.i),__vite__mapDeps([2,1,3]));return typeof h.SafeAppProvider!="function"&&typeof h.default.SafeAppProvider=="function"?h.default.SafeAppProvider:h.SafeAppProvider})();n=new p(d,u)}return n}},async getChainId(){const c=await this.getProvider();if(!c)throw new gr;return Number(c.chainId)},async isAuthorized(){var c;try{return t&&await((c=a.storage)==null?void 0:c.getItem("safe.disconnected"))?!1:!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){a.emitter.emit("disconnect")}})}Pv.type="walletConnect";function Pv(e){const t=e.isNewChainsStale??!0;let n,r;const a="eip155";let c,l,u,d,p,h;return m=>({id:"walletConnect",name:"WalletConnect",type:Pv.type,async setup(){const g=await this.getProvider().catch(()=>null);g&&(u||(u=this.onConnect.bind(this),g.on("connect",u)),p||(p=this.onSessionDelete.bind(this),g.on("session_delete",p)))},async connect({chainId:g,withCapabilities:v,...b}={}){var _,x;try{const j=await this.getProvider();if(!j)throw new gr;d||(d=this.onDisplayUri,j.on("display_uri",d));let A=g;if(!A){const B=await((_=m.storage)==null?void 0:_.getItem("state"))??{};m.chains.some(P=>P.id===B.chainId)?A=B.chainId:A=(x=m.chains[0])==null?void 0:x.id}if(!A)throw new Error("No chains found on connector.");const k=await this.isChainsStale();if(j.session&&k&&await j.disconnect(),!j.session||k){const B=m.chains.filter(M=>M.id!==A).map(M=>M.id);await j.connect({optionalChains:[A,...B],..."pairingTopic"in b?{pairingTopic:b.pairingTopic}:{}}),this.setRequestedChainsIds(m.chains.map(M=>M.id))}const N=(await j.enable()).map(B=>xt(B));let E=await this.getChainId();if(g&&E!==g){const B=await this.switchChain({chainId:g}).catch(M=>{var P;if(M.code===ct.code&&((P=M.cause)==null?void 0:P.message)!=="Missing or invalid. request() method: wallet_addEthereumChain")throw M;return{id:E}});E=(B==null?void 0:B.id)??E}return d&&(j.removeListener("display_uri",d),d=void 0),u&&(j.removeListener("connect",u),u=void 0),c||(c=this.onAccountsChanged.bind(this),j.on("accountsChanged",c)),l||(l=this.onChainChanged.bind(this),j.on("chainChanged",l)),h||(h=this.onDisconnect.bind(this),j.on("disconnect",h)),p||(p=this.onSessionDelete.bind(this),j.on("session_delete",p)),{accounts:v?N.map(B=>({address:B,capabilities:{}})):N,chainId:E}}catch(j){throw/(user rejected|connection request reset)/i.test(j==null?void 0:j.message)?new ct(j):j}},async disconnect(){const g=await this.getProvider();try{await(g==null?void 0:g.disconnect())}catch(v){if(!/No matching key/i.test(v.message))throw v}finally{l&&(g==null||g.removeListener("chainChanged",l),l=void 0),h&&(g==null||g.removeListener("disconnect",h),h=void 0),u||(u=this.onConnect.bind(this),g==null||g.on("connect",u)),c&&(g==null||g.removeListener("accountsChanged",c),c=void 0),p&&(g==null||g.removeListener("session_delete",p),p=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(v=>xt(v))},async getProvider({chainId:g}={}){var b;async function v(){const _=m.chains.map(j=>j.id);if(!_.length)return;const{EthereumProvider:x}=await je(async()=>{const{EthereumProvider:j}=await import("./index.es-Hqwz_Ukd.js").then(A=>A.x);return{EthereumProvider:j}},__vite__mapDeps([4,3]));return await x.init({...e,disableProviderPing:!0,optionalChains:_,projectId:e.projectId,rpcMap:Object.fromEntries(m.chains.map(j=>{const[A]=Sk({chain:j,transports:m.transports});return[j.id,A]})),showQrModal:e.showQrModal??!0})}return n||(r||(r=v()),n=await r,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY)),g&&await((b=this.switchChain)==null?void 0:b.call(this,{chainId:g})),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[g,v]=await Promise.all([this.getAccounts(),this.getProvider()]);return g.length?await this.isChainsStale()&&v.session?(await v.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:g,chainId:v}){var x,j,A;const b=await this.getProvider();if(!b)throw new gr;const _=m.chains.find(k=>k.id===v);if(!_)throw new sr(new pa);try{await Promise.all([new Promise(N=>{const E=({chainId:B})=>{B===v&&(m.emitter.off("change",E),N())};m.emitter.on("change",E)}),b.request({method:"wallet_switchEthereumChain",params:[{chainId:we(v)}]})]);const k=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...k,v]),_}catch(k){const N=k;if(/(user rejected)/i.test(N.message))throw new ct(N);try{let E;g!=null&&g.blockExplorerUrls?E=g.blockExplorerUrls:E=(x=_.blockExplorers)!=null&&x.default.url?[(j=_.blockExplorers)==null?void 0:j.default.url]:[];let B;(A=g==null?void 0:g.rpcUrls)!=null&&A.length?B=g.rpcUrls:B=[..._.rpcUrls.default.http];const M={blockExplorerUrls:E,chainId:we(v),chainName:(g==null?void 0:g.chainName)??_.name,iconUrls:g==null?void 0:g.iconUrls,nativeCurrency:(g==null?void 0:g.nativeCurrency)??_.nativeCurrency,rpcUrls:B};await b.request({method:"wallet_addEthereumChain",params:[M]});const P=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...P,v]),_}catch(E){throw new ct(E)}}},onAccountsChanged(g){g.length===0?this.onDisconnect():m.emitter.emit("change",{accounts:g.map(v=>xt(v))})},onChainChanged(g){const v=Number(g);m.emitter.emit("change",{chainId:v})},async onConnect(g){const v=Number(g.chainId),b=await this.getAccounts();m.emitter.emit("connect",{accounts:b,chainId:v})},async onDisconnect(g){this.setRequestedChainsIds([]),m.emitter.emit("disconnect");const v=await this.getProvider();c&&(v.removeListener("accountsChanged",c),c=void 0),l&&(v.removeListener("chainChanged",l),l=void 0),h&&(v.removeListener("disconnect",h),h=void 0),p&&(v.removeListener("session_delete",p),p=void 0),u||(u=this.onConnect.bind(this),v.on("connect",u))},onDisplayUri(g){m.emitter.emit("message",{type:"display_uri",data:g})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var v,b,_;return n?((_=(b=(v=n.session)==null?void 0:v.namespaces[a])==null?void 0:b.accounts)==null?void 0:_.map(x=>Number.parseInt(x.split(":")[1]||"",10)))??[]:[]},async getRequestedChainsIds(){var g;return await((g=m.storage)==null?void 0:g.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!t)return!1;const g=m.chains.map(_=>_.id),v=this.getNamespaceChainsIds();if(v.length&&!v.some(_=>g.includes(_)))return!1;const b=await this.getRequestedChainsIds();return!g.every(_=>b.includes(_))},async setRequestedChainsIds(g){var v;await((v=m.storage)==null?void 0:v.setItem(this.requestedChainsStorageKey,g))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}var Xh={},uD=768,vc=nA({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),B4=Ix({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),hy=cA({conditions:{defaultCondition:"base",conditionNames:["base","hover","active"],responsiveArray:void 0},styles:{background:{values:{accentColor:{conditions:{base:"ju367v9i",hover:"ju367v9j",active:"ju367v9k"},defaultClass:"ju367v9i"},accentColorForeground:{conditions:{base:"ju367v9l",hover:"ju367v9m",active:"ju367v9n"},defaultClass:"ju367v9l"},actionButtonBorder:{conditions:{base:"ju367v9o",hover:"ju367v9p",active:"ju367v9q"},defaultClass:"ju367v9o"},actionButtonBorderMobile:{conditions:{base:"ju367v9r",hover:"ju367v9s",active:"ju367v9t"},defaultClass:"ju367v9r"},actionButtonSecondaryBackground:{conditions:{base:"ju367v9u",hover:"ju367v9v",active:"ju367v9w"},defaultClass:"ju367v9u"},closeButton:{conditions:{base:"ju367v9x",hover:"ju367v9y",active:"ju367v9z"},defaultClass:"ju367v9x"},closeButtonBackground:{conditions:{base:"ju367va0",hover:"ju367va1",active:"ju367va2"},defaultClass:"ju367va0"},connectButtonBackground:{conditions:{base:"ju367va3",hover:"ju367va4",active:"ju367va5"},defaultClass:"ju367va3"},connectButtonBackgroundError:{conditions:{base:"ju367va6",hover:"ju367va7",active:"ju367va8"},defaultClass:"ju367va6"},connectButtonInnerBackground:{conditions:{base:"ju367va9",hover:"ju367vaa",active:"ju367vab"},defaultClass:"ju367va9"},connectButtonText:{conditions:{base:"ju367vac",hover:"ju367vad",active:"ju367vae"},defaultClass:"ju367vac"},connectButtonTextError:{conditions:{base:"ju367vaf",hover:"ju367vag",active:"ju367vah"},defaultClass:"ju367vaf"},connectionIndicator:{conditions:{base:"ju367vai",hover:"ju367vaj",active:"ju367vak"},defaultClass:"ju367vai"},downloadBottomCardBackground:{conditions:{base:"ju367val",hover:"ju367vam",active:"ju367van"},defaultClass:"ju367val"},downloadTopCardBackground:{conditions:{base:"ju367vao",hover:"ju367vap",active:"ju367vaq"},defaultClass:"ju367vao"},error:{conditions:{base:"ju367var",hover:"ju367vas",active:"ju367vat"},defaultClass:"ju367var"},generalBorder:{conditions:{base:"ju367vau",hover:"ju367vav",active:"ju367vaw"},defaultClass:"ju367vau"},generalBorderDim:{conditions:{base:"ju367vax",hover:"ju367vay",active:"ju367vaz"},defaultClass:"ju367vax"},menuItemBackground:{conditions:{base:"ju367vb0",hover:"ju367vb1",active:"ju367vb2"},defaultClass:"ju367vb0"},modalBackdrop:{conditions:{base:"ju367vb3",hover:"ju367vb4",active:"ju367vb5"},defaultClass:"ju367vb3"},modalBackground:{conditions:{base:"ju367vb6",hover:"ju367vb7",active:"ju367vb8"},defaultClass:"ju367vb6"},modalBorder:{conditions:{base:"ju367vb9",hover:"ju367vba",active:"ju367vbb"},defaultClass:"ju367vb9"},modalText:{conditions:{base:"ju367vbc",hover:"ju367vbd",active:"ju367vbe"},defaultClass:"ju367vbc"},modalTextDim:{conditions:{base:"ju367vbf",hover:"ju367vbg",active:"ju367vbh"},defaultClass:"ju367vbf"},modalTextSecondary:{conditions:{base:"ju367vbi",hover:"ju367vbj",active:"ju367vbk"},defaultClass:"ju367vbi"},profileAction:{conditions:{base:"ju367vbl",hover:"ju367vbm",active:"ju367vbn"},defaultClass:"ju367vbl"},profileActionHover:{conditions:{base:"ju367vbo",hover:"ju367vbp",active:"ju367vbq"},defaultClass:"ju367vbo"},profileForeground:{conditions:{base:"ju367vbr",hover:"ju367vbs",active:"ju367vbt"},defaultClass:"ju367vbr"},selectedOptionBorder:{conditions:{base:"ju367vbu",hover:"ju367vbv",active:"ju367vbw"},defaultClass:"ju367vbu"},standby:{conditions:{base:"ju367vbx",hover:"ju367vby",active:"ju367vbz"},defaultClass:"ju367vbx"}}},borderColor:{values:{accentColor:{conditions:{base:"ju367vc0",hover:"ju367vc1",active:"ju367vc2"},defaultClass:"ju367vc0"},accentColorForeground:{conditions:{base:"ju367vc3",hover:"ju367vc4",active:"ju367vc5"},defaultClass:"ju367vc3"},actionButtonBorder:{conditions:{base:"ju367vc6",hover:"ju367vc7",active:"ju367vc8"},defaultClass:"ju367vc6"},actionButtonBorderMobile:{conditions:{base:"ju367vc9",hover:"ju367vca",active:"ju367vcb"},defaultClass:"ju367vc9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vcc",hover:"ju367vcd",active:"ju367vce"},defaultClass:"ju367vcc"},closeButton:{conditions:{base:"ju367vcf",hover:"ju367vcg",active:"ju367vch"},defaultClass:"ju367vcf"},closeButtonBackground:{conditions:{base:"ju367vci",hover:"ju367vcj",active:"ju367vck"},defaultClass:"ju367vci"},connectButtonBackground:{conditions:{base:"ju367vcl",hover:"ju367vcm",active:"ju367vcn"},defaultClass:"ju367vcl"},connectButtonBackgroundError:{conditions:{base:"ju367vco",hover:"ju367vcp",active:"ju367vcq"},defaultClass:"ju367vco"},connectButtonInnerBackground:{conditions:{base:"ju367vcr",hover:"ju367vcs",active:"ju367vct"},defaultClass:"ju367vcr"},connectButtonText:{conditions:{base:"ju367vcu",hover:"ju367vcv",active:"ju367vcw"},defaultClass:"ju367vcu"},connectButtonTextError:{conditions:{base:"ju367vcx",hover:"ju367vcy",active:"ju367vcz"},defaultClass:"ju367vcx"},connectionIndicator:{conditions:{base:"ju367vd0",hover:"ju367vd1",active:"ju367vd2"},defaultClass:"ju367vd0"},downloadBottomCardBackground:{conditions:{base:"ju367vd3",hover:"ju367vd4",active:"ju367vd5"},defaultClass:"ju367vd3"},downloadTopCardBackground:{conditions:{base:"ju367vd6",hover:"ju367vd7",active:"ju367vd8"},defaultClass:"ju367vd6"},error:{conditions:{base:"ju367vd9",hover:"ju367vda",active:"ju367vdb"},defaultClass:"ju367vd9"},generalBorder:{conditions:{base:"ju367vdc",hover:"ju367vdd",active:"ju367vde"},defaultClass:"ju367vdc"},generalBorderDim:{conditions:{base:"ju367vdf",hover:"ju367vdg",active:"ju367vdh"},defaultClass:"ju367vdf"},menuItemBackground:{conditions:{base:"ju367vdi",hover:"ju367vdj",active:"ju367vdk"},defaultClass:"ju367vdi"},modalBackdrop:{conditions:{base:"ju367vdl",hover:"ju367vdm",active:"ju367vdn"},defaultClass:"ju367vdl"},modalBackground:{conditions:{base:"ju367vdo",hover:"ju367vdp",active:"ju367vdq"},defaultClass:"ju367vdo"},modalBorder:{conditions:{base:"ju367vdr",hover:"ju367vds",active:"ju367vdt"},defaultClass:"ju367vdr"},modalText:{conditions:{base:"ju367vdu",hover:"ju367vdv",active:"ju367vdw"},defaultClass:"ju367vdu"},modalTextDim:{conditions:{base:"ju367vdx",hover:"ju367vdy",active:"ju367vdz"},defaultClass:"ju367vdx"},modalTextSecondary:{conditions:{base:"ju367ve0",hover:"ju367ve1",active:"ju367ve2"},defaultClass:"ju367ve0"},profileAction:{conditions:{base:"ju367ve3",hover:"ju367ve4",active:"ju367ve5"},defaultClass:"ju367ve3"},profileActionHover:{conditions:{base:"ju367ve6",hover:"ju367ve7",active:"ju367ve8"},defaultClass:"ju367ve6"},profileForeground:{conditions:{base:"ju367ve9",hover:"ju367vea",active:"ju367veb"},defaultClass:"ju367ve9"},selectedOptionBorder:{conditions:{base:"ju367vec",hover:"ju367ved",active:"ju367vee"},defaultClass:"ju367vec"},standby:{conditions:{base:"ju367vef",hover:"ju367veg",active:"ju367veh"},defaultClass:"ju367vef"}}},boxShadow:{values:{connectButton:{conditions:{base:"ju367vei",hover:"ju367vej",active:"ju367vek"},defaultClass:"ju367vei"},dialog:{conditions:{base:"ju367vel",hover:"ju367vem",active:"ju367ven"},defaultClass:"ju367vel"},profileDetailsAction:{conditions:{base:"ju367veo",hover:"ju367vep",active:"ju367veq"},defaultClass:"ju367veo"},selectedOption:{conditions:{base:"ju367ver",hover:"ju367ves",active:"ju367vet"},defaultClass:"ju367ver"},selectedWallet:{conditions:{base:"ju367veu",hover:"ju367vev",active:"ju367vew"},defaultClass:"ju367veu"},walletLogo:{conditions:{base:"ju367vex",hover:"ju367vey",active:"ju367vez"},defaultClass:"ju367vex"}}},color:{values:{accentColor:{conditions:{base:"ju367vf0",hover:"ju367vf1",active:"ju367vf2"},defaultClass:"ju367vf0"},accentColorForeground:{conditions:{base:"ju367vf3",hover:"ju367vf4",active:"ju367vf5"},defaultClass:"ju367vf3"},actionButtonBorder:{conditions:{base:"ju367vf6",hover:"ju367vf7",active:"ju367vf8"},defaultClass:"ju367vf6"},actionButtonBorderMobile:{conditions:{base:"ju367vf9",hover:"ju367vfa",active:"ju367vfb"},defaultClass:"ju367vf9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vfc",hover:"ju367vfd",active:"ju367vfe"},defaultClass:"ju367vfc"},closeButton:{conditions:{base:"ju367vff",hover:"ju367vfg",active:"ju367vfh"},defaultClass:"ju367vff"},closeButtonBackground:{conditions:{base:"ju367vfi",hover:"ju367vfj",active:"ju367vfk"},defaultClass:"ju367vfi"},connectButtonBackground:{conditions:{base:"ju367vfl",hover:"ju367vfm",active:"ju367vfn"},defaultClass:"ju367vfl"},connectButtonBackgroundError:{conditions:{base:"ju367vfo",hover:"ju367vfp",active:"ju367vfq"},defaultClass:"ju367vfo"},connectButtonInnerBackground:{conditions:{base:"ju367vfr",hover:"ju367vfs",active:"ju367vft"},defaultClass:"ju367vfr"},connectButtonText:{conditions:{base:"ju367vfu",hover:"ju367vfv",active:"ju367vfw"},defaultClass:"ju367vfu"},connectButtonTextError:{conditions:{base:"ju367vfx",hover:"ju367vfy",active:"ju367vfz"},defaultClass:"ju367vfx"},connectionIndicator:{conditions:{base:"ju367vg0",hover:"ju367vg1",active:"ju367vg2"},defaultClass:"ju367vg0"},downloadBottomCardBackground:{conditions:{base:"ju367vg3",hover:"ju367vg4",active:"ju367vg5"},defaultClass:"ju367vg3"},downloadTopCardBackground:{conditions:{base:"ju367vg6",hover:"ju367vg7",active:"ju367vg8"},defaultClass:"ju367vg6"},error:{conditions:{base:"ju367vg9",hover:"ju367vga",active:"ju367vgb"},defaultClass:"ju367vg9"},generalBorder:{conditions:{base:"ju367vgc",hover:"ju367vgd",active:"ju367vge"},defaultClass:"ju367vgc"},generalBorderDim:{conditions:{base:"ju367vgf",hover:"ju367vgg",active:"ju367vgh"},defaultClass:"ju367vgf"},menuItemBackground:{conditions:{base:"ju367vgi",hover:"ju367vgj",active:"ju367vgk"},defaultClass:"ju367vgi"},modalBackdrop:{conditions:{base:"ju367vgl",hover:"ju367vgm",active:"ju367vgn"},defaultClass:"ju367vgl"},modalBackground:{conditions:{base:"ju367vgo",hover:"ju367vgp",active:"ju367vgq"},defaultClass:"ju367vgo"},modalBorder:{conditions:{base:"ju367vgr",hover:"ju367vgs",active:"ju367vgt"},defaultClass:"ju367vgr"},modalText:{conditions:{base:"ju367vgu",hover:"ju367vgv",active:"ju367vgw"},defaultClass:"ju367vgu"},modalTextDim:{conditions:{base:"ju367vgx",hover:"ju367vgy",active:"ju367vgz"},defaultClass:"ju367vgx"},modalTextSecondary:{conditions:{base:"ju367vh0",hover:"ju367vh1",active:"ju367vh2"},defaultClass:"ju367vh0"},profileAction:{conditions:{base:"ju367vh3",hover:"ju367vh4",active:"ju367vh5"},defaultClass:"ju367vh3"},profileActionHover:{conditions:{base:"ju367vh6",hover:"ju367vh7",active:"ju367vh8"},defaultClass:"ju367vh6"},profileForeground:{conditions:{base:"ju367vh9",hover:"ju367vha",active:"ju367vhb"},defaultClass:"ju367vh9"},selectedOptionBorder:{conditions:{base:"ju367vhc",hover:"ju367vhd",active:"ju367vhe"},defaultClass:"ju367vhc"},standby:{conditions:{base:"ju367vhf",hover:"ju367vhg",active:"ju367vhh"},defaultClass:"ju367vhf"}}}}},{conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0},styles:{alignItems:{values:{"flex-start":{conditions:{smallScreen:"ju367v0",largeScreen:"ju367v1"},defaultClass:"ju367v0"},"flex-end":{conditions:{smallScreen:"ju367v2",largeScreen:"ju367v3"},defaultClass:"ju367v2"},center:{conditions:{smallScreen:"ju367v4",largeScreen:"ju367v5"},defaultClass:"ju367v4"}}},display:{values:{none:{conditions:{smallScreen:"ju367v6",largeScreen:"ju367v7"},defaultClass:"ju367v6"},block:{conditions:{smallScreen:"ju367v8",largeScreen:"ju367v9"},defaultClass:"ju367v8"},flex:{conditions:{smallScreen:"ju367va",largeScreen:"ju367vb"},defaultClass:"ju367va"},inline:{conditions:{smallScreen:"ju367vc",largeScreen:"ju367vd"},defaultClass:"ju367vc"}}}}},{conditions:void 0,styles:{margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},alignSelf:{values:{"flex-start":{defaultClass:"ju367ve"},"flex-end":{defaultClass:"ju367vf"},center:{defaultClass:"ju367vg"}}},backgroundSize:{values:{cover:{defaultClass:"ju367vh"}}},borderRadius:{values:{1:{defaultClass:"ju367vi"},6:{defaultClass:"ju367vj"},10:{defaultClass:"ju367vk"},13:{defaultClass:"ju367vl"},actionButton:{defaultClass:"ju367vm"},connectButton:{defaultClass:"ju367vn"},menuButton:{defaultClass:"ju367vo"},modal:{defaultClass:"ju367vp"},modalMobile:{defaultClass:"ju367vq"},"25%":{defaultClass:"ju367vr"},full:{defaultClass:"ju367vs"}}},borderStyle:{values:{solid:{defaultClass:"ju367vt"}}},borderWidth:{values:{0:{defaultClass:"ju367vu"},1:{defaultClass:"ju367vv"},2:{defaultClass:"ju367vw"},4:{defaultClass:"ju367vx"}}},cursor:{values:{pointer:{defaultClass:"ju367vy"},none:{defaultClass:"ju367vz"}}},pointerEvents:{values:{none:{defaultClass:"ju367v10"},all:{defaultClass:"ju367v11"}}},minHeight:{values:{8:{defaultClass:"ju367v12"},44:{defaultClass:"ju367v13"}}},flexDirection:{values:{row:{defaultClass:"ju367v14"},column:{defaultClass:"ju367v15"}}},fontFamily:{values:{body:{defaultClass:"ju367v16"}}},fontSize:{values:{12:{defaultClass:"ju367v17"},13:{defaultClass:"ju367v18"},14:{defaultClass:"ju367v19"},16:{defaultClass:"ju367v1a"},18:{defaultClass:"ju367v1b"},20:{defaultClass:"ju367v1c"},23:{defaultClass:"ju367v1d"}}},fontWeight:{values:{regular:{defaultClass:"ju367v1e"},medium:{defaultClass:"ju367v1f"},semibold:{defaultClass:"ju367v1g"},bold:{defaultClass:"ju367v1h"},heavy:{defaultClass:"ju367v1i"}}},gap:{values:{0:{defaultClass:"ju367v1j"},1:{defaultClass:"ju367v1k"},2:{defaultClass:"ju367v1l"},3:{defaultClass:"ju367v1m"},4:{defaultClass:"ju367v1n"},5:{defaultClass:"ju367v1o"},6:{defaultClass:"ju367v1p"},8:{defaultClass:"ju367v1q"},10:{defaultClass:"ju367v1r"},12:{defaultClass:"ju367v1s"},14:{defaultClass:"ju367v1t"},16:{defaultClass:"ju367v1u"},18:{defaultClass:"ju367v1v"},20:{defaultClass:"ju367v1w"},24:{defaultClass:"ju367v1x"},28:{defaultClass:"ju367v1y"},32:{defaultClass:"ju367v1z"},36:{defaultClass:"ju367v20"},44:{defaultClass:"ju367v21"},64:{defaultClass:"ju367v22"},"-1":{defaultClass:"ju367v23"}}},height:{values:{1:{defaultClass:"ju367v24"},2:{defaultClass:"ju367v25"},4:{defaultClass:"ju367v26"},8:{defaultClass:"ju367v27"},12:{defaultClass:"ju367v28"},20:{defaultClass:"ju367v29"},24:{defaultClass:"ju367v2a"},28:{defaultClass:"ju367v2b"},30:{defaultClass:"ju367v2c"},32:{defaultClass:"ju367v2d"},34:{defaultClass:"ju367v2e"},36:{defaultClass:"ju367v2f"},40:{defaultClass:"ju367v2g"},44:{defaultClass:"ju367v2h"},48:{defaultClass:"ju367v2i"},54:{defaultClass:"ju367v2j"},60:{defaultClass:"ju367v2k"},200:{defaultClass:"ju367v2l"},full:{defaultClass:"ju367v2m"},max:{defaultClass:"ju367v2n"}}},justifyContent:{values:{"flex-start":{defaultClass:"ju367v2o"},"flex-end":{defaultClass:"ju367v2p"},center:{defaultClass:"ju367v2q"},"space-between":{defaultClass:"ju367v2r"},"space-around":{defaultClass:"ju367v2s"}}},textAlign:{values:{left:{defaultClass:"ju367v2t"},center:{defaultClass:"ju367v2u"},inherit:{defaultClass:"ju367v2v"}}},marginBottom:{values:{0:{defaultClass:"ju367v2w"},1:{defaultClass:"ju367v2x"},2:{defaultClass:"ju367v2y"},3:{defaultClass:"ju367v2z"},4:{defaultClass:"ju367v30"},5:{defaultClass:"ju367v31"},6:{defaultClass:"ju367v32"},8:{defaultClass:"ju367v33"},10:{defaultClass:"ju367v34"},12:{defaultClass:"ju367v35"},14:{defaultClass:"ju367v36"},16:{defaultClass:"ju367v37"},18:{defaultClass:"ju367v38"},20:{defaultClass:"ju367v39"},24:{defaultClass:"ju367v3a"},28:{defaultClass:"ju367v3b"},32:{defaultClass:"ju367v3c"},36:{defaultClass:"ju367v3d"},44:{defaultClass:"ju367v3e"},64:{defaultClass:"ju367v3f"},"-1":{defaultClass:"ju367v3g"}}},marginLeft:{values:{0:{defaultClass:"ju367v3h"},1:{defaultClass:"ju367v3i"},2:{defaultClass:"ju367v3j"},3:{defaultClass:"ju367v3k"},4:{defaultClass:"ju367v3l"},5:{defaultClass:"ju367v3m"},6:{defaultClass:"ju367v3n"},8:{defaultClass:"ju367v3o"},10:{defaultClass:"ju367v3p"},12:{defaultClass:"ju367v3q"},14:{defaultClass:"ju367v3r"},16:{defaultClass:"ju367v3s"},18:{defaultClass:"ju367v3t"},20:{defaultClass:"ju367v3u"},24:{defaultClass:"ju367v3v"},28:{defaultClass:"ju367v3w"},32:{defaultClass:"ju367v3x"},36:{defaultClass:"ju367v3y"},44:{defaultClass:"ju367v3z"},64:{defaultClass:"ju367v40"},"-1":{defaultClass:"ju367v41"}}},marginRight:{values:{0:{defaultClass:"ju367v42"},1:{defaultClass:"ju367v43"},2:{defaultClass:"ju367v44"},3:{defaultClass:"ju367v45"},4:{defaultClass:"ju367v46"},5:{defaultClass:"ju367v47"},6:{defaultClass:"ju367v48"},8:{defaultClass:"ju367v49"},10:{defaultClass:"ju367v4a"},12:{defaultClass:"ju367v4b"},14:{defaultClass:"ju367v4c"},16:{defaultClass:"ju367v4d"},18:{defaultClass:"ju367v4e"},20:{defaultClass:"ju367v4f"},24:{defaultClass:"ju367v4g"},28:{defaultClass:"ju367v4h"},32:{defaultClass:"ju367v4i"},36:{defaultClass:"ju367v4j"},44:{defaultClass:"ju367v4k"},64:{defaultClass:"ju367v4l"},"-1":{defaultClass:"ju367v4m"}}},marginTop:{values:{0:{defaultClass:"ju367v4n"},1:{defaultClass:"ju367v4o"},2:{defaultClass:"ju367v4p"},3:{defaultClass:"ju367v4q"},4:{defaultClass:"ju367v4r"},5:{defaultClass:"ju367v4s"},6:{defaultClass:"ju367v4t"},8:{defaultClass:"ju367v4u"},10:{defaultClass:"ju367v4v"},12:{defaultClass:"ju367v4w"},14:{defaultClass:"ju367v4x"},16:{defaultClass:"ju367v4y"},18:{defaultClass:"ju367v4z"},20:{defaultClass:"ju367v50"},24:{defaultClass:"ju367v51"},28:{defaultClass:"ju367v52"},32:{defaultClass:"ju367v53"},36:{defaultClass:"ju367v54"},44:{defaultClass:"ju367v55"},64:{defaultClass:"ju367v56"},"-1":{defaultClass:"ju367v57"}}},maxWidth:{values:{1:{defaultClass:"ju367v58"},2:{defaultClass:"ju367v59"},4:{defaultClass:"ju367v5a"},8:{defaultClass:"ju367v5b"},12:{defaultClass:"ju367v5c"},20:{defaultClass:"ju367v5d"},24:{defaultClass:"ju367v5e"},28:{defaultClass:"ju367v5f"},30:{defaultClass:"ju367v5g"},32:{defaultClass:"ju367v5h"},34:{defaultClass:"ju367v5i"},36:{defaultClass:"ju367v5j"},40:{defaultClass:"ju367v5k"},44:{defaultClass:"ju367v5l"},48:{defaultClass:"ju367v5m"},54:{defaultClass:"ju367v5n"},60:{defaultClass:"ju367v5o"},200:{defaultClass:"ju367v5p"},full:{defaultClass:"ju367v5q"},max:{defaultClass:"ju367v5r"}}},minWidth:{values:{1:{defaultClass:"ju367v5s"},2:{defaultClass:"ju367v5t"},4:{defaultClass:"ju367v5u"},8:{defaultClass:"ju367v5v"},12:{defaultClass:"ju367v5w"},20:{defaultClass:"ju367v5x"},24:{defaultClass:"ju367v5y"},28:{defaultClass:"ju367v5z"},30:{defaultClass:"ju367v60"},32:{defaultClass:"ju367v61"},34:{defaultClass:"ju367v62"},36:{defaultClass:"ju367v63"},40:{defaultClass:"ju367v64"},44:{defaultClass:"ju367v65"},48:{defaultClass:"ju367v66"},54:{defaultClass:"ju367v67"},60:{defaultClass:"ju367v68"},200:{defaultClass:"ju367v69"},full:{defaultClass:"ju367v6a"},max:{defaultClass:"ju367v6b"}}},overflow:{values:{hidden:{defaultClass:"ju367v6c"}}},paddingBottom:{values:{0:{defaultClass:"ju367v6d"},1:{defaultClass:"ju367v6e"},2:{defaultClass:"ju367v6f"},3:{defaultClass:"ju367v6g"},4:{defaultClass:"ju367v6h"},5:{defaultClass:"ju367v6i"},6:{defaultClass:"ju367v6j"},8:{defaultClass:"ju367v6k"},10:{defaultClass:"ju367v6l"},12:{defaultClass:"ju367v6m"},14:{defaultClass:"ju367v6n"},16:{defaultClass:"ju367v6o"},18:{defaultClass:"ju367v6p"},20:{defaultClass:"ju367v6q"},24:{defaultClass:"ju367v6r"},28:{defaultClass:"ju367v6s"},32:{defaultClass:"ju367v6t"},36:{defaultClass:"ju367v6u"},44:{defaultClass:"ju367v6v"},64:{defaultClass:"ju367v6w"},"-1":{defaultClass:"ju367v6x"}}},paddingLeft:{values:{0:{defaultClass:"ju367v6y"},1:{defaultClass:"ju367v6z"},2:{defaultClass:"ju367v70"},3:{defaultClass:"ju367v71"},4:{defaultClass:"ju367v72"},5:{defaultClass:"ju367v73"},6:{defaultClass:"ju367v74"},8:{defaultClass:"ju367v75"},10:{defaultClass:"ju367v76"},12:{defaultClass:"ju367v77"},14:{defaultClass:"ju367v78"},16:{defaultClass:"ju367v79"},18:{defaultClass:"ju367v7a"},20:{defaultClass:"ju367v7b"},24:{defaultClass:"ju367v7c"},28:{defaultClass:"ju367v7d"},32:{defaultClass:"ju367v7e"},36:{defaultClass:"ju367v7f"},44:{defaultClass:"ju367v7g"},64:{defaultClass:"ju367v7h"},"-1":{defaultClass:"ju367v7i"}}},paddingRight:{values:{0:{defaultClass:"ju367v7j"},1:{defaultClass:"ju367v7k"},2:{defaultClass:"ju367v7l"},3:{defaultClass:"ju367v7m"},4:{defaultClass:"ju367v7n"},5:{defaultClass:"ju367v7o"},6:{defaultClass:"ju367v7p"},8:{defaultClass:"ju367v7q"},10:{defaultClass:"ju367v7r"},12:{defaultClass:"ju367v7s"},14:{defaultClass:"ju367v7t"},16:{defaultClass:"ju367v7u"},18:{defaultClass:"ju367v7v"},20:{defaultClass:"ju367v7w"},24:{defaultClass:"ju367v7x"},28:{defaultClass:"ju367v7y"},32:{defaultClass:"ju367v7z"},36:{defaultClass:"ju367v80"},44:{defaultClass:"ju367v81"},64:{defaultClass:"ju367v82"},"-1":{defaultClass:"ju367v83"}}},paddingTop:{values:{0:{defaultClass:"ju367v84"},1:{defaultClass:"ju367v85"},2:{defaultClass:"ju367v86"},3:{defaultClass:"ju367v87"},4:{defaultClass:"ju367v88"},5:{defaultClass:"ju367v89"},6:{defaultClass:"ju367v8a"},8:{defaultClass:"ju367v8b"},10:{defaultClass:"ju367v8c"},12:{defaultClass:"ju367v8d"},14:{defaultClass:"ju367v8e"},16:{defaultClass:"ju367v8f"},18:{defaultClass:"ju367v8g"},20:{defaultClass:"ju367v8h"},24:{defaultClass:"ju367v8i"},28:{defaultClass:"ju367v8j"},32:{defaultClass:"ju367v8k"},36:{defaultClass:"ju367v8l"},44:{defaultClass:"ju367v8m"},64:{defaultClass:"ju367v8n"},"-1":{defaultClass:"ju367v8o"}}},position:{values:{absolute:{defaultClass:"ju367v8p"},fixed:{defaultClass:"ju367v8q"},relative:{defaultClass:"ju367v8r"}}},WebkitUserSelect:{values:{none:{defaultClass:"ju367v8s"}}},right:{values:{0:{defaultClass:"ju367v8t"}}},transition:{values:{default:{defaultClass:"ju367v8u"},transform:{defaultClass:"ju367v8v"}}},userSelect:{values:{none:{defaultClass:"ju367v8w"}}},width:{values:{1:{defaultClass:"ju367v8x"},2:{defaultClass:"ju367v8y"},4:{defaultClass:"ju367v8z"},8:{defaultClass:"ju367v90"},12:{defaultClass:"ju367v91"},20:{defaultClass:"ju367v92"},24:{defaultClass:"ju367v93"},28:{defaultClass:"ju367v94"},30:{defaultClass:"ju367v95"},32:{defaultClass:"ju367v96"},34:{defaultClass:"ju367v97"},36:{defaultClass:"ju367v98"},40:{defaultClass:"ju367v99"},44:{defaultClass:"ju367v9a"},48:{defaultClass:"ju367v9b"},54:{defaultClass:"ju367v9c"},60:{defaultClass:"ju367v9d"},200:{defaultClass:"ju367v9e"},full:{defaultClass:"ju367v9f"},max:{defaultClass:"ju367v9g"}}},backdropFilter:{values:{modalOverlay:{defaultClass:"ju367v9h"}}}}}),U_={colors:{accentColor:"var(--rk-colors-accentColor)",accentColorForeground:"var(--rk-colors-accentColorForeground)",actionButtonBorder:"var(--rk-colors-actionButtonBorder)",actionButtonBorderMobile:"var(--rk-colors-actionButtonBorderMobile)",actionButtonSecondaryBackground:"var(--rk-colors-actionButtonSecondaryBackground)",closeButton:"var(--rk-colors-closeButton)",closeButtonBackground:"var(--rk-colors-closeButtonBackground)",connectButtonBackground:"var(--rk-colors-connectButtonBackground)",connectButtonBackgroundError:"var(--rk-colors-connectButtonBackgroundError)",connectButtonInnerBackground:"var(--rk-colors-connectButtonInnerBackground)",connectButtonText:"var(--rk-colors-connectButtonText)",connectButtonTextError:"var(--rk-colors-connectButtonTextError)",connectionIndicator:"var(--rk-colors-connectionIndicator)",downloadBottomCardBackground:"var(--rk-colors-downloadBottomCardBackground)",downloadTopCardBackground:"var(--rk-colors-downloadTopCardBackground)",error:"var(--rk-colors-error)",generalBorder:"var(--rk-colors-generalBorder)",generalBorderDim:"var(--rk-colors-generalBorderDim)",menuItemBackground:"var(--rk-colors-menuItemBackground)",modalBackdrop:"var(--rk-colors-modalBackdrop)",modalBackground:"var(--rk-colors-modalBackground)",modalBorder:"var(--rk-colors-modalBorder)",modalText:"var(--rk-colors-modalText)",modalTextDim:"var(--rk-colors-modalTextDim)",modalTextSecondary:"var(--rk-colors-modalTextSecondary)",profileAction:"var(--rk-colors-profileAction)",profileActionHover:"var(--rk-colors-profileActionHover)",profileForeground:"var(--rk-colors-profileForeground)",selectedOptionBorder:"var(--rk-colors-selectedOptionBorder)",standby:"var(--rk-colors-standby)"},fonts:{body:"var(--rk-fonts-body)"},radii:{actionButton:"var(--rk-radii-actionButton)",connectButton:"var(--rk-radii-connectButton)",menuButton:"var(--rk-radii-menuButton)",modal:"var(--rk-radii-modal)",modalMobile:"var(--rk-radii-modalMobile)"},shadows:{connectButton:"var(--rk-shadows-connectButton)",dialog:"var(--rk-shadows-dialog)",profileDetailsAction:"var(--rk-shadows-profileDetailsAction)",selectedOption:"var(--rk-shadows-selectedOption)",selectedWallet:"var(--rk-shadows-selectedWallet)",walletLogo:"var(--rk-shadows-walletLogo)"},blurs:{modalOverlay:"var(--rk-blurs-modalOverlay)"}},dD={shrink:"_12cbo8i6",shrinkSm:"_12cbo8i7"},fD="_12cbo8i3 ju367v8r",hD={grow:"_12cbo8i4",growLg:"_12cbo8i5"};function Wt({active:e,hover:t}){return[fD,t&&hD[t],dD[e]]}var T4=I.createContext(null);function pD(){const{adapter:e}=I.useContext(T4)??{};if(!e)throw new Error("No authentication adapter found");return e}function zp(){const e=I.useContext(T4);return(e==null?void 0:e.status)??null}function Rv(){const e=zp(),{isConnected:t}=dt();return t?e&&(e==="loading"||e==="unauthenticated")?e:"connected":"disconnected"}function P4(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function mD(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function gD(){return typeof navigator<"u"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function Id(){return mD()||gD()}function Gt(){return P4()||Id()}var yD="iekbcc0",vD={a:"iekbcca",blockquote:"iekbcc2",button:"iekbcc9",input:"iekbcc8 iekbcc5 iekbcc4",mark:"iekbcc6",ol:"iekbcc1",q:"iekbcc2",select:"iekbcc7 iekbcc5 iekbcc4",table:"iekbcc3",textarea:"iekbcc5 iekbcc4",ul:"iekbcc1"},bD=({reset:e,...t})=>{if(!e)return hy(t);const n=vD[e],r=hy(t);return qk(yD,n,r)},U=S.forwardRef(({as:e="div",className:t,testId:n,...r},a)=>{const c={},l={};for(const d in r)hy.properties.has(d)?c[d]=r[d]:l[d]=r[d];const u=bD({reset:typeof e=="string"?e:"div",...c});return S.createElement(e,{className:qk(u,t),...l,"data-testid":n?`rk-${n.replace(/^rk-/,"")}`:void 0,ref:a})});U.displayName="Box";var R4=new Map,E1=new Map;async function L4(e){const t=E1.get(e);if(t)return t;const n=async()=>e().then(async a=>(R4.set(e,a),a)),r=n().catch(a=>n().catch(c=>{E1.delete(e)}));return E1.set(e,r),r}async function Ms(...e){return await Promise.all(e.map(t=>typeof t=="function"?L4(t):t))}function wD(){const[,e]=I.useReducer(t=>t+1,0);return e}function $p(e){const t=typeof e=="function"?R4.get(e):void 0,n=wD();return I.useEffect(()=>{typeof e=="function"&&!t&&L4(e).then(n)},[e,t,n]),typeof e=="function"?t:e}function un({alt:e,background:t,borderColor:n,borderRadius:r,useAsImage:a,boxShadow:c,height:l,src:u,width:d,testId:p}){const h=Id(),m=$p(u),g=m&&/^http/.test(m),[v,b]=I.useReducer(()=>!0,!1);return S.createElement(U,{"aria-label":e,borderRadius:r,boxShadow:c,height:typeof l=="string"?l:void 0,overflow:"hidden",position:"relative",role:"img",style:{background:t,height:typeof l=="number"?l:void 0,width:typeof d=="number"?d:void 0},width:typeof d=="string"?d:void 0,testId:p},S.createElement(U,{...g?{"aria-hidden":!0,as:"img",onLoad:b,src:m}:{"aria-hidden":!0,as:"img",src:m},height:"full",position:"absolute",...h?{WebkitUserSelect:"none"}:{},style:{WebkitTouchCallout:"none",transition:"opacity .15s linear",userSelect:"none",...!a&&g?{opacity:v?1:0}:{}},width:"full"}),n?S.createElement(U,{...typeof n=="object"&&"custom"in n?{style:{borderColor:n.custom}}:{borderColor:n},borderRadius:r,borderStyle:"solid",borderWidth:"1",height:"full",position:"relative",width:"full"}):null)}var _D="_1luule42",xD="_1luule43",CD=e=>I.useMemo(()=>`${e}_${Math.round(Math.random()*1e9)}`,[e]),id=({height:e=21,width:t=21})=>{const n=CD("spinner");return S.createElement("svg",{className:_D,fill:"none",height:e,viewBox:"0 0 21 21",width:t,xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Loading"),S.createElement("clipPath",{id:n},S.createElement("path",{d:"M10.5 3C6.35786 3 3 6.35786 3 10.5C3 14.6421 6.35786 18 10.5 18C11.3284 18 12 18.6716 12 19.5C12 20.3284 11.3284 21 10.5 21C4.70101 21 0 16.299 0 10.5C0 4.70101 4.70101 0 10.5 0C16.299 0 21 4.70101 21 10.5C21 11.3284 20.3284 12 19.5 12C18.6716 12 18 11.3284 18 10.5C18 6.35786 14.6421 3 10.5 3Z"})),S.createElement("foreignObject",{clipPath:`url(#${n})`,height:"21",width:"21",x:"0",y:"0"},S.createElement("div",{className:xD})))},ot=["#FC5C54","#FFD95A","#E95D72","#6A87C8","#5FD0F3","#75C06B","#FFDD86","#5FC6D4","#FF949A","#FF8024","#9BA1A4","#EC66FF","#FF8CBC","#FF9A23","#C5DADB","#A8CE63","#71ABFF","#FFE279","#B6B1B6","#FF6780","#A575FF","#4D82FF","#FFB35A"],W_=[{color:ot[0],emoji:"🌶"},{color:ot[1],emoji:"🤑"},{color:ot[2],emoji:"🐙"},{color:ot[3],emoji:"🫐"},{color:ot[4],emoji:"🐳"},{color:ot[0],emoji:"🤶"},{color:ot[5],emoji:"🌲"},{color:ot[6],emoji:"🌞"},{color:ot[7],emoji:"🐒"},{color:ot[8],emoji:"🐵"},{color:ot[9],emoji:"🦊"},{color:ot[10],emoji:"🐼"},{color:ot[11],emoji:"🦄"},{color:ot[12],emoji:"🐷"},{color:ot[13],emoji:"🐧"},{color:ot[8],emoji:"🦩"},{color:ot[14],emoji:"👽"},{color:ot[0],emoji:"🎈"},{color:ot[8],emoji:"🍉"},{color:ot[1],emoji:"🎉"},{color:ot[15],emoji:"🐲"},{color:ot[16],emoji:"🌎"},{color:ot[17],emoji:"🍊"},{color:ot[18],emoji:"🐭"},{color:ot[19],emoji:"🍣"},{color:ot[1],emoji:"🐥"},{color:ot[20],emoji:"👾"},{color:ot[15],emoji:"🥦"},{color:ot[0],emoji:"👹"},{color:ot[17],emoji:"🙀"},{color:ot[4],emoji:"⛱"},{color:ot[21],emoji:"⛵️"},{color:ot[17],emoji:"🥳"},{color:ot[8],emoji:"🤯"},{color:ot[22],emoji:"🤠"}];function kD(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function jD(e){const n=Math.abs(kD((typeof e=="string"?e:"").toLowerCase())%W_.length);return W_[n??0]}var SD=({address:e,ensImage:t,size:n})=>{const[r,a]=I.useState(!1);I.useEffect(()=>{if(t){const u=new Image;u.src=t,u.onload=()=>a(!0)}},[t]);const{color:c,emoji:l}=I.useMemo(()=>jD(e),[e]);return t?r?S.createElement(U,{backgroundSize:"cover",borderRadius:"full",position:"absolute",style:{backgroundImage:`url(${t})`,backgroundPosition:"center",height:n,width:n}}):S.createElement(U,{alignItems:"center",backgroundSize:"cover",borderRadius:"full",color:"modalText",display:"flex",justifyContent:"center",position:"absolute",style:{height:n,width:n}},S.createElement(id,null)):S.createElement(U,{alignItems:"center",display:"flex",justifyContent:"center",overflow:"hidden",style:{...!t&&{backgroundColor:c},height:n,width:n}},l)},D4=SD,O4=I.createContext(D4);function F4({address:e,imageUrl:t,loading:n,size:r}){const a=I.useContext(O4);return S.createElement(U,{"aria-hidden":!0,borderRadius:"full",overflow:"hidden",position:"relative",style:{height:`${r}px`,width:`${r}px`},userSelect:"none"},S.createElement(U,{alignItems:"center",borderRadius:"full",display:"flex",justifyContent:"center",overflow:"hidden",position:"absolute",style:{fontSize:`${Math.round(r*.55)}px`,height:`${r}px`,transform:n?"scale(0.72)":void 0,transition:".25s ease",transitionDelay:n?void 0:".1s",width:`${r}px`,willChange:"transform"},userSelect:"none"},S.createElement(a,{address:e,ensImage:t,size:r})),n&&S.createElement(U,{color:"accentColor",display:"flex",height:"full",position:"absolute",width:"full"},S.createElement(id,{height:"100%",width:"100%"})))}var V_=()=>S.createElement("svg",{fill:"none",height:"7",width:"14",xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Dropdown"),S.createElement("path",{d:"M12.75 1.54001L8.51647 5.0038C7.77974 5.60658 6.72026 5.60658 5.98352 5.0038L1.75 1.54001",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",xmlns:"http://www.w3.org/2000/svg"})),G_={defaultLocale:"en",locale:"en"},AD=class{constructor(e){this.listeners=new Set,this.defaultLocale=G_.defaultLocale,this.enableFallback=!1,this.locale=G_.locale,this.cachedLocales=[],this.translations={};for(const[t,n]of Object.entries(e))this.cachedLocales=[...this.cachedLocales,t],this.translations={...this.translations,...this.flattenTranslation(n,t)}}missingMessage(e){return`[missing: "${this.locale}.${e}" translation]`}flattenTranslation(e,t){const n={},r=(a,c)=>{for(const l of Object.keys(a)){const u=`${c}.${l}`,d=a[l];typeof d=="object"&&d!==null?r(d,u):n[u]=d}};return r(e,t),n}translateWithReplacements(e,t={}){let n=e;for(const r in t){const a=t[r];n=n.replace(`%{${r}}`,a)}return n}t(e,t,n){const r=`${this.locale}.${e}`,a=this.translations[r];if(!a){if(this.enableFallback){const c=`${this.defaultLocale}.${e}`,l=this.translations[c];if(l)return this.translateWithReplacements(l,t)}return n!=null&&n.rawKeyIfTranslationMissing?e:this.missingMessage(e)}return this.translateWithReplacements(a,t)}isLocaleCached(e){return this.cachedLocales.includes(e)}updateLocale(e){this.locale=e,this.notifyListeners()}setTranslations(e,t){this.isLocaleCached(e)||(this.cachedLocales=[...this.cachedLocales,e],this.translations={...this.translations,...this.flattenTranslation(t,e)}),this.locale=e,this.notifyListeners()}notifyListeners(){for(const e of this.listeners)e()}onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},Br=new AD({en:JSON.parse(rg),"en-US":JSON.parse(rg)});Br.defaultLocale="en-US";Br.locale="en-US";Br.enableFallback=!0;var ED=async e=>{switch(e){case"ar":case"ar-AR":return(await je(async()=>{const{default:t}=await import("./ar_AR-LIPSOZP5-BQrIDibT.js");return{default:t}},[])).default;case"de":case"de-DE":return(await je(async()=>{const{default:t}=await import("./de_DE-YE3KOFHU-BRt5ztUe.js");return{default:t}},[])).default;case"en":case"en-US":return(await je(async()=>{const{default:t}=await Promise.resolve().then(()=>mx);return{default:t}},void 0)).default;case"es":case"es-419":return(await je(async()=>{const{default:t}=await import("./es_419-7LMPU7G4-DH7rM0yQ.js");return{default:t}},[])).default;case"fr":case"fr-FR":return(await je(async()=>{const{default:t}=await import("./fr_FR-VBJP3ZLL-B-_ocunw.js");return{default:t}},[])).default;case"hi":case"hi-IN":return(await je(async()=>{const{default:t}=await import("./hi_IN-WBVD5XYI-D73g2UFs.js");return{default:t}},[])).default;case"id":case"id-ID":return(await je(async()=>{const{default:t}=await import("./id_ID-SBYANJ7G-Cjpa4ay6.js");return{default:t}},[])).default;case"ja":case"ja-JP":return(await je(async()=>{const{default:t}=await import("./ja_JP-ZRMWJV3I-DXbifiMm.js");return{default:t}},[])).default;case"ko":case"ko-KR":return(await je(async()=>{const{default:t}=await import("./ko_KR-FR54RFUG-upinSHjQ.js");return{default:t}},[])).default;case"ms":case"ms-MY":return(await je(async()=>{const{default:t}=await import("./ms_MY-EZSGYYYQ-4cPLK-3L.js");return{default:t}},[])).default;case"pt":case"pt-BR":return(await je(async()=>{const{default:t}=await import("./pt_BR-JQFQ3P4L-DOHfdcA2.js");return{default:t}},[])).default;case"ru":case"ru-RU":return(await je(async()=>{const{default:t}=await import("./ru_RU-Z42UEJBP-Cvb2oWxQ.js");return{default:t}},[])).default;case"th":case"th-TH":return(await je(async()=>{const{default:t}=await import("./th_TH-4YB4VSB2-BUipNP-V.js");return{default:t}},[])).default;case"tr":case"tr-TR":return(await je(async()=>{const{default:t}=await import("./tr_TR-5FKHPPIO-D5jTpIm9.js");return{default:t}},[])).default;case"ua":case"uk-UA":return(await je(async()=>{const{default:t}=await import("./uk_UA-ZD4IBC52-DgnQrpzl.js");return{default:t}},[])).default;case"vi":case"vi-VN":return(await je(async()=>{const{default:t}=await import("./vi_VN-5EVRZKLY-x078672g.js");return{default:t}},[])).default;case"zh":case"zh-CN":case"zh-Hans":return(await je(async()=>{const{default:t}=await import("./zh_CN-4XK5YJPR-Bt6Yz5Ek.js");return{default:t}},[])).default;case"zh-HK":return(await je(async()=>{const{default:t}=await import("./zh_HK-N4YN2WSI-Cvzl1V16.js");return{default:t}},[])).default;case"zh-Hant":case"zh-TW":return(await je(async()=>{const{default:t}=await import("./zh_TW-CNCRXH6Z-BNelatfN.js");return{default:t}},[])).default;default:return(await je(async()=>{const{default:t}=await Promise.resolve().then(()=>mx);return{default:t}},void 0)).default}};async function q_(e){if(Br.isLocaleCached(e)){Br.updateLocale(e);return}const n=await ED(e);Br.setTranslations(e,JSON.parse(n))}var ND=()=>{var e;if(typeof window<"u"&&typeof navigator<"u"){if((e=navigator.languages)!=null&&e.length)return navigator.languages[0];if(navigator.language)return navigator.language}},qt=I.createContext({i18n:Br}),MD=({children:e,locale:t})=>{const[n,r]=I.useState(0),a=I.useMemo(()=>ND(),[]);I.useEffect(()=>Br.onChange(()=>{r(u=>u+1)}),[]),I.useEffect(()=>{t&&t!==Br.locale?q_(t):!t&&a&&a!==Br.locale&&q_(a)},[t,a]);const c=I.useMemo(()=>({t:(u,d)=>Br.t(u,d),i18n:Br}),[n]);return S.createElement(qt.Provider,{value:c},e)};function z4(e){return e!=null}var K_={iconBackground:"#7290CC",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./apechain-SX5YFU6N-q5qBv-mp.js");return{default:e}},[])).default},N1={iconBackground:"#96bedc",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./arbitrum-WURIBY6W-CqVkHBr5.js");return{default:e}},[])).default},Q_={iconBackground:"#e84141",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./avalanche-KOMJD3XY-Dsn_JPR4.js");return{default:e}},[])).default},M1={iconBackground:"#0052ff",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./base-OAXLRA4F-CoYTVIiL.js");return{default:e}},[])).default},I1={iconBackground:"#814625",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./berachain-NJECWIVC-DumxnFvf.js");return{default:e}},[])).default},Y_={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./blast-V555OVXZ-BbhJh1tj.js");return{default:e}},[])).default},J_={iconBackground:"#ebac0e",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./bsc-N647EYR2-B2nLKXWV.js");return{default:e}},[])).default},X_={iconBackground:"#FCFF52",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./celo-GEP4TUHG-CenIBYLU.js");return{default:e}},[])).default},Z_={iconBackground:"#002D74",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./cronos-HJPAQTAE-BEOvlOC4.js");return{default:e}},[])).default},ID={iconBackground:"#A36EFD",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./degen-FQQ4XGHB-CeHTs88l.js");return{default:e}},[])).default},eo={iconBackground:"#484c50",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./ethereum-RGGVA4PY-SWGOlkuk.js");return{default:e}},[])).default},e6={iconBackground:"transparent",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./flow-5FQJFCTK-CUie2reO.js");return{default:e}},[])).default},BD={iconBackground:"#04795c",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./gnosis-37ZC4RBL-B137OtHZ.js");return{default:e}},[])).default},t6={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./gravity-J5YQHTYH-Bj6B0uod.js");return{default:e}},[])).default},TD={iconBackground:"#f9f7ec",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./hardhat-TX56IT5N-CV1FY-wE.js");return{default:e}},[])).default},PD={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./hyperevm-VKPAA4SA-CHwraEsx.js");return{default:e}},[])).default},n6={iconBackground:"#7132F5",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./ink-FZMYZWHG-62p-5IK5.js");return{default:e}},[])).default},r6={iconBackground:"transparent",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./kaia-65D2U3PU-JmuLQ4gC.js");return{default:e}},[])).default},B1={iconBackground:"#ffffff",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./linea-QRMVQ5DY-DuI3vv0d.js");return{default:e}},[])).default},T1={iconBackground:"#ffffff",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./manta-SI27YFEJ-CpVOKa06.js");return{default:e}},[])).default},s6={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./mantle-CKIUT334-DR2WgqzU.js");return{default:e}},[])).default},RD={iconBackground:"transparent",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./monad-4KWC6TSS-DVXSkpiz.js");return{default:e}},[])).default},mh={iconBackground:"#ff5a57",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./optimism-HAF2GUT7-ec6Nqxs9.js");return{default:e}},[])).default},P1={iconBackground:"#9f71ec",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./polygon-WW6ZI7PM-DXlmm4L1.js");return{default:e}},[])).default},LD={iconBackground:"#1273EA",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./ronin-EMCPYXZT-N-QBHZdV.js");return{default:e}},[])).default},DD={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./sanko-RHQYXGM5-OX010CbN.js");return{default:e}},[])).default},OD={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./superposition-HG6MMR2Y-bRkgatRO.js");return{default:e}},[])).default},a6={iconBackground:"#FFEEDA",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./scroll-5OBGQVOV-DJFECiai.js");return{default:e}},[])).default},o6={iconBackground:"#F50DB4",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./unichain-C5BWO2ZY-BfguYsnu.js");return{default:e}},[])).default},i6={iconBackground:"#f9f7ec",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./xdc-KJ3TDBYO-DNV6zchh.js");return{default:e}},[])).default},c6={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./zetachain-TLDS5IPW-Udhyw16T.js");return{default:e}},[])).default},l6={iconBackground:"#f9f7ec",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./zksync-DH7HK5U4-Dt4usFw6.js");return{default:e}},[])).default},R1={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./zora-FYL5H3IO-iB4wygST.js");return{default:e}},[])).default},FD={apechain:{chainId:33139,name:"ApeChain",...K_},apechainCurtis:{chainId:33111,name:"ApeChain Curtis",...K_},arbitrum:{chainId:42161,name:"Arbitrum",...N1},arbitrumGoerli:{chainId:421613,...N1},arbitrumSepolia:{chainId:421614,...N1},avalanche:{chainId:43114,...Q_},avalancheFuji:{chainId:43113,...Q_},base:{chainId:8453,name:"Base",...M1},baseGoerli:{chainId:84531,...M1},baseSepolia:{chainId:84532,...M1},berachain:{chainId:80094,name:"Berachain",...I1},berachainArtio:{chainId:80085,name:"Berachain Artio",...I1},berachainBArtio:{chainId:80084,name:"Berachain bArtio",...I1},blast:{chainId:81457,name:"Blast",...Y_},blastSepolia:{chainId:168587773,...Y_},bsc:{chainId:56,name:"BSC",...J_},bscTestnet:{chainId:97,...J_},celo:{chainId:42220,name:"Celo",...X_},celoAlfajores:{chainId:44787,name:"Celo Alfajores",...X_},cronos:{chainId:25,...Z_},cronosTestnet:{chainId:338,...Z_},degen:{chainId:666666666,name:"Degen",...ID},flow:{chainId:747,...e6},flowTestnet:{chainId:545,...e6},gnosis:{chainId:100,name:"Gnosis",...BD},goerli:{chainId:5,...eo},gravity:{chainId:1625,name:"Gravity",...t6},gravitySepolia:{chainId:13505,name:"Gravity Sepolia",...t6},hardhat:{chainId:31337,...TD},holesky:{chainId:17e3,...eo},hyperevm:{chainId:999,...PD},ink:{chainId:57073,...n6},inkSepolia:{chainId:763373,...n6},kaia:{chainId:8217,name:"Kaia",...r6},kairos:{chainId:1001,name:"Kairos",...r6},kovan:{chainId:42,...eo},linea:{chainId:59144,name:"Linea",...B1},lineaGoerli:{chainId:59140,name:"Linea Goerli",...B1},lineaSepolia:{chainId:59141,name:"Linea Sepolia",...B1},localhost:{chainId:1337,...eo},mainnet:{chainId:1,name:"Ethereum",...eo},manta:{chainId:169,name:"Manta",...T1},mantaSepolia:{chainId:3441006,...T1},mantaTestnet:{chainId:3441005,...T1},mantle:{chainId:5e3,...s6},mantleTestnet:{chainId:5001,...s6},monadTestnet:{chainId:10143,name:"Monad Testnet",...RD},optimism:{chainId:10,name:"Optimism",...mh},optimismGoerli:{chainId:420,...mh},optimismKovan:{chainId:69,...mh},optimismSepolia:{chainId:11155420,...mh},polygon:{chainId:137,name:"Polygon",...P1},polygonAmoy:{chainId:80002,...P1},polygonMumbai:{chainId:80001,...P1},rinkeby:{chainId:4,...eo},ronin:{chainId:2020,...LD},ropsten:{chainId:3,...eo},sanko:{chainId:1996,name:"Sanko",...DD},scroll:{chainId:534352,...a6},scrollSepolia:{chainId:534351,...a6},sepolia:{chainId:11155111,...eo},superposition:{chainId:55244,name:"Superposition",...OD},unichain:{chainId:130,...o6},unichainSepolia:{chainId:1301,...o6},xdc:{chainId:50,name:"XDC",...i6},xdcTestnet:{chainId:51,...i6},zetachain:{chainId:7e3,name:"ZetaChain",...c6},zetachainAthensTestnet:{chainId:7001,name:"Zeta Athens",...c6},zkSync:{chainId:324,name:"zkSync",...l6},zkSyncTestnet:{chainId:280,...l6},zora:{chainId:7777777,name:"Zora",...R1},zoraSepolia:{chainId:999999999,...R1},zoraTestnet:{chainId:999,...R1}},zD=Object.fromEntries(Object.values(FD).filter(z4).map(({chainId:e,...t})=>[e,t])),$D=e=>e.map(t=>{const n=zD[t.id]??{};return{...t,name:n.name??t.name,iconUrl:t.iconUrl??n.iconUrl,iconBackground:t.iconBackground??n.iconBackground}}),Lv=I.createContext({chains:[]});function HD({children:e,initialChain:t}){const{chains:n}=Lt();return S.createElement(Lv.Provider,{value:I.useMemo(()=>({chains:$D(n),initialChainId:typeof t=="number"?t:t==null?void 0:t.id}),[n,t])},e)}var Di=()=>I.useContext(Lv).chains,UD=()=>I.useContext(Lv).initialChainId,WD=()=>{const e=Di();return I.useMemo(()=>{const t={};for(const n of e)t[n.id]=n;return t},[e])},$4=I.createContext({showBalance:void 0,setShowBalance:()=>{}});function VD({children:e}){const[t,n]=I.useState();return S.createElement($4.Provider,{value:{showBalance:t,setShowBalance:n}},e)}var H4=()=>I.useContext($4);function GD(){const[e,t]=I.useState(!1);return I.useEffect(()=>(t(!0),()=>{t(!1)}),[]),I.useCallback(()=>e,[e])}function U4(){const e=Di(),t=Lp.id;return e.some(r=>r.id===t)}function qD(e){const t=U4(),n=a=>{try{return RR(a)}catch{}},{data:r}=QP({chainId:Lp.id,name:e?n(e):void 0,query:{enabled:t}});return r}async function Qo(e,t){const n={headers:{},method:"get",...t,timeout:t.timeout??1e4};if(!e)throw new Error("rainbowFetch: Missing url argument");const r=new AbortController,a=setTimeout(()=>r.abort(),n.timeout),{body:c,params:l,headers:u,...d}=n,p=c&&typeof c=="object"?JSON.stringify(c):c,h=await fetch(`${e}${QD(l)}`,{...d,body:p,headers:{Accept:"application/json","Content-Type":"application/json",...u},signal:r.signal});clearTimeout(a);const m=await KD(h);if(h.ok){const{headers:b,status:_}=h;return{data:m,headers:b,status:_}}throw YD({requestBody:c,response:h,responseBody:typeof m=="string"?{error:m}:m})}function KD(e){const t=e.headers.get("Content-Type");return t!=null&&t.startsWith("application/json")?e.json():e.text()}function QD(e){return e&&Object.keys(e).length?`?${new URLSearchParams(e)}`:""}function YD({requestBody:e,response:t,responseBody:n}){const r=(n==null?void 0:n.error)||(t==null?void 0:t.statusText)||"There was an error with the request.",a=new Error(r);return a.response=t,a.responseBody=n,a.requestBody=e,a}var JD=class{constructor(e={}){const{baseUrl:t="",...n}=e;this.baseUrl=t,this.opts=n}get(e,t){return Qo(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"get"})}delete(e,t){return Qo(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"delete"})}head(e,t){return Qo(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"head"})}options(e,t){return Qo(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"options"})}post(e,t,n){return Qo(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"post"})}put(e,t,n){return Qo(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"put"})}patch(e,t,n){return Qo(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"patch"})}};function XD({baseUrl:e,headers:t,params:n,timeout:r}){return new JD({baseUrl:e,headers:t,params:n,timeout:r})}var ZD=!!(typeof process<"u"&&typeof Xh<"u"&&Xh.RAINBOW_PROVIDER_API_KEY),eO=XD({baseUrl:"https://enhanced-provider.rainbow.me",headers:{"x-api-key":typeof process<"u"&&typeof Xh<"u"&&Xh.RAINBOW_PROVIDER_API_KEY||"LzbasoBiLqltex3VkcQ7LRmL4PtfiiZ1EMJrizrgfonWN6byJReu/l6yrUoo3zLW"}});function tO(e,t,n={}){return[e,t,n]}function Th(e){return`rk-ens-name-${e}`}function nO(e){try{const t=e?JSON.parse(e):null;return typeof t=="object"?t:null}catch{return null}}function rO(e,t){if(!Ft(e)||typeof window>"u")return;const n=new Date,r=new Date(n.getTime()+180*6e4);window.localStorage.setItem(Th(e),JSON.stringify({ensName:t,expires:r.getTime()}))}function sO(e){if(typeof window>"u")return null;const t=nO(window.localStorage.getItem(Th(e)));if(!t)return null;const{ensName:n,expires:r}=t;return typeof n!="string"||Number.isNaN(Number(r))||new Date().getTime()>Number(r)?(window.localStorage.removeItem(Th(e)),null):n}async function aO({address:e}){const t=sO(e);if(t)return t;const r=(await eO.get("/v1/resolve-ens",{params:{address:e}})).data.data;return r&&rO(e,r),r}function oO(e){const t=U4(),{data:n}=YP({chainId:Lp.id,address:e,query:{enabled:t}}),{data:r}=Uk({queryKey:tO("address",e),queryFn:()=>aO({address:e}),enabled:!t&&!!e&&ZD,staleTime:10*(60*1e3),retry:1});return n||r}function W4({address:e,includeBalance:t}){const n=oO(e),r=qD(n),{data:a}=Wk({address:t?e:void 0});return{ensName:n,ensAvatar:r,balance:a}}function Dv(){const{chain:e}=dt();return(e==null?void 0:e.id)??null}var iO="rk-transactions";function cO(e){const t=`${e.uid}.${iO}`;return{...e,uid:t}}var V4="rk-transactions";function lO(e){try{const t=e?JSON.parse(e):{};return typeof t=="object"?t:{}}catch{return{}}}function u6(){return lO(typeof window<"u"?window.localStorage.getItem(V4):null)}var uO=/^0x([A-Fa-f0-9]{64})$/;function dO(e){const t=[];return uO.test(e.hash)||t.push("Invalid transaction hash"),typeof e.description!="string"&&t.push("Transaction must have a description"),typeof e.confirmations<"u"&&(!Number.isInteger(e.confirmations)||e.confirmations<1)&&t.push("Transaction confirmations must be a positiver integer"),t}function fO({provider:e}){let t=u6(),n;const r=new Set,a=new Set,c=new Map;function l(A){n=cO(A)}l(e);function u(A,k){var N;return((N=t[A])==null?void 0:N[k])??[]}function d(A,k,N){const E=dO(N);if(E.length>0)throw new Error(["Unable to add transaction",...E].join(`
1759
+ */const fu={newline:10,reset:27};function WL(e){if(!Number.isSafeInteger(e))throw new Error(`integer expected: ${e}`)}function VL(e){if(!Number.isSafeInteger(e)||e<1||e>40)throw new Error(`Invalid version=${e}. Expected number [1..40]`)}function qo(e,t){return e.toString(2).padStart(t,"0")}function P_(e,t){const n=e%t;return n>=0?n:t+n}function bs(e,t){return new Array(e).fill(t)}function A1(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}function R_(e){let t=0,n=0;for(const c of e)t=Math.max(t,c.length),n+=c.length;const r=new Uint8Array(n);let a=0;for(let c=0;c<t;c++)for(const l of e)c<l.length&&(r[a++]=l[c]);return r}function GL(){let e,t=1/0;return{add(n,r){n>=t||(e=r,t=n)},get:()=>e,score:()=>t}}function L_(e){return Object.freeze({has:t=>e.includes(t),decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})},encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(WL(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})}})}function D_(e){if(e.length!==32)throw new Error("expects 32 element matrix");const t=[1431655765,858993459,252645135,16711935,65535];for(let n=0;n<5;n++){const r=t[n]>>>0,a=1<<n,c=a<<1;for(let l=0;l<32;l+=c)for(let u=0;u<a;u++){const d=l+u,p=d+a,h=e[d]>>>0,m=e[p]>>>0,g=(h>>>a^m)&r;e[d]=(h^g<<a)>>>0,e[p]=(m^g)>>>0}}}const hu=e=>1<<(e&31)>>>0,Ko=(e,t)=>t===0?0:t===32?4294967295:(1<<t)-1<<e>>>0;class Tn{constructor(t,n){Ka(this,"defined");Ka(this,"value");Ka(this,"tailMask");Ka(this,"words");Ka(this,"fullWords");Ka(this,"height");Ka(this,"width");const{height:r,width:a}=Tn.size(t);if(!Number.isSafeInteger(r)||r<=0)throw new Error(`Bitmap: invalid height=${r}, expected positive safe integer dimension`);if(!Number.isSafeInteger(a)||a<=0)throw new Error(`Bitmap: invalid width=${a}, expected positive safe integer dimension`);if(this.height=r,this.width=a,this.tailMask=Ko(0,a&31||32),this.words=Math.ceil(a/32)|0,this.fullWords=Math.floor(a/32)|0,this.value=new Uint32Array(this.words*r),this.defined=new Uint32Array(this.value.length),n){if(n.length!==r)throw new Error(`Bitmap: data height mismatch: exp=${r} got=${n.length}`);for(let c=0;c<r;c++){const l=n[c];if(!l||l.length!==a)throw new Error(`Bitmap: data width mismatch at y=${c}: exp=${a} got=${l==null?void 0:l.length}`);for(let u=0;u<a;u++)this.set(u,c,l[u])}}}static size(t,n){if(typeof t=="number"&&(t={height:t,width:t}),!Number.isSafeInteger(t.height)&&t.height!==1/0)throw new Error(`Bitmap: invalid height=${t.height} (${typeof t.height})`);if(!Number.isSafeInteger(t.width)&&t.width!==1/0)throw new Error(`Bitmap: invalid width=${t.width} (${typeof t.width})`);return n!==void 0&&(t={width:Math.min(t.width,n.width),height:Math.min(t.height,n.height)}),t}static fromString(t){t=t.replace(/^\n+/g,"").replace(/\n+$/g,"");const n=t.split(String.fromCharCode(fu.newline)),r=n.length;let a;const c=[];for(const l of n){const u=l.split("").map(d=>{if(d==="X")return!0;if(d===" ")return!1;if(d!=="?")throw new Error(`Bitmap.fromString: unknown symbol=${d}`)});if(a!==void 0&&u.length!==a)throw new Error(`Bitmap.fromString different row sizes: width=${a} cur=${u.length}`);a=u.length,c.push(u)}return a===void 0&&(a=0),new Tn({height:r,width:a},c)}point(t){return this.get(t.x,t.y)}isInside(t){return 0<=t.x&&t.x<this.width&&0<=t.y&&t.y<this.height}size(t){if(!t)return{height:this.height,width:this.width};const{x:n,y:r}=this.xy(t);return{height:this.height-r,width:this.width-n}}xy(t){if(typeof t=="number"&&(t={x:t,y:t}),!Number.isSafeInteger(t.x))throw new Error(`Bitmap: invalid x=${t.x}`);if(!Number.isSafeInteger(t.y))throw new Error(`Bitmap: invalid y=${t.y}`);return t.x=P_(t.x,this.width),t.y=P_(t.y,this.height),t}wordIndex(t,n){return n*this.words+(t>>>5)}bitIndex(t,n){return{word:this.wordIndex(t,n),bit:t&31}}isDefined(t,n){const r=this.wordIndex(t,n),a=hu(t);return(this.defined[r]&a)!==0}get(t,n){const r=this.wordIndex(t,n),a=hu(t);return(this.value[r]&a)!==0}maskWord(t,n,r){const{defined:a,value:c}=this;a[t]|=n,c[t]=c[t]&~n|-r&n}set(t,n,r){r!==void 0&&this.maskWord(this.wordIndex(t,n),hu(t),r)}fillRectConst(t,n,r,a,c){if(r<=0||a<=0||c===void 0)return;const{value:l,defined:u,words:d}=this,p=t>>>5,h=t+r-1>>>5,m=t&31,g=t+r-1&31;for(let v=0;v<a;v++){const b=(n+v)*d;if(p===h){const _=Ko(m,g-m+1);this.maskWord(b+p,_,c);continue}this.maskWord(b+p,Ko(m,32-m),c);for(let _=p+1;_<h;_++)u[b+_]=4294967295,l[b+_]=c?4294967295:0;this.maskWord(b+h,Ko(0,g+1),c)}}rectWords(t,n,r,a,c){for(let l=0;l<a;l++){const u=n+l;for(let d=0;d<r;){const p=t+d,{bit:h,word:m}=this.bitIndex(p,u),g=Math.min(32-h,r-d);c(m,p,d,l,g),d+=g}}}rect(t,n,r){const{x:a,y:c}=this.xy(t),{height:l,width:u}=Tn.size(n,this.size({x:a,y:c}));if(typeof r!="function")return this.fillRectConst(a,c,u,l,r),this;const{defined:d,value:p}=this;return this.rectWords(a,c,u,l,(h,m,g,v,b)=>{let _=0,x=p[h];for(let j=0;j<b;j++){const A=hu(m+j),k=r({x:g+j,y:v},(x&A)!==0);k!==void 0&&(_|=A,x=x&~A|-k&A)}d[h]|=_,p[h]=x}),this}rectRead(t,n,r){const{x:a,y:c}=this.xy(t),{height:l,width:u}=Tn.size(n,this.size({x:a,y:c})),{value:d}=this;return this.rectWords(a,c,u,l,(p,h,m,g,v)=>{const b=d[p];for(let _=0;_<v;_++){const x=hu(h+_);r({x:m+_,y:g},(b&x)!==0)}}),this}hLine(t,n,r){return this.rect(t,{width:n,height:1},r)}vLine(t,n,r){return this.rect(t,{width:1,height:n},r)}border(t=2,n){if(!Number.isSafeInteger(t)||t<=0)throw new Error(`Bitmap.border: invalid size=${t}`);const r=this.height+2*t,a=this.width+2*t,c=new Tn({height:r,width:a});return c.rect(0,1/0,n),c.embed({x:t,y:t},this),c}embed(t,n){const{x:r,y:a}=this.xy(t),{height:c,width:l}=Tn.size(n.size(),this.size({x:r,y:a}));if(l<=0||c<=0)return this;const{value:u,defined:d}=this,{words:p,value:h}=n;for(let m=0;m<c;m++){const g=m*p;for(let v=0;v<l;){const b=r+v,{word:_,bit:x}=this.bitIndex(b,a+m),{word:j,bit:A}=n.bitIndex(v,m),k=Math.min(32-x,l-v),N=h[j],E=A&&j+1<g+p?h[j+1]:0,B=A?(N>>>A|E<<32-A)>>>0:N,M=Ko(x,k),P=(B&Ko(0,k))<<x>>>0;d[_]|=M,u[_]=u[_]&~M|P,v+=k}}return this}rectSlice(t,n=this.size()){const{x:r,y:a}=this.xy(t),{height:c,width:l}=Tn.size(n,this.size({x:r,y:a})),u=new Tn({height:c,width:l});return this.rectRead({x:r,y:a},{height:c,width:l},(d,p)=>{this.isDefined(r+d.x,a+d.y)&&u.set(d.x,d.y,p)}),u}transpose(){const{height:t,width:n,value:r,defined:a,words:c}=this,l=new Tn({height:n,width:t}),{words:u,value:d,defined:p,tailMask:h}=l,m=new Uint32Array(32),g=new Uint32Array(32);for(let v=0;v<t;v+=32)for(let b=0;b<c;b++){const _=Math.min(32,t-v);for(let x=0;x<_;x++){const j=this.wordIndex(32*b,v+x);m[x]=r[j],g[x]=a[j]}m.fill(0,_),g.fill(0,_),D_(m),D_(g);for(let x=0;x<32;x++){const j=b*32+x;if(j>=n)break;const A=l.wordIndex(v,j),k=v>>>5===u-1?h:4294967295;d[A]=m[x]&k,p[A]=g[x]&k}}return l}negate(){const t=this.defined.length;for(let n=0;n<t;n++)this.value[n]=~this.value[n],this.defined[n]=4294967295;return this}scale(t){if(!Number.isSafeInteger(t)||t>1024)throw new Error(`invalid scale factor: ${t}`);const{height:n,width:r}=this;return new Tn({height:t*n,width:t*r}).rect({x:0,y:0},1/0,({x:c,y:l})=>this.get(c/t|0,l/t|0))}clone(){const t=new Tn(this.size());return t.defined.set(this.defined),t.value.set(this.value),t}assertDrawn(){const{height:t,width:n,defined:r,tailMask:a,fullWords:c,words:l}=this;if(!(!t||!n))for(let u=0;u<t;u++){const d=u*l;for(let p=0;p<c;p++)if(r[d+p]!==4294967295)throw new Error("Invalid color type=undefined");if(l!==c&&(r[d+c]&a)!==a)throw new Error("Invalid color type=undefined")}}countPatternInRow(t,n,...r){if(!Number.isSafeInteger(n)||n<=0||n>=32)throw new Error("wrong patternLen");const a=(1<<n)-1,{height:c,width:l,value:u,words:d}=this;if(!Number.isSafeInteger(t)||t<0||t>=c)return 0;let p=0;const h=this.wordIndex(0,t);for(let m=0,g=0;m<d;m++){const v=u[h+m],b=m===d-1&&l&31||32;for(let _=0;_<b;_++)if(g=(g<<1|v>>>_&1)&a,!(m*32+_+1<n)){for(const x of r)if(g===x){p++;break}}}return p}getRuns(t,n){const{height:r,width:a,value:c,words:l}=this;if(a===0||!Number.isSafeInteger(t)||t<0||t>=r)return;let u=0,d;const p=this.wordIndex(0,t);for(let h=0;h<l;h++){const m=c[p+h],g=h===l-1&&a&31||32;for(let v=0;v<g;v++){const b=(m&1<<v)!==0;if(b===d){u++;continue}d!==void 0&&n(u,d),d=b,u=1}}d!==void 0&&n(u,d)}popcnt(){const{height:t,width:n,words:r,fullWords:a,tailMask:c}=this;if(!t||!n)return 0;let l=0;for(let u=0;u<t;u++){const d=u*r;for(let p=0;p<a;p++)l+=A1(this.value[d+p]);r!==a&&(l+=A1(this.value[d+a]&c))}return l}countBoxes2x2(t){const{height:n,width:r,words:a}=this;if(r<2||!Number.isSafeInteger(t)||t<0||t+1>=n)return 0;const c=this.wordIndex(0,t),l=this.wordIndex(0,t+1),d=(r&31)===0?2147483647:Ko(0,r-1&31);let p=0;for(let h=0;h<a;h++){const m=this.value[c+h],g=this.value[l+h],v=~(m^g)>>>0,b=h+1<a?this.value[c+h+1]>>>0:0,_=~(m^(m>>>1|(b&1)<<31)>>>0)>>>0,x=h+1<a?this.value[l+h+1]>>>0:0,j=~(g^(g>>>1|(x&1)<<31)>>>0)>>>0;let A=(v&_&j)>>>0;h===a-1&&(A&=d),p+=A1(A)}return p}toString(){const t=String.fromCharCode(fu.newline);let n="";for(let r=0;r<this.height;r++){let a="";for(let c=0;c<this.width;c++){const l=this.get(c,r);a+=this.isDefined(c,r)?l?"X":" ":"?"}n+=a+(r+1===this.height?"":t)}return n}toRaw(){const t=Array.from({length:this.height},()=>new Array(this.width));for(let n=0;n<this.height;n++){const r=t[n];for(let a=0;a<this.width;a++)r[a]=this.get(a,n)}return t}toASCII(){const{height:t,width:n}=this;let r="";for(let a=0;a<t;a+=2){for(let c=0;c<n;c++){const l=this.get(c,a),u=a+1>=t?!0:this.get(c,a+1);!l&&!u?r+="█":!l&&u?r+="▀":l&&!u?r+="▄":l&&u&&(r+=" ")}r+=String.fromCharCode(fu.newline)}return r}toTerm(){const t=String.fromCharCode(fu.reset),n=t+"[0m",r=t+"[1;47m "+n,a=t+"[40m "+n,c=String.fromCharCode(fu.newline);let l="";for(let u=0;u<this.height;u++){for(let d=0;d<this.width;d++){const p=this.get(d,u);l+=p?a:r}l+=c}return l}toSVG(t=!0){let n=`<svg viewBox="0 0 ${this.width} ${this.height}" xmlns="http://www.w3.org/2000/svg">`,r="",a;return this.rectRead(0,1/0,(c,l)=>{if(!l)return;const{x:u,y:d}=c;if(!t){n+=`<rect x="${u}" y="${d}" width="1" height="1" />`;return}let p=`M${u} ${d}`;if(a){const m=`m${u-a.x} ${d-a.y}`;m.length<=p.length&&(p=m)}const h=u<10?`H${u}`:"h-1";r+=`${p}h1v1${h}Z`,a=c}),t&&(n+=`<path d="${r}"/>`),n+="</svg>",n}toGIF(){const t=u=>[u&255,u>>>8&255],n=[...t(this.width),...t(this.height)],r=[];this.rectRead(0,1/0,(u,d)=>r.push(+(d===!0)));const a=126,c=[71,73,70,56,55,97,...n,246,0,0,255,255,255,...bs(381,0),44,0,0,0,0,...n,0,7],l=Math.floor(r.length/a);for(let u=0;u<l;u++)c.push(a+1,128,...r.slice(a*u,a*(u+1)).map(d=>+d));return c.push(r.length%a+1,128,...r.slice(l*a).map(u=>+u)),c.push(1,129,0,59),new Uint8Array(c)}toImage(t=!1){const{height:n,width:r}=this.size(),a=new Uint8Array(n*r*(t?3:4));let c=0;for(let l=0;l<n;l++)for(let u=0;u<r;u++){const d=this.get(u,l)?0:255;a[c++]=d,a[c++]=d,a[c++]=d,t||(a[c++]=255)}return{height:n,width:r,data:a}}}const O_=Object.freeze(["low","medium","quartile","high"]),F_=Object.freeze(["numeric","alphanumeric","byte","kanji","eci"]),qL=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],KL={low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]},QL={low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]},Sn=Object.freeze({size:Object.freeze({encode:e=>21+4*(e-1),decode:e=>(e-17)/4}),sizeType:e=>Math.floor((e+7)/17),alignmentPatterns(e){if(e===1)return[];const t=6,n=Sn.size.encode(e)-t-1,r=n-t,a=Math.ceil(r/28);let c=Math.floor(r/a);c%2?c+=1:r%a*2>=a&&(c+=2);const l=[t];for(let u=1;u<a;u++)l.push(n-(a-u)*c);return l.push(n),l},ECCode:Object.freeze({low:1,medium:0,quartile:3,high:2}),formatMask:21522,formatBits(e,t){const n=Sn.ECCode[e]<<3|t;let r=n;for(let a=0;a<10;a++)r=r<<1^(r>>9)*1335;return(n<<10|r)^Sn.formatMask},versionBits(e){let t=e;for(let n=0;n<12;n++)t=t<<1^(t>>11)*7973;return e<<12|t},alphabet:Object.freeze({numeric:L_("0123456789"),alphanumerc:L_("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")}),lengthBits(e,t){return{numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]}[t][Sn.sizeType(e)]},modeBits:Object.freeze({numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"}),capacity(e,t){const n=qL[e-1],r=KL[t][e-1],a=QL[t][e-1],c=Math.floor(n/a)-r,l=a-n%a;return{words:r,numBlocks:a,shortBlocks:l,blockLen:c,capacity:(n-r*a)*8,total:(r+c)*a+a-l}}}),Iv=Object.freeze([(e,t)=>(e+t)%2==0,(e,t)=>t%2==0,(e,t)=>e%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(t/2)+Math.floor(e/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0]),Te={tables:(e=>{const t=bs(256,0),n=bs(256,0);for(let r=0,a=1;r<256;r++)t[r]=a,n[a]=r,a<<=1,a&256&&(a^=e);return{exp:t,log:n}})(285),exp:e=>Te.tables.exp[e],log(e){if(e===0)throw new Error(`GF.log: invalid arg=${e}`);return Te.tables.log[e]%255},mul(e,t){return e===0||t===0?0:Te.tables.exp[(Te.tables.log[e]+Te.tables.log[t])%255]},add:(e,t)=>e^t,pow:(e,t)=>Te.tables.exp[Te.tables.log[e]*t%255],inv(e){if(e===0)throw new Error(`GF.inverse: invalid arg=${e}`);return Te.tables.exp[255-Te.tables.log[e]]},polynomial(e){if(e.length==0)throw new Error("GF.polymomial: invalid length");if(e[0]!==0)return e;let t=0;for(;t<e.length-1&&e[t]==0;t++);return e.slice(t)},monomial(e,t){if(e<0)throw new Error(`GF.monomial: invalid degree=${e}`);if(t==0)return[0];let n=bs(e+1,0);return n[0]=t,Te.polynomial(n)},degree:e=>e.length-1,coefficient:(e,t)=>e[Te.degree(e)-t],mulPoly(e,t){if(e[0]===0||t[0]===0)return[0];const n=bs(e.length+t.length-1,0);for(let r=0;r<e.length;r++)for(let a=0;a<t.length;a++)n[r+a]=Te.add(n[r+a],Te.mul(e[r],t[a]));return Te.polynomial(n)},mulPolyScalar(e,t){if(t==0)return[0];if(t==1)return e;const n=bs(e.length,0);for(let r=0;r<e.length;r++)n[r]=Te.mul(e[r],t);return Te.polynomial(n)},mulPolyMonomial(e,t,n){if(t<0)throw new Error("GF.mulPolyMonomial: invalid degree");if(n==0)return[0];const r=bs(e.length+t,0);for(let a=0;a<e.length;a++)r[a]=Te.mul(e[a],n);return Te.polynomial(r)},addPoly(e,t){if(e[0]===0)return t;if(t[0]===0)return e;let n=e,r=t;n.length>r.length&&([n,r]=[r,n]);let a=bs(r.length,0),c=r.length-n.length,l=r.slice(0,c);for(let u=0;u<l.length;u++)a[u]=l[u];for(let u=c;u<r.length;u++)a[u]=Te.add(n[u-c],r[u]);return Te.polynomial(a)},remainderPoly(e,t){const n=Array.from(e);for(let r=0;r<e.length-t.length+1;r++){const a=n[r];if(a!==0)for(let c=1;c<t.length;c++)t[c]!==0&&(n[r+c]=Te.add(n[r+c],Te.mul(t[c],a)))}return n.slice(e.length-t.length+1,n.length)},divisorPoly(e){let t=[1];for(let n=0;n<e;n++)t=Te.mulPoly(t,[1,Te.pow(2,n)]);return t},evalPoly(e,t){if(t==0)return Te.coefficient(e,0);let n=e[0];for(let r=1;r<e.length;r++)n=Te.add(Te.mul(t,n),e[r]);return n},euclidian(e,t,n){Te.degree(e)<Te.degree(t)&&([e,t]=[t,e]);let r=e,a=t,c=[0],l=[1];for(;2*Te.degree(a)>=n;){let p=r,h=c;if(r=a,c=l,r[0]===0)throw new Error("rLast[0] === 0");a=p;let m=[0];const g=Te.inv(r[0]);for(;Te.degree(a)>=Te.degree(r)&&a[0]!==0;){const v=Te.degree(a)-Te.degree(r),b=Te.mul(a[0],g);m=Te.addPoly(m,Te.monomial(v,b)),a=Te.addPoly(a,Te.mulPolyMonomial(r,v,b))}if(m=Te.mulPoly(m,c),l=Te.addPoly(m,h),Te.degree(a)>=Te.degree(r))throw new Error(`Division failed r: ${a}, rLast: ${r}`)}const u=Te.coefficient(l,0);if(u==0)throw new Error("sigmaTilde(0) was zero");const d=Te.inv(u);return[Te.mulPolyScalar(l,d),Te.mulPolyScalar(a,d)]}};function YL(e){return{encode(t){const n=Te.divisorPoly(e),r=Array.from(t);return r.push(...n.slice(0,-1).fill(0)),Uint8Array.from(Te.remainderPoly(r,n))},decode(t){const n=t.slice(),r=Te.polynomial(Array.from(t));let a=bs(e,0),c=!1;for(let m=0;m<e;m++){const g=Te.evalPoly(r,Te.exp(m));a[a.length-1-m]=g,g!==0&&(c=!0)}if(!c)return n;a=Te.polynomial(a);const l=Te.monomial(e,1),[u,d]=Te.euclidian(l,a,e),p=bs(Te.degree(u),0);let h=0;for(let m=1;m<256&&h<p.length;m++)Te.evalPoly(u,m)===0&&(p[h++]=Te.inv(m));if(h!==p.length)throw new Error("RS.decode: invalid errors number");for(let m=0;m<p.length;m++){const g=n.length-1-Te.log(p[m]);if(g<0)throw new Error("RS.decode: invalid error location");const v=Te.inv(p[m]);let b=1;for(let _=0;_<p.length;_++)m!==_&&(b=Te.mul(b,Te.add(1,Te.mul(p[_],v))));n[g]=Te.add(n[g],Te.mul(Te.evalPoly(d,v),Te.inv(b)))}return n}}}function JL(e,t){const{words:n,shortBlocks:r,numBlocks:a,blockLen:c,total:l}=Sn.capacity(e,t),u=YL(n);return{encode(d){const p=[],h=[];for(let b=0;b<a;b++){const _=b<r,x=c+(_?0:1);p.push(d.subarray(0,x)),h.push(u.encode(d.subarray(0,x))),d=d.subarray(x)}const m=R_(p),g=R_(h),v=new Uint8Array(m.length+g.length);return v.set(m),v.set(g,m.length),v},decode(d){if(d.length!==l)throw new Error(`interleave.decode: len(data)=${d.length}, total=${l}`);const p=[];for(let g=0;g<a;g++){const v=g<r;p.push(new Uint8Array(n+c+(v?0:1)))}let h=0;for(let g=0;g<c;g++)for(let v=0;v<a;v++)p[v][g]=d[h++];for(let g=r;g<a;g++)p[g][c]=d[h++];for(let g=c;g<c+n;g++)for(let v=0;v<a;v++){const b=v<r;p[v][g+(b?0:1)]=d[h++]}const m=[];for(const g of p)m.push(...Array.from(u.decode(g)).slice(0,-n));return Uint8Array.from(m)}}}function XL(e,t,n,r=!1){const a=Sn.size.encode(e);let c=new Tn(a+2);const l=new Tn(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);c=c.embed(0,l).embed({x:-l.width,y:0},l).embed({x:0,y:-l.height},l),c=c.rectSlice(1,a);const u=new Tn(1).rect(0,1,!0).border(1,!1).border(1,!0),d=Sn.alignmentPatterns(e);for(const p of d)for(const h of d)c.isDefined(h,p)||c.embed({x:h-2,y:p-2},u);c=c.hLine({x:0,y:6},1/0,({x:p})=>c.isDefined(p,6)?void 0:p%2==0).vLine({x:6,y:0},1/0,({y:p})=>c.isDefined(6,p)?void 0:p%2==0);{const p=Sn.formatBits(t,n),h=m=>!r&&(p>>m&1)==1;for(let m=0;m<6;m++)c.set(8,m,h(m));for(let m=6;m<8;m++)c.set(8,m+1,h(m));for(let m=8;m<15;m++)c.set(8,a-15+m,h(m));for(let m=0;m<8;m++)c.set(a-m-1,8,h(m));for(let m=8;m<9;m++)c.set(15-m-1+1,8,h(m));for(let m=9;m<15;m++)c.set(15-m-1,8,h(m));c.set(8,a-8,!r)}if(e>=7){const p=Sn.versionBits(e);for(let h=0;h<18;h+=1){const m=!r&&(p>>h&1)==1,g=Math.floor(h/3),v=h%3+a-8-3;c.set(v,g,m),c.set(g,v,m)}}return c}function ZL(e,t,n){const r=e,a=r.height,c=Iv[t];let l=-1,u=a-1;for(let d=a-1;d>0;d-=2){for(d==6&&(d=5);;u+=l){for(let p=0;p<2;p+=1){const h=d-p;r.isDefined(h,u)||n(h,u,c(h,u))}if(u+l<0||u+l>=a)break}l=-l}}function eD(e){let t="numeric";for(let n of e)if(!Sn.alphabet.numeric.has(n)&&(t="alphanumeric",!Sn.alphabet.alphanumerc.has(n)))return"byte";return t}function tD(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function z_(e,t,n,r,a=tD){let c="",l=n.length;if(r==="numeric"){const g=Sn.alphabet.numeric.decode(n.split("")),v=g.length;for(let b=0;b<v-2;b+=3)c+=qo(g[b]*100+g[b+1]*10+g[b+2],10);v%3===1?c+=qo(g[v-1],4):v%3===2&&(c+=qo(g[v-2]*10+g[v-1],7))}else if(r==="alphanumeric"){const g=Sn.alphabet.alphanumerc.decode(n.split("")),v=g.length;for(let b=0;b<v-1;b+=2)c+=qo(g[b]*45+g[b+1],11);v%2==1&&(c+=qo(g[v-1],6))}else if(r==="byte"){const g=a(n);l=g.length,c=Array.from(g).map(v=>qo(v,8)).join("")}else throw new Error("encode: unsupported type");const{capacity:u}=Sn.capacity(e,t),d=qo(l,Sn.lengthBits(e,r));let p=Sn.modeBits[r]+d+c;if(p.length>u)throw new Error("Capacity overflow");p+="0".repeat(Math.min(4,Math.max(0,u-p.length))),p.length%8&&(p+="0".repeat(8-p.length%8));const h="1110110000010001";for(let g=0;p.length!==u;g++)p+=h[g%h.length];const m=Uint8Array.from(p.match(/(.{8})/g).map(g=>+`0b${g}`));return JL(e,t).encode(m)}function $_(e,t,n,r,a=!1){const c=XL(e,t,r,a);let l=0;const u=8*n.length;if(ZL(c,r,(d,p,h)=>{let m=!1;l<u&&(m=(n[l>>>3]>>(7-l&7)&1)!==0,l++),c.set(d,p,m!==h)}),l!==u)throw new Error("QR: bytes left after draw");return c}const N4=e=>{const t=e.map(n=>n?"1":"0").join("");return{len:t.length,n:+`0b${t}`}},M4=[!0,!1,!0,!0,!0,!1,!0],I4=[!1,!1,!1,!1],ph=N4([...M4,...I4]),H_=N4([...I4,...M4]);function nD(e){const t=e,{width:n,height:r}=t,a=t.transpose();let c=0;for(let g=0;g<r;g++)t.getRuns(g,v=>{v>=5&&(c+=3+(v-5))});for(let g=0;g<n;g++)a.getRuns(g,v=>{v>=5&&(c+=3+(v-5))});let l=0;for(let g=0;g<r-1;g++)l+=3*t.countBoxes2x2(g);let u=0;for(let g=0;g<r;g++)u+=40*t.countPatternInRow(g,ph.len,ph.n,H_.n);for(let g=0;g<n;g++)u+=40*a.countPatternInRow(g,ph.len,ph.n,H_.n);const d=r*n,p=t.popcnt(),m=10*Math.ceil(Math.max(0,Math.abs(p*100-d*50)-d*5)/(d*5));return c+l+u+m}function rD(e,t,n,r){if(r===void 0){const a=GL();for(let c=0;c<Iv.length;c++)a.add(nD($_(e,t,n,c,!0)),c);r=a.get()}if(r===void 0)throw new Error("Cannot find mask");return $_(e,t,n,r)}function sD(e){if(!O_.includes(e))throw new Error(`Invalid error correction mode=${e}. Expected: ${O_}`)}function aD(e){if(!F_.includes(e))throw new Error(`Encoding: invalid mode=${e}. Expected: ${F_}`);if(e==="kanji"||e==="eci")throw new Error(`Encoding: ${e} is not supported (yet?).`)}function oD(e){if(![0,1,2,3,4,5,6,7].includes(e)||!Iv[e])throw new Error(`Invalid mask=${e}. Expected number [0..7]`)}function iD(e,t="raw",n={}){const r=n,a=r.ecc!==void 0?r.ecc:"medium";sD(a);const c=r.encoding!==void 0?r.encoding:eD(e);aD(c),r.mask!==void 0&&oD(r.mask);let l=r.version,u,d=new Error("Unknown error");if(l!==void 0)VL(l),u=z_(l,a,e,c,r.textEncoder);else for(let m=1;m<=40;m++)try{u=z_(m,a,e,c,r.textEncoder),l=m;break}catch(g){d=g}if(!l||!u)throw d;let p=rD(l,a,u,r.mask);p.assertDrawn();const h=r.border===void 0?2:r.border;if(!Number.isSafeInteger(h)||h<=0)throw new Error(`invalid border=${h}`);if(p=p.border(h,!1),r.scale!==void 0&&(p=p.scale(r.scale)),t==="raw")return p.toRaw();if(t==="ascii")return p.toASCII();if(t==="svg")return p.toSVG(r.optimize);if(t==="gif")return p.toGIF();if(t==="term")return p.toTerm();throw new Error(`Unknown output: ${t}`)}function cD(e,t={}){const{errorCorrection:n,version:r}=t,a=iD(e,"raw",{border:0,ecc:n,scale:1,version:r});return{edgeLength:a.length,finderLength:7,grid:a,value:e}}function ks(e){const{arena:t,...n}=e;return o.jsxs(ks.Root,{...n,children:[o.jsx(ks.Finder,{}),o.jsx(ks.Cells,{}),t&&o.jsx(ks.Arena,{children:typeof t=="string"?o.jsx("img",{alt:"Arena",src:t,style:{borderRadius:1,height:"100%",objectFit:"cover",width:"100%"}}):t})]})}(function(e){e.Context=I.createContext(null);function t(c){const{children:l,size:u="100%",value:d,version:p,errorCorrection:h,...m}=c,g=I.useMemo(()=>(I.Children.map(l,k=>!I.isValidElement(k)||typeof k.type=="string"?null:"displayName"in k.type&&k.type.displayName==="Arena"?!0:null)??[]).some(Boolean),[l]),v=I.useMemo(()=>{let k=h;return g&&h==="low"&&(k="medium"),cD(d,{errorCorrection:k,version:p})},[d,g,h,p]),b=1,_=v.edgeLength*b,x=v.finderLength*b/2,j=g?Math.floor(_/4):0,A=I.useMemo(()=>({arenaSize:j,cellSize:b,edgeSize:_,qrcode:v,finderSize:x}),[j,_,v,x]);return o.jsx(e.Context.Provider,{value:A,children:o.jsxs("svg",{...m,width:u,height:u,viewBox:`0 0 ${_} ${_}`,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("title",{children:"QR Code"}),l]})})}e.Root=t,(function(c){c.displayName="Root"})(t=e.Root||(e.Root={}));function n(c){const{className:l,fill:u,innerClassName:d,radius:p=.25}=c,{cellSize:h,edgeSize:m,finderSize:g}=I.useContext(e.Context);function v({position:b}){let _=g-(g-h)-h/2;b==="top-right"&&(_=m-g-(g-h)-h/2);let x=g-(g-h)-h/2;b==="bottom-left"&&(x=m-g-(g-h)-h/2);let j=g-h*1.5;b==="top-right"&&(j=m-g-h*1.5);let A=g-h*1.5;return b==="bottom-left"&&(A=m-g-h*1.5),o.jsxs(o.Fragment,{children:[o.jsx("rect",{className:l,stroke:u??"currentColor",fill:"transparent",x:_,y:x,width:h+(g-h)*2,height:h+(g-h)*2,rx:2*p*(g-h),ry:2*p*(g-h),strokeWidth:h}),o.jsx("rect",{className:d,fill:u??"currentColor",x:j,y:A,width:h*3,height:h*3,rx:2*p*h,ry:2*p*h})]})}return o.jsxs(o.Fragment,{children:[o.jsx(v,{position:"top-left"}),o.jsx(v,{position:"top-right"}),o.jsx(v,{position:"bottom-left"})]})}e.Finder=n,(function(c){c.displayName="Finder"})(n=e.Finder||(e.Finder={}));function r(c){const{className:l,fill:u="currentColor",inset:d=!0,radius:p=1}=c,{arenaSize:h,cellSize:m,qrcode:g}=I.useContext(e.Context),{edgeLength:v,finderLength:b}=g,_=I.useMemo(()=>{let x="";for(let j=0;j<g.grid.length;j++){const A=g.grid[j];if(A)for(let k=0;k<A.length;k++){if(!A[k])continue;const E=v/2-h/2,B=E+h;if(j>=E&&j<=B&&k>=E&&k<=B)continue;const M=j<b&&k<b,P=j<b&&k>=v-b,R=j>=v-b&&k<b;if(M||P||R)continue;const z=d?m*.1:0,q=(m-z*2)/2,Q=k*m+m/2,O=j*m+m/2,K=Q-q,$=Q+q,L=O-q,se=O+q,D=p*q;x+=[`M ${K+D},${L}`,`L ${$-D},${L}`,`A ${D},${D} 0 0,1 ${$},${L+D}`,`L ${$},${se-D}`,`A ${D},${D} 0 0,1 ${$-D},${se}`,`L ${K+D},${se}`,`A ${D},${D} 0 0,1 ${K},${se-D}`,`L ${K},${L+D}`,`A ${D},${D} 0 0,1 ${K+D},${L}`,"z"].join(" ")}}return x},[h,m,v,b,g.grid,d,p]);return o.jsx("path",{className:l,d:_,fill:u})}e.Cells=r,(function(c){c.displayName="Cells"})(r=e.Cells||(e.Cells={}));function a(c){const{children:l}=c,{arenaSize:u,cellSize:d,edgeSize:p}=I.useContext(e.Context),h=Math.ceil(p/2-u/2),m=u+u%2,g=d/2;return o.jsx("foreignObject",{x:h,y:h,width:m,height:m,children:o.jsx("div",{style:{alignItems:"center",display:"flex",fontSize:1,justifyContent:"center",height:"100%",overflow:"hidden",width:"100%",padding:g,boxSizing:"border-box"},children:l})})}e.Arena=a,(function(c){c.displayName="Arena"})(a=e.Arena||(e.Arena={}))})(ks||(ks={}));function lD(e={}){let t,n,r,a;return c=>({id:"baseAccount",name:"Base Account",rdns:"app.base.account",type:"baseAccount",async connect({chainId:l,withCapabilities:u,...d}={}){var p;try{const h=await this.getProvider(),m=l??((p=c.chains[0])==null?void 0:p.id);if(!m)throw new pa;const g=await h.request({method:"wallet_connect",params:[{capabilities:"capabilities"in d&&d.capabilities?d.capabilities:{},chainIds:[we(m),...c.chains.filter(_=>_.id!==m).map(_=>we(_.id))]}]}),v=g.accounts.map(_=>({address:xt(_.address),capabilities:_.capabilities??{}}));let b=Number(g.chainIds[0]);if(n||(n=this.onAccountsChanged.bind(this),h.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),h.on("chainChanged",r)),a||(a=this.onDisconnect.bind(this),h.on("disconnect",a)),l&&b!==l){const _=await this.switchChain({chainId:l}).catch(x=>{if(x.code===ct.code)throw x;return{id:b}});b=(_==null?void 0:_.id)??b}return{accounts:u?v:v.map(_=>_.address),chainId:b}}catch(h){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(h.message)?new ct(h):h}},async disconnect(){const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),r&&(l.removeListener("chainChanged",r),r=void 0),a&&(l.removeListener("disconnect",a),a=void 0),l.disconnect()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(u=>xt(u))},async getChainId(){const u=await(await this.getProvider()).request({method:"eth_chainId"});return Number(u)},async getProvider(){if(!t){const l=(()=>{var p;return typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:((p=e.preference)==null?void 0:p.options)??"all"}})(),{createBaseAccountSDK:u}=await je(async()=>{const{createBaseAccountSDK:p}=await import("./index-CvRylmZJ.js");return{createBaseAccountSDK:p}},[]);t=u({...e,appChainIds:c.chains.map(p=>p.id),preference:l}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:u}){var h,m,g,v;const d=c.chains.find(b=>b.id===u);if(!d)throw new sr(new pa);const p=await this.getProvider();try{return await p.request({method:"wallet_switchEthereumChain",params:[{chainId:we(d.id)}]}),d}catch(b){if(b.code===4902)try{let _;l!=null&&l.blockExplorerUrls?_=l.blockExplorerUrls:_=(h=d.blockExplorers)!=null&&h.default.url?[(m=d.blockExplorers)==null?void 0:m.default.url]:[];let x;(g=l==null?void 0:l.rpcUrls)!=null&&g.length?x=l.rpcUrls:x=[((v=d.rpcUrls.default)==null?void 0:v.http[0])??""];const j={blockExplorerUrls:_,chainId:we(u),chainName:(l==null?void 0:l.chainName)??d.name,iconUrls:l==null?void 0:l.iconUrls,nativeCurrency:(l==null?void 0:l.nativeCurrency)??d.nativeCurrency,rpcUrls:x};return await p.request({method:"wallet_addEthereumChain",params:[j]}),d}catch(_){throw new ct(_)}throw new sr(b)}},onAccountsChanged(l){l.length===0?this.onDisconnect():c.emitter.emit("change",{accounts:l.map(u=>xt(u))})},onChainChanged(l){const u=Number(l);c.emitter.emit("change",{chainId:u})},async onDisconnect(l){c.emitter.emit("disconnect");const u=await this.getProvider();n&&(u.removeListener("accountsChanged",n),n=void 0),r&&(u.removeListener("chainChanged",r),r=void 0),a&&(u.removeListener("disconnect",a),a=void 0)}})}Bv.type="metaMask";function Bv(e={}){let t,n,r,a,c,l,u,d;return p=>({id:"metaMaskSDK",name:"MetaMask",rdns:["io.metamask","io.metamask.mobile"],type:Bv.type,async setup(){const h=await this.getProvider();h!=null&&h.on&&(l||(l=this.onConnect.bind(this),h.on("connect",l)),a||(a=this.onAccountsChanged.bind(this),h.on("accountsChanged",a)))},async connect({chainId:h,isReconnecting:m,withCapabilities:g}={}){const v=await this.getProvider();u||(u=this.onDisplayUri,v.on("display_uri",u));let b=[];m&&(b=await this.getAccounts().catch(()=>[]));try{let _,x;b!=null&&b.length||(e.connectAndSign||e.connectWith?(e.connectAndSign?_=await t.connectAndSign({msg:e.connectAndSign}):e.connectWith&&(x=await t.connectWith({method:e.connectWith.method,params:e.connectWith.params})),b=await this.getAccounts()):b=(await t.connect()).map(k=>xt(k)));let j=await this.getChainId();if(h&&j!==h){const A=await this.switchChain({chainId:h}).catch(k=>{if(k.code===ct.code)throw k;return{id:j}});j=(A==null?void 0:A.id)??j}return u&&(v.removeListener("display_uri",u),u=void 0),_?v.emit("connectAndSign",{accounts:b,chainId:j,signResponse:_}):x&&v.emit("connectWith",{accounts:b,chainId:j,connectWithResponse:x}),l&&(v.removeListener("connect",l),l=void 0),a||(a=this.onAccountsChanged.bind(this),v.on("accountsChanged",a)),c||(c=this.onChainChanged.bind(this),v.on("chainChanged",c)),d||(d=this.onDisconnect.bind(this),v.on("disconnect",d)),{accounts:g?b.map(A=>({address:A,capabilities:{}})):b,chainId:j}}catch(_){const x=_;throw x.code===ct.code?new ct(x):x.code===js.code?new js(x):x}},async disconnect(){const h=await this.getProvider();c&&(h.removeListener("chainChanged",c),c=void 0),d&&(h.removeListener("disconnect",d),d=void 0),l||(l=this.onConnect.bind(this),h.on("connect",l)),await t.terminate()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(g=>xt(g))},async getChainId(){const h=await this.getProvider(),m=h.getChainId()||await(h==null?void 0:h.request({method:"eth_chainId"}));return Number(m)},async getProvider(){async function h(){var _,x,j,A,k;const m=await(async()=>{const{default:N}=await je(async()=>{const{default:E}=await import("./metamask-sdk-K1x_iqcc.js");return{default:E}},[]);return typeof N!="function"&&typeof N.default=="function"?N.default:N})(),g={};for(const N of p.chains)g[we(N.id)]=(_=Sk({chain:N,transports:p.transports}))==null?void 0:_[0];t=new m({_source:"wagmi",forceDeleteProvider:!1,forceInjectProvider:!1,injectProvider:!1,...e,readonlyRPCMap:g,dappMetadata:{...e.dappMetadata,name:(x=e.dappMetadata)!=null&&x.name?(j=e.dappMetadata)==null?void 0:j.name:"wagmi",url:(A=e.dappMetadata)!=null&&A.url?(k=e.dappMetadata)==null?void 0:k.url:typeof window<"u"?window.location.origin:"https://wagmi.sh"},useDeeplink:e.useDeeplink??!0});const v=await t.init(),b=v!=null&&v.activeProvider?v.activeProvider:t.getProvider();if(!b)throw new gr;return b}return n||(r||(r=h()),n=await r),n},async isAuthorized(){try{return!!(await tl(()=>jp(()=>this.getAccounts(),{timeout:200}),{delay:201,retryCount:3})).length}catch{return!1}},async switchChain({addEthereumChainParameter:h,chainId:m}){var x,j;const g=await this.getProvider(),v=p.chains.find(A=>A.id===m);if(!v)throw new sr(new pa);try{return await g.request({method:"wallet_switchEthereumChain",params:[{chainId:we(m)}]}),await b(),await _(m),v}catch(A){const k=A;if(k.code===ct.code)throw new ct(k);if(k.code===4902||((j=(x=k==null?void 0:k.data)==null?void 0:x.originalError)==null?void 0:j.code)===4902)try{return await g.request({method:"wallet_addEthereumChain",params:[{blockExplorerUrls:(()=>{const{default:N,...E}=v.blockExplorers??{};if(h!=null&&h.blockExplorerUrls)return h.blockExplorerUrls;if(N)return[N.url,...Object.values(E).map(B=>B.url)]})(),chainId:we(m),chainName:(h==null?void 0:h.chainName)??v.name,iconUrls:h==null?void 0:h.iconUrls,nativeCurrency:(h==null?void 0:h.nativeCurrency)??v.nativeCurrency,rpcUrls:(()=>{var N,E;return(N=h==null?void 0:h.rpcUrls)!=null&&N.length?h.rpcUrls:[((E=v.rpcUrls.default)==null?void 0:E.http[0])??""]})()}]}),await b(),await _(m),v}catch(N){const E=N;throw E.code===ct.code?new ct(E):new sr(E)}throw new sr(k)}async function b(){await tl(async()=>{const A=Tr(await g.request({method:"eth_chainId"}));if(A!==m)throw new Error("User rejected switch after adding network.");return A},{delay:50,retryCount:20})}async function _(A){await new Promise(k=>{const N=(E=>{"chainId"in E&&E.chainId===A&&(p.emitter.off("change",N),k())});p.emitter.on("change",N),p.emitter.emit("change",{chainId:A})})}},async onAccountsChanged(h){if(h.length===0)if(t.isExtensionActive())this.onDisconnect();else return;else if(p.emitter.listenerCount("connect")){const m=(await this.getChainId()).toString();this.onConnect({chainId:m})}else p.emitter.emit("change",{accounts:h.map(m=>xt(m))})},onChainChanged(h){const m=Number(h);p.emitter.emit("change",{chainId:m})},async onConnect(h){const m=await this.getAccounts();if(m.length===0)return;const g=Number(h.chainId);p.emitter.emit("connect",{accounts:m,chainId:g});const v=await this.getProvider();l&&(v.removeListener("connect",l),l=void 0),a||(a=this.onAccountsChanged.bind(this),v.on("accountsChanged",a)),c||(c=this.onChainChanged.bind(this),v.on("chainChanged",c)),d||(d=this.onDisconnect.bind(this),v.on("disconnect",d))},async onDisconnect(h){const m=await this.getProvider();h&&h.code===1013&&m&&(await this.getAccounts()).length||(p.emitter.emit("disconnect"),c&&(m.removeListener("chainChanged",c),c=void 0),d&&(m.removeListener("disconnect",d),d=void 0),l||(l=this.onConnect.bind(this),m.on("connect",l)))},onDisplayUri(h){p.emitter.emit("message",{type:"display_uri",data:h})}})}Tv.type="safe";function Tv(e={}){const{shimDisconnect:t=!1}=e;let n,r;return a=>({id:"safe",name:"Safe",type:Tv.type,async connect({withCapabilities:c}={}){var p;const l=await this.getProvider();if(!l)throw new gr;const u=await this.getAccounts(),d=await this.getChainId();return r||(r=this.onDisconnect.bind(this),l.on("disconnect",r)),t&&await((p=a.storage)==null?void 0:p.removeItem("safe.disconnected")),{accounts:c?u.map(h=>({address:h,capabilities:{}})):u,chainId:d}},async disconnect(){var l;const c=await this.getProvider();if(!c)throw new gr;r&&(c.removeListener("disconnect",r),r=void 0),t&&await((l=a.storage)==null?void 0:l.setItem("safe.disconnected",!0))},async getAccounts(){const c=await this.getProvider();if(!c)throw new gr;return(await c.request({method:"eth_accounts"})).map(xt)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!n){const{default:l}=await je(async()=>{const{default:h}=await import("./index-BeUp3nOq.js");return{default:h}},__vite__mapDeps([0,1])),u=new l(e),d=await jp(()=>u.safe.getInfo(),{timeout:e.unstable_getInfoTimeout??10});if(!d)throw new Error("Could not load Safe information");const p=await(async()=>{const h=await je(()=>import("./index-Et5S3ZaW.js").then(m=>m.i),__vite__mapDeps([2,1,3]));return typeof h.SafeAppProvider!="function"&&typeof h.default.SafeAppProvider=="function"?h.default.SafeAppProvider:h.SafeAppProvider})();n=new p(d,u)}return n}},async getChainId(){const c=await this.getProvider();if(!c)throw new gr;return Number(c.chainId)},async isAuthorized(){var c;try{return t&&await((c=a.storage)==null?void 0:c.getItem("safe.disconnected"))?!1:!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){a.emitter.emit("disconnect")}})}Pv.type="walletConnect";function Pv(e){const t=e.isNewChainsStale??!0;let n,r;const a="eip155";let c,l,u,d,p,h;return m=>({id:"walletConnect",name:"WalletConnect",type:Pv.type,async setup(){const g=await this.getProvider().catch(()=>null);g&&(u||(u=this.onConnect.bind(this),g.on("connect",u)),p||(p=this.onSessionDelete.bind(this),g.on("session_delete",p)))},async connect({chainId:g,withCapabilities:v,...b}={}){var _,x;try{const j=await this.getProvider();if(!j)throw new gr;d||(d=this.onDisplayUri,j.on("display_uri",d));let A=g;if(!A){const B=await((_=m.storage)==null?void 0:_.getItem("state"))??{};m.chains.some(P=>P.id===B.chainId)?A=B.chainId:A=(x=m.chains[0])==null?void 0:x.id}if(!A)throw new Error("No chains found on connector.");const k=await this.isChainsStale();if(j.session&&k&&await j.disconnect(),!j.session||k){const B=m.chains.filter(M=>M.id!==A).map(M=>M.id);await j.connect({optionalChains:[A,...B],..."pairingTopic"in b?{pairingTopic:b.pairingTopic}:{}}),this.setRequestedChainsIds(m.chains.map(M=>M.id))}const N=(await j.enable()).map(B=>xt(B));let E=await this.getChainId();if(g&&E!==g){const B=await this.switchChain({chainId:g}).catch(M=>{var P;if(M.code===ct.code&&((P=M.cause)==null?void 0:P.message)!=="Missing or invalid. request() method: wallet_addEthereumChain")throw M;return{id:E}});E=(B==null?void 0:B.id)??E}return d&&(j.removeListener("display_uri",d),d=void 0),u&&(j.removeListener("connect",u),u=void 0),c||(c=this.onAccountsChanged.bind(this),j.on("accountsChanged",c)),l||(l=this.onChainChanged.bind(this),j.on("chainChanged",l)),h||(h=this.onDisconnect.bind(this),j.on("disconnect",h)),p||(p=this.onSessionDelete.bind(this),j.on("session_delete",p)),{accounts:v?N.map(B=>({address:B,capabilities:{}})):N,chainId:E}}catch(j){throw/(user rejected|connection request reset)/i.test(j==null?void 0:j.message)?new ct(j):j}},async disconnect(){const g=await this.getProvider();try{await(g==null?void 0:g.disconnect())}catch(v){if(!/No matching key/i.test(v.message))throw v}finally{l&&(g==null||g.removeListener("chainChanged",l),l=void 0),h&&(g==null||g.removeListener("disconnect",h),h=void 0),u||(u=this.onConnect.bind(this),g==null||g.on("connect",u)),c&&(g==null||g.removeListener("accountsChanged",c),c=void 0),p&&(g==null||g.removeListener("session_delete",p),p=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(v=>xt(v))},async getProvider({chainId:g}={}){var b;async function v(){const _=m.chains.map(j=>j.id);if(!_.length)return;const{EthereumProvider:x}=await je(async()=>{const{EthereumProvider:j}=await import("./index.es-dfpEui-9.js").then(A=>A.x);return{EthereumProvider:j}},__vite__mapDeps([4,3]));return await x.init({...e,disableProviderPing:!0,optionalChains:_,projectId:e.projectId,rpcMap:Object.fromEntries(m.chains.map(j=>{const[A]=Sk({chain:j,transports:m.transports});return[j.id,A]})),showQrModal:e.showQrModal??!0})}return n||(r||(r=v()),n=await r,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY)),g&&await((b=this.switchChain)==null?void 0:b.call(this,{chainId:g})),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[g,v]=await Promise.all([this.getAccounts(),this.getProvider()]);return g.length?await this.isChainsStale()&&v.session?(await v.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:g,chainId:v}){var x,j,A;const b=await this.getProvider();if(!b)throw new gr;const _=m.chains.find(k=>k.id===v);if(!_)throw new sr(new pa);try{await Promise.all([new Promise(N=>{const E=({chainId:B})=>{B===v&&(m.emitter.off("change",E),N())};m.emitter.on("change",E)}),b.request({method:"wallet_switchEthereumChain",params:[{chainId:we(v)}]})]);const k=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...k,v]),_}catch(k){const N=k;if(/(user rejected)/i.test(N.message))throw new ct(N);try{let E;g!=null&&g.blockExplorerUrls?E=g.blockExplorerUrls:E=(x=_.blockExplorers)!=null&&x.default.url?[(j=_.blockExplorers)==null?void 0:j.default.url]:[];let B;(A=g==null?void 0:g.rpcUrls)!=null&&A.length?B=g.rpcUrls:B=[..._.rpcUrls.default.http];const M={blockExplorerUrls:E,chainId:we(v),chainName:(g==null?void 0:g.chainName)??_.name,iconUrls:g==null?void 0:g.iconUrls,nativeCurrency:(g==null?void 0:g.nativeCurrency)??_.nativeCurrency,rpcUrls:B};await b.request({method:"wallet_addEthereumChain",params:[M]});const P=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...P,v]),_}catch(E){throw new ct(E)}}},onAccountsChanged(g){g.length===0?this.onDisconnect():m.emitter.emit("change",{accounts:g.map(v=>xt(v))})},onChainChanged(g){const v=Number(g);m.emitter.emit("change",{chainId:v})},async onConnect(g){const v=Number(g.chainId),b=await this.getAccounts();m.emitter.emit("connect",{accounts:b,chainId:v})},async onDisconnect(g){this.setRequestedChainsIds([]),m.emitter.emit("disconnect");const v=await this.getProvider();c&&(v.removeListener("accountsChanged",c),c=void 0),l&&(v.removeListener("chainChanged",l),l=void 0),h&&(v.removeListener("disconnect",h),h=void 0),p&&(v.removeListener("session_delete",p),p=void 0),u||(u=this.onConnect.bind(this),v.on("connect",u))},onDisplayUri(g){m.emitter.emit("message",{type:"display_uri",data:g})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var v,b,_;return n?((_=(b=(v=n.session)==null?void 0:v.namespaces[a])==null?void 0:b.accounts)==null?void 0:_.map(x=>Number.parseInt(x.split(":")[1]||"",10)))??[]:[]},async getRequestedChainsIds(){var g;return await((g=m.storage)==null?void 0:g.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!t)return!1;const g=m.chains.map(_=>_.id),v=this.getNamespaceChainsIds();if(v.length&&!v.some(_=>g.includes(_)))return!1;const b=await this.getRequestedChainsIds();return!g.every(_=>b.includes(_))},async setRequestedChainsIds(g){var v;await((v=m.storage)==null?void 0:v.setItem(this.requestedChainsStorageKey,g))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}var Xh={},uD=768,vc=nA({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),B4=Ix({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),hy=cA({conditions:{defaultCondition:"base",conditionNames:["base","hover","active"],responsiveArray:void 0},styles:{background:{values:{accentColor:{conditions:{base:"ju367v9i",hover:"ju367v9j",active:"ju367v9k"},defaultClass:"ju367v9i"},accentColorForeground:{conditions:{base:"ju367v9l",hover:"ju367v9m",active:"ju367v9n"},defaultClass:"ju367v9l"},actionButtonBorder:{conditions:{base:"ju367v9o",hover:"ju367v9p",active:"ju367v9q"},defaultClass:"ju367v9o"},actionButtonBorderMobile:{conditions:{base:"ju367v9r",hover:"ju367v9s",active:"ju367v9t"},defaultClass:"ju367v9r"},actionButtonSecondaryBackground:{conditions:{base:"ju367v9u",hover:"ju367v9v",active:"ju367v9w"},defaultClass:"ju367v9u"},closeButton:{conditions:{base:"ju367v9x",hover:"ju367v9y",active:"ju367v9z"},defaultClass:"ju367v9x"},closeButtonBackground:{conditions:{base:"ju367va0",hover:"ju367va1",active:"ju367va2"},defaultClass:"ju367va0"},connectButtonBackground:{conditions:{base:"ju367va3",hover:"ju367va4",active:"ju367va5"},defaultClass:"ju367va3"},connectButtonBackgroundError:{conditions:{base:"ju367va6",hover:"ju367va7",active:"ju367va8"},defaultClass:"ju367va6"},connectButtonInnerBackground:{conditions:{base:"ju367va9",hover:"ju367vaa",active:"ju367vab"},defaultClass:"ju367va9"},connectButtonText:{conditions:{base:"ju367vac",hover:"ju367vad",active:"ju367vae"},defaultClass:"ju367vac"},connectButtonTextError:{conditions:{base:"ju367vaf",hover:"ju367vag",active:"ju367vah"},defaultClass:"ju367vaf"},connectionIndicator:{conditions:{base:"ju367vai",hover:"ju367vaj",active:"ju367vak"},defaultClass:"ju367vai"},downloadBottomCardBackground:{conditions:{base:"ju367val",hover:"ju367vam",active:"ju367van"},defaultClass:"ju367val"},downloadTopCardBackground:{conditions:{base:"ju367vao",hover:"ju367vap",active:"ju367vaq"},defaultClass:"ju367vao"},error:{conditions:{base:"ju367var",hover:"ju367vas",active:"ju367vat"},defaultClass:"ju367var"},generalBorder:{conditions:{base:"ju367vau",hover:"ju367vav",active:"ju367vaw"},defaultClass:"ju367vau"},generalBorderDim:{conditions:{base:"ju367vax",hover:"ju367vay",active:"ju367vaz"},defaultClass:"ju367vax"},menuItemBackground:{conditions:{base:"ju367vb0",hover:"ju367vb1",active:"ju367vb2"},defaultClass:"ju367vb0"},modalBackdrop:{conditions:{base:"ju367vb3",hover:"ju367vb4",active:"ju367vb5"},defaultClass:"ju367vb3"},modalBackground:{conditions:{base:"ju367vb6",hover:"ju367vb7",active:"ju367vb8"},defaultClass:"ju367vb6"},modalBorder:{conditions:{base:"ju367vb9",hover:"ju367vba",active:"ju367vbb"},defaultClass:"ju367vb9"},modalText:{conditions:{base:"ju367vbc",hover:"ju367vbd",active:"ju367vbe"},defaultClass:"ju367vbc"},modalTextDim:{conditions:{base:"ju367vbf",hover:"ju367vbg",active:"ju367vbh"},defaultClass:"ju367vbf"},modalTextSecondary:{conditions:{base:"ju367vbi",hover:"ju367vbj",active:"ju367vbk"},defaultClass:"ju367vbi"},profileAction:{conditions:{base:"ju367vbl",hover:"ju367vbm",active:"ju367vbn"},defaultClass:"ju367vbl"},profileActionHover:{conditions:{base:"ju367vbo",hover:"ju367vbp",active:"ju367vbq"},defaultClass:"ju367vbo"},profileForeground:{conditions:{base:"ju367vbr",hover:"ju367vbs",active:"ju367vbt"},defaultClass:"ju367vbr"},selectedOptionBorder:{conditions:{base:"ju367vbu",hover:"ju367vbv",active:"ju367vbw"},defaultClass:"ju367vbu"},standby:{conditions:{base:"ju367vbx",hover:"ju367vby",active:"ju367vbz"},defaultClass:"ju367vbx"}}},borderColor:{values:{accentColor:{conditions:{base:"ju367vc0",hover:"ju367vc1",active:"ju367vc2"},defaultClass:"ju367vc0"},accentColorForeground:{conditions:{base:"ju367vc3",hover:"ju367vc4",active:"ju367vc5"},defaultClass:"ju367vc3"},actionButtonBorder:{conditions:{base:"ju367vc6",hover:"ju367vc7",active:"ju367vc8"},defaultClass:"ju367vc6"},actionButtonBorderMobile:{conditions:{base:"ju367vc9",hover:"ju367vca",active:"ju367vcb"},defaultClass:"ju367vc9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vcc",hover:"ju367vcd",active:"ju367vce"},defaultClass:"ju367vcc"},closeButton:{conditions:{base:"ju367vcf",hover:"ju367vcg",active:"ju367vch"},defaultClass:"ju367vcf"},closeButtonBackground:{conditions:{base:"ju367vci",hover:"ju367vcj",active:"ju367vck"},defaultClass:"ju367vci"},connectButtonBackground:{conditions:{base:"ju367vcl",hover:"ju367vcm",active:"ju367vcn"},defaultClass:"ju367vcl"},connectButtonBackgroundError:{conditions:{base:"ju367vco",hover:"ju367vcp",active:"ju367vcq"},defaultClass:"ju367vco"},connectButtonInnerBackground:{conditions:{base:"ju367vcr",hover:"ju367vcs",active:"ju367vct"},defaultClass:"ju367vcr"},connectButtonText:{conditions:{base:"ju367vcu",hover:"ju367vcv",active:"ju367vcw"},defaultClass:"ju367vcu"},connectButtonTextError:{conditions:{base:"ju367vcx",hover:"ju367vcy",active:"ju367vcz"},defaultClass:"ju367vcx"},connectionIndicator:{conditions:{base:"ju367vd0",hover:"ju367vd1",active:"ju367vd2"},defaultClass:"ju367vd0"},downloadBottomCardBackground:{conditions:{base:"ju367vd3",hover:"ju367vd4",active:"ju367vd5"},defaultClass:"ju367vd3"},downloadTopCardBackground:{conditions:{base:"ju367vd6",hover:"ju367vd7",active:"ju367vd8"},defaultClass:"ju367vd6"},error:{conditions:{base:"ju367vd9",hover:"ju367vda",active:"ju367vdb"},defaultClass:"ju367vd9"},generalBorder:{conditions:{base:"ju367vdc",hover:"ju367vdd",active:"ju367vde"},defaultClass:"ju367vdc"},generalBorderDim:{conditions:{base:"ju367vdf",hover:"ju367vdg",active:"ju367vdh"},defaultClass:"ju367vdf"},menuItemBackground:{conditions:{base:"ju367vdi",hover:"ju367vdj",active:"ju367vdk"},defaultClass:"ju367vdi"},modalBackdrop:{conditions:{base:"ju367vdl",hover:"ju367vdm",active:"ju367vdn"},defaultClass:"ju367vdl"},modalBackground:{conditions:{base:"ju367vdo",hover:"ju367vdp",active:"ju367vdq"},defaultClass:"ju367vdo"},modalBorder:{conditions:{base:"ju367vdr",hover:"ju367vds",active:"ju367vdt"},defaultClass:"ju367vdr"},modalText:{conditions:{base:"ju367vdu",hover:"ju367vdv",active:"ju367vdw"},defaultClass:"ju367vdu"},modalTextDim:{conditions:{base:"ju367vdx",hover:"ju367vdy",active:"ju367vdz"},defaultClass:"ju367vdx"},modalTextSecondary:{conditions:{base:"ju367ve0",hover:"ju367ve1",active:"ju367ve2"},defaultClass:"ju367ve0"},profileAction:{conditions:{base:"ju367ve3",hover:"ju367ve4",active:"ju367ve5"},defaultClass:"ju367ve3"},profileActionHover:{conditions:{base:"ju367ve6",hover:"ju367ve7",active:"ju367ve8"},defaultClass:"ju367ve6"},profileForeground:{conditions:{base:"ju367ve9",hover:"ju367vea",active:"ju367veb"},defaultClass:"ju367ve9"},selectedOptionBorder:{conditions:{base:"ju367vec",hover:"ju367ved",active:"ju367vee"},defaultClass:"ju367vec"},standby:{conditions:{base:"ju367vef",hover:"ju367veg",active:"ju367veh"},defaultClass:"ju367vef"}}},boxShadow:{values:{connectButton:{conditions:{base:"ju367vei",hover:"ju367vej",active:"ju367vek"},defaultClass:"ju367vei"},dialog:{conditions:{base:"ju367vel",hover:"ju367vem",active:"ju367ven"},defaultClass:"ju367vel"},profileDetailsAction:{conditions:{base:"ju367veo",hover:"ju367vep",active:"ju367veq"},defaultClass:"ju367veo"},selectedOption:{conditions:{base:"ju367ver",hover:"ju367ves",active:"ju367vet"},defaultClass:"ju367ver"},selectedWallet:{conditions:{base:"ju367veu",hover:"ju367vev",active:"ju367vew"},defaultClass:"ju367veu"},walletLogo:{conditions:{base:"ju367vex",hover:"ju367vey",active:"ju367vez"},defaultClass:"ju367vex"}}},color:{values:{accentColor:{conditions:{base:"ju367vf0",hover:"ju367vf1",active:"ju367vf2"},defaultClass:"ju367vf0"},accentColorForeground:{conditions:{base:"ju367vf3",hover:"ju367vf4",active:"ju367vf5"},defaultClass:"ju367vf3"},actionButtonBorder:{conditions:{base:"ju367vf6",hover:"ju367vf7",active:"ju367vf8"},defaultClass:"ju367vf6"},actionButtonBorderMobile:{conditions:{base:"ju367vf9",hover:"ju367vfa",active:"ju367vfb"},defaultClass:"ju367vf9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vfc",hover:"ju367vfd",active:"ju367vfe"},defaultClass:"ju367vfc"},closeButton:{conditions:{base:"ju367vff",hover:"ju367vfg",active:"ju367vfh"},defaultClass:"ju367vff"},closeButtonBackground:{conditions:{base:"ju367vfi",hover:"ju367vfj",active:"ju367vfk"},defaultClass:"ju367vfi"},connectButtonBackground:{conditions:{base:"ju367vfl",hover:"ju367vfm",active:"ju367vfn"},defaultClass:"ju367vfl"},connectButtonBackgroundError:{conditions:{base:"ju367vfo",hover:"ju367vfp",active:"ju367vfq"},defaultClass:"ju367vfo"},connectButtonInnerBackground:{conditions:{base:"ju367vfr",hover:"ju367vfs",active:"ju367vft"},defaultClass:"ju367vfr"},connectButtonText:{conditions:{base:"ju367vfu",hover:"ju367vfv",active:"ju367vfw"},defaultClass:"ju367vfu"},connectButtonTextError:{conditions:{base:"ju367vfx",hover:"ju367vfy",active:"ju367vfz"},defaultClass:"ju367vfx"},connectionIndicator:{conditions:{base:"ju367vg0",hover:"ju367vg1",active:"ju367vg2"},defaultClass:"ju367vg0"},downloadBottomCardBackground:{conditions:{base:"ju367vg3",hover:"ju367vg4",active:"ju367vg5"},defaultClass:"ju367vg3"},downloadTopCardBackground:{conditions:{base:"ju367vg6",hover:"ju367vg7",active:"ju367vg8"},defaultClass:"ju367vg6"},error:{conditions:{base:"ju367vg9",hover:"ju367vga",active:"ju367vgb"},defaultClass:"ju367vg9"},generalBorder:{conditions:{base:"ju367vgc",hover:"ju367vgd",active:"ju367vge"},defaultClass:"ju367vgc"},generalBorderDim:{conditions:{base:"ju367vgf",hover:"ju367vgg",active:"ju367vgh"},defaultClass:"ju367vgf"},menuItemBackground:{conditions:{base:"ju367vgi",hover:"ju367vgj",active:"ju367vgk"},defaultClass:"ju367vgi"},modalBackdrop:{conditions:{base:"ju367vgl",hover:"ju367vgm",active:"ju367vgn"},defaultClass:"ju367vgl"},modalBackground:{conditions:{base:"ju367vgo",hover:"ju367vgp",active:"ju367vgq"},defaultClass:"ju367vgo"},modalBorder:{conditions:{base:"ju367vgr",hover:"ju367vgs",active:"ju367vgt"},defaultClass:"ju367vgr"},modalText:{conditions:{base:"ju367vgu",hover:"ju367vgv",active:"ju367vgw"},defaultClass:"ju367vgu"},modalTextDim:{conditions:{base:"ju367vgx",hover:"ju367vgy",active:"ju367vgz"},defaultClass:"ju367vgx"},modalTextSecondary:{conditions:{base:"ju367vh0",hover:"ju367vh1",active:"ju367vh2"},defaultClass:"ju367vh0"},profileAction:{conditions:{base:"ju367vh3",hover:"ju367vh4",active:"ju367vh5"},defaultClass:"ju367vh3"},profileActionHover:{conditions:{base:"ju367vh6",hover:"ju367vh7",active:"ju367vh8"},defaultClass:"ju367vh6"},profileForeground:{conditions:{base:"ju367vh9",hover:"ju367vha",active:"ju367vhb"},defaultClass:"ju367vh9"},selectedOptionBorder:{conditions:{base:"ju367vhc",hover:"ju367vhd",active:"ju367vhe"},defaultClass:"ju367vhc"},standby:{conditions:{base:"ju367vhf",hover:"ju367vhg",active:"ju367vhh"},defaultClass:"ju367vhf"}}}}},{conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0},styles:{alignItems:{values:{"flex-start":{conditions:{smallScreen:"ju367v0",largeScreen:"ju367v1"},defaultClass:"ju367v0"},"flex-end":{conditions:{smallScreen:"ju367v2",largeScreen:"ju367v3"},defaultClass:"ju367v2"},center:{conditions:{smallScreen:"ju367v4",largeScreen:"ju367v5"},defaultClass:"ju367v4"}}},display:{values:{none:{conditions:{smallScreen:"ju367v6",largeScreen:"ju367v7"},defaultClass:"ju367v6"},block:{conditions:{smallScreen:"ju367v8",largeScreen:"ju367v9"},defaultClass:"ju367v8"},flex:{conditions:{smallScreen:"ju367va",largeScreen:"ju367vb"},defaultClass:"ju367va"},inline:{conditions:{smallScreen:"ju367vc",largeScreen:"ju367vd"},defaultClass:"ju367vc"}}}}},{conditions:void 0,styles:{margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},alignSelf:{values:{"flex-start":{defaultClass:"ju367ve"},"flex-end":{defaultClass:"ju367vf"},center:{defaultClass:"ju367vg"}}},backgroundSize:{values:{cover:{defaultClass:"ju367vh"}}},borderRadius:{values:{1:{defaultClass:"ju367vi"},6:{defaultClass:"ju367vj"},10:{defaultClass:"ju367vk"},13:{defaultClass:"ju367vl"},actionButton:{defaultClass:"ju367vm"},connectButton:{defaultClass:"ju367vn"},menuButton:{defaultClass:"ju367vo"},modal:{defaultClass:"ju367vp"},modalMobile:{defaultClass:"ju367vq"},"25%":{defaultClass:"ju367vr"},full:{defaultClass:"ju367vs"}}},borderStyle:{values:{solid:{defaultClass:"ju367vt"}}},borderWidth:{values:{0:{defaultClass:"ju367vu"},1:{defaultClass:"ju367vv"},2:{defaultClass:"ju367vw"},4:{defaultClass:"ju367vx"}}},cursor:{values:{pointer:{defaultClass:"ju367vy"},none:{defaultClass:"ju367vz"}}},pointerEvents:{values:{none:{defaultClass:"ju367v10"},all:{defaultClass:"ju367v11"}}},minHeight:{values:{8:{defaultClass:"ju367v12"},44:{defaultClass:"ju367v13"}}},flexDirection:{values:{row:{defaultClass:"ju367v14"},column:{defaultClass:"ju367v15"}}},fontFamily:{values:{body:{defaultClass:"ju367v16"}}},fontSize:{values:{12:{defaultClass:"ju367v17"},13:{defaultClass:"ju367v18"},14:{defaultClass:"ju367v19"},16:{defaultClass:"ju367v1a"},18:{defaultClass:"ju367v1b"},20:{defaultClass:"ju367v1c"},23:{defaultClass:"ju367v1d"}}},fontWeight:{values:{regular:{defaultClass:"ju367v1e"},medium:{defaultClass:"ju367v1f"},semibold:{defaultClass:"ju367v1g"},bold:{defaultClass:"ju367v1h"},heavy:{defaultClass:"ju367v1i"}}},gap:{values:{0:{defaultClass:"ju367v1j"},1:{defaultClass:"ju367v1k"},2:{defaultClass:"ju367v1l"},3:{defaultClass:"ju367v1m"},4:{defaultClass:"ju367v1n"},5:{defaultClass:"ju367v1o"},6:{defaultClass:"ju367v1p"},8:{defaultClass:"ju367v1q"},10:{defaultClass:"ju367v1r"},12:{defaultClass:"ju367v1s"},14:{defaultClass:"ju367v1t"},16:{defaultClass:"ju367v1u"},18:{defaultClass:"ju367v1v"},20:{defaultClass:"ju367v1w"},24:{defaultClass:"ju367v1x"},28:{defaultClass:"ju367v1y"},32:{defaultClass:"ju367v1z"},36:{defaultClass:"ju367v20"},44:{defaultClass:"ju367v21"},64:{defaultClass:"ju367v22"},"-1":{defaultClass:"ju367v23"}}},height:{values:{1:{defaultClass:"ju367v24"},2:{defaultClass:"ju367v25"},4:{defaultClass:"ju367v26"},8:{defaultClass:"ju367v27"},12:{defaultClass:"ju367v28"},20:{defaultClass:"ju367v29"},24:{defaultClass:"ju367v2a"},28:{defaultClass:"ju367v2b"},30:{defaultClass:"ju367v2c"},32:{defaultClass:"ju367v2d"},34:{defaultClass:"ju367v2e"},36:{defaultClass:"ju367v2f"},40:{defaultClass:"ju367v2g"},44:{defaultClass:"ju367v2h"},48:{defaultClass:"ju367v2i"},54:{defaultClass:"ju367v2j"},60:{defaultClass:"ju367v2k"},200:{defaultClass:"ju367v2l"},full:{defaultClass:"ju367v2m"},max:{defaultClass:"ju367v2n"}}},justifyContent:{values:{"flex-start":{defaultClass:"ju367v2o"},"flex-end":{defaultClass:"ju367v2p"},center:{defaultClass:"ju367v2q"},"space-between":{defaultClass:"ju367v2r"},"space-around":{defaultClass:"ju367v2s"}}},textAlign:{values:{left:{defaultClass:"ju367v2t"},center:{defaultClass:"ju367v2u"},inherit:{defaultClass:"ju367v2v"}}},marginBottom:{values:{0:{defaultClass:"ju367v2w"},1:{defaultClass:"ju367v2x"},2:{defaultClass:"ju367v2y"},3:{defaultClass:"ju367v2z"},4:{defaultClass:"ju367v30"},5:{defaultClass:"ju367v31"},6:{defaultClass:"ju367v32"},8:{defaultClass:"ju367v33"},10:{defaultClass:"ju367v34"},12:{defaultClass:"ju367v35"},14:{defaultClass:"ju367v36"},16:{defaultClass:"ju367v37"},18:{defaultClass:"ju367v38"},20:{defaultClass:"ju367v39"},24:{defaultClass:"ju367v3a"},28:{defaultClass:"ju367v3b"},32:{defaultClass:"ju367v3c"},36:{defaultClass:"ju367v3d"},44:{defaultClass:"ju367v3e"},64:{defaultClass:"ju367v3f"},"-1":{defaultClass:"ju367v3g"}}},marginLeft:{values:{0:{defaultClass:"ju367v3h"},1:{defaultClass:"ju367v3i"},2:{defaultClass:"ju367v3j"},3:{defaultClass:"ju367v3k"},4:{defaultClass:"ju367v3l"},5:{defaultClass:"ju367v3m"},6:{defaultClass:"ju367v3n"},8:{defaultClass:"ju367v3o"},10:{defaultClass:"ju367v3p"},12:{defaultClass:"ju367v3q"},14:{defaultClass:"ju367v3r"},16:{defaultClass:"ju367v3s"},18:{defaultClass:"ju367v3t"},20:{defaultClass:"ju367v3u"},24:{defaultClass:"ju367v3v"},28:{defaultClass:"ju367v3w"},32:{defaultClass:"ju367v3x"},36:{defaultClass:"ju367v3y"},44:{defaultClass:"ju367v3z"},64:{defaultClass:"ju367v40"},"-1":{defaultClass:"ju367v41"}}},marginRight:{values:{0:{defaultClass:"ju367v42"},1:{defaultClass:"ju367v43"},2:{defaultClass:"ju367v44"},3:{defaultClass:"ju367v45"},4:{defaultClass:"ju367v46"},5:{defaultClass:"ju367v47"},6:{defaultClass:"ju367v48"},8:{defaultClass:"ju367v49"},10:{defaultClass:"ju367v4a"},12:{defaultClass:"ju367v4b"},14:{defaultClass:"ju367v4c"},16:{defaultClass:"ju367v4d"},18:{defaultClass:"ju367v4e"},20:{defaultClass:"ju367v4f"},24:{defaultClass:"ju367v4g"},28:{defaultClass:"ju367v4h"},32:{defaultClass:"ju367v4i"},36:{defaultClass:"ju367v4j"},44:{defaultClass:"ju367v4k"},64:{defaultClass:"ju367v4l"},"-1":{defaultClass:"ju367v4m"}}},marginTop:{values:{0:{defaultClass:"ju367v4n"},1:{defaultClass:"ju367v4o"},2:{defaultClass:"ju367v4p"},3:{defaultClass:"ju367v4q"},4:{defaultClass:"ju367v4r"},5:{defaultClass:"ju367v4s"},6:{defaultClass:"ju367v4t"},8:{defaultClass:"ju367v4u"},10:{defaultClass:"ju367v4v"},12:{defaultClass:"ju367v4w"},14:{defaultClass:"ju367v4x"},16:{defaultClass:"ju367v4y"},18:{defaultClass:"ju367v4z"},20:{defaultClass:"ju367v50"},24:{defaultClass:"ju367v51"},28:{defaultClass:"ju367v52"},32:{defaultClass:"ju367v53"},36:{defaultClass:"ju367v54"},44:{defaultClass:"ju367v55"},64:{defaultClass:"ju367v56"},"-1":{defaultClass:"ju367v57"}}},maxWidth:{values:{1:{defaultClass:"ju367v58"},2:{defaultClass:"ju367v59"},4:{defaultClass:"ju367v5a"},8:{defaultClass:"ju367v5b"},12:{defaultClass:"ju367v5c"},20:{defaultClass:"ju367v5d"},24:{defaultClass:"ju367v5e"},28:{defaultClass:"ju367v5f"},30:{defaultClass:"ju367v5g"},32:{defaultClass:"ju367v5h"},34:{defaultClass:"ju367v5i"},36:{defaultClass:"ju367v5j"},40:{defaultClass:"ju367v5k"},44:{defaultClass:"ju367v5l"},48:{defaultClass:"ju367v5m"},54:{defaultClass:"ju367v5n"},60:{defaultClass:"ju367v5o"},200:{defaultClass:"ju367v5p"},full:{defaultClass:"ju367v5q"},max:{defaultClass:"ju367v5r"}}},minWidth:{values:{1:{defaultClass:"ju367v5s"},2:{defaultClass:"ju367v5t"},4:{defaultClass:"ju367v5u"},8:{defaultClass:"ju367v5v"},12:{defaultClass:"ju367v5w"},20:{defaultClass:"ju367v5x"},24:{defaultClass:"ju367v5y"},28:{defaultClass:"ju367v5z"},30:{defaultClass:"ju367v60"},32:{defaultClass:"ju367v61"},34:{defaultClass:"ju367v62"},36:{defaultClass:"ju367v63"},40:{defaultClass:"ju367v64"},44:{defaultClass:"ju367v65"},48:{defaultClass:"ju367v66"},54:{defaultClass:"ju367v67"},60:{defaultClass:"ju367v68"},200:{defaultClass:"ju367v69"},full:{defaultClass:"ju367v6a"},max:{defaultClass:"ju367v6b"}}},overflow:{values:{hidden:{defaultClass:"ju367v6c"}}},paddingBottom:{values:{0:{defaultClass:"ju367v6d"},1:{defaultClass:"ju367v6e"},2:{defaultClass:"ju367v6f"},3:{defaultClass:"ju367v6g"},4:{defaultClass:"ju367v6h"},5:{defaultClass:"ju367v6i"},6:{defaultClass:"ju367v6j"},8:{defaultClass:"ju367v6k"},10:{defaultClass:"ju367v6l"},12:{defaultClass:"ju367v6m"},14:{defaultClass:"ju367v6n"},16:{defaultClass:"ju367v6o"},18:{defaultClass:"ju367v6p"},20:{defaultClass:"ju367v6q"},24:{defaultClass:"ju367v6r"},28:{defaultClass:"ju367v6s"},32:{defaultClass:"ju367v6t"},36:{defaultClass:"ju367v6u"},44:{defaultClass:"ju367v6v"},64:{defaultClass:"ju367v6w"},"-1":{defaultClass:"ju367v6x"}}},paddingLeft:{values:{0:{defaultClass:"ju367v6y"},1:{defaultClass:"ju367v6z"},2:{defaultClass:"ju367v70"},3:{defaultClass:"ju367v71"},4:{defaultClass:"ju367v72"},5:{defaultClass:"ju367v73"},6:{defaultClass:"ju367v74"},8:{defaultClass:"ju367v75"},10:{defaultClass:"ju367v76"},12:{defaultClass:"ju367v77"},14:{defaultClass:"ju367v78"},16:{defaultClass:"ju367v79"},18:{defaultClass:"ju367v7a"},20:{defaultClass:"ju367v7b"},24:{defaultClass:"ju367v7c"},28:{defaultClass:"ju367v7d"},32:{defaultClass:"ju367v7e"},36:{defaultClass:"ju367v7f"},44:{defaultClass:"ju367v7g"},64:{defaultClass:"ju367v7h"},"-1":{defaultClass:"ju367v7i"}}},paddingRight:{values:{0:{defaultClass:"ju367v7j"},1:{defaultClass:"ju367v7k"},2:{defaultClass:"ju367v7l"},3:{defaultClass:"ju367v7m"},4:{defaultClass:"ju367v7n"},5:{defaultClass:"ju367v7o"},6:{defaultClass:"ju367v7p"},8:{defaultClass:"ju367v7q"},10:{defaultClass:"ju367v7r"},12:{defaultClass:"ju367v7s"},14:{defaultClass:"ju367v7t"},16:{defaultClass:"ju367v7u"},18:{defaultClass:"ju367v7v"},20:{defaultClass:"ju367v7w"},24:{defaultClass:"ju367v7x"},28:{defaultClass:"ju367v7y"},32:{defaultClass:"ju367v7z"},36:{defaultClass:"ju367v80"},44:{defaultClass:"ju367v81"},64:{defaultClass:"ju367v82"},"-1":{defaultClass:"ju367v83"}}},paddingTop:{values:{0:{defaultClass:"ju367v84"},1:{defaultClass:"ju367v85"},2:{defaultClass:"ju367v86"},3:{defaultClass:"ju367v87"},4:{defaultClass:"ju367v88"},5:{defaultClass:"ju367v89"},6:{defaultClass:"ju367v8a"},8:{defaultClass:"ju367v8b"},10:{defaultClass:"ju367v8c"},12:{defaultClass:"ju367v8d"},14:{defaultClass:"ju367v8e"},16:{defaultClass:"ju367v8f"},18:{defaultClass:"ju367v8g"},20:{defaultClass:"ju367v8h"},24:{defaultClass:"ju367v8i"},28:{defaultClass:"ju367v8j"},32:{defaultClass:"ju367v8k"},36:{defaultClass:"ju367v8l"},44:{defaultClass:"ju367v8m"},64:{defaultClass:"ju367v8n"},"-1":{defaultClass:"ju367v8o"}}},position:{values:{absolute:{defaultClass:"ju367v8p"},fixed:{defaultClass:"ju367v8q"},relative:{defaultClass:"ju367v8r"}}},WebkitUserSelect:{values:{none:{defaultClass:"ju367v8s"}}},right:{values:{0:{defaultClass:"ju367v8t"}}},transition:{values:{default:{defaultClass:"ju367v8u"},transform:{defaultClass:"ju367v8v"}}},userSelect:{values:{none:{defaultClass:"ju367v8w"}}},width:{values:{1:{defaultClass:"ju367v8x"},2:{defaultClass:"ju367v8y"},4:{defaultClass:"ju367v8z"},8:{defaultClass:"ju367v90"},12:{defaultClass:"ju367v91"},20:{defaultClass:"ju367v92"},24:{defaultClass:"ju367v93"},28:{defaultClass:"ju367v94"},30:{defaultClass:"ju367v95"},32:{defaultClass:"ju367v96"},34:{defaultClass:"ju367v97"},36:{defaultClass:"ju367v98"},40:{defaultClass:"ju367v99"},44:{defaultClass:"ju367v9a"},48:{defaultClass:"ju367v9b"},54:{defaultClass:"ju367v9c"},60:{defaultClass:"ju367v9d"},200:{defaultClass:"ju367v9e"},full:{defaultClass:"ju367v9f"},max:{defaultClass:"ju367v9g"}}},backdropFilter:{values:{modalOverlay:{defaultClass:"ju367v9h"}}}}}),U_={colors:{accentColor:"var(--rk-colors-accentColor)",accentColorForeground:"var(--rk-colors-accentColorForeground)",actionButtonBorder:"var(--rk-colors-actionButtonBorder)",actionButtonBorderMobile:"var(--rk-colors-actionButtonBorderMobile)",actionButtonSecondaryBackground:"var(--rk-colors-actionButtonSecondaryBackground)",closeButton:"var(--rk-colors-closeButton)",closeButtonBackground:"var(--rk-colors-closeButtonBackground)",connectButtonBackground:"var(--rk-colors-connectButtonBackground)",connectButtonBackgroundError:"var(--rk-colors-connectButtonBackgroundError)",connectButtonInnerBackground:"var(--rk-colors-connectButtonInnerBackground)",connectButtonText:"var(--rk-colors-connectButtonText)",connectButtonTextError:"var(--rk-colors-connectButtonTextError)",connectionIndicator:"var(--rk-colors-connectionIndicator)",downloadBottomCardBackground:"var(--rk-colors-downloadBottomCardBackground)",downloadTopCardBackground:"var(--rk-colors-downloadTopCardBackground)",error:"var(--rk-colors-error)",generalBorder:"var(--rk-colors-generalBorder)",generalBorderDim:"var(--rk-colors-generalBorderDim)",menuItemBackground:"var(--rk-colors-menuItemBackground)",modalBackdrop:"var(--rk-colors-modalBackdrop)",modalBackground:"var(--rk-colors-modalBackground)",modalBorder:"var(--rk-colors-modalBorder)",modalText:"var(--rk-colors-modalText)",modalTextDim:"var(--rk-colors-modalTextDim)",modalTextSecondary:"var(--rk-colors-modalTextSecondary)",profileAction:"var(--rk-colors-profileAction)",profileActionHover:"var(--rk-colors-profileActionHover)",profileForeground:"var(--rk-colors-profileForeground)",selectedOptionBorder:"var(--rk-colors-selectedOptionBorder)",standby:"var(--rk-colors-standby)"},fonts:{body:"var(--rk-fonts-body)"},radii:{actionButton:"var(--rk-radii-actionButton)",connectButton:"var(--rk-radii-connectButton)",menuButton:"var(--rk-radii-menuButton)",modal:"var(--rk-radii-modal)",modalMobile:"var(--rk-radii-modalMobile)"},shadows:{connectButton:"var(--rk-shadows-connectButton)",dialog:"var(--rk-shadows-dialog)",profileDetailsAction:"var(--rk-shadows-profileDetailsAction)",selectedOption:"var(--rk-shadows-selectedOption)",selectedWallet:"var(--rk-shadows-selectedWallet)",walletLogo:"var(--rk-shadows-walletLogo)"},blurs:{modalOverlay:"var(--rk-blurs-modalOverlay)"}},dD={shrink:"_12cbo8i6",shrinkSm:"_12cbo8i7"},fD="_12cbo8i3 ju367v8r",hD={grow:"_12cbo8i4",growLg:"_12cbo8i5"};function Wt({active:e,hover:t}){return[fD,t&&hD[t],dD[e]]}var T4=I.createContext(null);function pD(){const{adapter:e}=I.useContext(T4)??{};if(!e)throw new Error("No authentication adapter found");return e}function zp(){const e=I.useContext(T4);return(e==null?void 0:e.status)??null}function Rv(){const e=zp(),{isConnected:t}=dt();return t?e&&(e==="loading"||e==="unauthenticated")?e:"connected":"disconnected"}function P4(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function mD(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function gD(){return typeof navigator<"u"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function Id(){return mD()||gD()}function Gt(){return P4()||Id()}var yD="iekbcc0",vD={a:"iekbcca",blockquote:"iekbcc2",button:"iekbcc9",input:"iekbcc8 iekbcc5 iekbcc4",mark:"iekbcc6",ol:"iekbcc1",q:"iekbcc2",select:"iekbcc7 iekbcc5 iekbcc4",table:"iekbcc3",textarea:"iekbcc5 iekbcc4",ul:"iekbcc1"},bD=({reset:e,...t})=>{if(!e)return hy(t);const n=vD[e],r=hy(t);return qk(yD,n,r)},U=S.forwardRef(({as:e="div",className:t,testId:n,...r},a)=>{const c={},l={};for(const d in r)hy.properties.has(d)?c[d]=r[d]:l[d]=r[d];const u=bD({reset:typeof e=="string"?e:"div",...c});return S.createElement(e,{className:qk(u,t),...l,"data-testid":n?`rk-${n.replace(/^rk-/,"")}`:void 0,ref:a})});U.displayName="Box";var R4=new Map,E1=new Map;async function L4(e){const t=E1.get(e);if(t)return t;const n=async()=>e().then(async a=>(R4.set(e,a),a)),r=n().catch(a=>n().catch(c=>{E1.delete(e)}));return E1.set(e,r),r}async function Ms(...e){return await Promise.all(e.map(t=>typeof t=="function"?L4(t):t))}function wD(){const[,e]=I.useReducer(t=>t+1,0);return e}function $p(e){const t=typeof e=="function"?R4.get(e):void 0,n=wD();return I.useEffect(()=>{typeof e=="function"&&!t&&L4(e).then(n)},[e,t,n]),typeof e=="function"?t:e}function un({alt:e,background:t,borderColor:n,borderRadius:r,useAsImage:a,boxShadow:c,height:l,src:u,width:d,testId:p}){const h=Id(),m=$p(u),g=m&&/^http/.test(m),[v,b]=I.useReducer(()=>!0,!1);return S.createElement(U,{"aria-label":e,borderRadius:r,boxShadow:c,height:typeof l=="string"?l:void 0,overflow:"hidden",position:"relative",role:"img",style:{background:t,height:typeof l=="number"?l:void 0,width:typeof d=="number"?d:void 0},width:typeof d=="string"?d:void 0,testId:p},S.createElement(U,{...g?{"aria-hidden":!0,as:"img",onLoad:b,src:m}:{"aria-hidden":!0,as:"img",src:m},height:"full",position:"absolute",...h?{WebkitUserSelect:"none"}:{},style:{WebkitTouchCallout:"none",transition:"opacity .15s linear",userSelect:"none",...!a&&g?{opacity:v?1:0}:{}},width:"full"}),n?S.createElement(U,{...typeof n=="object"&&"custom"in n?{style:{borderColor:n.custom}}:{borderColor:n},borderRadius:r,borderStyle:"solid",borderWidth:"1",height:"full",position:"relative",width:"full"}):null)}var _D="_1luule42",xD="_1luule43",CD=e=>I.useMemo(()=>`${e}_${Math.round(Math.random()*1e9)}`,[e]),id=({height:e=21,width:t=21})=>{const n=CD("spinner");return S.createElement("svg",{className:_D,fill:"none",height:e,viewBox:"0 0 21 21",width:t,xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Loading"),S.createElement("clipPath",{id:n},S.createElement("path",{d:"M10.5 3C6.35786 3 3 6.35786 3 10.5C3 14.6421 6.35786 18 10.5 18C11.3284 18 12 18.6716 12 19.5C12 20.3284 11.3284 21 10.5 21C4.70101 21 0 16.299 0 10.5C0 4.70101 4.70101 0 10.5 0C16.299 0 21 4.70101 21 10.5C21 11.3284 20.3284 12 19.5 12C18.6716 12 18 11.3284 18 10.5C18 6.35786 14.6421 3 10.5 3Z"})),S.createElement("foreignObject",{clipPath:`url(#${n})`,height:"21",width:"21",x:"0",y:"0"},S.createElement("div",{className:xD})))},ot=["#FC5C54","#FFD95A","#E95D72","#6A87C8","#5FD0F3","#75C06B","#FFDD86","#5FC6D4","#FF949A","#FF8024","#9BA1A4","#EC66FF","#FF8CBC","#FF9A23","#C5DADB","#A8CE63","#71ABFF","#FFE279","#B6B1B6","#FF6780","#A575FF","#4D82FF","#FFB35A"],W_=[{color:ot[0],emoji:"🌶"},{color:ot[1],emoji:"🤑"},{color:ot[2],emoji:"🐙"},{color:ot[3],emoji:"🫐"},{color:ot[4],emoji:"🐳"},{color:ot[0],emoji:"🤶"},{color:ot[5],emoji:"🌲"},{color:ot[6],emoji:"🌞"},{color:ot[7],emoji:"🐒"},{color:ot[8],emoji:"🐵"},{color:ot[9],emoji:"🦊"},{color:ot[10],emoji:"🐼"},{color:ot[11],emoji:"🦄"},{color:ot[12],emoji:"🐷"},{color:ot[13],emoji:"🐧"},{color:ot[8],emoji:"🦩"},{color:ot[14],emoji:"👽"},{color:ot[0],emoji:"🎈"},{color:ot[8],emoji:"🍉"},{color:ot[1],emoji:"🎉"},{color:ot[15],emoji:"🐲"},{color:ot[16],emoji:"🌎"},{color:ot[17],emoji:"🍊"},{color:ot[18],emoji:"🐭"},{color:ot[19],emoji:"🍣"},{color:ot[1],emoji:"🐥"},{color:ot[20],emoji:"👾"},{color:ot[15],emoji:"🥦"},{color:ot[0],emoji:"👹"},{color:ot[17],emoji:"🙀"},{color:ot[4],emoji:"⛱"},{color:ot[21],emoji:"⛵️"},{color:ot[17],emoji:"🥳"},{color:ot[8],emoji:"🤯"},{color:ot[22],emoji:"🤠"}];function kD(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function jD(e){const n=Math.abs(kD((typeof e=="string"?e:"").toLowerCase())%W_.length);return W_[n??0]}var SD=({address:e,ensImage:t,size:n})=>{const[r,a]=I.useState(!1);I.useEffect(()=>{if(t){const u=new Image;u.src=t,u.onload=()=>a(!0)}},[t]);const{color:c,emoji:l}=I.useMemo(()=>jD(e),[e]);return t?r?S.createElement(U,{backgroundSize:"cover",borderRadius:"full",position:"absolute",style:{backgroundImage:`url(${t})`,backgroundPosition:"center",height:n,width:n}}):S.createElement(U,{alignItems:"center",backgroundSize:"cover",borderRadius:"full",color:"modalText",display:"flex",justifyContent:"center",position:"absolute",style:{height:n,width:n}},S.createElement(id,null)):S.createElement(U,{alignItems:"center",display:"flex",justifyContent:"center",overflow:"hidden",style:{...!t&&{backgroundColor:c},height:n,width:n}},l)},D4=SD,O4=I.createContext(D4);function F4({address:e,imageUrl:t,loading:n,size:r}){const a=I.useContext(O4);return S.createElement(U,{"aria-hidden":!0,borderRadius:"full",overflow:"hidden",position:"relative",style:{height:`${r}px`,width:`${r}px`},userSelect:"none"},S.createElement(U,{alignItems:"center",borderRadius:"full",display:"flex",justifyContent:"center",overflow:"hidden",position:"absolute",style:{fontSize:`${Math.round(r*.55)}px`,height:`${r}px`,transform:n?"scale(0.72)":void 0,transition:".25s ease",transitionDelay:n?void 0:".1s",width:`${r}px`,willChange:"transform"},userSelect:"none"},S.createElement(a,{address:e,ensImage:t,size:r})),n&&S.createElement(U,{color:"accentColor",display:"flex",height:"full",position:"absolute",width:"full"},S.createElement(id,{height:"100%",width:"100%"})))}var V_=()=>S.createElement("svg",{fill:"none",height:"7",width:"14",xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Dropdown"),S.createElement("path",{d:"M12.75 1.54001L8.51647 5.0038C7.77974 5.60658 6.72026 5.60658 5.98352 5.0038L1.75 1.54001",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",xmlns:"http://www.w3.org/2000/svg"})),G_={defaultLocale:"en",locale:"en"},AD=class{constructor(e){this.listeners=new Set,this.defaultLocale=G_.defaultLocale,this.enableFallback=!1,this.locale=G_.locale,this.cachedLocales=[],this.translations={};for(const[t,n]of Object.entries(e))this.cachedLocales=[...this.cachedLocales,t],this.translations={...this.translations,...this.flattenTranslation(n,t)}}missingMessage(e){return`[missing: "${this.locale}.${e}" translation]`}flattenTranslation(e,t){const n={},r=(a,c)=>{for(const l of Object.keys(a)){const u=`${c}.${l}`,d=a[l];typeof d=="object"&&d!==null?r(d,u):n[u]=d}};return r(e,t),n}translateWithReplacements(e,t={}){let n=e;for(const r in t){const a=t[r];n=n.replace(`%{${r}}`,a)}return n}t(e,t,n){const r=`${this.locale}.${e}`,a=this.translations[r];if(!a){if(this.enableFallback){const c=`${this.defaultLocale}.${e}`,l=this.translations[c];if(l)return this.translateWithReplacements(l,t)}return n!=null&&n.rawKeyIfTranslationMissing?e:this.missingMessage(e)}return this.translateWithReplacements(a,t)}isLocaleCached(e){return this.cachedLocales.includes(e)}updateLocale(e){this.locale=e,this.notifyListeners()}setTranslations(e,t){this.isLocaleCached(e)||(this.cachedLocales=[...this.cachedLocales,e],this.translations={...this.translations,...this.flattenTranslation(t,e)}),this.locale=e,this.notifyListeners()}notifyListeners(){for(const e of this.listeners)e()}onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},Br=new AD({en:JSON.parse(rg),"en-US":JSON.parse(rg)});Br.defaultLocale="en-US";Br.locale="en-US";Br.enableFallback=!0;var ED=async e=>{switch(e){case"ar":case"ar-AR":return(await je(async()=>{const{default:t}=await import("./ar_AR-LIPSOZP5-BQrIDibT.js");return{default:t}},[])).default;case"de":case"de-DE":return(await je(async()=>{const{default:t}=await import("./de_DE-YE3KOFHU-BRt5ztUe.js");return{default:t}},[])).default;case"en":case"en-US":return(await je(async()=>{const{default:t}=await Promise.resolve().then(()=>mx);return{default:t}},void 0)).default;case"es":case"es-419":return(await je(async()=>{const{default:t}=await import("./es_419-7LMPU7G4-DH7rM0yQ.js");return{default:t}},[])).default;case"fr":case"fr-FR":return(await je(async()=>{const{default:t}=await import("./fr_FR-VBJP3ZLL-B-_ocunw.js");return{default:t}},[])).default;case"hi":case"hi-IN":return(await je(async()=>{const{default:t}=await import("./hi_IN-WBVD5XYI-D73g2UFs.js");return{default:t}},[])).default;case"id":case"id-ID":return(await je(async()=>{const{default:t}=await import("./id_ID-SBYANJ7G-Cjpa4ay6.js");return{default:t}},[])).default;case"ja":case"ja-JP":return(await je(async()=>{const{default:t}=await import("./ja_JP-ZRMWJV3I-DXbifiMm.js");return{default:t}},[])).default;case"ko":case"ko-KR":return(await je(async()=>{const{default:t}=await import("./ko_KR-FR54RFUG-upinSHjQ.js");return{default:t}},[])).default;case"ms":case"ms-MY":return(await je(async()=>{const{default:t}=await import("./ms_MY-EZSGYYYQ-4cPLK-3L.js");return{default:t}},[])).default;case"pt":case"pt-BR":return(await je(async()=>{const{default:t}=await import("./pt_BR-JQFQ3P4L-DOHfdcA2.js");return{default:t}},[])).default;case"ru":case"ru-RU":return(await je(async()=>{const{default:t}=await import("./ru_RU-Z42UEJBP-Cvb2oWxQ.js");return{default:t}},[])).default;case"th":case"th-TH":return(await je(async()=>{const{default:t}=await import("./th_TH-4YB4VSB2-BUipNP-V.js");return{default:t}},[])).default;case"tr":case"tr-TR":return(await je(async()=>{const{default:t}=await import("./tr_TR-5FKHPPIO-D5jTpIm9.js");return{default:t}},[])).default;case"ua":case"uk-UA":return(await je(async()=>{const{default:t}=await import("./uk_UA-ZD4IBC52-DgnQrpzl.js");return{default:t}},[])).default;case"vi":case"vi-VN":return(await je(async()=>{const{default:t}=await import("./vi_VN-5EVRZKLY-x078672g.js");return{default:t}},[])).default;case"zh":case"zh-CN":case"zh-Hans":return(await je(async()=>{const{default:t}=await import("./zh_CN-4XK5YJPR-Bt6Yz5Ek.js");return{default:t}},[])).default;case"zh-HK":return(await je(async()=>{const{default:t}=await import("./zh_HK-N4YN2WSI-Cvzl1V16.js");return{default:t}},[])).default;case"zh-Hant":case"zh-TW":return(await je(async()=>{const{default:t}=await import("./zh_TW-CNCRXH6Z-BNelatfN.js");return{default:t}},[])).default;default:return(await je(async()=>{const{default:t}=await Promise.resolve().then(()=>mx);return{default:t}},void 0)).default}};async function q_(e){if(Br.isLocaleCached(e)){Br.updateLocale(e);return}const n=await ED(e);Br.setTranslations(e,JSON.parse(n))}var ND=()=>{var e;if(typeof window<"u"&&typeof navigator<"u"){if((e=navigator.languages)!=null&&e.length)return navigator.languages[0];if(navigator.language)return navigator.language}},qt=I.createContext({i18n:Br}),MD=({children:e,locale:t})=>{const[n,r]=I.useState(0),a=I.useMemo(()=>ND(),[]);I.useEffect(()=>Br.onChange(()=>{r(u=>u+1)}),[]),I.useEffect(()=>{t&&t!==Br.locale?q_(t):!t&&a&&a!==Br.locale&&q_(a)},[t,a]);const c=I.useMemo(()=>({t:(u,d)=>Br.t(u,d),i18n:Br}),[n]);return S.createElement(qt.Provider,{value:c},e)};function z4(e){return e!=null}var K_={iconBackground:"#7290CC",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./apechain-SX5YFU6N-q5qBv-mp.js");return{default:e}},[])).default},N1={iconBackground:"#96bedc",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./arbitrum-WURIBY6W-CqVkHBr5.js");return{default:e}},[])).default},Q_={iconBackground:"#e84141",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./avalanche-KOMJD3XY-Dsn_JPR4.js");return{default:e}},[])).default},M1={iconBackground:"#0052ff",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./base-OAXLRA4F-CoYTVIiL.js");return{default:e}},[])).default},I1={iconBackground:"#814625",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./berachain-NJECWIVC-DumxnFvf.js");return{default:e}},[])).default},Y_={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./blast-V555OVXZ-BbhJh1tj.js");return{default:e}},[])).default},J_={iconBackground:"#ebac0e",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./bsc-N647EYR2-B2nLKXWV.js");return{default:e}},[])).default},X_={iconBackground:"#FCFF52",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./celo-GEP4TUHG-CenIBYLU.js");return{default:e}},[])).default},Z_={iconBackground:"#002D74",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./cronos-HJPAQTAE-BEOvlOC4.js");return{default:e}},[])).default},ID={iconBackground:"#A36EFD",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./degen-FQQ4XGHB-CeHTs88l.js");return{default:e}},[])).default},eo={iconBackground:"#484c50",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./ethereum-RGGVA4PY-SWGOlkuk.js");return{default:e}},[])).default},e6={iconBackground:"transparent",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./flow-5FQJFCTK-CUie2reO.js");return{default:e}},[])).default},BD={iconBackground:"#04795c",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./gnosis-37ZC4RBL-B137OtHZ.js");return{default:e}},[])).default},t6={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./gravity-J5YQHTYH-Bj6B0uod.js");return{default:e}},[])).default},TD={iconBackground:"#f9f7ec",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./hardhat-TX56IT5N-CV1FY-wE.js");return{default:e}},[])).default},PD={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./hyperevm-VKPAA4SA-CHwraEsx.js");return{default:e}},[])).default},n6={iconBackground:"#7132F5",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./ink-FZMYZWHG-62p-5IK5.js");return{default:e}},[])).default},r6={iconBackground:"transparent",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./kaia-65D2U3PU-JmuLQ4gC.js");return{default:e}},[])).default},B1={iconBackground:"#ffffff",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./linea-QRMVQ5DY-DuI3vv0d.js");return{default:e}},[])).default},T1={iconBackground:"#ffffff",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./manta-SI27YFEJ-CpVOKa06.js");return{default:e}},[])).default},s6={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./mantle-CKIUT334-DR2WgqzU.js");return{default:e}},[])).default},RD={iconBackground:"transparent",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./monad-4KWC6TSS-DVXSkpiz.js");return{default:e}},[])).default},mh={iconBackground:"#ff5a57",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./optimism-HAF2GUT7-ec6Nqxs9.js");return{default:e}},[])).default},P1={iconBackground:"#9f71ec",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./polygon-WW6ZI7PM-DXlmm4L1.js");return{default:e}},[])).default},LD={iconBackground:"#1273EA",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./ronin-EMCPYXZT-N-QBHZdV.js");return{default:e}},[])).default},DD={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./sanko-RHQYXGM5-OX010CbN.js");return{default:e}},[])).default},OD={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./superposition-HG6MMR2Y-bRkgatRO.js");return{default:e}},[])).default},a6={iconBackground:"#FFEEDA",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./scroll-5OBGQVOV-DJFECiai.js");return{default:e}},[])).default},o6={iconBackground:"#F50DB4",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./unichain-C5BWO2ZY-BfguYsnu.js");return{default:e}},[])).default},i6={iconBackground:"#f9f7ec",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./xdc-KJ3TDBYO-DNV6zchh.js");return{default:e}},[])).default},c6={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./zetachain-TLDS5IPW-Udhyw16T.js");return{default:e}},[])).default},l6={iconBackground:"#f9f7ec",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./zksync-DH7HK5U4-Dt4usFw6.js");return{default:e}},[])).default},R1={iconBackground:"#000000",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./zora-FYL5H3IO-iB4wygST.js");return{default:e}},[])).default},FD={apechain:{chainId:33139,name:"ApeChain",...K_},apechainCurtis:{chainId:33111,name:"ApeChain Curtis",...K_},arbitrum:{chainId:42161,name:"Arbitrum",...N1},arbitrumGoerli:{chainId:421613,...N1},arbitrumSepolia:{chainId:421614,...N1},avalanche:{chainId:43114,...Q_},avalancheFuji:{chainId:43113,...Q_},base:{chainId:8453,name:"Base",...M1},baseGoerli:{chainId:84531,...M1},baseSepolia:{chainId:84532,...M1},berachain:{chainId:80094,name:"Berachain",...I1},berachainArtio:{chainId:80085,name:"Berachain Artio",...I1},berachainBArtio:{chainId:80084,name:"Berachain bArtio",...I1},blast:{chainId:81457,name:"Blast",...Y_},blastSepolia:{chainId:168587773,...Y_},bsc:{chainId:56,name:"BSC",...J_},bscTestnet:{chainId:97,...J_},celo:{chainId:42220,name:"Celo",...X_},celoAlfajores:{chainId:44787,name:"Celo Alfajores",...X_},cronos:{chainId:25,...Z_},cronosTestnet:{chainId:338,...Z_},degen:{chainId:666666666,name:"Degen",...ID},flow:{chainId:747,...e6},flowTestnet:{chainId:545,...e6},gnosis:{chainId:100,name:"Gnosis",...BD},goerli:{chainId:5,...eo},gravity:{chainId:1625,name:"Gravity",...t6},gravitySepolia:{chainId:13505,name:"Gravity Sepolia",...t6},hardhat:{chainId:31337,...TD},holesky:{chainId:17e3,...eo},hyperevm:{chainId:999,...PD},ink:{chainId:57073,...n6},inkSepolia:{chainId:763373,...n6},kaia:{chainId:8217,name:"Kaia",...r6},kairos:{chainId:1001,name:"Kairos",...r6},kovan:{chainId:42,...eo},linea:{chainId:59144,name:"Linea",...B1},lineaGoerli:{chainId:59140,name:"Linea Goerli",...B1},lineaSepolia:{chainId:59141,name:"Linea Sepolia",...B1},localhost:{chainId:1337,...eo},mainnet:{chainId:1,name:"Ethereum",...eo},manta:{chainId:169,name:"Manta",...T1},mantaSepolia:{chainId:3441006,...T1},mantaTestnet:{chainId:3441005,...T1},mantle:{chainId:5e3,...s6},mantleTestnet:{chainId:5001,...s6},monadTestnet:{chainId:10143,name:"Monad Testnet",...RD},optimism:{chainId:10,name:"Optimism",...mh},optimismGoerli:{chainId:420,...mh},optimismKovan:{chainId:69,...mh},optimismSepolia:{chainId:11155420,...mh},polygon:{chainId:137,name:"Polygon",...P1},polygonAmoy:{chainId:80002,...P1},polygonMumbai:{chainId:80001,...P1},rinkeby:{chainId:4,...eo},ronin:{chainId:2020,...LD},ropsten:{chainId:3,...eo},sanko:{chainId:1996,name:"Sanko",...DD},scroll:{chainId:534352,...a6},scrollSepolia:{chainId:534351,...a6},sepolia:{chainId:11155111,...eo},superposition:{chainId:55244,name:"Superposition",...OD},unichain:{chainId:130,...o6},unichainSepolia:{chainId:1301,...o6},xdc:{chainId:50,name:"XDC",...i6},xdcTestnet:{chainId:51,...i6},zetachain:{chainId:7e3,name:"ZetaChain",...c6},zetachainAthensTestnet:{chainId:7001,name:"Zeta Athens",...c6},zkSync:{chainId:324,name:"zkSync",...l6},zkSyncTestnet:{chainId:280,...l6},zora:{chainId:7777777,name:"Zora",...R1},zoraSepolia:{chainId:999999999,...R1},zoraTestnet:{chainId:999,...R1}},zD=Object.fromEntries(Object.values(FD).filter(z4).map(({chainId:e,...t})=>[e,t])),$D=e=>e.map(t=>{const n=zD[t.id]??{};return{...t,name:n.name??t.name,iconUrl:t.iconUrl??n.iconUrl,iconBackground:t.iconBackground??n.iconBackground}}),Lv=I.createContext({chains:[]});function HD({children:e,initialChain:t}){const{chains:n}=Lt();return S.createElement(Lv.Provider,{value:I.useMemo(()=>({chains:$D(n),initialChainId:typeof t=="number"?t:t==null?void 0:t.id}),[n,t])},e)}var Di=()=>I.useContext(Lv).chains,UD=()=>I.useContext(Lv).initialChainId,WD=()=>{const e=Di();return I.useMemo(()=>{const t={};for(const n of e)t[n.id]=n;return t},[e])},$4=I.createContext({showBalance:void 0,setShowBalance:()=>{}});function VD({children:e}){const[t,n]=I.useState();return S.createElement($4.Provider,{value:{showBalance:t,setShowBalance:n}},e)}var H4=()=>I.useContext($4);function GD(){const[e,t]=I.useState(!1);return I.useEffect(()=>(t(!0),()=>{t(!1)}),[]),I.useCallback(()=>e,[e])}function U4(){const e=Di(),t=Lp.id;return e.some(r=>r.id===t)}function qD(e){const t=U4(),n=a=>{try{return RR(a)}catch{}},{data:r}=QP({chainId:Lp.id,name:e?n(e):void 0,query:{enabled:t}});return r}async function Qo(e,t){const n={headers:{},method:"get",...t,timeout:t.timeout??1e4};if(!e)throw new Error("rainbowFetch: Missing url argument");const r=new AbortController,a=setTimeout(()=>r.abort(),n.timeout),{body:c,params:l,headers:u,...d}=n,p=c&&typeof c=="object"?JSON.stringify(c):c,h=await fetch(`${e}${QD(l)}`,{...d,body:p,headers:{Accept:"application/json","Content-Type":"application/json",...u},signal:r.signal});clearTimeout(a);const m=await KD(h);if(h.ok){const{headers:b,status:_}=h;return{data:m,headers:b,status:_}}throw YD({requestBody:c,response:h,responseBody:typeof m=="string"?{error:m}:m})}function KD(e){const t=e.headers.get("Content-Type");return t!=null&&t.startsWith("application/json")?e.json():e.text()}function QD(e){return e&&Object.keys(e).length?`?${new URLSearchParams(e)}`:""}function YD({requestBody:e,response:t,responseBody:n}){const r=(n==null?void 0:n.error)||(t==null?void 0:t.statusText)||"There was an error with the request.",a=new Error(r);return a.response=t,a.responseBody=n,a.requestBody=e,a}var JD=class{constructor(e={}){const{baseUrl:t="",...n}=e;this.baseUrl=t,this.opts=n}get(e,t){return Qo(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"get"})}delete(e,t){return Qo(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"delete"})}head(e,t){return Qo(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"head"})}options(e,t){return Qo(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"options"})}post(e,t,n){return Qo(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"post"})}put(e,t,n){return Qo(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"put"})}patch(e,t,n){return Qo(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"patch"})}};function XD({baseUrl:e,headers:t,params:n,timeout:r}){return new JD({baseUrl:e,headers:t,params:n,timeout:r})}var ZD=!!(typeof process<"u"&&typeof Xh<"u"&&Xh.RAINBOW_PROVIDER_API_KEY),eO=XD({baseUrl:"https://enhanced-provider.rainbow.me",headers:{"x-api-key":typeof process<"u"&&typeof Xh<"u"&&Xh.RAINBOW_PROVIDER_API_KEY||"LzbasoBiLqltex3VkcQ7LRmL4PtfiiZ1EMJrizrgfonWN6byJReu/l6yrUoo3zLW"}});function tO(e,t,n={}){return[e,t,n]}function Th(e){return`rk-ens-name-${e}`}function nO(e){try{const t=e?JSON.parse(e):null;return typeof t=="object"?t:null}catch{return null}}function rO(e,t){if(!Ft(e)||typeof window>"u")return;const n=new Date,r=new Date(n.getTime()+180*6e4);window.localStorage.setItem(Th(e),JSON.stringify({ensName:t,expires:r.getTime()}))}function sO(e){if(typeof window>"u")return null;const t=nO(window.localStorage.getItem(Th(e)));if(!t)return null;const{ensName:n,expires:r}=t;return typeof n!="string"||Number.isNaN(Number(r))||new Date().getTime()>Number(r)?(window.localStorage.removeItem(Th(e)),null):n}async function aO({address:e}){const t=sO(e);if(t)return t;const r=(await eO.get("/v1/resolve-ens",{params:{address:e}})).data.data;return r&&rO(e,r),r}function oO(e){const t=U4(),{data:n}=YP({chainId:Lp.id,address:e,query:{enabled:t}}),{data:r}=Uk({queryKey:tO("address",e),queryFn:()=>aO({address:e}),enabled:!t&&!!e&&ZD,staleTime:10*(60*1e3),retry:1});return n||r}function W4({address:e,includeBalance:t}){const n=oO(e),r=qD(n),{data:a}=Wk({address:t?e:void 0});return{ensName:n,ensAvatar:r,balance:a}}function Dv(){const{chain:e}=dt();return(e==null?void 0:e.id)??null}var iO="rk-transactions";function cO(e){const t=`${e.uid}.${iO}`;return{...e,uid:t}}var V4="rk-transactions";function lO(e){try{const t=e?JSON.parse(e):{};return typeof t=="object"?t:{}}catch{return{}}}function u6(){return lO(typeof window<"u"?window.localStorage.getItem(V4):null)}var uO=/^0x([A-Fa-f0-9]{64})$/;function dO(e){const t=[];return uO.test(e.hash)||t.push("Invalid transaction hash"),typeof e.description!="string"&&t.push("Transaction must have a description"),typeof e.confirmations<"u"&&(!Number.isInteger(e.confirmations)||e.confirmations<1)&&t.push("Transaction confirmations must be a positiver integer"),t}function fO({provider:e}){let t=u6(),n;const r=new Set,a=new Set,c=new Map;function l(A){n=cO(A)}l(e);function u(A,k){var N;return((N=t[A])==null?void 0:N[k])??[]}function d(A,k,N){const E=dO(N);if(E.length>0)throw new Error(["Unable to add transaction",...E].join(`
1760
1760
  `));g(A,k,B=>[{...N,status:"pending"},...B.filter(({hash:M})=>M!==N.hash)])}function p(A,k){g(A,k,()=>[])}function h(A,k,N,E){g(A,k,B=>B.map(M=>M.hash===N?{...M,status:E}:M))}async function m(A,k){await Promise.all(u(A,k).filter(N=>N.status==="pending").map(async N=>{const{confirmations:E,hash:B}=N,M=c.get(B);if(M)return await M;const P=mv(n,{confirmations:E,hash:B,timeout:3e5}).then(({status:R})=>{c.delete(B),R!==void 0&&(h(A,k,B,R===0||R==="reverted"?"failed":"confirmed"),_(R))}).catch(()=>{c.delete(B),h(A,k,B,"failed")});return c.set(B,P),await P}))}function g(A,k,N){t=u6(),t[A]=t[A]??{};let E=0;const B=10,M=N(t[A][k]??[]).filter(({status:P})=>P==="pending"?!0:E++<=B);t[A][k]=M.length>0?M:void 0,v(),b(),m(A,k)}function v(){typeof window<"u"&&window.localStorage.setItem(V4,JSON.stringify(t))}function b(){for(const A of r)A()}function _(A){for(const k of a)k(A)}function x(A){return r.add(A),()=>{r.delete(A)}}function j(A){return a.add(A),()=>{a.delete(A)}}return{addTransaction:d,clearTransactions:p,getTransactions:u,onTransactionStatus:j,onChange:x,setProvider:l,waitForPendingTransactions:m}}var L1,G4=S.createContext(null);function hO({children:e}){const t=Md(),{address:n}=dt(),r=Dv(),{refetch:a}=Wk({address:n,query:{enabled:!1}}),[c]=S.useState(()=>(L1||(L1=fO({provider:t})),L1)),l=S.useCallback(u=>{u==="success"&&a()},[a]);return S.useEffect(()=>{c.setProvider(t)},[c,t]),S.useEffect(()=>{n&&r&&c.waitForPendingTransactions(n,r)},[c,n,r]),S.useEffect(()=>{if(c&&n&&r)return c.onTransactionStatus(l)},[c,n,r,l]),S.createElement(G4.Provider,{value:c},e)}function q4(){const e=S.useContext(G4);if(!e)throw new Error("Transaction hooks must be used within RainbowKitProvider");return e}function K4(){const e=q4(),{address:t}=dt(),n=Dv(),[r,a]=I.useState(()=>e&&t&&n?e.getTransactions(t,n):[]);return I.useEffect(()=>{if(e&&t&&n)return a(e.getTransactions(t,n)),e.onChange(()=>{a(e.getTransactions(t,n))})},[e,t,n]),r}var d6=e=>typeof e=="function"?e():e;function pO(e,{extends:t}={}){const n={...w_(U_,d6(e))};if(!t)return n;const r=w_(U_,d6(t));return Object.fromEntries(Object.entries(n).filter(([c,l])=>l!==r[c]))}function f6(e,t={}){return Object.entries(pO(e,t)).map(([n,r])=>`${n}:${r.replace(/[:;{}</>]/g,"")};`).join("")}var Q4={appName:void 0,disclaimer:void 0,learnMoreUrl:"https://learn.rainbow.me/understanding-web3?utm_source=rainbowkit&utm_campaign=learnmore"},Bd=I.createContext(Q4),Y4=I.createContext(!1);function mO(e,t){let n=null;const r=()=>{n&&clearTimeout(n),n=setTimeout(()=>{n=null,e()},t)};return r.cancel=()=>{n&&(clearTimeout(n),n=null)},r}var J4=()=>{const[e,t]=I.useState({height:void 0,width:void 0});return I.useEffect(()=>{const n=mO(()=>{t({height:window.innerHeight,width:window.innerWidth})},500);return window.addEventListener("resize",n),n(),()=>{n.cancel(),window.removeEventListener("resize",n)}},[]),e},Td=I.createContext({connector:null,setConnector:()=>{}});function gO({children:e}){const[t,n]=I.useState(null);return S.createElement(Td.Provider,{value:I.useMemo(()=>({connector:t,setConnector:n}),[t])},e)}var Pd={COMPACT:"compact",WIDE:"wide"},Hp=I.createContext(Pd.WIDE);function yO({children:e,modalSize:t}){const{width:n}=J4(),r=n&&n<uD,{connector:a}=I.useContext(Td);return S.createElement(Hp.Provider,{value:r||a?Pd.COMPACT:t},e)}var Ov=I.createContext(!1),vO="rk-version";function bO({version:e}){typeof window<"u"&&window.localStorage.setItem(vO,e)}function wO(){const e=I.useCallback(()=>{bO({version:"2.2.11"})},[]);I.useEffect(()=>{e()},[e])}function _O(e,t){const n={};for(const r of e){const a=t(r);a&&(n[a]=r)}return n}function Fv(){return typeof navigator<"u"&&typeof navigator.userAgent<"u"&&/Version\/([0-9._]+).*Safari/.test(navigator.userAgent)}function xO(){return typeof document<"u"&&getComputedStyle(document.body).getPropertyValue("--arc-palette-focus")!==""}function zv(){var t,n;if(typeof navigator>"u")return"Browser";const e=(t=navigator.userAgent)==null?void 0:t.toLowerCase();return(n=navigator.brave)!=null&&n.isBrave?"Brave":(e==null?void 0:e.indexOf("edg/"))>-1?"Edge":(e==null?void 0:e.indexOf("op"))>-1?"Opera":xO()?"Arc":(e==null?void 0:e.indexOf("chrome"))>-1?"Chrome":(e==null?void 0:e.indexOf("firefox"))>-1?"Firefox":Fv()?"Safari":"Browser"}var CO=ma(),{os:$v}=CO;function kO(){return $v.name==="Windows"}function jO(){return $v.name==="macOS"}function SO(){return["Ubuntu","Mint","Fedora","Debian","Arch","Linux"].includes($v.name)}function Hv(){return kO()?"Windows":jO()?"macOS":SO()?"Linux":"Desktop"}var AO=e=>{var n,r,a,c,l,u,d,p,h,m,g;const t=zv();return{Arc:(n=e==null?void 0:e.downloadUrls)==null?void 0:n.chrome,Brave:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.chrome,Chrome:(a=e==null?void 0:e.downloadUrls)==null?void 0:a.chrome,Edge:((c=e==null?void 0:e.downloadUrls)==null?void 0:c.edge)||((l=e==null?void 0:e.downloadUrls)==null?void 0:l.chrome),Firefox:(u=e==null?void 0:e.downloadUrls)==null?void 0:u.firefox,Opera:((d=e==null?void 0:e.downloadUrls)==null?void 0:d.opera)||((p=e==null?void 0:e.downloadUrls)==null?void 0:p.chrome),Safari:(h=e==null?void 0:e.downloadUrls)==null?void 0:h.safari,Browser:(m=e==null?void 0:e.downloadUrls)==null?void 0:m.browserExtension}[t]??((g=e==null?void 0:e.downloadUrls)==null?void 0:g.browserExtension)},EO=e=>{var n,r,a;return(Id()?(n=e==null?void 0:e.downloadUrls)==null?void 0:n.ios:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.android)??((a=e==null?void 0:e.downloadUrls)==null?void 0:a.mobile)},NO=e=>{var n,r,a,c,l;const t=Hv();return{Windows:(n=e==null?void 0:e.downloadUrls)==null?void 0:n.windows,macOS:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.macos,Linux:(a=e==null?void 0:e.downloadUrls)==null?void 0:a.linux,Desktop:(c=e==null?void 0:e.downloadUrls)==null?void 0:c.desktop}[t]??((l=e==null?void 0:e.downloadUrls)==null?void 0:l.desktop)},X4=(e,t)=>e.some(n=>n.id===t),MO=e=>!!e.isRainbowKitConnector,h6=e=>{var t;return!!(!e.isRainbowKitConnector&&((t=e.icon)!=null&&t.replace(/\n/g,"").startsWith("data:image"))&&e.uid&&e.name)},IO=(e,t)=>e.id==="walletConnect"&&t?{...e,walletConnectModalConnector:t}:e,BO=({wallets:e,recentWallets:t})=>[...t,...e.filter(n=>!X4(t,n.id))],Z4="rk-recent";function TO(e){try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t:[]}catch{return[]}}function ej(){return typeof window<"u"?TO(window.localStorage.getItem(Z4)):[]}function PO(e){return[...new Set(e)]}function RO(e){const t=PO([e,...ej()]);typeof window<"u"&&window.localStorage.setItem(Z4,JSON.stringify(t))}function cd(e=!1){var N,E,B;const t=Di(),n=UD(),{connectAsync:r,connectors:a}=qP(),c=a,{setIsWalletConnectModalOpen:l}=jj(),u=c.map(M=>({...M,...M.rkDetails||{}}));async function d(M,P){var q,Q;const R=await M.getChainId(),z=await r({...P,chainId:(P==null?void 0:P.chainId)??n??((q=t.find(({id:O})=>O===R))==null?void 0:q.id)??((Q=t[0])==null?void 0:Q.id),connector:M});return z&&RO(M.id),z}async function p(M){try{l(!0),await d(M),l(!1)}catch(P){const R=P.name==="UserRejectedRequestError"||P.message==="Connection request reset. Please try again.";if(l(!1),!R)throw P}}const h=async(M,P)=>{const R=await M.getProvider();return M.id==="coinbase"?R.qrUrl:new Promise(z=>R.once("display_uri",q=>{z(P(q))}))},m=u.find(M=>M.id==="walletConnect"&&M.isWalletConnectModalConnector),g=u.filter(h6).map(M=>({...M,groupIndex:0})),v=u.filter(MO).filter(M=>!M.isWalletConnectModalConnector).filter(M=>e?!g.some(R=>R.id===M.rdns):!0).map(M=>IO(M,m)),b=[...g,...v],_=_O(b,M=>M.id),j=ej().map(M=>_[M]).filter(Boolean).slice(0,3),A=[],k=BO({wallets:b,recentWallets:j});for(const M of k){if(!M)continue;const P=h6(M),R=X4(j,M.id);if(P){A.push({...M,iconUrl:M.icon,ready:!0,connect:d.bind(null,M),groupName:"Installed",recent:R});continue}A.push({...M,ready:M.installed??!0,connect:d.bind(null,M),desktopDownloadUrl:NO(M),extensionDownloadUrl:AO(M),groupName:M.groupName,mobileDownloadUrl:EO(M),getQrCodeUri:(N=M.qrCode)!=null&&N.getUri?()=>h(M,M.qrCode.getUri):void 0,getDesktopUri:(E=M.desktop)!=null&&E.getUri?()=>h(M,M.desktop.getUri):void 0,getMobileUri:(B=M.mobile)!=null&&B.getUri?()=>h(M,M.mobile.getUri):void 0,recent:R,showWalletConnectModal:M.walletConnectModalConnector?()=>p(M.walletConnectModalConnector):void 0})}return A}var tj=async()=>(await je(async()=>{const{default:e}=await import("./assets-Q6ZU7ZJ5-P8HioiAD.js");return{default:e}},[])).default,LO=()=>Ms(tj),DO=()=>S.createElement(un,{background:"#d0d5de",borderRadius:"10",height:"48",src:tj,width:"48"}),nj=async()=>(await je(async()=>{const{default:e}=await import("./login-UP3DZBGS-Db_wM5oQ.js");return{default:e}},[])).default,OO=()=>Ms(nj),FO=()=>S.createElement(un,{background:"#d0d5de",borderRadius:"10",height:"48",src:nj,width:"48"}),ze=S.forwardRef(({as:e="div",children:t,className:n,color:r,display:a,font:c="body",id:l,size:u="16",style:d,tabIndex:p,textAlign:h="inherit",weight:m="regular",testId:g},v)=>S.createElement(U,{as:e,className:n,color:r,display:a,fontFamily:c,fontSize:u,fontWeight:m,id:l,ref:v,style:d,tabIndex:p,textAlign:h,testId:g},t));ze.displayName="Text";var zO={large:{fontSize:"16",paddingX:"24",paddingY:"10"},medium:{fontSize:"14",height:"28",paddingX:"12",paddingY:"4"},small:{fontSize:"14",paddingX:"10",paddingY:"5"}};function On({disabled:e=!1,href:t,label:n,onClick:r,rel:a="noreferrer noopener",size:c="medium",target:l="_blank",testId:u,type:d="primary"}){const p=d==="primary",h=c!=="large",m=Gt(),g=e?"actionButtonSecondaryBackground":p?"accentColor":h?"actionButtonSecondaryBackground":null,{fontSize:v,height:b,paddingX:_,paddingY:x}=zO[c],j=!m||!h;return S.createElement(U,{...t?e?{}:{as:"a",href:t,rel:a,target:l}:{as:"button",type:"button"},onClick:e?void 0:r,...j?{borderColor:m&&!h&&!p?"actionButtonBorderMobile":"actionButtonBorder",borderStyle:"solid",borderWidth:"1"}:{},borderRadius:"actionButton",className:!e&&Wt({active:"shrinkSm",hover:"grow"}),display:"block",paddingX:_,paddingY:x,style:{willChange:"transform"},testId:u,textAlign:"center",transition:"transform",...g?{background:g}:{},...b?{height:b}:{}},S.createElement(ze,{color:e?"modalTextSecondary":p?"accentColorForeground":"accentColor",size:v,weight:"bold"},n))}var $O=()=>Gt()?S.createElement("svg",{"aria-hidden":!0,fill:"none",height:"11.5",viewBox:"0 0 11.5 11.5",width:"11.5",xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Close"),S.createElement("path",{d:"M2.13388 0.366117C1.64573 -0.122039 0.854272 -0.122039 0.366117 0.366117C-0.122039 0.854272 -0.122039 1.64573 0.366117 2.13388L3.98223 5.75L0.366117 9.36612C-0.122039 9.85427 -0.122039 10.6457 0.366117 11.1339C0.854272 11.622 1.64573 11.622 2.13388 11.1339L5.75 7.51777L9.36612 11.1339C9.85427 11.622 10.6457 11.622 11.1339 11.1339C11.622 10.6457 11.622 9.85427 11.1339 9.36612L7.51777 5.75L11.1339 2.13388C11.622 1.64573 11.622 0.854272 11.1339 0.366117C10.6457 -0.122039 9.85427 -0.122039 9.36612 0.366117L5.75 3.98223L2.13388 0.366117Z",fill:"currentColor"})):S.createElement("svg",{"aria-hidden":!0,fill:"none",height:"10",viewBox:"0 0 10 10",width:"10",xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Close"),S.createElement("path",{d:"M1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L3.58579 5L0.292893 8.29289C-0.0976311 8.68342 -0.0976311 9.31658 0.292893 9.70711C0.683417 10.0976 1.31658 10.0976 1.70711 9.70711L5 6.41421L8.29289 9.70711C8.68342 10.0976 9.31658 10.0976 9.70711 9.70711C10.0976 9.31658 10.0976 8.68342 9.70711 8.29289L6.41421 5L9.70711 1.70711C10.0976 1.31658 10.0976 0.683417 9.70711 0.292893C9.31658 -0.0976311 8.68342 -0.0976311 8.29289 0.292893L5 3.58579L1.70711 0.292893Z",fill:"currentColor"})),Ei=({"aria-label":e="Close",onClose:t})=>{const n=Gt();return S.createElement(U,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:Wt({active:"shrinkSm",hover:"growLg"}),color:"closeButton",display:"flex",height:n?"30":"28",justifyContent:"center",onClick:t,style:{willChange:"transform"},transition:"default",type:"button",width:n?"30":"28"},S.createElement($O,null))},rj=async()=>(await je(async()=>{const{default:e}=await import("./sign-A7IJEUT5-CGsRnPrd.js");return{default:e}},[])).default;function HO({onClose:e,onCloseModal:t}){const{i18n:n}=I.useContext(qt),[{status:r,...a},c]=S.useState({status:"idle"}),l=pD(),u=I.useCallback(async()=>{try{const b=await l.getNonce();c(_=>({..._,nonce:b}))}catch{c(b=>({...b,errorMessage:n.t("sign_in.message.preparing_error"),status:"idle"}))}},[l,n.t]),d=I.useRef(!1);S.useEffect(()=>{d.current||(d.current=!0,u())},[u]);const p=Gt(),{address:h,chain:m}=dt(),{signMessageAsync:g}=JP(),v=async()=>{try{const b=m==null?void 0:m.id,{nonce:_}=a;if(!h||!b||!_)return;c(A=>({...A,errorMessage:void 0}));let x;try{const A=l.createMessage({address:h,chainId:b,nonce:_});A instanceof Promise&&c(k=>({...k,status:"creatingMessage"})),x=await A}catch{return c(A=>({...A,errorMessage:n.t("sign_in.message.preparing_error"),status:"idle"}))}let j;try{c(A=>({...A,status:"signing"})),j=await g({message:x})}catch(A){return A instanceof ct?c(k=>({...k,status:"idle"})):c(k=>({...k,errorMessage:n.t("sign_in.signature.signing_error"),status:"idle"}))}c(A=>({...A,status:"verifying"}));try{if(await l.verify({message:x,signature:j})){t();return}throw new Error}catch{return c(A=>({...A,errorMessage:n.t("sign_in.signature.verifying_error"),status:"idle"}))}}catch{c(b=>({...b,errorMessage:n.t("sign_in.signature.oops_error"),status:"idle"}))}};return S.createElement(U,{position:"relative"},S.createElement(U,{display:"flex",paddingRight:"16",paddingTop:"16",position:"absolute",right:"0"},S.createElement(Ei,{onClose:e})),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:p?"32":"24",padding:"24",paddingX:"18",style:{paddingTop:p?"60px":"36px"}},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:p?"6":"4",style:{maxWidth:p?320:280}},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:p?"32":"16"},S.createElement(un,{height:40,src:rj,width:40}),S.createElement(ze,{color:"modalText",size:p?"20":"18",textAlign:"center",weight:"heavy"},n.t("sign_in.label"))),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:p?"16":"12"},S.createElement(ze,{color:"modalTextSecondary",size:p?"16":"14",textAlign:"center"},n.t("sign_in.description")),r==="idle"&&a.errorMessage?S.createElement(ze,{color:"error",size:p?"16":"14",textAlign:"center",weight:"bold"},a.errorMessage):null)),S.createElement(U,{alignItems:p?void 0:"center",display:"flex",flexDirection:"column",gap:"8",width:"full"},S.createElement(On,{disabled:!a.nonce||r==="creatingMessage"||r==="signing"||r==="verifying",label:!a.nonce||r==="creatingMessage"?n.t("sign_in.message.preparing"):r==="signing"?n.t("sign_in.signature.waiting"):r==="verifying"?n.t("sign_in.signature.verifying"):n.t("sign_in.message.send"),onClick:v,size:p?"large":"medium",testId:"auth-message-button"}),p?S.createElement(On,{label:"Cancel",onClick:e,size:"large",type:"secondary"}):S.createElement(U,{as:"button",borderRadius:"full",className:Wt({active:"shrink",hover:"grow"}),display:"block",onClick:e,paddingX:"10",paddingY:"5",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},S.createElement(ze,{color:"closeButton",size:p?"16":"14",weight:"bold"},n.t("sign_in.message.cancel"))))))}function UO(){const e=Di(),t=cd(),n=zp()==="unauthenticated",r=I.useCallback(()=>{Ms(...t.map(a=>a.iconUrl),...e.map(a=>a.iconUrl).filter(z4)),Gt()||(LO(),OO()),n&&Ms(rj)},[t,e,n]);I.useEffect(()=>{r()},[r])}var sj="WALLETCONNECT_DEEPLINK_CHOICE";function WO({mobileUri:e,name:t}){typeof window>"u"||window.localStorage.setItem(sj,JSON.stringify({href:e.split("?")[0],name:t}))}function VO(){typeof window<"u"&&window.localStorage.removeItem(sj)}var aj=I.createContext(void 0),py="data-rk",oj=e=>({[py]:e||""}),GO=e=>{if(e&&!/^[a-zA-Z0-9_]+$/.test(e))throw new Error(`Invalid ID: ${e}`);return e?`[${py}="${e}"]`:`[${py}]`},qO=()=>{const e=I.useContext(aj);return oj(e)},KO=Nx();function QO({appInfo:e,avatar:t,children:n,coolMode:r=!1,id:a,initialChain:c,locale:l,modalSize:u=Pd.WIDE,showRecentTransactions:d=!1,theme:p=KO}){if(UO(),wO(),Nk({onDisconnect:VO}),typeof p=="function")throw new Error('A theme function was provided to the "theme" prop instead of a theme object. You must execute this function to get the resulting theme object.');const h=GO(a),m={...Q4,...e},g=t??D4;return S.createElement(HD,{initialChain:c},S.createElement(gO,null,S.createElement(MD,{locale:l},S.createElement(Y4.Provider,{value:r},S.createElement(yO,{modalSize:u},S.createElement(Ov.Provider,{value:d},S.createElement(hO,null,S.createElement(O4.Provider,{value:g},S.createElement(Bd.Provider,{value:m},S.createElement(aj.Provider,{value:a},S.createElement(VD,null,S.createElement(lz,null,p?S.createElement("div",{...oj(a)},S.createElement("style",{dangerouslySetInnerHTML:{__html:[`${h}{${f6("lightMode"in p?p.lightMode:p)}}`,"darkMode"in p?`@media(prefers-color-scheme:dark){${h}{${f6(p.darkMode,{extends:p.lightMode})}}}`:null].join("")}}),n):n))))))))))))}var YO="_9pm4ki5 ju367va ju367v15 ju367v8r",JO="_9pm4ki3 ju367v9h ju367vb3 ju367va ju367v2q ju367v8q",p6=(e,t)=>{const n=e.querySelectorAll("button:not(:disabled), a[href]");n.length!==0&&n[t==="end"?n.length-1:0].focus()};function XO(e){const t=I.useRef(null);return I.useEffect(()=>{const n=document.activeElement;return()=>{var r;(r=n.focus)==null||r.call(n)}},[]),I.useEffect(()=>{if(t.current){const n=t.current.querySelector("[data-auto-focus]");n?n.focus():t.current.focus()}},[]),S.createElement(S.Fragment,null,S.createElement("div",{onFocus:I.useCallback(()=>t.current&&p6(t.current,"end"),[]),tabIndex:0}),S.createElement("div",{ref:t,style:{outline:"none"},tabIndex:-1,...e}),S.createElement("div",{onFocus:I.useCallback(()=>t.current&&p6(t.current,"start"),[]),tabIndex:0}))}var ZO=e=>e.stopPropagation();function Zh({children:e,onClose:t,open:n,titleId:r}){I.useEffect(()=>{const p=h=>n&&h.key==="Escape"&&t();return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[n,t]);const[a,c]=I.useState(!0);I.useEffect(()=>{c(getComputedStyle(window.document.body).overflow!=="hidden")},[]);const l=I.useCallback(()=>t(),[t]),u=qO(),d=Gt();return S.createElement(S.Fragment,null,n?m4.createPortal(S.createElement(C4,{enabled:a},S.createElement(U,{...u},S.createElement(U,{...u,alignItems:d?"flex-end":"center","aria-labelledby":r,"aria-modal":!0,className:JO,onClick:l,position:"fixed",role:"dialog"},S.createElement(XO,{className:YO,onClick:ZO,role:"document"},e)))),document.body):null)}var eF="_1ckjpok7",tF="_1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",nF="_1ckjpok4 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",rF="_1ckjpok6 ju367vq",sF="_1ckjpok3 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",aF="_1ckjpok2 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r";function ep({bottomSheetOnMobile:e=!1,children:t,marginTop:n,padding:r="16",paddingBottom:a,wide:c=!1}){const l=Gt(),d=I.useContext(Hp)===Pd.COMPACT;return S.createElement(U,{marginTop:n},S.createElement(U,{className:[c?l?aF:d?nF:sF:tF,l?rF:null,l&&e?eF:null].join(" ")},S.createElement(U,{padding:r,paddingBottom:a??r},t)))}var m6=["k","m","b","t"];function gh(e,t=1){return e.toString().replace(new RegExp(`(.+\\.\\d{${t}})\\d+`),"$1").replace(/(\.[1-9]*)0+$/,"$1").replace(/\.$/,"")}function ij(e){if(e<1)return gh(e,3);if(e<10**2)return gh(e,2);if(e<10**4)return new Intl.NumberFormat().format(Number.parseFloat(gh(e,1)));const t=10**1;let n=String(e);for(let r=m6.length-1;r>=0;r--){const a=10**((r+1)*3);if(a<=e){const c=e*t/a/t;n=gh(c,1)+m6[r];break}}return n}function cj(e){return e.length<8?e:`${e.substring(0,4)}…${e.substring(e.length-4)}`}function lj(e){if(!e)return"";const t=e.split("."),n=t.pop();return t.join(".").length>24?`${t.join(".").substring(0,24)}...`:`${t.join(".")}.${n}`}var oF=()=>S.createElement("svg",{fill:"none",height:"13",viewBox:"0 0 13 13",width:"13",xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Copied"),S.createElement("path",{d:"M4.94568 12.2646C5.41052 12.2646 5.77283 12.0869 6.01892 11.7109L12.39 1.96973C12.5677 1.69629 12.6429 1.44336 12.6429 1.2041C12.6429 0.561523 12.1644 0.0966797 11.5082 0.0966797C11.057 0.0966797 10.7767 0.260742 10.5033 0.691406L4.9115 9.50977L2.07458 5.98926C1.82166 5.68848 1.54822 5.55176 1.16541 5.55176C0.502319 5.55176 0.0238037 6.02344 0.0238037 6.66602C0.0238037 6.95312 0.112671 7.20605 0.358765 7.48633L3.88611 11.7588C4.18005 12.1074 4.50818 12.2646 4.94568 12.2646Z",fill:"currentColor"})),iF=()=>S.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 17 16",width:"17",xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Copy"),S.createElement("path",{d:"M3.04236 12.3027H4.18396V13.3008C4.18396 14.8525 5.03845 15.7002 6.59705 15.7002H13.6244C15.183 15.7002 16.0375 14.8525 16.0375 13.3008V6.24609C16.0375 4.69434 15.183 3.84668 13.6244 3.84668H12.4828V2.8418C12.4828 1.29688 11.6283 0.442383 10.0697 0.442383H3.04236C1.48376 0.442383 0.629272 1.29004 0.629272 2.8418V9.90332C0.629272 11.4551 1.48376 12.3027 3.04236 12.3027ZM3.23376 10.5391C2.68689 10.5391 2.39294 10.2656 2.39294 9.68457V3.06055C2.39294 2.47949 2.68689 2.21289 3.23376 2.21289H9.8783C10.4252 2.21289 10.7191 2.47949 10.7191 3.06055V3.84668H6.59705C5.03845 3.84668 4.18396 4.69434 4.18396 6.24609V10.5391H3.23376ZM6.78845 13.9365C6.24158 13.9365 5.94763 13.6699 5.94763 13.0889V6.45801C5.94763 5.87695 6.24158 5.61035 6.78845 5.61035H13.433C13.9799 5.61035 14.2738 5.87695 14.2738 6.45801V13.0889C14.2738 13.6699 13.9799 13.9365 13.433 13.9365H6.78845Z",fill:"currentColor"})),cF=()=>S.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 18 16",width:"18",xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Disconnect"),S.createElement("path",{d:"M2.67834 15.5908H9.99963C11.5514 15.5908 12.399 14.7432 12.399 13.1777V10.2656H10.6354V12.9863C10.6354 13.5332 10.3688 13.8271 9.78772 13.8271H2.89026C2.3092 13.8271 2.0426 13.5332 2.0426 12.9863V3.15625C2.0426 2.60254 2.3092 2.30859 2.89026 2.30859H9.78772C10.3688 2.30859 10.6354 2.60254 10.6354 3.15625V5.89746H12.399V2.95801C12.399 1.39941 11.5514 0.544922 9.99963 0.544922H2.67834C1.12659 0.544922 0.278931 1.39941 0.278931 2.95801V13.1777C0.278931 14.7432 1.12659 15.5908 2.67834 15.5908ZM7.43616 8.85059H14.0875L15.0924 8.78906L14.566 9.14453L13.6842 9.96484C13.5406 10.1016 13.4586 10.2861 13.4586 10.4844C13.4586 10.8398 13.7321 11.168 14.1217 11.168C14.3199 11.168 14.4635 11.0928 14.6002 10.9561L16.7809 8.68652C16.986 8.48145 17.0543 8.27637 17.0543 8.06445C17.0543 7.85254 16.986 7.64746 16.7809 7.43555L14.6002 5.17285C14.4635 5.03613 14.3199 4.9541 14.1217 4.9541C13.7321 4.9541 13.4586 5.27539 13.4586 5.6377C13.4586 5.83594 13.5406 6.02734 13.6842 6.15723L14.566 6.98438L15.0924 7.33984L14.0875 7.27148H7.43616C7.01917 7.27148 6.65686 7.62012 6.65686 8.06445C6.65686 8.50195 7.01917 8.85059 7.43616 8.85059Z",fill:"currentColor"}));function lF(){const e=q4(),{address:t}=dt(),n=Dv();return I.useCallback(()=>{if(!t||!n)throw new Error("No address or chain ID found");e.clearTransactions(t,n)},[e,t,n])}var uj=e=>{var t,n;return(n=(t=e==null?void 0:e.blockExplorers)==null?void 0:t.default)==null?void 0:n.url},dj=()=>S.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Link"),S.createElement("path",{d:"M10 18.9443C15.0977 18.9443 19.2812 14.752 19.2812 9.6543C19.2812 4.56543 15.0889 0.373047 10 0.373047C4.90234 0.373047 0.71875 4.56543 0.71875 9.6543C0.71875 14.752 4.91113 18.9443 10 18.9443ZM10 16.6328C6.1416 16.6328 3.03906 13.5215 3.03906 9.6543C3.03906 5.7959 6.13281 2.68457 10 2.68457C13.8584 2.68457 16.9697 5.7959 16.9697 9.6543C16.9785 13.5215 13.8672 16.6328 10 16.6328ZM12.7158 12.1416C13.2432 12.1416 13.5684 11.7549 13.5684 11.1836V7.19336C13.5684 6.44629 13.1377 6.05957 12.417 6.05957H8.40918C7.8291 6.05957 7.45117 6.38477 7.45117 6.91211C7.45117 7.43945 7.8291 7.77344 8.40918 7.77344H9.69238L10.7207 7.63281L9.53418 8.67871L6.73047 11.4912C6.53711 11.6758 6.41406 11.9395 6.41406 12.2031C6.41406 12.7832 6.85352 13.1699 7.39844 13.1699C7.68848 13.1699 7.92578 13.0732 8.1543 12.8623L10.9316 10.0762L11.9775 8.89844L11.8545 9.98828V11.1836C11.8545 11.7725 12.1885 12.1416 12.7158 12.1416Z",fill:"currentColor"})),uF=()=>S.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Cancel"),S.createElement("path",{d:"M10 18.9443C15.0977 18.9443 19.2812 14.752 19.2812 9.6543C19.2812 4.56543 15.0889 0.373047 10 0.373047C4.90234 0.373047 0.71875 4.56543 0.71875 9.6543C0.71875 14.752 4.91113 18.9443 10 18.9443ZM10 16.6328C6.1416 16.6328 3.03906 13.5215 3.03906 9.6543C3.03906 5.7959 6.13281 2.68457 10 2.68457C13.8584 2.68457 16.9697 5.7959 16.9697 9.6543C16.9785 13.5215 13.8672 16.6328 10 16.6328ZM7.29297 13.3018C7.58301 13.3018 7.81152 13.2139 7.99609 13.0205L10 11.0166L12.0127 13.0205C12.1973 13.2051 12.4258 13.3018 12.707 13.3018C13.2432 13.3018 13.6562 12.8887 13.6562 12.3525C13.6562 12.0977 13.5508 11.8691 13.3662 11.6934L11.3535 9.67188L13.375 7.6416C13.5596 7.44824 13.6562 7.22852 13.6562 6.98242C13.6562 6.44629 13.2432 6.0332 12.7158 6.0332C12.4346 6.0332 12.2148 6.12109 12.0215 6.31445L10 8.32715L7.9873 6.32324C7.80273 6.12988 7.58301 6.04199 7.29297 6.04199C6.76562 6.04199 6.35254 6.45508 6.35254 6.99121C6.35254 7.2373 6.44922 7.46582 6.63379 7.6416L8.65527 9.67188L6.63379 11.6934C6.44922 11.8691 6.35254 12.1064 6.35254 12.3525C6.35254 12.8887 6.76562 13.3018 7.29297 13.3018Z",fill:"currentColor"})),dF=()=>S.createElement("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Success"),S.createElement("path",{d:"M10 19.4443C15.0977 19.4443 19.2812 15.252 19.2812 10.1543C19.2812 5.06543 15.0889 0.873047 10 0.873047C4.90234 0.873047 0.71875 5.06543 0.71875 10.1543C0.71875 15.252 4.91113 19.4443 10 19.4443ZM10 17.1328C6.1416 17.1328 3.03906 14.0215 3.03906 10.1543C3.03906 6.2959 6.13281 3.18457 10 3.18457C13.8584 3.18457 16.9697 6.2959 16.9697 10.1543C16.9785 14.0215 13.8672 17.1328 10 17.1328ZM9.07715 14.3379C9.4375 14.3379 9.7627 14.1533 9.97363 13.8369L13.7441 8.00977C13.8848 7.79883 13.9814 7.5791 13.9814 7.36816C13.9814 6.84961 13.5244 6.48926 13.0322 6.48926C12.707 6.48926 12.4258 6.66504 12.2148 7.0166L9.05957 12.0967L7.5918 10.2949C7.37207 10.0225 7.13477 9.9082 6.84473 9.9082C6.33496 9.9082 5.92188 10.3125 5.92188 10.8223C5.92188 11.0684 6.00098 11.2793 6.18555 11.5078L8.1543 13.8545C8.40918 14.1709 8.70801 14.3379 9.07715 14.3379Z",fill:"currentColor"})),fF=e=>{switch(e){case"pending":return id;case"confirmed":return dF;case"failed":return uF;default:return id}};function hF({tx:e}){const t=Gt(),n=fF(e.status),r=e.status==="failed"?"error":"accentColor",{chain:a}=dt(),c=e.status==="confirmed"?"Confirmed":e.status==="failed"?"Failed":"Pending",l=uj(a);return S.createElement(S.Fragment,null,S.createElement(U,{...l?{as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:Wt({active:"shrink"}),href:`${l}/tx/${e.hash}`,rel:"noreferrer noopener",target:"_blank",transition:"default"}:{},color:"modalText",display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"8",width:"full"},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",gap:t?"16":"14"},S.createElement(U,{color:r},S.createElement(n,null)),S.createElement(U,{display:"flex",flexDirection:"column",gap:t?"3":"1"},S.createElement(U,null,S.createElement(ze,{color:"modalText",font:"body",size:t?"16":"14",weight:"bold"},e==null?void 0:e.description)),S.createElement(U,null,S.createElement(ze,{color:e.status==="pending"?"modalTextSecondary":r,font:"body",size:"14",weight:t?"medium":"regular"},c)))),l&&S.createElement(U,{alignItems:"center",color:"modalTextDim",display:"flex"},S.createElement(dj,null))))}var pF=3;function mF({address:e}){const t=K4(),n=lF(),{chain:r}=dt(),a=uj(r),c=t.slice(0,pF),l=c.length>0,u=Gt(),{appName:d}=I.useContext(Bd),{i18n:p}=I.useContext(qt);return S.createElement(S.Fragment,null,S.createElement(U,{display:"flex",flexDirection:"column",gap:"10",paddingBottom:"2",paddingTop:"16",paddingX:u?"8":"18"},l&&S.createElement(U,{paddingBottom:u?"4":"0",paddingTop:"8",paddingX:u?"12":"6"},S.createElement(U,{display:"flex",justifyContent:"space-between"},S.createElement(ze,{color:"modalTextSecondary",size:u?"16":"14",weight:"semibold"},p.t("profile.transactions.recent.title")),S.createElement(U,{style:{marginBottom:-6,marginLeft:-10,marginRight:-10,marginTop:-6}},S.createElement(U,{as:"button",background:{hover:"profileForeground"},borderRadius:"actionButton",className:Wt({active:"shrink"}),onClick:n,paddingX:u?"8":"12",paddingY:u?"4":"5",transition:"default",type:"button"},S.createElement(ze,{color:"modalTextSecondary",size:u?"16":"14",weight:"semibold"},p.t("profile.transactions.clear.label")))))),S.createElement(U,{display:"flex",flexDirection:"column",gap:"4"},l?c.map(h=>S.createElement(hF,{key:h.hash,tx:h})):S.createElement(S.Fragment,null,S.createElement(U,{padding:u?"12":"8"},S.createElement(ze,{color:"modalTextDim",size:u?"16":"14",weight:u?"medium":"bold"},d?p.t("profile.transactions.description",{appName:d}):p.t("profile.transactions.description_fallback"))),u&&S.createElement(U,{background:"generalBorderDim",height:"1",marginX:"12",marginY:"8"})))),a&&S.createElement(U,{paddingBottom:"18",paddingX:u?"8":"18"},S.createElement(U,{alignItems:"center",as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:Wt({active:"shrink"}),color:"modalTextDim",display:"flex",flexDirection:"row",href:`${a}/address/${e}`,justifyContent:"space-between",paddingX:"8",paddingY:"12",rel:"noreferrer noopener",style:{willChange:"transform"},target:"_blank",transition:"default",width:"full",...u?{paddingLeft:"12"}:{}},S.createElement(ze,{color:"modalText",font:"body",size:u?"16":"14",weight:u?"semibold":"bold"},p.t("profile.explorer.label")),S.createElement(dj,null))))}function g6({action:e,icon:t,label:n,testId:r,url:a}){const c=Gt();return S.createElement(U,{...a?{as:"a",href:a,rel:"noreferrer noopener",target:"_blank"}:{as:"button",type:"button"},background:{base:"profileAction",...c?{}:{hover:"profileActionHover"}},borderRadius:"menuButton",boxShadow:"profileDetailsAction",className:Wt({active:"shrinkSm",hover:c?void 0:"grow"}),display:"flex",onClick:e,padding:c?"6":"8",style:{willChange:"transform"},testId:r,transition:"default",width:"full"},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"1",justifyContent:"center",paddingTop:"2",width:"full"},S.createElement(U,{color:"modalText",height:"max"},t),S.createElement(U,null,S.createElement(ze,{color:"modalText",size:c?"12":"13",weight:"semibold"},n))))}function gF({address:e,ensAvatar:t,ensName:n,balance:r,onClose:a,onDisconnect:c}){const l=I.useContext(Ov),{i18n:u}=I.useContext(qt),[d,p]=I.useState(!1),h=I.useCallback(()=>{e&&(navigator.clipboard.writeText(e),p(!0))},[e]);if(I.useEffect(()=>{if(d){const x=setTimeout(()=>{p(!1)},1500);return()=>clearTimeout(x)}},[d]),!e)return null;const m=n?lj(n):cj(e),g=r==null?void 0:r.formatted,v=g?ij(Number.parseFloat(g)):void 0,b="rk_profile_title",_=Gt();return S.createElement(S.Fragment,null,S.createElement(U,{display:"flex",flexDirection:"column"},S.createElement(U,{background:"profileForeground",padding:"16"},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:_?"16":"12",justifyContent:"center",margin:"8",style:{textAlign:"center"}},S.createElement(U,{style:{position:"absolute",right:16,top:16,willChange:"transform"}},S.createElement(Ei,{onClose:a}))," ",S.createElement(U,{marginTop:_?"24":"0"},S.createElement(F4,{address:e,imageUrl:t,size:_?82:74})),S.createElement(U,{display:"flex",flexDirection:"column",gap:_?"4":"0",textAlign:"center"},S.createElement(U,{textAlign:"center"},S.createElement(ze,{as:"h1",color:"modalText",id:b,size:_?"20":"18",weight:"heavy"},m)),!!r&&S.createElement(U,{textAlign:"center"},S.createElement(ze,{as:"h1",color:"modalTextSecondary",id:b,size:_?"16":"14",weight:"semibold"},v," ",r.symbol)))),S.createElement(U,{display:"flex",flexDirection:"row",gap:"8",margin:"2",marginTop:"16"},S.createElement(g6,{action:h,icon:d?S.createElement(oF,null):S.createElement(iF,null),label:d?u.t("profile.copy_address.copied"):u.t("profile.copy_address.label")}),S.createElement(g6,{action:c,icon:S.createElement(cF,null),label:u.t("profile.disconnect.label"),testId:"disconnect-button"}))),l&&S.createElement(S.Fragment,null,S.createElement(U,{background:"generalBorder",height:"1",marginTop:"-1"}),S.createElement(U,null,S.createElement(mF,{address:e})))))}function yF({onClose:e,open:t}){const{address:n}=dt(),{balance:r,ensAvatar:a,ensName:c}=W4({address:n,includeBalance:t}),{disconnect:l}=Ri();return n?S.createElement(S.Fragment,null,n&&S.createElement(Zh,{onClose:e,open:t,titleId:"rk_account_modal_title"},S.createElement(ep,{bottomSheetOnMobile:!0,padding:"0"},S.createElement(gF,{address:n,ensAvatar:a,ensName:c,balance:r,onClose:e,onDisconnect:l})))):null}var vF=({size:e})=>S.createElement("svg",{fill:"none",height:e,viewBox:"0 0 28 28",width:e,xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Disconnect"),S.createElement("path",{d:"M6.742 22.195h8.367c1.774 0 2.743-.968 2.743-2.758V16.11h-2.016v3.11c0 .625-.305.96-.969.96H6.984c-.664 0-.968-.335-.968-.96V7.984c0-.632.304-.968.968-.968h7.883c.664 0 .969.336.969.968v3.133h2.016v-3.36c0-1.78-.97-2.757-2.743-2.757H6.742C4.97 5 4 5.977 4 7.758v11.68c0 1.789.969 2.757 2.742 2.757Zm5.438-7.703h7.601l1.149-.07-.602.406-1.008.938a.816.816 0 0 0-.258.593c0 .407.313.782.758.782.227 0 .39-.086.547-.243l2.492-2.593c.235-.235.313-.47.313-.711 0-.242-.078-.477-.313-.719l-2.492-2.586c-.156-.156-.32-.25-.547-.25-.445 0-.758.367-.758.781 0 .227.094.446.258.594l1.008.945.602.407-1.149-.079H12.18a.904.904 0 0 0 0 1.805Z",fill:"currentColor"})),bF="v9horb0",Uv=S.forwardRef(({children:e,currentlySelected:t=!1,onClick:n,testId:r,...a},c)=>{const l=Gt();return S.createElement(U,{as:"button",borderRadius:"menuButton",disabled:t,display:"flex",onClick:n,ref:c,testId:r,type:"button"},S.createElement(U,{borderRadius:"menuButton",className:[l?bF:void 0,!t&&Wt({active:"shrink"})],padding:l?"8":"6",transition:"default",width:"full",...t?{background:"accentColor",borderColor:"selectedOptionBorder",borderStyle:"solid",borderWidth:"1",boxShadow:"selectedOption",color:"accentColorForeground"}:{background:{hover:"menuItemBackground"},color:"modalText",transition:"default"},...a},e))});Uv.displayName="MenuButton";var wF=({chainId:e,currentChainId:t,switchChain:n,chainIconSize:r,isLoading:a,src:c,name:l,iconBackground:u,idx:d})=>{const p=Gt(),{i18n:h}=I.useContext(qt),m=Di(),g=t===e;return S.createElement(I.Fragment,null,S.createElement(Uv,{currentlySelected:g,onClick:g?void 0:()=>n({chainId:e}),testId:`chain-option-${e}`},S.createElement(U,{fontFamily:"body",fontSize:"16",fontWeight:"bold"},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:r},c&&S.createElement(U,{height:"full",marginRight:"8"},S.createElement(un,{alt:l,background:u,borderRadius:"full",height:r,src:c,width:r,testId:`chain-option-${e}-icon`})),S.createElement("div",null,l??l)),g&&S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},S.createElement(ze,{color:"accentColorForeground",size:"14",weight:"medium"},h.t("chains.connected")),S.createElement(U,{background:"connectionIndicator",borderColor:"selectedOptionBorder",borderRadius:"full",borderStyle:"solid",borderWidth:"1",height:"8",marginLeft:"8",width:"8"})),a&&S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},S.createElement(ze,{color:"modalText",size:"14",weight:"medium"},h.t("chains.confirm")),S.createElement(U,{background:"standby",borderRadius:"full",height:"8",marginLeft:"8",width:"8"}))))),p&&d<m.length-1&&S.createElement(U,{background:"generalBorderDim",height:"1",marginX:"8"}))},_F=wF,xF="_18dqw9x0",CF="_18dqw9x1";function kF({onClose:e,open:t}){const{chainId:n}=dt(),{chains:r}=Lt(),[a,c]=I.useState(null),{switchChain:l}=Bs({mutation:{onMutate:({chainId:b})=>{c(b)},onSuccess:()=>{a&&c(null)},onError:()=>{a&&c(null)},onSettled:()=>{e()}}}),{i18n:u}=I.useContext(qt),{disconnect:d}=Ri(),p="rk_chain_modal_title",h=Gt(),m=r.some(b=>b.id===n),g=h?"36":"28",v=Di();return n?S.createElement(Zh,{onClose:e,open:t,titleId:p},S.createElement(ep,{bottomSheetOnMobile:!0,paddingBottom:"0"},S.createElement(U,{display:"flex",flexDirection:"column",gap:"14"},S.createElement(U,{display:"flex",flexDirection:"row",justifyContent:"space-between"},h&&S.createElement(U,{width:"30"}),S.createElement(U,{paddingBottom:"0",paddingLeft:"8",paddingTop:"4"},S.createElement(ze,{as:"h1",color:"modalText",id:p,size:h?"20":"18",weight:"heavy"},u.t("chains.title"))),S.createElement(Ei,{onClose:e})),!m&&S.createElement(U,{marginX:"8",textAlign:h?"center":"left"},S.createElement(ze,{color:"modalTextSecondary",size:"14",weight:"medium"},u.t("chains.wrong_network"))),S.createElement(U,{className:h?CF:xF,display:"flex",flexDirection:"column",gap:"4",padding:"2",paddingBottom:"16"},v.map(({iconBackground:b,iconUrl:_,id:x,name:j},A)=>S.createElement(_F,{key:x,chainId:x,currentChainId:n,switchChain:l,chainIconSize:g,isLoading:a===x,src:_,name:j,iconBackground:b,idx:A})),!m&&S.createElement(S.Fragment,null,S.createElement(U,{background:"generalBorderDim",height:"1",marginX:"8"}),S.createElement(Uv,{onClick:()=>d(),testId:"chain-option-disconnect"},S.createElement(U,{color:"error",fontFamily:"body",fontSize:"16",fontWeight:"bold"},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:g},S.createElement(U,{alignItems:"center",color:"error",height:g,justifyContent:"center",marginRight:"8"},S.createElement(vF,{size:Number(g)})),S.createElement("div",null,u.t("chains.disconnect"))))))))))):null}function jF(e,t){const n={};for(const r of e){const a=t(r);a&&(n[a]||(n[a]=[]),n[a].push(r))}return n}var SF="rk-latest-id";function AF(e){typeof window<"u"&&window.localStorage.setItem(SF,e)}var Wv=({children:e,href:t})=>S.createElement(U,{as:"a",color:"accentColor",href:t,rel:"noreferrer",target:"_blank"},e),Vv=({children:e})=>S.createElement(ze,{color:"modalTextSecondary",size:"12",weight:"medium"},e);function y6({compactModeEnabled:e=!1,getWallet:t}){const{disclaimer:n,learnMoreUrl:r}=I.useContext(Bd),{i18n:a}=I.useContext(qt);return S.createElement(S.Fragment,null,S.createElement(U,{alignItems:"center",color:"accentColor",display:"flex",flexDirection:"column",height:"full",justifyContent:"space-around"},S.createElement(U,{marginBottom:"10"},!e&&S.createElement(ze,{color:"modalText",size:"18",weight:"heavy"},a.t("intro.title"))),S.createElement(U,{display:"flex",flexDirection:"column",gap:"32",justifyContent:"center",marginY:"20",style:{maxWidth:312}},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},S.createElement(U,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},S.createElement(DO,null)),S.createElement(U,{display:"flex",flexDirection:"column",gap:"4"},S.createElement(ze,{color:"modalText",size:"14",weight:"bold"},a.t("intro.digital_asset.title")),S.createElement(ze,{color:"modalTextSecondary",size:"14",weight:"medium"},a.t("intro.digital_asset.description")))),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},S.createElement(U,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},S.createElement(FO,null)),S.createElement(U,{display:"flex",flexDirection:"column",gap:"4"},S.createElement(ze,{color:"modalText",size:"14",weight:"bold"},a.t("intro.login.title")),S.createElement(ze,{color:"modalTextSecondary",size:"14",weight:"medium"},a.t("intro.login.description"))))),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",margin:"10"},S.createElement(On,{label:a.t("intro.get.label"),onClick:t}),S.createElement(U,{as:"a",className:Wt({active:"shrink",hover:"grow"}),display:"block",href:r,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},S.createElement(ze,{color:"accentColor",size:"14",weight:"bold"},a.t("intro.learn_more.label")))),n&&!e&&S.createElement(U,{marginBottom:"8",marginTop:"12",textAlign:"center"},S.createElement(n,{Link:Wv,Text:Vv}))))}var fj=()=>S.createElement("svg",{fill:"none",height:"17",viewBox:"0 0 11 17",width:"11",xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Back"),S.createElement("path",{d:"M0.99707 8.6543C0.99707 9.08496 1.15527 9.44531 1.51562 9.79688L8.16016 16.3096C8.43262 16.5732 8.74902 16.7051 9.13574 16.7051C9.90918 16.7051 10.5508 16.0811 10.5508 15.3076C10.5508 14.9121 10.3838 14.5605 10.0938 14.2705L4.30176 8.64551L10.0938 3.0293C10.3838 2.74805 10.5508 2.3877 10.5508 2.00098C10.5508 1.23633 9.90918 0.603516 9.13574 0.603516C8.74902 0.603516 8.43262 0.735352 8.16016 0.999023L1.51562 7.51172C1.15527 7.85449 1.00586 8.21484 0.99707 8.6543Z",fill:"currentColor"})),EF=()=>S.createElement("svg",{fill:"none",height:"12",viewBox:"0 0 8 12",width:"8",xmlns:"http://www.w3.org/2000/svg"},S.createElement("title",null,"Info"),S.createElement("path",{d:"M3.64258 7.99609C4.19336 7.99609 4.5625 7.73828 4.68555 7.24609C4.69141 7.21094 4.70312 7.16406 4.70898 7.13477C4.80859 6.60742 5.05469 6.35547 6.04492 5.76367C7.14648 5.10156 7.67969 4.3457 7.67969 3.24414C7.67969 1.39844 6.17383 0.255859 3.95898 0.255859C2.32422 0.255859 1.05859 0.894531 0.548828 1.86719C0.396484 2.14844 0.320312 2.44727 0.320312 2.74023C0.314453 3.37305 0.742188 3.79492 1.42188 3.79492C1.91406 3.79492 2.33594 3.54883 2.53516 3.11523C2.78711 2.47656 3.23242 2.21289 3.83594 2.21289C4.55664 2.21289 5.10742 2.65234 5.10742 3.29102C5.10742 3.9707 4.7793 4.29883 3.81836 4.87891C3.02148 5.36523 2.50586 5.92773 2.50586 6.76562V6.90039C2.50586 7.55664 2.96289 7.99609 3.64258 7.99609ZM3.67188 11.4473C4.42773 11.4473 5.04297 10.8672 5.04297 10.1406C5.04297 9.41406 4.42773 8.83984 3.67188 8.83984C2.91602 8.83984 2.30664 9.41406 2.30664 10.1406C2.30664 10.8672 2.91602 11.4473 3.67188 11.4473Z",fill:"currentColor"})),NF=({"aria-label":e="Info",onClick:t})=>{const n=Gt();return S.createElement(U,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:Wt({active:"shrinkSm",hover:"growLg"}),color:"closeButton",display:"flex",height:n?"30":"28",justifyContent:"center",onClick:t,style:{willChange:"transform"},transition:"default",type:"button",width:n?"30":"28"},S.createElement(EF,null))},hj=e=>{const t=I.useRef(null),n=I.useContext(Y4),r=$p(e);return I.useEffect(()=>{if(n&&t.current&&r)return IF(t.current,r)},[n,r]),t},MF=()=>{const e="_rk_coolMode",t=document.getElementById(e);if(t)return t;const n=document.createElement("div");return n.setAttribute("id",e),n.setAttribute("style",["overflow:hidden","position:fixed","height:100%","top:0","left:0","right:0","bottom:0","pointer-events:none","z-index:2147483647"].join(";")),document.body.appendChild(n),n},v6=0;function IF(e,t){v6++;const n=[15,20,25,35,45],r=35;let a=[],c=!1,l=0,u=0;const d=MF();function p(){const N=n[Math.floor(Math.random()*n.length)],E=Math.random()*10,B=Math.random()*25,M=Math.random()*360,P=Math.random()*35*(Math.random()<=.5?-1:1),R=u-N/2,z=l-N/2,q=Math.random()<=.5?-1:1,Q=document.createElement("div"),O=document.createElement("img");O.src=t,O.width=N,O.height=N,O.style.borderRadius="25%",Q.appendChild(O),Q.setAttribute("style",["position:absolute","will-change:transform",`top:${R}px`,`left:${z}px`,`transform:rotate(${M}deg)`].join(";")),d.appendChild(Q),a.push({direction:q,element:Q,left:z,size:N,speedHorz:E,speedUp:B,spinSpeed:P,spinVal:M,top:R})}function h(){for(const N of a)N.left=N.left-N.speedHorz*N.direction,N.top=N.top-N.speedUp,N.speedUp=Math.min(N.size,N.speedUp-1),N.spinVal=N.spinVal+N.spinSpeed,N.top>=Math.max(window.innerHeight,document.body.clientHeight)+N.size&&(a=a.filter(E=>E!==N),N.element.remove()),N.element.setAttribute("style",["position:absolute","will-change:transform",`top:${N.top}px`,`left:${N.left}px`,`transform:rotate(${N.spinVal}deg)`].join(";"))}let m;function g(){c&&a.length<r&&p(),h(),m=requestAnimationFrame(g)}g();const v="ontouchstart"in window||navigator.msMaxTouchPoints,b=v?"touchstart":"mousedown",_=v?"touchend":"mouseup",x=v?"touchmove":"mousemove",j=N=>{var E,B;"touches"in N?(l=(E=N.touches)==null?void 0:E[0].clientX,u=(B=N.touches)==null?void 0:B[0].clientY):(l=N.clientX,u=N.clientY)},A=N=>{j(N),c=!0},k=()=>{c=!1};return e.addEventListener(x,j,{passive:!1}),e.addEventListener(b,A),e.addEventListener(_,k),e.addEventListener("mouseleave",k),()=>{e.removeEventListener(x,j),e.removeEventListener(b,A),e.removeEventListener(_,k),e.removeEventListener("mouseleave",k);const N=setInterval(()=>{m&&a.length===0&&(cancelAnimationFrame(m),clearInterval(N),--v6===0&&d.remove())},500)}}var BF="g5kl0l0",pj=({as:e="button",currentlySelected:t=!1,iconBackground:n,iconUrl:r,name:a,onClick:c,ready:l,recent:u,testId:d,isRainbowKitConnector:p,...h})=>{const m=hj(r),[g,v]=S.useState(!1),{i18n:b}=S.useContext(qt);return S.createElement(U,{display:"flex",flexDirection:"column",onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),ref:m},S.createElement(U,{as:e,borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:t?void 0:[BF,Wt({active:"shrink"})],disabled:t,onClick:c,padding:"5",style:{willChange:"transform"},testId:d,transition:"default",width:"full",...t?{background:"accentColor",borderColor:"selectedOptionBorder",boxShadow:"selectedWallet"}:{background:{hover:"menuItemBackground"}},...h},S.createElement(U,{color:t?"accentColorForeground":"modalText",disabled:!l,fontFamily:"body",fontSize:"16",fontWeight:"bold",transition:"default"},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",gap:"12"},S.createElement(un,{background:n,...!g&&p?{borderColor:"actionButtonBorder"}:{},useAsImage:!p,borderRadius:"6",height:"28",src:r,width:"28"}),S.createElement(U,null,S.createElement(U,{style:{marginTop:u?-2:void 0},maxWidth:"200"},a),u&&S.createElement(ze,{color:t?"accentColorForeground":"accentColor",size:"12",style:{lineHeight:1,marginTop:-1},weight:"medium"},b.t("connect.recent")))))))};pj.displayName="ModalSelection";var D1=(e,t=1)=>{let n=e.replace("#","");n.length===3&&(n=`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);const r=Number.parseInt(n.substring(0,2),16),a=Number.parseInt(n.substring(2,4),16),c=Number.parseInt(n.substring(4,6),16),l=t>1&&t<=100?t/100:t;return`rgba(${r},${a},${c},${l})`},TF=e=>e?[D1(e,.2),D1(e,.14),D1(e,.1)]:null,PF=e=>/^#([0-9a-f]{3}){1,2}$/i.test(e),mj=async()=>(await je(async()=>{const{default:e}=await import("./connect-UA7M4XW6-IY3X6Bmr.js");return{default:e}},[])).default,RF=()=>Ms(mj),LF=()=>S.createElement(un,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:mj,width:"48"}),gj=async()=>(await je(async()=>{const{default:e}=await import("./create-FASO7PVG-D_rvSpre.js");return{default:e}},[])).default,yj=()=>Ms(gj),DF=()=>S.createElement(un,{background:"#e3a5e8",borderColor:"generalBorder",borderRadius:"10",height:"48",src:gj,width:"48"}),vj=async()=>(await je(async()=>{const{default:e}=await import("./refresh-S4T5V5GX-CwqIaaxK.js");return{default:e}},[])).default,OF=()=>Ms(vj),FF=()=>S.createElement(un,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:vj,width:"48"}),bj=async()=>(await je(async()=>{const{default:e}=await import("./scan-4UYSQ56Q-CjMz6-XC.js");return{default:e}},[])).default,wj=()=>Ms(bj),zF=()=>S.createElement(un,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:bj,width:"48"}),$F="_1vwt0cg0",HF="_1vwt0cg2 ju367v7a ju367v7v",UF="_1vwt0cg3",WF="_1vwt0cg4";function _j({ecc:e="medium",logoBackground:t,logoSize:n=50,logoUrl:r,size:a=200,uri:c}){const u=a-Number.parseInt("20",10)*2,d=$p(r);return S.createElement(U,{borderColor:"generalBorder",borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:$F,padding:"20",width:"max"},S.createElement(U,{style:{height:u,userSelect:"none",width:u},userSelect:"none"},S.createElement(ks.Root,{errorCorrection:e,size:u,value:c},S.createElement(ks.Cells,{className:void 0,fill:"currentColor",filter:void 0,radius:1}),S.createElement(ks.Finder,{className:void 0,fill:"currentColor",radius:.25,stroke:void 0}),d&&S.createElement(ks.Arena,null,S.createElement("img",{alt:"Wallet Logo",src:d,style:{backgroundColor:t,borderRadius:"22.5%",height:"88%",objectFit:"cover",width:"88%"}})))))}var xj=async()=>{switch(zv()){case"Arc":return(await je(async()=>{const{default:t}=await import("./Arc-VDBY7LNS-BChRXCXW.js");return{default:t}},[])).default;case"Brave":return(await je(async()=>{const{default:t}=await import("./Brave-BRAKJXDS-mq-Xo37j.js");return{default:t}},[])).default;case"Chrome":return(await je(async()=>{const{default:t}=await import("./Chrome-65Q5P54Y-DR9MQEVr.js");return{default:t}},[])).default;case"Edge":return(await je(async()=>{const{default:t}=await import("./Edge-XSPUTORV-DEoZslQE.js");return{default:t}},[])).default;case"Firefox":return(await je(async()=>{const{default:t}=await import("./Firefox-AAHGJQIP-Bp_Hm04m.js");return{default:t}},[])).default;case"Opera":return(await je(async()=>{const{default:t}=await import("./Opera-KQZLSACL-Cwv5MDFy.js");return{default:t}},[])).default;case"Safari":return(await je(async()=>{const{default:t}=await import("./Safari-ZPL37GXR-C4Ggg6rz.js");return{default:t}},[])).default;default:return(await je(async()=>{const{default:t}=await import("./Browser-76IHF3Y2-BMhRaC5Z.js");return{default:t}},[])).default}},VF=()=>Ms(xj),Cj=async()=>{switch(Hv()){case"Windows":return(await je(async()=>{const{default:t}=await import("./Windows-PPTHQER6-BlyV2p7Y.js");return{default:t}},[])).default;case"macOS":return(await je(async()=>{const{default:t}=await import("./Macos-MW4AE7LN-Vvm8Drw3.js");return{default:t}},[])).default;case"Linux":return(await je(async()=>{const{default:t}=await import("./Linux-OO4TNCLJ-B0aw93n9.js");return{default:t}},[])).default;default:return(await je(async()=>{const{default:t}=await import("./Linux-OO4TNCLJ-B0aw93n9.js");return{default:t}},[])).default}},GF=()=>Ms(Cj);function qF({getWalletDownload:e,compactModeEnabled:t}){const r=cd().filter(c=>c.isRainbowKitConnector).splice(0,5),{i18n:a}=I.useContext(qt);return S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginTop:"18",width:"full"},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"28",height:"full",width:"full"},r==null?void 0:r.filter(c=>{var l;return c.extensionDownloadUrl||c.desktopDownloadUrl||c.qrCode&&((l=c.downloadUrls)==null?void 0:l.qrCode)}).map(c=>{const{downloadUrls:l,iconBackground:u,iconUrl:d,id:p,name:h,qrCode:m}=c,g=(l==null?void 0:l.qrCode)&&m,v=!!c.extensionDownloadUrl,b=(l==null?void 0:l.qrCode)&&v,_=(l==null?void 0:l.qrCode)&&!!c.desktopDownloadUrl;return S.createElement(U,{alignItems:"center",display:"flex",gap:"16",justifyContent:"space-between",key:c.id,width:"full"},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},S.createElement(un,{background:u,borderColor:"actionButtonBorder",borderRadius:"10",height:"48",src:d,width:"48"}),S.createElement(U,{display:"flex",flexDirection:"column",gap:"2"},S.createElement(ze,{color:"modalText",size:"14",weight:"bold"},h),S.createElement(ze,{color:"modalTextSecondary",size:"14",weight:"medium"},b?a.t("get.mobile_and_extension.description"):_?a.t("get.mobile_and_desktop.description"):g?a.t("get.mobile.description"):v?a.t("get.extension.description"):null))),S.createElement(U,{display:"flex",flexDirection:"column",gap:"4"},S.createElement(On,{label:a.t("get.action.label"),onClick:()=>e(p),type:"secondary"})))})),S.createElement(U,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"column",gap:"8",justifyContent:"space-between",marginBottom:"4",paddingY:"8",style:{maxWidth:275,textAlign:"center"}},S.createElement(ze,{color:"modalText",size:"14",weight:"bold"},a.t("get.looking_for.title")),S.createElement(ze,{color:"modalTextSecondary",size:"14",weight:"medium"},t?a.t("get.looking_for.desktop.compact_description"):a.t("get.looking_for.desktop.wide_description"))))}var O1="44";function KF({changeWalletStep:e,compactModeEnabled:t,connectionError:n,onClose:r,qrCodeUri:a,reconnect:c,wallet:l}){const{downloadUrls:u,iconBackground:d,iconUrl:p,name:h,qrCode:m,ready:g,showWalletConnectModal:v,getDesktopUri:b}=l,_=!!b,x=Fv(),{i18n:j}=I.useContext(qt),A=!!l.extensionDownloadUrl,k=(u==null?void 0:u.qrCode)&&A,N=(u==null?void 0:u.qrCode)&&!!l.desktopDownloadUrl,E=m&&a,B=async()=>{const z=await(b==null?void 0:b());window.open(z,x?"_blank":"_self")},M=v?{description:t?j.t("connect.walletconnect.description.compact"):j.t("connect.walletconnect.description.full"),label:j.t("connect.walletconnect.open.label"),onClick:()=>{r(),v()}}:E?{description:j.t("connect.secondary_action.get.description",{wallet:h}),label:j.t("connect.secondary_action.get.label"),onClick:()=>e(k||N?"DOWNLOAD_OPTIONS":"DOWNLOAD")}:null,{width:P}=J4(),R=P&&P<768;return I.useEffect(()=>{VF(),GF()},[]),S.createElement(U,{display:"flex",flexDirection:"column",height:"full",width:"full"},E?S.createElement(U,{alignItems:"center",display:"flex",height:"full",justifyContent:"center"},S.createElement(_j,{logoBackground:d,logoSize:t?60:72,logoUrl:p,size:t?318:R?Math.max(280,Math.min(P-308,382)):382,uri:a})):S.createElement(U,{alignItems:"center",display:"flex",justifyContent:"center",style:{flexGrow:1}},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8"},S.createElement(U,{borderRadius:"10",height:O1,overflow:"hidden"},S.createElement(un,{useAsImage:!l.isRainbowKitConnector,height:O1,src:p,width:O1})),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"4",paddingX:"32",style:{textAlign:"center"}},S.createElement(ze,{color:"modalText",size:"18",weight:"bold"},g?j.t("connect.status.opening",{wallet:h}):A?j.t("connect.status.not_installed",{wallet:h}):j.t("connect.status.not_available",{wallet:h})),!g&&A?S.createElement(U,{paddingTop:"20"},S.createElement(On,{href:l.extensionDownloadUrl,label:j.t("connect.secondary_action.install.label"),type:"secondary"})):null,g&&!E&&S.createElement(S.Fragment,null,S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},S.createElement(ze,{color:"modalTextSecondary",size:"14",textAlign:"center",weight:"medium"},j.t("connect.status.confirm"))),S.createElement(U,{alignItems:"center",color:"modalText",display:"flex",flexDirection:"row",height:"32",marginTop:"8"},n?S.createElement(On,{label:j.t("connect.secondary_action.retry.label"),onClick:async()=>{_&&B(),c(l)}}):S.createElement(U,{color:"modalTextSecondary"},S.createElement(id,null))))))),S.createElement(U,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"28",justifyContent:"space-between",marginTop:"12"},g&&M&&S.createElement(S.Fragment,null,S.createElement(ze,{color:"modalTextSecondary",size:"14",weight:"medium"},M.description),S.createElement(On,{label:M.label,onClick:M.onClick,type:"secondary"}))))}var F1=({actionLabel:e,description:t,iconAccent:n,iconBackground:r,iconUrl:a,isCompact:c,onAction:l,title:u,url:d,variant:p})=>{const h=p==="browser",m=!h&&n&&TF(n);return S.createElement(U,{alignItems:"center",borderRadius:"13",display:"flex",justifyContent:"center",overflow:"hidden",paddingX:c?"18":"44",position:"relative",style:{flex:1,isolation:"isolate"},width:"full"},S.createElement(U,{borderColor:"actionButtonBorder",borderRadius:"13",borderStyle:"solid",borderWidth:"1",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1}}),h&&S.createElement(U,{background:"downloadTopCardBackground",height:"full",position:"absolute",style:{zIndex:0},width:"full"},S.createElement(U,{display:"flex",flexDirection:"row",justifyContent:"space-between",style:{bottom:"0",filter:"blur(20px)",left:"0",position:"absolute",right:"0",top:"0",transform:"translate3d(0, 0, 0)"}},S.createElement(U,{style:{filter:"blur(100px)",marginLeft:-27,marginTop:-20,opacity:.6,transform:"translate3d(0, 0, 0)"}},S.createElement(un,{borderRadius:"full",height:"200",src:a,width:"200"})),S.createElement(U,{style:{filter:"blur(100px)",marginRight:0,marginTop:105,opacity:.6,overflow:"auto",transform:"translate3d(0, 0, 0)"}},S.createElement(un,{borderRadius:"full",height:"200",src:a,width:"200"})))),!h&&m&&S.createElement(U,{background:"downloadBottomCardBackground",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0"}},S.createElement(U,{position:"absolute",style:{background:`radial-gradient(50% 50% at 50% 50%, ${m[0]} 0%, ${m[1]} 25%, rgba(0,0,0,0) 100%)`,height:564,left:-215,top:-197,transform:"translate3d(0, 0, 0)",width:564}}),S.createElement(U,{position:"absolute",style:{background:`radial-gradient(50% 50% at 50% 50%, ${m[2]} 0%, rgba(0, 0, 0, 0) 100%)`,height:564,left:-1,top:-76,transform:"translate3d(0, 0, 0)",width:564}})),S.createElement(U,{alignItems:"flex-start",display:"flex",flexDirection:"row",gap:"24",height:"max",justifyContent:"center",style:{zIndex:1}},S.createElement(U,null,S.createElement(un,{height:"60",src:a,width:"60",...r?{background:r,borderColor:"generalBorder",borderRadius:"10"}:null})),S.createElement(U,{display:"flex",flexDirection:"column",gap:"4",style:{flex:1},width:"full"},S.createElement(ze,{color:"modalText",size:"14",weight:"bold"},u),S.createElement(ze,{color:"modalTextSecondary",size:"14",weight:"medium"},t),S.createElement(U,{marginTop:"14",width:"max"},S.createElement(On,{href:d,label:e,onClick:l,size:"medium"})))))};function QF({changeWalletStep:e,wallet:t}){const n=zv(),r=Hv(),c=I.useContext(Hp)==="compact",{desktop:l,desktopDownloadUrl:u,extension:d,extensionDownloadUrl:p,mobileDownloadUrl:h}=t,{i18n:m}=I.useContext(qt);return I.useEffect(()=>{yj(),wj(),OF(),RF()},[]),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",marginBottom:"8",marginTop:"4",width:"full"},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8",height:"full",justifyContent:"center",width:"full"},p&&S.createElement(F1,{actionLabel:m.t("get_options.extension.download.label",{browser:n}),description:m.t("get_options.extension.description"),iconUrl:xj,isCompact:c,onAction:()=>e(d!=null&&d.instructions?"INSTRUCTIONS_EXTENSION":"CONNECT"),title:m.t("get_options.extension.title",{wallet:t.name,browser:n}),url:p,variant:"browser"}),u&&S.createElement(F1,{actionLabel:m.t("get_options.desktop.download.label",{platform:r}),description:m.t("get_options.desktop.description"),iconUrl:Cj,isCompact:c,onAction:()=>e(l!=null&&l.instructions?"INSTRUCTIONS_DESKTOP":"CONNECT"),title:m.t("get_options.desktop.title",{wallet:t.name,platform:r}),url:u,variant:"desktop"}),h&&S.createElement(F1,{actionLabel:m.t("get_options.mobile.download.label",{wallet:t.name}),description:m.t("get_options.mobile.description"),iconAccent:t.iconAccent,iconBackground:t.iconBackground,iconUrl:t.iconUrl,isCompact:c,onAction:()=>{e("DOWNLOAD")},title:m.t("get_options.mobile.title",{wallet:t.name}),variant:"app"})))}function YF({changeWalletStep:e,wallet:t}){const{downloadUrls:n,qrCode:r}=t,{i18n:a}=I.useContext(qt);return I.useEffect(()=>{yj(),wj()},[]),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",width:"full"},S.createElement(U,{style:{maxWidth:220,textAlign:"center"}},S.createElement(ze,{color:"modalTextSecondary",size:"14",weight:"semibold"},a.t("get_mobile.description"))),S.createElement(U,{height:"full"},n!=null&&n.qrCode?S.createElement(_j,{logoSize:0,size:268,uri:n.qrCode}):null),S.createElement(U,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"34",justifyContent:"space-between",marginBottom:"12",paddingY:"8"},S.createElement(On,{label:a.t("get_mobile.continue.label"),onClick:()=>e(r!=null&&r.instructions?"INSTRUCTIONS_MOBILE":"CONNECT")})))}var ua={connect:()=>S.createElement(LF,null),create:()=>S.createElement(DF,null),install:e=>S.createElement(un,{background:e.iconBackground,borderColor:"generalBorder",borderRadius:"10",height:"48",src:e.iconUrl,width:"48"}),refresh:()=>S.createElement(FF,null),scan:()=>S.createElement(zF,null)};function JF({connectWallet:e,wallet:t}){var r,a,c,l;const{i18n:n}=I.useContext(qt);return S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},S.createElement(U,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(a=(r=t==null?void 0:t.qrCode)==null?void 0:r.instructions)==null?void 0:a.steps.map(u=>{var d;return S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:u.title},S.createElement(U,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(d=ua[u.step])==null?void 0:d.call(ua,t)),S.createElement(U,{display:"flex",flexDirection:"column",gap:"4"},S.createElement(ze,{color:"modalText",size:"14",weight:"bold"},n.t(u.title,void 0,{rawKeyIfTranslationMissing:!0})),S.createElement(ze,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(u.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},S.createElement(On,{label:n.t("get_instructions.mobile.connect.label"),onClick:()=>e(t)}),S.createElement(U,{as:"a",className:Wt({active:"shrink",hover:"grow"}),display:"block",href:(l=(c=t==null?void 0:t.qrCode)==null?void 0:c.instructions)==null?void 0:l.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},S.createElement(ze,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.mobile.learn_more.label")))))}function XF({wallet:e}){var n,r,a,c;const{i18n:t}=I.useContext(qt);return S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},S.createElement(U,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(r=(n=e==null?void 0:e.extension)==null?void 0:n.instructions)==null?void 0:r.steps.map(l=>{var u;return S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:l.title},S.createElement(U,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(u=ua[l.step])==null?void 0:u.call(ua,e)),S.createElement(U,{display:"flex",flexDirection:"column",gap:"4"},S.createElement(ze,{color:"modalText",size:"14",weight:"bold"},t.t(l.title,void 0,{rawKeyIfTranslationMissing:!0})),S.createElement(ze,{color:"modalTextSecondary",size:"14",weight:"medium"},t.t(l.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},S.createElement(On,{label:t.t("get_instructions.extension.refresh.label"),onClick:window.location.reload.bind(window.location)}),S.createElement(U,{as:"a",className:Wt({active:"shrink",hover:"grow"}),display:"block",href:(c=(a=e==null?void 0:e.extension)==null?void 0:a.instructions)==null?void 0:c.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},S.createElement(ze,{color:"accentColor",size:"14",weight:"bold"},t.t("get_instructions.extension.learn_more.label")))))}function ZF({connectWallet:e,wallet:t}){var r,a,c,l;const{i18n:n}=I.useContext(qt);return S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},S.createElement(U,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(a=(r=t==null?void 0:t.desktop)==null?void 0:r.instructions)==null?void 0:a.steps.map(u=>{var d;return S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:u.title},S.createElement(U,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(d=ua[u.step])==null?void 0:d.call(ua,t)),S.createElement(U,{display:"flex",flexDirection:"column",gap:"4"},S.createElement(ze,{color:"modalText",size:"14",weight:"bold"},n.t(u.title,void 0,{rawKeyIfTranslationMissing:!0})),S.createElement(ze,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(u.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},S.createElement(On,{label:n.t("get_instructions.desktop.connect.label"),onClick:()=>e(t)}),S.createElement(U,{as:"a",className:Wt({active:"shrink",hover:"grow"}),display:"block",href:(l=(c=t==null?void 0:t.desktop)==null?void 0:c.instructions)==null?void 0:l.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},S.createElement(ze,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.desktop.learn_more.label")))))}function ez({onClose:e}){const t="rk_connect_title",[n,r]=I.useState(),[a,c]=I.useState(),[l,u]=I.useState(),d=!!(a!=null&&a.qrCode)&&l,[p,h]=I.useState(!1),g=I.useContext(Hp)===Pd.COMPACT,{disclaimer:v}=I.useContext(Bd),{i18n:b}=I.useContext(qt),_=Fv(),x=I.useRef(!1),{connector:j}=I.useContext(Td),k=cd(!j).filter(Y=>Y.ready||!!Y.extensionDownloadUrl).sort((Y,ue)=>Y.groupIndex-ue.groupIndex),N=cd(),E=jF(k,Y=>Y.groupName),B=["Recommended","Other","Popular","More","Others","Installed"];I.useEffect(()=>{j&&!x.current&&(O("CONNECT"),z(j),x.current=!0)},[j]);const M=Y=>{var ue,xe;h(!1),Y.ready&&((xe=(ue=Y==null?void 0:Y.connect)==null?void 0:ue.call(Y))==null||xe.catch(()=>{h(!0)}))},P=async Y=>{const ue=k.find(xe=>Y.id===xe.id);ue!=null&&ue.getDesktopUri&&setTimeout(async()=>{var Re;const xe=await((Re=ue==null?void 0:ue.getDesktopUri)==null?void 0:Re.call(ue));xe&&window.open(xe,_?"_blank":"_self")},0)},R=async Y=>{var Re;const ue=k.find(Ae=>Y.id===Ae.id),xe=await((Re=ue==null?void 0:ue.getQrCodeUri)==null?void 0:Re.call(ue));u(xe),setTimeout(()=>{c(ue),O("CONNECT")},xe?0:50)},z=async Y=>{AF(Y.id),Y.ready&&(R(Y),P(Y)),M(Y),r(Y.id),Y.ready||(c(Y),O(Y!=null&&Y.extensionDownloadUrl?"DOWNLOAD_OPTIONS":"CONNECT"))},q=Y=>{var qe;const ue=N.find(Xe=>Y===Xe.id),xe=(qe=ue==null?void 0:ue.downloadUrls)==null?void 0:qe.qrCode,Re=!!(ue!=null&&ue.desktopDownloadUrl),Ae=!!(ue!=null&&ue.extensionDownloadUrl);c(ue),O(xe&&(Ae||Re)?"DOWNLOAD_OPTIONS":xe?"DOWNLOAD":Re?"INSTRUCTIONS_DESKTOP":"INSTRUCTIONS_EXTENSION")},Q=()=>{r(void 0),c(void 0),u(void 0)},O=(Y,ue=!1)=>{ue&&Y==="GET"&&K==="GET"?Q():!ue&&Y==="GET"?$("GET"):!ue&&Y==="CONNECT"&&$("CONNECT"),se(Y)},[K,$]=I.useState("NONE"),[L,se]=I.useState("NONE");let D=null,X=null,te=null,W;I.useEffect(()=>{h(!1)},[L,a]);const be=!!(!!(a!=null&&a.extensionDownloadUrl)&&(a!=null&&a.mobileDownloadUrl));switch(L){case"NONE":D=S.createElement(y6,{getWallet:()=>O("GET")});break;case"LEARN_COMPACT":D=S.createElement(y6,{compactModeEnabled:g,getWallet:()=>O("GET")}),X=b.t("intro.title"),te="NONE";break;case"GET":D=S.createElement(qF,{getWalletDownload:q,compactModeEnabled:g}),X=b.t("get.title"),te=g?"LEARN_COMPACT":"NONE";break;case"CONNECT":D=a&&S.createElement(KF,{changeWalletStep:O,compactModeEnabled:g,connectionError:p,onClose:e,qrCodeUri:l,reconnect:M,wallet:a}),X=d&&(a.name==="WalletConnect"?b.t("connect_scan.fallback_title"):b.t("connect_scan.title",{wallet:a.name})),te=g?j?null:"NONE":null,W=g?j?()=>{}:Q:()=>{};break;case"DOWNLOAD_OPTIONS":D=a&&S.createElement(QF,{changeWalletStep:O,wallet:a}),X=a&&b.t("get_options.short_title",{wallet:a.name}),te=j?"CONNECT":g?"NONE":K;break;case"DOWNLOAD":D=a&&S.createElement(YF,{changeWalletStep:O,wallet:a}),X=a&&b.t("get_mobile.title",{wallet:a.name}),te=be?"DOWNLOAD_OPTIONS":K;break;case"INSTRUCTIONS_MOBILE":D=a&&S.createElement(JF,{connectWallet:z,wallet:a}),X=a&&b.t("get_options.title",{wallet:g&&a.shortName||a.name}),te="DOWNLOAD";break;case"INSTRUCTIONS_EXTENSION":D=a&&S.createElement(XF,{wallet:a}),X=a&&b.t("get_options.title",{wallet:g&&a.shortName||a.name}),te="DOWNLOAD_OPTIONS";break;case"INSTRUCTIONS_DESKTOP":D=a&&S.createElement(ZF,{connectWallet:z,wallet:a}),X=a&&b.t("get_options.title",{wallet:g&&a.shortName||a.name}),te="DOWNLOAD_OPTIONS";break}return S.createElement(U,{display:"flex",flexDirection:"row",style:{maxHeight:g?468:504}},(g?L==="NONE":!0)&&S.createElement(U,{className:g?WF:UF,display:"flex",flexDirection:"column",marginTop:"16"},S.createElement(U,{display:"flex",justifyContent:"space-between"},g&&v&&S.createElement(U,{marginLeft:"16",width:"28"},S.createElement(NF,{onClick:()=>O("LEARN_COMPACT")})),g&&!v&&S.createElement(U,{marginLeft:"16",width:"28"}),S.createElement(U,{marginLeft:g?"0":"6",paddingBottom:"8",paddingTop:"2",paddingX:"18"},S.createElement(ze,{as:"h1",color:"modalText",id:t,size:"18",weight:"heavy",testId:"connect-header-label"},b.t("connect.title"))),g&&S.createElement(U,{marginRight:"16"},S.createElement(Ei,{onClose:e}))),S.createElement(U,{className:HF,paddingBottom:"18"},Object.entries(E).map(([Y,ue])=>ue.length>0&&S.createElement(I.Fragment,{key:Y},Y?S.createElement(U,{marginBottom:"8",marginTop:"16",marginX:"6"},S.createElement(ze,{color:Y==="Installed"?"accentColor":"modalTextSecondary",size:"14",weight:"bold"},B.includes(Y)?b.t(`connector_group.${Y.toLowerCase()}`):Y)):null,S.createElement(U,{display:"flex",flexDirection:"column",gap:"4"},ue.map(xe=>S.createElement(pj,{currentlySelected:xe.id===n,iconBackground:xe.iconBackground,iconUrl:xe.iconUrl,key:xe.id,name:xe.name,onClick:()=>z(xe),ready:xe.ready,recent:xe.recent,testId:`wallet-option-${xe.id}`,isRainbowKitConnector:xe.isRainbowKitConnector})))))),g&&S.createElement(S.Fragment,null,S.createElement(U,{background:"generalBorder",height:"1",marginTop:"-1"}),v?S.createElement(U,{paddingX:"24",paddingY:"16",textAlign:"center"},S.createElement(v,{Link:Wv,Text:Vv})):S.createElement(U,{alignItems:"center",display:"flex",justifyContent:"space-between",paddingX:"24",paddingY:"16"},S.createElement(U,{paddingY:"4"},S.createElement(ze,{color:"modalTextSecondary",size:"14",weight:"medium"},b.t("connect.new_to_ethereum.description"))),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",justifyContent:"center"},S.createElement(U,{className:Wt({active:"shrink",hover:"grow"}),cursor:"pointer",onClick:()=>O("LEARN_COMPACT"),paddingY:"4",style:{willChange:"transform"},transition:"default"},S.createElement(ze,{color:"accentColor",size:"14",weight:"bold"},b.t("connect.new_to_ethereum.learn_more.label"))))))),(g?L!=="NONE":!0)&&S.createElement(S.Fragment,null,!g&&S.createElement(U,{background:"generalBorder",minWidth:"1",width:"1"}),S.createElement(U,{display:"flex",flexDirection:"column",margin:"16",style:{flexGrow:1}},S.createElement(U,{alignItems:"center",display:"flex",justifyContent:"space-between",marginBottom:"12"},S.createElement(U,{width:"28"},te&&S.createElement(U,{as:"button",className:Wt({active:"shrinkSm",hover:"growLg"}),color:"accentColor",onClick:()=>{te&&O(te,!0),W==null||W()},paddingX:"8",paddingY:"4",style:{boxSizing:"content-box",height:17,willChange:"transform"},transition:"default",type:"button"},S.createElement(fj,null))),S.createElement(U,{display:"flex",justifyContent:"center",style:{flexGrow:1}},X&&S.createElement(ze,{color:"modalText",size:"18",textAlign:"center",weight:"heavy"},X)),S.createElement(Ei,{onClose:e})),S.createElement(U,{display:"flex",flexDirection:"column",style:{minHeight:g?396:432}},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"6",height:"full",justifyContent:"center",marginX:"8"},D)))))}var tz="_1am14412",nz="_1am14410",rz="_1am14413",sz=({wallet:e})=>S.createElement("svg",{className:rz,viewBox:"0 0 86 86",width:"86",height:"86"},S.createElement("title",null,"Loading"),S.createElement("rect",{x:"3",y:"3",width:80,height:80,rx:20,ry:20,strokeDasharray:`${160/3} ${320/3}`,strokeDashoffset:160,className:tz,style:{stroke:(e==null?void 0:e.iconAccent)||"#0D3887"}}));function kj({onClose:e,wallet:t,connecting:n}){const{connect:r,iconBackground:a,iconUrl:c,id:l,name:u,getMobileUri:d,ready:p,shortName:h,showWalletConnectModal:m}=t,g=hj(c),v=I.useRef(!1),{i18n:b}=I.useContext(qt),_=I.useCallback(async()=>{if(l!=="walletConnect"&&(async()=>{const j=await(d==null?void 0:d());if(j)if(j&&WO({mobileUri:j,name:u}),j.startsWith("http")){const A=document.createElement("a");A.href=j,A.target="_blank",A.rel="noreferrer noopener",A.click()}else window.location.href=j})(),m){m(),e==null||e();return}try{await(r==null?void 0:r())}catch{}},[r,d,m,e,u,l]);return I.useEffect(()=>{n&&!v.current&&(_(),v.current=!0)},[n,_]),S.createElement(U,{as:"button",color:p?"modalText":"modalTextSecondary",disabled:!p,fontFamily:"body",key:l,onClick:_,ref:g,style:{overflow:"visible",textAlign:"center"},testId:`wallet-option-${l}`,type:"button",width:"full"},S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},S.createElement(U,{display:"flex",alignItems:"center",justifyContent:"center",paddingBottom:"8",paddingTop:"10",position:"relative"},n?S.createElement(sz,{wallet:t}):null,S.createElement(un,{background:a,borderRadius:"13",boxShadow:"walletLogo",height:"60",src:c,width:"60"})),n?null:S.createElement(U,{display:"flex",flexDirection:"column",textAlign:"center"},S.createElement(ze,{as:"h2",color:t.ready?"modalText":"modalTextSecondary",size:"13",weight:"medium"},S.createElement(U,{as:"span",position:"relative"},h??u,!t.ready&&" (unsupported)")),t.recent&&S.createElement(ze,{color:"accentColor",size:"12",weight:"medium"},b.t("connect.recent")))))}function az({onClose:e}){var v;const t="rk_connect_title",n=cd().filter(b=>b.isRainbowKitConnector),{disclaimer:r,learnMoreUrl:a}=I.useContext(Bd);let c=null,l=null,u=!1,d=null;const[p,h]=I.useState("CONNECT"),{i18n:m}=I.useContext(qt),g=Id();switch(p){case"CONNECT":{c=m.t("connect.title"),u=!0,l=S.createElement(U,null,S.createElement(U,{background:"profileForeground",className:nz,display:"flex",paddingBottom:"20",paddingTop:"6",paddingX:"20",style:{gap:"calc((100% - 40px - 240px + 47px) / 4)"}},n.filter(b=>b.ready).map(b=>S.createElement(U,{key:b.id,width:"60"},S.createElement(kj,{onClose:e,wallet:b})))),S.createElement(U,{background:"generalBorder",height:"1",marginBottom:"32",marginTop:"-1"}),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"32",paddingX:"32",style:{textAlign:"center"}},S.createElement(U,{display:"flex",flexDirection:"column",gap:"8",textAlign:"center"},S.createElement(ze,{color:"modalText",size:"16",weight:"bold"},m.t("intro.title")),S.createElement(ze,{color:"modalTextSecondary",size:"16"},m.t("intro.description")))),S.createElement(U,{paddingTop:"32",paddingX:"20"},S.createElement(U,{display:"flex",gap:"14",justifyContent:"center"},S.createElement(On,{label:m.t("intro.get.label"),onClick:()=>h("GET"),size:"large",type:"secondary"}),S.createElement(On,{href:a,label:m.t("intro.learn_more.label"),size:"large",type:"secondary"}))),r&&S.createElement(U,{marginTop:"28",marginX:"32",textAlign:"center"},S.createElement(r,{Link:Wv,Text:Vv})));break}case"GET":{c=m.t("get.title"),d="CONNECT";const b=(v=n==null?void 0:n.filter(_=>{var x,j,A;return((x=_.downloadUrls)==null?void 0:x.ios)||((j=_.downloadUrls)==null?void 0:j.android)||((A=_.downloadUrls)==null?void 0:A.mobile)}))==null?void 0:v.splice(0,3);l=S.createElement(U,null,S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginBottom:"36",marginTop:"5",paddingTop:"12",width:"full"},b.map((_,x)=>{const{downloadUrls:j,iconBackground:A,iconUrl:k,name:N}=_;return!(j!=null&&j.ios)&&!(j!=null&&j.android)&&!(j!=null&&j.mobile)?null:S.createElement(U,{display:"flex",gap:"16",key:_.id,paddingX:"20",width:"full"},S.createElement(U,{style:{minHeight:48,minWidth:48}},S.createElement(un,{background:A,borderColor:"generalBorder",borderRadius:"10",height:"48",src:k,width:"48"})),S.createElement(U,{display:"flex",flexDirection:"column",width:"full"},S.createElement(U,{alignItems:"center",display:"flex",height:"48"},S.createElement(U,{width:"full"},S.createElement(ze,{color:"modalText",size:"18",weight:"bold"},N)),S.createElement(On,{href:(g?j==null?void 0:j.ios:j==null?void 0:j.android)||(j==null?void 0:j.mobile),label:m.t("get.action.label"),size:"small",type:"secondary"})),x<b.length-1&&S.createElement(U,{background:"generalBorderDim",height:"1",marginY:"10",width:"full"})))})),S.createElement(U,{style:{marginBottom:"42px"}}),S.createElement(U,{alignItems:"center",display:"flex",flexDirection:"column",gap:"36",paddingX:"36",style:{textAlign:"center"}},S.createElement(U,{display:"flex",flexDirection:"column",gap:"12",textAlign:"center"},S.createElement(ze,{color:"modalText",size:"16",weight:"bold"},m.t("get.looking_for.title")),S.createElement(ze,{color:"modalTextSecondary",size:"16"},m.t("get.looking_for.mobile.description")))));break}}return S.createElement(U,{display:"flex",flexDirection:"column",paddingBottom:"36"},S.createElement(U,{background:u?"profileForeground":"modalBackground",display:"flex",flexDirection:"column",paddingBottom:"4",paddingTop:"14"},S.createElement(U,{display:"flex",justifyContent:"center",paddingBottom:"6",paddingX:"20",position:"relative"},d&&S.createElement(U,{display:"flex",position:"absolute",style:{left:0,marginBottom:-20,marginTop:-20}},S.createElement(U,{alignItems:"center",as:"button",className:Wt({active:"shrinkSm",hover:"growLg"}),color:"accentColor",display:"flex",marginLeft:"4",marginTop:"20",onClick:()=>h(d),padding:"16",style:{height:17,willChange:"transform"},transition:"default",type:"button"},S.createElement(fj,null))),S.createElement(U,{marginTop:"4",textAlign:"center",width:"full"},S.createElement(ze,{as:"h1",color:"modalText",id:t,size:"20",weight:"bold"},c)),S.createElement(U,{alignItems:"center",display:"flex",height:"32",paddingRight:"14",position:"absolute",right:"0"},S.createElement(U,{style:{marginBottom:-20,marginTop:-20}},S.createElement(Ei,{onClose:e}))))),S.createElement(U,{display:"flex",flexDirection:"column"},l))}var oz=({onClose:e})=>{const{connector:t}=I.useContext(Td),{i18n:n}=I.useContext(qt),r=(t==null?void 0:t.name)||"";return S.createElement(U,null,S.createElement(U,{display:"flex",paddingBottom:"32",justifyContent:"center",alignItems:"center",background:"profileForeground",flexDirection:"column"},S.createElement(U,{width:"full",display:"flex",justifyContent:"flex-end",marginTop:"18",marginRight:"24"},S.createElement(Ei,{onClose:e})),S.createElement(U,{width:"60"},S.createElement(kj,{onClose:e,wallet:t,connecting:!0})),S.createElement(U,{marginTop:"20"},S.createElement(ze,{textAlign:"center",color:"modalText",size:"18",weight:"semibold"},n.t("connect.status.connect_mobile",{wallet:r}))),S.createElement(U,{maxWidth:"full",marginTop:"8"},S.createElement(ze,{textAlign:"center",color:"modalText",size:"16",weight:"medium"},n.t("connect.status.confirm_mobile",{wallet:r})))))};function iz({onClose:e}){const{connector:t}=I.useContext(Td);return Gt()?t?S.createElement(oz,{onClose:e}):S.createElement(az,{onClose:e}):S.createElement(ez,{onClose:e})}function cz({onClose:e,open:t}){const n="rk_connect_title",r=Rv(),{disconnect:a}=Ri(),{isConnecting:c}=dt(),l=S.useCallback(()=>{e(),a()},[e,a]),u=S.useCallback(()=>{c&&a(),e()},[e,a,c]);return r==="disconnected"?S.createElement(Zh,{onClose:u,open:t,titleId:n},S.createElement(ep,{bottomSheetOnMobile:!0,padding:"0",wide:!0},S.createElement(iz,{onClose:u}))):r==="unauthenticated"?S.createElement(Zh,{onClose:l,open:t,titleId:n},S.createElement(ep,{bottomSheetOnMobile:!0,padding:"0"},S.createElement(HO,{onClose:l,onCloseModal:e}))):null}function z1(){const[e,t]=I.useState(!1);return{closeModal:I.useCallback(()=>t(!1),[]),isModalOpen:e,openModal:I.useCallback(()=>t(!0),[])}}var yl=I.createContext({accountModalOpen:!1,chainModalOpen:!1,connectModalOpen:!1,isWalletConnectModalOpen:!1,setIsWalletConnectModalOpen:()=>{}});function lz({children:e}){const{closeModal:t,isModalOpen:n,openModal:r}=z1(),{closeModal:a,isModalOpen:c,openModal:l}=z1(),{closeModal:u,isModalOpen:d,openModal:p}=z1(),[h,m]=I.useState(!1),g=Rv(),{chainId:v}=dt(),{chains:b}=Lt(),_=b.some(A=>A.id===v),x=I.useCallback(({keepConnectModalOpen:A=!1}={})=>{A||t(),a(),u()},[t,a,u]),j=zp()==="unauthenticated";return Nk({onConnect:()=>x({keepConnectModalOpen:j}),onDisconnect:()=>x()}),I.useEffect(()=>{j&&x()},[j,x]),S.createElement(yl.Provider,{value:I.useMemo(()=>({accountModalOpen:c,chainModalOpen:d,connectModalOpen:n,isWalletConnectModalOpen:h,openAccountModal:_&&g==="connected"?l:void 0,openChainModal:g==="connected"?p:void 0,openConnectModal:g==="disconnected"||g==="unauthenticated"?r:void 0,setIsWalletConnectModalOpen:m}),[g,c,d,n,l,p,r,_,h])},e,S.createElement(cz,{onClose:t,open:n}),S.createElement(yF,{onClose:a,open:c}),S.createElement(kF,{onClose:u,open:d}))}function uz(){const{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}=I.useContext(yl);return{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}}function dz(){const{accountModalOpen:e,openAccountModal:t}=I.useContext(yl);return{accountModalOpen:e,openAccountModal:t}}function fz(){const{chainModalOpen:e,openChainModal:t}=I.useContext(yl);return{chainModalOpen:e,openChainModal:t}}function jj(){const{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}=I.useContext(yl);return{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}}function Oi(){const{connectModalOpen:e,openConnectModal:t}=I.useContext(yl),{isWalletConnectModalOpen:n}=jj();return{connectModalOpen:e||n,openConnectModal:t}}var $1=()=>{};function Gv({children:e}){const t=GD(),{address:n}=dt(),{chainId:r}=dt(),{chains:a}=Lt(),c=a.some(Q=>Q.id===r),l=WD(),u=zp()??void 0,d=r?l[r]:void 0,p=(d==null?void 0:d.name)??void 0,h=(d==null?void 0:d.iconUrl)??void 0,m=(d==null?void 0:d.iconBackground)??void 0,g=$p(h),v=I.useContext(Ov),b=K4().some(({status:Q})=>Q==="pending")&&v,{showBalance:_}=H4(),j=typeof _=="boolean"?_:_?B4(_)[Gt()?"smallScreen":"largeScreen"]:!0,{balance:A,ensAvatar:k,ensName:N}=W4({address:n,includeBalance:j}),E=A?`${ij(Number.parseFloat(A.formatted))} ${A.symbol}`:void 0,{openConnectModal:B}=Oi(),{openChainModal:M}=fz(),{openAccountModal:P}=dz(),{accountModalOpen:R,chainModalOpen:z,connectModalOpen:q}=uz();return S.createElement(S.Fragment,null,e({account:n?{address:n,balanceDecimals:A==null?void 0:A.decimals,balanceFormatted:A==null?void 0:A.formatted,balanceSymbol:A==null?void 0:A.symbol,displayBalance:E,displayName:N?lj(N):cj(n),ensAvatar:k??void 0,ensName:N??void 0,hasPendingTransactions:b}:void 0,accountModalOpen:R,authenticationStatus:u,chain:r?{hasIcon:!!h,iconBackground:m,iconUrl:g,id:r,name:p,unsupported:!c}:void 0,chainModalOpen:z,connectModalOpen:q,mounted:t(),openAccountModal:P??$1,openChainModal:M??$1,openConnectModal:B??$1}))}Gv.displayName="ConnectButton.Custom";var xu={accountStatus:"full",chainStatus:{largeScreen:"full",smallScreen:"icon"},label:"Connect Wallet",showBalance:{largeScreen:!0,smallScreen:!1}};function qv({accountStatus:e=xu.accountStatus,chainStatus:t=xu.chainStatus,label:n=xu.label,showBalance:r=xu.showBalance}){const a=Di(),c=Rv(),{setShowBalance:l}=H4(),[u,d]=I.useState(!1),{i18n:p}=I.useContext(qt);return I.useEffect(()=>{l(r),u||d(!0)},[r,l]),u?S.createElement(Gv,null,({account:h,chain:m,mounted:g,openAccountModal:v,openChainModal:b,openConnectModal:_})=>{const x=g&&c!=="loading",j=(m==null?void 0:m.unsupported)??!1;return S.createElement(U,{display:"flex",gap:"12",...!x&&{"aria-hidden":!0,style:{opacity:0,pointerEvents:"none",userSelect:"none"}}},x&&h&&c==="connected"?S.createElement(S.Fragment,null,m&&(a.length>1||j)&&S.createElement(U,{alignItems:"center","aria-label":"Chain Selector",as:"button",background:j?"connectButtonBackgroundError":"connectButtonBackground",borderRadius:"connectButton",boxShadow:"connectButton",className:Wt({active:"shrink",hover:"grow"}),color:j?"connectButtonTextError":"connectButtonText",display:vc(t,A=>A==="none"?"none":"flex"),fontFamily:"body",fontWeight:"bold",gap:"6",key:j?"unsupported":"supported",onClick:b,paddingX:"10",paddingY:"8",testId:j?"wrong-network-button":"chain-button",transition:"default",type:"button"},j?S.createElement(U,{alignItems:"center",display:"flex",height:"24",paddingX:"4"},p.t("connect_wallet.wrong_network.label")):S.createElement(U,{alignItems:"center",display:"flex",gap:"6"},m.hasIcon?S.createElement(U,{display:vc(t,A=>A==="full"||A==="icon"?"block":"none"),height:"24",width:"24"},S.createElement(un,{alt:m.name??"Chain icon",background:m.iconBackground,borderRadius:"full",height:"24",src:m.iconUrl,width:"24"})):null,S.createElement(U,{display:vc(t,A=>A==="icon"&&!m.iconUrl||A==="full"||A==="name"?"block":"none")},m.name??m.id)),S.createElement(V_,null)),!j&&S.createElement(U,{alignItems:"center",as:"button",background:"connectButtonBackground",borderRadius:"connectButton",boxShadow:"connectButton",className:Wt({active:"shrink",hover:"grow"}),color:"connectButtonText",display:"flex",fontFamily:"body",fontWeight:"bold",onClick:v,testId:"account-button",transition:"default",type:"button"},h.displayBalance&&S.createElement(U,{display:vc(r,A=>A?"block":"none"),padding:"8",paddingLeft:"12"},h.displayBalance),S.createElement(U,{background:B4(r)[Gt()?"smallScreen":"largeScreen"]?"connectButtonInnerBackground":"connectButtonBackground",borderColor:"connectButtonBackground",borderRadius:"connectButton",borderStyle:"solid",borderWidth:"2",color:"connectButtonText",fontFamily:"body",fontWeight:"bold",paddingX:"8",paddingY:"6",transition:"default"},S.createElement(U,{alignItems:"center",display:"flex",gap:"6",height:"24"},S.createElement(U,{display:vc(e,A=>A==="full"||A==="avatar"?"block":"none")},S.createElement(F4,{address:h.address,imageUrl:h.ensAvatar,loading:h.hasPendingTransactions,size:24})),S.createElement(U,{alignItems:"center",display:"flex",gap:"6"},S.createElement(U,{display:vc(e,A=>A==="full"||A==="address"?"block":"none")},h.displayName),S.createElement(V_,null)))))):S.createElement(U,{as:"button",background:"accentColor",borderRadius:"connectButton",boxShadow:"connectButton",className:Wt({active:"shrink",hover:"grow"}),color:"accentColorForeground",fontFamily:"body",fontWeight:"bold",height:"40",key:"connect",onClick:_,paddingX:"14",testId:"connect-button",transition:"default",type:"button"},g&&n==="Connect Wallet"?p.t("connect_wallet.label"):n))}):null}qv.__defaultProps=xu;qv.Custom=Gv;var Sj=({appName:e,appDescription:t,appUrl:n,appIcon:r})=>({name:e,description:t??e,url:n??(typeof window<"u"?window.location.origin:""),icons:[...r?[r]:[]]});function hz(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0))}function pz(e,t){const n=[];for(const r of e)n.some(a=>a[t]===r[t])||n.push(r);return n}var mz=(e,{projectId:t,walletConnectParameters:n,appName:r,appDescription:a,appUrl:c,appIcon:l})=>{if(!e.length)throw new Error("No wallet list was provided");for(const{wallets:v,groupName:b}of e)if(!v.length)throw new Error(`No wallets provided for group: ${b}`);let u=-1;const d=[],p=[],h=[],m=Sj({appName:r,appDescription:a,appUrl:c,appIcon:l});for(const[v,{groupName:b,wallets:_}]of e.entries())for(const x of _){u++;const j=x({projectId:t,appName:r,appIcon:l,options:{metadata:m,...n},walletConnectParameters:{metadata:m,...n}});if(j!=null&&j.iconAccent&&!PF(j==null?void 0:j.iconAccent))throw new Error(`Property \`iconAccent\` is not a hex value for wallet: ${j.name}`);const A={...j,groupIndex:v+1,groupName:b,index:u};typeof j.hidden=="function"?h.push(A):p.push(A)}const g=pz([...p,...h],"id");for(const{createConnector:v,groupIndex:b,groupName:_,hidden:x,...j}of g){if(typeof x=="function"&&x())continue;const A=E=>({rkDetails:hz({...j,groupIndex:b,groupName:_,isRainbowKitConnector:!0,...E||{}})});j.id==="walletConnect"&&d.push(v(A({isWalletConnectModalConnector:!0,showQrModal:!0})));const N=v(A());d.push(N)}return d},gz=typeof window>"u",b6=new Map,yz=({projectId:e,walletConnectParameters:t,rkDetailsShowQrModal:n,rkDetailsIsWalletConnectModalConnector:r})=>{if(gz)return vv({accounts:["0x0000000000000000000000000000000000000000"]});let a={telemetryEnabled:!1,...t||{},projectId:e,showQrModal:!1};n&&(a={...a,showQrModal:!0}),"customStoragePrefix"in a||(a={...a,customStoragePrefix:r?"clientOne":"clientTwo"});const c=JSON.stringify(a),l=b6.get(c);if(l)return l;const u=Pv(a);return b6.set(c,u),u};function vz({projectId:e,walletDetails:t,walletConnectParameters:n}){return r=>({...yz({projectId:e,walletConnectParameters:n,rkDetailsShowQrModal:t.rkDetails.showQrModal,rkDetailsIsWalletConnectModalConnector:t.rkDetails.isWalletConnectModalConnector})(r),...t})}function Kv({projectId:e,walletConnectParameters:t}){const n="21fef48091f12692cad574a6f7753643";if(!e||e==="")throw new Error("No projectId found. Every dApp must now provide a WalletConnect Cloud projectId to enable WalletConnect v2 https://www.rainbowkit.com/docs/installation#configure");return e==="YOUR_PROJECT_ID"&&(e=n),r=>vz({projectId:e,walletDetails:r,walletConnectParameters:t})}function Aj(e){const t=typeof window<"u"?window:void 0;if(typeof t>"u"||typeof t.ethereum>"u")return;const n=t.ethereum.providers;return n?n.find(r=>r[e]):t.ethereum[e]?t.ethereum:void 0}function Ej(e){const t=(n,r)=>{const[a,...c]=r.split("."),l=n[a];if(l)return c.length===0?l:t(l,c.join("."))};if(typeof window<"u")return t(window,e)}function bz({flag:e,namespace:t}){return!!(t&&typeof Ej(t)<"u"||typeof Aj(e)<"u")}function wz({flag:e,namespace:t}){var r;const n=typeof window<"u"?window:void 0;if(!(typeof n>"u")){if(t){const a=Ej(t);if(a)return a}(r=n.ethereum)==null||r.providers;{const a=Aj(e);if(a)return a}}}function _z(e){return t=>{const n=e?{target:()=>({id:t.rkDetails.id,name:t.rkDetails.name,provider:e})}:{};return r=>({...Ip(n)(r),...t})}}function xz({flag:e,namespace:t,target:n}){const r=n||wz({flag:e,namespace:t});return _z(r)}var Nj=({appName:e,appIcon:t})=>{const{preference:n,...r}=Nj;return{id:"base",aliases:["baseAccount"],name:"Base",shortName:"Base",rdns:"app.base.account",iconUrl:async()=>(await je(async()=>{const{default:a}=await import("./base-QS6CYWIN-CsjdbWCf.js");return{default:a}},[])).default,iconAccent:"#0000FF",iconBackground:"#0000FF",installed:!0,createConnector:a=>{const c=lD({appName:e,appLogoUrl:t,...r,preference:{telemetry:!1,...n||{}}});return l=>({...c(l),...a})}}};function Cz(e){return!(!(e!=null&&e.isMetaMask)||e.isBraveWallet&&!e._events&&!e._state||e.isApexWallet||e.isAvalanche||e.isBackpack||e.isBifrost||e.isBitKeep||e.isBitski||e.isBinance||e.isBlockWallet||e.isCoinbaseWallet||e.isDawn||e.isEnkrypt||e.isExodus||e.isFrame||e.isFrontier||e.isGamestop||e.isHyperPay||e.isImToken||e.isKuCoinWallet||e.isMathWallet||e.isNestWallet||e.isOkxWallet||e.isOKExWallet||e.isOneInchIOSWallet||e.isOneInchAndroidWallet||e.isOpera||e.isPhantom||e.isZilPay||e.isPortal||e.isxPortal||e.isRabby||e.isRainbow||e.isStatus||e.isTalisman||e.isTally||e.isTokenPocket||e.isTokenary||e.isTrust||e.isTrustWallet||e.isCTRL||e.isZeal||e.isCoin98||e.isMEWwallet||e.isSafeheron||e.isSafePal||e.isWigwam||e.isZerion||e.__seif)}var Mj=({projectId:e,walletConnectParameters:t})=>{const{...n}=Mj,r=typeof window<"u"?Cz(window.ethereum):!1,a=!r&&!Gt(),c=r||Gt();return{id:"metaMask",name:"MetaMask",rdns:"io.metamask",iconUrl:async()=>(await je(async()=>{const{default:l}=await import("./metaMaskWallet-EI6MED72-D5HFOsnz.js");return{default:l}},[])).default,iconAccent:"#f6851a",iconBackground:"#fff",installed:r||void 0,downloadUrls:{android:"https://play.google.com/store/apps/details?id=io.metamask",ios:"https://apps.apple.com/us/app/metamask/id1438144202",mobile:"https://metamask.io/download",qrCode:"https://metamask.io/download",chrome:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",edge:"https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",firefox:"https://addons.mozilla.org/firefox/addon/ether-metamask",opera:"https://addons.opera.com/extensions/details/metamask-10",browserExtension:"https://metamask.io/download"},mobile:{getUri:c?l=>l:void 0},qrCode:a?{getUri:l=>`https://metamask.app.link/wc?uri=${encodeURIComponent(l)}`,instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.qr_code.step1.description",step:"install",title:"wallet_connectors.metamask.qr_code.step1.title"},{description:"wallet_connectors.metamask.qr_code.step2.description",step:"create",title:"wallet_connectors.metamask.qr_code.step2.title"},{description:"wallet_connectors.metamask.qr_code.step3.description",step:"refresh",title:"wallet_connectors.metamask.qr_code.step3.title"}]}}:void 0,extension:{instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.extension.step1.description",step:"install",title:"wallet_connectors.metamask.extension.step1.title"},{description:"wallet_connectors.metamask.extension.step2.description",step:"create",title:"wallet_connectors.metamask.extension.step2.title"},{description:"wallet_connectors.metamask.extension.step3.description",step:"refresh",title:"wallet_connectors.metamask.extension.step3.title"}]}},createConnector:a?Kv({projectId:e,walletConnectParameters:t}):(l=>u=>{var p,h,m;const d=Bv({dappMetadata:{connector:"rainbowkit",name:(p=t==null?void 0:t.metadata)==null?void 0:p.name,iconUrl:(h=t==null?void 0:t.metadata)==null?void 0:h.icons[0],url:(m=t==null?void 0:t.metadata)==null?void 0:m.url},headless:!0,checkInstallationImmediately:!1,enableAnalytics:!1,...n})(u);return{...d,...l,getChainId:async()=>{var g;try{return await d.getChainId()}catch{return((g=u.chains[0])==null?void 0:g.id)??1}}}})}},kz=({projectId:e,walletConnectParameters:t})=>{const n=bz({flag:"isRainbow"}),r=!n,a=c=>P4()?c:Id()?`rainbow://wc?uri=${encodeURIComponent(c)}&connector=rainbowkit`:`https://rnbwapp.com/wc?uri=${encodeURIComponent(c)}&connector=rainbowkit`;return{id:"rainbow",name:"Rainbow",rdns:"me.rainbow",iconUrl:async()=>(await je(async()=>{const{default:c}=await import("./rainbowWallet-O26YNBMX-DUhYus-9.js");return{default:c}},[])).default,iconBackground:"#0c2f78",installed:r?void 0:n,downloadUrls:{android:"https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Drainbowkit&utm_source=rainbowkit",ios:"https://apps.apple.com/app/apple-store/id1457119021?pt=119997837&ct=rainbowkit&mt=8",mobile:"https://rainbow.download?utm_source=rainbowkit",qrCode:"https://rainbow.download?utm_source=rainbowkit&utm_medium=qrcode",browserExtension:"https://rainbow.me/extension?utm_source=rainbowkit"},mobile:{getUri:r?a:void 0},qrCode:r?{getUri:a,instructions:{learnMoreUrl:"https://learn.rainbow.me/connect-to-a-website-or-app?utm_source=rainbowkit&utm_medium=connector&utm_campaign=learnmore",steps:[{description:"wallet_connectors.rainbow.qr_code.step1.description",step:"install",title:"wallet_connectors.rainbow.qr_code.step1.title"},{description:"wallet_connectors.rainbow.qr_code.step2.description",step:"create",title:"wallet_connectors.rainbow.qr_code.step2.title"},{description:"wallet_connectors.rainbow.qr_code.step3.description",step:"scan",title:"wallet_connectors.rainbow.qr_code.step3.title"}]}}:void 0,createConnector:r?Kv({projectId:e,walletConnectParameters:t}):xz({flag:"isRainbow"})}},jz=()=>({id:"safe",name:"Safe",iconAccent:"#12ff80",iconBackground:"#fff",iconUrl:async()=>(await je(async()=>{const{default:e}=await import("./safeWallet-5MNKTR5Z-D-5imDLD.js");return{default:e}},[])).default,installed:!(typeof window>"u")&&(window==null?void 0:window.parent)!==window,downloadUrls:{},createConnector:e=>t=>({...Tv()(t),...e})}),Sz=({projectId:e,options:t})=>({id:"walletConnect",name:"WalletConnect",installed:void 0,iconUrl:async()=>(await je(async()=>{const{default:r}=await import("./walletConnectWallet-YHWKVTDY-D3lyiczV.js");return{default:r}},[])).default,iconBackground:"#3b99fc",qrCode:{getUri:r=>r},createConnector:Kv({projectId:e,walletConnectParameters:t})}),Az=e=>e.reduce((n,r)=>{const a=r.id;return n[a]=KB(),n},{}),Ez=({appName:e,appDescription:t,appUrl:n,appIcon:r,wallets:a,projectId:c,walletConnectParameters:l,...u})=>{const{transports:d,chains:p,...h}=u,m=Sj({appName:e,appDescription:t,appUrl:n,appIcon:r}),g=mz(a||[{groupName:"Popular",wallets:[jz,kz,Nj,Mj,Sz]}],{projectId:c,appName:e,appDescription:t,appUrl:n,appIcon:r,walletConnectParameters:{metadata:m,...l}});return BT({connectors:g,chains:p,transports:d||Az(p),...h})};const Nz="_overlay_ucm8o_7",Mz="_card_ucm8o_22",Iz="_iconWrap_ucm8o_47",Bz="_title_ucm8o_60",Tz="_body_ucm8o_70",Pz="_actions_ucm8o_79",Rz="_btn_ucm8o_86",Lz="_btnDanger_ucm8o_105",Dz="_btnGhost_ucm8o_115",ys={overlay:Nz,card:Mz,iconWrap:Iz,title:Bz,body:Tz,actions:Pz,btn:Rz,btnDanger:Lz,btnGhost:Dz};function Ij({open:e,title:t,body:n,confirmLabel:r="Confirm",cancelLabel:a="Cancel",onConfirm:c,onCancel:l}){return I.useEffect(()=>{if(!e)return;const u=d=>{d.key==="Escape"&&(l==null||l())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[e,l]),e?o.jsx("div",{className:ys.overlay,role:"dialog","aria-modal":"true","aria-label":t,onClick:l,children:o.jsxs("div",{className:ys.card,onClick:u=>u.stopPropagation(),children:[o.jsx("span",{className:ys.iconWrap,"aria-hidden":!0,children:o.jsxs("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 3l9 16H3l9-16z"}),o.jsx("path",{d:"M12 9v5"}),o.jsx("circle",{cx:"12",cy:"17",r:"0.9",fill:"currentColor",stroke:"none"})]})}),o.jsx("h2",{className:ys.title,children:t}),o.jsx("p",{className:ys.body,children:n}),o.jsxs("div",{className:ys.actions,children:[o.jsx("button",{type:"button",className:`${ys.btn} ${ys.btnDanger}`,onClick:c,autoFocus:!0,children:r}),o.jsx("button",{type:"button",className:`${ys.btn} ${ys.btnGhost}`,onClick:l,children:a})]})]})}):null}const Oz="_disc_gesk8_4",Fz="_icon_gesk8_15",zz="_claude_gesk8_20",$z="_cursor_gesk8_21",Hz="_openai_gesk8_22",Uz="_fallback_gesk8_30",pu={disc:Oz,icon:Fz,claude:zz,cursor:$z,openai:Hz,fallback:Uz};function da({name:e,size:t=28}){const n=Wz(e);if(n==="fallback")return o.jsx("span",{className:`${pu.disc} ${pu.fallback}`,style:{width:t,height:t},"aria-label":e,children:o.jsx("span",{style:{fontSize:Math.round(t*.48),lineHeight:1},children:((e==null?void 0:e[0])??"?").toUpperCase()})});const r=`/brands/${n}.svg`,c=Math.round(t*(n==="claude"?.78:n==="cursor"?.58:.68));return o.jsx("span",{className:`${pu.disc} ${pu[n]}`,style:{width:t,height:t},"aria-label":e,children:o.jsx("img",{src:r,alt:"",width:c,height:c,className:pu.icon,"aria-hidden":!0})})}function Wz(e){const t=(e??"").toLowerCase();return t==="claude"||t==="anthropic"?"claude":t==="cursor"?"cursor":t==="chatgpt"||t==="codex"||t==="openai"||t==="gpt"?"openai":"fallback"}const Vz="_horizonBg_6hi0i_7",Gz="_blob1_6hi0i_43",qz="_blob2_6hi0i_58",Kz="_blob3_6hi0i_73",Qz="_blob4_6hi0i_88",Yz="_blob5_6hi0i_103",Jz="_horizonFrost_6hi0i_118",Yo={horizonBg:Vz,blob1:Gz,blob2:qz,blob3:Kz,blob4:Qz,blob5:Yz,horizonFrost:Jz};function ga(){return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:Yo.horizonBg,"aria-hidden":"true",children:[o.jsx("div",{className:Yo.blob1}),o.jsx("div",{className:Yo.blob2}),o.jsx("div",{className:Yo.blob3}),o.jsx("div",{className:Yo.blob4}),o.jsx("div",{className:Yo.blob5})]}),o.jsx("div",{className:Yo.horizonFrost,"aria-hidden":"true"})]})}const Xz="_card_zqry2_1",Zz={card:Xz};function Kt({children:e,className:t="",as:n="div",...r}){return o.jsx(n,{className:`${Zz.card} ${t}`,...r,children:e})}const e$="_mark_1wlr6_1",t$={mark:e$},n$=`data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 36 34" width="288" height="272" role="img" aria-label="Sail logo" overflow="visible"><style>
1761
1761
  .boat { transform-origin: 16px 28.5px; animation: rock 4.6s cubic-bezier(.37,0,.63,1) infinite; }
1762
1762
  .bob { animation: bob 3.5s cubic-bezier(.37,0,.63,1) infinite; }
@@ -1771,7 +1771,7 @@ limitations under the License.
1771
1771
  @keyframes look { 0%,14%{transform:translateX(0)} 22%,38%{transform:translateX(-.22px)} 46%,62%{transform:translateX(0)} 70%,86%{transform:translateX(.22px)} 100%{transform:translateX(0)} }
1772
1772
  @keyframes blink{ 0%,86%,100%{transform:scaleY(1)} 90%{transform:scaleY(.16)} 95%{transform:scaleY(.16)} }
1773
1773
  @media (prefers-reduced-motion: reduce){ .boat,.bob,.sail,.eye,.blink{ animation:none } }
1774
- </style><g class="boat"><g class="bob"><g class="sail"><path d="M12 0.5h1v1h-1zM13 0.5h1v1h-1zM14 0.5h1v1h-1zM12 1.5h1v1h-1zM13 1.5h1v1h-1zM14 1.5h1v1h-1zM12 2.5h1v1h-1zM13 2.5h1v1h-1zM14 2.5h1v1h-1zM15 2.5h1v1h-1zM16 2.5h1v1h-1zM12 3.5h1v1h-1zM13 3.5h1v1h-1zM14 3.5h1v1h-1zM15 3.5h1v1h-1zM16 3.5h1v1h-1zM10 4.5h1v1h-1zM11 4.5h1v1h-1zM12 4.5h1v1h-1zM13 4.5h1v1h-1zM14 4.5h1v1h-1zM15 4.5h1v1h-1zM16 4.5h1v1h-1zM17 4.5h1v1h-1zM18 4.5h1v1h-1zM19 4.5h1v1h-1zM10 5.5h1v1h-1zM11 5.5h1v1h-1zM12 5.5h1v1h-1zM13 5.5h1v1h-1zM14 5.5h1v1h-1zM15 5.5h1v1h-1zM16 5.5h1v1h-1zM17 5.5h1v1h-1zM18 5.5h1v1h-1zM19 5.5h1v1h-1zM10 6.5h1v1h-1zM11 6.5h1v1h-1zM12 6.5h1v1h-1zM13 6.5h1v1h-1zM14 6.5h1v1h-1zM15 6.5h1v1h-1zM16 6.5h1v1h-1zM17 6.5h1v1h-1zM18 6.5h1v1h-1zM19 6.5h1v1h-1zM7 7.5h1v1h-1zM8 7.5h1v1h-1zM9 7.5h1v1h-1zM10 7.5h1v1h-1zM11 7.5h1v1h-1zM12 7.5h1v1h-1zM13 7.5h1v1h-1zM14 7.5h1v1h-1zM15 7.5h1v1h-1zM16 7.5h1v1h-1zM17 7.5h1v1h-1zM18 7.5h1v1h-1zM19 7.5h1v1h-1zM20 7.5h1v1h-1zM21 7.5h1v1h-1zM7 8.5h1v1h-1zM8 8.5h1v1h-1zM9 8.5h1v1h-1zM10 8.5h1v1h-1zM11 8.5h1v1h-1zM12 8.5h1v1h-1zM13 8.5h1v1h-1zM14 8.5h1v1h-1zM15 8.5h1v1h-1zM16 8.5h1v1h-1zM17 8.5h1v1h-1zM18 8.5h1v1h-1zM19 8.5h1v1h-1zM20 8.5h1v1h-1zM21 8.5h1v1h-1zM7 9.5h1v1h-1zM8 9.5h1v1h-1zM9 9.5h1v1h-1zM10 9.5h1v1h-1zM11 9.5h1v1h-1zM12 9.5h1v1h-1zM13 9.5h1v1h-1zM14 9.5h1v1h-1zM15 9.5h1v1h-1zM16 9.5h1v1h-1zM17 9.5h1v1h-1zM18 9.5h1v1h-1zM19 9.5h1v1h-1zM20 9.5h1v1h-1zM21 9.5h1v1h-1zM22 9.5h1v1h-1zM23 9.5h1v1h-1zM24 9.5h1v1h-1zM7 10.5h1v1h-1zM8 10.5h1v1h-1zM9 10.5h1v1h-1zM10 10.5h1v1h-1zM11 10.5h1v1h-1zM12 10.5h1v1h-1zM13 10.5h1v1h-1zM14 10.5h1v1h-1zM15 10.5h1v1h-1zM16 10.5h1v1h-1zM17 10.5h1v1h-1zM18 10.5h1v1h-1zM19 10.5h1v1h-1zM20 10.5h1v1h-1zM21 10.5h1v1h-1zM22 10.5h1v1h-1zM23 10.5h1v1h-1zM24 10.5h1v1h-1zM7 11.5h1v1h-1zM8 11.5h1v1h-1zM9 11.5h1v1h-1zM10 11.5h1v1h-1zM11 11.5h1v1h-1zM12 11.5h1v1h-1zM13 11.5h1v1h-1zM14 11.5h1v1h-1zM15 11.5h1v1h-1zM16 11.5h1v1h-1zM17 11.5h1v1h-1zM18 11.5h1v1h-1zM19 11.5h1v1h-1zM20 11.5h1v1h-1zM21 11.5h1v1h-1zM22 11.5h1v1h-1zM23 11.5h1v1h-1zM24 11.5h1v1h-1zM5 12.5h1v1h-1zM6 12.5h1v1h-1zM7 12.5h1v1h-1zM8 12.5h1v1h-1zM9 12.5h1v1h-1zM10 12.5h1v1h-1zM11 12.5h1v1h-1zM12 12.5h1v1h-1zM13 12.5h1v1h-1zM14 12.5h1v1h-1zM15 12.5h1v1h-1zM16 12.5h1v1h-1zM17 12.5h1v1h-1zM18 12.5h1v1h-1zM19 12.5h1v1h-1zM20 12.5h1v1h-1zM21 12.5h1v1h-1zM22 12.5h1v1h-1zM23 12.5h1v1h-1zM24 12.5h1v1h-1zM25 12.5h1v1h-1zM26 12.5h1v1h-1zM5 13.5h1v1h-1zM6 13.5h1v1h-1zM7 13.5h1v1h-1zM8 13.5h1v1h-1zM9 13.5h1v1h-1zM10 13.5h1v1h-1zM11 13.5h1v1h-1zM12 13.5h1v1h-1zM13 13.5h1v1h-1zM14 13.5h1v1h-1zM15 13.5h1v1h-1zM16 13.5h1v1h-1zM17 13.5h1v1h-1zM18 13.5h1v1h-1zM19 13.5h1v1h-1zM20 13.5h1v1h-1zM21 13.5h1v1h-1zM22 13.5h1v1h-1zM23 13.5h1v1h-1zM24 13.5h1v1h-1zM25 13.5h1v1h-1zM26 13.5h1v1h-1zM2 14.5h1v1h-1zM3 14.5h1v1h-1zM4 14.5h1v1h-1zM5 14.5h1v1h-1zM6 14.5h1v1h-1zM7 14.5h1v1h-1zM8 14.5h1v1h-1zM9 14.5h1v1h-1zM10 14.5h1v1h-1zM11 14.5h1v1h-1zM12 14.5h1v1h-1zM13 14.5h1v1h-1zM14 14.5h1v1h-1zM15 14.5h1v1h-1zM16 14.5h1v1h-1zM17 14.5h1v1h-1zM18 14.5h1v1h-1zM19 14.5h1v1h-1zM20 14.5h1v1h-1zM21 14.5h1v1h-1zM22 14.5h1v1h-1zM23 14.5h1v1h-1zM24 14.5h1v1h-1zM25 14.5h1v1h-1zM26 14.5h1v1h-1zM27 14.5h1v1h-1zM28 14.5h1v1h-1zM29 14.5h1v1h-1zM2 15.5h1v1h-1zM3 15.5h1v1h-1zM4 15.5h1v1h-1zM5 15.5h1v1h-1zM6 15.5h1v1h-1zM7 15.5h1v1h-1zM8 15.5h1v1h-1zM9 15.5h1v1h-1zM10 15.5h1v1h-1zM11 15.5h1v1h-1zM12 15.5h1v1h-1zM13 15.5h1v1h-1zM14 15.5h1v1h-1zM15 15.5h1v1h-1zM16 15.5h1v1h-1zM17 15.5h1v1h-1zM18 15.5h1v1h-1zM19 15.5h1v1h-1zM20 15.5h1v1h-1zM21 15.5h1v1h-1zM22 15.5h1v1h-1zM23 15.5h1v1h-1zM24 15.5h1v1h-1zM25 15.5h1v1h-1zM26 15.5h1v1h-1zM27 15.5h1v1h-1zM28 15.5h1v1h-1zM29 15.5h1v1h-1zM2 16.5h1v1h-1zM3 16.5h1v1h-1zM4 16.5h1v1h-1zM5 16.5h1v1h-1zM6 16.5h1v1h-1zM7 16.5h1v1h-1zM8 16.5h1v1h-1zM9 16.5h1v1h-1zM10 16.5h1v1h-1zM11 16.5h1v1h-1zM12 16.5h1v1h-1zM13 16.5h1v1h-1zM14 16.5h1v1h-1zM15 16.5h1v1h-1zM16 16.5h1v1h-1zM17 16.5h1v1h-1zM18 16.5h1v1h-1zM19 16.5h1v1h-1zM20 16.5h1v1h-1zM21 16.5h1v1h-1zM22 16.5h1v1h-1zM23 16.5h1v1h-1zM24 16.5h1v1h-1zM25 16.5h1v1h-1zM26 16.5h1v1h-1zM27 16.5h1v1h-1zM28 16.5h1v1h-1zM29 16.5h1v1h-1zM12 17.5h1v1h-1zM13 17.5h1v1h-1zM14 17.5h1v1h-1zM12 18.5h1v1h-1zM13 18.5h1v1h-1zM14 18.5h1v1h-1z" fill="#1990FF"/></g><g class="hull"><path d="M0 19.5h1v1h-1zM1 19.5h1v1h-1zM2 19.5h1v1h-1zM3 19.5h1v1h-1zM4 19.5h1v1h-1zM5 19.5h1v1h-1zM6 19.5h1v1h-1zM7 19.5h1v1h-1zM8 19.5h1v1h-1zM9 19.5h1v1h-1zM10 19.5h1v1h-1zM11 19.5h1v1h-1zM12 19.5h1v1h-1zM13 19.5h1v1h-1zM14 19.5h1v1h-1zM15 19.5h1v1h-1zM16 19.5h1v1h-1zM17 19.5h1v1h-1zM18 19.5h1v1h-1zM19 19.5h1v1h-1zM20 19.5h1v1h-1zM21 19.5h1v1h-1zM22 19.5h1v1h-1zM23 19.5h1v1h-1zM24 19.5h1v1h-1zM25 19.5h1v1h-1zM26 19.5h1v1h-1zM27 19.5h1v1h-1zM28 19.5h1v1h-1zM29 19.5h1v1h-1zM30 19.5h1v1h-1zM31 19.5h1v1h-1zM0 20.5h1v1h-1zM1 20.5h1v1h-1zM2 20.5h1v1h-1zM3 20.5h1v1h-1zM4 20.5h1v1h-1zM5 20.5h1v1h-1zM6 20.5h1v1h-1zM7 20.5h1v1h-1zM8 20.5h1v1h-1zM9 20.5h1v1h-1zM10 20.5h1v1h-1zM11 20.5h1v1h-1zM12 20.5h1v1h-1zM13 20.5h1v1h-1zM14 20.5h1v1h-1zM15 20.5h1v1h-1zM16 20.5h1v1h-1zM17 20.5h1v1h-1zM18 20.5h1v1h-1zM19 20.5h1v1h-1zM20 20.5h1v1h-1zM21 20.5h1v1h-1zM22 20.5h1v1h-1zM23 20.5h1v1h-1zM24 20.5h1v1h-1zM25 20.5h1v1h-1zM26 20.5h1v1h-1zM27 20.5h1v1h-1zM28 20.5h1v1h-1zM29 20.5h1v1h-1zM30 20.5h1v1h-1zM31 20.5h1v1h-1zM0 21.5h1v1h-1zM1 21.5h1v1h-1zM2 21.5h1v1h-1zM3 21.5h1v1h-1zM4 21.5h1v1h-1zM5 21.5h1v1h-1zM6 21.5h1v1h-1zM7 21.5h1v1h-1zM8 21.5h1v1h-1zM9 21.5h1v1h-1zM10 21.5h1v1h-1zM11 21.5h1v1h-1zM12 21.5h1v1h-1zM13 21.5h1v1h-1zM14 21.5h1v1h-1zM15 21.5h1v1h-1zM16 21.5h1v1h-1zM17 21.5h1v1h-1zM18 21.5h1v1h-1zM19 21.5h1v1h-1zM20 21.5h1v1h-1zM21 21.5h1v1h-1zM22 21.5h1v1h-1zM23 21.5h1v1h-1zM24 21.5h1v1h-1zM25 21.5h1v1h-1zM26 21.5h1v1h-1zM27 21.5h1v1h-1zM28 21.5h1v1h-1zM29 21.5h1v1h-1zM30 21.5h1v1h-1zM31 21.5h1v1h-1zM0 22.5h1v1h-1zM1 22.5h1v1h-1zM2 22.5h1v1h-1zM3 22.5h1v1h-1zM4 22.5h1v1h-1zM5 22.5h1v1h-1zM6 22.5h1v1h-1zM7 22.5h1v1h-1zM8 22.5h1v1h-1zM9 22.5h1v1h-1zM10 22.5h1v1h-1zM11 22.5h1v1h-1zM12 22.5h1v1h-1zM13 22.5h1v1h-1zM14 22.5h1v1h-1zM15 22.5h1v1h-1zM16 22.5h1v1h-1zM17 22.5h1v1h-1zM18 22.5h1v1h-1zM19 22.5h1v1h-1zM20 22.5h1v1h-1zM21 22.5h1v1h-1zM22 22.5h1v1h-1zM23 22.5h1v1h-1zM24 22.5h1v1h-1zM25 22.5h1v1h-1zM26 22.5h1v1h-1zM27 22.5h1v1h-1zM28 22.5h1v1h-1zM29 22.5h1v1h-1zM0 23.5h1v1h-1zM1 23.5h1v1h-1zM2 23.5h1v1h-1zM3 23.5h1v1h-1zM4 23.5h1v1h-1zM5 23.5h1v1h-1zM6 23.5h1v1h-1zM7 23.5h1v1h-1zM8 23.5h1v1h-1zM9 23.5h1v1h-1zM10 23.5h1v1h-1zM11 23.5h1v1h-1zM12 23.5h1v1h-1zM13 23.5h1v1h-1zM14 23.5h1v1h-1zM15 23.5h1v1h-1zM16 23.5h1v1h-1zM17 23.5h1v1h-1zM18 23.5h1v1h-1zM19 23.5h1v1h-1zM20 23.5h1v1h-1zM21 23.5h1v1h-1zM22 23.5h1v1h-1zM23 23.5h1v1h-1zM24 23.5h1v1h-1zM25 23.5h1v1h-1zM26 23.5h1v1h-1zM27 23.5h1v1h-1zM28 23.5h1v1h-1zM29 23.5h1v1h-1zM2 24.5h1v1h-1zM3 24.5h1v1h-1zM4 24.5h1v1h-1zM5 24.5h1v1h-1zM6 24.5h1v1h-1zM7 24.5h1v1h-1zM8 24.5h1v1h-1zM9 24.5h1v1h-1zM10 24.5h1v1h-1zM11 24.5h1v1h-1zM12 24.5h1v1h-1zM13 24.5h1v1h-1zM14 24.5h1v1h-1zM15 24.5h1v1h-1zM16 24.5h1v1h-1zM17 24.5h1v1h-1zM18 24.5h1v1h-1zM19 24.5h1v1h-1zM20 24.5h1v1h-1zM21 24.5h1v1h-1zM22 24.5h1v1h-1zM23 24.5h1v1h-1zM24 24.5h1v1h-1zM25 24.5h1v1h-1zM26 24.5h1v1h-1zM2 25.5h1v1h-1zM3 25.5h1v1h-1zM4 25.5h1v1h-1zM5 25.5h1v1h-1zM6 25.5h1v1h-1zM7 25.5h1v1h-1zM8 25.5h1v1h-1zM9 25.5h1v1h-1zM10 25.5h1v1h-1zM11 25.5h1v1h-1zM12 25.5h1v1h-1zM13 25.5h1v1h-1zM14 25.5h1v1h-1zM15 25.5h1v1h-1zM16 25.5h1v1h-1zM17 25.5h1v1h-1zM18 25.5h1v1h-1zM19 25.5h1v1h-1zM20 25.5h1v1h-1zM21 25.5h1v1h-1zM22 25.5h1v1h-1zM23 25.5h1v1h-1zM24 25.5h1v1h-1zM25 25.5h1v1h-1zM26 25.5h1v1h-1zM2 26.5h1v1h-1zM3 26.5h1v1h-1zM4 26.5h1v1h-1zM5 26.5h1v1h-1zM6 26.5h1v1h-1zM7 26.5h1v1h-1zM8 26.5h1v1h-1zM9 26.5h1v1h-1zM10 26.5h1v1h-1zM11 26.5h1v1h-1zM12 26.5h1v1h-1zM13 26.5h1v1h-1zM14 26.5h1v1h-1zM15 26.5h1v1h-1zM16 26.5h1v1h-1zM17 26.5h1v1h-1zM18 26.5h1v1h-1zM19 26.5h1v1h-1zM20 26.5h1v1h-1zM21 26.5h1v1h-1zM22 26.5h1v1h-1zM23 26.5h1v1h-1zM24 26.5h1v1h-1zM25 26.5h1v1h-1zM26 26.5h1v1h-1zM5 27.5h1v1h-1zM6 27.5h1v1h-1zM7 27.5h1v1h-1zM8 27.5h1v1h-1zM9 27.5h1v1h-1zM10 27.5h1v1h-1zM11 27.5h1v1h-1zM12 27.5h1v1h-1zM13 27.5h1v1h-1zM14 27.5h1v1h-1zM15 27.5h1v1h-1zM16 27.5h1v1h-1zM17 27.5h1v1h-1zM18 27.5h1v1h-1zM19 27.5h1v1h-1zM20 27.5h1v1h-1zM21 27.5h1v1h-1zM22 27.5h1v1h-1zM23 27.5h1v1h-1zM24 27.5h1v1h-1zM5 28.5h1v1h-1zM6 28.5h1v1h-1zM7 28.5h1v1h-1zM8 28.5h1v1h-1zM9 28.5h1v1h-1zM10 28.5h1v1h-1zM11 28.5h1v1h-1zM12 28.5h1v1h-1zM13 28.5h1v1h-1zM14 28.5h1v1h-1zM15 28.5h1v1h-1zM16 28.5h1v1h-1zM17 28.5h1v1h-1zM18 28.5h1v1h-1zM19 28.5h1v1h-1zM20 28.5h1v1h-1zM21 28.5h1v1h-1zM22 28.5h1v1h-1zM23 28.5h1v1h-1zM24 28.5h1v1h-1z" fill="#1990FF"/></g><g class="eye eyeL"><g class="blink"><path d="M17 21.5h1v1h-1zM18 21.5h1v1h-1zM19 21.5h1v1h-1zM17 22.5h1v1h-1zM18 22.5h1v1h-1zM19 22.5h1v1h-1zM17 23.5h1v1h-1zM18 23.5h1v1h-1zM19 23.5h1v1h-1z" fill="#0A1124"/></g></g><g class="eye eyeR"><g class="blink"><path d="M22 21.5h1v1h-1zM23 21.5h1v1h-1zM24 21.5h1v1h-1zM22 22.5h1v1h-1zM23 22.5h1v1h-1zM24 22.5h1v1h-1zM22 23.5h1v1h-1zM23 23.5h1v1h-1zM24 23.5h1v1h-1z" fill="#0A1124"/></g></g></g></g></svg>`)}`;function gn({size:e=80,className:t=""}){return o.jsx("img",{src:n$,width:e,height:e,alt:"Sail logo",className:`${t$.mark} ${t}`.trim()})}const r$="_pill_9mhgj_1",s$="_dot_9mhgj_19",a$="_active_9mhgj_32",o$="_paused_9mhgj_50",i$="_muted_9mhgj_50",c$="_expired_9mhgj_60",l$="_revoked_9mhgj_70",yh={pill:r$,dot:s$,active:a$,"dot-breathe":"_dot-breathe_9mhgj_1",paused:o$,muted:i$,expired:c$,revoked:l$},w6={mandate:{active:"Active",paused:"Paused",expired:"Expired",revoked:"Revoked"},agent:{active:"Active",paused:"Stopped",expired:"Expired",revoked:"Ended"}};function tp({status:e="active",kind:t="mandate"}){const n=`${yh.pill} ${yh[e]??yh.muted}`,r=w6[t]??w6.mandate;return o.jsxs("span",{className:n,children:[o.jsx("span",{className:yh.dot,"aria-hidden":!0}),o.jsx("span",{children:r[e]??e})]})}const u$="_btn_xgunx_1",d$="_fullWidth_xgunx_31",f$="_primary_xgunx_35",h$="_ctaSheen_xgunx_1",p$="_secondary_xgunx_81",m$="_ghost_xgunx_100",g$="_danger_xgunx_115",y$="_warning_xgunx_134",vh={btn:u$,fullWidth:d$,primary:f$,ctaSheen:h$,secondary:p$,ghost:m$,danger:g$,warning:y$};function Ze({children:e,variant:t="primary",fullWidth:n=!1,disabled:r=!1,type:a="button",className:c="",...l}){const u=[vh.btn,vh[t]??vh.primary,n?vh.fullWidth:"",c].filter(Boolean).join(" ");return o.jsx("button",{type:a,className:u,disabled:r,...l,children:e})}const v$="_wrap_f46ww_1",b$="_icon_f46ww_8",w$="_bubble_f46ww_28",H1={wrap:v$,icon:b$,bubble:w$},_6=8,mu=10;function bi({children:e,label:t="More info",side:n="top"}){const[r,a]=I.useState(!1),[c,l]=I.useState(null),u=I.useRef(null),d=I.useRef(null),p=I.useId(),h=I.useCallback(()=>{const m=u.current,g=d.current;if(!m||!g)return;const v=m.getBoundingClientRect(),b=g.offsetWidth,_=g.offsetHeight,x=window.innerWidth,j=window.innerHeight;let A=v.left+v.width/2-b/2;A=Math.max(mu,Math.min(A,x-b-mu));const k=v.top-_6-_,N=v.bottom+_6;let E=n==="bottom"?N:k;E<mu&&(E=N),E+_>j-mu&&(E=Math.max(mu,k)),l({left:A,top:E})},[n]);return I.useLayoutEffect(()=>{if(!r){l(null);return}return h(),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}},[r,h]),o.jsxs("span",{className:H1.wrap,children:[o.jsx("button",{ref:u,type:"button",className:H1.icon,"aria-label":t,"aria-describedby":r?p:void 0,"aria-expanded":r,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:m=>{m.stopPropagation(),a(g=>!g)},children:o.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":!0,children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),o.jsx("circle",{cx:"8",cy:"4.6",r:"0.95",fill:"currentColor"}),o.jsx("rect",{x:"7.2",y:"6.6",width:"1.6",height:"5",rx:"0.6",fill:"currentColor"})]})}),r&&typeof document<"u"&&m4.createPortal(o.jsx("span",{ref:d,id:p,role:"tooltip",className:H1.bubble,style:{left:c?`${c.left}px`:"-9999px",top:c?`${c.top}px`:"-9999px",visibility:c?"visible":"hidden"},children:e}),document.body)]})}const _$={1:"#627eea",11155111:"#627eea",8453:"#0052ff",84532:"#0052ff",42161:"#28a0f0",421614:"#28a0f0",130:"#ff007a",1301:"#ff007a",10:"#ff0420",11155420:"#ff0420",56:"#f3ba2f",97:"#f3ba2f",480:"#dfe3e8",4801:"#dfe3e8",999:"#50d2c1",998:"#50d2c1",4326:"#ffffff",6342:"#ffffff"};function x$(e){return _$[e]??"rgba(255,255,255,0.5)"}function C$({chainId:e,color:t}){return e===1||e===11155111?o.jsx("svg",{viewBox:"0 0 24 24",fill:t,xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M11.944 17.97L4.58 13.62 11.943 24l7.37-10.38-7.372 4.35h.003zM12.056 0L4.69 12.223l7.365 4.354 7.365-4.35L12.056 0z"})}):e===8453||e===84532?o.jsx("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{fill:t,fillRule:"evenodd",d:"M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Z M2.2 10.5h11.1v3H2.2Z"})}):e===42161||e===421614?o.jsx("svg",{viewBox:"0 0 2500 2500",xmlns:"http://www.w3.org/2000/svg",children:o.jsxs("g",{fill:t,children:[o.jsx("path",{d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"}),o.jsx("path",{d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"}),o.jsx("path",{d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"}),o.jsx("path",{d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),o.jsx("path",{d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})}):e===130||e===1301?o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M12 2.5C12 8 8 12 2.5 12 8 12 12 16 12 21.5 12 16 16 12 21.5 12 16 12 12 8 12 2.5Z",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round"})}):e===10||e===11155420?o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{fill:t,fillRule:"evenodd",clipRule:"evenodd",d:"M3.966 15.8q.979.7 2.512.7 1.854 0 2.962-.838 1.108-.85 1.559-2.562.27-1.05.464-2.163.063-.398.064-.663 0-.874-.451-1.499a2.7 2.7 0 0 0-1.237-.95Q9.053 7.5 8.062 7.5q-3.644 0-4.52 3.437a40 40 0 0 0-.477 2.163q-.058.335-.065.674 0 1.314.966 2.026m4.65-2.775c-.247.957-.926 1.58-1.958 1.58-1.02 0-1.368-.69-1.184-1.58a27 27 0 0 1 .464-2.05c.265-1.034.89-1.58 1.956-1.58 1.017 0 1.348.68 1.173 1.58a30 30 0 0 1-.451 2.05m3.902 3.385q.076.09.214.089h1.704a.38.38 0 0 0 .238-.089.36.36 0 0 0 .138-.232l.538-2.52h1.733c1.094 0 1.95-.53 2.576-1.002q.953-.707 1.266-2.186.075-.348.075-.67 0-1.117-.851-1.71-.84-.591-2.23-.591h-3.333a.38.38 0 0 0-.238.09.38.38 0 0 0-.138.232l-1.73 8.356a.3.3 0 0 0 .038.232m6.09-5.966c-.157.689-.757 1.319-1.462 1.319h-1.44l.496-2.369h1.503c.512 0 .94.102.94.665q0 .165-.037.385"})}):e===56||e===97?o.jsx("svg",{viewBox:"0 0 24 24",fill:t,xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M16.624 13.9202l2.7175 2.7154-7.353 7.353-7.353-7.352 2.7175-2.7164 4.6355 4.6595 4.6356-4.6595zm4.6366-4.6366L24 12l-2.7154 2.7164L18.5682 12l2.6924-2.7164zm-9.272.001l2.7163 2.6914-2.7164 2.7174v-.001L9.2721 12l2.7164-2.7154zm-9.2722-.001L5.4088 12l-2.6914 2.6924L0 12l2.7164-2.7164zM11.9885.0115l7.353 7.329-2.7174 2.7154-4.6356-4.6356-4.6355 4.6595-2.7174-2.7154 7.353-7.353z"})}):e===480||e===4801?o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{fill:t,d:"M16.513 4.203A8.8 8.8 0 0 0 12 3Q9.555 3 7.487 4.203a8.97 8.97 0 0 0-3.284 3.284A8.8 8.8 0 0 0 3 12q0 2.445 1.203 4.512a8.97 8.97 0 0 0 3.284 3.285A8.8 8.8 0 0 0 12 21q2.445 0 4.512-1.203a8.97 8.97 0 0 0 3.285-3.285A8.8 8.8 0 0 0 21 12q0-2.445-1.203-4.513a8.97 8.97 0 0 0-3.285-3.284M12.55 15.26c-1.027 0-1.83-.3-2.456-.877a2.74 2.74 0 0 1-.828-1.454h9.727c-.1.827-.35 1.604-.701 2.331h-5.741m-3.284-4.161a2.84 2.84 0 0 1 .828-1.455c.626-.576 1.429-.877 2.457-.877h5.74c.377.727.602 1.504.702 2.332zM5.908 8.415a7 7 0 0 1 2.557-2.582 6.94 6.94 0 0 1 3.56-.953 6.94 6.94 0 0 1 3.56.953 7.3 7.3 0 0 1 1.48 1.153h-4.539c-1.027 0-1.955.226-2.757.652a4.54 4.54 0 0 0-1.855 1.78 5.1 5.1 0 0 0-.602 1.705H5.081c.1-.953.4-1.856.877-2.683zm9.652 9.752a6.94 6.94 0 0 1-3.56.953 6.94 6.94 0 0 1-3.56-.953 7 7 0 0 1-2.557-2.582 6.7 6.7 0 0 1-.877-2.657h2.23a5.2 5.2 0 0 0 .602 1.704c.452.752 1.078 1.329 1.856 1.78.802.426 1.73.652 2.757.652h4.513a6.8 6.8 0 0 1-1.43 1.103z"})}):e===999||e===998?o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{fill:t,d:"M21 11.937a9.4 9.4 0 0 1-.901 4.112c-.867 1.863-2.947 3.387-4.846 1.765-1.55-1.322-1.837-4.005-4.157-4.398-3.07-.361-3.145 3.092-5.15 3.482-2.236.44-2.978-3.206-2.945-4.862s.487-3.984 2.43-3.984c2.236 0 2.386 3.283 5.224 3.105 2.81-.186 2.86-3.602 4.696-5.064 1.585-1.264 3.448-.337 4.381 1.184.865 1.406 1.245 3.057 1.265 4.66z"})}):e===4326||e===6342?o.jsxs("svg",{viewBox:"0 0 24 24",fill:t,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{d:"M3 16.5V5h2.8L12 12.2 18.2 5H21v11.5h-2.6V9.2L12 16.6 5.6 9.2v7.3z"}),o.jsx("circle",{cx:"9.4",cy:"20",r:"1.3"}),o.jsx("circle",{cx:"14.6",cy:"20",r:"1.3"})]}):o.jsx("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("circle",{cx:"12",cy:"12",r:"6",fill:t})})}function Co({chainId:e,size:t=20,color:n}){const r=n??x$(e);return o.jsx("span",{"aria-hidden":!0,style:{display:"inline-flex",width:t,height:t,flexShrink:0},children:o.jsx(C$,{chainId:e,color:r})})}const x6=["#4DABFF","#7EB8F7","#9B8FF7","#5AD1E8"];function k$(e,t){let n=0;for(let r=0;r<e.length;r++)n=n*31+e.charCodeAt(r)>>>0;return n%t}function j$({children:e,title:t}){const n=String(e??"");if(!n)return null;const r=x6[k$(n.toLowerCase(),x6.length)];return o.jsx("span",{title:t,style:{display:"inline-block",maxWidth:"100%",padding:"2px 9px",borderRadius:2,fontSize:10,fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase",lineHeight:1.5,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",background:`${r}22`,color:r,border:`1px solid ${r}55`},children:e})}function Bj({items:e}){const t=(e??[]).filter(Boolean);return t.length===0?null:o.jsx("div",{style:{display:"flex",gap:6,marginBottom:10,flexWrap:"wrap"},children:t.map(n=>o.jsx(j$,{title:n,children:n},n))})}const ya={1:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%2325292E%22%20fill-rule%3D%22evenodd%22%20d%3D%22M14%2028a14%2014%200%201%200%200-28%2014%2014%200%200%200%200%2028Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cpath%20fill%3D%22url(%23a)%22%20fill-opacity%3D%22.3%22%20fill-rule%3D%22evenodd%22%20d%3D%22M14%2028a14%2014%200%201%200%200-28%2014%2014%200%200%200%200%2028Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20d%3D%22M8.19%2014.77%2014%2018.21l5.8-3.44-5.8%208.19-5.81-8.19Z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m14%2016.93-5.81-3.44L14%204.34l5.81%209.15L14%2016.93Z%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22a%22%20x1%3D%220%22%20x2%3D%2214%22%20y1%3D%220%22%20y2%3D%2228%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%2214%22%20x2%3D%2214%22%20y1%3D%2214.77%22%20y2%3D%2222.96%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%20stop-opacity%3D%22.9%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",8453:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20fill%3D%22%230052FF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M14%2028a14%2014%200%201%200%200-28%2014%2014%200%200%200%200%2028Z%22%2F%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M13.967%2023.86c5.445%200%209.86-4.415%209.86-9.86%200-5.445-4.415-9.86-9.86-9.86-5.166%200-9.403%203.974-9.825%209.03h14.63v1.642H4.142c.413%205.065%204.654%209.047%209.826%209.047Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",42161:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cg%20transform%3D%22translate(0%2C0)%20scale(0.7)%22%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22%2396BEDC%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20fill-opacity%3D%22.3%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3Cpath%20fill%3D%22%232D374B%22%20fill-rule%3D%22evenodd%22%20d%3D%22M20%202.5C10.335%202.5%202.5%2010.335%202.5%2020c0%203.293.91%206.373%202.49%209.004L0%2031v9h10v-5.637A17.42%2017.42%200%200%200%2020%2037.5c9.665%200%2017.5-7.835%2017.5-17.5S29.665%202.5%2020%202.5Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cmask%20id%3D%22c%22%20width%3D%2238%22%20height%3D%2238%22%20x%3D%220%22%20y%3D%222%22%20maskUnits%3D%22userSpaceOnUse%22%20style%3D%22mask-type%3Aalpha%22%3E%3Cpath%20fill%3D%22%232D374B%22%20fill-rule%3D%22evenodd%22%20d%3D%22M20%202.5C10.335%202.5%202.5%2010.335%202.5%2020a17.42%2017.42%200%200%200%203.137%2010H0v10h10v-5.637A17.42%2017.42%200%200%200%2020%2037.5c9.665%200%2017.5-7.835%2017.5-17.5S29.665%202.5%2020%202.5Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url(%23c)%22%3E%3Cpath%20fill%3D%22%2328A0F0%22%20d%3D%22m26.873%2037.192-6.75-10.615%203.782-6.416%208.672%2013.676-5.704%203.355ZM34.126%2032.79l3.471-5.786-9.238-14.423-3.299%205.596%209.066%2014.613Z%22%2F%3E%3Cpath%20fill%3D%22url(%23d)%22%20fill-opacity%3D%22.2%22%20d%3D%22M0%2020C0%208.954%208.954%200%2020%200s20%208.954%2020%2020-8.954%2020-20%2020H0V20Z%22%2F%3E%3C%2Fg%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m.52%2040.315-4.387-2.524L-4.2%2036.6l15.267-23.715c1.042-1.702%203.314-2.25%205.422-2.22l2.475.065L.519%2040.315ZM27.38%2010.73l-6.523.024L-2.9%2050%202%2053.5l6.358-10.597%201.402-2.379L27.38%2010.73Z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%220%22%20x2%3D%2220%22%20y1%3D%220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22d%22%20x1%3D%220%22%20x2%3D%2220%22%20y1%3D%220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fg%3E%3C%2Fsvg%3E",130:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cg%20transform%3D%22translate(0%2C0)%20scale(0.7)%22%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22url(%23b)%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M36%2019.696c-8.672%200-15.696-7.03-15.696-15.696h-.608v15.696H4v.608c8.673%200%2015.696%207.03%2015.696%2015.696h.608V20.304H36v-.608Z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CradialGradient%20id%3D%22b%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientTransform%3D%22matrix(0%2020%20-20%200%2020%2020)%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FC74FE%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F50DB4%22%2F%3E%3C%2FradialGradient%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fg%3E%3C%2Fsvg%3E"};ya[11155111]=ya[1];ya[84532]=ya[8453];ya[421614]=ya[42161];ya[1301]=ya[130];function Tj({chainId:e,size:t=20}){const n=ya[e];return n?o.jsx("img",{src:n,width:t,height:t,style:{borderRadius:"50%",display:"block",flexShrink:0},alt:""}):o.jsx("span",{style:{display:"inline-block",width:t,height:t,borderRadius:"50%",flexShrink:0,background:"#888"}})}const S$="_shell_u0pao_1",A$="_header_u0pao_13",E$="_headerLeft_u0pao_31",N$="_brand_u0pao_38",M$="_backBtn_u0pao_51",I$="_headerTitle_u0pao_71",B$="_topActionsPill_u0pao_78",T$="_notifBtn_u0pao_99",P$="_chainIconPlaceholder_u0pao_120",R$="_avatarBtn_u0pao_129",L$="_avatarBtnMonogram_u0pao_155",D$="_avatarBtnAddr_u0pao_173",O$="_chainDropdownWrap_u0pao_182",F$="_chainMenu_u0pao_185",z$="_chainMenuHeader_u0pao_208",$$="_chainMenuList_u0pao_217",H$="_chainOption_u0pao_228",U$="_chainOptionActive_u0pao_250",W$="_chainOptionName_u0pao_260",V$="_chainCheck_u0pao_261",G$="_chainSwitching_u0pao_265",q$="_main_u0pao_271",K$="_eyebrow_u0pao_288",Q$="_title_u0pao_297",Y$="_card_u0pao_307",J$="_cardKicker_u0pao_319",X$="_cardHead_u0pao_334",Z$="_cardTitle_u0pao_335",eH="_cardDesc_u0pao_343",tH="_details_u0pao_352",nH="_detailRow_u0pao_361",rH="_detailLabel_u0pao_367",sH="_detailValue_u0pao_372",aH="_banner_u0pao_380",oH="_ok_u0pao_390",iH="_danger_u0pao_391",cH="_warn_u0pao_392",lH="_linkBtn_u0pao_393",uH="_actions_u0pao_400",dH="_reject_u0pao_406",fH="_primary_u0pao_419",hH="_connectHint_u0pao_434",pH="_emptyCard_u0pao_483",mH="_emptyCardSai_u0pao_508",gH="_emptyCardHeader_u0pao_517",yH="_emptyKicker_u0pao_525",vH="_emptyHeadline_u0pao_533",bH="_emptyTagline_u0pao_540",wH="_emptyCta_u0pao_547",He={shell:S$,header:A$,headerLeft:E$,brand:N$,backBtn:M$,headerTitle:I$,topActionsPill:B$,notifBtn:T$,chainIconPlaceholder:P$,avatarBtn:R$,avatarBtnMonogram:L$,avatarBtnAddr:D$,chainDropdownWrap:O$,chainMenu:F$,chainMenuHeader:z$,chainMenuList:$$,chainOption:H$,chainOptionActive:U$,chainOptionName:W$,chainCheck:V$,chainSwitching:G$,main:q$,eyebrow:K$,title:Q$,card:Y$,cardKicker:J$,cardHead:X$,cardTitle:Z$,cardDesc:eH,details:tH,detailRow:nH,detailLabel:rH,detailValue:sH,banner:aH,ok:oH,danger:iH,warn:cH,linkBtn:lH,actions:uH,reject:dH,primary:fH,connectHint:hH,emptyCard:pH,emptyCardSai:mH,emptyCardHeader:gH,emptyKicker:yH,emptyHeadline:vH,emptyTagline:bH,emptyCta:wH},_H="_overlay_aragl_4",xH="_overlayFade_aragl_1",CH="_panel_aragl_15",kH="_slideIn_aragl_1",jH="_panelOut_aragl_60",SH="_slideOut_aragl_1",AH="_hero_aragl_69",EH="_avatarRing_aragl_75",NH="_avatar_aragl_75",MH="_identity_aragl_104",IH="_identityKicker_aragl_112",BH="_identityAddress_aragl_120",TH="_identityCopyIcon_aragl_141",PH="_identityActions_aragl_149",RH="_settingsPill_aragl_155",LH="_disconnectPill_aragl_177",DH="_divider_aragl_202",OH="_smasSection_aragl_210",FH="_smasHead_aragl_217",zH="_smasKicker_aragl_224",$H="_smasCount_aragl_232",HH="_smaList_aragl_240",UH="_smaCard_aragl_286",WH="_smaCardPrimary_aragl_304",VH="_smaRow_aragl_313",GH="_smaIcon_aragl_331",qH="_smaBody_aragl_343",KH="_smaTitleRow_aragl_349",QH="_smaName_aragl_354",YH="_smaNameInput_aragl_362",JH="_smaPrimaryBadge_aragl_380",XH="_smaRename_aragl_396",ZH="_smaAddress_aragl_423",eU="_smaMeta_aragl_430",tU="_smaNetDot_aragl_439",nU="_smaNetDot_arbitrum_aragl_445",rU="_smaNetDot_base_aragl_446",sU="_smaNetDot_ethereum_aragl_447",aU="_smaNetDot_optimism_aragl_448",oU="_smaNetDot_polygon_aragl_449",iU="_smaNetStack_aragl_453",cU="_smaNetName_aragl_466",lU="_smaMetaSep_aragl_467",uU="_smaAgentCount_aragl_468",dU="_smaCopy_aragl_469",fU="_smaActions_aragl_491",hU="_smaSafeLink_aragl_502",pU="_smaSafeLinkLabel_aragl_530",mU="_smaSafeLinkChain_aragl_536",gU="_smaAction_aragl_491",yU="_smaActionPrimary_aragl_586",vU="_smaActionRow_aragl_599",bU="_smaActionBtn_aragl_604",wU="_smaActionBtnActive_aragl_626",_U="_smaActionIcon_aragl_632",xU="_smaImportSection_aragl_639",CU="_smaImportScan_aragl_649",kU="_smaImportList_aragl_655",jU="_smaImportRow_aragl_663",SU="_smaImportRowAddr_aragl_677",AU="_smaImportRowNet_aragl_682",EU="_smaImportLink_aragl_686",NU="_smaImportManual_aragl_699",MU="_smaImportInput_aragl_704",IU="_smaImportErr_aragl_718",BU="_smaImportActions_aragl_719",TU="_smaImportConfirm_aragl_720",PU="_accounts_aragl_736",RU="_acctRow_aragl_741",LU="_acctRowAccent_aragl_765",DU="_acctIcon_aragl_773",OU="_acctIconAccent_aragl_785",FU="_acctBody_aragl_790",zU="_acctLabel_aragl_796",$U="_acctValue_aragl_803",HU="_acctKicker_aragl_811",UU="_acctCopy_aragl_817",WU="_noSMA_aragl_834",VU="_noSMAIcon_aragl_847",GU="_noSMABody_aragl_858",qU="_noSMAKicker_aragl_864",KU="_noSMATitle_aragl_872",QU="_noSMASub_aragl_879",YU="_noSMACta_aragl_886",JU="_balance_aragl_914",XU="_balLabel_aragl_921",ZU="_balValWrap_aragl_929",eW="_balCurrency_aragl_939",tW="_balVal_aragl_929",nW="_balMeta_aragl_953",rW="_balDelta_aragl_963",sW="_balSep_aragl_973",aW="_balLifetime_aragl_979",oW="_actions_aragl_985",iW="_actionBtn_aragl_990",cW="_actionIcon_aragl_1009",lW="_actionBtnPrimary_aragl_1033",uW="_actionLabel_aragl_1050",dW="_disconnect_aragl_177",fW="_eoaLabel_aragl_1157",hW="_actionsHead_aragl_1159",pW="_ctaSheen_aragl_1",mW="_createSmaRow_aragl_1358",gW="_emptyCreate_aragl_1359",yW="_createSmaIcon_aragl_1372",vW="_emptyCreateIcon_aragl_1373",Se={overlay:_H,overlayFade:xH,panel:CH,slideIn:kH,panelOut:jH,slideOut:SH,hero:AH,avatarRing:EH,avatar:NH,identity:MH,identityKicker:IH,identityAddress:BH,identityCopyIcon:TH,identityActions:PH,settingsPill:RH,disconnectPill:LH,divider:DH,smasSection:OH,smasHead:FH,smasKicker:zH,smasCount:$H,smaList:HH,smaCard:UH,smaCardPrimary:WH,smaRow:VH,smaIcon:GH,smaBody:qH,smaTitleRow:KH,smaName:QH,smaNameInput:YH,smaPrimaryBadge:JH,smaRename:XH,smaAddress:ZH,smaMeta:eU,smaNetDot:tU,smaNetDot_arbitrum:nU,smaNetDot_base:rU,smaNetDot_ethereum:sU,smaNetDot_optimism:aU,smaNetDot_polygon:oU,smaNetStack:iU,smaNetName:cU,smaMetaSep:lU,smaAgentCount:uU,smaCopy:dU,smaActions:fU,smaSafeLink:hU,smaSafeLinkLabel:pU,smaSafeLinkChain:mU,smaAction:gU,smaActionPrimary:yU,smaActionRow:vU,smaActionBtn:bU,smaActionBtnActive:wU,smaActionIcon:_U,smaImportSection:xU,smaImportScan:CU,smaImportList:kU,smaImportRow:jU,smaImportRowAddr:SU,smaImportRowNet:AU,smaImportLink:EU,smaImportManual:NU,smaImportInput:MU,smaImportErr:IU,smaImportActions:BU,smaImportConfirm:TU,accounts:PU,acctRow:RU,acctRowAccent:LU,acctIcon:DU,acctIconAccent:OU,acctBody:FU,acctLabel:zU,acctValue:$U,acctKicker:HU,acctCopy:UU,noSMA:WU,noSMAIcon:VU,noSMABody:GU,noSMAKicker:qU,noSMATitle:KU,noSMASub:QU,noSMACta:YU,balance:JU,balLabel:XU,balValWrap:ZU,balCurrency:eW,balVal:tW,balMeta:nW,balDelta:rW,balSep:sW,balLifetime:aW,actions:oW,actionBtn:iW,actionIcon:cW,actionBtnPrimary:lW,actionLabel:uW,disconnect:dW,eoaLabel:fW,actionsHead:hW,ctaSheen:pW,createSmaRow:mW,emptyCreate:gW,createSmaIcon:yW,emptyCreateIcon:vW};function Pj(e){return!e||e.length<12?e??"":`${e.slice(0,6)}…${e.slice(-4)}`}function bW(){return o.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:[o.jsx("rect",{x:"2.5",y:"2.5",width:"7",height:"7",rx:"1.6",stroke:"currentColor",strokeWidth:"1.2"}),o.jsx("path",{d:"M4 4V3a1 1 0 011-1h4.5a1 1 0 011 1v5a1 1 0 01-1 1H9",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function wW(){return o.jsx("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function _W({open:e,wallet:t,onClose:n,onDisconnect:r}){const[a,c]=I.useState(!1),[l,u]=I.useState(!1);I.useEffect(()=>{if(!e)return;const h=m=>{m.key==="Escape"&&d()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[e]);function d(){c(!0),setTimeout(()=>{c(!1),n==null||n()},320)}function p(){var h;t&&((h=navigator==null?void 0:navigator.clipboard)!=null&&h.writeText&&navigator.clipboard.writeText(t),u(!0),setTimeout(()=>u(!1),1400))}return e?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Se.overlay,onClick:d,"aria-hidden":!0}),o.jsx("aside",{className:`${Se.panel} ${a?Se.panelOut:""}`,role:"dialog","aria-modal":"true","aria-label":"Account",children:o.jsxs("div",{className:Se.hero,children:[o.jsx("div",{className:Se.avatarRing,children:o.jsx("div",{className:Se.avatar,children:(t==null?void 0:t.slice(2,4).toUpperCase())??"U"})}),o.jsxs("div",{className:Se.identity,children:[o.jsx("span",{className:Se.identityKicker,children:"EOA · Owner"}),o.jsxs("button",{type:"button",className:Se.identityAddress,onClick:p,"aria-label":"Copy address",children:[o.jsx("span",{children:Pj(t)}),o.jsx("span",{className:Se.identityCopyIcon,"aria-hidden":!0,children:l?o.jsx(wW,{}):o.jsx(bW,{})})]})]}),o.jsx("button",{type:"button",className:Se.disconnectPill,onClick:r,children:"Disconnect"})]})})]}):null}function xW({open:e,onClose:t}){const n=kv(),{chainId:r}=dt(),{switchChainAsync:a}=Bs(),[c,l]=I.useState(null);return I.useEffect(()=>{if(!e)return;const u=p=>{var h,m;(m=(h=p.target)==null?void 0:h.closest)!=null&&m.call(h,`.${He.chainDropdownWrap}`)||t()},d=p=>{p.key==="Escape"&&t()};return window.addEventListener("click",u),window.addEventListener("keydown",d),()=>{window.removeEventListener("click",u),window.removeEventListener("keydown",d)}},[e,t]),e?o.jsxs("div",{className:He.chainMenu,children:[o.jsx("header",{className:He.chainMenuHeader,children:"Switch network"}),o.jsx("ul",{className:He.chainMenuList,children:n.map(u=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:`${He.chainOption} ${u.id===r?He.chainOptionActive:""}`,disabled:c===u.id,onClick:async()=>{l(u.id);try{await a({chainId:u.id})}catch{}l(null),t()},children:[o.jsx(Tj,{chainId:u.id,size:18}),o.jsx("span",{className:He.chainOptionName,children:u.name}),u.id===r&&o.jsx("span",{className:He.chainCheck,children:"✓"}),c===u.id&&o.jsx("span",{className:He.chainSwitching,children:"…"})]})},u.id))})]}):null}function Rj({eyebrow:e,title:t,backTo:n="#/dashboard",showBack:r=!0}){const[a,c]=I.useState(!1),[l,u]=I.useState(!1),{address:d,isConnected:p,chainId:h}=dt(),{openConnectModal:m}=Oi(),{disconnect:g}=Ri();return o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:He.header,children:[o.jsxs("div",{className:He.headerLeft,children:[o.jsx("button",{type:"button",className:He.brand,onClick:()=>{window.location.hash="#/dashboard"},"aria-label":"Go to dashboard",children:o.jsx(gn,{size:48,animate:!0})}),o.jsxs("div",{className:He.headerTitle,children:[o.jsx("span",{className:He.eyebrow,children:e}),o.jsx("h1",{className:He.title,children:t})]})]}),o.jsxs("div",{className:He.topActionsPill,children:[o.jsxs("div",{className:He.chainDropdownWrap,children:[o.jsx("button",{type:"button",className:He.notifBtn,onClick:()=>c(v=>!v),"aria-label":"Switch network",children:p&&h?o.jsx(Tj,{chainId:h,size:20}):o.jsx("span",{className:He.chainIconPlaceholder})}),o.jsx(xW,{open:a,onClose:()=>c(!1)})]}),o.jsxs("button",{type:"button",className:He.avatarBtn,onClick:p?()=>u(!0):m,"aria-label":p?"Open account":"Connect wallet",children:[o.jsx("span",{className:He.avatarBtnMonogram,"aria-hidden":!0,children:p&&d?d.slice(2,4).toUpperCase():"—"}),o.jsx("span",{className:He.avatarBtnAddr,children:p&&d?Pj(d):"Connect wallet"})]}),r&&o.jsx("button",{type:"button",className:He.backBtn,onClick:()=>{window.location.hash=n},"aria-label":"Go back",children:o.jsx("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M9 3L5 7l4 4"})})})]})]}),o.jsx(_W,{open:l,wallet:d,onClose:()=>u(!1),onDisconnect:()=>{u(!1),g()}})]})}const CW="_metaLabel_jkj8x_1",kW="_displayHeadline_jkj8x_11",jW="_italicMannerism_jkj8x_19",SW="_pageShell_jkj8x_27",ut={metaLabel:CW,displayHeadline:kW,italicMannerism:jW,pageShell:SW},AW="_shell_1m4oo_5",EW="_stage_1m4oo_17",NW="_stageInner_1m4oo_31",MW="_welcomeCard_1m4oo_170",IW="_authCard_1m4oo_171",BW="_cardSai_1m4oo_197",TW="_cardHeader_1m4oo_218",PW="_kicker_1m4oo_228",RW="_cardHeadline_1m4oo_237",LW="_cardSub_1m4oo_254",DW="_cardTagline_1m4oo_264",OW="_backBtn_1m4oo_272",FW="_welcomeCta_1m4oo_297",zW="_fineprint_1m4oo_406",$W="_mandateSignedPrompt_1m4oo_1162",HW="_mandateSignedPromptLabel_1m4oo_1170",UW="_mandateSignedPromptText_1m4oo_1178",WW="_mandateSignedCopyBtn_1m4oo_1185",VW="_embeddedFlow_1m4oo_1199",GW="_actionRow_1m4oo_1211",qW="_rejectBtn_1m4oo_1216",Je={shell:AW,stage:EW,stageInner:NW,welcomeCard:MW,authCard:IW,cardSai:BW,cardHeader:TW,kicker:PW,cardHeadline:RW,cardSub:LW,cardTagline:DW,backBtn:OW,welcomeCta:FW,fineprint:zW,mandateSignedPrompt:$W,mandateSignedPromptLabel:HW,mandateSignedPromptText:UW,mandateSignedCopyBtn:WW,embeddedFlow:VW,actionRow:GW,rejectBtn:qW};function Lj({eyebrow:e="WELCOME TO SAIL",title:t="Separately Managed Accounts.",sub:n="Enforced by code, run by agents."}){const{openConnectModal:r}=Oi();return o.jsxs(Kt,{className:Je.welcomeCard,children:[o.jsx("div",{className:Je.cardSai,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("header",{className:Je.cardHeader,children:[o.jsx("span",{className:Je.kicker,children:e}),o.jsx("h1",{className:`${ut.displayHeadline} ${Je.cardHeadline}`,children:t}),o.jsx("p",{className:`${ut.italicMannerism} ${Je.cardTagline}`,children:n})]}),o.jsx("div",{className:Je.welcomeCta,children:o.jsx(Ze,{fullWidth:!0,onClick:r,children:"Connect wallet"})}),o.jsx("p",{className:Je.fineprint,children:"Self-custody. Sail never holds your keys."})]})}const Up=5e3;function Ts(e,t,n=Up,r=0,a={}){const{fastWhile:c,fastMs:l=1500}=a,[u,d]=I.useState(t),[p,h]=I.useState(!0),[m,g]=I.useState(null);return I.useEffect(()=>{let v=!0,b;async function _(){let x;try{const A=await fetch(e);if(!A.ok)v&&(d(t),g(null));else{const k=await A.json();x=k,v&&(d(k),g(null))}}catch(A){v&&g(A)}finally{v&&h(!1)}if(!v)return;const j=c&&x!==void 0&&c(x)?l:n;b=setTimeout(_,j)}return _(),()=>{v=!1,clearTimeout(b)}},[e,n,l,r]),{data:u,loading:p,error:m}}function vl(e){const{data:t,loading:n,error:r}=Ts("/api/account",null,Up,e);return{account:t,loading:n,error:r}}function KW(e){const{data:t,loading:n,error:r}=Ts("/api/accounts",[],Up,e);return{accounts:t??[],loading:n,error:r}}async function QW(e){const t=await fetch("/api/account/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({safe:e})});if(!t.ok)throw new Error(`Switch failed (${t.status})`);return t.json()}async function C6(e,t){const n=await fetch("/api/account/rename",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({safe:e,name:t})});if(!n.ok)throw new Error(`Rename failed (${n.status})`);return n.json()}function YW(e){const{data:t,loading:n,error:r}=Ts("/api/overview",null,15e3,e,{fastWhile:a=>a!=null&&a.rpcConfigured===!0&&a.onchain!==!0,fastMs:1500});return{overview:t,loading:n,error:r}}function Dj(e){const{data:t,loading:n,error:r}=Ts("/api/activity",[],Up,e);return{events:Array.isArray(t)?t:[],loading:n,error:r}}function Wp(e){const{data:t,loading:n,error:r}=Ts("/api/mandate",[],1e4,e);return{mandates:Array.isArray(t)?t:t?[t]:[],loading:n,error:r}}function Oj(){const{data:e,loading:t}=Ts("/api/agent-status",{running:!1},5e3);return{running:(e==null?void 0:e.running)===!0,pid:(e==null?void 0:e.pid)??null,pids:Array.isArray(e==null?void 0:e.pids)?e.pids:[],source:(e==null?void 0:e.source)??null,lastActivityMs:(e==null?void 0:e.lastActivityMs)??null,githubActions:(e==null?void 0:e.githubActions)??null,loading:t}}function JW(){const{data:e,loading:t}=Ts("/api/station/pending",[],3e3);return{pending:Array.isArray(e)?e:[],loading:t}}const XW={1:"https://safe-transaction-mainnet.safe.global",10:"https://safe-transaction-optimism.safe.global",56:"https://safe-transaction-bsc.safe.global",100:"https://safe-transaction-gnosis-chain.safe.global",137:"https://safe-transaction-polygon.safe.global",8453:"https://safe-transaction-base.safe.global",130:"https://safe-transaction-unichain.safe.global",42161:"https://safe-transaction-arbitrum.safe.global",43114:"https://safe-transaction-avalanche.safe.global",59144:"https://safe-transaction-linea.safe.global",84532:"https://safe-transaction-base-sepolia.safe.global",421614:"https://safe-transaction-arbitrum-sepolia.safe.global",11155111:"https://safe-transaction-sepolia.safe.global"};function Fj(e,t){const[n,r]=I.useState([]),[a,c]=I.useState(!1),[l,u]=I.useState(!1);return I.useEffect(()=>{if(!t||!e){r([]),c(!1),u(!1);return}let d=!0;c(!0),u(!1),r([]);async function p(){const h=[];for(const[m,g]of Object.entries(XW))try{const v=await fetch(`${g}/api/v1/owners/${e}/safes/`);if(!v.ok)continue;const b=await v.json();for(const _ of(b==null?void 0:b.safes)??[])h.push({safe:_,chainId:Number(m)});d&&h.length>0&&r([...h])}catch{}d&&(c(!1),u(!0))}return p(),()=>{d=!1}},[e,t]),{safes:n,scanning:a,done:l}}function Qv(){const{data:e,loading:t,error:n}=Ts("/api/mandate-draft",null,5e3);return{draft:e,loading:t,error:n}}function zj(e){const{data:t,loading:n,error:r}=Ts("/api/positions",{positions:[],updatedAt:null},15e3,e);return{positions:(t==null?void 0:t.positions)??[],updatedAt:(t==null?void 0:t.updatedAt)??null,loading:n,error:r}}function ZW(e){const{data:t,loading:n,error:r}=Ts("/api/overviews",[],15e3,e,{fastWhile:a=>Array.isArray(a)&&a.some(c=>(c==null?void 0:c.rpcConfigured)===!0&&(c==null?void 0:c.onchain)!==!0),fastMs:1500});return{overviews:Array.isArray(t)?t:[],loading:n,error:r}}function U1(e){return!e||e.length<12?e??"":`${e.slice(0,6)}…${e.slice(-4)}`}const eV={ethereum:"eth",arbitrum:"arb1",base:"base",unichain:"unichain",optimism:"oeth",polygon:"matic"};function tV(e,t){return`https://app.safe.global/home?safe=${eV[e]??"eth"}:${t}`}function nV(){return o.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M5 9 L9 5"}),o.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}const rV={1:"Ethereum",10:"Optimism",137:"Polygon",8453:"Base",42161:"Arbitrum",130:"Unichain",84532:"Base Sepolia",421614:"Arb Sepolia"};function $j({open:e,wallet:t,safes:n=[],currentSafeId:r,hasSMA:a=!0,onClose:c,onDisconnect:l,onCreateSMA:u,onImportSMA:d,onRenameSafe:p,onSelectSafe:h}){const[m,g]=I.useState(!1),[v,b]=I.useState(null),[_,x]=I.useState(null),[j,A]=I.useState(""),[k,N]=I.useState(!1),[E,B]=I.useState(!1),[M,P]=I.useState(""),[R,z]=I.useState("8453"),[q,Q]=I.useState(""),{safes:O,scanning:K,done:$}=Fj(t,k&&!E);I.useEffect(()=>{if(!e)return;const Y=ue=>{ue.key==="Escape"&&L()};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[e]);function L(){g(!0),setTimeout(()=>{g(!1),c==null||c()},320)}function se(Y,ue){var xe;ue&&((xe=navigator==null?void 0:navigator.clipboard)!=null&&xe.writeText&&navigator.clipboard.writeText(ue),b(Y),setTimeout(()=>b(Re=>Re===Y?null:Re),1400))}function D(Y){x(Y.id),A(Y.name)}function X(){const Y=j.trim();_&&Y&&(p==null||p(_,Y)),x(null)}function te(){x(null)}function W(Y,ue){d==null||d({safe:Y,owner:t??Y,permissionSigner:t??Y,manager:t??Y,chainId:ue,createdAtBlock:"0"}),N(!1),L()}function oe(){const Y=M.trim();if(!/^0x[0-9a-fA-F]{40}$/.test(Y)){Q("Enter a valid 0x address.");return}const ue=Number(R);if(!ue){Q("Enter a valid chain ID.");return}W(Y,ue)}if(!e)return null;const be=a?n:[];return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Se.overlay,onClick:L,"aria-hidden":!0}),o.jsxs("aside",{className:`${Se.panel} ${m?Se.panelOut:""}`,role:"dialog","aria-modal":"true","aria-label":"Account",children:[o.jsxs("div",{className:Se.hero,children:[o.jsx("div",{className:Se.avatarRing,children:o.jsx("div",{className:Se.avatar,children:(t==null?void 0:t.slice(2,4).toUpperCase())??"U"})}),o.jsxs("div",{className:Se.identity,children:[o.jsx("span",{className:Se.identityKicker,children:"EOA · Owner"}),o.jsxs("button",{type:"button",className:Se.identityAddress,onClick:()=>se("eoa",t),"aria-label":"Copy EOA address",children:[o.jsx("span",{children:U1(t)}),o.jsx("span",{className:Se.identityCopyIcon,"aria-hidden":!0,children:v==="eoa"?o.jsx(j6,{}):o.jsx(k6,{})})]})]}),o.jsx("button",{type:"button",className:Se.disconnectPill,onClick:l??L,children:"Disconnect"})]}),o.jsx("div",{className:Se.divider}),o.jsxs("section",{className:Se.smasSection,children:[o.jsxs("header",{className:Se.smasHead,children:[o.jsx("span",{className:Se.smasKicker,children:"Separately Managed Accounts"}),o.jsxs("span",{className:Se.smasCount,children:[be.length," ",be.length===1?"SMA":"SMAs"]})]}),be.length>0?o.jsxs("ul",{className:Se.smaList,children:[be.map(Y=>{var Re;const ue=((Re=Y.id)==null?void 0:Re.toLowerCase())===(r==null?void 0:r.toLowerCase()),xe=Y.id===_;return o.jsxs("li",{className:`${Se.smaCard} ${ue?Se.smaCardPrimary:""}`,children:[o.jsxs("button",{type:"button",className:Se.smaRow,onClick:()=>{xe||h==null||h(Y)},children:[o.jsx("span",{className:Se.smaIcon,"aria-hidden":!0,children:o.jsx(S6,{})}),o.jsxs("span",{className:Se.smaBody,children:[o.jsxs("span",{className:Se.smaTitleRow,children:[xe?o.jsx("input",{autoFocus:!0,type:"text",value:j,onChange:Ae=>A(Ae.target.value),onClick:Ae=>Ae.stopPropagation(),onKeyDown:Ae=>{Ae.key==="Enter"&&(Ae.preventDefault(),X()),Ae.key==="Escape"&&(Ae.preventDefault(),te())},onBlur:X,className:Se.smaNameInput,maxLength:40,"aria-label":`Rename ${Y.name}`}):o.jsx("span",{className:Se.smaName,children:Y.name}),ue&&!xe&&o.jsx("span",{className:Se.smaPrimaryBadge,children:"Current"}),!xe&&o.jsx("span",{className:Se.smaRename,role:"button",tabIndex:0,onClick:Ae=>{Ae.stopPropagation(),D(Y)},onKeyDown:Ae=>{(Ae.key==="Enter"||Ae.key===" ")&&(Ae.preventDefault(),Ae.stopPropagation(),D(Y))},"aria-label":`Rename ${Y.name}`,children:o.jsx(sV,{})})]}),o.jsx("span",{className:Se.smaAddress,children:U1(Y.address)}),o.jsxs("span",{className:Se.smaMeta,children:[Y.networks&&Y.networks.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:Se.smaNetStack,"aria-hidden":!0,children:Y.networks.slice(0,4).map(Ae=>o.jsx("span",{className:`${Se.smaNetDot} ${Se[`smaNetDot_${Ae}`]??""}`},Ae))}),o.jsx("span",{className:Se.smaNetName,children:"Multichain"})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:`${Se.smaNetDot} ${Se[`smaNetDot_${Y.network}`]??""}`,"aria-hidden":!0}),o.jsx("span",{className:Se.smaNetName,children:bh(Y.network)})]}),o.jsx("span",{className:Se.smaMetaSep,"aria-hidden":!0,children:"·"}),o.jsxs("span",{className:Se.smaAgentCount,children:[Y.mandateCount," ",Y.mandateCount===1?"mandate":"mandates"]})]})]}),o.jsx("span",{className:Se.smaCopy,role:"button",tabIndex:0,onClick:Ae=>{Ae.stopPropagation(),se(Y.id,Y.address)},onKeyDown:Ae=>{(Ae.key==="Enter"||Ae.key===" ")&&(Ae.preventDefault(),Ae.stopPropagation(),se(Y.id,Y.address))},"aria-label":`Copy ${Y.name} address`,children:v===Y.id?o.jsx(j6,{}):o.jsx(k6,{})})]}),o.jsxs("a",{className:Se.smaSafeLink,href:tV(Y.network,Y.address),target:"_blank",rel:"noreferrer",onClick:Ae=>Ae.stopPropagation(),"aria-label":`Open ${Y.name} in the Safe app on ${bh(Y.network)}`,children:[o.jsxs("span",{className:Se.smaSafeLinkLabel,children:["Open in Safe",o.jsx("span",{className:Se.smaSafeLinkChain,children:Y.networks&&Y.networks.length>1?` · ${bh(Y.network)} (home)`:` · ${bh(Y.network)}`})]}),o.jsx(nV,{})]})]},Y.id)}),o.jsxs("li",{className:Se.smaActionRow,children:[o.jsxs("button",{type:"button",className:Se.smaActionBtn,onClick:u,children:[o.jsx("span",{className:Se.smaActionIcon,"aria-hidden":!0,children:"+"}),"Create"]}),o.jsxs("button",{type:"button",className:`${Se.smaActionBtn} ${k?Se.smaActionBtnActive:""}`,onClick:()=>{N(Y=>!Y),B(!1),Q("")},children:[o.jsx("span",{className:Se.smaActionIcon,"aria-hidden":!0,children:"↓"}),"Import"]})]}),k&&o.jsx("li",{className:Se.smaImportSection,children:E?o.jsxs("div",{className:Se.smaImportManual,children:[o.jsx("input",{className:Se.smaImportInput,type:"text",placeholder:"Safe address 0x…",value:M,onChange:Y=>{P(Y.target.value),Q("")},spellCheck:!1,autoFocus:!0}),o.jsx("input",{className:Se.smaImportInput,type:"text",placeholder:"Chain ID e.g. 8453",value:R,onChange:Y=>{z(Y.target.value),Q("")}}),q&&o.jsx("span",{className:Se.smaImportErr,children:q}),o.jsxs("div",{className:Se.smaImportActions,children:[o.jsx("button",{type:"button",className:Se.smaImportConfirm,onClick:oe,children:"Import SMA"}),o.jsx("button",{type:"button",className:Se.smaImportLink,onClick:()=>{B(!1),Q("")},children:"← Back"})]})]}):o.jsxs(o.Fragment,{children:[K&&O.length===0&&o.jsx("span",{className:Se.smaImportScan,children:"Scanning for Safes…"}),O.length>0&&o.jsx("ul",{className:Se.smaImportList,children:O.map(Y=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:Se.smaImportRow,onClick:()=>W(Y.safe,Y.chainId),children:[o.jsx("span",{className:Se.smaImportRowAddr,children:U1(Y.safe)}),o.jsx("span",{className:Se.smaImportRowNet,children:rV[Y.chainId]??`chain ${Y.chainId}`})]})},`${Y.chainId}-${Y.safe}`))}),$&&O.length===0&&o.jsx("span",{className:Se.smaImportScan,children:"No Safes found for this wallet."}),o.jsx("button",{type:"button",className:Se.smaImportLink,onClick:()=>B(!0),children:"Enter address manually"})]})})]}):o.jsxs("div",{className:Se.noSMA,children:[o.jsx("span",{className:Se.noSMAIcon,"aria-hidden":!0,children:o.jsx(S6,{})}),o.jsxs("div",{className:Se.noSMABody,children:[o.jsx("span",{className:Se.noSMAKicker,children:"Separately Managed Account"}),o.jsx("span",{className:Se.noSMATitle,children:"No SMA created yet"}),o.jsx("span",{className:Se.noSMASub,children:"Your SMA is deployed when you create your first agent."})]}),o.jsxs("button",{type:"button",className:Se.noSMACta,onClick:u,children:["Create your first agent",o.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M3 7h8M8 4l3 3-3 3"})})]})]})]})]})]})}function bh(e){return e&&e[0].toUpperCase()+e.slice(1)}function k6(){return o.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:[o.jsx("rect",{x:"2.5",y:"2.5",width:"7",height:"7",rx:"1.6",stroke:"currentColor",strokeWidth:"1.2"}),o.jsx("path",{d:"M4 4V3a1 1 0 011-1h4.5a1 1 0 011 1v5a1 1 0 01-1 1H9",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function j6(){return o.jsx("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function sV(){return o.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M9.5 1.6l2.9 2.9-7.6 7.6-3.2.4.4-3.2 7.5-7.7z",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M9 2.1l2.9 2.9",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function S6(){return o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:[o.jsx("rect",{x:"2.5",y:"3.5",width:"15",height:"13",rx:"2.6",stroke:"currentColor",strokeWidth:"1.4"}),o.jsx("circle",{cx:"10",cy:"10",r:"3",stroke:"currentColor",strokeWidth:"1.4"}),o.jsx("path",{d:"M10 7v.6M10 13.4v-.6M13 10h-.6M7.6 10H7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}const aV="_overlay_19cpu_1",oV="_card_19cpu_20",iV="_close_19cpu_52",cV="_headline_19cpu_78",lV="_lede_19cpu_85",uV="_promptBlock_19cpu_91",dV="_prompt_19cpu_91",fV="_copyBtn_19cpu_113",hV="_actions_19cpu_136",pV="_providerOpenBtn_19cpu_152",mV="_foot_19cpu_182",Xr={overlay:aV,card:oV,close:iV,headline:cV,lede:lV,promptBlock:uV,prompt:dV,copyBtn:fV,actions:hV,providerOpenBtn:pV,foot:mV},gV={claude:{bg:"linear-gradient(180deg, #D58066 0%, #BC6849 100%)",border:"#C57458",text:"#FFFFFF",shadow:"rgba(204, 120, 92, 0.5)"},cursor:{bg:"linear-gradient(180deg, #DDE3EE 0%, #B5BFD0 100%)",border:"#C9D2E0",text:"#0B0F17",shadow:"rgba(200, 210, 225, 0.42)"},codex:{bg:"linear-gradient(180deg, #11B58C 0%, #0D8C6C 100%)",border:"#11A07E",text:"#FFFFFF",shadow:"rgba(16, 163, 127, 0.5)"},default:{bg:"linear-gradient(180deg, #2F9CFF 0%, #1378E8 100%)",border:"#2D8EE8",text:"#FFFFFF",shadow:"rgba(25, 144, 255, 0.5)"}};function yV(e){const t=(e??"").toLowerCase();return t==="claude"||t==="anthropic"?"claude":t==="cursor"?"cursor":t==="codex"||t==="chatgpt"||t==="openai"||t==="gpt"?"codex":"default"}function vV({provider:e,onClick:t,children:n}){const r=gV[e],a={"--po-bg":r.bg,"--po-border":r.border,"--po-text":r.text,"--po-shadow":r.shadow};return o.jsx("button",{type:"button",className:Xr.providerOpenBtn,style:a,onClick:t,children:n})}function Yv({open:e,variant:t="new",context:n="agent",mandate:r=null,onClose:a}){const[c,l]=I.useState(!1);if(I.useEffect(()=>{if(!e)return;const g=v=>{v.key==="Escape"&&(a==null||a())};return window.addEventListener("keydown",g),document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",g),document.body.style.overflow=""}},[e,a]),!e)return null;const u=t==="redraft",d=n==="mandate",p=n==="station",h=u&&r?`Sailor, redraft my "${r.title}" agent. I want to change [describe the change].`:d?"Sailor, I want to register a permission that lets my agent swap up to $100 USDC into ETH weekly on Base.":p?"How do I get started with Sailor? I want to set up an agent, deploy a permission contract, and start the signing station.":"Sailor, I want to register a permission that lets my agent swap up to $100 USDC into ETH weekly on Base.";yV(r==null?void 0:r.aiName),r==null||r.aiName;function m(){var g;(g=navigator==null?void 0:navigator.clipboard)!=null&&g.writeText&&navigator.clipboard.writeText(h),l(!0),setTimeout(()=>l(!1),1500)}return o.jsx("div",{className:Xr.overlay,role:"dialog","aria-modal":"true",onClick:a,children:o.jsxs(Kt,{className:Xr.card,onClick:g=>g.stopPropagation(),children:[o.jsx("button",{type:"button",className:Xr.close,onClick:a,"aria-label":"Close",children:"×"}),o.jsx("h2",{className:`${ut.displayHeadline} ${Xr.headline}`,children:u?"Send this back to your AI.":d?"Mandates start with your AI.":p?"Get started with your AI.":"Agents start with your AI."}),o.jsx("p",{className:`${ut.italicMannerism} ${Xr.lede}`,children:u?"Tell your AI what to change. It will redraft the agent and a new signature request will appear here.":d?"A mandate defines the permissions your agents operate under. Your AI drafts it — you sign each permission onchain.":p?"Ask your AI to walk you through setting up Sailor — from keys and mandates to running your first agent.":"Your AI drafts the agent strategy. You review and authorize it here before it touches your funds."}),o.jsxs("div",{className:Xr.promptBlock,children:[o.jsx("span",{className:ut.metaLabel,children:"Try saying"}),o.jsxs("p",{className:Xr.prompt,children:["“",h,"”"]}),o.jsx("button",{type:"button",className:Xr.copyBtn,onClick:m,children:c?"✓ Copied":"Copy prompt"})]}),o.jsx("div",{className:Xr.actions,children:o.jsx(vV,{provider:"default",onClick:m,children:"Copy prompt →"})}),o.jsx("p",{className:Xr.foot,children:"Paste this into your AI coding assistant (Claude Code, Cursor, Codex, …) to get started."})]})})}const bV=3e3,A6=(()=>{if(typeof window>"u")return null;const e=new URLSearchParams(window.location.search).get("server");if(!e)return null;const t=Number(e);return!Number.isInteger(t)||t<1024||t>65535?null:t})();function E6(){return typeof window>"u"?null:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/station/ws`}async function wV(){var t,n;if(A6){try{const a=await fetch(`http://localhost:${A6}/config`,{signal:AbortSignal.timeout(1500)});if(a.ok){const c=await a.json();if((t=c==null?void 0:c.wsUrl)!=null&&t.includes("secret="))return c}}catch{}const r=E6();return r?{wsUrl:r}:null}try{const r=await fetch(`${window.location.origin}/config`,{signal:AbortSignal.timeout(500)});if(r.ok){const a=await r.json();if((n=a==null?void 0:a.wsUrl)!=null&&n.includes("secret="))return a}}catch{}const e=E6();return e?{wsUrl:e}:null}function Hj({onMessage:e,enabled:t=!0}={}){const[n,r]=I.useState("checking"),a=I.useRef(null),c=I.useRef(null),l=I.useRef(e);I.useEffect(()=>{l.current=e});const u=I.useCallback(p=>{var m;if(((m=a.current)==null?void 0:m.readyState)===WebSocket.OPEN)return;const h=new WebSocket(p);a.current=h,c.current=g=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify(g))},h.onopen=()=>r("connected"),h.onmessage=g=>{var v;try{(v=l.current)==null||v.call(l,JSON.parse(g.data))}catch{}},h.onclose=()=>{r("disconnected"),a.current=null},h.onerror=()=>{r("disconnected"),a.current=null}},[]);I.useEffect(()=>{if(!t)return;let p=!1;const h=async()=>{var v;if(((v=a.current)==null?void 0:v.readyState)===WebSocket.OPEN)return;const g=await wV();p||(g?u(g.wsUrl):r(b=>b==="checking"?"disconnected":b))};h();const m=setInterval(h,bV);return()=>{p=!0,clearInterval(m)}},[t,u]);const d=I.useCallback(p=>{var h;(h=c.current)==null||h.call(c,p)},[]);return{status:n,send:d}}const qr="0x38b508756c976e876EFF05a29E731A4d348BA6ED",Kr="0x6d2C802ffa0d9A8Ed69A5Bf22c1b63ccB566B8Fc",Qr="0x4315B37cA4A315A7042af1Fcb37F8436f4D24356",_V={1:{chainId:1,name:"Ethereum",rpcEnvVar:"ETH_MAINNET_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},8453:{chainId:8453,name:"Base",rpcEnvVar:"BASE_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},42161:{chainId:42161,name:"Arbitrum",rpcEnvVar:"ARBITRUM_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},10:{chainId:10,name:"Optimism",rpcEnvVar:"OPTIMISM_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},130:{chainId:130,name:"Unichain",rpcEnvVar:"UNICHAIN_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},56:{chainId:56,name:"BSC",rpcEnvVar:"BSC_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},480:{chainId:480,name:"World Chain",rpcEnvVar:"WORLD_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},999:{chainId:999,name:"HyperEVM",rpcEnvVar:"HYPEREVM_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},4326:{chainId:4326,name:"MegaETH",rpcEnvVar:"MEGAETH_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},84532:{chainId:84532,name:"Base Sepolia",rpcEnvVar:"BASE_SEPOLIA_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},11155111:{chainId:11155111,name:"Eth Sepolia",rpcEnvVar:"SEPOLIA_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}}};function my(e){const t=_V[e];if(!t)throw new Error(`Chain ${e} is not supported. Supported chains: 1 (Ethereum), 8453 (Base), 42161 (Arbitrum), 10 (Optimism), 130 (Unichain), 56 (BSC), 480 (World Chain), 999 (HyperEVM), 4326 (MegaETH), 84532 (Base Sepolia), 11155111 (Eth Sepolia).`);return t}const xV="0x38b508756c976e876EFF05a29E731A4d348BA6ED",CV="0x4315B37cA4A315A7042af1Fcb37F8436f4D24356",kV="0xC1E5F9A581D4100Aa949f80204540a33aD97A7b6",jV="0x7897Cb53a4be4a2eaAf46D60573C4Fd83b33fE1F",SV="0x6d2C802ffa0d9A8Ed69A5Bf22c1b63ccB566B8Fc",AV="0x1087312447C8a2BfA15EB9cE23590E3502DBA04b",EV="0xB01dCE443d052e44b7D13726c0EC9fFB7f5815B6",NV="0x7b37F85575F1568a37dBA342BC5FE6d393F0872f",MV=10000000000000000n,Jo={swap:"0x35cEEa0db96997Cc3CF3beB42FFa36A499342F7C",swapNoOracle:"0x34Ba96CbEd1f46c88A5265E645DC5fe41662b519",borrow:"0x3e2666051599223cEAb10De55C89A0842857d8AF",deposit:"0xBfB5e13a97b12Ee89d2F2b9B65eCf7e0E371911f",withdraw:"0xF5eF5dda450a130e3020d54f565E830e4a7531f8",transfer:"0xda909a1CC584fb7559Ce4A828b008B473Da095e1",approveAndCallBatch:"0x0535A4D51333484ef583103DAB1a9449756ab732"},IV=[{kind:"SwapPermission",address:Jo.swap,label:"Swap"},{kind:"SwapPermissionNoOracle",address:Jo.swapNoOracle,label:"Swap (no oracle)"},{kind:"BorrowPermission",address:Jo.borrow,label:"Borrow"},{kind:"DepositPermission",address:Jo.deposit,label:"Deposit"},{kind:"WithdrawPermission",address:Jo.withdraw,label:"Withdraw"},{kind:"TransferPermission",address:Jo.transfer,label:"Transfer"},{kind:"ApproveAndCallBatchPermission",address:Jo.approveAndCallBatch,label:"Approve + call batch"}],Yr={deployer:EV,governance:CV,timelock:kV,kernel:xV,mandateFactory:SV,standardFeePolicy:AV,safeModuleEnabler:jV,treasury:NV,maxPermissionFeeWei:MV,initialBaseFee:0n,initialComplexityRate:0n,dispatchModel:"selective",standaloneTemplates:{}};function Jr(e){return IV.map(t=>({...t,chainId:e}))}const Jv={1:{...Yr,chainId:1,blockNumber:25432741,knownTemplates:Jr(1)},8453:{...Yr,chainId:8453,blockNumber:48029413,knownTemplates:Jr(8453)},42161:{...Yr,chainId:42161,blockNumber:25432669,knownTemplates:Jr(42161)},10:{...Yr,chainId:10,blockNumber:153625159,knownTemplates:Jr(10)},130:{...Yr,chainId:130,blockNumber:52100873,knownTemplates:Jr(130)},56:{...Yr,chainId:56,blockNumber:107312662,knownTemplates:Jr(56)},480:{...Yr,chainId:480,blockNumber:31756901,knownTemplates:Jr(480)},999:{...Yr,chainId:999,blockNumber:39238629,knownTemplates:Jr(999)},4326:{...Yr,chainId:4326,blockNumber:20056530,knownTemplates:Jr(4326)},84532:{...Yr,chainId:84532,blockNumber:43539604,knownTemplates:Jr(84532)},11155111:{...Yr,chainId:11155111,blockNumber:11174750,knownTemplates:Jr(11155111)}};function Uj(e){const t=Jv[e];if(!t)throw new Error(`No Sail deployment is bundled for chain ${e}`);return t}const BV=Is({id:130,name:"Unichain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.unichain.org/"]}},blockExplorers:{default:{name:"Uniscan",url:"https://uniscan.xyz"}}}),TV=Is({id:1301,name:"Unichain Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.unichain.org/"]}},blockExplorers:{default:{name:"Uniscan Sepolia",url:"https://sepolia.uniscan.xyz"}},testnet:!0}),Wj=[h4,UR,Lp,BV,p4,WR,TV,VR],PV="sailor-local-dev",RV=Ez({appName:"Sailor",projectId:PV,chains:Wj,ssr:!1}),LV=Object.fromEntries(Wj.filter(e=>{var t,n;return(n=(t=e==null?void 0:e.blockExplorers)==null?void 0:t.default)==null?void 0:n.url}).map(e=>[e.id,{name:e.blockExplorers.default.name,url:e.blockExplorers.default.url.replace(/\/$/,"")}])),DV={10:{name:"Optimistic Etherscan",url:"https://optimistic.etherscan.io"},137:{name:"Polygonscan",url:"https://polygonscan.com"},56:{name:"BscScan",url:"https://bscscan.com"},480:{name:"Worldscan",url:"https://worldscan.org"},999:{name:"HyperEVM Scan",url:"https://hyperevmscan.io"},6342:{name:"MegaExplorer",url:"https://megaexplorer.xyz"}},OV={ethereum:1,base:8453,arbitrum:42161,"arbitrum one":42161,unichain:130,optimism:10,polygon:137,binance:56,world:480,hyperevm:999,megaeth:6342,"base sepolia":84532,"eth sepolia":11155111,"ethereum sepolia":11155111,"arbitrum sepolia":421614,"unichain sepolia":1301};function FV(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=e.trim().toLowerCase().replace(/[-_]+/g," ").replace(/\s+/g," ");return OV[t]??null}return null}function Vj(e){const t=FV(e);return t==null?null:LV[t]??DV[t]??null}function Ni(e,t){const n=Vj(e);return n?`${n.url}/tx/${t}`:null}function Xv(e,t){const n=Vj(e);return n?`${n.url}/address/${t}`:null}function Rd(e,t){const n=Xv(e,t);return n?`${n}#code`:null}function zV(){const{draft:e}=Qv();return e?o.jsx(Gj,{draft:e}):o.jsx($V,{})}function $V(){return o.jsxs("div",{className:Je.shell,children:[o.jsx(ga,{}),o.jsx(qj,{state:"welcome"}),o.jsx("main",{className:Je.stage,children:o.jsx("div",{className:Je.stageInner,children:o.jsxs(Kt,{className:Je.welcomeCard,children:[o.jsx("div",{className:Je.cardSai,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("header",{className:Je.cardHeader,children:[o.jsx("span",{className:Je.kicker,children:"SIGNING STATION"}),o.jsx("h1",{className:`${ut.displayHeadline} ${Je.cardHeadline}`,children:"No pending signatures."}),o.jsxs("p",{className:`${ut.italicMannerism} ${Je.cardTagline}`,children:["Run ",o.jsx("code",{style:{fontSize:13,opacity:.8},children:"sailor mandate prepare"})," to queue a mandate for signing."]})]}),o.jsx("div",{className:Je.welcomeCta,children:o.jsx(Ze,{fullWidth:!0,onClick:()=>{window.location.hash="#/dashboard"},children:"Go to dashboard"})})]})})})]})}new Set(Object.keys(Jv).map(Number));const HV=[{type:"function",name:"signerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]}];function UV({ex:e}){var t,n;return o.jsxs("div",{style:{marginTop:10,paddingTop:10,borderTop:"1px solid var(--glass-border)"},children:[o.jsx(Bj,{items:[e.protocol,e.chain,e.version]}),((t=e.enforced)==null?void 0:t.length)>0&&o.jsxs("div",{style:{marginBottom:8},children:[o.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"#5dde8b",marginBottom:5},children:"Enforced on-chain"}),o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:3},children:e.enforced.map((r,a)=>o.jsxs("li",{style:{fontSize:12,color:"rgba(255,255,255,0.65)",paddingLeft:12,position:"relative"},children:[o.jsx("span",{style:{position:"absolute",left:0,color:"#5dde8b"},children:"·"}),r]},a))})]}),((n=e.notEnforced)==null?void 0:n.length)>0&&o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgba(255,255,255,0.3)",marginBottom:5},children:"Agent code — not enforced on-chain"}),o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:3},children:e.notEnforced.map((r,a)=>o.jsxs("li",{style:{fontSize:12,color:"rgba(255,255,255,0.3)",paddingLeft:12,position:"relative"},children:[o.jsx("span",{style:{position:"absolute",left:0},children:"·"}),r]},a))})]})]})}function WV({item:e,chainId:t}){const[n,r]=I.useState(!1),a=e.permExplanation,c=e.address?Rd(t,e.address):null;return o.jsxs("li",{style:{borderRadius:2,background:"var(--glass-bg)",border:"1px solid var(--glass-border)",overflow:"hidden"},children:[o.jsxs("div",{onClick:()=>a&&r(l=>!l),style:{padding:"10px 12px",cursor:a?"pointer":"default",display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8},children:[o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx("div",{style:{color:"var(--text-secondary)",fontSize:14,lineHeight:1.5},children:e.explanation}),e.address&&o.jsxs("div",{style:{fontSize:11,color:"rgba(255,255,255,0.25)",marginTop:2,fontFamily:"monospace",display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[o.jsxs("span",{children:[e.address.slice(0,6),"…",e.address.slice(-4)]}),c&&o.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",onClick:l=>l.stopPropagation(),style:{color:"#7eb8f7",textDecoration:"none"},children:"View code on scanner ↗"})]})]}),a&&o.jsxs("span",{style:{flexShrink:0,display:"inline-flex",alignItems:"center",gap:5,padding:"3px 8px",borderRadius:4,border:"1px solid rgba(255,255,255,0.12)",background:n?"rgba(255,255,255,0.07)":"rgba(255,255,255,0.03)",fontSize:11,color:"rgba(255,255,255,0.5)",fontWeight:500,whiteSpace:"nowrap",transition:"background 0.15s, color 0.15s",userSelect:"none"},children:["Details",o.jsx("span",{style:{fontSize:8,display:"inline-block",transform:n?"rotate(180deg)":"none",transition:"transform 0.2s",opacity:.6},children:"▾"})]})]}),n&&a&&o.jsx("div",{style:{padding:"0 12px 12px"},children:o.jsx(UV,{ex:a})})]})}function VV({fee:e}){return o.jsxs("div",{style:{marginTop:4,marginBottom:4,padding:"10px 12px",borderRadius:2,background:"var(--glass-bg)",border:"1px solid var(--glass-border)",display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8},children:[o.jsx("span",{style:{fontSize:13,color:"var(--text-secondary)"},children:"Registration fee"}),o.jsxs("span",{style:{textAlign:"right"},children:[o.jsxs("span",{style:{fontSize:14,color:"var(--text-primary, #fff)",fontWeight:600},children:[e.totalEth," ETH"]}),e.permissionCount>1&&e.perPermissionEth&&o.jsxs("span",{style:{display:"block",fontSize:11,color:"rgba(255,255,255,0.4)",marginTop:2},children:[e.permissionCount," permissions × ",e.perPermissionEth," ETH"]}),e.permissionCount>1&&!e.perPermissionEth&&o.jsxs("span",{style:{display:"block",fontSize:11,color:"rgba(255,255,255,0.4)",marginTop:2},children:["for ",e.permissionCount," permissions"]})]})]})}function Gj({draft:e,embedded:t=!1}){const{isConnected:n,chainId:r}=dt(),{signTypedDataAsync:a}=ml(),{switchChainAsync:c}=Bs(),l=Md(),[u,d]=I.useState("review"),[p,h]=I.useState(""),m=(e.items??[]).length>0?e.items:(e.permissions??[]).map(A=>({template:A.address,explanation:A.label,address:A.address,permExplanation:A.explanation??null})),g=(()=>{try{return my(e.chainId).kernel}catch{return Bt}})(),v=n&&r!==e.chainId;async function b(){await fetch("/api/mandate-draft",{method:"DELETE"}).catch(()=>{}),window.location.hash="#/dashboard"}async function _(){try{await c({chainId:e.chainId})}catch(A){h((A==null?void 0:A.shortMessage)||(A==null?void 0:A.message)||"Could not switch network")}}async function x(){if(u!=="signing"){h(""),d("signing");try{const A=m.map(M=>M.template);let k=0n;try{l&&g!==Bt&&(k=await l.readContract({address:g,abi:HV,functionName:"signerNonces",args:[e.account]}))}catch{k=0n}const N=BigInt(Math.floor(Date.now()/1e3)+3600),E=await a({domain:{name:"SailKernel",version:"1",chainId:e.chainId,verifyingContract:g},types:{RegisterPermissions:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},primaryType:"RegisterPermissions",message:{account:e.account,permissions:A,nonce:k,deadline:N}}),B=await fetch("/api/mandate-submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({signature:E,signedAt:new Date().toISOString(),permissions:A,deadline:N.toString()})});if(!B.ok){const M=await B.json().catch(()=>null);throw new Error((M==null?void 0:M.error)||`Submit failed (${B.status})`)}d("done")}catch(A){h((A==null?void 0:A.shortMessage)||(A==null?void 0:A.message)||"Signing failed"),d("review")}}}const j=u==="done"?o.jsx(KV,{draft:e}):o.jsxs(Kt,{className:Je.authCard,children:[o.jsx(qV,{kicker:"REVIEW MANDATE",title:"Authorize your agent",sub:"Sign with your wallet — Sail never holds your keys."}),n?o.jsxs(o.Fragment,{children:[o.jsx(GV,{draft:e,items:m}),o.jsx("ul",{style:{listStyle:"none",padding:0,margin:"12px 0",display:"flex",flexDirection:"column",gap:10},children:m.map((A,k)=>o.jsx(WV,{item:A,chainId:e.chainId},k))}),e.registrationFee&&o.jsx(VV,{fee:e.registrationFee}),p&&o.jsx("p",{style:{color:"#ff6b6b",fontSize:13,margin:"8px 0"},children:p}),v?o.jsxs(o.Fragment,{children:[o.jsx("p",{style:{fontSize:13,color:"rgba(255,255,255,0.45)",margin:"0 0 10px"},children:"Your wallet is on a different network. Switch to sign this mandate."}),o.jsxs("div",{className:Je.actionRow,children:[o.jsxs(Ze,{fullWidth:!0,onClick:_,children:["Switch to ",(()=>{try{return my(e.chainId).name}catch{return`Chain ${e.chainId}`}})()]}),o.jsx("button",{type:"button",className:Je.rejectBtn,onClick:b,children:"Reject"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:Je.actionRow,children:[o.jsx(Ze,{fullWidth:!0,onClick:x,disabled:u==="signing",children:u==="signing"?"Waiting for wallet…":"Sign mandate"}),o.jsx("button",{type:"button",className:Je.rejectBtn,onClick:b,disabled:u==="signing",children:"Reject"})]}),o.jsx("p",{className:Je.fineprint,children:"Revocable on-chain at any time from your dashboard."})]})]}):o.jsx("div",{style:{display:"flex",justifyContent:"center",paddingTop:8},children:o.jsx(qv,{showBalance:!1})})]});return t?o.jsx("div",{className:Je.embeddedFlow,children:j}):o.jsxs("div",{className:Je.shell,children:[o.jsx(ga,{}),o.jsx(qj,{state:u==="done"?"confirming":"review"}),o.jsx("main",{className:Je.stage,children:o.jsx("div",{className:Je.stageInner,children:j})})]})}function GV({draft:e,items:t}){const n=(()=>{try{return my(e.chainId).name}catch{return`Chain ${e.chainId}`}})(),r=t.length,a=e.account?`${e.account.slice(0,6)}…${e.account.slice(-4)}`:"—",c={display:"flex",justifyContent:"space-between",gap:12,fontSize:12.5},l={color:"rgba(255,255,255,0.45)"},u={color:"rgba(255,255,255,0.85)",fontVariantNumeric:"tabular-nums"};return o.jsxs("div",{style:{border:"1px solid rgba(255,255,255,0.08)",borderRadius:8,padding:"12px 14px",margin:"4px 0 12px",background:"rgba(255,255,255,0.02)",display:"flex",flexDirection:"column",gap:10},children:[o.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5,color:"rgba(255,255,255,0.92)"},children:["You're authorizing your agent to perform"," ",o.jsxs("strong",{children:[r," bounded action type",r===1?"":"s"]})," on"," ",o.jsx("strong",{children:n}),". Each is constrained by the rules below."]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[o.jsxs("div",{style:c,children:[o.jsx("span",{style:l,children:"Account (SMA)"}),o.jsx("span",{style:u,children:a})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{style:l,children:"Network"}),o.jsx("span",{style:u,children:n})]})]}),o.jsxs("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:4},children:[o.jsx("li",{style:{fontSize:12.5,color:"rgba(120,220,160,0.95)"},children:"✓ Revocable on-chain anytime from your dashboard"}),o.jsx("li",{style:{fontSize:12.5,color:"rgba(120,220,160,0.95)"},children:"✓ Sail never holds your keys or funds — you sign every authorization"}),o.jsx("li",{style:{fontSize:12.5,color:"rgba(255,180,120,0.95)"},children:"✗ The agent cannot act outside the permissions listed below"})]})]})}function qj({state:e}){return o.jsx(Rj,{eyebrow:"Signing",title:e==="confirming"?"Signed":"Sail never sees your keys",backTo:"#/dashboard"})}function qV({kicker:e,title:t,sub:n,onBack:r}){return o.jsxs("header",{className:Je.cardHeader,children:[r&&o.jsx("button",{type:"button",className:Je.backBtn,onClick:r,"aria-label":"Back",children:o.jsx(QV,{})}),o.jsx("span",{className:Je.kicker,children:e}),o.jsx("h1",{className:`${ut.displayHeadline} ${Je.cardHeadline}`,children:t}),n&&o.jsx("p",{className:Je.cardSub,children:n})]})}function KV({draft:e}){const[t,n]=I.useState(!1),r=((e==null?void 0:e.items)??(e==null?void 0:e.permissions)??[]).length,a=e!=null&&e.account?`${e.account.slice(0,10)}…${e.account.slice(-6)}`:null,c=`My mandate is signed on Safe ${(e==null?void 0:e.account)??"my Safe"}. ${r} permission${r===1?"":"s"} registered. Now deploy and start the agent — use SAIL_PASSPHRASE from my config and run sailor run.`;function l(){var u;(u=navigator==null?void 0:navigator.clipboard)==null||u.writeText(c),n(!0),setTimeout(()=>n(!1),1500)}return o.jsxs(Kt,{className:Je.welcomeCard,children:[o.jsx("div",{className:Je.cardSai,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("header",{className:Je.cardHeader,children:[o.jsx("span",{className:Je.kicker,children:"MANDATE SIGNED"}),o.jsx("h1",{className:`${ut.displayHeadline} ${Je.cardHeadline}`,children:"Permissions registered."}),o.jsxs("p",{className:`${ut.italicMannerism} ${Je.cardTagline}`,children:[r," permission",r===1?"":"s"," authorized",a?` on ${a}`:"",". Tell your AI to start the agent."]})]}),o.jsxs("div",{className:Je.mandateSignedPrompt,children:[o.jsx("span",{className:Je.mandateSignedPromptLabel,children:"Copy prompt for your AI"}),o.jsxs("p",{className:Je.mandateSignedPromptText,children:['"',c,'"']}),o.jsx("button",{type:"button",className:Je.mandateSignedCopyBtn,onClick:l,children:t?"✓ Copied":"Copy"})]}),o.jsx("div",{className:Je.welcomeCta,children:o.jsx(Ze,{fullWidth:!0,onClick:()=>{window.location.hash="#/dashboard"},children:"Go to dashboard"})})]})}function QV(){return o.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M15 6l-6 6 6 6"})})}const YV={"create-sma":"Create Safe (SMA)","deploy-mandate":"Deploy Mandate","register-permission":"Register Permission","attach-mandate":"Attach Mandate","set-delegate":"Set Agent as Manager"},N6=e=>`${e.slice(0,6)}…${e.slice(-4)}`,W1=(e,t)=>{var n;return((n=e.find(r=>r.id===t))==null?void 0:n.name)??`Chain ${t}`};function JV(){const{draft:e}=Qv(),t=e&&(e.permissions??e.items??[]).length>0,[n,r]=I.useState([]),[a,c]=I.useState({phase:"idle"}),[l,u]=I.useState(!1),[d,p]=I.useState(!1),{address:h,isConnected:m}=dt(),g=kv(),{disconnect:v}=Ri(),{account:b}=vl(),_=I.useRef([]),x=I.useCallback(N=>{if(N.type==="pending")_.current=N.requests,r(N.requests);else if(N.type==="request")_.current.find(E=>E.id===N.request.id)||(_.current=[..._.current,N.request]),r(_.current);else if(N.type==="request-resolved"){const E=_.current.filter(B=>B.id!==N.requestId);_.current=E,r(E),c(B=>B.requestId!==N.requestId?B:B.phase==="done"&&E.length===0?{phase:"success",requestId:N.requestId,kind:B.kind}:{phase:"idle"})}},[]),{status:j,send:A}=Hj({onMessage:x});I.useEffect(()=>{j==="connected"&&A(m&&h?{type:"wallet-connected",address:h}:{type:"wallet-disconnected"})},[j,h,m,A]);const k=b?[{id:"live-sma",name:"My SMA",address:b.safe,network:b.chainId===8453?"base":b.chainId===42161?"arbitrum":"ethereum",networks:[],agentCount:0,createdAt:null}]:[];return o.jsxs("div",{className:He.shell,children:[o.jsx(ga,{}),o.jsx(Rj,{eyebrow:"Signing Station",title:"Pending Signatures",backTo:"#/dashboard"}),o.jsx("main",{className:He.main,children:m?a.phase==="success"?o.jsx(eG,{kind:a.kind,onDone:()=>{c({phase:"idle"}),window.location.hash="#/dashboard"}}):t?o.jsx(Gj,{draft:e,embedded:!0}):n.length===0?o.jsx(tG,{daemonConnected:j==="connected",onAsk:()=>p(!0)}):o.jsx(XV,{requests:n,chains:g,phase:a,setPhase:c,send:A}):o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,padding:"40px 0"},children:o.jsx(Lj,{eyebrow:"SIGNING STATION",title:"Connect to approve requests.",sub:"Connect the owner wallet to review and sign pending agent requests."})})}),o.jsx($j,{open:l,wallet:h,safes:k,currentSafeId:"live-sma",hasSMA:!!b,onClose:()=>u(!1),onDisconnect:()=>{u(!1),v()},onCreateSMA:()=>{u(!1),window.location.hash="#/dashboard"},onRenameSafe:()=>{},onSelectSafe:()=>{}}),o.jsx(Yv,{open:d,variant:"new",context:"station",onClose:()=>p(!1)})]})}function XV({requests:e,chains:t,phase:n,setPhase:r,send:a}){const{sendTransactionAsync:c}=Li(),{signTypedDataAsync:l}=ml(),u=I.useCallback(async h=>{r({phase:"submitting",requestId:h.id,kind:h.kind});try{if(h.type==="transaction"){const m=await c({to:h.to?h.to:void 0,data:h.data,value:h.value?BigInt(h.value):0n,chainId:h.chainId});r({phase:"done",requestId:h.id,kind:h.kind,txHash:m}),a({type:"signed",requestId:h.id,txHash:m})}else{const m=Object.fromEntries(Object.entries(h.typedData.message).map(([v,b])=>[v,typeof b=="string"&&/^\d+$/.test(b)?BigInt(b):b])),g=await l({domain:h.typedData.domain,types:h.typedData.types,primaryType:h.typedData.primaryType,message:m});r({phase:"done",requestId:h.id,kind:h.kind,txHash:g}),a({type:"signature",requestId:h.id,signature:g})}}catch(m){r({phase:"error",requestId:h.id,kind:h.kind,message:m instanceof Error?m.message:String(m)})}},[c,l,r,a]),d=I.useCallback(h=>{r({phase:"idle"}),a({type:"rejected",requestId:h})},[r,a]),p=n.phase==="submitting"||n.phase==="done";return o.jsx(o.Fragment,{children:e.map(h=>o.jsx(ZV,{request:h,chains:t,phase:n,onSign:u,onReject:d,otherActive:p&&n.requestId!==h.id},h.id))})}function ZV({request:e,chains:t,phase:n,onSign:r,onReject:a,otherActive:c}){var b;const{isConnected:l,chainId:u}=dt(),{switchChain:d}=Bs(),p=n.requestId===e.id,h=p&&n.phase==="submitting",m=p&&n.phase==="done",g=p&&n.phase==="error",v=l&&u!==void 0&&u!==e.chainId;return o.jsxs("div",{className:He.card,children:[o.jsx("span",{className:He.cardKicker,children:YV[e.kind]??e.kind}),o.jsxs("div",{className:He.cardHead,children:[o.jsx("h2",{className:He.cardTitle,children:e.title}),o.jsx("p",{className:He.cardDesc,children:e.description})]}),((b=e.permissions)==null?void 0:b.length)>0?o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,marginBottom:4},children:e.permissions.map((_,x)=>{const j=_.address?Rd(e.chainId,_.address):null;return o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8,flexWrap:"wrap"},children:[o.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-secondary, rgba(255,255,255,0.72))"},children:_.label}),j&&o.jsx("a",{href:j,target:"_blank",rel:"noreferrer",onClick:A=>A.stopPropagation(),style:{color:"#7eb8f7",textDecoration:"none",fontSize:12,whiteSpace:"nowrap"},children:"View code on scanner ↗"})]}),_.explanation&&o.jsx(M6,{ex:_.explanation})]},_.address??x)})}):e.explanation?o.jsx(M6,{ex:e.explanation}):null,o.jsxs("div",{className:He.details,children:[e.details.map(_=>o.jsx(wh,{label:_.label,value:_.value,chainId:e.chainId},_.label)),o.jsx(wh,{label:"Network",value:W1(t,e.chainId),mono:!1}),e.type==="transaction"&&e.to&&o.jsx(wh,{label:"Contract",value:e.to,chainId:e.chainId}),e.type==="transaction"&&!e.to&&o.jsx(wh,{label:"Action",value:"Deploys a new contract",mono:!1})]}),e.registrationFee&&o.jsxs("div",{style:{marginTop:4,marginBottom:4,padding:"10px 12px",borderRadius:2,background:"var(--glass-bg)",border:"1px solid var(--glass-border)",display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8},children:[o.jsx("span",{style:{fontSize:13,color:"var(--text-secondary)"},children:"Registration fee"}),o.jsxs("span",{style:{textAlign:"right"},children:[o.jsxs("span",{style:{fontSize:14,color:"var(--text-primary, #fff)",fontWeight:600},children:[e.registrationFee.totalEth," ETH"]}),e.registrationFee.permissionCount>1&&e.registrationFee.perPermissionEth&&o.jsxs("span",{style:{display:"block",fontSize:11,color:"rgba(255,255,255,0.4)",marginTop:2},children:[e.registrationFee.permissionCount," permissions × ",e.registrationFee.perPermissionEth," ETH"]})]})]}),m&&o.jsxs("div",{className:`${He.banner} ${He.ok}`,children:["Submitted —"," ",e.type==="transaction"&&Ni(e.chainId,n.txHash)?o.jsxs("a",{href:Ni(e.chainId,n.txHash),target:"_blank",rel:"noreferrer",style:{color:"inherit",textDecoration:"underline"},children:[N6(n.txHash)," ↗"]}):N6(n.txHash)]}),g&&o.jsx("div",{className:`${He.banner} ${He.danger}`,children:n.message}),v&&o.jsxs("div",{className:`${He.banner} ${He.warn}`,children:["Wallet is on ",W1(t,u),"."," ",o.jsxs("button",{type:"button",className:He.linkBtn,onClick:()=>d({chainId:e.chainId}),children:["Switch to ",W1(t,e.chainId)]})]}),o.jsxs("div",{className:He.actions,children:[o.jsx("button",{type:"button",className:He.reject,disabled:h||m||c,onClick:()=>a(e.id),children:"Reject"}),l?o.jsx("button",{type:"button",className:He.primary,disabled:h||m||v||c,onClick:()=>r(e),children:c?"Waiting…":h?e.type==="typed-data"?"Signing…":"Submitting…":m?"Signed ✓":e.type==="typed-data"?"Sign Message":"Sign & Submit"}):o.jsx("span",{className:He.connectHint,children:"Connect wallet to sign"})]})]})}function M6({ex:e}){var n,r,a,c,l;return(((n=e.enforced)==null?void 0:n.length)??0)>0||(((r=e.notEnforced)==null?void 0:r.length)??0)>0?o.jsxs("div",{style:{margin:"0 0 14px",padding:12,borderRadius:6,background:"rgba(255,255,255,0.03)",border:"1px solid var(--glass-border, rgba(255,255,255,0.1))"},children:[o.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgba(255,255,255,0.4)",marginBottom:8},children:"What you're signing"}),o.jsx(Bj,{items:[e.protocol,e.chain,e.version]}),((a=e.enforced)==null?void 0:a.length)>0&&o.jsxs("div",{style:{marginBottom:((c=e.notEnforced)==null?void 0:c.length)>0?8:0},children:[o.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"#5dde8b",marginBottom:5},children:"Enforced on-chain"}),o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:3},children:e.enforced.map((u,d)=>o.jsxs("li",{style:{fontSize:12,color:"rgba(255,255,255,0.65)",paddingLeft:12,position:"relative"},children:[o.jsx("span",{style:{position:"absolute",left:0,color:"#5dde8b"},children:"·"}),u]},d))})]}),((l=e.notEnforced)==null?void 0:l.length)>0&&o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgba(255,255,255,0.3)",marginBottom:5},children:"Agent code — not enforced on-chain"}),o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:3},children:e.notEnforced.map((u,d)=>o.jsxs("li",{style:{fontSize:12,color:"rgba(255,255,255,0.3)",paddingLeft:12,position:"relative"},children:[o.jsx("span",{style:{position:"absolute",left:0},children:"·"}),u]},d))})]})]}):null}function wh({label:e,value:t,mono:n=!0,chainId:r}){const a=typeof t=="string"&&/^0x[a-fA-F0-9]{40}$/.test(t),c=/contract|permission/i.test(e),l=a&&c&&r?Rd(r,t):null;return o.jsxs("div",{className:He.detailRow,children:[o.jsx("span",{className:He.detailLabel,children:e}),o.jsxs("span",{style:{display:"inline-flex",gap:10,alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end"},children:[n?o.jsx("code",{className:He.detailValue,children:t}):o.jsx("span",{className:He.detailValue,children:t}),l&&o.jsx("a",{href:l,target:"_blank",rel:"noreferrer",onClick:u=>u.stopPropagation(),style:{color:"#7eb8f7",textDecoration:"none",fontSize:12,whiteSpace:"nowrap"},children:"View code on scanner ↗"})]})]})}function eG({kind:e,onDone:t}){const n=e==="register-permission"||e==="attach-mandate";return o.jsxs(Kt,{className:He.emptyCard,children:[o.jsx("div",{className:He.emptyCardSai,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("header",{className:He.emptyCardHeader,children:[o.jsx("span",{className:He.emptyKicker,children:"SIGNED"}),o.jsxs("h1",{className:`${ut.displayHeadline} ${He.emptyHeadline}`,style:{color:"var(--accent-green, #4ade80)"},children:["✓ ",n?"Permission registered.":"Done."]}),o.jsx("p",{className:`${ut.italicMannerism} ${He.emptyTagline}`,children:n?"Your agent is authorized to dispatch within this permission.":"The request was signed and submitted."})]}),o.jsx("div",{className:He.emptyCta,children:o.jsx(Ze,{fullWidth:!0,onClick:t,children:"Back to dashboard →"})})]})}function tG({daemonConnected:e,onAsk:t}){return o.jsxs(Kt,{className:He.emptyCard,children:[o.jsx("div",{className:He.emptyCardSai,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("header",{className:He.emptyCardHeader,children:[o.jsx("span",{className:He.emptyKicker,children:"SIGNING STATION"}),o.jsx("h1",{className:`${ut.displayHeadline} ${He.emptyHeadline}`,children:"No signatures pending."}),o.jsx("p",{className:`${ut.italicMannerism} ${He.emptyTagline}`,children:e?"The agent will push approval requests here as it works.":o.jsxs(o.Fragment,{children:["Run ",o.jsx("code",{style:{fontSize:13,opacity:.8},children:"sailor station start"})," to connect — this page will reconnect automatically."]})})]}),o.jsx("div",{className:He.emptyCta,children:o.jsx(Ze,{fullWidth:!0,onClick:t,children:"Ask AI how to get started"})})]})}const nG={RegisterAccount:[{name:"account",type:"address"},{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"},{name:"feeAsset",type:"address"},{name:"deadline",type:"uint256"}]};function rG(e){const t=e.deadline??BigInt(Math.floor(Date.now()/1e3)+600),n=e.feeAsset??"0x0000000000000000000000000000000000000000";return{domain:{name:"SailKernel",version:"1",chainId:e.chainId,verifyingContract:e.kernel},types:nG,primaryType:"RegisterAccount",message:{account:e.account,permissionSigner:e.permissionSigner,manager:e.manager,feePolicy:e.feePolicy,feeAsset:n,deadline:t.toString()}}}const sG=[{type:"function",name:"execTransaction",stateMutability:"payable",inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"operation",type:"uint8"},{name:"safeTxGas",type:"uint256"},{name:"baseGas",type:"uint256"},{name:"gasPrice",type:"uint256"},{name:"gasToken",type:"address"},{name:"refundReceiver",type:"address"},{name:"signatures",type:"bytes"}],outputs:[{name:"success",type:"bool"}]}],Kj=[{type:"function",name:"setup",stateMutability:"nonpayable",inputs:[{name:"_owners",type:"address[]"},{name:"_threshold",type:"uint256"},{name:"to",type:"address"},{name:"data",type:"bytes"},{name:"fallbackHandler",type:"address"},{name:"paymentToken",type:"address"},{name:"payment",type:"uint256"},{name:"paymentReceiver",type:"address"}],outputs:[]}],aG=[{type:"function",name:"enable",stateMutability:"nonpayable",inputs:[{name:"module",type:"address"}],outputs:[]}],ri={proxyFactory:"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",singletonL2:"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",fallbackHandler:"0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99"};function oG(e){const t=At({abi:aG,functionName:"enable",args:[e.kernel]});return At({abi:Kj,functionName:"setup",args:[e.owners,e.threshold,e.safeModuleEnabler,t,e.fallbackHandler??ri.fallbackHandler,Bt,0n,Bt]})}function iG(e){return AC(["bytes32","bytes32","uint8"],[br(e,{size:32}),br("0x",{size:32}),1])}const cG=[{type:"function",name:"registerAccount",stateMutability:"nonpayable",inputs:[{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"},{name:"feeAsset",type:"address"},{name:"deadline",type:"uint256"},{name:"ownerSig",type:"bytes"}],outputs:[]}];function lG(e){const t=At({abi:cG,functionName:"registerAccount",args:[e.permissionSigner,e.manager,e.feePolicy,e.feeAsset,e.deadline,e.ownerSig]}),n=At({abi:sG,functionName:"execTransaction",args:[e.kernel,0n,t,0,0n,0n,0n,Bt,Bt,iG(e.owner)]});return{to:e.safe,data:n}}function uG(e={}){var Q;const t=e.container||document.body,n=e.opacity!=null?e.opacity:.28,r=e.zIndex!=null?e.zIndex:0,a=e.fixed!==!1,c=e.grid||17,l=1e3/(e.fps||30),u="attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos,0.0,1.0); }",d=["uniform float u_time;","uniform vec2 u_res;","uniform float u_grid;","float hash(vec2 p){ return fract(sin(dot(p, vec2(12.9898,78.233))) * 43758.5453); }","// Sharp crest, broad flat trough — the trochoidal silhouette of a real swell.","float crest(float phase, float sharp){ return exp(sharp * (cos(phase) - 1.0)); }","float composite(vec2 p, float t){"," p.y += sin(t * 0.40) * 0.055;"," p.x += sin(t * 0.31) * 0.022;"," float c1 = dot(p, vec2(0.34, 0.94)) * 2.2 - t * 0.62 + sin(p.x * 1.0 + t * 0.12) * 0.75;"," float c2 = dot(p, vec2(-0.22, 0.98)) * 4.4 - t * 1.00 + sin(p.x * 1.7 - t * 0.18) * 0.55;"," float c3 = dot(p, vec2(0.48, 0.88)) * 8.0 - t * 1.45;"," float r1 = crest(c1, 2.0);"," float r2 = crest(c2, 3.0);"," float r3 = crest(c3, 4.4);"," float h = r1 + 0.50 * r2 + 0.26 * r3;"," h += 0.40 * smoothstep(0.72, 1.0, r1);"," for (int i = 0; i < 2; i++){"," float fi = float(i);"," vec2 ap = vec2("," sin(t * (0.09 + fi * 0.05) + fi * 2.1) * 0.82,"," cos(t * (0.07 + fi * 0.04) + fi * 1.4) * 0.46"," );"," h += smoothstep(0.22, 0.0, length(p - ap)) * 0.20;"," }"," float weight = 0.5 + 0.5 * smoothstep(0.1, 1.05, length(p));"," return clamp(h * weight, 0.0, 1.0);","}","void main(){"," float grid = u_grid;"," vec2 cell = floor(gl_FragCoord.xy / grid);"," vec2 cc = (cell + 0.5) * grid;"," vec2 p = (cc - u_res * 0.5) / min(u_res.x, u_res.y);"," float inten = composite(p, u_time);"," float seed = hash(cell);"," float thr = 0.60 + (seed - 0.5) * 0.22;"," float on = step(thr, inten);"," vec2 f = fract(gl_FragCoord.xy / grid);"," float gap = 0.2;"," float sq = step(gap, f.x) * step(f.x, 1.0 - gap) * step(gap, f.y) * step(f.y, 1.0 - gap);"," vec3 mid = vec3(0.098, 0.565, 1.0);"," vec3 hi = vec3(0.30, 0.67, 1.0);"," float rad = smoothstep(0.15, 1.15, length(p));"," vec3 col = mix(mid, hi, rad);"," vec2 v = gl_FragCoord.xy / u_res - 0.5;"," float vig = smoothstep(1.05, 0.2, length(v));"," float a = on * sq * (0.55 + 0.45 * vig);"," gl_FragColor = vec4(col * a, a);","}"].join(`
1774
+ </style><g class="boat"><g class="bob"><g class="sail"><path d="M12 0.5h1v1h-1zM13 0.5h1v1h-1zM14 0.5h1v1h-1zM12 1.5h1v1h-1zM13 1.5h1v1h-1zM14 1.5h1v1h-1zM12 2.5h1v1h-1zM13 2.5h1v1h-1zM14 2.5h1v1h-1zM15 2.5h1v1h-1zM16 2.5h1v1h-1zM12 3.5h1v1h-1zM13 3.5h1v1h-1zM14 3.5h1v1h-1zM15 3.5h1v1h-1zM16 3.5h1v1h-1zM10 4.5h1v1h-1zM11 4.5h1v1h-1zM12 4.5h1v1h-1zM13 4.5h1v1h-1zM14 4.5h1v1h-1zM15 4.5h1v1h-1zM16 4.5h1v1h-1zM17 4.5h1v1h-1zM18 4.5h1v1h-1zM19 4.5h1v1h-1zM10 5.5h1v1h-1zM11 5.5h1v1h-1zM12 5.5h1v1h-1zM13 5.5h1v1h-1zM14 5.5h1v1h-1zM15 5.5h1v1h-1zM16 5.5h1v1h-1zM17 5.5h1v1h-1zM18 5.5h1v1h-1zM19 5.5h1v1h-1zM10 6.5h1v1h-1zM11 6.5h1v1h-1zM12 6.5h1v1h-1zM13 6.5h1v1h-1zM14 6.5h1v1h-1zM15 6.5h1v1h-1zM16 6.5h1v1h-1zM17 6.5h1v1h-1zM18 6.5h1v1h-1zM19 6.5h1v1h-1zM7 7.5h1v1h-1zM8 7.5h1v1h-1zM9 7.5h1v1h-1zM10 7.5h1v1h-1zM11 7.5h1v1h-1zM12 7.5h1v1h-1zM13 7.5h1v1h-1zM14 7.5h1v1h-1zM15 7.5h1v1h-1zM16 7.5h1v1h-1zM17 7.5h1v1h-1zM18 7.5h1v1h-1zM19 7.5h1v1h-1zM20 7.5h1v1h-1zM21 7.5h1v1h-1zM7 8.5h1v1h-1zM8 8.5h1v1h-1zM9 8.5h1v1h-1zM10 8.5h1v1h-1zM11 8.5h1v1h-1zM12 8.5h1v1h-1zM13 8.5h1v1h-1zM14 8.5h1v1h-1zM15 8.5h1v1h-1zM16 8.5h1v1h-1zM17 8.5h1v1h-1zM18 8.5h1v1h-1zM19 8.5h1v1h-1zM20 8.5h1v1h-1zM21 8.5h1v1h-1zM7 9.5h1v1h-1zM8 9.5h1v1h-1zM9 9.5h1v1h-1zM10 9.5h1v1h-1zM11 9.5h1v1h-1zM12 9.5h1v1h-1zM13 9.5h1v1h-1zM14 9.5h1v1h-1zM15 9.5h1v1h-1zM16 9.5h1v1h-1zM17 9.5h1v1h-1zM18 9.5h1v1h-1zM19 9.5h1v1h-1zM20 9.5h1v1h-1zM21 9.5h1v1h-1zM22 9.5h1v1h-1zM23 9.5h1v1h-1zM24 9.5h1v1h-1zM7 10.5h1v1h-1zM8 10.5h1v1h-1zM9 10.5h1v1h-1zM10 10.5h1v1h-1zM11 10.5h1v1h-1zM12 10.5h1v1h-1zM13 10.5h1v1h-1zM14 10.5h1v1h-1zM15 10.5h1v1h-1zM16 10.5h1v1h-1zM17 10.5h1v1h-1zM18 10.5h1v1h-1zM19 10.5h1v1h-1zM20 10.5h1v1h-1zM21 10.5h1v1h-1zM22 10.5h1v1h-1zM23 10.5h1v1h-1zM24 10.5h1v1h-1zM7 11.5h1v1h-1zM8 11.5h1v1h-1zM9 11.5h1v1h-1zM10 11.5h1v1h-1zM11 11.5h1v1h-1zM12 11.5h1v1h-1zM13 11.5h1v1h-1zM14 11.5h1v1h-1zM15 11.5h1v1h-1zM16 11.5h1v1h-1zM17 11.5h1v1h-1zM18 11.5h1v1h-1zM19 11.5h1v1h-1zM20 11.5h1v1h-1zM21 11.5h1v1h-1zM22 11.5h1v1h-1zM23 11.5h1v1h-1zM24 11.5h1v1h-1zM5 12.5h1v1h-1zM6 12.5h1v1h-1zM7 12.5h1v1h-1zM8 12.5h1v1h-1zM9 12.5h1v1h-1zM10 12.5h1v1h-1zM11 12.5h1v1h-1zM12 12.5h1v1h-1zM13 12.5h1v1h-1zM14 12.5h1v1h-1zM15 12.5h1v1h-1zM16 12.5h1v1h-1zM17 12.5h1v1h-1zM18 12.5h1v1h-1zM19 12.5h1v1h-1zM20 12.5h1v1h-1zM21 12.5h1v1h-1zM22 12.5h1v1h-1zM23 12.5h1v1h-1zM24 12.5h1v1h-1zM25 12.5h1v1h-1zM26 12.5h1v1h-1zM5 13.5h1v1h-1zM6 13.5h1v1h-1zM7 13.5h1v1h-1zM8 13.5h1v1h-1zM9 13.5h1v1h-1zM10 13.5h1v1h-1zM11 13.5h1v1h-1zM12 13.5h1v1h-1zM13 13.5h1v1h-1zM14 13.5h1v1h-1zM15 13.5h1v1h-1zM16 13.5h1v1h-1zM17 13.5h1v1h-1zM18 13.5h1v1h-1zM19 13.5h1v1h-1zM20 13.5h1v1h-1zM21 13.5h1v1h-1zM22 13.5h1v1h-1zM23 13.5h1v1h-1zM24 13.5h1v1h-1zM25 13.5h1v1h-1zM26 13.5h1v1h-1zM2 14.5h1v1h-1zM3 14.5h1v1h-1zM4 14.5h1v1h-1zM5 14.5h1v1h-1zM6 14.5h1v1h-1zM7 14.5h1v1h-1zM8 14.5h1v1h-1zM9 14.5h1v1h-1zM10 14.5h1v1h-1zM11 14.5h1v1h-1zM12 14.5h1v1h-1zM13 14.5h1v1h-1zM14 14.5h1v1h-1zM15 14.5h1v1h-1zM16 14.5h1v1h-1zM17 14.5h1v1h-1zM18 14.5h1v1h-1zM19 14.5h1v1h-1zM20 14.5h1v1h-1zM21 14.5h1v1h-1zM22 14.5h1v1h-1zM23 14.5h1v1h-1zM24 14.5h1v1h-1zM25 14.5h1v1h-1zM26 14.5h1v1h-1zM27 14.5h1v1h-1zM28 14.5h1v1h-1zM29 14.5h1v1h-1zM2 15.5h1v1h-1zM3 15.5h1v1h-1zM4 15.5h1v1h-1zM5 15.5h1v1h-1zM6 15.5h1v1h-1zM7 15.5h1v1h-1zM8 15.5h1v1h-1zM9 15.5h1v1h-1zM10 15.5h1v1h-1zM11 15.5h1v1h-1zM12 15.5h1v1h-1zM13 15.5h1v1h-1zM14 15.5h1v1h-1zM15 15.5h1v1h-1zM16 15.5h1v1h-1zM17 15.5h1v1h-1zM18 15.5h1v1h-1zM19 15.5h1v1h-1zM20 15.5h1v1h-1zM21 15.5h1v1h-1zM22 15.5h1v1h-1zM23 15.5h1v1h-1zM24 15.5h1v1h-1zM25 15.5h1v1h-1zM26 15.5h1v1h-1zM27 15.5h1v1h-1zM28 15.5h1v1h-1zM29 15.5h1v1h-1zM2 16.5h1v1h-1zM3 16.5h1v1h-1zM4 16.5h1v1h-1zM5 16.5h1v1h-1zM6 16.5h1v1h-1zM7 16.5h1v1h-1zM8 16.5h1v1h-1zM9 16.5h1v1h-1zM10 16.5h1v1h-1zM11 16.5h1v1h-1zM12 16.5h1v1h-1zM13 16.5h1v1h-1zM14 16.5h1v1h-1zM15 16.5h1v1h-1zM16 16.5h1v1h-1zM17 16.5h1v1h-1zM18 16.5h1v1h-1zM19 16.5h1v1h-1zM20 16.5h1v1h-1zM21 16.5h1v1h-1zM22 16.5h1v1h-1zM23 16.5h1v1h-1zM24 16.5h1v1h-1zM25 16.5h1v1h-1zM26 16.5h1v1h-1zM27 16.5h1v1h-1zM28 16.5h1v1h-1zM29 16.5h1v1h-1zM12 17.5h1v1h-1zM13 17.5h1v1h-1zM14 17.5h1v1h-1zM12 18.5h1v1h-1zM13 18.5h1v1h-1zM14 18.5h1v1h-1z" fill="#1990FF"/></g><g class="hull"><path d="M0 19.5h1v1h-1zM1 19.5h1v1h-1zM2 19.5h1v1h-1zM3 19.5h1v1h-1zM4 19.5h1v1h-1zM5 19.5h1v1h-1zM6 19.5h1v1h-1zM7 19.5h1v1h-1zM8 19.5h1v1h-1zM9 19.5h1v1h-1zM10 19.5h1v1h-1zM11 19.5h1v1h-1zM12 19.5h1v1h-1zM13 19.5h1v1h-1zM14 19.5h1v1h-1zM15 19.5h1v1h-1zM16 19.5h1v1h-1zM17 19.5h1v1h-1zM18 19.5h1v1h-1zM19 19.5h1v1h-1zM20 19.5h1v1h-1zM21 19.5h1v1h-1zM22 19.5h1v1h-1zM23 19.5h1v1h-1zM24 19.5h1v1h-1zM25 19.5h1v1h-1zM26 19.5h1v1h-1zM27 19.5h1v1h-1zM28 19.5h1v1h-1zM29 19.5h1v1h-1zM30 19.5h1v1h-1zM31 19.5h1v1h-1zM0 20.5h1v1h-1zM1 20.5h1v1h-1zM2 20.5h1v1h-1zM3 20.5h1v1h-1zM4 20.5h1v1h-1zM5 20.5h1v1h-1zM6 20.5h1v1h-1zM7 20.5h1v1h-1zM8 20.5h1v1h-1zM9 20.5h1v1h-1zM10 20.5h1v1h-1zM11 20.5h1v1h-1zM12 20.5h1v1h-1zM13 20.5h1v1h-1zM14 20.5h1v1h-1zM15 20.5h1v1h-1zM16 20.5h1v1h-1zM17 20.5h1v1h-1zM18 20.5h1v1h-1zM19 20.5h1v1h-1zM20 20.5h1v1h-1zM21 20.5h1v1h-1zM22 20.5h1v1h-1zM23 20.5h1v1h-1zM24 20.5h1v1h-1zM25 20.5h1v1h-1zM26 20.5h1v1h-1zM27 20.5h1v1h-1zM28 20.5h1v1h-1zM29 20.5h1v1h-1zM30 20.5h1v1h-1zM31 20.5h1v1h-1zM0 21.5h1v1h-1zM1 21.5h1v1h-1zM2 21.5h1v1h-1zM3 21.5h1v1h-1zM4 21.5h1v1h-1zM5 21.5h1v1h-1zM6 21.5h1v1h-1zM7 21.5h1v1h-1zM8 21.5h1v1h-1zM9 21.5h1v1h-1zM10 21.5h1v1h-1zM11 21.5h1v1h-1zM12 21.5h1v1h-1zM13 21.5h1v1h-1zM14 21.5h1v1h-1zM15 21.5h1v1h-1zM16 21.5h1v1h-1zM17 21.5h1v1h-1zM18 21.5h1v1h-1zM19 21.5h1v1h-1zM20 21.5h1v1h-1zM21 21.5h1v1h-1zM22 21.5h1v1h-1zM23 21.5h1v1h-1zM24 21.5h1v1h-1zM25 21.5h1v1h-1zM26 21.5h1v1h-1zM27 21.5h1v1h-1zM28 21.5h1v1h-1zM29 21.5h1v1h-1zM30 21.5h1v1h-1zM31 21.5h1v1h-1zM0 22.5h1v1h-1zM1 22.5h1v1h-1zM2 22.5h1v1h-1zM3 22.5h1v1h-1zM4 22.5h1v1h-1zM5 22.5h1v1h-1zM6 22.5h1v1h-1zM7 22.5h1v1h-1zM8 22.5h1v1h-1zM9 22.5h1v1h-1zM10 22.5h1v1h-1zM11 22.5h1v1h-1zM12 22.5h1v1h-1zM13 22.5h1v1h-1zM14 22.5h1v1h-1zM15 22.5h1v1h-1zM16 22.5h1v1h-1zM17 22.5h1v1h-1zM18 22.5h1v1h-1zM19 22.5h1v1h-1zM20 22.5h1v1h-1zM21 22.5h1v1h-1zM22 22.5h1v1h-1zM23 22.5h1v1h-1zM24 22.5h1v1h-1zM25 22.5h1v1h-1zM26 22.5h1v1h-1zM27 22.5h1v1h-1zM28 22.5h1v1h-1zM29 22.5h1v1h-1zM0 23.5h1v1h-1zM1 23.5h1v1h-1zM2 23.5h1v1h-1zM3 23.5h1v1h-1zM4 23.5h1v1h-1zM5 23.5h1v1h-1zM6 23.5h1v1h-1zM7 23.5h1v1h-1zM8 23.5h1v1h-1zM9 23.5h1v1h-1zM10 23.5h1v1h-1zM11 23.5h1v1h-1zM12 23.5h1v1h-1zM13 23.5h1v1h-1zM14 23.5h1v1h-1zM15 23.5h1v1h-1zM16 23.5h1v1h-1zM17 23.5h1v1h-1zM18 23.5h1v1h-1zM19 23.5h1v1h-1zM20 23.5h1v1h-1zM21 23.5h1v1h-1zM22 23.5h1v1h-1zM23 23.5h1v1h-1zM24 23.5h1v1h-1zM25 23.5h1v1h-1zM26 23.5h1v1h-1zM27 23.5h1v1h-1zM28 23.5h1v1h-1zM29 23.5h1v1h-1zM2 24.5h1v1h-1zM3 24.5h1v1h-1zM4 24.5h1v1h-1zM5 24.5h1v1h-1zM6 24.5h1v1h-1zM7 24.5h1v1h-1zM8 24.5h1v1h-1zM9 24.5h1v1h-1zM10 24.5h1v1h-1zM11 24.5h1v1h-1zM12 24.5h1v1h-1zM13 24.5h1v1h-1zM14 24.5h1v1h-1zM15 24.5h1v1h-1zM16 24.5h1v1h-1zM17 24.5h1v1h-1zM18 24.5h1v1h-1zM19 24.5h1v1h-1zM20 24.5h1v1h-1zM21 24.5h1v1h-1zM22 24.5h1v1h-1zM23 24.5h1v1h-1zM24 24.5h1v1h-1zM25 24.5h1v1h-1zM26 24.5h1v1h-1zM2 25.5h1v1h-1zM3 25.5h1v1h-1zM4 25.5h1v1h-1zM5 25.5h1v1h-1zM6 25.5h1v1h-1zM7 25.5h1v1h-1zM8 25.5h1v1h-1zM9 25.5h1v1h-1zM10 25.5h1v1h-1zM11 25.5h1v1h-1zM12 25.5h1v1h-1zM13 25.5h1v1h-1zM14 25.5h1v1h-1zM15 25.5h1v1h-1zM16 25.5h1v1h-1zM17 25.5h1v1h-1zM18 25.5h1v1h-1zM19 25.5h1v1h-1zM20 25.5h1v1h-1zM21 25.5h1v1h-1zM22 25.5h1v1h-1zM23 25.5h1v1h-1zM24 25.5h1v1h-1zM25 25.5h1v1h-1zM26 25.5h1v1h-1zM2 26.5h1v1h-1zM3 26.5h1v1h-1zM4 26.5h1v1h-1zM5 26.5h1v1h-1zM6 26.5h1v1h-1zM7 26.5h1v1h-1zM8 26.5h1v1h-1zM9 26.5h1v1h-1zM10 26.5h1v1h-1zM11 26.5h1v1h-1zM12 26.5h1v1h-1zM13 26.5h1v1h-1zM14 26.5h1v1h-1zM15 26.5h1v1h-1zM16 26.5h1v1h-1zM17 26.5h1v1h-1zM18 26.5h1v1h-1zM19 26.5h1v1h-1zM20 26.5h1v1h-1zM21 26.5h1v1h-1zM22 26.5h1v1h-1zM23 26.5h1v1h-1zM24 26.5h1v1h-1zM25 26.5h1v1h-1zM26 26.5h1v1h-1zM5 27.5h1v1h-1zM6 27.5h1v1h-1zM7 27.5h1v1h-1zM8 27.5h1v1h-1zM9 27.5h1v1h-1zM10 27.5h1v1h-1zM11 27.5h1v1h-1zM12 27.5h1v1h-1zM13 27.5h1v1h-1zM14 27.5h1v1h-1zM15 27.5h1v1h-1zM16 27.5h1v1h-1zM17 27.5h1v1h-1zM18 27.5h1v1h-1zM19 27.5h1v1h-1zM20 27.5h1v1h-1zM21 27.5h1v1h-1zM22 27.5h1v1h-1zM23 27.5h1v1h-1zM24 27.5h1v1h-1zM5 28.5h1v1h-1zM6 28.5h1v1h-1zM7 28.5h1v1h-1zM8 28.5h1v1h-1zM9 28.5h1v1h-1zM10 28.5h1v1h-1zM11 28.5h1v1h-1zM12 28.5h1v1h-1zM13 28.5h1v1h-1zM14 28.5h1v1h-1zM15 28.5h1v1h-1zM16 28.5h1v1h-1zM17 28.5h1v1h-1zM18 28.5h1v1h-1zM19 28.5h1v1h-1zM20 28.5h1v1h-1zM21 28.5h1v1h-1zM22 28.5h1v1h-1zM23 28.5h1v1h-1zM24 28.5h1v1h-1z" fill="#1990FF"/></g><g class="eye eyeL"><g class="blink"><path d="M17 21.5h1v1h-1zM18 21.5h1v1h-1zM19 21.5h1v1h-1zM17 22.5h1v1h-1zM18 22.5h1v1h-1zM19 22.5h1v1h-1zM17 23.5h1v1h-1zM18 23.5h1v1h-1zM19 23.5h1v1h-1z" fill="#0A1124"/></g></g><g class="eye eyeR"><g class="blink"><path d="M22 21.5h1v1h-1zM23 21.5h1v1h-1zM24 21.5h1v1h-1zM22 22.5h1v1h-1zM23 22.5h1v1h-1zM24 22.5h1v1h-1zM22 23.5h1v1h-1zM23 23.5h1v1h-1zM24 23.5h1v1h-1z" fill="#0A1124"/></g></g></g></g></svg>`)}`;function gn({size:e=80,className:t=""}){return o.jsx("img",{src:n$,width:e,height:e,alt:"Sail logo",className:`${t$.mark} ${t}`.trim()})}const r$="_pill_9mhgj_1",s$="_dot_9mhgj_19",a$="_active_9mhgj_32",o$="_paused_9mhgj_50",i$="_muted_9mhgj_50",c$="_expired_9mhgj_60",l$="_revoked_9mhgj_70",yh={pill:r$,dot:s$,active:a$,"dot-breathe":"_dot-breathe_9mhgj_1",paused:o$,muted:i$,expired:c$,revoked:l$},w6={mandate:{active:"Active",paused:"Paused",expired:"Expired",revoked:"Revoked"},agent:{active:"Active",paused:"Stopped",expired:"Expired",revoked:"Ended"}};function tp({status:e="active",kind:t="mandate"}){const n=`${yh.pill} ${yh[e]??yh.muted}`,r=w6[t]??w6.mandate;return o.jsxs("span",{className:n,children:[o.jsx("span",{className:yh.dot,"aria-hidden":!0}),o.jsx("span",{children:r[e]??e})]})}const u$="_btn_xgunx_1",d$="_fullWidth_xgunx_31",f$="_primary_xgunx_35",h$="_ctaSheen_xgunx_1",p$="_secondary_xgunx_81",m$="_ghost_xgunx_100",g$="_danger_xgunx_115",y$="_warning_xgunx_134",vh={btn:u$,fullWidth:d$,primary:f$,ctaSheen:h$,secondary:p$,ghost:m$,danger:g$,warning:y$};function Ze({children:e,variant:t="primary",fullWidth:n=!1,disabled:r=!1,type:a="button",className:c="",...l}){const u=[vh.btn,vh[t]??vh.primary,n?vh.fullWidth:"",c].filter(Boolean).join(" ");return o.jsx("button",{type:a,className:u,disabled:r,...l,children:e})}const v$="_wrap_f46ww_1",b$="_icon_f46ww_8",w$="_bubble_f46ww_28",H1={wrap:v$,icon:b$,bubble:w$},_6=8,mu=10;function bi({children:e,label:t="More info",side:n="top"}){const[r,a]=I.useState(!1),[c,l]=I.useState(null),u=I.useRef(null),d=I.useRef(null),p=I.useId(),h=I.useCallback(()=>{const m=u.current,g=d.current;if(!m||!g)return;const v=m.getBoundingClientRect(),b=g.offsetWidth,_=g.offsetHeight,x=window.innerWidth,j=window.innerHeight;let A=v.left+v.width/2-b/2;A=Math.max(mu,Math.min(A,x-b-mu));const k=v.top-_6-_,N=v.bottom+_6;let E=n==="bottom"?N:k;E<mu&&(E=N),E+_>j-mu&&(E=Math.max(mu,k)),l({left:A,top:E})},[n]);return I.useLayoutEffect(()=>{if(!r){l(null);return}return h(),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}},[r,h]),o.jsxs("span",{className:H1.wrap,children:[o.jsx("button",{ref:u,type:"button",className:H1.icon,"aria-label":t,"aria-describedby":r?p:void 0,"aria-expanded":r,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:m=>{m.stopPropagation(),a(g=>!g)},children:o.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":!0,children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),o.jsx("circle",{cx:"8",cy:"4.6",r:"0.95",fill:"currentColor"}),o.jsx("rect",{x:"7.2",y:"6.6",width:"1.6",height:"5",rx:"0.6",fill:"currentColor"})]})}),r&&typeof document<"u"&&m4.createPortal(o.jsx("span",{ref:d,id:p,role:"tooltip",className:H1.bubble,style:{left:c?`${c.left}px`:"-9999px",top:c?`${c.top}px`:"-9999px",visibility:c?"visible":"hidden"},children:e}),document.body)]})}const _$={1:"#627eea",11155111:"#627eea",8453:"#0052ff",84532:"#0052ff",42161:"#28a0f0",421614:"#28a0f0",130:"#ff007a",1301:"#ff007a",10:"#ff0420",11155420:"#ff0420",56:"#f3ba2f",97:"#f3ba2f",480:"#dfe3e8",4801:"#dfe3e8",999:"#50d2c1",998:"#50d2c1",4326:"#ffffff",6342:"#ffffff"};function x$(e){return _$[e]??"rgba(255,255,255,0.5)"}function C$({chainId:e,color:t}){return e===1||e===11155111?o.jsx("svg",{viewBox:"0 0 24 24",fill:t,xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M11.944 17.97L4.58 13.62 11.943 24l7.37-10.38-7.372 4.35h.003zM12.056 0L4.69 12.223l7.365 4.354 7.365-4.35L12.056 0z"})}):e===8453||e===84532?o.jsx("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{fill:t,fillRule:"evenodd",d:"M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Z M2.2 10.5h11.1v3H2.2Z"})}):e===42161||e===421614?o.jsx("svg",{viewBox:"0 0 2500 2500",xmlns:"http://www.w3.org/2000/svg",children:o.jsxs("g",{fill:t,children:[o.jsx("path",{d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"}),o.jsx("path",{d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"}),o.jsx("path",{d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"}),o.jsx("path",{d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),o.jsx("path",{d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})}):e===130||e===1301?o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M12 2.5C12 8 8 12 2.5 12 8 12 12 16 12 21.5 12 16 16 12 21.5 12 16 12 12 8 12 2.5Z",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round"})}):e===10||e===11155420?o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{fill:t,fillRule:"evenodd",clipRule:"evenodd",d:"M3.966 15.8q.979.7 2.512.7 1.854 0 2.962-.838 1.108-.85 1.559-2.562.27-1.05.464-2.163.063-.398.064-.663 0-.874-.451-1.499a2.7 2.7 0 0 0-1.237-.95Q9.053 7.5 8.062 7.5q-3.644 0-4.52 3.437a40 40 0 0 0-.477 2.163q-.058.335-.065.674 0 1.314.966 2.026m4.65-2.775c-.247.957-.926 1.58-1.958 1.58-1.02 0-1.368-.69-1.184-1.58a27 27 0 0 1 .464-2.05c.265-1.034.89-1.58 1.956-1.58 1.017 0 1.348.68 1.173 1.58a30 30 0 0 1-.451 2.05m3.902 3.385q.076.09.214.089h1.704a.38.38 0 0 0 .238-.089.36.36 0 0 0 .138-.232l.538-2.52h1.733c1.094 0 1.95-.53 2.576-1.002q.953-.707 1.266-2.186.075-.348.075-.67 0-1.117-.851-1.71-.84-.591-2.23-.591h-3.333a.38.38 0 0 0-.238.09.38.38 0 0 0-.138.232l-1.73 8.356a.3.3 0 0 0 .038.232m6.09-5.966c-.157.689-.757 1.319-1.462 1.319h-1.44l.496-2.369h1.503c.512 0 .94.102.94.665q0 .165-.037.385"})}):e===56||e===97?o.jsx("svg",{viewBox:"0 0 24 24",fill:t,xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M16.624 13.9202l2.7175 2.7154-7.353 7.353-7.353-7.352 2.7175-2.7164 4.6355 4.6595 4.6356-4.6595zm4.6366-4.6366L24 12l-2.7154 2.7164L18.5682 12l2.6924-2.7164zm-9.272.001l2.7163 2.6914-2.7164 2.7174v-.001L9.2721 12l2.7164-2.7154zm-9.2722-.001L5.4088 12l-2.6914 2.6924L0 12l2.7164-2.7164zM11.9885.0115l7.353 7.329-2.7174 2.7154-4.6356-4.6356-4.6355 4.6595-2.7174-2.7154 7.353-7.353z"})}):e===480||e===4801?o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{fill:t,d:"M16.513 4.203A8.8 8.8 0 0 0 12 3Q9.555 3 7.487 4.203a8.97 8.97 0 0 0-3.284 3.284A8.8 8.8 0 0 0 3 12q0 2.445 1.203 4.512a8.97 8.97 0 0 0 3.284 3.285A8.8 8.8 0 0 0 12 21q2.445 0 4.512-1.203a8.97 8.97 0 0 0 3.285-3.285A8.8 8.8 0 0 0 21 12q0-2.445-1.203-4.513a8.97 8.97 0 0 0-3.285-3.284M12.55 15.26c-1.027 0-1.83-.3-2.456-.877a2.74 2.74 0 0 1-.828-1.454h9.727c-.1.827-.35 1.604-.701 2.331h-5.741m-3.284-4.161a2.84 2.84 0 0 1 .828-1.455c.626-.576 1.429-.877 2.457-.877h5.74c.377.727.602 1.504.702 2.332zM5.908 8.415a7 7 0 0 1 2.557-2.582 6.94 6.94 0 0 1 3.56-.953 6.94 6.94 0 0 1 3.56.953 7.3 7.3 0 0 1 1.48 1.153h-4.539c-1.027 0-1.955.226-2.757.652a4.54 4.54 0 0 0-1.855 1.78 5.1 5.1 0 0 0-.602 1.705H5.081c.1-.953.4-1.856.877-2.683zm9.652 9.752a6.94 6.94 0 0 1-3.56.953 6.94 6.94 0 0 1-3.56-.953 7 7 0 0 1-2.557-2.582 6.7 6.7 0 0 1-.877-2.657h2.23a5.2 5.2 0 0 0 .602 1.704c.452.752 1.078 1.329 1.856 1.78.802.426 1.73.652 2.757.652h4.513a6.8 6.8 0 0 1-1.43 1.103z"})}):e===999||e===998?o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{fill:t,d:"M21 11.937a9.4 9.4 0 0 1-.901 4.112c-.867 1.863-2.947 3.387-4.846 1.765-1.55-1.322-1.837-4.005-4.157-4.398-3.07-.361-3.145 3.092-5.15 3.482-2.236.44-2.978-3.206-2.945-4.862s.487-3.984 2.43-3.984c2.236 0 2.386 3.283 5.224 3.105 2.81-.186 2.86-3.602 4.696-5.064 1.585-1.264 3.448-.337 4.381 1.184.865 1.406 1.245 3.057 1.265 4.66z"})}):e===4326||e===6342?o.jsxs("svg",{viewBox:"0 0 24 24",fill:t,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{d:"M3 16.5V5h2.8L12 12.2 18.2 5H21v11.5h-2.6V9.2L12 16.6 5.6 9.2v7.3z"}),o.jsx("circle",{cx:"9.4",cy:"20",r:"1.3"}),o.jsx("circle",{cx:"14.6",cy:"20",r:"1.3"})]}):o.jsx("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("circle",{cx:"12",cy:"12",r:"6",fill:t})})}function Co({chainId:e,size:t=20,color:n}){const r=n??x$(e);return o.jsx("span",{"aria-hidden":!0,style:{display:"inline-flex",width:t,height:t,flexShrink:0},children:o.jsx(C$,{chainId:e,color:r})})}const x6=["#4DABFF","#7EB8F7","#9B8FF7","#5AD1E8"];function k$(e,t){let n=0;for(let r=0;r<e.length;r++)n=n*31+e.charCodeAt(r)>>>0;return n%t}function j$({children:e,title:t}){const n=String(e??"");if(!n)return null;const r=x6[k$(n.toLowerCase(),x6.length)];return o.jsx("span",{title:t,style:{display:"inline-block",maxWidth:"100%",padding:"2px 9px",borderRadius:2,fontSize:10,fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase",lineHeight:1.5,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",background:`${r}22`,color:r,border:`1px solid ${r}55`},children:e})}function Bj({items:e}){const t=(e??[]).filter(Boolean);return t.length===0?null:o.jsx("div",{style:{display:"flex",gap:6,marginBottom:10,flexWrap:"wrap"},children:t.map(n=>o.jsx(j$,{title:n,children:n},n))})}const ya={1:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%2325292E%22%20fill-rule%3D%22evenodd%22%20d%3D%22M14%2028a14%2014%200%201%200%200-28%2014%2014%200%200%200%200%2028Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cpath%20fill%3D%22url(%23a)%22%20fill-opacity%3D%22.3%22%20fill-rule%3D%22evenodd%22%20d%3D%22M14%2028a14%2014%200%201%200%200-28%2014%2014%200%200%200%200%2028Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20d%3D%22M8.19%2014.77%2014%2018.21l5.8-3.44-5.8%208.19-5.81-8.19Z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m14%2016.93-5.81-3.44L14%204.34l5.81%209.15L14%2016.93Z%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22a%22%20x1%3D%220%22%20x2%3D%2214%22%20y1%3D%220%22%20y2%3D%2228%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%2214%22%20x2%3D%2214%22%20y1%3D%2214.77%22%20y2%3D%2222.96%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%20stop-opacity%3D%22.9%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",8453:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20fill%3D%22%230052FF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M14%2028a14%2014%200%201%200%200-28%2014%2014%200%200%200%200%2028Z%22%2F%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M13.967%2023.86c5.445%200%209.86-4.415%209.86-9.86%200-5.445-4.415-9.86-9.86-9.86-5.166%200-9.403%203.974-9.825%209.03h14.63v1.642H4.142c.413%205.065%204.654%209.047%209.826%209.047Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",42161:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cg%20transform%3D%22translate(0%2C0)%20scale(0.7)%22%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22%2396BEDC%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20fill-opacity%3D%22.3%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3Cpath%20fill%3D%22%232D374B%22%20fill-rule%3D%22evenodd%22%20d%3D%22M20%202.5C10.335%202.5%202.5%2010.335%202.5%2020c0%203.293.91%206.373%202.49%209.004L0%2031v9h10v-5.637A17.42%2017.42%200%200%200%2020%2037.5c9.665%200%2017.5-7.835%2017.5-17.5S29.665%202.5%2020%202.5Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cmask%20id%3D%22c%22%20width%3D%2238%22%20height%3D%2238%22%20x%3D%220%22%20y%3D%222%22%20maskUnits%3D%22userSpaceOnUse%22%20style%3D%22mask-type%3Aalpha%22%3E%3Cpath%20fill%3D%22%232D374B%22%20fill-rule%3D%22evenodd%22%20d%3D%22M20%202.5C10.335%202.5%202.5%2010.335%202.5%2020a17.42%2017.42%200%200%200%203.137%2010H0v10h10v-5.637A17.42%2017.42%200%200%200%2020%2037.5c9.665%200%2017.5-7.835%2017.5-17.5S29.665%202.5%2020%202.5Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url(%23c)%22%3E%3Cpath%20fill%3D%22%2328A0F0%22%20d%3D%22m26.873%2037.192-6.75-10.615%203.782-6.416%208.672%2013.676-5.704%203.355ZM34.126%2032.79l3.471-5.786-9.238-14.423-3.299%205.596%209.066%2014.613Z%22%2F%3E%3Cpath%20fill%3D%22url(%23d)%22%20fill-opacity%3D%22.2%22%20d%3D%22M0%2020C0%208.954%208.954%200%2020%200s20%208.954%2020%2020-8.954%2020-20%2020H0V20Z%22%2F%3E%3C%2Fg%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m.52%2040.315-4.387-2.524L-4.2%2036.6l15.267-23.715c1.042-1.702%203.314-2.25%205.422-2.22l2.475.065L.519%2040.315ZM27.38%2010.73l-6.523.024L-2.9%2050%202%2053.5l6.358-10.597%201.402-2.379L27.38%2010.73Z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%220%22%20x2%3D%2220%22%20y1%3D%220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22d%22%20x1%3D%220%22%20x2%3D%2220%22%20y1%3D%220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fg%3E%3C%2Fsvg%3E",130:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cg%20transform%3D%22translate(0%2C0)%20scale(0.7)%22%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22url(%23b)%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M36%2019.696c-8.672%200-15.696-7.03-15.696-15.696h-.608v15.696H4v.608c8.673%200%2015.696%207.03%2015.696%2015.696h.608V20.304H36v-.608Z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CradialGradient%20id%3D%22b%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientTransform%3D%22matrix(0%2020%20-20%200%2020%2020)%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FC74FE%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F50DB4%22%2F%3E%3C%2FradialGradient%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fg%3E%3C%2Fsvg%3E"};ya[11155111]=ya[1];ya[84532]=ya[8453];ya[421614]=ya[42161];ya[1301]=ya[130];function Tj({chainId:e,size:t=20}){const n=ya[e];return n?o.jsx("img",{src:n,width:t,height:t,style:{borderRadius:"50%",display:"block",flexShrink:0},alt:""}):o.jsx("span",{style:{display:"inline-block",width:t,height:t,borderRadius:"50%",flexShrink:0,background:"#888"}})}const S$="_shell_u0pao_1",A$="_header_u0pao_13",E$="_headerLeft_u0pao_31",N$="_brand_u0pao_38",M$="_backBtn_u0pao_51",I$="_headerTitle_u0pao_71",B$="_topActionsPill_u0pao_78",T$="_notifBtn_u0pao_99",P$="_chainIconPlaceholder_u0pao_120",R$="_avatarBtn_u0pao_129",L$="_avatarBtnMonogram_u0pao_155",D$="_avatarBtnAddr_u0pao_173",O$="_chainDropdownWrap_u0pao_182",F$="_chainMenu_u0pao_185",z$="_chainMenuHeader_u0pao_208",$$="_chainMenuList_u0pao_217",H$="_chainOption_u0pao_228",U$="_chainOptionActive_u0pao_250",W$="_chainOptionName_u0pao_260",V$="_chainCheck_u0pao_261",G$="_chainSwitching_u0pao_265",q$="_main_u0pao_271",K$="_eyebrow_u0pao_288",Q$="_title_u0pao_297",Y$="_card_u0pao_307",J$="_cardKicker_u0pao_319",X$="_cardHead_u0pao_334",Z$="_cardTitle_u0pao_335",eH="_cardDesc_u0pao_343",tH="_details_u0pao_352",nH="_detailRow_u0pao_361",rH="_detailLabel_u0pao_367",sH="_detailValue_u0pao_372",aH="_banner_u0pao_380",oH="_ok_u0pao_390",iH="_danger_u0pao_391",cH="_warn_u0pao_392",lH="_linkBtn_u0pao_393",uH="_actions_u0pao_400",dH="_reject_u0pao_406",fH="_primary_u0pao_419",hH="_connectHint_u0pao_434",pH="_emptyCard_u0pao_483",mH="_emptyCardSai_u0pao_508",gH="_emptyCardHeader_u0pao_517",yH="_emptyKicker_u0pao_525",vH="_emptyHeadline_u0pao_533",bH="_emptyTagline_u0pao_540",wH="_emptyCta_u0pao_547",He={shell:S$,header:A$,headerLeft:E$,brand:N$,backBtn:M$,headerTitle:I$,topActionsPill:B$,notifBtn:T$,chainIconPlaceholder:P$,avatarBtn:R$,avatarBtnMonogram:L$,avatarBtnAddr:D$,chainDropdownWrap:O$,chainMenu:F$,chainMenuHeader:z$,chainMenuList:$$,chainOption:H$,chainOptionActive:U$,chainOptionName:W$,chainCheck:V$,chainSwitching:G$,main:q$,eyebrow:K$,title:Q$,card:Y$,cardKicker:J$,cardHead:X$,cardTitle:Z$,cardDesc:eH,details:tH,detailRow:nH,detailLabel:rH,detailValue:sH,banner:aH,ok:oH,danger:iH,warn:cH,linkBtn:lH,actions:uH,reject:dH,primary:fH,connectHint:hH,emptyCard:pH,emptyCardSai:mH,emptyCardHeader:gH,emptyKicker:yH,emptyHeadline:vH,emptyTagline:bH,emptyCta:wH},_H="_overlay_aragl_4",xH="_overlayFade_aragl_1",CH="_panel_aragl_15",kH="_slideIn_aragl_1",jH="_panelOut_aragl_60",SH="_slideOut_aragl_1",AH="_hero_aragl_69",EH="_avatarRing_aragl_75",NH="_avatar_aragl_75",MH="_identity_aragl_104",IH="_identityKicker_aragl_112",BH="_identityAddress_aragl_120",TH="_identityCopyIcon_aragl_141",PH="_identityActions_aragl_149",RH="_settingsPill_aragl_155",LH="_disconnectPill_aragl_177",DH="_divider_aragl_202",OH="_smasSection_aragl_210",FH="_smasHead_aragl_217",zH="_smasKicker_aragl_224",$H="_smasCount_aragl_232",HH="_smaList_aragl_240",UH="_smaCard_aragl_286",WH="_smaCardPrimary_aragl_304",VH="_smaRow_aragl_313",GH="_smaIcon_aragl_331",qH="_smaBody_aragl_343",KH="_smaTitleRow_aragl_349",QH="_smaName_aragl_354",YH="_smaNameInput_aragl_362",JH="_smaPrimaryBadge_aragl_380",XH="_smaRename_aragl_396",ZH="_smaAddress_aragl_423",eU="_smaMeta_aragl_430",tU="_smaNetDot_aragl_439",nU="_smaNetDot_arbitrum_aragl_445",rU="_smaNetDot_base_aragl_446",sU="_smaNetDot_ethereum_aragl_447",aU="_smaNetDot_optimism_aragl_448",oU="_smaNetDot_polygon_aragl_449",iU="_smaNetStack_aragl_453",cU="_smaNetName_aragl_466",lU="_smaMetaSep_aragl_467",uU="_smaAgentCount_aragl_468",dU="_smaCopy_aragl_469",fU="_smaActions_aragl_491",hU="_smaSafeLink_aragl_502",pU="_smaSafeLinkLabel_aragl_530",mU="_smaSafeLinkChain_aragl_536",gU="_smaAction_aragl_491",yU="_smaActionPrimary_aragl_586",vU="_smaActionRow_aragl_599",bU="_smaActionBtn_aragl_604",wU="_smaActionBtnActive_aragl_626",_U="_smaActionIcon_aragl_632",xU="_smaImportSection_aragl_639",CU="_smaImportScan_aragl_649",kU="_smaImportList_aragl_655",jU="_smaImportRow_aragl_663",SU="_smaImportRowAddr_aragl_677",AU="_smaImportRowNet_aragl_682",EU="_smaImportLink_aragl_686",NU="_smaImportManual_aragl_699",MU="_smaImportInput_aragl_704",IU="_smaImportErr_aragl_718",BU="_smaImportActions_aragl_719",TU="_smaImportConfirm_aragl_720",PU="_accounts_aragl_736",RU="_acctRow_aragl_741",LU="_acctRowAccent_aragl_765",DU="_acctIcon_aragl_773",OU="_acctIconAccent_aragl_785",FU="_acctBody_aragl_790",zU="_acctLabel_aragl_796",$U="_acctValue_aragl_803",HU="_acctKicker_aragl_811",UU="_acctCopy_aragl_817",WU="_noSMA_aragl_834",VU="_noSMAIcon_aragl_847",GU="_noSMABody_aragl_858",qU="_noSMAKicker_aragl_864",KU="_noSMATitle_aragl_872",QU="_noSMASub_aragl_879",YU="_noSMACta_aragl_886",JU="_balance_aragl_914",XU="_balLabel_aragl_921",ZU="_balValWrap_aragl_929",eW="_balCurrency_aragl_939",tW="_balVal_aragl_929",nW="_balMeta_aragl_953",rW="_balDelta_aragl_963",sW="_balSep_aragl_973",aW="_balLifetime_aragl_979",oW="_actions_aragl_985",iW="_actionBtn_aragl_990",cW="_actionIcon_aragl_1009",lW="_actionBtnPrimary_aragl_1033",uW="_actionLabel_aragl_1050",dW="_disconnect_aragl_177",fW="_eoaLabel_aragl_1157",hW="_actionsHead_aragl_1159",pW="_ctaSheen_aragl_1",mW="_createSmaRow_aragl_1358",gW="_emptyCreate_aragl_1359",yW="_createSmaIcon_aragl_1372",vW="_emptyCreateIcon_aragl_1373",Se={overlay:_H,overlayFade:xH,panel:CH,slideIn:kH,panelOut:jH,slideOut:SH,hero:AH,avatarRing:EH,avatar:NH,identity:MH,identityKicker:IH,identityAddress:BH,identityCopyIcon:TH,identityActions:PH,settingsPill:RH,disconnectPill:LH,divider:DH,smasSection:OH,smasHead:FH,smasKicker:zH,smasCount:$H,smaList:HH,smaCard:UH,smaCardPrimary:WH,smaRow:VH,smaIcon:GH,smaBody:qH,smaTitleRow:KH,smaName:QH,smaNameInput:YH,smaPrimaryBadge:JH,smaRename:XH,smaAddress:ZH,smaMeta:eU,smaNetDot:tU,smaNetDot_arbitrum:nU,smaNetDot_base:rU,smaNetDot_ethereum:sU,smaNetDot_optimism:aU,smaNetDot_polygon:oU,smaNetStack:iU,smaNetName:cU,smaMetaSep:lU,smaAgentCount:uU,smaCopy:dU,smaActions:fU,smaSafeLink:hU,smaSafeLinkLabel:pU,smaSafeLinkChain:mU,smaAction:gU,smaActionPrimary:yU,smaActionRow:vU,smaActionBtn:bU,smaActionBtnActive:wU,smaActionIcon:_U,smaImportSection:xU,smaImportScan:CU,smaImportList:kU,smaImportRow:jU,smaImportRowAddr:SU,smaImportRowNet:AU,smaImportLink:EU,smaImportManual:NU,smaImportInput:MU,smaImportErr:IU,smaImportActions:BU,smaImportConfirm:TU,accounts:PU,acctRow:RU,acctRowAccent:LU,acctIcon:DU,acctIconAccent:OU,acctBody:FU,acctLabel:zU,acctValue:$U,acctKicker:HU,acctCopy:UU,noSMA:WU,noSMAIcon:VU,noSMABody:GU,noSMAKicker:qU,noSMATitle:KU,noSMASub:QU,noSMACta:YU,balance:JU,balLabel:XU,balValWrap:ZU,balCurrency:eW,balVal:tW,balMeta:nW,balDelta:rW,balSep:sW,balLifetime:aW,actions:oW,actionBtn:iW,actionIcon:cW,actionBtnPrimary:lW,actionLabel:uW,disconnect:dW,eoaLabel:fW,actionsHead:hW,ctaSheen:pW,createSmaRow:mW,emptyCreate:gW,createSmaIcon:yW,emptyCreateIcon:vW};function Pj(e){return!e||e.length<12?e??"":`${e.slice(0,6)}…${e.slice(-4)}`}function bW(){return o.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:[o.jsx("rect",{x:"2.5",y:"2.5",width:"7",height:"7",rx:"1.6",stroke:"currentColor",strokeWidth:"1.2"}),o.jsx("path",{d:"M4 4V3a1 1 0 011-1h4.5a1 1 0 011 1v5a1 1 0 01-1 1H9",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function wW(){return o.jsx("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function _W({open:e,wallet:t,onClose:n,onDisconnect:r}){const[a,c]=I.useState(!1),[l,u]=I.useState(!1);I.useEffect(()=>{if(!e)return;const h=m=>{m.key==="Escape"&&d()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[e]);function d(){c(!0),setTimeout(()=>{c(!1),n==null||n()},320)}function p(){var h;t&&((h=navigator==null?void 0:navigator.clipboard)!=null&&h.writeText&&navigator.clipboard.writeText(t),u(!0),setTimeout(()=>u(!1),1400))}return e?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Se.overlay,onClick:d,"aria-hidden":!0}),o.jsx("aside",{className:`${Se.panel} ${a?Se.panelOut:""}`,role:"dialog","aria-modal":"true","aria-label":"Account",children:o.jsxs("div",{className:Se.hero,children:[o.jsx("div",{className:Se.avatarRing,children:o.jsx("div",{className:Se.avatar,children:(t==null?void 0:t.slice(2,4).toUpperCase())??"U"})}),o.jsxs("div",{className:Se.identity,children:[o.jsx("span",{className:Se.identityKicker,children:"EOA · Owner"}),o.jsxs("button",{type:"button",className:Se.identityAddress,onClick:p,"aria-label":"Copy address",children:[o.jsx("span",{children:Pj(t)}),o.jsx("span",{className:Se.identityCopyIcon,"aria-hidden":!0,children:l?o.jsx(wW,{}):o.jsx(bW,{})})]})]}),o.jsx("button",{type:"button",className:Se.disconnectPill,onClick:r,children:"Disconnect"})]})})]}):null}function xW({open:e,onClose:t}){const n=kv(),{chainId:r}=dt(),{switchChainAsync:a}=Bs(),[c,l]=I.useState(null);return I.useEffect(()=>{if(!e)return;const u=p=>{var h,m;(m=(h=p.target)==null?void 0:h.closest)!=null&&m.call(h,`.${He.chainDropdownWrap}`)||t()},d=p=>{p.key==="Escape"&&t()};return window.addEventListener("click",u),window.addEventListener("keydown",d),()=>{window.removeEventListener("click",u),window.removeEventListener("keydown",d)}},[e,t]),e?o.jsxs("div",{className:He.chainMenu,children:[o.jsx("header",{className:He.chainMenuHeader,children:"Switch network"}),o.jsx("ul",{className:He.chainMenuList,children:n.map(u=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:`${He.chainOption} ${u.id===r?He.chainOptionActive:""}`,disabled:c===u.id,onClick:async()=>{l(u.id);try{await a({chainId:u.id})}catch{}l(null),t()},children:[o.jsx(Tj,{chainId:u.id,size:18}),o.jsx("span",{className:He.chainOptionName,children:u.name}),u.id===r&&o.jsx("span",{className:He.chainCheck,children:"✓"}),c===u.id&&o.jsx("span",{className:He.chainSwitching,children:"…"})]})},u.id))})]}):null}function Rj({eyebrow:e,title:t,backTo:n="#/dashboard",showBack:r=!0}){const[a,c]=I.useState(!1),[l,u]=I.useState(!1),{address:d,isConnected:p,chainId:h}=dt(),{openConnectModal:m}=Oi(),{disconnect:g}=Ri();return o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:He.header,children:[o.jsxs("div",{className:He.headerLeft,children:[o.jsx("button",{type:"button",className:He.brand,onClick:()=>{window.location.hash="#/dashboard"},"aria-label":"Go to dashboard",children:o.jsx(gn,{size:48,animate:!0})}),o.jsxs("div",{className:He.headerTitle,children:[o.jsx("span",{className:He.eyebrow,children:e}),o.jsx("h1",{className:He.title,children:t})]})]}),o.jsxs("div",{className:He.topActionsPill,children:[o.jsxs("div",{className:He.chainDropdownWrap,children:[o.jsx("button",{type:"button",className:He.notifBtn,onClick:()=>c(v=>!v),"aria-label":"Switch network",children:p&&h?o.jsx(Tj,{chainId:h,size:20}):o.jsx("span",{className:He.chainIconPlaceholder})}),o.jsx(xW,{open:a,onClose:()=>c(!1)})]}),o.jsxs("button",{type:"button",className:He.avatarBtn,onClick:p?()=>u(!0):m,"aria-label":p?"Open account":"Connect wallet",children:[o.jsx("span",{className:He.avatarBtnMonogram,"aria-hidden":!0,children:p&&d?d.slice(2,4).toUpperCase():"—"}),o.jsx("span",{className:He.avatarBtnAddr,children:p&&d?Pj(d):"Connect wallet"})]}),r&&o.jsx("button",{type:"button",className:He.backBtn,onClick:()=>{window.location.hash=n},"aria-label":"Go back",children:o.jsx("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M9 3L5 7l4 4"})})})]})]}),o.jsx(_W,{open:l,wallet:d,onClose:()=>u(!1),onDisconnect:()=>{u(!1),g()}})]})}const CW="_metaLabel_jkj8x_1",kW="_displayHeadline_jkj8x_11",jW="_italicMannerism_jkj8x_19",SW="_pageShell_jkj8x_27",ut={metaLabel:CW,displayHeadline:kW,italicMannerism:jW,pageShell:SW},AW="_shell_1m4oo_5",EW="_stage_1m4oo_17",NW="_stageInner_1m4oo_31",MW="_welcomeCard_1m4oo_170",IW="_authCard_1m4oo_171",BW="_cardSai_1m4oo_197",TW="_cardHeader_1m4oo_218",PW="_kicker_1m4oo_228",RW="_cardHeadline_1m4oo_237",LW="_cardSub_1m4oo_254",DW="_cardTagline_1m4oo_264",OW="_backBtn_1m4oo_272",FW="_welcomeCta_1m4oo_297",zW="_fineprint_1m4oo_406",$W="_mandateSignedPrompt_1m4oo_1162",HW="_mandateSignedPromptLabel_1m4oo_1170",UW="_mandateSignedPromptText_1m4oo_1178",WW="_mandateSignedCopyBtn_1m4oo_1185",VW="_embeddedFlow_1m4oo_1199",GW="_actionRow_1m4oo_1211",qW="_rejectBtn_1m4oo_1216",Je={shell:AW,stage:EW,stageInner:NW,welcomeCard:MW,authCard:IW,cardSai:BW,cardHeader:TW,kicker:PW,cardHeadline:RW,cardSub:LW,cardTagline:DW,backBtn:OW,welcomeCta:FW,fineprint:zW,mandateSignedPrompt:$W,mandateSignedPromptLabel:HW,mandateSignedPromptText:UW,mandateSignedCopyBtn:WW,embeddedFlow:VW,actionRow:GW,rejectBtn:qW};function Lj({eyebrow:e="WELCOME TO SAIL",title:t="Separately Managed Accounts.",sub:n="Enforced by code, run by agents."}){const{openConnectModal:r}=Oi();return o.jsxs(Kt,{className:Je.welcomeCard,children:[o.jsx("div",{className:Je.cardSai,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("header",{className:Je.cardHeader,children:[o.jsx("span",{className:Je.kicker,children:e}),o.jsx("h1",{className:`${ut.displayHeadline} ${Je.cardHeadline}`,children:t}),o.jsx("p",{className:`${ut.italicMannerism} ${Je.cardTagline}`,children:n})]}),o.jsx("div",{className:Je.welcomeCta,children:o.jsx(Ze,{fullWidth:!0,onClick:r,children:"Connect wallet"})}),o.jsx("p",{className:Je.fineprint,children:"Self-custody. Sail never holds your keys."})]})}const Up=5e3;function Ts(e,t,n=Up,r=0,a={}){const{fastWhile:c,fastMs:l=1500}=a,[u,d]=I.useState(t),[p,h]=I.useState(!0),[m,g]=I.useState(null);return I.useEffect(()=>{let v=!0,b;async function _(){let x;try{const A=await fetch(e);if(!A.ok)v&&(d(t),g(null));else{const k=await A.json();x=k,v&&(d(k),g(null))}}catch(A){v&&g(A)}finally{v&&h(!1)}if(!v)return;const j=c&&x!==void 0&&c(x)?l:n;b=setTimeout(_,j)}return _(),()=>{v=!1,clearTimeout(b)}},[e,n,l,r]),{data:u,loading:p,error:m}}function vl(e){const{data:t,loading:n,error:r}=Ts("/api/account",null,Up,e);return{account:t,loading:n,error:r}}function KW(e){const{data:t,loading:n,error:r}=Ts("/api/accounts",[],Up,e);return{accounts:t??[],loading:n,error:r}}async function QW(e){const t=await fetch("/api/account/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({safe:e})});if(!t.ok)throw new Error(`Switch failed (${t.status})`);return t.json()}async function C6(e,t){const n=await fetch("/api/account/rename",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({safe:e,name:t})});if(!n.ok)throw new Error(`Rename failed (${n.status})`);return n.json()}function YW(e){const{data:t,loading:n,error:r}=Ts("/api/overview",null,15e3,e,{fastWhile:a=>a!=null&&a.rpcConfigured===!0&&a.onchain!==!0,fastMs:1500});return{overview:t,loading:n,error:r}}function Dj(e){const{data:t,loading:n,error:r}=Ts("/api/activity",[],Up,e);return{events:Array.isArray(t)?t:[],loading:n,error:r}}function Wp(e){const{data:t,loading:n,error:r}=Ts("/api/mandate",[],1e4,e);return{mandates:Array.isArray(t)?t:t?[t]:[],loading:n,error:r}}function Oj(){const{data:e,loading:t}=Ts("/api/agent-status",{running:!1},5e3);return{running:(e==null?void 0:e.running)===!0,pid:(e==null?void 0:e.pid)??null,pids:Array.isArray(e==null?void 0:e.pids)?e.pids:[],source:(e==null?void 0:e.source)??null,lastActivityMs:(e==null?void 0:e.lastActivityMs)??null,githubActions:(e==null?void 0:e.githubActions)??null,loading:t}}function JW(){const{data:e,loading:t}=Ts("/api/station/pending",[],3e3);return{pending:Array.isArray(e)?e:[],loading:t}}const XW={1:"https://safe-transaction-mainnet.safe.global",10:"https://safe-transaction-optimism.safe.global",56:"https://safe-transaction-bsc.safe.global",100:"https://safe-transaction-gnosis-chain.safe.global",137:"https://safe-transaction-polygon.safe.global",8453:"https://safe-transaction-base.safe.global",130:"https://safe-transaction-unichain.safe.global",42161:"https://safe-transaction-arbitrum.safe.global",43114:"https://safe-transaction-avalanche.safe.global",59144:"https://safe-transaction-linea.safe.global",84532:"https://safe-transaction-base-sepolia.safe.global",421614:"https://safe-transaction-arbitrum-sepolia.safe.global",11155111:"https://safe-transaction-sepolia.safe.global"};function Fj(e,t){const[n,r]=I.useState([]),[a,c]=I.useState(!1),[l,u]=I.useState(!1);return I.useEffect(()=>{if(!t||!e){r([]),c(!1),u(!1);return}let d=!0;c(!0),u(!1),r([]);async function p(){const h=[];for(const[m,g]of Object.entries(XW))try{const v=await fetch(`${g}/api/v1/owners/${e}/safes/`);if(!v.ok)continue;const b=await v.json();for(const _ of(b==null?void 0:b.safes)??[])h.push({safe:_,chainId:Number(m)});d&&h.length>0&&r([...h])}catch{}d&&(c(!1),u(!0))}return p(),()=>{d=!1}},[e,t]),{safes:n,scanning:a,done:l}}function Qv(){const{data:e,loading:t,error:n}=Ts("/api/mandate-draft",null,5e3);return{draft:e,loading:t,error:n}}function zj(e){const{data:t,loading:n,error:r}=Ts("/api/positions",{positions:[],updatedAt:null},15e3,e);return{positions:(t==null?void 0:t.positions)??[],updatedAt:(t==null?void 0:t.updatedAt)??null,loading:n,error:r}}function ZW(e){const{data:t,loading:n,error:r}=Ts("/api/overviews",[],15e3,e,{fastWhile:a=>Array.isArray(a)&&a.some(c=>(c==null?void 0:c.rpcConfigured)===!0&&(c==null?void 0:c.onchain)!==!0),fastMs:1500});return{overviews:Array.isArray(t)?t:[],loading:n,error:r}}function U1(e){return!e||e.length<12?e??"":`${e.slice(0,6)}…${e.slice(-4)}`}const eV={ethereum:"eth",arbitrum:"arb1",base:"base",unichain:"unichain",optimism:"oeth",polygon:"matic"};function tV(e,t){return`https://app.safe.global/home?safe=${eV[e]??"eth"}:${t}`}function nV(){return o.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M5 9 L9 5"}),o.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}const rV={1:"Ethereum",10:"Optimism",137:"Polygon",8453:"Base",42161:"Arbitrum",130:"Unichain",84532:"Base Sepolia",421614:"Arb Sepolia"};function $j({open:e,wallet:t,safes:n=[],currentSafeId:r,hasSMA:a=!0,onClose:c,onDisconnect:l,onCreateSMA:u,onImportSMA:d,onRenameSafe:p,onSelectSafe:h}){const[m,g]=I.useState(!1),[v,b]=I.useState(null),[_,x]=I.useState(null),[j,A]=I.useState(""),[k,N]=I.useState(!1),[E,B]=I.useState(!1),[M,P]=I.useState(""),[R,z]=I.useState("8453"),[q,Q]=I.useState(""),{safes:O,scanning:K,done:$}=Fj(t,k&&!E);I.useEffect(()=>{if(!e)return;const Y=ue=>{ue.key==="Escape"&&L()};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[e]);function L(){g(!0),setTimeout(()=>{g(!1),c==null||c()},320)}function se(Y,ue){var xe;ue&&((xe=navigator==null?void 0:navigator.clipboard)!=null&&xe.writeText&&navigator.clipboard.writeText(ue),b(Y),setTimeout(()=>b(Re=>Re===Y?null:Re),1400))}function D(Y){x(Y.id),A(Y.name)}function X(){const Y=j.trim();_&&Y&&(p==null||p(_,Y)),x(null)}function te(){x(null)}function W(Y,ue){d==null||d({safe:Y,owner:t??Y,permissionSigner:t??Y,manager:t??Y,chainId:ue,createdAtBlock:"0"}),N(!1),L()}function oe(){const Y=M.trim();if(!/^0x[0-9a-fA-F]{40}$/.test(Y)){Q("Enter a valid 0x address.");return}const ue=Number(R);if(!ue){Q("Enter a valid chain ID.");return}W(Y,ue)}if(!e)return null;const be=a?n:[];return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Se.overlay,onClick:L,"aria-hidden":!0}),o.jsxs("aside",{className:`${Se.panel} ${m?Se.panelOut:""}`,role:"dialog","aria-modal":"true","aria-label":"Account",children:[o.jsxs("div",{className:Se.hero,children:[o.jsx("div",{className:Se.avatarRing,children:o.jsx("div",{className:Se.avatar,children:(t==null?void 0:t.slice(2,4).toUpperCase())??"U"})}),o.jsxs("div",{className:Se.identity,children:[o.jsx("span",{className:Se.identityKicker,children:"EOA · Owner"}),o.jsxs("button",{type:"button",className:Se.identityAddress,onClick:()=>se("eoa",t),"aria-label":"Copy EOA address",children:[o.jsx("span",{children:U1(t)}),o.jsx("span",{className:Se.identityCopyIcon,"aria-hidden":!0,children:v==="eoa"?o.jsx(j6,{}):o.jsx(k6,{})})]})]}),o.jsx("button",{type:"button",className:Se.disconnectPill,onClick:l??L,children:"Disconnect"})]}),o.jsx("div",{className:Se.divider}),o.jsxs("section",{className:Se.smasSection,children:[o.jsxs("header",{className:Se.smasHead,children:[o.jsx("span",{className:Se.smasKicker,children:"Separately Managed Accounts"}),o.jsxs("span",{className:Se.smasCount,children:[be.length," ",be.length===1?"SMA":"SMAs"]})]}),be.length>0?o.jsxs("ul",{className:Se.smaList,children:[be.map(Y=>{var Re;const ue=((Re=Y.id)==null?void 0:Re.toLowerCase())===(r==null?void 0:r.toLowerCase()),xe=Y.id===_;return o.jsxs("li",{className:`${Se.smaCard} ${ue?Se.smaCardPrimary:""}`,children:[o.jsxs("button",{type:"button",className:Se.smaRow,onClick:()=>{xe||h==null||h(Y)},children:[o.jsx("span",{className:Se.smaIcon,"aria-hidden":!0,children:o.jsx(S6,{})}),o.jsxs("span",{className:Se.smaBody,children:[o.jsxs("span",{className:Se.smaTitleRow,children:[xe?o.jsx("input",{autoFocus:!0,type:"text",value:j,onChange:Ae=>A(Ae.target.value),onClick:Ae=>Ae.stopPropagation(),onKeyDown:Ae=>{Ae.key==="Enter"&&(Ae.preventDefault(),X()),Ae.key==="Escape"&&(Ae.preventDefault(),te())},onBlur:X,className:Se.smaNameInput,maxLength:40,"aria-label":`Rename ${Y.name}`}):o.jsx("span",{className:Se.smaName,children:Y.name}),ue&&!xe&&o.jsx("span",{className:Se.smaPrimaryBadge,children:"Current"}),!xe&&o.jsx("span",{className:Se.smaRename,role:"button",tabIndex:0,onClick:Ae=>{Ae.stopPropagation(),D(Y)},onKeyDown:Ae=>{(Ae.key==="Enter"||Ae.key===" ")&&(Ae.preventDefault(),Ae.stopPropagation(),D(Y))},"aria-label":`Rename ${Y.name}`,children:o.jsx(sV,{})})]}),o.jsx("span",{className:Se.smaAddress,children:U1(Y.address)}),o.jsxs("span",{className:Se.smaMeta,children:[Y.networks&&Y.networks.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:Se.smaNetStack,"aria-hidden":!0,children:Y.networks.slice(0,4).map(Ae=>o.jsx("span",{className:`${Se.smaNetDot} ${Se[`smaNetDot_${Ae}`]??""}`},Ae))}),o.jsx("span",{className:Se.smaNetName,children:"Multichain"})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:`${Se.smaNetDot} ${Se[`smaNetDot_${Y.network}`]??""}`,"aria-hidden":!0}),o.jsx("span",{className:Se.smaNetName,children:bh(Y.network)})]}),o.jsx("span",{className:Se.smaMetaSep,"aria-hidden":!0,children:"·"}),o.jsxs("span",{className:Se.smaAgentCount,children:[Y.mandateCount," ",Y.mandateCount===1?"mandate":"mandates"]})]})]}),o.jsx("span",{className:Se.smaCopy,role:"button",tabIndex:0,onClick:Ae=>{Ae.stopPropagation(),se(Y.id,Y.address)},onKeyDown:Ae=>{(Ae.key==="Enter"||Ae.key===" ")&&(Ae.preventDefault(),Ae.stopPropagation(),se(Y.id,Y.address))},"aria-label":`Copy ${Y.name} address`,children:v===Y.id?o.jsx(j6,{}):o.jsx(k6,{})})]}),o.jsxs("a",{className:Se.smaSafeLink,href:tV(Y.network,Y.address),target:"_blank",rel:"noreferrer",onClick:Ae=>Ae.stopPropagation(),"aria-label":`Open ${Y.name} in the Safe app on ${bh(Y.network)}`,children:[o.jsxs("span",{className:Se.smaSafeLinkLabel,children:["Open in Safe",o.jsx("span",{className:Se.smaSafeLinkChain,children:Y.networks&&Y.networks.length>1?` · ${bh(Y.network)} (home)`:` · ${bh(Y.network)}`})]}),o.jsx(nV,{})]})]},Y.id)}),o.jsxs("li",{className:Se.smaActionRow,children:[o.jsxs("button",{type:"button",className:Se.smaActionBtn,onClick:u,children:[o.jsx("span",{className:Se.smaActionIcon,"aria-hidden":!0,children:"+"}),"Create"]}),o.jsxs("button",{type:"button",className:`${Se.smaActionBtn} ${k?Se.smaActionBtnActive:""}`,onClick:()=>{N(Y=>!Y),B(!1),Q("")},children:[o.jsx("span",{className:Se.smaActionIcon,"aria-hidden":!0,children:"↓"}),"Import"]})]}),k&&o.jsx("li",{className:Se.smaImportSection,children:E?o.jsxs("div",{className:Se.smaImportManual,children:[o.jsx("input",{className:Se.smaImportInput,type:"text",placeholder:"Safe address 0x…",value:M,onChange:Y=>{P(Y.target.value),Q("")},spellCheck:!1,autoFocus:!0}),o.jsx("input",{className:Se.smaImportInput,type:"text",placeholder:"Chain ID e.g. 8453",value:R,onChange:Y=>{z(Y.target.value),Q("")}}),q&&o.jsx("span",{className:Se.smaImportErr,children:q}),o.jsxs("div",{className:Se.smaImportActions,children:[o.jsx("button",{type:"button",className:Se.smaImportConfirm,onClick:oe,children:"Import SMA"}),o.jsx("button",{type:"button",className:Se.smaImportLink,onClick:()=>{B(!1),Q("")},children:"← Back"})]})]}):o.jsxs(o.Fragment,{children:[K&&O.length===0&&o.jsx("span",{className:Se.smaImportScan,children:"Scanning for Safes…"}),O.length>0&&o.jsx("ul",{className:Se.smaImportList,children:O.map(Y=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:Se.smaImportRow,onClick:()=>W(Y.safe,Y.chainId),children:[o.jsx("span",{className:Se.smaImportRowAddr,children:U1(Y.safe)}),o.jsx("span",{className:Se.smaImportRowNet,children:rV[Y.chainId]??`chain ${Y.chainId}`})]})},`${Y.chainId}-${Y.safe}`))}),$&&O.length===0&&o.jsx("span",{className:Se.smaImportScan,children:"No Safes found for this wallet."}),o.jsx("button",{type:"button",className:Se.smaImportLink,onClick:()=>B(!0),children:"Enter address manually"})]})})]}):o.jsxs("div",{className:Se.noSMA,children:[o.jsx("span",{className:Se.noSMAIcon,"aria-hidden":!0,children:o.jsx(S6,{})}),o.jsxs("div",{className:Se.noSMABody,children:[o.jsx("span",{className:Se.noSMAKicker,children:"Separately Managed Account"}),o.jsx("span",{className:Se.noSMATitle,children:"No SMA created yet"}),o.jsx("span",{className:Se.noSMASub,children:"Your SMA is deployed when you create your first agent."})]}),o.jsxs("button",{type:"button",className:Se.noSMACta,onClick:u,children:["Create your first agent",o.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M3 7h8M8 4l3 3-3 3"})})]})]})]})]})]})}function bh(e){return e&&e[0].toUpperCase()+e.slice(1)}function k6(){return o.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:[o.jsx("rect",{x:"2.5",y:"2.5",width:"7",height:"7",rx:"1.6",stroke:"currentColor",strokeWidth:"1.2"}),o.jsx("path",{d:"M4 4V3a1 1 0 011-1h4.5a1 1 0 011 1v5a1 1 0 01-1 1H9",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function j6(){return o.jsx("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function sV(){return o.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M9.5 1.6l2.9 2.9-7.6 7.6-3.2.4.4-3.2 7.5-7.7z",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M9 2.1l2.9 2.9",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function S6(){return o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:[o.jsx("rect",{x:"2.5",y:"3.5",width:"15",height:"13",rx:"2.6",stroke:"currentColor",strokeWidth:"1.4"}),o.jsx("circle",{cx:"10",cy:"10",r:"3",stroke:"currentColor",strokeWidth:"1.4"}),o.jsx("path",{d:"M10 7v.6M10 13.4v-.6M13 10h-.6M7.6 10H7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}const aV="_overlay_19cpu_1",oV="_card_19cpu_20",iV="_close_19cpu_52",cV="_headline_19cpu_78",lV="_lede_19cpu_85",uV="_promptBlock_19cpu_91",dV="_prompt_19cpu_91",fV="_copyBtn_19cpu_113",hV="_actions_19cpu_136",pV="_providerOpenBtn_19cpu_152",mV="_foot_19cpu_182",Xr={overlay:aV,card:oV,close:iV,headline:cV,lede:lV,promptBlock:uV,prompt:dV,copyBtn:fV,actions:hV,providerOpenBtn:pV,foot:mV},gV={claude:{bg:"linear-gradient(180deg, #D58066 0%, #BC6849 100%)",border:"#C57458",text:"#FFFFFF",shadow:"rgba(204, 120, 92, 0.5)"},cursor:{bg:"linear-gradient(180deg, #DDE3EE 0%, #B5BFD0 100%)",border:"#C9D2E0",text:"#0B0F17",shadow:"rgba(200, 210, 225, 0.42)"},codex:{bg:"linear-gradient(180deg, #11B58C 0%, #0D8C6C 100%)",border:"#11A07E",text:"#FFFFFF",shadow:"rgba(16, 163, 127, 0.5)"},default:{bg:"linear-gradient(180deg, #2F9CFF 0%, #1378E8 100%)",border:"#2D8EE8",text:"#FFFFFF",shadow:"rgba(25, 144, 255, 0.5)"}};function yV(e){const t=(e??"").toLowerCase();return t==="claude"||t==="anthropic"?"claude":t==="cursor"?"cursor":t==="codex"||t==="chatgpt"||t==="openai"||t==="gpt"?"codex":"default"}function vV({provider:e,onClick:t,children:n}){const r=gV[e],a={"--po-bg":r.bg,"--po-border":r.border,"--po-text":r.text,"--po-shadow":r.shadow};return o.jsx("button",{type:"button",className:Xr.providerOpenBtn,style:a,onClick:t,children:n})}function Yv({open:e,variant:t="new",context:n="agent",mandate:r=null,onClose:a}){const[c,l]=I.useState(!1);if(I.useEffect(()=>{if(!e)return;const g=v=>{v.key==="Escape"&&(a==null||a())};return window.addEventListener("keydown",g),document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",g),document.body.style.overflow=""}},[e,a]),!e)return null;const u=t==="redraft",d=n==="mandate",p=n==="station",h=u&&r?`Sailor, redraft my "${r.title}" agent. I want to change [describe the change].`:d?"Sailor, I want to register a permission that lets my agent swap up to $100 USDC into ETH weekly on Base.":p?"How do I get started with Sailor? I want to set up an agent, deploy a permission contract, and start the signing station.":"Sailor, I want to register a permission that lets my agent swap up to $100 USDC into ETH weekly on Base.";yV(r==null?void 0:r.aiName),r==null||r.aiName;function m(){var g;(g=navigator==null?void 0:navigator.clipboard)!=null&&g.writeText&&navigator.clipboard.writeText(h),l(!0),setTimeout(()=>l(!1),1500)}return o.jsx("div",{className:Xr.overlay,role:"dialog","aria-modal":"true",onClick:a,children:o.jsxs(Kt,{className:Xr.card,onClick:g=>g.stopPropagation(),children:[o.jsx("button",{type:"button",className:Xr.close,onClick:a,"aria-label":"Close",children:"×"}),o.jsx("h2",{className:`${ut.displayHeadline} ${Xr.headline}`,children:u?"Send this back to your AI.":d?"Mandates start with your AI.":p?"Get started with your AI.":"Agents start with your AI."}),o.jsx("p",{className:`${ut.italicMannerism} ${Xr.lede}`,children:u?"Tell your AI what to change. It will redraft the agent and a new signature request will appear here.":d?"A mandate defines the permissions your agents operate under. Your AI drafts it — you sign each permission onchain.":p?"Ask your AI to walk you through setting up Sailor — from keys and mandates to running your first agent.":"Your AI drafts the agent strategy. You review and authorize it here before it touches your funds."}),o.jsxs("div",{className:Xr.promptBlock,children:[o.jsx("span",{className:ut.metaLabel,children:"Try saying"}),o.jsxs("p",{className:Xr.prompt,children:["“",h,"”"]}),o.jsx("button",{type:"button",className:Xr.copyBtn,onClick:m,children:c?"✓ Copied":"Copy prompt"})]}),o.jsx("div",{className:Xr.actions,children:o.jsx(vV,{provider:"default",onClick:m,children:"Copy prompt →"})}),o.jsx("p",{className:Xr.foot,children:"Paste this into your AI coding agent (Claude Code, Cursor, Codex, …) to get started."})]})})}const bV=3e3,A6=(()=>{if(typeof window>"u")return null;const e=new URLSearchParams(window.location.search).get("server");if(!e)return null;const t=Number(e);return!Number.isInteger(t)||t<1024||t>65535?null:t})();function E6(){return typeof window>"u"?null:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/station/ws`}async function wV(){var t,n;if(A6){try{const a=await fetch(`http://localhost:${A6}/config`,{signal:AbortSignal.timeout(1500)});if(a.ok){const c=await a.json();if((t=c==null?void 0:c.wsUrl)!=null&&t.includes("secret="))return c}}catch{}const r=E6();return r?{wsUrl:r}:null}try{const r=await fetch(`${window.location.origin}/config`,{signal:AbortSignal.timeout(500)});if(r.ok){const a=await r.json();if((n=a==null?void 0:a.wsUrl)!=null&&n.includes("secret="))return a}}catch{}const e=E6();return e?{wsUrl:e}:null}function Hj({onMessage:e,enabled:t=!0}={}){const[n,r]=I.useState("checking"),a=I.useRef(null),c=I.useRef(null),l=I.useRef(e);I.useEffect(()=>{l.current=e});const u=I.useCallback(p=>{var m;if(((m=a.current)==null?void 0:m.readyState)===WebSocket.OPEN)return;const h=new WebSocket(p);a.current=h,c.current=g=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify(g))},h.onopen=()=>r("connected"),h.onmessage=g=>{var v;try{(v=l.current)==null||v.call(l,JSON.parse(g.data))}catch{}},h.onclose=()=>{r("disconnected"),a.current=null},h.onerror=()=>{r("disconnected"),a.current=null}},[]);I.useEffect(()=>{if(!t)return;let p=!1;const h=async()=>{var v;if(((v=a.current)==null?void 0:v.readyState)===WebSocket.OPEN)return;const g=await wV();p||(g?u(g.wsUrl):r(b=>b==="checking"?"disconnected":b))};h();const m=setInterval(h,bV);return()=>{p=!0,clearInterval(m)}},[t,u]);const d=I.useCallback(p=>{var h;(h=c.current)==null||h.call(c,p)},[]);return{status:n,send:d}}const qr="0x38b508756c976e876EFF05a29E731A4d348BA6ED",Kr="0x6d2C802ffa0d9A8Ed69A5Bf22c1b63ccB566B8Fc",Qr="0x4315B37cA4A315A7042af1Fcb37F8436f4D24356",_V={1:{chainId:1,name:"Ethereum",rpcEnvVar:"ETH_MAINNET_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},8453:{chainId:8453,name:"Base",rpcEnvVar:"BASE_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},42161:{chainId:42161,name:"Arbitrum",rpcEnvVar:"ARBITRUM_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},10:{chainId:10,name:"Optimism",rpcEnvVar:"OPTIMISM_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},130:{chainId:130,name:"Unichain",rpcEnvVar:"UNICHAIN_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},56:{chainId:56,name:"BSC",rpcEnvVar:"BSC_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},480:{chainId:480,name:"World Chain",rpcEnvVar:"WORLD_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},999:{chainId:999,name:"HyperEVM",rpcEnvVar:"HYPEREVM_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},4326:{chainId:4326,name:"MegaETH",rpcEnvVar:"MEGAETH_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},84532:{chainId:84532,name:"Base Sepolia",rpcEnvVar:"BASE_SEPOLIA_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}},11155111:{chainId:11155111,name:"Eth Sepolia",rpcEnvVar:"SEPOLIA_RPC_URL",kernel:qr,mandateFactory:Kr,governance:Qr,dispatchModel:"selective",protocols:{}}};function my(e){const t=_V[e];if(!t)throw new Error(`Chain ${e} is not supported. Supported chains: 1 (Ethereum), 8453 (Base), 42161 (Arbitrum), 10 (Optimism), 130 (Unichain), 56 (BSC), 480 (World Chain), 999 (HyperEVM), 4326 (MegaETH), 84532 (Base Sepolia), 11155111 (Eth Sepolia).`);return t}const xV="0x38b508756c976e876EFF05a29E731A4d348BA6ED",CV="0x4315B37cA4A315A7042af1Fcb37F8436f4D24356",kV="0xC1E5F9A581D4100Aa949f80204540a33aD97A7b6",jV="0x7897Cb53a4be4a2eaAf46D60573C4Fd83b33fE1F",SV="0x6d2C802ffa0d9A8Ed69A5Bf22c1b63ccB566B8Fc",AV="0x1087312447C8a2BfA15EB9cE23590E3502DBA04b",EV="0xB01dCE443d052e44b7D13726c0EC9fFB7f5815B6",NV="0x7b37F85575F1568a37dBA342BC5FE6d393F0872f",MV=10000000000000000n,Jo={swap:"0x35cEEa0db96997Cc3CF3beB42FFa36A499342F7C",swapNoOracle:"0x34Ba96CbEd1f46c88A5265E645DC5fe41662b519",borrow:"0x3e2666051599223cEAb10De55C89A0842857d8AF",deposit:"0xBfB5e13a97b12Ee89d2F2b9B65eCf7e0E371911f",withdraw:"0xF5eF5dda450a130e3020d54f565E830e4a7531f8",transfer:"0xda909a1CC584fb7559Ce4A828b008B473Da095e1",approveAndCallBatch:"0x0535A4D51333484ef583103DAB1a9449756ab732"},IV=[{kind:"SwapPermission",address:Jo.swap,label:"Swap"},{kind:"SwapPermissionNoOracle",address:Jo.swapNoOracle,label:"Swap (no oracle)"},{kind:"BorrowPermission",address:Jo.borrow,label:"Borrow"},{kind:"DepositPermission",address:Jo.deposit,label:"Deposit"},{kind:"WithdrawPermission",address:Jo.withdraw,label:"Withdraw"},{kind:"TransferPermission",address:Jo.transfer,label:"Transfer"},{kind:"ApproveAndCallBatchPermission",address:Jo.approveAndCallBatch,label:"Approve + call batch"}],Yr={deployer:EV,governance:CV,timelock:kV,kernel:xV,mandateFactory:SV,standardFeePolicy:AV,safeModuleEnabler:jV,treasury:NV,maxPermissionFeeWei:MV,initialBaseFee:0n,initialComplexityRate:0n,dispatchModel:"selective",standaloneTemplates:{}};function Jr(e){return IV.map(t=>({...t,chainId:e}))}const Jv={1:{...Yr,chainId:1,blockNumber:25432741,knownTemplates:Jr(1)},8453:{...Yr,chainId:8453,blockNumber:48029413,knownTemplates:Jr(8453)},42161:{...Yr,chainId:42161,blockNumber:25432669,knownTemplates:Jr(42161)},10:{...Yr,chainId:10,blockNumber:153625159,knownTemplates:Jr(10)},130:{...Yr,chainId:130,blockNumber:52100873,knownTemplates:Jr(130)},56:{...Yr,chainId:56,blockNumber:107312662,knownTemplates:Jr(56)},480:{...Yr,chainId:480,blockNumber:31756901,knownTemplates:Jr(480)},999:{...Yr,chainId:999,blockNumber:39238629,knownTemplates:Jr(999)},4326:{...Yr,chainId:4326,blockNumber:20056530,knownTemplates:Jr(4326)},84532:{...Yr,chainId:84532,blockNumber:43539604,knownTemplates:Jr(84532)},11155111:{...Yr,chainId:11155111,blockNumber:11174750,knownTemplates:Jr(11155111)}};function Uj(e){const t=Jv[e];if(!t)throw new Error(`No Sail deployment is bundled for chain ${e}`);return t}const BV=Is({id:130,name:"Unichain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.unichain.org/"]}},blockExplorers:{default:{name:"Uniscan",url:"https://uniscan.xyz"}}}),TV=Is({id:1301,name:"Unichain Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.unichain.org/"]}},blockExplorers:{default:{name:"Uniscan Sepolia",url:"https://sepolia.uniscan.xyz"}},testnet:!0}),Wj=[h4,UR,Lp,BV,p4,WR,TV,VR],PV="sailor-local-dev",RV=Ez({appName:"Sailor",projectId:PV,chains:Wj,ssr:!1}),LV=Object.fromEntries(Wj.filter(e=>{var t,n;return(n=(t=e==null?void 0:e.blockExplorers)==null?void 0:t.default)==null?void 0:n.url}).map(e=>[e.id,{name:e.blockExplorers.default.name,url:e.blockExplorers.default.url.replace(/\/$/,"")}])),DV={10:{name:"Optimistic Etherscan",url:"https://optimistic.etherscan.io"},137:{name:"Polygonscan",url:"https://polygonscan.com"},56:{name:"BscScan",url:"https://bscscan.com"},480:{name:"Worldscan",url:"https://worldscan.org"},999:{name:"HyperEVM Scan",url:"https://hyperevmscan.io"},6342:{name:"MegaExplorer",url:"https://megaexplorer.xyz"}},OV={ethereum:1,base:8453,arbitrum:42161,"arbitrum one":42161,unichain:130,optimism:10,polygon:137,binance:56,world:480,hyperevm:999,megaeth:6342,"base sepolia":84532,"eth sepolia":11155111,"ethereum sepolia":11155111,"arbitrum sepolia":421614,"unichain sepolia":1301};function FV(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=e.trim().toLowerCase().replace(/[-_]+/g," ").replace(/\s+/g," ");return OV[t]??null}return null}function Vj(e){const t=FV(e);return t==null?null:LV[t]??DV[t]??null}function Ni(e,t){const n=Vj(e);return n?`${n.url}/tx/${t}`:null}function Xv(e,t){const n=Vj(e);return n?`${n.url}/address/${t}`:null}function Rd(e,t){const n=Xv(e,t);return n?`${n}#code`:null}function zV(){const{draft:e}=Qv();return e?o.jsx(Gj,{draft:e}):o.jsx($V,{})}function $V(){return o.jsxs("div",{className:Je.shell,children:[o.jsx(ga,{}),o.jsx(qj,{state:"welcome"}),o.jsx("main",{className:Je.stage,children:o.jsx("div",{className:Je.stageInner,children:o.jsxs(Kt,{className:Je.welcomeCard,children:[o.jsx("div",{className:Je.cardSai,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("header",{className:Je.cardHeader,children:[o.jsx("span",{className:Je.kicker,children:"SIGNING STATION"}),o.jsx("h1",{className:`${ut.displayHeadline} ${Je.cardHeadline}`,children:"No pending signatures."}),o.jsxs("p",{className:`${ut.italicMannerism} ${Je.cardTagline}`,children:["Run ",o.jsx("code",{style:{fontSize:13,opacity:.8},children:"sailor mandate prepare"})," to queue a mandate for signing."]})]}),o.jsx("div",{className:Je.welcomeCta,children:o.jsx(Ze,{fullWidth:!0,onClick:()=>{window.location.hash="#/dashboard"},children:"Go to dashboard"})})]})})})]})}new Set(Object.keys(Jv).map(Number));const HV=[{type:"function",name:"signerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]}];function UV({ex:e}){var t,n;return o.jsxs("div",{style:{marginTop:10,paddingTop:10,borderTop:"1px solid var(--glass-border)"},children:[o.jsx(Bj,{items:[e.protocol,e.chain,e.version]}),((t=e.enforced)==null?void 0:t.length)>0&&o.jsxs("div",{style:{marginBottom:8},children:[o.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"#5dde8b",marginBottom:5},children:"Enforced on-chain"}),o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:3},children:e.enforced.map((r,a)=>o.jsxs("li",{style:{fontSize:12,color:"rgba(255,255,255,0.65)",paddingLeft:12,position:"relative"},children:[o.jsx("span",{style:{position:"absolute",left:0,color:"#5dde8b"},children:"·"}),r]},a))})]}),((n=e.notEnforced)==null?void 0:n.length)>0&&o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgba(255,255,255,0.3)",marginBottom:5},children:"Agent code — not enforced on-chain"}),o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:3},children:e.notEnforced.map((r,a)=>o.jsxs("li",{style:{fontSize:12,color:"rgba(255,255,255,0.3)",paddingLeft:12,position:"relative"},children:[o.jsx("span",{style:{position:"absolute",left:0},children:"·"}),r]},a))})]})]})}function WV({item:e,chainId:t}){const[n,r]=I.useState(!1),a=e.permExplanation,c=e.address?Rd(t,e.address):null;return o.jsxs("li",{style:{borderRadius:2,background:"var(--glass-bg)",border:"1px solid var(--glass-border)",overflow:"hidden"},children:[o.jsxs("div",{onClick:()=>a&&r(l=>!l),style:{padding:"10px 12px",cursor:a?"pointer":"default",display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8},children:[o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx("div",{style:{color:"var(--text-secondary)",fontSize:14,lineHeight:1.5},children:e.explanation}),e.address&&o.jsxs("div",{style:{fontSize:11,color:"rgba(255,255,255,0.25)",marginTop:2,fontFamily:"monospace",display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[o.jsxs("span",{children:[e.address.slice(0,6),"…",e.address.slice(-4)]}),c&&o.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",onClick:l=>l.stopPropagation(),style:{color:"#7eb8f7",textDecoration:"none"},children:"View code on scanner ↗"})]})]}),a&&o.jsxs("span",{style:{flexShrink:0,display:"inline-flex",alignItems:"center",gap:5,padding:"3px 8px",borderRadius:4,border:"1px solid rgba(255,255,255,0.12)",background:n?"rgba(255,255,255,0.07)":"rgba(255,255,255,0.03)",fontSize:11,color:"rgba(255,255,255,0.5)",fontWeight:500,whiteSpace:"nowrap",transition:"background 0.15s, color 0.15s",userSelect:"none"},children:["Details",o.jsx("span",{style:{fontSize:8,display:"inline-block",transform:n?"rotate(180deg)":"none",transition:"transform 0.2s",opacity:.6},children:"▾"})]})]}),n&&a&&o.jsx("div",{style:{padding:"0 12px 12px"},children:o.jsx(UV,{ex:a})})]})}function VV({fee:e}){return o.jsxs("div",{style:{marginTop:4,marginBottom:4,padding:"10px 12px",borderRadius:2,background:"var(--glass-bg)",border:"1px solid var(--glass-border)",display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8},children:[o.jsx("span",{style:{fontSize:13,color:"var(--text-secondary)"},children:"Registration fee"}),o.jsxs("span",{style:{textAlign:"right"},children:[o.jsxs("span",{style:{fontSize:14,color:"var(--text-primary, #fff)",fontWeight:600},children:[e.totalEth," ETH"]}),e.permissionCount>1&&e.perPermissionEth&&o.jsxs("span",{style:{display:"block",fontSize:11,color:"rgba(255,255,255,0.4)",marginTop:2},children:[e.permissionCount," permissions × ",e.perPermissionEth," ETH"]}),e.permissionCount>1&&!e.perPermissionEth&&o.jsxs("span",{style:{display:"block",fontSize:11,color:"rgba(255,255,255,0.4)",marginTop:2},children:["for ",e.permissionCount," permissions"]})]})]})}function Gj({draft:e,embedded:t=!1}){const{isConnected:n,chainId:r}=dt(),{signTypedDataAsync:a}=ml(),{switchChainAsync:c}=Bs(),l=Md(),[u,d]=I.useState("review"),[p,h]=I.useState(""),m=(e.items??[]).length>0?e.items:(e.permissions??[]).map(A=>({template:A.address,explanation:A.label,address:A.address,permExplanation:A.explanation??null})),g=(()=>{try{return my(e.chainId).kernel}catch{return Bt}})(),v=n&&r!==e.chainId;async function b(){await fetch("/api/mandate-draft",{method:"DELETE"}).catch(()=>{}),window.location.hash="#/dashboard"}async function _(){try{await c({chainId:e.chainId})}catch(A){h((A==null?void 0:A.shortMessage)||(A==null?void 0:A.message)||"Could not switch network")}}async function x(){if(u!=="signing"){h(""),d("signing");try{const A=m.map(M=>M.template);let k=0n;try{l&&g!==Bt&&(k=await l.readContract({address:g,abi:HV,functionName:"signerNonces",args:[e.account]}))}catch{k=0n}const N=BigInt(Math.floor(Date.now()/1e3)+3600),E=await a({domain:{name:"SailKernel",version:"1",chainId:e.chainId,verifyingContract:g},types:{RegisterPermissions:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},primaryType:"RegisterPermissions",message:{account:e.account,permissions:A,nonce:k,deadline:N}}),B=await fetch("/api/mandate-submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({signature:E,signedAt:new Date().toISOString(),permissions:A,deadline:N.toString()})});if(!B.ok){const M=await B.json().catch(()=>null);throw new Error((M==null?void 0:M.error)||`Submit failed (${B.status})`)}d("done")}catch(A){h((A==null?void 0:A.shortMessage)||(A==null?void 0:A.message)||"Signing failed"),d("review")}}}const j=u==="done"?o.jsx(KV,{draft:e}):o.jsxs(Kt,{className:Je.authCard,children:[o.jsx(qV,{kicker:"REVIEW MANDATE",title:"Authorize your agent",sub:"Sign with your wallet — Sail never holds your keys."}),n?o.jsxs(o.Fragment,{children:[o.jsx(GV,{draft:e,items:m}),o.jsx("ul",{style:{listStyle:"none",padding:0,margin:"12px 0",display:"flex",flexDirection:"column",gap:10},children:m.map((A,k)=>o.jsx(WV,{item:A,chainId:e.chainId},k))}),e.registrationFee&&o.jsx(VV,{fee:e.registrationFee}),p&&o.jsx("p",{style:{color:"#ff6b6b",fontSize:13,margin:"8px 0"},children:p}),v?o.jsxs(o.Fragment,{children:[o.jsx("p",{style:{fontSize:13,color:"rgba(255,255,255,0.45)",margin:"0 0 10px"},children:"Your wallet is on a different network. Switch to sign this mandate."}),o.jsxs("div",{className:Je.actionRow,children:[o.jsxs(Ze,{fullWidth:!0,onClick:_,children:["Switch to ",(()=>{try{return my(e.chainId).name}catch{return`Chain ${e.chainId}`}})()]}),o.jsx("button",{type:"button",className:Je.rejectBtn,onClick:b,children:"Reject"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:Je.actionRow,children:[o.jsx(Ze,{fullWidth:!0,onClick:x,disabled:u==="signing",children:u==="signing"?"Waiting for wallet…":"Sign mandate"}),o.jsx("button",{type:"button",className:Je.rejectBtn,onClick:b,disabled:u==="signing",children:"Reject"})]}),o.jsx("p",{className:Je.fineprint,children:"Revocable on-chain at any time from your dashboard."})]})]}):o.jsx("div",{style:{display:"flex",justifyContent:"center",paddingTop:8},children:o.jsx(qv,{showBalance:!1})})]});return t?o.jsx("div",{className:Je.embeddedFlow,children:j}):o.jsxs("div",{className:Je.shell,children:[o.jsx(ga,{}),o.jsx(qj,{state:u==="done"?"confirming":"review"}),o.jsx("main",{className:Je.stage,children:o.jsx("div",{className:Je.stageInner,children:j})})]})}function GV({draft:e,items:t}){const n=(()=>{try{return my(e.chainId).name}catch{return`Chain ${e.chainId}`}})(),r=t.length,a=e.account?`${e.account.slice(0,6)}…${e.account.slice(-4)}`:"—",c={display:"flex",justifyContent:"space-between",gap:12,fontSize:12.5},l={color:"rgba(255,255,255,0.45)"},u={color:"rgba(255,255,255,0.85)",fontVariantNumeric:"tabular-nums"};return o.jsxs("div",{style:{border:"1px solid rgba(255,255,255,0.08)",borderRadius:8,padding:"12px 14px",margin:"4px 0 12px",background:"rgba(255,255,255,0.02)",display:"flex",flexDirection:"column",gap:10},children:[o.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5,color:"rgba(255,255,255,0.92)"},children:["You're authorizing your agent to perform"," ",o.jsxs("strong",{children:[r," bounded action type",r===1?"":"s"]})," on"," ",o.jsx("strong",{children:n}),". Each is constrained by the rules below."]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[o.jsxs("div",{style:c,children:[o.jsx("span",{style:l,children:"Account (SMA)"}),o.jsx("span",{style:u,children:a})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{style:l,children:"Network"}),o.jsx("span",{style:u,children:n})]})]}),o.jsxs("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:4},children:[o.jsx("li",{style:{fontSize:12.5,color:"rgba(120,220,160,0.95)"},children:"✓ Revocable on-chain anytime from your dashboard"}),o.jsx("li",{style:{fontSize:12.5,color:"rgba(120,220,160,0.95)"},children:"✓ Sail never holds your keys or funds — you sign every authorization"}),o.jsx("li",{style:{fontSize:12.5,color:"rgba(255,180,120,0.95)"},children:"✗ The agent cannot act outside the permissions listed below"})]})]})}function qj({state:e}){return o.jsx(Rj,{eyebrow:"Signing",title:e==="confirming"?"Signed":"Sail never sees your keys",backTo:"#/dashboard"})}function qV({kicker:e,title:t,sub:n,onBack:r}){return o.jsxs("header",{className:Je.cardHeader,children:[r&&o.jsx("button",{type:"button",className:Je.backBtn,onClick:r,"aria-label":"Back",children:o.jsx(QV,{})}),o.jsx("span",{className:Je.kicker,children:e}),o.jsx("h1",{className:`${ut.displayHeadline} ${Je.cardHeadline}`,children:t}),n&&o.jsx("p",{className:Je.cardSub,children:n})]})}function KV({draft:e}){const[t,n]=I.useState(!1),r=((e==null?void 0:e.items)??(e==null?void 0:e.permissions)??[]).length,a=e!=null&&e.account?`${e.account.slice(0,10)}…${e.account.slice(-6)}`:null,c=`My mandate is signed on Safe ${(e==null?void 0:e.account)??"my Safe"}. ${r} permission${r===1?"":"s"} registered. Now deploy and start the agent — use SAIL_PASSPHRASE from my config and run sailor run.`;function l(){var u;(u=navigator==null?void 0:navigator.clipboard)==null||u.writeText(c),n(!0),setTimeout(()=>n(!1),1500)}return o.jsxs(Kt,{className:Je.welcomeCard,children:[o.jsx("div",{className:Je.cardSai,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("header",{className:Je.cardHeader,children:[o.jsx("span",{className:Je.kicker,children:"MANDATE SIGNED"}),o.jsx("h1",{className:`${ut.displayHeadline} ${Je.cardHeadline}`,children:"Permissions registered."}),o.jsxs("p",{className:`${ut.italicMannerism} ${Je.cardTagline}`,children:[r," permission",r===1?"":"s"," authorized",a?` on ${a}`:"",". Tell your AI to start the agent."]})]}),o.jsxs("div",{className:Je.mandateSignedPrompt,children:[o.jsx("span",{className:Je.mandateSignedPromptLabel,children:"Copy prompt for your AI"}),o.jsxs("p",{className:Je.mandateSignedPromptText,children:['"',c,'"']}),o.jsx("button",{type:"button",className:Je.mandateSignedCopyBtn,onClick:l,children:t?"✓ Copied":"Copy"})]}),o.jsx("div",{className:Je.welcomeCta,children:o.jsx(Ze,{fullWidth:!0,onClick:()=>{window.location.hash="#/dashboard"},children:"Go to dashboard"})})]})}function QV(){return o.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M15 6l-6 6 6 6"})})}const YV={"create-sma":"Create Safe (SMA)","deploy-mandate":"Deploy Mandate","register-permission":"Register Permission","attach-mandate":"Attach Mandate","set-delegate":"Set Agent as Manager"},N6=e=>`${e.slice(0,6)}…${e.slice(-4)}`,W1=(e,t)=>{var n;return((n=e.find(r=>r.id===t))==null?void 0:n.name)??`Chain ${t}`};function JV(){const{draft:e}=Qv(),t=e&&(e.permissions??e.items??[]).length>0,[n,r]=I.useState([]),[a,c]=I.useState({phase:"idle"}),[l,u]=I.useState(!1),[d,p]=I.useState(!1),{address:h,isConnected:m}=dt(),g=kv(),{disconnect:v}=Ri(),{account:b}=vl(),_=I.useRef([]),x=I.useCallback(N=>{if(N.type==="pending")_.current=N.requests,r(N.requests);else if(N.type==="request")_.current.find(E=>E.id===N.request.id)||(_.current=[..._.current,N.request]),r(_.current);else if(N.type==="request-resolved"){const E=_.current.filter(B=>B.id!==N.requestId);_.current=E,r(E),c(B=>B.requestId!==N.requestId?B:B.phase==="done"&&E.length===0?{phase:"success",requestId:N.requestId,kind:B.kind}:{phase:"idle"})}},[]),{status:j,send:A}=Hj({onMessage:x});I.useEffect(()=>{j==="connected"&&A(m&&h?{type:"wallet-connected",address:h}:{type:"wallet-disconnected"})},[j,h,m,A]);const k=b?[{id:"live-sma",name:"My SMA",address:b.safe,network:b.chainId===8453?"base":b.chainId===42161?"arbitrum":"ethereum",networks:[],agentCount:0,createdAt:null}]:[];return o.jsxs("div",{className:He.shell,children:[o.jsx(ga,{}),o.jsx(Rj,{eyebrow:"Signing Station",title:"Pending Signatures",backTo:"#/dashboard"}),o.jsx("main",{className:He.main,children:m?a.phase==="success"?o.jsx(eG,{kind:a.kind,onDone:()=>{c({phase:"idle"}),window.location.hash="#/dashboard"}}):t?o.jsx(Gj,{draft:e,embedded:!0}):n.length===0?o.jsx(tG,{daemonConnected:j==="connected",onAsk:()=>p(!0)}):o.jsx(XV,{requests:n,chains:g,phase:a,setPhase:c,send:A}):o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,padding:"40px 0"},children:o.jsx(Lj,{eyebrow:"SIGNING STATION",title:"Connect to approve requests.",sub:"Connect the owner wallet to review and sign pending agent requests."})})}),o.jsx($j,{open:l,wallet:h,safes:k,currentSafeId:"live-sma",hasSMA:!!b,onClose:()=>u(!1),onDisconnect:()=>{u(!1),v()},onCreateSMA:()=>{u(!1),window.location.hash="#/dashboard"},onRenameSafe:()=>{},onSelectSafe:()=>{}}),o.jsx(Yv,{open:d,variant:"new",context:"station",onClose:()=>p(!1)})]})}function XV({requests:e,chains:t,phase:n,setPhase:r,send:a}){const{sendTransactionAsync:c}=Li(),{signTypedDataAsync:l}=ml(),u=I.useCallback(async h=>{r({phase:"submitting",requestId:h.id,kind:h.kind});try{if(h.type==="transaction"){const m=await c({to:h.to?h.to:void 0,data:h.data,value:h.value?BigInt(h.value):0n,chainId:h.chainId});r({phase:"done",requestId:h.id,kind:h.kind,txHash:m}),a({type:"signed",requestId:h.id,txHash:m})}else{const m=Object.fromEntries(Object.entries(h.typedData.message).map(([v,b])=>[v,typeof b=="string"&&/^\d+$/.test(b)?BigInt(b):b])),g=await l({domain:h.typedData.domain,types:h.typedData.types,primaryType:h.typedData.primaryType,message:m});r({phase:"done",requestId:h.id,kind:h.kind,txHash:g}),a({type:"signature",requestId:h.id,signature:g})}}catch(m){r({phase:"error",requestId:h.id,kind:h.kind,message:m instanceof Error?m.message:String(m)})}},[c,l,r,a]),d=I.useCallback(h=>{r({phase:"idle"}),a({type:"rejected",requestId:h})},[r,a]),p=n.phase==="submitting"||n.phase==="done";return o.jsx(o.Fragment,{children:e.map(h=>o.jsx(ZV,{request:h,chains:t,phase:n,onSign:u,onReject:d,otherActive:p&&n.requestId!==h.id},h.id))})}function ZV({request:e,chains:t,phase:n,onSign:r,onReject:a,otherActive:c}){var b;const{isConnected:l,chainId:u}=dt(),{switchChain:d}=Bs(),p=n.requestId===e.id,h=p&&n.phase==="submitting",m=p&&n.phase==="done",g=p&&n.phase==="error",v=l&&u!==void 0&&u!==e.chainId;return o.jsxs("div",{className:He.card,children:[o.jsx("span",{className:He.cardKicker,children:YV[e.kind]??e.kind}),o.jsxs("div",{className:He.cardHead,children:[o.jsx("h2",{className:He.cardTitle,children:e.title}),o.jsx("p",{className:He.cardDesc,children:e.description})]}),((b=e.permissions)==null?void 0:b.length)>0?o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,marginBottom:4},children:e.permissions.map((_,x)=>{const j=_.address?Rd(e.chainId,_.address):null;return o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8,flexWrap:"wrap"},children:[o.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-secondary, rgba(255,255,255,0.72))"},children:_.label}),j&&o.jsx("a",{href:j,target:"_blank",rel:"noreferrer",onClick:A=>A.stopPropagation(),style:{color:"#7eb8f7",textDecoration:"none",fontSize:12,whiteSpace:"nowrap"},children:"View code on scanner ↗"})]}),_.explanation&&o.jsx(M6,{ex:_.explanation})]},_.address??x)})}):e.explanation?o.jsx(M6,{ex:e.explanation}):null,o.jsxs("div",{className:He.details,children:[e.details.map(_=>o.jsx(wh,{label:_.label,value:_.value,chainId:e.chainId},_.label)),o.jsx(wh,{label:"Network",value:W1(t,e.chainId),mono:!1}),e.type==="transaction"&&e.to&&o.jsx(wh,{label:"Contract",value:e.to,chainId:e.chainId}),e.type==="transaction"&&!e.to&&o.jsx(wh,{label:"Action",value:"Deploys a new contract",mono:!1})]}),e.registrationFee&&o.jsxs("div",{style:{marginTop:4,marginBottom:4,padding:"10px 12px",borderRadius:2,background:"var(--glass-bg)",border:"1px solid var(--glass-border)",display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8},children:[o.jsx("span",{style:{fontSize:13,color:"var(--text-secondary)"},children:"Registration fee"}),o.jsxs("span",{style:{textAlign:"right"},children:[o.jsxs("span",{style:{fontSize:14,color:"var(--text-primary, #fff)",fontWeight:600},children:[e.registrationFee.totalEth," ETH"]}),e.registrationFee.permissionCount>1&&e.registrationFee.perPermissionEth&&o.jsxs("span",{style:{display:"block",fontSize:11,color:"rgba(255,255,255,0.4)",marginTop:2},children:[e.registrationFee.permissionCount," permissions × ",e.registrationFee.perPermissionEth," ETH"]})]})]}),m&&o.jsxs("div",{className:`${He.banner} ${He.ok}`,children:["Submitted —"," ",e.type==="transaction"&&Ni(e.chainId,n.txHash)?o.jsxs("a",{href:Ni(e.chainId,n.txHash),target:"_blank",rel:"noreferrer",style:{color:"inherit",textDecoration:"underline"},children:[N6(n.txHash)," ↗"]}):N6(n.txHash)]}),g&&o.jsx("div",{className:`${He.banner} ${He.danger}`,children:n.message}),v&&o.jsxs("div",{className:`${He.banner} ${He.warn}`,children:["Wallet is on ",W1(t,u),"."," ",o.jsxs("button",{type:"button",className:He.linkBtn,onClick:()=>d({chainId:e.chainId}),children:["Switch to ",W1(t,e.chainId)]})]}),o.jsxs("div",{className:He.actions,children:[o.jsx("button",{type:"button",className:He.reject,disabled:h||m||c,onClick:()=>a(e.id),children:"Reject"}),l?o.jsx("button",{type:"button",className:He.primary,disabled:h||m||v||c,onClick:()=>r(e),children:c?"Waiting…":h?e.type==="typed-data"?"Signing…":"Submitting…":m?"Signed ✓":e.type==="typed-data"?"Sign Message":"Sign & Submit"}):o.jsx("span",{className:He.connectHint,children:"Connect wallet to sign"})]})]})}function M6({ex:e}){var n,r,a,c,l;return(((n=e.enforced)==null?void 0:n.length)??0)>0||(((r=e.notEnforced)==null?void 0:r.length)??0)>0?o.jsxs("div",{style:{margin:"0 0 14px",padding:12,borderRadius:6,background:"rgba(255,255,255,0.03)",border:"1px solid var(--glass-border, rgba(255,255,255,0.1))"},children:[o.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgba(255,255,255,0.4)",marginBottom:8},children:"What you're signing"}),o.jsx(Bj,{items:[e.protocol,e.chain,e.version]}),((a=e.enforced)==null?void 0:a.length)>0&&o.jsxs("div",{style:{marginBottom:((c=e.notEnforced)==null?void 0:c.length)>0?8:0},children:[o.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"#5dde8b",marginBottom:5},children:"Enforced on-chain"}),o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:3},children:e.enforced.map((u,d)=>o.jsxs("li",{style:{fontSize:12,color:"rgba(255,255,255,0.65)",paddingLeft:12,position:"relative"},children:[o.jsx("span",{style:{position:"absolute",left:0,color:"#5dde8b"},children:"·"}),u]},d))})]}),((l=e.notEnforced)==null?void 0:l.length)>0&&o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgba(255,255,255,0.3)",marginBottom:5},children:"Agent code — not enforced on-chain"}),o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:3},children:e.notEnforced.map((u,d)=>o.jsxs("li",{style:{fontSize:12,color:"rgba(255,255,255,0.3)",paddingLeft:12,position:"relative"},children:[o.jsx("span",{style:{position:"absolute",left:0},children:"·"}),u]},d))})]})]}):null}function wh({label:e,value:t,mono:n=!0,chainId:r}){const a=typeof t=="string"&&/^0x[a-fA-F0-9]{40}$/.test(t),c=/contract|permission/i.test(e),l=a&&c&&r?Rd(r,t):null;return o.jsxs("div",{className:He.detailRow,children:[o.jsx("span",{className:He.detailLabel,children:e}),o.jsxs("span",{style:{display:"inline-flex",gap:10,alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end"},children:[n?o.jsx("code",{className:He.detailValue,children:t}):o.jsx("span",{className:He.detailValue,children:t}),l&&o.jsx("a",{href:l,target:"_blank",rel:"noreferrer",onClick:u=>u.stopPropagation(),style:{color:"#7eb8f7",textDecoration:"none",fontSize:12,whiteSpace:"nowrap"},children:"View code on scanner ↗"})]})]})}function eG({kind:e,onDone:t}){const n=e==="register-permission"||e==="attach-mandate";return o.jsxs(Kt,{className:He.emptyCard,children:[o.jsx("div",{className:He.emptyCardSai,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("header",{className:He.emptyCardHeader,children:[o.jsx("span",{className:He.emptyKicker,children:"SIGNED"}),o.jsxs("h1",{className:`${ut.displayHeadline} ${He.emptyHeadline}`,style:{color:"var(--accent-green, #4ade80)"},children:["✓ ",n?"Permission registered.":"Done."]}),o.jsx("p",{className:`${ut.italicMannerism} ${He.emptyTagline}`,children:n?"Your agent is authorized to dispatch within this permission.":"The request was signed and submitted."})]}),o.jsx("div",{className:He.emptyCta,children:o.jsx(Ze,{fullWidth:!0,onClick:t,children:"Back to dashboard →"})})]})}function tG({daemonConnected:e,onAsk:t}){return o.jsxs(Kt,{className:He.emptyCard,children:[o.jsx("div",{className:He.emptyCardSai,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("header",{className:He.emptyCardHeader,children:[o.jsx("span",{className:He.emptyKicker,children:"SIGNING STATION"}),o.jsx("h1",{className:`${ut.displayHeadline} ${He.emptyHeadline}`,children:"No signatures pending."}),o.jsx("p",{className:`${ut.italicMannerism} ${He.emptyTagline}`,children:e?"The agent will push approval requests here as it works.":o.jsxs(o.Fragment,{children:["Run ",o.jsx("code",{style:{fontSize:13,opacity:.8},children:"sailor station start"})," to connect — this page will reconnect automatically."]})})]}),o.jsx("div",{className:He.emptyCta,children:o.jsx(Ze,{fullWidth:!0,onClick:t,children:"Ask AI how to get started"})})]})}const nG={RegisterAccount:[{name:"account",type:"address"},{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"},{name:"feeAsset",type:"address"},{name:"deadline",type:"uint256"}]};function rG(e){const t=e.deadline??BigInt(Math.floor(Date.now()/1e3)+600),n=e.feeAsset??"0x0000000000000000000000000000000000000000";return{domain:{name:"SailKernel",version:"1",chainId:e.chainId,verifyingContract:e.kernel},types:nG,primaryType:"RegisterAccount",message:{account:e.account,permissionSigner:e.permissionSigner,manager:e.manager,feePolicy:e.feePolicy,feeAsset:n,deadline:t.toString()}}}const sG=[{type:"function",name:"execTransaction",stateMutability:"payable",inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"operation",type:"uint8"},{name:"safeTxGas",type:"uint256"},{name:"baseGas",type:"uint256"},{name:"gasPrice",type:"uint256"},{name:"gasToken",type:"address"},{name:"refundReceiver",type:"address"},{name:"signatures",type:"bytes"}],outputs:[{name:"success",type:"bool"}]}],Kj=[{type:"function",name:"setup",stateMutability:"nonpayable",inputs:[{name:"_owners",type:"address[]"},{name:"_threshold",type:"uint256"},{name:"to",type:"address"},{name:"data",type:"bytes"},{name:"fallbackHandler",type:"address"},{name:"paymentToken",type:"address"},{name:"payment",type:"uint256"},{name:"paymentReceiver",type:"address"}],outputs:[]}],aG=[{type:"function",name:"enable",stateMutability:"nonpayable",inputs:[{name:"module",type:"address"}],outputs:[]}],ri={proxyFactory:"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",singletonL2:"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",fallbackHandler:"0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99"};function oG(e){const t=At({abi:aG,functionName:"enable",args:[e.kernel]});return At({abi:Kj,functionName:"setup",args:[e.owners,e.threshold,e.safeModuleEnabler,t,e.fallbackHandler??ri.fallbackHandler,Bt,0n,Bt]})}function iG(e){return AC(["bytes32","bytes32","uint8"],[br(e,{size:32}),br("0x",{size:32}),1])}const cG=[{type:"function",name:"registerAccount",stateMutability:"nonpayable",inputs:[{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"},{name:"feeAsset",type:"address"},{name:"deadline",type:"uint256"},{name:"ownerSig",type:"bytes"}],outputs:[]}];function lG(e){const t=At({abi:cG,functionName:"registerAccount",args:[e.permissionSigner,e.manager,e.feePolicy,e.feeAsset,e.deadline,e.ownerSig]}),n=At({abi:sG,functionName:"execTransaction",args:[e.kernel,0n,t,0,0n,0n,0n,Bt,Bt,iG(e.owner)]});return{to:e.safe,data:n}}function uG(e={}){var Q;const t=e.container||document.body,n=e.opacity!=null?e.opacity:.28,r=e.zIndex!=null?e.zIndex:0,a=e.fixed!==!1,c=e.grid||17,l=1e3/(e.fps||30),u="attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos,0.0,1.0); }",d=["uniform float u_time;","uniform vec2 u_res;","uniform float u_grid;","float hash(vec2 p){ return fract(sin(dot(p, vec2(12.9898,78.233))) * 43758.5453); }","// Sharp crest, broad flat trough — the trochoidal silhouette of a real swell.","float crest(float phase, float sharp){ return exp(sharp * (cos(phase) - 1.0)); }","float composite(vec2 p, float t){"," p.y += sin(t * 0.40) * 0.055;"," p.x += sin(t * 0.31) * 0.022;"," float c1 = dot(p, vec2(0.34, 0.94)) * 2.2 - t * 0.62 + sin(p.x * 1.0 + t * 0.12) * 0.75;"," float c2 = dot(p, vec2(-0.22, 0.98)) * 4.4 - t * 1.00 + sin(p.x * 1.7 - t * 0.18) * 0.55;"," float c3 = dot(p, vec2(0.48, 0.88)) * 8.0 - t * 1.45;"," float r1 = crest(c1, 2.0);"," float r2 = crest(c2, 3.0);"," float r3 = crest(c3, 4.4);"," float h = r1 + 0.50 * r2 + 0.26 * r3;"," h += 0.40 * smoothstep(0.72, 1.0, r1);"," for (int i = 0; i < 2; i++){"," float fi = float(i);"," vec2 ap = vec2("," sin(t * (0.09 + fi * 0.05) + fi * 2.1) * 0.82,"," cos(t * (0.07 + fi * 0.04) + fi * 1.4) * 0.46"," );"," h += smoothstep(0.22, 0.0, length(p - ap)) * 0.20;"," }"," float weight = 0.5 + 0.5 * smoothstep(0.1, 1.05, length(p));"," return clamp(h * weight, 0.0, 1.0);","}","void main(){"," float grid = u_grid;"," vec2 cell = floor(gl_FragCoord.xy / grid);"," vec2 cc = (cell + 0.5) * grid;"," vec2 p = (cc - u_res * 0.5) / min(u_res.x, u_res.y);"," float inten = composite(p, u_time);"," float seed = hash(cell);"," float thr = 0.60 + (seed - 0.5) * 0.22;"," float on = step(thr, inten);"," vec2 f = fract(gl_FragCoord.xy / grid);"," float gap = 0.2;"," float sq = step(gap, f.x) * step(f.x, 1.0 - gap) * step(gap, f.y) * step(f.y, 1.0 - gap);"," vec3 mid = vec3(0.098, 0.565, 1.0);"," vec3 hi = vec3(0.30, 0.67, 1.0);"," float rad = smoothstep(0.15, 1.15, length(p));"," vec3 col = mix(mid, hi, rad);"," vec2 v = gl_FragCoord.xy / u_res - 0.5;"," float vig = smoothstep(1.05, 0.2, length(v));"," float a = on * sq * (0.55 + 0.45 * vig);"," gl_FragColor = vec4(col * a, a);","}"].join(`
1775
1775
  `),p=document.createElement("canvas");p.setAttribute("aria-hidden","true");const h=a?"position:fixed;inset:0;width:100vw;height:100vh;":"position:absolute;inset:0;width:100%;height:100%;";p.style.cssText=`${h}z-index:${r};opacity:${n};pointer-events:none;display:block;`,t.appendChild(p);const m={alpha:!0,premultipliedAlpha:!0,antialias:!0,depth:!1,stencil:!1},g=p.getContext("webgl",m)||p.getContext("experimental-webgl",m);if(!g)return console.warn("[sailField] WebGL unavailable"),{canvas:p,destroy:()=>p.remove()};const v=g.getShaderPrecisionFormat&&g.getShaderPrecisionFormat(g.FRAGMENT_SHADER,g.HIGH_FLOAT),b=`precision ${v&&v.precision>0?"highp":"mediump"} float;
1776
1776
  `+d,_=((Q=window.matchMedia)==null?void 0:Q.call(window,"(prefers-reduced-motion: reduce)").matches)??!1,x=(O,K)=>{const $=g.createShader(O);return g.shaderSource($,K),g.compileShader($),g.getShaderParameter($,g.COMPILE_STATUS)||console.error(g.getShaderInfoLog($)),$},j=g.createProgram();g.attachShader(j,x(g.VERTEX_SHADER,u)),g.attachShader(j,x(g.FRAGMENT_SHADER,b)),g.linkProgram(j),g.useProgram(j);const A=g.createBuffer();g.bindBuffer(g.ARRAY_BUFFER,A),g.bufferData(g.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),g.STATIC_DRAW);const k=g.getAttribLocation(j,"a_pos");g.enableVertexAttribArray(k),g.vertexAttribPointer(k,2,g.FLOAT,!1,0,0);const N=g.getUniformLocation(j,"u_time"),E=g.getUniformLocation(j,"u_res"),B=g.getUniformLocation(j,"u_grid"),M=()=>{const O=Math.min(window.devicePixelRatio||1,1.25),K=a?window.innerWidth:t.clientWidth,$=a?window.innerHeight:t.clientHeight;p.width=Math.floor(K*O),p.height=Math.floor($*O),g.viewport(0,0,p.width,p.height)};M(),window.addEventListener("resize",M);let P,R=null,z=0;const q=O=>{if(P=requestAnimationFrame(q),O-z<l)return;z=O,R||(R=O);const K=_?6:(O-R)/1e3;g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT),g.uniform1f(N,K),g.uniform2f(E,p.width,p.height),g.uniform1f(B,c),g.drawArrays(g.TRIANGLE_STRIP,0,4),_&&cancelAnimationFrame(P)};return P=requestAnimationFrame(q),{canvas:p,destroy:()=>{cancelAnimationFrame(P),window.removeEventListener("resize",M),p.remove()}}}function Zv(){return I.useEffect(()=>{const e=uG({zIndex:-1});return()=>e.destroy()},[]),null}const dG="_shell_1uoju_2",fG="_stage_1uoju_15",hG="_stageInner_1uoju_28",pG="_rise_1uoju_1",mG="_welcomeCard_1uoju_40",gG="_authCard_1uoju_41",yG="_networkStepCard_1uoju_70",vG="_cardSai_1uoju_73",bG="_cardHeader_1uoju_80",wG="_kicker_1uoju_89",_G="_cardHeadline_1uoju_96",xG="_cardSub_1uoju_104",CG="_cardSubLead_1uoju_114",kG="_cardTagline_1uoju_115",jG="_fineprint_1uoju_121",SG="_skipLink_1uoju_129",AG="_welcomeCta_1uoju_145",EG="_connectPoints_1uoju_153",NG="_connectPoint_1uoju_153",MG="_connectGlyph_1uoju_165",IG="_connectGlyphMuted_1uoju_171",BG="_connectBody_1uoju_172",TG="_connectName_1uoju_173",PG="_connectDetail_1uoju_174",RG="_backBtn_1uoju_177",LG="_progressDots_1uoju_192",DG="_progressDot_1uoju_192",OG="_progressDotDone_1uoju_200",FG="_progressDotActive_1uoju_201",zG="_networkSection_1uoju_204",$G="_networkGroupLabel_1uoju_205",HG="_networkGrid_1uoju_209",UG="_networkCard_1uoju_210",WG="_networkCardSoon_1uoju_217",VG="_networkCheck_1uoju_218",GG="_networkCheckOn_1uoju_226",qG="_networkCardSelected_1uoju_234",KG="_networkLogo_1uoju_236",QG="_networkName_1uoju_237",YG="_networkDesc_1uoju_238",JG="_chainDeployList_1uoju_241",XG="_chainDeployRow_1uoju_242",ZG="_chainDeployDot_1uoju_247",eq="_chainDeployName_1uoju_248",tq="_chainDeployStatus_1uoju_249",nq="_chainStatus_done_1uoju_250",rq="_chainStatus_skipped_1uoju_251",sq="_chainStatus_error_1uoju_252",aq="_chainStatus_wallet_1uoju_253",oq="_chainStatus_confirming_1uoju_254",iq="_smaDetails_1uoju_257",cq="_detailRow_1uoju_258",lq="_detailLabel_1uoju_263",uq="_detailValue_1uoju_264",dq="_pwField_1uoju_267",fq="_fieldLabel_1uoju_268",hq="_inputWrap_1uoju_273",pq="_inputIcon_1uoju_284",mq="_pwInput_1uoju_288",gq="_revealBtn_1uoju_295",yq="_strengthRow_1uoju_305",vq="_strengthTrack_1uoju_306",bq="_strengthFill_1uoju_310",wq="_strengthLabel_1uoju_315",_q="_reqList_1uoju_326",xq="_reqItem_1uoju_330",Cq="_reqIcon_1uoju_335",kq="_reqMet_1uoju_340",jq="_pwError_1uoju_342",Sq="_keygenNote_1uoju_343",Aq="_generatedKey_1uoju_345",Eq="_generatedKeyLabel_1uoju_349",Nq="_generatedKeyAddr_1uoju_350",Mq="_copyHint_1uoju_355",Iq="_passphraseReminder_1uoju_356",me={shell:dG,stage:fG,stageInner:hG,rise:pG,welcomeCard:mG,authCard:gG,networkStepCard:yG,cardSai:vG,cardHeader:bG,kicker:wG,cardHeadline:_G,cardSub:xG,cardSubLead:CG,cardTagline:kG,fineprint:jG,skipLink:SG,welcomeCta:AG,connectPoints:EG,connectPoint:NG,connectGlyph:MG,connectGlyphMuted:IG,connectBody:BG,connectName:TG,connectDetail:PG,backBtn:RG,progressDots:LG,progressDot:DG,progressDotDone:OG,progressDotActive:FG,networkSection:zG,networkGroupLabel:$G,networkGrid:HG,networkCard:UG,networkCardSoon:WG,networkCheck:VG,networkCheckOn:GG,networkCardSelected:qG,networkLogo:KG,networkName:QG,networkDesc:YG,chainDeployList:JG,chainDeployRow:XG,chainDeployDot:ZG,chainDeployName:eq,chainDeployStatus:tq,chainStatus_done:nq,chainStatus_skipped:rq,chainStatus_error:sq,chainStatus_wallet:aq,chainStatus_confirming:oq,smaDetails:iq,detailRow:cq,detailLabel:lq,detailValue:uq,pwField:dq,fieldLabel:fq,inputWrap:hq,inputIcon:pq,pwInput:mq,revealBtn:gq,strengthRow:yq,strengthTrack:vq,strengthFill:bq,strengthLabel:wq,reqList:_q,reqItem:xq,reqIcon:Cq,reqMet:kq,pwError:jq,keygenNote:Sq,generatedKey:Aq,generatedKeyLabel:Eq,generatedKeyAddr:Nq,copyHint:Mq,passphraseReminder:Iq},Bq="_shell_ueb9y_1",Tq="_header_ueb9y_9",Pq="_brand_ueb9y_44",Rq="_topActionsPill_ueb9y_70",Lq="_notifBtn_ueb9y_90",Dq="_notifBtnLive_ueb9y_111",Oq="_notifBtnBreathe_ueb9y_1",Fq="_notifBadge_ueb9y_130",zq="_avatarBtn_ueb9y_154",$q="_avatarBtnMonogram_ueb9y_180",Hq="_avatarBtnAddr_ueb9y_198",Uq="_noSMAHero_ueb9y_228",Wq="_noSMAMascot_ueb9y_238",Vq="_noSMAStatus_ueb9y_244",Gq="_noSMAStatusDot_ueb9y_259",qq="_noSMATitle_ueb9y_266",Kq="_noSMASub_ueb9y_276",Qq="_noSMACta_ueb9y_284",Yq="_noSMAImportLink_ueb9y_288",Jq="_noSMAImport_ueb9y_288",Xq="_noSMAImportInput_ueb9y_309",Zq="_noSMAImportErr_ueb9y_323",eK="_noSMAImportScan_ueb9y_327",tK="_importSafeList_ueb9y_333",nK="_importSafeRow_ueb9y_343",rK="_importSafeAddr_ueb9y_360",sK="_importSafeNet_ueb9y_365",aK="_noSMAImportActions_ueb9y_372",oK="_noSMAFine_ueb9y_379",iK="_pendingBanner_ueb9y_396",cK="_pendingBannerPulse_ueb9y_432",lK="_pendingPulseRing_ueb9y_1",uK="_pendingBannerBody_ueb9y_454",dK="_pendingBannerKicker_ueb9y_460",fK="_pendingBannerTitle_ueb9y_467",hK="_pendingBannerCta_ueb9y_477",pK="_pendingBannerDraft_ueb9y_516",mK="_identityCard_ueb9y_724",gK="_identityHeader_ueb9y_739",yK="_identityMain_ueb9y_746",vK="_identityStatus_ueb9y_747",bK="_idStatusRow_ueb9y_749",wK="_fundsGroup_ueb9y_758",_K="_fundsLabel_ueb9y_763",xK="_fundsGrid_ueb9y_774",CK="_fundCard_ueb9y_781",kK="_fundCardLabel_ueb9y_792",jK="_fundAddr_ueb9y_806",SK="_fundAddrMono_ueb9y_821",AK="_fundAddrIcons_ueb9y_827",EK="_fundAddrIcon_ueb9y_827",NK="_portfolioCard_ueb9y_836",MK="_portfolioText_ueb9y_856",IK="_portfolioTitle_ueb9y_857",BK="_portfolioSub_ueb9y_865",TK="_portfolioLogo_ueb9y_879",PK="_portfolioImg_ueb9y_881",RK="_idWalletsGroup_ueb9y_892",LK="_idGroupLabel_ueb9y_900",DK="_idDefn_ueb9y_911",OK="_idGroupHead_ueb9y_920",FK="_idRelation_ueb9y_925",zK="_chainSwitcher_ueb9y_935",$K="_chainSwitchBtn_ueb9y_941",HK="_chainSwitchBtnActive_ueb9y_957",UK="_titleHeadFlex_ueb9y_962",WK="_titleNameGroup_ueb9y_970",VK="_titleNameBtn_ueb9y_976",GK="_safeChip_ueb9y_990",qK="_safeChipIcon_ueb9y_1011",KK="_safeChipPop_ueb9y_1013",QK="_safeChipPopTitle_ueb9y_1054",YK="_safeChipPopBody_ueb9y_1062",JK="_safeChipPopLink_ueb9y_1069",XK="_titleNameInput_ueb9y_1089",ZK="_emptyAgents_ueb9y_1132",eQ="_emptyAgentsBody_ueb9y_1144",tQ="_mandatesSection_ueb9y_1169",nQ="_mandatesSectionHead_ueb9y_1174",rQ="_mandatesSectionTitle_ueb9y_1182",sQ="_mandatesSectionMeta_ueb9y_1206",aQ="_mandateList_ueb9y_1212",oQ="_newMandateTile_ueb9y_1222",iQ="_newMandateTilePlus_ueb9y_1252",cQ="_newMandateTileText_ueb9y_1271",lQ="_newMandateTileLabel_ueb9y_1277",uQ="_newMandateTileHint_ueb9y_1283",dQ="_localFootnote_ueb9y_1293",fQ="_localFootnoteDot_ueb9y_1317",hQ="_mandateSummary_ueb9y_1330",pQ="_mandateSummaryHead_ueb9y_1367",mQ="_mandateSummaryHeadText_ueb9y_1374",gQ="_mandateSummaryKicker_ueb9y_1380",yQ="_mandateSummaryTitle_ueb9y_1391",vQ="_mandateSummaryHeadRight_ueb9y_1400",bQ="_mandateSummaryCount_ueb9y_1406",wQ="_mandateSummaryPerms_ueb9y_1412",_Q="_mandateSummaryPermRow_ueb9y_1419",xQ="_mandateSummaryPermLink_ueb9y_1431",CQ="_mandateSummaryPermLabel_ueb9y_1445",kQ="_mandateSummaryPermArrow_ueb9y_1446",jQ="_mandateSummaryCheck_ueb9y_1459",SQ="_mandateSummaryPermBody_ueb9y_1470",AQ="_mandateSummaryPermSub_ueb9y_1484",EQ="_mandateSummaryFoot_ueb9y_1495",NQ="_mandateSummaryFootMeta_ueb9y_1504",MQ="_mandateRevokeBtn_ueb9y_1508",IQ="_mandateSummaryOpenHint_ueb9y_1527",BQ="_smaBadge_ueb9y_1530",TQ="_netSelect_ueb9y_1547",PQ="_netSelectBtn_ueb9y_1551",RQ="_netSelectChevron_ueb9y_1574",LQ="_netSelectMenu_ueb9y_1580",DQ="_netSelectIn_ueb9y_1",OQ="_netSelectOption_ueb9y_1605",FQ="_netSelectOptionName_ueb9y_1625",zQ="_netSelectOptionActive_ueb9y_1626",$Q="_netSelectCheck_ueb9y_1627",HQ="_signersSection_ueb9y_1639",UQ="_signerGrid_ueb9y_1640",WQ="_signersOffline_ueb9y_1655",VQ="_signersOfflineMsg_ueb9y_1667",GQ="_signerCard_ueb9y_1336",qQ="_signerCardWarn_ueb9y_1688",KQ="_signerCardCrit_ueb9y_1695",QQ="_signerCardHead_ueb9y_1702",YQ="_signerRoleWrap_ueb9y_1713",JQ="_signerStatusGroup_ueb9y_1721",XQ="_signerRole_ueb9y_1713",ZQ="_signerBalance_ueb9y_1734",eY="_ethGlyph_ueb9y_1741",tY="_signerBalanceNum_ueb9y_1746",nY="_signerBalanceUnit_ueb9y_1755",rY="_signerBalanceNumLoading_ueb9y_1764",sY="_signerBalanceShimmer_ueb9y_1",aY="_balancePillLoading_ueb9y_1782",oY="_balancePillDot_ueb9y_1785",iY="_signerBalanceDotPulse_ueb9y_1",cY="_signerSub_ueb9y_1793",lY="_signerFoot_ueb9y_1799",uY="_signerAddrPill_ueb9y_1806",dY="_signerAddrMono_ueb9y_1819",fY="_signerAddrIcon_ueb9y_1823",hY="_signerAddrOpen_ueb9y_1824",pY="_signerRotateBtnSm_ueb9y_1838",mY="_signerTopUp_ueb9y_1856",gY="_balancePill_ueb9y_1782",yY="_balancePill_ok_ueb9y_1895",vY="_balancePill_low_ueb9y_1901",bY="_balancePill_critical_ueb9y_1907",wY="_agentSourceWrap_ueb9y_1915",_Y="_agentRunningBadge_ueb9y_1916",xY="_agentRunningBadgeClickable_ueb9y_1934",CY="_agentRunningDot_ueb9y_1939",kY="_agentSourceChevron_ueb9y_1950",jY="_agentSourceChevronOpen_ueb9y_1957",SY="_agentSourcePanel_ueb9y_1958",AY="_notifPanelIn_ueb9y_1",EY="_agentSourceRow_ueb9y_1973",NY="_agentSourceChain_ueb9y_1982",MY="_agentSourcePid_ueb9y_1988",IY="_notifWrap_ueb9y_1995",BY="_notifPanel_ueb9y_1996",TY="_notifPanelHead_ueb9y_2018",PY="_notifPanelTitle_ueb9y_2026",RY="_notifPanelCount_ueb9y_2031",LY="_notifEmpty_ueb9y_2035",DY="_notifEmptyBody_ueb9y_2036",OY="_notifList_ueb9y_2047",FY="_notifItem_ueb9y_2057",zY="_notifItemTop_ueb9y_2074",$Y="_notifItemKind_ueb9y_2079",HY="_notifItemType_ueb9y_2086",UY="_notifItemTitle_ueb9y_2096",WY="_notifItemDesc_ueb9y_2101",VY="_notifItemMeta_ueb9y_2110",GY="_notifFootBtn_ueb9y_2114",qY="_activityFilter_ueb9y_2132",KY="_activityFilterBtn_ueb9y_2140",QY="_activityFilterBtnActive_ueb9y_2157",YY="_activityActor_ueb9y_2164",JY="_activityActor_owner_ueb9y_2176",XY="_activityActor_agent_ueb9y_2181",ZY="_tickList_ueb9y_2192",eJ="_tickCard_ueb9y_2194",tJ="_tickCardHead_ueb9y_2203",nJ="_tickDot_ueb9y_2216",rJ="_tickDotLive_ueb9y_2222",sJ="_tickPulse_ueb9y_1",aJ="_tickMeta_ueb9y_2229",oJ="_tickTime_ueb9y_2230",iJ="_tickDuration_ueb9y_2231",cJ="_tickHeadline_ueb9y_2232",lJ="_tickValue_ueb9y_2233",uJ="_tickChevron_ueb9y_2234",dJ="_tickBody_ueb9y_2236",fJ="_tickLog_ueb9y_2242",hJ="_tickPositions_ueb9y_2244",pJ="_tickPosition_ueb9y_2244",mJ="_tickPositionToken_ueb9y_2259",gJ="_tickPositionValue_ueb9y_2260",yJ="_tickPositionProto_ueb9y_2261",vJ="_signerTopUpTitle_ueb9y_2264",bJ="_signerTopUpMsg_ueb9y_2265",wJ="_signerFundBtn_ueb9y_2266",_J="_signerSpacer_ueb9y_2289",xJ="_chainSection_ueb9y_2293",CJ="_chainSectionHeader_ueb9y_2311",kJ="_chainSectionBadge_ueb9y_2317",jJ="_chainSectionMeta_ueb9y_2331",SJ="_mOverflowRise_ueb9y_1",F={shell:Bq,header:Tq,brand:Pq,topActionsPill:Rq,notifBtn:Lq,notifBtnLive:Dq,notifBtnBreathe:Oq,notifBadge:Fq,avatarBtn:zq,avatarBtnMonogram:$q,avatarBtnAddr:Hq,noSMAHero:Uq,noSMAMascot:Wq,noSMAStatus:Vq,noSMAStatusDot:Gq,noSMATitle:qq,noSMASub:Kq,noSMACta:Qq,noSMAImportLink:Yq,noSMAImport:Jq,noSMAImportInput:Xq,noSMAImportErr:Zq,noSMAImportScan:eK,importSafeList:tK,importSafeRow:nK,importSafeAddr:rK,importSafeNet:sK,noSMAImportActions:aK,noSMAFine:oK,pendingBanner:iK,pendingBannerPulse:cK,pendingPulseRing:lK,pendingBannerBody:uK,pendingBannerKicker:dK,pendingBannerTitle:fK,pendingBannerCta:hK,pendingBannerDraft:pK,identityCard:mK,identityHeader:gK,identityMain:yK,identityStatus:vK,idStatusRow:bK,fundsGroup:wK,fundsLabel:_K,fundsGrid:xK,fundCard:CK,fundCardLabel:kK,fundAddr:jK,fundAddrMono:SK,fundAddrIcons:AK,fundAddrIcon:EK,portfolioCard:NK,portfolioText:MK,portfolioTitle:IK,portfolioSub:BK,portfolioLogo:TK,portfolioImg:PK,idWalletsGroup:RK,idGroupLabel:LK,idDefn:DK,idGroupHead:OK,idRelation:FK,chainSwitcher:zK,chainSwitchBtn:$K,chainSwitchBtnActive:HK,titleHeadFlex:UK,titleNameGroup:WK,titleNameBtn:VK,safeChip:GK,safeChipIcon:qK,safeChipPop:KK,safeChipPopTitle:QK,safeChipPopBody:YK,safeChipPopLink:JK,titleNameInput:XK,emptyAgents:ZK,emptyAgentsBody:eQ,mandatesSection:tQ,mandatesSectionHead:nQ,mandatesSectionTitle:rQ,mandatesSectionMeta:sQ,mandateList:aQ,newMandateTile:oQ,newMandateTilePlus:iQ,newMandateTileText:cQ,newMandateTileLabel:lQ,newMandateTileHint:uQ,localFootnote:dQ,localFootnoteDot:fQ,mandateSummary:hQ,mandateSummaryHead:pQ,mandateSummaryHeadText:mQ,mandateSummaryKicker:gQ,mandateSummaryTitle:yQ,mandateSummaryHeadRight:vQ,mandateSummaryCount:bQ,mandateSummaryPerms:wQ,mandateSummaryPermRow:_Q,mandateSummaryPermLink:xQ,mandateSummaryPermLabel:CQ,mandateSummaryPermArrow:kQ,mandateSummaryCheck:jQ,mandateSummaryPermBody:SQ,mandateSummaryPermSub:AQ,mandateSummaryFoot:EQ,mandateSummaryFootMeta:NQ,mandateRevokeBtn:MQ,mandateSummaryOpenHint:IQ,smaBadge:BQ,netSelect:TQ,netSelectBtn:PQ,netSelectChevron:RQ,netSelectMenu:LQ,netSelectIn:DQ,netSelectOption:OQ,netSelectOptionName:FQ,netSelectOptionActive:zQ,netSelectCheck:$Q,signersSection:HQ,signerGrid:UQ,signersOffline:WQ,signersOfflineMsg:VQ,signerCard:GQ,signerCardWarn:qQ,signerCardCrit:KQ,signerCardHead:QQ,signerRoleWrap:YQ,signerStatusGroup:JQ,signerRole:XQ,signerBalance:ZQ,ethGlyph:eY,signerBalanceNum:tY,signerBalanceUnit:nY,signerBalanceNumLoading:rY,signerBalanceShimmer:sY,balancePillLoading:aY,balancePillDot:oY,signerBalanceDotPulse:iY,signerSub:cY,signerFoot:lY,signerAddrPill:uY,signerAddrMono:dY,signerAddrIcon:fY,signerAddrOpen:hY,signerRotateBtnSm:pY,signerTopUp:mY,balancePill:gY,balancePill_ok:yY,balancePill_low:vY,balancePill_critical:bY,agentSourceWrap:wY,agentRunningBadge:_Y,agentRunningBadgeClickable:xY,agentRunningDot:CY,"dot-breathe":"_dot-breathe_ueb9y_1",agentSourceChevron:kY,agentSourceChevronOpen:jY,agentSourcePanel:SY,notifPanelIn:AY,agentSourceRow:EY,agentSourceChain:NY,agentSourcePid:MY,notifWrap:IY,notifPanel:BY,notifPanelHead:TY,notifPanelTitle:PY,notifPanelCount:RY,notifEmpty:LY,notifEmptyBody:DY,notifList:OY,notifItem:FY,notifItemTop:zY,notifItemKind:$Y,notifItemType:HY,notifItemTitle:UY,notifItemDesc:WY,notifItemMeta:VY,notifFootBtn:GY,activityFilter:qY,activityFilterBtn:KY,activityFilterBtnActive:QY,activityActor:YY,activityActor_owner:JY,activityActor_agent:XY,tickList:ZY,tickCard:eJ,tickCardHead:tJ,tickDot:nJ,tickDotLive:rJ,tickPulse:sJ,tickMeta:aJ,tickTime:oJ,tickDuration:iJ,tickHeadline:cJ,tickValue:lJ,tickChevron:uJ,tickBody:dJ,tickLog:fJ,tickPositions:hJ,tickPosition:pJ,tickPositionToken:mJ,tickPositionValue:gJ,tickPositionProto:yJ,signerTopUpTitle:vJ,signerTopUpMsg:bJ,signerFundBtn:wJ,signerSpacer:_J,chainSection:xJ,chainSectionHeader:CJ,chainSectionBadge:kJ,chainSectionMeta:jJ,"chip-dot":"_chip-dot_ueb9y_1","section-arrive":"_section-arrive_ueb9y_1",mOverflowRise:SJ,"modal-overlay-fade":"_modal-overlay-fade_ueb9y_1","modal-scale-in":"_modal-scale-in_ueb9y_1"};function I6(e){return e?`${e.slice(0,6)}…${e.slice(-4)}`:""}let V1=!1,G1=!1;const AJ="0x05f9a81a3b5e45d338f25347928e56b0aaaa0c65d4087a980c4e41370fcccfeb",EJ=new Set(Object.keys(Jv).map(Number)),np=[{chainId:8453,name:"Base",group:"mainnet",description:"Fast, cheap Coinbase L2.",color:"#0052ff"},{chainId:42161,name:"Arbitrum One",group:"mainnet",description:"Low-fee Ethereum L2.",color:"#28a0f0"},{chainId:1,name:"Ethereum",group:"mainnet",description:"The original chain.",color:"#627eea"},{chainId:130,name:"Unichain",group:"mainnet",description:"Uniswap-native L2.",color:"#ff007a"},{chainId:10,name:"Optimism",group:"mainnet",description:"OP Stack L2.",color:"#ff0420"},{chainId:56,name:"BNB Smart Chain",group:"mainnet",description:"High-throughput BNB chain.",color:"#f3ba2f"},{chainId:480,name:"World Chain",group:"mainnet",description:"Worldcoin L2.",color:"#dfe3e8"},{chainId:999,name:"HyperEVM",group:"mainnet",description:"Hyperliquid EVM.",color:"#50d2c1"},{chainId:6342,name:"MegaETH",group:"mainnet",description:"Real-time EVM.",color:"#ffffff"},{chainId:84532,name:"Base Sepolia",group:"testnet",description:"Free to experiment.",color:"#0052ff"},{chainId:11155111,name:"Ethereum Sepolia",group:"testnet",description:"Ethereum test network.",color:"#627eea"}],gu=["network","connect","keygen","create-sma"];function NJ({onSkip:e}){const{isConnected:t,address:n}=dt(),{openConnectModal:r}=Oi();I.useEffect(()=>{t&&V1&&(V1=!1,e==null||e())},[t,e]);function a(){t?e==null||e():(V1=!0,r==null||r())}return o.jsxs("header",{className:F.header,children:[o.jsx("button",{type:"button",className:F.brand,"aria-label":"Sail",children:o.jsx(gn,{size:48,animate:!0})}),o.jsx("div",{className:F.topActionsPill,children:o.jsxs("button",{type:"button",className:F.avatarBtn,onClick:a,"aria-label":t&&n?`Connected (${I6(n)})`:"Connect wallet",title:t&&n?n:void 0,children:[o.jsx("span",{className:F.avatarBtnMonogram,"aria-hidden":!0,children:t&&n?n.slice(2,4).toUpperCase():"—"}),o.jsx("span",{className:F.avatarBtnAddr,children:t&&n?I6(n):"Not connected"})]})})]})}function MJ({onboardState:e,onComplete:t,onSkip:n}){const{address:r}=dt(),[a,c]=I.useState("welcome"),[l,u]=I.useState([(e==null?void 0:e.chainId)??8453]),[d,p]=I.useState((e==null?void 0:e.managerAddress)??null),[h,m]=I.useState([]),[g]=I.useState(()=>String(Date.now()));function v(_){u(x=>x.includes(_)?x.filter(j=>j!==_):[...x,_])}const b=gu.indexOf(a);return o.jsxs("div",{className:me.shell,children:[o.jsx(Zv,{}),o.jsx(NJ,{onSkip:a==="welcome"?n??t:void 0}),o.jsx("main",{className:me.stage,children:o.jsxs("div",{className:me.stageInner,children:[a==="welcome"&&o.jsx(IJ,{onStart:()=>c("network"),onSkip:n??t}),a==="network"&&o.jsx(BJ,{selected:l,onToggle:v,onBack:()=>c("welcome"),onDone:()=>c("connect"),progressIndex:b,progressTotal:gu.length}),a==="connect"&&o.jsx(LJ,{onBack:()=>c("network"),onDone:()=>c(e!=null&&e.hasManagerKey?"create-sma":"keygen"),progressIndex:b,progressTotal:gu.length}),a==="keygen"&&o.jsx(DJ,{existingAddress:e==null?void 0:e.managerAddress,onBack:()=>c("network"),onDone:_=>{p(_),c("create-sma")},progressIndex:b,progressTotal:gu.length}),a==="create-sma"&&o.jsx(OJ,{owner:r,managerAddress:d??(e==null?void 0:e.managerAddress),chainIds:l,saltNonce:g,onBack:()=>c(e!=null&&e.hasManagerKey?"connect":"keygen"),onDone:_=>{m(_),c("done")},progressIndex:b,progressTotal:gu.length}),a==="done"&&o.jsx(FJ,{deployedSafes:h,onComplete:t})]},a)})]})}function Vp({current:e,total:t}){return o.jsx("div",{className:me.progressDots,children:Array.from({length:t},(n,r)=>o.jsx("span",{className:`${me.progressDot} ${r<e?me.progressDotDone:r===e?me.progressDotActive:""}`},r))})}function IJ({onStart:e,onSkip:t}){const{isConnected:n}=dt(),{openConnectModal:r}=Oi();I.useEffect(()=>{n&&G1&&(G1=!1,t==null||t())},[n,t]);function a(){n?t==null||t():(G1=!0,r==null||r())}return o.jsxs(Kt,{className:me.welcomeCard,children:[o.jsx("div",{className:me.cardSai,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("header",{className:me.cardHeader,children:[o.jsx("h1",{className:`${ut.displayHeadline} ${me.cardHeadline}`,children:"Welcome to the Sail Dashboard"}),o.jsx("p",{className:me.cardSub,children:"Set up your SMA, scope what your agent can do, and monitor every on-chain action — all from one place."})]}),o.jsx("div",{className:me.welcomeCta,children:o.jsx(Ze,{fullWidth:!0,onClick:e,children:"Start setup →"})}),o.jsx("p",{className:me.fineprint,children:"Self-custody. Sail never holds your keys."}),t&&o.jsx("button",{className:me.skipLink,onClick:a,children:"Already have an SMA? Skip to dashboard →"})]})}function BJ({selected:e,onToggle:t,onBack:n,onDone:r,progressIndex:a,progressTotal:c}){const l=np.filter(d=>d.group==="mainnet"),u=np.filter(d=>d.group==="testnet");return o.jsxs(Kt,{className:`${me.authCard} ${me.networkStepCard}`,children:[o.jsx(Vp,{current:a,total:c}),o.jsx(Gp,{kicker:"STEP 1 OF 4",title:"Choose your networks",sub:o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:me.cardSubLead,children:["Same SMA address on every chain."," ",o.jsx(bi,{label:"What is an SMA?",children:"Separately Managed Account — a self-custodial Safe that holds your capital. You stay the owner; the agent can only act within the mandate you set."})]}),"Deployed at a deterministic address, so it’s identical everywhere."]}),onBack:n}),o.jsxs("div",{className:me.networkSection,children:[o.jsx("span",{className:me.networkGroupLabel,children:"Mainnet"}),o.jsx("div",{className:me.networkGrid,children:l.map(d=>o.jsx(T6,{net:d,selected:e.includes(d.chainId),onToggle:t},d.chainId))}),o.jsx("span",{className:me.networkGroupLabel,children:"Testnet"}),o.jsx("div",{className:me.networkGrid,children:u.map(d=>o.jsx(T6,{net:d,selected:e.includes(d.chainId),onToggle:t},d.chainId))})]}),o.jsx(Ze,{fullWidth:!0,onClick:r,disabled:e.length===0,children:e.length===0?"Select at least one network":"Continue →"})]})}function TJ(e){if(typeof e!="string"||e[0]!=="#")return"#fff";let t=e.slice(1);t.length===3&&(t=t.split("").map(c=>c+c).join(""));const n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16);return .299*n+.587*r+.114*a>150?"#04060b":"#fff"}function gy(){return o.jsx("svg",{viewBox:"0 0 14 14",width:"9",height:"9",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M2.5 7.4 L5.7 10.5 L11.5 3.5",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"square",strokeLinejoin:"miter"})})}function B6(){return o.jsxs("svg",{viewBox:"0 0 24 24",width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"square",strokeLinejoin:"miter","aria-hidden":!0,children:[o.jsx("rect",{x:"5",y:"11",width:"14",height:"9",rx:"1"}),o.jsx("path",{d:"M8 11V8a4 4 0 0 1 8 0v3"})]})}function PJ({off:e}){return e?o.jsxs("svg",{viewBox:"0 0 24 24",width:"17",height:"17",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"}),o.jsx("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),o.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):o.jsxs("svg",{viewBox:"0 0 24 24",width:"17",height:"17",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7z"}),o.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function RJ(e){if(!e)return{level:0,label:""};let t=0;e.length>=8&&t++,e.length>=12&&t++,/[a-z]/.test(e)&&/[A-Z]/.test(e)&&t++,/\d/.test(e)&&t++,/[^A-Za-z0-9]/.test(e)&&t++;const n=Math.min(4,Math.max(1,t));return{level:n,label:["","Weak","Fair","Good","Strong"][n]}}function T6({net:e,selected:t,onToggle:n}){const r=EJ.has(e.chainId);return o.jsxs("button",{type:"button",className:`${me.networkCard} ${t?me.networkCardSelected:""} ${r?"":me.networkCardSoon}`,onClick:()=>r&&n(e.chainId),style:{"--net-color":r?e.color:"rgba(255,255,255,0.18)","--net-ink":r?TJ(e.color):"#fff"},title:r?void 0:"Sail kernel coming soon",children:[o.jsx("span",{className:me.networkLogo,children:o.jsx(Co,{chainId:e.chainId,size:20,color:r?void 0:"rgba(255,255,255,0.25)"})}),o.jsx("span",{className:me.networkName,children:e.name}),o.jsx("span",{className:me.networkDesc,children:r?e.description:"Coming soon"}),r&&o.jsx("span",{className:`${me.networkCheck} ${t?me.networkCheckOn:""}`,children:t&&o.jsx(gy,{})})]})}function LJ({onBack:e,onDone:t,progressIndex:n,progressTotal:r}){const{isConnected:a,address:c}=dt(),{openConnectModal:l}=Oi(),{status:u,send:d}=Hj();return I.useEffect(()=>{!a||!c||(u==="connected"?(d({type:"wallet-connected",address:c}),t==null||t()):u==="disconnected"&&(t==null||t()))},[a,c,u,d,t]),o.jsxs(Kt,{className:me.authCard,children:[o.jsx(Vp,{current:n,total:r}),o.jsx(Gp,{kicker:"STEP 2 OF 4",title:"Connect your wallet",sub:"This wallet sits at the center of your setup.",onBack:e}),o.jsxs("ul",{className:me.connectPoints,children:[o.jsxs("li",{className:me.connectPoint,children:[o.jsx("span",{className:me.connectGlyph,"aria-hidden":!0}),o.jsxs("span",{className:me.connectBody,children:[o.jsxs("span",{className:me.connectName,children:["Owns your"," ",o.jsx(zJ,{word:"SMA",children:"Separately Managed Account — the self-custodial Safe that holds your capital; you remain the owner."})]}),o.jsx("span",{className:me.connectDetail,children:"The Safe that holds your funds — you stay the owner."})]})]}),o.jsxs("li",{className:me.connectPoint,children:[o.jsx("span",{className:me.connectGlyph,"aria-hidden":!0}),o.jsxs("span",{className:me.connectBody,children:[o.jsxs("span",{className:me.connectName,children:["Governs your agent"," ",o.jsx(bi,{label:"What is a mandate?",children:"A mandate is the on-chain set of permission contracts registered to your account that define what the agent may do. Revocable anytime from your dashboard."})]}),o.jsx("span",{className:me.connectDetail,children:"Signs the mandates that scope what it can do."})]})]}),o.jsxs("li",{className:me.connectPoint,children:[o.jsx("span",{className:me.connectGlyph,"aria-hidden":!0}),o.jsxs("span",{className:me.connectBody,children:[o.jsx("span",{className:me.connectName,children:"Never trades for you"}),o.jsx("span",{className:me.connectDetail,children:"The agent does the trading — always within the mandate you set."})]})]})]}),o.jsx(Ze,{fullWidth:!0,onClick:l,children:"Connect wallet →"}),o.jsx("p",{className:me.fineprint,children:"Self-custody. Sail never holds your keys."})]})}function DJ({existingAddress:e,onBack:t,onDone:n,progressIndex:r,progressTotal:a}){const[c,l]=I.useState(""),[u,d]=I.useState(""),[p,h]=I.useState(!1),[m,g]=I.useState(!1),[v,b]=I.useState(""),[_,x]=I.useState(e??null),[j,A]=I.useState(!1),k=RJ(c),N=c.length>=8,E=c.length>0&&c===u,B=N&&E;async function M(){if(B){g(!0),b("");try{const R=await fetch("/api/onboard/generate-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({passphrase:c})}),z=await R.json();if(!R.ok)throw new Error(z.error);x(z.address)}catch(R){b(R.message)}finally{g(!1)}}}function P(R){var z;(z=navigator==null?void 0:navigator.clipboard)==null||z.writeText(R),A(!0),setTimeout(()=>A(!1),1500)}return o.jsxs(Kt,{className:me.authCard,children:[o.jsx(Vp,{current:r,total:a}),o.jsx(Gp,{kicker:"STEP 3 OF 4",title:"Set a passphrase",sub:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:me.cardSubLead,children:"Sail generates your agent wallet and encrypts it on this device."}),"This passphrase unlocks it for every run — Sail never sees it."]}),onBack:t}),_?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:me.generatedKey,children:[o.jsx("span",{className:me.generatedKeyLabel,children:"Agent address"}),o.jsxs("button",{type:"button",className:me.generatedKeyAddr,onClick:()=>P(_),title:"Copy address",children:[o.jsx("code",{children:_}),o.jsx("span",{className:me.copyHint,children:j?"✓":"copy"})]})]}),c&&o.jsx("div",{className:me.passphraseReminder,children:o.jsxs("span",{style:{opacity:.6,fontSize:12},children:["Saved locally to ",o.jsx("code",{children:".sail/.env.local"})," (0600, gitignored). For CI, add this same value as the ",o.jsx("code",{children:"SAIL_PASSPHRASE"})," GitHub Actions secret — don't commit"," ",o.jsx("code",{children:".env.local"}),"."]})}),o.jsx(Ze,{fullWidth:!0,onClick:()=>n(_),children:"Continue →"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:me.pwField,children:[o.jsx("span",{className:me.fieldLabel,children:"Passphrase"}),o.jsxs("div",{className:me.inputWrap,children:[o.jsx("span",{className:me.inputIcon,"aria-hidden":!0,children:o.jsx(B6,{})}),o.jsx("input",{type:p?"text":"password",className:me.pwInput,placeholder:"Enter a passphrase",value:c,onChange:R=>l(R.target.value),onKeyDown:R=>{R.key==="Enter"&&M()},autoComplete:"new-password",autoFocus:!0}),o.jsx("button",{type:"button",className:me.revealBtn,onClick:()=>h(R=>!R),"aria-label":p?"Hide passphrase":"Show passphrase",children:o.jsx(PJ,{off:p})})]}),o.jsxs("div",{className:me.strengthRow,"data-level":k.level,children:[o.jsx("span",{className:me.strengthTrack,children:o.jsx("span",{className:me.strengthFill,style:{width:`${k.level/4*100}%`}})}),o.jsx("span",{className:me.strengthLabel,children:k.label})]})]}),o.jsxs("div",{className:me.pwField,children:[o.jsx("span",{className:me.fieldLabel,children:"Confirm passphrase"}),o.jsxs("div",{className:me.inputWrap,children:[o.jsx("span",{className:me.inputIcon,"aria-hidden":!0,children:o.jsx(B6,{})}),o.jsx("input",{type:p?"text":"password",className:me.pwInput,placeholder:"Re-enter your passphrase",value:u,onChange:R=>d(R.target.value),onKeyDown:R=>{R.key==="Enter"&&M()},autoComplete:"new-password"})]})]}),o.jsxs("ul",{className:me.reqList,children:[o.jsxs("li",{className:`${me.reqItem} ${N?me.reqMet:""}`,children:[o.jsx("span",{className:me.reqIcon,"aria-hidden":!0,children:o.jsx(gy,{})}),"8 characters or more"]}),o.jsxs("li",{className:`${me.reqItem} ${E?me.reqMet:""}`,children:[o.jsx("span",{className:me.reqIcon,"aria-hidden":!0,children:o.jsx(gy,{})}),"Both entries match"]})]}),v&&o.jsx("p",{className:me.pwError,children:v}),o.jsx(Ze,{fullWidth:!0,onClick:M,disabled:m||!B,children:m?"Encrypting…":"Encrypt & continue →"}),o.jsxs("p",{className:`${me.fineprint} ${me.keygenNote}`,children:["It's saved to ",o.jsx("code",{children:".sail/.env.local"})," (mode 0600) so your agent can unlock the key unattended."]})]})]})}function OJ({owner:e,managerAddress:t,chainIds:n,saltNonce:r,onBack:a,onDone:c,progressIndex:l,progressTotal:u}){const{sendTransactionAsync:d}=Li(),{signTypedDataAsync:p}=ml(),{switchChainAsync:h}=Bs(),[m,g]=I.useState(()=>Object.fromEntries(n.map(z=>[z,"pending"]))),[v,b]=I.useState({}),[_,x]=I.useState(!1),[j,A]=I.useState([]);function k(z,q){g(Q=>({...Q,[z]:q}))}function N(z,q){b(Q=>({...Q,[z]:q}))}async function E(z){var W,oe;k(z,"switching");try{await h({chainId:z})}catch{}k(z,"building");const q=await fetch("/api/onboard/build-create-tx",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:e,manager:t,chainId:z,saltNonce:r})}),Q=await q.json();if(!q.ok)throw new Error((Q==null?void 0:Q.error)??"Build failed");const O=Qj[z];let K=!1;if(O){const be=await fetch(O,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_call",params:[{from:e,to:Q.to,data:Q.data},"latest"]})}).then(Y=>Y.json()).catch(()=>null);be!=null&&be.error&&(K=!0)}if(K){k(z,"building");const be=await fetch("/api/onboard/build-register-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:e,manager:t,chainId:z,saltNonce:r})}),Y=await be.json();if(!be.ok)throw new Error((Y==null?void 0:Y.error)??"Build failed");k(z,"wallet");const ue=await d({to:Y.deployTx.to,data:Y.deployTx.data,chainId:z});k(z,"confirming");const xe=await q1(ue,z),Re=(W=xe==null?void 0:xe.logs)==null?void 0:W.find(Or=>{var Yt,Fn;return((Yt=Or.address)==null?void 0:Yt.toLowerCase())===Y.deployTx.to.toLowerCase()&&((Fn=Or.topics)==null?void 0:Fn.length)>=2});if(!Re)throw new Error("ProxyCreation event not found in deploy receipt");const Ae=xt(`0x${Re.topics[1].slice(26)}`),qe="0x0000000000000000000000000000000000000000",Xe=BigInt(Math.floor(Date.now()/1e3)+600);k(z,"wallet");const Tt=rG({chainId:z,kernel:Y.kernel,account:Ae,permissionSigner:e,manager:t,feePolicy:qe,feeAsset:qe,deadline:Xe}),zt=await p({domain:Tt.domain,types:Tt.types,primaryType:Tt.primaryType,message:{...Tt.message,deadline:BigInt(Tt.message.deadline)}}),Qt=lG({safe:Ae,kernel:Y.kernel,permissionSigner:e,manager:t,feePolicy:qe,feeAsset:qe,deadline:Xe,ownerSig:zt,owner:e});k(z,"wallet");const $t=await d({to:Qt.to,data:Qt.data,chainId:z});k(z,"confirming");const yt=await q1($t,z);if((yt==null?void 0:yt.status)==="0x0")throw new Error("registerAccount reverted — check the kernel address and try again.");const yn=await(await fetch("/api/onboard/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({safe:Ae,owner:e,manager:t,txHash:$t,chainId:z})})).json();if(yn!=null&&yn.account)try{localStorage.setItem("sail.account",JSON.stringify(yn.account))}catch{}return k(z,"done"),{chainId:z,safe:Ae}}k(z,"wallet");const $=await d({to:Q.to,data:Q.data,chainId:z});k(z,"confirming");const L=await q1($,z);if((L==null?void 0:L.status)==="0x0")throw new Error("createAccount transaction reverted. The Safe factory may not be supported on this chain — try again and the wizard will use the register path.");const se=(oe=L==null?void 0:L.logs)==null?void 0:oe.find(be=>{var Y;return((Y=be.topics)==null?void 0:Y[0])===AJ});if(!se)throw new Error("AccountRegistered event not found in receipt. This may be a kernel version mismatch — please report this.");const D=xt(`0x${se.topics[1].slice(26)}`),te=await(await fetch("/api/onboard/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({safe:D,owner:e,manager:t,txHash:$,chainId:z})})).json();if(te!=null&&te.account)try{localStorage.setItem("sail.account",JSON.stringify(te.account))}catch{}return k(z,"done"),{chainId:z,safe:D}}async function B(){x(!0);const z=[];for(const Q of n)if(!(m[Q]==="done"||m[Q]==="skipped"))try{const O=await E(Q);z.push(O),A(K=>[...K,O])}catch(O){const K=(O==null?void 0:O.shortMessage)||(O==null?void 0:O.message)||"Failed";if(K.includes("UntrustedFactory"))N(Q,"Factory not approved on this chain yet"),k(Q,"skipped");else{N(Q,K),k(Q,"error"),x(!1);return}}x(!1);const q=[...j,...z];c(q)}const M=n.every(z=>m[z]==="done"||m[z]==="skipped"||m[z]==="error"),P=n.some(z=>m[z]==="error"),R=n.some(z=>m[z]==="done")||j.length>0;return o.jsxs(Kt,{className:me.authCard,children:[o.jsx(Vp,{current:l,total:u}),o.jsx(Gp,{kicker:"STEP 4 OF 4",title:"Deploy your SMAs",sub:"Same SMA address on every chain. Some chains need 2 transactions — your wallet will prompt for each.",onBack:_?void 0:a}),o.jsx("div",{className:me.chainDeployList,children:n.map(z=>{const q=np.find(K=>K.chainId===z),Q=m[z],O=v[z];return o.jsxs("div",{className:me.chainDeployRow,children:[o.jsx(Co,{chainId:z,size:18}),o.jsx("span",{className:me.chainDeployName,children:(q==null?void 0:q.name)??`Chain ${z}`}),o.jsxs("span",{className:`${me.chainDeployStatus} ${me[`chainStatus_${Q}`]}`,children:[Q==="pending"&&"—",Q==="switching"&&"Switching…",Q==="building"&&"Building…",Q==="wallet"&&"Confirm in wallet",Q==="confirming"&&"Confirming…",Q==="done"&&"✓ Deployed",Q==="skipped"&&`⚠ ${O??"Skipped"}`,Q==="error"&&`✗ ${O??"Error"}`]})]},z)})}),o.jsx(P6,{label:"Owner",value:e}),o.jsx(P6,{label:"Agent key",value:t}),!M&&o.jsx(Ze,{fullWidth:!0,onClick:B,disabled:_,style:{marginTop:14},children:_?"Deploying…":"Deploy SMAs"}),M&&P&&o.jsx(Ze,{fullWidth:!0,onClick:B,disabled:_,style:{marginTop:14},children:"Retry failed chains"}),M&&R&&o.jsx(Ze,{fullWidth:!0,onClick:()=>c(j),style:{marginTop:14},children:"Continue →"}),M&&!R&&o.jsx("p",{style:{color:"#f87171",fontSize:13,margin:"14px 0 0",textAlign:"center"},children:"No chains deployed successfully. Go back and select a supported network."}),o.jsx("p",{className:me.fineprint,children:"Same address on all chains — deterministic CREATE2 deployment with a fixed salt."})]})}const Qj={8453:"https://mainnet.base.org",84532:"https://sepolia.base.org",42161:"https://arb1.arbitrum.io/rpc",421614:"https://sepolia-rollup.arbitrum.io/rpc",130:"https://mainnet.unichain.org"};async function q1(e,t){const n=Qj[t];if(!n)throw new Error(`No public RPC for chain ${t}`);for(let r=0;r<60;r++){await new Promise(a=>setTimeout(a,2e3));try{const a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_getTransactionReceipt",params:[e]})}),{result:c}=await a.json();if(c)return c}catch{}}throw new Error("Receipt timeout")}function P6({label:e,value:t,mono:n=!0}){const r=n&&t&&t.length>20?`${t.slice(0,10)}…${t.slice(-6)}`:t||"—";return o.jsxs("div",{className:me.detailRow,children:[o.jsx("span",{className:me.detailLabel,children:e}),n?o.jsx("code",{className:me.detailValue,children:r}):o.jsx("span",{className:me.detailValue,children:r})]})}function FJ({deployedSafes:e,onComplete:t}){const n=e.map(({chainId:r})=>{var a;return(a=np.find(c=>c.chainId===r))==null?void 0:a.name}).filter(Boolean).join(" + ");return o.jsxs(Kt,{className:me.welcomeCard,children:[o.jsx("div",{className:me.cardSai,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("header",{className:me.cardHeader,children:[o.jsx("span",{className:me.kicker,children:"SETUP COMPLETE"}),o.jsx("h1",{className:`${ut.displayHeadline} ${me.cardHeadline}`,children:"You’re all set."}),o.jsx("p",{className:`${ut.italicMannerism} ${me.cardTagline}`,children:n?`Your SMA is live on ${n}.`:"Your SMA is live."})]}),o.jsx("div",{className:me.welcomeCta,children:o.jsx(Ze,{fullWidth:!0,onClick:t,children:"Go to dashboard →"})}),o.jsx("p",{className:me.fineprint,children:"Manage your agent, mandates and RPCs from your dashboard."})]})}function zJ({word:e,children:t}){return o.jsxs(o.Fragment,{children:[e,o.jsx(bi,{label:e,children:t})]})}function Gp({kicker:e,title:t,sub:n,onBack:r}){return o.jsxs("header",{className:me.cardHeader,children:[r&&o.jsx("button",{type:"button",className:me.backBtn,onClick:r,"aria-label":"Back",children:o.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M15 6l-6 6 6 6"})})}),o.jsx("span",{className:me.kicker,children:e}),o.jsx("h1",{className:`${ut.displayHeadline} ${me.cardHeadline}`,children:t}),n&&o.jsx("p",{className:me.cardSub,children:n})]})}const $J="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAABgCAYAAACDgFV6AAALiElEQVR42t2daYxeVRnHf3eZeWemtbWClABCBWtrNbWCIHWBtChao4kElKAhWDVW8QPgFnGNSzVRCfrBNWqMqBhRJEZxS6w6QaVVaStuJdoKFMSFdJ+Zznvf44fznOnp9b7LvPe59556kzeTLjNzzv8+51n+z3IiY8whjn9M7qv/RECc+xr1+P8hPfuBB4A/AncDvwR2AFlub50ye4kKAC16TMHHX0QiX+OAAU7k454p4C/Aj4Dbga25/5tVCagvoT7AWe6NxkCaAzgUcPPCkAIj3r9NAp8GviX7cmvvVAloEcC9wE08gKMApbYjnwRoyd9tAz4M3DGMtJYFtOjJvIWSk9yRwKQ2v26Acfn6beCtwJ75gFoFoHlgfSMXecAmgQLr1jwO/Bu4Dvi6CILpt964YiPgA+f076wYhCkBPQoMUKeqjgBLgK8BH/dOXNyUhOYNQjv3dn2JHfUkIFRp/SZwNXDUc68aA9RXA1kB2JGAOhKo8ZoFFgDfAy73hMPUeeR7qYGowBWbETXQDlANjACHgZeIPu3kfO7GAHUAjhT87kgWOi3gEiiolwOfkJOWNH3kB1EBTg0kwFiAurUNTADXAF/Ju1RNA+oUf7sLqJGAmgYEqlvXNPAMYLd3uho58kVqJ+0R5k6JZQ1Fr0YikYskVDX+2mLC8f3SHhuYEYmIAiJajgAvBK709WkIR36Q4++O2ogXc4ew1lFgF/B0ca2CkdBBJXVWJDWUtc4AK4GrnCGNjDH7cwo/yn2atP4mF5E4pz8VYzWIoTI5QlxbSlvAduCZgImMMabLIqZFIkyO26zrOSpHvAg4UxAgDLL5aY9K1Ab1YmAyFe9/sVit04CzgeXy9WTP95ry/MM69NNC4P3ArwS8rEBS+4GzEDhLpGcdsFT20lYUkI6s4SpgMioWUADOED/rBcAlwCr5+8OyoLRiQMfkKF2g9DOXAq8H3i5ATykJh5PQXcCayBiTf8umIHoZkze8EXixEAWHPLa7qohkMfBZ4I1iUbMSWQX3vWuArwJPVQTVGal1vSTUV+L+RlYDN4iIt7DZxKQiA9aRl/d8YEuZ5JlHFc4CpwK/AM7x6LiyRnQcuLEXoEXpYx/cC4HNwHpRA50KDFcmcfO9wFrZfF/WvM+TivSvwaaSk3y0U0JF3R7PI37NvGxgAvxadOtbZDHjPZzyMhHJYdn8G5ReWluM3Hbg8yVUSVGYvGpQCe22WecnXiDMywpRAakyGZECj4q6edQnI0roOyOezE4BuFNCSp3HcSRWSMKl2CKBi4CfiyFpK5MRM+LSXa9wPP1c+1+BezxAy6yxA4zHStY4Af4JbMBWYmiDmohT/jrxjTsKoDrrfo9i9tXEisYjFjfkMuAnyqA6KT0VeLVygPEf7QBf08VxoF6BLcRaqKDw/bXOAq8Ri6qVgh4NFVA8R/8A8HJgn+gno7TWKeApEr2VlVK3prNzljooQN3xT4H7JMIZL6nwi55XldR7kRcynq9k6FR1aJGhSoHbxJ1apKRPYzFOl0hsPuyxdy7fepHQmZLCNefaxRUTHBHwDvEAWgpH3xmnk4FLc9Z6vk44wLsUIi88inN31YAmwMPARz1DglJUsmGIYx95oee7ged4HCkK+vj3ZSKlQTcQCcGxAzhdIYNpRNofkMjpcJ/yncjjIpza2SQs1rSSHXGx/DVxDTnsGDgIfE4xbp7GEserC0rS41x5uvGSf4uAmwTMGS1DJJ7MfmAyrol9j4BbJA7X0KVOnZzngdUp+LjNrgTeBvwWeLOX6IsUVdtvgN1pTYAmwEMSQV0pfmoZveVC0etEl3Y78ol4Ayu8yuQpZVLc/d7vurx8DZiSylF/BfANBUB9VyUZoBQxKuB1tcB0L3clsLcOCcVLCU9K7DyhEDq6PP0ghRpjSqqmaF8tbIPDXiCJay6wegj4wzxy6oMWRiQ9PlVW7yWiv29uorbJHc3tCgTxMGGmqSAabGFLxX/n8l1NlOLcSzMliFSQRTgkAcKcUYwb2NTfPP8UxcipTlAz8anfK/WhcRP1oW5DjyiQEU1KqKtg3gJ8Uo56pwkd6jZ1ULnWs04JdSHmvziWOTiOXGlCh055xQWht4QX+ZyuG+T+on6lprpATtTH6f7HNNGa2A3IcXE3OicYuHOpYmxj7fJcG3hjgC5SdOznoxsjxarlxUL2jOQLk5s48kuVaLym1IxrWHgWcGNeSpuQ0HOU+zlNQ6DOCKAr/ZqrJiR01f+BIXS9SmPY6Q9zWdO45kaECEsKa0ZKhsEsc1QBJTkNvAxbapnVyTY5n/N0kdBpRbY86/OpkoRxnsoNPsp1AroeeCw6JY9GjNuCHoUKBsuZxp4RjJV16aw4+k+sKwXiT0a4TEmnObZnFzab2s3Ipd6pOKmCFIgjuSew9VwfqyMF4qTzLCwXOqrA1ruGhk3YKuR+z2nYZotrsZ0tM4rGytXXTwIXxzUe940CwlGl2s62SKc/LKboAzZT8AVsX8D75KVGilmDtryoJ9VR6AB2usxObAnNrFKDwN+xTatHBgAn4lgHicF2sNzirSVSktLXxjWkPQzwJtFl00r6cwS4S8BMBnSd2l496K3YIVdjyl7As+OKj3oGnImtjdfOh39/CD3orH6KnRvyU6WaK7eGp8U16M6bgMcp6U5X1/QPAYMhwPAJ4c1KxskxUcviCgsb2tjy7SuwhQ2pYh78x9j8fjKkYXFexiS2MLil0AXSBpbEFeaqV8uxOqKckDPY8WlaNfvbNMmauAIwM+AUbPXyuOJgq4440DuxCbKopO5za9qjmciLKwBzCbZw6snY/EuiGG2l4k/OKv7cLMQukNQD804s+arZomjEGj+Ibc2OFIE4JSRA/RLrZdhyxQsr6Pd0xugz2FadROGI+v3zWsIVlW2edYu6FPiSxMwHlMF043wels0fUNB5zqVb4dVaqaSY4yGBjD3GerM42Y/HFjGkFU2e+YhIvkY+30n49fKz20pq78H5DiDwx/5sAD4EnIstmjIVDSBYIK7N8zwa0JScsjgLPFeCg45iLH9bOkDnhMlNUbwIW6f+Uo4N3E8ryrHHniS183VEQ44CnsUmCm/1TprW2relBUfUL/h3iz8JeBF2xOM6+Z6DFbP+jvO8GXszQqvENB6/kWEtdqjqGYr8gntRXccMtbAte+dj2wDXAU+Qf6t6Gg5ehcYkNm2i8SzH9p5eK/vTHjP0J+DcFHglNs+zWKz0MjkSZ4r+QoiNA12ugKgS1LuwXSPdjnq/bOYENlNwnujMhbKXaXQDjkj4hZluo9rakibIBlw4FY1qmxCXyRTMloqHUCFHKxiJ5JKFa4G7I2PMvh4GiQbH8vp6L/JAdX5pax7+aFXDBJ3ruFUAjdIaU8nzHQ4D/zvE0PGhYwHVlkZiOOfGXZ5oA1lDAdNJ5w7smKWsygEEVYA5GphkOul8j5fsM+kJACYC5EhAYLrGhTuwty/M8RohHPles+xj0ZkhjV13Pvg+Cbv3+o1sacBgpgJmHNgMe6fLNwk/e9zEyDQA16ioJ7Tl+Z8mMA9kAvgg8B2PC2706oqOV8FRxCm2lAhkKrqx5svYsqK0aB9pAEfc6cpQr/9xVScLsOmXjbmynkbaajryhrOCyuMRIUJGA7xSzbFuC7BVflf3u/szrunttgsuYHVAjgV6KVXbi8reKUao7710aYVAdrpc8jfqDQ0wgd6eGInxuR9L+d3pMV6mXx6kCiCzgttpHW8QBwik8UiYcfnzF7GTxx4psuZVARrlpLHoFto0N0MpNJ+yk7u0ZQvwAeBnHF9aRBWA+rouD6J/T3KS4x1DANJvxY5yV2ROAz8EPoWd0It3xLP5pj4pcdl07C2s6DZvE9hdnT4fug9bJ/UDicn/nFNR2bC5ZOZxHXri/cK4gEUP9Vr0w9ihAXuwM0+2YieB3VeQTsnKlPn8F8491xFCAQ18AAAAAElFTkSuQmCC",HJ="_shell_27pi9_7",UJ="_header_27pi9_17",WJ="_backBtn_27pi9_32",VJ="_stopAllBtn_27pi9_59",GJ="_main_27pi9_92",qJ="_titleBlock_27pi9_107",KJ="_titleHeadRow_27pi9_112",QJ="_title_27pi9_107",YJ="_addrRow_27pi9_128",JJ="_addrPill_27pi9_134",XJ="_addrMono_27pi9_155",ZJ="_addrIcon_27pi9_156",eX="_addrOpen_27pi9_157",tX="_titleMeta_27pi9_170",nX="_quickLinks_27pi9_179",rX="_quickLink_27pi9_179",sX="_qlIcon_27pi9_222",aX="_qlText_27pi9_234",oX="_qlTitle_27pi9_235",iX="_qlSub_27pi9_242",cX="_qlArrow_27pi9_247",lX="_card_27pi9_258",uX="_cardHead_27pi9_285",dX="_cardHeadText_27pi9_294",fX="_cardTitle_27pi9_295",hX="_cardSub_27pi9_308",pX="_cardHeadMeta_27pi9_315",mX="_permList_27pi9_324",gX="_permRow_27pi9_331",yX="_permMark_27pi9_340",vX="_permRowAllow_27pi9_350",bX="_permRowDisallow_27pi9_351",wX="_permRowRevoked_27pi9_352",_X="_permBody_27pi9_354",xX="_permLabel_27pi9_360",CX="_permSub_27pi9_374",kX="_permRevokeBtn_27pi9_380",jX="_permRevokedTag_27pi9_402",SX="_technicalLink_27pi9_417",AX="_addAgentBtn_27pi9_443",EX="_signerList_27pi9_466",NX="_signerRow_27pi9_474",MX="_signerDot_27pi9_484",IX="_signerDotActive_27pi9_490",BX="_signerDotStopped_27pi9_494",TX="_signerBody_27pi9_498",PX="_signerHead_27pi9_499",RX="_signerName_27pi9_505",LX="_signerKind_27pi9_512",DX="_signerMeta_27pi9_518",OX="_signerAddr_27pi9_527",FX="_signerErc_27pi9_533",zX="_signerSep_27pi9_542",$X="_signerStopBtn_27pi9_544",HX="_signerResumeBtn_27pi9_545",UX="_journalList_27pi9_578",WX="_journalRow_27pi9_585",VX="_journalTime_27pi9_609",GX="_journalMark_27pi9_616",qX="_jStatus_success_27pi9_625",KX="_jStatus_rejected_27pi9_626",QX="_jStatus_info_27pi9_627",YX="_jStatus_warn_27pi9_628",JX="_journalBody_27pi9_630",XX="_journalTitle_27pi9_631",ZX="_journalActor_27pi9_641",eZ="_journalAction_27pi9_642",tZ="_journalMeta_27pi9_643",nZ="_journalRowRejected_27pi9_650",rZ="_journalKind_27pi9_652",sZ="_jKind_run_27pi9_666",aZ="_jKind_permission_27pi9_667",oZ="_jKind_prepared_27pi9_668",iZ="_jKind_rehearsal_27pi9_669",cZ="_jKind_recommendation_27pi9_670",lZ="_jKind_audit_27pi9_671",uZ="_jKind_error_27pi9_672",dZ="_journalChevron_27pi9_674",fZ="_journalViewAll_27pi9_681",hZ="_drawerScrim_27pi9_704",pZ="_drawerScrimOpen_27pi9_713",mZ="_drawer_27pi9_704",gZ="_drawerOpen_27pi9_731",yZ="_drawerHead_27pi9_732",vZ="_drawerHeadLeft_27pi9_740",bZ="_drawerKindChip_27pi9_741",wZ="_drawerTime_27pi9_752",_Z="_drawerClose_27pi9_757",xZ="_drawerBody_27pi9_773",CZ="_drawerTitle_27pi9_781",kZ="_drawerActor_27pi9_790",jZ="_drawerAction_27pi9_791",SZ="_drawerSection_27pi9_793",AZ="_drawerSectionHead_27pi9_794",EZ="_drawerSectionKicker_27pi9_795",NZ="_drawerSectionTitle_27pi9_802",MZ="_drawerProse_27pi9_810",IZ="_evidenceList_27pi9_817",BZ="_artifactList_27pi9_818",TZ="_evidenceRow_27pi9_824",PZ="_mono_27pi9_842",RZ="_authRow_27pi9_844",LZ="_authMark_27pi9_852",DZ="_authBody_27pi9_863",OZ="_authLabel_27pi9_864",FZ="_authSub_27pi9_870",zZ="_confirmScrim_27pi9_877",$Z="_confirmCard_27pi9_889",HZ="_confirmTitle_27pi9_900",UZ="_confirmBody_27pi9_908",WZ="_confirmPerm_27pi9_914",VZ="_confirmActions_27pi9_915",GZ="_confirmCancel_27pi9_921",qZ="_confirmDanger_27pi9_932",KZ="_notFound_27pi9_946",QZ="_notFoundTitle_27pi9_954",YZ="_notFoundBody_27pi9_961",vt={shell:HJ,header:UJ,backBtn:WJ,stopAllBtn:VJ,main:GJ,titleBlock:qJ,titleHeadRow:KJ,title:QJ,addrRow:YJ,addrPill:JJ,addrMono:XJ,addrIcon:ZJ,addrOpen:eX,titleMeta:tX,quickLinks:nX,quickLink:rX,qlIcon:sX,qlText:aX,qlTitle:oX,qlSub:iX,qlArrow:cX,card:lX,cardHead:uX,cardHeadText:dX,cardTitle:fX,cardSub:hX,cardHeadMeta:pX,permList:mX,permRow:gX,permMark:yX,permRowAllow:vX,permRowDisallow:bX,permRowRevoked:wX,permBody:_X,permLabel:xX,permSub:CX,permRevokeBtn:kX,permRevokedTag:jX,technicalLink:SX,addAgentBtn:AX,signerList:EX,signerRow:NX,signerDot:MX,signerDotActive:IX,signerDotStopped:BX,signerBody:TX,signerHead:PX,signerName:RX,signerKind:LX,signerMeta:DX,signerAddr:OX,signerErc:FX,signerSep:zX,signerStopBtn:$X,signerResumeBtn:HX,journalList:UX,journalRow:WX,journalTime:VX,journalMark:GX,jStatus_success:qX,jStatus_rejected:KX,jStatus_info:QX,jStatus_warn:YX,journalBody:JX,journalTitle:XX,journalActor:ZX,journalAction:eZ,journalMeta:tZ,journalRowRejected:nZ,journalKind:rZ,jKind_run:sZ,jKind_permission:aZ,jKind_prepared:oZ,jKind_rehearsal:iZ,jKind_recommendation:cZ,jKind_audit:lZ,jKind_error:uZ,journalChevron:dZ,journalViewAll:fZ,drawerScrim:hZ,drawerScrimOpen:pZ,drawer:mZ,drawerOpen:gZ,drawerHead:yZ,drawerHeadLeft:vZ,drawerKindChip:bZ,drawerTime:wZ,drawerClose:_Z,drawerBody:xZ,drawerTitle:CZ,drawerActor:kZ,drawerAction:jZ,drawerSection:SZ,drawerSectionHead:AZ,drawerSectionKicker:EZ,drawerSectionTitle:NZ,drawerProse:MZ,evidenceList:IZ,artifactList:BZ,evidenceRow:TZ,mono:PZ,authRow:RZ,authMark:LZ,authBody:DZ,authLabel:OZ,authSub:FZ,confirmScrim:zZ,confirmCard:$Z,confirmTitle:HZ,confirmBody:UZ,confirmPerm:WZ,confirmActions:VZ,confirmCancel:GZ,confirmDanger:qZ,notFound:KZ,notFoundTitle:QZ,notFoundBody:YZ};function JZ(){const[e,t]=I.useState(null),[n,r]=I.useState(!1),a=I.useRef(null);return I.useEffect(()=>{let c=!0;const l=async()=>{try{const d=await fetch("/api/version");if(!d.ok)return;const p=await d.json();c&&t(p)}catch{}};l();const u=setInterval(l,3e4);return()=>{c=!1,clearInterval(u)}},[]),I.useEffect(()=>{if(!n)return;const c=l=>{a.current&&!a.current.contains(l.target)&&r(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]),e!=null&&e.stale?o.jsxs("div",{ref:a,style:{position:"relative",display:"inline-flex"},children:[o.jsx("button",{type:"button",onClick:()=>r(c=>!c),"aria-label":`Update available — ${e.installed}`,title:"Update available",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",background:"none",padding:4,cursor:"pointer",color:"#F5C518"},children:o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M12 3.2 1.8 20.8h20.4L12 3.2Z",fill:"#F5C518"}),o.jsx("rect",{x:"11",y:"9.5",width:"2",height:"5.5",rx:"1",fill:"#1a1a1a"}),o.jsx("rect",{x:"11",y:"16.5",width:"2",height:"2",rx:"1",fill:"#1a1a1a"})]})}),n&&o.jsxs("div",{role:"status",style:{position:"absolute",top:"100%",left:0,marginTop:8,width:248,zIndex:9999,padding:"10px 12px",background:"#F5C518",color:"#1a1a1a",borderRadius:2,boxShadow:"0 8px 24px rgba(0,0,0,0.45)",font:"12px/1.5 ui-sans-serif, system-ui, sans-serif"},children:[o.jsxs("strong",{style:{display:"block",marginBottom:4},children:["Update available — ",e.installed]}),"This dashboard is still running ",e.running,". Restart it to update:",o.jsx("code",{style:{display:"block",marginTop:6,padding:"4px 6px",background:"rgba(0,0,0,0.12)",borderRadius:2,font:"11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace"},children:"sailor ui stop && sailor ui start"})]})]}):null}const Yj=[{type:"function",name:"createAccount",stateMutability:"nonpayable",inputs:[{name:"safeFactory",type:"address"},{name:"safeSingleton",type:"address"},{name:"safeInitializer",type:"bytes"},{name:"saltNonce",type:"uint256"},{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"},{name:"feeAsset",type:"address"}],outputs:[{name:"account",type:"address"}]},{type:"function",name:"registerAccount",stateMutability:"nonpayable",inputs:[{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"},{name:"feeAsset",type:"address"},{name:"deadline",type:"uint256"},{name:"ownerSig",type:"bytes"}],outputs:[]},{type:"function",name:"setManager",stateMutability:"nonpayable",inputs:[{name:"newManager",type:"address"}],outputs:[]},{type:"function",name:"getManager",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"address"}]},{type:"function",name:"registerPermission",stateMutability:"payable",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"registerPermissions",stateMutability:"payable",inputs:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"revokeSession",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"activateSession",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"dispatch",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"},{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"managerSig",type:"bytes"},{name:"deadline",type:"uint256"}],outputs:[]},{type:"function",name:"dispatchBatch",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"},{name:"calls",type:"tuple[]",components:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}]},{name:"managerSig",type:"bytes"},{name:"deadline",type:"uint256"}],outputs:[]},{type:"function",name:"previewBatch",stateMutability:"view",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"},{name:"calls",type:"tuple[]",components:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}]}],outputs:[{name:"approved",type:"bool"},{name:"reason",type:"string"}]},{type:"function",name:"collectFees",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"grossFee",type:"uint256"},{name:"currentNav",type:"uint256"},{name:"feeToken",type:"address"}],outputs:[]},{type:"function",name:"recordDeposit",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"recordWithdrawal",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"getPermissions",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"address[]"}]},{type:"function",name:"getPermissionsWithInfo",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"infos",type:"tuple[]",components:[{name:"permission",type:"address"},{name:"isBatch",type:"bool"},{name:"hasIntrospection",type:"bool"},{name:"permissionId",type:"bytes32"},{name:"permissionVersion",type:"bytes32"}]}]},{type:"function",name:"isPermissionRegistered",stateMutability:"view",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"configs",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"},{name:"feeAsset",type:"address"},{name:"sessionActive",type:"bool"}]},{type:"function",name:"registered",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"managerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"batchNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"signerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"event",name:"AccountRegistered",inputs:[{name:"account",type:"address",indexed:!0},{name:"permissionSigner",type:"address",indexed:!0},{name:"manager",type:"address",indexed:!0}]},{type:"event",name:"PermissionRegistered",inputs:[{name:"account",type:"address",indexed:!0},{name:"permission",type:"address",indexed:!0}]},{type:"event",name:"ManagerChanged",inputs:[{name:"account",type:"address",indexed:!0},{name:"oldManager",type:"address",indexed:!0},{name:"newManager",type:"address",indexed:!0}]},{type:"event",name:"PermissionRevoked",inputs:[{name:"account",type:"address",indexed:!0},{name:"permission",type:"address",indexed:!0}]},{type:"event",name:"Dispatched",inputs:[{name:"account",type:"address",indexed:!0},{name:"permission",type:"address",indexed:!0},{name:"target",type:"address",indexed:!1},{name:"selector",type:"bytes4",indexed:!1},{name:"value",type:"uint256",indexed:!1}]},{type:"event",name:"BatchDispatched",inputs:[{name:"account",type:"address",indexed:!0},{name:"permission",type:"address",indexed:!0},{name:"batchHash",type:"bytes32",indexed:!1},{name:"callCount",type:"uint256",indexed:!1}]}],XZ="_overlay_1d6ke_6",ZZ="_fadeIn_1d6ke_1",eee="_card_1d6ke_21",tee="_cardRise_1d6ke_1",nee="_close_1d6ke_47",ree="_stepper_1d6ke_73",see="_stepGroup_1d6ke_83",aee="_step_1d6ke_73",oee="_stepCircle_1d6ke_85",iee="_step_upcoming_1d6ke_99",cee="_step_current_1d6ke_104",lee="_step_done_1d6ke_111",uee="_stepLabel_1d6ke_115",dee="_stepLine_1d6ke_123",fee="_stepLineDone_1d6ke_130",hee="_body_1d6ke_133",pee="_bodyFade_1d6ke_1",mee="_bodyCentered_1d6ke_139",gee="_heroSai_1d6ke_149",yee="_header_1d6ke_155",vee="_headerCentered_1d6ke_162",bee="_kicker_1d6ke_170",wee="_headline_1d6ke_178",_ee="_sub_1d6ke_187",xee="_points_1d6ke_197",Cee="_liRise_1d6ke_1",kee="_checkBubble_1d6ke_218",jee="_pointTitle_1d6ke_231",See="_pointSub_1d6ke_239",Aee="_txPanel_1d6ke_249",Eee="_txPanelHeader_1d6ke_259",Nee="_txPanelKicker_1d6ke_267",Mee="_txPanelBadge_1d6ke_275",Iee="_netSelectWrap_1d6ke_288",Bee="_netSelectBtn_1d6ke_292",Tee="_netSelectBtnOpen_1d6ke_309",Pee="_netSelectDot_1d6ke_314",Ree="_netSelectName_1d6ke_320",Lee="_netSelectStack_1d6ke_326",Dee="_netSelectStackDot_1d6ke_331",Oee="_netSelectCaret_1d6ke_339",Fee="_netSelectCaretOpen_1d6ke_344",zee="_netSelectMenu_1d6ke_346",$ee="_netMenuRise_1d6ke_1",Hee="_netSelectMenuHeader_1d6ke_365",Uee="_netSelectMenuKicker_1d6ke_373",Wee="_netSelectMenuLink_1d6ke_381",Vee="_netSelectMenuList_1d6ke_398",Gee="_netSelectOption_1d6ke_412",qee="_netSelectOptionActive_1d6ke_433",Kee="_netSelectOptionBody_1d6ke_440",Qee="_netSelectOptionName_1d6ke_446",Yee="_netSelectOptionMeta_1d6ke_450",Jee="_netSelectCheckbox_1d6ke_459",Xee="_netSelectCheckboxOn_1d6ke_471",Zee="_netSummary_1d6ke_479",ete="_netSummaryItem_1d6ke_488",tte="_netSummarySep_1d6ke_493",nte="_netSummaryStack_1d6ke_497",rte="_netSummaryStackDot_1d6ke_501",ste="_txDetails_1d6ke_509",ate="_txRow_1d6ke_510",ote="_gas_1d6ke_522",ite="_txPanelFooter_1d6ke_523",cte="_actions_1d6ke_530",lte="_linkBtn_1d6ke_537",ute="_fineprint_1d6ke_551",dte="_confirmIndicator_1d6ke_562",fte="_confirmDone_1d6ke_573",hte="_pulse_1d6ke_576",pte="_confirmHeadline_1d6ke_588",mte="_confirmSub_1d6ke_593",gte="_successHalo_1d6ke_601",ke={overlay:XZ,fadeIn:ZZ,card:eee,cardRise:tee,close:nee,stepper:ree,stepGroup:see,step:aee,stepCircle:oee,step_upcoming:iee,step_current:cee,step_done:lee,stepLabel:uee,stepLine:dee,stepLineDone:fee,body:hee,bodyFade:pee,bodyCentered:mee,heroSai:gee,header:yee,headerCentered:vee,kicker:bee,headline:wee,sub:_ee,points:xee,liRise:Cee,checkBubble:kee,pointTitle:jee,pointSub:See,txPanel:Aee,txPanelHeader:Eee,txPanelKicker:Nee,txPanelBadge:Mee,netSelectWrap:Iee,netSelectBtn:Bee,netSelectBtnOpen:Tee,netSelectDot:Pee,netSelectName:Ree,netSelectStack:Lee,netSelectStackDot:Dee,netSelectCaret:Oee,netSelectCaretOpen:Fee,netSelectMenu:zee,netMenuRise:$ee,netSelectMenuHeader:Hee,netSelectMenuKicker:Uee,netSelectMenuLink:Wee,netSelectMenuList:Vee,netSelectOption:Gee,netSelectOptionActive:qee,netSelectOptionBody:Kee,netSelectOptionName:Qee,netSelectOptionMeta:Yee,netSelectCheckbox:Jee,netSelectCheckboxOn:Xee,netSummary:Zee,netSummaryItem:ete,netSummarySep:tte,netSummaryStack:nte,netSummaryStackDot:rte,txDetails:ste,txRow:ate,gas:ote,txPanelFooter:ite,actions:cte,linkBtn:lte,fineprint:ute,confirmIndicator:dte,confirmDone:fte,pulse:hte,"confirm-pulse":"_confirm-pulse_1d6ke_1",confirmHeadline:pte,confirmSub:mte,successHalo:gte},yte=[{type:"function",name:"createProxyWithNonce",stateMutability:"nonpayable",inputs:[{name:"singleton",type:"address"},{name:"initializer",type:"bytes"},{name:"saltNonce",type:"uint256"}],outputs:[{name:"proxy",type:"address"}]}],vte="0x4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e235";function bte(e){var r,a;if(!(e!=null&&e.logs))return null;const[t]=xp({abi:Yj,eventName:"AccountRegistered",logs:e.logs});if((r=t==null?void 0:t.args)!=null&&r.account)return t.args.account;const n=e.logs.find(c=>{var l;return((l=c.topics)==null?void 0:l[0])===vte});return n?`0x${(a=n.topics[1])==null?void 0:a.slice(26)}`:null}function wte(e,t,n){if(e){const a=oG({owners:[t],threshold:1n,kernel:e.kernel,safeModuleEnabler:e.safeModuleEnabler});return{to:e.kernel,data:At({abi:Yj,functionName:"createAccount",args:[ri.proxyFactory,ri.singletonL2,a,n,t,t,e.standardFeePolicy,Bt]})}}const r=At({abi:Kj,functionName:"setup",args:[[t],1n,Bt,"0x",ri.fallbackHandler,Bt,0n,Bt]});return{to:ri.proxyFactory,data:At({abi:yte,functionName:"createProxyWithNonce",args:[ri.singletonL2,r,n]})}}async function _te(e){try{await fetch("/api/account",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}function xte({open:e,onClose:t,onComplete:n}){const[r,a]=I.useState("intro"),[c,l]=I.useState([Jj]),[u,d]=I.useState(""),[p,h]=I.useState(null),[m,g]=I.useState(null),[v,b]=I.useState(null),{address:_,chainId:x}=dt(),{sendTransactionAsync:j}=Li(),{switchChainAsync:A}=Bs(),k=Lt();I.useEffect(()=>{if(!e)return;a("intro"),d(""),h(null),g(null),b(null),document.body.style.overflow="hidden";const E=B=>{B.key==="Escape"&&r!=="confirm"&&(t==null||t())};return window.addEventListener("keydown",E),()=>{window.removeEventListener("keydown",E),document.body.style.overflow=""}},[e]);async function N(){var Q;if(!_){d("No wallet connected.");return}const E=rp.filter(O=>c.includes(O.id));if(E.length===0){d("Select a network.");return}const B=BigInt(Date.now());a("confirm"),d("");const M=[];let P=null,R="0",z=x;try{for(const O of E){b({index:M.length,total:E.length,name:O.name});let K=null;try{K=Uj(O.chainId)}catch{}const{to:$,data:L}=wte(K,_,B);z!==O.chainId&&(await A({chainId:O.chainId}),z=O.chainId);const se=await j({to:$,data:L,chainId:O.chainId}),D=await Ck(k,{hash:se,chainId:O.chainId});P||(P=bte(D),R=((Q=D.blockNumber)==null?void 0:Q.toString())??"0"),M.push(O.chainId)}}catch(O){if(M.length===0){d((O==null?void 0:O.shortMessage)||(O==null?void 0:O.message)||"Transaction rejected."),a("review"),b(null);return}d(`Deployed on ${M.length} of ${E.length} chains — the rest were not completed. ${(O==null?void 0:O.shortMessage)||(O==null?void 0:O.message)||""}`.trim())}if(b(null),!P){a("review");return}const q={safe:P,owner:_,permissionSigner:_,manager:_,chainId:M[0],createdAtBlock:R,deployedChains:M};h(P),_te(q),g(q),a("ready")}return e?o.jsx("div",{className:ke.overlay,role:"dialog","aria-modal":"true","aria-label":"Create your SMA",onClick:r==="confirm"?void 0:t,children:o.jsxs(Kt,{className:ke.card,onClick:E=>E.stopPropagation(),children:[r!=="confirm"&&o.jsx("button",{type:"button",className:ke.close,onClick:t,"aria-label":"Close",children:"×"}),r!=="ready"&&o.jsx(Cte,{step:r}),r==="intro"&&o.jsx(kte,{onContinue:()=>a("review")}),r==="review"&&o.jsx(jte,{onBack:()=>a("intro"),onSign:N,networks:c,onNetworksChange:l,error:u,ownerAddress:_}),r==="confirm"&&o.jsx(Nte,{progress:v}),r==="ready"&&o.jsx(Mte,{safeAddress:p,onContinue:()=>{t==null||t(),n==null||n(m)}})]})}):null}const K1=[{id:"intro",label:"Intro"},{id:"review",label:"Review"},{id:"confirm",label:"Confirm"}];function Cte({step:e}){const t=K1.findIndex(n=>n.id===e);return o.jsx("div",{className:ke.stepper,"aria-label":"Setup progress",children:K1.map((n,r)=>{const a=r<t?"done":r===t?"current":"upcoming";return o.jsxs("span",{className:ke.stepGroup,children:[o.jsxs("span",{className:`${ke.step} ${ke[`step_${a}`]}`,children:[o.jsx("span",{className:ke.stepCircle,"aria-hidden":!0,children:a==="done"?o.jsx(Bte,{}):r+1}),a==="current"&&o.jsx("span",{className:ke.stepLabel,children:n.label})]}),r<K1.length-1&&o.jsx("span",{className:`${ke.stepLine} ${r<t?ke.stepLineDone:""}`,"aria-hidden":!0})]},n.id)})})}function kte({onContinue:e}){return o.jsxs("section",{className:ke.body,children:[o.jsx("div",{className:ke.heroSai,"aria-hidden":!0,children:o.jsx(gn,{size:56,animate:!0})}),o.jsxs("header",{className:ke.header,children:[o.jsx("span",{className:ke.kicker,children:"FIRST AGENT"}),o.jsx("h2",{className:`${ut.displayHeadline} ${ke.headline}`,children:"Before creating your first agent, we’ll create your SMA."}),o.jsx("p",{className:ke.sub,children:"Your Separately Managed Account is the self-custody smart contract that your AI operates inside. It’s deployed once. You alone control it."})]}),o.jsxs("ul",{className:ke.points,children:[o.jsxs("li",{style:{"--i":0},children:[o.jsx(Q1,{}),o.jsxs("div",{children:[o.jsx("span",{className:ke.pointTitle,children:"You own this account"}),o.jsx("span",{className:ke.pointSub,children:"Not Sail. Not the AI. Only the wallet you just connected."})]})]}),o.jsxs("li",{style:{"--i":1},children:[o.jsx(Q1,{}),o.jsxs("div",{children:[o.jsx("span",{className:ke.pointTitle,children:"Bounded delegation"}),o.jsx("span",{className:ke.pointSub,children:"Every agent has cap, time, and venue limits — enforced onchain."})]})]}),o.jsxs("li",{style:{"--i":2},children:[o.jsx(Q1,{}),o.jsxs("div",{children:[o.jsx("span",{className:ke.pointTitle,children:"Revoke at any time"}),o.jsx("span",{className:ke.pointSub,children:"One signature halts every running agent. No waiting period."})]})]})]}),o.jsx(Ze,{fullWidth:!0,onClick:e,children:"Continue"}),o.jsx("p",{className:ke.fineprint,children:"You can stop at any step. Nothing happens onchain until you sign."})]})}function jte({onBack:e,onSign:t,networks:n,onNetworksChange:r,error:a,ownerAddress:c}){const l=rp.filter(_=>n.includes(_.id)),u=l.reduce((_,x)=>_+Ate(x.gas),0),d=Ete(u),[p,h]=I.useState(!1),m=l[0];let g=null;if(m)try{g=Uj(m.chainId)}catch{}const v=!!g;async function b(){h(!0);try{await t()}finally{h(!1)}}return o.jsxs("section",{className:ke.body,children:[o.jsxs("header",{className:ke.headerCentered,children:[o.jsx("span",{className:ke.kicker,children:"REVIEW & SIGN"}),o.jsx("h2",{className:`${ut.displayHeadline} ${ke.headline}`,children:"Deploy your SMA."}),o.jsxs("p",{className:ke.sub,children:["One signature creates a self-custody smart account.",o.jsx("br",{}),"No AI has access until you create your first agent."]})]}),o.jsxs("div",{className:ke.txPanel,children:[o.jsxs("header",{className:ke.txPanelHeader,children:[o.jsx("span",{className:ke.txPanelKicker,children:"What you are signing"}),o.jsx(Ite,{value:n,onChange:r})]}),o.jsxs("dl",{className:ke.txDetails,children:[o.jsx(yu,{k:"Transaction",v:v?"Deploy & register SMA":"Safe proxy deployment"}),o.jsx(yu,{k:`Network${l.length===1?"":"s"}`,v:o.jsx(Ste,{nets:l})}),v?o.jsx(yu,{k:"SailKernel",v:`${g.kernel.slice(0,10)}…`}):o.jsx(yu,{k:"Factory",v:`${ri.proxyFactory.slice(0,10)}…`}),o.jsx(yu,{k:l.length===1?"Gas estimate":`Gas estimate · ${l.length} chains`,v:d,accent:!0})]})]}),a&&o.jsx("p",{style:{color:"#ff6b6b",fontSize:13,margin:"8px 0 0",textAlign:"center"},children:a}),o.jsxs("div",{className:ke.actions,children:[o.jsx(Ze,{fullWidth:!0,onClick:b,disabled:l.length===0||p,children:p?"Check your wallet…":"Sign & deploy"}),o.jsx("button",{type:"button",className:ke.linkBtn,onClick:e,children:"Back"})]})]})}function Ste({nets:e}){return e.length===0?o.jsx("span",{style:{opacity:.6},children:"None selected"}):e.length<=3?o.jsx("span",{className:ke.netSummary,children:e.map((t,n)=>o.jsxs("span",{className:ke.netSummaryItem,children:[o.jsx("span",{className:ke.netSelectDot,style:{background:t.color,boxShadow:`0 0 6px ${t.color}66`},"aria-hidden":!0}),o.jsx("span",{children:t.name}),n<e.length-1&&o.jsx("span",{className:ke.netSummarySep,"aria-hidden":!0,children:"·"})]},t.id))}):o.jsxs("span",{className:ke.netSummary,children:[o.jsx("span",{className:ke.netSummaryStack,"aria-hidden":!0,children:e.slice(0,4).map(t=>o.jsx("span",{className:ke.netSummaryStackDot,style:{background:t.color,boxShadow:`0 0 6px ${t.color}66`}},t.id))}),o.jsxs("span",{children:[e.length," networks"]})]})}function Ate(e){const t=String(e??"").match(/\$(\d+(?:\.\d+)?)/);return t?Number(t[1]):0}function Ete(e){return e<1?`$${e.toFixed(2)}`:e<100?`$${e.toFixed(2)}`:`$${Math.round(e)}`}function Nte({progress:e}){const t=e&&e.total>1;return o.jsxs("section",{className:`${ke.body} ${ke.bodyCentered}`,children:[o.jsx("div",{className:ke.confirmIndicator,children:o.jsx("span",{className:ke.pulse})}),o.jsx("h2",{className:`${ut.displayHeadline} ${ke.confirmHeadline}`,children:e?`Deploying on ${e.name}…`:"Waiting for confirmation…"}),o.jsx("p",{className:ke.confirmSub,children:t?`Chain ${e.index+1} of ${e.total} — approve each deployment in your wallet. You may be asked to switch networks between chains.`:"Approve the deployment in your wallet, then wait for the block."})]})}function Mte({onContinue:e,safeAddress:t}){return o.jsxs("section",{className:`${ke.body} ${ke.bodyCentered}`,children:[o.jsx("span",{className:ke.successHalo,"aria-hidden":!0,children:o.jsx(gn,{size:56,animate:!0})}),o.jsxs("header",{className:ke.headerCentered,children:[o.jsx("span",{className:ke.kicker,children:"SMA READY"}),o.jsx("h2",{className:`${ut.displayHeadline} ${ke.headline}`,children:"Your account is ready."}),t&&o.jsx("p",{className:ke.sub,style:{fontFamily:"monospace",fontSize:12,wordBreak:"break-all"},children:t}),o.jsxs("p",{className:ke.sub,children:["Open a chat with your AI and ask it to draft your first agent.",o.jsx("br",{}),"When it’s ready you’ll see it here, waiting for your signature."]})]}),o.jsx(Ze,{fullWidth:!0,onClick:e,children:"Open my dashboard"}),o.jsx("p",{className:ke.fineprint,children:"Tip: paste your SMA address into your AI chat to start."})]})}const rp=[{id:"base",name:"Base",chainId:8453,color:"#0052FF",gas:"$0.18",tier:"L2",sail:!0},{id:"arbitrum",name:"Arbitrum One",chainId:42161,color:"#28A0F0",gas:"$0.42",tier:"L2",sail:!0},{id:"ethereum",name:"Ethereum",chainId:1,color:"#627EEA",gas:"$24.80",tier:"L1",sail:!0},{id:"optimism",name:"Optimism",chainId:10,color:"#FF0420",gas:"$0.20",tier:"L2",sail:!0},{id:"unichain",name:"Unichain",chainId:130,color:"#FF007A",gas:"$0.10",tier:"L2",sail:!0},{id:"bsc",name:"BSC",chainId:56,color:"#F0B90B",gas:"$0.15",tier:"L1",sail:!0},{id:"world",name:"World Chain",chainId:480,color:"#000000",gas:"$0.05",tier:"L2",sail:!0},{id:"hyperevm",name:"HyperEVM",chainId:999,color:"#97FCE4",gas:"$0.05",tier:"L1",sail:!0},{id:"megaeth",name:"MegaETH",chainId:4326,color:"#5B5FEF",gas:"$0.05",tier:"L1",sail:!0},{id:"sepolia",name:"Ethereum Sepolia",chainId:11155111,color:"#627EEA",gas:"$0.01",tier:"Testnet",sail:!0},{id:"baseSepolia",name:"Base Sepolia",chainId:84532,color:"#3c6ef5",gas:"$0.01",tier:"Testnet",sail:!0},{id:"arbitrumSepolia",name:"Arbitrum Sepolia",chainId:421614,color:"#28A0F0",gas:"$0.01",tier:"Testnet",sail:!0},{id:"unichainSepolia",name:"Unichain Sepolia",chainId:1301,color:"#FF007A",gas:"$0.01",tier:"Testnet",sail:!0}],Jj="base";function Ite({value:e,onChange:t}){const[n,r]=I.useState(!1),a=rp.filter(u=>e.includes(u.id)),c=a.length===1?a[0]:null;I.useEffect(()=>{if(!n)return;const u=p=>{var h,m;(m=(h=p.target)==null?void 0:h.closest)!=null&&m.call(h,`.${ke.netSelectWrap}`)||r(!1)},d=p=>{p.key==="Escape"&&r(!1)};return window.addEventListener("click",u),window.addEventListener("keydown",d),()=>{window.removeEventListener("click",u),window.removeEventListener("keydown",d)}},[n]);function l(u){const d=e.includes(u)?e.filter(p=>p!==u):[...e,u];d.length!==0&&(t==null||t(d))}return o.jsxs("span",{className:ke.netSelectWrap,children:[o.jsxs("button",{type:"button",className:`${ke.netSelectBtn} ${n?ke.netSelectBtnOpen:""}`,onClick:()=>r(u=>!u),"aria-haspopup":"listbox","aria-expanded":n,children:[c?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:ke.netSelectDot,style:{background:c.color,boxShadow:`0 0 6px ${c.color}66`},"aria-hidden":!0}),o.jsx("span",{className:ke.netSelectName,children:c.name})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:ke.netSelectStack,"aria-hidden":!0,children:a.slice(0,4).map(u=>o.jsx("span",{className:ke.netSelectStackDot,style:{background:u.color,boxShadow:`0 0 6px ${u.color}66`}},u.id))}),o.jsx("span",{className:ke.netSelectName,children:a.length===0?"Select networks":`${a.length} networks`})]}),o.jsx("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",className:`${ke.netSelectCaret} ${n?ke.netSelectCaretOpen:""}`,"aria-hidden":!0,children:o.jsx("path",{d:"M3 4.5l3 3 3-3"})})]}),n&&o.jsxs("div",{className:ke.netSelectMenu,role:"listbox","aria-multiselectable":"true","aria-label":"EVM networks",children:[o.jsxs("header",{className:ke.netSelectMenuHeader,children:[o.jsx("span",{className:ke.netSelectMenuKicker,children:a.length===0?"Select at least one chain":`${a.length} selected`}),o.jsx("button",{type:"button",className:ke.netSelectMenuLink,onClick:()=>t==null?void 0:t([Jj]),children:"Reset"})]}),o.jsx("ul",{className:ke.netSelectMenuList,children:rp.map(u=>{const d=e.includes(u.id);return o.jsx("li",{children:o.jsxs("button",{type:"button",role:"option","aria-selected":d,className:`${ke.netSelectOption} ${d?ke.netSelectOptionActive:""}`,onClick:()=>l(u.id),children:[o.jsx("span",{className:ke.netSelectDot,style:{background:u.color,boxShadow:`0 0 6px ${u.color}66`},"aria-hidden":!0}),o.jsxs("span",{className:ke.netSelectOptionBody,children:[o.jsxs("span",{className:ke.netSelectOptionName,children:[u.name,u.sail&&o.jsx("span",{style:{marginLeft:6,fontSize:10,color:"var(--accent-blue)",opacity:.9},children:"● Sail"})]}),o.jsxs("span",{className:ke.netSelectOptionMeta,children:[u.tier," · chain ",u.chainId]})]}),o.jsx("span",{className:`${ke.netSelectCheckbox} ${d?ke.netSelectCheckboxOn:""}`,"aria-hidden":!0,children:d&&o.jsx("svg",{viewBox:"0 0 14 14",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4"})})})]})},u.id)})})]})]})}function yu({k:e,v:t,accent:n}){return o.jsxs("div",{className:ke.txRow,children:[o.jsx("dt",{children:e}),o.jsx("dd",{className:n?ke.gas:"",children:t})]})}function Q1(){return o.jsx("span",{className:ke.checkBubble,"aria-hidden":!0,children:o.jsx("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M5 12.5l5 5L20 7"})})})}function Bte(){return o.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M3 7.5l2.6 2.6L11 4"})})}const Tte="_overlay_1nszp_1",Pte="_card_1nszp_14",Rte="_close_1nszp_20",Lte="_title_1nszp_35",Dte="_body_1nszp_42",Ote="_meta_1nszp_50",Fte="_error_1nszp_70",zte="_warn_1nszp_79",$te="_actions_1nszp_85",Hte="_cancel_1nszp_91",Ute="_permList_1nszp_107",Wte="_permItem_1nszp_118",Vte="_permLabel_1nszp_124",Gte="_permCheck_1nszp_132",qte="_permName_1nszp_139",Kte="_permAddr_1nszp_145",Qte="_confirmList_1nszp_151",Yte="_confirmItem_1nszp_162",Jte="_tech_1nszp_173",Xte="_techSummary_1nszp_179",Zte="_techBody_1nszp_188",Ie={overlay:Tte,card:Pte,close:Rte,title:Lte,body:Dte,meta:Ote,error:Fte,warn:zte,actions:$te,cancel:Hte,permList:Ute,permItem:Wte,permLabel:Vte,permCheck:Gte,permName:qte,permAddr:Kte,confirmList:Qte,confirmItem:Yte,tech:Jte,techSummary:Xte,techBody:Zte},R6=[{type:"function",name:"revokePermissions",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"signerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]}],ene={RevokePermissions:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]};async function tne(e){try{await fetch("/api/activity",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}function nne({open:e,mandate:t,permissions:n,sma:r,kernel:a,chainId:c,onClose:l,onRevoked:u}){var q,Q;const{address:d,chainId:p}=dt(),h=Md({chainId:c}),{signTypedDataAsync:m}=ml(),{sendTransactionAsync:g}=Li(),{switchChainAsync:v}=Bs(),b=Array.isArray(n)&&n.length>0,[_,x]=I.useState("confirm"),[j,A]=I.useState(new Set),[k,N]=I.useState(""),[E,B]=I.useState(null),{isSuccess:M}=Vk({hash:E});if(I.useEffect(()=>{if(!e)return;x(b?"select":"confirm"),A(new Set),N(""),B(null),document.body.style.overflow="hidden";const O=K=>{K.key==="Escape"&&_!=="pending"&&(l==null||l())};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O),document.body.style.overflow=""}},[e]),I.useEffect(()=>{if(!M||!E||_==="done")return;x("done");const O=b?[...j]:[t==null?void 0:t.address];Promise.all(O.map(K=>tne({type:"permission_revoked",actor:"owner",permission:K,sma:r,txHash:E,chainId:c}))).then(()=>u==null?void 0:u())},[M,E]),!e)return null;const P=b?[...j]:t!=null&&t.address?[t.address]:[];async function R(){if(!d){N("Connect your owner wallet first.");return}if(!a||!r||P.length===0){N("Select at least one permission to revoke.");return}x("pending"),N("");try{p!==c&&await v({chainId:c});const O=await h.readContract({address:a,abi:R6,functionName:"signerNonces",args:[r]}),K=BigInt(Math.floor(Date.now()/1e3)+600),$=await m({domain:{name:"SailKernel",version:"1",chainId:c,verifyingContract:a},types:ene,primaryType:"RevokePermissions",message:{account:r,permissions:P,nonce:O,deadline:K}}),L=At({abi:R6,functionName:"revokePermissions",args:[r,P,K,$]}),se=await g({to:a,data:L,chainId:c});B(se)}catch(O){N((O==null?void 0:O.shortMessage)||(O==null?void 0:O.message)||"Transaction rejected."),x(b?"select":"confirm")}}function z(O){A(K=>{const $=new Set(K);return $.has(O)?$.delete(O):$.add(O),$})}return o.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-label":"Revoke permission",onClick:_==="pending"?void 0:l,children:o.jsxs(Kt,{className:Ie.card,onClick:O=>O.stopPropagation(),children:[_!=="pending"&&o.jsx("button",{type:"button",className:Ie.close,onClick:l,"aria-label":"Close",children:"×"}),_==="done"?o.jsxs(o.Fragment,{children:[o.jsxs("h2",{className:Ie.title,children:["Permission",P.length>1?"s":""," revoked"]}),o.jsxs("p",{className:Ie.body,children:[P.length===1?o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:(b?(q=n.find(O=>O.address===P[0]))==null?void 0:q.name:t==null?void 0:t.name)??P[0]})," is no longer attached to your SMA."]}):o.jsxs(o.Fragment,{children:[o.jsxs("strong",{children:[P.length," permissions"]})," removed from your SMA."]})," ","It now appears in Recent Activity."]}),o.jsx("div",{className:Ie.actions,children:o.jsx(Ze,{onClick:l,children:"Done"})})]}):_==="select"?o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:Ie.title,children:"Select permissions to revoke"}),o.jsx("p",{className:Ie.body,children:"Choose which permissions to remove from your SMA. The agent will no longer be able to act under revoked permissions."}),o.jsx("ul",{className:Ie.permList,children:n.map(O=>o.jsx("li",{className:Ie.permItem,children:o.jsxs("label",{className:Ie.permLabel,children:[o.jsx("input",{type:"checkbox",className:Ie.permCheck,checked:j.has(O.address),onChange:()=>z(O.address)}),o.jsx("span",{className:Ie.permName,children:O.name??O.address}),o.jsxs("span",{className:Ie.permAddr,children:[O.address.slice(0,10),"…",O.address.slice(-6)]})]})},O.address))}),k&&o.jsx("p",{className:Ie.error,children:k}),!d&&o.jsx("p",{className:Ie.warn,children:"Connect your owner wallet to continue."}),o.jsxs("div",{className:Ie.actions,children:[o.jsx("button",{type:"button",className:Ie.cancel,onClick:l,children:"Cancel"}),o.jsx(Ze,{onClick:()=>{if(j.size===0){N("Select at least one permission.");return}N(""),x("confirm")},disabled:!d,children:"Next"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("h2",{className:Ie.title,children:["Revoke ",P.length>1?`${P.length} permissions`:"this permission","?"]}),o.jsxs("p",{className:Ie.body,children:[P.length>1?`Removing these ${P.length} permissions means the agent can no longer act under them.`:o.jsxs(o.Fragment,{children:["Removing ",o.jsx("strong",{children:(b?(Q=n==null?void 0:n.find(O=>O.address===P[0]))==null?void 0:Q.name:t==null?void 0:t.name)??"this permission"})," means the agent can no longer act under it."]})," ","You authorize the removal in your wallet and pay gas."]}),b&&P.length>0&&o.jsx("ul",{className:Ie.confirmList,children:P.map(O=>{var $;const K=($=n.find(L=>L.address===O))==null?void 0:$.name;return o.jsx("li",{className:Ie.confirmItem,children:K??O},O)})}),!b&&o.jsxs("dl",{className:Ie.meta,children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Permission"}),o.jsx("dd",{children:t==null?void 0:t.address})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"SMA"}),o.jsx("dd",{children:r})]})]}),k&&o.jsx("p",{className:Ie.error,children:k}),!d&&o.jsx("p",{className:Ie.warn,children:"Connect your owner wallet to continue."}),o.jsxs("div",{className:Ie.actions,children:[o.jsx("button",{type:"button",className:Ie.cancel,onClick:b?()=>x("select"):l,disabled:_==="pending",children:b?"Back":"Cancel"}),o.jsx(Ze,{onClick:R,disabled:_==="pending"||!d,children:_==="pending"?"Awaiting wallet…":"Revoke"})]})]})]})})}const rne="_overlay_x1rfq_7",sne="_card_x1rfq_22",ane="_close_x1rfq_32",one="_body_x1rfq_49",ine="_kicker_x1rfq_55",cne="_headline_x1rfq_63",lne="_sub_x1rfq_70",une="_segmented_x1rfq_78",dne="_segmented2_x1rfq_79",fne="_segBtn_x1rfq_89",hne="_segActive_x1rfq_102",pne="_modeNote_x1rfq_107",mne="_field_x1rfq_115",gne="_fieldLabel_x1rfq_120",yne="_input_x1rfq_125",vne="_fieldHint_x1rfq_139",bne="_error_x1rfq_145",wne="_fineprint_x1rfq_151",_ne="_addrPanel_x1rfq_159",xne="_revealPanel_x1rfq_160",Cne="_addrLabel_x1rfq_169",kne="_revealLabel_x1rfq_170",jne="_addrValue_x1rfq_177",Sne="_revealValue_x1rfq_178",Ane="_revealNote_x1rfq_190",Ene="_copyBtn_x1rfq_196",Nne="_savedList_x1rfq_211",Mne="_savedItem_x1rfq_218",Ine="_savedItemActive_x1rfq_235",Bne="_savedAddr_x1rfq_240",Tne="_savedBadge_x1rfq_247",Ne={overlay:rne,card:sne,close:ane,body:one,kicker:ine,headline:cne,sub:lne,segmented:une,segmented2:dne,segBtn:fne,segActive:hne,modeNote:pne,field:mne,fieldLabel:gne,input:yne,fieldHint:vne,error:bne,fineprint:wne,addrPanel:_ne,revealPanel:xne,addrLabel:Cne,revealLabel:kne,addrValue:jne,revealValue:Sne,revealNote:Ane,copyBtn:Ene,savedList:Nne,savedItem:Mne,savedItemActive:Ine,savedAddr:Bne,savedBadge:Tne},L6=8;function D6(e){return e?`${e.slice(0,6)}…${e.slice(-4)}`:"this SMA"}function Pne({open:e,safe:t,onClose:n,onCreated:r}){const[a,c]=I.useState("create"),[l,u]=I.useState("privateKey"),[d,p]=I.useState(""),[h,m]=I.useState(""),[g,v]=I.useState(!1),[b,_]=I.useState(""),[x,j]=I.useState(null),[A,k]=I.useState(!1);if(I.useEffect(()=>{if(!e)return;c("create"),u("privateKey"),p(""),m(""),v(!1),_(""),j(null),k(!1),document.body.style.overflow="hidden";const P=R=>{R.key==="Escape"&&!g&&(n==null||n())};return window.addEventListener("keydown",P),()=>{window.removeEventListener("keydown",P),document.body.style.overflow=""}},[e]),!e)return null;const N=a==="create"?"generate":l,E=a==="import";async function B(){if(_(""),h.length<L6){_(`Password must be at least ${L6} characters.`);return}if(E&&!d.trim()){_(l==="privateKey"?"Enter a private key.":"Enter your recovery phrase.");return}v(!0);try{const P=await fetch("/api/signer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:N,secret:E?d.trim():void 0,password:h})}),R=await P.json();if(!P.ok)throw new Error((R==null?void 0:R.error)||"Failed to create signer.");j(R),p(""),m("")}catch(P){_((P==null?void 0:P.message)||"Failed to create signer.")}finally{v(!1)}}function M(){var P;x!=null&&x.revealed&&((P=navigator==null?void 0:navigator.clipboard)!=null&&P.writeText)&&(navigator.clipboard.writeText(x.revealed),k(!0),setTimeout(()=>k(!1),1500))}return o.jsx("div",{className:Ne.overlay,role:"dialog","aria-modal":"true","aria-label":"Add agent wallet",onClick:g?void 0:n,children:o.jsxs(Kt,{className:Ne.card,onClick:P=>P.stopPropagation(),children:[!g&&o.jsx("button",{type:"button",className:Ne.close,onClick:n,"aria-label":"Close",children:"×"}),x?o.jsxs("section",{className:Ne.body,children:[o.jsx("span",{className:Ne.kicker,children:"SIGNER READY"}),o.jsx("h2",{className:`${ut.displayHeadline} ${Ne.headline}`,children:"Agent wallet created."}),o.jsxs("p",{className:Ne.sub,children:["Encrypted on disk for ",D6(t),". It still needs to be delegated on-chain before the agent can sign with it."]}),o.jsxs("div",{className:Ne.addrPanel,children:[o.jsx("span",{className:Ne.addrLabel,children:"Signer address"}),o.jsx("code",{className:Ne.addrValue,children:x.address})]}),x.revealed&&o.jsxs("div",{className:Ne.revealPanel,children:[o.jsx("span",{className:Ne.revealLabel,children:"Private key — save it now, shown only once"}),o.jsx("code",{className:Ne.revealValue,children:x.revealed}),o.jsx("button",{type:"button",className:Ne.copyBtn,onClick:M,children:A?"Copied ✓":"Copy"}),o.jsx("p",{className:Ne.revealNote,children:"Anyone with this key controls the signer. Store it in a password manager — never paste it into a chat or commit it to a repo."})]}),o.jsx(Ze,{fullWidth:!0,onClick:()=>r==null?void 0:r(x),children:x.revealed?"I've saved it — done":"Done"})]}):o.jsxs("section",{className:Ne.body,children:[o.jsx("span",{className:Ne.kicker,children:"DELEGATED SIGNER"}),o.jsx("h2",{className:`${ut.displayHeadline} ${Ne.headline}`,children:"Add an agent wallet."}),o.jsxs("p",{className:Ne.sub,children:["A hot key the agent uses to sign dispatches for ",D6(t),". It’s encrypted on disk and never leaves this machine."]}),o.jsxs("div",{className:Ne.segmented,role:"tablist","aria-label":"Signer source",children:[o.jsx("button",{type:"button",role:"tab","aria-selected":a==="create",className:`${Ne.segBtn} ${a==="create"?Ne.segActive:""}`,onClick:()=>c("create"),children:"Create new"}),o.jsx("button",{type:"button",role:"tab","aria-selected":a==="import",className:`${Ne.segBtn} ${a==="import"?Ne.segActive:""}`,onClick:()=>c("import"),children:"Import"})]}),a==="create"?o.jsx("p",{className:Ne.modeNote,children:"Generates a fresh random key. You’ll see the private key once, to back up."}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:Ne.segmented2,children:[o.jsx("button",{type:"button",className:`${Ne.segBtn} ${l==="privateKey"?Ne.segActive:""}`,onClick:()=>u("privateKey"),children:"Private key"}),o.jsx("button",{type:"button",className:`${Ne.segBtn} ${l==="mnemonic"?Ne.segActive:""}`,onClick:()=>u("mnemonic"),children:"Recovery phrase"})]}),o.jsxs("label",{className:Ne.field,children:[o.jsx("span",{className:Ne.fieldLabel,children:l==="privateKey"?"Private key":"Recovery phrase (12 or 24 words)"}),o.jsx("textarea",{className:Ne.input,rows:l==="privateKey"?2:3,placeholder:l==="privateKey"?"0x…":"word1 word2 word3 …",value:d,onChange:P=>p(P.target.value),autoComplete:"off",spellCheck:!1})]})]}),o.jsxs("label",{className:Ne.field,children:[o.jsx("span",{className:Ne.fieldLabel,children:"Encryption password"}),o.jsx("input",{className:Ne.input,type:"password",placeholder:"At least 8 characters",value:h,onChange:P=>m(P.target.value),autoComplete:"new-password"}),o.jsx("span",{className:Ne.fieldHint,children:"Encrypts the key on disk. You’ll enter it to run the agent (or set SAIL_PASSPHRASE)."})]}),b&&o.jsx("p",{className:Ne.error,children:b}),o.jsx(Ze,{fullWidth:!0,onClick:B,disabled:g,children:g?"Working…":a==="create"?"Generate signer":"Import signer"}),o.jsx("p",{className:Ne.fineprint,children:"Self-custody. The key is encrypted locally and never sent anywhere."})]})]})})}const O6=8,Rne=[{type:"function",name:"setManager",stateMutability:"nonpayable",inputs:[{name:"newManager",type:"address"}],outputs:[]}],Lne=[{type:"function",name:"execTransaction",stateMutability:"payable",inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"operation",type:"uint8"},{name:"safeTxGas",type:"uint256"},{name:"baseGas",type:"uint256"},{name:"gasPrice",type:"uint256"},{name:"gasToken",type:"address"},{name:"refundReceiver",type:"address"},{name:"signatures",type:"bytes"}],outputs:[{name:"success",type:"bool"}]}],F6=[{type:"function",name:"registerPermissions",stateMutability:"payable",inputs:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"signerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]}],Dne={RegisterPermissions:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]};function One(e){return AC(["bytes32","bytes32","uint8"],[br(e,{size:32}),br("0x",{size:32}),1])}async function z6(e){try{await fetch("/api/activity",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}function Fne({open:e,sma:t,kernel:n,chainId:r,owner:a,currentManager:c,mandates:l=[],initialTo:u=null,onClose:d,onRotated:p}){const{address:h,chainId:m}=dt(),g=Md({chainId:r}),{signTypedDataAsync:v}=ml(),{sendTransactionAsync:b}=Li(),{switchChainAsync:_}=Bs(),x=(l??[]).map(Ee=>typeof Ee=="string"?Ee:Ee==null?void 0:Ee.address).filter(Boolean),[j,A]=I.useState("confirm"),[k,N]=I.useState("create"),[E,B]=I.useState("privateKey"),[M,P]=I.useState(""),[R,z]=I.useState(""),[q,Q]=I.useState(!1),[O,K]=I.useState(""),[$,L]=I.useState(null),[se,D]=I.useState(!1),[X,te]=I.useState(null),[W,oe]=I.useState(null),[be,Y]=I.useState(null),[ue,xe]=I.useState(!1),[Re,Ae]=I.useState("");if(I.useEffect(()=>{if(!e)return;A("confirm"),N(u?"saved":"create"),B("privateKey"),P(""),z(""),Q(!1),K(""),L(null),D(!1),te(null),oe(null),Y(null),xe(!1),Ae(u??""),u&&$t(),document.body.style.overflow="hidden";const Ee=bt=>{bt.key==="Escape"&&!q&&j!=="rotating"&&j!=="reattaching"&&(d==null||d())};return window.addEventListener("keydown",Ee),()=>{window.removeEventListener("keydown",Ee),document.body.style.overflow=""}},[e]),!e)return null;const qe=a??h,Xe=h&&qe&&h.toLowerCase()!==qe.toLowerCase(),Tt=k==="create"?"generate":E,zt=k==="import";async function Qt(){if(K(""),R.length<O6){K(`Passphrase must be at least ${O6} characters.`);return}if(zt&&!M.trim()){K(E==="privateKey"?"Enter a private key.":"Enter your recovery phrase.");return}Q(!0);try{const Ee=await fetch("/api/signer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:Tt,secret:zt?M.trim():void 0,password:R})}),bt=await Ee.json();if(!Ee.ok)throw new Error((bt==null?void 0:bt.error)||"Failed to prepare the new agent wallet.");L(bt),P(""),z(""),A("backup")}catch(Ee){K((Ee==null?void 0:Ee.message)||"Failed to prepare the new agent wallet.")}finally{Q(!1)}}async function $t(){xe(!0),K("");try{const Ee=await fetch("/api/signers");if(!Ee.ok)throw new Error(Ee.status===404?"Saved-agent listing needs an updated Sailor UI — restart it (sailor ui stop && sailor ui).":`Could not list saved agents (HTTP ${Ee.status}).`);const bt=await Ee.json().catch(()=>null);Y(Array.isArray(bt==null?void 0:bt.signers)?bt.signers:[])}catch(Ee){Y([]),K((Ee==null?void 0:Ee.message)||"Could not list saved agents.")}finally{xe(!1)}}function yt(Ee){N(Ee),K(""),Ee==="saved"&&be===null&&!ue&&$t()}const dn=(be??[]).filter(Ee=>!c||Ee.address.toLowerCase()!==c.toLowerCase());function yn(){K("");const Ee=dn.find(bt=>bt.address.toLowerCase()===Re.toLowerCase());if(!Ee){K("Select a saved agent to rotate to.");return}L({address:Ee.address,revealed:null,fromSaved:!0}),A("backup")}function Or(){var Ee;$!=null&&$.revealed&&((Ee=navigator==null?void 0:navigator.clipboard)!=null&&Ee.writeText)&&(navigator.clipboard.writeText($.revealed),D(!0),setTimeout(()=>D(!1),1500))}async function Yt(Ee,bt=8){let En;for(let ls=0;ls<bt;ls++)try{return await g.waitForTransactionReceipt({hash:Ee})}catch(zn){En=zn,await new Promise(So=>setTimeout(So,1500))}throw En}async function Fn(){if(!h){K("Connect your owner wallet first.");return}if(!n||!t||!($!=null&&$.address)){K("Missing SMA, kernel, or new signer.");return}A("rotating"),K("");try{m!==r&&await _({chainId:r});const Ee=At({abi:Rne,functionName:"setManager",args:[$.address]}),bt=At({abi:Lne,functionName:"execTransaction",args:[n,0n,Ee,0,0n,0n,0n,Bt,Bt,One(qe)]}),En=await b({to:t,data:bt,chainId:r});te(En),await Yt(En),await z6({type:"signer_rotated",actor:"owner",sma:t,oldManager:c??null,newManager:$.address,txHash:En,chainId:r}),x.length>0?await Fr():await wa(En)}catch(Ee){K((Ee==null?void 0:Ee.shortMessage)||(Ee==null?void 0:Ee.message)||"Rotation transaction rejected."),A("backup")}}async function Fr(){A("reattaching"),K("");try{m!==r&&await _({chainId:r});const Ee=await g.readContract({address:n,abi:F6,functionName:"signerNonces",args:[t]}),bt=BigInt(Math.floor(Date.now()/1e3)+600),En=await v({domain:{name:"SailKernel",version:"1",chainId:r,verifyingContract:n},types:Dne,primaryType:"RegisterPermissions",message:{account:t,permissions:x,nonce:Ee,deadline:bt}}),ls=At({abi:F6,functionName:"registerPermissions",args:[t,x,bt,En]}),zn=await b({to:n,data:ls,chainId:r});oe(zn),await Yt(zn),await z6({type:"mandates_reattached",actor:"owner",sma:t,permissions:x,txHash:zn,chainId:r}),await wa(X)}catch(Ee){K(((Ee==null?void 0:Ee.shortMessage)||(Ee==null?void 0:Ee.message)||"Re-approval rejected.")+" The signer was rotated, but the mandates are not re-approved yet — reopen this to retry."),A("backup")}}async function wa(Ee){try{$!=null&&$.fromSaved&&await fetch("/api/signer/activate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:$.address})}),await fetch("/api/manager/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({newManager:$==null?void 0:$.address,txHash:Ee})})}catch{}A("done"),p==null||p()}const cs=j==="rotating"||j==="reattaching";return o.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-label":"Rotate agent keys",onClick:cs?void 0:d,children:o.jsxs(Kt,{className:Ie.card,onClick:Ee=>Ee.stopPropagation(),children:[!cs&&o.jsx("button",{type:"button",className:Ie.close,onClick:d,"aria-label":"Close",children:"×"}),j==="done"?o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:Ie.title,children:"Agent rotated"}),o.jsxs("p",{className:Ie.body,children:[o.jsx("strong",{children:$==null?void 0:$.address})," is now this SMA’s delegated signer.",x.length>0?` ${x.length} mandate(s) were re-approved and bound to it.`:" No mandates were attached, so none needed re-approval."]}),o.jsx("p",{className:Ie.body,children:"Fund the new agent wallet so it can pay gas for dispatches, then restart your agent."}),o.jsx("div",{className:Ie.actions,children:o.jsx(Ze,{onClick:d,children:"Done"})})]}):j==="backup"?o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:Ie.title,children:$!=null&&$.revealed?"Back up the new agent":"New agent ready"}),o.jsx("p",{className:Ie.body,children:$!=null&&$.revealed?"A fresh agent wallet was created and encrypted on disk. Save its private key now — it’s shown only once. Then rotate the SMA to it.":$!=null&&$.fromSaved?"This agent is already saved in this project. Rotate the SMA to it below — its keystore becomes this SMA’s active signer.":"Your agent wallet was imported and encrypted on disk. Rotate the SMA to it below."}),o.jsxs("div",{className:Ne.addrPanel,children:[o.jsx("span",{className:Ne.addrLabel,children:"New agent address"}),o.jsx("code",{className:Ne.addrValue,children:$==null?void 0:$.address})]}),($==null?void 0:$.revealed)&&o.jsxs("div",{className:Ne.revealPanel,children:[o.jsx("span",{className:Ne.revealLabel,children:"Private key — save it now, shown only once"}),o.jsx("code",{className:Ne.revealValue,children:$.revealed}),o.jsx("button",{type:"button",className:Ne.copyBtn,onClick:Or,children:se?"Copied ✓":"Copy"}),o.jsx("p",{className:Ne.revealNote,children:"Anyone with this key controls the signer. Store it in a password manager."})]}),x.length>0&&o.jsxs("p",{className:Ie.warn,children:["Rotating clears all ",x.length," attached mandate(s); you’ll re-approve them in your wallet right after, rebinding them to the new signer."]}),O&&o.jsx("p",{className:Ie.error,children:O}),!h&&o.jsx("p",{className:Ie.warn,children:"Connect your owner wallet to continue."}),Xe&&o.jsxs("p",{className:Ie.warn,children:["Connected wallet isn’t the SMA owner (",qe,"). Switch to it to authorize."]}),o.jsxs("div",{className:Ie.actions,children:[o.jsx("button",{type:"button",className:Ie.cancel,onClick:d,children:"Cancel"}),o.jsx(Ze,{onClick:Fn,disabled:!h,children:x.length>0?"Rotate & re-approve":"Rotate signer"})]})]}):cs?o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:Ie.title,children:j==="rotating"?"Rotating signer…":"Re-approving mandates…"}),o.jsx("p",{className:Ie.body,children:j==="rotating"?"Confirm the Safe transaction in your wallet to set the new delegated signer.":"Sign the re-approval and confirm the transaction to rebind your mandates."}),o.jsxs("dl",{className:Ie.meta,children:[X&&o.jsxs("div",{children:[o.jsx("dt",{children:"Rotation tx"}),o.jsx("dd",{children:X})]}),W&&o.jsxs("div",{children:[o.jsx("dt",{children:"Re-approval tx"}),o.jsx("dd",{children:W})]})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:Ie.title,children:"Rotate the agent keys?"}),o.jsx("p",{className:Ie.body,children:"Rotate this SMA to a new delegated signer (agent) — the recovery path when the current agent key is lost or compromised. Generate a fresh wallet, or import an existing one by private key or recovery phrase. Set a passphrase to encrypt it on disk."}),o.jsxs("dl",{className:Ie.meta,children:[o.jsxs("div",{children:[o.jsx("dt",{children:"SMA"}),o.jsx("dd",{children:t})]}),c&&o.jsxs("div",{children:[o.jsx("dt",{children:"Current agent"}),o.jsx("dd",{children:c})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Attached mandates"}),o.jsx("dd",{children:x.length})]})]}),o.jsxs("div",{className:Ne.segmented,role:"tablist","aria-label":"New agent source",children:[o.jsx("button",{type:"button",role:"tab","aria-selected":k==="create",className:`${Ne.segBtn} ${k==="create"?Ne.segActive:""}`,onClick:()=>yt("create"),children:"Create new"}),o.jsx("button",{type:"button",role:"tab","aria-selected":k==="import",className:`${Ne.segBtn} ${k==="import"?Ne.segActive:""}`,onClick:()=>yt("import"),children:"Import"}),o.jsx("button",{type:"button",role:"tab","aria-selected":k==="saved",className:`${Ne.segBtn} ${k==="saved"?Ne.segActive:""}`,onClick:()=>yt("saved"),children:"Use saved"})]}),k==="create"?o.jsx("p",{className:Ne.modeNote,children:"Generates a fresh random key. You’ll see the private key once, to back up."}):k==="saved"?o.jsx("div",{className:Ne.savedList,role:"radiogroup","aria-label":"Saved agents",children:ue?o.jsx("p",{className:Ne.modeNote,children:"Loading saved agents…"}):(be??[]).length===0?o.jsx("p",{className:Ne.modeNote,children:"No saved agents in this project. Create a new wallet or import one."}):o.jsxs(o.Fragment,{children:[dn.length===0&&o.jsx("p",{className:Ne.modeNote,children:"The only saved agent is this SMA’s current one. Create a new wallet or import one."}),(be??[]).map(Ee=>o.jsxs("label",{className:`${Ne.savedItem} ${Re.toLowerCase()===Ee.address.toLowerCase()?Ne.savedItemActive:""}`,"aria-disabled":Ee.active,children:[o.jsx("input",{type:"radio",name:"saved-manager",value:Ee.address,disabled:Ee.active,checked:Re.toLowerCase()===Ee.address.toLowerCase(),onChange:()=>Ae(Ee.address)}),o.jsx("code",{className:Ne.savedAddr,children:Ee.address}),Ee.active&&o.jsx("span",{className:Ne.savedBadge,children:"current"})]},Ee.address))]})}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:Ne.segmented2,children:[o.jsx("button",{type:"button",className:`${Ne.segBtn} ${E==="privateKey"?Ne.segActive:""}`,onClick:()=>B("privateKey"),children:"Private key"}),o.jsx("button",{type:"button",className:`${Ne.segBtn} ${E==="mnemonic"?Ne.segActive:""}`,onClick:()=>B("mnemonic"),children:"Recovery phrase"})]}),o.jsxs("label",{className:Ne.field,children:[o.jsx("span",{className:Ne.fieldLabel,children:E==="privateKey"?"Private key":"Recovery phrase (12 or 24 words)"}),o.jsx("textarea",{className:Ne.input,rows:E==="privateKey"?2:3,placeholder:E==="privateKey"?"0x…":"word1 word2 word3 …",value:M,onChange:Ee=>P(Ee.target.value),autoComplete:"off",spellCheck:!1})]})]}),k!=="saved"&&o.jsxs("label",{className:Ne.field,children:[o.jsx("span",{className:Ne.fieldLabel,children:"Encryption passphrase"}),o.jsx("input",{className:Ne.input,type:"password",placeholder:"At least 8 characters",value:R,onChange:Ee=>z(Ee.target.value),autoComplete:"new-password"}),o.jsx("span",{className:Ne.fieldHint,children:"Encrypts the key on disk. You’ll enter it to run the agent (or set SAIL_PASSPHRASE)."})]}),O&&o.jsx("p",{className:Ie.error,children:O}),o.jsxs("div",{className:Ie.actions,children:[o.jsx("button",{type:"button",className:Ie.cancel,onClick:d,children:"Cancel"}),k==="saved"?o.jsx(Ze,{onClick:yn,disabled:q||!Re,children:"Use this agent"}):o.jsx(Ze,{onClick:Qt,disabled:q,children:q?"Working…":k==="create"?"Generate new wallet":"Import wallet"})]})]})]})})}const $6=[{type:"function",name:"revokeSession",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"activateSession",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"signerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]}],zne=e=>({[e]:[{name:"account",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]});async function $ne(e){try{await fetch("/api/activity",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}function Hne({open:e,mode:t,sma:n,kernel:r,chainId:a,onClose:c,onDone:l}){const{address:u,chainId:d}=dt(),p=Md({chainId:a}),{signTypedDataAsync:h}=ml(),{sendTransactionAsync:m}=Li(),{switchChainAsync:g}=Bs(),v=t==="pause",b=v?"RevokeSession":"ActivateSession",_=v?"revokeSession":"activateSession",[x,j]=I.useState("confirm"),[A,k]=I.useState(""),[N,E]=I.useState(null),{isSuccess:B}=Vk({hash:N});if(I.useEffect(()=>{if(!e)return;j("confirm"),k(""),E(null),document.body.style.overflow="hidden";const P=R=>{R.key==="Escape"&&x!=="pending"&&(c==null||c())};return window.addEventListener("keydown",P),()=>{window.removeEventListener("keydown",P),document.body.style.overflow=""}},[e]),I.useEffect(()=>{!B||!N||x==="done"||(j("done"),$ne({type:v?"session_paused":"session_resumed",actor:"owner",sma:n,txHash:N,chainId:a}).then(()=>l==null?void 0:l()))},[B,N]),!e)return null;async function M(){if(!u){k("Connect your owner wallet first.");return}if(!r||!n){k("Missing SMA or kernel address.");return}j("pending"),k("");try{d!==a&&await g({chainId:a});const P=await p.readContract({address:r,abi:$6,functionName:"signerNonces",args:[n]}),R=BigInt(Math.floor(Date.now()/1e3)+600),z=await h({domain:{name:"SailKernel",version:"1",chainId:a,verifyingContract:r},types:zne(b),primaryType:b,message:{account:n,nonce:P,deadline:R}}),q=At({abi:$6,functionName:_,args:[n,R,z]}),Q=await m({to:r,data:q,chainId:a});E(Q)}catch(P){k((P==null?void 0:P.shortMessage)||(P==null?void 0:P.message)||"Transaction rejected."),j("confirm")}}return o.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-label":v?"Pause SMA":"Resume SMA",onClick:x==="pending"?void 0:c,children:o.jsxs(Kt,{className:Ie.card,onClick:P=>P.stopPropagation(),children:[x!=="pending"&&o.jsx("button",{type:"button",className:Ie.close,onClick:c,"aria-label":"Close",children:"×"}),x==="done"?o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:Ie.title,children:v?"Your SMA is paused":"Your SMA is back online"}),o.jsx("p",{className:Ie.body,children:v?o.jsxs(o.Fragment,{children:["It’s ",o.jsx("strong",{children:"on hold"})," and can’t make any moves until you resume. Your permissions and funds are untouched — resume anytime, no re-setup needed. (Saved to Recent Activity.)"]}):o.jsxs(o.Fragment,{children:["It can ",o.jsx("strong",{children:"act again"})," within the permissions you’ve set. (Saved to Recent Activity.)"]})}),o.jsx("div",{className:Ie.actions,children:o.jsx(Ze,{onClick:c,children:"Done"})})]}):o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:Ie.title,children:v?"Pause this SMA?":"Resume this SMA?"}),o.jsx("p",{className:Ie.body,children:v?o.jsxs(o.Fragment,{children:["This puts your SMA ",o.jsx("strong",{children:"on hold right away"})," — it won’t be able to make any moves until you resume. Nothing else changes: the permissions you set stay in place, and your funds stay safe in your account."]}):o.jsxs(o.Fragment,{children:["This brings your SMA ",o.jsx("strong",{children:"back online"})," — it can act again within the permissions you’ve set."]})}),o.jsxs("ul",{className:Ie.confirmList,children:[o.jsx("li",{className:Ie.confirmItem,children:"Anything your SMA already had lined up to send stops working — you’re starting from a clean slate."}),o.jsx("li",{className:Ie.confirmItem,children:v?"Reversible anytime — resuming is instant, with no re-setup or re-signing.":"You can pause again whenever you like."}),o.jsx("li",{className:Ie.confirmItem,children:"You’ll approve this in your wallet — a quick signature plus one transaction."})]}),o.jsxs("details",{className:Ie.tech,children:[o.jsx("summary",{className:Ie.techSummary,children:"What happens on-chain"}),o.jsxs("div",{className:Ie.techBody,children:[o.jsxs("p",{children:["Your wallet signs an EIP-712 ",o.jsx("code",{children:b})," message, then submits"," ",o.jsxs("code",{children:[_,"(account, deadline, sig)"]})," to the SailKernel. The kernel verifies the signature against the account’s ",o.jsx("strong",{children:"permission signer"}),"."]}),o.jsxs("p",{children:["It flips the account’s ",o.jsx("code",{children:"sessionActive"})," flag — the kernel checks this on"," ",o.jsx("em",{children:"every"})," dispatch, so ",v?"all manager dispatch is blocked":"manager dispatch is allowed again","."]}),o.jsxs("p",{children:["It also advances the account’s signer and manager/batch ",o.jsx("strong",{children:"nonce epochs"}),", which is what invalidates anything pre-signed under the old epoch (the “clean slate” above). Your registered permissions and the SMA’s custody of funds are untouched."]})]})]}),o.jsx("dl",{className:Ie.meta,children:o.jsxs("div",{children:[o.jsx("dt",{children:"SMA"}),o.jsx("dd",{children:n})]})}),A&&o.jsx("p",{className:Ie.error,children:A}),!u&&o.jsx("p",{className:Ie.warn,children:"Connect your owner wallet to continue."}),o.jsxs("div",{className:Ie.actions,children:[o.jsx("button",{type:"button",className:Ie.cancel,onClick:c,disabled:x==="pending",children:"Cancel"}),o.jsx(Ze,{onClick:M,disabled:x==="pending"||!u,children:x==="pending"?"Awaiting wallet…":v?"Pause SMA":"Resume SMA"})]})]})]})})}const Une="_overlay_1rcxh_1",Wne="_card_1rcxh_16",Vne="_close_1rcxh_28",Gne="_body_1rcxh_45",qne="_kicker_1rcxh_51",Kne="_headline_1rcxh_59",Qne="_sub_1rcxh_68",Yne="_addrBlock_1rcxh_75",Jne="_addrRow_1rcxh_84",Xne="_addrDivider_1rcxh_92",Zne="_addrLabel_1rcxh_97",ere="_addrValue_1rcxh_106",tre="_addrValueFull_1rcxh_112",nre="_field_1rcxh_121",rre="_fieldLabel_1rcxh_127",sre="_amountWrap_1rcxh_133",are="_amountInput_1rcxh_144",ore="_amountUnit_1rcxh_155",ire="_error_1rcxh_162",_t={overlay:Une,card:Wne,close:Vne,body:Gne,kicker:qne,headline:Kne,sub:Qne,addrBlock:Yne,addrRow:Jne,addrDivider:Xne,addrLabel:Zne,addrValue:ere,addrValueFull:tre,field:nre,fieldLabel:rre,amountWrap:sre,amountInput:are,amountUnit:ore,error:ire};function H6(e){return e?`${e.slice(0,6)}…${e.slice(-4)}`:"—"}function cre({open:e,onClose:t,signer:n,network:r,chainId:a}){const[c,l]=I.useState("0.01"),[u,d]=I.useState(!1),[p,h]=I.useState(""),[m,g]=I.useState(!1),{address:v,chainId:b}=dt(),{sendTransactionAsync:_}=Li(),{switchChainAsync:x}=Bs(),j=v&&(n==null?void 0:n.address)&&v.toLowerCase()===n.address.toLowerCase();if(I.useEffect(()=>{if(!e)return;l("0.01"),d(!1),h(""),g(!1),document.body.style.overflow="hidden";const B=M=>{M.key==="Escape"&&!u&&(t==null||t())};return window.addEventListener("keydown",B),()=>{window.removeEventListener("keydown",B),document.body.style.overflow=""}},[e]),!e)return null;const A=c&&/^\d+(\.\d+)?$/.test(c)&&Number(c)>0,k=r?r.charAt(0).toUpperCase()+r.slice(1):null;function N(){var B;(B=navigator==null?void 0:navigator.clipboard)!=null&&B.writeText&&navigator.clipboard.writeText(n.address),g(!0),setTimeout(()=>g(!1),1500)}async function E(){if(A){d(!0),h("");try{a&&b!==a&&await x({chainId:a}),await _({to:n.address,value:JI(c),...a?{chainId:a}:{}}),t==null||t()}catch(B){const M=(B==null?void 0:B.shortMessage)??(B==null?void 0:B.message)??"Transaction rejected.";h(M)}finally{d(!1)}}}return o.jsx("div",{className:_t.overlay,role:"dialog","aria-modal":"true","aria-label":"Fund gas",onClick:u?void 0:t,children:o.jsxs(Kt,{className:_t.card,onClick:B=>B.stopPropagation(),children:[!u&&o.jsx("button",{type:"button",className:_t.close,onClick:t,"aria-label":"Close",children:"×"}),o.jsxs("section",{className:_t.body,children:[o.jsx("span",{className:_t.kicker,children:"FUND GAS"}),j?o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:_t.headline,children:"Send ETH to this address."}),o.jsxs("p",{className:_t.sub,children:["This is your connected wallet — you can't send to yourself. Transfer ETH here from an exchange or another wallet",k?` on ${k}`:"","."]}),o.jsx("div",{className:_t.addrBlock,children:o.jsx("div",{className:_t.addrRow,children:o.jsx("code",{className:_t.addrValueFull,children:n.address})})}),o.jsx(Ze,{fullWidth:!0,onClick:N,children:m?"Copied ✓":"Copy address"})]}):o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:_t.headline,children:"Top up agent wallet."}),o.jsxs("p",{className:_t.sub,children:["The agent signs transactions with its local wallet and pays gas from it. Send ETH from your connected wallet to keep it running.",k&&` The transfer happens on ${k}.`]}),o.jsxs("div",{className:_t.addrBlock,children:[o.jsxs("div",{className:_t.addrRow,children:[o.jsx("span",{className:_t.addrLabel,children:"From"}),o.jsx("code",{className:_t.addrValue,children:v?H6(v):"no wallet connected"})]}),o.jsx("div",{className:_t.addrDivider,"aria-hidden":!0}),o.jsxs("div",{className:_t.addrRow,children:[o.jsx("span",{className:_t.addrLabel,children:"To · agent wallet"}),o.jsx("code",{className:_t.addrValue,children:H6(n.address)})]})]}),o.jsxs("label",{className:_t.field,children:[o.jsx("span",{className:_t.fieldLabel,children:"Amount"}),o.jsxs("div",{className:_t.amountWrap,children:[o.jsx("input",{type:"text",inputMode:"decimal",className:_t.amountInput,value:c,autoFocus:!0,onChange:B=>l(B.target.value)}),o.jsx("span",{className:_t.amountUnit,children:"ETH"})]})]}),p&&o.jsx("p",{className:_t.error,children:p}),o.jsx(Ze,{fullWidth:!0,onClick:E,disabled:u||!A,children:u?"Check wallet…":"Send"})]})]})]})})}const lre="_section_w0aoa_5",ure="_head_w0aoa_11",dre="_eyebrow_w0aoa_17",fre="_loading_w0aoa_25",hre="_health_w0aoa_32",pre="_healthDot_w0aoa_38",mre="_healthOk_w0aoa_39",gre="_healthWarn_w0aoa_41",yre="_chainList_w0aoa_45",vre="_chainCard_w0aoa_50",bre="_chainCardActive_w0aoa_59",wre="_chainCardHead_w0aoa_63",_re="_chainMeta_w0aoa_70",xre="_chainName_w0aoa_76",Cre="_chainTag_w0aoa_85",kre="_chainTagActive_w0aoa_91",jre="_chainEndpoint_w0aoa_98",Sre="_chainEndpointMissing_w0aoa_107",Are="_edit_w0aoa_111",Ere="_editBtn_w0aoa_165",Nre="_listLabel_w0aoa_200",Mre="_optionList_w0aoa_234",Ire="_optionRow_w0aoa_242",Bre="_optionRowActive_w0aoa_265",Tre="_optionBody_w0aoa_293",Pre="_optionNameRow_w0aoa_294",Rre="_optionName_w0aoa_294",Lre="_optionTag_w0aoa_302",Dre="_optionTagMuted_w0aoa_308",Ore="_optionSub_w0aoa_314",Fre="_optionRadio_w0aoa_320",zre="_optionRadioOn_w0aoa_327",$re="_fieldBlock_w0aoa_340",Hre="_fieldLabel_w0aoa_341",Ure="_field_w0aoa_340",Wre="_fieldIcon_w0aoa_355",Vre="_fieldInput_w0aoa_356",Gre="_fieldOk_w0aoa_362",qre="_fieldNote_w0aoa_363",Kre="_howBlock_w0aoa_371",Qre="_howTrigger_w0aoa_372",Yre="_howTriggerIcon_w0aoa_381",Jre="_howTriggerText_w0aoa_382",Xre="_howChevron_w0aoa_388",Zre="_howChevronOpen_w0aoa_392",ese="_howPanel_w0aoa_393",tse="_howPanelOpen_w0aoa_394",nse="_howPanelInner_w0aoa_395",rse="_howSteps_w0aoa_403",sse="_howStepNum_w0aoa_405",ase="_howStepText_w0aoa_410",ose="_howLink_w0aoa_411",ise="_editActions_w0aoa_423",cse="_cancelBtn_w0aoa_428",lse="_saveBtn_w0aoa_440",De={section:lre,head:ure,eyebrow:dre,loading:fre,health:hre,healthDot:pre,healthOk:mre,healthWarn:gre,chainList:yre,chainCard:vre,chainCardActive:bre,chainCardHead:wre,chainMeta:_re,chainName:xre,chainTag:Cre,chainTagActive:kre,chainEndpoint:jre,chainEndpointMissing:Sre,edit:Are,editBtn:Ere,listLabel:Nre,optionList:Mre,optionRow:Ire,optionRowActive:Bre,optionBody:Tre,optionNameRow:Pre,optionName:Rre,optionTag:Lre,optionTagMuted:Dre,optionSub:Ore,optionRadio:Fre,optionRadioOn:zre,fieldBlock:$re,fieldLabel:Hre,field:Ure,fieldIcon:Wre,fieldInput:Vre,fieldOk:Gre,fieldNote:qre,howBlock:Kre,howTrigger:Qre,howTriggerIcon:Yre,howTriggerText:Jre,howChevron:Xre,howChevronOpen:Zre,howPanel:ese,howPanelOpen:tse,howPanelInner:nse,howSteps:rse,howStepNum:sse,howStepText:ase,howLink:ose,editActions:ise,cancelBtn:cse,saveBtn:lse};async function use(){const e=await fetch("/api/onboard/state");if(!e.ok)throw new Error(`onboard/state ${e.status}`);return e.json()}async function dse({rpcUrl:e,chainId:t}){const n=await fetch("/api/onboard/save-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rpcUrl:e,chainId:t})});if(!n.ok)throw new Error(`save-config ${n.status}`);return n.json()}const fse="An RPC is the connection your dashboard uses to read the blockchain and broadcast transactions — like a phone line to the network. Sail talks to the chain directly through it; there's no Sail server in between. A free Alchemy/Infura key (or a public endpoint) works.",hse=[{id:1,name:"Ethereum",kind:"mainnet"},{id:8453,name:"Base",kind:"mainnet"},{id:42161,name:"Arbitrum",kind:"mainnet"},{id:130,name:"Unichain",kind:"mainnet"},{id:10,name:"Optimism",kind:"mainnet"},{id:56,name:"BNB",kind:"mainnet"},{id:480,name:"World",kind:"mainnet"},{id:999,name:"HyperEVM",kind:"mainnet"},{id:4326,name:"MegaETH",kind:"mainnet"},{id:84532,name:"Base Sepolia",kind:"testnet"},{id:11155111,name:"Eth Sepolia",kind:"testnet"}],U6=[{id:"alchemy",name:"Alchemy",tag:"Recommended",needsKey:!0,desc:"Free tier, reliable for automation. The Sailor default.",keyHint:"Paste your Alchemy API key",url:"https://dashboard.alchemy.com/apps",urlLabel:"Open Alchemy dashboard",steps:["Create a free account at alchemy.com.",'Click "Create new app" and pick this network.',"Open the app and copy the API key from the top of the page.","Paste it above — one key works across every network."]},{id:"infura",name:"Infura",needsKey:!0,desc:"Free tier. A solid alternative to Alchemy.",keyHint:"Paste your Infura project key",url:"https://app.infura.io/dashboard",urlLabel:"Open Infura dashboard",steps:["Sign up free at infura.io.",'Open "API Keys" and click "Create new API key".',"Under Endpoints, enable this network.","Copy the key and paste it above."]},{id:"custom",name:"Custom / Public",needsKey:!1,desc:"Paste any RPC URL — a public endpoint, your own node, or a private provider."}],pse={1:"eth-mainnet.g.alchemy.com",8453:"base-mainnet.g.alchemy.com",42161:"arb-mainnet.g.alchemy.com",10:"opt-mainnet.g.alchemy.com",130:"unichain-mainnet.g.alchemy.com",84532:"base-sepolia.g.alchemy.com",11155111:"eth-sepolia.g.alchemy.com",56:"bnb-mainnet.g.alchemy.com",480:"worldchain-mainnet.g.alchemy.com"},mse={1:"mainnet.infura.io",8453:"base-mainnet.infura.io",42161:"arbitrum-mainnet.infura.io",10:"optimism-mainnet.infura.io",130:"unichain-mainnet.infura.io",84532:"base-sepolia.infura.io",11155111:"sepolia.infura.io",56:"bsc-mainnet.infura.io"},Y1={1:"https://eth.llamarpc.com",8453:"https://mainnet.base.org",42161:"https://arb1.arbitrum.io/rpc",10:"https://mainnet.optimism.io",130:"https://mainnet.unichain.org",84532:"https://sepolia.base.org",56:"https://bsc-dataseed.binance.org",480:"https://worldchain-mainnet.g.alchemy.com/public",999:"https://rpc.hyperliquid.xyz/evm",4326:"https://carrot.megaeth.com/rpc"};function J1(e,t,n){if(e==="infura"){const r=mse[t];return r?`https://${r}/v3/${n}`:""}if(e==="alchemy"){const r=pse[t];return r?`https://${r}/v2/${n}`:""}return n}function W6(e){return!e||/alchemy\.com/i.test(e)?"alchemy":/infura\.io/i.test(e)?"infura":"custom"}function gse(e){if(!e)return"";const t=e.match(/^(https?:\/\/[^/]+)(\/.*\/)([^/]+)$/);if(!t)return e;const[,n,r,a]=t,c=a.length>6?`${a.slice(0,4)}••••`:"••••";return`${n}${r}${c}`}function yse({chainId:e,rpcUrl:t,isActive:n,onSaved:r}){const a=hse.find(R=>R.id===e),[c,l]=I.useState(!1),[u,d]=I.useState("alchemy"),[p,h]=I.useState(""),[m,g]=I.useState(""),[v,b]=I.useState(!1),[_,x]=I.useState(!1),[j,A]=I.useState(!1);function k(){const R=W6(t);d(R),h(""),g(R==="custom"?t??"":Y1[e]??""),b(!1),l(!0)}async function N(){let R;u==="custom"?R=m.trim():u==="alchemy"&&p.trim()?R=J1("alchemy",e,p.trim()):u==="infura"&&p.trim()?R=J1("infura",e,p.trim()):R=t,R&&(x(!0),await dse({rpcUrl:R,chainId:e}),x(!1),A(!0),setTimeout(()=>A(!1),1600),l(!1),r==null||r())}const E=U6.find(R=>R.id===u),B=(E==null?void 0:E.needsKey)??!1,M=(u==="alchemy"||u==="infura")&&!J1(u,e,"x"),P=u==="custom"?m.trim().startsWith("http"):M?!1:!B||p.trim().length>=12||!!t;return o.jsxs("div",{className:`${De.chainCard} ${n?De.chainCardActive:""}`,children:[o.jsxs("div",{className:De.chainCardHead,children:[o.jsxs("div",{className:De.chainMeta,children:[o.jsxs("span",{className:De.chainName,children:[o.jsx(Co,{chainId:e,size:16}),(a==null?void 0:a.name)??`Chain ${e}`,(a==null?void 0:a.kind)==="testnet"&&o.jsx("span",{className:De.chainTag,children:"testnet"}),n&&o.jsx("span",{className:De.chainTagActive,children:"active"})]}),!c&&o.jsx("span",{className:De.chainEndpoint,children:t?gse(t):o.jsx("span",{className:De.chainEndpointMissing,children:"Not configured"})})]}),!c&&o.jsx("button",{type:"button",className:De.editBtn,onClick:k,children:j?"Saved ✓":t?"Edit":"Add"})]}),c&&o.jsxs("div",{className:De.edit,children:[o.jsx("span",{className:De.listLabel,children:"Provider"}),o.jsx("ul",{className:De.optionList,children:U6.map(R=>{const z=u===R.id;return o.jsx("li",{children:o.jsxs("button",{type:"button",className:`${De.optionRow} ${z?De.optionRowActive:""}`,onClick:()=>{d(R.id),R.id==="custom"&&g(t??Y1[e]??"")},"aria-pressed":z,children:[o.jsxs("span",{className:De.optionBody,children:[o.jsxs("span",{className:De.optionNameRow,children:[o.jsx("span",{className:De.optionName,children:R.name}),R.tag&&o.jsx("span",{className:De.optionTag,children:R.tag}),!R.needsKey&&o.jsx("span",{className:De.optionTagMuted,children:"URL"})]}),o.jsx("span",{className:De.optionSub,children:R.desc})]}),o.jsx("span",{className:`${De.optionRadio} ${z?De.optionRadioOn:""}`,"aria-hidden":!0})]})},R.id)})}),M&&o.jsxs("p",{className:De.fieldNote,children:[E==null?void 0:E.name," doesn’t serve ",(a==null?void 0:a.name)??`chain ${e}`,". Use the Public endpoint or a Custom URL instead."]}),B&&o.jsxs("div",{className:De.fieldBlock,children:[o.jsxs("label",{className:De.fieldLabel,htmlFor:`rpc-key-${e}`,children:[E.name," API key"]}),o.jsxs("div",{className:De.field,children:[o.jsx("span",{className:De.fieldIcon,"aria-hidden":!0,children:o.jsx(bse,{})}),o.jsx("input",{id:`rpc-key-${e}`,type:"text",className:De.fieldInput,placeholder:t&&W6(t)===u?"•••••••••• (keep current)":E.keyHint,value:p,spellCheck:!1,autoComplete:"off",onChange:R=>h(R.target.value)}),p.trim().length>=12&&o.jsx("span",{className:De.fieldOk,"aria-hidden":!0,children:o.jsx(V6,{})})]}),o.jsxs("p",{className:De.fieldNote,children:["Stored in ",o.jsx("code",{children:".sail/.env.local"}),". Never sent to Sail."]}),o.jsxs("div",{className:De.howBlock,children:[o.jsxs("button",{type:"button",className:De.howTrigger,onClick:()=>b(R=>!R),"aria-expanded":v,children:[o.jsx("span",{className:De.howTriggerIcon,"aria-hidden":!0,children:o.jsx(_se,{})}),o.jsxs("span",{className:De.howTriggerText,children:["Where do I find my ",E.name," key?"]}),o.jsx("span",{className:`${De.howChevron} ${v?De.howChevronOpen:""}`,"aria-hidden":!0,children:o.jsx(xse,{})})]}),o.jsx("div",{className:`${De.howPanel} ${v?De.howPanelOpen:""}`,"aria-hidden":!v,children:o.jsxs("div",{className:De.howPanelInner,children:[o.jsx("ol",{className:De.howSteps,children:E.steps.map((R,z)=>o.jsxs("li",{children:[o.jsx("span",{className:De.howStepNum,children:String(z+1).padStart(2,"0")}),o.jsx("span",{className:De.howStepText,children:R})]},z))}),o.jsxs("a",{className:De.howLink,href:E.url,target:"_blank",rel:"noreferrer",children:[E.urlLabel,o.jsx(Cse,{})]})]})})]})]}),!B&&o.jsxs("div",{className:De.fieldBlock,children:[o.jsx("label",{className:De.fieldLabel,htmlFor:`rpc-url-${e}`,children:"RPC URL"}),o.jsxs("div",{className:De.field,children:[o.jsx("span",{className:De.fieldIcon,"aria-hidden":!0,children:o.jsx(wse,{})}),o.jsx("input",{id:`rpc-url-${e}`,type:"text",className:De.fieldInput,placeholder:Y1[e]??"https://your-rpc-endpoint",value:m,spellCheck:!1,autoComplete:"off",onChange:R=>g(R.target.value)}),m.trim().startsWith("http")&&o.jsx("span",{className:De.fieldOk,"aria-hidden":!0,children:o.jsx(V6,{})})]}),o.jsxs("p",{className:De.fieldNote,children:["Stored in ",o.jsx("code",{children:".sail/.env.local"})," as ",o.jsxs("code",{children:["RPC_URL_",e]}),"."]})]}),o.jsxs("div",{className:De.editActions,children:[o.jsx("button",{type:"button",className:De.cancelBtn,onClick:()=>l(!1),disabled:_,children:"Cancel"}),o.jsx("button",{type:"button",className:De.saveBtn,onClick:N,disabled:_||!P,children:_?"Saving…":"Save"})]})]})]})}function vse({deployedChains:e,embedded:t=!1}){const[n,r]=I.useState(null);function a(){use().then(r).catch(()=>{})}if(I.useEffect(()=>{a()},[]),!n)return o.jsxs("div",{className:De.section,children:[o.jsx("span",{className:De.eyebrow,children:"RPC /"}),o.jsx("span",{className:De.loading,children:"Reading configuration…"})]});const c=n.rpcByChain??{},l=n.chainId??8453,u=e&&e.length>0?e:[l],d=u.filter(p=>c[p]).length;return o.jsxs("div",{className:De.section,children:[!t&&o.jsxs("div",{className:De.head,children:[o.jsxs("span",{className:De.eyebrow,children:["RPC / ",o.jsx(bi,{label:"What is an RPC?",children:fse})]}),o.jsxs("span",{className:`${De.health} ${d>0?De.healthOk:De.healthWarn}`,children:[o.jsx("span",{className:De.healthDot,"aria-hidden":!0}),d>0?`${d} network${d>1?"s":""} configured`:"No networks configured"]})]}),o.jsx("div",{className:De.chainList,children:u.map(p=>o.jsx(yse,{chainId:p,rpcUrl:c[p]??null,isActive:!!c[p],onSaved:a},p))})]})}function bse(){return o.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("circle",{cx:"5.5",cy:"5.5",r:"3"}),o.jsx("path",{d:"M7.6 7.6l5 5M11 11l1.4-1.4M9.4 9.4l1.4-1.4"})]})}function wse(){return o.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M6.5 9.5a3.5 3.5 0 0 0 5 0l1.5-1.5a3.5 3.5 0 0 0-5-5L7.5 3.5"}),o.jsx("path",{d:"M9.5 6.5a3.5 3.5 0 0 0-5 0L3 8a3.5 3.5 0 0 0 5 5l.5-.5"})]})}function V6(){return o.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4"})})}function _se(){return o.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.4","aria-hidden":!0,children:[o.jsx("circle",{cx:"8",cy:"8",r:"6"}),o.jsx("path",{d:"M8 7.2v3.4",strokeLinecap:"round"}),o.jsx("circle",{cx:"8",cy:"5.2",r:"0.8",fill:"currentColor",stroke:"none"})]})}function xse(){return o.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M3 5l4 4 4-4"})})}function Cse(){return o.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M5 9 L9 5"}),o.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}const kse={ethereum:"eth",arbitrum:"arb1",base:"base",unichain:"unichain",optimism:"oeth",polygon:"matic",binance:"bnb"},Nc={1:"ethereum",42161:"arbitrum",8453:"base",130:"unichain",10:"optimism",137:"polygon",56:"binance",480:"world",999:"hyperevm",6342:"megaeth",84532:"base sepolia"},jse={56:"BNB",480:"World",999:"HyperEVM",6342:"MegaETH"};function Mi(e){return jse[e]??Nc[e]}function Sse(e,t){return`https://app.safe.global/home?safe=${kse[e]??"eth"}:${t}`}function e2(e,t){return Xv(e,t)??`https://etherscan.io/address/${t}`}function Ase(e,t){return Rd(e,t)??`${e2(e,t)}#code`}function rs(e){return!e||e.length<12?e??"":`${e.slice(0,6)}…${e.slice(-4)}`}function Xj(e){return e?`${e.slice(0,10)}...${e.slice(-7)}`:""}const Ese={SharedBoundedSwapPermission:e=>[`Maximum swap size: $${Number(e.maxSwapValueUsd??0).toLocaleString()} USD per transaction`,`Maximum slippage: ${Number(e.maxSlippageBps??0)/100}%`,`Allowed input tokens: ${(e.allowedInputTokens??[]).join(", ")}`,`Allowed output tokens: ${(e.allowedOutputTokens??[]).join(", ")}`,`Allowed protocols: ${(e.allowedProtocols??[]).join(", ")}`],SharedTransferTargetPermission:e=>[`ERC-20 transfers restricted to ${(e.allowedRecipients??[]).length} approved recipient(s)`,`Applies to: ${(e.allowedTokens??[]).length===0?"all tokens":(e.allowedTokens??[]).join(", ")}`,`Approved recipients: ${(e.allowedRecipients??[]).join(", ")}`]};function Nse(e){const t=Ese[e==null?void 0:e.template];if(!t)return[];try{return t(e.params??{})}catch{return[]}}function Zj(e){try{const t=new Date(e),n=t.toLocaleDateString([],{month:"short",day:"numeric"}),r=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return`${n}, ${r}`}catch{return e??""}}const Mse={"create-sma":"Create Safe (SMA)","deploy-mandate":"Deploy mandate","register-permission":"Register permission","attach-mandate":"Attach mandate","set-delegate":"Set agent as manager","arbitrary-tx":"Arbitrary transaction"},Ise={1:"Ethereum",10:"Optimism",137:"Polygon",8453:"Base",42161:"Arbitrum One",130:"Unichain",84532:"Base Sepolia"},Bse={dispatch_executed:"executed dispatch",dispatch_approved:"approved dispatch",dispatch_denied:"denied dispatch",tick_start:"tick started",tick_end:"tick ended",error:"error",log:"log",permission_registered:"registered permission",permission_revoked:"revoked permission",owner_signed:"signed in wallet",owner_rejected:"rejected signing",sma_created:"created Safe (SMA)",mandate_deployed:"deployed mandate",mandate_attached:"attached mandate"},Tse=new Set(["dispatch_executed","dispatch_approved","owner_signed","sma_created","mandate_deployed","mandate_attached","permission_registered"]),Pse=new Set(["dispatch_denied","error","owner_rejected","permission_revoked"]);function Rse(e){return Tse.has(e)?"success":Pse.has(e)?"rejected":"info"}function G6(e){return e.actor==="owner"?"owner":"agent"}const Lse={owner:"Owner",agent:"Agent"};function Dse(e){if(e.type==="owner_signed"||e.type==="owner_rejected")return e.title??e.reason??e.kind??"";if(e.type==="sma_created")return rs(e.sma);if(e.type==="mandate_deployed"||e.type==="mandate_attached")return e.name??rs(e.address??e.permission);if(e.type==="permission_registered"||e.type==="permission_revoked"){const t=e.name??rs(e.permission);return e.type==="permission_registered"&&e.feeEth?`${t} · fee ${e.feeEth} ETH`:t}return e.permission?rs(e.permission):e.reason??e.msg??""}function Ose(e){const t=Number(e??0);return Number.isFinite(t)?t===0?"0":t<1e-4?t.toFixed(6):t.toFixed(t<1?5:4):"—"}const q6={ok:{label:"Funded"},low:{label:"Low gas balance"},critical:{label:"Empty"}},Fse={manager:{label:"Agent",gasReason:"Spends gas to submit every dispatch — keep it well funded."},owner:{label:"Owner",gasReason:"Only spends gas to deploy your SMA and register permissions."},permissionSigner:{label:"Permission signer"}};function zse(e,t,n){var a;const r=new Map;for(const c of t??[])for(const l of c.permissions??[]){const u=(a=l.address??(n==null?void 0:n.get(l.template)))==null?void 0:a.toLowerCase();u&&r.set(u,l)}return(e??[]).length>0?e.map(c=>{var u;const l=r.get((u=c.address)==null?void 0:u.toLowerCase());return{template:c.name??c.template??"Unknown permission",address:c.address,params:l==null?void 0:l.params,explanation:l==null?void 0:l.explanation}}):(t??[]).flatMap(c=>c.permissions??[])}function $se({overview:e,sma:t,onAddSigner:n,onRotateSigner:r}){var b,_;const{address:a}=dt(),c=(e==null?void 0:e.signers)??[],l=((_=(b=e==null?void 0:e.sma)==null?void 0:b.owner)==null?void 0:_.toLowerCase())??null;let u=!1,d=!1;const p=c.flatMap(x=>{var j,A;if(x.role==="manager"&&((j=x.managers)==null?void 0:j.length)>0){let k=x.managers;x.address&&!k.some(E=>{var B;return((B=E.address)==null?void 0:B.toLowerCase())===x.address.toLowerCase()})&&(k=[{address:x.address,balanceEth:x.balanceEth,isActive:!0},...k]);const N=[];for(const E of k){if(l&&((A=E.address)==null?void 0:A.toLowerCase())===l){u=!0,E.isActive&&(d=!0);continue}N.push({...x,address:E.address,balanceEth:E.balanceEth,status:E.isActive?x.status:"idle",managers:void 0,activeManager:E.isActive})}return N}return x.role==="manager"&&x.address&&l&&x.address.toLowerCase()===l?(u=!0,["local","unconfigured","idle"].includes(x.status)||(d=!0),[]):[x]}),h=p.findIndex(x=>x.role==="owner");if(h!==-1)p[h]={...p[h],isManager:u,managerActive:d};else if(u&&l){const x=c.find(j=>j.role==="manager");p.push({role:"owner",address:e.sma.owner,balanceEth:(x==null?void 0:x.balanceEth)??null,status:x==null?void 0:x.status,isManager:!0,managerActive:d})}const m=!!(e!=null&&e.rpcConfigured)&&!(e!=null&&e.onchain);let g=p;m&&a&&!g.some(x=>{var j;return((j=x.address)==null?void 0:j.toLowerCase())===a.toLowerCase()})&&(g=[...g,{role:"owner",address:a,balanceEth:null,status:void 0}]);const v={owner:0,manager:1,permissionSigner:2};return g=[...g].sort((x,j)=>(v[x.role]??9)-(v[j.role]??9)),g.length===0?o.jsxs("div",{className:F.signersOffline,children:[o.jsx("p",{className:F.signersOfflineMsg,children:(e==null?void 0:e.rpcConfigured)===!1||e!=null&&e.onchainError?"Add RPC_URL to .sail/.env.local to see balances.":"Reading balances…"}),t&&o.jsx(Ze,{variant:"secondary",onClick:n,children:"Add agent wallet"})]}):o.jsx("div",{className:F.signerGrid,children:g.map(x=>o.jsx(Wse,{signer:x,network:e.network,chainId:e.chainId,loading:m,onAddSigner:n,onRotateSigner:r},x.address?`${x.role}:${x.address}`:x.role))})}function Hse(){return o.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12","aria-hidden":!0,children:o.jsx("path",{d:"M4 6l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Use({chains:e,activeChainId:t,onSelect:n}){const[r,a]=I.useState(!1),c=I.useRef(null);I.useEffect(()=>{if(!r)return;const u=p=>{c.current&&!c.current.contains(p.target)&&a(!1)},d=p=>{p.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",d)}},[r]);const l=e.find(u=>u.id===t)??e[0];return o.jsxs("div",{className:F.netSelect,ref:c,children:[o.jsxs("button",{type:"button",className:F.netSelectBtn,onClick:()=>a(u=>!u),"aria-haspopup":"listbox","aria-expanded":r,"aria-label":`Network: ${l==null?void 0:l.name}. Choose a network.`,children:[(l==null?void 0:l.id)!=null&&o.jsx(Co,{chainId:l.id,size:14}),o.jsx("span",{className:F.netSelectName,children:l==null?void 0:l.name}),o.jsx("span",{className:F.netSelectChevron,"aria-hidden":!0,children:o.jsx(Hse,{})})]}),r&&o.jsx("div",{className:F.netSelectMenu,role:"listbox",children:e.map(u=>o.jsxs("button",{type:"button",role:"option","aria-selected":u.id===t,className:`${F.netSelectOption} ${u.id===t?F.netSelectOptionActive:""}`,onClick:()=>{u.id!=null&&n(Number(u.id)),a(!1)},children:[u.id!=null&&o.jsx(Co,{chainId:u.id,size:14}),o.jsx("span",{className:F.netSelectOptionName,children:u.name}),u.id===t&&o.jsx("span",{className:F.netSelectCheck,"aria-hidden":!0,children:o.jsx(qp,{})})]},u.name))})]})}function Wse({signer:e,network:t,chainId:n,loading:r,onAddSigner:a,onRotateSigner:c}){const[l,u]=I.useState(!1),[d,p]=I.useState(!1),h=e.role==="sma"?{label:"SMA"}:Fse[e.role]??{label:e.role},m=e.status==="unconfigured",g=e.status==="local",v=e.status==="idle",b=e.role==="manager"&&(e.activeManager!==void 0?e.activeManager:!g&&!m&&!v),_=e.role==="owner"&&e.isManager,x=e.role==="owner"&&e.managerActive,j=(b||x)&&c,A=e.role==="sma"||m||g||v?null:q6[e.status]??q6.ok,k=g&&e.balanceEth!=null?Number(e.balanceEth):null,N=e.balanceEth!=null?Number(e.balanceEth):null,E=!!r&&!m&&e.balanceEth==null,B=!m&&!v&&e.role!=="sma"&&N===0,M=e.status==="critical"||B,P=!E&&(e.status==="low"||M||g&&(k===null||k<.002));function R(){var z;(z=navigator==null?void 0:navigator.clipboard)!=null&&z.writeText&&navigator.clipboard.writeText(e.address),u(!0),setTimeout(()=>u(!1),1400)}return o.jsxs("article",{className:`${F.signerCard} ${P?F.signerCardWarn:""} ${M?F.signerCardCrit:""}`,children:[o.jsxs("header",{className:F.signerCardHead,children:[o.jsx("span",{className:F.signerRoleWrap,children:o.jsxs("span",{className:F.signerRole,children:[h.label," gas balance"]})}),o.jsx("span",{className:F.signerStatusGroup,children:E?o.jsxs("span",{className:`${F.balancePill} ${F.balancePillLoading}`,children:[o.jsx("span",{className:F.balancePillDot,"aria-hidden":!0}),"Reading…"]}):o.jsxs(o.Fragment,{children:[x?o.jsxs("span",{className:F.balancePill,style:{color:"#1990FF"},title:"This EOA is also registered as the SMA's delegated manager on-chain",children:[o.jsx("span",{className:F.balancePillDot,"aria-hidden":!0,style:{background:"#1990FF"}}),"Active manager"]}):_?o.jsxs("span",{className:F.balancePill,style:{color:"var(--text-secondary)"},title:"This EOA is a known manager for this SMA, not currently active on-chain",children:[o.jsx("span",{className:F.balancePillDot,"aria-hidden":!0,style:{background:"rgba(255,255,255,0.25)"}}),"Manager"]}):null,v&&o.jsxs("span",{className:F.balancePill,style:{color:"var(--text-secondary)"},children:[o.jsx("span",{className:F.balancePillDot,"aria-hidden":!0,style:{background:"rgba(255,255,255,0.25)"}}),"Idle"]}),A&&o.jsxs("span",{className:`${F.balancePill} ${F[`balancePill_${e.status}`]??""}`,children:[o.jsx("span",{className:F.balancePillDot,"aria-hidden":!0}),A.label]}),g&&o.jsxs("span",{className:F.balancePill,style:{color:"var(--text-secondary)"},children:[o.jsx("span",{className:F.balancePillDot,"aria-hidden":!0,style:{background:"var(--accent-blue)"}}),"Not registered"]})]})})]}),o.jsxs("div",{className:F.signerBalance,children:[!m&&o.jsx("span",{className:F.ethGlyph,"aria-hidden":!0,children:o.jsx(gae,{})}),m?o.jsx("span",{className:F.signerBalanceNum,style:{opacity:.4},children:"—"}):E?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:`${F.signerBalanceNum} ${F.signerBalanceNumLoading}`,"aria-label":"Loading balance",children:"0.0000"}),o.jsx("span",{className:`${F.signerBalanceUnit} ${F.signerBalanceNumLoading}`,children:"ETH"})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:F.signerBalanceNum,children:Ose(e.balanceEth)}),o.jsx("span",{className:F.signerBalanceUnit,children:"ETH"})]})]}),(m||g||v)&&o.jsx("p",{className:F.signerSub,children:m?"No agent wallet assigned yet — create or import one to let your agent sign.":g?"Local key — not yet delegated.":"Known manager — not currently active on-chain."}),m&&o.jsx(Ze,{fullWidth:!0,variant:"secondary",onClick:a,children:"Add agent wallet"}),e.address&&o.jsxs("footer",{className:F.signerFoot,children:[o.jsxs("button",{type:"button",className:F.signerAddrPill,onClick:R,title:e.address,"aria-label":"Copy signer address",children:[o.jsx("span",{className:F.signerAddrMono,children:rs(e.address)}),o.jsx("span",{className:F.signerAddrIcon,"aria-hidden":!0,children:l?o.jsx(qp,{}):o.jsx(t8,{})})]}),o.jsx("a",{className:F.signerAddrOpen,href:e2(t,e.address),target:"_blank",rel:"noreferrer","aria-label":"Open on block explorer",children:o.jsx(ju,{})}),j&&o.jsxs("button",{type:"button",className:F.signerRotateBtnSm,onClick:()=>c(),title:"Rotate agent keys",children:[o.jsx(Y6,{}),"Rotate keys"]}),e.role==="manager"&&v&&c&&o.jsxs("button",{type:"button",className:F.signerRotateBtnSm,onClick:()=>c(e.address),title:"Rotate to this key",children:[o.jsx(Y6,{}),"Rotate to this"]})]}),o.jsx("div",{className:F.signerSpacer}),P&&o.jsxs("div",{className:F.signerTopUp,children:[h.gasReason&&o.jsx("span",{className:F.signerTopUpTitle,children:h.gasReason}),o.jsx("span",{className:F.signerTopUpMsg,children:M?"Out of gas — agent is stalled.":"Running low — top up soon."}),o.jsx("button",{type:"button",className:F.signerFundBtn,onClick:()=>p(!0),children:"Fund Gas"})]}),o.jsx(cre,{open:d,onClose:()=>p(!1),signer:e,network:t,chainId:n})]})}function Vse({mandate:e,network:t,addressByTemplate:n,onRevoke:r}){const a=(e==null?void 0:e.permissions)??[],c=e!=null&&e.registeredOnChain?"active":"pending",l=e!=null&&e.signedAt?new Date(e.signedAt).toLocaleDateString():"",u=(()=>{const h=((e==null?void 0:e.chainId)!=null?Mi(e.chainId):null)??t??(e!=null&&e.chainId?Nc[e.chainId]:null);return h?h.charAt(0).toUpperCase()+h.slice(1):null})(),d=r?(()=>{const p=new Set;return a.map(h=>({name:h.template,address:n==null?void 0:n.get(h.template)})).filter(h=>{if(!h.address)return!1;const m=h.address.toLowerCase();return p.has(m)?!1:(p.add(m),!0)})})():[];return o.jsxs("article",{className:F.mandateSummary,children:[o.jsxs("header",{className:F.mandateSummaryHead,children:[o.jsxs("div",{className:F.mandateSummaryHeadText,children:[o.jsxs("span",{className:F.mandateSummaryKicker,children:["Live mandate",l?` · signed ${l}`:""]}),o.jsx("h3",{className:F.mandateSummaryTitle,children:u?`Mandate · ${u}`:"Mandate"})]}),o.jsxs("div",{className:F.mandateSummaryHeadRight,children:[o.jsx(tp,{status:c}),o.jsxs("span",{className:F.mandateSummaryCount,children:[a.length," permission",a.length===1?"":"s"]})]})]}),o.jsx("ul",{className:F.mandateSummaryPerms,children:a.map((p,h)=>{const m=n==null?void 0:n.get(p.template),g=o.jsxs("span",{className:F.mandateSummaryPermBody,children:[o.jsx("span",{className:F.mandateSummaryPermLabel,children:p.template}),(p.explanation?String(p.explanation).split("; "):Nse(p)).map((v,b)=>o.jsx("span",{className:F.mandateSummaryPermSub,children:v},b))]});return o.jsxs("li",{className:F.mandateSummaryPermRow,children:[o.jsx("span",{className:F.mandateSummaryCheck,"aria-hidden":!0,children:o.jsx(lae,{})}),m?o.jsxs("a",{className:F.mandateSummaryPermLink,href:Ase(u,m),target:"_blank",rel:"noreferrer",title:m,children:[g,o.jsx("span",{className:F.mandateSummaryPermArrow,"aria-hidden":!0,children:o.jsx(ju,{})})]}):g]},`${p.template}-${h}`)})}),o.jsxs("footer",{className:F.mandateSummaryFoot,children:[o.jsx("span",{className:F.mandateSummaryFootMeta,children:c==="active"?"Registered on-chain":"Signed — awaiting on-chain registration"}),d.length>0&&o.jsx("button",{type:"button",className:F.mandateRevokeBtn,onClick:()=>r(d),children:"Revoke permission"})]})]})}function Gse(e,t){return Ni(e,t)??`https://etherscan.io/tx/${t}`}const qse=[{key:"all",label:"All"},{key:"owner",label:"Owner"},{key:"agent",label:"Agent"}];function Kse(e,t=new Map){const n=[];let r=null;for(const a of e){const c=a.chainId??(a.permission?t.get(a.permission.toLowerCase())??null:null);a.type==="tick_start"?(r={kind:"tick",startTs:a.ts,endTs:null,durationMs:null,logs:[],complete:!1,chainIds:new Set},c&&r.chainIds.add(c)):a.type==="tick_end"&&r?(c&&r.chainIds.add(c),r.endTs=a.ts,r.durationMs=new Date(a.ts)-new Date(r.startTs),r.complete=!0,n.push(r),r=null):a.type==="log"&&r?a.msg&&r.logs.push(a.msg):a.type!=="tick_start"&&a.type!=="tick_end"&&a.type!=="log"?(r&&(c&&r.chainIds.add(c),n.push(r),r=null),n.push({kind:"event",event:{...a,chainId:c}})):r&&c&&r.chainIds.add(c)}return r&&n.push({kind:"tick",...r}),n.reverse()}function Qse(e){return e?e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`:""}function Yse({tick:e,positions:t}){const[n,r]=I.useState(!1),a=!e.complete,c=e.logs.find(h=>h.includes("hold")||h.includes("below threshold")),l=e.logs.find(h=>h.includes("rebalance")||h.includes("deposit")||h.includes("withdraw")),u=e.logs.find(h=>h.startsWith("portfolio:")),d=l??c??u??e.logs[0]??(a?"Running…":"Tick complete"),p=(t==null?void 0:t.reduce((h,m)=>h+(m.valueUsd??0),0))??null;return o.jsxs("li",{className:F.tickCard,children:[o.jsxs("button",{type:"button",className:F.tickCardHead,onClick:()=>r(h=>!h),"aria-expanded":n,children:[o.jsx("span",{className:`${F.tickDot} ${a?F.tickDotLive:""}`,"aria-hidden":!0}),o.jsxs("span",{className:F.tickMeta,children:[o.jsx("span",{className:F.tickTime,children:Zj(e.startTs)}),e.durationMs!=null&&o.jsx("span",{className:F.tickDuration,children:Qse(e.durationMs)})]}),o.jsx("span",{className:F.tickHeadline,children:d}),p!=null&&o.jsxs("span",{className:F.tickValue,children:["$",p.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),o.jsx("span",{className:F.tickChevron,"aria-hidden":!0,children:n?"▴":"▾"})]}),n&&o.jsxs("div",{className:F.tickBody,children:[e.logs.map((h,m)=>o.jsx("p",{className:F.tickLog,children:h},m)),t&&t.length>0&&o.jsx("div",{className:F.tickPositions,children:t.map(h=>o.jsxs("div",{className:F.tickPosition,children:[o.jsx("span",{className:F.tickPositionToken,children:(h.token??"token").toUpperCase()}),o.jsxs("span",{className:F.tickPositionValue,children:["$",(h.valueUsd??0).toFixed(2)]}),h.protocol&&o.jsx("span",{className:F.tickPositionProto,children:h.protocol})]},h.vaultAddress))})]})]})}function Jse({source:e,pid:t,pids:n}){const[r,a]=I.useState(!1),c=I.useRef(null);I.useEffect(()=>{if(!r)return;const d=p=>{c.current&&!c.current.contains(p.target)&&a(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[r]);const l=e==="remote"?"remote agent":e==="github-actions"?"github actions":"Running",u=e==="local"&&n.length>0;return o.jsxs("div",{className:F.agentSourceWrap,ref:c,children:[o.jsxs("button",{type:"button",className:`${F.agentRunningBadge} ${u?F.agentRunningBadgeClickable:""}`,onClick:()=>u&&a(d=>!d),"aria-haspopup":u?"true":void 0,"aria-expanded":r,children:[o.jsx("span",{className:F.agentRunningDot,"aria-hidden":!0}),l,u&&o.jsx("svg",{className:`${F.agentSourceChevron} ${r?F.agentSourceChevronOpen:""}`,width:"8",height:"8",viewBox:"0 0 8 8",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M1.5 3L4 5.5L6.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&o.jsx("div",{className:F.agentSourcePanel,children:n.map(({chainId:d,pid:p})=>{const h=d?Mi(d)??`chain ${d}`:"unknown chain";return o.jsxs("div",{className:F.agentSourceRow,children:[o.jsx("span",{className:F.agentSourceChain,children:h}),o.jsxs("span",{className:F.agentSourcePid,children:["PID ",p]})]},d??p)})})]})}function Xse({deployedChains:e,chainFilter:t,onChainFilterChange:n}){return e.length<=1?null:o.jsxs("div",{className:F.chainSwitcher,role:"tablist","aria-label":"Filter by chain",style:{marginBottom:14},children:[o.jsx("button",{type:"button",role:"tab","aria-selected":t==="all",className:`${F.chainSwitchBtn} ${t==="all"?F.chainSwitchBtnActive:""}`,onClick:()=>n("all"),children:"All chains"}),e.map(r=>{const a=Mi(r),c=a?a.charAt(0).toUpperCase()+a.slice(1):`Chain ${r}`;return o.jsxs("button",{type:"button",role:"tab","aria-selected":t===String(r),className:`${F.chainSwitchBtn} ${t===String(r)?F.chainSwitchBtnActive:""}`,onClick:()=>n(String(r)),title:c,children:[o.jsx(Co,{chainId:r,size:14}),o.jsx("span",{children:c})]},r)})]})}function Zse({events:e,positions:t,network:n,permToChain:r=new Map,chainFilter:a="all",actorFilter:c="all"}){const[u,d]=I.useState(8);I.useEffect(()=>{d(8)},[c,a]);const h=Kse(e,r).filter(b=>{var j;const _=c==="all"||(b.kind==="tick"?c==="agent":G6(b.event)===c),x=a==="all"||(b.kind==="tick"?(j=b.chainIds)==null?void 0:j.has(Number(a)):b.event.chainId===Number(a));return _&&x}),m=h.slice(0,u),g=h.length>u,v=[c!=="all"?c:null,a!=="all"?Mi(Number(a))??a:null].filter(Boolean).join(" · ");return o.jsx(o.Fragment,{children:m.length===0?o.jsx("div",{className:F.emptyAgents,children:o.jsxs("p",{className:F.emptyAgentsBody,children:["No ",v?`${v} `:"","activity yet."]})}):o.jsxs(o.Fragment,{children:[o.jsx("ul",{className:`${vt.journalList} ${F.tickList}`,children:m.map((b,_)=>{if(b.kind==="tick")return o.jsx(Yse,{tick:b,positions:t},`tick-${b.startTs}-${_}`);const x=b.event,j=Rse(x.type),A=G6(x),k=x.txHash&&x.txHash!=="0x",N=Dse(x);return o.jsx("li",{children:o.jsxs("div",{className:vt.journalRow,children:[o.jsx("span",{className:vt.journalTime,children:Zj(x.ts)}),o.jsxs("span",{className:`${vt.journalMark} ${vt[`jStatus_${j}`]??""}`,"aria-hidden":!0,children:[j==="success"&&o.jsx(qp,{}),j==="rejected"&&o.jsx(uae,{}),j==="info"&&o.jsx(dae,{})]}),o.jsxs("span",{className:vt.journalBody,children:[o.jsxs("span",{className:vt.journalTitle,children:[o.jsx("span",{className:`${F.activityActor} ${F[`activityActor_${A}`]??""}`,children:Lse[A]}),o.jsx("span",{className:vt.journalAction,children:Bse[x.type]??x.type})]}),o.jsxs("span",{className:vt.journalMeta,children:[N,k&&o.jsxs(o.Fragment,{children:[N?" · ":"",o.jsx("a",{href:Gse(n??"ethereum",x.txHash),target:"_blank",rel:"noreferrer",children:rs(x.txHash)})]})]})]})]})},`${x.ts}-${_}`)})}),g&&o.jsx("div",{style:{marginTop:"12px",textAlign:"center"},children:o.jsx("button",{type:"button",onClick:()=>d(b=>b+10),style:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px",border:"1px solid #3a3f4a",background:"transparent",color:"#9aa0ae",cursor:"pointer"},children:"Load more"})})]})})}let _h=null;function K6(){try{if(JSON.parse(localStorage.getItem("sail.account")??"null"))return{hasAccount:!0}}catch{}return null}function X1(){const[e,t]=I.useState(()=>_h??K6()),[n,r]=I.useState(()=>_h!==null||K6()!==null),{draft:a}=Qv(),[c,l]=I.useState(!1);function u(){fetch("/api/onboard/state").then(p=>p.json()).then(p=>{_h=p,t(p),r(!0)}).catch(()=>r(!0))}function d(){const p={...e??{},hasAccount:!0};_h=p,t(p),r(!0),u()}return I.useEffect(()=>{u()},[]),I.useEffect(()=>{if(e!=null&&e.hasAccount)return;const p=setInterval(u,2e3);return()=>clearInterval(p)},[e==null?void 0:e.hasAccount]),n?!(e!=null&&e.hasAccount)&&!c?o.jsx(MJ,{onboardState:e,onComplete:d,onSkip:()=>l(!0)}):o.jsx(eae,{draft:a,onReset:u,wizardSkipped:c}):o.jsx("div",{className:`${ut.pageShell} ${F.shell}`,children:o.jsx(Zv,{})})}function eae({draft:e,onReset:t,wizardSkipped:n}){var ka,Fd,ja,Mo,Io,zi,zd,$d,Hd,ds,xl;const{isConnected:r,address:a}=dt(),{disconnect:c}=Ri(),{openConnectModal:l}=Oi(),[u,d]=I.useState(0),[p,h]=I.useState(null),[m,g]=I.useState(!1),[v,b]=I.useState(!1),[_,x]=I.useState(!1),[j,A]=I.useState(null),[k,N]=I.useState(null),[E,B]=I.useState(!1),[M,P]=I.useState(null),[R,z]=I.useState(null),{account:q,loading:Q}=vl(u),{accounts:O}=KW(u),{overview:K}=YW(u),{overviews:$}=ZW(u),L=new Map;for(const Ce of $)for(const Ye of Ce.mandates??[])Ye.address&&L.set(Ye.address.toLowerCase(),Ce.chainId);const{mandates:se}=Wp(u),{events:D}=Dj(u),{positions:X}=zj(u),{running:te,pid:W,pids:oe,source:be}=Oj(),{pending:Y}=JW(),[ue,xe]=I.useState(()=>{try{return JSON.parse(localStorage.getItem("sail.account")??"null")}catch{return null}}),[Re,Ae]=I.useState(!1),[qe,Xe]=I.useState(!1),[Tt,zt]=I.useState(!1),[Qt,$t]=I.useState(!1),[yt,dn]=I.useState(null),[yn,Or]=I.useState(null),[Yt,Fn]=I.useState(null),[Fr,wa]=I.useState("all"),[cs,Ee]=I.useState("all"),[bt,En]=I.useState({}),[ls,zn]=I.useState(!1),[So,_a]=I.useState(""),xa=(ka=K==null?void 0:K.sma)!=null&&ka.address?{safe:K.sma.address,owner:K.sma.owner,permissionSigner:K.sma.permissionSigner,manager:K.sma.manager,chainId:K.chainId}:null,en=xa??q??ue,Ao=en!=null;K==null||K.mandates;const Ld=(ja=(Fd=xa??q)==null?void 0:Fd.safe)==null?void 0:ja.toLowerCase(),bl=se.filter(Ce=>Ce.safe!=null?Ce.safe.toLowerCase()===Ld:O.length<=1).length>0||te,Ca=en?Nc[en.chainId]??"ethereum":null,pt=en?{id:"live-sma",name:"My SMA",address:en.safe,network:Ca}:null,$n=(en==null?void 0:en.owner)??a??null,Et=O.find(Ce=>Ce.active)??O[0]??null,fn=(()=>{const Ce=new Set((Et==null?void 0:Et.deployedChains)??[]);for(const Ye of $)(Ye==null?void 0:Ye.chainId)!=null&&Ce.add(Number(Ye.chainId));return(Et==null?void 0:Et.chainId)!=null&&Ce.add(Number(Et.chainId)),[...Ce].filter(Ye=>Number.isFinite(Ye)&&Ye>0)})(),us=fn.length>1,Fi=p!=null&&fn.includes(Number(p))?Number(p):fn[0],nt=us?$.find(Ce=>Number(Ce.chainId)===Fi)??$[0]??K:K;I.useEffect(()=>{var cr;if(!R)return;const Ce=$.find(Hn=>Number(Hn.chainId)===Number(R.chainId));if(((cr=Ce==null?void 0:Ce.sma)==null?void 0:cr.sessionActive)===R.expectedActive){z(null);return}const Nt=setTimeout(()=>d(Hn=>Hn+1),2e3);return()=>clearTimeout(Nt)},[R,$]);const Eo=bt[(Et==null?void 0:Et.safe)??"live-sma"]??(Et==null?void 0:Et.name)??(pt==null?void 0:pt.name)??"My SMA",Ps=(Et==null?void 0:Et.safe)??(en==null?void 0:en.safe)??"live-sma",wl=O.length>0?(()=>{var Ye;const Ce=new Map;for(const Nt of O){const cr=Nt.safe.toLowerCase(),Hn=Nc[Nt.chainId]??"ethereum",Sa=((Ye=Nt.safe)==null?void 0:Ye.toLowerCase())===(Ps==null?void 0:Ps.toLowerCase()),et=Nt.deployedChains?Nt.deployedChains.map(tn=>Nc[tn]??"ethereum").filter(Boolean):null;if(!Ce.has(cr))Ce.set(cr,{id:Nt.safe,name:bt[Nt.safe]??Nt.name??"My SMA",address:Nt.safe,network:Hn,networks:et??[Hn],mandateCount:Sa?us&&$.length>0?$.reduce((tn,at)=>tn+(at.mandateCount??0),0):(K==null?void 0:K.mandateCount)??0:0,createdAt:Nt.addedAt??null});else{const tn=Ce.get(cr),at=et??[Hn];for(const xr of at)tn.networks.includes(xr)||tn.networks.push(xr)}}return[...Ce.values()]})():pt?[{...pt,name:Eo,networks:fn.length>0?fn.map(Ce=>Nc[Ce]??"ethereum").filter(Boolean):[Ca],mandateCount:us&&$.length>0?$.reduce((Ce,Ye)=>Ce+(Ye.mandateCount??0),0):(K==null?void 0:K.mandateCount)??0,createdAt:null}]:[],Od=pt?Sse(pt.network,pt.address):"#",No=pt?`https://debank.com/profile/${pt.address}`:"#";function _l(){var Ce;pt&&((Ce=navigator==null?void 0:navigator.clipboard)!=null&&Ce.writeText&&navigator.clipboard.writeText(pt.address),Ae(!0),setTimeout(()=>Ae(!1),1400))}return o.jsxs("div",{className:`${ut.pageShell} ${F.shell}`,children:[o.jsx(Zv,{}),o.jsxs("header",{className:F.header,children:[o.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[o.jsx("button",{type:"button",className:F.brand,onClick:()=>{window.location.hash="#/dashboard"},"aria-label":"Go to dashboard",children:o.jsx(gn,{size:48,animate:!0})}),o.jsx(JZ,{})]}),o.jsxs("div",{className:F.topActionsPill,children:[o.jsx(oae,{pending:Y,draft:e,open:qe,onToggle:()=>Xe(Ce=>!Ce),onClose:()=>Xe(!1),onOpenStation:()=>{Xe(!1),window.location.hash="#/station"},onOpenSigning:()=>{Xe(!1),window.location.hash="#/station"}}),o.jsxs("button",{type:"button",className:F.avatarBtn,onClick:r?()=>zt(!0):l,"aria-label":r&&$n?`Profile (${rs($n)})`:"Connect wallet",title:r&&$n?$n:void 0,children:[o.jsx("span",{className:F.avatarBtnMonogram,"aria-hidden":!0,children:r&&$n?$n.slice(2,4).toUpperCase():"—"}),o.jsx("span",{className:F.avatarBtnAddr,children:r&&$n?rs($n):"Not connected"})]})]})]}),o.jsx("main",{className:vt.main,children:r&&Ao&&a&&(en!=null&&en.owner)&&a.toLowerCase()!==en.owner.toLowerCase()?o.jsx(tae,{projectOwner:en.owner,connectedAddress:a,onReset:async()=>{await fetch("/api/account",{method:"DELETE"}).catch(()=>{}),t()},onConnect:l}):r?!Ao&&Q?o.jsx(nae,{}):Ao?o.jsxs(o.Fragment,{children:[e&&t2(e)>0&&o.jsx(sae,{draft:e,onReview:()=>{window.location.hash="#/station"}}),Y.length>0&&o.jsx(aae,{count:Y.length,onReview:()=>{window.location.hash="#/station"}}),o.jsxs("section",{className:F.identityCard,"aria-label":"Account identity",children:[o.jsxs("div",{className:F.identityHeader,children:[o.jsxs("div",{className:F.identityMain,children:[o.jsx("div",{className:F.titleHeadFlex,children:ls?o.jsx("input",{className:F.titleNameInput,value:So,autoFocus:!0,maxLength:40,onChange:Ce=>_a(Ce.target.value),onBlur:()=>{const Ce=So.trim();Ce&&Ce!==Eo&&(En(Ye=>({...Ye,[Ps]:Ce})),C6(Ps,Ce).catch(()=>{}),d(Ye=>Ye+1)),zn(!1)},onKeyDown:Ce=>{Ce.key==="Enter"&&Ce.target.blur(),Ce.key==="Escape"&&zn(!1)}}):o.jsxs("div",{className:F.titleNameGroup,children:[o.jsxs("button",{type:"button",className:F.titleNameBtn,onClick:()=>{_a(Eo),zn(!0)},title:"Click to rename",children:[o.jsx("h1",{className:vt.title,children:Eo}),o.jsx(mae,{})]}),o.jsxs("a",{className:F.safeChip,href:Od,target:"_blank",rel:"noreferrer",tabIndex:0,"aria-label":"This SMA is a Safe smart account — open it in the Safe app",children:[o.jsx("span",{className:F.safeChipIcon,"aria-hidden":!0,children:o.jsx(cae,{})}),o.jsxs("div",{className:F.safeChipPop,role:"tooltip",children:[o.jsx("span",{className:F.safeChipPopTitle,children:"Safe smart account"}),o.jsx("span",{className:F.safeChipPopBody,children:"Your SMA is a self-custodial Safe — a smart-contract wallet you fully control, with the same address on every chain. Manage settings in the Safe app."}),o.jsxs("span",{className:F.safeChipPopLink,children:["Open in Safe ",o.jsx(ju,{})]})]})]})]})}),o.jsx("p",{className:F.idDefn,children:"Your self-custodial wallet — it holds your funds, and your agent acts within the limits you set."})]}),o.jsx("div",{className:F.identityStatus,children:(K==null?void 0:K.sma)&&(()=>{const Ce=fn.length>0?fn.map(Ye=>({id:Ye,name:Mi(Ye)})).filter(Ye=>Ye.name):K.network?[{id:K.chainId,name:K.network}]:[];return o.jsxs("div",{className:F.idStatusRow,children:[Ce.length>1?o.jsx(Use,{chains:Ce,activeChainId:Fi,onSelect:h}):Ce.map(Ye=>o.jsxs("span",{className:F.smaBadge,children:[Ye.id!=null&&o.jsx(Co,{chainId:Ye.id,size:13}),Ye.name]},Ye.name)),be&&o.jsx(Jse,{source:be,pid:W,pids:oe})]})})()})]}),o.jsxs("div",{className:F.fundsGroup,children:[o.jsx("span",{className:F.fundsLabel,children:"Funds"}),o.jsxs("div",{className:F.fundsGrid,children:[o.jsxs("div",{className:F.fundCard,children:[o.jsxs("span",{className:F.fundCardLabel,children:["SMA address",o.jsx(bi,{label:"SMA address",children:"Send tokens here on any chain you've deployed to."})]}),o.jsxs("button",{type:"button",className:F.fundAddr,onClick:_l,"aria-label":"Copy SMA address",title:pt==null?void 0:pt.address,children:[o.jsx("span",{className:F.fundAddrMono,children:Xj(pt==null?void 0:pt.address)}),o.jsxs("span",{className:F.fundAddrIcons,"aria-hidden":!0,children:[o.jsx("span",{className:F.fundAddrIcon,children:Re?o.jsx(qp,{}):o.jsx(t8,{})}),o.jsx("a",{href:e2(pt==null?void 0:pt.network,pt==null?void 0:pt.address),target:"_blank",rel:"noreferrer",className:F.fundAddrIcon,onClick:Ce=>Ce.stopPropagation(),"aria-label":"Open SMA on block explorer",children:o.jsx(ju,{})})]})]})]}),o.jsxs("a",{className:F.portfolioCard,href:No,target:"_blank",rel:"noreferrer",children:[o.jsxs("span",{className:F.portfolioText,children:[o.jsx("span",{className:F.portfolioTitle,children:"View portfolio"}),o.jsxs("span",{className:F.portfolioSub,children:["Open DeBank ",o.jsx(ju,{})]})]}),o.jsx("span",{className:F.portfolioLogo,"aria-hidden":!0,children:o.jsx("img",{src:$J,alt:"",className:F.portfolioImg})})]})]})]}),o.jsxs("div",{className:F.idWalletsGroup,children:[o.jsxs("div",{className:F.idGroupHead,children:[o.jsxs("span",{className:F.idGroupLabel,children:["Wallets",o.jsxs(bi,{label:"How these wallets work",children:["Two wallets act on this SMA: you — ",o.jsx("strong",{children:"the owner"})," — deploy it and register your permissions; your ",o.jsx("strong",{children:"agent"})," submits each dispatch within them, never beyond."]})]}),o.jsx("p",{className:F.idRelation,children:"These wallets only hold gas to sign and submit transactions — your funds stay in the SMA."})]}),o.jsx($se,{overview:nt,sma:pt,onAddSigner:()=>b(!0),onRotateSigner:nt!=null&&nt.kernel&&((Mo=nt==null?void 0:nt.sma)!=null&&Mo.address)?Ce=>{N({sma:nt.sma.address,kernel:nt.kernel,chainId:nt.chainId,owner:nt.sma.owner,currentManager:nt.sma.manager,mandates:nt.mandates??[]}),A(Ce??null),x(!0)}:void 0})]}),((Io=nt==null?void 0:nt.sma)==null?void 0:Io.registered)&&(nt==null?void 0:nt.kernel)&&((zi=nt==null?void 0:nt.sma)==null?void 0:zi.address)&&o.jsxs("div",{className:F.idWalletsGroup,children:[o.jsxs("div",{className:F.idGroupHead,children:[o.jsxs("span",{className:F.idGroupLabel,children:["Session",o.jsxs(bi,{label:"What pausing does",children:["The kill switch for this SMA. Pausing immediately halts ",o.jsx("strong",{children:"all"})," ","of the SMA’s activity (permissions stay registered); resume anytime without re-signing. Any transaction the SMA pre-signed is invalidated."]})]}),o.jsx("p",{className:F.idRelation,children:nt.sma.sessionActive===!1?"Paused — your SMA is on hold and can’t make any moves until you resume.":"Live — your SMA can act within the permissions you’ve set."})]}),R&&Number(R.chainId)===Number(nt.chainId)&&nt.sma.sessionActive!==R.expectedActive?o.jsx(Ze,{variant:"warning",disabled:!0,"aria-busy":"true",children:R.expectedActive?"Resuming SMA…":"Pausing SMA…"}):o.jsx(Ze,{variant:nt.sma.sessionActive===!1?"primary":"danger",onClick:()=>{P({sma:nt.sma.address,kernel:nt.kernel,chainId:nt.chainId,paused:nt.sma.sessionActive===!1}),B(!0)},children:nt.sma.sessionActive===!1?"Resume SMA":"Pause SMA"})]})]}),(()=>{const Ce=(et,tn)=>{var Bo,Ea;const at=(et==null?void 0:et.mandates)??[],xr=(Ea=(Bo=et==null?void 0:et.sma)==null?void 0:Bo.address)==null?void 0:Ea.toLowerCase(),Rs=se.filter(Nn=>(Nn.safe==null||Nn.safe.toLowerCase()===xr)&&(!tn||Nn.chainId===(et==null?void 0:et.chainId))),Aa=new Map(at.map(Nn=>[Nn.name??Nn.template,Nn.address])),Ls=zse(at,Rs,Aa);return{ov:et,perms:Ls,abt:Aa,has:at.length>0||Rs.length>0}},Ye=et=>{var tn,at,xr,Rs,Aa,Ls,Bo,Ea,Nn,lr;return o.jsx(Vse,{mandate:{chainId:(tn=et.ov)==null?void 0:tn.chainId,registeredOnChain:(((xr=(at=et.ov)==null?void 0:at.mandates)==null?void 0:xr.length)??0)>0,safe:(Aa=(Rs=et.ov)==null?void 0:Rs.sma)==null?void 0:Aa.address,permissions:et.perms},network:((Ls=et.ov)==null?void 0:Ls.network)??Ca,addressByTemplate:et.abt,onRevoke:(Bo=et.ov)!=null&&Bo.kernel&&((Nn=(Ea=et.ov)==null?void 0:Ea.sma)!=null&&Nn.address)?Kp=>{Fn({sma:et.ov.sma.address,kernel:et.ov.kernel,chainId:et.ov.chainId}),Or(Kp)}:void 0},((lr=et.ov)==null?void 0:lr.chainId)??"single")},Nt=Ce(nt,us),cr=us?$.map(et=>Ce(et,!0)).filter(et=>et.has):[],Hn=us&&m,Sa=Hn?cr.reduce((et,tn)=>et+tn.perms.length,0):Nt.perms.length;return o.jsxs("section",{className:F.mandatesSection,"aria-label":"Your mandates",children:[o.jsxs("header",{className:F.mandatesSectionHead,children:[o.jsxs("h2",{className:F.mandatesSectionTitle,children:[o.jsx(fae,{}),"Your Mandates"]}),o.jsx("span",{className:F.mandatesSectionMeta,children:Sa>0?`${Sa} permission${Sa===1?"":"s"}${!Hn&&(nt!=null&&nt.onchain)?" · attached on-chain":""}`:"No permissions registered yet"})]}),us&&o.jsxs("div",{className:F.chainSwitcher,role:"tablist","aria-label":"View mandates by chain",children:[o.jsx("button",{type:"button",role:"tab","aria-selected":m,className:`${F.chainSwitchBtn} ${m?F.chainSwitchBtnActive:""}`,onClick:()=>g(!0),children:"All chains"}),fn.map(et=>{const tn=Mi(et)??`Chain ${et}`,at=tn.charAt(0).toUpperCase()+tn.slice(1),xr=!m&&Number(et)===Fi;return o.jsxs("button",{type:"button",role:"tab","aria-selected":xr,className:`${F.chainSwitchBtn} ${xr?F.chainSwitchBtnActive:""}`,onClick:()=>{g(!1),h(Number(et))},title:at,children:[o.jsx(Co,{chainId:et,size:14}),o.jsx("span",{children:at})]},et)})]}),o.jsx("div",{className:F.mandateList,children:Hn?cr.length>0?cr.map(Ye):o.jsx(Q6,{onClick:()=>dn({variant:"new",context:"mandate"})}):Nt.has?Ye(Nt):o.jsx(Q6,{onClick:()=>dn({variant:"new",context:"mandate"})})})]})})(),o.jsxs("section",{className:vt.card,children:[o.jsx("header",{className:vt.cardHead,children:o.jsxs("div",{className:vt.cardHeadText,children:[o.jsxs("h2",{className:F.mandatesSectionTitle,children:[o.jsx(hae,{}),"Network RPCs"]}),o.jsx("p",{className:vt.cardSub,children:"The connection your dashboard uses to read chains and broadcast transactions."})]})}),o.jsx(vse,{deployedChains:fn,embedded:!0})]}),o.jsxs("section",{className:vt.card,children:[o.jsxs("header",{className:vt.cardHead,children:[o.jsxs("div",{className:vt.cardHeadText,children:[o.jsxs("h2",{className:F.mandatesSectionTitle,children:[o.jsx(pae,{}),"Recent Activity"]}),o.jsx("p",{className:vt.cardSub,children:"Click any event to see the agent's reasoning and evidence."})]}),o.jsx("div",{className:F.activityFilter,role:"tablist","aria-label":"Filter by actor",children:qse.map(Ce=>o.jsx("button",{type:"button",role:"tab","aria-selected":cs===Ce.key,className:`${F.activityFilterBtn} ${cs===Ce.key?F.activityFilterBtnActive:""}`,onClick:()=>Ee(Ce.key),children:Ce.label},Ce.key))})]}),o.jsx(Xse,{deployedChains:fn,chainFilter:Fr,onChainFilterChange:wa}),D.length>0?o.jsx(Zse,{events:D,positions:X,network:Ca,permToChain:L,chainFilter:Fr,actorFilter:cs}):o.jsx("div",{className:F.emptyAgents,children:o.jsx("p",{className:F.emptyAgentsBody,children:bl?o.jsxs(o.Fragment,{children:["No activity yet — run ",o.jsx("code",{children:"sailor run"})," to start"]}):"Activity from your agents will appear here."})})]}),o.jsxs("footer",{className:F.localFootnote,children:[o.jsx("span",{className:F.localFootnoteDot,"aria-hidden":!0}),"Running locally at ",o.jsx("code",{children:window.location.host})," · project state lives in"," ",o.jsx("code",{children:".sail/"}),". There is no Sail-hosted backend; your wallet talks to the chain directly."]})]}):o.jsx(rae,{onCreate:()=>$t(!0),initialShowImport:n,onImport:Ce=>{xe(Ce);try{localStorage.setItem("sail.account",JSON.stringify(Ce))}catch{}fetch("/api/account",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ce)}).catch(()=>{}),d(Ye=>Ye+1)},ownerAddr:$n}):o.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center",alignItems:"center",padding:"40px 24px"},children:o.jsx(Lj,{eyebrow:"DASHBOARD",title:"Connect to view your SMA.",sub:"Connect the owner wallet you used to set up this project."})})}),o.jsx(Yv,{open:!!yt,variant:yt==null?void 0:yt.variant,context:yt==null?void 0:yt.context,mandate:yt==null?void 0:yt.mandate,onClose:()=>dn(null)}),o.jsx($j,{open:Tt,wallet:$n,safes:wl,currentSafeId:Ps,hasSMA:Ao,onClose:()=>zt(!1),onDisconnect:()=>{zt(!1),xe(null);try{localStorage.removeItem("sail.account")}catch{}c()},onCreateSMA:()=>{zt(!1),$t(!0)},onImportSMA:Ce=>{xe(Ce);try{localStorage.setItem("sail.account",JSON.stringify(Ce))}catch{}fetch("/api/account",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ce)}).catch(()=>{}),d(Ye=>Ye+1),zt(!1)},onRenameSafe:(Ce,Ye)=>{En(Nt=>({...Nt,[Ce]:Ye})),C6(Ce,Ye).catch(()=>{}),d(Nt=>Nt+1)},onSelectSafe:async Ce=>{try{await QW(Ce.address)}catch{}d(Ye=>Ye+1),zt(!1)}}),o.jsx(Pne,{open:v,safe:(zd=K==null?void 0:K.sma)==null?void 0:zd.address,onClose:()=>b(!1),onCreated:()=>{b(!1),d(Ce=>Ce+1)}}),o.jsx(Fne,{open:_,sma:(k==null?void 0:k.sma)??(($d=K==null?void 0:K.sma)==null?void 0:$d.address),kernel:(k==null?void 0:k.kernel)??(K==null?void 0:K.kernel),chainId:(k==null?void 0:k.chainId)??(K==null?void 0:K.chainId),owner:(k==null?void 0:k.owner)??((Hd=K==null?void 0:K.sma)==null?void 0:Hd.owner),currentManager:(k==null?void 0:k.currentManager)??((ds=K==null?void 0:K.sma)==null?void 0:ds.manager),mandates:(k==null?void 0:k.mandates)??(K==null?void 0:K.mandates)??[],initialTo:j,onClose:()=>{x(!1),A(null),N(null)},onRotated:()=>d(Ce=>Ce+1)}),o.jsx(Hne,{open:E,mode:M!=null&&M.paused?"resume":"pause",sma:M==null?void 0:M.sma,kernel:M==null?void 0:M.kernel,chainId:M==null?void 0:M.chainId,onClose:()=>{B(!1),P(null)},onDone:()=>{M&&z({chainId:M.chainId,expectedActive:M.paused}),B(!1),P(null),d(Ce=>Ce+1)}}),o.jsx(xte,{open:Qt,onClose:()=>$t(!1),onComplete:Ce=>{if(Ce){xe(Ce);try{localStorage.setItem("sail.account",JSON.stringify(Ce))}catch{}}$t(!1)}}),o.jsx(nne,{open:yn!=null,mandate:Array.isArray(yn)?void 0:yn,permissions:Array.isArray(yn)?yn:void 0,sma:(Yt==null?void 0:Yt.sma)??((xl=K==null?void 0:K.sma)==null?void 0:xl.address),kernel:(Yt==null?void 0:Yt.kernel)??(K==null?void 0:K.kernel),chainId:(Yt==null?void 0:Yt.chainId)??(K==null?void 0:K.chainId),onClose:()=>{Or(null),Fn(null)},onRevoked:()=>{Or(null),Fn(null)}})]})}function tae({projectOwner:e,connectedAddress:t,onReset:n,onConnect:r}){const[a,c]=I.useState(!1);return o.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center",alignItems:"center",padding:"40px 24px"},children:o.jsxs("div",{style:{maxWidth:440,width:"100%",background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.08)",borderRadius:20,padding:"36px 32px",display:"flex",flexDirection:"column",gap:16},children:[o.jsx("span",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.14em",textTransform:"uppercase",color:"rgba(255,165,0,0.7)"},children:"Wrong wallet"}),o.jsx("h2",{style:{margin:0,fontSize:22,fontWeight:600,color:"#fff",lineHeight:1.2},children:"This project belongs to a different wallet."}),o.jsxs("p",{style:{margin:0,fontSize:14,color:"rgba(255,255,255,0.5)",lineHeight:1.6},children:["Project owner: ",o.jsx("code",{style:{fontSize:12,color:"rgba(255,255,255,0.75)"},children:rs(e)}),o.jsx("br",{}),"Connected: ",o.jsx("code",{style:{fontSize:12,color:"rgba(255,255,255,0.75)"},children:rs(t)})]}),o.jsx("p",{style:{margin:0,fontSize:13,color:"rgba(255,255,255,0.4)",lineHeight:1.5},children:"Connect the owner wallet to manage this SMA, or reset to start a new project with the current wallet."}),o.jsxs("div",{style:{display:"flex",gap:10,marginTop:4},children:[o.jsx(Ze,{onClick:r,style:{flex:1},children:"Switch wallet"}),o.jsx("button",{type:"button",disabled:a,onClick:async()=>{c(!0),await n()},style:{flex:1,padding:"10px 16px",borderRadius:12,fontSize:14,fontWeight:500,color:"rgba(255,255,255,0.5)",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",cursor:a?"default":"pointer"},children:a?"Resetting…":"Reset project"})]})]})})}function nae(){return o.jsxs("section",{className:F.noSMAHero,children:[o.jsx("div",{className:F.noSMAMascot,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsx("h2",{className:F.noSMATitle,children:"Loading your project…"}),o.jsxs("p",{className:F.noSMASub,children:["Reading local state from ",o.jsx("code",{children:".sail/"}),"."]})]})}function rae({onCreate:e,onImport:t,ownerAddr:n,initialShowImport:r}){const[a,c]=I.useState(r??!1),[l,u]=I.useState(!1),[d,p]=I.useState(""),[h,m]=I.useState("8453"),[g,v]=I.useState(""),{safes:b,scanning:_,done:x}=Fj(n,a&&!l);function j(k,N){t==null||t({safe:k,owner:n??k,permissionSigner:n??k,manager:n??k,chainId:N,createdAtBlock:"0"})}function A(){const k=d.trim();if(!/^0x[0-9a-fA-F]{40}$/.test(k)){v("Enter a valid 0x address.");return}const N=Number(h);if(!N){v("Enter a valid chain ID.");return}j(k,N)}return o.jsxs("section",{className:F.noSMAHero,children:[o.jsx("div",{className:F.noSMAMascot,"aria-hidden":!0,children:o.jsx(gn,{size:64,animate:!0})}),o.jsxs("div",{className:F.noSMAStatus,children:[o.jsx("span",{className:F.noSMAStatusDot,"aria-hidden":!0}),"No SMA yet"]}),o.jsx("h2",{className:F.noSMATitle,children:"Your wallet is connected."}),o.jsx("p",{className:F.noSMASub,children:"Create a new Separately Managed Account for your AI to operate — you only pay gas when there’s something for it to do — or import an existing Safe you already own."}),a?l?o.jsxs("div",{className:F.noSMAImport,children:[o.jsx("input",{className:F.noSMAImportInput,type:"text",placeholder:"Safe address 0x…",value:d,onChange:k=>{p(k.target.value),v("")},spellCheck:!1}),o.jsx("input",{className:F.noSMAImportInput,type:"text",placeholder:"Chain ID e.g. 8453",value:h,onChange:k=>{m(k.target.value),v("")}}),g&&o.jsx("span",{className:F.noSMAImportErr,children:g}),o.jsxs("div",{className:F.noSMAImportActions,children:[o.jsx(Ze,{onClick:A,children:"Import SMA"}),o.jsx("button",{type:"button",className:F.noSMAImportLink,onClick:()=>{u(!1),v("")},children:"Back to discovered Safes"})]})]}):o.jsxs("div",{className:F.noSMAImport,children:[_&&b.length===0&&o.jsxs("span",{className:F.noSMAImportScan,children:["Scanning for Safes owned by ",rs(n),"…"]}),b.length>0&&o.jsx("ul",{className:F.importSafeList,children:b.map(k=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:F.importSafeRow,onClick:()=>j(k.safe,k.chainId),children:[o.jsx("span",{className:F.importSafeAddr,children:Xj(k.safe)}),o.jsx("span",{className:F.importSafeNet,children:Mi(k.chainId)??`chain ${k.chainId}`})]})},`${k.chainId}-${k.safe}`))}),x&&b.length===0&&o.jsx("span",{className:F.noSMAImportScan,children:"No Safes found for this wallet on supported chains."}),o.jsxs("div",{className:F.noSMAImportActions,children:[o.jsx("button",{type:"button",className:F.noSMAImportLink,onClick:()=>u(!0),children:"Enter an address manually"}),o.jsx("button",{type:"button",className:F.noSMAImportLink,onClick:()=>c(!1),children:"Cancel"})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:F.noSMACta,children:o.jsx(Ze,{onClick:e,children:"Create your first agent"})}),o.jsx("button",{type:"button",className:F.noSMAImportLink,onClick:()=>c(!0),children:"Already have a Safe? Import it as your SMA"})]}),o.jsx("p",{className:F.noSMAFine,children:"Self-custody. Sail never holds your keys."})]})}function t2(e){return((e==null?void 0:e.permissions)??(e==null?void 0:e.items)??[]).length}function sae({draft:e,onReview:t}){const n=t2(e);return o.jsxs("button",{type:"button",className:`${F.pendingBanner} ${F.pendingBannerDraft}`,onClick:t,"aria-label":"Review pending mandate draft",children:[o.jsx("span",{className:F.pendingBannerPulse,"aria-hidden":!0}),o.jsxs("span",{className:F.pendingBannerBody,children:[o.jsx("span",{className:F.pendingBannerKicker,children:"Mandate draft ready"}),o.jsxs("span",{className:F.pendingBannerTitle,children:[o.jsx("strong",{children:n})," permission",n===1?"":"s"," queued — sign or reject"]})]})]})}function aae({count:e,onReview:t}){return o.jsxs("button",{type:"button",className:F.pendingBanner,onClick:t,"aria-label":`Review ${e} pending mandates`,children:[o.jsx("span",{className:F.pendingBannerPulse,"aria-hidden":!0}),o.jsxs("span",{className:F.pendingBannerBody,children:[o.jsx("span",{className:F.pendingBannerKicker,children:"Awaiting your signature"}),o.jsxs("span",{className:F.pendingBannerTitle,children:[o.jsx("strong",{children:e})," mandate",e===1?"":"s"," ready to authorize"]})]}),o.jsxs("span",{className:F.pendingBannerCta,children:["Review",o.jsx(e8,{})]})]})}function Q6({onClick:e}){return o.jsxs("button",{type:"button",className:F.newMandateTile,onClick:e,children:[o.jsx("span",{className:F.newMandateTilePlus,"aria-hidden":!0,children:"+"}),o.jsxs("span",{className:F.newMandateTileText,children:[o.jsx("span",{className:F.newMandateTileLabel,children:"Register a permission"}),o.jsx("span",{className:F.newMandateTileHint,children:"Draft one with your AI — sign each permission individually."})]})]})}function oae({pending:e,draft:t,open:n,onToggle:r,onClose:a,onOpenStation:c,onOpenSigning:l}){const u=I.useRef(null);I.useEffect(()=>{if(!n)return;function m(v){u.current&&!u.current.contains(v.target)&&a()}function g(v){v.key==="Escape"&&a()}return document.addEventListener("mousedown",m),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",g)}},[n,a]);const d=t2(t),p=d>0,h=e.length+(p?1:0);return o.jsxs("div",{className:F.notifWrap,ref:u,children:[o.jsxs("button",{type:"button",className:`${F.notifBtn} ${h>0?F.notifBtnLive:""}`,onClick:r,"aria-label":h>0?`${h} pending signatures`:"Pending signatures","aria-expanded":n,children:[o.jsx(iae,{}),h>0&&o.jsx("span",{className:F.notifBadge,children:h})]}),n&&o.jsxs("div",{className:F.notifPanel,role:"menu",children:[o.jsxs("header",{className:F.notifPanelHead,children:[o.jsx("span",{className:F.notifPanelTitle,children:"Pending signatures"}),o.jsx("span",{className:F.notifPanelCount,children:h===0?"none":`${h} waiting`})]}),h===0?o.jsx("div",{className:F.notifEmpty,children:o.jsxs("p",{className:F.notifEmptyBody,children:["Nothing to approve right now. When your agent needs a signature it appears here — start it with ",o.jsx("code",{children:"sailor station start"}),"."]})}):o.jsxs("ul",{className:F.notifList,children:[p&&o.jsx("li",{children:o.jsxs("button",{type:"button",className:F.notifItem,onClick:l,children:[o.jsxs("span",{className:F.notifItemTop,children:[o.jsx("span",{className:F.notifItemKind,children:"Mandate"}),o.jsx("span",{className:F.notifItemType,children:"signature"})]}),o.jsx("span",{className:F.notifItemTitle,children:"Permission draft ready"}),o.jsxs("span",{className:F.notifItemDesc,children:[d," permission",d===1?"":"s"," queued — sign or reject"]})]})}),e.map(m=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:F.notifItem,onClick:c,children:[o.jsxs("span",{className:F.notifItemTop,children:[o.jsx("span",{className:F.notifItemKind,children:Mse[m.kind]??m.kind}),o.jsx("span",{className:F.notifItemType,children:m.type==="typed-data"?"signature":"transaction"})]}),o.jsx("span",{className:F.notifItemTitle,children:m.title}),m.description&&o.jsx("span",{className:F.notifItemDesc,children:m.description}),o.jsx("span",{className:F.notifItemMeta,children:Ise[m.chainId]??`Chain ${m.chainId}`})]})},m.id))]}),e.length>0&&o.jsxs("button",{type:"button",className:F.notifFootBtn,onClick:c,children:["Open signing station",o.jsx(e8,{})]})]})]})}function iae(){return o.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M4.6 6.2a3.4 3.4 0 016.8 0v2.6c0 .9.3 1.7.9 2.3l.6.7H3.1l.6-.7c.6-.6.9-1.4.9-2.3V6.2z"}),o.jsx("path",{d:"M6.8 12.5a1.4 1.4 0 002.4 0"})]})}function ju(){return o.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M5 9 L9 5"}),o.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}function Y6(){return o.jsxs("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M13.2 8a5.2 5.2 0 1 1-1.5-3.66"}),o.jsx("path",{d:"M13.4 2.6V5.1h-2.5"})]})}function cae(){return o.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:o.jsx("path",{d:"M7.063 8.117c0-.583.472-1.055 1.055-1.055h7.76c.582 0 1.055-.472 1.055-1.055V4.055c0-.583-.473-1.055-1.055-1.055h-8.21c-.583 0-1.055.472-1.055 1.055V5.56c0 .583-.473 1.055-1.055 1.055H4.056A1.055 1.055 0 0 0 3 7.67v3.293c0 .583.475 1.031 1.058 1.031h1.951c.583 0 1.056-.472 1.056-1.055zm12.882 3.878h-1.952c-.583 0-1.055.472-1.055 1.055v2.833c0 .583-.472 1.055-1.055 1.055H8.118c-.583 0-1.055.472-1.055 1.055v1.952c0 .583.472 1.055 1.055 1.055h8.214a1.05 1.05 0 0 0 1.049-1.055v-1.566c0-.583.472-.996 1.055-.996h1.509c.582 0 1.055-.473 1.055-1.056v-3.29c0-.582-.473-1.042-1.055-1.042m-6.989-2.052h-1.874c-.61 0-1.107.496-1.107 1.107v1.874c0 .61.496 1.107 1.107 1.107h1.874c.61 0 1.107-.496 1.107-1.107V11.05c0-.61-.496-1.107-1.107-1.107"})})}function e8(){return o.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M3 7h8M8 4l3 3-3 3"})})}function t8(){return o.jsxs("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("rect",{x:"2.5",y:"2.5",width:"7",height:"7",rx:"1.6"}),o.jsx("path",{d:"M4 4V3a1 1 0 011-1h4.5a1 1 0 011 1v5a1 1 0 01-1 1H9"})]})}function qp(){return o.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4"})})}function lae(){return o.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M3.5 8.4l3 3L13 5.2"})})}function uae(){return o.jsx("svg",{viewBox:"0 0 14 14",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M3.5 3.5l7 7M10.5 3.5l-7 7"})})}function dae(){return o.jsx("svg",{viewBox:"0 0 14 14",width:"8",height:"8","aria-hidden":!0,children:o.jsx("circle",{cx:"7",cy:"7",r:"3.2",fill:"currentColor"})})}function fae(){return o.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M4 2.5h5l3 3v8a.5.5 0 01-.5.5h-7.5a.5.5 0 01-.5-.5v-10a.5.5 0 01.5-.5z"}),o.jsx("path",{d:"M9 2.5v3h3"}),o.jsx("path",{d:"M5.6 9h5M5.6 11.4h5"})]})}function hae(){return o.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("circle",{cx:"8",cy:"8",r:"2"}),o.jsx("circle",{cx:"3.2",cy:"4",r:"1.4"}),o.jsx("circle",{cx:"12.8",cy:"4",r:"1.4"}),o.jsx("circle",{cx:"8",cy:"13.4",r:"1.4"}),o.jsx("path",{d:"M4.4 4.9 6.4 6.6M11.6 4.9 9.6 6.6M8 10v2"})]})}function pae(){return o.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),o.jsx("path",{d:"M8 5v3.2l2.1 1.5"})]})}function mae(){return o.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M11.5 2.5a1.414 1.414 0 0 1 2 2L5 13H3v-2L11.5 2.5z"})})}function gae(){return o.jsxs("svg",{viewBox:"0 0 32 32",width:"20",height:"20","aria-hidden":!0,children:[o.jsx("path",{d:"M16 3 7.8 16.6 16 12.9Z",fill:"#1990ff"}),o.jsx("path",{d:"M16 3 24.2 16.6 16 12.9Z",fill:"#1990ff",opacity:"0.55"}),o.jsx("path",{d:"M16 20.2 7.8 16.6 16 12.9Z",fill:"#1990ff",opacity:"0.8"}),o.jsx("path",{d:"M16 20.2 24.2 16.6 16 12.9Z",fill:"#1990ff",opacity:"0.4"}),o.jsx("path",{d:"M16 29 7.8 18.2 16 21.7Z",fill:"#1990ff"}),o.jsx("path",{d:"M16 29 24.2 18.2 16 21.7Z",fill:"#1990ff",opacity:"0.55"})]})}const yae="_shell_19tsl_8",vae="_header_19tsl_18",bae="_backBtn_19tsl_33",wae="_headerActions_19tsl_60",_ae="_editBtnProvider_19tsl_68",xae="_headerPauseBtn_19tsl_76",Cae="_headerRevokeBtn_19tsl_77",kae="_headerPauseBtnPaused_19tsl_100",jae="_headerBtn_19tsl_117",Sae="_headerBtnGhost_19tsl_141",Aae="_headerBtnDanger_19tsl_142",Eae="_main_19tsl_185",Nae="_titleBlock_19tsl_198",Mae="_identityRow_19tsl_204",Iae="_body_19tsl_215",Bae="_tierStack_19tsl_230",Tae="_tierCard_19tsl_241",Pae="_tierCardOpen_19tsl_255",Rae="_tierCardDepth_0_19tsl_263",Lae="_tierCardDepth_1_19tsl_264",Dae="_tierCardDepth_2_19tsl_265",Oae="_tierCardConnector_19tsl_270",Fae="_tierCardHead_19tsl_288",zae="_tierCardHeadText_19tsl_305",$ae="_tierCardLabel_19tsl_311",Hae="_tierCardPrimary_19tsl_319",Uae="_tierCardSummary_19tsl_330",Wae="_tierCardChevron_19tsl_337",Vae="_tierCardChevronOpen_19tsl_354",Gae="_tierCardBody_19tsl_356",qae="_tierGrid_19tsl_369",Kae="_statusStrip_19tsl_379",Qae="_statusCell_19tsl_387",Yae="_statusCellKicker_19tsl_397",Jae="_statusCellValue_19tsl_405",Xae="_statusCellDot_19tsl_416",Zae="_statusDot_success_19tsl_423",eoe="_statusDot_warn_19tsl_424",toe="_statusDot_danger_19tsl_425",noe="_statusDot_muted_19tsl_426",roe="_statusCellSub_19tsl_427",soe="_gasRow_19tsl_435",aoe="_gasChain_19tsl_444",ooe="_gasValue_19tsl_451",ioe="_actionCard_19tsl_457",coe="_actionCard_neutral_19tsl_471",loe="_actionCard_warn_19tsl_472",uoe="_actionCard_danger_19tsl_478",doe="_actionCardText_19tsl_484",foe="_actionCardKicker_19tsl_490",hoe="_actionCardKicker_warn_19tsl_498",poe="_actionCardKicker_danger_19tsl_499",moe="_actionCardTitle_19tsl_500",goe="_actionCardDescription_19tsl_508",yoe="_actionCardAction_19tsl_516",voe="_pauseBtn_19tsl_520",boe="_revokeBtn_19tsl_521",woe="_sidebar_19tsl_541",_oe="_statusCard_19tsl_550",xoe="_statusList_19tsl_557",Coe="_statusRow_19tsl_562",koe="_statusRowProminent_19tsl_573",joe="_statusHead_19tsl_577",Soe="_statusHeadProminent_19tsl_583",Aoe="_statusKicker_19tsl_588",Eoe="_statusValue_19tsl_596",Noe="_statusValueLarge_19tsl_604",Moe="_statusDot_19tsl_423",Ioe="_statusTone_muted_19tsl_622",Boe="_statusSub_19tsl_623",Toe="_actionsBlock_19tsl_631",Poe="_actionsHint_19tsl_636",Roe="_hero_19tsl_649",Loe="_heroIdentity_19tsl_663",Doe="_chainChips_19tsl_676",Ooe="_chainChip_19tsl_676",Foe="_chainChipDot_19tsl_696",zoe="_statStat_19tsl_712",$oe="_statTone_success_19tsl_722",Hoe="_statTone_warn_19tsl_728",Uoe="_statTone_danger_19tsl_734",Woe="_statTone_muted_19tsl_740",Voe="_statKicker_19tsl_743",Goe="_statValue_19tsl_751",qoe="_statDot_19tsl_762",Koe="_statDot_success_19tsl_769",Qoe="_statDot_warn_19tsl_770",Yoe="_statDot_danger_19tsl_771",Joe="_statDot_muted_19tsl_772",Xoe="_statSub_19tsl_773",Zoe="_heroActions_19tsl_787",eie="_heroActionsHint_19tsl_795",tie="_hierarchy_19tsl_811",nie="_hierStep_19tsl_825",rie="_hierKicker_19tsl_840",sie="_hierTitle_19tsl_848",aie="_hierSub_19tsl_855",oie="_hierStepActive_19tsl_862",iie="_hierTone_owner_19tsl_868",cie="_hierTone_sma_19tsl_869",lie="_hierArrow_19tsl_872",uie="_identityName_19tsl_885",die="_identityDot_19tsl_886",fie="_title_19tsl_198",hie="_summary_19tsl_894",pie="_chainBlock_19tsl_906",mie="_chainHeader_19tsl_917",gie="_chainList_19tsl_922",yie="_chainStep_19tsl_931",vie="_chainDepth_0_19tsl_949",bie="_chainDepth_1_19tsl_950",wie="_chainDepth_2_19tsl_951",_ie="_chainConnector_19tsl_956",xie="_chainConnectorSvg_19tsl_965",Cie="_chainStepActive_19tsl_971",kie="_chainKicker_19tsl_976",jie="_chainTitle_19tsl_985",Sie="_chainAddress_19tsl_992",Aie="_chainCopyIcon_19tsl_1013",Eie="_sidebarBlock_19tsl_1019",Nie="_sidebarBlockHead_19tsl_1028",Mie="_sidebarKicker_19tsl_1033",Iie="_sidebarBlockTitle_19tsl_1041",Bie="_sidebarBody_19tsl_1048",Tie="_sidebarMeta_19tsl_1053",Pie="_sidebarValue_19tsl_1068",Rie="_sidebarHint_19tsl_1074",Lie="_copyAddress_19tsl_1082",Die="_copyAddressValue_19tsl_1103",Oie="_copyAddressIcon_19tsl_1104",Fie="_identityLink_19tsl_1114",zie="_identityHandle_19tsl_1135",$ie="_identityArrow_19tsl_1136",Hie="_networkList_19tsl_1139",Uie="_networkRow_19tsl_1147",Wie="_networkDot_19tsl_1159",Vie="_netDot_ethereum_19tsl_1166",Gie="_netDot_base_19tsl_1167",qie="_netDot_arbitrum_19tsl_1168",Kie="_netDot_optimism_19tsl_1169",Qie="_netDot_polygon_19tsl_1170",Yie="_networkName_19tsl_1171",Jie="_networkState_19tsl_1172",Xie="_pauseBtnPaused_19tsl_1203",Zie="_content_19tsl_1237",ece="_section_19tsl_1243",tce="_sectionAccent_mandate_19tsl_1261",nce="_sectionKicker_19tsl_1269",rce="_sectionAccent_permissions_19tsl_1270",sce="_sectionAccent_identity_19tsl_1279",ace="_mandateExplainer_19tsl_1291",oce="_hierarchyHeader_19tsl_1310",ice="_hierTier_19tsl_1329",cce="_hierTier_depth_0_19tsl_1341",lce="_hierTier_depth_1_19tsl_1342",uce="_hierTier_depth_2_19tsl_1343",dce="_hierTier_depth_3_19tsl_1344",fce="_hierTier_depth_4_19tsl_1345",hce="_hierTier_identity_19tsl_1354",pce="_hierTier_mandate_19tsl_1360",mce="_hierTier_permissions_19tsl_1366",gce="_hierTierActive_19tsl_1375",yce="_hierTierConnector_19tsl_1385",vce="_hierTierHead_19tsl_1396",bce="_hierTierKicker_19tsl_1402",wce="_hierTierPrimary_19tsl_1414",_ce="_hierTierSecondary_19tsl_1425",xce="_hierTierChips_19tsl_1433",Cce="_hierTierChip_19tsl_1433",kce="_hierTierChipMono_19tsl_1454",jce="_hierTierAddress_19tsl_1488",Sce="_hierTierAddressKicker_19tsl_1514",Ace="_hierTierAddressValue_19tsl_1522",Ece="_hierTierAddressIcon_19tsl_1523",Nce="_sectionHead_19tsl_1538",Mce="_sectionHeadText_19tsl_1544",Ice="_sectionHeadAction_19tsl_1552",Bce="_sectionLink_19tsl_1556",Tce="_collapsibleSection_19tsl_1581",Pce="_collapsibleTrigger_19tsl_1584",Rce="_collapsibleOpen_19tsl_1603",Lce="_collapsibleChevron_19tsl_1607",Dce="_collapsibleChevronOpen_19tsl_1624",Oce="_collapsibleBody_19tsl_1625",Fce="_sectionTitle_19tsl_1639",zce="_sectionTitleHint_19tsl_1653",$ce="_sectionNote_19tsl_1677",Hce="_subsection_19tsl_1687",Uce="_subsectionHead_19tsl_1696",Wce="_subsectionKicker_19tsl_1701",Vce="_subsectionTitle_19tsl_1709",Gce="_mandateSpec_19tsl_1719",qce="_specCell_19tsl_1724",Kce="_specKey_19tsl_1733",Qce="_specHintWrap_19tsl_1744",Yce="_specHintIcon_19tsl_1745",Jce="_registryGrid_19tsl_1772",Xce="_gasCell_19tsl_1778",Zce="_gasKicker_19tsl_1787",ele="_specValRow_19tsl_1808",tle="_specVal_19tsl_1808",nle="_specViewBtn_19tsl_1824",rle="_specValMono_19tsl_1852",sle="_targetList_19tsl_1858",ale="_targetRow_19tsl_1866",ole="_targetLabel_19tsl_1876",ile="_targetVenue_19tsl_1884",cle="_targetSep_19tsl_1889",lle="_targetSelector_19tsl_1890",ule="_targetMeta_19tsl_1902",dle="_targetHash_19tsl_1911",fle="_targetConstraint_19tsl_1916",hle="_targetTemplate_19tsl_1924",ple="_permRelation_19tsl_1940",mle="_permRelationText_19tsl_1952",gle="_permRelationKicker_19tsl_1958",yle="_permRelationRole_19tsl_1965",vle="_permRelationBody_19tsl_1972",ble="_permRelationLink_19tsl_1982",wle="_permRelationHint_19tsl_2005",_le="_permRelationEmpty_19tsl_2015",xle="_agentPermList_19tsl_2030",Cle="_agentPermRow_19tsl_2038",kle="_agentPermUsed_19tsl_2049",jle="_agentPermUnused_19tsl_2053",Sle="_agentPermRevoked_19tsl_2056",Ale="_agentPermLabel_19tsl_2059",Ele="_agentPermMark_19tsl_2063",Nle="_agentPermBody_19tsl_2081",Mle="_agentPermSub_19tsl_2095",Ile="_agentPermMeta_19tsl_2100",Ble="_agentPermMetaTpl_19tsl_2110",Tle="_agentPermMetaSep_19tsl_2114",Ple="_agentPermMetaVer_19tsl_2115",Rle="_agentPermTag_19tsl_2116",Lle="_scheduleList_19tsl_2143",Dle="_scheduleRow_19tsl_2151",Ole="_scheduleRowDisabled_19tsl_2161",Fle="_scheduleMain_19tsl_2162",zle="_scheduleHeadRow_19tsl_2168",$le="_scheduleId_19tsl_2173",Hle="_scheduleMode_19tsl_2180",Ule="_scheduleModeLive_19tsl_2190",Wle="_scheduleModeFork_19tsl_2195",Vle="_scheduleCron_19tsl_2200",Gle="_scheduleRuns_19tsl_2213",qle="_scheduleToggle_19tsl_2227",Kle="_scheduleToggleOn_19tsl_2246",Qle="_signerShareRow_19tsl_2257",Yle="_signerShareLabel_19tsl_2266",Jle="_signerShareList_19tsl_2271",Xle="_signerShareChip_19tsl_2276",Zle="_receiptGrid_19tsl_2291",eue="_receiptRow_19tsl_2300",tue="_linkOut_19tsl_2312",nue="_recoQuote_19tsl_2326",rue="_recoMark_19tsl_2340",sue="_recoBody_19tsl_2347",aue="_recoFoot_19tsl_2356",oue="_pagesList_19tsl_2367",iue="_pageRow_19tsl_2375",cue="_pageIcon_19tsl_2390",lue="_pageBody_19tsl_2404",uue="_pageTitle_19tsl_2410",due="_pageMeta_19tsl_2417",fue="_pageOpen_19tsl_2425",hue="_pageNew_19tsl_2445",pue="_pageNewIcon_19tsl_2454",mue="_pageNewBody_19tsl_2466",gue="_pageNewTitle_19tsl_2472",yue="_pageNewSub_19tsl_2479",vue="_pagesEmpty_19tsl_2485",bue="_pagesEmptyIcon_19tsl_2496",wue="_pagesEmptyTitle_19tsl_2509",_ue="_pagesEmptySub_19tsl_2516",xue="_activityList_19tsl_2525",Cue="_activityRow_19tsl_2533",kue="_activityDot_19tsl_2545",jue="_actDot_exec_19tsl_2551",Sue="_actDot_sim_19tsl_2552",Aue="_actDot_check_19tsl_2553",Eue="_actDot_sys_19tsl_2554",Nue="_actDot_auth_19tsl_2555",Mue="_activityLabel_19tsl_2556",Iue="_activityAgo_19tsl_2557",Bue="_activityEmpty_19tsl_2562",Tue="_runList_19tsl_2571",Pue="_runRow_19tsl_2579",Rue="_runStatus_19tsl_2600",Lue="_runStatus_success_19tsl_2610",Due="_runStatus_failed_19tsl_2611",Oue="_runStatus_pending_19tsl_2612",Fue="_runId_19tsl_2613",zue="_runLabel_19tsl_2619",$ue="_runMeta_19tsl_2627",Hue="_runGas_19tsl_2636",Uue="_runAgo_19tsl_2637",Wue="_runChevron_19tsl_2638",Vue="_runFailed_19tsl_2640",Gue="_drawerScrim_19tsl_2643",que="_drawerScrimOpen_19tsl_2654",Kue="_drawer_19tsl_2643",Que="_drawerOpen_19tsl_2672",Yue="_drawerHead_19tsl_2673",Jue="_drawerHeadLeft_19tsl_2680",Xue="_drawerKicker_19tsl_2681",Zue="_drawerTitle_19tsl_2689",ede="_drawerClose_19tsl_2697",tde="_drawerBody_19tsl_2714",nde="_drawerGrid_19tsl_2722",rde="_drawerRow_19tsl_2731",sde="_drawerLink_19tsl_2748",ade="_drawerStatus_19tsl_2760",ode="_drawerError_19tsl_2772",ide="_drawerSection_19tsl_2776",cde="_drawerSectionTitle_19tsl_2781",lde="_drawerNote_19tsl_2790",ude="_drawerLog_19tsl_2797",dde="_notFound_19tsl_2812",fde="_notFoundTitle_19tsl_2822",hde="_notFoundBody_19tsl_2829",pde="_mandateLinkPill_19tsl_2847",mde="_titleScope_19tsl_2873",gde="_identityFootnote_19tsl_2886",yde="_readinessLine_19tsl_2910",vde="_readinessStatusRow_19tsl_2916",bde="_readinessDot_19tsl_2925",wde="_readinessDot_success_19tsl_2932",_de="_readinessDot_warn_19tsl_2933",xde="_readinessDot_muted_19tsl_2934",Cde="_readinessLabel_19tsl_2935",kde="_readinessDetail_19tsl_2939",jde="_readinessRehearsal_19tsl_2943",Sde="_readinessRehearsalStaleBtn_19tsl_2968",Ade="_readinessRehearsalBusy_19tsl_2977",Ede="_readinessRehearsalStale_19tsl_2968",Nde="_readinessAttribution_19tsl_2987",Z={shell:yae,header:vae,backBtn:bae,headerActions:wae,editBtnProvider:_ae,headerPauseBtn:xae,headerRevokeBtn:Cae,headerPauseBtnPaused:kae,headerBtn:jae,headerBtnGhost:Sae,headerBtnDanger:Aae,main:Eae,titleBlock:Nae,identityRow:Mae,body:Iae,tierStack:Bae,tierCard:Tae,tierCardOpen:Pae,tierCardDepth_0:Rae,tierCardDepth_1:Lae,tierCardDepth_2:Dae,tierCardConnector:Oae,tierCardHead:Fae,tierCardHeadText:zae,tierCardLabel:$ae,tierCardPrimary:Hae,tierCardSummary:Uae,tierCardChevron:Wae,tierCardChevronOpen:Vae,tierCardBody:Gae,tierGrid:qae,statusStrip:Kae,statusCell:Qae,statusCellKicker:Yae,statusCellValue:Jae,statusCellDot:Xae,statusDot_success:Zae,statusDot_warn:eoe,statusDot_danger:toe,statusDot_muted:noe,statusCellSub:roe,gasRow:soe,gasChain:aoe,gasValue:ooe,actionCard:ioe,actionCard_neutral:coe,actionCard_warn:loe,actionCard_danger:uoe,actionCardText:doe,actionCardKicker:foe,actionCardKicker_warn:hoe,actionCardKicker_danger:poe,actionCardTitle:moe,actionCardDescription:goe,actionCardAction:yoe,pauseBtn:voe,revokeBtn:boe,sidebar:woe,statusCard:_oe,statusList:xoe,statusRow:Coe,statusRowProminent:koe,statusHead:joe,statusHeadProminent:Soe,statusKicker:Aoe,statusValue:Eoe,statusValueLarge:Noe,statusDot:Moe,statusTone_muted:Ioe,statusSub:Boe,actionsBlock:Toe,actionsHint:Poe,hero:Roe,heroIdentity:Loe,chainChips:Doe,chainChip:Ooe,chainChipDot:Foe,statStat:zoe,statTone_success:$oe,statTone_warn:Hoe,statTone_danger:Uoe,statTone_muted:Woe,statKicker:Voe,statValue:Goe,statDot:qoe,statDot_success:Koe,statDot_warn:Qoe,statDot_danger:Yoe,statDot_muted:Joe,statSub:Xoe,heroActions:Zoe,heroActionsHint:eie,hierarchy:tie,hierStep:nie,hierKicker:rie,hierTitle:sie,hierSub:aie,hierStepActive:oie,hierTone_owner:iie,hierTone_sma:cie,hierArrow:lie,identityName:uie,identityDot:die,title:fie,summary:hie,chainBlock:pie,chainHeader:mie,chainList:gie,chainStep:yie,chainDepth_0:vie,chainDepth_1:bie,chainDepth_2:wie,chainConnector:_ie,chainConnectorSvg:xie,chainStepActive:Cie,chainKicker:kie,chainTitle:jie,chainAddress:Sie,chainCopyIcon:Aie,sidebarBlock:Eie,sidebarBlockHead:Nie,sidebarKicker:Mie,sidebarBlockTitle:Iie,sidebarBody:Bie,sidebarMeta:Tie,sidebarValue:Pie,sidebarHint:Rie,copyAddress:Lie,copyAddressValue:Die,copyAddressIcon:Oie,identityLink:Fie,identityHandle:zie,identityArrow:$ie,networkList:Hie,networkRow:Uie,networkDot:Wie,netDot_ethereum:Vie,netDot_base:Gie,netDot_arbitrum:qie,netDot_optimism:Kie,netDot_polygon:Qie,networkName:Yie,networkState:Jie,pauseBtnPaused:Xie,content:Zie,section:ece,sectionAccent_mandate:tce,sectionKicker:nce,sectionAccent_permissions:rce,sectionAccent_identity:sce,mandateExplainer:ace,hierarchyHeader:oce,hierTier:ice,hierTier_depth_0:cce,hierTier_depth_1:lce,hierTier_depth_2:uce,hierTier_depth_3:dce,hierTier_depth_4:fce,hierTier_identity:hce,hierTier_mandate:pce,hierTier_permissions:mce,hierTierActive:gce,hierTierConnector:yce,hierTierHead:vce,hierTierKicker:bce,hierTierPrimary:wce,hierTierSecondary:_ce,hierTierChips:xce,hierTierChip:Cce,hierTierChipMono:kce,hierTierAddress:jce,hierTierAddressKicker:Sce,hierTierAddressValue:Ace,hierTierAddressIcon:Ece,sectionHead:Nce,sectionHeadText:Mce,sectionHeadAction:Ice,sectionLink:Bce,collapsibleSection:Tce,collapsibleTrigger:Pce,collapsibleOpen:Rce,collapsibleChevron:Lce,collapsibleChevronOpen:Dce,collapsibleBody:Oce,sectionTitle:Fce,sectionTitleHint:zce,sectionNote:$ce,subsection:Hce,subsectionHead:Uce,subsectionKicker:Wce,subsectionTitle:Vce,mandateSpec:Gce,specCell:qce,specKey:Kce,specHintWrap:Qce,specHintIcon:Yce,registryGrid:Jce,gasCell:Xce,gasKicker:Zce,specValRow:ele,specVal:tle,specViewBtn:nle,specValMono:rle,targetList:sle,targetRow:ale,targetLabel:ole,targetVenue:ile,targetSep:cle,targetSelector:lle,targetMeta:ule,targetHash:dle,targetConstraint:fle,targetTemplate:hle,permRelation:ple,permRelationText:mle,permRelationKicker:gle,permRelationRole:yle,permRelationBody:vle,permRelationLink:ble,permRelationHint:wle,permRelationEmpty:_le,agentPermList:xle,agentPermRow:Cle,agentPermUsed:kle,agentPermUnused:jle,agentPermRevoked:Sle,agentPermLabel:Ale,agentPermMark:Ele,agentPermBody:Nle,agentPermSub:Mle,agentPermMeta:Ile,agentPermMetaTpl:Ble,agentPermMetaSep:Tle,agentPermMetaVer:Ple,agentPermTag:Rle,scheduleList:Lle,scheduleRow:Dle,scheduleRowDisabled:Ole,scheduleMain:Fle,scheduleHeadRow:zle,scheduleId:$le,scheduleMode:Hle,scheduleModeLive:Ule,scheduleModeFork:Wle,scheduleCron:Vle,scheduleRuns:Gle,scheduleToggle:qle,scheduleToggleOn:Kle,signerShareRow:Qle,signerShareLabel:Yle,signerShareList:Jle,signerShareChip:Xle,receiptGrid:Zle,receiptRow:eue,linkOut:tue,recoQuote:nue,recoMark:rue,recoBody:sue,recoFoot:aue,pagesList:oue,pageRow:iue,pageIcon:cue,pageBody:lue,pageTitle:uue,pageMeta:due,pageOpen:fue,pageNew:hue,pageNewIcon:pue,pageNewBody:mue,pageNewTitle:gue,pageNewSub:yue,pagesEmpty:vue,pagesEmptyIcon:bue,pagesEmptyTitle:wue,pagesEmptySub:_ue,activityList:xue,activityRow:Cue,activityDot:kue,actDot_exec:jue,actDot_sim:Sue,actDot_check:Aue,actDot_sys:Eue,actDot_auth:Nue,activityLabel:Mue,activityAgo:Iue,activityEmpty:Bue,runList:Tue,runRow:Pue,runStatus:Rue,runStatus_success:Lue,runStatus_failed:Due,runStatus_pending:Oue,runId:Fue,runLabel:zue,runMeta:$ue,runGas:Hue,runAgo:Uue,runChevron:Wue,runFailed:Vue,drawerScrim:Gue,drawerScrimOpen:que,drawer:Kue,drawerOpen:Que,drawerHead:Yue,drawerHeadLeft:Jue,drawerKicker:Xue,drawerTitle:Zue,drawerClose:ede,drawerBody:tde,drawerGrid:nde,drawerRow:rde,drawerLink:sde,drawerStatus:ade,drawerError:ode,drawerSection:ide,drawerSectionTitle:cde,drawerNote:lde,drawerLog:ude,notFound:dde,notFoundTitle:fde,notFoundBody:hde,mandateLinkPill:pde,titleScope:mde,identityFootnote:gde,readinessLine:yde,readinessStatusRow:vde,readinessDot:bde,readinessDot_success:wde,readinessDot_warn:_de,readinessDot_muted:xde,readinessLabel:Cde,readinessDetail:kde,readinessRehearsal:jde,readinessRehearsalStaleBtn:Sde,readinessRehearsalBusy:Ade,readinessRehearsalStale:Ede,readinessAttribution:Nde},Mde="_overlay_d5rhd_6",Ide="_contractFade_d5rhd_1",Bde="_card_d5rhd_21",Tde="_contractRise_d5rhd_1",Pde="_close_d5rhd_45",Rde="_doc_d5rhd_74",Lde="_docHead_d5rhd_88",Dde="_docKicker_d5rhd_95",Ode="_docTitle_d5rhd_103",Fde="_docLede_d5rhd_113",zde="_docMeta_d5rhd_132",$de="_docMetaCell_d5rhd_144",Hde="_docMetaWithMark_d5rhd_167",Ude="_divider_d5rhd_177",Wde="_section_d5rhd_186",Vde="_sectionHead_d5rhd_191",Gde="_sectionRoman_d5rhd_199",qde="_sectionTitle_d5rhd_208",Kde="_sectionKicker_d5rhd_217",Qde="_sectionBody_d5rhd_224",Yde="_docBody_d5rhd_231",Jde="_recital_d5rhd_251",Xde="_recitalMark_d5rhd_265",Zde="_parties_d5rhd_295",efe="_party_d5rhd_306",tfe="_partyActive_d5rhd_315",nfe="_partyRole_d5rhd_319",rfe="_partyName_d5rhd_328",sfe="_partyDesc_d5rhd_335",afe="_partyAddr_d5rhd_341",ofe="_scopeGrid_d5rhd_351",ife="_scopeBlock_d5rhd_359",cfe="_scopeHead_d5rhd_368",lfe="_scopeCount_d5rhd_380",ufe="_scopeChips_d5rhd_386",dfe="_scopePill_d5rhd_391",ffe="_scopePillDot_d5rhd_404",hfe="_scopeEmpty_d5rhd_410",pfe="_limitsGrid_d5rhd_418",mfe="_limitCell_d5rhd_426",gfe="_limitCellEmphasis_d5rhd_435",yfe="_limitLabel_d5rhd_441",vfe="_limitValueWrap_d5rhd_449",bfe="_limitVal_d5rhd_449",wfe="_limitSub_d5rhd_464",_fe="_actionList_d5rhd_473",xfe="_actionItem_d5rhd_482",Cfe="_actionIndex_d5rhd_491",kfe="_actionBody_d5rhd_500",jfe="_actionLabel_d5rhd_506",Sfe="_actionMeta_d5rhd_513",Afe="_actionChip_d5rhd_518",Efe="_actionChipDot_d5rhd_531",Nfe="_rights_d5rhd_539",Mfe="_sigBlock_d5rhd_576",Ife="_sigHead_d5rhd_588",Bfe="_sigTitle_d5rhd_595",Tfe="_sigSub_d5rhd_603",Pfe="_sigGrid_d5rhd_610",Rfe="_sigCard_d5rhd_619",Lfe="_sigCard_signed_d5rhd_629",Dfe="_sigCardProvider_claude_d5rhd_637",Ofe="_sigCardRole_d5rhd_641",Ffe="_sigLine_d5rhd_642",zfe="_sigX_d5rhd_643",$fe="_sigCardProvider_cursor_d5rhd_645",Hfe="_sigCardProvider_codex_d5rhd_653",Ufe="_sigCard_signing_d5rhd_660",Wfe="_sigCardHead_d5rhd_663",Vfe="_sigCardName_d5rhd_677",Gfe="_sigCardAddr_d5rhd_684",qfe="_sigCardAddrLabel_d5rhd_689",Kfe="_sigCardAddrValue_d5rhd_697",Qfe="_sigLineWrap_d5rhd_706",Yfe="_sigValue_d5rhd_729",Jfe="_sigWrite_d5rhd_1",Xfe="_sigPenLine_d5rhd_747",Zfe="_penDraw_d5rhd_1",ehe="_docFooter_d5rhd_770",the="_authorizeBtn_d5rhd_788",nhe="_rejectBtn_d5rhd_809",rhe="_docFooterNote_d5rhd_827",she="_revokeError_d5rhd_840",ahe="_readOnlyFoot_d5rhd_855",ohe="_readOnlyNote_d5rhd_862",ihe="_readOnlyClose_d5rhd_869",che="_docFooterSuccess_d5rhd_897",lhe="_successBlock_d5rhd_902",uhe="_successRise_d5rhd_1",dhe="_successMark_d5rhd_914",fhe="_successPop_d5rhd_1",hhe="_successCheck_d5rhd_1",phe="_successBody_d5rhd_941",mhe="_successTitle_d5rhd_947",ghe="_successSub_d5rhd_954",yhe="_successDone_d5rhd_961",vhe="_docRevoking_d5rhd_1011",bhe="_revokeStamp_d5rhd_1029",whe="_revokeStampLanded_d5rhd_1045",_he="_revokeStampInner_d5rhd_1053",xhe="_revokeStampText_d5rhd_1081",Che="_revokeStampDate_d5rhd_1096",khe="_revokeStampImpact_d5rhd_1114",jhe="_stampImpact_d5rhd_1",She="_docFooterRevoked_d5rhd_1131",Ahe="_revokingBlock_d5rhd_1138",Ehe="_revokingPulse_d5rhd_1149",Nhe="_revokePulse_d5rhd_1",Mhe="_revokingTitle_d5rhd_1161",Ihe="_revokedBlock_d5rhd_1165",Bhe="_revokedMark_d5rhd_1173",The="_revokedBody_d5rhd_1192",Phe="_revokedTitle_d5rhd_1198",Rhe="_revokedSub_d5rhd_1205",Lhe="_scopeRow_d5rhd_1288",Dhe="_limitRow_d5rhd_1289",Ohe="_actionLine_d5rhd_1290",Fhe="_signatureRow_d5rhd_1291",zhe="_signatureSlot_d5rhd_1292",$he="_actionsRow_d5rhd_1367",Hhe="_footerActions_d5rhd_1368",Uhe="_footerBar_d5rhd_1369",Whe="_footerCta_d5rhd_1370",Vhe="_cta_d5rhd_1373",Ghe="_ctaSecondary_d5rhd_1374",qhe="_ctaTertiary_d5rhd_1375",Khe="_ctaDestructive_d5rhd_1376",Qhe="_docRequester_d5rhd_1389",Yhe="_protections_d5rhd_1408",Jhe="_protectionChip_d5rhd_1414",Xhe="_partyAvatar_d5rhd_1441",Zhe="_onchain_d5rhd_1459",epe="_onchainKicker_d5rhd_1464",tpe="_onchainList_d5rhd_1472",npe="_onchainRow_d5rhd_1479",rpe="_onchainLabel_d5rhd_1488",spe="_onchainAddr_d5rhd_1494",ape="_onchainLink_d5rhd_1500",ce={overlay:Mde,contractFade:Ide,card:Bde,contractRise:Tde,close:Pde,doc:Rde,docHead:Lde,docKicker:Dde,docTitle:Ode,docLede:Fde,docMeta:zde,docMetaCell:$de,docMetaWithMark:Hde,divider:Ude,section:Wde,sectionHead:Vde,sectionRoman:Gde,sectionTitle:qde,sectionKicker:Kde,sectionBody:Qde,docBody:Yde,recital:Jde,recitalMark:Xde,parties:Zde,party:efe,partyActive:tfe,partyRole:nfe,partyName:rfe,partyDesc:sfe,partyAddr:afe,scopeGrid:ofe,scopeBlock:ife,scopeHead:cfe,scopeCount:lfe,scopeChips:ufe,scopePill:dfe,scopePillDot:ffe,scopeEmpty:hfe,limitsGrid:pfe,limitCell:mfe,limitCellEmphasis:gfe,limitLabel:yfe,limitValueWrap:vfe,limitVal:bfe,limitSub:wfe,actionList:_fe,actionItem:xfe,actionIndex:Cfe,actionBody:kfe,actionLabel:jfe,actionMeta:Sfe,actionChip:Afe,actionChipDot:Efe,rights:Nfe,sigBlock:Mfe,sigHead:Ife,sigTitle:Bfe,sigSub:Tfe,sigGrid:Pfe,sigCard:Rfe,sigCard_signed:Lfe,sigCardProvider_claude:Dfe,sigCardRole:Ofe,sigLine:Ffe,sigX:zfe,sigCardProvider_cursor:$fe,sigCardProvider_codex:Hfe,sigCard_signing:Ufe,sigCardHead:Wfe,sigCardName:Vfe,sigCardAddr:Gfe,sigCardAddrLabel:qfe,sigCardAddrValue:Kfe,sigLineWrap:Qfe,sigValue:Yfe,sigWrite:Jfe,sigPenLine:Xfe,penDraw:Zfe,docFooter:ehe,authorizeBtn:the,rejectBtn:nhe,docFooterNote:rhe,revokeError:she,readOnlyFoot:ahe,readOnlyNote:ohe,readOnlyClose:ihe,docFooterSuccess:che,successBlock:lhe,successRise:uhe,successMark:dhe,successPop:fhe,successCheck:hhe,successBody:phe,successTitle:mhe,successSub:ghe,successDone:yhe,docRevoking:vhe,revokeStamp:bhe,revokeStampLanded:whe,revokeStampInner:_he,revokeStampText:xhe,revokeStampDate:Che,revokeStampImpact:khe,stampImpact:jhe,docFooterRevoked:She,revokingBlock:Ahe,revokingPulse:Ehe,revokePulse:Nhe,revokingTitle:Mhe,revokedBlock:Ihe,revokedMark:Bhe,revokedBody:The,revokedTitle:Phe,revokedSub:Rhe,scopeRow:Lhe,limitRow:Dhe,actionLine:Ohe,signatureRow:Fhe,signatureSlot:zhe,actionsRow:$he,footerActions:Hhe,footerBar:Uhe,footerCta:Whe,cta:Vhe,ctaSecondary:Ghe,ctaTertiary:qhe,ctaDestructive:Khe,docRequester:Qhe,protections:Yhe,protectionChip:Jhe,partyAvatar:Xhe,onchain:Zhe,onchainKicker:epe,onchainList:tpe,onchainRow:npe,onchainLabel:rpe,onchainAddr:spe,onchainLink:ape},ope={ethereum:{id:"ethereum",name:"Ethereum",chainId:1,color:"#627EEA",short:"ETH"},arbitrum:{id:"arbitrum",name:"Arbitrum",chainId:42161,color:"#2D374B",short:"ARB"},base:{id:"base",name:"Base",chainId:8453,color:"#0052FF",short:"BASE"},optimism:{id:"optimism",name:"Optimism",chainId:10,color:"#FF0420",short:"OP"},polygon:{id:"polygon",name:"Polygon",chainId:137,color:"#8247E5",short:"POL"}},ipe={USDC:{symbol:"USDC",name:"USD Coin",color:"#2775CA",decimals:6,addresses:{ethereum:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",arbitrum:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",base:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",optimism:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"}},USDT:{symbol:"USDT",name:"Tether USD",color:"#26A17B",decimals:6,addresses:{ethereum:"0xdAC17F958D2ee523a2206206994597C13D831ec7",arbitrum:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",polygon:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F"}},DAI:{symbol:"DAI",name:"Dai Stablecoin",color:"#F4B731",decimals:18,addresses:{ethereum:"0x6B175474E89094C44Da98b954EedeAC495271d0F",arbitrum:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",base:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb"}},WETH:{symbol:"WETH",name:"Wrapped Ether",color:"#627EEA",decimals:18,addresses:{ethereum:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",arbitrum:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",base:"0x4200000000000000000000000000000000000006"}},ARB:{symbol:"ARB",name:"Arbitrum",color:"#2D374B",decimals:18,addresses:{arbitrum:"0x912CE59144191C1204E64559FE8253a0e49E6548"}},VVV:{symbol:"VVV",name:"Venice Token",color:"#FF3B5C",decimals:18,addresses:{base:"0xacfE6019Ed1A7Dc6f7B508C02d1b04ec88cC21bf"}},LINK:{symbol:"LINK",name:"Chainlink",color:"#2A5ADA",decimals:18,addresses:{ethereum:"0x514910771AF9Ca656af840dff83E8264EcF986CA",arbitrum:"0xf97f4df75117a78c1A5a0DBb814Af92458539FB4",base:"0x88Fb150BDc53A65fe94Dea0c9BA0a6dAf8C6e196"}},WBTC:{symbol:"WBTC",name:"Wrapped Bitcoin",color:"#F7931A",decimals:8,addresses:{ethereum:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",arbitrum:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f"}},CRV:{symbol:"CRV",name:"Curve DAO Token",color:"#A50E0E",decimals:18,addresses:{ethereum:"0xD533a949740bb3306d119CC777fa900bA034cd52",arbitrum:"0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978"}}},cpe={"morpho-blue":{id:"morpho-blue",name:"Morpho Blue",kind:"Lending vaults",color:"#2B5CFF",addresses:{ethereum:"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFFb",base:"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFFb"}},aave:{id:"aave",name:"Aave V3",kind:"Lending pool",color:"#B6509E",addresses:{ethereum:"0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",arbitrum:"0x794a61358D6845594F94dc1DB02A252b5b4814aD",base:"0xA238Dd80C259a72e81d7e4664a9801593F98d1c5"}},compound:{id:"compound",name:"Compound III",kind:"Lending pool",color:"#00D395",addresses:{ethereum:"0xc3d688B66703497DAA19211EEdff47f25384cdc3",arbitrum:"0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf",base:"0xb125E6687d4313864e53df431d5425969c15Eb2F"}},"uniswap-v3":{id:"uniswap-v3",name:"Uniswap V3",kind:"AMM",color:"#FF007A",addresses:{ethereum:"0xE592427A0AEce92De3Edee1F18E0157C05861564",arbitrum:"0xE592427A0AEce92De3Edee1F18E0157C05861564",base:"0x2626664c2603336E57B271c5C0b26F421741e481"}},curve:{id:"curve",name:"Curve",kind:"AMM",color:"#A50E0E",addresses:{ethereum:"0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7",arbitrum:"0x7544Fe3d184b6B55D6B36c3FCA1157eE0Ba30287"}},gmx:{id:"gmx",name:"GMX",kind:"Perps",color:"#3D88FF",addresses:{arbitrum:"0x489ee077994B6658eAfA855C308275EAd8097C4A"}},pendle:{id:"pendle",name:"Pendle",kind:"Fixed yield",color:"#00B388",addresses:{ethereum:"0x888888888889758F76e7103c6CbF23ABbF58F946",arbitrum:"0x888888888889758F76e7103c6CbF23ABbF58F946"}},ethena:{id:"ethena",name:"Ethena",kind:"Yield strategy",color:"#7AFAA1",addresses:{ethereum:"0x9D39A5DE30e57443BfF2A8307A4256c8797A3497"}},lyra:{id:"lyra",name:"Lyra",kind:"Options",color:"#39EBA0",addresses:{arbitrum:"0x2dD5edEEf3A77fcF8290a44C7CD96fAaa0E96322"}},dopex:{id:"dopex",name:"Dopex",kind:"Options",color:"#22E1FF",addresses:{arbitrum:"0xa12d0FaF12BC4d2DB8DD0F1F94B7C9DA02b2D7A8"}}},Z1={deposit:{label:"Deposit",accent:"#1990FF"},withdraw:{label:"Withdraw",accent:"#6ba3ff"},claim:{label:"Claim",accent:"#5fd28a"},swap:{label:"Swap",accent:"#9b8eff"},rebalance:{label:"Rebalance",accent:"#ffb84d"},"conditional-swap":{label:"Conditional",accent:"#ff8a8a"},short:{label:"Short",accent:"#ff8a8a"},long:{label:"Long",accent:"#5fd28a"},hedge:{label:"Hedge",accent:"#9b8eff"}},J6=e=>ope[e],X6=e=>ipe[e],eg=e=>cpe[e];function sp({open:e,mandate:t,onClose:n,onAuthorize:r,onReject:a,onRevoke:c,readOnly:l=!1,signedDate:u=null,mode:d="sign"}){var Q,O,K,$,L,se;const p=l&&d==="sign"?"view":d,{address:h}=dt(),{account:m}=vl(),g=(m==null?void 0:m.safe)??null,v=m?[{name:"My SMA",address:m.safe}]:[],[b,_]=I.useState("preview"),[x,j]=I.useState(null),[A,k]=I.useState(!1),N=I.useRef(null),E=I.useRef(null);I.useEffect(()=>{if(!e)return;p==="view"?(_("signed"),j(u?new Date(u):new Date)):p==="revoke"?(_("preview"),j(u?new Date(u):new Date)):(_("preview"),j(null)),document.body.style.overflow="hidden";const D=X=>{X.key==="Escape"&&b!=="signing"&&b!=="revoking"&&b!=="revoked"&&(n==null||n())};return window.addEventListener("keydown",D),()=>{window.removeEventListener("keydown",D),document.body.style.overflow=""}},[e,p]);function B(){const D=N.current,X=E.current;if(D&&X){const te=Math.max(0,D.offsetTop-(X.clientHeight-D.clientHeight)/2);Z6(X,te,360)}setTimeout(()=>_("signing"),280),setTimeout(()=>{j(new Date),_("signed"),setTimeout(()=>r==null?void 0:r(t.id),4200)},1880)}function M(){r==null||r(t.id)}function P(){const D=N.current,X=E.current;if(D&&X){const te=Math.max(0,D.offsetTop-(X.clientHeight-D.clientHeight)/2);Z6(X,te,360)}setTimeout(()=>_("revoking"),280),setTimeout(()=>_("revoked"),640),setTimeout(()=>c==null?void 0:c(t.id),3600)}if(!e||!t)return null;const R=lpe(t),z=v[0],q=new Date;return o.jsxs("div",{className:ce.overlay,role:"dialog","aria-modal":"true","aria-label":"Mandate",onClick:b==="preview"?n:void 0,children:[o.jsxs(Kt,{className:ce.card,onClick:D=>D.stopPropagation(),children:[o.jsx("button",{type:"button",className:ce.close,onClick:n,"aria-label":"Close",disabled:b==="signing",children:"×"}),o.jsxs("article",{ref:E,className:`${ce.doc} ${b==="revoking"||b==="revoked"?ce.docRevoking:""}`,children:[o.jsxs("header",{className:ce.docHead,children:[o.jsx("span",{className:ce.docKicker,children:"Mandate"}),o.jsx("h1",{className:ce.docTitle,children:t.title}),o.jsxs("p",{className:ce.docLede,children:["A bounded delegation between ",o.jsx("strong",{children:yy(h)})," and the agent operating inside ",o.jsx("strong",{children:z.name}),"."]}),o.jsxs("dl",{className:ce.docMeta,children:[o.jsxs("span",{className:ce.docMetaCell,children:[o.jsx("dt",{children:"Drafted by"}),o.jsxs("dd",{className:ce.docMetaWithMark,children:[o.jsx(da,{name:t.aiName,size:14})," ",t.aiName]})]}),o.jsxs("span",{className:ce.docMetaCell,children:[o.jsx("dt",{children:"Requested"}),o.jsx("dd",{children:t.requestedAgo??"just now"})]}),o.jsxs("span",{className:ce.docMetaCell,children:[o.jsx("dt",{children:"Effective"}),o.jsx("dd",{children:"upon signature"})]}),o.jsxs("span",{className:ce.docMetaCell,children:[o.jsx("dt",{children:"Date"}),o.jsx("dd",{children:_c(q)})]})]})]}),o.jsx(ex,{}),o.jsxs(bc,{roman:"",title:"Summary",kicker:"Plain-language recital",children:[o.jsxs("p",{className:ce.docBody,children:["The undersigned wallet (the ",o.jsx("em",{children:"Owner"}),") hereby grants the agent identified herein a",o.jsx("em",{children:" bounded delegation"})," to act on its behalf inside the Separately Managed Account named ",o.jsx("strong",{children:z.name}),", strictly within the scope, limits, and permitted actions defined by this mandate."]}),t.summary&&o.jsxs("blockquote",{className:ce.recital,children:[o.jsx("span",{className:ce.recitalMark,"aria-hidden":!0,children:"“"}),o.jsx("p",{children:t.summary}),o.jsxs("footer",{children:[o.jsx(da,{name:t.aiName,size:13}),o.jsxs("span",{children:["Drafted by ",t.aiName]})]})]})]}),o.jsx(bc,{roman:"I",title:"Parties",children:o.jsxs("ul",{className:ce.parties,children:[o.jsx(tg,{role:"Owner",desc:"Externally Owned Account — sole signer",address:h}),o.jsx(tg,{role:"Safe Account",desc:`Separately Managed Account · ${wc(z.network)}`,name:z.name,address:g}),o.jsx(tg,{role:"Agent",desc:`Delegated EOA · operated by ${t.aiName}`,address:rx(t),active:!0})]})}),o.jsx(bc,{roman:"II",title:"Scope",children:o.jsxs("div",{className:ce.scopeGrid,children:[o.jsx(ng,{label:"Networks",count:((Q=t.networks)==null?void 0:Q.length)??0,children:(t.networks??[]).map(D=>{const X=J6(D)??{label:wc(D),color:"#1990FF"};return o.jsxs("span",{className:ce.scopePill,children:[o.jsx("span",{className:ce.scopePillDot,style:{background:X.color},"aria-hidden":!0}),X.label]},D)})}),o.jsx(ng,{label:"Assets",count:((O=t.assets)==null?void 0:O.length)??0,children:(t.assets??[]).map(D=>{const X=X6(D)??{symbol:D,color:"#999"};return o.jsxs("span",{className:ce.scopePill,children:[o.jsx("span",{className:ce.scopePillDot,style:{background:X.color},"aria-hidden":!0}),X.symbol]},D)})}),o.jsxs(ng,{label:"Protocols",count:R.protocols.length,children:[R.protocols.length===0&&o.jsx("span",{className:ce.scopeEmpty,children:"Any onchain target permitted under the action whitelist."}),R.protocols.map(D=>{const X=eg(D)??{label:wc(D),color:"#FFFFFF"};return o.jsxs("span",{className:ce.scopePill,children:[o.jsx("span",{className:ce.scopePillDot,style:{background:X.color??"#FFFFFF"},"aria-hidden":!0}),X.label]},D)})]})]})}),o.jsx(bc,{roman:"III",title:"Limits",children:o.jsxs("div",{className:ce.limitsGrid,children:[o.jsx(tx,{label:"Spending cap",emphasis:!0,children:((K=t.caps)==null?void 0:K.length)>0?t.caps.map((D,X)=>o.jsxs("span",{className:ce.limitVal,children:[D.currency==="USD"?`$${D.amount.toLocaleString()}`:`${D.amount} ${D.asset}`,o.jsxs("span",{className:ce.limitSub,children:["max · ",D.asset]})]},X)):o.jsx("span",{className:ce.limitVal,children:"—"})}),o.jsx(tx,{label:"Time limit",emphasis:!0,children:o.jsxs("span",{className:ce.limitVal,children:[t.duration??"—",t.endsAt&&o.jsxs("span",{className:ce.limitSub,children:["ends · ",_c(new Date(t.endsAt*1e3))]})]})})]})}),o.jsx(bc,{roman:"IV",title:"Permitted actions",kicker:`${(($=t.actions)==null?void 0:$.length)??((L=t.allowed)==null?void 0:L.length)??0} authorised`,children:((se=t.actions)==null?void 0:se.length)>0?o.jsx("ol",{className:ce.actionList,children:t.actions.map((D,X)=>{var te,W,oe;return(Z1==null?void 0:Z1[D.kind])??wc(D.kind),o.jsxs("li",{className:ce.actionItem,children:[o.jsx("span",{className:ce.actionIndex,children:sx(X+1).toLowerCase()}),o.jsxs("div",{className:ce.actionBody,children:[o.jsx("span",{className:ce.actionLabel,children:D.label}),o.jsxs("div",{className:ce.actionMeta,children:[D.asset&&o.jsxs("span",{className:ce.actionChip,children:[o.jsx("span",{className:ce.actionChipDot,style:{background:((te=X6(D.asset))==null?void 0:te.color)??"#999"}}),D.asset]}),D.venue&&o.jsxs("span",{className:ce.actionChip,children:[o.jsx("span",{className:ce.actionChipDot,style:{background:((W=eg(D.venue))==null?void 0:W.color)??"#fff"}}),((oe=eg(D.venue))==null?void 0:oe.label)??wc(D.venue)]}),(D.networks??[]).map(be=>{var Y;return o.jsxs("span",{className:ce.actionChip,children:[o.jsx("span",{className:ce.actionChipDot,style:{background:((Y=J6(be))==null?void 0:Y.color)??"#1990FF"}}),wc(be)]},be)})]})]})]},D.id??X)})}):o.jsx("ol",{className:ce.actionList,children:(t.allowed??[]).map((D,X)=>o.jsxs("li",{className:ce.actionItem,children:[o.jsx("span",{className:ce.actionIndex,children:sx(X+1).toLowerCase()}),o.jsx("div",{className:ce.actionBody,children:o.jsx("span",{className:ce.actionLabel,children:D})})]},X))})}),o.jsx(bc,{roman:"V",title:"Reservation of rights",children:o.jsxs("ul",{className:ce.rights,children:[o.jsxs("li",{children:["The Owner may ",o.jsx("strong",{children:"pause"})," the agent at any time, halting future executions without revoking the mandate."]}),o.jsxs("li",{children:["The Owner may ",o.jsx("strong",{children:"revoke"})," the mandate at any time. Revocation is permanent and immediate onchain."]}),o.jsxs("li",{children:["The Owner retains ",o.jsx("strong",{children:"self-custody"})," of the Separately Managed Account at all times. Sail never holds the keys."]}),o.jsxs("li",{children:["Any action taken outside the scope, limits, or permitted actions of this mandate is ",o.jsx("strong",{children:"rejected onchain"})," by Template Logic."]})]})}),o.jsx(ex,{}),o.jsxs("section",{ref:N,className:ce.sigBlock,"aria-label":"Signatures",children:[o.jsxs("header",{className:ce.sigHead,children:[o.jsx("span",{className:ce.docKicker,children:"Signatures"}),o.jsx("h2",{className:ce.sigTitle,children:"In witness whereof"}),o.jsxs("p",{className:ce.sigSub,children:["Signed on ",_c(q),b==="signed"&&x&&` at ${xh(x)} UTC`,"."]})]}),o.jsxs("div",{className:ce.sigGrid,children:[o.jsx(nx,{role:"Drafted by",name:t.aiName,addressKicker:"Agent identity",address:`sail-agent#${rx(t).slice(2,8)}`,state:"signed",signatureValue:`/s/ ${t.aiName}`,signatureSub:"Counter-signed at draft",brand:t.aiName}),o.jsx(nx,{role:"Owner",name:"Externally Owned Account",addressKicker:"EOA address",address:yy(h),state:p==="view"||p==="revoke"||b==="signed"?"signed":b==="signing"?"signing":"pending",signatureValue:h,signatureSub:p==="view"||p==="revoke"?x?`Signed ${_c(x)} at ${xh(x)} UTC`:"Signed onchain":b==="signed"&&x?`Signed ${_c(x)} at ${xh(x)} UTC`:"Awaiting signature"})]}),(b==="revoking"||b==="revoked")&&o.jsxs("div",{className:`${ce.revokeStamp} ${b==="revoked"?ce.revokeStampLanded:""}`,"aria-hidden":!0,children:[o.jsxs("span",{className:ce.revokeStampInner,children:[o.jsx("span",{className:ce.revokeStampText,children:"REVOKED"}),o.jsx("span",{className:ce.revokeStampDate,children:x&&_c(x)})]}),o.jsx("span",{className:ce.revokeStampImpact,"aria-hidden":!0})]})]}),o.jsx("footer",{className:`${ce.docFooter} ${b==="signed"&&p!=="view"?ce.docFooterSuccess:""} ${b==="revoked"?ce.docFooterRevoked:""}`,children:p==="view"?o.jsxs("div",{className:ce.readOnlyFoot,children:[o.jsx("span",{className:ce.readOnlyNote,children:"Signed onchain · revocable at any time from the agent page."}),o.jsx("button",{type:"button",className:ce.readOnlyClose,onClick:n,children:"Close"})]}):p==="revoke"?b==="preview"?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:ce.rejectBtn,onClick:P,children:"Revoke this mandate"}),o.jsx("button",{type:"button",className:ce.authorizeBtn,onClick:n,style:{background:"rgba(255,255,255,0.04)",borderColor:"rgba(255,255,255,0.12)",color:"var(--text-primary)",boxShadow:"none"},children:"Keep it active"}),o.jsxs("p",{className:ce.docFooterNote,children:["Revocation is ",o.jsx("strong",{children:"permanent"})," and immediate onchain. Open positions stay in your SMA — Sail won't unwind anything — but your AI loses authority to act and you cannot undo this."]})]}):b==="revoking"?o.jsxs("div",{className:ce.revokingBlock,role:"status","aria-live":"polite",children:[o.jsx("span",{className:ce.revokingPulse,"aria-hidden":!0}),o.jsx("span",{className:ce.revokingTitle,children:"Revoking onchain…"})]}):o.jsxs("div",{className:ce.revokedBlock,role:"status","aria-live":"polite",children:[o.jsx("span",{className:ce.revokedMark,"aria-hidden":!0,children:o.jsxs("svg",{viewBox:"0 0 32 32",width:"22",height:"22",fill:"none","aria-hidden":!0,children:[o.jsx("circle",{cx:"16",cy:"16",r:"15",stroke:"currentColor",strokeWidth:"1.4"}),o.jsx("path",{d:"M10 16h12",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round"})]})}),o.jsxs("div",{className:ce.revokedBody,children:[o.jsx("span",{className:ce.revokedTitle,children:"Mandate revoked"}),o.jsx("span",{className:ce.revokedSub,children:"The delegated EOA is permanently disabled. Funds remain self-custody."})]})]}):b!=="signed"?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:ce.authorizeBtn,onClick:B,disabled:b!=="preview",children:[b==="preview"&&"Authorize & sign",b==="signing"&&"Signing…"]}),o.jsx("button",{type:"button",className:ce.rejectBtn,onClick:()=>k(!0),disabled:b!=="preview",children:"Reject mandate"}),o.jsx("p",{className:ce.docFooterNote,children:"By signing you agree to the scope, limits, and permitted actions described above. Revocable at any time from the agent page."})]}):o.jsxs("div",{className:ce.successBlock,role:"status","aria-live":"polite",children:[o.jsx("span",{className:ce.successMark,"aria-hidden":!0,children:o.jsxs("svg",{viewBox:"0 0 32 32",width:"22",height:"22",fill:"none","aria-hidden":!0,children:[o.jsx("circle",{cx:"16",cy:"16",r:"15",stroke:"currentColor",strokeWidth:"1.4"}),o.jsx("path",{d:"M9 16.5l4.5 4.5L23 11",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),o.jsxs("div",{className:ce.successBody,children:[o.jsx("span",{className:ce.successTitle,children:"Mandate signed"}),o.jsxs("span",{className:ce.successSub,children:["Your agent is operating inside ",v[0].name," now.",x&&` Signed at ${xh(x)} UTC.`]})]}),o.jsx("button",{type:"button",className:ce.successDone,onClick:M,autoFocus:!0,children:"Done"})]})})]})]}),o.jsx(Ij,{open:A,title:"Reject this mandate?",body:o.jsxs(o.Fragment,{children:[o.jsx("strong",{style:{color:"var(--text-primary)"},children:t.aiName})," will be told the draft was declined. Nothing is created onchain. You can ask your AI to redraft anytime."]}),confirmLabel:"Reject mandate",cancelLabel:"Keep reading",onConfirm:()=>{k(!1),a==null||a(t.id)},onCancel:()=>k(!1)})]})}function Z6(e,t,n=360){if(!e)return;const r=e.scrollTop,a=t-r;if(Math.abs(a)<1)return;const c=Date.now(),l=d=>1-Math.pow(1-d,3);function u(){const d=Math.min(1,(Date.now()-c)/n);e.scrollTop=r+a*l(d),d<1&&setTimeout(u,16)}u()}function bc({roman:e,title:t,kicker:n,children:r}){return o.jsxs("section",{className:ce.section,children:[o.jsxs("header",{className:ce.sectionHead,children:[e&&o.jsxs("span",{className:ce.sectionRoman,children:["Article ",e]}),o.jsx("h2",{className:ce.sectionTitle,children:t}),n&&o.jsx("span",{className:ce.sectionKicker,children:n})]}),o.jsx("div",{className:ce.sectionBody,children:r})]})}function ex(){return o.jsx("span",{className:ce.divider,"aria-hidden":!0})}function tg({role:e,name:t,desc:n,address:r,active:a}){return o.jsxs("li",{className:`${ce.party} ${a?ce.partyActive:""}`,children:[o.jsx("span",{className:ce.partyRole,children:e}),o.jsx("span",{className:ce.partyName,children:t??yy(r)}),o.jsx("span",{className:ce.partyDesc,children:n}),o.jsx("span",{className:ce.partyAddr,children:r})]})}function ng({label:e,count:t,children:n}){return o.jsxs("div",{className:ce.scopeBlock,children:[o.jsxs("header",{className:ce.scopeHead,children:[o.jsx("span",{children:e}),o.jsx("span",{className:ce.scopeCount,children:t})]}),o.jsx("div",{className:ce.scopeChips,children:n})]})}function tx({label:e,emphasis:t,children:n}){return o.jsxs("div",{className:`${ce.limitCell} ${t?ce.limitCellEmphasis:""}`,children:[o.jsx("span",{className:ce.limitLabel,children:e}),o.jsx("div",{className:ce.limitValueWrap,children:n})]})}function nx({role:e,name:t,addressKicker:n,address:r,state:a,signatureValue:c,signatureSub:l,brand:u}){const d=u?ce[`sigCardProvider_${upe(u)}`]:"";return o.jsxs("div",{className:`${ce.sigCard} ${ce[`sigCard_${a}`]} ${d}`,children:[o.jsxs("header",{className:ce.sigCardHead,children:[o.jsx("span",{className:ce.sigCardRole,children:e}),u&&o.jsx(da,{name:u,size:14})]}),o.jsx("span",{className:ce.sigCardName,children:t}),o.jsxs("div",{className:ce.sigCardAddr,children:[o.jsx("span",{className:ce.sigCardAddrLabel,children:n}),o.jsx("span",{className:ce.sigCardAddrValue,children:r})]}),o.jsxs("div",{className:ce.sigLineWrap,children:[o.jsx("span",{className:ce.sigX,"aria-hidden":!0,children:"X"}),o.jsxs("div",{className:ce.sigLine,children:[a==="signed"&&o.jsx("span",{className:ce.sigValue,children:c}),a==="signing"&&o.jsx("span",{className:ce.sigPenLine,"aria-hidden":!0})]})]}),o.jsx("span",{className:ce.sigSub,children:l})]})}function lpe(e){const t=new Set;for(const n of e.actions??[])n.venue&&t.add(n.venue);return{protocols:Array.from(t)}}function rx(e){let t=0;const n=e.id??"";for(let l=0;l<n.length;l++)t=t*31+n.charCodeAt(l)|0;t=Math.abs(t);const r=t.toString(16).padStart(8,"0"),a=(t*7).toString(16).padStart(8,"0"),c=(t*11).toString(16).padStart(8,"0");return("0x"+r+a+c+r).slice(0,42)}function sx(e){return["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI"][e-1]??`${e}`}function upe(e){const t=(e??"").toLowerCase();return t==="claude"||t==="anthropic"?"claude":t==="cursor"?"cursor":t==="codex"||t==="chatgpt"||t==="openai"||t==="gpt"?"codex":"default"}function wc(e){return e&&e[0].toUpperCase()+e.slice(1)}function yy(e){return!e||e.length<12?e??"":`${e.slice(0,6)}…${e.slice(-4)}`}function _c(e){return e.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function xh(e){return e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1})}function dpe({agentId:e,onBack:t,onEdit:n,onRevoke:r}){var K,$;const{mandate:a}=Wp(),{account:c}=vl(),{address:l}=dt();c==null||c.safe,c&&c.safe;const u=a??null,d=I.useMemo(()=>jpe(u),[u]),p=((a==null?void 0:a.permissions)??[]).map(L=>({...L,usedByThisAgent:!0})),[h,m]=I.useState([]);function g(L){m(se=>se.map(D=>D.id===L?{...D,enabled:!D.enabled}:D))}const v=(u==null?void 0:u.lastRehearsalHoursAgo)??3,[b,_]=I.useState(v),[x,j]=I.useState(!1);I.useEffect(()=>{_(v)},[v]);function A(){x||(j(!0),setTimeout(()=>{_(0),j(!1)},900))}const[k,N]=I.useState(null),[E,B]=I.useState(!1),[M,P]=I.useState(!1),[R,z]=I.useState(!1);if(I.useEffect(()=>{window.scrollTo({top:0,behavior:"instant"})},[e]),!u)return o.jsxs("div",{className:`${ut.pageShell} ${Z.shell}`,children:[o.jsx(ga,{}),o.jsxs("main",{className:Z.notFound,children:[o.jsx(gn,{size:48}),o.jsx("h1",{className:Z.notFoundTitle,children:"Agent not found"}),o.jsx("p",{className:Z.notFoundBody,children:"The URL points to an agent that doesn’t exist."}),o.jsx(Ze,{onClick:t,children:"Back to agents"})]})]});const q=u.status==="active",Q=E?"paused":u.status,O=k?d.runs.find(L=>L.id===k):null;return _pe(u),xpe(u,Q),kpe(u),o.jsxs("div",{className:`${ut.pageShell} ${Z.shell}`,children:[o.jsx(ga,{}),o.jsxs("header",{className:Z.header,children:[o.jsxs("button",{type:"button",className:Z.backBtn,onClick:t,"aria-label":"Back to dashboard",children:[o.jsx(Ipe,{}),o.jsx("span",{children:"Dashboard"})]}),parentMandate&&o.jsxs("a",{href:`#/mandate/${parentMandate.id}`,className:Z.mandateLinkPill,children:[o.jsx(Mpe,{}),o.jsxs("span",{children:["Operating under: ",parentMandate.title]}),o.jsx(lx,{})]})]}),o.jsxs("main",{className:Z.main,children:[o.jsxs("section",{className:Z.titleBlock,children:[o.jsxs("div",{className:Z.identityRow,children:[o.jsx(da,{name:u.aiName,size:22}),o.jsxs("span",{className:Z.identityName,children:["Created in ",u.aiName]}),o.jsx("span",{className:Z.identityDot,"aria-hidden":!0,children:"·"}),o.jsx(tp,{status:Q,kind:"agent"}),o.jsx(bpe,{networks:u.networks})]}),o.jsx("h1",{className:`${ut.displayHeadline} ${Z.title}`,children:u.role??u.title}),u.role&&o.jsx("p",{className:Z.titleScope,children:u.title}),d.agentId!=null&&o.jsxs("p",{className:Z.identityFootnote,children:[o.jsx("code",{children:u.id}),o.jsx("span",{className:Z.identityDot,"aria-hidden":!0,children:"·"}),o.jsxs("span",{children:["agentId ",o.jsx("code",{children:d.agentId.toLocaleString()})]})]}),o.jsx(mpe,{status:Q,mandate:u,hasMpcWallet:!!((K=d.mpcWallet)!=null&&K.address),lastRehearsalHoursAgo:b,rehearsing:x,onRehearse:A,managerEndpoint:mockManagerEndpoint})]}),o.jsxs("div",{className:Z.body,children:[o.jsx(ax,{title:"Your brief",kicker:"What you asked for",hint:`A summary of everything you told ${u.aiName} across your conversation — your goal, plus any follow-up details ${u.aiName} asked for while drafting this mandate. The mandate itself is ${u.aiName}'s interpretation of this brief into onchain rules.`,children:o.jsxs("blockquote",{className:Z.recoQuote,children:[o.jsx("span",{className:Z.recoMark,"aria-hidden":!0,children:"“"}),o.jsx("p",{className:Z.recoBody,children:d.recommendation.body}),o.jsxs("footer",{className:Z.recoFoot,children:[o.jsx(da,{name:u.aiName,size:16}),o.jsxs("span",{children:["Interpreted by ",u.aiName," · ",d.recommendation.ago]})]})]})}),o.jsxs("div",{className:Z.tierStack,children:[o.jsxs(ox,{tier:"1",depth:0,label:"Agent",primary:d.erc8004.handle,summary:`${Epe(d.mpcWallet.address)} · ${d.runs.length} execution${d.runs.length===1?"":"s"} · last ${(($=d.activity[0])==null?void 0:$.ago)??"—"}`,defaultOpen:!0,children:[o.jsxs("div",{className:Z.tierGrid,children:[o.jsxs(ei,{title:"Verified handle",kicker:"ERC-8004 · optional",children:[o.jsxs("a",{href:d.erc8004.url,target:"_blank",rel:"noreferrer",className:Z.identityLink,children:[o.jsx("span",{className:Z.identityHandle,children:d.erc8004.handle}),o.jsx(vy,{})]}),o.jsx("span",{className:Z.sidebarHint,children:"Template-layer metadata only — the kernel doesn't read this. The canonical agent identity is the agentId above."})]}),o.jsxs(ei,{title:"Gas balance",kicker:"Agent wallet",children:[o.jsxs("div",{className:Z.gasRow,children:[o.jsxs("span",{className:Z.gasChain,children:[o.jsx(Ppe,{})," Arbitrum"]}),o.jsxs("span",{className:Z.gasValue,children:[d.mpcWallet.gas," ETH"]})]}),d.mpcWallet.threshold&&o.jsxs("div",{className:Z.signerShareRow,children:[o.jsxs("span",{className:Z.signerShareLabel,children:["Signed by ",d.mpcWallet.threshold.replace("-of-"," of ")]}),o.jsx("span",{className:Z.signerShareList,children:(d.mpcWallet.keyShares??[]).map(L=>o.jsx("span",{className:Z.signerShareChip,children:L},L))})]})]})]}),h.length>0&&o.jsx(ei,{title:"Schedules",kicker:`${h.filter(L=>L.enabled).length} of ${h.length} enabled`,children:o.jsx("ul",{className:Z.scheduleList,children:h.map(L=>{var se;return o.jsxs("li",{className:`${Z.scheduleRow} ${L.enabled?"":Z.scheduleRowDisabled}`,children:[o.jsxs("div",{className:Z.scheduleMain,children:[o.jsxs("div",{className:Z.scheduleHeadRow,children:[o.jsx("span",{className:Z.scheduleId,children:L.id}),o.jsx("span",{className:`${Z.scheduleMode} ${L.mode==="live"?Z.scheduleModeLive:Z.scheduleModeFork}`,children:L.mode})]}),o.jsxs("span",{className:Z.scheduleCron,children:[L.cronHuman," · ",o.jsx("code",{children:L.cron})]})]}),o.jsxs("div",{className:Z.scheduleRuns,children:[o.jsxs("span",{children:["Last ",o.jsx("code",{children:((se=L.lastRun)==null?void 0:se.at)??"—"})]}),o.jsxs("span",{children:["Next ",o.jsx("code",{children:L.nextRun??"—"})]})]}),o.jsx("button",{type:"button",className:`${Z.scheduleToggle} ${L.enabled?Z.scheduleToggleOn:""}`,onClick:()=>g(L.id),"aria-pressed":L.enabled,"aria-label":`${L.enabled?"Disable":"Enable"} schedule ${L.id}`,children:L.enabled?"Enabled":"Disabled"})]},L.id)})})}),o.jsx(ppe,{runs:d.runs}),o.jsx(ei,{title:"Activity",kicker:"Recent events",children:o.jsxs("ul",{className:Z.activityList,children:[d.activity.map(L=>o.jsxs("li",{className:Z.activityRow,children:[o.jsx("span",{className:`${Z.activityDot} ${Z[`actDot_${L.kind}`]??""}`,"aria-hidden":!0}),o.jsx("span",{className:Z.activityLabel,children:L.label}),o.jsx("span",{className:Z.activityAgo,children:L.ago})]},L.id)),d.activity.length===0&&o.jsx("li",{className:Z.activityEmpty,children:"No recent activity."})]})}),o.jsx(ei,{title:"Runs",kicker:`${d.runs.length} execution${d.runs.length===1?"":"s"}`,children:o.jsxs("ul",{className:Z.runList,children:[d.runs.map(L=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:`${Z.runRow} ${L.status==="failed"?Z.runFailed:""}`,onClick:()=>N(L.id),children:[o.jsx("span",{className:`${Z.runStatus} ${Z[`runStatus_${L.status}`]}`,"aria-hidden":!0,children:L.status==="success"?o.jsx(ux,{}):L.status==="failed"?o.jsx(dx,{}):o.jsx(fx,{})}),o.jsx("span",{className:Z.runId,children:L.id}),o.jsx("span",{className:Z.runLabel,children:L.label}),o.jsxs("span",{className:Z.runMeta,children:[o.jsx("span",{className:Z.runGas,children:L.gas}),o.jsx("span",{className:Z.runAgo,children:L.ago})]}),o.jsx("span",{className:Z.runChevron,"aria-hidden":!0,children:o.jsx(Bpe,{})})]})},L.id)),d.runs.length===0&&o.jsx("li",{className:Z.activityEmpty,children:"This agent hasn’t executed yet."})]})})]}),o.jsx(ox,{tier:"2",depth:1,label:"Permissions",primary:parentMandate?`${usedPermissionIds.size} of ${p.filter(L=>!L.revoked).length} active permissions`:"No mandate",summary:parentMandate?`Operating under ${parentMandate.title} · this agent uses the highlighted lines below`:"This agent is not bound to a signed mandate.",defaultOpen:!0,children:parentMandate?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:Z.permRelation,children:[o.jsxs("div",{className:Z.permRelationText,children:[o.jsx("span",{className:Z.permRelationKicker,children:"Role"}),o.jsx("span",{className:Z.permRelationRole,children:u.role??u.title}),o.jsxs("span",{className:Z.permRelationBody,children:["Operates as an agent wallet under"," ",o.jsx("strong",{children:parentMandate.title}),". The mandate above defines the full permission set; this agent uses the",o.jsxs("strong",{children:[" ",usedPermissionIds.size]})," highlighted below."]})]}),o.jsxs("a",{href:`#/mandate/${parentMandate.id}`,className:Z.permRelationLink,children:[o.jsx("span",{children:"Open mandate"}),o.jsx(lx,{})]})]}),o.jsx(ei,{title:"Permissions this agent uses",kicker:"Inherited from the mandate",children:o.jsx("ul",{className:Z.agentPermList,children:p.map(L=>o.jsxs("li",{className:`${Z.agentPermRow} ${L.usedByThisAgent?Z.agentPermUsed:Z.agentPermUnused} ${L.revoked?Z.agentPermRevoked:""}`,children:[o.jsx("span",{className:Z.agentPermMark,"aria-hidden":!0,children:L.revoked?o.jsx(dx,{}):L.usedByThisAgent?o.jsx(ux,{}):o.jsx(fx,{})}),o.jsxs("span",{className:Z.agentPermBody,children:[o.jsx("span",{className:Z.agentPermLabel,children:L.label}),o.jsx("span",{className:Z.agentPermSub,children:L.sub}),L.template&&o.jsxs("span",{className:Z.agentPermMeta,children:[o.jsx("span",{className:Z.agentPermMetaTpl,children:L.template}),L.version&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:Z.agentPermMetaSep,"aria-hidden":!0,children:"·"}),o.jsxs("span",{className:Z.agentPermMetaVer,children:["v",L.version]})]})]})]}),o.jsx("span",{className:Z.agentPermTag,children:L.revoked?"Revoked on mandate":L.usedByThisAgent?"Used by this agent":"Available · not used"})]},L.id))})}),o.jsx("p",{className:Z.permRelationHint,children:"To revoke an individual permission, open the parent mandate. Revocation always happens at the mandate level so every agent operating under it loses authority for that line at once."})]}):o.jsx("p",{className:Z.permRelationEmpty,children:"This agent is not currently bound to a signed mandate."})})]}),o.jsx(ax,{title:"Custom pages",kicker:`${d.pages.length} created by your AI`,note:"Ask your AI to build a page for this agent — a dashboard, a watchlist, anything you want.",children:d.pages.length>0?o.jsxs("ul",{className:Z.pagesList,children:[d.pages.map(L=>o.jsxs("li",{className:Z.pageRow,children:[o.jsx("span",{className:Z.pageIcon,"aria-hidden":!0,children:L.icon}),o.jsxs("div",{className:Z.pageBody,children:[o.jsx("span",{className:Z.pageTitle,children:L.title}),o.jsxs("span",{className:Z.pageMeta,children:[o.jsx(da,{name:L.maker,size:12}),o.jsxs("span",{children:[L.maker," · ",L.updated]})]})]}),o.jsxs("a",{className:Z.pageOpen,href:L.url,target:"_blank",rel:"noreferrer",children:[o.jsx("span",{children:"Open"}),o.jsx(vy,{})]})]},L.id)),o.jsxs("li",{className:Z.pageNew,children:[o.jsx("span",{className:Z.pageNewIcon,"aria-hidden":!0,children:"+"}),o.jsxs("div",{className:Z.pageNewBody,children:[o.jsx("span",{className:Z.pageNewTitle,children:"Ask your AI to build a page"}),o.jsx("span",{className:Z.pageNewSub,children:"Try: “Sailor, build me a yield-history page for this agent.”"})]})]})]}):o.jsxs("div",{className:Z.pagesEmpty,children:[o.jsx("span",{className:Z.pagesEmptyIcon,"aria-hidden":!0,children:"+"}),o.jsx("span",{className:Z.pagesEmptyTitle,children:"No custom pages yet"}),o.jsx("span",{className:Z.pagesEmptySub,children:"Ask your AI to design one for this agent — Sail will serve it locally."})]})}),o.jsx(hpe,{tone:"warn",kicker:"Reversible · agent only",title:E?"Resume this agent":"Stop this agent",description:E?"This agent is stopped. Resume to let it dispatch again — no re-signing required.":"Stops this agent. Other agents under the same mandate keep running. You can resume at any time without re-signing. Agents are never revoked; only mandates and individual permissions are.",action:o.jsx("button",{type:"button",className:`${Z.pauseBtn} ${E?Z.pauseBtnPaused:""}`,onClick:()=>B(L=>!L),disabled:!q&&!E,children:E?"Resume this agent":"Stop this agent"})})]})]}),o.jsx(wpe,{run:O,open:!!O,onClose:()=>N(null),chainId:c==null?void 0:c.chainId}),o.jsx(sp,{open:R,mandate:u,readOnly:!0,signedDate:d.receipt.signedAt,onClose:()=>z(!1)}),o.jsx(sp,{open:M,mode:"revoke",mandate:u,signedDate:d.receipt.signedAt,onClose:()=>P(!1),onRevoke:()=>{P(!1),r==null||r()}})]})}function ax({title:e,kicker:t,note:n,hint:r,headerAction:a,accent:c,children:l}){return o.jsxs("section",{className:`${Z.section} ${c?Z[`sectionAccent_${c}`]:""}`,children:[o.jsxs("header",{className:Z.sectionHead,children:[o.jsxs("div",{className:Z.sectionHeadText,children:[o.jsx("span",{className:Z.sectionKicker,children:t}),o.jsxs("h2",{className:Z.sectionTitle,children:[e,r&&o.jsx("span",{className:Z.sectionTitleHint,title:r,"aria-label":r,role:"img",children:"i"})]}),n&&o.jsx("p",{className:Z.sectionNote,children:n})]}),a&&o.jsx("div",{className:Z.sectionHeadAction,children:a})]}),l]})}function ox({tier:e,depth:t=0,label:n,primary:r,summary:a,defaultOpen:c,children:l}){const[u,d]=I.useState(c??!1),p=`tier-${e}-heading`,h=`tier-${e}-body`;return o.jsxs("section",{className:`${Z.tierCard} ${Z[`tierCardDepth_${t}`]??""} ${u?Z.tierCardOpen:""}`,"aria-labelledby":p,children:[t>0&&o.jsx("span",{className:Z.tierCardConnector,"aria-hidden":!0,children:o.jsx(fpe,{})}),o.jsxs("button",{type:"button",className:Z.tierCardHead,onClick:()=>d(m=>!m),"aria-expanded":u,"aria-controls":h,id:p,children:[o.jsxs("div",{className:Z.tierCardHeadText,children:[o.jsx("span",{className:Z.tierCardLabel,children:n}),o.jsx("span",{className:Z.tierCardPrimary,children:r}),a&&o.jsx("span",{className:Z.tierCardSummary,children:a})]}),o.jsx("span",{className:`${Z.tierCardChevron} ${u?Z.tierCardChevronOpen:""}`,"aria-hidden":!0,children:o.jsx(Tpe,{})})]}),u&&o.jsx("div",{className:Z.tierCardBody,id:h,role:"region",children:l})]})}function fpe(){return o.jsxs("svg",{viewBox:"0 0 24 52",width:"24",height:"52",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"tier-conn",x1:"0",y1:"0",x2:"0",y2:"52",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{offset:"0%",stopColor:"#FFFFFF",stopOpacity:"0"}),o.jsx("stop",{offset:"35%",stopColor:"#FFFFFF",stopOpacity:"0.18"}),o.jsx("stop",{offset:"100%",stopColor:"#1990FF",stopOpacity:"0.65"})]})}),o.jsx("path",{d:"M 1.5 0 L 1.5 36 Q 1.5 44 11 44 L 22 44",stroke:"url(#tier-conn)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),o.jsx("circle",{cx:"22",cy:"44",r:"2",fill:"#1990FF",fillOpacity:"0.75"})]})}function hpe({tone:e,kicker:t,title:n,description:r,action:a}){return o.jsxs("section",{className:`${Z.actionCard} ${Z[`actionCard_${e}`]}`,children:[o.jsxs("div",{className:Z.actionCardText,children:[o.jsx("span",{className:`${Z.actionCardKicker} ${Z[`actionCardKicker_${e}`]}`,children:t}),o.jsx("h3",{className:Z.actionCardTitle,children:n}),o.jsx("p",{className:Z.actionCardDescription,children:r})]}),o.jsx("div",{className:Z.actionCardAction,children:a})]})}function ix(e){if(e==null)return"—";const t=Math.round(e/1e3);if(t<60)return`${t}s ago`;const n=Math.round(t/60);if(n<60)return`${n}m ago`;const r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function ppe({runs:e=[]}){const{running:t,lastActivityMs:n}=Oj(),{positions:r,updatedAt:a}=zj(),c=n!=null&&n<5*6e4,l=t?c?"working":"idle":"stopped",u=l==="working"?"rgba(120,220,160,0.95)":l==="idle"?"rgba(255,200,120,0.95)":"rgba(255,255,255,0.4)",d=l==="working"?"Working":l==="idle"?"Idle":"Stopped",p=(r??[]).reduce((x,j)=>x+(Number(j==null?void 0:j.valueUsd)||0),0),h=(r??[]).length>0,m=e.slice(0,16).reverse(),g=x=>x==="success"?"rgba(120,220,160,0.9)":x==="failed"?"rgba(255,120,120,0.9)":"rgba(255,200,120,0.9)",v={display:"flex",flexDirection:"column",gap:3},b={fontSize:11,letterSpacing:.4,textTransform:"uppercase",color:"rgba(255,255,255,0.4)"},_={fontSize:14,color:"rgba(255,255,255,0.92)",fontVariantNumeric:"tabular-nums"};return o.jsxs(ei,{title:"Status",kicker:"Live",children:[o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24,alignItems:"flex-end",padding:"4px 0"},children:[o.jsxs("div",{style:v,children:[o.jsx("span",{style:b,children:"Agent"}),o.jsxs("span",{style:{..._,display:"flex",alignItems:"center",gap:7},children:[o.jsx("span",{"aria-hidden":!0,style:{width:8,height:8,borderRadius:"50%",background:u,boxShadow:l==="working"?`0 0 8px ${u}`:"none"}}),d]})]}),o.jsxs("div",{style:v,children:[o.jsx("span",{style:b,children:"Last activity"}),o.jsx("span",{style:_,children:ix(n)})]}),o.jsxs("div",{style:v,children:[o.jsx("span",{style:b,children:"Portfolio"}),o.jsx("span",{style:_,children:h?`$${p.toLocaleString(void 0,{maximumFractionDigits:2})}`:"—"})]}),m.length>0&&o.jsxs("div",{style:{...v,flex:1,minWidth:160},children:[o.jsx("span",{style:b,children:"Recent runs"}),o.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:3,height:24},"aria-hidden":!0,children:m.map((x,j)=>o.jsx("div",{title:`${x.label??"run"} · ${x.status}${x.ago?` · ${x.ago}`:""}`,style:{flex:1,maxWidth:10,height:x.status==="pending"?10:20,borderRadius:2,background:g(x.status)}},x.id??j))})]})]}),a&&o.jsxs("p",{style:{fontSize:11,color:"rgba(255,255,255,0.35)",margin:"8px 0 0"},children:["Portfolio updated ",ix(Date.now()-new Date(a).getTime())]})]})}function ei({title:e,kicker:t,children:n}){return o.jsxs("section",{className:Z.subsection,children:[o.jsxs("header",{className:Z.subsectionHead,children:[o.jsx("span",{className:Z.subsectionKicker,children:t}),o.jsx("h3",{className:Z.subsectionTitle,children:e})]}),n]})}function mpe({status:e,mandate:t,hasMpcWallet:n,lastRehearsalHoursAgo:r,rehearsing:a,onRehearse:c,managerEndpoint:l}){const u=gpe({status:e,hasMpcWallet:n,lastRehearsalHoursAgo:r}),d=r!=null&&r>24;return o.jsxs("div",{className:Z.readinessLine,children:[o.jsxs("div",{className:Z.readinessStatusRow,children:[o.jsx("span",{className:`${Z.readinessDot} ${Z[`readinessDot_${u.tone}`]}`,"aria-hidden":!0}),o.jsx("span",{className:Z.readinessLabel,children:u.headline}),u.detail&&o.jsx("span",{className:Z.readinessDetail,children:u.detail}),r!=null&&o.jsxs("button",{type:"button",className:`${Z.readinessRehearsal} ${d?Z.readinessRehearsalStaleBtn:""} ${a?Z.readinessRehearsalBusy:""}`,onClick:c,disabled:a,title:"Click to re-run the dry run — runs against a local chain fork. Live dispatch requires a rehearsal ≤ 24h old.","aria-label":"Re-run dry run on a chain fork",children:[o.jsx(vpe,{}),a?o.jsx(o.Fragment,{children:"Re-running dry run…"}):o.jsxs(o.Fragment,{children:["Dry run · ",ype(r),d&&o.jsx("span",{className:Z.readinessRehearsalStale,children:" · stale · re-run"})]})]})]}),o.jsxs("p",{className:Z.readinessAttribution,children:["Drafted in ",o.jsx("strong",{children:t.aiName}),". Runtime decisions come from your agent endpoint at ",o.jsx("code",{children:l.url})," — not from"," ",t.aiName,". Switching drafters doesn't change who runs the agent."]})]})}function gpe({status:e,hasMpcWallet:t,lastRehearsalHoursAgo:n}){return e==="revoked"?{headline:"Ended",detail:"parent mandate was revoked",tone:"muted"}:e==="expired"?{headline:"Expired",detail:"window closed",tone:"muted"}:e==="paused"?{headline:"Stopped",detail:"schedules disabled · resume any time",tone:"warn"}:t?n!=null&&n>24?{headline:"Dry run stale",detail:"rerun on a chain fork to resume live dispatch",tone:"warn"}:{headline:"Live · dispatching",detail:"schedules firing onchain",tone:"success"}:{headline:"Awaiting signer",detail:"delegated MPC wallet not yet bound",tone:"warn"}}function ype(e){if(e<1)return"just now";if(e<24)return`${Math.round(e)}h ago`;const t=Math.round(e/24);return t===1?"1 day ago":`${t} days ago`}function vpe(){return o.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M3 9.5c2-3.6 6-3.6 8 0"}),o.jsx("path",{d:"M5.5 7l-2.5 2.5L5.5 12"}),o.jsx("circle",{cx:"11",cy:"3.5",r:"1",fill:"currentColor"})]})}function bpe({networks:e}){return!e||e.length===0?null:o.jsx("span",{className:Z.chainChips,"aria-label":`Networks: ${e.map(cx).join(", ")}`,children:e.map(t=>o.jsxs("span",{className:Z.chainChip,children:[o.jsx("span",{className:`${Z.chainChipDot} ${Z[`netDot_${t}`]??""}`,"aria-hidden":!0}),o.jsx("span",{children:cx(t)})]},t))})}function wpe({run:e,open:t,onClose:n,chainId:r}){return I.useEffect(()=>{if(!t)return;const a=c=>{c.key==="Escape"&&(n==null||n())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,n]),o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`${Z.drawerScrim} ${t?Z.drawerScrimOpen:""}`,onClick:n,"aria-hidden":!0}),o.jsx("aside",{className:`${Z.drawer} ${t?Z.drawerOpen:""}`,role:"dialog","aria-modal":"true","aria-label":"Run detail",children:e&&o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:Z.drawerHead,children:[o.jsxs("div",{className:Z.drawerHeadLeft,children:[o.jsx("span",{className:Z.drawerKicker,children:"Execution"}),o.jsx("span",{className:Z.drawerTitle,children:e.id})]}),o.jsx("button",{type:"button",className:Z.drawerClose,onClick:n,"aria-label":"Close",children:"×"})]}),o.jsxs("div",{className:Z.drawerBody,children:[o.jsxs("dl",{className:Z.drawerGrid,children:[o.jsx(Xo,{k:"Status",v:o.jsx("span",{className:`${Z.drawerStatus} ${Z[`runStatus_${e.status}`]}`,children:e.status==="success"?"Success":e.status==="failed"?"Failed":"Pending"})}),o.jsx(Xo,{k:"Action",v:e.label}),o.jsx(Xo,{k:"Tx hash",v:o.jsxs("a",{className:Z.drawerLink,href:Ni(r,e.txHash)??void 0,target:"_blank",rel:"noreferrer",children:[Npe(e.txHash),o.jsx(vy,{})]})}),o.jsx(Xo,{k:"Block",v:e.block}),o.jsx(Xo,{k:"Gas",v:e.gas}),o.jsx(Xo,{k:"When",v:`${e.ts} · ${e.ago}`}),e.error&&o.jsx(Xo,{k:"Error",v:o.jsx("span",{className:Z.drawerError,children:e.error})})]}),o.jsxs("section",{className:Z.drawerSection,children:[o.jsx("h3",{className:Z.drawerSectionTitle,children:"Simulation"}),o.jsx("p",{className:Z.drawerNote,children:e.status==="failed"?"Simulation passed before broadcast. The revert was triggered onchain.":"Simulation matched the executed result exactly."})]}),o.jsxs("section",{className:Z.drawerSection,children:[o.jsx("h3",{className:Z.drawerSectionTitle,children:"Log"}),o.jsx("pre",{className:Z.drawerLog,children:e.log})]})]})]})})]})}function Xo({k:e,v:t}){return o.jsxs("div",{className:Z.drawerRow,children:[o.jsx("dt",{children:e}),o.jsx("dd",{children:t})]})}function _pe(e){return e.lastAction?{value:e.lastAction.ago,sub:e.lastAction.label}:{value:"—",sub:"No checks yet."}}function xpe(e,t){var u;if(t!=="active")return{value:"—",sub:t==="paused"?"Paused":"Not running"};const n=((u=e.lastAction)==null?void 0:u.ago)??"0h ago",r=Cpe(n),a=6;if(r==null)return{value:"~6h",sub:"Continuous · every 6h"};const c=Math.max(0,a-r);return{value:c<=0?"soon":`in ${c}h`,sub:"Continuous · every 6h"}}function Cpe(e){if(!e)return null;if(/just now/i.test(e))return 0;const t=e.match(/(\d+)\s*([mhd])/i);if(!t)return null;const n=Number(t[1]),r=t[2].toLowerCase();return r==="m"?n/60:r==="h"?n:r==="d"?n*24:null}function kpe(e){const t=e.duration??"",n=t.match(/Ends in (.+)/i);return n?{value:n[1],sub:"Auto-revokes at expiry."}:/^expired/i.test(t)?{value:"Expired",sub:t.replace(/^expired\s*/i,"")}:/^revoked/i.test(t)?{value:"Revoked",sub:t.replace(/^revoked\s*/i,"")}:{value:t||"—",sub:""}}function jpe(e){var N,E,B,M;if(!e)return{mpcWallet:{},runs:[],activity:[],schedule:{},erc8004:{},agentId:null,templateHash:"",policyHash:"",templateDeployed:!1,targets:[],receipt:{},pages:[],recommendation:{}};const t=Spe(e.id),n=t.toString(16).padStart(8,"0"),r=`0x${n}${(t*7).toString(16).padStart(8,"0")}${(t*11).toString(16).padStart(8,"0")}${n}`,a={address:Ape(r),gas:(.005+t%30/1e3).toFixed(4),threshold:"2-of-3",provenance:"sail-mpc-lab",keyShares:["operator-a","operator-b","paper-backup"]},c=8004e3+t%1e3,l={handle:`sail-agent#${a.address.slice(2,8)}`,url:`https://identity.erc8004.org/${a.address}`},u=e.status==="active"?{label:"Continuous · checks every 6h"}:{label:"Stopped"},d=((N=e.lastAction)==null?void 0:N.label)??"Mandate signed",p=e.status==="active"?[{id:"a1",label:d,ago:((E=e.lastAction)==null?void 0:E.ago)??"just now",kind:"exec"},{id:"a2",label:"Simulation passed before broadcast",ago:((B=e.lastAction)==null?void 0:B.ago)??"2h ago",kind:"sim"},{id:"a3",label:"Permission check ok",ago:"4h ago",kind:"check"},{id:"a4",label:"Gas balance refreshed",ago:"4h ago",kind:"sys"},{id:"a5",label:"Agent authorized",ago:"1d ago",kind:"auth"}]:[{id:"a1",label:e.status==="revoked"?"Agent revoked":"Agent expired",ago:((M=e.lastAction)==null?void 0:M.ago)??"—",kind:"auth"}],h=(e.actions??[]).slice(0,6).map((P,R)=>{var z;return{id:`run-${String(t%900+70+R).padStart(3,"0")}`,label:P.label,status:R===2&&e.status==="active"?"failed":"success",ago:["just now","2h ago","6h ago","1d ago","2d ago","4d ago"][R]??`${R+1}d ago`,ts:"2026-05-21 12:08 UTC",block:23481004-R*13,txHash:`0x${t.toString(16).padStart(4,"0").repeat(8).slice(0,60)}${R}`,gas:`$${(.08+R*.04).toFixed(2)}`,log:`[exec] ${P.label}
1777
1777
  [exec] target: ${P.venue??"protocol"}@${((z=P.networks)==null?void 0:z[0])??"arbitrum"}